libStatGen Software 1
Loading...
Searching...
No Matches
GlfFileReader Class Reference
Inheritance diagram for GlfFileReader:
Collaboration diagram for GlfFileReader:

Public Member Functions

 GlfFileReader ()
 Default Constructor.
 
 GlfFileReader (const char *filename)
 Constructor that opens the specified file for read.
 
- Public Member Functions inherited from GlfFile
 GlfFile ()
 Default Constructor.
 
 GlfFile (const char *filename, OpenType mode=READ)
 Constructor that opens the specified file based on the specified mode (READ/WRITE).
 
virtual ~GlfFile ()
 Closes the file if there is one open, adding an end marker record if there is a previous section and one has not already been written.
 
bool openForRead (const char *filename)
 Open a glf file for reading with the specified filename.
 
bool openForRead (const char *filename, GlfHeader &header)
 Open a glf file for reading with the specified filename and read the header into the specified header.
 
bool openForWrite (const char *filename, bool compressed=true)
 Open a glf file for writing with the specified filename.
 
void close ()
 Close the file if there is one open, adding an end marker record if there is a previous section and one has not already been written.
 
bool isEOF ()
 Returns whether or not the end of the file has been reached.
 
bool readHeader (GlfHeader &header)
 Reads the header section from the file and stores it in the passed in header.
 
bool writeHeader (GlfHeader &header)
 Writes the specified header into the file.
 
bool getNextRefSection (GlfRefSection &refSection)
 Gets the next reference section from the file & stores it in the passed in section, consuming records until a new section is found.
 
bool writeRefSection (const GlfRefSection &refSection)
 Write the reference section to the file, adding an end marker record if there is a previous section and one has not already been written.
 
bool getNextRecord (GlfRecord &record)
 Gets the nextrecord from the file & stores it in the passed in record.
 
bool writeRecord (const GlfRecord &record)
 Writes the specified record into the file.
 
uint32_t getCurrentRecordCount ()
 Return the number of records that have been read/written so far.
 
GlfStatus::Status getFailure ()
 Get the Status of the last call that sets status.
 
GlfStatus::Status getStatus ()
 Get the Status of the last call that sets status.
 
const char * getStatusMessage ()
 Get the Status of the last call that sets status.
 

Additional Inherited Members

- Public Types inherited from GlfFile
enum  OpenType { READ , WRITE }
 Enum for indicating whether to open the file for read or write. More...
 

Detailed Description

Definition at line 173 of file GlfFile.h.

Constructor & Destructor Documentation

◆ GlfFileReader() [1/2]

GlfFileReader::GlfFileReader ( )

Default Constructor.

Definition at line 522 of file GlfFile.cpp.

523{
524}

◆ GlfFileReader() [2/2]

GlfFileReader::GlfFileReader ( const char *  filename)

Constructor that opens the specified file for read.

Parameters
filenamefile to open for reading.

Definition at line 528 of file GlfFile.cpp.

529{
530 if(!openForRead(filename))
531 {
532 // Failed to open for reading - print error and abort.
533 fprintf(stderr, "%s\n", getStatusMessage());
534 std::cerr << "FAILURE - EXITING!!!" << std::endl;
535 exit(-1);
536 }
537}
const char * getStatusMessage()
Get the Status of the last call that sets status.
Definition GlfFile.h:135
bool openForRead(const char *filename)
Open a glf file for reading with the specified filename.
Definition GlfFile.cpp:66

References GlfFile::getStatusMessage(), and GlfFile::openForRead().

◆ ~GlfFileReader()

GlfFileReader::~GlfFileReader ( )
virtual

Definition at line 540 of file GlfFile.cpp.

541{
542}

The documentation for this class was generated from the following files: