Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions common/estring.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ struct charset : std::bitset<256>
// charset(const char (&s) [N]) :
// charset(std::string_view(s, N - 1)) { }

// bool test(char ch) const
// {
// return std::bitset<256>::test((unsigned char)ch);
// }
// bitset& set(char ch, bool value = true)
// {
// return std::bitset<256>::set((unsigned char)ch, value);
// }
bool test(char ch) const
{
return std::bitset<256>::test((unsigned char)ch);
}
bitset& set(char ch, bool value = true)
{
return std::bitset<256>::set((unsigned char)ch, value);
}
};

class estring_view : public std::string_view
Expand Down
4 changes: 2 additions & 2 deletions common/test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -872,9 +872,9 @@ TEST(estring, test)
auto ps = estring::snprintf("%d%d%d", 2, 3, 4);
EXPECT_EQ(ps, "234");

estring as = " \tasdf \t\r\n";
estring as = " \tasdf中文 \t\r\n";
auto trimmed = as.trim();
EXPECT_EQ(trimmed, "asdf");
EXPECT_EQ(trimmed, "asdf中文");

EXPECT_EQ(estring_view("234423").to_uint64(), 234423);
EXPECT_EQ(estring_view("-234423").to_int64(), -234423);
Expand Down
Loading