#include <nap/projectinfo.h>
Public Types | |
enum | EContext : uint8 { Application = 0, Editor = 1 } |
Public Member Functions | |
bool | isEditorMode () const |
std::string | getFilename () const |
std::string | getProjectDir () const |
std::string | getNAPRootDir () const |
std::string | getBuildDir () const |
std::vector< std::string > | getModuleDirectories () const |
std::string | getDataFile () const |
std::string | getDataDirectory () const |
std::string | getIniDir () const |
std::string | getIniFilePath (const std::string &name) const |
bool | hasServiceConfigFile () const |
const PathMapping & | getPathMapping () const |
void | patchPath (std::string &path, const std::unordered_map< std::string, std::string > &additionalValues={}) const |
void | patchPaths (std::vector< std::string > &paths, const std::unordered_map< std::string, std::string > &additionalValues={}) const |
std::unique_ptr< ProjectInfo > | clone () const |
![]() | |
Object () | |
virtual | ~Object () |
virtual bool | init (utility::ErrorState &errorState) |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
std::string | mTitle |
Property: 'Title' project title. More... | |
std::string | mVersion |
Property: 'Version' project version. More... | |
std::string | mDefaultData |
Property: 'Data' relative path to the application content (json) file. More... | |
std::string | mPathMappingFile |
Property: 'PathMapping' relative path to the path mapping file. More... | |
std::string | mServiceConfigFilename = {} |
Property: 'ServiceConfig' optional relative path to service configuration file. More... | |
std::vector< std::string > | mRequiredModules |
Property: 'RequiredModules' names of modules this project depends on. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
Contains project related information, including project title, version number, the names of the modules the project depends on and what data file to load. The data file contains the actual app content. The project file describes the project.
The link to a service configuration file is optional, but when specified it is loaded and applied by Core on startup. The link to the path mapping file is required, otherwise the system won't be able to resolve all the paths.
std::unique_ptr<ProjectInfo> clone | ( | ) | const |
Clones this project info, including all properties.
std::string getBuildDir | ( | ) | const |
std::string getDataDirectory | ( | ) | const |
std::string getDataFile | ( | ) | const |
Returns the absolute path to the application data file, which contains application content.
std::string getFilename | ( | ) | const |
std::string getIniDir | ( | ) | const |
Returns the absolute path to this project's .ini directory. Note that it is not created if it does not exist. The .ini directory contains files that are used to (re)-store settings in between sessions
std::string getIniFilePath | ( | const std::string & | name | ) | const |
Returns an absolute .ini file path based on the given name. Note that this call does not create the .ini directory if it does not exist. The .ini file is used to (re)-store settings in between sessions
name | name of the file |
std::vector<std::string> getModuleDirectories | ( | ) | const |
std::string getNAPRootDir | ( | ) | const |
const PathMapping& getPathMapping | ( | ) | const |
std::string getProjectDir | ( | ) | const |
bool hasServiceConfigFile | ( | ) | const |
Returns if a service configuration file has been provided. Service configuration resources deserialized from the configuration file override service defaults. This means that if no config file is provided, services are initialized using their default configuration resource.
bool isEditorMode | ( | ) | const |
void patchPath | ( | std::string & | path, |
const std::unordered_map< std::string, std::string > & | additionalValues = {} |
||
) | const |
Replace all occurrences of specific project variables such as 'ROOT', 'BUILD_CONFIG' etc. with the actual resolved values. For example:
ROOT -> path to nap root directory BUILD_ARCH -> x86_64 BUILD_CONFIG -> Debug-x86_64 BUILD_TYPE -> Release PROJECT_DIR -> path to project directory
path | full path that contains the project variables to replace |
additionalValues | additional variables to resolve |
void patchPaths | ( | std::vector< std::string > & | paths, |
const std::unordered_map< std::string, std::string > & | additionalValues = {} |
||
) | const |
Replace all occurrences of specific project variables such as 'ROOT', 'BUILD_CONFIG' etc. with the actual resolved values. For example:
ROOT -> path to nap root directory BUILD_ARCH -> x86_64 BUILD_CONFIG -> Debug-x86_64 BUILD_TYPE -> Release PROJECT_DIR -> path to project directory
paths | paths that contains the project variables to replace |
additionalValues | additional variables to resolve |
std::string mDefaultData |
Property: 'Data' relative path to the application content (json) file.
std::string mPathMappingFile |
Property: 'PathMapping' relative path to the path mapping file.
std::vector<std::string> mRequiredModules |
Property: 'RequiredModules' names of modules this project depends on.
std::string mServiceConfigFilename = {} |
Property: 'ServiceConfig' optional relative path to service configuration file.
std::string mTitle |
Property: 'Title' project title.
std::string mVersion |
Property: 'Version' project version.