Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

Os Class Reference

generalized output class, covers streams, files, strings etc. More...

#include <IsOs.h>

List of all members.

Public Methods

 Os ()
 Os (const char *s)
 Os (const String &s)
 Os (ostream &os)
 Os (ofstream &ofs)
 Os (const Os &os)
 Os (const String &filename, enum FileMode mode)
 Os (const String &filename, enum Format_type format, enum FileMode mode, bool xdr_format=true)
 ~Os ()
void rebind (const char *s)
void rebind (const String &s)
void rebind (ostream &os)
void rebind (ofstream &ofs)
void rebind (const Os &os)
void rebind (const String &filename, enum FileMode mode)
void rebind (const String &filename, enum Format_type format, enum FileMode mode, bool xdr_format=true)
void operator= (const Os &os)
void init ()
bool ok () const
Os_baseoperator-> ()
Os_basegetPtr ()
Os_basegetRef ()
void flush ()
bool isString ()
String getString ()

Static Public Methods

void describeFile (const String &filename, const String &description)

Friends

Os& operator<< (Os &os, double a)
Os& operator<< (Os &os, float a)
Os& operator<< (Os &os, int i)
Os& operator<< (Os &os, long int i)
Os& operator<< (Os &os, char c)
Os& operator<< (Os &os, const char *s)
Os& operator<< (Os &os, const String &s)
Os& operator<< (Os &os, void *v)


Detailed Description

generalized output class, covers streams, files, strings etc.

NAME: Os - generalized output class, covers streams, files, strings etc

DESCRIPTION:

See description of class "Is". Class "Os" has access to an "Os_base" hierarchy like class "Is" has a pointer to "Is_base". Most of the documentation of class "Is" is relevant for class "Os". The design, functionality and names of functions are as similar as possible. Hence, the documentation here of class "Os" is very brief.


Constructor & Destructor Documentation

Os::Os ( )
 

The constructors take ordinary output sources as arguments and enable automatic type conversion. Output source arguments may be "ostream", "ofstream", "char*", "String" or C xdr-binary files. Additional initialization may be a call to the member function "Is_base setFormat" for setting the format to "BINARY" or "ASCII" mode. The default is "ASCII" mode. One can also initialize the output format for numbers by calling the functions "setRealFormat" and "setIntFormat". These functions can be called whenever it is desired.

Note, this is not in effect in modern C++ compilers: The static member Os_base protection can be used to set a different file protection, the default is 0664 in contrast to the ofstream having 0644 as default.

Os::Os ( const char * s )
 

See documentation of one of the overloaded constructor.

Os::Os ( const String & s )
 

See documentation of one of the overloaded constructor.

Os::Os ( ostream & os )
 

See documentation of one of the overloaded constructor.

Os::Os ( ofstream & ofs )
 

See documentation of one of the overloaded constructor.

Os::Os ( const Os & os )
 

See documentation of one of the overloaded constructor.

Os::Os ( const String & filename,
enum FileMode mode )
 

See documentation of one of the overloaded constructor.

Os::Os ( const String & filename,
enum Format_type format,
enum FileMode mode,
bool xdr_format = true )
 

See documentation of one of the overloaded constructor.

Os::~Os ( )
 


Member Function Documentation

static void Os::describeFile ( const String & filename,
const String & description ) [static]
 

makes a description of a file on the file "casename.files". Every time one opens a 'new' file (not append mode!) one is encouraged to call "Os describeFile" and give a short description of the file. After a Diffpack program has terminated there may be a lot of files and the user can then examine the "casename.files" file if it is unclear what a file is.

void Os::flush ( ) [inline]
 

flushes the output buffer, that is, forces the output to be written immediately.

Os_base * Os::getPtr ( ) [inline]
 

returns a pointer to "Os_base". This function and "getRef" are usually used when casting from an "Os" to an "Os_base" subclass in order to use e.g. "iostream" or "String" functions directly.

Os_base & Os::getRef ( ) [inline]
 

returns a reference to "Os_base". This function and "getRef" are usually used when casting from an "Os" to an "Os_base" subclass in order to use e.g. "iostream" or "String" functions directly.

String Os::getString ( )
 

if the object is a "String" (see function "isString"), this function will return the "String" allowing you to use normal "String" functionality.

void Os::init ( )
 

initializes the "Os" object

bool Os::isString ( )
 

check if the object is a string. (If the object is a string, increased functionality is available.)

bool Os::ok ( ) const
 

determines if the "Os" object is properly initialized, that is, if it has access to an opened I/O source and is ready for reading data.

Os_base * Os::operator-> ( )
 

"Os_base". See class "Os_base" for the member function documentation of the functionality that can be accessed through this operator. (If the pointer to "Os_base" is not properly initialized, an error message is issued.)

void Os::operator= ( const Os & os )
 

void Os::rebind ( const String & filename,
enum Format_type format,
enum FileMode mode,
bool xdr_format = true )
 

See documentation of one of the overloaded functions.

void Os::rebind ( const String & filename,
enum FileMode mode )
 

See documentation of one of the overloaded functions.

void Os::rebind ( const Os & os )
 

See documentation of one of the overloaded functions.

void Os::rebind ( ofstream & ofs )
 

See documentation of one of the overloaded functions.

void Os::rebind ( ostream & os )
 

See documentation of one of the overloaded functions.

void Os::rebind ( const String & s )
 

See documentation of one of the overloaded functions.

void Os::rebind ( const char * s )
 

function for attaching or changing output sources such as "ostream", "ofstream", "char*" or "String". See the constructors for more information.


Friends And Related Function Documentation

Os & operator<< ( Os & os,
void * v ) [friend]
 

Os & operator<< ( Os & os,
const String & s ) [friend]
 

Os & operator<< ( Os & os,
const char * s ) [friend]
 

Os & operator<< ( Os & os,
char c ) [friend]
 

Os & operator<< ( Os & os,
long int i ) [friend]
 

Os & operator<< ( Os & os,
int i ) [friend]
 

Os & operator<< ( Os & os,
float a ) [friend]
 

Os & operator<< ( Os & os,
double a ) [friend]
 


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.