CBuild
C++ build system with scripts written in c++
Loading...
Searching...
No Matches
Functions | Variables
CBuild::Registry Namespace Reference

Functions

void init ()
 Internal init.
 
void RegisterTask (CBuild::Task *task)
 Register new task.
 
void CallTask (std::string name, std::vector< std::string > args)
 Run tasks.
 
void RegisterTarget (CBuild::Toolchain *target)
 Register new target for build.
 
CBuild::ToolchainGetToolchain (std::string name, bool force=false)
 Get the registered toolchain.
 
lib::map< std::string, CBuild::Toolchain * > GetTargets ()
 Get list of all targets.
 
void RegisterKeyword (std::string key, CBuild::Task *func)
 Register new keyord for parsing, ! Dangerous, owerwriting existing keywords can lead to undefined behaviours.
 
lib::map< std::string, std::string > GetKeywordsList ()
 Get list of all user registered keywords.
 
void SetRebuildName (std::string _name)
 Set the rebuilt CBuild executable name.
 
void AddLinkArg (std::string arg)
 Add linker arg for CBuild rebuild.
 
void AddCompileArg (std::string arg)
 Add compiler argument for CBuild rebuild.
 
void SetVersionHandler (void(*handler)())
 Set handler to add output to --version
 
void ToolchainAll (bool force, std::string path, std::vector< std::string > *args)
 Call and execute all toolchains.
 
CBuild::generator_baseGetGenerator (std::string id)
 Get generator for specified id.
 
void RegisterGenerator (CBuild::generator_base *gen, std::string id)
 Register generator for id.
 
std::vector< std::string > GetGeneratorsList ()
 Get list of registered generators.
 
std::vector< std::string > GetToolchainsList ()
 Get list of registered toolchains.
 
std::vector< std::string > GetTasksList ()
 Get list of registered tasks.
 
CBuild::ToolchainGetRebuildTarget ()
 Get target used for rebuild of CBuild script.
 
void null_handler ()
 

Variables

void(* handler )() = Registry::null_handler
 
CBuild::Help help
 
CBuild::Init initw
 
CBuild::Version ver
 
CBuild::TaskList tasklist
 
CBuild::ToolchainList toolchainlist
 
CBuild::GeneratorList generatorlist
 
CBuild::CmdList cmdlist
 
CBuild::ccj_out ccjo
 
CBuild::makefile_out makefileo
 
CBuild::CBuildRebuildScript rebuild_script
 
lib::map< std::string, CBuild::Task * > tasks
 
lib::map< std::string, bool > task_executed
 
lib::map< std::string, CBuild::Toolchain * > targets
 
lib::map< std::string, bool > target_executed
 
lib::map< std::string, std::string > keywords
 
lib::map< std::string, CBuild::generator_base * > generators
 

Function Documentation

◆ AddCompileArg()

void CBuild::Registry::AddCompileArg ( std::string arg)

Add compiler argument for CBuild rebuild.

Parameters
arg=> std::string -> raw argument

Definition at line 289 of file register.cpp.

References CBuild::Toolchain::add_compile_arg(), CBuild::arg, and rebuild_script.

◆ AddLinkArg()

void CBuild::Registry::AddLinkArg ( std::string arg)

Add linker arg for CBuild rebuild.

Parameters
arg=> std::string -> raw argument

Definition at line 285 of file register.cpp.

References CBuild::Toolchain::add_link_arg(), CBuild::arg, and rebuild_script.

◆ CallTask()

void CBuild::Registry::CallTask ( std::string name,
std::vector< std::string > args )

Run tasks.

Parameters
name=> std::string -> Name of task
args=> std::vector<std::string> -> Arguments for task

Definition at line 206 of file register.cpp.

References CBuild::print(), and CBuild::RED.

Referenced by CBuild::Toolchain::call(), and CBuild::loop().

◆ GetGenerator()

CBuild::generator_base * CBuild::Registry::GetGenerator ( std::string id)

Get generator for specified id.

Parameters
id=> std::string -> Generator id
Returns
CBuild::generator_base* -> Pointer to generator instance

Definition at line 317 of file register.cpp.

Referenced by CBuild::loop().

◆ GetGeneratorsList()

std::vector< std::string > CBuild::Registry::GetGeneratorsList ( )

Get list of registered generators.

Returns
std::vector<std::string> -> List of generators

Definition at line 331 of file register.cpp.

References generators.

Referenced by CBuild::GeneratorList::call(), and CBuild::generator_handler().

◆ GetKeywordsList()

lib::map< std::string, std::string > CBuild::Registry::GetKeywordsList ( )

Get list of all user registered keywords.

Returns
lib::map<std::string, std::string> where key - keyword, value - task id to call

Definition at line 276 of file register.cpp.

Referenced by CBuild::CmdList::call(), and CBuild::parse().

◆ GetRebuildTarget()

CBuild::Toolchain * CBuild::Registry::GetRebuildTarget ( )

Get target used for rebuild of CBuild script.

Returns
CBuild::Toolcgain* -> Rebuild target

Definition at line 355 of file register.cpp.

References rebuild_script.

◆ GetTargets()

lib::map< std::string, CBuild::Toolchain * > CBuild::Registry::GetTargets ( )

Get list of all targets.

Returns
lib::map<std::string, CBuild::Toolchain*>

Definition at line 262 of file register.cpp.

◆ GetTasksList()

std::vector< std::string > CBuild::Registry::GetTasksList ( )

Get list of registered tasks.

Returns
std::vector<std::string> -> List of tasks

Definition at line 345 of file register.cpp.

References tasks.

Referenced by CBuild::TaskList::call(), and CBuild::task_handler().

◆ GetToolchain()

CBuild::Toolchain * CBuild::Registry::GetToolchain ( std::string name,
bool force = false )

Get the registered toolchain.

Parameters
name=> std::string -> target id
force=> bool -> default = false, if true does not look in list of executed toolchains
Returns
CBuild::Toolchain* -> pointer to toolchain or null if target with given id does not exists

Definition at line 239 of file register.cpp.

Referenced by CBuild::Toolchain::call(), CBuild::gcc_hash_impl(), CBuild::ccj_out::generate(), CBuild::loop(), CBuild::MINGW_GXX< hash >::post_link(), CBuild::MINGW_GXXMT< hash >::post_link(), CBuild::MINGW_GCC< hash >::post_link(), CBuild::MINGW_GCCMT< hash >::post_link(), and CBuild::Toolchain::stdargs().

◆ GetToolchainsList()

std::vector< std::string > CBuild::Registry::GetToolchainsList ( )

Get list of registered toolchains.

Returns
std::vector<std::string> -> List of toolchains

Definition at line 338 of file register.cpp.

References targets.

Referenced by CBuild::build_handler(), and CBuild::ToolchainList::call().

◆ init()

void CBuild::Registry::init ( )

◆ null_handler()

void CBuild::Registry::null_handler ( )

Definition at line 40 of file register.cpp.

◆ RegisterGenerator()

void CBuild::Registry::RegisterGenerator ( CBuild::generator_base * gen,
std::string id )

Register generator for id.

Parameters
gen=> CBuild::generator_base* -> Generator instance
id=> std::string -> Geneator id

Definition at line 324 of file register.cpp.

References CBuild::print_full(), and CBuild::RED.

◆ RegisterKeyword()

void CBuild::Registry::RegisterKeyword ( std::string key,
CBuild::Task * func )

Register new keyord for parsing, ! Dangerous, owerwriting existing keywords can lead to undefined behaviours.

Parameters
key=> std::string -> new keyword
func=> Cbuild::Task -> task, associated with keyword

Definition at line 266 of file register.cpp.

References CBuild::print_full(), CBuild::RED, and CBuild::Task::self_name().

◆ RegisterTarget()

void CBuild::Registry::RegisterTarget ( CBuild::Toolchain * target)

Register new target for build.

Parameters
target=> CBuild::Toolchain* -> Pointer to staticly allocated class that extends CBuild::Toolchain

Definition at line 226 of file register.cpp.

References CBuild::Toolchain::get_id(), CBuild::print_full(), and CBuild::RED.

Referenced by CBuild::CrossCompiler::perform_registry().

◆ RegisterTask()

void CBuild::Registry::RegisterTask ( CBuild::Task * task)

Register new task.

Parameters
task=> CBuild::Task* -> pointer to staticly allocated task

Definition at line 194 of file register.cpp.

References CBuild::print_full(), CBuild::RED, and CBuild::Task::self_name().

◆ SetRebuildName()

void CBuild::Registry::SetRebuildName ( std::string _name)

Set the rebuilt CBuild executable name.

Parameters
_name=> std::string -> new CBuild user executable name

Definition at line 281 of file register.cpp.

References rebuild_script, and CBuild::Toolchain::set_name().

◆ SetVersionHandler()

void CBuild::Registry::SetVersionHandler ( void(*)() handler)

Set handler to add output to --version

Parameters
handler=> void (*)() -> Handler

Definition at line 352 of file register.cpp.

References handler.

◆ ToolchainAll()

void CBuild::Registry::ToolchainAll ( bool force,
std::string path,
std::vector< std::string > * args )

Call and execute all toolchains.

Parameters
force=> bool -> Compilation type
path=> std::string -> Base path
args=> std::vector<std::string>* -> PArgs

Definition at line 293 of file register.cpp.

Referenced by CBuild::loop().

Variable Documentation

◆ ccjo

CBuild::ccj_out CBuild::Registry::ccjo

Definition at line 145 of file register.cpp.

Referenced by init().

◆ cmdlist

CBuild::CmdList CBuild::Registry::cmdlist

Definition at line 143 of file register.cpp.

Referenced by init().

◆ generatorlist

CBuild::GeneratorList CBuild::Registry::generatorlist

Definition at line 142 of file register.cpp.

Referenced by init().

◆ generators

lib::map<std::string, CBuild::generator_base*> CBuild::Registry::generators

Definition at line 161 of file register.cpp.

Referenced by GetGeneratorsList().

◆ handler

void(* CBuild::Registry::handler) () ( ) = Registry::null_handler

Definition at line 42 of file register.cpp.

Referenced by CBuild::Version::call(), and SetVersionHandler().

◆ help

CBuild::Help CBuild::Registry::help

Definition at line 137 of file register.cpp.

Referenced by init().

◆ initw

CBuild::Init CBuild::Registry::initw

Definition at line 138 of file register.cpp.

Referenced by init().

◆ keywords

lib::map<std::string, std::string> CBuild::Registry::keywords

Definition at line 159 of file register.cpp.

◆ makefileo

CBuild::makefile_out CBuild::Registry::makefileo

Definition at line 146 of file register.cpp.

Referenced by init().

◆ rebuild_script

CBuild::CBuildRebuildScript CBuild::Registry::rebuild_script

Definition at line 148 of file register.cpp.

Referenced by AddCompileArg(), AddLinkArg(), GetRebuildTarget(), init(), and SetRebuildName().

◆ target_executed

lib::map<std::string, bool> CBuild::Registry::target_executed

Definition at line 157 of file register.cpp.

◆ targets

lib::map<std::string, CBuild::Toolchain*> CBuild::Registry::targets

Definition at line 155 of file register.cpp.

Referenced by GetToolchainsList().

◆ task_executed

lib::map<std::string, bool> CBuild::Registry::task_executed

Definition at line 153 of file register.cpp.

◆ tasklist

CBuild::TaskList CBuild::Registry::tasklist

Definition at line 140 of file register.cpp.

Referenced by init().

◆ tasks

lib::map<std::string, CBuild::Task*> CBuild::Registry::tasks

Definition at line 151 of file register.cpp.

Referenced by GetTasksList().

◆ toolchainlist

CBuild::ToolchainList CBuild::Registry::toolchainlist

Definition at line 141 of file register.cpp.

Referenced by init().

◆ ver

CBuild::Version CBuild::Registry::ver

Definition at line 139 of file register.cpp.

Referenced by init().