33 #ifndef __H__UG__path_provider__
34 #define __H__UG__path_provider__
175 absoluteFilename =
inst().
get_path(pathType) + pathSep + relativeFilename;
190 absoluteDirname =
inst().
get_path(pathType) + pathSep + relativeDirname;
204 std::map<PathTypes, std::string>
m_map;
Singleton which stores common paths and a stack of current paths.
Definition: path_provider.h:76
static bool has_current_path()
returns true if a current path exists, false if not.
Definition: path_provider.h:120
static void push_current_path(const std::string &path)
pushes a path to the stack of current paths
Definition: path_provider.h:124
std::map< PathTypes, std::string > m_map
Definition: path_provider.h:204
std::stack< std::string > m_curPaths
Definition: path_provider.h:205
static void pop_current_path()
pops a path from the stack of current paths
Definition: path_provider.h:128
static PathProvider & inst()
Definition: path_provider.h:197
static bool get_filename_relative_to_path(PathTypes pathType, const std::string &relativeFilename, std::string &absoluteFilename)
Definition: path_provider.h:170
PathProvider(const PathProvider &)
Definition: path_provider.h:195
static void clear_current_path_stack()
clears the stack of current paths. This makes sense if an error was catched.
Definition: path_provider.h:132
static const std::string & get_current_path(PathTypes defPath=BIN_PATH)
returns the current path
Definition: path_provider.h:112
static bool get_filename_relative_to_current_path(const std::string &relativeFilename, std::string &absoluteFilename)
Definition: path_provider.h:140
static bool get_dirname_relative_to_path(PathTypes pathType, const std::string &relativeDirname, std::string &absoluteDirname)
Definition: path_provider.h:184
static void set_path(PathTypes pathType, const std::string &path)
sets the path for the given constant.
Definition: path_provider.h:84
static const std::string & get_path(PathTypes pathType)
returns the path associated with the given constant.
Definition: path_provider.h:93
static bool get_dirname_relative_to_current_path(const std::string &relativeDirname, std::string &absoluteDirname)
Definition: path_provider.h:155
PathProvider()
Definition: path_provider.h:194
static bool has_path(PathTypes pathType)
returns true, if the path associated with the given constant exists.
Definition: path_provider.h:102
UG_API bool FileExists(const char *filename)
!!! Serial i/o version !!!
Definition: file_util.cpp:53
UG_API bool DirectoryExists(const char *dirname)
Checks the existence of a given directory.
Definition: file_util_posix.cpp:74
const char * GetPathSeparator()
returns a string containing the path-separator for the current os
Definition: os_info_linux.cpp:47
PathTypes
Constants used by PathProvider.
Definition: path_provider.h:53
@ SCRIPT_PATH
Definition: path_provider.h:55
@ ROOT_PATH
Definition: path_provider.h:56
@ MAX_PATH_CONSTANT
Definition: path_provider.h:61
@ APPS_PATH
path in which the application-scripts lie
Definition: path_provider.h:58
@ PLUGIN_PATH
Definition: path_provider.h:57
@ BIN_PATH
path in which the binary lies
Definition: path_provider.h:54