]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/Parser.h
resolve inclusion path name in Parser
[l2e.git] / src / loader / Parser.h
index 9e4cbf4551de5bd5e71ffe133e9afdcc5a0c4498..ebfeafaacf0f9c081a0c60512818647ff0311350 100644 (file)
@@ -26,7 +26,7 @@ class PropertyList;
 class Parser {
 
 public:
-       Parser(const char *file, ParsedSource &product);
+       Parser(const std::string &file, ParsedSource &product);
        ~Parser() { }
 private:
        Parser(const Parser &);
@@ -38,12 +38,13 @@ public:
 public:
        class Error: public std::runtime_error {
        public:
-               Error(const char *file, int line, const std::string &msg)
+               Error(const std::string &file, int line, const std::string &msg)
                : std::runtime_error(msg), file(file), line(line) { };
-               const char *File() const { return file; }
+               ~Error() throw() { }
+               const std::string &File() const { return file; }
                int Line() const { return line; }
        private:
-               const char *file;
+               std::string file;
                int line;
        };
 
@@ -73,7 +74,8 @@ private:
        bool BeginOfPropertyList(const Tokenizer::Token &) const;
 
 private:
-       const char *file;
+       std::string file;
+       std::string dirname;
        std::ifstream in;
        Tokenizer tok;
        ParsedSource &product;