From ef7b2923fafd73063f2a3fc02e34a5c83f14fc0b Mon Sep 17 00:00:00 2001 From: Jens Thiele Date: Mon, 18 Dec 2006 16:19:05 +0000 Subject: [PATCH 1/1] cleanup --- codegen/TODO | 1 - codegen/main.cpp | 15 +++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/codegen/TODO b/codegen/TODO index d90cf65..998f2e3 100644 --- a/codegen/TODO +++ b/codegen/TODO @@ -1,4 +1,3 @@ -- remove support for LIBT2N_EXPORT_GROUP(group) (this will simplify the generator a lot) - add option similar to gccs -MD (at the moment it is a fixed set of files generated and they are handled in the makefile snippet [codegen.make]) - it would really be much nicer if the client lib includes would not depend upon boost serialization diff --git a/codegen/main.cpp b/codegen/main.cpp index f228ece..bfe12e0 100644 --- a/codegen/main.cpp +++ b/codegen/main.cpp @@ -106,19 +106,14 @@ std::string get_namespace(const xmlpp::Element* root, const std::string &id) return element->get_attribute("name")->get_value(); } -//! extract group from attributes -std::string -extract_group(const std::string &attrs) +//! procedure marked for export? +bool +is_marked(const std::string &attrs) { // todo: improve this - std::string error; std::string to_match("gccxml(libt2n-"); std::string::size_type p(attrs.find(to_match)); - if (p==std::string::npos) return error; - std::string group(attrs, p+to_match.length(), attrs.length()); - p=group.find_first_of(')'); - assert(p!=std::string::npos); - return std::string(group,0,p); + return (p!=std::string::npos); } struct type_info @@ -260,7 +255,7 @@ protected: // attributes are speparated by spaces? t2n_procedure f; - if (extract_group(attributes->get_value()).empty()) return; + if (!is_marked(attributes->get_value())) return; // we need the return type f.ret_type=get_type(root, returns->get_value()); -- 1.7.1