Last change
on this file since 3463 was
3463,
checked in by ldelgass, 11 years ago
|
Begin process of renaming R2 library
|
-
Property svn:eol-style set to
native
|
File size:
1.0 KB
|
Line | |
---|
1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | #ifndef NV_UTIL_FILE_PATH_H |
---|
3 | #define NV_UTIL_FILE_PATH_H |
---|
4 | |
---|
5 | #include <list> |
---|
6 | #include <string> |
---|
7 | |
---|
8 | namespace nv { |
---|
9 | namespace util { |
---|
10 | |
---|
11 | class FilePath |
---|
12 | { |
---|
13 | public: |
---|
14 | FilePath(); |
---|
15 | |
---|
16 | /** |
---|
17 | * @brief find a file whose name is fileName and return its full path |
---|
18 | * @param fileName a file name |
---|
19 | * @return return full path of the file, but if not found, return "" |
---|
20 | */ |
---|
21 | std::string getPath(const char *fileName); |
---|
22 | |
---|
23 | /** |
---|
24 | * @brief set default data paths |
---|
25 | * @param path all default paths separated by colon(:) |
---|
26 | */ |
---|
27 | bool setPath(const char *path); |
---|
28 | |
---|
29 | void setWorkingDirectory(int argc, const char **argv); |
---|
30 | |
---|
31 | /// get FilePath instance |
---|
32 | static FilePath *getInstance(); |
---|
33 | |
---|
34 | private: |
---|
35 | typedef std::list<std::string> StringList; |
---|
36 | typedef std::list<std::string>::iterator StringListIter; |
---|
37 | |
---|
38 | /// application directory |
---|
39 | static std::string _curDirectory; |
---|
40 | |
---|
41 | /// FilePath instance |
---|
42 | static FilePath _instance; |
---|
43 | |
---|
44 | /// all default file paths |
---|
45 | StringList _pathList; |
---|
46 | }; |
---|
47 | |
---|
48 | } |
---|
49 | } |
---|
50 | |
---|
51 | #endif |
---|
52 | |
---|
Note: See
TracBrowser
for help on using the repository browser.