Helpers.h
Go to the documentation of this file.
00001 
00031 #ifndef URDF_TRAVERSER_HELPERS_H
00032 #define URDF_TRAVERSER_HELPERS_H
00033 // Copyright Jennifer Buehler
00034 
00041 #include <iostream>
00042 #include <string>
00043 #include <set>
00044 
00045 #include <Eigen/Core>
00046 #include <Eigen/Geometry>
00047 #include <urdf/model.h>
00048 
00049 namespace urdf_traverser
00050 {
00051 
00052 namespace helpers
00053 {
00054 
00063 // returns filename extension without the dot. Make sure first that this is a file.
00064 extern std::string fileExtension(const char* file);
00065 
00066 extern bool directoryExists(const char* dPath);
00067 
00068 extern std::string getPath(const char * file);
00069 
00070 extern bool fileExists(const char* file);
00071 
00072 std::string getFilename(const char* file);
00073 
00074 std::string getFilenameWithoutExtension(const char* file);
00075 
00076 extern bool makeDirectoryIfNeeded(const char * dPath);
00077 
00085 extern void enforceDirectory(std::string& path, bool printWarn);
00086 
00095 extern bool getSubdirPath(const std::string& from, const std::string& to, std::string& result);
00096 
00104 extern bool getCommonParentPath(const std::string& p1, const std::string& p2, std::string& result);
00105 
00109 extern bool getCommonParentPath(const std::set<std::string>& allFiles, std::string& result);
00110 
00125 extern bool getRelativeDirectory(const std::string& path, const std::string& relTo, std::string& result);
00126 
00131 extern std::string getDirectory(const std::string& path);
00132 
00139 extern bool isDirectoryPath(const std::string& path);
00140 
00146 extern std::string getDirectoryName(const std::string& path);
00147 
00148 
00152 extern std::string replaceAll(const std::string& text, const std::string& from, const std::string& to);
00153 
00154 extern bool writeToFile(const std::string& content, const std::string& filename);
00155 extern void deleteFile(const char* file);
00156 
00157 extern void findAndReplace(const std::string& newStr, const std::string& oldStr, const std::string& in, std::string& out);
00158 
00159 // transforms a path specification in the form package://<package-name>/<path> to an absolute path on the computer
00160 extern std::string packagePathToAbsolute(std::string& packagePath);
00161 
00162 }  //  namespace helpers
00163 }  //  namespace urdf_traverser
00164 
00165 extern std::ostream& operator<<(std::ostream& o, const Eigen::Vector3d& v);
00166 
00167 extern std::ostream& operator<<(std::ostream& o, const Eigen::Vector3f& v);
00168 
00169 extern std::ostream& operator<<(std::ostream& o, const Eigen::Quaterniond& v);
00170 
00171 
00172 extern std::ostream& operator<<(std::ostream& o, const Eigen::Transform<double, 3, Eigen::Affine>& t);
00173 
00174 extern std::ostream& operator<<(std::ostream& o, const Eigen::Matrix4d& m);
00175 
00176 extern std::ostream& operator<<(std::ostream& o, const urdf::Pose& p);
00177 
00178 
00179 extern std::ostream& operator<<(std::ostream& o, const urdf::Vector3& p);
00180 
00181 #endif  // URDF_TRAVERSER_HELPERS_H


urdf_traverser
Author(s): Jennifer Buehler
autogenerated on Fri Mar 1 2019 03:38:07