X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=blobdiff_plain;f=codegen%2Fmain.cpp;h=bfe12e03098478ae32ce74bf2819c71209bec250;hp=f228eceee390e6e4a028ed9f5aa4358d8d3d25c5;hb=ef7b2923fafd73063f2a3fc02e34a5c83f14fc0b;hpb=7781f1c4d69c5be72d5cc98bf34d0b5ccf1f372e 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());