summaryrefslogtreecommitdiff
path: root/src/third_party
diff options
context:
space:
mode:
authorMathew Robinson <chasinglogic@gmail.com>2018-11-07 11:55:44 -0500
committerMathew Robinson <chasinglogic@gmail.com>2019-06-07 14:14:55 -0400
commit7af2d686f401c70676e84e1a65c84ec7a13409ed (patch)
tree7a1f49833831f523ad585292923a2cba563461da /src/third_party
parent7a92a3a86cd055861040e5a183469cb0335f92fb (diff)
downloadmongo-7af2d686f401c70676e84e1a65c84ec7a13409ed.tar.gz
SERVER-37984 Upgrade yaml-cpp to 0.6.2
(cherry picked from commit efea6a2c614627152ada31468462033ec0f7ffed)
Diffstat (limited to 'src/third_party')
-rw-r--r--src/third_party/SConscript2
-rwxr-xr-x[-rw-r--r--]src/third_party/scripts/yaml-cpp_get_sources.sh8
-rw-r--r--src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/iterator.h65
-rw-r--r--src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/parse.h30
-rw-r--r--src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/parser.h48
-rw-r--r--src/third_party/yaml-cpp-0.5.3/src/null.cpp5
-rw-r--r--src/third_party/yaml-cpp-0.5.3/src/ptr_stack.h53
-rw-r--r--src/third_party/yaml-cpp-0.6.2/.clang-format (renamed from src/third_party/yaml-cpp-0.5.3/.clang-format)2
-rw-r--r--src/third_party/yaml-cpp-0.6.2/.codedocs50
-rw-r--r--src/third_party/yaml-cpp-0.6.2/.gitignore (renamed from src/third_party/yaml-cpp-0.5.3/.gitignore)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/.travis.yml28
-rw-r--r--src/third_party/yaml-cpp-0.6.2/CONTRIBUTING.md (renamed from src/third_party/yaml-cpp-0.5.3/CONTRIBUTING.md)11
-rw-r--r--src/third_party/yaml-cpp-0.6.2/LICENSE (renamed from src/third_party/yaml-cpp-0.5.3/LICENSE)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/README.md (renamed from src/third_party/yaml-cpp-0.5.3/README.md)9
-rw-r--r--src/third_party/yaml-cpp-0.6.2/SConscript (renamed from src/third_party/yaml-cpp-0.5.3/SConscript)1
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/anchor.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/anchor.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/binary.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/binary.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/contrib/anchordict.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/contrib/anchordict.h)12
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/contrib/graphbuilder.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/contrib/graphbuilder.h)2
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/dll.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/dll.h)16
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emitfromevents.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emitfromevents.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emitter.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emitter.h)6
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emitterdef.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emitterdef.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emittermanip.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emittermanip.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emitterstyle.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emitterstyle.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/eventhandler.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/eventhandler.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/exceptions.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/exceptions.h)74
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/mark.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/mark.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/convert.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/convert.h)42
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/bool_type.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/bool_type.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/impl.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/impl.h)20
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/iterator.h92
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/iterator_fwd.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/iterator_fwd.h)1
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/memory.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/memory.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/node.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/node.h)15
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/node_data.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/node_data.h)8
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/node_iterator.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/node_iterator.h)57
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/node_ref.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/node_ref.h)5
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/emit.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/emit.h)9
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/impl.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/impl.h)6
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/iterator.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/iterator.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/node.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/node.h)2
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/parse.h78
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/ptr.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/ptr.h)12
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/type.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/type.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/noncopyable.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/noncopyable.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/null.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/null.h)2
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/ostream_wrapper.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/ostream_wrapper.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/parser.h86
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/stlemitter.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/stlemitter.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/traits.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/traits.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/yaml.h (renamed from src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/yaml.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/install.txt (renamed from src/third_party/yaml-cpp-0.5.3/install.txt)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/binary.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/binary.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/collectionstack.h (renamed from src/third_party/yaml-cpp-0.5.3/src/collectionstack.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/contrib/graphbuilder.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/contrib/graphbuilder.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/contrib/graphbuilderadapter.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/contrib/graphbuilderadapter.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/contrib/graphbuilderadapter.h (renamed from src/third_party/yaml-cpp-0.5.3/src/contrib/graphbuilderadapter.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/convert.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/convert.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/directives.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/directives.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/directives.h (renamed from src/third_party/yaml-cpp-0.5.3/src/directives.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/emit.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/emit.cpp)2
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/emitfromevents.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/emitfromevents.cpp)2
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/emitter.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/emitter.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/emitterstate.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/emitterstate.cpp)83
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/emitterstate.h (renamed from src/third_party/yaml-cpp-0.5.3/src/emitterstate.h)30
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/emitterutils.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/emitterutils.cpp)13
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/emitterutils.h (renamed from src/third_party/yaml-cpp-0.5.3/src/emitterutils.h)4
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/exceptions.cpp31
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/exp.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/exp.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/exp.h (renamed from src/third_party/yaml-cpp-0.5.3/src/exp.h)21
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/indentation.h (renamed from src/third_party/yaml-cpp-0.5.3/src/indentation.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/memory.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/memory.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/node.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/node.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/node_data.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/node_data.cpp)13
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/nodebuilder.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/nodebuilder.cpp)5
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/nodebuilder.h (renamed from src/third_party/yaml-cpp-0.5.3/src/nodebuilder.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/nodeevents.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/nodeevents.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/nodeevents.h (renamed from src/third_party/yaml-cpp-0.5.3/src/nodeevents.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/null.cpp10
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/ostream_wrapper.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/ostream_wrapper.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/parse.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/parse.cpp)14
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/parser.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/parser.cpp)49
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/ptr_vector.h (renamed from src/third_party/yaml-cpp-0.5.3/src/ptr_vector.h)20
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/regex_yaml.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/regex_yaml.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/regex_yaml.h (renamed from src/third_party/yaml-cpp-0.5.3/src/regex_yaml.h)12
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/regeximpl.h (renamed from src/third_party/yaml-cpp-0.5.3/src/regeximpl.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/scanner.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/scanner.cpp)170
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/scanner.h (renamed from src/third_party/yaml-cpp-0.5.3/src/scanner.h)59
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/scanscalar.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/scanscalar.cpp)85
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/scanscalar.h (renamed from src/third_party/yaml-cpp-0.5.3/src/scanscalar.h)6
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/scantag.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/scantag.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/scantag.h (renamed from src/third_party/yaml-cpp-0.5.3/src/scantag.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/scantoken.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/scantoken.cpp)7
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/setting.h (renamed from src/third_party/yaml-cpp-0.5.3/src/setting.h)24
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/simplekey.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/simplekey.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/singledocparser.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/singledocparser.cpp)3
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/singledocparser.h (renamed from src/third_party/yaml-cpp-0.5.3/src/singledocparser.h)2
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/stream.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/stream.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/stream.h (renamed from src/third_party/yaml-cpp-0.5.3/src/stream.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/streamcharsource.h (renamed from src/third_party/yaml-cpp-0.5.3/src/streamcharsource.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/stringsource.h (renamed from src/third_party/yaml-cpp-0.5.3/src/stringsource.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/tag.cpp (renamed from src/third_party/yaml-cpp-0.5.3/src/tag.cpp)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/tag.h (renamed from src/third_party/yaml-cpp-0.5.3/src/tag.h)0
-rw-r--r--src/third_party/yaml-cpp-0.6.2/src/token.h (renamed from src/third_party/yaml-cpp-0.5.3/src/token.h)0
105 files changed, 961 insertions, 561 deletions
diff --git a/src/third_party/SConscript b/src/third_party/SConscript
index 02f26cbc412..cd62604ec0b 100644
--- a/src/third_party/SConscript
+++ b/src/third_party/SConscript
@@ -10,7 +10,7 @@ snappySuffix = '-1.1.3'
zlibSuffix = '-1.2.11'
pcreSuffix = "-8.41"
mozjsSuffix = '-45'
-yamlSuffix = '-0.5.3'
+yamlSuffix = '-0.6.2'
icuSuffix = '-57.1'
gperftoolsSuffix = '-2.5'
timelibSuffix = '-2017.05'
diff --git a/src/third_party/scripts/yaml-cpp_get_sources.sh b/src/third_party/scripts/yaml-cpp_get_sources.sh
index 37d6cf8bfb6..63e8fe13e65 100644..100755
--- a/src/third_party/scripts/yaml-cpp_get_sources.sh
+++ b/src/third_party/scripts/yaml-cpp_get_sources.sh
@@ -7,13 +7,13 @@ set -o errexit
# Yaml-cpp does not use any autotools/cmake/config system to it is a simple import.
# This script is designed to run on Linux or Mac OS X
#
-# Yaml-cpp tarballs use the name "yaml-cpp-release" so we need to rename it
+# Yaml-cpp tarballs use the name "yaml-cpp-yaml-cpp-$VERSION" so we need to rename it
#
-VERSION=0.5.3
+VERSION=0.6.2
NAME=yaml-cpp
-TARBALL=release-$VERSION.tar.gz
-TARBALL_DEST_DIR=$NAME-release-$VERSION
+TARBALL=$NAME-$VERSION.tar.gz
+TARBALL_DEST_DIR=$NAME-$NAME-$VERSION
DEST_DIR=`git rev-parse --show-toplevel`/src/third_party/$NAME-$VERSION
if [ ! -f $TARBALL ]; then
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/iterator.h b/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/iterator.h
deleted file mode 100644
index 2c701af5fae..00000000000
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/iterator.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66
-#define VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66
-
-#if defined(_MSC_VER) || \
- (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
- (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
-#pragma once
-#endif
-
-#include "yaml-cpp/dll.h"
-#include "yaml-cpp/node/ptr.h"
-#include "yaml-cpp/node/detail/node_iterator.h"
-#include <boost/iterator/iterator_adaptor.hpp>
-#include <boost/utility.hpp>
-
-namespace YAML {
-namespace detail {
-struct iterator_value;
-
-template <typename V>
-class iterator_base
- : public boost::iterator_adaptor<iterator_base<V>, node_iterator, V,
- std::forward_iterator_tag, V> {
- private:
- template <typename>
- friend class iterator_base;
- struct enabler {};
- typedef typename iterator_base::base_type base_type;
-
- public:
- typedef typename iterator_base::value_type value_type;
-
- public:
- iterator_base() {}
- explicit iterator_base(base_type rhs, shared_memory_holder pMemory)
- : iterator_base::iterator_adaptor_(rhs), m_pMemory(pMemory) {}
-
- template <class W>
- iterator_base(const iterator_base<W>& rhs,
- typename boost::enable_if<boost::is_convertible<W*, V*>,
- enabler>::type = enabler())
- : iterator_base::iterator_adaptor_(rhs.base()),
- m_pMemory(rhs.m_pMemory) {}
-
- private:
- friend class boost::iterator_core_access;
-
- void increment() { this->base_reference() = boost::next(this->base()); }
-
- value_type dereference() const {
- const typename base_type::value_type& v = *this->base();
- if (v.pNode)
- return value_type(Node(*v, m_pMemory));
- if (v.first && v.second)
- return value_type(Node(*v.first, m_pMemory), Node(*v.second, m_pMemory));
- return value_type();
- }
-
- private:
- shared_memory_holder m_pMemory;
-};
-}
-}
-
-#endif // VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/parse.h b/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/parse.h
deleted file mode 100644
index 0ea4948d165..00000000000
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/parse.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
-#define VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
-
-#if defined(_MSC_VER) || \
- (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
- (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
-#pragma once
-#endif
-
-#include <iosfwd>
-#include <string>
-#include <vector>
-
-#include "yaml-cpp/dll.h"
-
-namespace YAML {
-class Node;
-
-YAML_CPP_API Node Load(const std::string& input);
-YAML_CPP_API Node Load(const char* input);
-YAML_CPP_API Node Load(std::istream& input);
-YAML_CPP_API Node LoadFile(const std::string& filename);
-
-YAML_CPP_API std::vector<Node> LoadAll(const std::string& input);
-YAML_CPP_API std::vector<Node> LoadAll(const char* input);
-YAML_CPP_API std::vector<Node> LoadAll(std::istream& input);
-YAML_CPP_API std::vector<Node> LoadAllFromFile(const std::string& filename);
-}
-
-#endif // VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/parser.h b/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/parser.h
deleted file mode 100644
index 24880e4faf0..00000000000
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/parser.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
-#define PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
-
-#if defined(_MSC_VER) || \
- (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
- (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
-#pragma once
-#endif
-
-#include <ios>
-#include <memory>
-
-#include "yaml-cpp/dll.h"
-#include "yaml-cpp/noncopyable.h"
-
-namespace YAML {
-class EventHandler;
-class Node;
-class Scanner;
-struct Directives;
-struct Token;
-
-class YAML_CPP_API Parser : private noncopyable {
- public:
- Parser();
- Parser(std::istream& in);
- ~Parser();
-
- operator bool() const;
-
- void Load(std::istream& in);
- bool HandleNextDocument(EventHandler& eventHandler);
-
- void PrintTokens(std::ostream& out);
-
- private:
- void ParseDirectives();
- void HandleDirective(const Token& token);
- void HandleYamlDirective(const Token& token);
- void HandleTagDirective(const Token& token);
-
- private:
- std::auto_ptr<Scanner> m_pScanner;
- std::auto_ptr<Directives> m_pDirectives;
-};
-}
-
-#endif // PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/src/third_party/yaml-cpp-0.5.3/src/null.cpp b/src/third_party/yaml-cpp-0.5.3/src/null.cpp
deleted file mode 100644
index 1b24b70daf3..00000000000
--- a/src/third_party/yaml-cpp-0.5.3/src/null.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-#include "yaml-cpp/null.h"
-
-namespace YAML {
-_Null Null;
-}
diff --git a/src/third_party/yaml-cpp-0.5.3/src/ptr_stack.h b/src/third_party/yaml-cpp-0.5.3/src/ptr_stack.h
deleted file mode 100644
index f378ffc181e..00000000000
--- a/src/third_party/yaml-cpp-0.5.3/src/ptr_stack.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef PTR_STACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66
-#define PTR_STACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66
-
-#if defined(_MSC_VER) || \
- (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
- (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
-#pragma once
-#endif
-
-#include <cstddef>
-#include <cstdlib>
-#include <memory>
-#include <vector>
-
-#include "yaml-cpp/noncopyable.h"
-
-template <typename T>
-class ptr_stack : private YAML::noncopyable {
- public:
- ptr_stack() {}
- ~ptr_stack() { clear(); }
-
- void clear() {
- for (std::size_t i = 0; i < m_data.size(); i++)
- delete m_data[i];
- m_data.clear();
- }
-
- std::size_t size() const { return m_data.size(); }
- bool empty() const { return m_data.empty(); }
-
- void push(std::auto_ptr<T> t) {
- m_data.push_back(NULL);
- m_data.back() = t.release();
- }
- std::auto_ptr<T> pop() {
- std::auto_ptr<T> t(m_data.back());
- m_data.pop_back();
- return t;
- }
- T& top() { return *m_data.back(); }
- const T& top() const { return *m_data.back(); }
-
- T& top(std::ptrdiff_t diff) { return **(m_data.end() - 1 + diff); }
- const T& top(std::ptrdiff_t diff) const {
- return **(m_data.end() - 1 + diff);
- }
-
- private:
- std::vector<T*> m_data;
-};
-
-#endif // PTR_STACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/src/third_party/yaml-cpp-0.5.3/.clang-format b/src/third_party/yaml-cpp-0.6.2/.clang-format
index d6e1b22f09a..d6d46fb4165 100644
--- a/src/third_party/yaml-cpp-0.5.3/.clang-format
+++ b/src/third_party/yaml-cpp-0.6.2/.clang-format
@@ -30,7 +30,7 @@ PenaltyReturnTypeOnItsOwnLine: 200
PointerBindsToType: true
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: true
-Standard: Auto
+Standard: Cpp11
IndentWidth: 2
TabWidth: 8
UseTab: Never
diff --git a/src/third_party/yaml-cpp-0.6.2/.codedocs b/src/third_party/yaml-cpp-0.6.2/.codedocs
new file mode 100644
index 00000000000..02e438213a7
--- /dev/null
+++ b/src/third_party/yaml-cpp-0.6.2/.codedocs
@@ -0,0 +1,50 @@
+# CodeDocs.xyz Configuration File
+
+# Optional project name, if left empty the GitHub repository name will be used.
+PROJECT_NAME =
+
+# One or more directories and files that contain example code to be included.
+EXAMPLE_PATH =
+
+# One or more directories and files to exclude from documentation generation.
+# Use relative paths with respect to the repository root directory.
+EXCLUDE = test/gtest-1.8.0/
+
+# One or more wildcard patterns to exclude files and directories from document
+# generation.
+EXCLUDE_PATTERNS =
+
+# One or more symbols to exclude from document generation. Symbols can be
+# namespaces, classes, or functions.
+EXCLUDE_SYMBOLS =
+
+# Override the default parser (language) used for each file extension.
+EXTENSION_MAPPING =
+
+# Set the wildcard patterns used to filter out the source-files.
+# If left blank the default is:
+# *.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl,
+# *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php,
+# *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox, *.py,
+# *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
+FILE_PATTERNS =
+
+# Hide undocumented class members.
+HIDE_UNDOC_MEMBERS =
+
+# Hide undocumented classes.
+HIDE_UNDOC_CLASSES =
+
+# Specify a markdown page whose contents should be used as the main page
+# (index.html). This will override a page marked as \mainpage. For example, a
+# README.md file usually serves as a useful main page.
+USE_MDFILE_AS_MAINPAGE = README.md
+
+# Specify external repository to link documentation with.
+# This is similar to Doxygen's TAGFILES option, but will automatically link to
+# tags of other repositories already using CodeDocs. List each repository to
+# link with by giving its location in the form of owner/repository.
+# For example:
+# TAGLINKS = doxygen/doxygen CodeDocs/osg
+# Note: these repositories must already be built on CodeDocs.
+TAGLINKS =
diff --git a/src/third_party/yaml-cpp-0.5.3/.gitignore b/src/third_party/yaml-cpp-0.6.2/.gitignore
index 567609b1234..567609b1234 100644
--- a/src/third_party/yaml-cpp-0.5.3/.gitignore
+++ b/src/third_party/yaml-cpp-0.6.2/.gitignore
diff --git a/src/third_party/yaml-cpp-0.6.2/.travis.yml b/src/third_party/yaml-cpp-0.6.2/.travis.yml
new file mode 100644
index 00000000000..d0b6a04efec
--- /dev/null
+++ b/src/third_party/yaml-cpp-0.6.2/.travis.yml
@@ -0,0 +1,28 @@
+language: c++
+os:
+ - linux
+ - osx
+compiler:
+ - clang
+ - gcc
+before_install:
+ - |
+ if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
+ sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y \
+ && sudo apt-get update -qq \
+ && if [ "$CXX" == "g++" ]; then
+ sudo apt-get install -qq g++-4.7 && export CXX="g++-4.7" CC="gcc-4.7"
+ fi
+ fi
+before_script:
+ - mkdir build
+ - cd build
+ - cmake ..
+script:
+ - make
+ - test/run-tests
+
+matrix:
+ exclude:
+ - os: linux
+ compiler: clang
diff --git a/src/third_party/yaml-cpp-0.5.3/CONTRIBUTING.md b/src/third_party/yaml-cpp-0.6.2/CONTRIBUTING.md
index 41f50dc688b..cd09a1aca80 100644
--- a/src/third_party/yaml-cpp-0.5.3/CONTRIBUTING.md
+++ b/src/third_party/yaml-cpp-0.6.2/CONTRIBUTING.md
@@ -2,9 +2,18 @@
This project is formatted with [clang-format][fmt] using the style file at the root of the repository. Please run clang-format before sending a pull request.
-In general, try to follow the style of surrounding code.
+In general, try to follow the style of surrounding code. We mostly follow the [Google C++ style guide][cpp-style].
+
+Commit messages should be in the imperative mood, as described in the [Git contributing file][git-contrib]:
+
+> Describe your changes in imperative mood, e.g. "make xyzzy do frotz"
+> instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy
+> to do frotz", as if you are giving orders to the codebase to change
+> its behaviour.
[fmt]: http://clang.llvm.org/docs/ClangFormat.html
+[cpp-style]: https://google.github.io/styleguide/cppguide.html
+[git-contrib]: http://git.kernel.org/cgit/git/git.git/tree/Documentation/SubmittingPatches?id=HEAD
# Tests
diff --git a/src/third_party/yaml-cpp-0.5.3/LICENSE b/src/third_party/yaml-cpp-0.6.2/LICENSE
index 991fdbbe7d3..991fdbbe7d3 100644
--- a/src/third_party/yaml-cpp-0.5.3/LICENSE
+++ b/src/third_party/yaml-cpp-0.6.2/LICENSE
diff --git a/src/third_party/yaml-cpp-0.5.3/README.md b/src/third_party/yaml-cpp-0.6.2/README.md
index 54263ef3b96..f33d3503a15 100644
--- a/src/third_party/yaml-cpp-0.5.3/README.md
+++ b/src/third_party/yaml-cpp-0.6.2/README.md
@@ -1,13 +1,12 @@
-# yaml-cpp
+# yaml-cpp [![Build Status](https://travis-ci.org/jbeder/yaml-cpp.svg?branch=master)](https://travis-ci.org/jbeder/yaml-cpp) [![Documentation](https://codedocs.xyz/jbeder/yaml-cpp.svg)](https://codedocs.xyz/jbeder/yaml-cpp/)
yaml-cpp is a [YAML](http://www.yaml.org/) parser and emitter in C++ matching the [YAML 1.2 spec](http://www.yaml.org/spec/1.2/spec.html).
To get a feel for how it can be used, see the [Tutorial](https://github.com/jbeder/yaml-cpp/wiki/Tutorial) or [How to Emit YAML](https://github.com/jbeder/yaml-cpp/wiki/How-To-Emit-YAML). For the old API (version < 0.5.0), see [How To Parse A Document](https://github.com/jbeder/yaml-cpp/wiki/How-To-Parse-A-Document-(Old-API)).
-
# Problems? #
-If you find a bug, post an [issue](https://github.com/jbeder/yaml-cpp/issues)! If you have questions about how to use yaml-cpp, please post it on http://stackoverflow.com and tag it `yaml-cpp`.
+If you find a bug, post an [issue](https://github.com/jbeder/yaml-cpp/issues)! If you have questions about how to use yaml-cpp, please post it on http://stackoverflow.com and tag it [`yaml-cpp`](http://stackoverflow.com/questions/tagged/yaml-cpp).
# How to Build #
@@ -31,7 +30,7 @@ cmake [-G generator] [-DBUILD_SHARED_LIBS=ON|OFF] ..
```
* The `generator` is whatever type of build system you'd like to use. To see a full list of generators on your platform, just run `cmake` (with no arguments). For example:
- * On Windows, you might use "Visual Studio 12 2013" to generate a Visual Studio 2013 solution
+ * On Windows, you might use "Visual Studio 12 2013" to generate a Visual Studio 2013 solution or "Visual Studio 14 2015 Win64" to generate a 64-bit Visual Studio 2015 solution.
* On OS X, you might use "Xcode" to generate an Xcode project
* On a UNIX-y system, simply omit the option to generate a makefile
@@ -45,7 +44,7 @@ cmake [-G generator] [-DBUILD_SHARED_LIBS=ON|OFF] ..
# Recent Release #
-[yaml-cpp 0.5.2](https://github.com/jbeder/yaml-cpp/releases/tag/release-0.5.2) has been released! This is a bug fix release.
+[yaml-cpp 0.6.0](https://github.com/jbeder/yaml-cpp/releases/tag/yaml-cpp-0.6.0) has been released! This release requires C++11, and no longer depends on Boost.
[yaml-cpp 0.3.0](https://github.com/jbeder/yaml-cpp/releases/tag/release-0.3.0) is still available if you want the old API.
diff --git a/src/third_party/yaml-cpp-0.5.3/SConscript b/src/third_party/yaml-cpp-0.6.2/SConscript
index 181d2ead9eb..c147f5a54e4 100644
--- a/src/third_party/yaml-cpp-0.5.3/SConscript
+++ b/src/third_party/yaml-cpp-0.6.2/SConscript
@@ -21,6 +21,7 @@ env.Library("yaml",
"src/emitter.cpp",
"src/emitterstate.cpp",
"src/emitterutils.cpp",
+ "src/exceptions.cpp",
"src/exp.cpp",
"src/memory.cpp",
"src/node.cpp",
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/anchor.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/anchor.h
index 06759c724d2..06759c724d2 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/anchor.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/anchor.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/binary.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/binary.h
index 29d5dbd027a..29d5dbd027a 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/binary.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/binary.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/contrib/anchordict.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/contrib/anchordict.h
index b4677e23fcb..78db9ec9288 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/contrib/anchordict.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/contrib/anchordict.h
@@ -12,11 +12,13 @@
#include "../anchor.h"
namespace YAML {
-/// AnchorDict
-/// . An object that stores and retrieves values correlating to anchor_t
-/// values.
-/// . Efficient implementation that can make assumptions about how anchor_t
-/// values are assigned by the Parser class.
+/**
+ * An object that stores and retrieves values correlating to {@link anchor_t}
+ * values.
+ *
+ * <p>Efficient implementation that can make assumptions about how
+ * {@code anchor_t} values are assigned by the {@link Parser} class.
+ */
template <class T>
class AnchorDict {
public:
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/contrib/graphbuilder.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/contrib/graphbuilder.h
index 7c2159b4659..f0a38f28873 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/contrib/graphbuilder.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/contrib/graphbuilder.h
@@ -19,6 +19,8 @@ class Parser;
// functions.
class GraphBuilderInterface {
public:
+ virtual ~GraphBuilderInterface() = 0;
+
// Create and return a new node with a null value.
virtual void *NewNull(const Mark &mark, void *pParentNode) = 0;
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/dll.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/dll.h
index 827e0f1ea70..a32c06b2e30 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/dll.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/dll.h
@@ -8,16 +8,12 @@
#endif
// The following ifdef block is the standard way of creating macros which make
-// exporting
-// from a DLL simpler. All files within this DLL are compiled with the
-// yaml_cpp_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any
-// project
-// that uses this DLL. This way any other project whose source files include
-// this file see
-// YAML_CPP_API functions as being imported from a DLL, whereas this DLL sees
-// symbols
-// defined with this macro as being exported.
+// exporting from a DLL simpler. All files within this DLL are compiled with the
+// yaml_cpp_EXPORTS symbol defined on the command line. This symbol should not
+// be defined on any project that uses this DLL. This way any other project
+// whose source files include this file see YAML_CPP_API functions as being
+// imported from a DLL, whereas this DLL sees symbols defined with this macro as
+// being exported.
#undef YAML_CPP_API
#ifdef YAML_CPP_DLL // Using or Building YAML-CPP DLL (definition defined
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emitfromevents.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emitfromevents.h
index f14b051ab0e..f14b051ab0e 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emitfromevents.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emitfromevents.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emitter.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emitter.h
index cc49659c59e..ef92cc4035b 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emitter.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emitter.h
@@ -122,7 +122,7 @@ class YAML_CPP_API Emitter : private noncopyable {
bool CanEmitNewline() const;
private:
- std::auto_ptr<EmitterState> m_pState;
+ std::unique_ptr<EmitterState> m_pState;
ostream_wrapper m_stream;
};
@@ -162,12 +162,12 @@ inline Emitter& Emitter::WriteStreamable(T value) {
template <>
inline void Emitter::SetStreamablePrecision<float>(std::stringstream& stream) {
- stream.precision(GetFloatPrecision());
+ stream.precision(static_cast<std::streamsize>(GetFloatPrecision()));
}
template <>
inline void Emitter::SetStreamablePrecision<double>(std::stringstream& stream) {
- stream.precision(GetDoublePrecision());
+ stream.precision(static_cast<std::streamsize>(GetDoublePrecision()));
}
// overloads of insertion
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emitterdef.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emitterdef.h
index 0b426957fae..0b426957fae 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emitterdef.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emitterdef.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emittermanip.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emittermanip.h
index 89f7256714e..89f7256714e 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emittermanip.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emittermanip.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emitterstyle.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emitterstyle.h
index 67bb3981b12..67bb3981b12 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/emitterstyle.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/emitterstyle.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/eventhandler.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/eventhandler.h
index efe381c6218..efe381c6218 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/eventhandler.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/eventhandler.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/exceptions.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/exceptions.h
index 285fc33e8af..9c96859b2c9 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/exceptions.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/exceptions.h
@@ -9,9 +9,17 @@
#include "yaml-cpp/mark.h"
#include "yaml-cpp/traits.h"
+#include <sstream>
#include <stdexcept>
#include <string>
-#include <sstream>
+
+// This is here for compatibility with older versions of Visual Studio
+// which don't support noexcept
+#ifdef _MSC_VER
+ #define YAML_CPP_NOEXCEPT _NOEXCEPT
+#else
+ #define YAML_CPP_NOEXCEPT noexcept
+#endif
namespace YAML {
// error messages
@@ -89,7 +97,7 @@ const char* const BAD_FILE = "bad file";
template <typename T>
inline const std::string KEY_NOT_FOUND_WITH_KEY(
- const T&, typename disable_if<is_numeric<T> >::type* = 0) {
+ const T&, typename disable_if<is_numeric<T>>::type* = 0) {
return KEY_NOT_FOUND;
}
@@ -101,18 +109,20 @@ inline const std::string KEY_NOT_FOUND_WITH_KEY(const std::string& key) {
template <typename T>
inline const std::string KEY_NOT_FOUND_WITH_KEY(
- const T& key, typename enable_if<is_numeric<T> >::type* = 0) {
+ const T& key, typename enable_if<is_numeric<T>>::type* = 0) {
std::stringstream stream;
stream << KEY_NOT_FOUND << ": " << key;
return stream.str();
}
}
-class Exception : public std::runtime_error {
+class YAML_CPP_API Exception : public std::runtime_error {
public:
Exception(const Mark& mark_, const std::string& msg_)
: std::runtime_error(build_what(mark_, msg_)), mark(mark_), msg(msg_) {}
- virtual ~Exception() throw() {}
+ virtual ~Exception() YAML_CPP_NOEXCEPT;
+
+ Exception(const Exception&) = default;
Mark mark;
std::string msg;
@@ -131,39 +141,47 @@ class Exception : public std::runtime_error {
}
};
-class ParserException : public Exception {
+class YAML_CPP_API ParserException : public Exception {
public:
ParserException(const Mark& mark_, const std::string& msg_)
: Exception(mark_, msg_) {}
+ ParserException(const ParserException&) = default;
+ virtual ~ParserException() YAML_CPP_NOEXCEPT;
};
-class RepresentationException : public Exception {
+class YAML_CPP_API RepresentationException : public Exception {
public:
RepresentationException(const Mark& mark_, const std::string& msg_)
: Exception(mark_, msg_) {}
+ RepresentationException(const RepresentationException&) = default;
+ virtual ~RepresentationException() YAML_CPP_NOEXCEPT;
};
// representation exceptions
-class InvalidScalar : public RepresentationException {
+class YAML_CPP_API InvalidScalar : public RepresentationException {
public:
InvalidScalar(const Mark& mark_)
: RepresentationException(mark_, ErrorMsg::INVALID_SCALAR) {}
+ InvalidScalar(const InvalidScalar&) = default;
+ virtual ~InvalidScalar() YAML_CPP_NOEXCEPT;
};
-class KeyNotFound : public RepresentationException {
+class YAML_CPP_API KeyNotFound : public RepresentationException {
public:
template <typename T>
KeyNotFound(const Mark& mark_, const T& key_)
: RepresentationException(mark_, ErrorMsg::KEY_NOT_FOUND_WITH_KEY(key_)) {
}
+ KeyNotFound(const KeyNotFound&) = default;
+ virtual ~KeyNotFound() YAML_CPP_NOEXCEPT;
};
template <typename T>
-class TypedKeyNotFound : public KeyNotFound {
+class YAML_CPP_API TypedKeyNotFound : public KeyNotFound {
public:
TypedKeyNotFound(const Mark& mark_, const T& key_)
: KeyNotFound(mark_, key_), key(key_) {}
- virtual ~TypedKeyNotFound() throw() {}
+ virtual ~TypedKeyNotFound() YAML_CPP_NOEXCEPT {}
T key;
};
@@ -174,16 +192,20 @@ inline TypedKeyNotFound<T> MakeTypedKeyNotFound(const Mark& mark,
return TypedKeyNotFound<T>(mark, key);
}
-class InvalidNode : public RepresentationException {
+class YAML_CPP_API InvalidNode : public RepresentationException {
public:
InvalidNode()
: RepresentationException(Mark::null_mark(), ErrorMsg::INVALID_NODE) {}
+ InvalidNode(const InvalidNode&) = default;
+ virtual ~InvalidNode() YAML_CPP_NOEXCEPT;
};
-class BadConversion : public RepresentationException {
+class YAML_CPP_API BadConversion : public RepresentationException {
public:
explicit BadConversion(const Mark& mark_)
: RepresentationException(mark_, ErrorMsg::BAD_CONVERSION) {}
+ BadConversion(const BadConversion&) = default;
+ virtual ~BadConversion() YAML_CPP_NOEXCEPT;
};
template <typename T>
@@ -192,40 +214,54 @@ class TypedBadConversion : public BadConversion {
explicit TypedBadConversion(const Mark& mark_) : BadConversion(mark_) {}
};
-class BadDereference : public RepresentationException {
+class YAML_CPP_API BadDereference : public RepresentationException {
public:
BadDereference()
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_DEREFERENCE) {}
+ BadDereference(const BadDereference&) = default;
+ virtual ~BadDereference() YAML_CPP_NOEXCEPT;
};
-class BadSubscript : public RepresentationException {
+class YAML_CPP_API BadSubscript : public RepresentationException {
public:
BadSubscript()
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_SUBSCRIPT) {}
+ BadSubscript(const BadSubscript&) = default;
+ virtual ~BadSubscript() YAML_CPP_NOEXCEPT;
};
-class BadPushback : public RepresentationException {
+class YAML_CPP_API BadPushback : public RepresentationException {
public:
BadPushback()
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_PUSHBACK) {}
+ BadPushback(const BadPushback&) = default;
+ virtual ~BadPushback() YAML_CPP_NOEXCEPT;
};
-class BadInsert : public RepresentationException {
+class YAML_CPP_API BadInsert : public RepresentationException {
public:
BadInsert()
: RepresentationException(Mark::null_mark(), ErrorMsg::BAD_INSERT) {}
+ BadInsert(const BadInsert&) = default;
+ virtual ~BadInsert() YAML_CPP_NOEXCEPT;
};
-class EmitterException : public Exception {
+class YAML_CPP_API EmitterException : public Exception {
public:
EmitterException(const std::string& msg_)
: Exception(Mark::null_mark(), msg_) {}
+ EmitterException(const EmitterException&) = default;
+ virtual ~EmitterException() YAML_CPP_NOEXCEPT;
};
-class BadFile : public Exception {
+class YAML_CPP_API BadFile : public Exception {
public:
BadFile() : Exception(Mark::null_mark(), ErrorMsg::BAD_FILE) {}
+ BadFile(const BadFile&) = default;
+ virtual ~BadFile() YAML_CPP_NOEXCEPT;
};
}
+#undef YAML_CPP_NOEXCEPT
+
#endif // EXCEPTIONS_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/mark.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/mark.h
index bf94b4f41fc..bf94b4f41fc 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/mark.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/mark.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/convert.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/convert.h
index f388a673978..45a878ab0c0 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/convert.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/convert.h
@@ -7,6 +7,7 @@
#pragma once
#endif
+#include <array>
#include <limits>
#include <list>
#include <map>
@@ -162,7 +163,7 @@ struct convert<bool> {
// std::map
template <typename K, typename V>
-struct convert<std::map<K, V> > {
+struct convert<std::map<K, V>> {
static Node encode(const std::map<K, V>& rhs) {
Node node(NodeType::Map);
for (typename std::map<K, V>::const_iterator it = rhs.begin();
@@ -189,7 +190,7 @@ struct convert<std::map<K, V> > {
// std::vector
template <typename T>
-struct convert<std::vector<T> > {
+struct convert<std::vector<T>> {
static Node encode(const std::vector<T>& rhs) {
Node node(NodeType::Sequence);
for (typename std::vector<T>::const_iterator it = rhs.begin();
@@ -216,7 +217,7 @@ struct convert<std::vector<T> > {
// std::list
template <typename T>
-struct convert<std::list<T> > {
+struct convert<std::list<T>> {
static Node encode(const std::list<T>& rhs) {
Node node(NodeType::Sequence);
for (typename std::list<T>::const_iterator it = rhs.begin();
@@ -241,9 +242,42 @@ struct convert<std::list<T> > {
}
};
+// std::array
+template <typename T, std::size_t N>
+struct convert<std::array<T, N>> {
+ static Node encode(const std::array<T, N>& rhs) {
+ Node node(NodeType::Sequence);
+ for (const auto& element : rhs) {
+ node.push_back(element);
+ }
+ return node;
+ }
+
+ static bool decode(const Node& node, std::array<T, N>& rhs) {
+ if (!isNodeValid(node)) {
+ return false;
+ }
+
+ for (auto i = 0u; i < node.size(); ++i) {
+#if defined(__GNUC__) && __GNUC__ < 4
+ // workaround for GCC 3:
+ rhs[i] = node[i].template as<T>();
+#else
+ rhs[i] = node[i].as<T>();
+#endif
+ }
+ return true;
+ }
+
+ private:
+ static bool isNodeValid(const Node& node) {
+ return node.IsSequence() && node.size() == N;
+ }
+};
+
// std::pair
template <typename T, typename U>
-struct convert<std::pair<T, U> > {
+struct convert<std::pair<T, U>> {
static Node encode(const std::pair<T, U>& rhs) {
Node node(NodeType::Sequence);
node.push_back(rhs.first);
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/bool_type.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/bool_type.h
index 2c80705c9ae..2c80705c9ae 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/bool_type.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/bool_type.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/impl.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/impl.h
index f6d218c8062..09e55f838c2 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/impl.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/impl.h
@@ -9,7 +9,7 @@
#include "yaml-cpp/node/detail/node.h"
#include "yaml-cpp/node/detail/node_data.h"
-#include <boost/type_traits.hpp>
+#include <type_traits>
namespace YAML {
namespace detail {
@@ -22,9 +22,9 @@ struct get_idx {
};
template <typename Key>
-struct get_idx<
- Key, typename boost::enable_if_c<boost::is_unsigned<Key>::value &&
- !boost::is_same<Key, bool>::value>::type> {
+struct get_idx<Key,
+ typename std::enable_if<std::is_unsigned<Key>::value &&
+ !std::is_same<Key, bool>::value>::type> {
static node* get(const std::vector<node*>& sequence, const Key& key,
shared_memory_holder /* pMemory */) {
return key < sequence.size() ? sequence[key] : 0;
@@ -32,7 +32,7 @@ struct get_idx<
static node* get(std::vector<node*>& sequence, const Key& key,
shared_memory_holder pMemory) {
- if (key > sequence.size())
+ if (key > sequence.size() || (key > 0 && !sequence[key-1]->is_defined()))
return 0;
if (key == sequence.size())
sequence.push_back(&pMemory->create_node());
@@ -41,7 +41,7 @@ struct get_idx<
};
template <typename Key>
-struct get_idx<Key, typename boost::enable_if<boost::is_signed<Key> >::type> {
+struct get_idx<Key, typename std::enable_if<std::is_signed<Key>::value>::type> {
static node* get(const std::vector<node*>& sequence, const Key& key,
shared_memory_holder pMemory) {
return key >= 0 ? get_idx<std::size_t>::get(
@@ -132,6 +132,14 @@ inline bool node_data::remove(const Key& key, shared_memory_holder pMemory) {
if (m_type != NodeType::Map)
return false;
+ for (kv_pairs::iterator it = m_undefinedPairs.begin();
+ it != m_undefinedPairs.end();) {
+ kv_pairs::iterator jt = std::next(it);
+ if (it->first->equals(key, pMemory))
+ m_undefinedPairs.erase(it);
+ it = jt;
+ }
+
for (node_map::iterator it = m_map.begin(); it != m_map.end(); ++it) {
if (it->first->equals(key, pMemory)) {
m_map.erase(it);
diff --git a/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/iterator.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/iterator.h
new file mode 100644
index 00000000000..deec8fb62cd
--- /dev/null
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/iterator.h
@@ -0,0 +1,92 @@
+#ifndef VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66
+#define VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66
+
+#if defined(_MSC_VER) || \
+ (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
+ (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
+#pragma once
+#endif
+
+#include "yaml-cpp/dll.h"
+#include "yaml-cpp/node/node.h"
+#include "yaml-cpp/node/ptr.h"
+#include "yaml-cpp/node/detail/node_iterator.h"
+#include <cstddef>
+#include <iterator>
+
+namespace YAML {
+namespace detail {
+struct iterator_value;
+
+template <typename V>
+class iterator_base : public std::iterator<std::forward_iterator_tag, V,
+ std::ptrdiff_t, V*, V> {
+
+ private:
+ template <typename>
+ friend class iterator_base;
+ struct enabler {};
+ typedef node_iterator base_type;
+
+ struct proxy {
+ explicit proxy(const V& x) : m_ref(x) {}
+ V* operator->() { return std::addressof(m_ref); }
+ operator V*() { return std::addressof(m_ref); }
+
+ V m_ref;
+ };
+
+ public:
+ typedef typename iterator_base::value_type value_type;
+
+ public:
+ iterator_base() : m_iterator(), m_pMemory() {}
+ explicit iterator_base(base_type rhs, shared_memory_holder pMemory)
+ : m_iterator(rhs), m_pMemory(pMemory) {}
+
+ template <class W>
+ iterator_base(const iterator_base<W>& rhs,
+ typename std::enable_if<std::is_convertible<W*, V*>::value,
+ enabler>::type = enabler())
+ : m_iterator(rhs.m_iterator), m_pMemory(rhs.m_pMemory) {}
+
+ iterator_base<V>& operator++() {
+ ++m_iterator;
+ return *this;
+ }
+
+ iterator_base<V> operator++(int) {
+ iterator_base<V> iterator_pre(*this);
+ ++(*this);
+ return iterator_pre;
+ }
+
+ template <typename W>
+ bool operator==(const iterator_base<W>& rhs) const {
+ return m_iterator == rhs.m_iterator;
+ }
+
+ template <typename W>
+ bool operator!=(const iterator_base<W>& rhs) const {
+ return m_iterator != rhs.m_iterator;
+ }
+
+ value_type operator*() const {
+ const typename base_type::value_type& v = *m_iterator;
+ if (v.pNode)
+ return value_type(Node(*v, m_pMemory));
+ if (v.first && v.second)
+ return value_type(Node(*v.first, m_pMemory), Node(*v.second, m_pMemory));
+ return value_type();
+ }
+
+ proxy operator->() const { return proxy(**this); }
+
+ private:
+ base_type m_iterator;
+ shared_memory_holder m_pMemory;
+};
+}
+}
+
+#endif // VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/iterator_fwd.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/iterator_fwd.h
index c54a2587b78..5f1ffe7436d 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/iterator_fwd.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/iterator_fwd.h
@@ -13,7 +13,6 @@
#include <vector>
namespace YAML {
-class node;
namespace detail {
struct iterator_value;
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/memory.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/memory.h
index 8f2bc2657a2..8f2bc2657a2 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/memory.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/memory.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/node.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/node.h
index bbb497d7906..8a776f62a9e 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/node.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/node.h
@@ -13,13 +13,14 @@
#include "yaml-cpp/node/ptr.h"
#include "yaml-cpp/node/detail/node_ref.h"
#include <set>
-#include <boost/utility.hpp>
namespace YAML {
namespace detail {
-class node : private boost::noncopyable {
+class node {
public:
node() : m_pRef(new node_ref) {}
+ node(const node&) = delete;
+ node& operator=(const node&) = delete;
bool is(const node& rhs) const { return m_pRef == rhs.m_pRef; }
const node_ref* ref() const { return m_pRef.get(); }
@@ -65,9 +66,7 @@ class node : private boost::noncopyable {
m_pRef->set_data(*rhs.m_pRef);
}
- void set_mark(const Mark& mark) {
- m_pRef->set_mark(mark);
- }
+ void set_mark(const Mark& mark) { m_pRef->set_mark(mark); }
void set_type(NodeType::value type) {
if (type != NodeType::Undefined)
@@ -107,9 +106,9 @@ class node : private boost::noncopyable {
node_iterator end() { return m_pRef->end(); }
// sequence
- void push_back(node& node, shared_memory_holder pMemory) {
- m_pRef->push_back(node, pMemory);
- node.add_dependency(*this);
+ void push_back(node& input, shared_memory_holder pMemory) {
+ m_pRef->push_back(input, pMemory);
+ input.add_dependency(*this);
}
void insert(node& key, node& value, shared_memory_holder pMemory) {
m_pRef->insert(key, value, pMemory);
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/node_data.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/node_data.h
index 60308673447..50bcd74352d 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/node_data.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/node_data.h
@@ -7,8 +7,6 @@
#pragma once
#endif
-#include <boost/noncopyable.hpp>
-#include <boost/utility.hpp>
#include <list>
#include <map>
#include <string>
@@ -29,9 +27,11 @@ class node;
namespace YAML {
namespace detail {
-class YAML_CPP_API node_data : private boost::noncopyable {
+class YAML_CPP_API node_data {
public:
node_data();
+ node_data(const node_data&) = delete;
+ node_data& operator=(const node_data&) = delete;
void mark_defined();
void set_mark(const Mark& mark);
@@ -114,7 +114,7 @@ class YAML_CPP_API node_data : private boost::noncopyable {
mutable std::size_t m_seqSize;
// map
- typedef std::map<node*, node*> node_map;
+ typedef std::vector<std::pair<node*, node*>> node_map;
node_map m_map;
typedef std::pair<node*, node*> kv_pair;
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/node_iterator.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/node_iterator.h
index 9669c819284..088090fe743 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/node_iterator.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/node_iterator.h
@@ -9,8 +9,9 @@
#include "yaml-cpp/dll.h"
#include "yaml-cpp/node/ptr.h"
-#include <boost/iterator/iterator_facade.hpp>
-#include <boost/utility/enable_if.hpp>
+#include <cstddef>
+#include <iterator>
+#include <memory>
#include <map>
#include <utility>
#include <vector>
@@ -18,7 +19,7 @@
namespace YAML {
namespace detail {
struct iterator_type {
- enum value { None, Sequence, Map };
+ enum value { NoneType, Sequence, Map };
};
template <typename V>
@@ -36,7 +37,7 @@ struct node_iterator_value : public std::pair<V*, V*> {
};
typedef std::vector<node*> node_seq;
-typedef std::map<node*, node*> node_map;
+typedef std::vector<std::pair<node*, node*>> node_map;
template <typename V>
struct node_iterator_type {
@@ -52,19 +53,27 @@ struct node_iterator_type<const V> {
template <typename V>
class node_iterator_base
- : public boost::iterator_facade<
- node_iterator_base<V>, node_iterator_value<V>,
- std::forward_iterator_tag, node_iterator_value<V> > {
+ : public std::iterator<std::forward_iterator_tag, node_iterator_value<V>,
+ std::ptrdiff_t, node_iterator_value<V>*,
+ node_iterator_value<V>> {
private:
struct enabler {};
+ struct proxy {
+ explicit proxy(const node_iterator_value<V>& x) : m_ref(x) {}
+ node_iterator_value<V>* operator->() { return std::addressof(m_ref); }
+ operator node_iterator_value<V>*() { return std::addressof(m_ref); }
+
+ node_iterator_value<V> m_ref;
+ };
+
public:
typedef typename node_iterator_type<V>::seq SeqIter;
typedef typename node_iterator_type<V>::map MapIter;
typedef node_iterator_value<V> value_type;
node_iterator_base()
- : m_type(iterator_type::None), m_seqIt(), m_mapIt(), m_mapEnd() {}
+ : m_type(iterator_type::NoneType), m_seqIt(), m_mapIt(), m_mapEnd() {}
explicit node_iterator_base(SeqIter seqIt)
: m_type(iterator_type::Sequence),
m_seqIt(seqIt),
@@ -80,25 +89,23 @@ class node_iterator_base
template <typename W>
node_iterator_base(const node_iterator_base<W>& rhs,
- typename boost::enable_if<boost::is_convertible<W*, V*>,
- enabler>::type = enabler())
+ typename std::enable_if<std::is_convertible<W*, V*>::value,
+ enabler>::type = enabler())
: m_type(rhs.m_type),
m_seqIt(rhs.m_seqIt),
m_mapIt(rhs.m_mapIt),
m_mapEnd(rhs.m_mapEnd) {}
- private:
- friend class boost::iterator_core_access;
template <typename>
friend class node_iterator_base;
template <typename W>
- bool equal(const node_iterator_base<W>& rhs) const {
+ bool operator==(const node_iterator_base<W>& rhs) const {
if (m_type != rhs.m_type)
return false;
switch (m_type) {
- case iterator_type::None:
+ case iterator_type::NoneType:
return true;
case iterator_type::Sequence:
return m_seqIt == rhs.m_seqIt;
@@ -108,9 +115,14 @@ class node_iterator_base
return true;
}
- void increment() {
+ template <typename W>
+ bool operator!=(const node_iterator_base<W>& rhs) const {
+ return !(*this == rhs);
+ }
+
+ node_iterator_base<V>& operator++() {
switch (m_type) {
- case iterator_type::None:
+ case iterator_type::NoneType:
break;
case iterator_type::Sequence:
++m_seqIt;
@@ -120,11 +132,18 @@ class node_iterator_base
m_mapIt = increment_until_defined(m_mapIt);
break;
}
+ return *this;
+ }
+
+ node_iterator_base<V> operator++(int) {
+ node_iterator_base<V> iterator_pre(*this);
+ ++(*this);
+ return iterator_pre;
}
- value_type dereference() const {
+ value_type operator*() const {
switch (m_type) {
- case iterator_type::None:
+ case iterator_type::NoneType:
return value_type();
case iterator_type::Sequence:
return value_type(**m_seqIt);
@@ -134,6 +153,8 @@ class node_iterator_base
return value_type();
}
+ proxy operator->() const { return proxy(**this); }
+
MapIter increment_until_defined(MapIter it) {
while (it != m_mapEnd && !is_defined(it))
++it;
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/node_ref.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/node_ref.h
index 26b1872d0ca..d8a94f8b804 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/detail/node_ref.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/detail/node_ref.h
@@ -11,13 +11,14 @@
#include "yaml-cpp/node/type.h"
#include "yaml-cpp/node/ptr.h"
#include "yaml-cpp/node/detail/node_data.h"
-#include <boost/utility.hpp>
namespace YAML {
namespace detail {
-class node_ref : private boost::noncopyable {
+class node_ref {
public:
node_ref() : m_pData(new node_data) {}
+ node_ref(const node_ref&) = delete;
+ node_ref& operator=(const node_ref&) = delete;
bool is_defined() const { return m_pData->is_defined(); }
const Mark& mark() const { return m_pData->mark(); }
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/emit.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/emit.h
index 7c55af215df..032268c5d04 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/emit.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/emit.h
@@ -16,10 +16,17 @@ namespace YAML {
class Emitter;
class Node;
+/**
+ * Emits the node to the given {@link Emitter}. If there is an error in writing,
+ * {@link Emitter#good} will return false.
+ */
YAML_CPP_API Emitter& operator<<(Emitter& out, const Node& node);
+
+/** Emits the node to the given output stream. */
YAML_CPP_API std::ostream& operator<<(std::ostream& out, const Node& node);
+/** Converts the node to a YAML string. */
YAML_CPP_API std::string Dump(const Node& node);
-}
+} // namespace YAML
#endif // NODE_EMIT_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/impl.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/impl.h
index 50af6b67ff1..20c487a687f 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/impl.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/impl.h
@@ -103,7 +103,7 @@ struct as_if<std::string, S> {
explicit as_if(const Node& node_) : node(node_) {}
const Node& node;
- const std::string operator()(const S& fallback) const {
+ std::string operator()(const S& fallback) const {
if (node.Type() != NodeType::Scalar)
return fallback;
return node.Scalar();
@@ -115,7 +115,7 @@ struct as_if<T, void> {
explicit as_if(const Node& node_) : node(node_) {}
const Node& node;
- const T operator()() const {
+ T operator()() const {
if (!node.m_pNode)
throw TypedBadConversion<T>(node.Mark());
@@ -131,7 +131,7 @@ struct as_if<std::string, void> {
explicit as_if(const Node& node_) : node(node_) {}
const Node& node;
- const std::string operator()() const {
+ std::string operator()() const {
if (node.Type() != NodeType::Scalar)
throw TypedBadConversion<std::string>(node.Mark());
return node.Scalar();
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/iterator.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/iterator.h
index 366a9c807fe..366a9c807fe 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/iterator.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/iterator.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/node.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/node.h
index 1207f6e56d0..1ded7d27b72 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/node.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/node.h
@@ -58,7 +58,7 @@ class YAML_CPP_API Node {
bool IsMap() const { return Type() == NodeType::Map; }
// bool conversions
- YAML_CPP_OPERATOR_BOOL();
+ YAML_CPP_OPERATOR_BOOL()
bool operator!() const { return !IsDefined(); }
// access
diff --git a/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/parse.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/parse.h
new file mode 100644
index 00000000000..7745fd7245b
--- /dev/null
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/parse.h
@@ -0,0 +1,78 @@
+#ifndef VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
+#define VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
+
+#if defined(_MSC_VER) || \
+ (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
+ (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
+#pragma once
+#endif
+
+#include <iosfwd>
+#include <string>
+#include <vector>
+
+#include "yaml-cpp/dll.h"
+
+namespace YAML {
+class Node;
+
+/**
+ * Loads the input string as a single YAML document.
+ *
+ * @throws {@link ParserException} if it is malformed.
+ */
+YAML_CPP_API Node Load(const std::string& input);
+
+/**
+ * Loads the input string as a single YAML document.
+ *
+ * @throws {@link ParserException} if it is malformed.
+ */
+YAML_CPP_API Node Load(const char* input);
+
+/**
+ * Loads the input stream as a single YAML document.
+ *
+ * @throws {@link ParserException} if it is malformed.
+ */
+YAML_CPP_API Node Load(std::istream& input);
+
+/**
+ * Loads the input file as a single YAML document.
+ *
+ * @throws {@link ParserException} if it is malformed.
+ * @throws {@link BadFile} if the file cannot be loaded.
+ */
+YAML_CPP_API Node LoadFile(const std::string& filename);
+
+/**
+ * Loads the input string as a list of YAML documents.
+ *
+ * @throws {@link ParserException} if it is malformed.
+ */
+YAML_CPP_API std::vector<Node> LoadAll(const std::string& input);
+
+/**
+ * Loads the input string as a list of YAML documents.
+ *
+ * @throws {@link ParserException} if it is malformed.
+ */
+YAML_CPP_API std::vector<Node> LoadAll(const char* input);
+
+/**
+ * Loads the input stream as a list of YAML documents.
+ *
+ * @throws {@link ParserException} if it is malformed.
+ */
+YAML_CPP_API std::vector<Node> LoadAll(std::istream& input);
+
+/**
+ * Loads the input file as a list of YAML documents.
+ *
+ * @throws {@link ParserException} if it is malformed.
+ * @throws {@link BadFile} if the file cannot be loaded.
+ */
+YAML_CPP_API std::vector<Node> LoadAllFromFile(const std::string& filename);
+} // namespace YAML
+
+#endif // VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/ptr.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/ptr.h
index 64c86891a40..ce085dd5cd8 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/ptr.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/ptr.h
@@ -8,7 +8,7 @@
#endif
#include "yaml-cpp/dll.h"
-#include <boost/shared_ptr.hpp>
+#include <memory>
namespace YAML {
namespace detail {
@@ -18,11 +18,11 @@ class node_data;
class memory;
class memory_holder;
-typedef boost::shared_ptr<node> shared_node;
-typedef boost::shared_ptr<node_ref> shared_node_ref;
-typedef boost::shared_ptr<node_data> shared_node_data;
-typedef boost::shared_ptr<memory_holder> shared_memory_holder;
-typedef boost::shared_ptr<memory> shared_memory;
+typedef std::shared_ptr<node> shared_node;
+typedef std::shared_ptr<node_ref> shared_node_ref;
+typedef std::shared_ptr<node_data> shared_node_data;
+typedef std::shared_ptr<memory_holder> shared_memory_holder;
+typedef std::shared_ptr<memory> shared_memory;
}
}
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/type.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/type.h
index 9d55ca96621..9d55ca96621 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/node/type.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/node/type.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/noncopyable.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/noncopyable.h
index a261040739b..a261040739b 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/noncopyable.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/noncopyable.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/null.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/null.h
index 5dbda9af9c6..b9521d488a6 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/null.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/null.h
@@ -8,6 +8,7 @@
#endif
#include "yaml-cpp/dll.h"
+#include <string>
namespace YAML {
class Node;
@@ -17,6 +18,7 @@ inline bool operator==(const _Null&, const _Null&) { return true; }
inline bool operator!=(const _Null&, const _Null&) { return false; }
YAML_CPP_API bool IsNull(const Node& node); // old API only
+YAML_CPP_API bool IsNullString(const std::string& str);
extern YAML_CPP_API _Null Null;
}
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/ostream_wrapper.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/ostream_wrapper.h
index 09d45f39b78..09d45f39b78 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/ostream_wrapper.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/ostream_wrapper.h
diff --git a/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/parser.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/parser.h
new file mode 100644
index 00000000000..ceac22d0268
--- /dev/null
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/parser.h
@@ -0,0 +1,86 @@
+#ifndef PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
+#define PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
+
+#if defined(_MSC_VER) || \
+ (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
+ (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
+#pragma once
+#endif
+
+#include <ios>
+#include <memory>
+
+#include "yaml-cpp/dll.h"
+#include "yaml-cpp/noncopyable.h"
+
+namespace YAML {
+class EventHandler;
+class Node;
+class Scanner;
+struct Directives;
+struct Token;
+
+/**
+ * A parser turns a stream of bytes into one stream of "events" per YAML
+ * document in the input stream.
+ */
+class YAML_CPP_API Parser : private noncopyable {
+ public:
+ /** Constructs an empty parser (with no input. */
+ Parser();
+
+ /**
+ * Constructs a parser from the given input stream. The input stream must
+ * live as long as the parser.
+ */
+ explicit Parser(std::istream& in);
+
+ ~Parser();
+
+ /** Evaluates to true if the parser has some valid input to be read. */
+ explicit operator bool() const;
+
+ /**
+ * Resets the parser with the given input stream. Any existing state is
+ * erased.
+ */
+ void Load(std::istream& in);
+
+ /**
+ * Handles the next document by calling events on the {@code eventHandler}.
+ *
+ * @throw a ParserException on error.
+ * @return false if there are no more documents
+ */
+ bool HandleNextDocument(EventHandler& eventHandler);
+
+ void PrintTokens(std::ostream& out);
+
+ private:
+ /**
+ * Reads any directives that are next in the queue, setting the internal
+ * {@code m_pDirectives} state.
+ */
+ void ParseDirectives();
+
+ void HandleDirective(const Token& token);
+
+ /**
+ * Handles a "YAML" directive, which should be of the form 'major.minor' (like
+ * a version number).
+ */
+ void HandleYamlDirective(const Token& token);
+
+ /**
+ * Handles a "TAG" directive, which should be of the form 'handle prefix',
+ * where 'handle' is converted to 'prefix' in the file.
+ */
+ void HandleTagDirective(const Token& token);
+
+ private:
+ std::unique_ptr<Scanner> m_pScanner;
+ std::unique_ptr<Directives> m_pDirectives;
+};
+}
+
+#endif // PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/stlemitter.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/stlemitter.h
index 06780c861f1..06780c861f1 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/stlemitter.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/stlemitter.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/traits.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/traits.h
index f33d0e1f637..f33d0e1f637 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/traits.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/traits.h
diff --git a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/yaml.h b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/yaml.h
index 7f515efb961..7f515efb961 100644
--- a/src/third_party/yaml-cpp-0.5.3/include/yaml-cpp/yaml.h
+++ b/src/third_party/yaml-cpp-0.6.2/include/yaml-cpp/yaml.h
diff --git a/src/third_party/yaml-cpp-0.5.3/install.txt b/src/third_party/yaml-cpp-0.6.2/install.txt
index 939236249bf..939236249bf 100644
--- a/src/third_party/yaml-cpp-0.5.3/install.txt
+++ b/src/third_party/yaml-cpp-0.6.2/install.txt
diff --git a/src/third_party/yaml-cpp-0.5.3/src/binary.cpp b/src/third_party/yaml-cpp-0.6.2/src/binary.cpp
index a7e51301b82..a7e51301b82 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/binary.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/binary.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/collectionstack.h b/src/third_party/yaml-cpp-0.6.2/src/collectionstack.h
index 2302786e037..2302786e037 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/collectionstack.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/collectionstack.h
diff --git a/src/third_party/yaml-cpp-0.5.3/src/contrib/graphbuilder.cpp b/src/third_party/yaml-cpp-0.6.2/src/contrib/graphbuilder.cpp
index 416c1359db6..416c1359db6 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/contrib/graphbuilder.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/contrib/graphbuilder.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/contrib/graphbuilderadapter.cpp b/src/third_party/yaml-cpp-0.6.2/src/contrib/graphbuilderadapter.cpp
index 02a3d972a50..02a3d972a50 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/contrib/graphbuilderadapter.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/contrib/graphbuilderadapter.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/contrib/graphbuilderadapter.h b/src/third_party/yaml-cpp-0.6.2/src/contrib/graphbuilderadapter.h
index 0d1e579208c..0d1e579208c 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/contrib/graphbuilderadapter.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/contrib/graphbuilderadapter.h
diff --git a/src/third_party/yaml-cpp-0.5.3/src/convert.cpp b/src/third_party/yaml-cpp-0.6.2/src/convert.cpp
index ec05b77826b..ec05b77826b 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/convert.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/convert.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/directives.cpp b/src/third_party/yaml-cpp-0.6.2/src/directives.cpp
index 963bd2cd379..963bd2cd379 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/directives.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/directives.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/directives.h b/src/third_party/yaml-cpp-0.6.2/src/directives.h
index 333af26e374..333af26e374 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/directives.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/directives.h
diff --git a/src/third_party/yaml-cpp-0.5.3/src/emit.cpp b/src/third_party/yaml-cpp-0.6.2/src/emit.cpp
index 5fb593ba9ef..51bc791533d 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/emit.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/emit.cpp
@@ -22,4 +22,4 @@ std::string Dump(const Node& node) {
emitter << node;
return emitter.c_str();
}
-}
+} // namespace YAML
diff --git a/src/third_party/yaml-cpp-0.5.3/src/emitfromevents.cpp b/src/third_party/yaml-cpp-0.6.2/src/emitfromevents.cpp
index 45c5b99c998..4832649f3c7 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/emitfromevents.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/emitfromevents.cpp
@@ -111,7 +111,7 @@ void EmitFromEvents::BeginNode() {
}
void EmitFromEvents::EmitProps(const std::string& tag, anchor_t anchor) {
- if (!tag.empty() && tag != "?")
+ if (!tag.empty() && tag != "?" && tag != "!")
m_emitter << VerbatimTag(tag);
if (anchor)
m_emitter << Anchor(ToString(anchor));
diff --git a/src/third_party/yaml-cpp-0.5.3/src/emitter.cpp b/src/third_party/yaml-cpp-0.6.2/src/emitter.cpp
index ebeb059554e..ebeb059554e 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/emitter.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/emitter.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/emitterstate.cpp b/src/third_party/yaml-cpp-0.6.2/src/emitterstate.cpp
index a0874ac9aa1..3542aaf5071 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/emitterstate.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/emitterstate.cpp
@@ -53,28 +53,31 @@ void EmitterState::SetNonContent() { m_hasNonContent = true; }
void EmitterState::SetLongKey() {
assert(!m_groups.empty());
- if (m_groups.empty())
+ if (m_groups.empty()) {
return;
+ }
- assert(m_groups.top().type == GroupType::Map);
- m_groups.top().longKey = true;
+ assert(m_groups.back()->type == GroupType::Map);
+ m_groups.back()->longKey = true;
}
void EmitterState::ForceFlow() {
assert(!m_groups.empty());
- if (m_groups.empty())
+ if (m_groups.empty()) {
return;
+ }
- m_groups.top().flowType = FlowType::Flow;
+ m_groups.back()->flowType = FlowType::Flow;
}
void EmitterState::StartedNode() {
if (m_groups.empty()) {
m_docCount++;
} else {
- m_groups.top().childCount++;
- if (m_groups.top().childCount % 2 == 0)
- m_groups.top().longKey = false;
+ m_groups.back()->childCount++;
+ if (m_groups.back()->childCount % 2 == 0) {
+ m_groups.back()->longKey = false;
+ }
}
m_hasAnchor = false;
@@ -121,41 +124,50 @@ void EmitterState::StartedScalar() {
void EmitterState::StartedGroup(GroupType::value type) {
StartedNode();
- const int lastGroupIndent = (m_groups.empty() ? 0 : m_groups.top().indent);
+ const std::size_t lastGroupIndent =
+ (m_groups.empty() ? 0 : m_groups.back()->indent);
m_curIndent += lastGroupIndent;
- std::auto_ptr<Group> pGroup(new Group(type));
+ // TODO: Create move constructors for settings types to simplify transfer
+ std::unique_ptr<Group> pGroup(new Group(type));
// transfer settings (which last until this group is done)
- pGroup->modifiedSettings = m_modifiedSettings;
+ //
+ // NB: if pGroup->modifiedSettings == m_modifiedSettings,
+ // m_modifiedSettings is not changed!
+ pGroup->modifiedSettings = std::move(m_modifiedSettings);
// set up group
- if (GetFlowType(type) == Block)
+ if (GetFlowType(type) == Block) {
pGroup->flowType = FlowType::Block;
- else
+ } else {
pGroup->flowType = FlowType::Flow;
+ }
pGroup->indent = GetIndent();
- m_groups.push(pGroup);
+ m_groups.push_back(std::move(pGroup));
}
void EmitterState::EndedGroup(GroupType::value type) {
if (m_groups.empty()) {
- if (type == GroupType::Seq)
+ if (type == GroupType::Seq) {
return SetError(ErrorMsg::UNEXPECTED_END_SEQ);
- else
+ } else {
return SetError(ErrorMsg::UNEXPECTED_END_MAP);
+ }
}
// get rid of the current group
{
- std::auto_ptr<Group> pFinishedGroup = m_groups.pop();
- if (pFinishedGroup->type != type)
+ std::unique_ptr<Group> pFinishedGroup = std::move(m_groups.back());
+ m_groups.pop_back();
+ if (pFinishedGroup->type != type) {
return SetError(ErrorMsg::UNMATCHED_GROUP_TAG);
+ }
}
// reset old settings
- std::size_t lastIndent = (m_groups.empty() ? 0 : m_groups.top().indent);
+ std::size_t lastIndent = (m_groups.empty() ? 0 : m_groups.back()->indent);
assert(m_curIndent >= lastIndent);
m_curIndent -= lastIndent;
@@ -167,37 +179,39 @@ void EmitterState::EndedGroup(GroupType::value type) {
}
EmitterNodeType::value EmitterState::CurGroupNodeType() const {
- if (m_groups.empty())
+ if (m_groups.empty()) {
return EmitterNodeType::NoType;
+ }
- return m_groups.top().NodeType();
+ return m_groups.back()->NodeType();
}
GroupType::value EmitterState::CurGroupType() const {
- return m_groups.empty() ? GroupType::NoType : m_groups.top().type;
+ return m_groups.empty() ? GroupType::NoType : m_groups.back()->type;
}
FlowType::value EmitterState::CurGroupFlowType() const {
- return m_groups.empty() ? FlowType::NoType : m_groups.top().flowType;
+ return m_groups.empty() ? FlowType::NoType : m_groups.back()->flowType;
}
-int EmitterState::CurGroupIndent() const {
- return m_groups.empty() ? 0 : m_groups.top().indent;
+std::size_t EmitterState::CurGroupIndent() const {
+ return m_groups.empty() ? 0 : m_groups.back()->indent;
}
std::size_t EmitterState::CurGroupChildCount() const {
- return m_groups.empty() ? m_docCount : m_groups.top().childCount;
+ return m_groups.empty() ? m_docCount : m_groups.back()->childCount;
}
bool EmitterState::CurGroupLongKey() const {
- return m_groups.empty() ? false : m_groups.top().longKey;
+ return m_groups.empty() ? false : m_groups.back()->longKey;
}
-int EmitterState::LastIndent() const {
- if (m_groups.size() <= 1)
+std::size_t EmitterState::LastIndent() const {
+ if (m_groups.size() <= 1) {
return 0;
+ }
- return m_curIndent - m_groups.top(-1).indent;
+ return m_curIndent - m_groups[m_groups.size() - 2]->indent;
}
void EmitterState::ClearModifiedSettings() { m_modifiedSettings.clear(); }
@@ -334,15 +348,16 @@ bool EmitterState::SetMapKeyFormat(EMITTER_MANIP value, FmtScope::value scope) {
}
}
-bool EmitterState::SetFloatPrecision(int value, FmtScope::value scope) {
- if (value < 0 || value > std::numeric_limits<float>::digits10 + 1)
+bool EmitterState::SetFloatPrecision(std::size_t value, FmtScope::value scope) {
+ if (value > std::numeric_limits<float>::digits10 + 1)
return false;
_Set(m_floatPrecision, value, scope);
return true;
}
-bool EmitterState::SetDoublePrecision(int value, FmtScope::value scope) {
- if (value < 0 || value > std::numeric_limits<double>::digits10 + 1)
+bool EmitterState::SetDoublePrecision(std::size_t value,
+ FmtScope::value scope) {
+ if (value > std::numeric_limits<double>::digits10 + 1)
return false;
_Set(m_doublePrecision, value, scope);
return true;
diff --git a/src/third_party/yaml-cpp-0.5.3/src/emitterstate.h b/src/third_party/yaml-cpp-0.6.2/src/emitterstate.h
index 2ddec76c656..0937f000d9f 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/emitterstate.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/emitterstate.h
@@ -7,15 +7,15 @@
#pragma once
#endif
-#include "ptr_stack.h"
#include "setting.h"
#include "yaml-cpp/emitterdef.h"
#include "yaml-cpp/emittermanip.h"
+
#include <cassert>
-#include <vector>
-#include <stack>
#include <memory>
+#include <stack>
#include <stdexcept>
+#include <vector>
namespace YAML {
struct FmtScope {
@@ -58,12 +58,12 @@ class EmitterState {
GroupType::value CurGroupType() const;
FlowType::value CurGroupFlowType() const;
- int CurGroupIndent() const;
+ std::size_t CurGroupIndent() const;
std::size_t CurGroupChildCount() const;
bool CurGroupLongKey() const;
- int LastIndent() const;
- int CurIndent() const { return m_curIndent; }
+ std::size_t LastIndent() const;
+ std::size_t CurIndent() const { return m_curIndent; }
bool HasAnchor() const { return m_hasAnchor; }
bool HasTag() const { return m_hasTag; }
bool HasBegunNode() const {
@@ -95,12 +95,12 @@ class EmitterState {
EMITTER_MANIP GetIntFormat() const { return m_intFmt.get(); }
bool SetIndent(std::size_t value, FmtScope::value scope);
- int GetIndent() const { return m_indent.get(); }
+ std::size_t GetIndent() const { return m_indent.get(); }
bool SetPreCommentIndent(std::size_t value, FmtScope::value scope);
- int GetPreCommentIndent() const { return m_preCommentIndent.get(); }
+ std::size_t GetPreCommentIndent() const { return m_preCommentIndent.get(); }
bool SetPostCommentIndent(std::size_t value, FmtScope::value scope);
- int GetPostCommentIndent() const { return m_postCommentIndent.get(); }
+ std::size_t GetPostCommentIndent() const { return m_postCommentIndent.get(); }
bool SetFlowType(GroupType::value groupType, EMITTER_MANIP value,
FmtScope::value scope);
@@ -109,9 +109,9 @@ class EmitterState {
bool SetMapKeyFormat(EMITTER_MANIP value, FmtScope::value scope);
EMITTER_MANIP GetMapKeyFormat() const { return m_mapKeyFmt.get(); }
- bool SetFloatPrecision(int value, FmtScope::value scope);
+ bool SetFloatPrecision(std::size_t value, FmtScope::value scope);
std::size_t GetFloatPrecision() const { return m_floatPrecision.get(); }
- bool SetDoublePrecision(int value, FmtScope::value scope);
+ bool SetDoublePrecision(std::size_t value, FmtScope::value scope);
std::size_t GetDoublePrecision() const { return m_doublePrecision.get(); }
private:
@@ -137,8 +137,8 @@ class EmitterState {
Setting<EMITTER_MANIP> m_seqFmt;
Setting<EMITTER_MANIP> m_mapFmt;
Setting<EMITTER_MANIP> m_mapKeyFmt;
- Setting<int> m_floatPrecision;
- Setting<int> m_doublePrecision;
+ Setting<std::size_t> m_floatPrecision;
+ Setting<std::size_t> m_doublePrecision;
SettingChanges m_modifiedSettings;
SettingChanges m_globalModifiedSettings;
@@ -149,7 +149,7 @@ class EmitterState {
GroupType::value type;
FlowType::value flowType;
- int indent;
+ std::size_t indent;
std::size_t childCount;
bool longKey;
@@ -174,7 +174,7 @@ class EmitterState {
}
};
- ptr_stack<Group> m_groups;
+ std::vector<std::unique_ptr<Group>> m_groups;
std::size_t m_curIndent;
bool m_hasAnchor;
bool m_hasTag;
diff --git a/src/third_party/yaml-cpp-0.5.3/src/emitterutils.cpp b/src/third_party/yaml-cpp-0.6.2/src/emitterutils.cpp
index 4a4c982cf36..147738ad8a1 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/emitterutils.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/emitterutils.cpp
@@ -9,6 +9,7 @@
#include "stringsource.h"
#include "yaml-cpp/binary.h" // IWYU pragma: keep
#include "yaml-cpp/ostream_wrapper.h"
+#include "yaml-cpp/null.h"
namespace YAML {
namespace Utils {
@@ -152,12 +153,8 @@ void WriteCodePoint(ostream_wrapper& out, int codePoint) {
bool IsValidPlainScalar(const std::string& str, FlowType::value flowType,
bool allowOnlyAscii) {
- if (str.empty()) {
- return false;
- }
-
// check against null
- if (str == "null") {
+ if (IsNullString(str)) {
return false;
}
@@ -357,7 +354,7 @@ bool WriteDoubleQuotedString(ostream_wrapper& out, const std::string& str,
}
bool WriteLiteralString(ostream_wrapper& out, const std::string& str,
- int indent) {
+ std::size_t indent) {
out << "|\n";
out << IndentTo(indent);
int codePoint;
@@ -383,6 +380,8 @@ bool WriteChar(ostream_wrapper& out, char ch) {
out << "\"\\n\"";
} else if (ch == '\b') {
out << "\"\\b\"";
+ } else if (ch == '\\') {
+ out << "\"\\\\\"";
} else if ((0x20 <= ch && ch <= 0x7e) || ch == ' ') {
out << "\"" << ch << "\"";
} else {
@@ -394,7 +393,7 @@ bool WriteChar(ostream_wrapper& out, char ch) {
}
bool WriteComment(ostream_wrapper& out, const std::string& str,
- int postCommentIndent) {
+ std::size_t postCommentIndent) {
const std::size_t curIndent = out.col();
out << "#" << Indentation(postCommentIndent);
out.set_comment();
diff --git a/src/third_party/yaml-cpp-0.5.3/src/emitterutils.h b/src/third_party/yaml-cpp-0.6.2/src/emitterutils.h
index 3a9c2f8556e..6cc73191476 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/emitterutils.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/emitterutils.h
@@ -34,10 +34,10 @@ bool WriteSingleQuotedString(ostream_wrapper& out, const std::string& str);
bool WriteDoubleQuotedString(ostream_wrapper& out, const std::string& str,
bool escapeNonAscii);
bool WriteLiteralString(ostream_wrapper& out, const std::string& str,
- int indent);
+ std::size_t indent);
bool WriteChar(ostream_wrapper& out, char ch);
bool WriteComment(ostream_wrapper& out, const std::string& str,
- int postCommentIndent);
+ std::size_t postCommentIndent);
bool WriteAlias(ostream_wrapper& out, const std::string& str);
bool WriteAnchor(ostream_wrapper& out, const std::string& str);
bool WriteTag(ostream_wrapper& out, const std::string& str, bool verbatim);
diff --git a/src/third_party/yaml-cpp-0.6.2/src/exceptions.cpp b/src/third_party/yaml-cpp-0.6.2/src/exceptions.cpp
new file mode 100644
index 00000000000..9b6d8912c18
--- /dev/null
+++ b/src/third_party/yaml-cpp-0.6.2/src/exceptions.cpp
@@ -0,0 +1,31 @@
+#include "yaml-cpp/exceptions.h"
+
+// This is here for compatibility with older versions of Visual Studio
+// which don't support noexcept
+#ifdef _MSC_VER
+ #define YAML_CPP_NOEXCEPT _NOEXCEPT
+#else
+ #define YAML_CPP_NOEXCEPT noexcept
+#endif
+
+namespace YAML {
+
+// These destructors are defined out-of-line so the vtable is only emitted once.
+Exception::~Exception() YAML_CPP_NOEXCEPT {}
+ParserException::~ParserException() YAML_CPP_NOEXCEPT {}
+RepresentationException::~RepresentationException() YAML_CPP_NOEXCEPT {}
+InvalidScalar::~InvalidScalar() YAML_CPP_NOEXCEPT {}
+KeyNotFound::~KeyNotFound() YAML_CPP_NOEXCEPT {}
+InvalidNode::~InvalidNode() YAML_CPP_NOEXCEPT {}
+BadConversion::~BadConversion() YAML_CPP_NOEXCEPT {}
+BadDereference::~BadDereference() YAML_CPP_NOEXCEPT {}
+BadSubscript::~BadSubscript() YAML_CPP_NOEXCEPT {}
+BadPushback::~BadPushback() YAML_CPP_NOEXCEPT {}
+BadInsert::~BadInsert() YAML_CPP_NOEXCEPT {}
+EmitterException::~EmitterException() YAML_CPP_NOEXCEPT {}
+BadFile::~BadFile() YAML_CPP_NOEXCEPT {}
+}
+
+#undef YAML_CPP_NOEXCEPT
+
+
diff --git a/src/third_party/yaml-cpp-0.5.3/src/exp.cpp b/src/third_party/yaml-cpp-0.6.2/src/exp.cpp
index 695440aec0e..695440aec0e 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/exp.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/exp.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/exp.h b/src/third_party/yaml-cpp-0.6.2/src/exp.h
index f248802017d..7c02cf6e451 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/exp.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/exp.h
@@ -20,6 +20,10 @@ namespace YAML {
namespace Exp {
// misc
+inline const RegEx& Empty() {
+ static const RegEx e;
+ return e;
+}
inline const RegEx& Space() {
static const RegEx e = RegEx(' ');
return e;
@@ -131,7 +135,7 @@ inline const RegEx& URI() {
return e;
}
inline const RegEx& Tag() {
- static const RegEx e = Word() || RegEx("#;/?:@&=+$_.~*'", REGEX_OR) ||
+ static const RegEx e = Word() || RegEx("#;/?:@&=+$_.~*'()", REGEX_OR) ||
(RegEx('%') + Hex() + Hex());
return e;
}
@@ -165,6 +169,15 @@ inline const RegEx& EndScalarInFlow() {
return e;
}
+inline const RegEx& ScanScalarEndInFlow() {
+ static const RegEx e = (EndScalarInFlow() || (BlankOrBreak() + Comment()));
+ return e;
+}
+
+inline const RegEx& ScanScalarEnd() {
+ static const RegEx e = EndScalar() || (BlankOrBreak() + Comment());
+ return e;
+}
inline const RegEx& EscSingleQuote() {
static const RegEx e = RegEx("\'\'");
return e;
@@ -187,7 +200,7 @@ inline const RegEx& Chomp() {
// and some functions
std::string Escape(Stream& in);
-}
+} // namespace Exp
namespace Keys {
const char Directive = '%';
@@ -203,7 +216,7 @@ const char LiteralScalar = '|';
const char FoldedScalar = '>';
const char VerbatimTagStart = '<';
const char VerbatimTagEnd = '>';
-}
-}
+} // namespace Keys
+} // namespace YAML
#endif // EXP_H_62B23520_7C8E_11DE_8A39_0800200C9A66
diff --git a/src/third_party/yaml-cpp-0.5.3/src/indentation.h b/src/third_party/yaml-cpp-0.6.2/src/indentation.h
index 1a2ccaea2e1..1a2ccaea2e1 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/indentation.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/indentation.h
diff --git a/src/third_party/yaml-cpp-0.5.3/src/memory.cpp b/src/third_party/yaml-cpp-0.6.2/src/memory.cpp
index e5f8a9d3f8c..e5f8a9d3f8c 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/memory.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/memory.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/node.cpp b/src/third_party/yaml-cpp-0.6.2/src/node.cpp
index 2088e13c9ae..2088e13c9ae 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/node.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/node.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/node_data.cpp b/src/third_party/yaml-cpp-0.6.2/src/node_data.cpp
index a1ca9002038..77cd4657806 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/node_data.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/node_data.cpp
@@ -1,5 +1,5 @@
#include <assert.h>
-#include <boost/smart_ptr/shared_ptr.hpp>
+#include <iterator>
#include <sstream>
#include "yaml-cpp/exceptions.h"
@@ -28,9 +28,7 @@ void node_data::mark_defined() {
m_isDefined = true;
}
-void node_data::set_mark(const Mark& mark) {
- m_mark = mark;
-}
+void node_data::set_mark(const Mark& mark) { m_mark = mark; }
void node_data::set_type(NodeType::value type) {
if (type == NodeType::Undefined) {
@@ -104,7 +102,7 @@ void node_data::compute_seq_size() const {
void node_data::compute_map_size() const {
kv_pairs::iterator it = m_undefinedPairs.begin();
while (it != m_undefinedPairs.end()) {
- kv_pairs::iterator jt = boost::next(it);
+ kv_pairs::iterator jt = std::next(it);
if (it->first->is_defined() && it->second->is_defined())
m_undefinedPairs.erase(it);
it = jt;
@@ -258,9 +256,10 @@ void node_data::reset_map() {
}
void node_data::insert_map_pair(node& key, node& value) {
- m_map[&key] = &value;
+ m_map.emplace_back(&key, &value);
+
if (!key.is_defined() || !value.is_defined())
- m_undefinedPairs.push_back(kv_pair(&key, &value));
+ m_undefinedPairs.emplace_back(&key, &value);
}
void node_data::convert_to_map(shared_memory_holder pMemory) {
diff --git a/src/third_party/yaml-cpp-0.5.3/src/nodebuilder.cpp b/src/third_party/yaml-cpp-0.6.2/src/nodebuilder.cpp
index 20ec3ac672c..093d2efeb77 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/nodebuilder.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/nodebuilder.cpp
@@ -48,9 +48,8 @@ void NodeBuilder::OnScalar(const Mark& mark, const std::string& tag,
Pop();
}
-void NodeBuilder::OnSequenceStart(const Mark& mark,
- const std::string& tag, anchor_t anchor,
- EmitterStyle::value style) {
+void NodeBuilder::OnSequenceStart(const Mark& mark, const std::string& tag,
+ anchor_t anchor, EmitterStyle::value style) {
detail::node& node = Push(mark, anchor);
node.set_tag(tag);
node.set_type(NodeType::Sequence);
diff --git a/src/third_party/yaml-cpp-0.5.3/src/nodebuilder.h b/src/third_party/yaml-cpp-0.6.2/src/nodebuilder.h
index a6a47f007bb..a6a47f007bb 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/nodebuilder.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/nodebuilder.h
diff --git a/src/third_party/yaml-cpp-0.5.3/src/nodeevents.cpp b/src/third_party/yaml-cpp-0.6.2/src/nodeevents.cpp
index 82261feb058..82261feb058 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/nodeevents.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/nodeevents.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/nodeevents.h b/src/third_party/yaml-cpp-0.6.2/src/nodeevents.h
index 49c18eb854a..49c18eb854a 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/nodeevents.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/nodeevents.h
diff --git a/src/third_party/yaml-cpp-0.6.2/src/null.cpp b/src/third_party/yaml-cpp-0.6.2/src/null.cpp
new file mode 100644
index 00000000000..d12dd08ce4b
--- /dev/null
+++ b/src/third_party/yaml-cpp-0.6.2/src/null.cpp
@@ -0,0 +1,10 @@
+#include "yaml-cpp/null.h"
+
+namespace YAML {
+_Null Null;
+
+bool IsNullString(const std::string& str) {
+ return str.empty() || str == "~" || str == "null" || str == "Null" ||
+ str == "NULL";
+}
+}
diff --git a/src/third_party/yaml-cpp-0.5.3/src/ostream_wrapper.cpp b/src/third_party/yaml-cpp-0.6.2/src/ostream_wrapper.cpp
index 357fc0094c4..357fc0094c4 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/ostream_wrapper.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/ostream_wrapper.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/parse.cpp b/src/third_party/yaml-cpp-0.6.2/src/parse.cpp
index 1ef474db557..0b2ae4a4f6e 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/parse.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/parse.cpp
@@ -22,16 +22,18 @@ Node Load(const char* input) {
Node Load(std::istream& input) {
Parser parser(input);
NodeBuilder builder;
- if (!parser.HandleNextDocument(builder))
+ if (!parser.HandleNextDocument(builder)) {
return Node();
+ }
return builder.Root();
}
Node LoadFile(const std::string& filename) {
std::ifstream fin(filename.c_str());
- if (!fin)
+ if (!fin) {
throw BadFile();
+ }
return Load(fin);
}
@@ -51,8 +53,9 @@ std::vector<Node> LoadAll(std::istream& input) {
Parser parser(input);
while (1) {
NodeBuilder builder;
- if (!parser.HandleNextDocument(builder))
+ if (!parser.HandleNextDocument(builder)) {
break;
+ }
docs.push_back(builder.Root());
}
@@ -61,8 +64,9 @@ std::vector<Node> LoadAll(std::istream& input) {
std::vector<Node> LoadAllFromFile(const std::string& filename) {
std::ifstream fin(filename.c_str());
- if (!fin)
+ if (!fin) {
throw BadFile();
+ }
return LoadAll(fin);
}
-}
+} // namespace YAML
diff --git a/src/third_party/yaml-cpp-0.5.3/src/parser.cpp b/src/third_party/yaml-cpp-0.6.2/src/parser.cpp
index 538d0be1f0c..cd69f39fcec 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/parser.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/parser.cpp
@@ -26,40 +26,38 @@ void Parser::Load(std::istream& in) {
m_pDirectives.reset(new Directives);
}
-// HandleNextDocument
-// . Handles the next document
-// . Throws a ParserException on error.
-// . Returns false if there are no more documents
bool Parser::HandleNextDocument(EventHandler& eventHandler) {
if (!m_pScanner.get())
return false;
ParseDirectives();
- if (m_pScanner->empty())
+ if (m_pScanner->empty()) {
return false;
+ }
SingleDocParser sdp(*m_pScanner, *m_pDirectives);
sdp.HandleDocument(eventHandler);
return true;
}
-// ParseDirectives
-// . Reads any directives that are next in the queue.
void Parser::ParseDirectives() {
bool readDirective = false;
while (1) {
- if (m_pScanner->empty())
+ if (m_pScanner->empty()) {
break;
+ }
Token& token = m_pScanner->peek();
- if (token.type != Token::DIRECTIVE)
+ if (token.type != Token::DIRECTIVE) {
break;
+ }
// we keep the directives from the last document if none are specified;
// but if any directives are specific, then we reset them
- if (!readDirective)
+ if (!readDirective) {
m_pDirectives.reset(new Directives);
+ }
readDirective = true;
HandleDirective(token);
@@ -68,58 +66,61 @@ void Parser::ParseDirectives() {
}
void Parser::HandleDirective(const Token& token) {
- if (token.value == "YAML")
+ if (token.value == "YAML") {
HandleYamlDirective(token);
- else if (token.value == "TAG")
+ } else if (token.value == "TAG") {
HandleTagDirective(token);
+ }
}
-// HandleYamlDirective
-// . Should be of the form 'major.minor' (like a version number)
void Parser::HandleYamlDirective(const Token& token) {
- if (token.params.size() != 1)
+ if (token.params.size() != 1) {
throw ParserException(token.mark, ErrorMsg::YAML_DIRECTIVE_ARGS);
+ }
- if (!m_pDirectives->version.isDefault)
+ if (!m_pDirectives->version.isDefault) {
throw ParserException(token.mark, ErrorMsg::REPEATED_YAML_DIRECTIVE);
+ }
std::stringstream str(token.params[0]);
str >> m_pDirectives->version.major;
str.get();
str >> m_pDirectives->version.minor;
- if (!str || str.peek() != EOF)
+ if (!str || str.peek() != EOF) {
throw ParserException(
token.mark, std::string(ErrorMsg::YAML_VERSION) + token.params[0]);
+ }
- if (m_pDirectives->version.major > 1)
+ if (m_pDirectives->version.major > 1) {
throw ParserException(token.mark, ErrorMsg::YAML_MAJOR_VERSION);
+ }
m_pDirectives->version.isDefault = false;
// TODO: warning on major == 1, minor > 2?
}
-// HandleTagDirective
-// . Should be of the form 'handle prefix', where 'handle' is converted to
-// 'prefix' in the file.
void Parser::HandleTagDirective(const Token& token) {
if (token.params.size() != 2)
throw ParserException(token.mark, ErrorMsg::TAG_DIRECTIVE_ARGS);
const std::string& handle = token.params[0];
const std::string& prefix = token.params[1];
- if (m_pDirectives->tags.find(handle) != m_pDirectives->tags.end())
+ if (m_pDirectives->tags.find(handle) != m_pDirectives->tags.end()) {
throw ParserException(token.mark, ErrorMsg::REPEATED_TAG_DIRECTIVE);
+ }
m_pDirectives->tags[handle] = prefix;
}
void Parser::PrintTokens(std::ostream& out) {
- if (!m_pScanner.get())
+ if (!m_pScanner.get()) {
return;
+ }
while (1) {
- if (m_pScanner->empty())
+ if (m_pScanner->empty()) {
break;
+ }
out << m_pScanner->peek() << "\n";
m_pScanner->pop();
diff --git a/src/third_party/yaml-cpp-0.5.3/src/ptr_vector.h b/src/third_party/yaml-cpp-0.6.2/src/ptr_vector.h
index a546a895db2..955aebd8d56 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/ptr_vector.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/ptr_vector.h
@@ -16,33 +16,27 @@
namespace YAML {
+// TODO: This class is no longer needed
template <typename T>
class ptr_vector : private YAML::noncopyable {
public:
ptr_vector() {}
- ~ptr_vector() { clear(); }
- void clear() {
- for (std::size_t i = 0; i < m_data.size(); i++)
- delete m_data[i];
- m_data.clear();
- }
+ void clear() { m_data.clear(); }
std::size_t size() const { return m_data.size(); }
bool empty() const { return m_data.empty(); }
- void push_back(std::auto_ptr<T> t) {
- m_data.push_back(NULL);
- m_data.back() = t.release();
- }
+ void push_back(std::unique_ptr<T>&& t) { m_data.push_back(std::move(t)); }
T& operator[](std::size_t i) { return *m_data[i]; }
const T& operator[](std::size_t i) const { return *m_data[i]; }
- T& back() { return *m_data.back(); }
- const T& back() const { return *m_data.back(); }
+ T& back() { return *(m_data.back().get()); }
+
+ const T& back() const { return *(m_data.back().get()); }
private:
- std::vector<T*> m_data;
+ std::vector<std::unique_ptr<T>> m_data;
};
}
diff --git a/src/third_party/yaml-cpp-0.5.3/src/regex_yaml.cpp b/src/third_party/yaml-cpp-0.6.2/src/regex_yaml.cpp
index 20b772051d2..20b772051d2 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/regex_yaml.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/regex_yaml.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/regex_yaml.h b/src/third_party/yaml-cpp-0.6.2/src/regex_yaml.h
index 3fa7327fdda..8f28b852a29 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/regex_yaml.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/regex_yaml.h
@@ -10,6 +10,8 @@
#include <string>
#include <vector>
+#include "yaml-cpp/dll.h"
+
namespace YAML {
class Stream;
@@ -26,7 +28,7 @@ enum REGEX_OP {
// simplified regular expressions
// . Only straightforward matches (no repeated characters)
// . Only matches from start of string
-class RegEx {
+class YAML_CPP_API RegEx {
public:
RegEx();
RegEx(char ch);
@@ -34,10 +36,10 @@ class RegEx {
RegEx(const std::string& str, REGEX_OP op = REGEX_SEQ);
~RegEx() {}
- friend RegEx operator!(const RegEx& ex);
- friend RegEx operator||(const RegEx& ex1, const RegEx& ex2);
- friend RegEx operator&&(const RegEx& ex1, const RegEx& ex2);
- friend RegEx operator+(const RegEx& ex1, const RegEx& ex2);
+ friend YAML_CPP_API RegEx operator!(const RegEx& ex);
+ friend YAML_CPP_API RegEx operator||(const RegEx& ex1, const RegEx& ex2);
+ friend YAML_CPP_API RegEx operator&&(const RegEx& ex1, const RegEx& ex2);
+ friend YAML_CPP_API RegEx operator+(const RegEx& ex1, const RegEx& ex2);
bool Matches(char ch) const;
bool Matches(const std::string& str) const;
diff --git a/src/third_party/yaml-cpp-0.5.3/src/regeximpl.h b/src/third_party/yaml-cpp-0.6.2/src/regeximpl.h
index 709124f0088..709124f0088 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/regeximpl.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/regeximpl.h
diff --git a/src/third_party/yaml-cpp-0.5.3/src/scanner.cpp b/src/third_party/yaml-cpp-0.6.2/src/scanner.cpp
index 680c73bf2ed..b5cfcc12b22 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/scanner.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/scanner.cpp
@@ -16,23 +16,17 @@ Scanner::Scanner(std::istream& in)
Scanner::~Scanner() {}
-// empty
-// . Returns true if there are no more tokens to be read
bool Scanner::empty() {
EnsureTokensInQueue();
return m_tokens.empty();
}
-// pop
-// . Simply removes the next token on the queue.
void Scanner::pop() {
EnsureTokensInQueue();
if (!m_tokens.empty())
m_tokens.pop();
}
-// peek
-// . Returns (but does not remove) the next token on the queue.
Token& Scanner::peek() {
EnsureTokensInQueue();
assert(!m_tokens.empty()); // should we be asserting here? I mean, we really
@@ -49,21 +43,17 @@ Token& Scanner::peek() {
return m_tokens.front();
}
-// mark
-// . Returns the current mark in the stream
Mark Scanner::mark() const { return INPUT.mark(); }
-// EnsureTokensInQueue
-// . Scan until there's a valid token at the front of the queue,
-// or we're sure the queue is empty.
void Scanner::EnsureTokensInQueue() {
while (1) {
if (!m_tokens.empty()) {
Token& token = m_tokens.front();
// if this guy's valid, then we're done
- if (token.status == Token::VALID)
+ if (token.status == Token::VALID) {
return;
+ }
// here's where we clean up the impossible tokens
if (token.status == Token::INVALID) {
@@ -75,23 +65,23 @@ void Scanner::EnsureTokensInQueue() {
}
// no token? maybe we've actually finished
- if (m_endedStream)
+ if (m_endedStream) {
return;
+ }
// no? then scan...
ScanNextToken();
}
}
-// ScanNextToken
-// . The main scanning function; here we branch out and
-// scan whatever the next token should be.
void Scanner::ScanNextToken() {
- if (m_endedStream)
+ if (m_endedStream) {
return;
+ }
- if (!m_startedStream)
+ if (!m_startedStream) {
return StartStream();
+ }
// get rid of whitespace, etc. (in between tokens it should be irrelevent)
ScanToNextToken();
@@ -104,85 +94,102 @@ void Scanner::ScanNextToken() {
// *****
// end of stream
- if (!INPUT)
+ if (!INPUT) {
return EndStream();
+ }
- if (INPUT.column() == 0 && INPUT.peek() == Keys::Directive)
+ if (INPUT.column() == 0 && INPUT.peek() == Keys::Directive) {
return ScanDirective();
+ }
// document token
- if (INPUT.column() == 0 && Exp::DocStart().Matches(INPUT))
+ if (INPUT.column() == 0 && Exp::DocStart().Matches(INPUT)) {
return ScanDocStart();
+ }
- if (INPUT.column() == 0 && Exp::DocEnd().Matches(INPUT))
+ if (INPUT.column() == 0 && Exp::DocEnd().Matches(INPUT)) {
return ScanDocEnd();
+ }
// flow start/end/entry
- if (INPUT.peek() == Keys::FlowSeqStart || INPUT.peek() == Keys::FlowMapStart)
+ if (INPUT.peek() == Keys::FlowSeqStart ||
+ INPUT.peek() == Keys::FlowMapStart) {
return ScanFlowStart();
+ }
- if (INPUT.peek() == Keys::FlowSeqEnd || INPUT.peek() == Keys::FlowMapEnd)
+ if (INPUT.peek() == Keys::FlowSeqEnd || INPUT.peek() == Keys::FlowMapEnd) {
return ScanFlowEnd();
+ }
- if (INPUT.peek() == Keys::FlowEntry)
+ if (INPUT.peek() == Keys::FlowEntry) {
return ScanFlowEntry();
+ }
// block/map stuff
- if (Exp::BlockEntry().Matches(INPUT))
+ if (Exp::BlockEntry().Matches(INPUT)) {
return ScanBlockEntry();
+ }
- if ((InBlockContext() ? Exp::Key() : Exp::KeyInFlow()).Matches(INPUT))
+ if ((InBlockContext() ? Exp::Key() : Exp::KeyInFlow()).Matches(INPUT)) {
return ScanKey();
+ }
- if (GetValueRegex().Matches(INPUT))
+ if (GetValueRegex().Matches(INPUT)) {
return ScanValue();
+ }
// alias/anchor
- if (INPUT.peek() == Keys::Alias || INPUT.peek() == Keys::Anchor)
+ if (INPUT.peek() == Keys::Alias || INPUT.peek() == Keys::Anchor) {
return ScanAnchorOrAlias();
+ }
// tag
- if (INPUT.peek() == Keys::Tag)
+ if (INPUT.peek() == Keys::Tag) {
return ScanTag();
+ }
// special scalars
if (InBlockContext() && (INPUT.peek() == Keys::LiteralScalar ||
- INPUT.peek() == Keys::FoldedScalar))
+ INPUT.peek() == Keys::FoldedScalar)) {
return ScanBlockScalar();
+ }
- if (INPUT.peek() == '\'' || INPUT.peek() == '\"')
+ if (INPUT.peek() == '\'' || INPUT.peek() == '\"') {
return ScanQuotedScalar();
+ }
// plain scalars
if ((InBlockContext() ? Exp::PlainScalar() : Exp::PlainScalarInFlow())
- .Matches(INPUT))
+ .Matches(INPUT)) {
return ScanPlainScalar();
+ }
// don't know what it is!
throw ParserException(INPUT.mark(), ErrorMsg::UNKNOWN_TOKEN);
}
-// ScanToNextToken
-// . Eats input until we reach the next token-like thing.
void Scanner::ScanToNextToken() {
while (1) {
// first eat whitespace
while (INPUT && IsWhitespaceToBeEaten(INPUT.peek())) {
- if (InBlockContext() && Exp::Tab().Matches(INPUT))
+ if (InBlockContext() && Exp::Tab().Matches(INPUT)) {
m_simpleKeyAllowed = false;
+ }
INPUT.eat(1);
}
// then eat a comment
if (Exp::Comment().Matches(INPUT)) {
// eat until line break
- while (INPUT && !Exp::Break().Matches(INPUT))
+ while (INPUT && !Exp::Break().Matches(INPUT)) {
INPUT.eat(1);
+ }
}
// if it's NOT a line break, then we're done!
- if (!Exp::Break().Matches(INPUT))
+ if (!Exp::Break().Matches(INPUT)) {
break;
+ }
// otherwise, let's eat the line break and keep going
int n = Exp::Break().Match(INPUT);
@@ -192,8 +199,9 @@ void Scanner::ScanToNextToken() {
InvalidateSimpleKey();
// new line - we may be able to accept a simple key now
- if (InBlockContext())
+ if (InBlockContext()) {
m_simpleKeyAllowed = true;
+ }
}
}
@@ -210,40 +218,39 @@ void Scanner::ScanToNextToken() {
// that they can't contribute to indentation, so once you've seen a tab in a
// line, you can't start a simple key
bool Scanner::IsWhitespaceToBeEaten(char ch) {
- if (ch == ' ')
+ if (ch == ' ') {
return true;
+ }
- if (ch == '\t')
+ if (ch == '\t') {
return true;
+ }
return false;
}
-// GetValueRegex
-// . Get the appropriate regex to check if it's a value token
const RegEx& Scanner::GetValueRegex() const {
- if (InBlockContext())
+ if (InBlockContext()) {
return Exp::Value();
+ }
return m_canBeJSONFlow ? Exp::ValueInJSONFlow() : Exp::ValueInFlow();
}
-// StartStream
-// . Set the initial conditions for starting a stream.
void Scanner::StartStream() {
m_startedStream = true;
m_simpleKeyAllowed = true;
- std::auto_ptr<IndentMarker> pIndent(new IndentMarker(-1, IndentMarker::NONE));
- m_indentRefs.push_back(pIndent);
+ std::unique_ptr<IndentMarker> pIndent(
+ new IndentMarker(-1, IndentMarker::NONE));
+ m_indentRefs.push_back(std::move(pIndent));
m_indents.push(&m_indentRefs.back());
}
-// EndStream
-// . Close out the stream, finish up, etc.
void Scanner::EndStream() {
// force newline
- if (INPUT.column() > 0)
+ if (INPUT.column() > 0) {
INPUT.ResetColumn();
+ }
PopAllIndents();
PopAllSimpleKeys();
@@ -271,84 +278,80 @@ Token::TYPE Scanner::GetStartTokenFor(IndentMarker::INDENT_TYPE type) const {
throw std::runtime_error("yaml-cpp: internal error, invalid indent type");
}
-// PushIndentTo
-// . Pushes an indentation onto the stack, and enqueues the
-// proper token (sequence start or mapping start).
-// . Returns the indent marker it generates (if any).
Scanner::IndentMarker* Scanner::PushIndentTo(int column,
IndentMarker::INDENT_TYPE type) {
// are we in flow?
- if (InFlowContext())
+ if (InFlowContext()) {
return 0;
+ }
- std::auto_ptr<IndentMarker> pIndent(new IndentMarker(column, type));
+ std::unique_ptr<IndentMarker> pIndent(new IndentMarker(column, type));
IndentMarker& indent = *pIndent;
const IndentMarker& lastIndent = *m_indents.top();
// is this actually an indentation?
- if (indent.column < lastIndent.column)
+ if (indent.column < lastIndent.column) {
return 0;
+ }
if (indent.column == lastIndent.column &&
!(indent.type == IndentMarker::SEQ &&
- lastIndent.type == IndentMarker::MAP))
+ lastIndent.type == IndentMarker::MAP)) {
return 0;
+ }
// push a start token
indent.pStartToken = PushToken(GetStartTokenFor(type));
// and then the indent
m_indents.push(&indent);
- m_indentRefs.push_back(pIndent);
+ m_indentRefs.push_back(std::move(pIndent));
return &m_indentRefs.back();
}
-// PopIndentToHere
-// . Pops indentations off the stack until we reach the current indentation
-// level,
-// and enqueues the proper token each time.
-// . Then pops all invalid indentations off.
void Scanner::PopIndentToHere() {
// are we in flow?
- if (InFlowContext())
+ if (InFlowContext()) {
return;
+ }
// now pop away
while (!m_indents.empty()) {
const IndentMarker& indent = *m_indents.top();
- if (indent.column < INPUT.column())
+ if (indent.column < INPUT.column()) {
break;
+ }
if (indent.column == INPUT.column() &&
!(indent.type == IndentMarker::SEQ &&
- !Exp::BlockEntry().Matches(INPUT)))
+ !Exp::BlockEntry().Matches(INPUT))) {
break;
+ }
PopIndent();
}
- while (!m_indents.empty() && m_indents.top()->status == IndentMarker::INVALID)
+ while (!m_indents.empty() &&
+ m_indents.top()->status == IndentMarker::INVALID) {
PopIndent();
+ }
}
-// PopAllIndents
-// . Pops all indentations (except for the base empty one) off the stack,
-// and enqueues the proper token each time.
void Scanner::PopAllIndents() {
// are we in flow?
- if (InFlowContext())
+ if (InFlowContext()) {
return;
+ }
// now pop away
while (!m_indents.empty()) {
const IndentMarker& indent = *m_indents.top();
- if (indent.type == IndentMarker::NONE)
+ if (indent.type == IndentMarker::NONE) {
break;
+ }
PopIndent();
}
}
-// PopIndent
-// . Pops a single indent, pushing the proper token
void Scanner::PopIndent() {
const IndentMarker& indent = *m_indents.top();
m_indents.pop();
@@ -358,23 +361,20 @@ void Scanner::PopIndent() {
return;
}
- if (indent.type == IndentMarker::SEQ)
+ if (indent.type == IndentMarker::SEQ) {
m_tokens.push(Token(Token::BLOCK_SEQ_END, INPUT.mark()));
- else if (indent.type == IndentMarker::MAP)
+ } else if (indent.type == IndentMarker::MAP) {
m_tokens.push(Token(Token::BLOCK_MAP_END, INPUT.mark()));
+ }
}
-// GetTopIndent
int Scanner::GetTopIndent() const {
- if (m_indents.empty())
+ if (m_indents.empty()) {
return 0;
+ }
return m_indents.top()->column;
}
-// ThrowParserException
-// . Throws a ParserException with the current token location
-// (if available).
-// . Does not parse any more tokens.
void Scanner::ThrowParserException(const std::string& msg) const {
Mark mark = Mark::null_mark();
if (!m_tokens.empty()) {
@@ -383,4 +383,4 @@ void Scanner::ThrowParserException(const std::string& msg) const {
}
throw ParserException(mark, msg);
}
-}
+} // namespace YAML
diff --git a/src/third_party/yaml-cpp-0.5.3/src/scanner.h b/src/third_party/yaml-cpp-0.6.2/src/scanner.h
index b0ac6d96dbf..7bb2ccc71a5 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/scanner.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/scanner.h
@@ -24,15 +24,24 @@ namespace YAML {
class Node;
class RegEx;
+/**
+ * A scanner transforms a stream of characters into a stream of tokens.
+ */
class Scanner {
public:
- Scanner(std::istream &in);
+ explicit Scanner(std::istream &in);
~Scanner();
- // token queue management (hopefully this looks kinda stl-ish)
+ /** Returns true if there are no more tokens to be read. */
bool empty();
+
+ /** Removes the next token in the queue. */
void pop();
+
+ /** Returns, but does not remove, the next token in the queue. */
Token &peek();
+
+ /** Returns the current mark in the input stream. */
Mark mark() const;
private:
@@ -52,11 +61,29 @@ class Scanner {
private:
// scanning
+
+ /**
+ * Scans until there's a valid token at the front of the queue, or the queue
+ * is empty. The state can be checked by {@link #empty}, and the next token
+ * retrieved by {@link #peek}.
+ */
void EnsureTokensInQueue();
+
+ /**
+ * The main scanning function; this method branches out to scan whatever the
+ * next token should be.
+ */
void ScanNextToken();
+
+ /** Eats the input stream until it reaches the next token-like thing. */
void ScanToNextToken();
+
+ /** Sets the initial conditions for starting a stream. */
void StartStream();
+
+ /** Closes out the stream, finish up, etc. */
void EndStream();
+
Token *PushToken(Token::TYPE type);
bool InFlowContext() const { return !m_flows.empty(); }
@@ -64,9 +91,29 @@ class Scanner {
std::size_t GetFlowLevel() const { return m_flows.size(); }
Token::TYPE GetStartTokenFor(IndentMarker::INDENT_TYPE type) const;
+
+ /**
+ * Pushes an indentation onto the stack, and enqueues the proper token
+ * (sequence start or mapping start).
+ *
+ * @return the indent marker it generates (if any).
+ */
IndentMarker *PushIndentTo(int column, IndentMarker::INDENT_TYPE type);
+
+ /**
+ * Pops indentations off the stack until it reaches the current indentation
+ * level, and enqueues the proper token each time. Then pops all invalid
+ * indentations off.
+ */
void PopIndentToHere();
+
+ /**
+ * Pops all indentations (except for the base empty one) off the stack, and
+ * enqueues the proper token each time.
+ */
void PopAllIndents();
+
+ /** Pops a single indent, pushing the proper token. */
void PopIndent();
int GetTopIndent() const;
@@ -78,9 +125,17 @@ class Scanner {
bool VerifySimpleKey();
void PopAllSimpleKeys();
+ /**
+ * Throws a ParserException with the current token location (if available),
+ * and does not parse any more tokens.
+ */
void ThrowParserException(const std::string &msg) const;
bool IsWhitespaceToBeEaten(char ch);
+
+ /**
+ * Returns the appropriate regex to check if the next token is a value token.
+ */
const RegEx &GetValueRegex() const;
struct SimpleKey {
diff --git a/src/third_party/yaml-cpp-0.5.3/src/scanscalar.cpp b/src/third_party/yaml-cpp-0.6.2/src/scanscalar.cpp
index 8253b8d18dc..10e359d4466 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/scanscalar.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/scanscalar.cpp
@@ -28,22 +28,28 @@ std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) {
std::string scalar;
params.leadingSpaces = false;
+ if (!params.end) {
+ params.end = &Exp::Empty();
+ }
+
while (INPUT) {
// ********************************
// Phase #1: scan until line ending
std::size_t lastNonWhitespaceChar = scalar.size();
bool escapedNewline = false;
- while (!params.end.Matches(INPUT) && !Exp::Break().Matches(INPUT)) {
- if (!INPUT)
+ while (!params.end->Matches(INPUT) && !Exp::Break().Matches(INPUT)) {
+ if (!INPUT) {
break;
+ }
// document indicator?
if (INPUT.column() == 0 && Exp::DocIndicator().Matches(INPUT)) {
- if (params.onDocIndicator == BREAK)
+ if (params.onDocIndicator == BREAK) {
break;
- else if (params.onDocIndicator == THROW)
+ } else if (params.onDocIndicator == THROW) {
throw ParserException(INPUT.mark(), ErrorMsg::DOC_IN_SCALAR);
+ }
}
foundNonEmptyLine = true;
@@ -70,27 +76,31 @@ std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) {
// otherwise, just add the damn character
char ch = INPUT.get();
scalar += ch;
- if (ch != ' ' && ch != '\t')
+ if (ch != ' ' && ch != '\t') {
lastNonWhitespaceChar = scalar.size();
+ }
}
// eof? if we're looking to eat something, then we throw
if (!INPUT) {
- if (params.eatEnd)
+ if (params.eatEnd) {
throw ParserException(INPUT.mark(), ErrorMsg::EOF_IN_SCALAR);
+ }
break;
}
// doc indicator?
if (params.onDocIndicator == BREAK && INPUT.column() == 0 &&
- Exp::DocIndicator().Matches(INPUT))
+ Exp::DocIndicator().Matches(INPUT)) {
break;
+ }
// are we done via character match?
- int n = params.end.Match(INPUT);
+ int n = params.end->Match(INPUT);
if (n >= 0) {
- if (params.eatEnd)
+ if (params.eatEnd) {
INPUT.eat(n);
+ }
break;
}
@@ -107,23 +117,33 @@ std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) {
// Phase #3: scan initial spaces
// first the required indentation
- while (INPUT.peek() == ' ' && (INPUT.column() < params.indent ||
- (params.detectIndent && !foundNonEmptyLine)))
+ while (INPUT.peek() == ' ' &&
+ (INPUT.column() < params.indent ||
+ (params.detectIndent && !foundNonEmptyLine)) &&
+ !params.end->Matches(INPUT)) {
INPUT.eat(1);
+ }
// update indent if we're auto-detecting
- if (params.detectIndent && !foundNonEmptyLine)
+ if (params.detectIndent && !foundNonEmptyLine) {
params.indent = std::max(params.indent, INPUT.column());
+ }
// and then the rest of the whitespace
while (Exp::Blank().Matches(INPUT)) {
// we check for tabs that masquerade as indentation
if (INPUT.peek() == '\t' && INPUT.column() < params.indent &&
- params.onTabInIndentation == THROW)
+ params.onTabInIndentation == THROW) {
throw ParserException(INPUT.mark(), ErrorMsg::TAB_IN_INDENTATION);
+ }
- if (!params.eatLeadingWhitespace)
+ if (!params.eatLeadingWhitespace) {
break;
+ }
+
+ if (params.end->Matches(INPUT)) {
+ break;
+ }
INPUT.eat(1);
}
@@ -143,26 +163,29 @@ std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) {
break;
case FOLD_BLOCK:
if (!emptyLine && !nextEmptyLine && !moreIndented &&
- !nextMoreIndented && INPUT.column() >= params.indent)
+ !nextMoreIndented && INPUT.column() >= params.indent) {
scalar += " ";
- else if (nextEmptyLine)
+ } else if (nextEmptyLine) {
foldedNewlineCount++;
- else
+ } else {
scalar += "\n";
+ }
if (!nextEmptyLine && foldedNewlineCount > 0) {
scalar += std::string(foldedNewlineCount - 1, '\n');
if (foldedNewlineStartedMoreIndented ||
- nextMoreIndented | !foundNonEmptyLine)
+ nextMoreIndented | !foundNonEmptyLine) {
scalar += "\n";
+ }
foldedNewlineCount = 0;
}
break;
case FOLD_FLOW:
- if (nextEmptyLine)
+ if (nextEmptyLine) {
scalar += "\n";
- else if (!emptyLine && !nextEmptyLine && !escapedNewline)
+ } else if (!emptyLine && !nextEmptyLine && !escapedNewline) {
scalar += " ";
+ }
break;
}
}
@@ -182,35 +205,41 @@ std::string ScanScalar(Stream& INPUT, ScanScalarParams& params) {
if (params.trimTrailingSpaces) {
std::size_t pos = scalar.find_last_not_of(' ');
if (lastEscapedChar != std::string::npos) {
- if (pos < lastEscapedChar || pos == std::string::npos)
+ if (pos < lastEscapedChar || pos == std::string::npos) {
pos = lastEscapedChar;
+ }
}
- if (pos < scalar.size())
+ if (pos < scalar.size()) {
scalar.erase(pos + 1);
+ }
}
switch (params.chomp) {
case CLIP: {
std::size_t pos = scalar.find_last_not_of('\n');
if (lastEscapedChar != std::string::npos) {
- if (pos < lastEscapedChar || pos == std::string::npos)
+ if (pos < lastEscapedChar || pos == std::string::npos) {
pos = lastEscapedChar;
+ }
}
- if (pos == std::string::npos)
+ if (pos == std::string::npos) {
scalar.erase();
- else if (pos + 1 < scalar.size())
+ } else if (pos + 1 < scalar.size()) {
scalar.erase(pos + 2);
+ }
} break;
case STRIP: {
std::size_t pos = scalar.find_last_not_of('\n');
if (lastEscapedChar != std::string::npos) {
- if (pos < lastEscapedChar || pos == std::string::npos)
+ if (pos < lastEscapedChar || pos == std::string::npos) {
pos = lastEscapedChar;
+ }
}
- if (pos == std::string::npos)
+ if (pos == std::string::npos) {
scalar.erase();
- else if (pos < scalar.size())
+ } else if (pos < scalar.size()) {
scalar.erase(pos + 1);
+ }
} break;
default:
break;
diff --git a/src/third_party/yaml-cpp-0.5.3/src/scanscalar.h b/src/third_party/yaml-cpp-0.6.2/src/scanscalar.h
index 62da13c34f7..c3a574ad9b6 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/scanscalar.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/scanscalar.h
@@ -19,7 +19,8 @@ enum FOLD { DONT_FOLD, FOLD_BLOCK, FOLD_FLOW };
struct ScanScalarParams {
ScanScalarParams()
- : eatEnd(false),
+ : end(nullptr),
+ eatEnd(false),
indent(0),
detectIndent(false),
eatLeadingWhitespace(0),
@@ -32,7 +33,8 @@ struct ScanScalarParams {
leadingSpaces(false) {}
// input:
- RegEx end; // what condition ends this scalar?
+ const RegEx* end; // what condition ends this scalar?
+ // unowned.
bool eatEnd; // should we eat that condition when we see it?
int indent; // what level of indentation should be eaten and ignored?
bool detectIndent; // should we try to autodetect the indent?
diff --git a/src/third_party/yaml-cpp-0.5.3/src/scantag.cpp b/src/third_party/yaml-cpp-0.6.2/src/scantag.cpp
index c5b39652ad0..c5b39652ad0 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/scantag.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/scantag.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/scantag.h b/src/third_party/yaml-cpp-0.6.2/src/scantag.h
index 522ba5495e8..522ba5495e8 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/scantag.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/scantag.h
diff --git a/src/third_party/yaml-cpp-0.5.3/src/scantoken.cpp b/src/third_party/yaml-cpp-0.6.2/src/scantoken.cpp
index 180ad00ab0a..fd8758d7815 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/scantoken.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/scantoken.cpp
@@ -297,8 +297,8 @@ void Scanner::ScanPlainScalar() {
// set up the scanning parameters
ScanScalarParams params;
- params.end = (InFlowContext() ? Exp::EndScalarInFlow() : Exp::EndScalar()) ||
- (Exp::BlankOrBreak() + Exp::Comment());
+ params.end =
+ (InFlowContext() ? &Exp::ScanScalarEndInFlow() : &Exp::ScanScalarEnd());
params.eatEnd = false;
params.indent = (InFlowContext() ? 0 : GetTopIndent() + 1);
params.fold = FOLD_FLOW;
@@ -338,7 +338,8 @@ void Scanner::ScanQuotedScalar() {
// setup the scanning parameters
ScanScalarParams params;
- params.end = (single ? RegEx(quote) && !Exp::EscSingleQuote() : RegEx(quote));
+ RegEx end = (single ? RegEx(quote) && !Exp::EscSingleQuote() : RegEx(quote));
+ params.end = &end;
params.eatEnd = true;
params.escape = (single ? '\'' : '\\');
params.indent = 0;
diff --git a/src/third_party/yaml-cpp-0.5.3/src/setting.h b/src/third_party/yaml-cpp-0.6.2/src/setting.h
index 3ff8c20986b..b78d40e2e85 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/setting.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/setting.h
@@ -20,7 +20,7 @@ class Setting {
Setting() : m_value() {}
const T get() const { return m_value; }
- std::auto_ptr<SettingChangeBase> set(const T& value);
+ std::unique_ptr<SettingChangeBase> set(const T& value);
void restore(const Setting<T>& oldSetting) { m_value = oldSetting.get(); }
private:
@@ -49,8 +49,8 @@ class SettingChange : public SettingChangeBase {
};
template <typename T>
-inline std::auto_ptr<SettingChangeBase> Setting<T>::set(const T& value) {
- std::auto_ptr<SettingChangeBase> pChange(new SettingChange<T>(this));
+inline std::unique_ptr<SettingChangeBase> Setting<T>::set(const T& value) {
+ std::unique_ptr<SettingChangeBase> pChange(new SettingChange<T>(this));
m_value = value;
return pChange;
}
@@ -62,10 +62,6 @@ class SettingChanges : private noncopyable {
void clear() {
restore();
-
- for (setting_changes::const_iterator it = m_settingChanges.begin();
- it != m_settingChanges.end(); ++it)
- delete *it;
m_settingChanges.clear();
}
@@ -75,23 +71,23 @@ class SettingChanges : private noncopyable {
(*it)->pop();
}
- void push(std::auto_ptr<SettingChangeBase> pSettingChange) {
- m_settingChanges.push_back(pSettingChange.release());
+ void push(std::unique_ptr<SettingChangeBase> pSettingChange) {
+ m_settingChanges.push_back(std::move(pSettingChange));
}
- // like std::auto_ptr - assignment is transfer of ownership
- SettingChanges& operator=(SettingChanges& rhs) {
+ // like std::unique_ptr - assignment is transfer of ownership
+ SettingChanges& operator=(SettingChanges&& rhs) {
if (this == &rhs)
return *this;
clear();
- m_settingChanges = rhs.m_settingChanges;
- rhs.m_settingChanges.clear();
+ std::swap(m_settingChanges, rhs.m_settingChanges);
+
return *this;
}
private:
- typedef std::vector<SettingChangeBase*> setting_changes;
+ typedef std::vector<std::unique_ptr<SettingChangeBase>> setting_changes;
setting_changes m_settingChanges;
};
}
diff --git a/src/third_party/yaml-cpp-0.5.3/src/simplekey.cpp b/src/third_party/yaml-cpp-0.6.2/src/simplekey.cpp
index 70f56b6ae42..70f56b6ae42 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/simplekey.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/simplekey.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/singledocparser.cpp b/src/third_party/yaml-cpp-0.6.2/src/singledocparser.cpp
index cde1d2062f8..a27c1c3b04d 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/singledocparser.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/singledocparser.cpp
@@ -11,6 +11,7 @@
#include "yaml-cpp/eventhandler.h"
#include "yaml-cpp/exceptions.h" // IWYU pragma: keep
#include "yaml-cpp/mark.h"
+#include "yaml-cpp/null.h"
namespace YAML {
SingleDocParser::SingleDocParser(Scanner& scanner, const Directives& directives)
@@ -75,7 +76,7 @@ void SingleDocParser::HandleNode(EventHandler& eventHandler) {
const Token& token = m_scanner.peek();
- if (token.type == Token::PLAIN_SCALAR && token.value == "null") {
+ if (token.type == Token::PLAIN_SCALAR && IsNullString(token.value)) {
eventHandler.OnNull(mark, anchor);
m_scanner.pop();
return;
diff --git a/src/third_party/yaml-cpp-0.5.3/src/singledocparser.h b/src/third_party/yaml-cpp-0.6.2/src/singledocparser.h
index ed0aad503bc..2b92067cddb 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/singledocparser.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/singledocparser.h
@@ -53,7 +53,7 @@ class SingleDocParser : private noncopyable {
private:
Scanner& m_scanner;
const Directives& m_directives;
- std::auto_ptr<CollectionStack> m_pCollectionStack;
+ std::unique_ptr<CollectionStack> m_pCollectionStack;
typedef std::map<std::string, anchor_t> Anchors;
Anchors m_anchors;
diff --git a/src/third_party/yaml-cpp-0.5.3/src/stream.cpp b/src/third_party/yaml-cpp-0.6.2/src/stream.cpp
index 3b013cfa7d3..3b013cfa7d3 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/stream.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/stream.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/stream.h b/src/third_party/yaml-cpp-0.6.2/src/stream.h
index 42d542d5b16..42d542d5b16 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/stream.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/stream.h
diff --git a/src/third_party/yaml-cpp-0.5.3/src/streamcharsource.h b/src/third_party/yaml-cpp-0.6.2/src/streamcharsource.h
index 624599e65da..624599e65da 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/streamcharsource.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/streamcharsource.h
diff --git a/src/third_party/yaml-cpp-0.5.3/src/stringsource.h b/src/third_party/yaml-cpp-0.6.2/src/stringsource.h
index 6fee44bb288..6fee44bb288 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/stringsource.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/stringsource.h
diff --git a/src/third_party/yaml-cpp-0.5.3/src/tag.cpp b/src/third_party/yaml-cpp-0.6.2/src/tag.cpp
index 51435520e46..51435520e46 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/tag.cpp
+++ b/src/third_party/yaml-cpp-0.6.2/src/tag.cpp
diff --git a/src/third_party/yaml-cpp-0.5.3/src/tag.h b/src/third_party/yaml-cpp-0.6.2/src/tag.h
index ac30673b9e8..ac30673b9e8 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/tag.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/tag.h
diff --git a/src/third_party/yaml-cpp-0.5.3/src/token.h b/src/third_party/yaml-cpp-0.6.2/src/token.h
index ad0b7d0a005..ad0b7d0a005 100644
--- a/src/third_party/yaml-cpp-0.5.3/src/token.h
+++ b/src/third_party/yaml-cpp-0.6.2/src/token.h