mirror of
https://github.com/znc/znc.git
synced 2026-07-06 01:41:12 +02:00
Make 1st parameter of CConfig::Write() a reference.
Pointer doesn't make much sense, because File can't be NULL.
This commit is contained in:
+6
-6
@@ -170,22 +170,22 @@ bool CConfig::Parse(CFile& file, CString& sErrorMsg)
|
||||
return true;
|
||||
}
|
||||
|
||||
void CConfig::Write(CFile *pFile, unsigned int iIndentation) {
|
||||
void CConfig::Write(CFile& File, unsigned int iIndentation) {
|
||||
CString sIndentation = CString(iIndentation, '\t');
|
||||
|
||||
for (EntryMapIterator it = m_ConfigEntries.begin(); it != m_ConfigEntries.end(); ++it) {
|
||||
for (VCString::const_iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) {
|
||||
pFile->Write(sIndentation + it->first + " = " + *it2 + "\n");
|
||||
File.Write(sIndentation + it->first + " = " + *it2 + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
for (SubConfigMapIterator it = m_SubConfigs.begin(); it != m_SubConfigs.end(); ++it) {
|
||||
for (SubConfig::const_iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) {
|
||||
pFile->Write("\n");
|
||||
File.Write("\n");
|
||||
|
||||
pFile->Write(sIndentation + "<" + it->first + " " + it2->first + ">\n");
|
||||
it2->second.m_pSubConfig->Write(pFile, iIndentation + 1);
|
||||
pFile->Write(sIndentation + "</" + it->first + ">\n");
|
||||
File.Write(sIndentation + "<" + it->first + " " + it2->first + ">\n");
|
||||
it2->second.m_pSubConfig->Write(File, iIndentation + 1);
|
||||
File.Write(sIndentation + "</" + it->first + ">\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public:
|
||||
}
|
||||
|
||||
bool Parse(CFile& file, CString& sErrorMsg);
|
||||
void Write(CFile *pFile, unsigned int iIndentation = 0);
|
||||
void Write(CFile& file, unsigned int iIndentation = 0);
|
||||
|
||||
private:
|
||||
EntryMap m_ConfigEntries;
|
||||
|
||||
Reference in New Issue
Block a user