Zen
A cross-platform functional programming language

Project Struct Reference

This class represents a project. More...

#include <Build.hpp>

List of all members.

Public Member Functions

 Project ()
 Constructor for abstract base class.
ProjectsetRunMode (const RunMode::T &val)
 Set run mode.
const RunMode::TgetRunMode () const
 Get run mode.
ProjectsetName (const z::string &val)
 Set project name.
const z::stringgetName () const
 Get project name.
ProjectsetProjectType (const z::string &val)
 Set project type.
const z::stringgetProjectType () const
 Get project type.
ProjectsetSrc (const z::string &val)
 Set source directory.
const z::stringgetSrc () const
 Get source directory.
ProjectsetOut (const z::string &val)
 Set output directory.
const z::stringgetOut () const
 Get output directory.
ProjectsetBldDir (const z::string &val)
 Set build directory.
const z::stringgetBldDir () const
 Get build directory.
ProjectsetRmBldDir (const bool &val)
 Set flag whether to delete bld directory.
const bool & getRmBldDir () const
 Get rmdir flag.
ProjectsetNoBuild (const bool &val)
 Set noBuild flag.
const bool & getNoBuild () const
 Get nobuild flag.
ProjectsetNoTest (const bool &val)
 Set no Test flag.
const bool & getNoTest () const
 Get notest flag.
ProjectsetMain (const bool &val)
 Set main flag.
const bool & getMain () const
 Get main flag.
ProjectaddFile (const Unit &val)
 Add file.
const z::list< Unit > & getFileList () const
 Get file list.
ProjectaddConfig (const Config &val)
 Add config.
const z::list< Config > & getConfigList () const
 Get config list.
ProjectaddGenCfg (const z::string &val)
 Add config to list of config's to generate.
const z::list< z::string > & getGenCfgList () const
 Get config list to generate.
const z::list< Config > & getCConfigList () const
 Get config list.
ProjectaddFileName (const z::string &val)
 Add file name.
bool inGenCfgList (const Config &cfg) const
 Check if a config is in the gen config list.
ProjectsetProjectFile (const z::string &val)
 Set project file name.
const z::stringgetProjectFile () const
 Get project file name.
ProjectsetRoot (const z::string &val)
 Set root directory.
const z::stringgetRoot () const
 Get root directory.
ProjectsetConfig (const z::string &val)
 Set config name.
const z::stringgetConfig () const
 Get config name.
ConfiggetCmdConfig ()
 Get command line configuration.
const ConfiggetCmdConfig () const
 Get command line configuration.
bool isZppExt (const z::string &ext) const
 Check if extension is a ZPP file.
bool isCppExt (const z::string &ext) const
 Check if extension is a CPP file.
bool isHppExt (const z::string &ext) const
 Check if extension is a HPP file.
z::string getAbsoluteDirPath (const z::string &filename) const
 Convert filename to absolute path.
z::string getDirPath (const z::string &dir, const z::string &filename) const
 Convert filename to absolute path.
z::string getAbsoluteFilePath (const z::string &filename) const
 Convert filename to absolute path.
z::string getFilePath (const z::string &dir, const z::string &filename) const
 Convert filename to absolute path.
z::string getRelativeFilePath (const z::string &srcdir, const z::string &dstdir, const z::string &filename) const
 Convert filename to path relative to given path.
void verifyDir (const z::string &name, const z::string &dir, const Config &cfg) const
 Check if directory exists. If not, make it.
z::string getExt (const Build::Config &cfg) const
 Get output extension depending on output type and platform.
z::string getConfigValue (const Build::Config &cfg, const z::string &val) const
 Get config value, expanded.
z::string getConfigValue (const z::string &val) const
 Get config value, expanded.

Private Attributes

RunMode::T _runMode
 The run mode for the compiler.
z::string _name
 Project name.
z::string _project
 Project type.
z::string _src
 Source directory.
z::string _out
 Outpout directory.
z::string _bldDir
 Build directory.
bool _rmBldDir
 True if build directory should be deleted.
bool _noBuild
 True if build should not be called.
bool _noTest
 True if unit test should not be called.
bool _main
 True if main() should be generated.
z::list< Unit_fileList
 List of files in project.
z::list< Config_cfgList
 List of config's in project.
z::list< z::string_genCfgList
 Subset of config's to generate project for.
z::string _projectFile
 Project file name.
z::string _root
 Root directory.
z::string _config
 Config name.
z::list< Config_cmdCfgList
 Command line config list (contains only one config)
z::string _zppExtensionList
 List of extensions for zpp files.
z::string _cppExtensionList
 List of extensions for cpp files.
z::string _hppExtensionList
 List of extensions for hpp files.

Detailed Description

This class represents a project.

Todo:
Explain GenConfigList

Member Function Documentation

Project& addConfig ( const Config val) [inline]

Add config.

Parameters:
valThe file
Returns:
Self-reference
Project& addFile ( const Unit val) [inline]

Add file.

Parameters:
valThe file
Returns:
Self-reference
Project& addFileName ( const z::string val) [inline]

Add file name.

Create a Unit instance and add it to the list

Parameters:
valThe file name
Returns:
Self-reference
Project& addGenCfg ( const z::string val) [inline]

Add config to list of config's to generate.

Parameters:
valThe config name
Returns:
Self-reference
z::string getAbsoluteDirPath ( const z::string filename) const [inline]

Convert filename to absolute path.

Parameters:
filenameFilename to convert
Returns:
Absolute path of filename
z::string getAbsoluteFilePath ( const z::string filename) const [inline]

Convert filename to absolute path.

Parameters:
filenameFilename to convert
Returns:
Absolute path of filename
const z::string& getBldDir ( ) const [inline]

Get build directory.

Returns:
Build directory
const z::list<Config>& getCConfigList ( ) const [inline]

Get config list.

This checks if list of config's is non-empty. If it is empty, return cmdConfig

Returns:
Reference to config list
Config& getCmdConfig ( ) [inline]

Get command line configuration.

Returns:
Reference command line configuration
const Config& getCmdConfig ( ) const [inline]

Get command line configuration.

Returns:
Reference command line configuration
const z::string& getConfig ( ) const [inline]

Get config name.

Returns:
Config name
const z::list<Config>& getConfigList ( ) const [inline]

Get config list.

Returns:
Reference to config list
z::string getConfigValue ( const Build::Config cfg,
const z::string val 
) const [inline]

Get config value, expanded.

Parameters:
cfgConfig to check under
valThe value to read and expand
Returns:
The expanded value
z::string getConfigValue ( const z::string val) const [inline]

Get config value, expanded.

Parameters:
valThe value to read and expand
Returns:
The expanded value
z::string getDirPath ( const z::string dir,
const z::string filename 
) const [inline]

Convert filename to absolute path.

Parameters:
dirThe directory of the file
filenameFilename to convert
Returns:
Absolute path of filename
z::string getExt ( const Build::Config cfg) const [inline]

Get output extension depending on output type and platform.

Parameters:
cfgConfig to check under
Returns:
The extension
const z::list<Unit>& getFileList ( ) const [inline]

Get file list.

Returns:
Reference to file list
z::string getFilePath ( const z::string dir,
const z::string filename 
) const [inline]

Convert filename to absolute path.

Parameters:
dirThe directory for the file
filenameFilename to convert
Returns:
Absolute path of filename
const z::list<z::string>& getGenCfgList ( ) const [inline]

Get config list to generate.

Returns:
Reference to library list
const bool& getMain ( ) const [inline]

Get main flag.

Returns:
True if main mode, else false
const z::string& getName ( ) const [inline]

Get project name.

Returns:
Project name
const bool& getNoBuild ( ) const [inline]

Get nobuild flag.

Returns:
True if nobuild mode, else false
const bool& getNoTest ( ) const [inline]

Get notest flag.

Returns:
True if notest mode, else false
const z::string& getOut ( ) const [inline]

Get output directory.

Returns:
Output directory
const z::string& getProjectFile ( ) const [inline]

Get project file name.

Returns:
Project file name
const z::string& getProjectType ( ) const [inline]

Get project type.

Returns:
Project type
z::string getRelativeFilePath ( const z::string srcdir,
const z::string dstdir,
const z::string filename 
) const [inline]

Convert filename to path relative to given path.

Parameters:
srcdirOutput path is relative to this
dstdirPath of file
filenameFilename to convert
Returns:
Relative path of filename
const bool& getRmBldDir ( ) const [inline]

Get rmdir flag.

Returns:
True if rmdir mode, else false
const z::string& getRoot ( ) const [inline]

Get root directory.

Returns:
Root directory
const RunMode::T& getRunMode ( ) const [inline]

Get run mode.

Returns:
Run mode value
const z::string& getSrc ( ) const [inline]

Get source directory.

Returns:
Source directory
bool inGenCfgList ( const Config cfg) const [inline]

Check if a config is in the gen config list.

Parameters:
cfgThe config to check
Returns:
True if cgf is in the list of config's to be generated.
bool isCppExt ( const z::string ext) const [inline]

Check if extension is a CPP file.

Parameters:
extThe extension to check
Returns:
True if extension is a CPP file
bool isHppExt ( const z::string ext) const [inline]

Check if extension is a HPP file.

Parameters:
extThe extension to check
Returns:
True if extension is a HPP file
bool isZppExt ( const z::string ext) const [inline]

Check if extension is a ZPP file.

Parameters:
extThe extension to check
Returns:
True if extension is a ZPP file
Project& setBldDir ( const z::string val) [inline]

Set build directory.

Parameters:
valNew value
Returns:
Self-reference
Project& setConfig ( const z::string val) [inline]

Set config name.

Parameters:
valNew value
Returns:
Self-reference
Project& setMain ( const bool &  val) [inline]

Set main flag.

Parameters:
valNew value
Returns:
Self-reference
Project& setName ( const z::string val) [inline]

Set project name.

Parameters:
valNew value
Returns:
Self-reference
Project& setNoBuild ( const bool &  val) [inline]

Set noBuild flag.

Parameters:
valNew value
Returns:
Self-reference
Project& setNoTest ( const bool &  val) [inline]

Set no Test flag.

Parameters:
valNew value
Returns:
Self-reference
Project& setOut ( const z::string val) [inline]

Set output directory.

Parameters:
valNew value
Returns:
Self-reference
Project& setProjectFile ( const z::string val) [inline]

Set project file name.

Parameters:
valNew value
Returns:
Self-reference
Project& setProjectType ( const z::string val) [inline]

Set project type.

Parameters:
valNew value
Returns:
Self-reference
Project& setRmBldDir ( const bool &  val) [inline]

Set flag whether to delete bld directory.

Parameters:
valNew value
Returns:
Self-reference
Project& setRoot ( const z::string val) [inline]

Set root directory.

Parameters:
valNew value
Returns:
Self-reference
Project& setRunMode ( const RunMode::T val) [inline]

Set run mode.

Parameters:
valNew value
Returns:
Self-reference
Project& setSrc ( const z::string val) [inline]

Set source directory.

Parameters:
valNew value
Returns:
Self-reference
void verifyDir ( const z::string name,
const z::string dir,
const Config cfg 
) const [inline]

Check if directory exists. If not, make it.

Parameters:
nameName of directory (for error message)
dirPath of directory
cfgConfig to check under

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines