#include <iostream>#include <iomanip>#include <ctype.h>#include <stdio.h>#include "abkstring.h"#include "abkassert.h"#include "abkio.h"Include dependency graph for abkio.cxx:

Go to the source code of this file.
Defines | |
| #define | eh eathash |
Functions | |
| istream & | eatblank (istream &i) |
| istream & | skiptoeol (istream &i) |
| istream & | impl_eathash (istream &i, int &lineNo) |
| istream & | impl_needeol (istream &i, int lineNo=-1) |
| istream & | impl_noeol (istream &i, int lineNo=-1) |
| istream & | impl_isnumber (istream &i, int lineNo=-1) |
| istream & | impl_isword (istream &i, int lineNo=-1) |
| istream & | impl_needword (istream &in, const char *word, int lineNo=-1) |
| istream & | impl_needcaseword (istream &in, const char *word, int lineNo=-1) |
| ManipFuncObj2< const char *, int > | needword (const char *word, int lineNo) |
| ManipFuncObj2< const char *, int > | needcaseword (const char *word, int lineNo) |
| ManipFuncObj1< int & > | eathash (int &lineNo) |
| ManipFuncObj1< int > | needeol (int lineNo) |
| ManipFuncObj1< int > | noeol (int lineNo) |
| ManipFuncObj1< int > | my_isnumber (int lineNo) |
| ManipFuncObj1< int > | isword (int lineNo) |
|
|
|
|
|
Definition at line 65 of file abkio.cxx. Referenced by impl_eathash(), impl_isnumber(), impl_isword(), impl_needcaseword(), impl_needeol(), impl_needword(), and impl_noeol().
00066 {
00067 while (i.peek()==' ' || i.peek()=='\t') i.get();
00068 return i;
00069 }
|
|
|
Definition at line 202 of file abkio.cxx.
00203 { return ManipFuncObj1<int&>(impl_eathash, lineNo); }
|
|
||||||||||||
|
Definition at line 81 of file abkio.cxx. References eatblank(). Referenced by eathash().
00082 {
00083 bool noLineNo=(lineNo==-1);
00084 i >> eatblank;
00085 while (i.peek() == '\n' || i.peek() == '\r')
00086 {
00087 lineNo++; i.get();
00088 i >> eatblank;
00089 }
00090 // if (i.peek()!='#' && i.peek()!='\n') {i.putback('\n'); }
00091 while (i.peek()=='#')
00092 {
00093 while (!i.eof() && i.peek()!='\n' && i.peek()!='\r') i.get();
00094 while (!i.eof() && (i.peek()=='\n' || i.peek()=='\r'))
00095 { i.get(); i >> eatblank; lineNo++;}
00096 }
00097 while (i.peek() == '\n' || i.peek() == '\r')
00098 {
00099 lineNo++;
00100 i.get();
00101 i >> eatblank;
00102 }
00103 // if (i.peek()!='#' && i.peek()!='\n') {i.putback('\n'); }
00104 // if (i.peek() == '\n') { i.get(); lineNo++; }
00105 if (noLineNo) lineNo=-1;
00106 return i;
00107 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 139 of file abkio.cxx. References abkfatal2, and eatblank(). Referenced by my_isnumber().
00140 {
00141 i >> eatblank;
00142 char errMess[255];
00143 char c=i.peek();
00144 if (lineNo>0) sprintf(errMess," near line %d, but starts with %c ",lineNo,c);
00145 else sprintf(errMess,", but starts with %c ",c);
00146 abkfatal2(isdigit(i.peek()) || i.peek()=='-', " Number expected",errMess);
00147 return i;
00148 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 150 of file abkio.cxx. References abkfatal2, and eatblank(). Referenced by isword().
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 178 of file abkio.cxx. References abkfatal, abkfatal2, and eatblank(). Referenced by needcaseword().
00179 {
00180 char buffer[1024], errMess[255]; // still no way to avoid buffer overflow !
00181 in >> eatblank;
00182 in >> buffer;
00183 if (lineNo>0)
00184 {
00185 sprintf(errMess," '%s' expected near line %d. Got %s ",word,lineNo, buffer);
00186 abkfatal2(strcasecmp(buffer,word)==0,errMess,lineNo);
00187 }
00188 else
00189 {
00190 sprintf(errMess," '%s' expected. Got %s ",word, buffer);
00191 abkfatal(strcasecmp(buffer,word)==0,errMess);
00192 }
00193 return in;
00194 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 109 of file abkio.cxx. References abkfatal, abkfatal2, and eatblank(). Referenced by needeol().
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 161 of file abkio.cxx. References abkfatal, and eatblank(). Referenced by needword().
00162 {
00163 char buffer[1024], errMess[255]; // still no way to avoid buffer overflow !
00164 in >> eatblank >> buffer;
00165 if (lineNo>0)
00166 {
00167 sprintf(errMess," '%s' expected near line %d . Got %s ",word,lineNo,buffer);
00168 abkfatal(strcmp(buffer,word)==0,errMess);
00169 }
00170 else
00171 {
00172 sprintf(errMess," '%s' expected. Got %s ",word, buffer);
00173 abkfatal(strcmp(buffer,word)==0,errMess);
00174 }
00175 return in;
00176 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 124 of file abkio.cxx. References abkfatal, abkfatal2, and eatblank(). Referenced by noeol().
|
Here is the call graph for this function:

|
|
Definition at line 214 of file abkio.cxx. References impl_isword().
00215 { return ManipFuncObj1<int>(impl_isword, lineNo); }
|
Here is the call graph for this function:

|
|
Definition at line 211 of file abkio.cxx. References impl_isnumber().
00212 { return ManipFuncObj1<int>(impl_isnumber,lineNo); }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 199 of file abkio.cxx. References impl_needcaseword().
00200 { return ManipFuncObj2<const char *, int>(impl_needcaseword,word,lineNo); }
|
Here is the call graph for this function:

|
|
Definition at line 205 of file abkio.cxx. References impl_needeol().
00206 { return ManipFuncObj1<int>(impl_needeol, lineNo); }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 196 of file abkio.cxx. References impl_needword().
00197 { return ManipFuncObj2<const char *,int>(impl_needword,word, lineNo); }
|
Here is the call graph for this function:

|
|
Definition at line 208 of file abkio.cxx. References impl_noeol().
00209 { return ManipFuncObj1<int>(impl_noeol,lineNo); }
|
Here is the call graph for this function:

|
|
Definition at line 71 of file abkio.cxx.
00072 {
00073 while (!i.eof() && i.peek()!='\n' && i.peek()!='\r') i.get();
00074 //if (i.peek() == '\n' || i.peek() == '\r') i.get();
00075 return i;
00076 }
|
1.3.2