Pol  Revision:3cfda13
Pol::Clib::ConfigElem Class Reference

#include <cfgelem.h>

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

Public Member Functions

 ConfigElem ()
 
virtual ~ConfigElem ()
 
void add_prop (const char *propname, const char *str)
 
void add_prop (const char *propname, unsigned int lval)
 
void add_prop (const char *propname, unsigned short sval)
 
void add_prop (const char *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 57 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 120 of file cfgelem.h.

Constructor & Destructor Documentation

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

Definition at line 66 of file cfgfile.cpp.

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

Definition at line 68 of file cfgfile.cpp.

Member Function Documentation

void Pol::Clib::ConfigElem::add_prop ( const char *  propname,
unsigned int  lval 
)

Definition at line 542 of file cfgfile.cpp.

References OSTRINGSTREAM, OSTRINGSTREAM_STR, and properties.

void Pol::Clib::ConfigElem::add_prop ( const char *  propname,
unsigned short  sval 
)

Definition at line 516 of file cfgfile.cpp.

References OSTRINGSTREAM, OSTRINGSTREAM_STR, and properties.

void Pol::Clib::ConfigElem::add_prop ( const char *  propname,
short  sval 
)

Definition at line 523 of file cfgfile.cpp.

References OSTRINGSTREAM, OSTRINGSTREAM_STR, and 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 323 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 172 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 421 of file cfgfile.cpp.

References read_prop().

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

Definition at line 444 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 449 of file cfgfile.cpp.

References remove_prop().

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

Definition at line 360 of file cfgfile.cpp.

References remove_prop().

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

Definition at line 141 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 211 of file cfgfile.cpp.

References properties.

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

Definition at line 242 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 430 of file cfgfile.cpp.

References remove_prop().

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

Definition at line 487 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 380 of file cfgfile.cpp.

References remove_prop().

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

Definition at line 344 of file cfgfile.cpp.

References remove_prop().

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

Definition at line 103 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 63 of file cfgelem.h.

Member Data Documentation


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