GCMemcardDirectory: Pass std::strings by reference.

This commit is contained in:
Lioncash 2014-10-31 10:17:24 -04:00
parent ef1520eab0
commit c23131d046
2 changed files with 6 additions and 6 deletions

View File

@ -13,7 +13,7 @@
const int NO_INDEX = -1;
static const char *MC_HDR = "MC_SYSTEM_AREA";
int GCMemcardDirectory::LoadGCI(std::string fileName, DiscIO::IVolume::ECountry card_region, bool currentGameOnly)
int GCMemcardDirectory::LoadGCI(const std::string& fileName, DiscIO::IVolume::ECountry card_region, bool currentGameOnly)
{
File::IOFile gcifile(fileName, "rb");
if (gcifile)
@ -131,7 +131,7 @@ int GCMemcardDirectory::LoadGCI(std::string fileName, DiscIO::IVolume::ECountry
return NO_INDEX;
}
GCMemcardDirectory::GCMemcardDirectory(std::string directory, int slot, u16 sizeMb, bool ascii, DiscIO::IVolume::ECountry card_region, int gameId)
GCMemcardDirectory::GCMemcardDirectory(const std::string& directory, int slot, u16 sizeMb, bool ascii, DiscIO::IVolume::ECountry card_region, int gameId)
: MemoryCardBase(slot, sizeMb)
, m_GameId(gameId)
, m_LastBlock(-1)
@ -652,7 +652,7 @@ void GCIFile::DoState(PointerWrap &p)
p.Do(m_used_blocks);
}
void MigrateFromMemcardFile(std::string strDirectoryName, int card_index)
void MigrateFromMemcardFile(const std::string& strDirectoryName, int card_index)
{
File::CreateFullPath(strDirectoryName);
std::string ini_memcard =

View File

@ -9,12 +9,12 @@
// Uncomment this to write the system data of the memorycard from directory to disc
//#define _WRITE_MC_HEADER 1
void MigrateFromMemcardFile(std::string strDirectoryName, int card_index);
void MigrateFromMemcardFile(const std::string& strDirectoryName, int card_index);
class GCMemcardDirectory : public MemoryCardBase, NonCopyable
{
public:
GCMemcardDirectory(std::string directory, int slot = 0, u16 sizeMb = MemCard2043Mb, bool ascii = true,
GCMemcardDirectory(const std::string& directory, int slot = 0, u16 sizeMb = MemCard2043Mb, bool ascii = true,
DiscIO::IVolume::ECountry card_region = DiscIO::IVolume::COUNTRY_EUROPE, int gameId = 0);
~GCMemcardDirectory();
void FlushToFile();
@ -26,7 +26,7 @@ public:
void DoState(PointerWrap &p) override;
private:
int LoadGCI(std::string fileName, DiscIO::IVolume::ECountry card_region, bool currentGameOnly);
int LoadGCI(const std::string& fileName, DiscIO::IVolume::ECountry card_region, bool currentGameOnly);
inline s32 SaveAreaRW(u32 block, bool writing = false);
// s32 DirectoryRead(u32 offset, u32 length, u8* destaddress);
s32 DirectoryWrite(u32 destaddress, u32 length, u8 *srcaddress);