FILE_TEXT Class Reference

Class for encoded text file read/write. More...

#include <mi32/filetext.h>

Inheritance diagram for FILE_TEXT:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 FILE_TEXT ()
virtual ~FILE_TEXT ()
void Close ()
INT64 GetApproxFilePos () const
bool IsOpen () const
ERRVALUE Open (const FILEPATH &filepath, FILE_ACCESS access=FILE_ACCESS_Read, CHAR_ENCODING encoding=CHAR_ENCODING_UTF8)

Private Member Functions

 FILE_TEXT (const FILE_TEXT &)
FILE_TEXToperator= (const FILE_TEXT &)
virtual
GENERICRW_TEXT::CAPABILITIES 
v_GetCapabilities ()
virtual INT64 v_GetSize () const
virtual INT64 v_Read (void *buf, INT32 numbytes, bool AllowPartial)
virtual INT64 v_Seek (INT64 offset, GENERICRW::SEEKFROM from=GENERICRW::SEEKFROM_Beginning)
virtual INT64 v_Tell () const
virtual ERRVALUE v_Write (const void *buffer, INT32 numbytes)

Detailed Description

Class for encoded text file read/write.

Designed for simple text line-by-line reading, full or partial text line writing, automatic handling of line terminations including CR, LF, CR/LF, and LF/CR with possibility of mixing within a single file, and character encoding conversion on read/write. It should not be used for binary or mixed text/binary files.

This class is not thread safe. Most of the time the instance is specific to a thread therefore the resource sharing issues are not involved. If this class is a shared resource, it is up to the user of the class to guard it using the appropriate locking method.


Constructor & Destructor Documentation

FILE_TEXT::FILE_TEXT (  ) 

Default constructor.

virtual FILE_TEXT::~FILE_TEXT (  )  [virtual]

Destructor, will close file if open.

FILE_TEXT::FILE_TEXT ( const FILE_TEXT  )  [private]

Member Function Documentation

void FILE_TEXT::Close (  ) 

Close file if presently open.

INT64 FILE_TEXT::GetApproxFilePos (  )  const

Get the approximate position of the file pointer. Use for updating status bars.

bool FILE_TEXT::IsOpen (  )  const

Determine if file is currently open.

ERRVALUE FILE_TEXT::Open ( const FILEPATH filepath,
FILE_ACCESS  access = FILE_ACCESS_Read,
CHAR_ENCODING  encoding = CHAR_ENCODING_UTF8 
)

Open specified file.

If file is already open the previous file will be closed.

Parameters:
filepath Path to file to be opened or created
access Desired access
encoding Encoding of file
FILE_TEXT& FILE_TEXT::operator= ( const FILE_TEXT  )  [private]
virtual GENERICRW_TEXT::CAPABILITIES FILE_TEXT::v_GetCapabilities (  )  [private, virtual]

Override to get capabilities.

Implements GENERICRW_TEXT.

virtual INT64 FILE_TEXT::v_GetSize (  )  const [private, virtual]

Override to get current size of data.

Implements GENERICRW_TEXT.

virtual INT64 FILE_TEXT::v_Read ( void *  buf,
INT32  numbytes,
bool  AllowPartial 
) [private, virtual]

Override to read a line of text.

Implements GENERICRW_TEXT.

virtual INT64 FILE_TEXT::v_Seek ( INT64  offset,
GENERICRW::SEEKFROM  from = GENERICRW::SEEKFROM_Beginning 
) [private, virtual]

Override to seek.

Implements GENERICRW_TEXT.

virtual INT64 FILE_TEXT::v_Tell (  )  const [private, virtual]

Override to return current position.

Implements GENERICRW_TEXT.

virtual ERRVALUE FILE_TEXT::v_Write ( const void *  buffer,
INT32  numbytes 
) [private, virtual]

Override to write data.

Implements GENERICRW_TEXT.


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

Generated on Sun Oct 7 21:33:22 2012 for TNTsdk 2012 by  doxygen 1.6.1