Commit Graph

794 Commits

Author SHA1 Message Date
Jesse Beder
9a3624205e
Update version to 0.6.3. 2019-09-25 09:56:00 -07:00
Andy Maloney
968e0c1f02 Fix shared lib build with new YAML_BUILD_SHARED_LIBS option (#737) 2019-09-14 21:21:35 -04:00
Andy Maloney
b218787b98 Remove extraneous conversion from string -> c_str -> string (#739) 2019-09-14 20:24:17 -04:00
Andy Maloney
db0bda7087 Static analysis fix: replace 0 and NULL with nullptr (#738) 2019-09-14 20:23:22 -04:00
Andy Maloney
6cdf363625 CMake: Prefix options with "YAML" and hide platform-specific options (#734)
* CMake: Prefix options with "YAML" and hide platform-specific options

When including yaml-cpp as a subproject, some option names can conflict with other projects.

(1) Make sure the yaml-cpp options are prefixed with YAML
(2) Hide platform-specific options when possible to avoid cluttering the cmake option list

* Update docs for change from BUILD_SHARED_LIBS to YAML_BUILD_SHARED_LIBS
2019-09-10 10:00:07 -07:00
Andy Maloney
d638508d33 Set C++ standard options in CMake per-target instead of globally (#735)
Setting CMAKE_CXX_STANDARD and CMAKE_CXX_STANDARD_REQUIRED directly is problematic when including yaml-cpp as a subproject.

The proper way is to set these per-target.
2019-09-10 07:51:13 -07:00
Andy Maloney
90350662c9 Use VERSION on the CMake project (#733)
This sets the other variables:

 https://cmake.org/cmake/help/latest/command/project.html
2019-09-10 07:50:10 -07:00
Jeppe Blicher Tarp
e0e01d53c2 Make sure output of NaN, Infinity and -Infinity is identical on all platforms (#717)
Specifically, printing `.nan`, `.inf`, and `-.inf`, respectively, as per the spec section 10.2.1.4.
2019-08-03 21:41:45 -04:00
bedapisl
0122697561 Improve error messages on operator[] or as<> (#656)
Invalid access via operator[] or as<> will now print the offending key, if possible.

For example:

a:
  x: 1
  y: 2

node["a"]["z"].as<int>()

will say that the key "z" was invalid.
2019-04-17 08:44:09 -05:00
Jesse Beder
bd7f8c60c8 Disallow moving for the Parser.
It wouldn't have compiled anyways, since the Scanner and Directive objects inside it are incomplete types at the time of the move definitions.
2019-03-24 17:01:14 -05:00
peterchen-cp
82e9571213 Add MSVC Debugger Visualizer config for YAML::Node (#693) 2019-03-24 16:02:09 -05:00
Ted Lyngmo
0d5c57150c Apply formatting/style tweaks to comply with compile time diagnostics for g++ and clang++ (#686)
* Add compilation flags: -Wshadow -Weffc++ -pedantic -pedantic-errors
* Delete implicit copy & move constructors & assignment operators
  in classes with pointer data members.
* An exception to the above: Add default copy & move constructors &
  assignment operators for the Binary class.
* Convert boolean RegEx operators to binary operators.
* Initialize all members in all classes in ctors.
* Let default ctor delegate to the converting ctor in
  Binary and RegEx
* Don't change any tests except regex_test (as a result of the change
  to binary operators).

Note: https://bugzilla.redhat.com/show_bug.cgi?id=1544675 makes
-Weffc++ report a false positive in "include/yaml-cpp/node/impl.h".
2019-03-13 15:18:34 -07:00
caryoscelus
eca9cfd648 Add optional OnAnchor method to EventHandler (#530)
ref #110
2019-03-12 15:24:32 -07:00
Olli Wang
a2a113c6ff Fix ninja build error. (#677)
NDK now uses ninja for building but yaml-cpp would emit the “ninja: error: build.ninja:326: bad $-escape (literal $ must be written as $$)” error due to syntax error in the generated build.ninja file. Related issue: https://github.com/jbeder/yaml-cpp/issues/630
2019-02-27 14:58:45 -06:00
tt4g
283d06f9f7 Fix warning C4127 on Visual Studio (#672)
Splitting the condition of the if statement containing `constant expression` eliminates warnings in Visual Studio with /W4.
2019-02-13 09:39:59 -06:00
pent0
b87c76a2ef Fix GCC-types flags appended on Clang-cl (#659) 2019-01-06 00:23:52 -06:00
Simon Gene Gottlieb
abf941b20d Fix float precision (#649)
The issue is that numbers like
2.01 or 3.01 can not be precisely represented with binary floating point
numbers.

This replaces all occurrences of 'std::numeric_limits<T>::digits10 + 1' with
'std::numeric_limits<T>::max_digits10'.

Background:
Using 'std::numeric_limits<T>::digits10 + 1' is not precise enough.
Converting a 'float' into a 'string' and back to a 'float' will not always
produce the original 'float' value. To guarantee that the 'string'
representation has sufficient precision the value
'std::numeric_limits<T>::max_digits10' has to be used.
2018-12-21 09:05:19 -05:00
Alexander Anokhin
b659858b19 Some small changes as a result of using a static analyzer (#643)
* Removed an expression which is always true
* The second expression (ch is space) is removed because the first one contains space 0x20
* nextEmptyLine is always false so it is removed from the expression
2018-11-23 11:12:55 -06:00
Joel Frederico
2443da5224 Don't stomp on build flags (#635)
Let CMake handle the default optimizations for various configurations. We don't need to override them. In fact, overriding them makes it impossible for users to override them themselves.
2018-11-19 09:10:10 -06:00
Lassi Hämäläinen
54fc4dadbb Add YAML_CPP_INSTALL option for disabling install target (#624) (#625)
- Option defaults to ON and setting it to OFF, disables install
  target generation
2018-11-18 11:27:15 -06:00
dand-oss
774f25800e fix up static, so works as DLL (#559)
* fix up static, so works as DLL
2018-09-25 10:12:12 -04:00
Florian Eich
ca77ef716e Fix -Wmaybe-uninitialized warning (#600) 2018-09-23 19:40:53 -04:00
Andy Maloney
ee99c4151c Fix a warning from -Wshadow (#627)
Variable "it" was shadowed
2018-09-05 23:16:02 -05:00
Stefan Reinhold
d0da14404e Fix include for std::isspace, fixes #621 (#622) 2018-09-04 08:34:18 -05:00
Stefan Reinhold
45d9035a33 Skip newlines in binary decoding (Fix #387) (#616)
* Skip newlines in binary decoding
This fixes #387

* Skip all whitespace characters

This also removes spaces and tabs in addition to newlines.
2018-09-03 15:55:45 -05:00
Antony Polukhin
b71e672caf Suppress unused variable warning in release builds (#611) 2018-09-03 10:37:47 -05:00
Azamat H. Hackimov
5e79f5eed3 Improvements to CMake buildsystem
Roll-forward of c90c08ccc9 "Revert "Improvements to CMake buildsystem (#563)""

NEW:

* Replace CMAKE_SOURCE_DIR with CMAKE_CURRENT_SOURCE_DIR

Fixes #612 when yaml-cpp is used as a git submodule.

ORIGINAL:

* Move enable_testing() into proper place

* Added CMake's checks for C++11 standards

Raised minimal version of CMake to 3.1, since on old systems there no
decent compilers that supports c++11.

Closes #377.

* Externalize googletest project

Externalize gtest to avoid installation, fixes #539.

* Remove defined cmake_policies

CMP0012 - OLD marked as deprecated for >=cmake-3.1 and will be removed
CMP0015 - does not affect to build process
CMP0042 - already NEW for >=cmake-3.1

Fixes #505

* Fix compiling in Windows MSVC
2018-09-03 10:37:06 -05:00
Jesse Beder
c90c08ccc9 Revert "Improvements to CMake buildsystem (#563)"
This reverts commit 3e33bb3166.

The original commit broke the build (#612) when yaml-cpp is used as a git submodule.
2018-08-09 10:05:07 -05:00
Azamat H. Hackimov
3e33bb3166 Improvements to CMake buildsystem (#563)
* Move enable_testing() into proper place

* Added CMake's checks for C++11 standards

Raised minimal version of CMake to 3.1, since on old systems there no
decent compilers that supports c++11.

Closes #377.

* Externalize googletest project

Externalize gtest to avoid installation, fixes #539.

* Remove defined cmake_policies

CMP0012 - OLD marked as deprecated for >=cmake-3.1 and will be removed
CMP0015 - does not affect to build process
CMP0042 - already NEW for >=cmake-3.1

Fixes #505

* Fix compiling in Windows MSVC
2018-08-09 07:11:50 -05:00
Alexander
1698b47b65 Use nullptr instead of 0 or NULL (clang-tidy warns) (#603) 2018-07-02 23:59:04 -05:00
Alexander Karatarakis
0f9a586ca1 Fix _NOEXCEPT not available in VS2017 15.8. Use noexcept for VS2015+ (#597) 2018-06-30 16:23:28 -05:00
Jiao
4fb1c4b92b Enable items to be removed from a sequence (#582) 2018-05-14 08:50:28 -05:00
Patrick Stotko
ab5f9259a4 Use target-based include_directories to enable modern CMake usage (#583) 2018-05-05 11:03:13 -05:00
Tanki Zhang
124ae47600 Update the iterator implementation for C++17 (#575)
Fix the compiler error which prevents deriving from std::iterator in C++17
2018-04-10 23:47:23 -05:00
maek
f996468a6a Fix UTF-8 code points emitting (#571) 2018-03-24 10:48:39 -05:00
Jesse Beder
562aefc114 Bump CMake version to 0.6.2.
It was incorrectly left at 0.6.0 when 0.6.1 was released, so this needs to be done to make it consistent between the tagged version and the CMake version.
2018-03-05 22:56:23 -06:00
Jamie Snape
5d5bb52ec2 Fix paths in pkg-config file (#556)
pkg-config should be giving absolute paths rather than relative paths.
2018-02-02 09:12:34 -06:00
Jesse Beder
f5d5604a2c Update README. 2018-01-28 10:36:23 -06:00
Jesse Beder
aac4df342b Bump version to 0.6.0. 2018-01-28 10:23:36 -06:00
Guillaume Dumont
4c9e3d87e1 Fix build for shared libraries with MSVC 12 (#380) 2018-01-28 10:20:57 -06:00
Denis Gladkikh
cfb7606a84 Fix tag parsing with () (#532) 2018-01-28 10:18:55 -06:00
Cybel
86ae3a5aa7 Change None in C/C++ source to NoneType. (#545)
* Change None in C/C++ source to NoneType.

Prevent name conflict with X11 None definition.
2017-11-29 13:12:01 -06:00
Matthew Woehlke
752804372c Separate tests and tools
Don't build tests if the confusingly named YAML_CPP_BUILD_TOOLS is ON.
Instead, add a new option that controls only if the tests are built.
(Also, default tests to OFF.)
2017-11-14 08:43:53 -08:00
Ryan Schmidt
3f33f337a7 Only use -Wno-c99-extensions for clang 2017-11-14 07:07:37 -08:00
Matthew Woehlke
5a519a4c6c Fix NullEventHandler overloads
Fix some virtual methods of NullEventHandler that were apparently
intended to overload base class methods, but did not. Add override
keyword to prevent these getting out of sync again.
2017-11-10 15:17:46 -08:00
Matthew Woehlke
58687ee7c4 Add explicit virtual dtor
Add explicit virtual dtor to GraphBuilderInterface. This avoids tripping
a -Wnon-virtual-dtor warning, and also ensures that the correct
(virtual) dtor is called if an instance is deleted via a pointer to the
base type.
2017-11-10 15:17:46 -08:00
Matthew Woehlke
dc9c750efd Avoid absolute install destinations
Remove use of CMAKE_INSTALL_PREFIX when specifying install destinations.
It is preferred that install destinations are specified as relative
paths, not absolute paths. This is also needed to create relocatable
installs, and thus should fix #526.
2017-11-09 18:26:52 -08:00
Matthew Woehlke
d96826f12b Fix Windows library install location
Don't install LIBRARIES on Windows to `bin`; they belong in `lib`. (This
appears to have been done in a mistaken attempt to install the DLL's to
`bin`, which do need to be there, but RUNTIME DESTINATION already takes
care of this.)
2017-11-09 18:26:52 -08:00
Alain Vaucher
46dcdc3ea2 Add missing include directive 2017-11-08 07:08:59 -08:00
Roger Leigh
beb44b872c travis: Exclude linux/clang from the build matrix
The combination of clang++ 3.4 with libstdc++ from GCC 4.6
doesn't work.
2017-08-24 22:49:17 -05:00