feisty meow concerns codebase  2.140
write_build_config.h
Go to the documentation of this file.
1 #ifndef BUILD_DEFAULTS_CLASS
2 #define BUILD_DEFAULTS_CLASS
3 
4 /*****************************************************************************\
5 * *
6 * Name : write_build_config *
7 * Author : Chris Koeritz *
8 * *
9 * Purpose: *
10 * *
11 * This class creates a header file that will provide macros that govern *
12 * how the build is created under win32 using visual studio project files. *
13 * This file is not on other platforms, nor with the clam makefile system. *
14 * *
15 *******************************************************************************
16 * Copyright (c) 1995-$now By Author. This program is free software; you can *
17 * redistribute it and/or modify it under the terms of the GNU General Public *
18 * License as published by the Free Software Foundation; either version 2 of *
19 * the License or (at your option) any later version. This is online at: *
20 * http://www.fsf.org/copyleft/gpl.html *
21 * Please send any updates to: fred@gruntose.com *
22 \*****************************************************************************/
23 
25 #include <basis/astring.h>
26 #include <basis/enhance_cpp.h>
27 #include <basis/outcome.h>
28 #include <structures/set.h>
30 
32 {
33 public:
36 
37  DEFINE_CLASS_NAME("write_build_config");
38 
39  int execute();
41 
44 
45  basis::outcome output_macro(const basis::astring &symbol, const basis::astring &value,
46  basis::astring &accumulator);
48 
50  basis::astring &cfg_accumulator, basis::astring &ver_accumulator);
52 
56  basis::astring &accumulator);
58 
59  bool process_version_parts(const basis::astring &symbol, const basis::astring &value);
61 
63  bool check_nesting(const basis::astring &to_check);
65 
68  bool write_output_file(const basis::astring &filename, const basis::astring &contents);
70 
71 private:
72  basis::astring *_end_matter; // stuff that isn't part of the real file.
73  structures::version *_ver; // accumulated when we see the right parts.
74  int _nesting; // how many levels of conditionals do we see?
75 
76  // not provided.
78  write_build_config &operator =(const write_build_config &);
79 };
80 
81 #endif
82 
The application_shell is a base object for console programs.
Provides a dynamically resizable ASCII character string.
Definition: astring.h:35
Outcomes describe the state of completion for an operation.
Definition: outcome.h:31
A simple object that wraps a templated set of strings.
Definition: set.h:168
Holds a file's version identifier.
const structures::string_set & exclusions()
returns the set of symbols that we will not include in the header.
bool write_output_file(const basis::astring &filename, const basis::astring &contents)
writes "contents" to "filename" if it differs from current contents.
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".
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.
bool check_nesting(const basis::astring &to_check)
if "to_check" is a make conditional, the nesting level is adjusted.
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".
int execute()
performs the main action of creating our build configuration header.
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.
DEFINE_CLASS_NAME("write_build_config")