Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
glooxwrapper.h
Go to the documentation of this file.
1/* Copyright (C) 2023 Wildfire Games.
2 * This file is part of 0 A.D.
3 *
4 * 0 A.D. is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * 0 A.D. is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef INCLUDED_GLOOXWRAPPER_H
19#define INCLUDED_GLOOXWRAPPER_H
20
21/*
22
23The gloox API uses various STL types (std::string, std::list, etc), and
24it has functions that acquire/release ownership of objects and expect the
25library's user's 'new'/'delete' functions to be compatible with the library's.
26
27These assumptions are invalid when the game and library are built with
28different compiler versions (or the same version with different build flags):
29the STL types have different layouts, and new/delete can use different heaps.
30
31We want to let people build the game on Windows with any compiler version
32(any supported Visual Studio version, and debug vs release), without requiring
33them to rebuild the gloox library themselves. And we don't want to provide ~8
34different prebuilt versions of the library.
35
36glooxwrapper replaces the gloox API with a version that is safe to use across
37compiler versions. glooxwrapper and gloox must be compiled together with the
38same version, but the resulting library can be used with any other compiler.
39
40This is the small subset of the API that the game currently uses, with no
41attempt to be comprehensive.
42
43General design and rules:
44
45 * There is a strict boundary between gloox+glooxwrapper.cpp, and the game
46 code that includes glooxwrapper.h.
47 Objects allocated with new/delete on one side of the boundary must be
48 freed/allocated on the same side.
49 Objects allocated with glooxwrapper_alloc()/glooxwrapper_delete() can be
50 freely shared across the boundary.
51
52 * glooxwrapper.h and users of glooxwrapper must not use any types from
53 the gloox namespace, except for enums.
54
55 * std::string is replaced with glooxwrapper::string,
56 std::list with glooxwrapper::list
57
58 * Most glooxwrapper classes are simple wrappers around gloox classes.
59 Some always take ownership of their wrapped gloox object (i.e. their
60 destructor will delete the wrapped object too); some never do; and some
61 can be used either way (indicated by an m_Owned field).
62
63*/
64
65#if OS_WIN
67// Prevent gloox pulling in windows.h
68# define _WINDOWS_
69#endif
70
71#include <gloox/client.h>
72#include <gloox/mucroom.h>
73#include <gloox/registration.h>
74#include <gloox/message.h>
75#include <gloox/jinglecontent.h>
76#include <gloox/jingleiceudp.h>
77#include <gloox/jinglesessionhandler.h>
78#include <gloox/jinglesessionmanager.h>
79
80#include <cstring>
81
82// Gloox leaves some #define up, we need to undefine them.
83#undef lookup
84#undef lookup2
85#undef deflookup
86#undef deflookup2
87
88#if OS_WIN
89#define GLOOXWRAPPER_API __declspec(dllexport)
90#else
91#define GLOOXWRAPPER_API
92#endif
93
94namespace glooxwrapper
95{
96 class Client;
97 class DataForm;
98 class DelayedDelivery;
99 class Disco;
100 class IQ;
101 class JID;
102 class MUCRoom;
103 class MUCRoomConfigHandler;
104 class Message;
105 class MessageSession;
106 class OOB;
107 class Presence;
108 class StanzaError;
109 class StanzaExtension;
110 class Tag;
111
112 class ClientImpl;
113 class MUCRoomHandlerWrapper;
114 class SessionHandlerWrapper;
115
116 GLOOXWRAPPER_API void* glooxwrapper_alloc(size_t size);
118
119 class string
120 {
121 private:
122 size_t m_Size;
123 char* m_Data;
124 public:
126 {
127 m_Size = 0;
128 m_Data = (char*)glooxwrapper_alloc(1);
129 m_Data[0] = '\0';
130 }
131
132 string(const string& str)
133 {
134 m_Size = str.m_Size;
135 m_Data = (char*)glooxwrapper_alloc(m_Size + 1);
136 memcpy(m_Data, str.m_Data, m_Size + 1);
137 }
138
139 string(const std::string& str) : m_Data(NULL)
140 {
141 m_Size = str.size();
142 m_Data = (char*)glooxwrapper_alloc(m_Size + 1);
143 memcpy(m_Data, str.c_str(), m_Size + 1);
144 }
145
146 string(const char* str)
147 {
148 m_Size = strlen(str);
149 m_Data = (char*)glooxwrapper_alloc(m_Size + 1);
150 memcpy(m_Data, str, m_Size + 1);
151 }
152
153 string& operator=(const string& str)
154 {
155 if (this != &str)
156 {
158 m_Size = str.m_Size;
159 m_Data = (char*)glooxwrapper_alloc(m_Size + 1);
160 memcpy(m_Data, str.m_Data, m_Size + 1);
161 }
162 return *this;
163 }
164
166 {
168 }
169
170 /**
171 * Gloox strings are UTF encoded, so don't forget to decode it before passing it to the GUI!
172 */
173 std::string to_string() const
174 {
175 return std::string(m_Data, m_Size);
176 }
177
178 const char* c_str() const
179 {
180 return m_Data;
181 }
182
183 bool empty() const
184 {
185 return m_Size == 0;
186 }
187
188 bool operator==(const char* str) const
189 {
190 return strcmp(m_Data, str) == 0;
191 }
192
193 bool operator!=(const char* str) const
194 {
195 return strcmp(m_Data, str) != 0;
196 }
197
198 bool operator==(const string& str) const
199 {
200 return strcmp(m_Data, str.m_Data) == 0;
201 }
202
203 bool operator<(const string& str) const
204 {
205 return strcmp(m_Data, str.m_Data) < 0;
206 }
207 };
208
209 static inline std::ostream& operator<<(std::ostream& stream, const string& string)
210 {
211 return stream << string.c_str();
212 }
213
214 template<typename T>
215 class list
216 {
217 private:
218 struct node
219 {
220 node(const T& item) : m_Item(item), m_Next(NULL) {}
223 };
226
227 public:
229 {
230 const node* m_Node;
231 const_iterator(const node* n) : m_Node(n) {}
232 bool operator!=(const const_iterator& it) { return m_Node != it.m_Node; }
234 const T& operator*() { return m_Node->m_Item; }
235 };
237 const_iterator end() const { return const_iterator(NULL); }
238
239 list() : m_Head(NULL), m_Tail(NULL) {}
240
241 list(const list& src) : m_Head(NULL), m_Tail(NULL)
242 {
243 *this = src;
244 }
245
246 list& operator=(const list& src)
247 {
248 if (this != &src)
249 {
250 clear();
251 for (node* n = src.m_Head; n; n = n->m_Next)
252 push_back(n->m_Item);
253 }
254 return *this;
255 }
256
258 {
259 clear();
260 }
261
262 void push_back(const T& item)
263 {
264 node* n = new (glooxwrapper_alloc(sizeof(node))) node(item);
265 if (m_Tail)
266 m_Tail->m_Next = n;
267 m_Tail = n;
268 if (!m_Head)
269 m_Head = n;
270 }
271
272 void clear()
273 {
274 node* n = m_Head;
275 while (n)
276 {
277 node* next = n->m_Next;
279 n = next;
280 }
281 m_Head = m_Tail = NULL;
282 }
283
284 const T& front() const
285 {
286 return *begin();
287 }
288 };
289
292
293 struct CertInfo
294 {
296 bool chain;
297 string issuer;
298 string server;
301 string protocol;
302 string cipher;
303 string mac;
305 };
306
308 {
309 string username;
310 string nick;
311 string password;
312 string name;
313 string first;
314 string last;
315 string email;
316 string address;
317 string city;
318 string state;
319 string zip;
320 string phone;
321 string url;
322 string date;
323#if !OS_WIN
324 string misc;
325 string text;
326#endif
327 };
328
330 {
332 gloox::MUCRoomAffiliation affiliation;
333 gloox::MUCRoomRole role;
335 int flags;
336 string reason;
338 string newNick;
339 string status;
341 };
342
343
345 {
346 public:
348 virtual void onConnect() = 0;
349 virtual void onDisconnect(gloox::ConnectionError e) = 0;
350 virtual bool onTLSConnect(const CertInfo& info) = 0;
351 };
352
354 {
355 public:
356 virtual ~IqHandler() {}
357 virtual bool handleIq(const IQ& iq) = 0;
358 virtual void handleIqID(const IQ& iq, int context) = 0;
359 };
360
362 {
363 public:
364 virtual ~MessageHandler() {}
365 virtual void handleMessage(const Message& msg, MessageSession* session = 0) = 0; // MessageSession not supported
366 };
367
369 {
370 public:
371 virtual ~MUCRoomHandler() {}
372 virtual void handleMUCParticipantPresence(MUCRoom& room, const MUCRoomParticipant participant, const Presence& presence) = 0;
373 virtual void handleMUCMessage(MUCRoom& room, const Message& msg, bool priv) = 0;
374 virtual void handleMUCError(MUCRoom& room, gloox::StanzaError error) = 0;
375 virtual void handleMUCSubject(MUCRoom& room, const string& nick, const string& subject) = 0;
376 };
377
379 {
380 public:
382 virtual void handleRegistrationFields(const JID& from, int fields, string instructions) = 0;
383 virtual void handleAlreadyRegistered(const JID& from) = 0;
384 virtual void handleRegistrationResult(const JID& from, gloox::RegistrationResult regResult) = 0;
385 virtual void handleDataForm(const JID& from, const DataForm& form) = 0; // DataForm not supported
386 virtual void handleOOB(const JID& from, const OOB& oob) = 0; // OOB not supported
387 };
388
390 {
391 public:
392 StanzaExtension(int type) : m_extensionType(type) {}
393 virtual ~StanzaExtension() {}
394 virtual const string& filterString() const = 0;
395 virtual StanzaExtension* newInstance(const Tag* tag) const = 0;
396 virtual glooxwrapper::Tag* tag() const = 0;
397 virtual StanzaExtension* clone() const = 0;
398
399 int extensionType() const { return m_extensionType; }
400 private:
402 };
403
404
406 {
408 private:
409 gloox::Client* m_Wrapped;
412
413 public:
414 gloox::Client* getWrapped() { return m_Wrapped; }
415
416 bool connect(bool block = true);
417 gloox::ConnectionError recv(int timeout = -1);
418 const string getID() const;
419 const string getJID() const;
420 void send(const IQ& iq);
421
422 void setTls(gloox::TLSPolicy tls);
423 void setCompression(bool compression);
424
425 void setSASLMechanisms(int mechanisms);
426 void registerStanzaExtension(StanzaExtension* ext);
427 void registerConnectionListener(ConnectionListener* cl);
428 void registerIqHandler(IqHandler* ih, int exttype);
429 void registerMessageHandler(MessageHandler* mh);
430
431 bool removePresenceExtension(int type);
432
433 Disco* disco() const { return m_DiscoWrapper; }
434
435 Client(const string& server);
436 Client(const JID& jid, const string& password, int port = -1);
437 ~Client();
438
439 void setPresence(gloox::Presence::PresenceType pres, int priority, const string& status = "");
440 void disconnect();
441 };
442
444 {
446 private:
447 const gloox::DelayedDelivery* m_Wrapped;
448 public:
449 DelayedDelivery(const gloox::DelayedDelivery* wrapped);
450 const string stamp() const;
451 };
452
454 {
456 private:
457 gloox::Disco* m_Wrapped;
458 public:
459 Disco(gloox::Disco* wrapped);
460 void setVersion(const string& name, const string& version, const string& os = "");
461 void setIdentity(const string& category, const string& type, const string& name = "");
462 };
463
465 {
467 private:
468 gloox::IQ* m_Wrapped;
470 public:
471 const gloox::IQ& getWrapped() const { return *m_Wrapped; }
472 IQ(const gloox::IQ& iq) : m_Wrapped(const_cast<gloox::IQ*>(&iq)), m_Owned(false) { }
473
474 IQ(gloox::IQ::IqType type, const JID& to, const string& id);
475 ~IQ();
476
477 void addExtension(const StanzaExtension* se);
478 const StanzaExtension* findExtension(int type) const;
479
480 template<class T>
481 inline const T* findExtension(int type) const
482 {
483 return static_cast<const T*>(findExtension(type));
484 }
485
486 gloox::IQ::IqType subtype() const;
487 const string id() const;
488 const gloox::JID& from() const;
489
490 gloox::StanzaError error_error() const; // wrapper for ->error()->error()
491 Tag* tag() const;
492 };
493
495 {
497 private:
498 gloox::JID* m_Wrapped;
500 void init(const char* data, size_t len);
501 public:
502 const gloox::JID& getWrapped() const { return *m_Wrapped; }
503 JID(const gloox::JID& jid) : m_Wrapped(const_cast<gloox::JID*>(&jid)), m_Owned(false) { }
504
505 JID();
506 JID(const string& jid);
507 JID(const std::string& jid) { init(jid.c_str(), jid.size()); }
508 ~JID();
509
510 string username() const;
511 string resource() const;
512 };
513
515 {
517 private:
518 gloox::Message* m_Wrapped;
522 public:
523 Message(gloox::Message* wrapped, bool owned);
524 ~Message();
525 gloox::Message::MessageType subtype() const;
526 const JID& from() const;
527 string body() const;
528 string subject(const string& lang = "default") const;
529 string thread() const;
530 const glooxwrapper::DelayedDelivery* when() const;
531 };
532
534 {
536 private:
537 gloox::MUCRoom* m_Wrapped;
540 public:
541 MUCRoom(gloox::MUCRoom* room, bool owned);
542 MUCRoom(Client* parent, const JID& nick, MUCRoomHandler* mrh, MUCRoomConfigHandler* mrch = 0);
543 ~MUCRoom();
544 const string nick() const;
545 const string name() const;
546 const string service() const;
547 void join(gloox::Presence::PresenceType type = gloox::Presence::Available, const string& status = "", int priority = 0);
548 void leave(const string& msg = "");
549 void send(const string& message);
550 void setNick(const string& nick);
551 void setPresence(gloox::Presence::PresenceType presence, const string& msg = "");
552 void setRequestHistory(int value, gloox::MUCRoom::HistoryRequestType type);
553 void kick(const string& nick, const string& reason);
554 void ban(const string& nick, const string& reason);
555 };
556
558 {
559 gloox::Presence::PresenceType m_Presence;
560 public:
561 Presence(gloox::Presence::PresenceType presence) : m_Presence(presence) {}
562 gloox::Presence::PresenceType presence() const { return m_Presence; }
563 };
564
566 {
568 private:
569 gloox::Registration* m_Wrapped;
570 std::list<std::shared_ptr<gloox::RegistrationHandler> > m_RegistrationHandlers;
571 public:
572 Registration(Client* parent);
574 void fetchRegistrationFields();
575 bool createAccount(int fields, const RegistrationFields& values);
576 void registerRegistrationHandler(RegistrationHandler* rh);
577 };
578
580 {
582 private:
583 gloox::Tag* m_Wrapped;
585
586 Tag(const string& name);
587 Tag(const string& name, const string& cdata);
588 Tag(gloox::Tag* wrapped, bool owned) : m_Wrapped(wrapped), m_Owned(owned) {}
589 ~Tag();
590
591 public:
592 // Internal use:
593 gloox::Tag* getWrapped() { return m_Wrapped; }
594 gloox::Tag* stealWrapped() { m_Owned = false; return m_Wrapped; }
595 static Tag* allocate(gloox::Tag* wrapped, bool owned);
596
597 // Instead of using new/delete, Tags must be allocated/freed with these functions
598 static Tag* allocate(const string& name);
599 static Tag* allocate(const string& name, const string& cdata);
600 static void free(const Tag* tag);
601
602 bool addAttribute(const string& name, const string& value);
603 string findAttribute(const string& name) const;
604 Tag* clone() const;
605 string xmlns() const;
606 bool setXmlns(const string& xmlns);
607 string xml() const;
608 void addChild(Tag* child);
609 string name() const;
610 string cdata() const;
611 const Tag* findTag_clone(const string& expression) const; // like findTag but must be Tag::free()d
612 ConstTagList findTagList_clone(const string& expression) const; // like findTagList but each tag must be Tag::free()d
613 };
614
615 /**
616 * See XEP-0166: Jingle and https://camaya.net/api/gloox/namespacegloox_1_1Jingle.html.
617 */
618 namespace Jingle
619 {
620
622 {
623 protected:
624 const gloox::Jingle::Plugin* m_Wrapped;
626
627 public:
628 Plugin(const gloox::Jingle::Plugin* wrapped, bool owned) : m_Wrapped(wrapped), m_Owned(owned) {}
629
630 virtual ~Plugin();
631
632 const Plugin findPlugin(int type) const;
633 const gloox::Jingle::Plugin* getWrapped() const { return m_Wrapped; }
634 };
635
637
638 /**
639 * See XEP-0176: Jingle ICE-UDP Transport Method
640 */
642 {
643 public:
644 struct Candidate {
645 string ip;
646 int port;
647 };
648 private:
649 // Class not implemented as it is not used.
650 ICEUDP() = delete;
651 };
652
654 {
655 protected:
656 gloox::Jingle::Session* m_Wrapped;
658
659 public:
661 {
662 private:
663 const gloox::Jingle::Session::Jingle* m_Wrapped;
665 public:
666 Jingle(const gloox::Jingle::Session::Jingle* wrapped, bool owned) : m_Wrapped(wrapped), m_Owned(owned) {}
668 {
669 if (m_Owned)
670 delete m_Wrapped;
671 }
672 ICEUDP::Candidate getCandidate() const;
673 };
674
675 Session(gloox::Jingle::Session* wrapped, bool owned);
676 ~Session();
677
678 bool sessionInitiate(const char* ipStr, uint16_t port);
679 };
680
682 {
683 public:
684 virtual ~SessionHandler() {}
685 virtual void handleSessionAction(gloox::Jingle::Action action, Session& session, const Session::Jingle& jingle) = 0;
686 };
687
688 }
689
691 {
692 private:
693 gloox::Jingle::SessionManager* m_Wrapped;
695
696 public:
699 void registerPlugins();
700 Jingle::Session createSession(const JID& callee);
701 };
702
703}
704
705#endif // INCLUDED_GLOOXWRAPPER_H
Definition: glooxwrapper.cpp:311
Definition: glooxwrapper.h:406
Disco * m_DiscoWrapper
Definition: glooxwrapper.h:411
gloox::Client * getWrapped()
Definition: glooxwrapper.h:414
Disco * disco() const
Definition: glooxwrapper.h:433
gloox::Client * m_Wrapped
Definition: glooxwrapper.h:409
ClientImpl * m_Impl
Definition: glooxwrapper.h:410
Definition: glooxwrapper.h:345
virtual bool onTLSConnect(const CertInfo &info)=0
virtual ~ConnectionListener()
Definition: glooxwrapper.h:347
virtual void onDisconnect(gloox::ConnectionError e)=0
Definition: glooxwrapper.h:444
const gloox::DelayedDelivery * m_Wrapped
Definition: glooxwrapper.h:447
NONCOPYABLE(DelayedDelivery)
Definition: glooxwrapper.h:454
gloox::Disco * m_Wrapped
Definition: glooxwrapper.h:457
Definition: glooxwrapper.h:465
bool m_Owned
Definition: glooxwrapper.h:469
gloox::IQ * m_Wrapped
Definition: glooxwrapper.h:468
const gloox::IQ & getWrapped() const
Definition: glooxwrapper.h:471
IQ(const gloox::IQ &iq)
Definition: glooxwrapper.h:472
const T * findExtension(int type) const
Definition: glooxwrapper.h:481
Definition: glooxwrapper.h:354
virtual ~IqHandler()
Definition: glooxwrapper.h:356
virtual bool handleIq(const IQ &iq)=0
virtual void handleIqID(const IQ &iq, int context)=0
Definition: glooxwrapper.h:495
gloox::JID * m_Wrapped
Definition: glooxwrapper.h:498
JID(const std::string &jid)
Definition: glooxwrapper.h:507
bool m_Owned
Definition: glooxwrapper.h:499
const gloox::JID & getWrapped() const
Definition: glooxwrapper.h:502
JID(const gloox::JID &jid)
Definition: glooxwrapper.h:503
See XEP-0176: Jingle ICE-UDP Transport Method.
Definition: glooxwrapper.h:642
Definition: glooxwrapper.h:622
const gloox::Jingle::Plugin * m_Wrapped
Definition: glooxwrapper.h:624
const gloox::Jingle::Plugin * getWrapped() const
Definition: glooxwrapper.h:633
bool m_Owned
Definition: glooxwrapper.h:625
Plugin(const gloox::Jingle::Plugin *wrapped, bool owned)
Definition: glooxwrapper.h:628
Definition: glooxwrapper.h:682
virtual ~SessionHandler()
Definition: glooxwrapper.h:684
virtual void handleSessionAction(gloox::Jingle::Action action, Session &session, const Session::Jingle &jingle)=0
Definition: glooxwrapper.h:661
const gloox::Jingle::Session::Jingle * m_Wrapped
Definition: glooxwrapper.h:663
~Jingle()
Definition: glooxwrapper.h:667
bool m_Owned
Definition: glooxwrapper.h:664
Jingle(const gloox::Jingle::Session::Jingle *wrapped, bool owned)
Definition: glooxwrapper.h:666
Definition: glooxwrapper.h:654
bool m_Owned
Definition: glooxwrapper.h:657
gloox::Jingle::Session * m_Wrapped
Definition: glooxwrapper.h:656
Definition: glooxwrapper.cpp:117
Definition: glooxwrapper.h:369
virtual ~MUCRoomHandler()
Definition: glooxwrapper.h:371
virtual void handleMUCError(MUCRoom &room, gloox::StanzaError error)=0
virtual void handleMUCParticipantPresence(MUCRoom &room, const MUCRoomParticipant participant, const Presence &presence)=0
virtual void handleMUCSubject(MUCRoom &room, const string &nick, const string &subject)=0
virtual void handleMUCMessage(MUCRoom &room, const Message &msg, bool priv)=0
Definition: glooxwrapper.h:534
bool m_Owned
Definition: glooxwrapper.h:539
gloox::MUCRoom * m_Wrapped
Definition: glooxwrapper.h:537
MUCRoomHandlerWrapper * m_HandlerWrapper
Definition: glooxwrapper.h:538
Definition: glooxwrapper.h:362
virtual ~MessageHandler()
Definition: glooxwrapper.h:364
virtual void handleMessage(const Message &msg, MessageSession *session=0)=0
Definition: glooxwrapper.h:515
glooxwrapper::DelayedDelivery * m_DelayedDelivery
Definition: glooxwrapper.h:521
glooxwrapper::JID m_From
Definition: glooxwrapper.h:520
bool m_Owned
Definition: glooxwrapper.h:519
gloox::Message * m_Wrapped
Definition: glooxwrapper.h:518
Definition: glooxwrapper.h:558
gloox::Presence::PresenceType presence() const
Definition: glooxwrapper.h:562
gloox::Presence::PresenceType m_Presence
Definition: glooxwrapper.h:559
Presence(gloox::Presence::PresenceType presence)
Definition: glooxwrapper.h:561
Definition: glooxwrapper.h:379
virtual void handleOOB(const JID &from, const OOB &oob)=0
virtual void handleRegistrationResult(const JID &from, gloox::RegistrationResult regResult)=0
virtual void handleAlreadyRegistered(const JID &from)=0
virtual ~RegistrationHandler()
Definition: glooxwrapper.h:381
virtual void handleRegistrationFields(const JID &from, int fields, string instructions)=0
virtual void handleDataForm(const JID &from, const DataForm &form)=0
Definition: glooxwrapper.h:566
std::list< std::shared_ptr< gloox::RegistrationHandler > > m_RegistrationHandlers
Definition: glooxwrapper.h:570
gloox::Registration * m_Wrapped
Definition: glooxwrapper.h:569
Definition: glooxwrapper.cpp:280
Definition: glooxwrapper.h:691
gloox::Jingle::SessionManager * m_Wrapped
Definition: glooxwrapper.h:693
SessionHandlerWrapper * m_HandlerWrapper
Definition: glooxwrapper.h:694
Definition: glooxwrapper.h:390
virtual StanzaExtension * newInstance(const Tag *tag) const =0
int extensionType() const
Definition: glooxwrapper.h:399
StanzaExtension(int type)
Definition: glooxwrapper.h:392
virtual StanzaExtension * clone() const =0
virtual ~StanzaExtension()
Definition: glooxwrapper.h:393
virtual const string & filterString() const =0
virtual glooxwrapper::Tag * tag() const =0
int m_extensionType
Definition: glooxwrapper.h:401
Definition: glooxwrapper.h:580
gloox::Tag * stealWrapped()
Definition: glooxwrapper.h:594
bool m_Owned
Definition: glooxwrapper.h:584
Tag(gloox::Tag *wrapped, bool owned)
Definition: glooxwrapper.h:588
gloox::Tag * m_Wrapped
Definition: glooxwrapper.h:583
gloox::Tag * getWrapped()
Definition: glooxwrapper.h:593
Definition: glooxwrapper.h:216
list(const list &src)
Definition: glooxwrapper.h:241
void clear()
Definition: glooxwrapper.h:272
list & operator=(const list &src)
Definition: glooxwrapper.h:246
const_iterator end() const
Definition: glooxwrapper.h:237
const T & front() const
Definition: glooxwrapper.h:284
~list()
Definition: glooxwrapper.h:257
node * m_Tail
Definition: glooxwrapper.h:225
const_iterator begin() const
Definition: glooxwrapper.h:236
void push_back(const T &item)
Definition: glooxwrapper.h:262
node * m_Head
Definition: glooxwrapper.h:224
list()
Definition: glooxwrapper.h:239
Definition: glooxwrapper.h:120
bool operator!=(const char *str) const
Definition: glooxwrapper.h:193
size_t m_Size
Definition: glooxwrapper.h:122
bool empty() const
Definition: glooxwrapper.h:183
std::string to_string() const
Gloox strings are UTF encoded, so don't forget to decode it before passing it to the GUI!
Definition: glooxwrapper.h:173
string(const std::string &str)
Definition: glooxwrapper.h:139
char * m_Data
Definition: glooxwrapper.h:123
~string()
Definition: glooxwrapper.h:165
string(const string &str)
Definition: glooxwrapper.h:132
string & operator=(const string &str)
Definition: glooxwrapper.h:153
const char * c_str() const
Definition: glooxwrapper.h:178
string(const char *str)
Definition: glooxwrapper.h:146
bool operator==(const char *str) const
Definition: glooxwrapper.h:188
bool operator<(const string &str) const
Definition: glooxwrapper.h:203
bool operator==(const string &str) const
Definition: glooxwrapper.h:198
string()
Definition: glooxwrapper.h:125
#define GLOOXWRAPPER_API
Definition: glooxwrapper.h:91
bool error(JSContext *cx, uint argc, JS::Value *vp)
Definition: ScriptInterface.cpp:173
list< const Plugin * > PluginList
Definition: glooxwrapper.h:636
Definition: glooxwrapper.cpp:46
static std::ostream & operator<<(std::ostream &stream, const string &string)
Definition: glooxwrapper.h:209
glooxwrapper::list< const Tag * > ConstTagList
Definition: glooxwrapper.h:291
GLOOXWRAPPER_API void * glooxwrapper_alloc(size_t size)
Definition: glooxwrapper.cpp:31
GLOOXWRAPPER_API void glooxwrapper_free(void *p)
Definition: glooxwrapper.cpp:39
glooxwrapper::list< Tag * > TagList
Definition: glooxwrapper.h:290
def xml
Definition: tests.py:138
#define T(string_literal)
Definition: secure_crt.cpp:77
Definition: glooxwrapper.h:294
string server
Definition: glooxwrapper.h:298
int date_to
Definition: glooxwrapper.h:300
string compression
Definition: glooxwrapper.h:304
string issuer
Definition: glooxwrapper.h:297
bool chain
Definition: glooxwrapper.h:296
string protocol
Definition: glooxwrapper.h:301
int status
Definition: glooxwrapper.h:295
int date_from
Definition: glooxwrapper.h:299
string cipher
Definition: glooxwrapper.h:302
string mac
Definition: glooxwrapper.h:303
Definition: glooxwrapper.h:644
string ip
Definition: glooxwrapper.h:645
int port
Definition: glooxwrapper.h:646
Definition: glooxwrapper.h:330
int flags
Definition: glooxwrapper.h:335
string newNick
Definition: glooxwrapper.h:338
JID * actor
Definition: glooxwrapper.h:337
JID * jid
Definition: glooxwrapper.h:334
gloox::MUCRoomAffiliation affiliation
Definition: glooxwrapper.h:332
string reason
Definition: glooxwrapper.h:336
JID * alternate
Definition: glooxwrapper.h:340
JID * nick
Definition: glooxwrapper.h:331
string status
Definition: glooxwrapper.h:339
gloox::MUCRoomRole role
Definition: glooxwrapper.h:333
Definition: glooxwrapper.h:308
string nick
Definition: glooxwrapper.h:310
string zip
Definition: glooxwrapper.h:319
string email
Definition: glooxwrapper.h:315
string url
Definition: glooxwrapper.h:321
string name
Definition: glooxwrapper.h:312
string last
Definition: glooxwrapper.h:314
string password
Definition: glooxwrapper.h:311
string text
Definition: glooxwrapper.h:325
string username
Definition: glooxwrapper.h:309
string phone
Definition: glooxwrapper.h:320
string address
Definition: glooxwrapper.h:316
string date
Definition: glooxwrapper.h:322
string city
Definition: glooxwrapper.h:317
string first
Definition: glooxwrapper.h:313
string state
Definition: glooxwrapper.h:318
string misc
Definition: glooxwrapper.h:324
Definition: glooxwrapper.h:229
const_iterator(const node *n)
Definition: glooxwrapper.h:231
const T & operator*()
Definition: glooxwrapper.h:234
const node * m_Node
Definition: glooxwrapper.h:230
const_iterator & operator++()
Definition: glooxwrapper.h:233
bool operator!=(const const_iterator &it)
Definition: glooxwrapper.h:232
Definition: glooxwrapper.h:219
node(const T &item)
Definition: glooxwrapper.h:220
node * m_Next
Definition: glooxwrapper.h:222
T m_Item
Definition: glooxwrapper.h:221
unsigned short uint16_t
Definition: wposix_types.h:52