Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

resource_manager_file.h

Go to the documentation of this file.
00001 /*
00002         $Id: resource_manager_file.h,v 1.2 2000/06/04 19:02:55 sphair Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 */
00014 
00015 #ifndef header_resource_manager_file
00016 #define header_resource_manager_file
00017 
00018 #include <API/Core/Resources/resource_manager.h>
00019 #include "resource_tokenizer.h"
00020 
00021 #define default_scriptfile_id "_script_section"
00022 
00023 class CL_ResourceManager_File : public CL_ResourceManager
00024 {
00025 public:
00026         CL_ResourceManager_File(
00027                 const char *config_file,
00028                 CL_InputSourceProvider *provider = NULL,
00029                 bool read_directly_from_source=false,
00030                 bool delete_inputsource_provider=false);
00031 
00032         CL_ResourceManager_File(
00033                 const char *file_name,
00034                 const bool is_datafile);
00035 
00036         virtual ~CL_ResourceManager_File();
00037 
00038         virtual void load_all_resources();
00039         virtual void unload_all_resources();
00040 
00041         virtual void load_section(const char *section_name);
00042         virtual void unload_section(const char *section_name);
00043 
00044         virtual CL_Resource *get_resource(std::string res_id);
00045         virtual std::list<std::string> *get_all_resources();
00046         virtual std::list<std::string> *get_resources_of_type(std::string type_id);
00047 
00048         virtual CL_InputSourceProvider *get_resource_provider();
00049 
00050 private:
00051         void parse();
00052 
00053         void parse_include(CL_ResourceTokenizer &lexer);
00054         
00055         void parse_section_body(
00056                 std::string token,
00057                 CL_ResourceTokenizer &lexer,
00058                 std::string prefix);
00059 
00060         CL_Resource *create_resource(
00061                 std::string name,
00062                 std::string location,
00063                 CL_ResourceOptions &options);
00064 
00065         CL_InputSourceProvider *resource_provider;
00066 
00067         std::list<CL_Resource*> resources;
00068         
00069         std::string filename;
00070         bool from_source;
00071         bool delete_resource_provider;
00072 };
00073 
00074 #endif

Generated at Wed Apr 4 19:54:03 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001