Removed pointer to config.

This commit is contained in:
Guillaume Melquiond 2009-04-04 21:31:06 +00:00
parent 547fa1f3bb
commit 6e7b107837
3 changed files with 7 additions and 9 deletions

View file

@ -267,11 +267,11 @@ namespace game_config {
DBG_CACHE << "Reading cached defines from: " << path << "\n";
// use static preproc_define::read_pair(config*) to make a object
// use static preproc_define::read_pair(config) to make a object
// and pass that object config_cache_transaction::insert_to_active method
foreach (const config::any_child &value, cfg.all_children_range()) {
config_cache_transaction::instance().insert_to_active(
preproc_define::read_pair(&value.cfg));
preproc_define::read_pair(value.cfg));
}
}

View file

@ -90,18 +90,16 @@ void preproc_define::read(const config& cfg)
read_argument(arg);
}
preproc_map::value_type preproc_define::read_pair(const config* cfg)
preproc_map::value_type preproc_define::read_pair(const config &cfg)
{
std::string first = (*cfg)["name"];
preproc_define second;
second.read(*cfg);
return std::make_pair(first, second);
second.read(cfg);
return preproc_map::value_type(cfg["name"], second);
}
std::ostream& operator<<(std::ostream& stream, const preproc_define& def)
{
return stream << std::string("value: ") << def.value << std::string(" arguments: ") << def.location;
return stream << "value: " << def.value << " arguments: " << def.location;
}
std::ostream& operator<<(std::ostream& stream, const preproc_map::value_type& def)

View file

@ -47,7 +47,7 @@ struct preproc_define
void write_argument(config_writer&, const std::string&) const;
void read(const config&);
void read_argument(const config &);
static preproc_map::value_type read_pair(const config*);
static preproc_map::value_type read_pair(const config &);
bool operator==(preproc_define const &) const;
bool operator<(preproc_define const &) const;
bool operator!=(preproc_define const &v) const { return !operator==(v); }