#include <assert.h>
#include <ctype.h>
#include "File.hpp"
#include "String.hpp"
Go to the source code of this file.
|
unsigned int | File__byte_read (File file) |
| Read a byte from file. More...
|
|
void | File__byte_write (File file, unsigned int byte) |
| Write byte ot file. More...
|
|
int | File__character_read (File in_file) |
| Return the next character read from in_file. More...
|
|
void | File__close (File file) |
| Closes file. More...
|
|
double | File__double_attribute_read (File in_file, String_Const attribute_name) |
| Reads in an XML attribute with a floating point value. More...
|
|
float | File__float_attribute_read (File in_file, String_Const attribute_name) |
| Reads in an XML attribute with a floating point value. More...
|
|
void | File__flush (File file) |
| Flushes file content out of internal buffers. More...
|
|
void | File__format (File file, String_Const format,...) |
| will write format out to file with all patterns that start with "%" replaced by formatted versions of its arguments. More...
|
|
int | File__integer_attribute_read (File in_file, String_Const attribute_name) |
| Reads in an XML attribute with a integer value. More...
|
|
unsigned int | File__little_endian_short_read (File file) |
| Read a little endian short (16-bits) from file. More...
|
|
void | File__little_endian_short_write (File file, unsigned int xshort) |
| Write 16-bit xshort to file in little endian format. More...
|
|
File | File__open (String_Const file_name, String_Const flags) |
| will open file_name using flags to specify read/write options. More...
|
|
void | File__string_match (File in_file, String_Const pattern) |
| Exactly matches pattern read from in_file. More...
|
|
void | File__tag_match (File in_file, String_Const tag_name) |
| Matchs and "XML" start tag. More...
|
|
unsigned int File__byte_read |
( |
File |
file | ) |
|
Read a byte from file.
- Parameters
-
- Returns
- byte read from file.
File__byte_read() will read a byte from file and return it.
Definition at line 17 of file File.cpp.
void File__byte_write |
( |
File |
file, |
|
|
unsigned int |
byte |
|
) |
| |
Write byte ot file.
- Parameters
-
file | to read from. |
byte | to write out. |
File__byte_write() will write byte to file.
Definition at line 29 of file File.cpp.
int File__character_read |
( |
File |
in_file | ) |
|
Return the next character read from in_file.
- Parameters
-
- Returns
- character read from in_file.
File__character_read() will read in and return the next character from in_file. (char)(-1) is returned when an end of file condition is encountered on in_file.
Definition at line 41 of file File.cpp.
void File__close |
( |
File |
file | ) |
|
Closes file.
- Parameters
-
File__close() will close file.
Definition at line 50 of file File.cpp.
double File__double_attribute_read |
( |
File |
in_file, |
|
|
String_Const |
attribute_name |
|
) |
| |
Reads in an XML attribute with a floating point value.
- Parameters
-
in_file | is the input file to read from. |
attribute_name | is the attribute name. |
- Returns
- the floating point value.
File__double_attribute_read() will read in a pattern that matches ' ATTRIBUTE_NAME="VALUE"', where ATTRIBUTE_NAME matches attribute_name and VALUE is an optionally signed floating point number. This is used for parsing "XML" file input. "XML" is in quotes is because this is really not a very robust XML parser. An assertion failure occurs if the input does not parse properly.
Definition at line 66 of file File.cpp.
Reads in an XML attribute with a floating point value.
- Parameters
-
in_file | is the input file to read from. |
attribute_name | is the attribute name. |
- Returns
- the floating point value.
File__float_attribute_read() will read in a pattern that matches ' ATTRIBUTE_NAME="VALUE"', where ATTRIBUTE_NAME matches attribute_name and VALUE is an optionally signed floating point number. This is used for parsing "XML" file input. "XML" is in quotes is because this is really not a very robust XML parser. An assertion failure occurs if the input does not parse properly.
Definition at line 128 of file File.cpp.
void File__flush |
( |
File |
file | ) |
|
Flushes file content out of internal buffers.
- Parameters
-
File__flush() will flush out the internal buffers of out_file.
Definition at line 166 of file File.cpp.
will write format out to file with all patterns that start with "%" replaced by formatted versions of its arguments.
- Parameters
-
file | to output to. |
format | is the formatting string. |
File__format() will write format out to file with all patterns that start with "%" replaced by formatted versions of its arguments.
Definition at line 107 of file File.cpp.
Reads in an XML attribute with a integer value.
- Parameters
-
in_file | is the input file to read from. |
attribute_name | is the attribute name. |
- Returns
- the floating point value.
File__integer_attribute_read() will read in a pattern that matches ' ATTRIBUTE_NAME="VALUE"', where ATTRIBUTE_NAME matches attribute_name and VALUE is an optionally signed integer number. This is used for parsing "XML" file input. "XML" is in quotes is because this is really not a very robust XML parser. An assertion failure occurs if the input does not parse properly.
Definition at line 183 of file File.cpp.
unsigned int File__little_endian_short_read |
( |
File |
file | ) |
|
Read a little endian short (16-bits) from file.
- Parameters
-
- Returns
- 16-bit value from file.
File__little_endian_short_read() will read a 16-bit unsigned integer from file and return it.
Definition at line 215 of file File.cpp.
void File__little_endian_short_write |
( |
File |
file, |
|
|
unsigned int |
xshort |
|
) |
| |
Write 16-bit xshort to file in little endian format.
- Parameters
-
file | to write. |
xshort | to write. |
File__little_endian_short_write() will write write xshort to file as a little endian 16-bit unsigned integer.
Definition at line 231 of file File.cpp.
will open file_name using flags to specify read/write options.
- Parameters
-
file_name | is the file name to open. |
flags | specify the read/write options. |
File__open() will open file_name using flags to read/write options. An open File object is returned or (*File)0 if the open failed.
Definition at line 243 of file File.cpp.
Exactly matches pattern read from in_file.
- Parameters
-
in_file | to read from. |
pattern | to matach. |
File__string_match() will read characters from in_file that must exactly match pattern. An assertion failure occurs if pattern does not match exactly.
Definition at line 255 of file File.cpp.
Matchs and "XML" start tag.
- Parameters
-
in_file | is the file to read from. |
tag_name | is the name of the tat to match. |
File__tag_match() parse "WHITESPACE<TAG" where WHTITESPACE is zero or more spaces and TAG matches tag_name. An assertion failure occurs the pattern does not parse properly. This is not a very robust XML parser.
Definition at line 272 of file File.cpp.