WD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
webdriver::Response Class Reference

#include <response.h>

Public Member Functions

 Response ()
 
 ~Response ()
 
ErrorCode GetStatus () const
 
void SetStatus (ErrorCode status)
 
const base::Value * GetValue () const
 
void SetValue (base::Value *value)
 
void SetError (Error *error)
 
void SetField (const std::string &key, base::Value *value)
 
const base::Value * GetDictionary () const
 
std::string ToJSON () const
 

Detailed Description

A simple class that encapsulates the information describing the response to a Command. In Webdriver all responses must be sent back as a JSON value, conforming to the spec found at: http://code.google.com/p/selenium/wiki/JsonWireProtocol#Messages

Constructor & Destructor Documentation

webdriver::Response::Response ( )

Creates a new Response with a default status of kSuccess and a NullValue.

webdriver::Response::~Response ( )

Member Function Documentation

const base::Value* webdriver::Response::GetDictionary ( ) const

Returns a pointer to the actual response dictionary.

ErrorCode webdriver::Response::GetStatus ( ) const
const base::Value* webdriver::Response::GetValue ( ) const

Ownership of the returned pointer is kept by this object.

void webdriver::Response::SetError ( Error error)

Configures this response to report the given error. Ownership of the error is taken from the caller.

void webdriver::Response::SetField ( const std::string &  key,
base::Value *  value 
)

Sets a JSON field in this response. The key may be a "." delimitted string to indicate the value should be set in a nested object. Any previously set value for the key will be deleted. This object assumes ownership of value.

void webdriver::Response::SetStatus ( ErrorCode  status)
void webdriver::Response::SetValue ( base::Value *  value)

Sets the value of this response, assuming ownership of the object in the process.

std::string webdriver::Response::ToJSON ( ) const

Returns this response as a JSON string.


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