|
Pol
Rev 533
|
#include <cfgfile.h>
Inheritance diagram for ConfigFile:
Collaboration diagram for ConfigFile:Public Member Functions | |
| ConfigFile (const char *filename=NULL, const char *allowed_types=NULL) | |
| ConfigFile (const std::string &filename, const char *allowed_types=NULL) | |
| virtual | ~ConfigFile () |
| unsigned | element_line_start () const |
| const std::string & | filename () const |
| const time_t | modified () const |
| void | open (const char *i_filename) |
| bool | read (ConfigElem &elem) |
| void | readraw (ConfigElem &elem) |
Protected Member Functions | |
| bool | _read (ConfigElem &elem) |
| bool | _read (VectorConfigElem &elem) |
| void | display_and_rethrow_exception () |
| void | display_error (const std::string &msg, bool show_curline=true, const ConfigElemBase *elem=NULL, bool error=true) const |
| void | init (const char *i_filename, const char *allowed_types_str) |
| bool | read_properties (ConfigElem &elem) |
| bool | read_properties (VectorConfigElem &elem) |
| bool | readline (std::string &strbuf) |
| void | register_allowed_type (const char *allowed_type) |
Private Types | |
| typedef std::set< string, ci_cmp_pred > | AllowedTypesCont |
Private Attributes | |
| int | _cur_line |
| int | _element_line_start |
| std::string | _filename |
| time_t | _modified |
| AllowedTypesCont | allowed_types_ |
| FILE * | fp |
Static Private Attributes | |
| static char | buffer [1024] |
Friends | |
| class | ConfigElem |
| class | ConfigSection |
typedef std::set<string, ci_cmp_pred> ConfigFile::AllowedTypesCont [private] |
| ConfigFile::ConfigFile | ( | const char * | filename = NULL, |
| const char * | allowed_types = NULL |
||
| ) | [explicit] |
Definition at line 609 of file cfgfile.cpp.
References init().
Here is the call graph for this function:| ConfigFile::ConfigFile | ( | const std::string & | filename, |
| const char * | allowed_types = NULL |
||
| ) | [explicit] |
Definition at line 624 of file cfgfile.cpp.
References init().
Here is the call graph for this function:| ConfigFile::~ConfigFile | ( | ) | [virtual] |
Definition at line 696 of file cfgfile.cpp.
References fp.
| bool ConfigFile::_read | ( | ConfigElem & | elem | ) | [protected] |
Definition at line 904 of file cfgfile.cpp.
References _cur_line, _element_line_start, allowed_types_, buffer, commentline(), fp, OSTRINGSTREAM, OSTRINGSTREAM_STR, ConfigElem::properties, read_properties(), readline(), ConfigElemBase::rest_, splitnamevalue(), and ConfigElemBase::type_.
Referenced by read().
Here is the call graph for this function:
Here is the caller graph for this function:| bool ConfigFile::_read | ( | VectorConfigElem & | elem | ) | [protected] |
Definition at line 969 of file cfgfile.cpp.
References _cur_line, _element_line_start, allowed_types_, buffer, commentline(), fp, OSTRINGSTREAM, OSTRINGSTREAM_STR, VectorConfigElem::properties, read_properties(), readline(), VectorConfigElem::rest_, splitnamevalue(), and VectorConfigElem::type_.
Here is the call graph for this function:| void ConfigFile::display_and_rethrow_exception | ( | ) | [protected] |
Definition at line 1070 of file cfgfile.cpp.
References display_error().
Referenced by read(), and readraw().
Here is the call graph for this function:
Here is the caller graph for this function:| void ConfigFile::display_error | ( | const std::string & | msg, |
| bool | show_curline = true, |
||
| const ConfigElemBase * | elem = NULL, |
||
| bool | error = true |
||
| ) | const [protected, virtual] |
Implements ConfigSource.
Definition at line 1040 of file cfgfile.cpp.
References _cur_line, _element_line_start, _filename, ConfigElemBase::rest(), and ConfigElemBase::type().
Referenced by display_and_rethrow_exception(), and ConfigSection::~ConfigSection().
Here is the call graph for this function:
Here is the caller graph for this function:| unsigned ConfigFile::element_line_start | ( | ) | const |
Definition at line 665 of file cfgfile.cpp.
References _element_line_start.
| const string & ConfigFile::filename | ( | ) | const |
Definition at line 657 of file cfgfile.cpp.
References _filename.
Referenced by ConfigSection::~ConfigSection().
Here is the caller graph for this function:| void ConfigFile::init | ( | const char * | i_filename, |
| const char * | allowed_types_str | ||
| ) | [protected] |
Definition at line 639 of file cfgfile.cpp.
References allowed_types_, ISTRINGSTREAM, and open().
Referenced by ConfigFile().
Here is the call graph for this function:
Here is the caller graph for this function:| const time_t ConfigFile::modified | ( | ) | const |
Definition at line 661 of file cfgfile.cpp.
References _modified.
Referenced by StoredConfigFile::load(), and load_mime_config().
Here is the caller graph for this function:| void ConfigFile::open | ( | const char * | i_filename | ) |
Definition at line 670 of file cfgfile.cpp.
References _filename, _modified, and fp.
Referenced by FindNpcTemplate(), init(), read_combat_config(), read_extobj(), read_servspecopt(), and set_watch_vars().
Here is the caller graph for this function:| bool ConfigFile::read | ( | ConfigElem & | elem | ) |
Definition at line 1096 of file cfgfile.cpp.
References _read(), ConfigElemBase::_source, and display_and_rethrow_exception().
Referenced by FindEquipTemplate(), FindNpcTemplate(), import_new_data(), RealmDescriptor::Load(), StoredConfigFile::load(), DataFileContents::load(), load_anim_xlate_cfg(), load_armor_zones(), load_circle_data(), load_cmdlevels(), load_console_commands(), load_fileaccess_cfg(), load_incremental_indexes(), load_mime_config(), load_movecost(), load_npc_templates(), load_npc_weapon_templates(), load_packages(), load_party_cfg(), load_repsys_cfg(), load_resource_cfg(), load_spells_cfg(), MapWriter::OpenExistingFiles(), process_package_cmds_cfg(), Storage::read(), read_account_data(), read_bannedips_config(), read_boat_cfg(), read_datastore_dat(), read_gameservers(), read_guilds_dat(), read_itemdesc_file(), read_menus(), read_multidefs(), read_party_dat(), read_region_data(), read_resources_dat(), read_stacking_cfg(), read_starting_locations(), reload_account_data(), and slurp().
Here is the call graph for this function:
Here is the caller graph for this function:| bool ConfigFile::read_properties | ( | ConfigElem & | elem | ) | [protected] |
Definition at line 839 of file cfgfile.cpp.
References _cur_line, commentline(), decodequotedstring(), ISTRINGSTREAM, ConfigElem::properties, readline(), and splitnamevalue().
Referenced by _read(), and readraw().
Here is the call graph for this function:
Here is the caller graph for this function:| bool ConfigFile::read_properties | ( | VectorConfigElem & | elem | ) | [protected] |
Definition at line 870 of file cfgfile.cpp.
References _cur_line, commentline(), decodequotedstring(), ISTRINGSTREAM, VectorConfigElem::properties, readline(), and splitnamevalue().
Here is the call graph for this function:| bool ConfigFile::readline | ( | std::string & | strbuf | ) | [protected] |
Definition at line 811 of file cfgfile.cpp.
Referenced by _read(), and read_properties().
Here is the caller graph for this function:| void ConfigFile::readraw | ( | ConfigElem & | elem | ) |
Definition at line 1110 of file cfgfile.cpp.
References ConfigElemBase::_source, display_and_rethrow_exception(), and read_properties().
Referenced by read_combat_config(), read_extobj(), read_pol_config(), read_servspecopt(), set_watch_vars(), and xmain().
Here is the call graph for this function:
Here is the caller graph for this function:| void ConfigFile::register_allowed_type | ( | const char * | allowed_type | ) | [protected] |
friend class ConfigElem [friend] |
friend class ConfigSection [friend] |
int ConfigFile::_cur_line [private] |
Definition at line 90 of file cfgfile.h.
Referenced by _read(), display_error(), and read_properties().
int ConfigFile::_element_line_start [private] |
Definition at line 89 of file cfgfile.h.
Referenced by _read(), display_error(), and element_line_start().
std::string ConfigFile::_filename [private] |
Definition at line 81 of file cfgfile.h.
Referenced by display_error(), filename(), and open().
time_t ConfigFile::_modified [private] |
Definition at line 82 of file cfgfile.h.
Referenced by modified(), and open().
AllowedTypesCont ConfigFile::allowed_types_ [private] |
Definition at line 93 of file cfgfile.h.
Referenced by _read(), ConfigSection::ConfigSection(), and init().
char ConfigFile::buffer [static, private] |
Definition at line 87 of file cfgfile.h.
Referenced by _read(), and readline().
FILE* ConfigFile::fp [private] |
Definition at line 86 of file cfgfile.h.
Referenced by _read(), open(), readline(), and ~ConfigFile().