#include <ExCFile.h>
Inheritance diagram for ExCFile:

Public Methods | |
| ExCFile () | |
| ExCFile (string s) | |
| ExCFile (string s, int m) | |
| virtual | ~ExCFile () |
| bool | open (void) |
| bool | close (void) |
| void | setOpenMode (int) |
| ios_base::openmode | getOpenMode (int) |
| void | setFileName (string s) |
| std::string | getFileName (void) |
| bool | exist (void) |
| vector< std::string > | getContent (void) |
| bool | add (std::string) |
| bool | addLine (void) |
Protected Attributes | |
| string | filename |
| ios_base::openmode | mode |
|
|
Definition at line 88 of file ExCFile.h.
00088 {};
|
|
|
Definition at line 89 of file ExCFile.h. References filename.
00089 { filename = s; };
|
|
||||||||||||
|
Definition at line 90 of file ExCFile.h. References filename, and setOpenMode().
00090 { filename = s, setOpenMode (m); };
|
|
|
Definition at line 72 of file ExCFile.cpp.
00072 {
00073 }
|
|
|
Definition at line 48 of file ExCFile.cpp. References filename. Referenced by ExCOptions::create_options_file().
00048 {
00049 ofstream p;
00050 p.open (filename.data (), ios::app);
00051 if (p.fail ()) {
00052 std::cerr << "Erreur ouverture" << std::endl;
00053 return false;
00054 }
00055 p << f << std::endl;
00056 p.close ();
00057 return true;
00058 }
|
|
|
Definition at line 60 of file ExCFile.cpp. References filename. Referenced by ExCOptions::create_options_file().
00060 {
00061 ofstream p;
00062 p.open (filename.data (), ios::app);
00063 if (p.fail ()) {
00064 std::cerr << "Erreur ouverture" << std::endl;
00065 return false;
00066 }
00067 p << std::endl;
00068 p.close ();
00069 return true;
00070 }
|
|
|
|
|
|
Definition at line 75 of file ExCFile.cpp. References filename, getOpenMode(), and RO. Referenced by ExCOptions::init(), and ExManagerCommand::LoadCommandFile().
00075 {
00076 fstream file;
00077 file.open (filename.data(), getOpenMode (RO));
00078 if (! file.fail ()) {
00079 file.close();
00080 return true;
00081 }
00082 return false;
00083 }
|
|
|
Reimplemented in ExCFileReader. Definition at line 85 of file ExCFile.cpp. References filename, getOpenMode(), and RO. Referenced by ExCOptions::load().
00085 {
00086 string d;
00087 vector<string> v;
00088 fstream file;
00089 file.open (filename.data (), getOpenMode (RO));
00090 if (! file.fail ()) {
00091 while (! std::getline (file, d).eof ()) {
00092 v.push_back (d);
00093 }
00094 }
00095 file.close ();
00096 return v;
00097 }
|
|
|
Definition at line 98 of file ExCFile.h. References filename.
00098 { return filename; };
|
|
|
Definition at line 37 of file ExCFile.cpp. References RO, RW, RWA, WO, and WOA. Referenced by exist(), ExCFileReader::getContent(), getContent(), and ExCFileWriter::setContent().
00037 {
00038 switch (mode) {
00039 case RO: return ios::in; break;
00040 case WO: return ios::out; break;
00041 case WOA: return ios::out | ios::app; break;
00042 case RW: return ios::in | ios::out; break;
00043 case RWA: return ios::in | ios::out | ios::app; break;
00044 default: return ios::in; break;
00045 }
00046 }
|
|
|
|
|
|
Definition at line 97 of file ExCFile.h. References filename.
00097 { filename = s; };
|
|
|
Definition at line 26 of file ExCFile.cpp. References mode, RO, RW, RWA, WO, and WOA. Referenced by ExCFile(), ExCOptions::init(), and ExCOptions::load().
00026 {
00027 switch (mode) {
00028 case RO: this->mode = fstream::in; break;
00029 case WO: this->mode = fstream::out; break;
00030 case WOA: this->mode = fstream::out | fstream::app; break;
00031 case RW: this->mode = fstream::in | fstream::out; break;
00032 case RWA: this->mode = fstream::in | fstream::out | fstream::app; break;
00033 default: this->mode = fstream::in; break;
00034 }
00035 }
|
|
|
Definition at line 85 of file ExCFile.h. Referenced by add(), addLine(), ExCFile(), exist(), ExCFileReader::getContent(), getContent(), getFileName(), ExCFileWriter::setContent(), and setFileName(). |
|
|
Definition at line 86 of file ExCFile.h. Referenced by setOpenMode(). |
1.3-rc1