| 123 | char* StringAsArray(std::string* str) { return str->empty() ? NULL : &*str->begin(); } |
| 124 | |
| 125 | std::string Uint64ToString(uint64_t i, int base) { |
| 126 | std::stringstream ss; |
| 127 | if (base == 16) { |
| 128 | ss << std::hex << std::setfill('0') << std::setw(16) << i; |
| 129 | } else if (base == 8) { |
| 130 | ss << std::oct << std::setfill('0') << std::setw(8) << i; |
| 131 | } else { |
| 132 | ss << i; |
| 133 | } |
| 134 | return ss.str(); |
| 135 | } |
| 136 | |
| 137 | uint64_t StringToUint64(const std::string& int_str, int base) { |
| 138 | uint64_t value; |
no outgoing calls