Dobby 3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
AnonymousFile Class Reference

Public Member Functions

 AnonymousFile (int fd=-1)
 Constructor - called when content of already created volatile file matters.
 
int create ()
 Creates a volatile file that lives in RAM.
 
bool copyContentTo (const std::string &destFile)
 Copies content of volatile file from RAM to a disk.
 

Private Member Functions

long getFileSize (FILE *fp)
 Calculates file size for provided file pointer.
 

Private Attributes

int mFd
 

Constructor & Destructor Documentation

◆ AnonymousFile()

AnonymousFile::AnonymousFile ( int  fd = -1)
explicit

Constructor - called when content of already created volatile file matters.

Parameters
[in]fdfile descriptor to previously created volatile file

Member Function Documentation

◆ copyContentTo()

bool AnonymousFile::copyContentTo ( const std::string &  destFile)

Copies content of volatile file from RAM to a disk.

Parameters
[in]destFiledestination file path
Returns
True on success or false on failure

◆ create()

int AnonymousFile::create ( )

Creates a volatile file that lives in RAM.

Returns
File descriptor to a volatile file on success or -1 on failure

◆ getFileSize()

long AnonymousFile::getFileSize ( FILE *  fp)
private

Calculates file size for provided file pointer.

Please note that file position indicator is reset to begining

Parameters
[in]fpfile pointer for which size calculation will happen
Returns
File size

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