xmppd::lwresc::lwresult Class Reference

#include <jabberdlib.h>

Public Types

enum  QueryResult {
  res_success = 0, res_nomemory = 1, res_timeout = 2, res_notfound = 3,
  res_unexpectedend = 4, res_failure = 5, res_ioerror = 6, res_notimplemented = 7,
  res_unexpected = 8, res_trailingdata = 9, res_incomplete = 10, res_retry = 11,
  res_typenotfound = 12, res_toolarge = 13
}

Public Member Functions

 lwresult (std::istream &is)
 ~lwresult ()
uint32_t getSerial () const
QueryResult getResult () const
lwresult_rdata const * getRData () const

Static Public Member Functions

static uint16_t read_uint16 (std::istream &is)
static uint32_t read_uint32 (std::istream &is)
static std::string read_string (std::istream &is)
static std::string read_qname (std::istream &is)

Detailed Description

base class for results to lwqueries.


Member Enumeration Documentation

possible result values

Enumerator:
res_success 
res_nomemory 
res_timeout 
res_notfound 
res_unexpectedend 
res_failure 
res_ioerror 
res_notimplemented 
res_unexpected 
res_trailingdata 
res_incomplete 
res_retry 
res_typenotfound 
res_toolarge 

Constructor & Destructor Documentation

xmppd::lwresc::lwresult::lwresult ( std::istream &  is  ) 

construct a lwresult class by reading a result from an istream

Parameters:
is the std::istream to read the result from

References read_uint16(), and read_uint32().

xmppd::lwresc::lwresult::~lwresult (  ) 

destruct an instance of a lwresult


Member Function Documentation

lwresult_rdata const * xmppd::lwresc::lwresult::getRData (  )  const
lwresult::QueryResult xmppd::lwresc::lwresult::getResult (  )  const
uint32_t xmppd::lwresc::lwresult::getSerial (  )  const
std::string xmppd::lwresc::lwresult::read_qname ( std::istream &  is  )  [static]

read a qname (sequence of labels, terminated by a zero label)

Note:
this method does not unread anything if it could not read the string successfully
Parameters:
is the stream to read from
Returns:
the string that has been read
Exceptions:
std::runtime_error if no string was readable

Referenced by xmppd::lwresc::srv_record::srv_record().

std::string xmppd::lwresc::lwresult::read_string ( std::istream &  is  )  [static]

read a string (16 bit length field, string, zero byte)

Note:
this method does not unread anything if it could not read the string successfully
Parameters:
is the stream to read from
Returns:
the string that has been read
Exceptions:
std::runtime_error if no string was readable

References read_uint16().

Referenced by xmppd::lwresc::lwresult_rrset::lwresult_rrset().

uint16_t xmppd::lwresc::lwresult::read_uint16 ( std::istream &  is  )  [static]

read a 16 bit value in network byte order from a stream

Parameters:
is the stream to read from
Returns:
the value that has been read
Exceptions:
std::runtime_error if no value was readable

Referenced by xmppd::lwresc::a_record::a_record(), xmppd::lwresc::aaaa_record::aaaa_record(), lwresult(), xmppd::lwresc::lwresult_rrset::lwresult_rrset(), read_string(), read_uint32(), and xmppd::lwresc::srv_record::srv_record().

uint32_t xmppd::lwresc::lwresult::read_uint32 ( std::istream &  is  )  [static]

read a 32 bit value in network byte order from a stream

Parameters:
is the stream to read from
Returns:
the value that has been read
Exceptions:
std::runtime_error if no value was readable

References read_uint16().

Referenced by lwresult(), and xmppd::lwresc::lwresult_rrset::lwresult_rrset().


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

Generated on Wed Mar 10 06:00:16 2010 for jabberd14 by  doxygen 1.6.1