Commit Graph

869 Commits

Author SHA1 Message Date
Chen
026a53fbe1
Parse colon in plain scalar correctly when in a flow collection
Fixes #740.
2020-07-02 14:08:14 -05:00
Raffaello Bertini
1c2e767347
Fix YAML::Newline in a sequence or map.
Inside of a sequence or map, `YAML::Newline` wouldn't reset the collection state, which would cause behavior like this:

```
nodeA:   
    k: [{i: 0},
 {i:1},
  ]NodeB:
    k: [{i: 0},
 {i:1},
  ]
```
2020-07-01 22:31:51 -05:00
Chen
3f381f13a0
remove the wrong swap file. (#907) 2020-06-29 08:19:35 -05:00
Chen
08aa252611
Support kinds of emitter format-setting for YAML::Null. (#906)
* Support kinds of emitter format-setting for YAML::Null.

* update the code and test cases

* add the comment //fallthrough
2020-06-28 23:31:53 -05:00
Dekken
27d8a0e302
Refactor to allow MSVC without #define NOMINMAX (#905) 2020-06-27 20:28:24 -05:00
Dekken
97d1ae547c
rm unusued typedef (#901) 2020-06-21 07:58:16 -05:00
Chen
5a9ab177ba
tag_null (#897) 2020-06-17 12:49:09 -05:00
Chen
72fe73a104
fix issue752: generate right long keys (#879)
* fix issue752: generate right long keys

* Improve the readability of test cases

* update to raw string literal
2020-06-17 00:57:28 -05:00
Rosen Penev
a7a7908dc5
[clang-tidy] use auto (#888)
Found with modernize-use-auto

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-16 10:22:14 -05:00
Rosen Penev
0b0bf35c48
[clang-tidy] convert several functions to use references (#894)
Found with performance-unnecessary-value-param

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 17:34:27 -05:00
Rosen Penev
dbb385bdf5
[clang-tidy] use empty method (#895)
Found with readability-container-size-empty

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 17:23:40 -05:00
Rosen Penev
b2cd008717
partially fix clang compilation (#893)
* partially fix clang compilation

Missing header and mistaken algorithm usage.

Also removed it name from range loops. It's not correct.

Signed-off-by: Rosen Penev <rosenp@gmail.com>

* run through clang's -Wrange-loop-analysis

Some range loops should not use references as they need to copy.

Signed-off-by: Rosen Penev <rosenp@gmail.com>

* manual range loop conversions

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 16:59:27 -05:00
Rosen Penev
6387cbc0ca
[clang-tidy] use braced initialization list (#883)
Found with modernize-return-braced-init-list

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 15:41:14 -05:00
Rosen Penev
1bf9540a7d
[clang-tidy] fix inconsistent declaration (#884)
Found with readability-inconsistent-declaration-parameter-name

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 15:39:04 -05:00
Rosen Penev
4c90f2962e
[clang-tidy] use bool literals (#881)
Found with modernize-use-bool-literals

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 15:30:37 -05:00
Rosen Penev
4f6d0733c9
[clang-tidy] use raw strings for easier readability (#882)
Found with modernize-raw-string-literal

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 15:29:38 -05:00
Rosen Penev
f05947ae59
[clang-tidy] use emplace_back (#880)
Found with modernize-use-emplace

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 15:28:19 -05:00
Rosen Penev
66171449d4
[clang-tidy] replace typedef with using (#886)
Found with modernize-use-using

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 15:27:08 -05:00
Rosen Penev
33c9f6e062
[clang-tidy] use override (#885)
Found with modernize-use-override

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 15:20:22 -05:00
Rosen Penev
7e4f290ef9
[clang-tidy] use = default (#887)
Found with modernize-use-equals-default

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 15:19:21 -05:00
Rosen Penev
ae811c3d86
[clang-tidy] convert to range loops (#889)
Found with modernize-loop-convert

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 15:17:50 -05:00
Rosen Penev
41001d1bf9
manual algorithm conversions (#891)
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 15:10:09 -05:00
Rosen Penev
a808c1f44a
[clang-tidy] do not use return after else (#892)
Found with readability-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-15 15:09:29 -05:00
Chen
4dbfeb0bbc
Support as<uint8_t>/as<int8_t>.
Fix issue 844/848.
2020-06-15 10:31:59 -05:00
Chen
33316d531b
Add tests for some interfaces of emitter (#875) 2020-05-31 09:16:16 -05:00
Josh Soref
6701275f19
Spelling (#870)
* spelling: differently

* spelling: irrelevant

* spelling: specified
2020-05-25 09:30:55 -05:00
Hans-Peter Gygax
cb7bb9821d
Change CMakeLists to honor option "MSVC shared Runtimes" (#867) 2020-05-24 12:55:52 -05:00
Raúl Gutiérrez Segalés
f05b2577ad
Fix crash when parsing {x: (#865) 2020-05-23 12:17:20 -05:00
Chen
d9c35b6079
Throw an exception when trying to parse a negative number as an unsigned.
Fixing issue 859.
2020-05-19 11:48:22 -05:00
Chen
4b98aedc16
Supplement test cases for 2.19 ~ 2.22 schema tags. (#857)
Add test cases for the event handler for schema tags; does not include test cases for Node because specialized tag handling is not implemented yet.
2020-05-12 13:20:45 -05:00
Ted Lyngmo
a98b8af448
Add filename to the BadFile exception (#858)
The BadFile exception which is thrown when failing to open a file now
contains the filename.
2020-05-07 14:46:28 -05:00
Ian Taylor
9fb5153487
implement convert for standard library containers allowing for custom allocators (#855) 2020-04-29 18:29:33 -05:00
deflinhec
513ee81fbf
Make debug postfix optional (#856)
Library debug postfix might not be suitable for cross platform project, and usually require extra work of link against prebuilt yaml-cpp.

Generally, Xcode project output library to these directories:
    Debug
    Release
    Debug-iphoneos
    Release-iphoneos
    Debug-iphonesimulator
    Release-iphonesimulator

Another Xcode project usually configured its build setting as follow, and expects library name to be same between Release and Debug
    LIBRARY_SEARCH_PATHS=$(CONFIGURATION)$(EFFECT_PLATFORM_NAME)
    OTHER_LDFLAGS= $(inherited) -lyaml-cpp
2020-04-29 09:58:05 -05:00
Ian Taylor
9f2781b527
Fix clang format (#854)
Fix invocation of clang-format in CMakeLists and apply clang-format.
2020-04-29 09:40:33 -05:00
Martin Delille
7083db28b3
Add Qt wrapper gist (#853)
Add Qt wrapper gist to README as a third party contribution
2020-04-26 16:53:02 -05:00
Jesse Beder
2f00649291 Set theme jekyll-theme-slate 2020-04-24 14:22:43 -05:00
Martin Delille
b35f2a86a6
Rename "Home" to "index" in the doc (#851)
This will allow hosting as Github Pages.
2020-04-24 14:21:17 -05:00
Martin Delille
99222fc938
Include wiki content into a doc folder (#850)
* Copied Tutorial from Google Code wiki.

* Initial Home page

* Copied How To Parse A Document from Google Code wiki

* Updated How To Parse A Document (markdown)

* Updated How To Parse A Document (markdown)

* Updated How To Parse A Document (Old API) (markdown)

* Copied How To Emit YAML from Google Code wiki

* Copied Breaking Changes from Google Code wiki

* Copied Strings from Google Code wiki

* Updated Strings (markdown)

* Updated Home (markdown)

* Fix typo.

* Updated Breaking Changes (markdown)

* Updated How To Parse A Document (Old API) (markdown)

* Updated Breaking Changes (markdown)

* Move wiki content to docs/

* Improve markdown and add colored code syntax

Co-authored-by: Jesse Beder <jbeder+github@gmail.com>
2020-04-23 15:08:27 -05:00
Alan Griffiths
4edff1fa5d
Fix stack overflow (#807)
Fix stack overflow in HandleNode by explicitly limiting the depth of recursion.
2020-04-09 13:02:10 -05:00
Tindy X
70205f5d88
Fix 'comparison object must be invocable as const' (#846) 2020-04-09 09:38:02 -05:00
Jesse Beder
9b8f35093e
Update travis config to use updated versions of OS and compilers. (#845)
This fixes the linux/gcc error building Google Test with gcc 4.7:

https://travis-ci.org/github/jbeder/yaml-cpp/jobs/668233706
2020-04-07 22:46:47 -05:00
Ted Lyngmo
1d8542ad32
Add NodeTest EqualRepresentationAfterMoveAssignment (#816)
Add check that a move assigned Node gets the same representation as the
moved-from Node had before the move.
2020-04-07 20:08:56 -05:00
Maxim Okhotskiy
6f7ead5171
Maintain order of nodes in sequences (#668) 2020-04-07 11:46:34 -05:00
Victor Mataré
cf93f4c57b
Pass a mark to BadSubscript exception (#843)
It's clearly related to an existing node, so it can have a mark and give
an error location.
2020-04-07 11:33:16 -05:00
Romain Deterre
26faac387c
Remove uses of std::iterator (deprecated in C++17) (#839) 2020-03-29 17:53:55 -05:00
Romain Deterre
120863ba5a
Update Google Test to v1.10.0 (#840)
This commit updates the version of Google Test from 1.8 to 1.10.
2020-03-28 19:53:13 -05:00
Dekken
b2f89386d8
Split conversion call that uses std::signbit with unsupported parameters with enable_if (#824) 2020-03-11 08:59:16 -05:00
Néstor Subirón
1bfbd2be4c
Allow including yaml-cpp as system headers (#829) 2020-02-29 22:27:16 -06:00
Anton Onishchenko
de8253fcb0
Fix storing inf and NaN (#817) 2020-02-14 18:03:21 -06:00
JeffWegher
29dcf92f87
Fix Node::size() after removing node from sequence (#820) 2020-02-14 14:38:58 -06:00