]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/loader.h
Use a common StatementKey structure for Loader and BinaryParser/Writer
[libs/datafile.git] / source / loader.h
index 4a1faa3f7af650ff4f4ec3726cc768fea77255cb..bb1292cc7b3c2740adc14a6c596bde54c4a59678 100644 (file)
@@ -35,21 +35,12 @@ See also classes ObjectLoader and CollectionObjectLoader in objectloader.h.
 class Loader
 {
 private:
-       struct ActionKey
-       {
-               std::string keyword;
-               std::string signature;
-
-               ActionKey(const std::string &, const std::string &);
-
-               bool operator<(const ActionKey &) const;
-       };
-
-       typedef std::map<ActionKey, LoaderAction *> ActionMap;
+       typedef std::map<StatementKey, LoaderAction *> ActionMap;
 
        ActionMap actions;
        const Statement *cur_st;
        bool sub_loaded;
+       std::list<Loader *> aux_loaders;
 protected:
        bool check_sub_loads;
 
@@ -131,7 +122,12 @@ protected:
 private:
        void add(const std::string &, LoaderAction *);
 
-       LoaderAction *find_action(const ActionKey &) const;
+protected:
+       void add_auxiliary_loader(Loader &);
+
+private:
+       bool has_action(const StatementKey &) const;
+       LoaderAction *find_action(const StatementKey &) const;
 
 protected:
        /** Returns the source of the statement being processed.  This can be used
@@ -139,9 +135,6 @@ protected:
        source may not necessarily be a file. */
        const std::string &get_source() const;
 
-       /** Throws a data_error from the current line. */
-       void error(const std::string &) const;
-
        virtual void finish() { }
 };