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

Method get_include_prefix

compiler/cpp/src/thrift/generate/t_cpp_generator.cc:5138–5152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5136
5137
5138string t_cpp_generator::get_include_prefix(const t_program& program) const {
5139 string include_prefix = program.get_include_prefix();
5140 if (!use_include_prefix_ || (include_prefix.size() > 0 && include_prefix[0] == '/')) {
5141 // if flag is turned off or this is absolute path, return empty prefix
5142 return "";
5143 }
5144
5145 string::size_type last_slash = string::npos;
5146 if ((last_slash = include_prefix.rfind("/")) != string::npos) {
5147 return include_prefix.substr(0, last_slash)
5148 + (get_program()->is_out_path_absolute() ? "/" : "/" + out_dir_base_ + "/");
5149 }
5150
5151 return "";
5152}
5153
5154string t_cpp_generator::get_legal_program_name(std::string program_name)
5155{

Callers

nothing calls this directly

Calls 3

is_out_path_absoluteMethod · 0.80
sizeMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected