Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/simpleini.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrodie Thiesfield <brofield@gmail.com>2009-06-30 13:23:17 +0400
committerBrodie Thiesfield <brofield@gmail.com>2009-06-30 13:23:17 +0400
commit871c57f1fbe8f6684ff242bf544bfeb133c375eb (patch)
tree7bf09f7b7c12b8427aaac1829efe7da8e6174ba5 /SimpleIni.h
parent74aab3c0a0983462f24decead41583ce0fe86014 (diff)
test script (although really just testing in name rather than spirit)
Diffstat (limited to 'SimpleIni.h')
-rw-r--r--SimpleIni.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/SimpleIni.h b/SimpleIni.h
index 390b9b1..b5a526a 100644
--- a/SimpleIni.h
+++ b/SimpleIni.h
@@ -445,8 +445,8 @@ public:
@param a_bMultiLine See the method SetMultiLine() for details.
*/
CSimpleIniTempl(
- bool a_bIsUtf8 = false,
- bool a_bMultiKey = false,
+ bool a_bIsUtf8 = false,
+ bool a_bMultiKey = false,
bool a_bMultiLine = false
);
@@ -519,6 +519,19 @@ public:
/** Query the status of multi-line data */
bool IsMultiLine() const { return m_bAllowMultiLine; }
+ /** Should spaces be added around the equals sign when writing key/value
+ pairs out. When true, the result will be "key = value". When false,
+ the result will be "key=value". This value may be changed at any time.
+
+ \param a_bSpaces Add spaces around the equals sign?
+ */
+ void SetSpaces(bool a_bSpaces = true) {
+ m_bSpaces = a_bSpaces;
+ }
+
+ /** Query the status of spaces output */
+ bool UsingSpaces() const { return m_bSpaces; }
+
/*-----------------------------------------------------------------------*/
/** @}
@{ @name Loading INI Data */
@@ -986,7 +999,7 @@ public:
SI_Error SetBoolValue(
const SI_CHAR * a_pSection,
const SI_CHAR * a_pKey,
- bool a_nValue,
+ bool a_bValue,
const SI_CHAR * a_pComment = NULL,
bool a_bForceReplace = false
);
@@ -1165,6 +1178,9 @@ private:
/** Are data values permitted to span multiple lines? */
bool m_bAllowMultiLine;
+ /** Should spaces be written out surrounding the equals sign? */
+ bool m_bSpaces;
+
/** Next order value, used to ensure sections and keys are output in the
same order that they are loaded/added.
*/
@@ -1187,6 +1203,7 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::CSimpleIniTempl(
, m_bStoreIsUtf8(a_bIsUtf8)
, m_bAllowMultiKey(a_bAllowMultiKey)
, m_bAllowMultiLine(a_bAllowMultiLine)
+ , m_bSpaces(true)
, m_nOrder(0)
{ }
@@ -2319,7 +2336,7 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::Save(
if (!convert.ConvertToStore(iValue->pItem)) {
return SI_FAIL;
}
- a_oOutput.Write(" = ");
+ a_oOutput.Write(m_bSpaces ? " = " : "=");
if (m_bAllowMultiLine && IsMultiLineData(iValue->pItem)) {
// multi-line data needs to be processed specially to ensure
// that we use the correct newline format for the current system