summaryrefslogtreecommitdiff
path: root/cli/context.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-09-19 10:47:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-09-19 10:47:42 +0200
commit28b0b90f965f08c6363555b6e672da807f9faf7a (patch)
tree266bb76a474dd87aead1bfba01702b42812c5129 /cli/context.hxx
parentcb65012eb524eb57b00249f1dee0f245e947cda4 (diff)
Open output files and generate boilerplate code
Diffstat (limited to 'cli/context.hxx')
-rw-r--r--cli/context.hxx23
1 files changed, 20 insertions, 3 deletions
diff --git a/cli/context.hxx b/cli/context.hxx
index 28b74eb..8dc9fff 100644
--- a/cli/context.hxx
+++ b/cli/context.hxx
@@ -6,6 +6,8 @@
#ifndef CLI_CONTEXT_HXX
#define CLI_CONTEXT_HXX
+#include <map>
+#include <string>
#include <ostream>
#include <cutl/shared-ptr.hxx>
@@ -17,15 +19,30 @@ using std::endl;
class context
{
+public:
+ typedef std::string string;
+
+private:
+ struct data;
+ cutl::shared_ptr<data> data_;
+
+public:
+ std::ostream& os;
+
+ typedef std::map<string, string> reserved_name_map_type;
+ reserved_name_map_type& reserved_name_map;
+
private:
struct data
{
+ reserved_name_map_type reserved_name_map_;
};
- cutl::shared_ptr<data> data_;
-
public:
- std::ostream& os;
+ // Escape C++ keywords, reserved names, and illegal characters.
+ //
+ string
+ escape (string const&) const;
public:
context (std::ostream& os_);