libkmime

boolflags.h
1/*
2 boolflags.h
3
4 KNode, the KDE newsreader
5 Copyright (c) 1999-2001 the KNode authors.
6 See file AUTHORS for details
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software Foundation,
14 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
15*/
16
17#ifndef __KMIME_BOOLFLAGS_H__
18#define __KMIME_BOOLFLAGS_H__
19
20#include <tdemacros.h>
21
28class TDE_EXPORT BoolFlags {
29
30public:
31 BoolFlags() { clear(); }
32 ~BoolFlags() {}
33
34 void set(unsigned int i, bool b=true);
35 bool get(unsigned int i);
36 void clear() { bits[0]=0; bits[1]=0; }
37 unsigned char *data() { return bits; }
38
39protected:
40 unsigned char bits[2]; //space for 16 flags
41};
42
43#endif // __KMIME_BOOLFLAGS_H__
This class stores boolean values in single bytes.
Definition: boolflags.h:28