opensurgsim
ApplicationData.h
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_FRAMEWORK_APPLICATIONDATA_H
17 #define SURGSIM_FRAMEWORK_APPLICATIONDATA_H
18 
19 #include <string>
20 #include <vector>
21 
22 #if !defined(SURGSIM_PARSED_BY_DOXYGEN) // do not generate documentation for Boost stuff!
23 namespace boost
24 {
25 namespace filesystem
26 {
27 class path;
28 } // namespace filesystem
29 } // namespace boost
30 #endif // defined(SURGSIM_PARSED_BY_DOXYGEN)
31 
32 namespace SurgSim
33 {
34 namespace Framework
35 {
36 
40 {
41 public:
42 
48  explicit ApplicationData(const std::vector<std::string>& paths);
49 
52  explicit ApplicationData(const std::string& configFile);
53 
54  ~ApplicationData();
55 
59  std::vector<std::string> getPaths() const;
60 
68  std::string findFile(const std::string& fileName) const;
69 
76  bool tryFindFile(const std::string& fileName, std::string* target) const;
77 
81  bool isValidFilename(const std::string& fileName) const;
82 
83 private:
88  bool addPath(const std::string& pathName);
89 
95  bool setPaths(const std::vector<std::string>& paths);
96 
97  std::vector<boost::filesystem::path> m_paths;
98 };
99 
100 }; // Framework
101 }; // SurgSim
102 
103 #endif // SURGSIM_FRAMEWORK_APPLICATIONDATA_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Enable searching for files in a given list of paths, give access to the current directory and wrap bo...
Definition: ApplicationData.h:39
Definition: ApplicationData.h:23