API changes: preliminary support for the new "silent" flag

This commit is contained in:
Sude 2013-10-13 12:21:14 +03:00
parent eb0208fffa
commit 08b0e10429
2 changed files with 6 additions and 3 deletions

View File

@ -19,13 +19,14 @@ extern "C" {
class gameFile { class gameFile {
public: public:
gameFile(const int& t_updated, const std::string& t_id, const std::string& t_name, const std::string& t_path, const std::string& t_size, const unsigned int& t_language = GlobalConstants::LANGUAGE_EN); gameFile(const int& t_updated, const std::string& t_id, const std::string& t_name, const std::string& t_path, const std::string& t_size, const unsigned int& t_language = GlobalConstants::LANGUAGE_EN, const int& t_silent = 0);
int updated; int updated;
std::string id; std::string id;
std::string name; std::string name;
std::string path; std::string path;
std::string size; std::string size;
unsigned int language; unsigned int language;
int silent;
virtual ~gameFile(); virtual ~gameFile();
}; };

View File

@ -18,7 +18,7 @@ size_t writeMemoryCallback(char *ptr, size_t size, size_t nmemb, void *userp) {
return count; return count;
} }
gameFile::gameFile(const int& t_updated, const std::string& t_id, const std::string& t_name, const std::string& t_path, const std::string& t_size, const unsigned int& t_language) gameFile::gameFile(const int& t_updated, const std::string& t_id, const std::string& t_name, const std::string& t_path, const std::string& t_size, const unsigned int& t_language, const int& t_silent)
{ {
this->updated = t_updated; this->updated = t_updated;
this->id = t_id; this->id = t_id;
@ -26,6 +26,7 @@ gameFile::gameFile(const int& t_updated, const std::string& t_id, const std::str
this->path = t_path; this->path = t_path;
this->size = t_size; this->size = t_size;
this->language = t_language; this->language = t_language;
this->silent = t_silent;
} }
gameFile::~gameFile() gameFile::~gameFile()
@ -314,7 +315,8 @@ gameDetails API::getGameDetails(const std::string& game_name, const unsigned int
installer["name"].asString(), installer["name"].asString(),
installer["link"].asString(), installer["link"].asString(),
installer["size"].asString(), installer["size"].asString(),
language language,
installer["silent"].isInt() ? installer["silent"].asInt() : std::stoi(installer["silent"].asString())
) )
); );
} }