LogBinding.cpp
Go to the documentation of this file.
00001 
00021 #include <grasp_planning_graspit/LogBinding.h>
00022 #include <grasp_planning_graspit/SharedPtr.h>
00023 #include <string>
00024 
00025 SHARED_PTR<GraspIt::Log> GraspIt::Log::Singleton((GraspIt::Log*) NULL);
00026 
00027 bool GraspIt::Log::initSglWarningPrinted = false;
00028 
00029 
00030 std::string getFilenameFromPath(const std::string& path)
00031 {
00032     std::string filename = path;
00033     const size_t last_slash_idx = filename.find_last_of("/");
00034     if (std::string::npos != last_slash_idx)
00035     {
00036         filename.erase(0, last_slash_idx + 1);
00037     }
00038     return filename;
00039 }
00040 
00041 std::string getFileDirectory(const std::string& pathToFile)
00042 {
00043     std::string filename = pathToFile;
00044     const size_t last_slash_idx = filename.find_last_of("/");
00045     if (std::string::npos != last_slash_idx)
00046     {
00047         filename.erase(last_slash_idx + 1, filename.length() - last_slash_idx);
00048     }
00049     return filename;
00050 }
00051 
00052 
00053 
00054 
00055 
00056 


grasp_planning_graspit
Author(s): Jennifer Buehler
autogenerated on Wed May 8 2019 02:53:36