Pyrogenesis  trunk
glooxwrapper.h
Go to the documentation of this file.
1 /* Copyright (C) 2021 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 
23 The gloox API uses various STL types (std::string, std::list, etc), and
24 it has functions that acquire/release ownership of objects and expect the
25 library's user's 'new'/'delete' functions to be compatible with the library's.
26 
27 These assumptions are invalid when the game and library are built with
28 different compiler versions (or the same version with different build flags):
29 the STL types have different layouts, and new/delete can use different heaps.
30 
31 We 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
33 them to rebuild the gloox library themselves. And we don't want to provide ~8
34 different prebuilt versions of the library.
35 
36 glooxwrapper replaces the gloox API with a version that is safe to use across
37 compiler versions. glooxwrapper and gloox must be compiled together with the
38 same version, but the resulting library can be used with any other compiler.
39 
40 This is the small subset of the API that the game currently uses, with no
41 attempt to be comprehensive.
42 
43 General 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
66 # include "lib/sysdep/os/win/win.h"
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 
94 namespace 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);
117  GLOOXWRAPPER_API void glooxwrapper_free(void* p);
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  {
157  glooxwrapper_free(m_Data);
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  {
167  glooxwrapper_free(m_Data);
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; }
233  const_iterator& operator++() { m_Node = m_Node->m_Next; return *this; }
234  const T& operator*() { return m_Node->m_Item; }
235  };
236  const_iterator begin() const { return const_iterator(m_Head); }
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  {
295  int status;
296  bool chain;
297  string issuer;
298  string server;
300  int date_to;
301  string protocol;
302  string cipher;
303  string mac;
304  string compression;
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  string misc;
324  string text;
325  };
326 
328  {
330  gloox::MUCRoomAffiliation affiliation;
331  gloox::MUCRoomRole role;
333  int flags;
334  string reason;
336  string newNick;
337  string status;
339  };
340 
341 
343  {
344  public:
345  virtual ~ConnectionListener() {}
346  virtual void onConnect() = 0;
347  virtual void onDisconnect(gloox::ConnectionError e) = 0;
348  virtual bool onTLSConnect(const CertInfo& info) = 0;
349  };
350 
352  {
353  public:
354  virtual ~IqHandler() {}
355  virtual bool handleIq(const IQ& iq) = 0;
356  virtual void handleIqID(const IQ& iq, int context) = 0;
357  };
358 
360  {
361  public:
362  virtual ~MessageHandler() {}
363  virtual void handleMessage(const Message& msg, MessageSession* session = 0) = 0; // MessageSession not supported
364  };
365 
367  {
368  public:
369  virtual ~MUCRoomHandler() {}
370  virtual void handleMUCParticipantPresence(MUCRoom& room, const MUCRoomParticipant participant, const Presence& presence) = 0;
371  virtual void handleMUCMessage(MUCRoom& room, const Message& msg, bool priv) = 0;
372  virtual void handleMUCError(MUCRoom& room, gloox::StanzaError error) = 0;
373  virtual void handleMUCSubject(MUCRoom& room, const string& nick, const string& subject) = 0;
374  };
375 
377  {
378  public:
379  virtual ~RegistrationHandler() {}
380  virtual void handleRegistrationFields(const JID& from, int fields, string instructions) = 0;
381  virtual void handleAlreadyRegistered(const JID& from) = 0;
382  virtual void handleRegistrationResult(const JID& from, gloox::RegistrationResult regResult) = 0;
383  virtual void handleDataForm(const JID& from, const DataForm& form) = 0; // DataForm not supported
384  virtual void handleOOB(const JID& from, const OOB& oob) = 0; // OOB not supported
385  };
386 
388  {
389  public:
390  StanzaExtension(int type) : m_extensionType(type) {}
391  virtual ~StanzaExtension() {}
392  virtual const string& filterString() const = 0;
393  virtual StanzaExtension* newInstance(const Tag* tag) const = 0;
394  virtual glooxwrapper::Tag* tag() const = 0;
395  virtual StanzaExtension* clone() const = 0;
396 
397  int extensionType() const { return m_extensionType; }
398  private:
400  };
401 
402 
404  {
406  private:
407  gloox::Client* m_Wrapped;
410 
411  public:
412  gloox::Client* getWrapped() { return m_Wrapped; }
413 
414  bool connect(bool block = true);
415  gloox::ConnectionError recv(int timeout = -1);
416  const string getID() const;
417  const string getJID() const;
418  void send(const IQ& iq);
419 
420  void setTls(gloox::TLSPolicy tls);
421  void setCompression(bool compression);
422 
423  void setSASLMechanisms(int mechanisms);
424  void registerStanzaExtension(StanzaExtension* ext);
425  void registerConnectionListener(ConnectionListener* cl);
426  void registerIqHandler(IqHandler* ih, int exttype);
427  void registerMessageHandler(MessageHandler* mh);
428 
429  bool removePresenceExtension(int type);
430 
431  Disco* disco() const { return m_DiscoWrapper; }
432 
433  Client(const string& server);
434  Client(const JID& jid, const string& password, int port = -1);
435  ~Client();
436 
437  void setPresence(gloox::Presence::PresenceType pres, int priority, const string& status = "");
438  void disconnect();
439  };
440 
442  {
444  private:
445  const gloox::DelayedDelivery* m_Wrapped;
446  public:
447  DelayedDelivery(const gloox::DelayedDelivery* wrapped);
448  const string stamp() const;
449  };
450 
452  {
454  private:
455  gloox::Disco* m_Wrapped;
456  public:
457  Disco(gloox::Disco* wrapped);
458  void setVersion(const string& name, const string& version, const string& os = "");
459  void setIdentity(const string& category, const string& type, const string& name = "");
460  };
461 
463  {
464  NONCOPYABLE(IQ);
465  private:
466  gloox::IQ* m_Wrapped;
467  bool m_Owned;
468  public:
469  const gloox::IQ& getWrapped() const { return *m_Wrapped; }
470  IQ(const gloox::IQ& iq) : m_Wrapped(const_cast<gloox::IQ*>(&iq)), m_Owned(false) { }
471 
472  IQ(gloox::IQ::IqType type, const JID& to, const string& id);
473  ~IQ();
474 
475  void addExtension(const StanzaExtension* se);
476  const StanzaExtension* findExtension(int type) const;
477 
478  template<class T>
479  inline const T* findExtension(int type) const
480  {
481  return static_cast<const T*>(findExtension(type));
482  }
483 
484  gloox::IQ::IqType subtype() const;
485  const string id() const;
486  const gloox::JID& from() const;
487 
488  gloox::StanzaError error_error() const; // wrapper for ->error()->error()
489  Tag* tag() const;
490  };
491 
493  {
494  NONCOPYABLE(JID);
495  private:
496  gloox::JID* m_Wrapped;
497  bool m_Owned;
498  void init(const char* data, size_t len);
499  public:
500  const gloox::JID& getWrapped() const { return *m_Wrapped; }
501  JID(const gloox::JID& jid) : m_Wrapped(const_cast<gloox::JID*>(&jid)), m_Owned(false) { }
502 
503  JID();
504  JID(const string& jid);
505  JID(const std::string& jid) { init(jid.c_str(), jid.size()); }
506  ~JID();
507 
508  string username() const;
509  string resource() const;
510  };
511 
513  {
515  private:
516  gloox::Message* m_Wrapped;
517  bool m_Owned;
520  public:
521  Message(gloox::Message* wrapped, bool owned);
522  ~Message();
523  gloox::Message::MessageType subtype() const;
524  const JID& from() const;
525  string body() const;
526  string subject(const string& lang = "default") const;
527  string thread() const;
528  const glooxwrapper::DelayedDelivery* when() const;
529  };
530 
532  {
534  private:
535  gloox::MUCRoom* m_Wrapped;
537  bool m_Owned;
538  public:
539  MUCRoom(gloox::MUCRoom* room, bool owned);
540  MUCRoom(Client* parent, const JID& nick, MUCRoomHandler* mrh, MUCRoomConfigHandler* mrch = 0);
541  ~MUCRoom();
542  const string nick() const;
543  const string name() const;
544  const string service() const;
545  void join(gloox::Presence::PresenceType type = gloox::Presence::Available, const string& status = "", int priority = 0);
546  void leave(const string& msg = "");
547  void send(const string& message);
548  void setNick(const string& nick);
549  void setPresence(gloox::Presence::PresenceType presence, const string& msg = "");
550  void setRequestHistory(int value, gloox::MUCRoom::HistoryRequestType type);
551  void kick(const string& nick, const string& reason);
552  void ban(const string& nick, const string& reason);
553  };
554 
556  {
557  gloox::Presence::PresenceType m_Presence;
558  public:
559  Presence(gloox::Presence::PresenceType presence) : m_Presence(presence) {}
560  gloox::Presence::PresenceType presence() const { return m_Presence; }
561  };
562 
564  {
566  private:
567  gloox::Registration* m_Wrapped;
568  std::list<std::shared_ptr<gloox::RegistrationHandler> > m_RegistrationHandlers;
569  public:
570  Registration(Client* parent);
571  ~Registration();
572  void fetchRegistrationFields();
573  bool createAccount(int fields, const RegistrationFields& values);
574  void registerRegistrationHandler(RegistrationHandler* rh);
575  };
576 
578  {
579  NONCOPYABLE(Tag);
580  private:
581  gloox::Tag* m_Wrapped;
582  bool m_Owned;
583 
584  Tag(const string& name);
585  Tag(const string& name, const string& cdata);
586  Tag(gloox::Tag* wrapped, bool owned) : m_Wrapped(wrapped), m_Owned(owned) {}
587  ~Tag();
588 
589  public:
590  // Internal use:
591  gloox::Tag* getWrapped() { return m_Wrapped; }
592  gloox::Tag* stealWrapped() { m_Owned = false; return m_Wrapped; }
593  static Tag* allocate(gloox::Tag* wrapped, bool owned);
594 
595  // Instead of using new/delete, Tags must be allocated/freed with these functions
596  static Tag* allocate(const string& name);
597  static Tag* allocate(const string& name, const string& cdata);
598  static void free(const Tag* tag);
599 
600  bool addAttribute(const string& name, const string& value);
601  string findAttribute(const string& name) const;
602  Tag* clone() const;
603  string xmlns() const;
604  bool setXmlns(const string& xmlns);
605  string xml() const;
606  void addChild(Tag* child);
607  string name() const;
608  string cdata() const;
609  const Tag* findTag_clone(const string& expression) const; // like findTag but must be Tag::free()d
610  ConstTagList findTagList_clone(const string& expression) const; // like findTagList but each tag must be Tag::free()d
611  };
612 
613  /**
614  * See XEP-0166: Jingle and https://camaya.net/api/gloox/namespacegloox_1_1Jingle.html.
615  */
616  namespace Jingle
617  {
618 
620  {
621  protected:
622  const gloox::Jingle::Plugin* m_Wrapped;
623  bool m_Owned;
624 
625  public:
626  Plugin(const gloox::Jingle::Plugin* wrapped, bool owned) : m_Wrapped(wrapped), m_Owned(owned) {}
627 
628  virtual ~Plugin();
629 
630  const Plugin findPlugin(int type) const;
631  const gloox::Jingle::Plugin* getWrapped() const { return m_Wrapped; }
632  };
633 
635 
636  /**
637  * See XEP-0176: Jingle ICE-UDP Transport Method
638  */
640  {
641  public:
642  struct Candidate {
643  string ip;
644  int port;
645  };
646  private:
647  // Class not implemented as it is not used.
648  ICEUDP() = delete;
649  };
650 
652  {
653  protected:
654  gloox::Jingle::Session* m_Wrapped;
655  bool m_Owned;
656 
657  public:
659  {
660  private:
661  const gloox::Jingle::Session::Jingle* m_Wrapped;
662  bool m_Owned;
663  public:
664  Jingle(const gloox::Jingle::Session::Jingle* wrapped, bool owned) : m_Wrapped(wrapped), m_Owned(owned) {}
666  {
667  if (m_Owned)
668  delete m_Wrapped;
669  }
670  ICEUDP::Candidate getCandidate() const;
671  };
672 
673  Session(gloox::Jingle::Session* wrapped, bool owned);
674  ~Session();
675 
676  bool sessionInitiate(const char* ipStr, uint16_t port);
677  };
678 
680  {
681  public:
682  virtual ~SessionHandler() {}
683  virtual void handleSessionAction(gloox::Jingle::Action action, Session& session, const Session::Jingle& jingle) = 0;
684  };
685 
686  }
687 
689  {
690  private:
691  gloox::Jingle::SessionManager* m_Wrapped;
693 
694  public:
696  ~SessionManager();
697  void registerPlugins();
698  Jingle::Session createSession(const JID& callee);
699  };
700 
701 }
702 
703 #endif // INCLUDED_GLOOXWRAPPER_H
#define NONCOPYABLE(className)
Indicates that a class is noncopyable (usually due to const or reference members, or because the clas...
Definition: code_annotation.h:227
string username
Definition: glooxwrapper.h:309
JID(const std::string &jid)
Definition: glooxwrapper.h:505
string status
Definition: glooxwrapper.h:337
Definition: glooxwrapper.h:376
virtual ~StanzaExtension()
Definition: glooxwrapper.h:391
void clear()
Definition: glooxwrapper.h:272
list(const list &src)
Definition: glooxwrapper.h:241
int date_to
Definition: glooxwrapper.h:300
std::string to_string() const
Gloox strings are UTF encoded, so don&#39;t forget to decode it before passing it to the GUI! ...
Definition: glooxwrapper.h:173
gloox::Registration * m_Wrapped
Definition: glooxwrapper.h:567
string protocol
Definition: glooxwrapper.h:301
Definition: glooxwrapper.h:228
Definition: glooxwrapper.cpp:306
virtual ~MessageHandler()
Definition: glooxwrapper.h:362
string phone
Definition: glooxwrapper.h:320
int date_from
Definition: glooxwrapper.h:299
string nick
Definition: glooxwrapper.h:310
glooxwrapper::list< const Tag * > ConstTagList
Definition: glooxwrapper.h:291
gloox::Jingle::SessionManager * m_Wrapped
Definition: glooxwrapper.h:691
string state
Definition: glooxwrapper.h:318
string(const string &str)
Definition: glooxwrapper.h:132
const_iterator end() const
Definition: glooxwrapper.h:237
bool empty() const
Definition: glooxwrapper.h:183
bool m_Owned
Definition: glooxwrapper.h:517
bool(void *pContext, const CFsmEvent *pEvent) Action
Definition: FSM.h:34
JID * actor
Definition: glooxwrapper.h:335
Definition: glooxwrapper.h:327
Definition: glooxwrapper.h:451
bool m_Owned
Definition: glooxwrapper.h:623
string newNick
Definition: glooxwrapper.h:336
string city
Definition: glooxwrapper.h:317
ClientImpl * m_Impl
Definition: glooxwrapper.h:408
~Jingle()
Definition: glooxwrapper.h:665
const T & front() const
Definition: glooxwrapper.h:284
list< const Plugin * > PluginList
Definition: glooxwrapper.h:634
bool operator!=(const char *str) const
Definition: glooxwrapper.h:193
string address
Definition: glooxwrapper.h:316
const T * findExtension(int type) const
Definition: glooxwrapper.h:479
string text
Definition: glooxwrapper.h:324
virtual ~ConnectionListener()
Definition: glooxwrapper.h:345
string compression
Definition: glooxwrapper.h:304
gloox::Tag * m_Wrapped
Definition: glooxwrapper.h:581
~list()
Definition: glooxwrapper.h:257
gloox::MUCRoom * m_Wrapped
Definition: glooxwrapper.h:535
gloox::Message * m_Wrapped
Definition: glooxwrapper.h:516
JID * nick
Definition: glooxwrapper.h:329
bool operator==(const char *str) const
Definition: glooxwrapper.h:188
gloox::JID * m_Wrapped
Definition: glooxwrapper.h:496
gloox::Tag * stealWrapped()
Definition: glooxwrapper.h:592
Definition: glooxwrapper.h:658
MUCRoomHandlerWrapper * m_HandlerWrapper
Definition: glooxwrapper.h:536
Tag(gloox::Tag *wrapped, bool owned)
Definition: glooxwrapper.h:586
Definition: glooxwrapper.h:387
const T & operator*()
Definition: glooxwrapper.h:234
Definition: glooxwrapper.h:531
Definition: glooxwrapper.h:492
bool m_Owned
Definition: glooxwrapper.h:582
gloox::IQ * m_Wrapped
Definition: glooxwrapper.h:466
Definition: glooxwrapper.h:555
node * m_Tail
Definition: glooxwrapper.h:225
Definition: glooxwrapper.h:619
Definition: glooxwrapper.h:512
std::list< std::shared_ptr< gloox::RegistrationHandler > > m_RegistrationHandlers
Definition: glooxwrapper.h:568
Definition: glooxwrapper.h:563
gloox::Disco * m_Wrapped
Definition: glooxwrapper.h:455
string last
Definition: glooxwrapper.h:314
string date
Definition: glooxwrapper.h:322
node * m_Next
Definition: glooxwrapper.h:222
node(const T &item)
Definition: glooxwrapper.h:220
int port
Definition: glooxwrapper.h:644
void push_back(const T &item)
Definition: glooxwrapper.h:262
Presence(gloox::Presence::PresenceType presence)
Definition: glooxwrapper.h:559
bool m_Owned
Definition: glooxwrapper.h:537
string zip
Definition: glooxwrapper.h:319
string server
Definition: glooxwrapper.h:298
glooxwrapper::DelayedDelivery * m_DelayedDelivery
Definition: glooxwrapper.h:519
Definition: glooxwrapper.h:441
string email
Definition: glooxwrapper.h:315
Definition: glooxwrapper.h:679
string()
Definition: glooxwrapper.h:125
bool operator!=(const const_iterator &it)
Definition: glooxwrapper.h:232
gloox::Client * m_Wrapped
Definition: glooxwrapper.h:407
int status
Definition: glooxwrapper.h:295
Definition: glooxwrapper.h:688
Definition: glooxwrapper.h:359
bool operator==(const string &str) const
Definition: glooxwrapper.h:198
string(const std::string &str)
Definition: glooxwrapper.h:139
Disco * disco() const
Definition: glooxwrapper.h:431
Definition: glooxwrapper.h:215
string first
Definition: glooxwrapper.h:313
string issuer
Definition: glooxwrapper.h:297
Definition: glooxwrapper.h:403
IQ(const gloox::IQ &iq)
Definition: glooxwrapper.h:470
SessionHandlerWrapper * m_HandlerWrapper
Definition: glooxwrapper.h:692
Jingle(const gloox::Jingle::Session::Jingle *wrapped, bool owned)
Definition: glooxwrapper.h:664
string(const char *str)
Definition: glooxwrapper.h:146
const gloox::DelayedDelivery * m_Wrapped
Definition: glooxwrapper.h:445
string password
Definition: glooxwrapper.h:311
#define GLOOXWRAPPER_API
Definition: glooxwrapper.h:91
const gloox::Jingle::Session::Jingle * m_Wrapped
Definition: glooxwrapper.h:661
Definition: glooxwrapper.h:366
#define T(string_literal)
Definition: secure_crt.cpp:77
Definition: glooxwrapper.h:119
char * m_Data
Definition: glooxwrapper.h:123
int extensionType() const
Definition: glooxwrapper.h:397
const node * m_Node
Definition: glooxwrapper.h:230
list & operator=(const list &src)
Definition: glooxwrapper.h:246
JID(const gloox::JID &jid)
Definition: glooxwrapper.h:501
const gloox::JID & getWrapped() const
Definition: glooxwrapper.h:500
gloox::MUCRoomAffiliation affiliation
Definition: glooxwrapper.h:330
static std::ostream & operator<<(std::ostream &stream, const string &string)
Definition: glooxwrapper.h:209
string & operator=(const string &str)
Definition: glooxwrapper.h:153
Definition: glooxwrapper.h:218
string mac
Definition: glooxwrapper.h:303
const_iterator begin() const
Definition: glooxwrapper.h:236
T m_Item
Definition: glooxwrapper.h:221
string ip
Definition: glooxwrapper.h:643
string url
Definition: glooxwrapper.h:321
Definition: glooxwrapper.h:293
Definition: glooxwrapper.h:651
const gloox::IQ & getWrapped() const
Definition: glooxwrapper.h:469
bool chain
Definition: glooxwrapper.h:296
int flags
Definition: glooxwrapper.h:333
string cipher
Definition: glooxwrapper.h:302
size_t m_Size
Definition: glooxwrapper.h:122
virtual ~SessionHandler()
Definition: glooxwrapper.h:682
Definition: glooxwrapper.h:351
const_iterator(const node *n)
Definition: glooxwrapper.h:231
string name
Definition: glooxwrapper.h:312
Definition: glooxwrapper.h:642
~string()
Definition: glooxwrapper.h:165
GLOOXWRAPPER_API void glooxwrapper_free(void *p)
Definition: glooxwrapper.cpp:39
StanzaExtension(int type)
Definition: glooxwrapper.h:390
string reason
Definition: glooxwrapper.h:334
int m_extensionType
Definition: glooxwrapper.h:399
const char * c_str() const
Definition: glooxwrapper.h:178
gloox::MUCRoomRole role
Definition: glooxwrapper.h:331
Definition: glooxwrapper.h:462
glooxwrapper::list< Tag * > TagList
Definition: glooxwrapper.h:290
gloox::Presence::PresenceType m_Presence
Definition: glooxwrapper.h:557
Definition: glooxwrapper.h:342
Definition: glooxwrapper.cpp:45
const_iterator & operator++()
Definition: glooxwrapper.h:233
JID * alternate
Definition: glooxwrapper.h:338
unsigned short uint16_t
Definition: wposix_types.h:52
gloox::Tag * getWrapped()
Definition: glooxwrapper.h:591
list()
Definition: glooxwrapper.h:239
glooxwrapper::JID m_From
Definition: glooxwrapper.h:518
Disco * m_DiscoWrapper
Definition: glooxwrapper.h:409
See XEP-0176: Jingle ICE-UDP Transport Method.
Definition: glooxwrapper.h:639
gloox::Client * getWrapped()
Definition: glooxwrapper.h:412
bool m_Owned
Definition: glooxwrapper.h:655
def xml
Definition: tests.py:121
node * m_Head
Definition: glooxwrapper.h:224
bool m_Owned
Definition: glooxwrapper.h:467
Definition: glooxwrapper.cpp:275
virtual ~IqHandler()
Definition: glooxwrapper.h:354
virtual ~MUCRoomHandler()
Definition: glooxwrapper.h:369
const gloox::Jingle::Plugin * m_Wrapped
Definition: glooxwrapper.h:622
Plugin(const gloox::Jingle::Plugin *wrapped, bool owned)
Definition: glooxwrapper.h:626
GLOOXWRAPPER_API void * glooxwrapper_alloc(size_t size)
Definition: glooxwrapper.cpp:31
bool m_Owned
Definition: glooxwrapper.h:662
Definition: glooxwrapper.h:307
gloox::Jingle::Session * m_Wrapped
Definition: glooxwrapper.h:654
bool operator<(const string &str) const
Definition: glooxwrapper.h:203
gloox::Presence::PresenceType presence() const
Definition: glooxwrapper.h:560
virtual ~RegistrationHandler()
Definition: glooxwrapper.h:379
string misc
Definition: glooxwrapper.h:323
JID * jid
Definition: glooxwrapper.h:332
const gloox::Jingle::Plugin * getWrapped() const
Definition: glooxwrapper.h:631
bool m_Owned
Definition: glooxwrapper.h:497
bool error(JSContext *cx, uint argc, JS::Value *vp)
Definition: ScriptInterface.cpp:172
Definition: glooxwrapper.cpp:116
Definition: glooxwrapper.h:577