65 return packagePathStr + uriString.substr(pos, uriString.size() - pos);
79 static std::string
package_uri(std::string pathStr, std::string packageName = std::string()) {
81 fs::path absPath = fs::path(pathStr);
84 if (packageName == std::string()) {
86 std::vector<std::string> packageVector;
90 std::stable_sort(packageVector.begin(), packageVector.end());
93 fs::path parentPath = absPath;
96 while (parentPath != fs::path()) {
98 fs::path filename = parentPath.filename();
101 if (std::binary_search(packageVector.begin(), packageVector.end(), filename)) {
104 if (possiblePath == parentPath.string()) {
105 packageName = filename.string();
111 parentPath = parentPath.parent_path();
ROSLIB_DECL bool getAll(V_string &packages)
static std::string file_uri(fs::path path)
static std::string package_uri(std::string pathStr, std::string packageName=std::string())
static path relative_path(path &subject, path base=current_path())
static const std::string getFilePrefix()
ROSLIB_DECL std::string getPath(const std::string &package_name)
static std::string absolute_path(std::string uriString)
static const std::string getPackagePrefix()