libDwm-0.9.45
Dwm::XDRUtils Class Reference

Wrapper for XDR encode/decode functions. More...

#include <DwmXDRUtils.hh>

Static Public Member Functions

static bool Encode (float val, std::array< char, 4 > &buf)
 Encode the given float val into the given buffer buf.
 
static bool Decode (const std::array< char, 4 > &buf, float &val)
 Decodes the given buffer buf into the given value val.
 
static bool Encode (double val, std::array< char, 8 > &buf)
 Encode the given double val into the given buffer buf.
 
static bool Decode (const std::array< char, 8 > &buf, double &val)
 Decodes the given buffer buf into the given double value val.
 
static uint32_t Encode (float val, char **buf)
 Encodes the given float val into *buf.
 
static void Decode (char *buf, float &val)
 Decodes the given buf into the given float value val.
 
static uint32_t Encode (double val, char **buf)
 Encodes the given double val into *buf.
 
static void Decode (char *buf, double &val)
 Decodes the given buf into the given double value val.
 

Detailed Description

Wrapper for XDR encode/decode functions.

Member Function Documentation

◆ Decode() [1/2]

static bool Dwm::XDRUtils::Decode ( const std::array< char, 4 > & buf,
float & val )
static

Decodes the given buffer buf into the given value val.

Returns true on success, false on failure.

◆ Decode() [2/2]

static bool Dwm::XDRUtils::Decode ( const std::array< char, 8 > & buf,
double & val )
static

Decodes the given buffer buf into the given double value val.

Returns true on success, false on failure.

◆ Encode() [1/4]

static uint32_t Dwm::XDRUtils::Encode ( double val,
char ** buf )
static

Encodes the given double val into *buf.

If *buf is non-null on entry, it will be freed. *buf will be allocated to hold the encoded value. Returns the size of *buf.

◆ Encode() [2/4]

static bool Dwm::XDRUtils::Encode ( double val,
std::array< char, 8 > & buf )
static

Encode the given double val into the given buffer buf.

Returns true on success, false on failure.

◆ Encode() [3/4]

static uint32_t Dwm::XDRUtils::Encode ( float val,
char ** buf )
static

Encodes the given float val into *buf.

If *buf is non-null on entry, it will be freed. *buf will be allocated to hold the encoded value. Returns the size of *buf.

◆ Encode() [4/4]

static bool Dwm::XDRUtils::Encode ( float val,
std::array< char, 4 > & buf )
static

Encode the given float val into the given buffer buf.

Returns true on success, false on failure.


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