KMime::BoolFlags Class Reference

Provides a class for storing boolean values in single bytes. More...

#include <boolflags.h>

List of all members.

Public Member Functions

 BoolFlags ()
 ~BoolFlags ()
void clear ()
unsigned char * data ()
bool get (unsigned int i)
void set (unsigned int i, bool b=true)

Detailed Description

Provides a class for storing boolean values in single bytes.

This class provides functionality similar to QBitArray but requires much less memory. Only 16-bits (or 2-bytes) can be stored.

Definition at line 45 of file boolflags.h.


Constructor & Destructor Documentation

KMime::BoolFlags::BoolFlags (  )  [inline]

Constructs an empty 2-byte flag storage.

Definition at line 51 of file boolflags.h.

KMime::BoolFlags::~BoolFlags (  )  [inline]

Destroys the flag storage.

Definition at line 56 of file boolflags.h.


Member Function Documentation

void KMime::BoolFlags::clear (  )  [inline]

Sets all bits to false.

Definition at line 80 of file boolflags.h.

unsigned char* KMime::BoolFlags::data (  )  [inline]

Returns a pointer to the data structure used to store the bits.

Definition at line 85 of file boolflags.h.

bool BoolFlags::get ( unsigned int  i  ) 

Get bit number i.

Parameters:
i is the bit number. Valid values are 0 through 15. Higher values all return false.
Returns:
Value of the single bit i. Invalid bit numbers return false.

Definition at line 59 of file boolflags.cpp.

void BoolFlags::set ( unsigned int  i,
bool  b = true 
)

Sets bit number i to the value b.

Parameters:
i is the bit number. Valid values are 0 through 15. Higher values will be silently ignored.
b is the value to set for bit i.

Definition at line 35 of file boolflags.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys