mirror of
https://github.com/Sude-/lgogdownloader.git
synced 2024-11-20 11:49:17 +01:00
Minor code cleanup, use std::to_string instead of stringstream
This commit is contained in:
parent
f11ff9e7e4
commit
5b2c4ae00a
25
src/api.cpp
25
src/api.cpp
@ -346,10 +346,7 @@ gameDetails API::getGameDetails(const std::string& game_name, const unsigned int
|
||||
{
|
||||
unsigned int patch_number = 1;
|
||||
unsigned int patch_number_file = 1;
|
||||
std::ostringstream ss;
|
||||
ss.str(std::string());
|
||||
ss << GlobalConstants::LANGUAGES[i].languageCode << patch_number << "patch" << patch_number_file;
|
||||
std::string patchname = ss.str();
|
||||
std::string patchname = GlobalConstants::LANGUAGES[i].languageCode + std::to_string(patch_number) + "patch" + std::to_string(patch_number_file);
|
||||
if (root["game"].isMember(patchname)) // found a patch node
|
||||
{
|
||||
Json::Value patchnode = root["game"][patchname];
|
||||
@ -373,15 +370,11 @@ gameDetails API::getGameDetails(const std::string& game_name, const unsigned int
|
||||
);
|
||||
}
|
||||
patch_number_file++;
|
||||
ss.str(std::string());
|
||||
ss << GlobalConstants::LANGUAGES[i].languageCode << patch_number << "patch" << patch_number_file;
|
||||
patchname = ss.str();
|
||||
patchname = GlobalConstants::LANGUAGES[i].languageCode + std::to_string(patch_number) + "patch" + std::to_string(patch_number_file);
|
||||
patchnode = root["game"][patchname];
|
||||
}
|
||||
patch_number++;
|
||||
ss.str(std::string());
|
||||
ss << GlobalConstants::LANGUAGES[i].languageCode << patch_number << "patch" << patch_number_file;
|
||||
patchname = ss.str();
|
||||
patchname = GlobalConstants::LANGUAGES[i].languageCode + std::to_string(patch_number) + "patch" + std::to_string(patch_number_file);
|
||||
patchnode = root["game"][patchname];
|
||||
}
|
||||
}
|
||||
@ -409,9 +402,7 @@ gameDetails API::getGameDetails(const std::string& game_name, const unsigned int
|
||||
std::string API::getInstallerLink(const std::string& game_name, const std::string& id)
|
||||
{
|
||||
std::string url, link;
|
||||
std::stringstream ss;
|
||||
ss << this->config.get_installer_link << game_name << "/" << id << "/";
|
||||
url = ss.str();
|
||||
url = this->config.get_installer_link + game_name + "/" + id + "/";
|
||||
std::string json = this->getResponseOAuth(url);
|
||||
|
||||
if (!json.empty())
|
||||
@ -447,9 +438,7 @@ std::string API::getInstallerLink(const std::string& game_name, const std::strin
|
||||
std::string API::getExtraLink(const std::string& game_name, const std::string& id)
|
||||
{
|
||||
std::string url, link;
|
||||
std::stringstream ss;
|
||||
ss << this->config.get_extra_link << game_name << "/" << id << "/";
|
||||
url = ss.str();
|
||||
url = this->config.get_extra_link + game_name + "/" + id + "/";
|
||||
std::string json = this->getResponseOAuth(url);
|
||||
|
||||
if (!json.empty())
|
||||
@ -490,9 +479,7 @@ std::string API::getPatchLink(const std::string& game_name, const std::string& i
|
||||
std::string API::getXML(const std::string& game_name, const std::string& id)
|
||||
{
|
||||
std::string url, XML;
|
||||
std::stringstream ss;
|
||||
ss << this->config.get_installer_link << game_name << "/" << id << "/crc/";
|
||||
url = ss.str();
|
||||
url = this->config.get_installer_link + game_name + "/" + id + "/crc/";
|
||||
std::string json = this->getResponseOAuth(url);
|
||||
|
||||
if (!json.empty())
|
||||
|
Loading…
Reference in New Issue
Block a user