MCPcopy Create free account
hub / github.com/apache/brpc / to_string

Method to_string

src/brpc/restful.cpp:49–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49std::string RestfulMethodPath::to_string() const {
50 std::string s;
51 s.reserve(service_name.size() + prefix.size() + 2 + postfix.size());
52 if (!service_name.empty()) {
53 s.push_back('/');
54 s.append(service_name);
55 }
56 if (has_wildcard) {
57 s.append(prefix);
58 s.push_back('*');
59 butil::StringPiece tmp = remove_last_char(postfix);
60 s.append(tmp.data(), tmp.size());
61 } else {
62 butil::StringPiece tmp = remove_last_char(prefix);
63 s.append(tmp.data(), tmp.size());
64 }
65 return s;
66}
67
68struct DebugPrinter {
69 explicit DebugPrinter(const RestfulMethodPath& p) : path(&p) {}

Callers 15

ParseRequestFromIOBufMethod · 0.45
TEST_FFunction · 0.45
TESTFunction · 0.45
TEST_FFunction · 0.45
ProcessRpcRequestMethod · 0.45
TestBaiduMasterServiceFunction · 0.45
TestGenericCallFunction · 0.45
to_strFunction · 0.45
TEST_FFunction · 0.45
TEST_FFunction · 0.45
EchoMethod · 0.45

Calls 7

remove_last_charFunction · 0.85
reserveMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45
appendMethod · 0.45
dataMethod · 0.45

Tested by 15

TEST_FFunction · 0.36
TESTFunction · 0.36
TEST_FFunction · 0.36
ProcessRpcRequestMethod · 0.36
TestBaiduMasterServiceFunction · 0.36
TestGenericCallFunction · 0.36
to_strFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36
EchoMethod · 0.36
TEST_FFunction · 0.36