KeyValueResponse Class Reference

KeyValueResponse is a class that parses a stream in the form of key=value, saves and enables access to the results. More...

#include <librets/KeyValueResponse.h>

Inheritance diagram for KeyValueResponse:

RetsObject LoginResponse LogoutResponse

List of all members.

Public Member Functions

 KeyValueResponse ()
 Default constructor.
virtual ~KeyValueResponse ()
void Parse (istreamPtr inputStream, RetsVersion retsVersion)
 Parse the input stream, converting the data into keys and values.
void Parse (istreamPtr inputStream, RetsVersion retsVersion, EncodingType encoding)
 Parse the input stream, converting the data into keys and values.
std::string GetValue (std::string key) const
 For a given key, return the associated value.
int GetRetsReplyCode () const
 Returns an integer representing the RETS Response Code for this object.
std::string GetRetsReplyText () const
 Returns a string representing the RETS Reply Text.
virtual std::ostream & Print (std::ostream &outputStream) const
std::string ToString () const
virtual bool Equals (const RetsObject *object) const

Protected Member Functions

virtual RetsXmlTextEventPtr GetBodyEvent (RetsXmlEventListPtr eventList, RetsVersion retsVersion)=0
RetsXmlTextEventPtr GetBodyEventFromStandardResponse (RetsXmlEventListPtr eventList)
RetsXmlTextEventPtr GetBodyEventFromResponseWithNoRetsResponse (RetsXmlEventListPtr eventList)
RetsXmlTextEventPtr GetBodyEventFromShortResponse (RetsXmlEventListPtr eventList)
virtual void ParsingFinished ()

Static Protected Member Functions

static void AssertEquals (const std::string &expected, const std::string &actual)
static void AssertEquals (int expected, int actual)
static void AssertEventListSize (int expected, RetsXmlEventListPtr eventList)
static void AssertNotEquals (const std::string &expected, const std::string &actual)


Detailed Description

KeyValueResponse is a class that parses a stream in the form of key=value, saves and enables access to the results.

Constructor & Destructor Documentation

Default constructor.

virtual ~KeyValueResponse (  )  [virtual]


Member Function Documentation

static void AssertEquals ( int  expected,
int  actual 
) [static, protected]

static void AssertEquals ( const std::string &  expected,
const std::string &  actual 
) [static, protected]

static void AssertEventListSize ( int  expected,
RetsXmlEventListPtr  eventList 
) [static, protected]

static void AssertNotEquals ( const std::string &  expected,
const std::string &  actual 
) [static, protected]

virtual bool Equals ( const RetsObject object  )  const [virtual, inherited]

virtual RetsXmlTextEventPtr GetBodyEvent ( RetsXmlEventListPtr  eventList,
RetsVersion  retsVersion 
) [protected, pure virtual]

RetsXmlTextEventPtr GetBodyEventFromResponseWithNoRetsResponse ( RetsXmlEventListPtr  eventList  )  [protected]

RetsXmlTextEventPtr GetBodyEventFromShortResponse ( RetsXmlEventListPtr  eventList  )  [protected]

RetsXmlTextEventPtr GetBodyEventFromStandardResponse ( RetsXmlEventListPtr  eventList  )  [protected]

int GetRetsReplyCode (  )  const

Returns an integer representing the RETS Response Code for this object.

This is really only used internally to indicate login failures on those servers that don't return a 401 Unauthorized response but do return the RETS Response Code.

Returns:
An integer containing the RETS Response Code.

std::string GetRetsReplyText (  )  const

Returns a string representing the RETS Reply Text.

Returns:
A string containing the RETS Reply Text.

std::string GetValue ( std::string  key  )  const

For a given key, return the associated value.

If the key is not found and empty string is returned.

Parameters:
key A string representing the key whose value is to be returned.
Returns:
A string containing the value.

void Parse ( istreamPtr  inputStream,
RetsVersion  retsVersion,
EncodingType  encoding 
)

Parse the input stream, converting the data into keys and values.

Parameters:
inputStream A pointer to the input stream.
retsVersion The RETS version.
encoding The character encoding to use when parsing.

void Parse ( istreamPtr  inputStream,
RetsVersion  retsVersion 
)

Parse the input stream, converting the data into keys and values.

Parameters:
inputStream A pointer to the input stream.
retsVersion The RETS version.

virtual void ParsingFinished (  )  [protected, virtual]

virtual std::ostream& Print ( std::ostream &  outputStream  )  const [virtual, inherited]

std::string ToString (  )  const [inherited]


Generated by  doxygen