imebra  build 2011-09-18_22-24-41
puntoexe::stream Class Reference

This class derives from the baseStream class and implements a file stream. More...

#include <stream.h>

Inheritance diagram for puntoexe::stream:
puntoexe::baseStream puntoexe::baseObject

List of all members.

Public Member Functions

void openFile (const std::string &fileName, const int mode)
 Open a file.

Detailed Description

This class derives from the baseStream class and implements a file stream.

This class can be used to read/write on physical files in the mass storage.

Examples:

changeTransferSyntax/changeTransferSyntax.cpp, dicom2jpeg/dicom2jpeg.cpp, and dicomdirItems/dicomdirItems.cpp.


Member Function Documentation

void puntoexe::stream::openFile ( const std::string &  fileName,
const int  mode 
)

Open a file.

The function uses the standard library function fopen to open the specified file.

The created file object will be automatically closed and destroyed when one of the following events will occur:

  • the stream class will be destroyed
  • this function will be called again
Parameters:
fileNamethe name of the file to be opened
modethe opening mode. Can be the combination of one or more of the following values:
  • ios_base::in the file will be opened for reading operations
  • ios_base::out the file will be opened for writing operations
  • ios_base::app the writing operations will append data to the existing file
  • ios_base::trunc the existing file will be truncated to zero length
  • ios_base::binary the file will be opened in binary mode. Please note that this flag is useless, since all the files ARE OPENED IN BINARY MODE.

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