Loading base/file.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,8 @@ TemporaryDir::TemporaryDir() { } TemporaryDir::~TemporaryDir() { if (!remove_dir_and_contents_) return; auto callback = [](const char* child, const struct stat*, int file_type, struct FTW*) -> int { switch (file_type) { case FTW_D: Loading base/include/android-base/file.h +4 −0 Original line number Diff line number Diff line Loading @@ -61,12 +61,16 @@ class TemporaryDir { public: TemporaryDir(); ~TemporaryDir(); // Don't remove the temporary dir in the destructor. void DoNotRemove() { remove_dir_and_contents_ = false; } char path[1024]; private: bool init(const std::string& tmp_dir); bool remove_dir_and_contents_ = true; DISALLOW_COPY_AND_ASSIGN(TemporaryDir); }; Loading Loading
base/file.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,8 @@ TemporaryDir::TemporaryDir() { } TemporaryDir::~TemporaryDir() { if (!remove_dir_and_contents_) return; auto callback = [](const char* child, const struct stat*, int file_type, struct FTW*) -> int { switch (file_type) { case FTW_D: Loading
base/include/android-base/file.h +4 −0 Original line number Diff line number Diff line Loading @@ -61,12 +61,16 @@ class TemporaryDir { public: TemporaryDir(); ~TemporaryDir(); // Don't remove the temporary dir in the destructor. void DoNotRemove() { remove_dir_and_contents_ = false; } char path[1024]; private: bool init(const std::string& tmp_dir); bool remove_dir_and_contents_ = true; DISALLOW_COPY_AND_ASSIGN(TemporaryDir); }; Loading