MCPcopy Create free account
hub / github.com/catboost/catboost / FormatPointerValue

Function FormatPointerValue

library/cpp/yt/string/format.cpp:109–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107#undef XX
108
109void FormatPointerValue(
110 TStringBuilderBase* builder,
111 const void* value,
112 TStringBuf format)
113{
114 static_assert(sizeof(value) == sizeof(ui64));
115 if (format == TStringBuf("p") || format == TStringBuf("v")) {
116 builder->AppendString(TStringBuf("0x"));
117 FormatValue(builder, reinterpret_cast<ui64>(value), TStringBuf("x"));
118 } else if (format == TStringBuf("x") || format == TStringBuf("X")) {
119 FormatValue(builder, reinterpret_cast<ui64>(value), format);
120 } else {
121 builder->AppendString("<invalid pointer format>");
122 }
123}
124
125////////////////////////////////////////////////////////////////////////////////
126

Callers 1

FormatValueFunction · 0.85

Calls 2

FormatValueFunction · 0.70
AppendStringMethod · 0.45

Tested by

no test coverage detected