class FileSink

File data output More...

Definition#include <FileSink.h>
InheritsReporter [public virtual ], Sink [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods

Protected Members

Private Methods

Private Members


Detailed Description

File data output

char * fileName

fileName

[private]

void  init ( const char * name )
throw ( Exception )

init

[private]

Initialize the object.

Parameters:
namename of the file to be represented by the object.

Throws: Exception

void  strip ( void )
throw ( Exception )

strip

[private]

De-initialize the object.

Throws: Exception

int fileDescriptor

fileDescriptor

[protected]

inline  FileSink ( void )
throw ( Exception )

FileSink

[protected]

Default constructor. Always throws an Exception.

Throws: Exception

inline  FileSink ( const char * name )
throw ( Exception )

FileSink

Constructor by a file name.

Parameters:
namename of the file to be represented by the object.

Throws: Exception

 FileSink ( const FileSink & fsink )
throw ( Exception )

FileSink

Copy constructor.

Parameters:
fsinkthe FileSink to copy.

Throws: Exception

inline  ~FileSink ( void )
throw ( Exception )

~FileSink

[virtual]

Destructor.

Throws: Exception

FileSink &  operator= ( const FileSink & fs )
throw ( Exception )

operator=

[virtual]

Assignment operator.

Parameters:
fsthe FileSink to assign to this object.

Returns: a reference to this object.

Throws: Exception

Reimplemented from Sink.

inline const char *  getFileName ( void )
throw ()

getFileName

[const]

Get the file name this FileSink represents.

Returns: the file name this FileSink represents.

bool  exists ( void )
throw ()

exists

[const virtual]

Check for the existence of the file this FileSink represents.

Returns: true if the file exists and is a regular file, false otherwise.

bool  create ( void )
throw ( Exception )

create

[virtual]

Create the file.

Returns: true if creation was successful, false otherwise.

Throws: Exception

bool  open ( void )
throw ( Exception )

open

[virtual]

Open the file. Truncates the file.

Returns: true if opening was successful, false otherwise.

Throws: Exception

Reimplemented from Sink.

inline bool  isOpen ( void )
throw ()

isOpen

[const virtual]

Check if the FileSink is open.

Returns: true if the FileSink is open, false otherwise.

Reimplemented from Sink.

bool  canWrite ( unsigned int sec, unsigned int usec )
throw ( Exception )

canWrite

[virtual]

Check if the FileSink is ready to accept data. Blocks until the specified time for data to be available.

Parameters:
secthe maximum seconds to block.
usecmicro seconds to block after the full seconds.

Returns: true if the Sink is ready to accept data, false otherwise.

Throws: Exception

Reimplemented from Sink.

unsigned int  write ( const void * buf, unsigned int len )
throw ( Exception )

write

[virtual]

Write data to the FileSink.

Parameters:
bufthe data to write.
lennumber of bytes to write from buf.

Returns: the number of bytes written (may be less than len).

Throws: Exception

Reimplemented from Sink.

inline void  flush ( void )
throw ( Exception )

flush

[virtual]

This is a no-op in this FileSink.

Throws: Exception

Reimplemented from Sink.

void  close ( void )
throw ( Exception )

close

[virtual]

Close the FileSink.

Throws: Exception

Reimplemented from Sink.