MCPcopy Create free account
hub / github.com/apache/trafficserver / XS

Class XS

src/proxy/http/unit_tests/test_ForwardedConfig.cc:65–92  ·  view source on GitHub ↗

Alternate upper/lower case and add blanks.

Source from the content-addressed store, hash-verified

63}
64// Alternate upper/lower case and add blanks.
65class XS
66{
67private:
68 std::string s;
69
70public:
71 explicit XS(const char *in) : s{nextWs()}
72 {
73 bool upper{true};
74 for (; *in; ++in) {
75 if (islower(*in)) {
76 s += upper ? toupper(*in) : *in;
77 upper = !upper;
78
79 } else if (isupper(*in)) {
80 s += upper ? *in : tolower(*in);
81 upper = !upper;
82
83 } else {
84 s += *in;
85 }
86 s += nextWs();
87 }
88 s += nextWs();
89 }
90
91 operator std::string_view() const { return std::string_view(s.c_str()); }
92};
93
94void
95test(const char *spec, const char *reqErr, const OptionBitSet &bS)

Callers 1

testFunction · 0.85

Calls 1

c_strMethod · 0.45

Tested by 1

testFunction · 0.68