aboutsummaryrefslogtreecommitdiff
path: root/odb/generator.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-06-29 14:08:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-06-29 14:08:29 +0200
commit2bc006daa59995085626b3e9c0754823bf9d95a5 (patch)
tree25854abe3450783ad641da07e14b3ca8e23b7c2f /odb/generator.cxx
parent21fc3270c40e0623cee4363e00bb4435518a4bb7 (diff)
Add --include-regex and --include-regex-trace options
This requires libcutl update.
Diffstat (limited to 'odb/generator.cxx')
-rw-r--r--odb/generator.cxx21
1 files changed, 9 insertions, 12 deletions
diff --git a/odb/generator.cxx b/odb/generator.cxx
index 60f8e2a..7fa6d6a 100644
--- a/odb/generator.cxx
+++ b/odb/generator.cxx
@@ -232,13 +232,7 @@ generate (options const& ops, semantics::unit& unit, path const& p)
// Include settings.
//
- bool br (ops.include_with_brackets ());
- string ip (ops.include_prefix ());
string gp (ops.guard_prefix ());
-
- if (!ip.empty () && ip[ip.size () - 1] != '/')
- ip.append ("/");
-
if (!gp.empty () && gp[gp.size () - 1] != '_')
gp.append ("_");
@@ -275,8 +269,7 @@ generate (options const& ops, semantics::unit& unit, path const& p)
<< "// End prologue." << endl
<< endl;
- hxx << "#include " << (br ? '<' : '"') << ip << file <<
- (br ? '>' : '"') << endl
+ hxx << "#include " << ctx->process_include_path (file.string ()) << endl
<< endl;
include::generate ();
@@ -297,8 +290,7 @@ generate (options const& ops, semantics::unit& unit, path const& p)
}
}
- hxx << "#include " << (br ? '<' : '"') << ip << ixx_name <<
- (br ? '>' : '"') << endl
+ hxx << "#include " << ctx->process_include_path (ixx_name) << endl
<< endl;
// Copy epilogue.
@@ -375,8 +367,7 @@ generate (options const& ops, semantics::unit& unit, path const& p)
<< "// End prologue." << endl
<< endl;
- cxx << "#include " << (br ? '<' : '"') << ip << hxx_name <<
- (br ? '>' : '"') << endl
+ cxx << "#include " << ctx->process_include_path (hxx_name) << endl
<< endl;
switch (ops.database ())
@@ -444,6 +435,12 @@ generate (options const& ops, semantics::unit& unit, path const& p)
//
throw failed ();
}
+ catch (const re::format& e)
+ {
+ cerr << "error: invalid regex: '" << e.regex () << "': " <<
+ e.description () << endl;
+ throw failed ();
+ }
catch (semantics::invalid_path const& e)
{
cerr << "error: '" << e.path () << "' is not a valid filesystem path"