GemaCoreLib
The GeMA Core library
gmPath.h
Go to the documentation of this file.
1 /************************************************************************
2 **
3 ** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4 ** All rights reserved.
5 **
6 ** This file is part of the "GeMA" software. It's use should respect
7 ** the terms in the license agreement that can be found together
8 ** with this source code.
9 ** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10 ** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11 ** A PARTICULAR PURPOSE.
12 **
13 ************************************************************************/
14 
24 #ifndef _GEMA_PATH_H_
25 #define _GEMA_PATH_H_
26 
27 #include "gmCoreConfig.h"
28 #include "gmLog.h"
29 
30 #include <QString>
31 #include <QDateTime>
32 
33 
38 {
39 public:
40  GmPath();
41 
43  void setConfigPath(QString path) { _configPath = path; }
44 
46  void setScriptsPath(QString path) { _scriptsPath = path; }
47 
49  QString scriptsPath() const { return _scriptsPath; }
50 
60  void setUserGivenPaths(QString logPath, QString inputPath, QString outputPath)
61  {
62  _logPath = logPath;
63  _inputPath = inputPath;
64  _outputPath = outputPath;
65  }
66 
68  void setSimulationPath(QString simulationDir, QString simulationBaseName)
69  {
70  _simulationDir = simulationDir;
71  _simulationBaseFileName = simulationBaseName;
72  }
73 
74  QString translatePath(QString path) const;
75 
76  void printPathMacros(const GmLogCategory& logger, GmLogLevel level, bool printProjectMacros);
77 
78  static QString toNativeSeparators(QString path);
79 
80 private:
92 };
93 
94 
95 #endif
96 
QString _inputPath
An input file path. Either a user supplied path (through command line) or equal to _simulationDir.
Definition: gmPath.h:89
Declaration of usefull configuration definitions for the Core library.
QString _logPath
The path for the log file. Either a user supplied path (through command line) or equal to _appPath.
Definition: gmPath.h:88
QString _buildMode
'release', 'debug' or '' depending on the presence of those subdirs in the unstripped program path
Definition: gmPath.h:83
Class used to store releveant system and project paths, providing functions for path macro translatio...
Definition: gmPath.h:37
QString scriptsPath() const
Returns the current scripts path.
Definition: gmPath.h:49
QString _scriptsPath
Directory that contains utilitary Lua script files.
Definition: gmPath.h:85
void setConfigPath(QString path)
Sets the path used to find configuration files ($APPCONFIG value)
Definition: gmPath.h:43
QString _outputPath
An output file path. Either a user supplied path (through command line) or equal to _simulationDir.
Definition: gmPath.h:90
#define GMC_API_EXPORT
Macro for controling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_LI...
Definition: gmCoreConfig.h:35
void setUserGivenPaths(QString logPath, QString inputPath, QString outputPath)
Sets paths given by the user as command line parameters.
Definition: gmPath.h:60
QString _appPath
Directory that contains the executable (stripped of release or debug dirs if present)
Definition: gmPath.h:81
GmLogLevel
Available log levels list.
Definition: gmLog.h:36
Class representing a category with multiple logging levels.
Definition: gmLog.h:58
QString _configPath
Directory that contains the config file in use.
Definition: gmPath.h:84
QString _simulationDir
Directory that contains the simulation file in use.
Definition: gmPath.h:86
void setScriptsPath(QString path)
Sets the path used to find utilitary Lua scripts ($SCRIPTS value)
Definition: gmPath.h:46
QDateTime _simTime
The time when the simulation started.
Definition: gmPath.h:91
void setSimulationPath(QString simulationDir, QString simulationBaseName)
Sets the location and base file name for the simulation project ($SIMULATIONDIR and $SIMULATIONNAME v...
Definition: gmPath.h:68
QString _simulationBaseFileName
Base simulation file name, without extension.
Definition: gmPath.h:87
QString _initialPath
The current path when the library was initialized.
Definition: gmPath.h:82
Declaration of support functions and macros for information logging.