/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
util/folder/tempdir.h
43 строки
896 B
qkrorlqr
Initial NBS OpenSource export
28 апр 2023, 21:54
28 апр 2023, 21:54
783a858
Код
Авторство
О чём код?
#pragma once #include "fwd.h" #include "path.h" #include <util/generic/string.h> class TTempDir { public: /// Create new directory in system tmp folder. TTempDir(); /// Create new directory with this fixed name. If it already exists, clear it. TTempDir(const TString& tempDir); ~TTempDir(); /// Create new directory in given folder. static TTempDir NewTempDir(const TString& root); const TString& operator()() const { return Name(); } const TString& Name() const { return TempDir.GetPath(); } const TFsPath& Path() const { return TempDir; } void DoNotRemove(); private: struct TCreationToken {}; // Prevent people from confusing this ctor with the public one // by requiring additional fake argument. TTempDir(const char* prefix, TCreationToken); TFsPath TempDir; bool Remove; };