# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::COFile Class Reference

Output File. More...

#include <file.h>

Inheritance diagram for NLMISC::COFile:

NLMISC::IStream List of all members.

Public Methods

 COFile ()
 Object. NB: destructor close() the stream. More...

 COFile (const std::string &path, bool append=false, bool text=false)
 ~COFile ()
bool open (const std::string &path, bool append=false, bool text=false)
 Open a file for writing. false if failed. close() if a file was opened. More...

void close ()
 Explicit close. More...

void flush ()
 flush the file. More...

bool seek (sint32 offset, IStream::TSeekOrigin origin) throw (EStream)
 Seek the file. More...

sint32 getPos () throw (EStream)
 Gt the location of the file pointer. More...

virtual std::string getStreamName () const
 Get a name for this stream. More...

virtual void serialBuffer (uint8 *buf, uint len) throw (EWriteError)
 Method to be specified by the Deriver. More...


Protected Methods

virtual void serialBit (bool &bit) throw (EWriteError)

Private Attributes

FILE * _F
std::string _FileName

Detailed Description

Output File.

Author:
Lionel Berenguier , Nevrax France
Date:
2000

Definition at line 156 of file file.h.


Constructor & Destructor Documentation

NLMISC::COFile::COFile  
 

Object. NB: destructor close() the stream.

Definition at line 407 of file file.cpp.

References _F, and _FileName.

NLMISC::COFile::COFile const std::string &    path,
bool    append = false,
bool    text = false
 

Definition at line 414 of file file.cpp.

References _F, and open.

NLMISC::COFile::~COFile  
 

Definition at line 421 of file file.cpp.

References close.


Member Function Documentation

void NLMISC::COFile::close  
 

Explicit close.

Definition at line 445 of file file.cpp.

References _F, and NLMISC::IStream::resetPtrTable.

Referenced by loadForm, open, and ~COFile.

void NLMISC::COFile::flush  
 

flush the file.

Definition at line 455 of file file.cpp.

References _F.

sint32 NLMISC::COFile::getPos   throw (EStream) [virtual]
 

Gt the location of the file pointer.

Reimplemented from NLMISC::IStream.

Definition at line 507 of file file.cpp.

std::string NLMISC::COFile::getStreamName   const [virtual]
 

Get a name for this stream.

maybe a fileName if FileStream. Default is to return "".

Reimplemented from NLMISC::IStream.

Definition at line 517 of file file.cpp.

References _FileName.

bool NLMISC::COFile::open const std::string &    path,
bool    append = false,
bool    text = false
 

Open a file for writing. false if failed. close() if a file was opened.

Definition at line 426 of file file.cpp.

References _F, _FileName, and close.

Referenced by COFile, and loadForm.

bool NLMISC::COFile::seek sint32    offset,
IStream::TSeekOrigin    origin
throw (EStream)
 

Seek the file.

Definition at line 480 of file file.cpp.

References nlstop, and offset.

void NLMISC::COFile::serialBit bool &    bit throw (EWriteError) [protected, virtual]
 

Implements NLMISC::IStream.

Definition at line 473 of file file.cpp.

References v.

void NLMISC::COFile::serialBuffer uint8   buf,
uint    len
throw (EWriteError) [virtual]
 

Method to be specified by the Deriver.

Warning:
Do not call these methods from outside, unless you really know what you are doing. Using them instead of serial() can lead to communication problems between different platforms !

Implements NLMISC::IStream.

Definition at line 465 of file file.cpp.


Member Data Documentation

FILE* NLMISC::COFile::_F [private]
 

Definition at line 188 of file file.h.

Referenced by close, COFile, flush, and open.

std::string NLMISC::COFile::_FileName [private]
 

Definition at line 189 of file file.h.

Referenced by COFile, getStreamName, and open.


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