Functions
File.cpp File Reference
#include <assert.h>
#include <ctype.h>
#include "File.hpp"
#include "String.hpp"
Include dependency graph for File.cpp:

Go to the source code of this file.

Functions

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...
 

Function Documentation

unsigned int File__byte_read ( File  file)

Read a byte from file.

Parameters
fileto read from.
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
fileto read from.
byteto 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
in_fileto read from.
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
fileto close.

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_fileis the input file to read from.
attribute_nameis 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.

float File__float_attribute_read ( File  in_file,
String_Const  attribute_name 
)

Reads in an XML attribute with a floating point value.

Parameters
in_fileis the input file to read from.
attribute_nameis 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
fileto flush.

File__flush() will flush out the internal buffers of out_file.

Definition at line 166 of file File.cpp.

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.

Parameters
fileto output to.
formatis 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.

int File__integer_attribute_read ( File  in_file,
String_Const  attribute_name 
)

Reads in an XML attribute with a integer value.

Parameters
in_fileis the input file to read from.
attribute_nameis 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
fileto read from.
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
fileto write.
xshortto 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.

File File__open ( String_Const  file_name,
String_Const  flags 
)

will open file_name using flags to specify read/write options.

Parameters
file_nameis the file name to open.
flagsspecify 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.

void File__string_match ( File  in_file,
String_Const  pattern 
)

Exactly matches pattern read from in_file.

Parameters
in_fileto read from.
patternto 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.

void File__tag_match ( File  in_file,
String_Const  tag_name 
)

Matchs and "XML" start tag.

Parameters
in_fileis the file to read from.
tag_nameis 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.



fiducial_lib
Author(s): Wayne Gramlich
autogenerated on Thu Dec 28 2017 04:06:53