Pol  Revision:cb584c9
cmdlevel.h
Go to the documentation of this file.
1 
6 #ifndef __CMDLEVEL_H
7 #define __CMDLEVEL_H
8 
9 #include <string>
10 #include <vector>
11 
12 namespace Pol
13 {
14 namespace Bscript
15 {
16 class ObjArray;
17 }
18 namespace Clib
19 {
20 class ConfigElem;
21 }
22 namespace Plib
23 {
24 class Package;
25 }
26 namespace Core
27 {
28 class CmdLevel
29 {
30 public:
31  CmdLevel( Clib::ConfigElem& elem, int cmdlevelnum );
32  size_t estimateSize() const;
33 
34  bool matches( const std::string& name ) const;
35  void add_searchdir( Plib::Package* pkg, const std::string& dir );
36  void add_searchdir_front( Plib::Package* pkg, const std::string& dir );
37 
38  std::string name;
39  unsigned char cmdlevel;
40 
41  struct SearchDir
42  {
44  std::string dir;
45  };
46 
47  typedef std::vector<SearchDir> SearchList;
48  SearchList searchlist;
49 
50  typedef std::vector<std::string> Aliases;
51  Aliases aliases;
52 };
53 
54 CmdLevel* find_cmdlevel( const char* name );
55 CmdLevel* FindCmdLevelByAlias( const std::string& str );
56 
57 Bscript::ObjArray* GetCommandsInPackage( Plib::Package* m_pkg, int cmdlvl_num );
58 }
59 }
60 #endif
Bscript::ObjArray * GetCommandsInPackage(Plib::Package *m_pkg, int cmdlvl_num)
Definition: cmdlevel.cpp:104
std::vector< std::string > Aliases
Definition: cmdlevel.h:50
std::vector< SearchDir > SearchList
Definition: cmdlevel.h:47
unsigned char cmdlevel
Definition: cmdlevel.h:39
std::string name
Definition: cmdlevel.h:38
CmdLevel * find_cmdlevel(const char *name)
Definition: cmdlevel.cpp:84
std::string name
Definition: osmod.cpp:943
SearchList searchlist
Definition: cmdlevel.h:48
Definition: berror.cpp:12
CmdLevel * FindCmdLevelByAlias(const std::string &str)
Definition: cmdlevel.cpp:94