Remove a compilation error and set up framework to remove the others

coverity_scan^2
AnyOldName3 9 years ago
parent f2456225db
commit c1ffc9e776

@ -242,7 +242,7 @@ bool parseOptions (int argc, char** argv, OMW::Engine& engine, Files::Configurat
engine.setScriptConsoleMode (variables["script-console"].as<bool>()); engine.setScriptConsoleMode (variables["script-console"].as<bool>());
engine.setStartupScript (variables["script-run"].as<std::string>()); engine.setStartupScript (variables["script-run"].as<std::string>());
engine.setWarningsMode (variables["script-warn"].as<int>()); engine.setWarningsMode (variables["script-warn"].as<int>());
engine.setScriptBlacklist (variables["script-blacklist"].as<StringsVector>()); engine.setScriptBlacklist (string::toStdStringVector(variables["script-blacklist"].as<StringsVector>()));
engine.setScriptBlacklistUse (variables["script-blacklist-use"].as<bool>()); engine.setScriptBlacklistUse (variables["script-blacklist-use"].as<bool>());
engine.setSaveGameFile (variables["load-savegame"].as<std::string>()); engine.setSaveGameFile (variables["load-savegame"].as<std::string>());

@ -240,6 +240,17 @@ std::string EscapeHashString::processString(const std::string & str)
return temp; return temp;
} }
std::vector<std::string> EscapeHashString::toStdStringVector(const std::vector<EscapeHashString> & vec)
{
std::vector<std::string> temp = std::vector<std::string>();
for (std::vector<EscapeHashString>::const_iterator it = vec.begin(); it != vec.end(); ++it)
{
temp.push_back(it->toStdString());
}
return temp;
}
EscapeHashString::EscapeHashString() EscapeHashString::EscapeHashString()
{ {
} }
@ -269,6 +280,11 @@ EscapeHashString::EscapeHashString(InputIterator first, InputIterator last) : st
{ {
} }
std::string EscapeHashString::toStdString() const
{
return std::string(* this);
}
const boost::filesystem::path& ConfigurationManager::getGlobalPath() const const boost::filesystem::path& ConfigurationManager::getGlobalPath() const
{ {
return mFixedPath.getGlobalConfigPath(); return mFixedPath.getGlobalConfigPath();

@ -95,6 +95,7 @@ class EscapeHashString : public std::string
{ {
public: public:
static std::string processString(const std::string & str); static std::string processString(const std::string & str);
static std::vector<std::string> toStdStringVector(const std::vector<EscapeHashString> & vec);
EscapeHashString(); EscapeHashString();
EscapeHashString(const std::string & str); EscapeHashString(const std::string & str);
@ -104,6 +105,8 @@ class EscapeHashString : public std::string
EscapeHashString(size_t n, char c); EscapeHashString(size_t n, char c);
template <class InputIterator> template <class InputIterator>
EscapeHashString(InputIterator first, InputIterator last); EscapeHashString(InputIterator first, InputIterator last);
std::string toStdString() const;
}; };
} /* namespace Cfg */ } /* namespace Cfg */

Loading…
Cancel
Save