Commit Graph

139 Commits

Author SHA1 Message Date
rezahousseini
aca6327cd8
Rename Windows.h to windows.h for mingw-w64 (#63)
Co-authored-by: Reza Housseini <reza.housseini@mecos.com>
2020-09-30 16:14:25 +03:00
Raul Tambre
248e6031cf
meson: Install CMake and pkg-config files into architecture-independe… (#60)
toml++ is header-only so these should be installed into architecture-independent directories to allow them to be found for crosscompiling regardless of the architecture they were installed on.

Fixes #59.
2020-09-17 15:16:36 +03:00
Mark Gillard
bf26a88412 minor cleanup and code review 2020-09-13 14:02:29 +03:00
Mark Gillard
dc29f80a4d added value_flags
Allows controlling the output format of integers, and round-trips their format when serializing after parsing.
2020-09-06 13:01:14 +03:00
Mark Gillard
1381240e10 meson refactoring
- renamed options to `snake_case`
- tests, examples and cmake config now explicitly disabled when used as a subproject
- removed small_binaries (it's now implicit when building as release)
- added minimum meson version 0.53
2020-09-05 13:26:12 +03:00
Mark Gillard
8ae2eecf71 Updated github templates [skip ci] 2020-09-01 20:16:54 +03:00
Mark Gillard
81d74663e8 fixed _Float16 erroneously supported on g++ (closes #57) 2020-09-01 14:47:21 +03:00
Mark Gillard
977cfbbf4e fixes for VS2017 (closes #55) 2020-08-26 14:51:12 +03:00
Mark Gillard
83b9ca3f9c added set information to CONTRIBUTING
also updated windows test targets to use /MP
2020-08-20 14:03:14 +03:00
Mark Gillard
e19fb41517 Added more explicit control over budget in toml_generator example 2020-08-14 12:06:34 +03:00
Mark Gillard
11a0e84ced added additional node_view constructors
also made node conversion operators explicit
2020-08-13 14:53:55 +03:00
Mark Gillard
9b4614a4e7 Update README [skip ci] 2020-08-11 18:29:40 +03:00
Mark Gillard
40d87de5b5 cleaned up some compiler warning management spam
also:
- removed `std::endl` from example code in documentation
- trimmed some fat from the toml.hpp generator
2020-08-11 18:07:02 +03:00
Mark Gillard
2ac735054a updated TOML version to v1.0.0-rc.2
also:
- simplified warning handling macros
- minor version bump
2020-08-09 12:32:17 +03:00
Nathan Reed
3b44bd504b
Add implicit conversion operator from node to node_view (#52)
- Creates a node_view pointing to that node. This is similar to how std::string has a conversion operator creating a string_view of the string.
- Also, enabled the move assignment operator for node_view, but made both copy and move assignment operators lvalue-only to avoid the "misleading assignment" issue (see https://github.com/marzer/tomlplusplus/issues/49#issuecomment-664432777)
2020-08-09 02:12:17 +03:00
Mark Gillard
ad6be8e51e minor cleanup
mostly for testing on ICC.
2020-08-08 20:51:33 +03:00
Mark Gillard
b8fc830f9c regenerated unicode functions 2020-08-03 19:05:39 +03:00
Mark Gillard
82616e734c fix some issues handling infinities and NaNs
fixes #51
2020-08-03 09:10:06 +03:00
Mark Gillard
f6450f6ff9 moved is_homogenous to toml::node
also:
- added is_homogenous overload for identifying failure-causing element (to assist with implementing #45)
- added table::is_homogenous
- added value::is_homogenous (just for generic code's sake)
2020-08-02 17:02:10 +03:00
Mark Gillard
b024ee6dc2 added tests for copying and insertion (closes #49)
also:
- added tests to catch any regressions of pull/50
- moved UTF-8 decoder copyright notice
- cleaned up static assert messages
2020-08-02 12:20:41 +03:00
Mark Gillard
6f7f6c6554 moved the unicode function generator stuff to another repo
also:
- updated github templates
2020-08-01 22:37:39 +03:00
Mark Gillard
6b8fa1bef5 fixed source information being copied when copying nodes
also:
- many minor documentation fixes
- added pull request template
2020-07-30 23:31:08 +03:00
whiterabbit963
52736559d2
fix node::value_or() to act like node::value() (#50)
auto table = toml::table{{{"value", 10}}};
const toml::node *value = table.get("value");
if(value && value->is_number())
{
    double number = value->value_or<double>(0);
    cout << number << endl;
}
The original output was 0. This change will output 10.0.
The old way would see that it was an integer (a native type),
then use the integer conversion, but since the type being requested
was a double, it would return the default value.
2020-07-30 20:41:28 +03:00
Mark Gillard
a1527d5529 fix godbolt links in documentation 2020-07-28 01:51:14 +03:00
Mark Gillard
2efb15bf9e added insert, emplace, push_back etc. compatibility with node_views
In service of satisfying #49.
2020-07-28 01:21:41 +03:00
Mark Gillard
17d1876529 added copy construction/assignment for arrays. tables and values
In service of satisfying #49.
2020-07-27 13:38:01 +03:00
Mark Gillard
539aad89f4 fixed array::insert not working correctly in some cases
also:
- improved the documentation for table and array
- fixed documentation font on mobile
2020-07-26 15:03:33 +03:00
Mark Gillard
35ada5d851 fix include guard regression in toml.hpp generator 2020-07-26 00:42:36 +03:00
Mark Gillard
fd07301bae improved support for __fp16, _Float16 and __float128
also:
- fixed a bunch of doxygen parsing issues
- added `#define` leak detection to the single-header script
- renamed `TOML_ALL_INLINE` to `TOML_HEADER_ONLY` (the old one still works too)
- simplified abi namespace definitions
2020-07-25 20:50:24 +03:00
Mark Gillard
cb113ae65e fixed Wcast-align warning spam on ARM 2020-07-22 21:47:27 +01:00
Mark Gillard
9afa43e7c2 fixed leading/trailing newlines with printing to ostreams (fixes #48)
also:
- change internal nan constant to match qNaN bits on x86/ARM
2020-07-21 16:11:32 +03:00
Mark Gillard
7314fbf8c2 deprecated parse_result::get() in favour of parse_result::table()
also:
- fixed static assert messages being badly formatted on clang
- minor documentation fixes
- updated version numbers
2020-07-20 17:26:36 +03:00
Mark Gillard
d84bd8bc78 renamed date_time::time_offset to just 'offset'
also:
- fixed natvis for date, time, time_offset, date_time
2020-07-20 02:09:03 +03:00
Mark Gillard
1ecd0bd844 Merge branch 'master' into new-value-getters 2020-07-20 00:47:49 +03:00
Mark Gillard
ca6f639fb9 fixed narrowing conversion warnings when constructing int values from unsigned
also:
- added ability to construct values from wide strings and u8 strings
- added non-template version of array::is_homogeneous()
- added explicit instantiations for more template types when `!TOML_ALL_INLINE`
- cleaned up abi namespaces
- simplified build and test machinery on windows
- removed TOML_CHAR_8_STRINGS since it no longer makes sense
2020-07-20 00:40:55 +03:00
Nathan Reed
a9a748e5dc
Add more VS debug visualizers (#46)
- Added natvis entries for toml::table, toml::array, parse_result, and parse_error
2020-07-19 22:37:23 +03:00
Mark Gillard
cb791fe0ef expanded allowable conversion semantics of value and value_or
also:
- fixed infinity and NaN-related code breaking when using -ffast-math and friends
- added much more detail to many static_assert error messages
- added more test permutations of various compiler flags
- added many more static checks to test code
2020-07-17 16:33:56 +03:00
Mark Gillard
de07ba7187 string value serialization now emits literals where possible (closes #43)
also added support for wide strings on Windows (closes #42):
- added wide-string path arg overloads of `parse()` and `parse_file()`
- added wide-string support to all relevant `table` and `array` ops
- added `std::wstring` support to `node::value()` and `node::value_or()`
- added `std::wstring` support to `node_view::value()` and `node_view::value_or()`
- added wide-string overloads of `table::operator[]`
- added wide-string overloads of `node_view::operator[]`
- added `source_region::wide_path()`
- added `TOML_WINDOWS_COMPAT` switch for explicitly enabling/disabling this stuff

also:
- fixed internal macro `assert_or_assume` leaking out of `toml_parser.hpp`
- deprecated `node_view::get()` in favour of `node_view::node()`
- minor documentation fixes
- minor cleanup
2020-07-14 20:50:24 +03:00
Mark Gillard
8d958fcc54 documentation improvements and minor cleanup
- split conformance tests into multiple TU's
- added "Try this code on Compiler Explorer" links to the main page
- minor preprocessor cleanup
2020-07-06 01:03:07 +03:00
Mark Gillard
51f64fd08d documentation improvements
- moved the main page to a separate dox file
- added integration section to homepage
- improved some of the examples
- formatting fixes
- added note about python wrapper (closes #36)
2020-07-02 20:17:23 +03:00
Mark Gillard
f52949a481 refactoring parser to reduce binary sizes
Basically boils down to eliminating excessive template instantiations.
2020-06-29 17:49:48 +03:00
Mark Gillard
40a1a03315 simplified test code to reduce bloat and improve compile times 2020-06-29 01:57:59 +03:00
Mark Gillard
25c020bb43 fixed streamsize conversion warning on ARM 2020-06-28 15:46:04 +01:00
Mark Gillard
0b334fd7d2 added rvalue overload of array::flatten
also:
- made array::flatten return a reference to the array
- minor documentation fixes
2020-06-28 15:26:18 +03:00
Mark Gillard
b8438b3258 fixed ML strings not allowing whitespace after line-ending backslashes
also:
- fixed value comparison with special floats
- added all the remaining conformance tests from BurntSushi/toml-test and iarna/toml-spec-tests
- added toml::inserter
- added license boilerplate to test files
2020-06-27 15:55:15 +03:00
Mark Gillard
7bf908fc11 updating submodules 2020-06-25 17:44:43 +03:00
Mark Gillard
761690d4a6 fixed BOM check causing EOF on very short iostream inputs
also fixed a number of small parsing conformance issues
2020-06-25 17:33:01 +03:00
Mark Gillard
a122b3b9b4 more preprocessor cleanup
- fixing 'unknown pragma' warnings in GCC
- cleaning up test structure
2020-06-24 21:05:23 +03:00
Mark Gillard
464d3d13cc documentation improvements
- updated TOML links to new toml.io website
- refactored the main page
2020-06-24 14:28:20 +03:00
Mark Gillard
00a8d14a49 minor preprocessor/doxygen cleanup 2020-06-23 13:04:05 +03:00