GM6000 Digital Heater Controller Build: 16 (Branch = develop)
SDX-1330
List of all members | Public Member Functions | Protected Attributes
Cpl::Io::File::Output Class Reference

This concrete class provides a platform independent 'standard' implementation of a Cpl::Io::File::Output object. More...

Detailed Description

This concrete class provides a platform independent 'standard' implementation of a Cpl::Io::File::Output object.

NOTE: All the write operations return 'false' if an error occurred, this INCLUDES the end-of-file condition (which is error when dealing with streams). To differentiate between a true error and EOF, the client must call isEof().

#include <Output.h>

Inheritance diagram for Cpl::Io::File::Output:
[legend]
Collaboration diagram for Cpl::Io::File::Output:
[legend]

Public Member Functions

 Output (const char *fileName, bool forceCreate=true, bool forceEmptyFile=false)
 Constructor -->Opens the file.
 
 Output (Cpl::Io::Descriptor streamfd)
 Constructor. 'streamfd' is a the file descriptor of a existing/opened file.
 
 ~Output ()
 Destructor -->Will insure the file gets closed.
 
bool isOpened ()
 This method returns true if the file was successfully open and/or is still opened (i.e.
 
bool write (char c)
 See Cpl::Io::Output.
 
bool write (const char *string)
 See Cpl::Io::Output.
 
bool write (const Cpl::Text::String &string)
 See Cpl::Io::Output.
 
bool write (Cpl::Text::String &formatBuffer, const char *format,...)
 See Cpl::Io::Output.
 
bool vwrite (Cpl::Text::String &formatBuffer, const char *format, va_list ap)
 See Cpl::Io::Output.
 
bool write (const void *buffer, int maxBytes)
 See Cpl::Io::Output.
 
bool write (const void *buffer, int maxBytes, int &bytesWritten)
 See Cpl::Io::Output.
 
void flush ()
 See Cpl::Io::Output.
 
bool isEos ()
 See Cpl::Io::IsEos (is equivalent to isEof())
 
void close ()
 See Cpl::Io::Close.
 
bool isEof ()
 See Cpl::Io::File::ObjectApi.
 
bool length (unsigned long &len)
 See Cpl::Io::File::ObjectApi.
 
bool currentPos (unsigned long &curPosition)
 See Cpl::Io::File::Object.
 
bool setRelativePos (long deltaOffset)
 See Cpl::Io::File::ObjectApi.
 
bool setAbsolutePos (unsigned long newoffset)
 See Cpl::Io::File::Object.
 
bool setToEof ()
 See Cpl::Io::File::ObjectApi.
 
- Public Member Functions inherited from Cpl::Io::Close
virtual ~Close ()
 Lets the make the destructor virtual.
 
- Public Member Functions inherited from Cpl::Container::Item
bool insert_ (void *newContainerPtr)
 Helper method to trap when inserting an item in multiple containers.
 
bool isInContainer_ (const void *containerPtr) const noexcept
 Returns 'true' if the instance is in the specified container.
 
- Public Member Functions inherited from Cpl::Io::IsEos
virtual ~IsEos ()
 Lets the make the destructor virtual.
 
- Public Member Functions inherited from Cpl::Io::File::ObjectApi
virtual ~ObjectApi ()
 Virtual destructor.
 

Protected Attributes

Cpl::Io::Stdio::Output_ m_stream
 Provides the underlying write functionality.
 

Additional Inherited Members

- Static Public Member Functions inherited from Cpl::Container::Item
static void remove_ (Item *itemPtr) noexcept
 Helper method to do the proper 'clean-up' for the multiple-containers-error-trap when removing an item from a container.
 
- Public Attributes inherited from Cpl::Container::Item
voidm_nextPtr_
 The link field.
 
voidm_inListPtr_
 Debug field.
 
- Protected Member Functions inherited from Cpl::Container::Item
 Item ()
 Constructor.
 
 Item (const char *)
 Constructor used ONLY with the child class MapItem: -->special constructor to allow a Map to be statically allocated.
 

Constructor & Destructor Documentation

◆ Output() [1/2]

Cpl::Io::File::Output::Output ( const char * fileName,
bool forceCreate = true,
bool forceEmptyFile = false )

Constructor -->Opens the file.

◆ Output() [2/2]

Cpl::Io::File::Output::Output ( Cpl::Io::Descriptor streamfd)

Constructor. 'streamfd' is a the file descriptor of a existing/opened file.

◆ ~Output()

Cpl::Io::File::Output::~Output ( )
virtual

Destructor -->Will insure the file gets closed.

Reimplemented from Cpl::Io::Output.

Member Function Documentation

◆ close()

void Cpl::Io::File::Output::close ( )
virtual

See Cpl::Io::Close.

Implements Cpl::Io::Close.

◆ currentPos()

bool Cpl::Io::File::Output::currentPos ( unsigned long & curPosition)
virtual

See Cpl::Io::File::Object.

Implements Cpl::Io::File::ObjectApi.

◆ flush()

void Cpl::Io::File::Output::flush ( )
virtual

See Cpl::Io::Output.

Implements Cpl::Io::Output.

◆ isEof()

bool Cpl::Io::File::Output::isEof ( )
virtual

◆ isEos()

bool Cpl::Io::File::Output::isEos ( )
virtual

See Cpl::Io::IsEos (is equivalent to isEof())

Implements Cpl::Io::IsEos.

◆ isOpened()

bool Cpl::Io::File::Output::isOpened ( )

This method returns true if the file was successfully open and/or is still opened (i.e.

close() has not been called). Note: it is okay to call other methods in the class if the file is not open - i.e. nothing 'bad' will happen and the method will return 'failed' status (when appropriate).

◆ length()

bool Cpl::Io::File::Output::length ( unsigned long & len)
virtual

◆ setAbsolutePos()

bool Cpl::Io::File::Output::setAbsolutePos ( unsigned long newoffset)
virtual

See Cpl::Io::File::Object.

Implements Cpl::Io::File::ObjectApi.

◆ setRelativePos()

bool Cpl::Io::File::Output::setRelativePos ( long deltaOffset)
virtual

◆ setToEof()

bool Cpl::Io::File::Output::setToEof ( )
virtual

◆ vwrite()

bool Cpl::Io::File::Output::vwrite ( Cpl::Text::String & formatBuffer,
const char * format,
va_list ap )
virtual

See Cpl::Io::Output.

Reimplemented from Cpl::Io::Output.

◆ write() [1/6]

bool Cpl::Io::File::Output::write ( char c)
virtual

See Cpl::Io::Output.

Reimplemented from Cpl::Io::Output.

◆ write() [2/6]

bool Cpl::Io::File::Output::write ( const char * string)
virtual

See Cpl::Io::Output.

Reimplemented from Cpl::Io::Output.

◆ write() [3/6]

bool Cpl::Io::File::Output::write ( const Cpl::Text::String & string)
virtual

See Cpl::Io::Output.

Reimplemented from Cpl::Io::Output.

◆ write() [4/6]

bool Cpl::Io::File::Output::write ( const void * buffer,
int maxBytes )
virtual

See Cpl::Io::Output.

Reimplemented from Cpl::Io::Output.

◆ write() [5/6]

bool Cpl::Io::File::Output::write ( const void * buffer,
int maxBytes,
int & bytesWritten )
virtual

See Cpl::Io::Output.

Implements Cpl::Io::Output.

◆ write() [6/6]

bool Cpl::Io::File::Output::write ( Cpl::Text::String & formatBuffer,
const char * format,
... )
virtual

See Cpl::Io::Output.

Reimplemented from Cpl::Io::Output.

Member Data Documentation

◆ m_stream

Cpl::Io::Stdio::Output_ Cpl::Io::File::Output::m_stream
protected

Provides the underlying write functionality.


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