Documentation for OpenFLUID 2.2.0
ExamplesManager.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30 */
31 
32 
33 /**
34  @file ExamplesManager.hpp
35 
36  @author Jean-Christophe FABRE <jean-christophe.fabre@inrae.fr>
37  */
38 
39 
40 #ifndef __OPENFLUID_BASE_EXAMPLESMANAGER_HPP__
41 #define __OPENFLUID_BASE_EXAMPLESMANAGER_HPP__
42 
43 
44 #include <string>
45 
46 #include <openfluid/dllexport.hpp>
47 
48 
49 namespace openfluid { namespace base {
50 
51 
53 {
54 
55  private:
56 
57  static std::string buildRessourcesPath(const std::string& Path);
58 
59  static std::string buildInstallPath(const std::string& Path);
60 
61  static bool installDirectory(const std::string& FromPath, const std::string& ToPath,
62  const std::string& DirName, const bool Force = false);
63 
64  public:
65 
66  ExamplesManager() = delete;
67 
68  ~ExamplesManager() = delete;
69 
70  /**
71  Installs a single example project, using its directory name
72  @param[in] ProjectDir Name of the project directory to install
73  @param[in] ResourcesPath Path to the examples ressources,
74  uses standard ressources path if empty (default is empty)
75  @param[in] InstallPath Path where to install the examples ressources,
76  uses user openfluid path if empty (default is empty)
77  @param[in] Force If true, the installation is forced even if it already exists (default is false)
78  */
79  static bool installProject(const std::string& ProjectDir,
80  const std::string& ResourcesPath = "", const std::string& InstallPath = "",
81  const bool Force = false);
82 
83  /**
84  Installs a single example simulator, using its directory name
85  @param[in] SimulatorDir Name of the simulator directory to install
86  @param[in] ResourcesPath Path to the examples ressources,
87  uses standard ressources path if empty (default is empty)
88  @param[in] InstallPath Path where to install the examples ressources,
89  uses user openfluid path if empty (default is empty)
90  @param[in] Force If true, the installation is forced even if it already exists (default is false)
91  */
92  static bool installSimulator(const std::string& SimulatorDir,
93  const std::string& ResourcesPath = "", const std::string& InstallPath = "",
94  const bool Force = false);
95 
96  /**
97  Installs all example projects
98  @param[in] ResourcesPath Path to the examples ressources,
99  uses standard ressources path if empty (default is empty)
100  @param[in] InstallPath Path where to install the examples ressources,
101  uses user openfluid path if empty (default is empty)
102  @param[in] Force If true, the installation is forced even if it already exists (default is false)
103  */
104  static bool installAllProjects(const std::string& ResourcesPath = "", const std::string& InstallPath = "",
105  const bool Force = false);
106 
107  /**
108  Installs all example simulators
109  @param[in] ResourcesPath Path to the examples ressources,
110  uses standard ressources path if empty (default is empty)
111  @param[in] InstallPath Path where to install the examples ressources,
112  uses user openfluid path if empty (default is empty)
113  @param[in] Force If true, the installation is forced even if it already exists (default is false)
114  */
115  static bool installAllSimulators(const std::string& ResourcesPath = "", const std::string& InstallPath = "",
116  const bool Force = false);
117 
118  /**
119  Installs all example projects and simulators
120  @param[in] ResourcesPath Path to the examples ressources,
121  uses standard ressources path if empty (default is empty)
122  @param[in] InstallPath Path where to install the examples ressources,
123  uses user openfluid path if empty (default is empty)
124  @param[in] Force If true, the installation is forced even if it already exists (default is false)
125  */
126  static bool installAll(const std::string& ResourcesPath = "", const std::string& InstallPath = "",
127  const bool Force = false);
128 };
129 
130 
131 } } // namespaces
132 
133 
134 #endif /* __OPENFLUID_BASE_EXAMPLESMANAGER_HPP__ */
Definition: ExamplesManager.hpp:53
static bool installAllSimulators(const std::string &ResourcesPath="", const std::string &InstallPath="", const bool Force=false)
static bool installSimulator(const std::string &SimulatorDir, const std::string &ResourcesPath="", const std::string &InstallPath="", const bool Force=false)
static bool installProject(const std::string &ProjectDir, const std::string &ResourcesPath="", const std::string &InstallPath="", const bool Force=false)
static bool installAllProjects(const std::string &ResourcesPath="", const std::string &InstallPath="", const bool Force=false)
static bool installAll(const std::string &ResourcesPath="", const std::string &InstallPath="", const bool Force=false)
#define OPENFLUID_API
Definition: dllexport.hpp:86
FilesystemPath Path
Definition: FilesystemPath.hpp:308
Definition: ApplicationException.hpp:47