| 124 | } |
| 125 | |
| 126 | inline StringValue StringValue::Trim() const { |
| 127 | SimpleString this_s = ToSimpleString(); |
| 128 | // Remove leading and trailing spaces. |
| 129 | int32_t begin = 0; |
| 130 | while (begin < this_s.len && this_s.ptr[begin] == ' ') { |
| 131 | ++begin; |
| 132 | } |
| 133 | int32_t end = this_s.len - 1; |
| 134 | while (end > begin && this_s.ptr[end] == ' ') { |
| 135 | --end; |
| 136 | } |
| 137 | return StringValue(this_s.ptr + begin, end - begin + 1); |
| 138 | } |
| 139 | |
| 140 | inline void StringValue::PadWithSpaces(char* cptr, int64_t cptr_len, int64_t num_chars) { |
| 141 | DCHECK(cptr != NULL); |
nothing calls this directly
no test coverage detected