Pol  Revision:3cfda13
cfgmod.cpp
Go to the documentation of this file.
1 
9 #include "cfgmod.h"
10 
11 #include <ctype.h>
12 #include <fstream>
13 #include <string>
14 #include <utility>
15 
16 #include "../../bscript/berror.h"
17 #include "../../bscript/bobject.h"
18 #include "../../bscript/bstruct.h"
19 #include "../../bscript/dict.h"
20 #include "../../bscript/execmodl.h"
21 #include "../../bscript/executor.h"
22 #include "../../bscript/impstr.h"
23 #include "../../bscript/objmembers.h"
24 #include "../../clib/rawtypes.h"
25 #include "../../clib/refptr.h"
26 #include "../../clib/strutil.h"
27 #include "../../plib/pkg.h"
28 #include "../cfgrepos.h"
29 
30 namespace Pol
31 {
32 namespace Module
33 {
34 }
35 namespace Bscript
36 {
37 using namespace Module;
38 template <>
41  {"ReadConfigFile", &ConfigFileExecutorModule::mf_ConfigFile},
45  {"GetConfigStringArray", &ConfigFileExecutorModule::mf_GetConfigStringArray},
46  {"GetConfigStringDictionary", &ConfigFileExecutorModule::mf_GetConfigStringDictionary},
48  {"GetConfigIntArray", &ConfigFileExecutorModule::mf_GetConfigIntArray},
50  {"GetConfigMaxIntKey", &ConfigFileExecutorModule::mf_GetConfigMaxIntKey},
51  {"GetConfigStringKeys", &ConfigFileExecutorModule::mf_GetConfigStringKeys},
52  {"GetConfigIntKeys", &ConfigFileExecutorModule::mf_GetConfigIntKeys},
53  {"ListConfigElemProps", &ConfigFileExecutorModule::mf_ListConfigElemProps},
54  {"AppendConfigFileElem", &ConfigFileExecutorModule::mf_AppendConfigFileElem},
55  {"UnloadConfigFile", &ConfigFileExecutorModule::mf_UnloadConfigFile},
56  {"LoadTusScpFile", &ConfigFileExecutorModule::mf_LoadTusScpFile}};
57 }
58 namespace Module
59 {
62 
63 
65  : EConfigFileRefObjImpBase( &cfgfile_type, rcfile )
66 {
67 }
68 
70 {
71  const Bscript::BObjectImp& imp = obj.impref();
73 
74  if ( imp.isa( OTString ) )
75  {
76  const char* strval = static_cast<const Bscript::String*>( &imp )->data();
77  celem = obj_->findelem( strval );
78  }
79  else if ( imp.isa( OTLong ) )
80  {
81  int key = static_cast<const Bscript::BLong*>( &imp )->value();
82  celem = obj_->findelem( key );
83  }
84 
85  if ( celem.get() != NULL )
86  {
87  return Bscript::BObjectRef( new EConfigElemRefObjImp( celem ) );
88  }
89  else
90  {
91  return Bscript::BObjectRef( new Bscript::BError( "Element not found" ) );
92  }
93 }
94 
95 const char* EConfigFileRefObjImp::typeOf() const
96 {
97  return "ConfigFileRef";
98 }
100 {
101  return OTConfigFileRef;
102 }
104 {
105  return new EConfigFileRefObjImp( obj_ );
106 }
107 
109  : EConfigElemRefObjImpBase( &cfgelem_type, rcelem )
110 {
111 }
112 
113 const char* EConfigElemRefObjImp::typeOf() const
114 {
115  return "ConfigElemRef";
116 }
118 {
119  return OTConfigElemRef;
120 }
122 {
123  return new EConfigElemRefObjImp( obj_ );
124 }
125 
127 {
129 
130  return get_member( memb->code );
131 }
133 {
134  Bscript::BObjectImp* imp = obj_->getimp( membername );
135  if ( imp != NULL )
136  return Bscript::BObjectRef( imp );
137 
139 }
140 
142  : TmplExecutorModule<ConfigFileExecutorModule>( "cfgfile", exec )
143 {
144 }
145 
146 bool ConfigFileExecutorModule::get_cfgfilename( const std::string& cfgdesc, std::string* cfgfile,
147  std::string* errmsg, std::string* allpkgbase )
148 {
149  if ( allpkgbase )
150  *allpkgbase = "";
151  const Plib::Package* pkg = exec.prog()->pkg;
152 
153  if ( cfgdesc[0] == ':' )
154  {
155  if ( cfgdesc[1] == ':' )
156  {
157  // Austin 2005-11-15
158  // This is a bit of a kludge to make /regions/ config files readable.
159  // Will go away when the paths here work like they do for file.em.
160  // Looks for ::regions/filename
161  if ( cfgdesc.substr( 2, 8 ) == "regions/" )
162  {
163  *cfgfile = cfgdesc.substr( 2, std::string::npos ) + ".cfg";
164  return true;
165  }
166  else
167  {
168  // "::cfgfile" - core config file
169  *cfgfile = "config/" + cfgdesc.substr( 2, std::string::npos ) + ".cfg";
170  return true;
171  }
172  }
173  else // ":pkgname:configfile" - config file in some package
174  {
175  std::string::size_type second_colon = cfgdesc.find( ':', 2 );
176  if ( second_colon != std::string::npos )
177  {
178  std::string pkgname = cfgdesc.substr( 1, second_colon - 1 );
179  std::string cfgbase = cfgdesc.substr( second_colon + 1, std::string::npos );
180 
181  if ( pkgname == "*" )
182  {
183  if ( allpkgbase )
184  {
185  *cfgfile = cfgdesc;
186  *allpkgbase = cfgbase;
187  return true;
188  }
189  else
190  {
191  return false;
192  }
193  }
194 
195  Plib::Package* dstpkg = Plib::find_package( pkgname );
196  if ( dstpkg != NULL )
197  {
198  *cfgfile = GetPackageCfgPath( dstpkg, cfgbase + ".cfg" );
199  return true;
200  }
201  else
202  {
203  *errmsg = "Unable to find package " + pkgname;
204  return false;
205  }
206  }
207  else
208  {
209  *errmsg = "Poorly formed config file descriptor: " + cfgdesc;
210  return false;
211  }
212  }
213  }
214  else
215  {
216  if ( pkg != NULL )
217  {
218  *cfgfile = GetPackageCfgPath( const_cast<Plib::Package*>( pkg ), cfgdesc + ".cfg" );
219  return true;
220  }
221  else
222  {
223  *cfgfile = "config/" + cfgdesc + ".cfg";
224  return true;
225  }
226  }
227 }
228 
229 
231 {
232  const Bscript::String* cfgdesc_str;
233  if ( exec.getStringParam( 0, cfgdesc_str ) )
234  {
235  const std::string& cfgdesc = cfgdesc_str->value();
236  std::string cfgfile;
237  std::string errmsg;
238  std::string allpkgbase;
239  if ( !get_cfgfilename( cfgdesc, &cfgfile, &errmsg, &allpkgbase ) )
240  {
241  return new Bscript::BError( errmsg );
242  }
243 
244  ref_ptr<Core::StoredConfigFile> cfile = Core::FindConfigFile( cfgfile, allpkgbase );
245 
246  if ( cfile.get() != NULL )
247  {
248  return new EConfigFileRefObjImp( cfile );
249  }
250  else
251  {
252  return new Bscript::BError( "Config file not found" );
253  }
254  }
255  else
256  {
257  return new Bscript::BError( "Invalid parameter type" );
258  }
259 }
260 
261 bool legal_scp_filename( const char* filename )
262 {
263  while ( filename && *filename )
264  {
265  if ( !isalnum( *filename ) )
266  return false;
267  ++filename;
268  }
269  return true;
270 }
271 
273 {
274  const Bscript::String* filename_str;
275  if ( !exec.getStringParam( 0, filename_str ) )
276  {
277  return new Bscript::BError( "Invalid parameter type" );
278  }
279 
280  if ( !legal_scp_filename( filename_str->data() ) )
281  {
282  return new Bscript::BError( "Filename cannot include path information or special characters" );
283  }
284 
286  Core::LoadTusScpFile( "import/tus/" + filename_str->value() + ".scp" );
287 
288  if ( cfile.get() == NULL )
289  {
290  return new Bscript::BError( "File not found" );
291  }
292 
293  return new EConfigFileRefObjImp( cfile );
294 }
295 
297 {
298  Core::StoredConfigFile* cfile;
299 
300  if ( getStoredConfigFileParam( *this, 0, cfile ) )
301  {
302  return new Bscript::BLong( cfile->maxintkey() );
303  }
304  else
305  {
306  return new Bscript::BError( "Parameter 0 must be a Config File" );
307  }
308 }
309 
311 {
312  Core::StoredConfigFile* cfile;
313  if ( getStoredConfigFileParam( *this, 0, cfile ) )
314  {
315  std::unique_ptr<Bscript::ObjArray> arr( new Bscript::ObjArray );
316  Core::StoredConfigFile::ElementsByName::const_iterator itr = cfile->byname_begin(),
317  end = cfile->byname_end();
318  for ( ; itr != end; ++itr )
319  {
320  arr->addElement( new Bscript::String( ( *itr ).first.c_str() ) );
321  }
322  return arr.release();
323  }
324  else
325  {
326  return new Bscript::BError( "GetConfigStringKeys param 0 must be a Config File" );
327  }
328 }
329 
331 {
332  Core::StoredConfigFile* cfile;
333  if ( getStoredConfigFileParam( *this, 0, cfile ) )
334  {
335  std::unique_ptr<Bscript::ObjArray> arr( new Bscript::ObjArray );
336  Core::StoredConfigFile::ElementsByNum::const_iterator itr = cfile->bynum_begin(),
337  end = cfile->bynum_end();
338  for ( ; itr != end; ++itr )
339  {
340  arr->addElement( new Bscript::BLong( ( *itr ).first ) );
341  }
342  return arr.release();
343  }
344  else
345  {
346  return new Bscript::BError( "GetConfigIntKeys param 0 must be a Config File" );
347  }
348 }
349 
351 {
352  Core::StoredConfigFile* cfile;
353 
354  if ( getStoredConfigFileParam( *this, 0, cfile ) )
355  {
356  Bscript::BObjectImp* keyimp = exec.getParamImp( 1 );
357 
359 
360  if ( keyimp->isa( Bscript::BObjectImp::OTLong ) )
361  {
362  int key = static_cast<Bscript::BLong*>( keyimp )->value();
363  celem = cfile->findelem( key );
364  }
365  else if ( keyimp->isa( Bscript::BObjectImp::OTString ) )
366  {
367  const char* strval = static_cast<Bscript::String*>( keyimp )->data();
368  celem = cfile->findelem( strval );
369  }
370  else
371  {
372  return new Bscript::BError( "Param 1 must be an Integer or a String" );
373  }
374 
375  if ( celem.get() != NULL )
376  {
377  return new EConfigElemRefObjImp( celem );
378  }
379  else
380  {
381  return new Bscript::BError( "Element not found" );
382  }
383  }
384  else
385  {
386  return new Bscript::BError( "Parameter 0 must be a Config File" );
387  }
388 }
389 
391 {
392  Core::StoredConfigElem* celem;
393  const Bscript::String* propname_str;
394 
395  if ( getStoredConfigElemParam( *this, 0, celem ) && getStringParam( 1, propname_str ) )
396  {
397  Bscript::BObjectImp* imp = celem->getimp( propname_str->value() );
398  if ( imp != NULL )
399  {
400  return new Bscript::String( imp->getStringRep() );
401  }
402  else
403  {
404  return new Bscript::BError( "Property not found" );
405  }
406  }
407  else
408  {
409  return new Bscript::BError( "Invalid parameter type" );
410  }
411 }
412 
414 {
415  Core::StoredConfigElem* celem;
416  const Bscript::String* propname_str;
417 
418  if ( getStoredConfigElemParam( *this, 0, celem ) && getStringParam( 1, propname_str ) )
419  {
420  std::pair<Core::StoredConfigElem::const_iterator, Core::StoredConfigElem::const_iterator> pr =
421  celem->equal_range( propname_str->data() );
424 
425  std::unique_ptr<Bscript::ObjArray> ar( new Bscript::ObjArray );
426  for ( ; itr != end; ++itr )
427  {
428  Bscript::BObjectImp* imp = ( *itr ).second.get();
429  // Added 9-03-2005 Austin
430  // Will no longer place the string right into the array.
431  // Instead a check is done to make sure something is there.
432  if ( imp->getStringRep().length() >= 1 )
433  ar->addElement( new Bscript::String( imp->getStringRep() ) );
434  }
435  return ar.release();
436  }
437  else
438  {
439  return new Bscript::BError( "Invalid parameter type" );
440  }
441 }
442 
444 {
445  Core::StoredConfigElem* celem;
446  const Bscript::String* propname_str;
447 
448  if ( getStoredConfigElemParam( *this, 0, celem ) && getStringParam( 1, propname_str ) )
449  {
450  std::pair<Core::StoredConfigElem::const_iterator, Core::StoredConfigElem::const_iterator> pr =
451  celem->equal_range( propname_str->data() );
454 
455  std::unique_ptr<Bscript::BDictionary> dict( new Bscript::BDictionary );
456  for ( ; itr != end; ++itr )
457  {
458  Bscript::BObjectImp* line = ( *itr ).second.get();
459 
460  std::string line_str = line->getStringRep();
461  if ( line_str.length() < 1 )
462  continue;
463 
464  /* Example:
465  * Elem
466  * {
467  * PropName data moredata more data
468  * PropName stuff morestuff stuffity stuff
469  * }
470  * dict "data"->"moredata more data", "stuff"->"morestuff stuffity stuff!"
471  */
472  std::string prop_name, prop_value;
473  Clib::splitnamevalue( line_str, prop_name, prop_value );
474 
475  dict->addMember( new Bscript::String( prop_name ), new Bscript::String( prop_value ) );
476  }
477 
478  return dict.release();
479  }
480  else
481  {
482  return new Bscript::BError( "Invalid parameter type" );
483  }
484 }
485 
486 
488 {
489  Core::StoredConfigElem* celem;
490  const Bscript::String* propname_str;
491 
492  if ( getStoredConfigElemParam( *this, 0, celem ) && getStringParam( 1, propname_str ) )
493  {
494  Bscript::BObjectImp* imp = celem->getimp( propname_str->value() );
495  if ( imp != NULL )
496  {
497  if ( imp->isa( Bscript::BObjectImp::OTLong ) )
498  {
499  return imp;
500  }
501  else if ( imp->isa( Bscript::BObjectImp::OTDouble ) )
502  {
503  Bscript::Double* dbl = static_cast<Bscript::Double*>( imp );
504  return new Bscript::BLong( static_cast<int>( dbl->value() ) );
505  }
506  else if ( imp->isa( Bscript::BObjectImp::OTString ) )
507  {
508  Bscript::String* str = static_cast<Bscript::String*>( imp );
509  return new Bscript::BLong( strtoul( str->data(), NULL, 0 ) );
510  }
511  else
512  {
513  return new Bscript::BError( "Invalid type in config file! (internal error)" );
514  }
515  }
516  else
517  {
518  return new Bscript::BError( "Property not found" );
519  }
520  }
521  else
522  {
523  return new Bscript::BError( "Invalid parameter type" );
524  }
525 }
526 
528 {
529  Core::StoredConfigElem* celem;
530  const Bscript::String* propname_str;
531 
532  if ( getStoredConfigElemParam( *this, 0, celem ) && getStringParam( 1, propname_str ) )
533  {
534  auto pr = celem->equal_range( propname_str->data() );
537 
538  std::unique_ptr<Bscript::ObjArray> ar( new Bscript::ObjArray );
539  for ( ; itr != end; ++itr )
540  {
541  Bscript::BObjectImp* imp = ( *itr ).second.get();
542  // Will no longer place the string right into the array.
543  // Instead a check is done to make sure something is there.
544 
545  if ( imp->getStringRep().length() >= 1 )
546  {
547  if ( imp->isa( Bscript::BObjectImp::OTLong ) )
548  {
549  ar->addElement( imp );
550  }
551  else if ( imp->isa( Bscript::BObjectImp::OTDouble ) )
552  {
553  Bscript::Double* dbl = static_cast<Bscript::Double*>( imp );
554  ar->addElement( new Bscript::BLong( static_cast<int>( dbl->value() ) ) );
555  }
556  else if ( imp->isa( Bscript::BObjectImp::OTString ) )
557  {
558  Bscript::String* str = static_cast<Bscript::String*>( imp );
559  ar->addElement( new Bscript::BLong( strtoul( str->data(), NULL, 0 ) ) );
560  }
561  }
562  }
563  return ar.release();
564  }
565  else
566  {
567  return new Bscript::BError( "Invalid parameter type" );
568  }
569 }
570 
572 {
573  Core::StoredConfigElem* celem;
574  const Bscript::String* propname_str;
575 
576  if ( getStoredConfigElemParam( *this, 0, celem ) && getStringParam( 1, propname_str ) )
577  {
578  Bscript::BObjectImp* imp = celem->getimp( propname_str->value() );
579  if ( imp != NULL )
580  {
581  if ( imp->isa( Bscript::BObjectImp::OTDouble ) )
582  {
583  return imp;
584  }
585  else if ( imp->isa( Bscript::BObjectImp::OTLong ) )
586  {
587  Bscript::BLong* blong = static_cast<Bscript::BLong*>( imp );
588  return new Bscript::Double( blong->value() );
589  }
590  else if ( imp->isa( Bscript::BObjectImp::OTString ) )
591  {
592  Bscript::String* str = static_cast<Bscript::String*>( imp );
593  return new Bscript::Double( strtod( str->data(), NULL ) );
594  }
595  else
596  {
597  return new Bscript::BError( "Invalid type in config file! (internal error)" );
598  }
599  }
600  else
601  {
602  return new Bscript::BError( "Property not found" );
603  }
604  }
605  else
606  {
607  return new Bscript::BError( "Invalid parameter type" );
608  }
609 }
610 
612 {
613  Core::StoredConfigElem* celem;
614  if ( getStoredConfigElemParam( *this, 0, celem ) )
615  {
616  // should return an array or prop-names
617  return celem->listprops();
618  }
619  else
620  {
621  return new Bscript::BError( "Invalid parameter type" );
622  }
623 }
624 
625 /* The elements in the array passed should each be a structure (name, value) */
627 {
628  const Bscript::String* filename;
629  const Bscript::String* elemtype;
630  Bscript::ObjArray* objarr;
631  if ( !exec.getStringParam( 0, filename ) || !exec.getStringParam( 1, elemtype ) ||
632  !exec.getObjArrayParam( 3, objarr ) )
633  {
634  return new Bscript::BError( "Invalid parameter type" );
635  }
636  std::string elemkey = getParamImp( 2 )->getStringRep();
637 
638  std::string pathname, errmsg;
639  const std::string& cfgdesc = filename->value();
640  if ( !get_cfgfilename( cfgdesc, &pathname, &errmsg ) )
641  {
642  return new Bscript::BError( errmsg );
643  }
644 
645  std::ofstream ofs( pathname.c_str(), std::ios::app );
646  ofs << std::endl << elemtype->value() << " " << elemkey << std::endl << "{" << std::endl;
647  for ( Bscript::ObjArray::const_iterator itr = objarr->ref_arr.begin(),
648  end = objarr->ref_arr.end();
649  itr != end; ++itr )
650  {
651  Bscript::BObject* bo = itr->get();
652  if ( bo != NULL )
653  {
654  if ( bo->isa( Bscript::BObjectImp::OTArray ) )
655  {
656  Bscript::ObjArray* inarr = (Bscript::ObjArray*)( bo->impptr() );
657  if ( inarr->ref_arr.size() == 2 )
658  {
659  Bscript::BObject* nobj = inarr->ref_arr[0].get();
660  Bscript::BObject* vobj = inarr->ref_arr[1].get();
661  if ( nobj != NULL && nobj->isa( Bscript::BObjectImp::OTString ) && vobj != NULL )
662  {
663  Bscript::String* namestr = static_cast<Bscript::String*>( nobj->impptr() );
664  std::string value = vobj->impptr()->getStringRep();
665 
666  ofs << "\t" << namestr->value() << "\t" << value << std::endl;
667  }
668  }
669  }
670  else if ( bo->isa( Bscript::BObjectImp::OTStruct ) )
671  {
672  Bscript::BStruct* instruct = static_cast<Bscript::BStruct*>( bo->impptr() );
673  const Bscript::BObjectImp* name_imp = instruct->FindMember( "name" );
674  const Bscript::BObjectImp* value_imp = instruct->FindMember( "value" );
675  if ( name_imp && name_imp->isa( Bscript::BObjectImp::OTString ) && value_imp )
676  {
677  const Bscript::String* namestr = static_cast<const Bscript::String*>( name_imp );
678  std::string value = value_imp->getStringRep();
679 
680  ofs << "\t" << namestr->value() << "\t" << value << std::endl;
681  }
682  }
683  }
684  }
685  ofs << "}" << std::endl;
686 
687  Core::UnloadConfigFile( pathname );
688 
689  return new Bscript::BLong( 1 );
690 }
691 
693 {
694  const Bscript::String* filename;
695  if ( getStringParam( 0, filename ) )
696  {
697  const std::string& cfgdesc = filename->value();
698  std::string cfgfile;
699  std::string errmsg;
700  std::string allpkgbase;
701  if ( !get_cfgfilename( cfgdesc, &cfgfile, &errmsg, &allpkgbase ) )
702  {
703  return new Bscript::BError( errmsg );
704  }
705 
706  return new Bscript::BLong( Core::UnloadConfigFile( cfgfile ) );
707  }
708  else
709  {
710  return new Bscript::BError( "Invalid parameter" );
711  }
712 }
713 
715  Core::StoredConfigFile*& cfile )
716 {
717  Bscript::BApplicObjBase* ao_cfile_base = exmod.exec.getApplicObjParam( param, &cfgfile_type );
718  if ( ao_cfile_base != NULL )
719  {
720  EConfigFileRefObjImp* ao_cfile = static_cast<EConfigFileRefObjImp*>( ao_cfile_base );
721 
722  cfile = ao_cfile->value().get();
723 
724  return true;
725  }
726  else
727  {
728  return false;
729  }
730 }
731 
733  Core::StoredConfigElem*& celem )
734 {
735  Bscript::BApplicObjBase* ao_celem_base = exmod.exec.getApplicObjParam( param, &cfgelem_type );
736  if ( ao_celem_base != NULL )
737  {
738  EConfigElemRefObjImp* ao_celem = static_cast<EConfigElemRefObjImp*>( ao_celem_base );
739 
740  celem = ao_celem->value().get();
741 
742  return true;
743  }
744  else
745  {
746  return false;
747  }
748 }
749 }
750 }
ConfigFileExecutorModule(Bscript::Executor &exec)
Definition: cfgmod.cpp:141
unsigned char u8
Definition: rawtypes.h:25
Bscript::BObjectImp * mf_LoadTusScpFile()
Definition: cfgmod.cpp:272
virtual Bscript::BObjectRef get_member_id(const int id) POL_OVERRIDE
Definition: cfgmod.cpp:126
virtual u8 typeOfInt() const POL_OVERRIDE
Definition: cfgmod.cpp:117
virtual std::string getStringRep() const =0
const EScriptProgram * prog() const
Definition: executor.h:423
const std::string & value() const
Definition: impstr.h:67
ElementsByNum::const_iterator bynum_end()
Definition: cfgrepos.h:87
virtual const char * typeOf() const POL_OVERRIDE
Definition: cfgmod.cpp:113
int value() const
Definition: bobject.h:592
Bscript::BApplicObjType cfgelem_type
Definition: cfgmod.cpp:61
Bscript::BObjectImp * mf_GetConfigStringKeys()
Definition: cfgmod.cpp:310
void splitnamevalue(const std::string &istr, std::string &propname, std::string &propvalue)
Definition: strutil.cpp:107
bool isa(BObjectType type) const
Definition: bobject.h:353
Bscript::BObjectImp * mf_UnloadConfigFile()
Definition: cfgmod.cpp:692
int UnloadConfigFile(const std::string &filename)
Definition: cfgrepos.cpp:346
T * get() const
Definition: refptr.h:175
StoredConfigElem::PropImpList::const_iterator const_iterator
Definition: cfgrepos.h:55
virtual u8 typeOfInt() const POL_OVERRIDE
Definition: cfgmod.cpp:99
Bscript::BObjectImp * mf_GetConfigString()
Definition: cfgmod.cpp:390
Bscript::BObjectImp * mf_GetConfigIntArray()
Definition: cfgmod.cpp:527
BObjectImp * getParamImp(unsigned param)
Definition: execmodl.cpp:22
virtual Bscript::BObjectImp * copy() const POL_OVERRIDE
Definition: cfgmod.cpp:103
ElementsByName::const_iterator byname_begin()
Definition: cfgrepos.h:83
Bscript::BObjectImp * mf_GetConfigInt()
Definition: cfgmod.cpp:487
Package * find_package(const std::string &pkgname)
Definition: pkg.cpp:33
Bscript::BObjectImp * mf_GetConfigStringArray()
Definition: cfgmod.cpp:413
bool get_cfgfilename(const std::string &cfgdesc, std::string *cfgfile, std::string *errmsg, std::string *allpkgbase=NULL)
Definition: cfgmod.cpp:146
virtual Bscript::BObjectRef get_member(const char *membername) POL_OVERRIDE
Definition: cfgmod.cpp:132
virtual Bscript::BObjectImp * copy() const POL_OVERRIDE
Definition: cfgmod.cpp:121
Cont::const_iterator const_iterator
Definition: bobject.h:509
Bscript::BObjectImp * mf_GetConfigMaxIntKey()
Definition: cfgmod.cpp:296
Definition: refptr.h:64
Bscript::BObjectImp * mf_AppendConfigFileElem()
Definition: cfgmod.cpp:626
Bscript::BObjectImp * mf_FindConfigElement()
Definition: cfgmod.cpp:350
EConfigFileRefObjImp(ref_ptr< Core::StoredConfigFile > rcfile)
Definition: cfgmod.cpp:64
Bscript::BObjectImp * listprops() const
Definition: cfgrepos.cpp:82
Bscript::BObjectImp * mf_ConfigFile()
Definition: cfgmod.cpp:230
ObjMember * getObjMember(int id)
Definition: parser.cpp:501
bool getStoredConfigElemParam(Bscript::ExecutorModule &exmod, unsigned param, Core::StoredConfigElem *&celem)
Definition: cfgmod.cpp:732
Bscript::BApplicObjType cfgfile_type
Definition: cfgmod.cpp:60
Bscript::BObjectImp * getimp(const std::string &propname) const
Definition: cfgrepos.cpp:73
Bscript::BObjectImp * mf_GetConfigReal()
Definition: cfgmod.cpp:571
const String * getStringParam(unsigned param)
Definition: execmodl.cpp:36
bool getStoredConfigFileParam(Bscript::ExecutorModule &exmod, unsigned param, Core::StoredConfigFile *&cfile)
Definition: cfgmod.cpp:714
std::unordered_map< u64, ScriptDiffData > data
Definition: osmod.cpp:966
virtual Bscript::BObjectRef OperSubscript(const Bscript::BObject &obj) POL_OVERRIDE
Definition: cfgmod.cpp:69
ElemRef findelem(int key)
Definition: cfgrepos.cpp:153
Bscript::BObjectImp * mf_ListConfigElemProps()
Definition: cfgmod.cpp:611
BObjectImp & impref()
Definition: bobject.h:438
BApplicObjBase * getApplicObjParam(unsigned param, const BApplicObjType *object_type)
Definition: executor.cpp:488
Plib::Package const * pkg
Definition: eprog.h:123
virtual const char * typeOf() const POL_OVERRIDE
Definition: cfgmod.cpp:95
const String * getStringParam(unsigned param)
Definition: executor.cpp:347
bool legal_scp_filename(const char *filename)
Definition: cfgmod.cpp:261
Bscript::BObjectImp * mf_GetConfigStringDictionary()
Definition: cfgmod.cpp:443
std::string GetPackageCfgPath(const Package *pkg, const std::string &filename)
Definition: pkg.cpp:491
Bscript::BObjectImp * mf_GetConfigIntKeys()
Definition: cfgmod.cpp:330
EConfigElemRefObjImp(ref_ptr< Core::StoredConfigElem > rcelem)
Definition: cfgmod.cpp:108
double value() const
Definition: bobject.h:713
ConfigFileRef FindConfigFile(const std::string &filename, const std::string &allpkgbase)
Definition: cfgrepos.cpp:247
ElementsByName::const_iterator byname_end()
Definition: cfgrepos.h:84
bool getObjArrayParam(unsigned param, ObjArray *&pobjarr)
Definition: executor.cpp:457
ConfigFileRef LoadTusScpFile(const std::string &filename)
Definition: cfgrepos.cpp:328
const char * data() const
Definition: impstr.h:66
Definition: berror.cpp:12
const BObjectImp * FindMember(const char *name)
Definition: bstruct.cpp:216
ElementsByNum::const_iterator bynum_begin()
Definition: cfgrepos.h:86
BObjectImp * getParamImp(unsigned param)
Definition: executor.cpp:266
std::pair< const_iterator, const_iterator > equal_range(const std::string &propname) const
Definition: cfgrepos.cpp:96