OSB_LIB::CdrOutputFile Class Reference

Inheritance diagram for OSB_LIB::CdrOutputFile:

Inheritance graph
[legend]
Collaboration diagram for OSB_LIB::CdrOutputFile:

Collaboration graph
[legend]
List of all members.

Detailed Description

Support output of Cdr, ASN.1, and text CDR to file.

Definition at line 231 of file cdrfile.h.

Public Member Functions

Public Attributes

Private Member Functions


Constructor & Destructor Documentation

OSB_LIB::CdrOutputFile::CdrOutputFile ( const size_t  blockSize = 0,
const unsigned char  filler = 0x00 
)

Default constructor.

Parameters:
blockSize Set the size of the ASN.1 block.
filler Character used to fill up the ASN.1 block.
Remarks:
The above parameters is only applicable when writing an ASN.1 data using write(const Asn1Data&) member function.

OSB_LIB::CdrOutputFile::CdrOutputFile ( const CdrOutputFile  )  [private]

Prevent copying: not implemented.


Member Function Documentation

virtual int OSB_LIB::CdrOutputFile::close (  )  [virtual]

Close the output file.

Returns:
0 in case of success or file_ was never opened, else errno.
If the file is created with ASN.1 block enabled, meaning parameter "blockSize > 0" in the constructor, the block will be filled with filler if a block exist.

Reimplemented from OSB_LIB::FileBase.

int OSB_LIB::CdrOutputFile::flush (  ) 

Flush the file.

Returns:
0 in case of success or file_ was never opened, else errno.

int OSB_LIB::CdrOutputFile::open ( const std::string &  dir,
const std::string &  name 
)

Open the file.

Parameters:
dir Directory of the output file.
name Name of the output file.
Returns:
0 in case of success, else errno.
Note:
Uses fopen() to create the file, i.e., an existing file is overwritten.

int OSB_LIB::CdrOutputFile::open ( const std::string &  path  ) 

Open the file.

Parameters:
path Full path of the output file.
Returns:
0 in case of success, else errno.
Note:
Uses fopen() to create the file, i.e., an existing file is overwritten.

CdrOutputFile& OSB_LIB::CdrOutputFile::operator= ( const CdrOutputFile  )  [private]

Prevent assignment: not implemented.

int OSB_LIB::CdrOutputFile::write ( const Asn1Data asn1  ) 

Write binary ASN.1 data to the file.

Parameters:
asn1 ASN.1 record to write.
Returns:
0 in case of success, else
1: file not open
2: error writing data.

int OSB_LIB::CdrOutputFile::write ( const std::string &  record  ) 

Write a text record to the file.

Parameters:
record Record to write.
Returns:
0 in case of success, else
1: file not open
2: error writing data.

int OSB_LIB::CdrOutputFile::write ( const Cdr cdr,
Asn1Writer writer 
)

Add a CDR to the file.

Parameters:
cdr CDR to add.
writer ASN.1 writer to use.
Returns:
0 in case of success, else
1: file not open
2: error writing ASN.1 data


Member Data Documentation

size_t OSB_LIB::CdrOutputFile::blkSz_

ASN.1 block size.

Definition at line 340 of file cdrfile.h.

size_t OSB_LIB::CdrOutputFile::cnt_

Total bytes written to the block.

Definition at line 344 of file cdrfile.h.

unsigned char OSB_LIB::CdrOutputFile::filler_

Filler character.

Definition at line 342 of file cdrfile.h.


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:15:11 2006 for OSB Library by  doxygen 1.4.7