GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
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{
39public:
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
75 void setAppPath(const QString &appPath)
76 {
77 _appPath = appPath;
78 }
79
84 void setBuildMode(const QString &buildMode)
85 {
86 _buildMode = buildMode;
87 }
88
89 QString translatePath(QString path) const;
90
91 void printPathMacros(const GmLogCategory& logger, GmLogLevel level, bool printProjectMacros);
92
93 static QString toNativeSeparators(QString path);
94
95private:
107};
108
109
110#endif
111
Class representing a category with multiple logging levels.
Definition gmLog.h:58
Class used to store releveant system and project paths, providing functions for path macro translatio...
Definition gmPath.h:38
void setUserGivenPaths(QString logPath, QString inputPath, QString outputPath)
Sets paths given by the user as command line parameters.
Definition gmPath.h:60
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 _appPath
Directory that contains the executable (stripped of release or debug dirs if present)
Definition gmPath.h:96
QString scriptsPath() const
Returns the current scripts path.
Definition gmPath.h:49
QString _simulationBaseFileName
Base simulation file name, without extension.
Definition gmPath.h:102
void setAppPath(const QString &appPath)
Sets the app location.
Definition gmPath.h:75
QDateTime _simTime
The time when the simulation started.
Definition gmPath.h:106
void setBuildMode(const QString &buildMode)
Overwrite the build mode.
Definition gmPath.h:84
QString _configPath
Directory that contains the config file in use.
Definition gmPath.h:99
QString _inputPath
An input file path. Either a user supplied path (through command line) or equal to _simulationDir.
Definition gmPath.h:104
QString _outputPath
An output file path. Either a user supplied path (through command line) or equal to _simulationDir.
Definition gmPath.h:105
QString _initialPath
The current path when the library was initialized.
Definition gmPath.h:97
QString _scriptsPath
Directory that contains utilitary Lua script files.
Definition gmPath.h:100
void setConfigPath(QString path)
Sets the path used to find configuration files ($APPCONFIG value)
Definition gmPath.h:43
QString _simulationDir
Directory that contains the simulation file in use.
Definition gmPath.h:101
QString _buildMode
'release', 'debug' or '' depending on the presence of those subdirs in the unstripped program path
Definition gmPath.h:98
void setScriptsPath(QString path)
Sets the path used to find utilitary Lua scripts ($SCRIPTS value)
Definition gmPath.h:46
QString _logPath
The path for the log file. Either a user supplied path (through command line) or equal to _appPath.
Definition gmPath.h:103
Declaration of useful configuration definitions for the Core library.
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Declaration of support functions and macros for information logging.
GmLogLevel
Available log levels list.
Definition gmLog.h:36