libkmime
boolflags.h
00001 /* 00002 boolflags.h 00003 00004 KNode, the KDE newsreader 00005 Copyright (c) 1999-2001 the KNode authors. 00006 See file AUTHORS for details 00007 00008 This program is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 You should have received a copy of the GNU General Public License 00013 along with this program; if not, write to the Free Software Foundation, 00014 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US 00015 */ 00016 00017 #ifndef __KMIME_BOOLFLAGS_H__ 00018 #define __KMIME_BOOLFLAGS_H__ 00019 00020 #include <tdepimmacros.h> 00021 00028 class KDE_EXPORT BoolFlags { 00029 00030 public: 00031 BoolFlags() { clear(); } 00032 ~BoolFlags() {} 00033 00034 void set(unsigned int i, bool b=true); 00035 bool get(unsigned int i); 00036 void clear() { bits[0]=0; bits[1]=0; } 00037 unsigned char *data() { return bits; } 00038 00039 protected: 00040 unsigned char bits[2]; //space for 16 flags 00041 }; 00042 00043 #endif // __KMIME_BOOLFLAGS_H__