XMPPDirVal Class Reference

Direction flags. More...

#include <xmpputils.h>

List of all members.

Public Types

enum  Direction { None = 0, To = 1, From = 2, Both = 3 }

Public Member Functions

 XMPPDirVal (int flags=None)
 XMPPDirVal (const char *name)
void replace (int flag)
void replace (const char *name)
void set (int flag)
void reset (int flag)
bool flag (int mask) const
bool to () const
bool from () const
 operator int ()

Static Public Member Functions

static const char * lookup (int flag, const char *defVal="")
static int lookup (const char *name, int defVal=None)

Static Public Attributes

static TokenDict s_names []


Detailed Description

Direction flags.

This class holds a 4-state direction value (such as subscription states)


Constructor & Destructor Documentation

XMPPDirVal ( int  flags = None  )  [inline]

Constructor

Parameters:
flags Flag(s) to set

XMPPDirVal ( const char *  name  )  [inline]

Constructor

Parameters:
name The name of the flag used to initialize this object

References TelEngine::lookup().


Member Function Documentation

void replace ( int  flag  )  [inline]

Replace all flags

Parameters:
flag The new value of the flags

void replace ( const char *  name  )  [inline]

Replace all flags from a value's name

Parameters:
name The name of the flag used to replace this value

References TelEngine::lookup().

void set ( int  flag  )  [inline]

Set one or more flags

Parameters:
flag Flag(s) to set

void reset ( int  flag  )  [inline]

Reset one or more flags

Parameters:
flag Flag(s) to reset

bool flag ( int  mask  )  const [inline]

Check if a given bit mask is set

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

bool to (  )  const [inline]

Check if the 'To' flag is set

Returns:
True if the 'To' flag is set

bool from (  )  const [inline]

Check if the 'From' flag is set

Returns:
True if the 'From' flag is set

operator int (  )  [inline]

Cast operator

static const char* lookup ( int  flag,
const char *  defVal = "" 
) [inline, static]

Get the name of a flag

Parameters:
flag The flag
defVal Value to return if not found
Returns:
The name of the requested flag

References TelEngine::lookup().

static int lookup ( const char *  name,
int  defVal = None 
) [inline, static]

Get the value associated with a flag name

Parameters:
name The flag name
defVal Value to return if not found
Returns:
The value of the requested flag name

References TelEngine::lookup().


Member Data Documentation

TokenDict s_names[] [static]

Keep the flag names


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

Generated on Mon Aug 11 16:18:53 2008 for Yate by  doxygen 1.5.6