Click here to Skip to main content
15,881,866 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
ini file may be not in usual, just like:

[ip]
ip1
ip2
ip3
[domain]
do1
do2
...


in windows, there is 'GetPrivateProfileSection', But I want to do it by boost.

I know there is a 'boost::property_tree::ini_parser', but read_ini() can not work for the ini format above.

Is there any solution?


Thanks!

[Updated]
I will write my own code for it.
Thanks!
[/Updated]
Posted
Updated 16-Apr-14 5:23am
v3
Comments
Sergey Alexandrovich Kryukov 16-Apr-14 1:04am    
Why? INI is total obsolete garbage. Use, say, XML...
And why do you think boost INI parser does not work? What have you tried so far?
By the way, you sample is not an INI file at all, it cannot be parsed. Parse it by yourself, if you really need it. Big deal...
—SA
Member 10271708 16-Apr-14 4:44am    
I also want to replace ini, but it's necessary for my work.
I thought there may be a solution for this situation in boost, well, I'll parse it.
Sergey Alexandrovich Kryukov 16-Apr-14 9:19am    
I understand. Well, your own parsing is the solution.
—SA

1 solution

As suggested, you can easily write your own code for parsing such a simple format (and rewriting it as XML is a good suggestion too). Even Boost.Regex is, in my opinion, overkill for such a format.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 16-Apr-14 9:18am    
Agree, a 5.
—SA
CPallini 16-Apr-14 11:23am    
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900