22 #if U_SHOW_CPLUSPLUS_API 32 template<
typename T, u
int32_t minValue, u
int32_t limitValue>
38 #ifndef U_HIDE_INTERNAL_API 39 inline void clear() { fBools=0; }
40 inline void add(T toAdd) {
set(toAdd, 1); }
41 inline void remove(T toRemove) {
set(toRemove, 0); }
42 inline int32_t contains(T toCheck)
const {
return get(toCheck); }
43 inline void set(T toSet, int32_t v) { fBools=(fBools&(~flag(toSet)))|(v?(flag(toSet)):0); }
44 inline int32_t
get(T toCheck)
const {
return (fBools & flag(toCheck))?1:0; }
45 inline UBool isValidEnum(T toCheck)
const {
return (toCheck>=minValue&&toCheck<limitValue); }
46 inline UBool isValidValue(int32_t v)
const {
return (v==0||v==1); }
48 fBools = other.fBools;
52 inline uint32_t getAll()
const {
58 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.