20 #if U_SHOW_CPLUSPLUS_API
29 template<
typename T, u
int32_t minValue, u
int32_t limitValue>
35 inline void clear() { fBools=0; }
36 inline void add(T toAdd) { set(toAdd, 1); }
37 inline void remove(T toRemove) { set(toRemove, 0); }
38 inline int32_t contains(T toCheck)
const {
return get(toCheck); }
39 inline void set(T toSet, int32_t v) { fBools=(fBools&(~flag(toSet)))|(v?(flag(toSet)):0); }
40 inline int32_t
get(T toCheck)
const {
return (fBools & flag(toCheck))?1:0; }
41 inline UBool isValidEnum(T toCheck)
const {
return (toCheck>=minValue&&toCheck<limitValue); }
42 inline UBool isValidValue(int32_t v)
const {
return (v==0||v==1); }
44 fBools = other.fBools;
48 inline uint32_t getAll()
const {
53 inline uint32_t flag(T toCheck)
const {
return (1<<(toCheck-minValue)); }
enum bitset for boolean fields.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Basic definitions for ICU, for both C and C++ APIs.
int8_t UBool
The ICU boolean type.