libStatGen Software 1
GlfFileWriter Class Reference
Inheritance diagram for GlfFileWriter:
Collaboration diagram for GlfFileWriter:

Public Member Functions

 GlfFileWriter ()
 Default Constructor. More...
 
 GlfFileWriter (const char *filename)
 Constructor that opens the specified file for write. More...
 
- Public Member Functions inherited from GlfFile
 GlfFile ()
 Default Constructor. More...
 
 GlfFile (const char *filename, OpenType mode=READ)
 Constructor that opens the specified file based on the specified mode (READ/WRITE). More...
 
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. More...
 
bool openForRead (const char *filename)
 Open a glf file for reading with the specified filename. More...
 
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. More...
 
bool openForWrite (const char *filename, bool compressed=true)
 Open a glf file for writing with the specified filename. More...
 
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. More...
 
bool isEOF ()
 Returns whether or not the end of the file has been reached. More...
 
bool readHeader (GlfHeader &header)
 Reads the header section from the file and stores it in the passed in header. More...
 
bool writeHeader (GlfHeader &header)
 Writes the specified header into the file. More...
 
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. More...
 
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. More...
 
bool getNextRecord (GlfRecord &record)
 Gets the nextrecord from the file & stores it in the passed in record. More...
 
bool writeRecord (const GlfRecord &record)
 Writes the specified record into the file. More...
 
uint32_t getCurrentRecordCount ()
 Return the number of records that have been read/written so far. More...
 
GlfStatus::Status getFailure ()
 Get the Status of the last call that sets status. More...
 
GlfStatus::Status getStatus ()
 Get the Status of the last call that sets status. More...
 
const char * getStatusMessage ()
 Get the Status of the last call that sets status. More...
 

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 188 of file GlfFile.h.

Constructor & Destructor Documentation

◆ GlfFileWriter() [1/2]

GlfFileWriter::GlfFileWriter ( )

Default Constructor.

Definition at line 546 of file GlfFile.cpp.

547{
548}

◆ GlfFileWriter() [2/2]

GlfFileWriter::GlfFileWriter ( const char *  filename)

Constructor that opens the specified file for write.

Parameters
filenamefile to open for writing.

Definition at line 552 of file GlfFile.cpp.

553{
554 if(!openForWrite(filename))
555 {
556 // Failed to open for reading - print error and abort.
557 fprintf(stderr, "%s\n", getStatusMessage());
558 std::cerr << "FAILURE - EXITING!!!" << std::endl;
559 exit(-1);
560 }
561}
const char * getStatusMessage()
Get the Status of the last call that sets status.
Definition: GlfFile.h:135
bool openForWrite(const char *filename, bool compressed=true)
Open a glf file for writing with the specified filename.
Definition: GlfFile.cpp:109

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

◆ ~GlfFileWriter()

GlfFileWriter::~GlfFileWriter ( )
virtual

Definition at line 564 of file GlfFile.cpp.

565{
566}

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