| 158 | } |
| 159 | |
| 160 | bool IsValidColumnFamilyName(const std::string& str) { |
| 161 | if ((64 * 1024 - 1) < str.size()) { // [0, 64KB) |
| 162 | return false; |
| 163 | } |
| 164 | for (size_t i = 0; i < str.size(); ++i) { |
| 165 | char c = str[i]; |
| 166 | if (!isprint(c)) { |
| 167 | return false; |
| 168 | } |
| 169 | } |
| 170 | return true; |
| 171 | } |
| 172 | |
| 173 | std::string RoundNumberToNDecimalPlaces(double n, int d) { |
| 174 | if (d < 0 || 9 < d) { |