30 #include <boost/tokenizer.hpp>
32 #include "WPathHelper.h"
148 boost::filesystem::path resRel =
getPathHelper()->m_moduleResourcePathRelative / packageName;
151 return moduleLibPath / resRel;
157 std::vector< boost::filesystem::path > paths;
163 std::string additionalPaths( getenv(
"OW_MODULE_PATH" ) ? getenv(
"OW_MODULE_PATH" ) :
"" );
166 typedef boost::tokenizer< boost::char_separator< char > > tokenizer;
167 boost::char_separator< char > sep(
";" );
168 tokenizer tok( additionalPaths, sep );
169 for( tokenizer::iterator it = tok.begin(); it != tok.end(); ++it )
171 paths.push_back( boost::filesystem::path( *it ) );
179 if( !std::count( paths.begin(), paths.end(), *it ) )
181 paths.push_back( *it );
boost::filesystem::path m_moduleResourcePathRelative
The path to module resources, relative to the module libraries path.
static boost::filesystem::path getConfigPath()
The path where the config files reside in.
static boost::filesystem::path getDocPath()
The path where the doc files reside in.
static boost::filesystem::path getHomePath()
The path to the OW dir in the user's home.
void setBasePaths(boost::filesystem::path appPath, boost::filesystem::path homePath)
Set the current application path.
static Fonts getAllFonts()
The paths to all fonts supported.
void setBasePathsOSXBundle(boost::filesystem::path appPath, boost::filesystem::path homePath)
Set the current application path.
boost::filesystem::path m_appPath
Application path.
static boost::filesystem::path getFontPath()
The path where font files reside in.
Paths to all known fonts.
std::vector< boost::filesystem::path > m_additionalModulePaths
A list of additional paths to search for modules.
boost::filesystem::path m_modulePath
The path to the globally installed modules.
static boost::filesystem::path getShaderPath()
The path to the global shaders.
virtual ~WPathHelper()
Destructor.
boost::filesystem::path m_docPath
The path where all the documentation files reside in.
boost::filesystem::path Default
The default font to use in most cases.
static std::vector< boost::filesystem::path > getAllModulePaths()
This returns a list of search paths for modules.
static boost::shared_ptr< WPathHelper > getPathHelper()
Returns instance of the path helper.
boost::filesystem::path m_sharePath
The path where all the shared files reside in.
void addAdditionalModulePath(const boost::filesystem::path &path)
This method adds the given path to the list of module paths.
static boost::shared_ptr< WPathHelper > m_instance
Singleton instance of WPathHelper.
boost::filesystem::path m_homePath
The path of a user specific OW directory.
boost::filesystem::path m_configPath
The path where all the config files reside in.
boost::filesystem::path Italic
Italic font.
static boost::filesystem::path getLibPath()
The path to the OW libs.
static boost::filesystem::path getSharePath()
The path where shared files reside in.
boost::filesystem::path Regular
The Regular font (not bold, not italic)
WPathHelper()
Constructors are protected because this is a Singleton.
boost::filesystem::path m_libPath
The path to the OW libs.
static boost::filesystem::path getAppPath()
The path where the binary file resides in.
static boost::filesystem::path getModulePath()
The path to the globally installed modules.
static boost::filesystem::path getModuleResourcePath(boost::filesystem::path moduleLibPath, std::string packageName)
The path to a given module's resources.
boost::filesystem::path Bold
Bold font.
const std::vector< boost::filesystem::path > & getAdditionalModulePaths() const
Returns the list of paths added using addAdditionalModulePath.