LFile Class Reference

#include <filecls.h>

List of all members.

Public Types

enum  { SeekBegin = 0, SeekRel = 1, SeekEnd = 2 }
enum  {
  O_Read = O_RDONLY, O_Write = O_WRONLY, O_AccMode = O_ACCMODE, O_ReadWrite = O_RDWR,
  O_Create = O_CREAT, O_Exclusive = O_EXCL, O_Truncate = O_TRUNC, O_Append = O_APPEND,
  O_WriteNew = O_WRONLY|O_TRUNC|O_CREAT
}
enum  { FILE_UNKNOWN, FILE_GZ, FILE_BZ2 }

Public Member Functions

 LFile (const char *name, unsigned attr, mode_t mode=00644)
virtual ~LFile ()
virtual int Read (char *buffer, int size)
virtual int Write (const char *data, int size)
virtual int Seek (int gap, int mode)
int SeekFromBegin (int gap)
int SeekFromEnd (int gap)
int SeekRelatively (int gap)
void Stat ()
unsigned long Length ()
int FileType ()

Static Public Member Functions

static LFileMakeTemp (char *tpl)
static LFileOpen (const char *name, unsigned attr, mode_t mode=00644)
static void Close (LFile *&f)
static int Unlink (const char *name)
static int Rename (const char *oldname, const char *newname)
static int Symlink (const char *oldpath, const char *newpath)
static int Stat (const char *name, struct stat *buf=0)
static int LoadToString (const char *fname, char *&buffer, int size)
static void BZipFile (const char *fname, bool bg=false)
static void GZipFile (const char *fname, bool bg=false)
static void SubHomeDir (const char *fname, char *extname)

Public Attributes

int handle

Protected Member Functions

 LFile (int h)

Protected Attributes

struct stat m_stat


Detailed Description

Definition at line 11 of file filecls.h.


Member Enumeration Documentation

anonymous enum

Enumerator:
SeekBegin 
SeekRel 
SeekEnd 

Definition at line 18 of file filecls.h.

anonymous enum

Enumerator:
O_Read 
O_Write 
O_AccMode 
O_ReadWrite 
O_Create 
O_Exclusive 
O_Truncate 
O_Append 
O_WriteNew 

Definition at line 23 of file filecls.h.

anonymous enum

Enumerator:
FILE_UNKNOWN 
FILE_GZ 
FILE_BZ2 

Definition at line 35 of file filecls.h.


Constructor & Destructor Documentation

LFile::LFile ( int  h  )  [inline, protected]

Definition at line 44 of file filecls.h.

References handle, and m_stat.

Referenced by MakeTemp(), and Open().

LFile::LFile ( const char *  name,
unsigned  attr,
mode_t  mode = 00644 
) [inline]

Definition at line 53 of file filecls.h.

References handle, and Stat().

virtual LFile::~LFile (  )  [inline, virtual]

Definition at line 62 of file filecls.h.

References handle.


Member Function Documentation

void LFile::BZipFile ( const char *  fname,
bool  bg = false 
) [static]

Definition at line 30 of file filecls.cpp.

Referenced by AUXFile::close(), AUXFile::write(), and Converter::writepdb().

static void LFile::Close ( LFile *&  f  )  [inline, static]

int LFile::FileType (  ) 

Definition at line 5 of file filecls.cpp.

References FILE_BZ2, FILE_GZ, FILE_UNKNOWN, and Read().

Referenced by LoadToString().

void LFile::GZipFile ( const char *  fname,
bool  bg = false 
) [static]

Definition at line 41 of file filecls.cpp.

Referenced by AUXFile::close(), and AUXFile::write().

unsigned long LFile::Length (  )  [inline]

Definition at line 98 of file filecls.h.

References m_stat.

Referenced by LoadToString().

int LFile::LoadToString ( const char *  fname,
char *&  buffer,
int  size 
) [static]

static LFile* LFile::MakeTemp ( char *  tpl  )  [inline, static]

Definition at line 100 of file filecls.h.

References handle, LFile(), and NULL.

Referenced by Unzip().

static LFile* LFile::Open ( const char *  name,
unsigned  attr,
mode_t  mode = 00644 
) [inline, static]

Definition at line 107 of file filecls.h.

References handle, LFile(), and NULL.

Referenced by LoadToString(), AUXFile::open(), Converter::readcn(), and AUXFile::reopen().

virtual int LFile::Read ( char *  buffer,
int  size 
) [inline, virtual]

Definition at line 66 of file filecls.h.

References ASSERT, handle, and NULL.

Referenced by FileType(), and LoadToString().

static int LFile::Rename ( const char *  oldname,
const char *  newname 
) [inline, static]

Definition at line 127 of file filecls.h.

virtual int LFile::Seek ( int  gap,
int  mode 
) [inline, virtual]

Definition at line 79 of file filecls.h.

References handle.

Referenced by SeekFromBegin(), SeekFromEnd(), and SeekRelatively().

int LFile::SeekFromBegin ( int  gap  )  [inline]

Definition at line 82 of file filecls.h.

References Seek(), and SeekBegin.

Referenced by LoadToString().

int LFile::SeekFromEnd ( int  gap  )  [inline]

Definition at line 85 of file filecls.h.

References Seek(), and SeekEnd.

int LFile::SeekRelatively ( int  gap  )  [inline]

Definition at line 88 of file filecls.h.

References Seek(), and SeekRel.

static int LFile::Stat ( const char *  name,
struct stat *  buf = 0 
) [inline, static]

Definition at line 137 of file filecls.h.

void LFile::Stat (  )  [inline]

Definition at line 90 of file filecls.h.

References handle, and m_stat.

Referenced by LFile(), and Unzip().

void LFile::SubHomeDir ( const char *  fname,
char *  extname 
) [static]

static int LFile::Symlink ( const char *  oldpath,
const char *  newpath 
) [inline, static]

Definition at line 132 of file filecls.h.

static int LFile::Unlink ( const char *  name  )  [inline, static]

Definition at line 122 of file filecls.h.

Referenced by Unzip().

virtual int LFile::Write ( const char *  data,
int  size 
) [inline, virtual]

Definition at line 72 of file filecls.h.

References ASSERT, handle, and NULL.


Member Data Documentation

Definition at line 52 of file filecls.h.

Referenced by Close(), LFile(), MakeTemp(), Open(), Read(), Seek(), Stat(), Write(), and ~LFile().

struct stat LFile::m_stat [read, protected]

Definition at line 42 of file filecls.h.

Referenced by Length(), LFile(), and Stat().


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

Generated on Tue Oct 28 15:21:19 2008 for MD++ by  doxygen 1.5.7.1