Pol  Revision:4b29d2b
Pol::Clib::ConfigElem Class Reference

#include <cfgelem.h>

+ Inheritance diagram for Pol::Clib::ConfigElem:

Public Member Functions

 ConfigElem ()
 
virtual ~ConfigElem ()
 
void add_prop (std::string propname, std::string propval)
 
void add_prop (std::string propname, unsigned int lval)
 
void add_prop (std::string propname, unsigned short sval)
 
void add_prop (std::string propname, short sval)
 
void clear_prop (const char *propname)
 
virtual size_t estimateSize () const POL_OVERRIDE
 
void get_prop (const char *propname, unsigned int *plong) const
 
bool has_prop (const char *propname) const
 
bool read_prop (const char *propname, std::string *value) const
 
std::string read_string (const char *propname) const
 
std::string read_string (const char *propname, const char *dflt) const
 
bool remove_bool (const char *propname)
 
bool remove_bool (const char *propname, bool dflt)
 
double remove_double (const char *propname, double dflt)
 
bool remove_first_prop (std::string *propname, std::string *value)
 
float remove_float (const char *propname, float dflt)
 
int remove_int (const char *propname)
 
int remove_int (const char *propname, int dflt)
 
bool remove_prop (const char *propname, std::string *value)
 
bool remove_prop (const char *propname, unsigned int *plong)
 
bool remove_prop (const char *propname, unsigned short *pushort)
 
std::string remove_string (const char *propname)
 
std::string remove_string (const char *propname, const char *dflt)
 
unsigned int remove_ulong (const char *propname)
 
unsigned int remove_ulong (const char *propname, unsigned int dflt)
 
unsigned remove_unsigned (const char *propname)
 
unsigned remove_unsigned (const char *propname, int dflt)
 
unsigned short remove_ushort (const char *propname)
 
unsigned short remove_ushort (const char *propname, unsigned short dflt)
 
void set_rest (const char *newrest)
 
void set_source (const ConfigElem &elem)
 
void set_source (const ConfigSource *source)
 
void set_type (const char *newtype)
 
POL_NORETURN void throw_error (const std::string &errmsg) const
 
void warn (const std::string &errmsg) const
 
void warn_with_line (const std::string &errmsg) const
 
- Public Member Functions inherited from Pol::Clib::ConfigElemBase
virtual ~ConfigElemBase ()
 
const char * rest () const
 
const char * type () const
 
bool type_is (const char *name) const
 

Protected Types

typedef std::multimap< std::string, std::string, ci_cmp_predProps
 

Protected Member Functions

POL_NORETURN void prop_not_found (const char *propname) const
 
- Protected Member Functions inherited from Pol::Clib::ConfigElemBase
 ConfigElemBase ()
 

Protected Attributes

Props properties
 
- Protected Attributes inherited from Pol::Clib::ConfigElemBase
const ConfigSource_source
 
std::string rest_
 
std::string type_
 

Friends

class ConfigFile
 

Detailed Description

Definition at line 53 of file cfgelem.h.

Member Typedef Documentation

typedef std::multimap<std::string, std::string, ci_cmp_pred> Pol::Clib::ConfigElem::Props
protected

Definition at line 116 of file cfgelem.h.

Constructor & Destructor Documentation

Pol::Clib::ConfigElem::ConfigElem ( )

Definition at line 53 of file cfgfile.cpp.

Pol::Clib::ConfigElem::~ConfigElem ( )
virtual

Definition at line 55 of file cfgfile.cpp.

Member Function Documentation

void Pol::Clib::ConfigElem::add_prop ( std::string  propname,
unsigned int  lval 
)

Definition at line 517 of file cfgfile.cpp.

References properties.

void Pol::Clib::ConfigElem::add_prop ( std::string  propname,
unsigned short  sval 
)

Definition at line 501 of file cfgfile.cpp.

References properties.

void Pol::Clib::ConfigElem::add_prop ( std::string  propname,
short  sval 
)

Definition at line 505 of file cfgfile.cpp.

References properties.

void Pol::Clib::ConfigElem::clear_prop ( const char *  propname)
size_t Pol::Clib::ConfigElem::estimateSize ( ) const
virtual
void Pol::Clib::ConfigElem::get_prop ( const char *  propname,
unsigned int *  plong 
) const
void Pol::Clib::ConfigElem::prop_not_found ( const char *  propname) const
protected

Definition at line 310 of file cfgfile.cpp.

References throw_error().

Referenced by read_string(), remove_string(), remove_ulong(), and remove_ushort().

bool Pol::Clib::ConfigElem::read_prop ( const char *  propname,
std::string *  value 
) const

Definition at line 159 of file cfgfile.cpp.

References properties.

Referenced by read_string().

std::string Pol::Clib::ConfigElem::read_string ( const char *  propname) const
std::string Pol::Clib::ConfigElem::read_string ( const char *  propname,
const char *  dflt 
) const

Definition at line 408 of file cfgfile.cpp.

References read_prop().

bool Pol::Clib::ConfigElem::remove_bool ( const char *  propname,
bool  dflt 
)

Definition at line 431 of file cfgfile.cpp.

References remove_ushort().

double Pol::Clib::ConfigElem::remove_double ( const char *  propname,
double  dflt 
)
bool Pol::Clib::ConfigElem::remove_first_prop ( std::string *  propname,
std::string *  value 
)
float Pol::Clib::ConfigElem::remove_float ( const char *  propname,
float  dflt 
)

Definition at line 436 of file cfgfile.cpp.

References remove_prop().

int Pol::Clib::ConfigElem::remove_int ( const char *  propname,
int  dflt 
)

Definition at line 347 of file cfgfile.cpp.

References remove_prop().

bool Pol::Clib::ConfigElem::remove_prop ( const char *  propname,
std::string *  value 
)

Definition at line 128 of file cfgfile.cpp.

References properties.

Referenced by Pol::Items::ArmorDesc::ArmorDesc(), Pol::Mobile::Attribute::Attribute(), Pol::Network::AuxService::AuxService(), Pol::Multi::BoatShape::BoatShape(), Pol::Core::checka(), Pol::Core::checkv(), clear_prop(), Pol::Core::CmdLevel::CmdLevel(), Pol::Items::create_intrinsic_shield_from_npctemplate(), Pol::Items::create_intrinsic_weapon_from_npctemplate(), Pol::Core::equip_from_template(), Pol::Module::FileAccess::FileAccess(), Pol::Items::ItemDesc::ItemDesc(), Pol::Mobile::load_armor_zones(), Pol::Core::ConsoleCommand::load_console_commands(), Pol::Core::load_general_entry(), Pol::Core::StorageArea::load_item(), Pol::Core::load_mime_config(), Pol::Plib::load_packages(), Pol::Network::load_packet_entries(), Pol::Network::load_packethook_length(), Pol::Network::load_packethook_version(), Pol::Core::load_party_cfg_hooks(), Pol::Core::load_repsys_cfg_hooks(), Pol::Core::load_resource_cfg(), Pol::Mobile::NPC::loadEquipablePropertiesNPC(), Pol::Multi::MultiDef::MultiDef(), Pol::Core::MusicRegion::MusicRegion(), Pol::Plib::PackageList::PackageList(), Pol::Core::RegionGroupBase::paint_zones(), Pol::Core::Party::Party(), Pol::Core::process_package_cmds_cfg(), Pol::Core::ResourceDef::read_config(), Pol::Core::read_gameservers(), Pol::Core::read_global_item(), Pol::Core::read_item(), Pol::Core::read_multi(), Pol::Core::read_starting_locations(), Pol::Mobile::Character::readAttributesAndVitals(), Pol::Mobile::Character::readCommonProperties(), Pol::Mobile::NPC::readNewNpcAttributes(), Pol::Mobile::NPC::readNpcProperties(), Pol::Core::UCorpse::readProperties(), Pol::Multi::UHouse::readProperties(), Pol::Multi::CustomHouseDesign::readProperties(), Pol::Core::PropertyList::readProperties(), Pol::Multi::UBoat::readProperties(), remove_double(), remove_float(), remove_int(), remove_prop(), remove_string(), remove_ulong(), remove_unsigned(), remove_ushort(), Pol::Core::SerialSet::SerialSet(), Pol::Core::USpell::USpell(), and Pol::Core::Vital::Vital().

bool Pol::Clib::ConfigElem::remove_prop ( const char *  propname,
unsigned int *  plong 
)

Definition at line 198 of file cfgfile.cpp.

References properties.

bool Pol::Clib::ConfigElem::remove_prop ( const char *  propname,
unsigned short *  pushort 
)

Definition at line 229 of file cfgfile.cpp.

References remove_prop(), and throw_error().

std::string Pol::Clib::ConfigElem::remove_string ( const char *  propname)
std::string Pol::Clib::ConfigElem::remove_string ( const char *  propname,
const char *  dflt 
)

Definition at line 417 of file cfgfile.cpp.

References remove_prop().

unsigned int Pol::Clib::ConfigElem::remove_ulong ( const char *  propname,
unsigned int  dflt 
)

Definition at line 474 of file cfgfile.cpp.

References remove_prop().

unsigned Pol::Clib::ConfigElem::remove_unsigned ( const char *  propname)
unsigned Pol::Clib::ConfigElem::remove_unsigned ( const char *  propname,
int  dflt 
)

Definition at line 367 of file cfgfile.cpp.

References remove_prop().

unsigned short Pol::Clib::ConfigElem::remove_ushort ( const char *  propname,
unsigned short  dflt 
)

Definition at line 331 of file cfgfile.cpp.

References remove_prop().

void Pol::Clib::ConfigElem::set_source ( const ConfigSource source)

Definition at line 90 of file cfgfile.cpp.

References Pol::Clib::ConfigElemBase::_source.

void Pol::Clib::ConfigElem::set_type ( const char *  newtype)
void Pol::Clib::ConfigElem::warn ( const std::string &  errmsg) const
void Pol::Clib::ConfigElem::warn_with_line ( const std::string &  errmsg) const

Friends And Related Function Documentation

friend class ConfigFile
friend

Definition at line 59 of file cfgelem.h.

Member Data Documentation


The documentation for this class was generated from the following files: