activemq-cpp-3.6.0
decaf::io::Writer Class Reference

#include <src/main/decaf/io/Writer.h>

Inheritance diagram for decaf::io::Writer:

Public Member Functions

 Writer ()
virtual ~Writer ()
virtual void write (char v)
 Writes an single byte char value.
virtual void write (const std::vector< char > &buffer)
 Writes an array of Chars.
virtual void write (const char *buffer, int size)
 Writes a byte array to the output stream.
virtual void write (const char *buffer, int size, int offset, int length)
 Writes a byte array to the output stream.
virtual void write (const std::string &str)
 Writes a string.
virtual void write (const std::string &str, int offset, int length)
 Writes a string.
virtual decaf::lang::Appendableappend (char value)
 Appends the specified character to this Appendable.
virtual decaf::lang::Appendableappend (const decaf::lang::CharSequence *csq)
 Appends the specified character sequence to this Appendable.
virtual decaf::lang::Appendableappend (const decaf::lang::CharSequence *csq, int start, int end)
 Appends a subsequence of the specified character sequence to this Appendable.
- Public Member Functions inherited from decaf::io::Closeable
virtual ~Closeable ()
virtual void close ()=0
 Closes this object and deallocates the appropriate resources.
- Public Member Functions inherited from decaf::io::Flushable
virtual ~Flushable ()
virtual void flush ()=0
 Flushes this stream by writing any buffered output to the underlying stream.
- Public Member Functions inherited from decaf::lang::Appendable
virtual ~Appendable ()

Protected Member Functions

virtual void doWriteArrayBounded (const char *buffer, int size, int offset, int length)=0
 Override this method to customize the functionality of the method write( char* buffer, int size, int offset, int length ).
virtual void doWriteChar (char v)
virtual void doWriteVector (const std::vector< char > &buffer)
virtual void doWriteArray (const char *buffer, int size)
virtual void doWriteString (const std::string &str)
virtual void doWriteStringBounded (const std::string &str, int offset, int length)
virtual decaf::lang::AppendabledoAppendChar (char value)
virtual decaf::lang::AppendabledoAppendCharSequence (const decaf::lang::CharSequence *csq)
virtual decaf::lang::AppendabledoAppendCharSequenceStartEnd (const decaf::lang::CharSequence *csq, int start, int end)

Constructor & Destructor Documentation

decaf::io::Writer::Writer ( )
virtual decaf::io::Writer::~Writer ( )
virtual

Member Function Documentation

virtual decaf::lang::Appendable& decaf::io::Writer::append ( char  value)
virtual

Appends the specified character to this Appendable.

Parameters
valueThe character to append.
Returns
a Reference to this Appendable
Exceptions
Exceptionif an error occurs.

Implements decaf::lang::Appendable.

virtual decaf::lang::Appendable& decaf::io::Writer::append ( const decaf::lang::CharSequence csq)
virtual

Appends the specified character sequence to this Appendable.

Parameters
csqThe character sequence from which a subsequence will be appended. If csq is NULL, then characters will be appended as if csq contained the string "null".
Returns
a Reference to this Appendable.
Exceptions
Exceptionif an error occurs.

Implements decaf::lang::Appendable.

virtual decaf::lang::Appendable& decaf::io::Writer::append ( const decaf::lang::CharSequence csq,
int  start,
int  end 
)
virtual

Appends a subsequence of the specified character sequence to this Appendable.

Parameters
csq- The character sequence from which a subsequence will be appended. If csq is NULL, then characters will be appended as if csq contained the string "null".
startThe index of the first character in the subsequence.
endThe index of the character following the last character in the subsequence.
Returns
a Reference to this Appendable
Exceptions
Exceptionif an error occurs.
IndexOutOfBoundsExceptionstart is greater than end, or end is greater than csq.length()

Implements decaf::lang::Appendable.

virtual decaf::lang::Appendable& decaf::io::Writer::doAppendChar ( char  value)
protectedvirtual
virtual decaf::lang::Appendable& decaf::io::Writer::doAppendCharSequence ( const decaf::lang::CharSequence csq)
protectedvirtual
virtual decaf::lang::Appendable& decaf::io::Writer::doAppendCharSequenceStartEnd ( const decaf::lang::CharSequence csq,
int  start,
int  end 
)
protectedvirtual
virtual void decaf::io::Writer::doWriteArray ( const char *  buffer,
int  size 
)
protectedvirtual
virtual void decaf::io::Writer::doWriteArrayBounded ( const char *  buffer,
int  size,
int  offset,
int  length 
)
protectedpure virtual

Override this method to customize the functionality of the method write( char* buffer, int size, int offset, int length ).

All subclasses must override this method to provide the basic Writer functionality.

Implemented in decaf::io::OutputStreamWriter.

virtual void decaf::io::Writer::doWriteChar ( char  v)
protectedvirtual
virtual void decaf::io::Writer::doWriteString ( const std::string &  str)
protectedvirtual
virtual void decaf::io::Writer::doWriteStringBounded ( const std::string &  str,
int  offset,
int  length 
)
protectedvirtual
virtual void decaf::io::Writer::doWriteVector ( const std::vector< char > &  buffer)
protectedvirtual
virtual void decaf::io::Writer::write ( char  v)
virtual

Writes an single byte char value.

Parameters
vThe value to be written.
Exceptions
IOExceptionthrown if an error occurs.
virtual void decaf::io::Writer::write ( const std::vector< char > &  buffer)
virtual

Writes an array of Chars.

Parameters
bufferThe array to be written.
Exceptions
IOExceptionthrown if an error occurs.
virtual void decaf::io::Writer::write ( const char *  buffer,
int  size 
)
virtual

Writes a byte array to the output stream.

Parameters
bufferThe byte array to write (cannot be NULL).
sizeThe size in bytes of the buffer passed.
Exceptions
IOExceptionif an I/O error occurs.
NullPointerExceptionif buffer is NULL.
virtual void decaf::io::Writer::write ( const char *  buffer,
int  size,
int  offset,
int  length 
)
virtual

Writes a byte array to the output stream.

Parameters
bufferThe byte array to write (cannot be NULL).
sizeThe size in bytes of the buffer passed.
offsetThe position in the array to start writing from.
lengthThe number of bytes in the array to write.
Exceptions
IOExceptionif an I/O error occurs.
NullPointerExceptionif buffer is NULL.
IndexOutOfBoundsExceptionif offset + length > size of the buffer.
virtual void decaf::io::Writer::write ( const std::string &  str)
virtual

Writes a string.

Parameters
strThe string to be written.
Exceptions
IOExceptionthrown if an error occurs.
virtual void decaf::io::Writer::write ( const std::string &  str,
int  offset,
int  length 
)
virtual

Writes a string.

Parameters
strThe string to be written.
offsetThe position in the array to start writing from.
lengthThe number of bytes in the array to write.
Exceptions
IOExceptionthrown if an error occurs.
IndexOutOfBoundsExceptionif offset+length is greater than the string length.

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