mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-28 23:49:51 +00:00
Fix string AI assets being truncated if they contain spaces
This commit is contained in:
parent
63ebe48d64
commit
cfd23bd850
@ -58,6 +58,35 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template<>
|
||||||
|
class config_value_translator<std::string> {
|
||||||
|
public:
|
||||||
|
|
||||||
|
static std::string cfg_to_value(const config &cfg)
|
||||||
|
{
|
||||||
|
return cfg["value"].str();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void cfg_to_value(const config &cfg, std::string &value)
|
||||||
|
{
|
||||||
|
value = cfg_to_value(cfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void value_to_cfg(const std::string &value, config &cfg)
|
||||||
|
{
|
||||||
|
cfg["value"] = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
static config value_to_cfg(const std::string &value)
|
||||||
|
{
|
||||||
|
config cfg;
|
||||||
|
value_to_cfg(value,cfg);
|
||||||
|
return cfg;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
class config_value_translator<bool> {
|
class config_value_translator<bool> {
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user