Public Methods |
| File () |
| creates non valid file. More...
|
| File (std::string name, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out, bool nocreate=false, bool real=true) |
| File (const File &file) |
| copy constructur. More...
|
| ~File () |
void | open (std::string name, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out, bool nocreate=false, bool real=true) |
bool | is_valid () const |
bool | operator! () const |
std::string | get_name () const |
template<class T> File & | operator<< (const T t) |
template<class T> File & | operator>> (T &t) |
void | seekg (long pos) |
long | tellg () |
void | seekp (long pos) |
long | tellp () |
int | eof () |
std::iostream & | get_io () |
| returns the iostream of the stream. More...
|
void | operator= (const File &file) |
std::ios_base::openmode | get_mode () const |
int | get_line () const |
void | set_line (int line) |
void | operator++ () |
| increase the line number. More...
|
void | operator-- () |
| decrease the line number. More...
|
std::ostream & | flush () |
std::ostream & | put (char c) |
std::ostream & | write (std::string str) |
std::ostream & | write (std::string str, std::streamsize n) |
std::istream & | get (char &c) |
std::istream & | read (char *ptr, std::streamsize n) |
void | clear () |
void | trunc () |
| truncate the file. More...
|
bool | append (File other) |
| append and other file to this file. More...
|
void | stats (File other) |
void | stats (std::ostream &out) |
void | dump (File other) |
void | dump (std::ostream &out) |
Static Public Methods |
bool | use_handler () |
| use the file handler? More...
|
void | use_handler (bool u) |
bool | use_tmp_files () |
| use temporary files? More...
|
void | use_tmp_files (bool u) |
bool | fh_has_file (std::string name) |
| check the file handler if the file already is registerd. More...
|
Private Methods |
void | set_mode (std::ios_base::openmode mode) |
Private Attributes |
stream * | s |
| the stream. More...
|
bool | valid |
bool | real |
| true if the file is a real file. More...
|
std::string | init_name |
| if s == 0 it uses this backup name. More...
|
bool | nocreate |
| if true, no file will be created, if it does not exist. More...
|
Static Private Attributes |
bool | use_mem = true |
| use the file handler (default true). More...
|
bool | use_tmp = false |
| use temporary files (default false). More...
|
file_handler | fh |
| the global file handler. More...
|
The class can access real files or virtual files that are mapped into the memory. At creation time you can specify if this file has to be exist really. The heart of the File class are the stream classes. The class is using reference counting for easy handling the Files.