Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
fc::temp_file_base Class Reference

#include <filesystem.hpp>

Inheritance diagram for fc::temp_file_base:

Public Member Functions

 ~temp_file_base ()
 
 operator bool () const
 
bool operator! () const
 
const fc::pathpath () const
 
void remove ()
 
void release ()
 

Protected Types

typedef std::optional< fc::pathpath_t
 

Protected Member Functions

 temp_file_base (const path_t &path)
 
 temp_file_base (path_t &&path)
 

Protected Attributes

path_t _path
 

Detailed Description

Class which creates a temporary directory inside an existing temporary directory.

Definition at line 193 of file filesystem.hpp.

Member Typedef Documentation

◆ path_t

std::optional<fc::path> fc::temp_file_base::path_t
protected

Definition at line 203 of file filesystem.hpp.

Constructor & Destructor Documentation

◆ ~temp_file_base()

fc::temp_file_base::~temp_file_base ( )
inline

Definition at line 196 of file filesystem.hpp.

196{ remove(); }
Here is the call graph for this function:

◆ temp_file_base() [1/2]

fc::temp_file_base::temp_file_base ( const path_t & path)
inlineprotected

Definition at line 204 of file filesystem.hpp.

204: _path(path) {}
const fc::path & path() const

◆ temp_file_base() [2/2]

fc::temp_file_base::temp_file_base ( path_t && path)
inlineprotected

Definition at line 205 of file filesystem.hpp.

205: _path(std::move(path)) {}

Member Function Documentation

◆ operator bool()

fc::temp_file_base::operator bool ( ) const
inline

Definition at line 197 of file filesystem.hpp.

197{ return _path.has_value(); }

◆ operator!()

bool fc::temp_file_base::operator! ( ) const
inline

Definition at line 198 of file filesystem.hpp.

198{ return !_path.has_value(); }

◆ path()

const fc::path & fc::temp_file_base::path ( ) const

Definition at line 441 of file filesystem.cpp.

442 {
443 if (!_path)
444 {
445 FC_THROW( "Temporary directory has been released." );
446 }
447 return *_path;
448 }
#define FC_THROW( ...)
Here is the caller graph for this function:

◆ release()

void fc::temp_file_base::release ( )

Definition at line 466 of file filesystem.cpp.

467 {
468 _path = std::optional<fc::path>();
469 }
Here is the caller graph for this function:

◆ remove()

void fc::temp_file_base::remove ( )

Definition at line 450 of file filesystem.cpp.

451 {
452 if (_path)
453 {
454 try
455 {
457 }
458 catch (...)
459 {
460 // eat errors on cleanup
461 }
462 release();
463 }
464 }
void remove_all(const path &p)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _path

path_t fc::temp_file_base::_path
protected

Definition at line 206 of file filesystem.hpp.


The documentation for this class was generated from the following files: