The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ModuleRpcJson Class Reference

Inheritance diagram for ModuleRpcJson:

Inheritance graph
[legend]
Collaboration diagram for ModuleRpcJson:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleRpcJson (InspIRCd *Me)
virtual ~ModuleRpcJson ()
virtual Version GetVersion ()
 Returns the version number of a Module.
virtual void OnEvent (Event *event)
 Called whenever an Event class is sent to all module by another module.
void AttachToParent (RPCValue *parent, RPCValue *child, const std::string &key="")
void AttachToParentReset (RPCValue *parent, RPCValue *&child, std::string &key)
RPCValueJSONParse (const std::string &data)
void JSONSerialize (RPCValue *value, std::stringstream &re)

Detailed Description

Definition at line 40 of file m_rpc_json.cpp.


Constructor & Destructor Documentation

ModuleRpcJson::ModuleRpcJson InspIRCd Me  )  [inline]
 

Definition at line 45 of file m_rpc_json.cpp.

References ModuleManager::Attach(), I_OnEvent, InspIRCd::Modules, ModuleManager::PublishInterface(), and Module::ServerInstance.

virtual ModuleRpcJson::~ModuleRpcJson  )  [inline, virtual]
 

Definition at line 52 of file m_rpc_json.cpp.

References InspIRCd::Modules, Module::ServerInstance, and ModuleManager::UnpublishInterface().


Member Function Documentation

void ModuleRpcJson::AttachToParent RPCValue parent,
RPCValue child,
const std::string key = ""
[inline]
 

Definition at line 136 of file m_rpc_json.cpp.

References RPCValue::ArrayAdd(), RPCValue::GetType(), RPCValue::ObjectAdd(), RPCArray, and RPCObject.

Referenced by AttachToParentReset().

void ModuleRpcJson::AttachToParentReset RPCValue parent,
RPCValue *&  child,
std::string key
[inline]
 

Definition at line 149 of file m_rpc_json.cpp.

References AttachToParent().

Referenced by JSONParse().

virtual Version ModuleRpcJson::GetVersion  )  [inline, virtual]
 

Returns the version number of a Module.

The method should return a Version object with its version information assigned via Version::Version

Reimplemented from Module.

Definition at line 57 of file m_rpc_json.cpp.

References API_VERSION, VF_SERVICEPROVIDER, and VF_VENDOR.

RPCValue* ModuleRpcJson::JSONParse const std::string data  )  [inline]
 

Definition at line 156 of file m_rpc_json.cpp.

References AttachToParentReset(), RPCValue::parent, RPCArray, and RPCObject.

Referenced by OnEvent().

void ModuleRpcJson::JSONSerialize RPCValue value,
std::stringstream &  re
[inline]
 

Definition at line 324 of file m_rpc_json.cpp.

References RPCValue::ArraySize(), RPCValue::GetArray(), RPCValue::GetBool(), RPCValue::GetInt(), RPCValue::GetObjectIterator(), RPCValue::GetString(), RPCValue::GetType(), RPCArray, RPCBoolean, RPCInteger, RPCNull, RPCObject, and RPCString.

Referenced by OnEvent().

virtual void ModuleRpcJson::OnEvent Event event  )  [inline, virtual]
 

Called whenever an Event class is sent to all module by another module.

Please see the documentation of Event::Send() for further information. The Event sent can always be assumed to be non-NULL, you should *always* check the value of Event::GetEventID() before doing anything to the event data, and you should *not* change the event data in any way!

Parameters:
event The Event class being received

Reimplemented from Module.

Definition at line 63 of file m_rpc_json.cpp.

References Event::GetData(), Event::GetEventID(), RPCValue::GetObject(), HTTPRequest::GetPostData(), Event::GetSource(), RPCValue::GetString(), RPCValue::GetType(), HTTPRequest::GetURI(), HTTPDocument::headers, JSONParse(), JSONSerialize(), RPCArray, RPCObject, RPCString, Request::Send(), Event::Send(), Module::ServerInstance, HTTPHeaders::SetHeader(), and HTTPRequest::sock.


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