GM6000 Digital Heater Controller Branch: main
SDX-1330
List of all members | Public Member Functions
Cpl::Io::LineWriterApi Class Referenceabstract

This abstract class defines a interface for a stream line writer. More...

Detailed Description

This abstract class defines a interface for a stream line writer.

A line writer allows the client to write lines to a stream. The interface also handles the output of the 'new line' character(s).

#include <LineWriterApi.h>

Inheritance diagram for Cpl::Io::LineWriterApi:
[legend]
Collaboration diagram for Cpl::Io::LineWriterApi:
[legend]

Public Member Functions

virtual bool print (const char *srcstring)=0
 Outputs the specified string to the stream.
 
virtual bool println (const char *srcstring)=0
 Outputs the specified string to the stream and then appends the newline character(s) to the stream.
 
virtual bool print (const char *srcstring, int numbytes)=0
 Outputs the first 'numbytes' bytes of the specified string to the stream.
 
virtual bool println (const char *srcstring, int numbytes)=0
 Outputs the first 'numbytes' bytes of the specified string to the stream and then appends the newline character(s) to the stream.
 
virtual bool println ()=0
 Outputs the newline character(s) to the stream.
 
virtual bool print (Cpl::Text::String &formatBuffer, const char *format,...)=0
 Formatted output to the stream.
 
virtual bool println (Cpl::Text::String &formatBuffer, const char *format,...)=0
 Same as above, except newline character(s) are appended to the end of the formatted output.
 
virtual bool vprint (Cpl::Text::String &formatBuffer, const char *format, va_list ap)=0
 Same as print( String& formatBuffer, const char* format,...), except that it is called with a va_list instead of a variable number of arguments.
 
virtual bool vprintln (Cpl::Text::String &formatBuffer, const char *format, va_list ap)=0
 Same as println( String& formatBuffer, const char* format,...), except that it is called with a va_list instead of a variable number of arguments.
 
virtual void flush ()=0
 Forces all buffered data (if any) to be written to the stream media.
 
virtual void close ()=0
 Closes the writer and the underlying output stream.
 
virtual ~LineWriterApi ()
 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.
 

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

◆ ~LineWriterApi()

virtual Cpl::Io::LineWriterApi::~LineWriterApi ( )
inlinevirtual

Lets the make the destructor virtual.

Member Function Documentation

◆ close()

virtual void Cpl::Io::LineWriterApi::close ( )
pure virtual

Closes the writer and the underlying output stream.

Implemented in Cpl::Io::LineWriter.

◆ flush()

virtual void Cpl::Io::LineWriterApi::flush ( )
pure virtual

Forces all buffered data (if any) to be written to the stream media.

Implemented in Cpl::Io::LineWriter.

◆ print() [1/3]

virtual bool Cpl::Io::LineWriterApi::print ( const char *  srcstring)
pure virtual

Outputs the specified string to the stream.

No newline character(s) are written. Returns true if successful, or false if End-of-Stream was encountered.

Implemented in Cpl::Io::LineWriter.

◆ print() [2/3]

virtual bool Cpl::Io::LineWriterApi::print ( const char *  srcstring,
int  numbytes 
)
pure virtual

Outputs the first 'numbytes' bytes of the specified string to the stream.

No newline character(s) are written. Returns true if successful, or false if End-of-Stream was encountered.

Implemented in Cpl::Io::LineWriter.

◆ print() [3/3]

virtual bool Cpl::Io::LineWriterApi::print ( Cpl::Text::String formatBuffer,
const char *  format,
  ... 
)
pure virtual

Formatted output to the stream.

The formatting syntax/semantics is the same as printf(). The number of characters actually outputted to stream is limited by the size of 'formatBuffer'. No newline character(s) are written to the stream. Returns true if successful, or false if End-of-Stream was encountered.

Implemented in Cpl::Io::LineWriter.

◆ println() [1/4]

virtual bool Cpl::Io::LineWriterApi::println ( )
pure virtual

Outputs the newline character(s) to the stream.

Implemented in Cpl::Io::LineWriter.

◆ println() [2/4]

virtual bool Cpl::Io::LineWriterApi::println ( const char *  srcstring)
pure virtual

Outputs the specified string to the stream and then appends the newline character(s) to the stream.

Returns true if successful, or false if End-of-Stream was encountered.

Implemented in Cpl::Io::LineWriter.

◆ println() [3/4]

virtual bool Cpl::Io::LineWriterApi::println ( const char *  srcstring,
int  numbytes 
)
pure virtual

Outputs the first 'numbytes' bytes of the specified string to the stream and then appends the newline character(s) to the stream.

Returns true if successful, or false if End-of-Stream was encountered.

Implemented in Cpl::Io::LineWriter.

◆ println() [4/4]

virtual bool Cpl::Io::LineWriterApi::println ( Cpl::Text::String formatBuffer,
const char *  format,
  ... 
)
pure virtual

Same as above, except newline character(s) are appended to the end of the formatted output.

Implemented in Cpl::Io::LineWriter.

◆ vprint()

virtual bool Cpl::Io::LineWriterApi::vprint ( Cpl::Text::String formatBuffer,
const char *  format,
va_list  ap 
)
pure virtual

Same as print( String& formatBuffer, const char* format,...), except that it is called with a va_list instead of a variable number of arguments.

Implemented in Cpl::Io::LineWriter.

◆ vprintln()

virtual bool Cpl::Io::LineWriterApi::vprintln ( Cpl::Text::String formatBuffer,
const char *  format,
va_list  ap 
)
pure virtual

Same as println( String& formatBuffer, const char* format,...), except that it is called with a va_list instead of a variable number of arguments.

Implemented in Cpl::Io::LineWriter.


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