setcase
/
src
/
setcase.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef OB_SETCASE_HH
#define OB_SETCASE_HH
#include <string>
namespace OB
{
class Setcase
{
public:
enum ctype
{
Lower,
Upper
};
Setcase(std::string const& str = {});
std::string get(ctype type);
private:
std::string str_;
char to_lower(char c) const;
char to_upper(char c) const;
std::string to_lower(std::string s) const;
std::string to_upper(std::string s) const;
}; // class Setcase
} // namespace OB
#endif // OB_SETCASE_HH