feisty meow concerns codebase
2.140
|
#include <write_build_config.h>
Public Member Functions | |
write_build_config () | |
~write_build_config () | |
DEFINE_CLASS_NAME ("write_build_config") | |
int | execute () |
performs the main action of creating our build configuration header. More... | |
const structures::string_set & | exclusions () |
returns the set of symbols that we will not include in the header. More... | |
basis::outcome | output_macro (const basis::astring &symbol, const basis::astring &value, basis::astring &accumulator) |
sends a macro definition for "symbol" with "value" to "accumulator". More... | |
basis::outcome | output_decorated_macro (const basis::astring &symbol, const basis::astring &value, basis::astring &cfg_accumulator, basis::astring &ver_accumulator) |
produces a new macro by adding a uniquifying string to "symbol". More... | |
basis::outcome | output_definition_macro (const basis::astring &embedded_value, basis::astring &accumulator) |
parses a 'name=value' pair out of "embedded_value" and writes a macro. More... | |
bool | process_version_parts (const basis::astring &symbol, const basis::astring &value) |
checks on "symbol" to see if it's a version component. stores if so. More... | |
bool | check_nesting (const basis::astring &to_check) |
if "to_check" is a make conditional, the nesting level is adjusted. More... | |
bool | write_output_file (const basis::astring &filename, const basis::astring &contents) |
writes "contents" to "filename" if it differs from current contents. More... | |
Public Member Functions inherited from application::application_shell | |
application_shell () | |
constructs an application_shell to serve as the root of the program. More... | |
virtual | ~application_shell () |
virtual int | execute_application () |
runs the base class's execute() method and catches any exceptions due to it. More... | |
int | exit_value () const |
once the application has finished executing, this will contain the exit value. More... | |
const mathematics::chaos & | randomizer () const |
provides access to the random number generator owned by this app. More... | |
virtual basis::outcome | log (const basis::base_string &to_print, int filter=basis::ALWAYS_PRINT) |
< returns the full name of the current application. More... | |
Public Member Functions inherited from application::base_application | |
virtual const char * | class_name () const =0 |
Returns the bare name of this class as a constant character pointer. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from application::application_shell | |
static application_shell * | single_instance () |
in a program with a single application_shell extant, this gives out the instance. More... | |
Definition at line 31 of file write_build_config.h.
write_build_config::write_build_config | ( | ) |
Definition at line 61 of file write_build_config.cpp.
write_build_config::~write_build_config | ( | ) |
Definition at line 68 of file write_build_config.cpp.
References basis::WHACK().
bool write_build_config::check_nesting | ( | const basis::astring & | to_check | ) |
if "to_check" is a make conditional, the nesting level is adjusted.
also if it's a conditional, true is returned, which means the line can be dropped.
Definition at line 127 of file write_build_config.cpp.
References basis::astring::compare(), ENDIF_STATEMENT, IFEQ_STATEMENT, and IFNEQ_STATEMENT.
Referenced by output_decorated_macro().
write_build_config::DEFINE_CLASS_NAME | ( | "write_build_config" | ) |
const string_set & write_build_config::exclusions | ( | ) |
returns the set of symbols that we will not include in the header.
Definition at line 74 of file write_build_config.cpp.
Referenced by output_decorated_macro(), output_definition_macro(), and output_macro().
|
virtual |
performs the main action of creating our build configuration header.
Implements application::application_shell.
Definition at line 226 of file write_build_config.cpp.
References basis::astring::compare(), DEFINITIONS_STATEMENT, basis::astring::end(), filesystem::byte_filer::eof(), EXPORT_STATEMENT, structures::version::flex_text_form(), FUNCDEF, filesystem::byte_filer::getline(), filesystem::byte_filer::good(), LOG, MAX_LINE_SIZE, filesystem::byte_filer::name(), structures::symbol_table< contents >::name(), non_continuable_error, output_decorated_macro(), output_definition_macro(), configuration::variable_tokenizer::parse(), structures::version::set_component(), SETUP_CONSOLE_LOGGER, static_class_name, basis::astring::strip_spaces(), configuration::variable_tokenizer::symbols(), basis::astring::t(), configuration::variable_tokenizer::table(), write_output_file(), and basis::astring::zap().
outcome write_build_config::output_decorated_macro | ( | const basis::astring & | symbol, |
const basis::astring & | value, | ||
basis::astring & | cfg_accumulator, | ||
basis::astring & | ver_accumulator | ||
) |
produces a new macro by adding a uniquifying string to "symbol".
if the item is a version component, it will be output to the "ver_accumulator" but otherwise it goes to the "cfg_accumulator".
Definition at line 141 of file write_build_config.cpp.
References ADD_COMMENT_RETURN, check_nesting(), basis::astring::contains(), exclusions(), output_macro(), and process_version_parts().
Referenced by execute().
outcome write_build_config::output_definition_macro | ( | const basis::astring & | embedded_value, |
basis::astring & | accumulator | ||
) |
parses a 'name=value' pair out of "embedded_value" and writes a macro.
Definition at line 166 of file write_build_config.cpp.
References ADD_COMMENT_RETURN, exclusions(), FUNCDEF, structures::symbol_table< contents >::name(), output_macro(), configuration::variable_tokenizer::parse(), configuration::variable_tokenizer::symbols(), and configuration::variable_tokenizer::table().
Referenced by execute().
outcome write_build_config::output_macro | ( | const basis::astring & | symbol, |
const basis::astring & | value, | ||
basis::astring & | accumulator | ||
) |
sends a macro definition for "symbol" with "value" to "accumulator".
Definition at line 92 of file write_build_config.cpp.
References ADD_COMMENT_RETURN, basis::astring::contains(), and exclusions().
Referenced by output_decorated_macro(), and output_definition_macro().
bool write_build_config::process_version_parts | ( | const basis::astring & | symbol, |
const basis::astring & | value | ||
) |
checks on "symbol" to see if it's a version component. stores if so.
if the string was a version component, then true is returned.
Definition at line 113 of file write_build_config.cpp.
References basis::astring::equal_to(), and structures::version::set_component().
Referenced by output_decorated_macro().
bool write_build_config::write_output_file | ( | const basis::astring & | filename, |
const basis::astring & | contents | ||
) |
writes "contents" to "filename" if it differs from current contents.
Definition at line 182 of file write_build_config.cpp.
References continuable_error, FUNCDEF, filesystem::byte_filer::good(), LOG, MAX_HEADER_FILE, filesystem::byte_filer::name(), basis::array< contents >::observe(), filesystem::byte_filer::read(), read, static_class_name, and filesystem::byte_filer::write().
Referenced by execute().