#include <fileutl.h>
Public Types | |
enum | CompressMode { Auto = 'A', None = 'N', Extension = 'E', Gzip = 'G', Bzip2 = 'B', Lzma = 'L', Xz = 'X' } |
enum | OpenMode { ReadOnly = (1 << 0), WriteOnly = (1 << 1), ReadWrite = ReadOnly | WriteOnly, Create = (1 << 2), Exclusive = (1 << 3), Atomic = Exclusive | (1 << 4), Empty = (1 << 5), WriteEmpty = ReadWrite | Create | Empty, WriteExists = ReadWrite, WriteAny = ReadWrite | Create, WriteTemp = ReadWrite | Create | Exclusive, ReadOnlyGzip, WriteAtomic = ReadWrite | Create | Atomic } |
Public Member Functions | |
FileFd (std::string FileName, unsigned int const Mode, unsigned long Perms=0666) | |
FileFd (std::string FileName, unsigned int const Mode, CompressMode Compress, unsigned long Perms=0666) | |
FileFd () | |
FileFd (int const Fd, unsigned int const Mode=ReadWrite, CompressMode Compress=None) | |
FileFd (int const Fd, bool const AutoClose) | |
virtual | ~FileFd () |
bool | Close () |
bool | Eof () |
void | EraseOnFailure () |
bool | Failed () |
int | Fd () |
void | Fd (int fd) |
unsigned long long | FileSize () |
__deprecated gzFile | gzFd () |
bool | IsCompressed () |
bool | IsOpen () |
time_t | ModificationTime () |
std::string & | Name () |
bool | Open (std::string FileName, unsigned int const Mode, CompressMode Compress, unsigned long const Perms=0666) |
bool | Open (std::string FileName, unsigned int const Mode, APT::Configuration::Compressor const &compressor, unsigned long const Perms=0666) |
bool | Open (std::string const &FileName, unsigned int const Mode, unsigned long const Perms=0666) |
bool | OpenDescriptor (int Fd, unsigned int const Mode, CompressMode Compress, bool AutoClose=false) |
bool | OpenDescriptor (int Fd, unsigned int const Mode, APT::Configuration::Compressor const &compressor, bool AutoClose=false) |
bool | OpenDescriptor (int Fd, unsigned int const Mode, bool AutoClose=false) |
void | OpFail () |
bool | Read (void *To, unsigned long long Size, bool AllowEof) |
bool | Read (void *To, unsigned long long Size, unsigned long long *Actual=0) |
__deprecated bool | Read (void *To, unsigned long long Size, unsigned long *Actual) |
char * | ReadLine (char *To, unsigned long long const Size) |
bool | Seek (unsigned long long To) |
unsigned long long | Size () |
bool | Skip (unsigned long long To) |
bool | Sync () |
unsigned long long | Tell () |
bool | Truncate (unsigned long long To) |
bool | Write (const void *From, unsigned long long Size) |
Static Public Member Functions | |
static bool | Write (int Fd, const void *From, unsigned long long Size) |
Protected Types | |
enum | LocalFlags { AutoClose = (1<<0), Fail = (1<<1), DelOnFail = (1<<2), HitEof = (1<<3), Replace = (1<<4), Compressed = (1<<5) } |
Protected Attributes | |
std::string | FileName |
unsigned long | Flags |
int | iFd |
std::string | TemporaryFileName |
Private Member Functions | |
bool | OpenInternDescriptor (unsigned int const Mode, APT::Configuration::Compressor const &compressor) |
Private Attributes | |
FileFdPrivate * | d |
enum FileFd::CompressMode |
|
protected |
enum FileFd::OpenMode |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
virtual |
bool FileFd::Close | ( | ) |
|
inline |
References iFd.
|
inline |
unsigned long long FileFd::FileSize | ( | ) |
__deprecated gzFile FileFd::gzFd | ( | ) |
|
inline |
References Compressed, and Flags.
|
inline |
References iFd.
time_t FileFd::ModificationTime | ( | ) |
|
inline |
References FileName.
bool FileFd::Open | ( | std::string | FileName, |
unsigned int const | Mode, | ||
CompressMode | Compress, | ||
unsigned long const | Perms = 0666 |
||
) |
bool FileFd::Open | ( | std::string | FileName, |
unsigned int const | Mode, | ||
APT::Configuration::Compressor const & | compressor, | ||
unsigned long const | Perms = 0666 |
||
) |
|
inline |
bool FileFd::OpenDescriptor | ( | int | Fd, |
unsigned int const | Mode, | ||
CompressMode | Compress, | ||
bool | AutoClose = false |
||
) |
bool FileFd::OpenDescriptor | ( | int | Fd, |
unsigned int const | Mode, | ||
APT::Configuration::Compressor const & | compressor, | ||
bool | AutoClose = false |
||
) |
|
inline |
|
private |
|
inline |
bool FileFd::Read | ( | void * | To, |
unsigned long long | Size, | ||
unsigned long long * | Actual = 0 |
||
) |
|
inline |
char* FileFd::ReadLine | ( | char * | To, |
unsigned long long const | Size | ||
) |
bool FileFd::Seek | ( | unsigned long long | To | ) |
unsigned long long FileFd::Size | ( | ) |
bool FileFd::Skip | ( | unsigned long long | To | ) |
bool FileFd::Sync | ( | ) |
unsigned long long FileFd::Tell | ( | ) |
bool FileFd::Truncate | ( | unsigned long long | To | ) |
bool FileFd::Write | ( | const void * | From, |
unsigned long long | Size | ||
) |
|
static |
|
private |
|
protected |
Referenced by Name().
|
protected |
Referenced by Eof(), EraseOnFailure(), Failed(), IsCompressed(), and OpFail().
|
protected |