| 31 | |
| 32 | template<typename T> |
| 33 | void Set(const T* str, bool autoFormat = false) |
| 34 | { |
| 35 | int32 max = StringUtils::Length(str), dst = 0; |
| 36 | T prev = 0; |
| 37 | for (int32 i = 0; i < max && dst < ARRAY_COUNT(Buffer) - 2; i++) |
| 38 | { |
| 39 | T cur = (T)str[i]; |
| 40 | if (autoFormat && StringUtils::IsUpper(cur) && StringUtils::IsLower(prev)) |
| 41 | { |
| 42 | Ansi[dst] = '/'; |
| 43 | Buffer[dst++] = '/'; |
| 44 | } |
| 45 | Ansi[dst] = (char)cur; |
| 46 | Buffer[dst++] = (Char)cur; |
| 47 | prev = cur; |
| 48 | } |
| 49 | Buffer[dst] = 0; |
| 50 | Ansi[dst] = 0; |
| 51 | } |
| 52 | }; |
| 53 | |
| 54 | // Compact groups stack container. |
no test coverage detected