The Dirtchamber
A mixed reality testing environment for real-time global illumination algorithms
common_tools.h
Go to the documentation of this file.
1 /*
2  * Dune D3D library - Tobias Alexander Franke 2011
3  * For copyright and license see LICENSE
4  * http://www.tobias-franke.eu
5  */
6 
9 #ifndef DUNE_COMMON_TOOLS
10 #define DUNE_COMMON_TOOLS
11 
12 #include "unicode.h"
13 #include <vector>
14 
15 namespace dune
16 {
18  tstring extract_path(const tstring& pattern);
19 
21  bool path_is_relative(const tstring& p);
22 
24  tstring absolute_path();
25 
27  tstring make_absolute_path(const tstring& relative_filename);
28 
30  std::vector<tstring> files_from_args(const tstring& args, const tstring& default_file = L"");
31 }
32 
33 #endif
tstring extract_path(const tstring &pattern)
Extract a path from a given pattern, e.g. "C:/foo" from "C:/foo/\*.bar".
Definition: common_tools.cpp:37
bool path_is_relative(const tstring &p)
Returns true if the supplied path p was a relative URI.
Definition: common_tools.cpp:47
tstring absolute_path()
Returns an absolute path of the current execution directory.
Definition: common_tools.cpp:53
tstring make_absolute_path(const tstring &relative_filename)
Return an absolute URI to a URI relative to the execution directory. Thus function is used in every l...
Definition: common_tools.cpp:67
std::vector< tstring > files_from_args(const tstring &arg, const tstring &default_file)
Return a vector of strings from a given argument string. A default file will be pushed to the vector ...
Definition: common_tools.cpp:18