From: Daniel Karbach Date: Sun, 2 Sep 2012 17:19:40 +0000 (+0200) Subject: added utility function to create headers X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;h=ba714f2fe9064dd49b4c4a387502579b38a73223;hp=622b633b3c284b3b44c8cbb71528d20b97fe8d59;p=l2e.git added utility function to create headers --- diff --git a/src/loader/ParsedSource.cpp b/src/loader/ParsedSource.cpp index bceed08..90498e7 100644 --- a/src/loader/ParsedSource.cpp +++ b/src/loader/ParsedSource.cpp @@ -103,6 +103,12 @@ const Definition &ParsedSource::GetDefinition(const std::string &name) const { } } +void ParsedSource::WriteHeader(std::ostream &out) const { + for (std::set::const_iterator i(exports.begin()), end(exports.end()); i != end; ++i) { + out << GetDeclaration(*i).TypeName() << ' ' << *i << std::endl; + } +} + Definition::~Definition() { if (isLiteral) { diff --git a/src/loader/ParsedSource.h b/src/loader/ParsedSource.h index 8401777..98ecd84 100644 --- a/src/loader/ParsedSource.h +++ b/src/loader/ParsedSource.h @@ -206,6 +206,9 @@ public: const std::map &Definitions() const { return definitions; } const std::set &Exports() const { return exports; } +public: + void WriteHeader(std::ostream &) const; + private: std::map declarations; std::map definitions;