Pol  Revision:4b29d2b
cfgmod.h
Go to the documentation of this file.
1 
7 #ifndef CFGEMOD_H
8 #define CFGEMOD_H
9 
10 #include <stddef.h>
11 #include <string>
12 
13 #include "../../bscript/bobject.h"
14 #include "../../bscript/execmodl.h"
15 #include "../../clib/compilerspecifics.h"
16 #include "../../clib/rawtypes.h"
17 #include "../cfgrepos.h"
18 
19 namespace Pol
20 {
21 namespace Bscript
22 {
23 class Executor;
24 class ExecutorModule;
25 } // namespace Bscript
26 namespace Core
27 {
28 class StoredConfigElem;
29 class StoredConfigFile;
30 } // namespace Core
31 } // namespace Pol
32 template <class T>
33 class ref_ptr;
34 
35 namespace Pol
36 {
37 namespace Module
38 {
39 class ConfigFileExecutorModule : public Bscript::TmplExecutorModule<ConfigFileExecutorModule>
40 {
41 public:
43 
44  Bscript::BObjectImp* mf_ConfigFile();
45  Bscript::BObjectImp* mf_FindConfigElement();
46  Bscript::BObjectImp* mf_GetElementProperty();
47  Bscript::BObjectImp* mf_GetConfigString();
48  Bscript::BObjectImp* mf_GetConfigStringArray();
49  Bscript::BObjectImp* mf_GetConfigStringDictionary();
50  Bscript::BObjectImp* mf_GetConfigInt();
51  Bscript::BObjectImp* mf_GetConfigIntArray();
52  Bscript::BObjectImp* mf_GetConfigReal();
53  Bscript::BObjectImp* mf_GetConfigMaxIntKey();
54  Bscript::BObjectImp* mf_GetConfigStringKeys();
55  Bscript::BObjectImp* mf_GetConfigIntKeys();
56  Bscript::BObjectImp* mf_ListConfigElemProps();
57 
58  Bscript::BObjectImp* mf_AppendConfigFileElem();
59  Bscript::BObjectImp* mf_UnloadConfigFile();
60 
61  Bscript::BObjectImp* mf_LoadTusScpFile();
62 
63 
64 protected:
65  bool get_cfgfilename( const std::string& cfgdesc, std::string* cfgfile, std::string* errmsg,
66  std::string* allpkgbase = nullptr );
67 };
68 
69 
71 
72 class EConfigFileRefObjImp : public EConfigFileRefObjImpBase
73 {
74 public:
76  virtual Bscript::BObjectRef OperSubscript( const Bscript::BObject& obj ) POL_OVERRIDE;
77  virtual const char* typeOf() const POL_OVERRIDE;
78  virtual u8 typeOfInt() const POL_OVERRIDE;
79  virtual Bscript::BObjectImp* copy() const POL_OVERRIDE;
80 };
81 
82 
84 
85 class EConfigElemRefObjImp : public EConfigElemRefObjImpBase
86 {
87 public:
89  virtual Bscript::BObjectRef get_member( const char* membername ) POL_OVERRIDE;
90  virtual Bscript::BObjectRef get_member_id( const int id ) POL_OVERRIDE; // id test
91  virtual const char* typeOf() const POL_OVERRIDE;
92  virtual u8 typeOfInt() const POL_OVERRIDE;
93  virtual Bscript::BObjectImp* copy() const POL_OVERRIDE;
94 };
95 
96 
97 bool getStoredConfigFileParam( Bscript::ExecutorModule& exmod, unsigned param,
98  Core::StoredConfigFile*& cfile );
99 bool getStoredConfigElemParam( Bscript::ExecutorModule& exmod, unsigned param,
100  Core::StoredConfigElem*& celem );
101 }
102 }
103 #endif
unsigned char u8
Definition: rawtypes.h:25
#define POL_OVERRIDE
Bscript::BApplicObj< ref_ptr< Core::StoredConfigFile > > EConfigFileRefObjImpBase
Definition: cfgmod.h:70
Definition: refptr.h:65
bool getStoredConfigElemParam(Bscript::ExecutorModule &exmod, unsigned param, Core::StoredConfigElem *&celem)
Definition: cfgmod.cpp:732
bool getStoredConfigFileParam(Bscript::ExecutorModule &exmod, unsigned param, Core::StoredConfigFile *&cfile)
Definition: cfgmod.cpp:714
Bscript::BApplicObj< ref_ptr< Core::StoredConfigElem > > EConfigElemRefObjImpBase
Definition: cfgmod.h:83
Definition: berror.cpp:12