ToruNiina
57b5545ba2
fix: add _type suffix to value::xxx_type
2019-06-17 20:34:13 +09:00
ToruNiina
f36b39c04f
fix: consider comments while comparing values
2019-06-17 20:33:57 +09:00
ToruNiina
af19dfe032
fix: conversion between different basic_values
2019-06-15 20:19:51 +09:00
ToruNiina
5726d10339
feat: save comment information in value
2019-06-15 17:13:02 +09:00
ToruNiina
6345910c3e
🔀 Merge branch 'master' into v3
2019-06-08 20:05:05 +09:00
ToruNiina
4f4d4380f2
feat: throw from as_* if type differs
2019-06-07 19:34:04 +09:00
ToruNiina
7db8388d17
fix: avoid deprecated stuff in the internal code
2019-06-07 13:27:10 +09:00
ToruNiina
62c993e096
feat: add as|is_floating and deprecate as|is_float
...
to make the function names consistent with snake_case_typenames
2019-06-07 00:10:12 +09:00
ToruNiina
7258c52334
feat: enable to edit comments through memfun
2019-06-03 22:17:10 +09:00
ToruNiina
407d9223f6
feat: 💥 is_float -> is_floating
2019-06-03 22:01:47 +09:00
ToruNiina
d7c5606dcf
fix: update as_float -> floating
2019-06-03 21:46:48 +09:00
ToruNiina
f19b3822bb
feat: 💥 change as_float -> as_floating
2019-06-03 21:43:35 +09:00
ToruNiina
319365f86b
feat: update types in format_error
2019-06-02 21:50:27 +09:00
ToruNiina
89f0ace6ee
fix: initialize comment container correctly
2019-06-02 21:50:01 +09:00
ToruNiina
9676499ab5
refactor: move file inclusion to correct position
2019-06-02 15:29:34 +09:00
ToruNiina
5792411d5e
feat: add default template argument to basic_value
2019-06-02 15:15:43 +09:00
ToruNiina
44184026f9
feat: enable to convert different basic_values
2019-06-02 00:13:12 +09:00
ToruNiina
f9b5166c09
refactor: move default value types to value.hpp
2019-06-01 23:58:17 +09:00
ToruNiina
5c5d8b686a
feat: introduce basic_value
...
it is capable to change comment policy, backend container of an array
and a table.
2019-06-01 20:18:57 +09:00
ToruNiina
1633268d57
refactor: use snake_case typename only
2019-05-30 14:39:15 +09:00
ToruNiina
0ce259ada0
refactor: split throw_bad_cast from value::cast
2019-05-29 21:06:25 +09:00
ToruNiina
74da49f87f
refactor: move switch_cast from inside of value
...
use as_something() instead of it. To realize this, the implementation of
as_something() is also changed. Now as_something does not depends on
`cast`. This reduces complexity around casting toml::value to other types.
2019-05-29 20:18:15 +09:00
Ivan Shynkarenka
db6f3d5d11
Fix Visual Studio 2019 warnings in pedantic compilation mode (/W4 /WX)
2019-05-10 14:58:22 +03:00
ToruNiina
4cbbcd8f62
Merge branch 'master' into as-something
2019-04-27 19:04:44 +09:00
Toru Niina
a2631ecacb
Merge pull request #60 from ToruNiina/string-view
...
support std::string_view
2019-04-27 18:33:59 +09:00
ToruNiina
4bcc5e8375
Merge branch 'master' into as-something
2019-04-27 17:42:12 +09:00
ToruNiina
aa7b9a3965
refactor: rename as_floating -> as_float
...
Actually, since `floating` is used for toml::types, `as_floating`
seems to be clearer. But currently `is_*` functions uses `float`,
not `floating`, so `as_float` is chosen for the consistency.
In a future release, possibly v3, those names may need to be
re-considered for clarity.
2019-04-27 16:45:25 +09:00
ToruNiina
0d623856a7
feat: add value::as_something() for convenience
2019-04-27 16:22:23 +09:00
ToruNiina
01aa2ef5b2
feat: add ctor to value to init with string_view
2019-04-26 16:33:09 +09:00
ToruNiina
e460826084
feat: enable to get a comment related to a value
...
- comment_before(): get comments just before a value.
- comment_inline(): get a comment in the same line as a value.
- comment(): get comment_before() + comment_inline().
2019-04-25 22:32:39 +09:00
ToruNiina
c5b6ee6f81
feat: add yet another constructor to value
...
to make implementation of parse_value easier
2019-04-17 23:43:42 +09:00
ToruNiina
5aebd6b562
fix: restore the back compat of format_error
...
the following code was okay in the last release
```
toml::format_error("[test]", v, "test", {"hint1", "hint2"})
```
but was not okay in the current master. This commit fixes this.
cons: By this, the number of values to show is limited upto 3.
2019-03-20 20:46:22 +09:00
ToruNiina
65c2c3c238
fix: correctly deduce return value of visitor
2019-03-18 10:53:04 +09:00
ToruNiina
891a61a5e3
fix: do not move array element without checking
2019-03-18 02:05:55 +09:00
Toru Niina
d86870e038
Merge pull request #38 from ToruNiina/get-any-type
...
extended conversions
2019-03-17 13:11:59 +09:00
Toru Niina
0908806915
Merge pull request #33 from ToruNiina/is-something
...
add `is_boolean` and other stuffs like that
2019-03-16 23:55:01 +09:00
ToruNiina
04bfeba3f2
merge branch master into get-any-type
2019-03-16 15:58:18 +09:00
ToruNiina
b1b72a94a8
feat: support conversion with external types
2019-03-16 14:44:04 +09:00
ToruNiina
fd063af7ce
refactor: make include guard style uniform
2019-03-16 14:19:47 +09:00
ToruNiina
055353a460
chore: merge branch 'master' into is-something
2019-03-15 17:25:17 +09:00
ToruNiina
61dfa4a2dc
feat: format any number of values into an err msg
...
```cpp
toml::format_error("[error] message", v1, "v1", v2, "v2", ...);
```
2019-03-15 12:38:37 +09:00
ToruNiina
0babe8d589
fix: use format_underline for N regions everywhere
2019-03-14 00:59:10 +09:00
ToruNiina
dc112bd6c1
feat: add is_[boolean|integer|...]() member func
...
it is an alias to is<toml::value_t::[Boolean|Integer|...]>
2019-03-12 20:43:07 +09:00
ToruNiina
d88521d63c
feat: enable to change region of value
...
To allow the following toml file, we need to replace the region after
the more precise region is found.
```toml
[a.b.c]
d = 42
[a]
e = 2.71
```
If the precise region (here, [a]) is found, the region of `a` should be
`[a]`, not `[a.b.c]`. After `[a]` is defined, toml does not allow to
write `[a]` twice. To check it, we need to replace the region of values
to the precise one.
2019-03-04 15:01:28 +09:00
ToruNiina
b36fdf2f54
refactor: remove internal fn not needed any more
...
The function was needed to copy region information from value to value,
for a useful error message. Because of the last few commits, the region
information about keys are passed to insert_nested_keys that requires
the function which is removed. And it turned out that the function is no
longer required. It is originally a workaround, so I removed it.
2019-02-27 01:07:00 +09:00
ToruNiina
41e354f1ee
supress warnings while skipping switch-cases
2019-02-13 13:50:33 +09:00
ToruNiina
64774a8db0
add toml::visit to use it in serializer
2019-02-13 13:36:55 +09:00
ToruNiina
53f6b8268b
fix: compare offset_datetime correctly
2019-02-13 13:34:26 +09:00
ToruNiina
aa67069387
move hints to the internal function
2018-12-27 16:32:20 +09:00
ToruNiina
ee3424ad51
add an extra parameter hints
to format_error
2018-12-27 16:26:23 +09:00