MCPcopy Create free account
hub / github.com/apache/thrift / join_path

Function join_path

compiler/cpp/tests/cpp/t_cpp_generator_test_utils.h:59–67  ·  view source on GitHub ↗

Join two path components

Source from the content-addressed store, hash-verified

57
58// Join two path components
59inline std::string join_path(const std::string& a, const std::string& b) {
60 if (a.empty()) {
61 return b;
62 }
63 if (a.back() == '/' || a.back() == '\\') {
64 return a + b;
65 }
66 return a + "/" + b;
67}
68
69// Normalize generated code for comparison by removing comments and extra whitespace
70inline std::string normalize_for_compare(std::string s) {

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected