#include <File.h>
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 &) | |
File & | operator= (const File &) |
Private Attributes | |
int | h |
Definition at line 34 of file File.h.
adchpp::File::File | ( | const std::string & | aFileName, | |
int | access, | |||
int | mode = OPEN | |||
) | throw (FileException) |
adchpp::File::~File | ( | ) | [inline] |
adchpp::File::File | ( | const File & | ) | [private] |
void adchpp::File::close | ( | ) | [inline] |
static void adchpp::File::deleteFile | ( | const std::string & | aFileName | ) | [inline, static] |
void adchpp::File::ensureDirectory | ( | const std::string & | aFile | ) | throw () [static] |
Definition at line 170 of file File.cpp.
Referenced by adchpp::LogManager::dolog().
string adchpp::File::getFileName | ( | const std::string & | name | ) | throw () [static] |
string adchpp::File::getFilePath | ( | const std::string & | name | ) | throw () [static] |
int64_t adchpp::File::getSize | ( | const std::string & | aFileName | ) | [static] |
int64_t adchpp::File::getSize | ( | ) |
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().
std::string adchpp::File::makeAbsolutePath | ( | const std::string & | path, | |
const std::string & | filename | |||
) | [static] |
Definition at line 184 of file File.cpp.
References isAbsolutePath().
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().
std::string adchpp::File::read | ( | ) | throw (FileException) [inline] |
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().
string adchpp::File::read | ( | uint32_t | len | ) | throw (FileException) |
static void adchpp::File::renameFile | ( | const std::string & | source, | |
const std::string & | target | |||
) | [inline, static] |
void adchpp::File::setEndPos | ( | int64_t | pos | ) | [inline] |
Definition at line 135 of file File.h.
Referenced by adchpp::LogManager::dolog().
void adchpp::File::setEOF | ( | ) | throw (FileException) [inline] |
void adchpp::File::setPos | ( | int64_t | pos | ) | [inline] |
void adchpp::File::write | ( | const std::string & | aString | ) | throw (FileException) [inline] |
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().
int adchpp::File::h [private] |