#include <DCFlogifstream.h>
Collaboration diagram for DCFlogifstream:

Public Member Functions | |
| DCFlogifstream (const string filenamebase) | |
| DCFlogifstream (const string filenamebase) | |
| int | getarg (const int narg, const string line, string arg) |
| int | getarg (const int narg, const string line, string arg) |
| int | nextDCF (string line) |
| int | nextDCF (string line) |
| int | nextUSR (string line) |
| int | nextUSR (string line) |
| void | resetDCF () |
| void | resetDCF () |
| void | resetUSR () |
| void | resetUSR () |
| ~DCFlogifstream () | |
| ~DCFlogifstream () | |
Private Attributes | |
| int | _dcfeof |
| int | _dcffilepos |
| string | _filenamelog |
| int | _filenotfound |
| ifstream * | _ifs |
| ifstream * | _ifs |
| int | _usreof |
| int | _usrfilepos |
|
|
Definition at line 26 of file DCFlogifstream.cpp. References _filenamelog, _filenotfound, _ifs, and dcflogfilename().
00027 : _dcffilepos(0), _dcfeof(0), _usrfilepos(0), _usreof(0) 00028 { 00029 dcflogfilename( filenamebase, _filenamelog ); 00030 _ifs = new ifstream( _filenamelog.c_str() ); 00031 (*_ifs).good() ? _filenotfound = 0 : _filenotfound = 1; 00032 }; |
|
|
Definition at line 34 of file DCFlogifstream.cpp. References _ifs.
00035 {
00036 delete _ifs;
00037 };
|
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
Definition at line 113 of file DCFlogifstream.cpp. References j.
00114 {
00115 int i = 0;
00116 int found = 0;
00117 int eol = 0;
00118 int iarg = 0;
00119
00120 int j;
00121 char c;
00122
00123 while ( found==0 && eol==0 ) {
00124 c = ' ';
00125
00126 while ( c == ' ' ) { c = line[i++]; }
00127
00128 arg="";
00129 while ( ( c != ' ' ) && ( i < line.size() ) ) {
00130 arg += c;
00131 c = line[i++];
00132 }
00133
00134 if ( i == line.size() ) eol = 1;
00135 if ( (++iarg) == narg ) found = 1;
00136 }
00137
00138 if ( found == 0 ) arg = "";
00139
00140 return !found;
00141
00142 };
|
|
|
|
|
|
Definition at line 39 of file DCFlogifstream.cpp. References _dcfeof, _dcffilepos, and _filenotfound.
00040 {
00041 if ( ( _filenotfound == 1 ) || ( _dcfeof == 1 ) ) return 1;
00042
00043 string tmpbuf="";
00044
00045 int found = 0;
00046 (*_ifs).seekg( _dcffilepos, ios::beg );
00047
00048 int i;
00049 char c;
00050
00051 while ( ( found == 0 ) && ( _dcfeof == 0 ) ) {
00052 c=' ';
00053 i=0;
00054 while ( ( c == ' ' ) && (*_ifs).good() ) { (*_ifs).get(c); }
00055 while ( ( c != ' ' ) && ( c != 10 ) && (*_ifs).good() ) {
00056 tmpbuf += c;
00057 (*_ifs).get(c);
00058 }
00059 if ( (*_ifs).eof() ) _dcfeof = 1;
00060 if ( tmpbuf == "DCF" ) found = 1;
00061 c=' ';
00062 i=0;
00063 while ( ( c == ' ' ) && (*_ifs).good() ) { (*_ifs).get(c); }
00064 while ( ( c != 10 ) && (*_ifs).good() ) {
00065 tmpbuf += c;
00066 (*_ifs).get(c);
00067 }
00068 }
00069
00070 if ( (*_ifs).eof() ) _dcfeof=1;
00071 line = tmpbuf;
00072 _dcffilepos = (*_ifs).tellg();
00073 (*_ifs).clear();
00074 return _dcfeof;
00075 };
|
|
|
|
|
|
Definition at line 77 of file DCFlogifstream.cpp. References _filenotfound, _usreof, and _usrfilepos.
00078 {
00079 if ( ( _filenotfound == 1 ) || ( _usreof == 1 ) ) return 1;
00080 string tmpbuf="";
00081 int found=0;
00082 (*_ifs).seekg( _usrfilepos, ios::beg );
00083
00084 int i;
00085 char c;
00086
00087 while ( ( found == 0 ) && ( _usreof == 0 ) ) {
00088 c=' ';
00089 i=0;
00090 while ( ( c == ' ' ) && (*_ifs).good() ) { (*_ifs).get(c); }
00091 while ( ( c != ' ' ) && ( c != 10 ) && (*_ifs).good() ) {
00092 tmpbuf += c;
00093 (*_ifs).get(c);
00094 }
00095 if ( (*_ifs).eof() ) _usreof = 1;
00096 if ( tmpbuf == "USR" ) found = 1;
00097 c = ' ';
00098 i = 0;
00099 while ( ( c == ' ' ) && (*_ifs).good() ) { (*_ifs).get(c); }
00100 while ( ( c != 10 ) && (*_ifs).good() ) {
00101 tmpbuf += c;
00102 (*_ifs).get(c);
00103 }
00104 }
00105
00106 if ( (*_ifs).eof() ) _usreof = 1;
00107 line = tmpbuf;
00108 _usrfilepos = (*_ifs).tellg();
00109 (*_ifs).clear();
00110 return _usreof;
00111 };
|
|
|
|
|
|
Definition at line 22 of file DCFlogifstream.h. References _dcfeof, and _dcffilepos.
00022 : _dcffilepos(0), _dcfeof(0) {} |
|
|
|
|
|
Definition at line 23 of file DCFlogifstream.h. References _usreof, and _usrfilepos.
00023 : _usrfilepos(0), _usreof(0) {} |
|
|
Definition at line 32 of file 2/DCFlogifstream.h. Referenced by nextDCF(), and resetDCF(). |
|
|
Definition at line 33 of file 2/DCFlogifstream.h. Referenced by nextDCF(), and resetDCF(). |
|
|
Definition at line 29 of file 2/DCFlogifstream.h. Referenced by DCFlogifstream(). |
|
|
Definition at line 31 of file 2/DCFlogifstream.h. Referenced by DCFlogifstream(), nextDCF(), and nextUSR(). |
|
|
Definition at line 30 of file 2/DCFlogifstream.h. |
|
|
Definition at line 30 of file DCFlogifstream.h. Referenced by DCFlogifstream(), and ~DCFlogifstream(). |
|
|
Definition at line 34 of file 2/DCFlogifstream.h. Referenced by nextUSR(), and resetUSR(). |
|
|
Definition at line 35 of file 2/DCFlogifstream.h. Referenced by nextUSR(), and resetUSR(). |
1.3.6