ApplicationData.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_FRAMEWORK_APPLICATIONDATA_H
#define SURGSIM_FRAMEWORK_APPLICATIONDATA_H
#include <string>
#include <vector>
#if !defined(SURGSIM_PARSED_BY_DOXYGEN) // do not generate documentation for Boost stuff!
namespace boost
{
namespace filesystem
{
class path;
} // namespace filesystem
} // namespace boost
#endif // defined(SURGSIM_PARSED_BY_DOXYGEN)
namespace SurgSim
{
namespace Framework
{
class ApplicationData
{
public:
explicit ApplicationData(const std::vector<std::string>& paths);
explicit ApplicationData(const std::string& configFile);
~ApplicationData();
std::vector<std::string> getPaths() const;
std::string findFile(const std::string& fileName) const;
bool tryFindFile(const std::string& fileName, std::string* target) const;
bool isValidFilename(const std::string& fileName) const;
private:
bool addPath(const std::string& pathName);
bool setPaths(const std::vector<std::string>& paths);
std::vector<boost::filesystem::path> m_paths;
};
}; // Framework
}; // SurgSim
#endif // SURGSIM_FRAMEWORK_APPLICATIONDATA_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Framework::ApplicationData::m_paths
std::vector< boost::filesystem::path > m_paths
Definition: ApplicationData.h:97
SurgSim::Framework::ApplicationData
Enable searching for files in a given list of paths, give access to the current directory and wrap bo...
Definition: ApplicationData.h:39