source: nanovis/trunk/util/FilePath.h @ 4795

Last change on this file since 4795 was 3465, checked in by ldelgass, 11 years ago

Rename R2 library to nv::graphics and nv::util.

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