45 std::string mod_filename = filename;
46 if (filename.find(
"package://") == 0)
48 mod_filename.erase(0, strlen(
"package://"));
49 size_t pos = mod_filename.find(
"/");
50 if (pos == std::string::npos)
52 throw ros::Exception(
"Could not parse package:// format into file:// format");
55 std::string
package = mod_filename.substr(0, pos);
56 mod_filename.erase(0, pos);
59 if (package_path.empty())
64 mod_filename = package_path + mod_filename;
std::string resolve_filename(const std::string &filename)
Replace a package:// prefix with the actual path to the given package.
ROSLIB_DECL std::string getPath(const std::string &package_name)