00001
00002
00004
00005 #if !defined(XMLIFILEMANAGER_H_)
00006 #define XMLIFILEMANAGER_H_
00007
00008 #if _MSC_VER >= 1000
00009 #pragma once
00010 #endif // _MSC_VER >= 1000
00011
00012
00013 #include <vector>
00014
00015 namespace xml {
00016 class Element;
00017 class IFile;
00018
00021 class IFileManager {
00022 public:
00023 typedef void (* LoadParamFunc)(IFile&);
00024
00026 void load( IFile* file );
00027
00029 void load( char *filename );
00030
00033 static IFileManager* instance() { return (s_instance == 0) ?
00034 new IFileManager() : s_instance; }
00035 static void destroy() { delete s_instance; s_instance = 0; }
00036
00038 static bool loadParams( LoadParamFunc func = 0);
00039
00040
00041 virtual ~IFileManager();
00042
00043 void printOn(std::ostream& out);
00044
00046 const IFile* ifile()const{return m_file;}
00047
00048 protected:
00049
00050 IFileManager();
00051
00052 private:
00053 static std::vector<LoadParamFunc> s_calls;
00054 static IFileManager* s_instance;
00055 IFile* m_file;
00056 };
00057 }
00058 #endif // !defined(IFILEMANAGER_H_)