Kill off some usages of c_str.

Also changes some function params, but this is ok.
Some simplifications were also able to be made (ie. killing off strcmps with ==, etc).
This commit is contained in:
Lioncash
2014-03-12 15:33:41 -04:00
parent dccc6d8b47
commit a82675b7d5
170 changed files with 812 additions and 704 deletions

View File

@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include <iostream>
#include <string>
#include <vector>
#include "Common/Common.h"
@ -13,7 +14,7 @@
#include "Core/DSP/DSPCodeUtil.h"
#include "Core/DSP/DSPDisassembler.h"
bool Assemble(const char *text, std::vector<u16> &code, bool force)
bool Assemble(const std::string& text, std::vector<u16> &code, bool force)
{
AssemblerSettings settings;
// settings.pc = 0;
@ -194,7 +195,7 @@ void BinaryStringBEToCode(const std::string &str, std::vector<u16> &code)
}
}
bool LoadBinary(const char *filename, std::vector<u16> &code)
bool LoadBinary(const std::string& filename, std::vector<u16> &code)
{
std::string buffer;
if (!File::ReadFileToString(filename, buffer))
@ -204,7 +205,7 @@ bool LoadBinary(const char *filename, std::vector<u16> &code)
return true;
}
bool SaveBinary(const std::vector<u16> &code, const char *filename)
bool SaveBinary(const std::vector<u16> &code, const std::string& filename)
{
std::string buffer;
CodeToBinaryStringBE(code, buffer);