libapt-pkg-dev  v0.9.7.5ubuntu5.4
Debian+Ubuntu APT Package Management
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FileFd Class Reference

#include <fileutl.h>

Collaboration diagram for FileFd:

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
 

Member Enumeration Documentation

Enumerator
Auto 
None 
Extension 
Gzip 
Bzip2 
Lzma 
Xz 
enum FileFd::LocalFlags
protected
Enumerator
AutoClose 
Fail 
DelOnFail 
HitEof 
Replace 
Compressed 
Enumerator
ReadOnly 
WriteOnly 
ReadWrite 
Create 
Exclusive 
Atomic 
Empty 
WriteEmpty 
WriteExists 
WriteAny 
WriteTemp 
ReadOnlyGzip 
WriteAtomic 

Constructor & Destructor Documentation

FileFd::FileFd ( std::string  FileName,
unsigned int const  Mode,
unsigned long  Perms = 0666 
)
inline

References None, and Open().

Here is the call graph for this function:

FileFd::FileFd ( std::string  FileName,
unsigned int const  Mode,
CompressMode  Compress,
unsigned long  Perms = 0666 
)
inline

References Open().

Here is the call graph for this function:

FileFd::FileFd ( )
inline
FileFd::FileFd ( int const  Fd,
unsigned int const  Mode = ReadWrite,
CompressMode  Compress = None 
)
inline

References OpenDescriptor().

Here is the call graph for this function:

FileFd::FileFd ( int const  Fd,
bool const  AutoClose 
)
inline

References None, OpenDescriptor(), and ReadWrite.

Here is the call graph for this function:

virtual FileFd::~FileFd ( )
virtual

Member Function Documentation

bool FileFd::Close ( )
bool FileFd::Eof ( )
inline

References Flags, and HitEof.

void FileFd::EraseOnFailure ( )
inline

References DelOnFail, and Flags.

bool FileFd::Failed ( )
inline

References Fail, and Flags.

int FileFd::Fd ( )
inline

References iFd.

void FileFd::Fd ( int  fd)
inline

References OpenDescriptor(), and ReadWrite.

Here is the call graph for this function:

unsigned long long FileFd::FileSize ( )
__deprecated gzFile FileFd::gzFd ( )
bool FileFd::IsCompressed ( )
inline

References Compressed, and Flags.

bool FileFd::IsOpen ( )
inline

References iFd.

time_t FileFd::ModificationTime ( )
std::string& FileFd::Name ( )
inline

References FileName.

bool FileFd::Open ( std::string  FileName,
unsigned int const  Mode,
CompressMode  Compress,
unsigned long const  Perms = 0666 
)

Referenced by FileFd(), and Open().

Here is the caller graph for this function:

bool FileFd::Open ( std::string  FileName,
unsigned int const  Mode,
APT::Configuration::Compressor const &  compressor,
unsigned long const  Perms = 0666 
)
bool FileFd::Open ( std::string const &  FileName,
unsigned int const  Mode,
unsigned long const  Perms = 0666 
)
inline

References None, and Open().

Here is the call graph for this function:

bool FileFd::OpenDescriptor ( int  Fd,
unsigned int const  Mode,
CompressMode  Compress,
bool  AutoClose = false 
)

Referenced by Fd(), FileFd(), and OpenDescriptor().

Here is the caller graph for this function:

bool FileFd::OpenDescriptor ( int  Fd,
unsigned int const  Mode,
APT::Configuration::Compressor const &  compressor,
bool  AutoClose = false 
)
bool FileFd::OpenDescriptor ( int  Fd,
unsigned int const  Mode,
bool  AutoClose = false 
)
inline

References AutoClose, None, and OpenDescriptor().

Here is the call graph for this function:

bool FileFd::OpenInternDescriptor ( unsigned int const  Mode,
APT::Configuration::Compressor const &  compressor 
)
private
void FileFd::OpFail ( )
inline

References Fail, and Flags.

bool FileFd::Read ( void *  To,
unsigned long long  Size,
bool  AllowEof 
)
inline

Referenced by Read().

Here is the caller graph for this function:

bool FileFd::Read ( void *  To,
unsigned long long  Size,
unsigned long long *  Actual = 0 
)
__deprecated bool FileFd::Read ( void *  To,
unsigned long long  Size,
unsigned long *  Actual 
)
inline

References Read().

Here is the call graph for this function:

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 bool FileFd::Write ( int  Fd,
const void *  From,
unsigned long long  Size 
)
static

Member Data Documentation

FileFdPrivate* FileFd::d
private
std::string FileFd::FileName
protected

Referenced by Name().

unsigned long FileFd::Flags
protected
int FileFd::iFd
protected

Referenced by Fd(), and IsOpen().

std::string FileFd::TemporaryFileName
protected

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