CoinUtils 2.11.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
CoinPlainFileInput Class Reference

This reads plain text files. More...

#include <CoinFileIO.hpp>

+ Inheritance diagram for CoinPlainFileInput:
+ Collaboration diagram for CoinPlainFileInput:

Public Member Functions

 CoinPlainFileInput (const std::string &fileName)
 
 CoinPlainFileInput (FILE *fp)
 When already opened.
 
virtual ~CoinPlainFileInput ()
 
virtual int read (void *buffer, int size)
 Read a block of data from the file, similar to fread.
 
virtual char * gets (char *buffer, int size)
 Reads up to (size-1) characters an stores them into the buffer, similar to fgets.
 
- Public Member Functions inherited from CoinFileInput
 CoinFileInput (const std::string &fileName)
 Constructor (don't use this, use the create method instead).
 
virtual ~CoinFileInput ()
 Destructor.
 
- Public Member Functions inherited from CoinFileIOBase
 CoinFileIOBase (const std::string &fileName)
 Constructor.
 
 ~CoinFileIOBase ()
 Destructor.
 
const char * getFileName () const
 Return the name of the file used by this object.
 
std::string getReadType () const
 Return the method of reading being used.
 

Private Attributes

FILE * f_
 

Additional Inherited Members

- Static Public Member Functions inherited from CoinFileInput
static bool haveGzipSupport ()
 indicates whether CoinFileInput supports gzip'ed files
 
static bool haveBzip2Support ()
 indicates whether CoinFileInput supports bzip2'ed files
 
static CoinFileInput * create (const std::string &fileName)
 Factory method, that creates a CoinFileInput (more precisely a subclass of it) for the file specified.
 
- Protected Attributes inherited from CoinFileIOBase
std::string readType_
 

Detailed Description

This reads plain text files.

Definition at line 82 of file CoinFileIO.hpp.

Constructor & Destructor Documentation

◆ CoinPlainFileInput() [1/2]

CoinPlainFileInput::CoinPlainFileInput ( const std::string &  fileName)

◆ CoinPlainFileInput() [2/2]

CoinPlainFileInput::CoinPlainFileInput ( FILE *  fp)

When already opened.

◆ ~CoinPlainFileInput()

virtual CoinPlainFileInput::~CoinPlainFileInput ( )
virtual

Member Function Documentation

◆ read()

virtual int CoinPlainFileInput::read ( void *  buffer,
int  size 
)
virtual

Read a block of data from the file, similar to fread.

Parameters
bufferAddress of a buffer to store the data into.
sizeNumber of bytes to read (buffer should be large enough).
Returns
Number of bytes read.

Implements CoinFileInput.

◆ gets()

virtual char * CoinPlainFileInput::gets ( char *  buffer,
int  size 
)
virtual

Reads up to (size-1) characters an stores them into the buffer, similar to fgets.

Reading ends, when EOF or a newline occurs or (size-1) characters have been read. The resulting string is terminated with '\0'. If reading ends due to an encoutered newline, the '
' is put into the buffer, before the '\0' is appended.

Parameters
bufferThe buffer to put the string into.
sizeThe size of the buffer in characters.
Returns
buffer on success, or 0 if no characters have been read.

Implements CoinFileInput.

Member Data Documentation

◆ f_

FILE* CoinPlainFileInput::f_
private

Definition at line 94 of file CoinFileIO.hpp.


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