Home » Developing U++ » UppHub » Simple INI parser (15 mb in 4 s, DualCore 2500 Mhz)
Re: Simple INI parser (15 mb in 4 s, DualCore 2500 Mhz) [message #24511 is a reply to message #24458] |
Thu, 21 January 2010 18:55   |
Sc0rch
Messages: 99 Registered: February 2008 Location: Russia, Rubtsovsk
|
Member |

|
|
IniFile 1.0 - Simple INI parser
Example of ini-file:
[Test]
Title = "Test \"Title\""
Name1 = "Value 1"
"Name 2" = Value2
Number = 1
Characters = \\\"\[\]\,\=
"Name with \\\"\[\]\,\=" = Value
["Section with \\\"\[\]\,\="]
Name = Value
Example of usage:
IniFile p;
p.Add("Test", "Name1", "Value 1");
p.Add("Test", "Name 2", "Value2");
p.AddInt("Test", "Number", 1);
p.Add("Test", "Characters", "\\\"[],=");
p.Add("Test", "Name with \\\"[],=", "Value");
p.Add("Section with \\\"[],=", "Name", "Value");
DUMP(p.Get("Test", "Name1")); // "Value 1" as result
DUMP(p.GetInt("Test", "Number")); // 1 as result
DUMP(p.Get("Test", "Characters")); // \"[],= as result
LOG(p.Dump());
p.Save(ConfigFile("Test1.ini", CHARSET_CP1251));
p.Clear();
p.Load(ConfigFile("Test1.ini", CHARSET_CP1251));
p.Save(ConfigFile("Test2.ini")); // CHARSET_DEFAULT
Version 1.0:
* bugfixes (most of them)
+ charsets support (Load("file...", CHARSET_CP1251) and Save)
+ added \ support to use the chars []=,\
Best regards!
|
|
|
 |
|
Simple INI parser (15 mb in 4 s, DualCore 2500 Mhz)
By: Sc0rch on Mon, 18 January 2010 10:11
|
 |
|
Re: Simple INI parser (15 mb in 4 s, DualCore 2500 Mhz)
By: Sc0rch on Thu, 21 January 2010 18:55
|
 |
|
Re: Simple INI parser (15 mb in 4 s, DualCore 2500 Mhz)
By: Sc0rch on Mon, 25 January 2010 11:03
|
 |
|
Re: Simple INI parser (15 mb in 4 s, DualCore 2500 Mhz)
By: Sc0rch on Mon, 25 January 2010 19:05
|
 |
|
Re: Simple INI parser (15 mb in 4 s, DualCore 2500 Mhz)
By: vicxtor on Sun, 05 January 2014 12:28
|
Goto Forum:
Current Time: Tue Apr 22 19:17:56 CEST 2025
Total time taken to generate the page: 0.02300 seconds
|