MCPcopy Create free account
hub / github.com/build2/build2 / process_path_convert

Function process_path_convert

libbuild2/variable.cxx:1072–1100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1070 //
1071 template <typename T>
1072 static T
1073 process_path_convert (name&& n, name* r, const char* what)
1074 {
1075 if ( !n.pattern && n.untyped () && n.unqualified () && !n.empty () &&
1076 (r == nullptr || (!r->pattern && r->untyped () && r->unqualified () && !r->empty ())))
1077 {
1078 path rp (move (n.dir));
1079 if (rp.empty ())
1080 rp = path (move (n.value));
1081 else
1082 rp /= n.value;
1083
1084 path ep;
1085 if (r != nullptr)
1086 {
1087 ep = move (r->dir);
1088 if (ep.empty ())
1089 ep = path (move (r->value));
1090 else
1091 ep /= r->value;
1092 }
1093
1094 T pp (nullptr, move (rp), move (ep));
1095 pp.initial = pp.recall.string ().c_str ();
1096 return pp;
1097 }
1098
1099 throw_invalid_argument (n, r, what, true /* pair_ok */);
1100 }
1101
1102 process_path value_traits<process_path>::
1103 convert (name&& n, name* r)

Callers

nothing calls this directly

Calls 2

throw_invalid_argumentFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected