adchpp::File Class Reference

#include <File.h>

Collaboration diagram for adchpp::File:
Collaboration graph
[legend]

List of all members.

Public Types

enum  { READ = 0x01, WRITE = 0x02 }
enum  { OPEN = 0x01, CREATE = 0x02, TRUNCATE = 0x04 }

Public Member Functions

void close ()
ADCHPP_DLL File (const std::string &aFileName, int access, int mode=OPEN) throw (FileException)
int64_t getPos ()
ADCHPP_DLL int64_t getSize ()
void movePos (int64_t pos)
std::string read () throw (FileException)
uint32_t read (void *buf, uint32_t len) throw (FileException)
ADCHPP_DLL std::string read (uint32_t len) throw (FileException)
void setEndPos (int64_t pos)
void setEOF () throw (FileException)
void setPos (int64_t pos)
void write (const std::string &aString) throw (FileException)
void write (const void *buf, uint32_t len) throw (FileException)
 ~File ()

Static Public Member Functions

static void deleteFile (const std::string &aFileName)
static ADCHPP_DLL void ensureDirectory (const std::string &aFile) throw ()
static ADCHPP_DLL std::string getFileName (const std::string &name) throw ()
 Returns the filename part of the full path.
static ADCHPP_DLL std::string getFilePath (const std::string &name) throw ()
 Returns the directory part of the full path.
static ADCHPP_DLL int64_t getSize (const std::string &aFileName)
static ADCHPP_DLL bool isAbsolutePath (const std::string &name) throw ()
static ADCHPP_DLL std::string makeAbsolutePath (const std::string &path, const std::string &filename)
static ADCHPP_DLL std::string makeAbsolutePath (const std::string &filename)
static void renameFile (const std::string &source, const std::string &target)

Private Member Functions

 File (const File &)
Fileoperator= (const File &)

Private Attributes

int h

Detailed Description

Definition at line 34 of file File.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
READ 
WRITE 

Definition at line 37 of file File.h.

anonymous enum
Enumerator:
OPEN 
CREATE 
TRUNCATE 

Definition at line 42 of file File.h.


Constructor & Destructor Documentation

adchpp::File::File ( const std::string &  aFileName,
int  access,
int  mode = OPEN 
) throw (FileException)

Definition at line 118 of file File.cpp.

References dcassert.

adchpp::File::~File (  )  [inline]

Definition at line 165 of file File.h.

References close().

Here is the call graph for this function:

adchpp::File::File ( const File  )  [private]

Member Function Documentation

void adchpp::File::close (  )  [inline]

Definition at line 125 of file File.h.

Referenced by ~File().

Here is the caller graph for this function:

static void adchpp::File::deleteFile ( const std::string &  aFileName  )  [inline, static]

Definition at line 160 of file File.h.

void adchpp::File::ensureDirectory ( const std::string &  aFile  )  throw () [static]

Definition at line 170 of file File.cpp.

Referenced by adchpp::LogManager::dolog().

Here is the caller graph for this function:

string adchpp::File::getFileName ( const std::string &  name  )  throw () [static]

Returns the filename part of the full path.

Definition at line 161 of file File.cpp.

string adchpp::File::getFilePath ( const std::string &  name  )  throw () [static]

Returns the directory part of the full path.

Definition at line 156 of file File.cpp.

int64_t adchpp::File::getPos (  )  [inline]

Definition at line 132 of file File.h.

int64_t adchpp::File::getSize ( const std::string &  aFileName  )  [static]

Definition at line 148 of file File.cpp.

int64_t adchpp::File::getSize (  ) 

Definition at line 140 of file File.cpp.

Referenced by read().

Here is the caller graph for this function:

bool adchpp::File::isAbsolutePath ( const std::string &  name  )  throw () [static]

Definition at line 166 of file File.cpp.

Referenced by adchpp::PluginManager::loadPlugin(), and makeAbsolutePath().

Here is the caller graph for this function:

std::string adchpp::File::makeAbsolutePath ( const std::string &  path,
const std::string &  filename 
) [static]

Definition at line 184 of file File.cpp.

References isAbsolutePath().

Here is the call graph for this function:

std::string adchpp::File::makeAbsolutePath ( const std::string &  filename  )  [static]

Definition at line 180 of file File.cpp.

References adchpp::Util::getAppPath(), and PATH_SEPARATOR.

Referenced by adchpp::LogManager::dolog().

Here is the call graph for this function:

Here is the caller graph for this function:

void adchpp::File::movePos ( int64_t  pos  )  [inline]

Definition at line 136 of file File.h.

File& adchpp::File::operator= ( const File  )  [private]
std::string adchpp::File::read (  )  throw (FileException) [inline]

Definition at line 169 of file File.h.

References getSize(), and setPos().

Referenced by read().

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t adchpp::File::read ( void *  buf,
uint32_t  len 
) throw (FileException) [inline]

Definition at line 138 of file File.h.

References read(), and adchpp::Util::translateError().

Here is the call graph for this function:

string adchpp::File::read ( uint32_t  len  )  throw (FileException)

Definition at line 27 of file File.cpp.

static void adchpp::File::renameFile ( const std::string &  source,
const std::string &  target 
) [inline, static]

Definition at line 161 of file File.h.

void adchpp::File::setEndPos ( int64_t  pos  )  [inline]

Definition at line 135 of file File.h.

Referenced by adchpp::LogManager::dolog().

Here is the caller graph for this function:

void adchpp::File::setEOF (  )  throw (FileException) [inline]
Todo:
fix for unix...

Definition at line 157 of file File.h.

void adchpp::File::setPos ( int64_t  pos  )  [inline]

Definition at line 134 of file File.h.

Referenced by read().

Here is the caller graph for this function:

void adchpp::File::write ( const std::string &  aString  )  throw (FileException) [inline]

Definition at line 174 of file File.h.

References write().

Here is the call graph for this function:

void adchpp::File::write ( const void *  buf,
uint32_t  len 
) throw (FileException) [inline]

Definition at line 145 of file File.h.

References adchpp::Util::translateError().

Referenced by adchpp::LogManager::dolog(), and write().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

int adchpp::File::h [private]

Definition at line 185 of file File.h.

Generated on Sat Nov 27 23:38:41 2010 for adchpp by  doxygen 1.6.3