Yate
Public Types | Public Member Functions | Static Public Attributes | List of all members
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

◆ XMPPDirVal() [2/3]

XMPPDirVal ( const String flags)
inline

Constructor

Parameters
flagsComma separated list of flags

◆ XMPPDirVal() [3/3]

XMPPDirVal ( const XMPPDirVal other)
inline

Copy constructor

Parameters
otherSource to copy

Member Function Documentation

◆ from()

bool from ( ) const
inline

Check if the 'From' flag is set

Returns
True if the 'From' flag is set

◆ 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().

◆ replace() [2/2]

void replace ( int  flag)
inline

Replace all flags

Parameters
flagThe new value of the flags

◆ 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

◆ to()

bool to ( ) const
inline

Check if the 'To' flag is set

Returns
True if the 'To' flag is set

◆ 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


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