• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

Public Member Functions | Static Public Attributes | List of all members
BitSet Class Reference

#include <bitset.h>

Public Member Functions

 BitSet (quint32 num_bits=8)
 
 BitSet (const quint8 *data, quint32 num_bits)
 
 BitSet (const BitSet &bs)
 
virtual ~BitSet ()
 
bool allOff () const
 
bool allOn () const
 
void clear ()
 
bool get (quint32 i) const
 
void getContinuousRange (qint32 *start, qint32 *end, bool on)
 
const quint8 * getData () const
 
quint8 * getData ()
 
quint32 getNumBits () const
 
quint32 getNumBytes () const
 
bool isNull () const
 
quint32 numOnBits () const
 
bool operator!= (const BitSet &bs)
 
BitSet & operator= (const BitSet &bs)
 
bool operator== (const BitSet &bs)
 
void orBitSet (const BitSet &other)
 
void set (quint32 i, bool on)
 
void setAll (bool on)
 
void setRange (quint32 start, quint32 end, bool value)
 

Static Public Attributes

static BitSet null
 

Detailed Description

Simple implementation of a BitSet.

Author
Joris Guisson Simple implementation of a BitSet, can only turn on and off bits. BitSet's are used to indicate which chunks we have or not.

Definition at line 32 of file bitset.h.

Constructor & Destructor Documentation

BitSet::BitSet ( quint32  num_bits = 8)

Constructor.

Parameters
num_bitsThe number of bits

Definition at line 26 of file bitset.cpp.

BitSet::BitSet ( const quint8 *  data,
quint32  num_bits 
)

Manually set data.

Parameters
dataThe data
num_bitsThe number of bits

Definition at line 34 of file bitset.cpp.

BitSet::BitSet ( const BitSet &  bs)

Copy constructor.

Parameters
bsBitSet to copy
Returns

Definition at line 49 of file bitset.cpp.

BitSet::~BitSet ( )
virtual

Definition at line 55 of file bitset.cpp.

Member Function Documentation

bool BitSet::allOff ( ) const

Definition at line 132 of file bitset.cpp.

bool BitSet::allOn ( ) const

Check if all bit are set to 1.

Definition at line 127 of file bitset.cpp.

void BitSet::clear ( )

Set all bits to 0.

Definition at line 111 of file bitset.cpp.

bool BitSet::get ( quint32  i) const
inline

Get the value of a bit, false means 0, true 1.

Parameters
iIndex of Bit

Definition at line 139 of file bitset.h.

void BitSet::getContinuousRange ( qint32 *  start,
qint32 *  end,
bool  on 
)

Finds a continous rang of bits that on/off.

Parameters
starthere the start bit will be stored, -1 if nothing is found
endstores the end bit, -1 if nothing is found
onwether a continous range of bits on (set) or off (not set) should be searched for

Definition at line 80 of file bitset.cpp.

const quint8* BitSet::getData ( ) const
inline

Definition at line 88 of file bitset.h.

quint8* BitSet::getData ( )
inline

Definition at line 89 of file bitset.h.

quint32 BitSet::getNumBits ( ) const
inline

Definition at line 87 of file bitset.h.

quint32 BitSet::getNumBytes ( ) const
inline

Definition at line 86 of file bitset.h.

bool BitSet::isNull ( ) const
inline

See if the BitSet is null.

Definition at line 60 of file bitset.h.

quint32 BitSet::numOnBits ( ) const
inline

Get the number of on bits.

Definition at line 92 of file bitset.h.

bool BitSet::operator!= ( const BitSet &  bs)
inline

Opposite of operator ==.

Definition at line 134 of file bitset.h.

BitSet & BitSet::operator= ( const BitSet &  bs)

Assignment operator.

Parameters
bsBitSet to copy
Returns
*this

Definition at line 62 of file bitset.cpp.

bool BitSet::operator== ( const BitSet &  bs)

Check for equality of bitsets.

Parameters
bsBitSet to compare
Returns
true if equal

Definition at line 137 of file bitset.cpp.

void BitSet::orBitSet ( const BitSet &  other)

or this BitSet with another.

Parameters
otherThe other BitSet

Definition at line 116 of file bitset.cpp.

void BitSet::set ( quint32  i,
bool  on 
)
inline

Set the value of a bit, false means 0, true 1.

Parameters
iIndex of Bit
onFalse means 0, true 1

Definition at line 150 of file bitset.h.

void BitSet::setAll ( bool  on)

Set all bits on or off.

Definition at line 74 of file bitset.cpp.

void BitSet::setRange ( quint32  start,
quint32  end,
bool  value 
)
inline

Sets the value of a range of bits.

Parameters
startof the range
endof the range
valueto set the range to

Definition at line 170 of file bitset.h.

Member Data Documentation

BitSet BitSet::null
static

Definition at line 136 of file bitset.h.


The documentation for this class was generated from the following files:
  • bitset.h
  • bitset.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal