base::StreambufFile2 Class Reference

Streambuf class that can write to one or two files (a confluence/fork). More...

#include <base_stream.hh>

List of all members.

Public Member Functions

 StreambufFile2 (SafePtr< FILE > file0, bool close0, SafePtr< FILE > file1=NULL, bool close1=false)
 ~StreambufFile2 ()

Protected Member Functions

virtual int_type overflow (int_type c)
std::streamsize xsputn (const char *buf, std::streamsize n)

Protected Attributes

SafePtr< FILE > mFile0
SafePtr< FILE > mFile1
bool mClose0
bool mClose1

Private Types

typedef streambuf Parent


Detailed Description

Streambuf class that can write to one or two files (a confluence/fork).

This is a "streambuf" class to serve as the basis of an ostream. Derived from Nicolai Josuttis's STL book.

/// Example:
///		SafePtr<FILE> file1 = fopen(...);
///		SafePtr<FILE> file2 = fopen(...);
///     StreamFile2 streambufFile2( file1, file2 );
///     std::ostream out( &streambufFile2 );  // ostream based on streambuf
///     out << "hello" << endl;
/// 

Member Typedef Documentation

typedef streambuf base::StreambufFile2::Parent [private]


Constructor & Destructor Documentation

base::StreambufFile2::StreambufFile2 ( SafePtr< FILE >  file0,
bool  close0,
SafePtr< FILE >  file1 = NULL,
bool  close1 = false 
)

ctor/dtor.

Parameters:
file0,file1 Second is optional.
close0,close1 If destructor should close file. Never deletes FILE* object. Second is optional.

base::StreambufFile2::~StreambufFile2 (  ) 


Member Function Documentation

virtual int_type base::StreambufFile2::overflow ( int_type  c  )  [protected, virtual]

std::streamsize base::StreambufFile2::xsputn ( const char *  buf,
std::streamsize  n 
) [protected]


Member Data Documentation

SafePtr<FILE> base::StreambufFile2::mFile0 [protected]

SafePtr<FILE> base::StreambufFile2::mFile1 [protected]

bool base::StreambufFile2::mClose0 [protected]

bool base::StreambufFile2::mClose1 [protected]


The documentation for this class was generated from the following files: Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:19 2007