Blender  V3.3
AppConfig.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
10 #include <algorithm>
11 #include <string>
12 
13 #include "../system/Precision.h"
14 
15 #ifdef WITH_CXX_GUARDEDALLOC
16 # include "MEM_guardedalloc.h"
17 #endif
18 
19 using namespace std;
20 
21 namespace Freestyle {
22 
23 namespace Config {
24 
25 class Path {
26  protected:
27  static Path *_pInstance;
28  string _ProjectDir;
29  string _ModelsPath;
30  string _PatternsPath;
31  string _BrushesPath;
32  string _EnvMapDir;
33  string _MapsDir;
34  string _HomeDir;
35 
36  public:
37  Path();
38  virtual ~Path();
39  static Path *getInstance();
40 
41  void setRootDir(const string &iRootDir);
42  void setHomeDir(const string &iHomeDir);
43 
44  const string &getProjectDir() const
45  {
46  return _ProjectDir;
47  }
48  const string &getModelsPath() const
49  {
50  return _ModelsPath;
51  }
52  const string &getPatternsPath() const
53  {
54  return _PatternsPath;
55  }
56  const string &getBrushesPath() const
57  {
58  return _BrushesPath;
59  }
60  const string &getEnvMapDir() const
61  {
62  return _EnvMapDir;
63  }
64  const string &getMapsDir() const
65  {
66  return _MapsDir;
67  }
68  const string &getHomeDir() const
69  {
70  return _HomeDir;
71  }
72 
73  static string getEnvVar(const string &iEnvVarName);
74 
75 #ifdef WITH_CXX_GUARDEDALLOC
76  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Config:Path")
77 #endif
78 };
79 
80 //
81 // Configuration, default values
82 //
84 
85 // Application
86 static const string APPLICATION_NAME("APPNAME");
87 static const string APPLICATION_VERSION("APPVERSION");
88 
89 // ViewMap
90 static const string VIEWMAP_EXTENSION("vm");
91 static const string VIEWMAP_MAGIC("ViewMap File");
92 static const string VIEWMAP_VERSION("1.9");
93 
94 // Style modules
95 static const string STYLE_MODULE_EXTENSION("py");
96 static const string STYLE_MODULES_LIST_EXTENSION("sml");
97 
98 // Options
99 static const string OPTIONS_DIR("." + APPLICATION_NAME);
100 static const string OPTIONS_FILE("options.xml");
101 static const string OPTIONS_CURRENT_DIRS_FILE("current_dirs.xml");
102 static const string OPTIONS_QGLVIEWER_FILE("qglviewer.xml");
103 
104 } // namespace Config
105 
106 } /* namespace Freestyle */
Read Guarded memory(de)allocation.
const string & getPatternsPath() const
Definition: AppConfig.h:52
const string & getBrushesPath() const
Definition: AppConfig.h:56
const string & getEnvMapDir() const
Definition: AppConfig.h:60
const string & getModelsPath() const
Definition: AppConfig.h:48
const string & getProjectDir() const
Definition: AppConfig.h:44
const string & getMapsDir() const
Definition: AppConfig.h:64
const string & getHomeDir() const
Definition: AppConfig.h:68
static Path * _pInstance
Definition: AppConfig.h:27
static const string VIEWMAP_EXTENSION("vm")
static const string OPTIONS_DIR("."+APPLICATION_NAME)
static const string OPTIONS_QGLVIEWER_FILE("qglviewer.xml")
static const string OPTIONS_CURRENT_DIRS_FILE("current_dirs.xml")
static const string STYLE_MODULE_EXTENSION("py")
static const string STYLE_MODULES_LIST_EXTENSION("sml")
static const string OPTIONS_FILE("options.xml")
static const string VIEWMAP_VERSION("1.9")
static const string VIEWMAP_MAGIC("ViewMap File")
static const string APPLICATION_NAME("APPNAME")
static const string APPLICATION_VERSION("APPVERSION")
inherits from class Rep
Definition: AppCanvas.cpp:18