├── CMakeLists.txt ├── LICENSE ├── README.md ├── config └── devq.yaml ├── include └── robot_control │ ├── fsm │ ├── fsm_state.h │ ├── fsm_state_lie_down.h │ ├── fsm_state_passive.h │ ├── fsm_state_rl_model.h │ ├── fsm_state_soft_stop.h │ └── fsm_state_stand_up.h │ ├── remote_control.h │ ├── robot.h │ ├── robot_control.h │ └── robot_data.h ├── model └── devq │ └── policy.mnn ├── package.xml ├── resources └── devq │ ├── meshes │ ├── abad_link.STL │ ├── base_link.STL │ ├── foot_link.STL │ ├── hip_link.STL │ └── knee_link.STL │ └── urdf │ └── devq.urdf ├── sensorimotor_interface ├── include │ ├── sensorimotor │ │ ├── actuators.h │ │ └── imu.h │ └── sensorimotor_interface.h └── lib │ ├── aarch64 │ └── libsensorimotor_interface.so │ └── x86_64 │ └── libsensorimotor_interface.so ├── src ├── main.cpp ├── remote_control.cpp ├── robot.cpp └── robot_control.cpp └── third-party ├── CMakeLists.txt └── yaml-cpp ├── .clang-format ├── .codedocs ├── .travis.yml ├── BUILD.bazel ├── CMakeLists.txt ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── WORKSPACE ├── appveyor.yml ├── cmake_uninstall.cmake.in ├── docs ├── Breaking-Changes.md ├── How-To-Emit-YAML.md ├── How-To-Parse-A-Document-(Old-API).md ├── Strings.md ├── Tutorial.md ├── _config.yml └── index.md ├── include └── yaml-cpp │ ├── anchor.h │ ├── binary.h │ ├── contrib │ ├── anchordict.h │ └── graphbuilder.h │ ├── depthguard.h │ ├── dll.h │ ├── emitfromevents.h │ ├── emitter.h │ ├── emitterdef.h │ ├── emittermanip.h │ ├── emitterstyle.h │ ├── eventhandler.h │ ├── exceptions.h │ ├── mark.h │ ├── node │ ├── convert.h │ ├── detail │ │ ├── impl.h │ │ ├── iterator.h │ │ ├── iterator_fwd.h │ │ ├── memory.h │ │ ├── node.h │ │ ├── node_data.h │ │ ├── node_iterator.h │ │ └── node_ref.h │ ├── emit.h │ ├── impl.h │ ├── iterator.h │ ├── node.h │ ├── parse.h │ ├── ptr.h │ └── type.h │ ├── noexcept.h │ ├── null.h │ ├── ostream_wrapper.h │ ├── parser.h │ ├── stlemitter.h │ ├── traits.h │ └── yaml.h ├── install.txt ├── src ├── binary.cpp ├── collectionstack.h ├── contrib │ ├── graphbuilder.cpp │ ├── graphbuilderadapter.cpp │ ├── graphbuilderadapter.h │ ├── yaml-cpp.natvis │ └── yaml-cpp.natvis.md ├── convert.cpp ├── depthguard.cpp ├── directives.cpp ├── directives.h ├── emit.cpp ├── emitfromevents.cpp ├── emitter.cpp ├── emitterstate.cpp ├── emitterstate.h ├── emitterutils.cpp ├── emitterutils.h ├── exceptions.cpp ├── exp.cpp ├── exp.h ├── indentation.h ├── memory.cpp ├── node.cpp ├── node_data.cpp ├── nodebuilder.cpp ├── nodebuilder.h ├── nodeevents.cpp ├── nodeevents.h ├── null.cpp ├── ostream_wrapper.cpp ├── parse.cpp ├── parser.cpp ├── ptr_vector.h ├── regex_yaml.cpp ├── regex_yaml.h ├── regeximpl.h ├── scanner.cpp ├── scanner.h ├── scanscalar.cpp ├── scanscalar.h ├── scantag.cpp ├── scantag.h ├── scantoken.cpp ├── setting.h ├── simplekey.cpp ├── singledocparser.cpp ├── singledocparser.h ├── stream.cpp ├── stream.h ├── streamcharsource.h ├── stringsource.h ├── tag.cpp ├── tag.h └── token.h ├── test ├── BUILD.bazel ├── CMakeLists.txt ├── binary_test.cpp ├── create-emitter-tests.py ├── gtest-1.11.0 │ ├── .clang-format │ ├── .github │ │ └── ISSUE_TEMPLATE │ │ │ ├── 00-bug_report.md │ │ │ ├── 10-feature_request.md │ │ │ └── config.yml │ ├── .gitignore │ ├── BUILD.bazel │ ├── CMakeLists.txt │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── README.md │ ├── WORKSPACE │ ├── ci │ │ ├── linux-presubmit.sh │ │ └── macos-presubmit.sh │ ├── docs │ │ ├── _config.yml │ │ ├── _data │ │ │ └── navigation.yml │ │ ├── _layouts │ │ │ └── default.html │ │ ├── _sass │ │ │ └── main.scss │ │ ├── advanced.md │ │ ├── assets │ │ │ └── css │ │ │ │ └── style.scss │ │ ├── community_created_documentation.md │ │ ├── faq.md │ │ ├── gmock_cheat_sheet.md │ │ ├── gmock_cook_book.md │ │ ├── gmock_faq.md │ │ ├── gmock_for_dummies.md │ │ ├── index.md │ │ ├── pkgconfig.md │ │ ├── platforms.md │ │ ├── primer.md │ │ ├── quickstart-bazel.md │ │ ├── quickstart-cmake.md │ │ ├── reference │ │ │ ├── actions.md │ │ │ ├── assertions.md │ │ │ ├── matchers.md │ │ │ ├── mocking.md │ │ │ └── testing.md │ │ └── samples.md │ ├── googlemock │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── cmake │ │ │ ├── gmock.pc.in │ │ │ └── gmock_main.pc.in │ │ ├── docs │ │ │ └── README.md │ │ ├── include │ │ │ └── gmock │ │ │ │ ├── gmock-actions.h │ │ │ │ ├── gmock-cardinalities.h │ │ │ │ ├── gmock-function-mocker.h │ │ │ │ ├── gmock-matchers.h │ │ │ │ ├── gmock-more-actions.h │ │ │ │ ├── gmock-more-matchers.h │ │ │ │ ├── gmock-nice-strict.h │ │ │ │ ├── gmock-spec-builders.h │ │ │ │ ├── gmock.h │ │ │ │ └── internal │ │ │ │ ├── custom │ │ │ │ ├── README.md │ │ │ │ ├── gmock-generated-actions.h │ │ │ │ ├── gmock-matchers.h │ │ │ │ └── gmock-port.h │ │ │ │ ├── gmock-internal-utils.h │ │ │ │ ├── gmock-port.h │ │ │ │ └── gmock-pp.h │ │ ├── scripts │ │ │ ├── README.md │ │ │ ├── fuse_gmock_files.py │ │ │ └── generator │ │ │ │ ├── LICENSE │ │ │ │ ├── README │ │ │ │ ├── README.cppclean │ │ │ │ ├── cpp │ │ │ │ ├── __init__.py │ │ │ │ ├── ast.py │ │ │ │ ├── gmock_class.py │ │ │ │ ├── gmock_class_test.py │ │ │ │ ├── keywords.py │ │ │ │ ├── tokenize.py │ │ │ │ └── utils.py │ │ │ │ └── gmock_gen.py │ │ ├── src │ │ │ ├── gmock-all.cc │ │ │ ├── gmock-cardinalities.cc │ │ │ ├── gmock-internal-utils.cc │ │ │ ├── gmock-matchers.cc │ │ │ ├── gmock-spec-builders.cc │ │ │ ├── gmock.cc │ │ │ └── gmock_main.cc │ │ └── test │ │ │ ├── BUILD.bazel │ │ │ ├── gmock-actions_test.cc │ │ │ ├── gmock-cardinalities_test.cc │ │ │ ├── gmock-function-mocker_test.cc │ │ │ ├── gmock-internal-utils_test.cc │ │ │ ├── gmock-matchers_test.cc │ │ │ ├── gmock-more-actions_test.cc │ │ │ ├── gmock-nice-strict_test.cc │ │ │ ├── gmock-port_test.cc │ │ │ ├── gmock-pp-string_test.cc │ │ │ ├── gmock-pp_test.cc │ │ │ ├── gmock-spec-builders_test.cc │ │ │ ├── gmock_all_test.cc │ │ │ ├── gmock_ex_test.cc │ │ │ ├── gmock_leak_test.py │ │ │ ├── gmock_leak_test_.cc │ │ │ ├── gmock_link2_test.cc │ │ │ ├── gmock_link_test.cc │ │ │ ├── gmock_link_test.h │ │ │ ├── gmock_output_test.py │ │ │ ├── gmock_output_test_.cc │ │ │ ├── gmock_output_test_golden.txt │ │ │ ├── gmock_stress_test.cc │ │ │ ├── gmock_test.cc │ │ │ └── gmock_test_utils.py │ ├── googletest │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── cmake │ │ │ ├── Config.cmake.in │ │ │ ├── gtest.pc.in │ │ │ ├── gtest_main.pc.in │ │ │ ├── internal_utils.cmake │ │ │ └── libgtest.la.in │ │ ├── docs │ │ │ └── README.md │ │ ├── include │ │ │ └── gtest │ │ │ │ ├── gtest-death-test.h │ │ │ │ ├── gtest-matchers.h │ │ │ │ ├── gtest-message.h │ │ │ │ ├── gtest-param-test.h │ │ │ │ ├── gtest-printers.h │ │ │ │ ├── gtest-spi.h │ │ │ │ ├── gtest-test-part.h │ │ │ │ ├── gtest-typed-test.h │ │ │ │ ├── gtest.h │ │ │ │ ├── gtest_pred_impl.h │ │ │ │ ├── gtest_prod.h │ │ │ │ └── internal │ │ │ │ ├── custom │ │ │ │ ├── README.md │ │ │ │ ├── gtest-port.h │ │ │ │ ├── gtest-printers.h │ │ │ │ └── gtest.h │ │ │ │ ├── gtest-death-test-internal.h │ │ │ │ ├── gtest-filepath.h │ │ │ │ ├── gtest-internal.h │ │ │ │ ├── gtest-param-util.h │ │ │ │ ├── gtest-port-arch.h │ │ │ │ ├── gtest-port.h │ │ │ │ ├── gtest-string.h │ │ │ │ └── gtest-type-util.h │ │ ├── samples │ │ │ ├── prime_tables.h │ │ │ ├── sample1.cc │ │ │ ├── sample1.h │ │ │ ├── sample10_unittest.cc │ │ │ ├── sample1_unittest.cc │ │ │ ├── sample2.cc │ │ │ ├── sample2.h │ │ │ ├── sample2_unittest.cc │ │ │ ├── sample3-inl.h │ │ │ ├── sample3_unittest.cc │ │ │ ├── sample4.cc │ │ │ ├── sample4.h │ │ │ ├── sample4_unittest.cc │ │ │ ├── sample5_unittest.cc │ │ │ ├── sample6_unittest.cc │ │ │ ├── sample7_unittest.cc │ │ │ ├── sample8_unittest.cc │ │ │ └── sample9_unittest.cc │ │ ├── scripts │ │ │ ├── README.md │ │ │ ├── common.py │ │ │ ├── fuse_gtest_files.py │ │ │ ├── gen_gtest_pred_impl.py │ │ │ ├── gtest-config.in │ │ │ ├── release_docs.py │ │ │ ├── run_with_path.py │ │ │ ├── upload.py │ │ │ └── upload_gtest.py │ │ ├── src │ │ │ ├── gtest-all.cc │ │ │ ├── gtest-death-test.cc │ │ │ ├── gtest-filepath.cc │ │ │ ├── gtest-internal-inl.h │ │ │ ├── gtest-matchers.cc │ │ │ ├── gtest-port.cc │ │ │ ├── gtest-printers.cc │ │ │ ├── gtest-test-part.cc │ │ │ ├── gtest-typed-test.cc │ │ │ ├── gtest.cc │ │ │ └── gtest_main.cc │ │ └── test │ │ │ ├── BUILD.bazel │ │ │ ├── googletest-break-on-failure-unittest.py │ │ │ ├── googletest-break-on-failure-unittest_.cc │ │ │ ├── googletest-catch-exceptions-test.py │ │ │ ├── googletest-catch-exceptions-test_.cc │ │ │ ├── googletest-color-test.py │ │ │ ├── googletest-color-test_.cc │ │ │ ├── googletest-death-test-test.cc │ │ │ ├── googletest-death-test_ex_test.cc │ │ │ ├── googletest-env-var-test.py │ │ │ ├── googletest-env-var-test_.cc │ │ │ ├── googletest-failfast-unittest.py │ │ │ ├── googletest-failfast-unittest_.cc │ │ │ ├── googletest-filepath-test.cc │ │ │ ├── googletest-filter-unittest.py │ │ │ ├── googletest-filter-unittest_.cc │ │ │ ├── googletest-global-environment-unittest.py │ │ │ ├── googletest-global-environment-unittest_.cc │ │ │ ├── googletest-json-outfiles-test.py │ │ │ ├── googletest-json-output-unittest.py │ │ │ ├── googletest-list-tests-unittest.py │ │ │ ├── googletest-list-tests-unittest_.cc │ │ │ ├── googletest-listener-test.cc │ │ │ ├── googletest-message-test.cc │ │ │ ├── googletest-options-test.cc │ │ │ ├── googletest-output-test-golden-lin.txt │ │ │ ├── googletest-output-test.py │ │ │ ├── googletest-output-test_.cc │ │ │ ├── googletest-param-test-invalid-name1-test.py │ │ │ ├── googletest-param-test-invalid-name1-test_.cc │ │ │ ├── googletest-param-test-invalid-name2-test.py │ │ │ ├── googletest-param-test-invalid-name2-test_.cc │ │ │ ├── googletest-param-test-test.cc │ │ │ ├── googletest-param-test-test.h │ │ │ ├── googletest-param-test2-test.cc │ │ │ ├── googletest-port-test.cc │ │ │ ├── googletest-printers-test.cc │ │ │ ├── googletest-setuptestsuite-test.py │ │ │ ├── googletest-setuptestsuite-test_.cc │ │ │ ├── googletest-shuffle-test.py │ │ │ ├── googletest-shuffle-test_.cc │ │ │ ├── googletest-test-part-test.cc │ │ │ ├── googletest-throw-on-failure-test.py │ │ │ ├── googletest-throw-on-failure-test_.cc │ │ │ ├── googletest-uninitialized-test.py │ │ │ ├── googletest-uninitialized-test_.cc │ │ │ ├── gtest-typed-test2_test.cc │ │ │ ├── gtest-typed-test_test.cc │ │ │ ├── gtest-typed-test_test.h │ │ │ ├── gtest-unittest-api_test.cc │ │ │ ├── gtest_all_test.cc │ │ │ ├── gtest_assert_by_exception_test.cc │ │ │ ├── gtest_environment_test.cc │ │ │ ├── gtest_help_test.py │ │ │ ├── gtest_help_test_.cc │ │ │ ├── gtest_json_test_utils.py │ │ │ ├── gtest_list_output_unittest.py │ │ │ ├── gtest_list_output_unittest_.cc │ │ │ ├── gtest_main_unittest.cc │ │ │ ├── gtest_no_test_unittest.cc │ │ │ ├── gtest_pred_impl_unittest.cc │ │ │ ├── gtest_premature_exit_test.cc │ │ │ ├── gtest_prod_test.cc │ │ │ ├── gtest_repeat_test.cc │ │ │ ├── gtest_skip_check_output_test.py │ │ │ ├── gtest_skip_environment_check_output_test.py │ │ │ ├── gtest_skip_in_environment_setup_test.cc │ │ │ ├── gtest_skip_test.cc │ │ │ ├── gtest_sole_header_test.cc │ │ │ ├── gtest_stress_test.cc │ │ │ ├── gtest_test_macro_stack_footprint_test.cc │ │ │ ├── gtest_test_utils.py │ │ │ ├── gtest_testbridge_test.py │ │ │ ├── gtest_testbridge_test_.cc │ │ │ ├── gtest_throw_on_failure_ex_test.cc │ │ │ ├── gtest_unittest.cc │ │ │ ├── gtest_xml_outfile1_test_.cc │ │ │ ├── gtest_xml_outfile2_test_.cc │ │ │ ├── gtest_xml_outfiles_test.py │ │ │ ├── gtest_xml_output_unittest.py │ │ │ ├── gtest_xml_output_unittest_.cc │ │ │ ├── gtest_xml_test_utils.py │ │ │ ├── production.cc │ │ │ └── production.h │ └── library.json ├── handler_test.h ├── integration │ ├── emitter_test.cpp │ ├── encoding_test.cpp │ ├── error_messages_test.cpp │ ├── gen_emitter_test.cpp │ ├── handler_spec_test.cpp │ ├── handler_test.cpp │ ├── load_node_test.cpp │ └── node_spec_test.cpp ├── main.cpp ├── mock_event_handler.h ├── node │ └── node_test.cpp ├── ostream_wrapper_test.cpp ├── parser_test.cpp ├── regex_test.cpp └── specexamples.h ├── util ├── CMakeLists.txt ├── api.cpp ├── parse.cpp ├── read.cpp └── sandbox.cpp ├── yaml-cpp-config.cmake.in └── yaml-cpp.pc.in /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2024, AlphaDogDeveloper 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of the copyright holder nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 23 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 27 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /include/robot_control/fsm/fsm_state_passive.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @ Dev Robot Control SDK 3 | * @ Copyright (c) 2024 WEILAN.Co.Ltd. All Rights Reserved. 4 | ******************************************************************************/ 5 | #pragma once 6 | 7 | #include "robot_control/fsm/fsm_state.h" 8 | #include 9 | 10 | /** 11 | * Passive state 12 | */ 13 | class FSMStatePassive : public FSMState 14 | { 15 | public: 16 | explicit FSMStatePassive(RobotData *robot_data) : FSMState(robot_data) 17 | { 18 | state_name_ = FSMStateName::PASSIVE; 19 | } 20 | ~FSMStatePassive() {} 21 | 22 | // Enter this state 23 | void on_enter() 24 | { 25 | std::cout << "[FSMStatePassive] enter" <robot_command.joints[i].kp = 0; 34 | robot_data_->robot_command.joints[i].kd = 0; 35 | robot_data_->robot_command.joints[i].tau = 0; 36 | robot_data_->robot_command.joints[i].vel = 0; 37 | } 38 | } 39 | 40 | // Check transition to desired state from user command 41 | FSMStateName check_transition() 42 | { 43 | FSMStateName next_name = state_name_; 44 | 45 | switch (robot_data_->remote_command.mode[0]) 46 | { 47 | case 0: 48 | next_name = FSMStateName::PASSIVE; 49 | break; 50 | case 1: 51 | next_name = FSMStateName::LIE_DOWN; 52 | break; 53 | case 2: 54 | next_name = FSMStateName::STAND_UP; 55 | break; 56 | // case 3: 57 | // next_name = FSMStateName::RL_MODEL; 58 | // break; 59 | default: 60 | break; 61 | } 62 | 63 | return next_name; 64 | } 65 | 66 | // Clean up 67 | void on_exit() 68 | { 69 | std::cout << "[FSMStatePassive] exit" < 7 | #include 8 | #include 9 | #include 10 | #include "robot_control/robot_data.h" 11 | 12 | /** 13 | * Abstract class for any kind of remote controller. 14 | */ 15 | class RemoteControl 16 | { 17 | public: 18 | RemoteControl(); 19 | virtual ~RemoteControl(); 20 | 21 | void get_command(RemoteCommand &cmd); 22 | 23 | protected: 24 | RemoteCommand cmd_; 25 | std::mutex cmd_mutex_; 26 | }; 27 | 28 | /** 29 | * Remote controller base on ROS communication. 30 | */ 31 | class RosRemoteControl: public RemoteControl 32 | { 33 | public: 34 | RosRemoteControl(); 35 | virtual ~RosRemoteControl(); 36 | 37 | protected: 38 | void on_set_mode_callback(const std_msgs::Int32MultiArray::ConstPtr &msg); 39 | void on_set_velocity_callback(const std_msgs::Float32MultiArray::ConstPtr &msg); 40 | 41 | protected: 42 | ros::NodeHandle node_; 43 | std::vector subscribers_; 44 | }; -------------------------------------------------------------------------------- /model/devq/policy.mnn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaDogDeveloper/dev_robot_control_sdk/533a11c1f368a237920d6bc1e3199467620587eb/model/devq/policy.mnn -------------------------------------------------------------------------------- /resources/devq/meshes/abad_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaDogDeveloper/dev_robot_control_sdk/533a11c1f368a237920d6bc1e3199467620587eb/resources/devq/meshes/abad_link.STL -------------------------------------------------------------------------------- /resources/devq/meshes/base_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaDogDeveloper/dev_robot_control_sdk/533a11c1f368a237920d6bc1e3199467620587eb/resources/devq/meshes/base_link.STL -------------------------------------------------------------------------------- /resources/devq/meshes/foot_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaDogDeveloper/dev_robot_control_sdk/533a11c1f368a237920d6bc1e3199467620587eb/resources/devq/meshes/foot_link.STL -------------------------------------------------------------------------------- /resources/devq/meshes/hip_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaDogDeveloper/dev_robot_control_sdk/533a11c1f368a237920d6bc1e3199467620587eb/resources/devq/meshes/hip_link.STL -------------------------------------------------------------------------------- /resources/devq/meshes/knee_link.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaDogDeveloper/dev_robot_control_sdk/533a11c1f368a237920d6bc1e3199467620587eb/resources/devq/meshes/knee_link.STL -------------------------------------------------------------------------------- /sensorimotor_interface/include/sensorimotor/imu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #pragma pack(1) 11 | 12 | /** 13 | * IMU data structure. 14 | */ 15 | typedef struct 16 | { 17 | // Acceleration. uinit: m/s2 18 | float acc_x; 19 | float acc_y; 20 | float acc_z; 21 | 22 | // Angular velocity. uinit: rad/s 23 | float gyro_x; 24 | float gyro_y; 25 | float gyro_z; 26 | 27 | // Orientation. uinit: rad 28 | float pitch; 29 | float roll; 30 | float yaw; 31 | 32 | // Orientation in quaternion 33 | float quaternion_w; 34 | float quaternion_x; 35 | float quaternion_y; 36 | float quaternion_z; 37 | } imu_data_t; 38 | 39 | #pragma pack() 40 | 41 | /** 42 | * IMU data callback function type. 43 | * @param data IMU data 44 | * @param param Pointer for using in class 45 | */ 46 | typedef void (*imu_data_callback_t)(const imu_data_t *data, void *param); 47 | 48 | /** 49 | * Initialize IMU device. 50 | * @param device_path IMU device path. 51 | * @param calibrate Calibrate IMU orientation. 52 | * @param callback Output IMU data. 53 | * @return 0 for success, others for failure. 54 | */ 55 | int initialize_imu(const char *device_path, bool calibrate=false, 56 | imu_data_callback_t callback=NULL, void *callback_param=NULL); 57 | 58 | /** 59 | * Deinitialize IMU device. 60 | */ 61 | void deinitialize_imu(); 62 | 63 | /** 64 | * Get the current IMU data. 65 | * @param data IMU data. 66 | * @return 0 for success, others for failure. 67 | */ 68 | int get_imu_data(imu_data_t *data); 69 | 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | -------------------------------------------------------------------------------- /sensorimotor_interface/include/sensorimotor_interface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sensorimotor/imu.h" 4 | #include "sensorimotor/actuators.h" 5 | -------------------------------------------------------------------------------- /sensorimotor_interface/lib/aarch64/libsensorimotor_interface.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaDogDeveloper/dev_robot_control_sdk/533a11c1f368a237920d6bc1e3199467620587eb/sensorimotor_interface/lib/aarch64/libsensorimotor_interface.so -------------------------------------------------------------------------------- /sensorimotor_interface/lib/x86_64/libsensorimotor_interface.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaDogDeveloper/dev_robot_control_sdk/533a11c1f368a237920d6bc1e3199467620587eb/sensorimotor_interface/lib/x86_64/libsensorimotor_interface.so -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @ Dev Robot Control SDK 3 | * @ Copyright (c) 2024 WEILAN.Co.Ltd. All Rights Reserved. 4 | ******************************************************************************/ 5 | #include 6 | #include 7 | #include "robot_control/robot_control.h" 8 | 9 | int main(int argc, char **argv) 10 | { 11 | int err; 12 | 13 | ros::init(argc, argv, "robot_control", ros::init_options::NoRosout); 14 | 15 | // Parse args 16 | std::string config_path; 17 | if (argc > 1) 18 | { 19 | config_path = argv[1]; 20 | } 21 | else 22 | { 23 | printf("Usage: ./robot_control [YAML config file path]\n"); 24 | return 1; 25 | } 26 | 27 | // Create robot control 28 | RobotControl robot_control(config_path); 29 | 30 | // Initialize robot controller 31 | err = robot_control.initialize(); 32 | if (err != 0) 33 | { 34 | printf("[main] Failed to initialize (error:%d).\n", err); 35 | return 2; 36 | } 37 | 38 | // Start robot controller 39 | err = robot_control.start(); 40 | if (err != 0) 41 | { 42 | printf("[main] Failed to start (error:%d).\n", err); 43 | return 3; 44 | } 45 | 46 | // Spin 47 | ros::spin(); 48 | 49 | // Stop robot controller 50 | robot_control.stop(); 51 | 52 | // Deinitialize robot controller 53 | robot_control.deinitialize(); 54 | return 0; 55 | } -------------------------------------------------------------------------------- /src/remote_control.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @ Dev Robot Control SDK 3 | * @ Copyright (c) 2024 WEILAN.Co.Ltd. All Rights Reserved. 4 | ******************************************************************************/ 5 | #include "robot_control/remote_control.h" 6 | #include 7 | 8 | RemoteControl::RemoteControl() 9 | { 10 | } 11 | 12 | RemoteControl::~RemoteControl() 13 | { 14 | } 15 | 16 | void RemoteControl::get_command(RemoteCommand &cmd) 17 | { 18 | cmd_mutex_.lock(); 19 | memcpy(&cmd, &cmd_, sizeof(RemoteCommand)); 20 | cmd_mutex_.unlock(); 21 | } 22 | 23 | RosRemoteControl::RosRemoteControl() : node_("robot_control") 24 | { 25 | subscribers_.emplace_back(node_.subscribe("set_mode", 5, &RosRemoteControl::on_set_mode_callback, this)); 26 | subscribers_.emplace_back(node_.subscribe("set_velocity", 5, &RosRemoteControl::on_set_velocity_callback, this)); 27 | } 28 | 29 | RosRemoteControl::~RosRemoteControl() 30 | { 31 | } 32 | 33 | void RosRemoteControl::on_set_mode_callback(const std_msgs::Int32MultiArray::ConstPtr &msg) 34 | { 35 | std::cout << "[RosRemoteControl] set mode "; 36 | for (auto it = msg->data.begin(); it != msg->data.end(); it++) 37 | { 38 | std::cout << *it << ","; 39 | } 40 | std::cout << std::endl; 41 | 42 | cmd_mutex_.lock(); 43 | for (int i = 0; i < std::min(3, static_cast(msg->data.size())); ++i) 44 | { 45 | cmd_.mode[i] = msg->data[i]; 46 | } 47 | cmd_mutex_.unlock(); 48 | } 49 | 50 | void RosRemoteControl::on_set_velocity_callback(const std_msgs::Float32MultiArray::ConstPtr &msg) 51 | { 52 | std::cout << "[RosRemoteControl] set velocity "; 53 | for (auto it = msg->data.begin(); it != msg->data.end(); it++) 54 | { 55 | std::cout << *it << ","; 56 | } 57 | std::cout << std::endl; 58 | 59 | int size = static_cast(msg->data.size()); 60 | cmd_mutex_.lock(); 61 | if (size >= 1) 62 | { 63 | cmd_.vx = msg->data[0]; 64 | 65 | if (size >= 2) 66 | { 67 | cmd_.vy = msg->data[1]; 68 | 69 | if (size >= 3) 70 | { 71 | cmd_.wz = msg->data[2]; 72 | } 73 | } 74 | } 75 | cmd_mutex_.unlock(); 76 | } 77 | -------------------------------------------------------------------------------- /third-party/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(yaml-cpp) 2 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | # BasedOnStyle: Google 3 | AccessModifierOffset: -1 4 | ConstructorInitializerIndentWidth: 4 5 | AlignEscapedNewlinesLeft: true 6 | AlignTrailingComments: true 7 | AllowAllParametersOfDeclarationOnNextLine: true 8 | AllowShortIfStatementsOnASingleLine: false 9 | AllowShortLoopsOnASingleLine: false 10 | AlwaysBreakTemplateDeclarations: true 11 | AlwaysBreakBeforeMultilineStrings: true 12 | BreakBeforeBinaryOperators: false 13 | BreakBeforeTernaryOperators: true 14 | BreakConstructorInitializersBeforeComma: false 15 | BinPackParameters: true 16 | ColumnLimit: 80 17 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 18 | DerivePointerBinding: true 19 | ExperimentalAutoDetectBinPacking: false 20 | IndentCaseLabels: true 21 | MaxEmptyLinesToKeep: 1 22 | NamespaceIndentation: None 23 | ObjCSpaceBeforeProtocolList: false 24 | PenaltyBreakBeforeFirstCallParameter: 1 25 | PenaltyBreakComment: 60 26 | PenaltyBreakString: 1000 27 | PenaltyBreakFirstLessLess: 120 28 | PenaltyExcessCharacter: 1000000 29 | PenaltyReturnTypeOnItsOwnLine: 200 30 | PointerBindsToType: true 31 | SpacesBeforeTrailingComments: 2 32 | Cpp11BracedListStyle: true 33 | Standard: Cpp11 34 | IndentWidth: 2 35 | TabWidth: 8 36 | UseTab: Never 37 | BreakBeforeBraces: Attach 38 | IndentFunctionDeclarationAfterType: true 39 | SpacesInParentheses: false 40 | SpacesInAngles: false 41 | SpaceInEmptyParentheses: false 42 | SpacesInCStyleCastParentheses: false 43 | SpaceAfterControlStatementKeyword: true 44 | SpaceBeforeAssignmentOperators: true 45 | ContinuationIndentWidth: 4 46 | ... 47 | 48 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/.codedocs: -------------------------------------------------------------------------------- 1 | # CodeDocs.xyz Configuration File 2 | 3 | # Optional project name, if left empty the GitHub repository name will be used. 4 | PROJECT_NAME = 5 | 6 | # One or more directories and files that contain example code to be included. 7 | EXAMPLE_PATH = 8 | 9 | # One or more directories and files to exclude from documentation generation. 10 | # Use relative paths with respect to the repository root directory. 11 | EXCLUDE = test/gtest-1.8.0/ 12 | 13 | # One or more wildcard patterns to exclude files and directories from document 14 | # generation. 15 | EXCLUDE_PATTERNS = 16 | 17 | # One or more symbols to exclude from document generation. Symbols can be 18 | # namespaces, classes, or functions. 19 | EXCLUDE_SYMBOLS = 20 | 21 | # Override the default parser (language) used for each file extension. 22 | EXTENSION_MAPPING = 23 | 24 | # Set the wildcard patterns used to filter out the source-files. 25 | # If left blank the default is: 26 | # *.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, 27 | # *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, 28 | # *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox, *.py, 29 | # *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js. 30 | FILE_PATTERNS = 31 | 32 | # Hide undocumented class members. 33 | HIDE_UNDOC_MEMBERS = 34 | 35 | # Hide undocumented classes. 36 | HIDE_UNDOC_CLASSES = 37 | 38 | # Specify a markdown page whose contents should be used as the main page 39 | # (index.html). This will override a page marked as \mainpage. For example, a 40 | # README.md file usually serves as a useful main page. 41 | USE_MDFILE_AS_MAINPAGE = README.md 42 | 43 | # Specify external repository to link documentation with. 44 | # This is similar to Doxygen's TAGFILES option, but will automatically link to 45 | # tags of other repositories already using CodeDocs. List each repository to 46 | # link with by giving its location in the form of owner/repository. 47 | # For example: 48 | # TAGLINKS = doxygen/doxygen CodeDocs/osg 49 | # Note: these repositories must already be built on CodeDocs. 50 | TAGLINKS = 51 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c++ 2 | 3 | matrix: 4 | include: 5 | - os: linux 6 | compiler: gcc 7 | - os: osx 8 | compiler: clang 9 | - os: osx 10 | compiler: gcc 11 | env: 12 | - CTEST_OUTPUT_ON_FAILURE=1 13 | 14 | before_script: 15 | - mkdir build 16 | - cd build 17 | - cmake .. 18 | - cd .. 19 | script: 20 | - cmake --build build 21 | - cmake --build build --target test 22 | 23 | addons: 24 | apt: 25 | sources: 26 | - ubuntu-toolchain-r-test 27 | - llvm-toolchain-precise-3.9 28 | packages: 29 | - g++-4.9 30 | - clang-3.9 31 | update: true 32 | homebrew: 33 | packages: 34 | - ccache 35 | - gcc@4.9 36 | - llvm@4 37 | update: true 38 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/BUILD.bazel: -------------------------------------------------------------------------------- 1 | yaml_cpp_defines = select({ 2 | # On Windows, ensure static linking is used. 3 | "@platforms//os:windows": ["YAML_CPP_STATIC_DEFINE", "YAML_CPP_NO_CONTRIB"], 4 | "//conditions:default": [], 5 | }) 6 | 7 | cc_library( 8 | name = "yaml-cpp_internal", 9 | visibility = ["//:__subpackages__"], 10 | strip_include_prefix = "src", 11 | hdrs = glob(["src/**/*.h"]), 12 | ) 13 | 14 | cc_library( 15 | name = "yaml-cpp", 16 | visibility = ["//visibility:public"], 17 | includes = ["include"], 18 | hdrs = glob(["include/**/*.h"]), 19 | srcs = glob(["src/**/*.cpp", "src/**/*.h"]), 20 | defines = yaml_cpp_defines, 21 | ) 22 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Style 2 | 3 | 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. 4 | 5 | In general, try to follow the style of surrounding code. We mostly follow the [Google C++ style guide][cpp-style]. 6 | 7 | Commit messages should be in the imperative mood, as described in the [Git contributing file][git-contrib]: 8 | 9 | > Describe your changes in imperative mood, e.g. "make xyzzy do frotz" 10 | > instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy 11 | > to do frotz", as if you are giving orders to the codebase to change 12 | > its behaviour. 13 | 14 | [fmt]: http://clang.llvm.org/docs/ClangFormat.html 15 | [cpp-style]: https://google.github.io/styleguide/cppguide.html 16 | [git-contrib]: http://git.kernel.org/cgit/git/git.git/tree/Documentation/SubmittingPatches?id=HEAD 17 | 18 | # Tests 19 | 20 | Please verify the tests pass by running the target `test/yaml-cpp-tests`. 21 | 22 | If you are adding functionality, add tests accordingly. 23 | 24 | # Pull request process 25 | 26 | Every pull request undergoes a code review. Unfortunately, github's code review process isn't great, but we'll manage. During the code review, if you make changes, add new commits to the pull request for each change. Once the code review is complete, rebase against the master branch and squash into a single commit. 27 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2015 Jesse Beder. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "com_github_jbeder_yaml_cpp") 2 | 3 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 4 | 5 | http_archive( 6 | name = "com_google_googletest", 7 | strip_prefix = "googletest-release-1.8.1", 8 | url = "https://github.com/google/googletest/archive/release-1.8.1.tar.gz", 9 | sha256 = "9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c", 10 | ) 11 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | 3 | environment: 4 | matrix: 5 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 6 | CMAKE_GENERATOR: Visual Studio 14 2015 7 | CMAKE_PLATFORM: win32 8 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 9 | CMAKE_GENERATOR: Visual Studio 14 2015 10 | CMAKE_PLATFORM: x64 11 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 12 | CMAKE_GENERATOR: Visual Studio 15 2017 13 | CMAKE_PLATFORM: win32 14 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 15 | CMAKE_GENERATOR: Visual Studio 15 2017 16 | CMAKE_PLATFORM: x64 17 | 18 | before_build: 19 | - cmd: mkdir build 20 | - cmd: cd build 21 | - cmd: cmake .. -G "%CMAKE_GENERATOR%" -DCMAKE_GENERATOR_PLATFORM=%CMAKE_PLATFORM% 22 | - cmd: cd .. 23 | 24 | build_script: 25 | - cmake --build build 26 | test_script: 27 | - cmd: cd build 28 | - ctest 29 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 2 | message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") 3 | endif() 4 | 5 | file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) 6 | string(REGEX REPLACE "\n" ";" files "${files}") 7 | foreach(file ${files}) 8 | message(STATUS "Uninstalling $ENV{DESTDIR}${file}") 9 | if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 10 | exec_program( 11 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 12 | OUTPUT_VARIABLE rm_out 13 | RETURN_VALUE rm_retval 14 | ) 15 | if(NOT "${rm_retval}" STREQUAL 0) 16 | message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 17 | endif() 18 | else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 19 | message(STATUS "File $ENV{DESTDIR}${file} does not exist.") 20 | endif() 21 | endforeach() 22 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/docs/Breaking-Changes.md: -------------------------------------------------------------------------------- 1 | # The following is a list of breaking changes to yaml-cpp, by version # 2 | 3 | # New API # 4 | 5 | ## HEAD ## 6 | 7 | * Throws an exception when trying to parse a negative number as an unsigned integer. 8 | * Supports the `as`/`as`, which throws an exception when the value exceeds the range of `int8_t`/`uint8_t`. 9 | 10 | ## 0.6.0 ## 11 | 12 | * Requires C++11. 13 | 14 | ## 0.5.3 ## 15 | 16 | _none_ 17 | 18 | ## 0.5.2 ## 19 | 20 | _none_ 21 | 22 | ## 0.5.1 ## 23 | 24 | * `Node::clear` was replaced by `Node::reset`, which takes an optional node, similar to smart pointers. 25 | 26 | ## 0.5.0 ## 27 | 28 | Initial version of the new API. 29 | 30 | # Old API # 31 | 32 | ## 0.3.0 ## 33 | 34 | _none_ 35 | 36 | ## 0.2.7 ## 37 | 38 | * `YAML::Binary` now takes `const unsigned char *` for the binary data (instead of `const char *`). 39 | 40 | ## 0.2.6 ## 41 | 42 | * `Node::GetType()` is now `Node::Type()`, and returns an enum `NodeType::value`, where: 43 | > > ` struct NodeType { enum value { Null, Scalar, Sequence, Map }; }; ` 44 | * `Node::GetTag()` is now `Node::Tag()` 45 | * `Node::Identity()` is removed, and `Node::IsAlias()` and `Node::IsReferenced()` have been merged into `Node::IsAliased()`. The reason: there's no reason to distinguish an alias node from its anchor - whichever happens to be emitted first will be the anchor, and the rest will be aliases. 46 | * `Node::Read` is now `Node::to`. This wasn't a documented function, so it shouldn't break anything. 47 | * `Node`'s comparison operators (for example, `operator == (const Node&, const T&)`) have all been removed. These weren't documented either (they were just used for the tests), so this shouldn't break anything either. 48 | * The emitter no longer produces the document start by default - if you want it, you can supply it with the manipulator `YAML::BeginDoc`. 49 | 50 | ## 0.2.5 ## 51 | 52 | This wiki was started with v0.2.5. -------------------------------------------------------------------------------- /third-party/yaml-cpp/docs/Strings.md: -------------------------------------------------------------------------------- 1 | # Encodings and `yaml-cpp` # 2 | 3 | `yaml-cpp` will parse any file as specified by the [YAML 1.2 spec](http://www.yaml.org/spec/1.2/spec.html#id2570322). Internally, it stores all strings in UTF-8, and representation is done with UTF-8. This means that in 4 | 5 | ``` 6 | std::string str; 7 | node >> str; 8 | ``` 9 | 10 | `str` will be UTF-8. Similarly, if you're accessing a map by string key, you need to pass the key in UTF-8. If your application uses a different encoding, you need to convert to and from UTF-8 to work with `yaml-cpp`. (It's possible we'll add some small conversion functions, but for now it's restricted.) 11 | 12 | --- 13 | 14 | For convenience, Richard Weeks has kindly provided a google gadget that converts Unicode to a string literal. It's a Google Gadget, so unfortunately it does not work on GitHub. Patches welcome to port it to a usable format here: 15 | 16 | ``` 17 | 18 | ``` -------------------------------------------------------------------------------- /third-party/yaml-cpp/docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate -------------------------------------------------------------------------------- /third-party/yaml-cpp/docs/index.md: -------------------------------------------------------------------------------- 1 | To learn how to use the library, see the [Tutorial](https://github.com/jbeder/yaml-cpp/wiki/Tutorial) and [How To Emit YAML](https://github.com/jbeder/yaml-cpp/wiki/How-To-Emit-YAML) 2 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/anchor.h: -------------------------------------------------------------------------------- 1 | #ifndef ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | 12 | namespace YAML { 13 | using anchor_t = std::size_t; 14 | const anchor_t NullAnchor = 0; 15 | } 16 | 17 | #endif // ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 18 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/binary.h: -------------------------------------------------------------------------------- 1 | #ifndef BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | #include "yaml-cpp/dll.h" 14 | 15 | namespace YAML { 16 | YAML_CPP_API std::string EncodeBase64(const unsigned char *data, 17 | std::size_t size); 18 | YAML_CPP_API std::vector DecodeBase64(const std::string &input); 19 | 20 | class YAML_CPP_API Binary { 21 | public: 22 | Binary(const unsigned char *data_, std::size_t size_) 23 | : m_data{}, m_unownedData(data_), m_unownedSize(size_) {} 24 | Binary() : Binary(nullptr, 0) {} 25 | Binary(const Binary &) = default; 26 | Binary(Binary &&) = default; 27 | Binary &operator=(const Binary &) = default; 28 | Binary &operator=(Binary &&) = default; 29 | 30 | bool owned() const { return !m_unownedData; } 31 | std::size_t size() const { return owned() ? m_data.size() : m_unownedSize; } 32 | const unsigned char *data() const { 33 | return owned() ? &m_data[0] : m_unownedData; 34 | } 35 | 36 | void swap(std::vector &rhs) { 37 | if (m_unownedData) { 38 | m_data.swap(rhs); 39 | rhs.clear(); 40 | rhs.resize(m_unownedSize); 41 | std::copy(m_unownedData, m_unownedData + m_unownedSize, rhs.begin()); 42 | m_unownedData = nullptr; 43 | m_unownedSize = 0; 44 | } else { 45 | m_data.swap(rhs); 46 | } 47 | } 48 | 49 | bool operator==(const Binary &rhs) const { 50 | const std::size_t s = size(); 51 | if (s != rhs.size()) 52 | return false; 53 | const unsigned char *d1 = data(); 54 | const unsigned char *d2 = rhs.data(); 55 | for (std::size_t i = 0; i < s; i++) { 56 | if (*d1++ != *d2++) 57 | return false; 58 | } 59 | return true; 60 | } 61 | 62 | bool operator!=(const Binary &rhs) const { return !(*this == rhs); } 63 | 64 | private: 65 | std::vector m_data; 66 | const unsigned char *m_unownedData; 67 | std::size_t m_unownedSize; 68 | }; 69 | } // namespace YAML 70 | 71 | #endif // BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 72 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/contrib/anchordict.h: -------------------------------------------------------------------------------- 1 | #ifndef ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | 12 | #include "../anchor.h" 13 | 14 | namespace YAML { 15 | /** 16 | * An object that stores and retrieves values correlating to {@link anchor_t} 17 | * values. 18 | * 19 | *

Efficient implementation that can make assumptions about how 20 | * {@code anchor_t} values are assigned by the {@link Parser} class. 21 | */ 22 | template 23 | class AnchorDict { 24 | public: 25 | AnchorDict() : m_data{} {} 26 | void Register(anchor_t anchor, T value) { 27 | if (anchor > m_data.size()) { 28 | m_data.resize(anchor); 29 | } 30 | m_data[anchor - 1] = value; 31 | } 32 | 33 | T Get(anchor_t anchor) const { return m_data[anchor - 1]; } 34 | 35 | private: 36 | std::vector m_data; 37 | }; 38 | } // namespace YAML 39 | 40 | #endif // ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 41 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/dll.h: -------------------------------------------------------------------------------- 1 | #ifndef DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | // Definition YAML_CPP_STATIC_DEFINE using to building YAML-CPP as static 5 | // library (definition created by CMake or defined manually) 6 | 7 | // Definition yaml_cpp_EXPORTS using to building YAML-CPP as dll/so library 8 | // (definition created by CMake or defined manually) 9 | 10 | #ifdef YAML_CPP_STATIC_DEFINE 11 | # define YAML_CPP_API 12 | # define YAML_CPP_NO_EXPORT 13 | #else 14 | # if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) 15 | # ifndef YAML_CPP_API 16 | # ifdef yaml_cpp_EXPORTS 17 | /* We are building this library */ 18 | # pragma message( "Defining YAML_CPP_API for DLL export" ) 19 | # define YAML_CPP_API __declspec(dllexport) 20 | # else 21 | /* We are using this library */ 22 | # pragma message( "Defining YAML_CPP_API for DLL import" ) 23 | # define YAML_CPP_API __declspec(dllimport) 24 | # endif 25 | # endif 26 | # ifndef YAML_CPP_NO_EXPORT 27 | # define YAML_CPP_NO_EXPORT 28 | # endif 29 | # else /* No _MSC_VER */ 30 | # ifndef YAML_CPP_API 31 | # ifdef yaml_cpp_EXPORTS 32 | /* We are building this library */ 33 | # define YAML_CPP_API __attribute__((visibility("default"))) 34 | # else 35 | /* We are using this library */ 36 | # define YAML_CPP_API __attribute__((visibility("default"))) 37 | # endif 38 | # endif 39 | # ifndef YAML_CPP_NO_EXPORT 40 | # define YAML_CPP_NO_EXPORT __attribute__((visibility("hidden"))) 41 | # endif 42 | # endif /* _MSC_VER */ 43 | #endif /* YAML_CPP_STATIC_DEFINE */ 44 | 45 | #ifndef YAML_CPP_DEPRECATED 46 | # ifdef _MSC_VER 47 | # define YAML_CPP_DEPRECATED __declspec(deprecated) 48 | # else 49 | # define YAML_CPP_DEPRECATED __attribute__ ((__deprecated__)) 50 | # endif 51 | #endif 52 | 53 | #ifndef YAML_CPP_DEPRECATED_EXPORT 54 | # define YAML_CPP_DEPRECATED_EXPORT YAML_CPP_API YAML_CPP_DEPRECATED 55 | #endif 56 | 57 | #ifndef YAML_CPP_DEPRECATED_NO_EXPORT 58 | # define YAML_CPP_DEPRECATED_NO_EXPORT YAML_CPP_NO_EXPORT YAML_CPP_DEPRECATED 59 | #endif 60 | 61 | #endif /* DLL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 */ 62 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/emitfromevents.h: -------------------------------------------------------------------------------- 1 | #ifndef EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | 12 | #include "yaml-cpp/anchor.h" 13 | #include "yaml-cpp/emitterstyle.h" 14 | #include "yaml-cpp/eventhandler.h" 15 | 16 | namespace YAML { 17 | struct Mark; 18 | } // namespace YAML 19 | 20 | namespace YAML { 21 | class Emitter; 22 | 23 | class EmitFromEvents : public EventHandler { 24 | public: 25 | EmitFromEvents(Emitter& emitter); 26 | 27 | void OnDocumentStart(const Mark& mark) override; 28 | void OnDocumentEnd() override; 29 | 30 | void OnNull(const Mark& mark, anchor_t anchor) override; 31 | void OnAlias(const Mark& mark, anchor_t anchor) override; 32 | void OnScalar(const Mark& mark, const std::string& tag, 33 | anchor_t anchor, const std::string& value) override; 34 | 35 | void OnSequenceStart(const Mark& mark, const std::string& tag, 36 | anchor_t anchor, EmitterStyle::value style) override; 37 | void OnSequenceEnd() override; 38 | 39 | void OnMapStart(const Mark& mark, const std::string& tag, 40 | anchor_t anchor, EmitterStyle::value style) override; 41 | void OnMapEnd() override; 42 | 43 | private: 44 | void BeginNode(); 45 | void EmitProps(const std::string& tag, anchor_t anchor); 46 | 47 | private: 48 | Emitter& m_emitter; 49 | 50 | struct State { 51 | enum value { WaitingForSequenceEntry, WaitingForKey, WaitingForValue }; 52 | }; 53 | std::stack m_stateStack; 54 | }; 55 | } 56 | 57 | #endif // EMITFROMEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 58 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/emitterdef.h: -------------------------------------------------------------------------------- 1 | #ifndef EMITTERDEF_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define EMITTERDEF_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | namespace YAML { 11 | struct EmitterNodeType { 12 | enum value { NoType, Property, Scalar, FlowSeq, BlockSeq, FlowMap, BlockMap }; 13 | }; 14 | } 15 | 16 | #endif // EMITTERDEF_H_62B23520_7C8E_11DE_8A39_0800200C9A66 17 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/emitterstyle.h: -------------------------------------------------------------------------------- 1 | #ifndef EMITTERSTYLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define EMITTERSTYLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | namespace YAML { 11 | struct EmitterStyle { 12 | enum value { Default, Block, Flow }; 13 | }; 14 | } 15 | 16 | #endif // EMITTERSTYLE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 17 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/eventhandler.h: -------------------------------------------------------------------------------- 1 | #ifndef EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | 12 | #include "yaml-cpp/anchor.h" 13 | #include "yaml-cpp/emitterstyle.h" 14 | 15 | namespace YAML { 16 | struct Mark; 17 | 18 | class EventHandler { 19 | public: 20 | virtual ~EventHandler() = default; 21 | 22 | virtual void OnDocumentStart(const Mark& mark) = 0; 23 | virtual void OnDocumentEnd() = 0; 24 | 25 | virtual void OnNull(const Mark& mark, anchor_t anchor) = 0; 26 | virtual void OnAlias(const Mark& mark, anchor_t anchor) = 0; 27 | virtual void OnScalar(const Mark& mark, const std::string& tag, 28 | anchor_t anchor, const std::string& value) = 0; 29 | 30 | virtual void OnSequenceStart(const Mark& mark, const std::string& tag, 31 | anchor_t anchor, EmitterStyle::value style) = 0; 32 | virtual void OnSequenceEnd() = 0; 33 | 34 | virtual void OnMapStart(const Mark& mark, const std::string& tag, 35 | anchor_t anchor, EmitterStyle::value style) = 0; 36 | virtual void OnMapEnd() = 0; 37 | 38 | virtual void OnAnchor(const Mark& /*mark*/, 39 | const std::string& /*anchor_name*/) { 40 | // empty default implementation for compatibility 41 | } 42 | }; 43 | } // namespace YAML 44 | 45 | #endif // EVENTHANDLER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 46 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/mark.h: -------------------------------------------------------------------------------- 1 | #ifndef MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include "yaml-cpp/dll.h" 11 | 12 | namespace YAML { 13 | struct YAML_CPP_API Mark { 14 | Mark() : pos(0), line(0), column(0) {} 15 | 16 | static const Mark null_mark() { return Mark(-1, -1, -1); } 17 | 18 | bool is_null() const { return pos == -1 && line == -1 && column == -1; } 19 | 20 | int pos; 21 | int line, column; 22 | 23 | private: 24 | Mark(int pos_, int line_, int column_) 25 | : pos(pos_), line(line_), column(column_) {} 26 | }; 27 | } 28 | 29 | #endif // MARK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 30 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/node/detail/iterator_fwd.h: -------------------------------------------------------------------------------- 1 | #ifndef VALUE_DETAIL_ITERATOR_FWD_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define VALUE_DETAIL_ITERATOR_FWD_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include "yaml-cpp/dll.h" 11 | #include 12 | #include 13 | #include 14 | 15 | namespace YAML { 16 | 17 | namespace detail { 18 | struct iterator_value; 19 | template 20 | class iterator_base; 21 | } 22 | 23 | using iterator = detail::iterator_base; 24 | using const_iterator = detail::iterator_base; 25 | } 26 | 27 | #endif // VALUE_DETAIL_ITERATOR_FWD_H_62B23520_7C8E_11DE_8A39_0800200C9A66 28 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/node/detail/memory.h: -------------------------------------------------------------------------------- 1 | #ifndef VALUE_DETAIL_MEMORY_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define VALUE_DETAIL_MEMORY_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | 12 | #include "yaml-cpp/dll.h" 13 | #include "yaml-cpp/node/ptr.h" 14 | 15 | namespace YAML { 16 | namespace detail { 17 | class node; 18 | } // namespace detail 19 | } // namespace YAML 20 | 21 | namespace YAML { 22 | namespace detail { 23 | class YAML_CPP_API memory { 24 | public: 25 | memory() : m_nodes{} {} 26 | node& create_node(); 27 | void merge(const memory& rhs); 28 | 29 | private: 30 | using Nodes = std::set; 31 | Nodes m_nodes; 32 | }; 33 | 34 | class YAML_CPP_API memory_holder { 35 | public: 36 | memory_holder() : m_pMemory(new memory) {} 37 | 38 | node& create_node() { return m_pMemory->create_node(); } 39 | void merge(memory_holder& rhs); 40 | 41 | private: 42 | shared_memory m_pMemory; 43 | }; 44 | } // namespace detail 45 | } // namespace YAML 46 | 47 | #endif // VALUE_DETAIL_MEMORY_H_62B23520_7C8E_11DE_8A39_0800200C9A66 48 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/node/emit.h: -------------------------------------------------------------------------------- 1 | #ifndef NODE_EMIT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODE_EMIT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | #include "yaml-cpp/dll.h" 14 | 15 | namespace YAML { 16 | class Emitter; 17 | class Node; 18 | 19 | /** 20 | * Emits the node to the given {@link Emitter}. If there is an error in writing, 21 | * {@link Emitter#good} will return false. 22 | */ 23 | YAML_CPP_API Emitter& operator<<(Emitter& out, const Node& node); 24 | 25 | /** Emits the node to the given output stream. */ 26 | YAML_CPP_API std::ostream& operator<<(std::ostream& out, const Node& node); 27 | 28 | /** Converts the node to a YAML string. */ 29 | YAML_CPP_API std::string Dump(const Node& node); 30 | } // namespace YAML 31 | 32 | #endif // NODE_EMIT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 33 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/node/iterator.h: -------------------------------------------------------------------------------- 1 | #ifndef VALUE_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define VALUE_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include "yaml-cpp/dll.h" 11 | #include "yaml-cpp/node/node.h" 12 | #include "yaml-cpp/node/detail/iterator_fwd.h" 13 | #include "yaml-cpp/node/detail/iterator.h" 14 | #include 15 | #include 16 | #include 17 | 18 | // Assert in place so gcc + libc++ combination properly builds 19 | static_assert(std::is_constructible::value, "Node must be copy constructable"); 20 | 21 | namespace YAML { 22 | namespace detail { 23 | struct iterator_value : public Node, std::pair { 24 | iterator_value() = default; 25 | explicit iterator_value(const Node& rhs) 26 | : Node(rhs), 27 | std::pair(Node(Node::ZombieNode), Node(Node::ZombieNode)) {} 28 | explicit iterator_value(const Node& key, const Node& value) 29 | : Node(Node::ZombieNode), std::pair(key, value) {} 30 | }; 31 | } 32 | } 33 | 34 | #endif // VALUE_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 35 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/node/parse.h: -------------------------------------------------------------------------------- 1 | #ifndef VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "yaml-cpp/dll.h" 15 | 16 | namespace YAML { 17 | class Node; 18 | 19 | /** 20 | * Loads the input string as a single YAML document. 21 | * 22 | * @throws {@link ParserException} if it is malformed. 23 | */ 24 | YAML_CPP_API Node Load(const std::string& input); 25 | 26 | /** 27 | * Loads the input string as a single YAML document. 28 | * 29 | * @throws {@link ParserException} if it is malformed. 30 | */ 31 | YAML_CPP_API Node Load(const char* input); 32 | 33 | /** 34 | * Loads the input stream as a single YAML document. 35 | * 36 | * @throws {@link ParserException} if it is malformed. 37 | */ 38 | YAML_CPP_API Node Load(std::istream& input); 39 | 40 | /** 41 | * Loads the input file as a single YAML document. 42 | * 43 | * @throws {@link ParserException} if it is malformed. 44 | * @throws {@link BadFile} if the file cannot be loaded. 45 | */ 46 | YAML_CPP_API Node LoadFile(const std::string& filename); 47 | 48 | /** 49 | * Loads the input string as a list of YAML documents. 50 | * 51 | * @throws {@link ParserException} if it is malformed. 52 | */ 53 | YAML_CPP_API std::vector LoadAll(const std::string& input); 54 | 55 | /** 56 | * Loads the input string as a list of YAML documents. 57 | * 58 | * @throws {@link ParserException} if it is malformed. 59 | */ 60 | YAML_CPP_API std::vector LoadAll(const char* input); 61 | 62 | /** 63 | * Loads the input stream as a list of YAML documents. 64 | * 65 | * @throws {@link ParserException} if it is malformed. 66 | */ 67 | YAML_CPP_API std::vector LoadAll(std::istream& input); 68 | 69 | /** 70 | * Loads the input file as a list of YAML documents. 71 | * 72 | * @throws {@link ParserException} if it is malformed. 73 | * @throws {@link BadFile} if the file cannot be loaded. 74 | */ 75 | YAML_CPP_API std::vector LoadAllFromFile(const std::string& filename); 76 | } // namespace YAML 77 | 78 | #endif // VALUE_PARSE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 79 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/node/ptr.h: -------------------------------------------------------------------------------- 1 | #ifndef VALUE_PTR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define VALUE_PTR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | 12 | namespace YAML { 13 | namespace detail { 14 | class node; 15 | class node_ref; 16 | class node_data; 17 | class memory; 18 | class memory_holder; 19 | 20 | using shared_node = std::shared_ptr; 21 | using shared_node_ref = std::shared_ptr; 22 | using shared_node_data = std::shared_ptr; 23 | using shared_memory_holder = std::shared_ptr; 24 | using shared_memory = std::shared_ptr; 25 | } 26 | } 27 | 28 | #endif // VALUE_PTR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 29 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/node/type.h: -------------------------------------------------------------------------------- 1 | #ifndef VALUE_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define VALUE_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | namespace YAML { 11 | struct NodeType { 12 | enum value { Undefined, Null, Scalar, Sequence, Map }; 13 | }; 14 | } 15 | 16 | #endif // VALUE_TYPE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 17 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/noexcept.h: -------------------------------------------------------------------------------- 1 | #ifndef NOEXCEPT_H_768872DA_476C_11EA_88B8_90B11C0C0FF8 2 | #define NOEXCEPT_H_768872DA_476C_11EA_88B8_90B11C0C0FF8 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | // This is here for compatibility with older versions of Visual Studio 11 | // which don't support noexcept. 12 | #if defined(_MSC_VER) && _MSC_VER < 1900 13 | #define YAML_CPP_NOEXCEPT _NOEXCEPT 14 | #else 15 | #define YAML_CPP_NOEXCEPT noexcept 16 | #endif 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/null.h: -------------------------------------------------------------------------------- 1 | #ifndef NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include "yaml-cpp/dll.h" 11 | #include 12 | 13 | namespace YAML { 14 | class Node; 15 | 16 | struct YAML_CPP_API _Null {}; 17 | inline bool operator==(const _Null&, const _Null&) { return true; } 18 | inline bool operator!=(const _Null&, const _Null&) { return false; } 19 | 20 | YAML_CPP_API bool IsNull(const Node& node); // old API only 21 | YAML_CPP_API bool IsNullString(const std::string& str); 22 | 23 | extern YAML_CPP_API _Null Null; 24 | } 25 | 26 | #endif // NULL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 27 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/ostream_wrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef OSTREAM_WRAPPER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define OSTREAM_WRAPPER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | #include "yaml-cpp/dll.h" 14 | 15 | namespace YAML { 16 | class YAML_CPP_API ostream_wrapper { 17 | public: 18 | ostream_wrapper(); 19 | explicit ostream_wrapper(std::ostream& stream); 20 | ostream_wrapper(const ostream_wrapper&) = delete; 21 | ostream_wrapper(ostream_wrapper&&) = delete; 22 | ostream_wrapper& operator=(const ostream_wrapper&) = delete; 23 | ostream_wrapper& operator=(ostream_wrapper&&) = delete; 24 | ~ostream_wrapper(); 25 | 26 | void write(const std::string& str); 27 | void write(const char* str, std::size_t size); 28 | 29 | void set_comment() { m_comment = true; } 30 | 31 | const char* str() const { 32 | if (m_pStream) { 33 | return nullptr; 34 | } else { 35 | m_buffer[m_pos] = '\0'; 36 | return &m_buffer[0]; 37 | } 38 | } 39 | 40 | std::size_t row() const { return m_row; } 41 | std::size_t col() const { return m_col; } 42 | std::size_t pos() const { return m_pos; } 43 | bool comment() const { return m_comment; } 44 | 45 | private: 46 | void update_pos(char ch); 47 | 48 | private: 49 | mutable std::vector m_buffer; 50 | std::ostream* const m_pStream; 51 | 52 | std::size_t m_pos; 53 | std::size_t m_row, m_col; 54 | bool m_comment; 55 | }; 56 | 57 | template 58 | inline ostream_wrapper& operator<<(ostream_wrapper& stream, 59 | const char (&str)[N]) { 60 | stream.write(str, N - 1); 61 | return stream; 62 | } 63 | 64 | inline ostream_wrapper& operator<<(ostream_wrapper& stream, 65 | const std::string& str) { 66 | stream.write(str); 67 | return stream; 68 | } 69 | 70 | inline ostream_wrapper& operator<<(ostream_wrapper& stream, char ch) { 71 | stream.write(&ch, 1); 72 | return stream; 73 | } 74 | } // namespace YAML 75 | 76 | #endif // OSTREAM_WRAPPER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 77 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/stlemitter.h: -------------------------------------------------------------------------------- 1 | #ifndef STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | namespace YAML { 16 | template 17 | inline Emitter& EmitSeq(Emitter& emitter, const Seq& seq) { 18 | emitter << BeginSeq; 19 | for (const auto& v : seq) 20 | emitter << v; 21 | emitter << EndSeq; 22 | return emitter; 23 | } 24 | 25 | template 26 | inline Emitter& operator<<(Emitter& emitter, const std::vector& v) { 27 | return EmitSeq(emitter, v); 28 | } 29 | 30 | template 31 | inline Emitter& operator<<(Emitter& emitter, const std::list& v) { 32 | return EmitSeq(emitter, v); 33 | } 34 | 35 | template 36 | inline Emitter& operator<<(Emitter& emitter, const std::set& v) { 37 | return EmitSeq(emitter, v); 38 | } 39 | 40 | template 41 | inline Emitter& operator<<(Emitter& emitter, const std::map& m) { 42 | emitter << BeginMap; 43 | for (const auto& v : m) 44 | emitter << Key << v.first << Value << v.second; 45 | emitter << EndMap; 46 | return emitter; 47 | } 48 | } 49 | 50 | #endif // STLEMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 51 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/include/yaml-cpp/yaml.h: -------------------------------------------------------------------------------- 1 | #ifndef YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include "yaml-cpp/parser.h" 11 | #include "yaml-cpp/emitter.h" 12 | #include "yaml-cpp/emitterstyle.h" 13 | #include "yaml-cpp/stlemitter.h" 14 | #include "yaml-cpp/exceptions.h" 15 | 16 | #include "yaml-cpp/node/node.h" 17 | #include "yaml-cpp/node/impl.h" 18 | #include "yaml-cpp/node/convert.h" 19 | #include "yaml-cpp/node/iterator.h" 20 | #include "yaml-cpp/node/detail/impl.h" 21 | #include "yaml-cpp/node/parse.h" 22 | #include "yaml-cpp/node/emit.h" 23 | 24 | #endif // YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66 25 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/install.txt: -------------------------------------------------------------------------------- 1 | *** With CMake *** 2 | 3 | yaml-cpp uses CMake to support cross-platform building. In a UNIX-like system, the basic steps to build are: 4 | 5 | 1. Download and install CMake (if you don't have root privileges, just install to a local directory, like ~/bin) 6 | 7 | 2. From the source directory, run: 8 | 9 | mkdir build 10 | cd build 11 | cmake .. 12 | 13 | and then the usual 14 | 15 | make 16 | make install 17 | 18 | 3. To clean up, just remove the 'build' directory. 19 | 20 | *** Without CMake *** 21 | 22 | If you don't want to use CMake, just add all .cpp files to a makefile. yaml-cpp does not need any special build settings, so no 'configure' file is necessary. 23 | 24 | (Note: this is pretty tedious. It's sooo much easier to use CMake.) 25 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/collectionstack.h: -------------------------------------------------------------------------------- 1 | #ifndef COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace YAML { 14 | struct CollectionType { 15 | enum value { NoCollection, BlockMap, BlockSeq, FlowMap, FlowSeq, CompactMap }; 16 | }; 17 | 18 | class CollectionStack { 19 | public: 20 | CollectionStack() : collectionStack{} {} 21 | CollectionType::value GetCurCollectionType() const { 22 | if (collectionStack.empty()) 23 | return CollectionType::NoCollection; 24 | return collectionStack.top(); 25 | } 26 | 27 | void PushCollectionType(CollectionType::value type) { 28 | collectionStack.push(type); 29 | } 30 | void PopCollectionType(CollectionType::value type) { 31 | assert(type == GetCurCollectionType()); 32 | (void)type; 33 | collectionStack.pop(); 34 | } 35 | 36 | private: 37 | std::stack collectionStack; 38 | }; 39 | } // namespace YAML 40 | 41 | #endif // COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 42 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/contrib/graphbuilder.cpp: -------------------------------------------------------------------------------- 1 | #include "graphbuilderadapter.h" 2 | 3 | #include "yaml-cpp/parser.h" // IWYU pragma: keep 4 | 5 | namespace YAML { 6 | class GraphBuilderInterface; 7 | 8 | void* BuildGraphOfNextDocument(Parser& parser, 9 | GraphBuilderInterface& graphBuilder) { 10 | GraphBuilderAdapter eventHandler(graphBuilder); 11 | if (parser.HandleNextDocument(eventHandler)) { 12 | return eventHandler.RootNode(); 13 | } 14 | return nullptr; 15 | } 16 | } // namespace YAML 17 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/contrib/yaml-cpp.natvis.md: -------------------------------------------------------------------------------- 1 | # MSVC debugger visualizer for YAML::Node 2 | 3 | ## How to use 4 | Add yaml-cpp.natvis to your Visual C++ project like any other source file. It will be included in the debug information, and improve debugger display on YAML::Node and contained types. 5 | 6 | ## Compatibility and Troubleshooting 7 | 8 | This has been tested for MSVC 2017. It is expected to be compatible with VS 2015 and VS 2019. If you have any problems, you can open an issue here: https://github.com/peterchen-cp/yaml-cpp-natvis 9 | 10 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/convert.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "yaml-cpp/node/convert.h" 4 | 5 | namespace { 6 | // we're not gonna mess with the mess that is all the isupper/etc. functions 7 | bool IsLower(char ch) { return 'a' <= ch && ch <= 'z'; } 8 | bool IsUpper(char ch) { return 'A' <= ch && ch <= 'Z'; } 9 | char ToLower(char ch) { return IsUpper(ch) ? ch + 'a' - 'A' : ch; } 10 | 11 | std::string tolower(const std::string& str) { 12 | std::string s(str); 13 | std::transform(s.begin(), s.end(), s.begin(), ToLower); 14 | return s; 15 | } 16 | 17 | template 18 | bool IsEntirely(const std::string& str, T func) { 19 | return std::all_of(str.begin(), str.end(), [=](char ch) { return func(ch); }); 20 | } 21 | 22 | // IsFlexibleCase 23 | // . Returns true if 'str' is: 24 | // . UPPERCASE 25 | // . lowercase 26 | // . Capitalized 27 | bool IsFlexibleCase(const std::string& str) { 28 | if (str.empty()) 29 | return true; 30 | 31 | if (IsEntirely(str, IsLower)) 32 | return true; 33 | 34 | bool firstcaps = IsUpper(str[0]); 35 | std::string rest = str.substr(1); 36 | return firstcaps && (IsEntirely(rest, IsLower) || IsEntirely(rest, IsUpper)); 37 | } 38 | } // namespace 39 | 40 | namespace YAML { 41 | bool convert::decode(const Node& node, bool& rhs) { 42 | if (!node.IsScalar()) 43 | return false; 44 | 45 | // we can't use iostream bool extraction operators as they don't 46 | // recognize all possible values in the table below (taken from 47 | // http://yaml.org/type/bool.html) 48 | static const struct { 49 | std::string truename, falsename; 50 | } names[] = { 51 | {"y", "n"}, 52 | {"yes", "no"}, 53 | {"true", "false"}, 54 | {"on", "off"}, 55 | }; 56 | 57 | if (!IsFlexibleCase(node.Scalar())) 58 | return false; 59 | 60 | for (const auto& name : names) { 61 | if (name.truename == tolower(node.Scalar())) { 62 | rhs = true; 63 | return true; 64 | } 65 | 66 | if (name.falsename == tolower(node.Scalar())) { 67 | rhs = false; 68 | return true; 69 | } 70 | } 71 | 72 | return false; 73 | } 74 | } // namespace YAML 75 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/depthguard.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/depthguard.h" 2 | 3 | namespace YAML { 4 | 5 | DeepRecursion::DeepRecursion(int depth, const Mark& mark_, 6 | const std::string& msg_) 7 | : ParserException(mark_, msg_), m_depth(depth) {} 8 | 9 | } // namespace YAML 10 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/directives.cpp: -------------------------------------------------------------------------------- 1 | #include "directives.h" 2 | 3 | namespace YAML { 4 | Directives::Directives() : version{true, 1, 2}, tags{} {} 5 | 6 | std::string Directives::TranslateTagHandle( 7 | const std::string& handle) const { 8 | auto it = tags.find(handle); 9 | if (it == tags.end()) { 10 | if (handle == "!!") 11 | return "tag:yaml.org,2002:"; 12 | return handle; 13 | } 14 | 15 | return it->second; 16 | } 17 | } // namespace YAML 18 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/directives.h: -------------------------------------------------------------------------------- 1 | #ifndef DIRECTIVES_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define DIRECTIVES_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace YAML { 14 | struct Version { 15 | bool isDefault; 16 | int major, minor; 17 | }; 18 | 19 | struct Directives { 20 | Directives(); 21 | 22 | std::string TranslateTagHandle(const std::string& handle) const; 23 | 24 | Version version; 25 | std::map tags; 26 | }; 27 | } 28 | 29 | #endif // DIRECTIVES_H_62B23520_7C8E_11DE_8A39_0800200C9A66 30 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/emit.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/node/emit.h" 2 | #include "nodeevents.h" 3 | #include "yaml-cpp/emitfromevents.h" 4 | #include "yaml-cpp/emitter.h" 5 | 6 | namespace YAML { 7 | Emitter& operator<<(Emitter& out, const Node& node) { 8 | EmitFromEvents emitFromEvents(out); 9 | NodeEvents events(node); 10 | events.Emit(emitFromEvents); 11 | return out; 12 | } 13 | 14 | std::ostream& operator<<(std::ostream& out, const Node& node) { 15 | Emitter emitter(out); 16 | emitter << node; 17 | return out; 18 | } 19 | 20 | std::string Dump(const Node& node) { 21 | Emitter emitter; 22 | emitter << node; 23 | return emitter.c_str(); 24 | } 25 | } // namespace YAML 26 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/emitterutils.h: -------------------------------------------------------------------------------- 1 | #ifndef EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | 12 | #include "emitterstate.h" 13 | #include "yaml-cpp/emittermanip.h" 14 | #include "yaml-cpp/ostream_wrapper.h" 15 | 16 | namespace YAML { 17 | class ostream_wrapper; 18 | } // namespace YAML 19 | 20 | namespace YAML { 21 | class Binary; 22 | 23 | struct StringFormat { 24 | enum value { Plain, SingleQuoted, DoubleQuoted, Literal }; 25 | }; 26 | 27 | struct StringEscaping { 28 | enum value { None, NonAscii, JSON }; 29 | }; 30 | 31 | namespace Utils { 32 | StringFormat::value ComputeStringFormat(const std::string& str, 33 | EMITTER_MANIP strFormat, 34 | FlowType::value flowType, 35 | bool escapeNonAscii); 36 | 37 | bool WriteSingleQuotedString(ostream_wrapper& out, const std::string& str); 38 | bool WriteDoubleQuotedString(ostream_wrapper& out, const std::string& str, 39 | StringEscaping::value stringEscaping); 40 | bool WriteLiteralString(ostream_wrapper& out, const std::string& str, 41 | std::size_t indent); 42 | bool WriteChar(ostream_wrapper& out, char ch, 43 | StringEscaping::value stringEscapingStyle); 44 | bool WriteComment(ostream_wrapper& out, const std::string& str, 45 | std::size_t postCommentIndent); 46 | bool WriteAlias(ostream_wrapper& out, const std::string& str); 47 | bool WriteAnchor(ostream_wrapper& out, const std::string& str); 48 | bool WriteTag(ostream_wrapper& out, const std::string& str, bool verbatim); 49 | bool WriteTagWithPrefix(ostream_wrapper& out, const std::string& prefix, 50 | const std::string& tag); 51 | bool WriteBinary(ostream_wrapper& out, const Binary& binary); 52 | } 53 | } 54 | 55 | #endif // EMITTERUTILS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 56 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/exceptions.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/exceptions.h" 2 | #include "yaml-cpp/noexcept.h" 3 | 4 | namespace YAML { 5 | 6 | // These destructors are defined out-of-line so the vtable is only emitted once. 7 | Exception::~Exception() YAML_CPP_NOEXCEPT = default; 8 | ParserException::~ParserException() YAML_CPP_NOEXCEPT = default; 9 | RepresentationException::~RepresentationException() YAML_CPP_NOEXCEPT = default; 10 | InvalidScalar::~InvalidScalar() YAML_CPP_NOEXCEPT = default; 11 | KeyNotFound::~KeyNotFound() YAML_CPP_NOEXCEPT = default; 12 | InvalidNode::~InvalidNode() YAML_CPP_NOEXCEPT = default; 13 | BadConversion::~BadConversion() YAML_CPP_NOEXCEPT = default; 14 | BadDereference::~BadDereference() YAML_CPP_NOEXCEPT = default; 15 | BadSubscript::~BadSubscript() YAML_CPP_NOEXCEPT = default; 16 | BadPushback::~BadPushback() YAML_CPP_NOEXCEPT = default; 17 | BadInsert::~BadInsert() YAML_CPP_NOEXCEPT = default; 18 | EmitterException::~EmitterException() YAML_CPP_NOEXCEPT = default; 19 | BadFile::~BadFile() YAML_CPP_NOEXCEPT = default; 20 | } // namespace YAML 21 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/indentation.h: -------------------------------------------------------------------------------- 1 | #ifndef INDENTATION_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define INDENTATION_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | #include "yaml-cpp/ostream_wrapper.h" 14 | 15 | namespace YAML { 16 | struct Indentation { 17 | Indentation(std::size_t n_) : n(n_) {} 18 | std::size_t n; 19 | }; 20 | 21 | inline ostream_wrapper& operator<<(ostream_wrapper& out, 22 | const Indentation& indent) { 23 | for (std::size_t i = 0; i < indent.n; i++) 24 | out << ' '; 25 | return out; 26 | } 27 | 28 | struct IndentTo { 29 | IndentTo(std::size_t n_) : n(n_) {} 30 | std::size_t n; 31 | }; 32 | 33 | inline ostream_wrapper& operator<<(ostream_wrapper& out, 34 | const IndentTo& indent) { 35 | while (out.col() < indent.n) 36 | out << ' '; 37 | return out; 38 | } 39 | } 40 | 41 | #endif // INDENTATION_H_62B23520_7C8E_11DE_8A39_0800200C9A66 42 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/memory.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/node/detail/memory.h" 2 | #include "yaml-cpp/node/detail/node.h" // IWYU pragma: keep 3 | #include "yaml-cpp/node/ptr.h" 4 | 5 | namespace YAML { 6 | namespace detail { 7 | 8 | void memory_holder::merge(memory_holder& rhs) { 9 | if (m_pMemory == rhs.m_pMemory) 10 | return; 11 | 12 | m_pMemory->merge(*rhs.m_pMemory); 13 | rhs.m_pMemory = m_pMemory; 14 | } 15 | 16 | node& memory::create_node() { 17 | shared_node pNode(new node); 18 | m_nodes.insert(pNode); 19 | return *pNode; 20 | } 21 | 22 | void memory::merge(const memory& rhs) { 23 | m_nodes.insert(rhs.m_nodes.begin(), rhs.m_nodes.end()); 24 | } 25 | } // namespace detail 26 | } // namespace YAML 27 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/node.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/node/node.h" 2 | #include "nodebuilder.h" 3 | #include "nodeevents.h" 4 | 5 | namespace YAML { 6 | Node Clone(const Node& node) { 7 | NodeEvents events(node); 8 | NodeBuilder builder; 9 | events.Emit(builder); 10 | return builder.Root(); 11 | } 12 | } // namespace YAML 13 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/nodeevents.h: -------------------------------------------------------------------------------- 1 | #ifndef NODE_NODEEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define NODE_NODEEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | #include "yaml-cpp/anchor.h" 14 | #include "yaml-cpp/node/ptr.h" 15 | 16 | namespace YAML { 17 | namespace detail { 18 | class node; 19 | } // namespace detail 20 | } // namespace YAML 21 | 22 | namespace YAML { 23 | class EventHandler; 24 | class Node; 25 | 26 | class NodeEvents { 27 | public: 28 | explicit NodeEvents(const Node& node); 29 | NodeEvents(const NodeEvents&) = delete; 30 | NodeEvents(NodeEvents&&) = delete; 31 | NodeEvents& operator=(const NodeEvents&) = delete; 32 | NodeEvents& operator=(NodeEvents&&) = delete; 33 | 34 | void Emit(EventHandler& handler); 35 | 36 | private: 37 | class AliasManager { 38 | public: 39 | AliasManager() : m_anchorByIdentity{}, m_curAnchor(0) {} 40 | 41 | void RegisterReference(const detail::node& node); 42 | anchor_t LookupAnchor(const detail::node& node) const; 43 | 44 | private: 45 | anchor_t _CreateNewAnchor() { return ++m_curAnchor; } 46 | 47 | private: 48 | using AnchorByIdentity = std::map; 49 | AnchorByIdentity m_anchorByIdentity; 50 | 51 | anchor_t m_curAnchor; 52 | }; 53 | 54 | void Setup(const detail::node& node); 55 | void Emit(const detail::node& node, EventHandler& handler, 56 | AliasManager& am) const; 57 | bool IsAliased(const detail::node& node) const; 58 | 59 | private: 60 | detail::shared_memory_holder m_pMemory; 61 | detail::node* m_root; 62 | 63 | using RefCount = std::map; 64 | RefCount m_refCount; 65 | }; 66 | } // namespace YAML 67 | 68 | #endif // NODE_NODEEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 69 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/null.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/null.h" 2 | 3 | namespace YAML { 4 | _Null Null; 5 | 6 | bool IsNullString(const std::string& str) { 7 | return str.empty() || str == "~" || str == "null" || str == "Null" || 8 | str == "NULL"; 9 | } 10 | } // namespace YAML 11 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/ostream_wrapper.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/ostream_wrapper.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace YAML { 8 | ostream_wrapper::ostream_wrapper() 9 | : m_buffer(1, '\0'), 10 | m_pStream(nullptr), 11 | m_pos(0), 12 | m_row(0), 13 | m_col(0), 14 | m_comment(false) {} 15 | 16 | ostream_wrapper::ostream_wrapper(std::ostream& stream) 17 | : m_buffer{}, 18 | m_pStream(&stream), 19 | m_pos(0), 20 | m_row(0), 21 | m_col(0), 22 | m_comment(false) {} 23 | 24 | ostream_wrapper::~ostream_wrapper() = default; 25 | 26 | void ostream_wrapper::write(const std::string& str) { 27 | if (m_pStream) { 28 | m_pStream->write(str.c_str(), str.size()); 29 | } else { 30 | m_buffer.resize(std::max(m_buffer.size(), m_pos + str.size() + 1)); 31 | std::copy(str.begin(), str.end(), m_buffer.begin() + m_pos); 32 | } 33 | 34 | for (char ch : str) { 35 | update_pos(ch); 36 | } 37 | } 38 | 39 | void ostream_wrapper::write(const char* str, std::size_t size) { 40 | if (m_pStream) { 41 | m_pStream->write(str, size); 42 | } else { 43 | m_buffer.resize(std::max(m_buffer.size(), m_pos + size + 1)); 44 | std::copy(str, str + size, m_buffer.begin() + m_pos); 45 | } 46 | 47 | for (std::size_t i = 0; i < size; i++) { 48 | update_pos(str[i]); 49 | } 50 | } 51 | 52 | void ostream_wrapper::update_pos(char ch) { 53 | m_pos++; 54 | m_col++; 55 | 56 | if (ch == '\n') { 57 | m_row++; 58 | m_col = 0; 59 | m_comment = false; 60 | } 61 | } 62 | } // namespace YAML 63 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/parse.cpp: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/node/parse.h" 2 | 3 | #include 4 | #include 5 | 6 | #include "nodebuilder.h" 7 | #include "yaml-cpp/node/impl.h" 8 | #include "yaml-cpp/node/node.h" 9 | #include "yaml-cpp/parser.h" 10 | 11 | namespace YAML { 12 | Node Load(const std::string& input) { 13 | std::stringstream stream(input); 14 | return Load(stream); 15 | } 16 | 17 | Node Load(const char* input) { 18 | std::stringstream stream(input); 19 | return Load(stream); 20 | } 21 | 22 | Node Load(std::istream& input) { 23 | Parser parser(input); 24 | NodeBuilder builder; 25 | if (!parser.HandleNextDocument(builder)) { 26 | return Node(); 27 | } 28 | 29 | return builder.Root(); 30 | } 31 | 32 | Node LoadFile(const std::string& filename) { 33 | std::ifstream fin(filename); 34 | if (!fin) { 35 | throw BadFile(filename); 36 | } 37 | return Load(fin); 38 | } 39 | 40 | std::vector LoadAll(const std::string& input) { 41 | std::stringstream stream(input); 42 | return LoadAll(stream); 43 | } 44 | 45 | std::vector LoadAll(const char* input) { 46 | std::stringstream stream(input); 47 | return LoadAll(stream); 48 | } 49 | 50 | std::vector LoadAll(std::istream& input) { 51 | std::vector docs; 52 | 53 | Parser parser(input); 54 | while (true) { 55 | NodeBuilder builder; 56 | if (!parser.HandleNextDocument(builder)) { 57 | break; 58 | } 59 | docs.push_back(builder.Root()); 60 | } 61 | 62 | return docs; 63 | } 64 | 65 | std::vector LoadAllFromFile(const std::string& filename) { 66 | std::ifstream fin(filename); 67 | if (!fin) { 68 | throw BadFile(filename); 69 | } 70 | return LoadAll(fin); 71 | } 72 | } // namespace YAML 73 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/ptr_vector.h: -------------------------------------------------------------------------------- 1 | #ifndef PTR_VECTOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define PTR_VECTOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | namespace YAML { 16 | 17 | // TODO: This class is no longer needed 18 | template 19 | class ptr_vector { 20 | public: 21 | ptr_vector() : m_data{} {} 22 | ptr_vector(const ptr_vector&) = delete; 23 | ptr_vector(ptr_vector&&) = default; 24 | ptr_vector& operator=(const ptr_vector&) = delete; 25 | ptr_vector& operator=(ptr_vector&&) = default; 26 | 27 | void clear() { m_data.clear(); } 28 | 29 | std::size_t size() const { return m_data.size(); } 30 | bool empty() const { return m_data.empty(); } 31 | 32 | void push_back(std::unique_ptr&& t) { m_data.push_back(std::move(t)); } 33 | T& operator[](std::size_t i) { return *m_data[i]; } 34 | const T& operator[](std::size_t i) const { return *m_data[i]; } 35 | 36 | T& back() { return *(m_data.back().get()); } 37 | 38 | const T& back() const { return *(m_data.back().get()); } 39 | 40 | private: 41 | std::vector> m_data; 42 | }; 43 | } // namespace YAML 44 | 45 | #endif // PTR_VECTOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 46 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/regex_yaml.cpp: -------------------------------------------------------------------------------- 1 | #include "regex_yaml.h" 2 | 3 | namespace YAML { 4 | // constructors 5 | 6 | RegEx::RegEx(REGEX_OP op) : m_op(op), m_a(0), m_z(0), m_params{} {} 7 | RegEx::RegEx() : RegEx(REGEX_EMPTY) {} 8 | 9 | RegEx::RegEx(char ch) : m_op(REGEX_MATCH), m_a(ch), m_z(0), m_params{} {} 10 | 11 | RegEx::RegEx(char a, char z) : m_op(REGEX_RANGE), m_a(a), m_z(z), m_params{} {} 12 | 13 | RegEx::RegEx(const std::string& str, REGEX_OP op) 14 | : m_op(op), m_a(0), m_z(0), m_params(str.begin(), str.end()) {} 15 | 16 | // combination constructors 17 | RegEx operator!(const RegEx& ex) { 18 | RegEx ret(REGEX_NOT); 19 | ret.m_params.push_back(ex); 20 | return ret; 21 | } 22 | 23 | RegEx operator|(const RegEx& ex1, const RegEx& ex2) { 24 | RegEx ret(REGEX_OR); 25 | ret.m_params.push_back(ex1); 26 | ret.m_params.push_back(ex2); 27 | return ret; 28 | } 29 | 30 | RegEx operator&(const RegEx& ex1, const RegEx& ex2) { 31 | RegEx ret(REGEX_AND); 32 | ret.m_params.push_back(ex1); 33 | ret.m_params.push_back(ex2); 34 | return ret; 35 | } 36 | 37 | RegEx operator+(const RegEx& ex1, const RegEx& ex2) { 38 | RegEx ret(REGEX_SEQ); 39 | ret.m_params.push_back(ex1); 40 | ret.m_params.push_back(ex2); 41 | return ret; 42 | } 43 | } // namespace YAML 44 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/scantag.cpp: -------------------------------------------------------------------------------- 1 | #include "exp.h" 2 | #include "regex_yaml.h" 3 | #include "regeximpl.h" 4 | #include "stream.h" 5 | #include "yaml-cpp/exceptions.h" // IWYU pragma: keep 6 | #include "yaml-cpp/mark.h" 7 | 8 | namespace YAML { 9 | const std::string ScanVerbatimTag(Stream& INPUT) { 10 | std::string tag; 11 | 12 | // eat the start character 13 | INPUT.get(); 14 | 15 | while (INPUT) { 16 | if (INPUT.peek() == Keys::VerbatimTagEnd) { 17 | // eat the end character 18 | INPUT.get(); 19 | return tag; 20 | } 21 | 22 | int n = Exp::URI().Match(INPUT); 23 | if (n <= 0) 24 | break; 25 | 26 | tag += INPUT.get(n); 27 | } 28 | 29 | throw ParserException(INPUT.mark(), ErrorMsg::END_OF_VERBATIM_TAG); 30 | } 31 | 32 | const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle) { 33 | std::string tag; 34 | canBeHandle = true; 35 | Mark firstNonWordChar; 36 | 37 | while (INPUT) { 38 | if (INPUT.peek() == Keys::Tag) { 39 | if (!canBeHandle) 40 | throw ParserException(firstNonWordChar, ErrorMsg::CHAR_IN_TAG_HANDLE); 41 | break; 42 | } 43 | 44 | int n = 0; 45 | if (canBeHandle) { 46 | n = Exp::Word().Match(INPUT); 47 | if (n <= 0) { 48 | canBeHandle = false; 49 | firstNonWordChar = INPUT.mark(); 50 | } 51 | } 52 | 53 | if (!canBeHandle) 54 | n = Exp::Tag().Match(INPUT); 55 | 56 | if (n <= 0) 57 | break; 58 | 59 | tag += INPUT.get(n); 60 | } 61 | 62 | return tag; 63 | } 64 | 65 | const std::string ScanTagSuffix(Stream& INPUT) { 66 | std::string tag; 67 | 68 | while (INPUT) { 69 | int n = Exp::Tag().Match(INPUT); 70 | if (n <= 0) 71 | break; 72 | 73 | tag += INPUT.get(n); 74 | } 75 | 76 | if (tag.empty()) 77 | throw ParserException(INPUT.mark(), ErrorMsg::TAG_WITH_NO_SUFFIX); 78 | 79 | return tag; 80 | } 81 | } // namespace YAML 82 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/scantag.h: -------------------------------------------------------------------------------- 1 | #ifndef SCANTAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define SCANTAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | #include "stream.h" 12 | 13 | namespace YAML { 14 | const std::string ScanVerbatimTag(Stream& INPUT); 15 | const std::string ScanTagHandle(Stream& INPUT, bool& canBeHandle); 16 | const std::string ScanTagSuffix(Stream& INPUT); 17 | } 18 | 19 | #endif // SCANTAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 20 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/singledocparser.h: -------------------------------------------------------------------------------- 1 | #ifndef SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "yaml-cpp/anchor.h" 15 | 16 | namespace YAML { 17 | class CollectionStack; 18 | template class DepthGuard; // depthguard.h 19 | class EventHandler; 20 | class Node; 21 | class Scanner; 22 | struct Directives; 23 | struct Mark; 24 | struct Token; 25 | 26 | class SingleDocParser { 27 | public: 28 | SingleDocParser(Scanner& scanner, const Directives& directives); 29 | SingleDocParser(const SingleDocParser&) = delete; 30 | SingleDocParser(SingleDocParser&&) = delete; 31 | SingleDocParser& operator=(const SingleDocParser&) = delete; 32 | SingleDocParser& operator=(SingleDocParser&&) = delete; 33 | ~SingleDocParser(); 34 | 35 | void HandleDocument(EventHandler& eventHandler); 36 | 37 | private: 38 | void HandleNode(EventHandler& eventHandler); 39 | 40 | void HandleSequence(EventHandler& eventHandler); 41 | void HandleBlockSequence(EventHandler& eventHandler); 42 | void HandleFlowSequence(EventHandler& eventHandler); 43 | 44 | void HandleMap(EventHandler& eventHandler); 45 | void HandleBlockMap(EventHandler& eventHandler); 46 | void HandleFlowMap(EventHandler& eventHandler); 47 | void HandleCompactMap(EventHandler& eventHandler); 48 | void HandleCompactMapWithNoKey(EventHandler& eventHandler); 49 | 50 | void ParseProperties(std::string& tag, anchor_t& anchor, 51 | std::string& anchor_name); 52 | void ParseTag(std::string& tag); 53 | void ParseAnchor(anchor_t& anchor, std::string& anchor_name); 54 | 55 | anchor_t RegisterAnchor(const std::string& name); 56 | anchor_t LookupAnchor(const Mark& mark, const std::string& name) const; 57 | 58 | private: 59 | int depth = 0; 60 | Scanner& m_scanner; 61 | const Directives& m_directives; 62 | std::unique_ptr m_pCollectionStack; 63 | 64 | using Anchors = std::map; 65 | Anchors m_anchors; 66 | 67 | anchor_t m_curAnchor; 68 | }; 69 | } // namespace YAML 70 | 71 | #endif // SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 72 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/stream.h: -------------------------------------------------------------------------------- 1 | #ifndef STREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include "yaml-cpp/mark.h" 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | namespace YAML { 19 | 20 | class StreamCharSource; 21 | 22 | class Stream { 23 | public: 24 | friend class StreamCharSource; 25 | 26 | Stream(std::istream& input); 27 | Stream(const Stream&) = delete; 28 | Stream(Stream&&) = delete; 29 | Stream& operator=(const Stream&) = delete; 30 | Stream& operator=(Stream&&) = delete; 31 | ~Stream(); 32 | 33 | operator bool() const; 34 | bool operator!() const { return !static_cast(*this); } 35 | 36 | char peek() const; 37 | char get(); 38 | std::string get(int n); 39 | void eat(int n = 1); 40 | 41 | static char eof() { return 0x04; } 42 | 43 | const Mark mark() const { return m_mark; } 44 | int pos() const { return m_mark.pos; } 45 | int line() const { return m_mark.line; } 46 | int column() const { return m_mark.column; } 47 | void ResetColumn() { m_mark.column = 0; } 48 | 49 | private: 50 | enum CharacterSet { utf8, utf16le, utf16be, utf32le, utf32be }; 51 | 52 | std::istream& m_input; 53 | Mark m_mark; 54 | 55 | CharacterSet m_charSet; 56 | mutable std::deque m_readahead; 57 | unsigned char* const m_pPrefetched; 58 | mutable size_t m_nPrefetchedAvailable; 59 | mutable size_t m_nPrefetchedUsed; 60 | 61 | void AdvanceCurrent(); 62 | char CharAt(size_t i) const; 63 | bool ReadAheadTo(size_t i) const; 64 | bool _ReadAheadTo(size_t i) const; 65 | void StreamInUtf8() const; 66 | void StreamInUtf16() const; 67 | void StreamInUtf32() const; 68 | unsigned char GetNextByte() const; 69 | }; 70 | 71 | // CharAt 72 | // . Unchecked access 73 | inline char Stream::CharAt(size_t i) const { return m_readahead[i]; } 74 | 75 | inline bool Stream::ReadAheadTo(size_t i) const { 76 | if (m_readahead.size() > i) 77 | return true; 78 | return _ReadAheadTo(i); 79 | } 80 | } // namespace YAML 81 | 82 | #endif // STREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 83 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/streamcharsource.h: -------------------------------------------------------------------------------- 1 | #ifndef STREAMCHARSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STREAMCHARSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include "yaml-cpp/noexcept.h" 11 | #include "stream.h" 12 | #include 13 | 14 | namespace YAML { 15 | 16 | class StreamCharSource { 17 | public: 18 | StreamCharSource(const Stream& stream) : m_offset(0), m_stream(stream) {} 19 | StreamCharSource(const StreamCharSource& source) = default; 20 | StreamCharSource(StreamCharSource&&) YAML_CPP_NOEXCEPT = default; 21 | StreamCharSource& operator=(const StreamCharSource&) = delete; 22 | StreamCharSource& operator=(StreamCharSource&&) = delete; 23 | ~StreamCharSource() = default; 24 | 25 | operator bool() const; 26 | char operator[](std::size_t i) const { return m_stream.CharAt(m_offset + i); } 27 | bool operator!() const { return !static_cast(*this); } 28 | 29 | const StreamCharSource operator+(int i) const; 30 | 31 | private: 32 | std::size_t m_offset; 33 | const Stream& m_stream; 34 | }; 35 | 36 | inline StreamCharSource::operator bool() const { 37 | return m_stream.ReadAheadTo(m_offset); 38 | } 39 | 40 | inline const StreamCharSource StreamCharSource::operator+(int i) const { 41 | StreamCharSource source(*this); 42 | if (static_cast(source.m_offset) + i >= 0) 43 | source.m_offset += static_cast(i); 44 | else 45 | source.m_offset = 0; 46 | return source; 47 | } 48 | } // namespace YAML 49 | 50 | #endif // STREAMCHARSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 51 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/stringsource.h: -------------------------------------------------------------------------------- 1 | #ifndef STRINGSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define STRINGSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | 12 | namespace YAML { 13 | class StringCharSource { 14 | public: 15 | StringCharSource(const char* str, std::size_t size) 16 | : m_str(str), m_size(size), m_offset(0) {} 17 | 18 | operator bool() const { return m_offset < m_size; } 19 | char operator[](std::size_t i) const { return m_str[m_offset + i]; } 20 | bool operator!() const { return !static_cast(*this); } 21 | 22 | const StringCharSource operator+(int i) const { 23 | StringCharSource source(*this); 24 | if (static_cast(source.m_offset) + i >= 0) 25 | source.m_offset += i; 26 | else 27 | source.m_offset = 0; 28 | return source; 29 | } 30 | 31 | StringCharSource& operator++() { 32 | ++m_offset; 33 | return *this; 34 | } 35 | 36 | StringCharSource& operator+=(std::size_t offset) { 37 | m_offset += offset; 38 | return *this; 39 | } 40 | 41 | private: 42 | const char* m_str; 43 | std::size_t m_size; 44 | std::size_t m_offset; 45 | }; 46 | } 47 | 48 | #endif // STRINGSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 49 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/tag.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "directives.h" // IWYU pragma: keep 5 | #include "tag.h" 6 | #include "token.h" 7 | 8 | namespace YAML { 9 | Tag::Tag(const Token& token) 10 | : type(static_cast(token.data)), handle{}, value{} { 11 | switch (type) { 12 | case VERBATIM: 13 | value = token.value; 14 | break; 15 | case PRIMARY_HANDLE: 16 | value = token.value; 17 | break; 18 | case SECONDARY_HANDLE: 19 | value = token.value; 20 | break; 21 | case NAMED_HANDLE: 22 | handle = token.value; 23 | value = token.params[0]; 24 | break; 25 | case NON_SPECIFIC: 26 | break; 27 | default: 28 | assert(false); 29 | } 30 | } 31 | 32 | std::string Tag::Translate(const Directives& directives) { 33 | switch (type) { 34 | case VERBATIM: 35 | return value; 36 | case PRIMARY_HANDLE: 37 | return directives.TranslateTagHandle("!") + value; 38 | case SECONDARY_HANDLE: 39 | return directives.TranslateTagHandle("!!") + value; 40 | case NAMED_HANDLE: 41 | return directives.TranslateTagHandle("!" + handle + "!") + value; 42 | case NON_SPECIFIC: 43 | // TODO: 44 | return "!"; 45 | default: 46 | assert(false); 47 | } 48 | throw std::runtime_error("yaml-cpp: internal error, bad tag type"); 49 | } 50 | } // namespace YAML 51 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/tag.h: -------------------------------------------------------------------------------- 1 | #ifndef TAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define TAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include 11 | 12 | namespace YAML { 13 | struct Directives; 14 | struct Token; 15 | 16 | struct Tag { 17 | enum TYPE { 18 | VERBATIM, 19 | PRIMARY_HANDLE, 20 | SECONDARY_HANDLE, 21 | NAMED_HANDLE, 22 | NON_SPECIFIC 23 | }; 24 | 25 | Tag(const Token& token); 26 | std::string Translate(const Directives& directives); 27 | 28 | TYPE type; 29 | std::string handle, value; 30 | }; 31 | } 32 | 33 | #endif // TAG_H_62B23520_7C8E_11DE_8A39_0800200C9A66 34 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/src/token.h: -------------------------------------------------------------------------------- 1 | #ifndef TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 | #define TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 3 | 4 | #if defined(_MSC_VER) || \ 5 | (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 | (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 7 | #pragma once 8 | #endif 9 | 10 | #include "yaml-cpp/mark.h" 11 | #include 12 | #include 13 | #include 14 | 15 | namespace YAML { 16 | const std::string TokenNames[] = { 17 | "DIRECTIVE", "DOC_START", "DOC_END", "BLOCK_SEQ_START", 18 | "BLOCK_MAP_START", "BLOCK_SEQ_END", "BLOCK_MAP_END", "BLOCK_ENTRY", 19 | "FLOW_SEQ_START", "FLOW_MAP_START", "FLOW_SEQ_END", "FLOW_MAP_END", 20 | "FLOW_MAP_COMPACT", "FLOW_ENTRY", "KEY", "VALUE", 21 | "ANCHOR", "ALIAS", "TAG", "SCALAR"}; 22 | 23 | struct Token { 24 | // enums 25 | enum STATUS { VALID, INVALID, UNVERIFIED }; 26 | enum TYPE { 27 | DIRECTIVE, 28 | DOC_START, 29 | DOC_END, 30 | BLOCK_SEQ_START, 31 | BLOCK_MAP_START, 32 | BLOCK_SEQ_END, 33 | BLOCK_MAP_END, 34 | BLOCK_ENTRY, 35 | FLOW_SEQ_START, 36 | FLOW_MAP_START, 37 | FLOW_SEQ_END, 38 | FLOW_MAP_END, 39 | FLOW_MAP_COMPACT, 40 | FLOW_ENTRY, 41 | KEY, 42 | VALUE, 43 | ANCHOR, 44 | ALIAS, 45 | TAG, 46 | PLAIN_SCALAR, 47 | NON_PLAIN_SCALAR 48 | }; 49 | 50 | // data 51 | Token(TYPE type_, const Mark& mark_) 52 | : status(VALID), type(type_), mark(mark_), value{}, params{}, data(0) {} 53 | 54 | friend std::ostream& operator<<(std::ostream& out, const Token& token) { 55 | out << TokenNames[token.type] << std::string(": ") << token.value; 56 | for (const std::string& param : token.params) 57 | out << std::string(" ") << param; 58 | return out; 59 | } 60 | 61 | STATUS status; 62 | TYPE type; 63 | Mark mark; 64 | std::string value; 65 | std::vector params; 66 | int data; 67 | }; 68 | } // namespace YAML 69 | 70 | #endif // TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 71 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/BUILD.bazel: -------------------------------------------------------------------------------- 1 | cc_test( 2 | name = "test", 3 | srcs = glob([ 4 | "*.cpp", 5 | "*.h", 6 | "integrations/*.cpp", 7 | "node/*.cpp", 8 | ]), 9 | deps = [ 10 | "//:yaml-cpp", 11 | "//:yaml-cpp_internal", 12 | "@com_google_googletest//:gtest_main", 13 | ], 14 | ) 15 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(Threads REQUIRED) 2 | 3 | set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) 4 | set(BUILD_MOCK ON CACHE BOOL "" FORCE) 5 | set(CMAKE_POLICY_DEFAULT_CMP0048 NEW) 6 | 7 | add_subdirectory( 8 | "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.11.0" 9 | "${CMAKE_CURRENT_BINARY_DIR}/prefix") 10 | 11 | include_directories(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.11.0/googletest/include") 12 | 13 | set(test-new-api-pattern "new-api/*.cpp") 14 | set(test-source-pattern "*.cpp" "integration/*.cpp" "node/*.cpp") 15 | if (CMAKE_VERSION VERSION_GREATER 3.11) 16 | list(INSERT test-new-api-pattern 0 CONFIGURE_DEPENDS) 17 | list(INSERT test-source-pattern 0 CONFIGURE_DEPENDS) 18 | endif() 19 | 20 | file(GLOB test-new-api-sources ${test-new-api-pattern}) 21 | file(GLOB test-sources ${test-source-pattern}) 22 | 23 | add_executable(yaml-cpp-tests "") 24 | target_sources(yaml-cpp-tests 25 | PRIVATE 26 | ${test-new-api-sources} 27 | ${test-sources}) 28 | target_include_directories(yaml-cpp-tests 29 | PRIVATE 30 | ${CMAKE_CURRENT_SOURCE_DIR}/integration 31 | ${CMAKE_CURRENT_SOURCE_DIR} 32 | ${PROJECT_SOURCE_DIR}/src) 33 | target_compile_options(yaml-cpp-tests 34 | PRIVATE 35 | $<$:-Wno-c99-extensions -Wno-variadic-macros -Wno-sign-compare> 36 | $<$:-Wno-variadic-macros -Wno-sign-compare>) 37 | target_link_libraries(yaml-cpp-tests 38 | PRIVATE 39 | Threads::Threads 40 | yaml-cpp 41 | gmock) 42 | 43 | set_property(TARGET yaml-cpp-tests PROPERTY CXX_STANDARD_REQUIRED ON) 44 | if (NOT DEFINED CMAKE_CXX_STANDARD) 45 | set_target_properties(yaml-cpp-tests PROPERTIES CXX_STANDARD 11) 46 | endif() 47 | 48 | 49 | add_test(yaml-cpp::test yaml-cpp-tests) 50 | 51 | if (build-windows-dll) 52 | add_custom_command( 53 | TARGET yaml-cpp-tests 54 | POST_BUILD COMMAND ${CMAKE_COMMAND} -E 55 | copy_if_different "$" "$") 56 | endif() 57 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/binary_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | #include 3 | 4 | TEST(BinaryTest, DecodingSimple) { 5 | std::string input{90, 71, 86, 104, 90, 71, 74, 108, 90, 87, 89, 61}; 6 | const std::vector &result = YAML::DecodeBase64(input); 7 | EXPECT_EQ(std::string(result.begin(), result.end()), "deadbeef"); 8 | } 9 | 10 | TEST(BinaryTest, DecodingNoCrashOnNegative) { 11 | std::string input{-58, -1, -99, 109}; 12 | const std::vector &result = YAML::DecodeBase64(input); 13 | EXPECT_TRUE(result.empty()); 14 | } 15 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/.clang-format: -------------------------------------------------------------------------------- 1 | # Run manually to reformat a file: 2 | # clang-format -i --style=file 3 | Language: Cpp 4 | BasedOnStyle: Google 5 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/.github/ISSUE_TEMPLATE/00-bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: 'bug' 6 | assignees: '' 7 | --- 8 | 9 | **Describe the bug** 10 | 11 | Include a clear and concise description of what the problem is, including what 12 | you expected to happen, and what actually happened. 13 | 14 | **Steps to reproduce the bug** 15 | 16 | It's important that we are able to reproduce the problem that you are 17 | experiencing. Please provide all code and relevant steps to reproduce the 18 | problem, including your `BUILD`/`CMakeLists.txt` file and build commands. Links 19 | to a GitHub branch or [godbolt.org](https://godbolt.org/) that demonstrate the 20 | problem are also helpful. 21 | 22 | **Does the bug persist in the most recent commit?** 23 | 24 | We recommend using the latest commit in the master branch in your projects. 25 | 26 | **What operating system and version are you using?** 27 | 28 | If you are using a Linux distribution please include the name and version of the 29 | distribution as well. 30 | 31 | **What compiler and version are you using?** 32 | 33 | Please include the output of `gcc -v` or `clang -v`, or the equivalent for your 34 | compiler. 35 | 36 | **What build system are you using?** 37 | 38 | Please include the output of `bazel --version` or `cmake --version`, or the 39 | equivalent for your build system. 40 | 41 | **Additional context** 42 | 43 | Add any other context about the problem here. 44 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/.github/ISSUE_TEMPLATE/10-feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Propose a new feature 4 | title: '' 5 | labels: 'enhancement' 6 | assignees: '' 7 | --- 8 | 9 | **Does the feature exist in the most recent commit?** 10 | 11 | We recommend using the latest commit from GitHub in your projects. 12 | 13 | **Why do we need this feature?** 14 | 15 | Ideally, explain why a combination of existing features cannot be used instead. 16 | 17 | **Describe the proposal** 18 | 19 | Include a detailed description of the feature, with usage examples. 20 | 21 | **Is the feature specific to an operating system, compiler, or build system version?** 22 | 23 | If it is, please specify which versions. 24 | 25 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore CI build directory 2 | build/ 3 | xcuserdata 4 | cmake-build-debug/ 5 | .idea/ 6 | bazel-bin 7 | bazel-genfiles 8 | bazel-googletest 9 | bazel-out 10 | bazel-testlogs 11 | # python 12 | *.pyc 13 | 14 | # Visual Studio files 15 | .vs 16 | *.sdf 17 | *.opensdf 18 | *.VC.opendb 19 | *.suo 20 | *.user 21 | _ReSharper.Caches/ 22 | Win32-Debug/ 23 | Win32-Release/ 24 | x64-Debug/ 25 | x64-Release/ 26 | 27 | # Ignore autoconf / automake files 28 | Makefile.in 29 | aclocal.m4 30 | configure 31 | build-aux/ 32 | autom4te.cache/ 33 | googletest/m4/libtool.m4 34 | googletest/m4/ltoptions.m4 35 | googletest/m4/ltsugar.m4 36 | googletest/m4/ltversion.m4 37 | googletest/m4/lt~obsolete.m4 38 | googlemock/m4 39 | 40 | # Ignore generated directories. 41 | googlemock/fused-src/ 42 | googletest/fused-src/ 43 | 44 | # macOS files 45 | .DS_Store 46 | googletest/.DS_Store 47 | googletest/xcode/.DS_Store 48 | 49 | # Ignore cmake generated directories and files. 50 | CMakeFiles 51 | CTestTestfile.cmake 52 | Makefile 53 | cmake_install.cmake 54 | googlemock/CMakeFiles 55 | googlemock/CTestTestfile.cmake 56 | googlemock/Makefile 57 | googlemock/cmake_install.cmake 58 | googlemock/gtest 59 | /bin 60 | /googlemock/gmock.dir 61 | /googlemock/gmock_main.dir 62 | /googlemock/RUN_TESTS.vcxproj.filters 63 | /googlemock/RUN_TESTS.vcxproj 64 | /googlemock/INSTALL.vcxproj.filters 65 | /googlemock/INSTALL.vcxproj 66 | /googlemock/gmock_main.vcxproj.filters 67 | /googlemock/gmock_main.vcxproj 68 | /googlemock/gmock.vcxproj.filters 69 | /googlemock/gmock.vcxproj 70 | /googlemock/gmock.sln 71 | /googlemock/ALL_BUILD.vcxproj.filters 72 | /googlemock/ALL_BUILD.vcxproj 73 | /lib 74 | /Win32 75 | /ZERO_CHECK.vcxproj.filters 76 | /ZERO_CHECK.vcxproj 77 | /RUN_TESTS.vcxproj.filters 78 | /RUN_TESTS.vcxproj 79 | /INSTALL.vcxproj.filters 80 | /INSTALL.vcxproj 81 | /googletest-distribution.sln 82 | /CMakeCache.txt 83 | /ALL_BUILD.vcxproj.filters 84 | /ALL_BUILD.vcxproj 85 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Note: CMake support is community-based. The maintainers do not use CMake 2 | # internally. 3 | 4 | cmake_minimum_required(VERSION 2.8.12) 5 | 6 | if (POLICY CMP0048) 7 | cmake_policy(SET CMP0048 NEW) 8 | endif (POLICY CMP0048) 9 | 10 | project(googletest-distribution) 11 | set(GOOGLETEST_VERSION 1.11.0) 12 | 13 | if (CMAKE_VERSION VERSION_GREATER "3.0.2") 14 | if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX) 15 | set(CMAKE_CXX_EXTENSIONS OFF) 16 | endif() 17 | endif() 18 | 19 | enable_testing() 20 | 21 | include(CMakeDependentOption) 22 | include(GNUInstallDirs) 23 | 24 | #Note that googlemock target already builds googletest 25 | option(BUILD_GMOCK "Builds the googlemock subproject" ON) 26 | option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON) 27 | 28 | if(BUILD_GMOCK) 29 | add_subdirectory( googlemock ) 30 | else() 31 | add_subdirectory( googletest ) 32 | endif() 33 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file contains a list of people who've made non-trivial 2 | # contribution to the Google C++ Testing Framework project. People 3 | # who commit code to the project are encouraged to add their names 4 | # here. Please keep the list sorted by first names. 5 | 6 | Ajay Joshi 7 | Balázs Dán 8 | Benoit Sigoure 9 | Bharat Mediratta 10 | Bogdan Piloca 11 | Chandler Carruth 12 | Chris Prince 13 | Chris Taylor 14 | Dan Egnor 15 | Dave MacLachlan 16 | David Anderson 17 | Dean Sturtevant 18 | Eric Roman 19 | Gene Volovich 20 | Hady Zalek 21 | Hal Burch 22 | Jeffrey Yasskin 23 | Jim Keller 24 | Joe Walnes 25 | Jon Wray 26 | Jói Sigurðsson 27 | Keir Mierle 28 | Keith Ray 29 | Kenton Varda 30 | Kostya Serebryany 31 | Krystian Kuzniarek 32 | Lev Makhlis 33 | Manuel Klimek 34 | Mario Tanev 35 | Mark Paskin 36 | Markus Heule 37 | Matthew Simmons 38 | Mika Raento 39 | Mike Bland 40 | Miklós Fazekas 41 | Neal Norwitz 42 | Nermin Ozkiranartli 43 | Owen Carlsen 44 | Paneendra Ba 45 | Pasi Valminen 46 | Patrick Hanna 47 | Patrick Riley 48 | Paul Menage 49 | Peter Kaminski 50 | Piotr Kaminski 51 | Preston Jackson 52 | Rainer Klaffenboeck 53 | Russ Cox 54 | Russ Rufer 55 | Sean Mcafee 56 | Sigurður Ásgeirsson 57 | Sverre Sundsdal 58 | Takeshi Yoshino 59 | Tracy Bialik 60 | Vadim Berman 61 | Vlad Losev 62 | Wolfgang Klier 63 | Zhanyong Wan 64 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "com_google_googletest") 2 | 3 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 4 | 5 | http_archive( 6 | name = "com_google_absl", 7 | urls = ["https://github.com/abseil/abseil-cpp/archive/7971fb358ae376e016d2d4fc9327aad95659b25e.zip"], # 2021-05-20T02:59:16Z 8 | strip_prefix = "abseil-cpp-7971fb358ae376e016d2d4fc9327aad95659b25e", 9 | sha256 = "aeba534f7307e36fe084b452299e49b97420667a8d28102cf9a0daeed340b859", 10 | ) 11 | 12 | http_archive( 13 | name = "rules_cc", 14 | urls = ["https://github.com/bazelbuild/rules_cc/archive/68cb652a71e7e7e2858c50593e5a9e3b94e5b9a9.zip"], # 2021-05-14T14:51:14Z 15 | strip_prefix = "rules_cc-68cb652a71e7e7e2858c50593e5a9e3b94e5b9a9", 16 | sha256 = "1e19e9a3bc3d4ee91d7fcad00653485ee6c798efbbf9588d40b34cbfbded143d", 17 | ) 18 | 19 | http_archive( 20 | name = "rules_python", 21 | urls = ["https://github.com/bazelbuild/rules_python/archive/ed6cc8f2c3692a6a7f013ff8bc185ba77eb9b4d2.zip"], # 2021-05-17T00:24:16Z 22 | strip_prefix = "rules_python-ed6cc8f2c3692a6a7f013ff8bc185ba77eb9b4d2", 23 | sha256 = "98b3c592faea9636ac8444bfd9de7f3fb4c60590932d6e6ac5946e3f8dbd5ff6", 24 | ) 25 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/docs/_config.yml: -------------------------------------------------------------------------------- 1 | title: GoogleTest 2 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/docs/_data/navigation.yml: -------------------------------------------------------------------------------- 1 | nav: 2 | - section: "Get Started" 3 | items: 4 | - title: "Supported Platforms" 5 | url: "/platforms.html" 6 | - title: "Quickstart: Bazel" 7 | url: "/quickstart-bazel.html" 8 | - title: "Quickstart: CMake" 9 | url: "/quickstart-cmake.html" 10 | - section: "Guides" 11 | items: 12 | - title: "GoogleTest Primer" 13 | url: "/primer.html" 14 | - title: "Advanced Topics" 15 | url: "/advanced.html" 16 | - title: "Mocking for Dummies" 17 | url: "/gmock_for_dummies.html" 18 | - title: "Mocking Cookbook" 19 | url: "/gmock_cook_book.html" 20 | - title: "Mocking Cheat Sheet" 21 | url: "/gmock_cheat_sheet.html" 22 | - section: "References" 23 | items: 24 | - title: "Testing Reference" 25 | url: "/reference/testing.html" 26 | - title: "Mocking Reference" 27 | url: "/reference/mocking.html" 28 | - title: "Assertions" 29 | url: "/reference/assertions.html" 30 | - title: "Matchers" 31 | url: "/reference/matchers.html" 32 | - title: "Actions" 33 | url: "/reference/actions.html" 34 | - title: "Testing FAQ" 35 | url: "/faq.html" 36 | - title: "Mocking FAQ" 37 | url: "/gmock_faq.html" 38 | - title: "Code Samples" 39 | url: "/samples.html" 40 | - title: "Using pkg-config" 41 | url: "/pkgconfig.html" 42 | - title: "Community Documentation" 43 | url: "/community_created_documentation.html" 44 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/docs/assets/css/style.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @import "jekyll-theme-primer"; 5 | @import "main"; 6 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/docs/community_created_documentation.md: -------------------------------------------------------------------------------- 1 | # Community-Created Documentation 2 | 3 | The following is a list, in no particular order, of links to documentation 4 | created by the Googletest community. 5 | 6 | * [Googlemock Insights](https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/googletest/insights.md), 7 | by [ElectricRCAircraftGuy](https://github.com/ElectricRCAircraftGuy) 8 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/docs/index.md: -------------------------------------------------------------------------------- 1 | # GoogleTest User's Guide 2 | 3 | ## Welcome to GoogleTest! 4 | 5 | GoogleTest is Google's C++ testing and mocking framework. This user's guide has 6 | the following contents: 7 | 8 | * [GoogleTest Primer](primer.md) - Teaches you how to write simple tests using 9 | GoogleTest. Read this first if you are new to GoogleTest. 10 | * [GoogleTest Advanced](advanced.md) - Read this when you've finished the 11 | Primer and want to utilize GoogleTest to its full potential. 12 | * [GoogleTest Samples](samples.md) - Describes some GoogleTest samples. 13 | * [GoogleTest FAQ](faq.md) - Have a question? Want some tips? Check here 14 | first. 15 | * [Mocking for Dummies](gmock_for_dummies.md) - Teaches you how to create mock 16 | objects and use them in tests. 17 | * [Mocking Cookbook](gmock_cook_book.md) - Includes tips and approaches to 18 | common mocking use cases. 19 | * [Mocking Cheat Sheet](gmock_cheat_sheet.md) - A handy reference for 20 | matchers, actions, invariants, and more. 21 | * [Mocking FAQ](gmock_faq.md) - Contains answers to some mocking-specific 22 | questions. 23 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/docs/platforms.md: -------------------------------------------------------------------------------- 1 | # Supported Platforms 2 | 3 | GoogleTest requires a codebase and compiler compliant with the C++11 standard or 4 | newer. 5 | 6 | The GoogleTest code is officially supported on the following platforms. 7 | Operating systems or tools not listed below are community-supported. For 8 | community-supported platforms, patches that do not complicate the code may be 9 | considered. 10 | 11 | If you notice any problems on your platform, please file an issue on the 12 | [GoogleTest GitHub Issue Tracker](https://github.com/google/googletest/issues). 13 | Pull requests containing fixes are welcome! 14 | 15 | ### Operating systems 16 | 17 | * Linux 18 | * macOS 19 | * Windows 20 | 21 | ### Compilers 22 | 23 | * gcc 5.0+ 24 | * clang 5.0+ 25 | * MSVC 2015+ 26 | 27 | **macOS users:** Xcode 9.3+ provides clang 5.0+. 28 | 29 | ### Build systems 30 | 31 | * [Bazel](https://bazel.build/) 32 | * [CMake](https://cmake.org/) 33 | 34 | Bazel is the build system used by the team internally and in tests. CMake is 35 | supported on a best-effort basis and by the community. 36 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/docs/samples.md: -------------------------------------------------------------------------------- 1 | # Googletest Samples 2 | 3 | If you're like us, you'd like to look at 4 | [googletest samples.](https://github.com/google/googletest/tree/master/googletest/samples) 5 | The sample directory has a number of well-commented samples showing how to use a 6 | variety of googletest features. 7 | 8 | * Sample #1 shows the basic steps of using googletest to test C++ functions. 9 | * Sample #2 shows a more complex unit test for a class with multiple member 10 | functions. 11 | * Sample #3 uses a test fixture. 12 | * Sample #4 teaches you how to use googletest and `googletest.h` together to 13 | get the best of both libraries. 14 | * Sample #5 puts shared testing logic in a base test fixture, and reuses it in 15 | derived fixtures. 16 | * Sample #6 demonstrates type-parameterized tests. 17 | * Sample #7 teaches the basics of value-parameterized tests. 18 | * Sample #8 shows using `Combine()` in value-parameterized tests. 19 | * Sample #9 shows use of the listener API to modify Google Test's console 20 | output and the use of its reflection API to inspect test results. 21 | * Sample #10 shows use of the listener API to implement a primitive memory 22 | leak checker. 23 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/README.md: -------------------------------------------------------------------------------- 1 | # Googletest Mocking (gMock) Framework 2 | 3 | ### Overview 4 | 5 | Google's framework for writing and using C++ mock classes. It can help you 6 | derive better designs of your system and write better tests. 7 | 8 | It is inspired by: 9 | 10 | * [jMock](http://www.jmock.org/) 11 | * [EasyMock](http://www.easymock.org/) 12 | * [Hamcrest](http://code.google.com/p/hamcrest/) 13 | 14 | It is designed with C++'s specifics in mind. 15 | 16 | gMock: 17 | 18 | - Provides a declarative syntax for defining mocks. 19 | - Can define partial (hybrid) mocks, which are a cross of real and mock 20 | objects. 21 | - Handles functions of arbitrary types and overloaded functions. 22 | - Comes with a rich set of matchers for validating function arguments. 23 | - Uses an intuitive syntax for controlling the behavior of a mock. 24 | - Does automatic verification of expectations (no record-and-replay needed). 25 | - Allows arbitrary (partial) ordering constraints on function calls to be 26 | expressed. 27 | - Lets a user extend it by defining new matchers and actions. 28 | - Does not use exceptions. 29 | - Is easy to learn and use. 30 | 31 | Details and examples can be found here: 32 | 33 | * [gMock for Dummies](https://google.github.io/googletest/gmock_for_dummies.html) 34 | * [Legacy gMock FAQ](https://google.github.io/googletest/gmock_faq.html) 35 | * [gMock Cookbook](https://google.github.io/googletest/gmock_cook_book.html) 36 | * [gMock Cheat Sheet](https://google.github.io/googletest/gmock_cheat_sheet.html) 37 | 38 | Please note that code under scripts/generator/ is from the 39 | [cppclean project](http://code.google.com/p/cppclean/) and under the Apache 40 | License, which is different from GoogleMock's license. 41 | 42 | GoogleMock is a part of 43 | [GoogleTest C++ testing framework](http://github.com/google/googletest/) and a 44 | subject to the same requirements. 45 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/cmake/gmock.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gmock 5 | Description: GoogleMock (without main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gtest = @PROJECT_VERSION@ 9 | Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 11 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/cmake/gmock_main.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gmock_main 5 | Description: GoogleMock (with main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gmock = @PROJECT_VERSION@ 9 | Libs: -L${libdir} -lgmock_main @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 11 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/docs/README.md: -------------------------------------------------------------------------------- 1 | # Content Moved 2 | 3 | We are working on updates to the GoogleTest documentation, which has moved to 4 | the top-level [docs](../../docs) directory. 5 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/include/gmock/internal/custom/README.md: -------------------------------------------------------------------------------- 1 | # Customization Points 2 | 3 | The custom directory is an injection point for custom user configurations. 4 | 5 | ## Header `gmock-port.h` 6 | 7 | The following macros can be defined: 8 | 9 | ### Flag related macros: 10 | 11 | * `GMOCK_DECLARE_bool_(name)` 12 | * `GMOCK_DECLARE_int32_(name)` 13 | * `GMOCK_DECLARE_string_(name)` 14 | * `GMOCK_DEFINE_bool_(name, default_val, doc)` 15 | * `GMOCK_DEFINE_int32_(name, default_val, doc)` 16 | * `GMOCK_DEFINE_string_(name, default_val, doc)` 17 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/include/gmock/internal/custom/gmock-generated-actions.h: -------------------------------------------------------------------------------- 1 | // GOOGLETEST_CM0002 DO NOT DELETE 2 | 3 | #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 4 | #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 5 | 6 | #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 7 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/include/gmock/internal/custom/gmock-matchers.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Injection point for custom user configurations. See README for details 31 | // 32 | // GOOGLETEST_CM0002 DO NOT DELETE 33 | 34 | #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_ 35 | #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_ 36 | #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_ 37 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/include/gmock/internal/custom/gmock-port.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Injection point for custom user configurations. See README for details 31 | // 32 | // ** Custom implementation starts here ** 33 | 34 | // GOOGLETEST_CM0002 DO NOT DELETE 35 | 36 | #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ 37 | #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ 38 | 39 | #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ 40 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/scripts/README.md: -------------------------------------------------------------------------------- 1 | # Please Note: 2 | 3 | Files in this directory are no longer supported by the maintainers. They 4 | represent mostly historical artifacts and supported by the community only. There 5 | is no guarantee whatsoever that these scripts still work. 6 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/scripts/generator/README: -------------------------------------------------------------------------------- 1 | 2 | The Google Mock class generator is an application that is part of cppclean. 3 | For more information about cppclean, visit http://code.google.com/p/cppclean/ 4 | 5 | The mock generator requires Python 2.3.5 or later. If you don't have Python 6 | installed on your system, you will also need to install it. You can download 7 | Python from: http://www.python.org/download/releases/ 8 | 9 | To use the Google Mock class generator, you need to call it 10 | on the command line passing the header file and class for which you want 11 | to generate a Google Mock class. 12 | 13 | Make sure to install the scripts somewhere in your path. Then you can 14 | run the program. 15 | 16 | gmock_gen.py header-file.h [ClassName]... 17 | 18 | If no ClassNames are specified, all classes in the file are emitted. 19 | 20 | To change the indentation from the default of 2, set INDENT in 21 | the environment. For example to use an indent of 4 spaces: 22 | 23 | INDENT=4 gmock_gen.py header-file.h ClassName 24 | 25 | This version was made from SVN revision 281 in the cppclean repository. 26 | 27 | Known Limitations 28 | ----------------- 29 | Not all code will be generated properly. For example, when mocking templated 30 | classes, the template information is lost. You will need to add the template 31 | information manually. 32 | 33 | Not all permutations of using multiple pointers/references will be rendered 34 | properly. These will also have to be fixed manually. 35 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/scripts/generator/cpp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlphaDogDeveloper/dev_robot_control_sdk/533a11c1f368a237920d6bc1e3199467620587eb/third-party/yaml-cpp/test/gtest-1.11.0/googlemock/scripts/generator/cpp/__init__.py -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/scripts/generator/cpp/keywords.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2007 Neal Norwitz 4 | # Portions Copyright 2007 Google Inc. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | """C++ keywords and helper utilities for determining keywords.""" 19 | 20 | try: 21 | # Python 3.x 22 | import builtins 23 | except ImportError: 24 | # Python 2.x 25 | import __builtin__ as builtins 26 | 27 | 28 | if not hasattr(builtins, 'set'): 29 | # Nominal support for Python 2.3. 30 | from sets import Set as set 31 | 32 | 33 | TYPES = set('bool char int long short double float void wchar_t unsigned signed'.split()) 34 | TYPE_MODIFIERS = set('auto register const inline extern static virtual volatile mutable'.split()) 35 | ACCESS = set('public protected private friend'.split()) 36 | 37 | CASTS = set('static_cast const_cast dynamic_cast reinterpret_cast'.split()) 38 | 39 | OTHERS = set('true false asm class namespace using explicit this operator sizeof'.split()) 40 | OTHER_TYPES = set('new delete typedef struct union enum typeid typename template'.split()) 41 | 42 | CONTROL = set('case switch default if else return goto'.split()) 43 | EXCEPTION = set('try catch throw'.split()) 44 | LOOP = set('while do for break continue'.split()) 45 | 46 | ALL = TYPES | TYPE_MODIFIERS | ACCESS | CASTS | OTHERS | OTHER_TYPES | CONTROL | EXCEPTION | LOOP 47 | 48 | 49 | def IsKeyword(token): 50 | return token in ALL 51 | 52 | def IsBuiltinType(token): 53 | if token in ('virtual', 'inline'): 54 | # These only apply to methods, they can't be types by themselves. 55 | return False 56 | return token in TYPES or token in TYPE_MODIFIERS 57 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/scripts/generator/cpp/utils.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2007 Neal Norwitz 4 | # Portions Copyright 2007 Google Inc. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | """Generic utilities for C++ parsing.""" 19 | 20 | import sys 21 | 22 | # Set to True to see the start/end token indices. 23 | DEBUG = True 24 | 25 | 26 | def ReadFile(filename, print_error=True): 27 | """Returns the contents of a file.""" 28 | try: 29 | fp = open(filename) 30 | try: 31 | return fp.read() 32 | finally: 33 | fp.close() 34 | except IOError: 35 | if print_error: 36 | print('Error reading %s: %s' % (filename, sys.exc_info()[1])) 37 | return None 38 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/scripts/generator/gmock_gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2008 Google Inc. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | """Driver for starting up Google Mock class generator.""" 18 | 19 | 20 | import os 21 | import sys 22 | 23 | if __name__ == '__main__': 24 | # Add the directory of this script to the path so we can import gmock_class. 25 | sys.path.append(os.path.dirname(__file__)) 26 | 27 | from cpp import gmock_class 28 | # Fix the docstring in case they require the usage. 29 | gmock_class.__doc__ = gmock_class.__doc__.replace('gmock_class.py', __file__) 30 | gmock_class.main() 31 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/src/gmock-all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // Google C++ Mocking Framework (Google Mock) 32 | // 33 | // This file #includes all Google Mock implementation .cc files. The 34 | // purpose is to allow a user to build Google Mock by compiling this 35 | // file alone. 36 | 37 | // This line ensures that gmock.h can be compiled on its own, even 38 | // when it's fused. 39 | #include "gmock/gmock.h" 40 | 41 | // The following lines pull in the real gmock *.cc files. 42 | #include "src/gmock-cardinalities.cc" 43 | #include "src/gmock-internal-utils.cc" 44 | #include "src/gmock-matchers.cc" 45 | #include "src/gmock-spec-builders.cc" 46 | #include "src/gmock.cc" 47 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/test/gmock-port_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | // Google Mock - a framework for writing C++ mock classes. 32 | // 33 | // This file tests the internal cross-platform support utilities. 34 | 35 | #include "gmock/internal/gmock-port.h" 36 | #include "gtest/gtest.h" 37 | 38 | // NOTE: if this file is left without tests for some reason, put a dummy 39 | // test here to make references to symbols in the gtest library and avoid 40 | // 'undefined symbol' linker errors in gmock_main: 41 | 42 | TEST(DummyTest, Dummy) {} 43 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/test/gmock_link2_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | // Google Mock - a framework for writing C++ mock classes. 32 | // 33 | // This file is for verifying that various Google Mock constructs do not 34 | // produce linker errors when instantiated in different translation units. 35 | // Please see gmock_link_test.h for details. 36 | 37 | #define LinkTest LinkTest2 38 | 39 | #include "test/gmock_link_test.h" 40 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googlemock/test/gmock_link_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | // Google Mock - a framework for writing C++ mock classes. 32 | // 33 | // This file is for verifying that various Google Mock constructs do not 34 | // produce linker errors when instantiated in different translation units. 35 | // Please see gmock_link_test.h for details. 36 | 37 | #define LinkTest LinkTest1 38 | 39 | #include "test/gmock_link_test.h" 40 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/cmake/Config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | include(CMakeFindDependencyMacro) 3 | if (@GTEST_HAS_PTHREAD@) 4 | set(THREADS_PREFER_PTHREAD_FLAG @THREADS_PREFER_PTHREAD_FLAG@) 5 | find_dependency(Threads) 6 | endif() 7 | 8 | include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") 9 | check_required_components("@project_name@") 10 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/cmake/gtest.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gtest 5 | Description: GoogleTest (without main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@ 9 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 10 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/cmake/gtest_main.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gtest_main 5 | Description: GoogleTest (with main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gtest = @PROJECT_VERSION@ 9 | Libs: -L${libdir} -lgtest_main @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 11 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/cmake/libgtest.la.in: -------------------------------------------------------------------------------- 1 | # libgtest.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.6 3 | 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Names of this library. 8 | library_names='libgtest.so' 9 | 10 | # Is this an already installed library? 11 | installed=yes 12 | 13 | # Should we warn about portability when linking against -modules? 14 | shouldnotlink=no 15 | 16 | # Files to dlopen/dlpreopen 17 | dlopen='' 18 | dlpreopen='' 19 | 20 | # Directory that this library needs to be installed in: 21 | libdir='@CMAKE_INSTALL_FULL_LIBDIR@' 22 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/docs/README.md: -------------------------------------------------------------------------------- 1 | # Content Moved 2 | 3 | We are working on updates to the GoogleTest documentation, which has moved to 4 | the top-level [docs](../../docs) directory. 5 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/include/gtest/internal/custom/README.md: -------------------------------------------------------------------------------- 1 | # Customization Points 2 | 3 | The custom directory is an injection point for custom user configurations. 4 | 5 | ## Header `gtest.h` 6 | 7 | ### The following macros can be defined: 8 | 9 | * `GTEST_OS_STACK_TRACE_GETTER_` - The name of an implementation of 10 | `OsStackTraceGetterInterface`. 11 | * `GTEST_CUSTOM_TEMPDIR_FUNCTION_` - An override for `testing::TempDir()`. See 12 | `testing::TempDir` for semantics and signature. 13 | 14 | ## Header `gtest-port.h` 15 | 16 | The following macros can be defined: 17 | 18 | ### Flag related macros: 19 | 20 | * `GTEST_FLAG(flag_name)` 21 | * `GTEST_USE_OWN_FLAGFILE_FLAG_` - Define to 0 when the system provides its 22 | own flagfile flag parsing. 23 | * `GTEST_DECLARE_bool_(name)` 24 | * `GTEST_DECLARE_int32_(name)` 25 | * `GTEST_DECLARE_string_(name)` 26 | * `GTEST_DEFINE_bool_(name, default_val, doc)` 27 | * `GTEST_DEFINE_int32_(name, default_val, doc)` 28 | * `GTEST_DEFINE_string_(name, default_val, doc)` 29 | 30 | ### Logging: 31 | 32 | * `GTEST_LOG_(severity)` 33 | * `GTEST_CHECK_(condition)` 34 | * Functions `LogToStderr()` and `FlushInfoLog()` have to be provided too. 35 | 36 | ### Threading: 37 | 38 | * `GTEST_HAS_NOTIFICATION_` - Enabled if Notification is already provided. 39 | * `GTEST_HAS_MUTEX_AND_THREAD_LOCAL_` - Enabled if `Mutex` and `ThreadLocal` 40 | are already provided. Must also provide `GTEST_DECLARE_STATIC_MUTEX_(mutex)` 41 | and `GTEST_DEFINE_STATIC_MUTEX_(mutex)` 42 | * `GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)` 43 | * `GTEST_LOCK_EXCLUDED_(locks)` 44 | 45 | ### Underlying library support features 46 | 47 | * `GTEST_HAS_CXXABI_H_` 48 | 49 | ### Exporting API symbols: 50 | 51 | * `GTEST_API_` - Specifier for exported symbols. 52 | 53 | ## Header `gtest-printers.h` 54 | 55 | * See documentation at `gtest/gtest-printers.h` for details on how to define a 56 | custom printer. 57 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/include/gtest/internal/custom/gtest-port.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Injection point for custom user configurations. See README for details 31 | // 32 | // ** Custom implementation starts here ** 33 | 34 | #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ 35 | #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ 36 | 37 | #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ 38 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/include/gtest/internal/custom/gtest-printers.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // This file provides an injection point for custom printers in a local 31 | // installation of gTest. 32 | // It will be included from gtest-printers.h and the overrides in this file 33 | // will be visible to everyone. 34 | // 35 | // Injection point for custom user configurations. See README for details 36 | // 37 | // ** Custom implementation starts here ** 38 | 39 | #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ 40 | #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ 41 | 42 | #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_ 43 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/include/gtest/internal/custom/gtest.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Injection point for custom user configurations. See README for details 31 | // 32 | // ** Custom implementation starts here ** 33 | 34 | #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 35 | #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 36 | 37 | #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 38 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/samples/sample1.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | 32 | #ifndef GOOGLETEST_SAMPLES_SAMPLE1_H_ 33 | #define GOOGLETEST_SAMPLES_SAMPLE1_H_ 34 | 35 | // Returns n! (the factorial of n). For negative n, n! is defined to be 1. 36 | int Factorial(int n); 37 | 38 | // Returns true if and only if n is a prime number. 39 | bool IsPrime(int n); 40 | 41 | #endif // GOOGLETEST_SAMPLES_SAMPLE1_H_ 42 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/samples/sample4.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | 32 | #include 33 | 34 | #include "sample4.h" 35 | 36 | // Returns the current counter value, and increments it. 37 | int Counter::Increment() { 38 | return counter_++; 39 | } 40 | 41 | // Returns the current counter value, and decrements it. 42 | // counter can not be less than 0, return 0 in this case 43 | int Counter::Decrement() { 44 | if (counter_ == 0) { 45 | return counter_; 46 | } else { 47 | return counter_--; 48 | } 49 | } 50 | 51 | // Prints the current counter value to STDOUT. 52 | void Counter::Print() const { 53 | printf("%d", counter_); 54 | } 55 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/samples/sample4.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | #ifndef GOOGLETEST_SAMPLES_SAMPLE4_H_ 32 | #define GOOGLETEST_SAMPLES_SAMPLE4_H_ 33 | 34 | // A simple monotonic counter. 35 | class Counter { 36 | private: 37 | int counter_; 38 | 39 | public: 40 | // Creates a counter that starts at 0. 41 | Counter() : counter_(0) {} 42 | 43 | // Returns the current counter value, and increments it. 44 | int Increment(); 45 | 46 | // Returns the current counter value, and decrements it. 47 | int Decrement(); 48 | 49 | // Prints the current counter value to STDOUT. 50 | void Print() const; 51 | }; 52 | 53 | #endif // GOOGLETEST_SAMPLES_SAMPLE4_H_ 54 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/samples/sample4_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | #include "sample4.h" 32 | #include "gtest/gtest.h" 33 | 34 | namespace { 35 | // Tests the Increment() method. 36 | 37 | TEST(Counter, Increment) { 38 | Counter c; 39 | 40 | // Test that counter 0 returns 0 41 | EXPECT_EQ(0, c.Decrement()); 42 | 43 | // EXPECT_EQ() evaluates its arguments exactly once, so they 44 | // can have side effects. 45 | 46 | EXPECT_EQ(0, c.Increment()); 47 | EXPECT_EQ(1, c.Increment()); 48 | EXPECT_EQ(2, c.Increment()); 49 | 50 | EXPECT_EQ(3, c.Decrement()); 51 | } 52 | 53 | } // namespace 54 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/scripts/README.md: -------------------------------------------------------------------------------- 1 | # Please Note: 2 | 3 | Files in this directory are no longer supported by the maintainers. They 4 | represent mosty historical artifacts and supported by the community only. There 5 | is no guarantee whatsoever that these scripts still work. 6 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/scripts/run_with_path.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2010 Google Inc. All Rights Reserved. 4 | 5 | """Runs program specified in the command line with the substituted PATH. 6 | 7 | This script is needed for to support building under Pulse which is unable 8 | to override the existing PATH variable. 9 | """ 10 | 11 | import os 12 | import subprocess 13 | import sys 14 | 15 | SUBST_PATH_ENV_VAR_NAME = "SUBST_PATH" 16 | 17 | def main(): 18 | if SUBST_PATH_ENV_VAR_NAME in os.environ: 19 | os.environ["PATH"] = os.environ[SUBST_PATH_ENV_VAR_NAME] 20 | 21 | exit_code = subprocess.Popen(sys.argv[1:]).wait() 22 | 23 | # exit_code is negative (-signal) if the process has been terminated by 24 | # a signal. Returning negative exit code is not portable and so we return 25 | # 100 instead. 26 | if exit_code < 0: 27 | exit_code = 100 28 | 29 | sys.exit(exit_code) 30 | 31 | if __name__ == "__main__": 32 | main() 33 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/src/gtest-all.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // Google C++ Testing and Mocking Framework (Google Test) 32 | // 33 | // Sometimes it's desirable to build Google Test by compiling a single file. 34 | // This file serves this purpose. 35 | 36 | // This line ensures that gtest.h can be compiled on its own, even 37 | // when it's fused. 38 | #include "gtest/gtest.h" 39 | 40 | // The following lines pull in the real gtest *.cc files. 41 | #include "src/gtest.cc" 42 | #include "src/gtest-death-test.cc" 43 | #include "src/gtest-filepath.cc" 44 | #include "src/gtest-matchers.cc" 45 | #include "src/gtest-port.cc" 46 | #include "src/gtest-printers.cc" 47 | #include "src/gtest-test-part.cc" 48 | #include "src/gtest-typed-test.cc" 49 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/src/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | #include "gtest/gtest.h" 32 | 33 | #if GTEST_OS_ESP8266 || GTEST_OS_ESP32 34 | #if GTEST_OS_ESP8266 35 | extern "C" { 36 | #endif 37 | void setup() { 38 | testing::InitGoogleTest(); 39 | } 40 | 41 | void loop() { RUN_ALL_TESTS(); } 42 | 43 | #if GTEST_OS_ESP8266 44 | } 45 | #endif 46 | 47 | #else 48 | 49 | GTEST_API_ int main(int argc, char **argv) { 50 | printf("Running main() from %s\n", __FILE__); 51 | testing::InitGoogleTest(&argc, argv); 52 | return RUN_ALL_TESTS(); 53 | } 54 | #endif 55 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name1-test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | #include "gtest/gtest.h" 32 | 33 | namespace { 34 | class DummyTest : public ::testing::TestWithParam {}; 35 | 36 | TEST_P(DummyTest, Dummy) { 37 | } 38 | 39 | INSTANTIATE_TEST_SUITE_P(InvalidTestName, 40 | DummyTest, 41 | ::testing::Values("InvalidWithQuotes"), 42 | ::testing::PrintToStringParamName()); 43 | 44 | } // namespace 45 | 46 | int main(int argc, char *argv[]) { 47 | testing::InitGoogleTest(&argc, argv); 48 | return RUN_ALL_TESTS(); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/googletest-param-test-invalid-name2-test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | #include "gtest/gtest.h" 32 | 33 | namespace { 34 | class DummyTest : public ::testing::TestWithParam {}; 35 | 36 | std::string StringParamTestSuffix( 37 | const testing::TestParamInfo& info) { 38 | return std::string(info.param); 39 | } 40 | 41 | TEST_P(DummyTest, Dummy) { 42 | } 43 | 44 | INSTANTIATE_TEST_SUITE_P(DuplicateTestNames, 45 | DummyTest, 46 | ::testing::Values("a", "b", "a", "c"), 47 | StringParamTestSuffix); 48 | } // namespace 49 | 50 | int main(int argc, char *argv[]) { 51 | testing::InitGoogleTest(&argc, argv); 52 | return RUN_ALL_TESTS(); 53 | } 54 | 55 | 56 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/googletest-setuptestsuite-test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | #include "gtest/gtest.h" 32 | 33 | class SetupFailTest : public ::testing::Test { 34 | protected: 35 | static void SetUpTestSuite() { 36 | ASSERT_EQ("", "SET_UP_FAIL"); 37 | } 38 | }; 39 | 40 | TEST_F(SetupFailTest, NoopPassingTest) {} 41 | 42 | class TearDownFailTest : public ::testing::Test { 43 | protected: 44 | static void TearDownTestSuite() { 45 | ASSERT_EQ("", "TEAR_DOWN_FAIL"); 46 | } 47 | }; 48 | 49 | TEST_F(TearDownFailTest, NoopPassingTest) {} 50 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/googletest-uninitialized-test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | #include "gtest/gtest.h" 32 | 33 | TEST(DummyTest, Dummy) { 34 | // This test doesn't verify anything. We just need it to create a 35 | // realistic stage for testing the behavior of Google Test when 36 | // RUN_ALL_TESTS() is called without 37 | // testing::InitGoogleTest() being called first. 38 | } 39 | 40 | int main() { 41 | return RUN_ALL_TESTS(); 42 | } 43 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/gtest-typed-test2_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Google Inc. 2 | // All Rights Reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | #include 32 | 33 | #include "test/gtest-typed-test_test.h" 34 | #include "gtest/gtest.h" 35 | 36 | // Tests that the same type-parameterized test case can be 37 | // instantiated in different translation units linked together. 38 | // (ContainerTest is also instantiated in gtest-typed-test_test.cc.) 39 | INSTANTIATE_TYPED_TEST_SUITE_P(Vector, ContainerTest, 40 | testing::Types >); 41 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/gtest_all_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // Tests for Google C++ Testing and Mocking Framework (Google Test) 32 | // 33 | // Sometimes it's desirable to build most of Google Test's own tests 34 | // by compiling a single file. This file serves this purpose. 35 | #include "test/googletest-filepath-test.cc" 36 | #include "test/googletest-message-test.cc" 37 | #include "test/googletest-options-test.cc" 38 | #include "test/googletest-port-test.cc" 39 | #include "test/googletest-test-part-test.cc" 40 | #include "test/gtest-typed-test2_test.cc" 41 | #include "test/gtest-typed-test_test.cc" 42 | #include "test/gtest_pred_impl_unittest.cc" 43 | #include "test/gtest_prod_test.cc" 44 | #include "test/gtest_skip_test.cc" 45 | #include "test/gtest_unittest.cc" 46 | #include "test/production.cc" 47 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/gtest_help_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2009, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | // This program is meant to be run by gtest_help_test.py. Do not run 32 | // it directly. 33 | 34 | #include "gtest/gtest.h" 35 | 36 | // When a help flag is specified, this program should skip the tests 37 | // and exit with 0; otherwise the following test will be executed, 38 | // causing this program to exit with a non-zero code. 39 | TEST(HelpFlagTest, ShouldNotBeRun) { 40 | ASSERT_TRUE(false) << "Tests shouldn't be run when --help is specified."; 41 | } 42 | 43 | #if GTEST_HAS_DEATH_TEST 44 | TEST(DeathTest, UsedByPythonScriptToDetectSupportForDeathTestsInThisBinary) {} 45 | #endif 46 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/gtest_main_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | #include "gtest/gtest.h" 32 | 33 | // Tests that we don't have to define main() when we link to 34 | // gtest_main instead of gtest. 35 | 36 | namespace { 37 | 38 | TEST(GTestMainTest, ShouldSucceed) { 39 | } 40 | 41 | } // namespace 42 | 43 | // We are using the main() function defined in gtest_main.cc, so we 44 | // don't define it here. 45 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/gtest_prod_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // Unit test for gtest_prod.h. 32 | 33 | #include "production.h" 34 | #include "gtest/gtest.h" 35 | 36 | // Tests that private members can be accessed from a TEST declared as 37 | // a friend of the class. 38 | TEST(PrivateCodeTest, CanAccessPrivateMembers) { 39 | PrivateCode a; 40 | EXPECT_EQ(0, a.x_); 41 | 42 | a.set_x(1); 43 | EXPECT_EQ(1, a.x_); 44 | } 45 | 46 | typedef testing::Test PrivateCodeFixtureTest; 47 | 48 | // Tests that private members can be accessed from a TEST_F declared 49 | // as a friend of the class. 50 | TEST_F(PrivateCodeFixtureTest, CanAccessPrivateMembers) { 51 | PrivateCode a; 52 | EXPECT_EQ(0, a.x_); 53 | 54 | a.set_x(2); 55 | EXPECT_EQ(2, a.x_); 56 | } 57 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/gtest_skip_environment_check_output_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2019 Google LLC. All Rights Reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are 7 | # met: 8 | # 9 | # * Redistributions of source code must retain the above copyright 10 | # notice, this list of conditions and the following disclaimer. 11 | # * Redistributions in binary form must reproduce the above 12 | # copyright notice, this list of conditions and the following disclaimer 13 | # in the documentation and/or other materials provided with the 14 | # distribution. 15 | # * Neither the name of Google Inc. nor the names of its 16 | # contributors may be used to endorse or promote products derived from 17 | # this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | """Tests Google Test's gtest skip in environment setup behavior. 31 | 32 | This script invokes gtest_skip_in_environment_setup_test_ and verifies its 33 | output. 34 | """ 35 | 36 | import gtest_test_utils 37 | 38 | # Path to the gtest_skip_in_environment_setup_test binary 39 | EXE_PATH = gtest_test_utils.GetTestExecutablePath( 40 | 'gtest_skip_in_environment_setup_test') 41 | 42 | OUTPUT = gtest_test_utils.Subprocess([EXE_PATH]).output 43 | 44 | 45 | # Test. 46 | class SkipEntireEnvironmentTest(gtest_test_utils.TestCase): 47 | 48 | def testSkipEntireEnvironmentTest(self): 49 | self.assertIn('Skipping the entire environment', OUTPUT) 50 | self.assertNotIn('FAILED', OUTPUT) 51 | 52 | 53 | if __name__ == '__main__': 54 | gtest_test_utils.Main() 55 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/gtest_skip_in_environment_setup_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2019, Google LLC. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google LLC. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // This test verifies that skipping in the environment results in the 31 | // testcases being skipped. 32 | 33 | #include 34 | #include "gtest/gtest.h" 35 | 36 | class SetupEnvironment : public testing::Environment { 37 | public: 38 | void SetUp() override { GTEST_SKIP() << "Skipping the entire environment"; } 39 | }; 40 | 41 | TEST(Test, AlwaysFails) { EXPECT_EQ(true, false); } 42 | 43 | int main(int argc, char **argv) { 44 | testing::InitGoogleTest(&argc, argv); 45 | 46 | testing::AddGlobalTestEnvironment(new SetupEnvironment()); 47 | 48 | return RUN_ALL_TESTS(); 49 | } 50 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/gtest_skip_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Google Inc. 2 | // All Rights Reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: arseny.aprelev@gmail.com (Arseny Aprelev) 31 | // 32 | 33 | #include "gtest/gtest.h" 34 | 35 | using ::testing::Test; 36 | 37 | TEST(SkipTest, DoesSkip) { 38 | GTEST_SKIP() << "skipping single test"; 39 | EXPECT_EQ(0, 1); 40 | } 41 | 42 | class Fixture : public Test { 43 | protected: 44 | void SetUp() override { 45 | GTEST_SKIP() << "skipping all tests for this fixture"; 46 | } 47 | }; 48 | 49 | TEST_F(Fixture, SkipsOneTest) { 50 | EXPECT_EQ(5, 7); 51 | } 52 | 53 | TEST_F(Fixture, SkipsAnotherTest) { 54 | EXPECT_EQ(99, 100); 55 | } 56 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/gtest_sole_header_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // This test verifies that it's possible to use Google Test by including 32 | // the gtest.h header file alone. 33 | 34 | #include "gtest/gtest.h" 35 | 36 | namespace { 37 | 38 | void Subroutine() { 39 | EXPECT_EQ(42, 42); 40 | } 41 | 42 | TEST(NoFatalFailureTest, ExpectNoFatalFailure) { 43 | EXPECT_NO_FATAL_FAILURE(;); 44 | EXPECT_NO_FATAL_FAILURE(SUCCEED()); 45 | EXPECT_NO_FATAL_FAILURE(Subroutine()); 46 | EXPECT_NO_FATAL_FAILURE({ SUCCEED(); }); 47 | } 48 | 49 | TEST(NoFatalFailureTest, AssertNoFatalFailure) { 50 | ASSERT_NO_FATAL_FAILURE(;); 51 | ASSERT_NO_FATAL_FAILURE(SUCCEED()); 52 | ASSERT_NO_FATAL_FAILURE(Subroutine()); 53 | ASSERT_NO_FATAL_FAILURE({ SUCCEED(); }); 54 | } 55 | 56 | } // namespace 57 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/gtest_testbridge_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018, Google LLC. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | 31 | // This program is meant to be run by gtest_test_filter_test.py. Do not run 32 | // it directly. 33 | 34 | #include "gtest/gtest.h" 35 | 36 | // These tests are used to detect if filtering is working. Only 37 | // 'TestThatSucceeds' should ever run. 38 | 39 | TEST(TestFilterTest, TestThatSucceeds) {} 40 | 41 | TEST(TestFilterTest, TestThatFails) { 42 | ASSERT_TRUE(false) << "This test should never be run."; 43 | } 44 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/gtest_xml_outfile1_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // gtest_xml_outfile1_test_ writes some xml via TestProperty used by 31 | // gtest_xml_outfiles_test.py 32 | 33 | #include "gtest/gtest.h" 34 | 35 | class PropertyOne : public testing::Test { 36 | protected: 37 | void SetUp() override { RecordProperty("SetUpProp", 1); } 38 | void TearDown() override { RecordProperty("TearDownProp", 1); } 39 | }; 40 | 41 | TEST_F(PropertyOne, TestSomeProperties) { 42 | RecordProperty("TestSomeProperty", 1); 43 | } 44 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/gtest_xml_outfile2_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // gtest_xml_outfile2_test_ writes some xml via TestProperty used by 31 | // gtest_xml_outfiles_test.py 32 | 33 | #include "gtest/gtest.h" 34 | 35 | class PropertyTwo : public testing::Test { 36 | protected: 37 | void SetUp() override { RecordProperty("SetUpProp", 2); } 38 | void TearDown() override { RecordProperty("TearDownProp", 2); } 39 | }; 40 | 41 | TEST_F(PropertyTwo, TestSomeProperties) { 42 | RecordProperty("TestSomeProperty", 2); 43 | } 44 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/production.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // This is part of the unit test for gtest_prod.h. 32 | 33 | #include "production.h" 34 | 35 | PrivateCode::PrivateCode() : x_(0) {} 36 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/googletest/test/production.h: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // This is part of the unit test for gtest_prod.h. 32 | 33 | #ifndef GOOGLETEST_TEST_PRODUCTION_H_ 34 | #define GOOGLETEST_TEST_PRODUCTION_H_ 35 | 36 | #include "gtest/gtest_prod.h" 37 | 38 | class PrivateCode { 39 | public: 40 | // Declares a friend test that does not use a fixture. 41 | FRIEND_TEST(PrivateCodeTest, CanAccessPrivateMembers); 42 | 43 | // Declares a friend test that uses a fixture. 44 | FRIEND_TEST(PrivateCodeFixtureTest, CanAccessPrivateMembers); 45 | 46 | PrivateCode(); 47 | 48 | int x() const { return x_; } 49 | private: 50 | void set_x(int an_x) { x_ = an_x; } 51 | int x_; 52 | }; 53 | 54 | #endif // GOOGLETEST_TEST_PRODUCTION_H_ 55 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/gtest-1.11.0/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "googletest", 3 | "keywords": "unittest, unit, test, gtest, gmock", 4 | "description": "googletest is a testing framework developed by the Testing Technology team with Google's specific requirements and constraints in mind. No matter whether you work on Linux, Windows, or a Mac, if you write C++ code, googletest can help you. And it supports any kind of tests, not just unit tests.", 5 | "license": "BSD-3-Clause", 6 | "homepage": "https://github.com/google/googletest/blob/master/README.md", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/google/googletest.git" 10 | }, 11 | "version": "1.10.0", 12 | "frameworks": "arduino", 13 | "platforms": [ 14 | "espressif32", 15 | "espressif8266" 16 | ], 17 | "export": { 18 | "include": [ 19 | "googlemock/include/*", 20 | "googlemock/src/*", 21 | "googletest/include/*", 22 | "googletest/src/*" 23 | ], 24 | "exclude": [ 25 | "ci", 26 | "googlemock/cmake", 27 | "googlemock/scripts", 28 | "googlemock/test", 29 | "googlemock/CMakeLists.txt", 30 | "googletest/cmake", 31 | "googletest/scripts", 32 | "googletest/test", 33 | "googletest/CMakeLists.txt" 34 | ] 35 | }, 36 | "build": { 37 | "flags": [ 38 | "-Igooglemock/include", 39 | "-Igooglemock", 40 | "-Igoogletest/include", 41 | "-Igoogletest" 42 | ], 43 | "srcFilter": [ 44 | "+<*>", 45 | "-<.git/>", 46 | "-", 47 | "-", 48 | "-", 49 | "+", 50 | "+", 51 | "+", 52 | "-", 53 | "-", 54 | "-", 55 | "-", 56 | "-", 57 | "-", 58 | "+", 59 | "+" 60 | ] 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/handler_test.h: -------------------------------------------------------------------------------- 1 | #include "mock_event_handler.h" 2 | #include "yaml-cpp/yaml.h" // IWYU pragma: keep 3 | 4 | #include "gmock/gmock.h" 5 | #include "gtest/gtest.h" 6 | 7 | using ::testing::InSequence; 8 | using ::testing::NiceMock; 9 | using ::testing::StrictMock; 10 | 11 | namespace YAML { 12 | class HandlerTest : public ::testing::Test { 13 | protected: 14 | void Parse(const std::string& example) { 15 | std::stringstream stream(example); 16 | Parser parser(stream); 17 | while (parser.HandleNextDocument(handler)) { 18 | } 19 | } 20 | 21 | void IgnoreParse(const std::string& example) { 22 | std::stringstream stream(example); 23 | Parser parser(stream); 24 | while (parser.HandleNextDocument(nice_handler)) { 25 | } 26 | } 27 | 28 | InSequence sequence; 29 | StrictMock handler; 30 | NiceMock nice_handler; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/main.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | int main(int argc, char** argv) { 4 | ::testing::InitGoogleTest(&argc, argv); 5 | return RUN_ALL_TESTS(); 6 | } 7 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/mock_event_handler.h: -------------------------------------------------------------------------------- 1 | #include "yaml-cpp/emitterstyle.h" 2 | #include "yaml-cpp/eventhandler.h" 3 | #include "yaml-cpp/mark.h" 4 | 5 | #include "gmock/gmock.h" 6 | 7 | #include 8 | 9 | namespace YAML { 10 | 11 | class MockEventHandler : public EventHandler { 12 | public: 13 | MOCK_METHOD1(OnDocumentStart, void(const Mark&)); 14 | MOCK_METHOD0(OnDocumentEnd, void()); 15 | 16 | MOCK_METHOD2(OnNull, void(const Mark&, anchor_t)); 17 | MOCK_METHOD2(OnAlias, void(const Mark&, anchor_t)); 18 | MOCK_METHOD4(OnScalar, void(const Mark&, const std::string&, anchor_t, 19 | const std::string&)); 20 | 21 | MOCK_METHOD4(OnSequenceStart, void(const Mark&, const std::string&, anchor_t, 22 | EmitterStyle::value)); 23 | MOCK_METHOD0(OnSequenceEnd, void()); 24 | 25 | MOCK_METHOD4(OnMapStart, void(const Mark&, const std::string&, anchor_t, 26 | EmitterStyle::value)); 27 | MOCK_METHOD0(OnMapEnd, void()); 28 | MOCK_METHOD2(OnAnchor, void(const Mark&, const std::string&)); 29 | }; 30 | } // namespace YAML 31 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/ostream_wrapper_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "gtest/gtest.h" 5 | #include "yaml-cpp/ostream_wrapper.h" 6 | 7 | namespace { 8 | TEST(OstreamWrapperTest, BufferNoWrite) { 9 | YAML::ostream_wrapper wrapper; 10 | EXPECT_STREQ("", wrapper.str()); 11 | } 12 | 13 | TEST(OstreamWrapperTest, BufferWriteStr) { 14 | YAML::ostream_wrapper wrapper; 15 | wrapper.write(std::string("Hello, world")); 16 | EXPECT_STREQ("Hello, world", wrapper.str()); 17 | } 18 | 19 | TEST(OstreamWrapperTest, BufferWriteCStr) { 20 | YAML::ostream_wrapper wrapper; 21 | wrapper.write("Hello, world"); 22 | EXPECT_STREQ("Hello, world", wrapper.str()); 23 | } 24 | 25 | TEST(OstreamWrapperTest, StreamNoWrite) { 26 | std::stringstream stream; 27 | YAML::ostream_wrapper wrapper(stream); 28 | EXPECT_STREQ(NULL, wrapper.str()); 29 | EXPECT_EQ("", stream.str()); 30 | } 31 | 32 | TEST(OstreamWrapperTest, StreamWriteStr) { 33 | std::stringstream stream; 34 | YAML::ostream_wrapper wrapper(stream); 35 | wrapper.write(std::string("Hello, world")); 36 | EXPECT_STREQ(NULL, wrapper.str()); 37 | EXPECT_EQ("Hello, world", stream.str()); 38 | } 39 | 40 | TEST(OstreamWrapperTest, StreamWriteCStr) { 41 | std::stringstream stream; 42 | YAML::ostream_wrapper wrapper(stream); 43 | wrapper.write("Hello, world"); 44 | EXPECT_STREQ(NULL, wrapper.str()); 45 | EXPECT_EQ("Hello, world", stream.str()); 46 | } 47 | 48 | TEST(OstreamWrapperTest, Position) { 49 | YAML::ostream_wrapper wrapper; 50 | wrapper.write("Hello, world\n"); 51 | EXPECT_EQ(1, wrapper.row()); 52 | EXPECT_EQ(0, wrapper.col()); 53 | EXPECT_EQ(13, wrapper.pos()); 54 | } 55 | 56 | TEST(OstreamWrapperTest, Comment) { 57 | YAML::ostream_wrapper wrapper; 58 | wrapper.write("Hello, world "); 59 | wrapper.set_comment(); 60 | EXPECT_TRUE(wrapper.comment()); 61 | wrapper.write("foo"); 62 | EXPECT_TRUE(wrapper.comment()); 63 | wrapper.write("\n"); 64 | EXPECT_FALSE(wrapper.comment()); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/test/parser_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "yaml-cpp/parser.h" 3 | #include "yaml-cpp/exceptions.h" 4 | #include "mock_event_handler.h" 5 | #include "gtest/gtest.h" 6 | 7 | using YAML::Parser; 8 | using YAML::MockEventHandler; 9 | using ::testing::NiceMock; 10 | using ::testing::StrictMock; 11 | 12 | TEST(ParserTest, Empty) { 13 | Parser parser; 14 | 15 | EXPECT_FALSE(parser); 16 | 17 | StrictMock handler; 18 | EXPECT_FALSE(parser.HandleNextDocument(handler)); 19 | } 20 | 21 | TEST(ParserTest, CVE_2017_5950) { 22 | std::string excessive_recursion; 23 | for (auto i = 0; i != 16384; ++i) 24 | excessive_recursion.push_back('['); 25 | std::istringstream input{excessive_recursion}; 26 | Parser parser{input}; 27 | 28 | NiceMock handler; 29 | EXPECT_THROW(parser.HandleNextDocument(handler), YAML::DeepRecursion); 30 | } 31 | 32 | TEST(ParserTest, CVE_2018_20573) { 33 | std::string excessive_recursion; 34 | for (auto i = 0; i != 20535; ++i) 35 | excessive_recursion.push_back('{'); 36 | std::istringstream input{excessive_recursion}; 37 | Parser parser{input}; 38 | 39 | NiceMock handler; 40 | EXPECT_THROW(parser.HandleNextDocument(handler), YAML::DeepRecursion); 41 | } 42 | 43 | TEST(ParserTest, CVE_2018_20574) { 44 | std::string excessive_recursion; 45 | for (auto i = 0; i != 21989; ++i) 46 | excessive_recursion.push_back('{'); 47 | std::istringstream input{excessive_recursion}; 48 | Parser parser{input}; 49 | 50 | NiceMock handler; 51 | EXPECT_THROW(parser.HandleNextDocument(handler), YAML::DeepRecursion); 52 | } 53 | 54 | TEST(ParserTest, CVE_2019_6285) { 55 | std::string excessive_recursion; 56 | for (auto i = 0; i != 23100; ++i) 57 | excessive_recursion.push_back('['); 58 | excessive_recursion.push_back('f'); 59 | std::istringstream input{excessive_recursion}; 60 | Parser parser{input}; 61 | 62 | NiceMock handler; 63 | EXPECT_THROW(parser.HandleNextDocument(handler), YAML::DeepRecursion); 64 | } 65 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/util/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(yaml-cpp-sandbox sandbox.cpp) 2 | add_executable(yaml-cpp-parse parse.cpp) 3 | add_executable(yaml-cpp-read read.cpp) 4 | 5 | target_link_libraries(yaml-cpp-sandbox PRIVATE yaml-cpp) 6 | target_link_libraries(yaml-cpp-parse PRIVATE yaml-cpp) 7 | target_link_libraries(yaml-cpp-read PRIVATE yaml-cpp) 8 | 9 | set_property(TARGET yaml-cpp-sandbox PROPERTY OUTPUT_NAME sandbox) 10 | set_property(TARGET yaml-cpp-parse PROPERTY OUTPUT_NAME parse) 11 | set_property(TARGET yaml-cpp-read PROPERTY OUTPUT_NAME read) 12 | 13 | set_target_properties(yaml-cpp-sandbox 14 | PROPERTIES 15 | CXX_STANDARD_REQUIRED ON 16 | OUTPUT_NAME sandbox) 17 | 18 | set_target_properties(yaml-cpp-parse 19 | PROPERTIES 20 | CXX_STANDARD_REQUIRED ON 21 | OUTPUT_NAME parse) 22 | 23 | set_target_properties(yaml-cpp-read 24 | PROPERTIES 25 | CXX_STANDARD_REQUIRED ON 26 | OUTPUT_NAME read) 27 | 28 | if (NOT DEFINED CMAKE_CXX_STANDARD) 29 | set_target_properties(yaml-cpp-sandbox yaml-cpp-parse yaml-cpp-read 30 | PROPERTIES 31 | CXX_STANDARD 11) 32 | endif() 33 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/util/parse.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "yaml-cpp/eventhandler.h" 6 | #include "yaml-cpp/yaml.h" // IWYU pragma: keep 7 | 8 | class NullEventHandler : public YAML::EventHandler { 9 | public: 10 | void OnDocumentStart(const YAML::Mark&) override {} 11 | void OnDocumentEnd() override {} 12 | 13 | void OnNull(const YAML::Mark&, YAML::anchor_t) override {} 14 | void OnAlias(const YAML::Mark&, YAML::anchor_t) override {} 15 | void OnScalar(const YAML::Mark&, const std::string&, YAML::anchor_t, 16 | const std::string&) override {} 17 | 18 | void OnSequenceStart(const YAML::Mark&, const std::string&, YAML::anchor_t, 19 | YAML::EmitterStyle::value) override {} 20 | void OnSequenceEnd() override {} 21 | 22 | void OnMapStart(const YAML::Mark&, const std::string&, YAML::anchor_t, 23 | YAML::EmitterStyle::value) override {} 24 | void OnMapEnd() override {} 25 | }; 26 | 27 | void parse(std::istream& input) { 28 | try { 29 | YAML::Node doc = YAML::Load(input); 30 | std::cout << doc << "\n"; 31 | } catch (const YAML::Exception& e) { 32 | std::cerr << e.what() << "\n"; 33 | } 34 | } 35 | 36 | int main(int argc, char** argv) { 37 | if (argc > 1) { 38 | std::ifstream fin; 39 | fin.open(argv[1]); 40 | parse(fin); 41 | } else { 42 | parse(std::cin); 43 | } 44 | 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/util/sandbox.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "yaml-cpp/emitterstyle.h" 4 | #include "yaml-cpp/eventhandler.h" 5 | #include "yaml-cpp/yaml.h" // IWYU pragma: keep 6 | 7 | class NullEventHandler : public YAML::EventHandler { 8 | public: 9 | using Mark = YAML::Mark; 10 | using anchor_t = YAML::anchor_t; 11 | 12 | NullEventHandler() = default; 13 | 14 | void OnDocumentStart(const Mark&) override {} 15 | void OnDocumentEnd() override {} 16 | void OnNull(const Mark&, anchor_t) override {} 17 | void OnAlias(const Mark&, anchor_t) override {} 18 | void OnScalar(const Mark&, const std::string&, anchor_t, 19 | const std::string&) override {} 20 | void OnSequenceStart(const Mark&, const std::string&, anchor_t, 21 | YAML::EmitterStyle::value style) override {} 22 | void OnSequenceEnd() override {} 23 | void OnMapStart(const Mark&, const std::string&, anchor_t, 24 | YAML::EmitterStyle::value style) override {} 25 | void OnMapEnd() override {} 26 | }; 27 | 28 | int main() { 29 | YAML::Node root; 30 | 31 | for (;;) { 32 | YAML::Node node; 33 | root = node; 34 | } 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/yaml-cpp-config.cmake.in: -------------------------------------------------------------------------------- 1 | # - Config file for the yaml-cpp package 2 | # It defines the following variables 3 | # YAML_CPP_INCLUDE_DIR - include directory 4 | # YAML_CPP_LIBRARY_DIR - directory containing libraries 5 | # YAML_CPP_SHARED_LIBS_BUILT - whether we have built shared libraries or not 6 | # YAML_CPP_LIBRARIES - libraries to link against 7 | 8 | @PACKAGE_INIT@ 9 | 10 | set_and_check(YAML_CPP_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") 11 | set_and_check(YAML_CPP_LIBRARY_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@") 12 | 13 | # Are we building shared libraries? 14 | set(YAML_CPP_SHARED_LIBS_BUILT "@PACKAGE_YAML_BUILD_SHARED_LIBS@") 15 | 16 | # Our library dependencies (contains definitions for IMPORTED targets) 17 | include(@PACKAGE_CONFIG_EXPORT_DIR@/yaml-cpp-targets.cmake) 18 | 19 | # These are IMPORTED targets created by yaml-cpp-targets.cmake 20 | set(YAML_CPP_LIBRARIES "@EXPORT_TARGETS@") 21 | 22 | check_required_components(@EXPORT_TARGETS@) 23 | -------------------------------------------------------------------------------- /third-party/yaml-cpp/yaml-cpp.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 4 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 5 | 6 | Name: Yaml-cpp 7 | Description: A YAML parser and emitter for C++ 8 | Version: @YAML_CPP_VERSION@ 9 | Requires: 10 | Libs: -L${libdir} -lyaml-cpp 11 | Cflags: -I${includedir} 12 | --------------------------------------------------------------------------------