libcommonc++  0.7
XDRDecoder Class Reference

A decoder for XDR, the eXternal Data Representation format. More...

#include <XDRDecoder.h++>

Public Member Functions

 XDRDecoder (DataReader &reader)
 Construct a new XDRDecoder that will decode values from the given DataReader. More...
 
 ~XDRDecoder ()
 Destructor. More...
 
XDRDecoderdecode (bool &v)
 Decode a boolean value. More...
 
XDRDecoderdecode (byte_t &v)
 Decode a byte value. More...
 
XDRDecoderdecode (char &v)
 Decode a char value. More...
 
XDRDecoderdecode (int16_t &v)
 Decode a signed 16-bit integer value. More...
 
XDRDecoderdecode (uint16_t &v)
 Decode an unsigned 16-bit integer value. More...
 
XDRDecoderdecode (int32_t &v)
 Decode a signed 32-bit integer value. More...
 
XDRDecoderdecode (uint32_t &v)
 Decode an unsigned 32-bit integer value. More...
 
XDRDecoderdecode (int64_t &v)
 Decode a signed 64-bit integer value. More...
 
XDRDecoderdecode (uint64_t &v)
 Decode an unsigned 64-bit integer value. More...
 
XDRDecoderdecode (float &v)
 Decode a floating point value. More...
 
XDRDecoderdecode (double &v)
 Decode a double precision floating point value. More...
 
XDRDecoderdecode (char *s, size_t maxlen=0)
 Decode a string. More...
 
XDRDecoderdecode (String &s, size_t maxlen=0)
 Decode a string. More...
 
XDRDecoderdecode (byte_t *v, size_t len)
 Decode a block of opaque data. More...
 
XDRDecoderdecode (Variant &v)
 Decode an arbitrary value into a Variant. More...
 

Detailed Description

A decoder for XDR, the eXternal Data Representation format.

XDR is a scheme for encoding primitive datatypes in a platform-independent manner. For more information, see RFC 1832.

Author
Mark Lindner

Constructor & Destructor Documentation

◆ XDRDecoder()

XDRDecoder ( DataReader reader)

Construct a new XDRDecoder that will decode values from the given DataReader.

Parameters
readerThe DataReader.

◆ ~XDRDecoder()

~XDRDecoder ( )

Destructor.

Member Function Documentation

◆ decode() [1/15]

XDRDecoder& decode ( bool &  v)
inline

Decode a boolean value.

Parameters
vThe value to decode into.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [2/15]

XDRDecoder& decode ( byte_t v)
inline

Decode a byte value.

Parameters
vThe value to decode into.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [3/15]

XDRDecoder& decode ( char &  v)
inline

Decode a char value.

Parameters
vThe value to decode into.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [4/15]

XDRDecoder& decode ( int16_t &  v)
inline

Decode a signed 16-bit integer value.

Parameters
vThe value to decode into.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [5/15]

XDRDecoder& decode ( uint16_t &  v)
inline

Decode an unsigned 16-bit integer value.

Parameters
vThe value to decode into.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [6/15]

XDRDecoder& decode ( int32_t &  v)
inline

Decode a signed 32-bit integer value.

Parameters
vThe value to decode into.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [7/15]

XDRDecoder& decode ( uint32_t &  v)
inline

Decode an unsigned 32-bit integer value.

Parameters
vThe value to decode into.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [8/15]

XDRDecoder& decode ( int64_t &  v)
inline

Decode a signed 64-bit integer value.

Parameters
vThe value to decode into.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [9/15]

XDRDecoder& decode ( uint64_t &  v)
inline

Decode an unsigned 64-bit integer value.

Parameters
vThe value to decode into.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [10/15]

XDRDecoder& decode ( float &  v)
inline

Decode a floating point value.

Parameters
vThe value to decode into.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [11/15]

XDRDecoder& decode ( double &  v)
inline

Decode a double precision floating point value.

Parameters
vThe value to decode into.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [12/15]

XDRDecoder & decode ( char *  s,
size_t  maxlen = 0 
)

Decode a string.

Parameters
sThe character array to decode into.
maxlenThe maximum length of the string to decode. If the encoded string is longer than this length, an IOException will be thrown.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [13/15]

XDRDecoder & decode ( String s,
size_t  maxlen = 0 
)

Decode a string.

Parameters
sThe String to decode into.
maxlenThe maximum length of the string to decode. If the encoded string is longer than this length, an IOException will be thrown.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [14/15]

XDRDecoder & decode ( byte_t v,
size_t  len 
)

Decode a block of opaque data.

Parameters
vThe byte array to decode into.
lenThe number of bytes to decode.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

◆ decode() [15/15]

XDRDecoder & decode ( Variant v)

Decode an arbitrary value into a Variant.

Parameters
vThe Variant to decode into.
Returns
The XDRDecoder.
Exceptions
IOExceptionIf an I/O error occcurs.

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