Replace MwIniImporter::numberToString with std::to_string

pull/1697/head
tri4ng1e 7 years ago
parent 9126e844bf
commit 3b86f73ae7
No known key found for this signature in database
GPG Key ID: A3E3103F4E24BEA5

@ -654,12 +654,6 @@ void MwIniImporter::setVerbose(bool verbose) {
mVerbose = verbose; mVerbose = verbose;
} }
std::string MwIniImporter::numberToString(int n) {
std::stringstream str;
str << n;
return str.str();
}
MwIniImporter::multistrmap MwIniImporter::loadIniFile(const boost::filesystem::path& filename) const { MwIniImporter::multistrmap MwIniImporter::loadIniFile(const boost::filesystem::path& filename) const {
std::cout << "load ini file: " << filename << std::endl; std::cout << "load ini file: " << filename << std::endl;
@ -801,7 +795,7 @@ void MwIniImporter::importArchives(multistrmap &cfg, const multistrmap &ini) con
multistrmap::const_iterator it = ini.begin(); multistrmap::const_iterator it = ini.begin();
for(int i=0; it != ini.end(); i++) { for(int i=0; it != ini.end(); i++) {
archive = baseArchive; archive = baseArchive;
archive.append(this->numberToString(i)); archive.append(std::to_string(i));
it = ini.find(archive); it = ini.find(archive);
if(it == ini.end()) { if(it == ini.end()) {
@ -892,7 +886,7 @@ void MwIniImporter::importGameFiles(multistrmap &cfg, const multistrmap &ini, co
for (int i=0; it != ini.end(); i++) for (int i=0; it != ini.end(); i++)
{ {
gameFile = baseGameFile; gameFile = baseGameFile;
gameFile.append(this->numberToString(i)); gameFile.append(std::to_string(i));
it = ini.find(gameFile); it = ini.find(gameFile);
if(it == ini.end()) if(it == ini.end())

@ -35,7 +35,6 @@ class MwIniImporter {
static std::vector<std::string>::iterator findString(std::vector<std::string>& source, const std::string& string); static std::vector<std::string>::iterator findString(std::vector<std::string>& source, const std::string& string);
static void insertMultistrmap(multistrmap &cfg, const std::string& key, const std::string& value); static void insertMultistrmap(multistrmap &cfg, const std::string& key, const std::string& value);
static std::string numberToString(int n);
/// \return file's "last modified time", used in original MW to determine plug-in load order /// \return file's "last modified time", used in original MW to determine plug-in load order
static std::time_t lastWriteTime(const boost::filesystem::path& filename, std::time_t defaultTime); static std::time_t lastWriteTime(const boost::filesystem::path& filename, std::time_t defaultTime);

Loading…
Cancel
Save