Yate
XMPPDirVal Class Reference

Direction flags. More...

#include <xmpputils.h>

Public Types

enum  Direction {
  None = 0x00 , To = 0x01 , From = 0x02 , PendingIn = 0x10 ,
  PendingOut = 0x20 , Both = 0x03 , Pending = 0x30
}
 

Public Member Functions

 XMPPDirVal (int flags=None)
 
 XMPPDirVal (const String &flags)
 
 XMPPDirVal (const XMPPDirVal &other)
 
void replace (int flag)
 
void replace (const String &flags)
 
void toString (String &buf, bool full) const
 
void toSubscription (String &buf) const
 
void set (int flag)
 
void reset (int flag)
 
bool test (int mask) const
 
bool to () const
 
bool from () const
 
 operator int ()
 

Static Public Attributes

static const TokenDict s_names []
 

Detailed Description

Direction flags.

This class holds a direction flags (such as subscription states)

Member Enumeration Documentation

◆ Direction

enum Direction

Direction flags enumeration

Constructor & Destructor Documentation

◆ XMPPDirVal() [1/3]

XMPPDirVal ( int flags = None)
inline

Constructor

Parameters
flagsFlag(s) to set

Referenced by XMPPDirVal().

◆ XMPPDirVal() [2/3]

XMPPDirVal ( const String & flags)
inline

Constructor

Parameters
flagsComma separated list of flags

References replace().

◆ XMPPDirVal() [3/3]

XMPPDirVal ( const XMPPDirVal & other)
inline

Copy constructor

Parameters
otherSource to copy

References XMPPDirVal().

Member Function Documentation

◆ from()

bool from ( ) const
inline

Check if the 'From' flag is set

Returns
True if the 'From' flag is set

References test().

◆ operator int()

operator int ( )
inline

Cast operator

◆ replace() [1/2]

void replace ( const String & flags)
inline

Replace all flags from a list

Parameters
flagsComma separated list of flags

References XMPPUtils::decodeFlags(), and s_names.

◆ replace() [2/2]

void replace ( int flag)
inline

Replace all flags

Parameters
flagThe new value of the flags

Referenced by XMPPDirVal().

◆ reset()

void reset ( int flag)
inline

Reset one or more flags

Parameters
flagFlag(s) to reset

◆ set()

void set ( int flag)
inline

Set one or more flags

Parameters
flagFlag(s) to set

◆ test()

bool test ( int mask) const
inline

Check if a given bit mask is set

Parameters
maskBit mask to check
Returns
True if the given bit mask is set

Referenced by from(), and to().

◆ to()

bool to ( ) const
inline

Check if the 'To' flag is set

Returns
True if the 'To' flag is set

References test().

◆ toString()

void toString ( String & buf,
bool full ) const

Build a string representation of this object

Parameters
bufDestination string
fullTrue to add all flags, false to ignore pending flags

◆ toSubscription()

void toSubscription ( String & buf) const

Build a subscription state string representation of this object

Parameters
bufDestination string

Member Data Documentation

◆ s_names

const TokenDict s_names[]
static

Keep the flag names

Referenced by replace().


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