Project64: In ini handling change SectionList from vector to set
This commit is contained in:
parent
f5c2c33149
commit
7e503dc192
|
@ -869,7 +869,7 @@ void CIniFileBase::GetVectorOfSections(SectionList & sections)
|
|||
|
||||
for (FILELOC::const_iterator iter = m_SectionsPos.begin(); iter != m_SectionsPos.end(); iter++)
|
||||
{
|
||||
sections.push_back(iter->first);
|
||||
sections.insert(iter->first);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,13 +10,14 @@
|
|||
#include <map>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <set>
|
||||
#include <memory>
|
||||
|
||||
class CIniFileBase
|
||||
{
|
||||
public:
|
||||
typedef std::map<std::string, std::string> KeyValueData;
|
||||
typedef std::vector<std::string> SectionList;
|
||||
typedef std::set<std::string> SectionList;
|
||||
typedef std::list<std::string> strlist;
|
||||
typedef std::pair<const std::string *, const std::string *> KeyValueItem;
|
||||
typedef std::vector<KeyValueItem> KeyValueVector;
|
||||
|
|
|
@ -70,9 +70,9 @@ void SplitFile(const char * FileName, const char * Target)
|
|||
CIniFile CheatIniFile(FileName);
|
||||
CheatIniFile.GetVectorOfSections(Sections);
|
||||
|
||||
for (size_t i = 0, n = Sections.size(); i < n; i++)
|
||||
for (CIniFile::SectionList::const_iterator SectionItr = Sections.begin(); SectionItr != Sections.end(); SectionItr++)
|
||||
{
|
||||
const char * Section = Sections[i].c_str();
|
||||
const char * Section = SectionItr->c_str();
|
||||
|
||||
CIniFile::KeyValueData data;
|
||||
CheatIniFile.GetKeyValueData(Section, data);
|
||||
|
@ -136,9 +136,9 @@ void RegionSection(CFile &TargetIniFile, Files &files, const char * Region, cons
|
|||
|
||||
bool found = false;
|
||||
stdstr_f searchStr(":%s", RegionCode);
|
||||
for (size_t i = 0, n = Sections.size(); i < n; i++)
|
||||
for (CIniFile::SectionList::const_iterator SectionItr = Sections.begin(); SectionItr != Sections.end(); SectionItr++)
|
||||
{
|
||||
const char * Section = Sections[i].c_str();
|
||||
const char * Section = SectionItr->c_str();
|
||||
const char * pos = strstr(Section, searchStr.c_str());
|
||||
if (pos == NULL)
|
||||
{
|
||||
|
@ -153,9 +153,9 @@ void RegionSection(CFile &TargetIniFile, Files &files, const char * Region, cons
|
|||
continue;
|
||||
}
|
||||
|
||||
for (size_t i = 0, n = Sections.size(); i < n; i++)
|
||||
for (CIniFile::SectionList::const_iterator SectionItr = Sections.begin(); SectionItr != Sections.end(); SectionItr++)
|
||||
{
|
||||
const char * Section = Sections[i].c_str();
|
||||
const char * Section = SectionItr->c_str();
|
||||
|
||||
CIniFile::KeyValueData data;
|
||||
GameIniFile.GetKeyValueData(Section, data);
|
||||
|
@ -200,9 +200,9 @@ void JoinFile(const char * Directory, const char * Target)
|
|||
|
||||
CIniFile::SectionList Sections;
|
||||
GameIniFile.GetVectorOfSections(Sections);
|
||||
for (size_t i = 0, n = Sections.size(); i < n; i++)
|
||||
for (CIniFile::SectionList::const_iterator SectionItr = Sections.begin(); SectionItr != Sections.end(); SectionItr++)
|
||||
{
|
||||
const char * Section = Sections[i].c_str();
|
||||
const char * Section = SectionItr->c_str();
|
||||
stdstr Name = GameIniFile.GetString(Section, "Name", Section);
|
||||
Name.Trim("\t =");
|
||||
if (Name.size() > 0)
|
||||
|
@ -282,9 +282,9 @@ void UpdateNames(const char* Directory, const char* RdbFile)
|
|||
CIniFile::SectionList Sections;
|
||||
CheatFile.GetVectorOfSections(Sections);
|
||||
CheatFile.SetCustomSort(CustomSortData);
|
||||
for (size_t i = 0, n = Sections.size(); i < n; i++)
|
||||
for (CIniFile::SectionList::const_iterator SectionItr = Sections.begin(); SectionItr != Sections.end(); SectionItr++)
|
||||
{
|
||||
const char * Section = Sections[i].c_str();
|
||||
const char * Section = SectionItr->c_str();
|
||||
std::string Name = RdbIni.GetString(Section, "Good Name", "");
|
||||
if (Name.empty())
|
||||
{
|
||||
|
@ -616,9 +616,9 @@ void convertGS(const char* Directory)
|
|||
CIniFile::SectionList Sections;
|
||||
CheatFile.GetVectorOfSections(Sections);
|
||||
CheatFile.SetCustomSort(CustomSortData);
|
||||
for (size_t i = 0, n = Sections.size(); i < n; i++)
|
||||
for (CIniFile::SectionList::const_iterator SectionItr = Sections.begin(); SectionItr != Sections.end(); SectionItr++)
|
||||
{
|
||||
const char * Section = Sections[i].c_str();
|
||||
const char * Section = SectionItr->c_str();
|
||||
for (uint32_t cheat = 0; cheat < MaxCheats; cheat++)
|
||||
{
|
||||
std::string CheatEntry = CheatFile.GetString(Section, stdstr_f("Cheat%d", cheat).c_str(), "");
|
||||
|
@ -846,9 +846,9 @@ void ConvertNew(const char * Src, const char * Dest)
|
|||
MaxCheats = 50000,
|
||||
};
|
||||
|
||||
for (size_t i = 0, n = Sections.size(); i < n; i++)
|
||||
for (CIniFile::SectionList::const_iterator SectionItr = Sections.begin(); SectionItr != Sections.end(); SectionItr++)
|
||||
{
|
||||
const char * Section = Sections[i].c_str();
|
||||
const char * Section = SectionItr->c_str();
|
||||
std::string GameName = SrcIniFile.GetString(Section, "Name", "");
|
||||
DstCheatFile.SetName(Section, GameName.c_str());
|
||||
for (uint32_t cheat = 0; cheat < MaxCheats; cheat++)
|
||||
|
|
|
@ -121,9 +121,9 @@ void CSettingTypeApplication::ResetAll()
|
|||
}
|
||||
CIniFile::SectionList sections;
|
||||
m_SettingsIniFile->GetVectorOfSections(sections);
|
||||
for (size_t i = 0; i < sections.size(); i++)
|
||||
for (CIniFile::SectionList::const_iterator itr = sections.begin(); itr != sections.end(); itr++)
|
||||
{
|
||||
m_SettingsIniFile->DeleteSection(sections[i].c_str());
|
||||
m_SettingsIniFile->DeleteSection(itr->c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -118,10 +118,8 @@
|
|||
<ClCompile Include="UserInterface\WTLControls\wtl-BitmapPicture.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="DiscordRPC.h" />
|
||||
<ClInclude Include="UserInterface\Debugger\CPULog.h" />
|
||||
<ClInclude Include="UserInterface\Debugger\Debugger-CPULogView.h" />
|
||||
<ClInclude Include="N64System\Debugger\OpInfo.h" />
|
||||
<ClInclude Include="N64System.h" />
|
||||
<ClInclude Include="Settings\GuiSettings.h" />
|
||||
<ClInclude Include="Settings\NotificationSettings.h" />
|
||||
|
@ -157,7 +155,6 @@
|
|||
<ClInclude Include="UserInterface\Debugger\ScriptHook.h" />
|
||||
<ClInclude Include="UserInterface\Debugger\ScriptInstance.h" />
|
||||
<ClInclude Include="UserInterface\Debugger\ScriptSystem.h" />
|
||||
<ClInclude Include="UserInterface\Debugger\stdafx.h" />
|
||||
<ClInclude Include="UserInterface\Debugger\Symbols.h" />
|
||||
<ClInclude Include="UserInterface\EnhancementConfig.h" />
|
||||
<ClInclude Include="UserInterface\MainWindow.h" />
|
||||
|
|
|
@ -353,9 +353,6 @@
|
|||
<ClInclude Include="UserInterface\SupportWindow.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="N64System\Debugger\OpInfo.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="UserInterface\WTLControls\TooltipDialog.h">
|
||||
<Filter>Header Files\User Interface Headers\WTL Controls Headers</Filter>
|
||||
</ClInclude>
|
||||
|
@ -428,9 +425,6 @@
|
|||
<ClInclude Include="UserInterface\Debugger\ScriptSystem.h">
|
||||
<Filter>Header Files\User Interface Headers\Debugger Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="UserInterface\Debugger\stdafx.h">
|
||||
<Filter>Header Files\User Interface Headers\Debugger Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="UserInterface\Debugger\Symbols.h">
|
||||
<Filter>Header Files\User Interface Headers\Debugger Headers</Filter>
|
||||
</ClInclude>
|
||||
|
@ -461,9 +455,6 @@
|
|||
<ClInclude Include="UserInterface\Settings\SettingsPage-DiskDrive.h">
|
||||
<Filter>Header Files\User Interface Headers\Settings Header</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="DiscordRPC.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="UserInterface\WTLControls\HexEditCtrl.h">
|
||||
<Filter>Header Files\User Interface Headers\WTL Controls Headers</Filter>
|
||||
</ClInclude>
|
||||
|
|
Loading…
Reference in New Issue