#include <Input.hpp>
Inheritance diagram for Input::

Public Methods | |
| Input () | |
| void | FillBuf () |
| char | OpenFile (char *filename) |
| char | ReadData (char *dest, int len) |
| void | GetChar (char *ptr) |
| void | ReadFullUInt32 (unsigned long *data) |
| void | ReadUInt32 (unsigned long *data) |
| void | PeekData (char *ptr, int len) |
| void | PeekChar (char *ptr) |
| void | SkipData (int len) |
| void | FastSkipData (int len) |
| void | SkipChar () |
| char | IsEndOfFile (unsigned len=0) |
| int | GetCurBlockPtr (char **ptr) |
| void | RefillAndGetCurBlockPtr (char **ptr, int *len) |
| void | UndoReadChar () |
|
|
Definition at line 64 of file Input.hpp. 00065 {
00066 curptr=endptr=NULL;
00067 curlineno=1;
00068 }
|
|
|
Definition at line 232 of file Input.hpp. 00234 {
00235 curptr+=len;
00236 }
|
|
|
Definition at line 70 of file Input.hpp. 00071 {
00072 int bytesread;
00073
00074 if(endptr-curptr>0)
00075 // Is there some unread data ?
00076 {
00077 memmove(databuf,curptr,endptr-curptr);
00078 endptr=databuf+(endptr-curptr);
00079 curptr=databuf;
00080 }
00081 else
00082 curptr=endptr=databuf;
00083
00084 // We try to fill the rest of the buffer
00085 bytesread=ReadBlock(endptr,databuf+FILEBUF_SIZE-endptr);
00086
00087 endptr+=bytesread;
00088 }
|
|
|
Reimplemented in FileParser. Definition at line 144 of file Input.hpp. 00146 {
00147 FillBufLen(1);
00148 *ptr=*curptr;
00149 if(*curptr=='\n')
00150 curlineno++;
00151 curptr++;
00152 }
|
|
|
|
|
|
Definition at line 247 of file Input.hpp. 00249 {
00250 return (curptr+len==endptr)&&(iseof);
00251 }
|
|
|
Reimplemented from CFile. Reimplemented in FileParser. Definition at line 90 of file Input.hpp. 00092 {
00093 if(CFile::OpenFile(filename)==0)
00094 return 0;
00095
00096 curptr=endptr=databuf;
00097
00098 FillBuf();
00099
00100 curlineno=1;
00101
00102 return 1;
00103 }
|
|
|
Definition at line 204 of file Input.hpp. 00209 {
00210 FillBufLen(1);
00211 *ptr=*curptr;
00212 }
|
|
||||||||||||
|
Definition at line 197 of file Input.hpp. 00199 {
00200 FillBufLen(len);
00201 mymemcpy(ptr,curptr,len);
00202 }
|
|
||||||||||||
|
Definition at line 105 of file Input.hpp. 00111 {
00112 int savelen=len;
00113
00114 while(endptr-curptr<len)
00115 {
00116 if(IsEndOfFile())
00117 return 1;
00118
00119 len-=endptr-curptr;
00120
00121 while(curptr<endptr)
00122 {
00123 *dest=*curptr;
00124 if(*curptr=='\n')
00125 curlineno++;
00126 dest++;
00127 curptr++;
00128 }
00129 FillBuf();
00130 }
00131
00132 while(len>0)
00133 {
00134 *dest=*curptr;
00135 if(*curptr=='\n')
00136 curlineno++;
00137 dest++;
00138 curptr++;
00139 len--;
00140 }
00141 return 0;
00142 }
|
|
|
Definition at line 156 of file Input.hpp. 00158 {
00159 FillBufLen(sizeof(unsigned long));
00160
00161 *data=*(unsigned long *)curptr;
00162 curptr+=4;
00163 }
|
|
|
Definition at line 165 of file Input.hpp. 00171 {
00172 FillBufLen(1);
00173
00174 if(*(unsigned char *)curptr<128)
00175 *data=(unsigned)(unsigned char)*(curptr++);
00176 else
00177 {
00178 if(*(unsigned char *)curptr<192)
00179 {
00180 FillBufLen(1);
00181 *data=(((unsigned)(unsigned char)*(curptr++)-128)<<8)+(unsigned)(unsigned char)*(curptr++);
00182 }
00183 else
00184 {
00185 FillBufLen(3);
00186
00187 *data= (((unsigned)(unsigned char)*(curptr++)-192)<<24)+
00188 (((unsigned)(unsigned char)*(curptr++))<<16)+
00189 (((unsigned)(unsigned char)*(curptr++))<<8)+
00190 (unsigned)(unsigned char)*(curptr++);
00191 }
00192 }
00193 }
|
|
||||||||||||
|
|
|
|
Reimplemented in FileParser. Definition at line 238 of file Input.hpp. 00240 {
00241 FillBufLen(1);
00242 if(*curptr=='\n')
00243 curlineno++;
00244 curptr++;
00245 }
|
|
|
Reimplemented in FileParser. |
|
|
Definition at line 271 of file Input.hpp. 00273 {
00274 curptr--;
00275 }
|
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001