mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-25 15:30:14 +00:00
Fix travis build issues.
This commit is contained in:
parent
bda26cba1f
commit
6fc4349b91
@ -517,7 +517,9 @@ std::string RTrim(std::string & s) {
|
||||
}
|
||||
|
||||
std::string Trim(std::string & s) {
|
||||
return LTrim(RTrim(s));
|
||||
auto temp = RTrim(s);
|
||||
auto temp2 = LTrim(temp);
|
||||
return temp2;
|
||||
}
|
||||
|
||||
std::string Join(const std::vector<std::string>& elements, const char* const separator) {
|
||||
|
@ -38,10 +38,10 @@ void RefreshCheats() {
|
||||
namespace CheatEngine {
|
||||
CheatEngine::CheatEngine() {
|
||||
//Create folder and file for cheats if it doesn't exist
|
||||
FileUtil::CreateDir(FileUtil::GetExeDirectory() + "\\user\\cheats");
|
||||
FileUtil::CreateDir(FileUtil::GetUserPath(D_USER_IDX) + "\\cheats");
|
||||
char buffer[50];
|
||||
sprintf(buffer, "%016llX", Loader::program_id);
|
||||
std::string file_path = FileUtil::GetExeDirectory() + "\\user\\cheats\\" + std::string(buffer) + ".txt";
|
||||
std::string file_path = FileUtil::GetUserPath(D_USER_IDX) + "\\cheats\\" + std::string(buffer) + ".txt";
|
||||
if (!FileUtil::Exists(file_path))
|
||||
FileUtil::CreateEmptyFile(file_path);
|
||||
cheats_list = ReadFileContents();
|
||||
@ -50,7 +50,7 @@ namespace CheatEngine {
|
||||
std::vector<std::shared_ptr<ICheat>> CheatEngine::ReadFileContents() {
|
||||
char buffer[50];
|
||||
auto a = sprintf(buffer, "%016llX", Loader::program_id);
|
||||
std::string file_path = FileUtil::GetExeDirectory() + "\\user\\cheats\\" + std::string(buffer) + ".txt";
|
||||
std::string file_path = FileUtil::GetUserPath(D_USER_IDX) + "\\cheats\\" + std::string(buffer) + ".txt";
|
||||
|
||||
std::string contents;
|
||||
FileUtil::ReadFileToString(true, file_path.c_str(), contents);
|
||||
@ -64,7 +64,8 @@ namespace CheatEngine {
|
||||
std::string name;
|
||||
bool enabled = false;
|
||||
for (int i = 0; i < lines.size(); i++) {
|
||||
std::string current_line = Common::Trim(std::string(lines[i].c_str()));
|
||||
std::string current_line = std::string(lines[i].c_str());
|
||||
current_line = Common::Trim(current_line);
|
||||
|
||||
if (current_line == "[Gateway]") { // Codetype header
|
||||
code_type = "Gateway";
|
||||
@ -113,7 +114,7 @@ namespace CheatEngine {
|
||||
void CheatEngine::Save(std::vector<std::shared_ptr<ICheat>> cheats) {
|
||||
char buffer[50];
|
||||
auto a = sprintf(buffer, "%016llX", Loader::program_id);
|
||||
std::string file_path = FileUtil::GetExeDirectory() + "\\user\\cheats\\" + std::string(buffer) + ".txt";
|
||||
std::string file_path = FileUtil::GetUserPath(D_USER_IDX) + "\\cheats\\" + std::string(buffer) + ".txt";
|
||||
FileUtil::IOFile file = FileUtil::IOFile(file_path, "w+");
|
||||
bool sectionGateway = false;
|
||||
for (auto& cheat : cheats) {
|
||||
|
@ -22,7 +22,8 @@ namespace CheatEngine {
|
||||
*/
|
||||
struct CheatLine {
|
||||
CheatLine(std::string line) {
|
||||
line = Common::Trim(std::string(line.c_str())); // remove '/0' characters if any.
|
||||
line = std::string(line.c_str()); // remove '/0' characters if any.
|
||||
line = Common::Trim(line);
|
||||
if (line.length() != 17) {
|
||||
type = -1;
|
||||
cheat_line = line;
|
||||
|
Loading…
Reference in New Issue
Block a user