From ce696c26d2c9dd5a5813fd865082ab19ac49bcfa Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 6 Nov 2010 18:05:19 +0200 Subject: Add support for container persistence --- odb/parser.cxx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'odb/parser.cxx') diff --git a/odb/parser.cxx b/odb/parser.cxx index c257305..528b55b 100644 --- a/odb/parser.cxx +++ b/odb/parser.cxx @@ -1812,7 +1812,15 @@ process_pragmas (tree t, ts << "\t\t pragma " << i->name << " (" << i->value << ")" << endl; - node.set (i->name, i->value); + // Convert '_' to '-' in the pragma name so we get foo-bar instead + // of foo_bar (that's the convention used). + // + string tmp (i->name); + for (size_t j (0); j < tmp.size (); ++j) + if (tmp[j] == '_') + tmp[j] = '-'; + + node.set (tmp, i->value); } } @@ -1834,7 +1842,15 @@ process_named_pragmas (tree t, node& node) ts << "\t\t pragma " << i->name << " (" << i->value << ")" << endl; - node.set (i->name, i->value); + // Convert '_' to '-' in the pragma name so we get foo-bar instead + // of foo_bar (that's the convention used). + // + string tmp (i->name); + for (size_t j (0); j < tmp.size (); ++j) + if (tmp[j] == '_') + tmp[j] = '-'; + + node.set (tmp, i->value); } } -- cgit v1.1