27 #ifndef FILE_TOKENIZER_HPP
28 #define FILE_TOKENIZER_HPP
30 #ifdef MSQ_USE_OLD_C_HEADERS
36 #include <sys/types.h>
bool get_boolean_internal(bool &result, MsqError &err)
Internal implementation of get_Booleans.
int line_number() const
Get the line number the last token was read from.
void unget_token()
Put current token back in buffer.
~FileTokenizer()
destructor : closes file.
bool get_float_internal(float &result, MsqError &err)
Internal implementation of get_floats.
char buffer[512]
Input buffer.
bool get_long_int_internal(long &result, MsqError &err)
Internal implementation of get_long_ints.
bool match_token(const char *string, MsqError &err)
Match current token to passed string.
Used to hold the error state and return it to the application.
bool get_newline(MsqError &err)
check for newline
bool get_floats(size_t count, float *array, MsqError &err)
Parse a sequence of float values.
bool get_short_ints(size_t count, short *array, MsqError &err)
Parse a sequence of integer values.
bool get_doubles(size_t count, double *array, MsqError &err)
Parse a sequence of double values.
const char * get_string(MsqError &err)
get next token
bool get_bytes(size_t count, unsigned char *array, MsqError &err)
Parse a sequence of integer values.
FileTokenizer(msq_stdc::FILE *file_ptr)
constructor
bool get_long_ints(size_t count, long *array, MsqError &err)
Parse a sequence of integer values.
bool get_short_int_internal(short &result, MsqError &err)
Internal implementation of get_short_ints.
char * bufferEnd
One past the last used byte of the buffer.
char * nextToken
One past the end of the last token returned.
bool get_double_internal(double &result, MsqError &err)
Internal implementation of get_doubles.
bool get_integer_internal(int &result, MsqError &err)
Internal implementation of get_integers.
bool get_booleans(size_t count, bool *array, MsqError &err)
Parse a sequence of bit or boolean values.
bool get_byte_internal(unsigned char &result, MsqError &err)
Internal implementation of get_bytes.
msq_stdc::FILE * filePtr
Pointer to standard C FILE struct.
bool get_integers(size_t count, int *array, MsqError &err)
Parse a sequence of integer values.
int lineNumber
Line number of last returned token.
char lastChar
The whitespace character marking the end of the last returned token.
bool eof() const
Check for end-of-file condition.
Parse a file as space-separated tokens.