X-Git-Url: http://git.tdb.fi/?p=libs%2Fdatafile.git;a=blobdiff_plain;f=source%2Floader.h;fp=source%2Floader.h;h=5dac2e6b46fd8d35b38f35fafcc3f8cdb3549387;hp=7799a7eacb5dd404915f25cbfe87f0665f515436;hb=0881c95bef812d94d8086225c2736b4f15b4c8dc;hpb=b0186e8878204a29e25ca4063c1dac4dea908508 diff --git a/source/loader.h b/source/loader.h index 7799a7e..5dac2e6 100644 --- a/source/loader.h +++ b/source/loader.h @@ -35,10 +35,12 @@ See also classes ObjectLoader and CollectionObjectLoader in objectloader.h. */ class Loader { -private: +protected: typedef std::map ActionMap; - ActionMap actions; +private: + ActionMap local_actions; + ActionMap *actions; Parser *cur_parser; unsigned cur_level; const Statement *cur_st; @@ -88,6 +90,11 @@ protected: /** Processes the current statement's substatements with another Loader. */ void load_sub_with(Loader &); + /** Sets the actions to be used when loading. If the map is empty, + init_actions will be called. */ + void set_actions(ActionMap &); + virtual void init_actions() { } + /** Adds a keyword that is loaded by calling a function. */ template void add(const std::string &k, void (L::*func)())