5 #ifndef __XMPP_STANZA_H__
6 #define __XMPP_STANZA_H__
54 type(type),
from(
""),
to(
"") {
62 std::unique_ptr<XmlBase>
dom;
182 const std::string &ts);
184 std::string &from,
const std::string &xmlns,
185 uint8_t *data,
size_t size);
191 uint8_t *data,
size_t size);
194 static int EncodeOpen(uint8_t *data, std::string &to, std::string &from,
195 const std::string &xmlns,
size_t size);
196 static int EncodeOpenResp(uint8_t *data, std::string &to, std::string &from,
228 #endif // __XMPP_STANZA_H__
static int EncodeOpen(uint8_t *data, std::string &to, std::string &from, const std::string &xmlns, size_t size)
static const char * GetXmlns(XmlBase *doc)
bool IsValidType(XmppMessageType type) const
XmppChatMessage(XmppMessageStateType stype)
static const char * GetId(XmlBase *doc)
virtual int LoadDoc(const std::string &doc)=0
XmppStreamTlsType strmtlstype
static XmlBase * AllocXmppXmlImpl(const char *doc=NULL)
DISALLOW_COPY_AND_ASSIGN(XmppProto)
XmppPresenceShowType show
static const char * GetType(XmlBase *doc)
static int EncodeMessage(const XmppChatMessage *, uint8_t *data, size_t size)
static const char * GetDsNode(XmlBase *doc)
XmppStreamMsgType strmtype
static int EncodePresence(uint8_t *data, size_t size)
static const char * GetFrom(XmlBase *doc)
static int SetFrom(std::string &from, XmlBase *doc)
DISALLOW_COPY_AND_ASSIGN(XmppStanza)
std::unique_ptr< XmlBase > dom
static XmppStanza::XmppMessage * DecodeInternal(const XmppConnection *connection, const std::string &ts, XmlBase *impl)
static std::unique_ptr< XmlBase > open_doc_
XmppMessage(XmppMessageType type)
XmppStanzaErrorType error
static int SetXmlns(const std::string &from, XmlBase *doc)
static int EncodeIq(const XmppMessageIq *iq, XmlBase *doc, uint8_t *data, size_t size)
static int EncodeFeatureTlsProceed(uint8_t *data)
XmppMessageStateType state
static const char * GetAction(XmlBase *doc, const std::string &str)
static XmppStanza::XmppMessage * Decode(const XmppConnection *connection, const std::string &ts)
static const char * GetAsNode(XmlBase *doc)
static int SetTo(std::string &to, XmlBase *doc)
static int EncodeWhitespace(uint8_t *data)
XmppPresenceSubtype stype
const XmppMessage & operator=(const XmppMessage &)=delete
static int EncodeStream(const XmppStreamMessage &str, std::string &to, std::string &from, const std::string &xmlns, uint8_t *data, size_t size)
static int EncodeFeatureTlsStart(uint8_t *data)
static XmppXmlImplFactory * Instance()
static int EncodeFeatureTlsRequest(uint8_t *data)
static int EncodeOpenResp(uint8_t *data, std::string &to, std::string &from, size_t size)
static const char * GetNode(XmlBase *doc, const std::string &str)
static const char * GetTo(XmlBase *doc)