Code Monkey home page Code Monkey logo

tortellini's Issues

need fix

Hi, if i use NDEBUG & RELEASE defines in my projetct, then the "strparse" function is not working properly (return only fallback value). could you make this function without try/catch construct?

Безымянный

Reading a char from the file

Using a file containing:

v = 25500

and extracting that using

const char a = init[""]["v"] | 'a';

I would expect that '25500' is out of range, so the fall back is used, but it isn't and the value 0x639c is used instead. This can be seen in #5 on line 292 and 291.

The root CMakeLists doesn't export the library

A good practice when writing a library with CMake is to export any public targets. This enables code reuse and the usage of find_package().

Currently the tortelini target isn't being exported nor installed.

We should check whenever the project is a root project (ie. "${CMAKE_SOURCE_DIR} == ${CMAKE_CURRENT_SOURCE_DIR}"), provide an install target and export it.

`string` to `long double`

should not this!

    inline double operator |(long double fallback) const {
        return strparse<long double, std::stold>(_value, fallback);
    }

should this?

    inline long double operator |(long double fallback) const {
        return strparse<long double, std::stold>(_value, fallback);
    }

Reading a bool from a file

With a file containing:

v = hello

and extracting a bool from that using

const auto b = ini[""]["v"] | true;

I would expect the fallback to be the result, but there returned value is false. In tortellini.hh

inline bool operator |(bool fallback) const {
	return _value.empty()
		? fallback
		: (
			   case_insensitive::compare(_value, "1")
			|| case_insensitive::compare(_value, "true")
			|| case_insensitive::compare(_value, "yes")
		);
}

This function only uses the fallback if the _value is empty, and not if the string isn't one of the valid [1|true|yes] options. This can be seen in #5 test.cc line 248.

Readme docs for running test are outdated

The readme states you can run tests by running make but this is no longer the case; the library was switched to CMake in order to create a target and to honor the testing flags provided by CMake.

The readme should be updated to reflect this.

mkdir build && cd build
cmake .. -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Debug
cmake --build .
ctest

The above should be tested and, if correct, updated in the readme.

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.