WSF
RunEnvManager.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11#ifndef RUNENVMANAGER_HPP
12#define RUNENVMANAGER_HPP
13
14#include <string>
15#include <vector>
16
17#include "ViExport.hpp"
18
19// Utilities
20#include "UtPath.hpp"
21
22// Forward Declaration
23class UtDynamicLibrary;
24
25namespace wizard
26{
28{
29public:
30 static bool Initialize(const UtPath& aBinPath, std::string& aErrorString);
31
32 static std::string GetVersionString(bool aDate = true);
33 static void SetVersion(int aMajor, int aMinor, int aPatch);
34
35 static const UtPath& GetInstallRootDir();
36
37 static const UtPath& GetBinDir();
38 static const UtPath& GetDemosDir();
39 static const UtPath& GetTrainingDir();
40 static const UtPath& GetScenariosDir();
41 static const UtPath& GetDocumentationDir();
42 static const UtPath& GetDataDir();
43 static const UtPath& GetGrammarDir();
44
45 static bool HasDeveloperPaths();
46
47 static std::vector<UtPath> GetDemoSearchPaths();
48
49 static std::string DocumentationURL_Static(const std::string& aPageName, const std::string& aAnchor = std::string());
50
51 static std::string DocumentationURL(const std::string& aPageName, const std::string& aAnchor = std::string());
52
54 static UtPath Search(const std::vector<UtPath>& aPathsToSearch, const UtPath& aRelativePath, bool aTargetIsDirectory);
55
57 static UtPath RelativePath(const std::vector<UtPath>& aPathsToSearch, const UtPath& aFullPath);
58
59 // Search for a data file under data/, if the file is not found, exit with error message
60 static UtPath FindCriticalResource(const std::string& aFileRelativePath);
61
62 static std::string GetSimpleVersionString();
63
64private:
65 static UtPath InitSubDir(const UtPath& aParentDir, const std::string& aSubDirName);
66 static bool InitDataDir(std::string& aErrorString);
67 static bool InitRootDir(std::string& aErrorString);
68
69 static UtPath FindPath(const UtPath& aPath, const std::string& aDir, int aIter);
70
71 static bool InitDir(UtPath& aDirPath, const std::string& aDirName, std::string& aErrorString);
72};
73} // namespace wizard
74
75#endif
#define VI_EXPORT
Definition ViExport.hpp:38
Definition RunEnvManager.hpp:28
static const UtPath & GetInstallRootDir()
Definition RunEnvManager.cpp:109
static const UtPath & GetDemosDir()
Definition RunEnvManager.cpp:119
static std::string DocumentationURL_Static(const std::string &aPageName, const std::string &aAnchor=std::string())
Definition RunEnvManager.cpp:187
static bool Initialize(const UtPath &aBinPath, std::string &aErrorString)
Definition RunEnvManager.cpp:44
static UtPath FindCriticalResource(const std::string &aFileRelativePath)
Definition RunEnvManager.cpp:242
static std::string GetSimpleVersionString()
Definition RunEnvManager.cpp:256
static const UtPath & GetBinDir()
Definition RunEnvManager.cpp:114
static const UtPath & GetDataDir()
Definition RunEnvManager.cpp:129
static void SetVersion(int aMajor, int aMinor, int aPatch)
Definition RunEnvManager.cpp:101
static const UtPath & GetScenariosDir()
Definition RunEnvManager.cpp:144
static std::string DocumentationURL(const std::string &aPageName, const std::string &aAnchor=std::string())
Definition RunEnvManager.cpp:192
static const UtPath & GetGrammarDir()
Definition RunEnvManager.cpp:134
static bool HasDeveloperPaths()
Definition RunEnvManager.cpp:149
static UtPath Search(const std::vector< UtPath > &aPathsToSearch, const UtPath &aRelativePath, bool aTargetIsDirectory)
Search for a file in a list of directories. returns an empty path if the file is not found.
Definition RunEnvManager.cpp:198
static const UtPath & GetDocumentationDir()
Definition RunEnvManager.cpp:124
static UtPath RelativePath(const std::vector< UtPath > &aPathsToSearch, const UtPath &aFullPath)
Complimentary to Search(), this yields the best relative path given a search path.
Definition RunEnvManager.cpp:219
static std::string GetVersionString(bool aDate=true)
Definition RunEnvManager.cpp:86
static std::vector< UtPath > GetDemoSearchPaths()
Definition RunEnvManager.cpp:155
static const UtPath & GetTrainingDir()
Definition RunEnvManager.cpp:139
Definition Runner.hpp:22
Copyrights Multiple, All Rights Reserved