X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FParsedSource.cpp;h=90498e71f3e17ee5e2b96dea5d58803994851cc3;hb=ba714f2fe9064dd49b4c4a387502579b38a73223;hp=13b1262f93410de52ce0f522bfb538f66531fa6a;hpb=774c652e18456863dc1ae03e3a5bb4a75f40a956;p=l2e.git diff --git a/src/loader/ParsedSource.cpp b/src/loader/ParsedSource.cpp index 13b1262..90498e7 100644 --- a/src/loader/ParsedSource.cpp +++ b/src/loader/ParsedSource.cpp @@ -7,6 +7,8 @@ #include "ParsedSource.h" +#include "utility.h" + #include #include @@ -101,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) { @@ -209,6 +217,16 @@ Literal::Literal(int number) } +Literal::Literal(const string &dir, const string &path) +: props(0) +, str(CatPath(dir, path)) +, i1(0), i2(0) +, i3(0), i4(0) +, b(false) +, type(STRING) { + +} + Literal::Literal(const string &str) : props(0) , str(str) @@ -428,6 +446,9 @@ ostream &operator <<(ostream &out, const loader::Literal &l) { case loader::Literal::NUMBER: out << "number, " << l.GetNumber(); break; + case loader::Literal::PATH: + out << "path, \"" << l.GetString() << '"'; + break; case loader::Literal::STRING: out << "string, \"" << l.GetString() << '"'; break;