TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/common/utils/applicationPath.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_COMMON_APPLICATIONPATH_HPP_
00002 #define _TUTTLE_COMMON_APPLICATIONPATH_HPP_
00003 
00004 #include <boost/filesystem/path.hpp>
00005 #include <boost/filesystem/operations.hpp>
00006 
00007 namespace tuttle {
00008 namespace common {
00009 
00010 
00011 boost::filesystem::path applicationFilepath( const std::string& argv0, const boost::filesystem::path& currentPath = boost::filesystem::current_path() );
00012 
00013 
00014 inline boost::filesystem::path canonicalApplicationFilepath( const std::string& argv0, const boost::filesystem::path& currentPath = boost::filesystem::current_path() )
00015 {
00016         return boost::filesystem::canonical( applicationFilepath( argv0, currentPath ), currentPath );
00017 }
00018 
00019 
00020 inline boost::filesystem::path applicationFolder( const std::string& argv0, const boost::filesystem::path& currentPath = boost::filesystem::current_path() )
00021 {
00022         return applicationFilepath( argv0, currentPath ).parent_path();
00023 }
00024 
00025 
00026 inline boost::filesystem::path canonicalApplicationFolder( const std::string& argv0, const boost::filesystem::path& currentPath = boost::filesystem::current_path() )
00027 {
00028         return canonicalApplicationFilepath( argv0, currentPath ).parent_path();
00029 }
00030 
00031 
00032 }
00033 }
00034 
00035 #endif