summaryrefslogtreecommitdiff
path: root/cpp/rubygen/cppgen.rb
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-08-09 22:31:59 +0000
committerAlan Conway <aconway@apache.org>2007-08-09 22:31:59 +0000
commitf82c2029963a67ee6586ab03c7f5ef3f2a728c0b (patch)
treefcf9f7b95c9b99e9a7542a27324ebb793201b3be /cpp/rubygen/cppgen.rb
parent17f7af3557b1a4db846d0521f3652a297a1ef3aa (diff)
downloadqpid-python-f82c2029963a67ee6586ab03c7f5ef3f2a728c0b.tar.gz
* src/qpid/framing/MethodHolder.h, .cpp:
Replace boost::variant with Blob. * rubygen/templates/MethodHolder.rb: Generate support files for Blob-based MethodHolder. * src/Makefile.am: generate MethodHolder suppport files. * rubygen/cppgen.rb: Minor fixes/enhancements. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@564409 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/rubygen/cppgen.rb')
-rwxr-xr-xcpp/rubygen/cppgen.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/cpp/rubygen/cppgen.rb b/cpp/rubygen/cppgen.rb
index 8feaeb9ba5..64987e763f 100755
--- a/cpp/rubygen/cppgen.rb
+++ b/cpp/rubygen/cppgen.rb
@@ -136,7 +136,9 @@ class CppGen < Generator
end
def include(header)
- genl /<.*>/.match(header) ? "#include #{header}" : "#include \"#{header}\""
+ header+=".h" unless /(\.h|[">])$/===header
+ header="\"#{header}\"" unless /(^<.*>$)|(^".*"$)/===header
+ genl "#include #{header}"
end
def scope(open="{",close="}", &block)
@@ -154,11 +156,11 @@ class CppGen < Generator
genl
end
- def struct_class(type, name, *bases, &block)
+ def struct_class(type, name, bases, &block)
genl
gen "#{type} #{name}"
gen ": #{bases.join(', ')}" unless bases.empty?
- scope(" {","};", &block)
+ scope(" {","};") { yield }
end
def struct(name, *bases, &block) struct_class("struct", name, bases, &block); end