Alternate upper/lower case and add blanks.
| 63 | } |
| 64 | // Alternate upper/lower case and add blanks. |
| 65 | class XS |
| 66 | { |
| 67 | private: |
| 68 | std::string s; |
| 69 | |
| 70 | public: |
| 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 | |
| 94 | void |
| 95 | test(const char *spec, const char *reqErr, const OptionBitSet &bS) |