mcmtroffaes / inipp Goto Github PK
View Code? Open in Web Editor NEWSimple C++ ini parser.
License: MIT License
Simple C++ ini parser.
License: MIT License
I came across this project and like its compactness. I was wondering... for the generation feature, is it possible to generate comments? I couldn't see an easy way to do it without modification. I see it ignores them on parsing, but not that it can write them.
Thanks!
Hey,
You don' support comments behind a line yet.
Example:
[general]
some_field = some_value ; Comment
Hey,
the ltrim/rtrim implementations generate compile errors for me with C++17 as a language standard because std::ptr_fun is deprecated since C++11 and finaly removed in 17. Do you mind changing this to a lambda, i.e. the full implementation of ltrim would then become:
template <class CharT> inline void ltrim(std::basic_string<CharT> & s) { s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int c) {return !std::isspace(c); })); }
I can also do a PR if you like.
Currently, the generated output writes all sections with no new lines between them.
Would be nice (for cosmetic reasons) to have the option to separate each section by a new line.
How to set a value?
something like inipp::get_value();
but to set a value would be great
Thanks.
If is there a reason, could you explain why?
Hello,
First of all, thank you for inipp, it is very lightweight and I think, very elegant.
I have an issue when trying to simulate 'default values' for std::string.
For example, if I insert those lines in example.cpp, with the same example.ini,
where Usera is not defined :
std::string user = "testUser";
inipp::extract(ini.sections["bitbucket.org"]["Usera"], user);
std::cout << "bitbucket.org user: " << user << std::endl;
the output contains:
bitbucket.org user:
instead of what I would have expected:
bitbucket.org user: testUser
While looking why in the source code I found that my test uses this template specialization:
template <typename CharT>
inline bool extract(const std::basic_string<CharT> & value, std::basic_string<CharT> & dst) {
dst = value;
return true;
}
So it is clear why my default string became an empty string.
Would it be possible to have the same feature as integer or boolean ?
Please tell me if I could help.
Thank you.
In this project:
https://github.com/Danielgb23/EA872-projeto
If I configure the config/player.ini attack_rate to 0.87 for example the parser reads it as a 0 which leads to a division by zero later on in the code.
It's read in this line of the code:
attack_rate = reader.GetReal("stats", "attack_rate", -1);
At the line 49 of src/model/entity.cpp. I checked it out with GDB and it really reads it as zero. If I change to other number it reads it normally. Real numbers like 4.3 are read normally (actually they change to 4.299999 or something like that).
My machine is 20.04 Ubuntu
Hi,
I've just modified the test1.ini file to
[section]
variable="value" ;dummy
Output in test1.output should be
>>> ERRORS <<<
>>> GENERATE <<<
[section]
variable=value
>>> INTERPOLATE <<<
[section]
variable=value
However the output from the library is:
>>> ERRORS <<<
>>> GENERATE <<<
[section]
variable=value ;dummy
>>> INTERPOLATE <<<
[section]
variable=value ;dummy
Maybe someone would be willing to add proper CMake support which means to at least define an INTERFACE library as target.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.