filesaver
filesaver::FileEntry Class Reference

File entry abstraction. More...

#include <FileEntry.h>

Public Member Functions

 FileEntry ()=default
 
 FileEntry (FileType _type, off_t _size, uintmax_t _dev, uintmax_t _ino, std::string _filename)
 
 FileEntry (FileType _type, off_t _size, uintmax_t _dev, uintmax_t _ino, boost::filesystem::path _filepath)
 
bool operator== (const FileEntry &rhs) const
 
bool operator!= (const FileEntry &rhs) const
 
bool isDirectory () const
 
bool getHasCachedChildren () const
 
void setCachedChildren (std::vector< boost::filesystem::path > cachedChildren)
 
const std::vector< boost::filesystem::path > & children ()
 

Static Public Member Functions

static std::shared_ptr< FileEntryfromPath (const boost::filesystem::path &filepath)
 

Public Attributes

uintmax_t dev = 0
 
uintmax_t ino = 0
 
FileType type = FileType::unknown
 
off_t size = 0
 
boost::filesystem::path filepath
 
bool isFinished = false
 

Detailed Description

File entry abstraction.

Wraps a file entry in an object, provide utility functions for reading this information from a path and cache child files in memory.

Definition at line 36 of file FileEntry.h.

Constructor & Destructor Documentation

◆ FileEntry() [1/3]

filesaver::FileEntry::FileEntry ( )
default

◆ FileEntry() [2/3]

filesaver::FileEntry::FileEntry ( FileType  _type,
off_t  _size,
uintmax_t  _dev,
uintmax_t  _ino,
std::string  _filename 
)

Definition at line 12 of file FileEntry.cpp.

◆ FileEntry() [3/3]

filesaver::FileEntry::FileEntry ( FileType  _type,
off_t  _size,
uintmax_t  _dev,
uintmax_t  _ino,
boost::filesystem::path  _filepath 
)

Definition at line 17 of file FileEntry.cpp.

Member Function Documentation

◆ children()

const std::vector< boost::filesystem::path > & filesaver::FileEntry::children ( )

Definition at line 22 of file FileEntry.cpp.

◆ fromPath()

std::shared_ptr< FileEntry > filesaver::FileEntry::fromPath ( const boost::filesystem::path &  filepath)
static

Definition at line 74 of file FileEntry.cpp.

◆ getHasCachedChildren()

bool filesaver::FileEntry::getHasCachedChildren ( ) const

Definition at line 136 of file FileEntry.cpp.

◆ isDirectory()

bool filesaver::FileEntry::isDirectory ( ) const

Definition at line 131 of file FileEntry.cpp.

◆ operator!=()

bool filesaver::FileEntry::operator!= ( const FileEntry rhs) const

Definition at line 126 of file FileEntry.cpp.

◆ operator==()

bool filesaver::FileEntry::operator== ( const FileEntry rhs) const

Definition at line 121 of file FileEntry.cpp.

◆ setCachedChildren()

void filesaver::FileEntry::setCachedChildren ( std::vector< boost::filesystem::path >  cachedChildren)

Definition at line 141 of file FileEntry.cpp.

Member Data Documentation

◆ dev

uintmax_t filesaver::FileEntry::dev = 0

Definition at line 39 of file FileEntry.h.

◆ filepath

boost::filesystem::path filesaver::FileEntry::filepath

Definition at line 44 of file FileEntry.h.

◆ ino

uintmax_t filesaver::FileEntry::ino = 0

Definition at line 40 of file FileEntry.h.

◆ isFinished

bool filesaver::FileEntry::isFinished = false

Definition at line 45 of file FileEntry.h.

◆ size

off_t filesaver::FileEntry::size = 0

Definition at line 43 of file FileEntry.h.

◆ type

FileType filesaver::FileEntry::type = FileType::unknown

Definition at line 42 of file FileEntry.h.


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