InspIRCd
3.0
|
#include <clientprotocol.h>
Public Member Functions | |
Serializer (Module *mod, const char *Name) | |
bool | HandleTag (LocalUser *user, const std::string &tagname, std::string &tagvalue, TagMap &tags) const |
const SerializedMessage & | SerializeForUser (LocalUser *user, Message &msg) |
virtual std::string | Serialize (const Message &msg, const TagSelection &tagwl) const =0 |
virtual bool | Parse (LocalUser *user, const std::string &line, ParseOutput &parseoutput)=0 |
![]() | |
DataProvider (Module *Creator, const std::string &Name) | |
![]() | |
ServiceProvider (Module *Creator, const std::string &Name, ServiceType Type) | |
virtual void | RegisterService () |
void | DisableAutoRegister () |
![]() | |
virtual CullResult | cull () |
Additional Inherited Members | |
![]() | |
ModuleRef | creator |
const std::string | name |
const ServiceType | service |
Base class for client protocol serializers. A serializer has to implement serialization and parsing of protocol messages to/from wire format.
ClientProtocol::Serializer::Serializer | ( | Module * | mod, |
const char * | Name | ||
) |
Constructor.
mod | Module owning the serializer. |
Name | Name of the serializer, e.g. "rfc". |
bool ClientProtocol::Serializer::HandleTag | ( | LocalUser * | user, |
const std::string & | tagname, | ||
std::string & | tagvalue, | ||
TagMap & | tags | ||
) | const |
Handle a tag in a message being parsed. Call this method for each parsed tag.
user | User sending the tag. |
tagname | Name of the tag. |
tagvalue | Tag value, may be empty. |
tags | TagMap to place the tag into, if it gets accepted. |
|
pure virtual |
Parse a protocol message from wire format.
user | Source of the message. |
line | Raw protocol message. |
parseoutput | Output of the parser. |
|
pure virtual |
Serialize a high level protocol message into wire format.
msg | High level message to serialize. Contains all necessary information about the message, including all possible tags. |
tagwl | Message tags to include in the serialized message. Tags attached to the message but not included in the whitelist must not appear in the output. This is because each user may get a different set of tags for the same message. |
const ClientProtocol::SerializedMessage & ClientProtocol::Serializer::SerializeForUser | ( | LocalUser * | user, |
Message & | msg | ||
) |
Serialize a message for a user.