Typedefs | Functions
File.hpp File Reference
#include <stdio.h>
#include <stdarg.h>
#include "String.hpp"
Include dependency graph for File.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef FILE * File
 *FILE* is a file I/O object.

Functions

unsigned int File__byte_read (File file)
 Read a byte from *file*.
void File__byte_write (File file, unsigned int byte)
 Write *byte* ot *file*.
int File__character_read (File in_file)
 Return the next character read from *in_file*.
void File__close (File file)
 Closes *file*.
double File__double_attribute_read (File in_file, String_Const attribute_name)
 Reads in an XML attribute with a floating point value.
float File__float_attribute_read (File in_file, String_Const attribute_name)
 Reads in an XML attribute with a floating point value.
void File__flush (File file)
 Flushes file content out of internal buffers.
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.
int File__integer_attribute_read (File in_file, String_Const attribute_name)
 Reads in an XML attribute with a integer value.
unsigned int File__little_endian_short_read (File)
 Read a little endian short (16-bits) from *file*.
void File__little_endian_short_write (File, unsigned int xshort)
 Write 16-bit *xshort* to *file* in little endian format.
File File__open (String_Const file_name, String_Const flags)
 will open *file_name* using *flags* to specify read/write options.
void File__string_match (File in_file, String_Const pattern)
 Exactly matches *pattern* read from *in_file*.
void File__tag_match (File in_file, String_Const tag_name)
 Matchs and "XML" start tag.

Typedef Documentation

typedef FILE* File

*FILE* is a file I/O object.

Definition at line 12 of file File.hpp.


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 Jun 6 2019 18:08:04