20 #ifndef ABSL_STRINGS_INTERNAL_CHAR_MAP_H_ 21 #define ABSL_STRINGS_INTERNAL_CHAR_MAP_H_ 31 namespace strings_internal {
49 constexpr
bool contains(
unsigned char c)
const {
50 return (
m_[c / 64] >> (c % 64)) & 0x1;
56 if ((
m_[
i] & c.
m_[
i]) != 0)
return true;
62 for (uint64_t c :
m_) {
63 if (c != 0)
return false;
102 constexpr
Charmap(uint64_t b0, uint64_t
b1, uint64_t
b2, uint64_t b3)
105 static constexpr uint64_t
RangeForWord(
unsigned char lo,
unsigned char hi,
114 return (upper <= 64 * word)
116 : (upper >= 64 * (word + 1))
117 ? ~static_cast<uint64_t>(0)
118 : (~static_cast<uint64_t>(0) >> (64 - upper % 64));
122 return (x / 64 == word) ? (
static_cast<uint64_t
>(1) << (x % 64)) : 0;
127 m_[c / 64] |=
static_cast<uint64_t
>(1) << (c % 64);
154 #endif // ABSL_STRINGS_INTERNAL_CHAR_MAP_H_ constexpr Charmap AlphaCharmap()
constexpr bool contains(unsigned char c) const
static constexpr uint64_t RangeForWord(unsigned char lo, unsigned char hi, uint64_t word)
constexpr Charmap XDigitCharmap()
constexpr Charmap PunctCharmap()
static constexpr uint64_t CharMaskForWord(unsigned char x, uint64_t word)
static constexpr uint64_t OpenRangeFromZeroForWord(uint64_t upper, uint64_t word)
constexpr Charmap PrintCharmap()
constexpr Charmap SpaceCharmap()
friend constexpr Charmap operator|(const Charmap &a, const Charmap &b)
constexpr Charmap BlankCharmap()
friend constexpr Charmap operator&(const Charmap &a, const Charmap &b)
constexpr Charmap AlnumCharmap()
static constexpr Charmap Range(char lo, char hi)
constexpr Charmap GraphCharmap()
bool IntersectsWith(const Charmap &c) const
constexpr Charmap UpperCharmap()
static constexpr Charmap Char(char x)
friend constexpr Charmap operator~(const Charmap &a)
constexpr Charmap LowerCharmap()
#define ABSL_ARRAYSIZE(array)
constexpr Charmap(uint64_t b0, uint64_t b1, uint64_t b2, uint64_t b3)
void SetChar(unsigned char c)
static constexpr Charmap FromString(const char *s)
constexpr Charmap DigitCharmap()
Charmap(const char *str, int len)
constexpr Charmap CntrlCharmap()