#include <filecls.h>
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 LFile * | MakeTemp (char *tpl) |
| static LFile * | Open (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 |
Definition at line 11 of file filecls.h.
| anonymous enum |
| LFile::LFile | ( | int | h | ) | [inline, protected] |
| LFile::LFile | ( | const char * | name, | |
| unsigned | attr, | |||
| mode_t | mode = 00644 | |||
| ) | [inline] |
| virtual LFile::~LFile | ( | ) | [inline, virtual] |
| 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] |
Definition at line 114 of file filecls.h.
References ASSERT, handle, and NULL.
Referenced by AUXFile::close(), LoadToString(), AUXFile::read(), Converter::readcn(), AUXFile::reopen(), and AUXFile::write().
| 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] |
| unsigned long LFile::Length | ( | ) | [inline] |
| int LFile::LoadToString | ( | const char * | fname, | |
| char *& | buffer, | |||
| int | size | |||
| ) | [static] |
Definition at line 52 of file filecls.cpp.
References Close(), FILE_BZ2, FILE_GZ, FILE_UNKNOWN, FileType(), int(), Length(), MAlloc(), NOR, NOTREACHED, NULL, O_Read, Open(), Read(), s, SeekFromBegin(), Unzip(), and YEL.
Referenced by Converter::readcn().
| static LFile* LFile::MakeTemp | ( | char * | tpl | ) | [inline, static] |
| 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] |
| 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] |
| int LFile::SeekRelatively | ( | int | gap | ) | [inline] |
| static int LFile::Stat | ( | const char * | name, | |
| struct stat * | buf = 0 | |||
| ) | [inline, static] |
| void LFile::Stat | ( | ) | [inline] |
| void LFile::SubHomeDir | ( | const char * | fname, | |
| char * | extname | |||
| ) | [static] |
Definition at line 98 of file filecls.cpp.
References INFO_Printf, and NULL.
Referenced by AUXFile::open(), EAMFrame::readeam(), FSParam::readfile(), MEAMFrame::readMEAM(), VaspBox::readoutcarstress(), MDFrame::runcommand(), IsingFrame::runcommand(), and VaspBox::writeZXCGR().
| static int LFile::Symlink | ( | const char * | oldpath, | |
| const char * | newpath | |||
| ) | [inline, static] |
| static int LFile::Unlink | ( | const char * | name | ) | [inline, static] |
| virtual int LFile::Write | ( | const char * | data, | |
| int | size | |||
| ) | [inline, virtual] |
| int LFile::handle |
struct stat LFile::m_stat [read, protected] |
1.5.7.1