#include <cstring>
#include <string>
#include <map>
#include <list>
#include <algorithm>
#include <stdio.h>
#include <wchar.h>
#include "ConvertUTF.h"
Go to the source code of this file.
Macros | |
#define | CSimpleIni CSimpleIniA |
#define | CSimpleIniCase CSimpleIniCaseA |
#define | SI_ASSERT(x) |
#define | SI_Case SI_GenericCase |
#define | SI_CONVERT_GENERIC |
#define | SI_NEWLINE SI_NEWLINE_A |
#define | SI_NEWLINE_A "\n" |
#define | SI_NEWLINE_W L"\n" |
#define | SI_NoCase SI_GenericNoCase |
#define | SI_UTF8_SIGNATURE "\xEF\xBB\xBF" |
Typedefs | |
typedef CSimpleIniTempl< char, SI_NoCase< char >, SI_ConvertA< char > > | CSimpleIniA |
typedef CSimpleIniTempl< char, SI_Case< char >, SI_ConvertA< char > > | CSimpleIniCaseA |
typedef CSimpleIniTempl< wchar_t, SI_Case< wchar_t >, SI_ConvertW< wchar_t > > | CSimpleIniCaseW |
typedef CSimpleIniTempl< wchar_t, SI_NoCase< wchar_t >, SI_ConvertW< wchar_t > > | CSimpleIniW |
Enumerations | |
enum | SI_Error { SI_OK = 0, SI_UPDATED = 1, SI_INSERTED = 2, SI_FAIL = -1, SI_NOMEM = -2, SI_FILE = -3 } |
#define CSimpleIni CSimpleIniA |
Definition at line 3366 of file SimpleIni.h.
#define CSimpleIniCase CSimpleIniCaseA |
Definition at line 3367 of file SimpleIni.h.
#define SI_ASSERT | ( | x | ) |
Library | SimpleIni |
---|---|
File | SimpleIni.h |
Author | Brodie Thiesfield [code at jellycan dot com] |
Source | http://code.jellycan.com/simpleini/ |
Version | 4.15 |
Jump to the CSimpleIni interface documentation.
This component allows an INI-style configuration file to be used on both Windows and Linux/Unix. It is fast, simple and source code using this component will compile unchanged on either OS.
Interface | Case-sensitive | Load UTF-8 | Load MBCS | Typedef |
---|---|---|---|---|
SI_CONVERT_GENERIC | ||||
char | No | Yes | Yes #1 | CSimpleIniA |
char | Yes | Yes | Yes | CSimpleIniCaseA |
wchar_t | No | Yes | Yes | CSimpleIniW |
wchar_t | Yes | Yes | Yes | CSimpleIniCaseW |
SI_CONVERT_WIN32 | ||||
char | No | No #2 | Yes | CSimpleIniA |
char | Yes | Yes | Yes | CSimpleIniCaseA |
wchar_t | No | Yes | Yes | CSimpleIniW |
wchar_t | Yes | Yes | Yes | CSimpleIniCaseW |
SI_CONVERT_ICU | ||||
char | No | Yes | Yes | CSimpleIniA |
char | Yes | Yes | Yes | CSimpleIniCaseA |
UChar | No | Yes | Yes | CSimpleIniW |
UChar | Yes | Yes | Yes | CSimpleIniCaseW |
GetAllSections | Return all section names |
GetAllKeys | Return all key names within a section |
GetAllValues | Return all values within a section & key |
GetSection | Return all key names and values in a section |
GetSectionSize | Return the number of keys in a section |
GetValue | Return a value for a section & key |
SetValue | Add or update a value for a section & key |
Delete | Remove a section, or a key from a section |
SimpleIni supports reading from and writing to STL IO streams. Enable this by defining SI_SUPPORT_IOSTREAMS before including the SimpleIni.h header file. Ensure that if the streams are backed by a file (e.g. ifstream or ofstream) then the flag ios_base::binary has been used when the file was opened.
Values that span multiple lines are created using the following format.
<pre> key = <<<ENDTAG .... multiline value .... ENDTAG </pre>
Note the following:
Comments are preserved in the file within the following restrictions:
The sections and keys are written out in the same order as they were read in from the file. Sections and keys added to the data after the file has been loaded will be added to the end of the file when it is written. There is no way to specify the location of a section or key other than in first-created, first-saved order.
The licence text below is the boilerplate "MIT Licence" used from: http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2006-2012, Brodie Thiesfield
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition at line 232 of file SimpleIni.h.
#define SI_Case SI_GenericCase |
Definition at line 2789 of file SimpleIni.h.
#define SI_CONVERT_GENERIC |
Definition at line 2621 of file SimpleIni.h.
#define SI_NEWLINE SI_NEWLINE_A |
Definition at line 3368 of file SimpleIni.h.
#define SI_NEWLINE_A "\n" |
Definition at line 252 of file SimpleIni.h.
#define SI_NEWLINE_W L"\n" |
Definition at line 253 of file SimpleIni.h.
#define SI_NoCase SI_GenericNoCase |
Definition at line 2790 of file SimpleIni.h.
#define SI_UTF8_SIGNATURE "\xEF\xBB\xBF" |
Definition at line 246 of file SimpleIni.h.
typedef CSimpleIniTempl<char, SI_NoCase<char>,SI_ConvertA<char> > CSimpleIniA |
Definition at line 3345 of file SimpleIni.h.
typedef CSimpleIniTempl<char, SI_Case<char>,SI_ConvertA<char> > CSimpleIniCaseA |
Definition at line 3347 of file SimpleIni.h.
typedef CSimpleIniTempl<wchar_t, SI_Case<wchar_t>,SI_ConvertW<wchar_t> > CSimpleIniCaseW |
Definition at line 3358 of file SimpleIni.h.
typedef CSimpleIniTempl<wchar_t, SI_NoCase<wchar_t>,SI_ConvertW<wchar_t> > CSimpleIniW |
Definition at line 3356 of file SimpleIni.h.
enum SI_Error |
Enumerator | |
---|---|
SI_OK | No error. |
SI_UPDATED | An existing value was updated. |
SI_INSERTED | A new value was inserted. |
SI_FAIL | Generic failure. |
SI_NOMEM | Out of memory error. |
SI_FILE | File error (see errno for detail error) |
Definition at line 235 of file SimpleIni.h.