Giter Site home page Giter Site logo

inipp's People

Contributors

cyberdniwe avatar germanaizek avatar higaski avatar mcmtroffaes avatar mixusminimax avatar sonulohani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inipp's Issues

Writing comments

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!

Compile error with C++17, ptr_fun deprecated

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.

How to set a value

How to set a value?
something like inipp::get_value(); but to set a value would be great
Thanks.

Default value for std::string

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 ?

  • return false if no match
  • not changing the existing value

Please tell me if I could help.

Thank you.

I get a 0 instead of 0.87 in my parsing of a Real number.

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

Bug: Comments are treated as value

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


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.