Lines Matching refs:std
39 std::string ToHexString(T x) { in ToHexString()
44 std::stringstream tmp; in ToHexString()
45 …tmp << "0x" << std::internal << std::hex << std::setfill('0') << std::setw(sizeof(T) * 2) << (unsi… in ToHexString()
50 inline std::string ToHexString<signed long>(signed long x) {
55 std::stringstream tmp;
56 …tmp << "0x" << std::internal << std::hex << std::setfill('0') << std::setw(sizeof(signed long) * 2)
63 std::string ToHexString(InputIt first, InputIt last) { in ToHexString()
65 …std::is_same_v<typename std::iterator_traits<InputIt>::value_type, uint8_t>, "Must use uint8_t ite… in ToHexString()
66 std::stringstream ss; in ToHexString()
69 ss << std::hex << std::setw(2) << std::setfill('0') << +(*it); in ToHexString()
74 std::string ToHexString(const std::vector<uint8_t>& value);
77 bool IsValidHexString(const std::string& str);
80 std::optional<std::vector<uint8_t>> FromHexString(const std::string& str);
83 std::string StringTrim(std::string str);
86 std::vector<std::string> StringSplit(const std::string& str, const std::string& delim, size_t max_t…
89 std::string StringJoin(const std::vector<std::string>& strings, const std::string& delim);
92 std::optional<int64_t> Int64FromString(const std::string& str);
93 std::string ToString(int64_t value);
94 std::optional<uint64_t> Uint64FromString(const std::string& str);
95 std::string ToString(uint64_t value);
96 std::optional<bool> BoolFromString(const std::string& str);
97 std::string ToString(bool value);
102 std::string StringFormat(const std::string& format, Args... args) { in StringFormat()
103 auto size = std::snprintf(nullptr, 0, format.c_str(), args...); in StringFormat()
107 auto actual_size = std::snprintf(buffer, sizeof(buffer), format.c_str(), args...); in StringFormat()
116 return std::string(buffer, size); in StringFormat()
119 inline std::string StringFormatTime(const std::string& format, const struct std::tm& tm) { in StringFormatTime()
120 std::ostringstream os; in StringFormatTime()
121 os << std::put_time(&tm, format.c_str()); in StringFormatTime()
125 inline std::string StringFormatTimeWithMilliseconds(
126 const std::string& format,
127 std::chrono::time_point<std::chrono::system_clock> time_point,
129 std::time_t epoch_time = std::chrono::system_clock::to_time_t(time_point);
130 auto millis = time_point.time_since_epoch() / std::chrono::milliseconds(1) % 1000;
131 std::tm tm = *calendar_to_tm(&epoch_time);
132 std::ostringstream os;
133 os << std::put_time(&tm, format.c_str()) << StringFormat(".%03u", millis);