summaryrefslogtreecommitdiff
path: root/cli/runtime-inline.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-10-04 14:18:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-10-04 14:18:38 +0200
commit6f6c10491ce0e973fe8328508fe2a232c2189016 (patch)
tree8163d6bf03edfb050fa14a408e38030246c0a99c /cli/runtime-inline.cxx
parent6a9a911f05bbd0d2a63a06512733a4a6ff5b3e65 (diff)
Move runtime inline function to inline file
Diffstat (limited to 'cli/runtime-inline.cxx')
-rw-r--r--cli/runtime-inline.cxx107
1 files changed, 107 insertions, 0 deletions
diff --git a/cli/runtime-inline.cxx b/cli/runtime-inline.cxx
new file mode 100644
index 0000000..9c33c2e
--- /dev/null
+++ b/cli/runtime-inline.cxx
@@ -0,0 +1,107 @@
+// file : cli/runtime-inline.cxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2009 Code Synthesis Tools CC
+// license : MIT; see accompanying LICENSE file
+
+#include "runtime-inline.hxx"
+
+using namespace std;
+
+void
+generate_runtime_inline (context& ctx)
+{
+ ostream& os (ctx.os);
+ string const& inl (ctx.inl);
+
+ os << "namespace cli"
+ << "{";
+
+ os << "// unknown_mode" << endl
+ << "//" << endl;
+
+ os << inl << "unknown_mode::" << endl
+ << "unknown_mode (value v)" << endl
+ << ": v_ (v)"
+ << "{"
+ << "}";
+
+ os << "// exception" << endl
+ << "//" << endl;
+
+ os << inl << "std::ostream&" << endl
+ << "operator<< (std::ostream& os, const exception& e)"
+ << "{"
+ << "e.print (os);"
+ << "return os;"
+ << "}";
+
+ os << "// unknown_option" << endl
+ << "//" << endl;
+
+ os << inl << "unknown_option::" << endl
+ << "unknown_option (const std::string& option)" << endl
+ << ": option_ (option)"
+ << "{"
+ << "}";
+
+ os << inl << "const std::string& unknown_option::" << endl
+ << "option () const"
+ << "{"
+ << "return option_;"
+ << "}";
+
+ os << "// unknown_argument" << endl
+ << "//" << endl;
+
+ os << inl << "unknown_argument::" << endl
+ << "unknown_argument (const std::string& argument)" << endl
+ << ": argument_ (argument)"
+ << "{"
+ << "}";
+
+ os << inl << "const std::string& unknown_argument::" << endl
+ << "argument () const"
+ << "{"
+ << "return argument_;"
+ << "}";
+
+ os << "// missing_value" << endl
+ << "//" << endl;
+
+ os << inl << "missing_value::" << endl
+ << "missing_value (const std::string& option)" << endl
+ << ": option_ (option)"
+ << "{"
+ << "}";
+
+ os << inl << "const std::string& missing_value::" << endl
+ << "option () const"
+ << "{"
+ << "return option_;"
+ << "}";
+
+ os << "// invalid_value" << endl
+ << "//" << endl;
+
+ os << inl << "invalid_value::" << endl
+ << "invalid_value (const std::string& option," << endl
+ << "const std::string& value)" << endl
+ << ": option_ (option),"
+ << " value_ (value)"
+ << "{"
+ << "}";
+
+ os << inl << "const std::string& invalid_value::" << endl
+ << "option () const"
+ << "{"
+ << "return option_;"
+ << "}";
+
+ os << inl << "const std::string& invalid_value::" << endl
+ << "value () const"
+ << "{"
+ << "return value_;"
+ << "}";
+
+ os << "}"; // namespace cli
+}