Update IniFileClass.cpp

Fix title case, add spacing, fix some typos
This commit is contained in:
Derek "Turtle" Roe 2021-03-16 18:11:25 -05:00
parent 311e39e0d0
commit 00653b2b65
1 changed files with 11 additions and 11 deletions

View File

@ -184,7 +184,7 @@ void CIniFileBase::SaveCurrentSection(void)
} }
else else
{ {
//increase/decrease space needed // Increase/decrease space needed
int NeededBufferLen = 0; int NeededBufferLen = 0;
{ {
std::unique_ptr<char> LineData; std::unique_ptr<char> LineData;
@ -237,7 +237,7 @@ void CIniFileBase::SaveCurrentSection(void)
m_File.Flush(); m_File.Flush();
ClearSectionPosList(StartPos); ClearSectionPosList(StartPos);
} }
//set pointer to beginning of the start pos // Set pointer to beginning of the start POS
m_File.Seek(StartPos, CFileBase::begin); m_File.Seek(StartPos, CFileBase::begin);
} }
@ -328,7 +328,7 @@ bool CIniFileBase::MoveToSectionNameData(const char * lpSectionName, bool Change
if (result <= 1) { continue; } if (result <= 1) { continue; }
if (strlen(CleanLine(Input)) <= 1) { continue; } if (strlen(CleanLine(Input)) <= 1) { continue; }
//We Only care about sections // We only care about sections
char * CurrentSection = Input; char * CurrentSection = Input;
if (m_lastSectionSearch == 0 && !memcmp(CurrentSection, pUTF8, 3)) if (m_lastSectionSearch == 0 && !memcmp(CurrentSection, pUTF8, 3))
@ -339,7 +339,7 @@ bool CIniFileBase::MoveToSectionNameData(const char * lpSectionName, bool Change
if (CurrentSection[0] != '[') { continue; } if (CurrentSection[0] != '[') { continue; }
int lineEndPos = (int)strlen(CurrentSection) - 1; int lineEndPos = (int)strlen(CurrentSection) - 1;
if (CurrentSection[lineEndPos] != ']') { continue; } if (CurrentSection[lineEndPos] != ']') { continue; }
//take off the ']' from the end of the string // Take off the ']' from the end of the string
CurrentSection[lineEndPos] = 0; CurrentSection[lineEndPos] = 0;
CurrentSection += 1; CurrentSection += 1;
m_lastSectionSearch = (m_File.GetPosition() - DataSize) + ReadPos; m_lastSectionSearch = (m_File.GetPosition() - DataSize) + ReadPos;
@ -438,7 +438,7 @@ const char * CIniFileBase::CleanLine(char * Line)
} }
} }
//strip any spaces or line feeds from the end of the line // Strip any spaces or line feeds from the end of the line
for (int count = (int)strlen(&Line[0]) - 1; count >= 0; count--) for (int count = (int)strlen(&Line[0]) - 1; count >= 0; count--)
{ {
if (Line[count] != ' ' && Line[count] != '\r') { break; } if (Line[count] != ' ' && Line[count] != '\r') { break; }
@ -458,7 +458,7 @@ void CIniFileBase::OpenIniFileReadOnly()
void CIniFileBase::OpenIniFile(bool bCreate) void CIniFileBase::OpenIniFile(bool bCreate)
{ {
//Open for reading/Writing // Open for reading/writing
m_ReadOnly = false; m_ReadOnly = false;
if (!m_File.Open(m_FileName.c_str(), CFileBase::modeReadWrite | CFileBase::shareDenyWrite)) if (!m_File.Open(m_FileName.c_str(), CFileBase::modeReadWrite | CFileBase::shareDenyWrite))
{ {
@ -721,7 +721,7 @@ void CIniFileBase::SaveString(const char * lpSectionName, const char * lpKeyNam
void CIniFileBase::SaveNumber(const char * lpSectionName, const char * lpKeyName, int32_t Value) void CIniFileBase::SaveNumber(const char * lpSectionName, const char * lpKeyName, int32_t Value)
{ {
//translate the string to an ascii version and save as text // Translate the string to an ASCII version and save as text
SaveString(lpSectionName, lpKeyName, FormatStr("%d", Value).c_str()); SaveString(lpSectionName, lpKeyName, FormatStr("%d", Value).c_str());
} }