[
  {
    "path": ".github/workflows/linux-clang.yml",
    "content": "name: Ubuntu (clang)\n\non:\n  push:\n    branches: [ master, develop ]\n  pull_request:\n    branches: [ master, develop ]\n    \njobs:\n  build:\n    strategy:\n      matrix:\n        mode: [ Debug, Release ]\n        cpp_version: [11, 20]\n    runs-on: ubuntu-22.04\n    \n    steps:\n    - name: check out\n      uses: actions/checkout@v3\n\n    - name: Install Dependencies\n      run: |\n        sudo apt-get update \n        sudo apt-get install curl libssl-dev libcurl4-openssl-dev\n              \n    - name: configure cmake\n      run: CXX=clang++ CC=clang cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.mode }} -DCMAKE_CXX_STANDARD=${{ matrix.cpp_version }}\n      \n    - name: build project\n      run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.mode }}\n\n  \n"
  },
  {
    "path": ".github/workflows/linux-gcc.yml",
    "content": "name: Ubuntu (gcc)\n\non:\n  push:\n    branches: [ master, develop ]\n  pull_request:\n    branches: [ master, develop ]\n    \njobs:\n  ubuntu_gcc:\n    strategy:\n      matrix:\n        mode: [ Debug, Release ]\n        cpp_version: [11, 20]\n    runs-on: ubuntu-22.04\n    \n    steps:\n    - name: check out\n      uses: actions/checkout@v3\n\n    - name: Install Dependencies\n      run: |\n        sudo apt-get update\n        sudo apt-get install curl libssl-dev libcurl4-openssl-dev\n\n    - name: checkout gcc version\n      run: gcc --version\n\n    - name: configure cmake\n      run: CXX=g++ CC=gcc cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.mode }} -DCMAKE_CXX_STANDARD=${{ matrix.cpp_version }}\n      \n    - name: build project\n      run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.mode }}\n"
  },
  {
    "path": ".github/workflows/mac.yml",
    "content": "name:  macOS Monterey 12\n\non:\n  push:\n    branches: [ master, develop ]\n  pull_request:\n    branches: [ master, develop ]\n    \njobs:\n  build:\n    strategy:\n      matrix:\n        mode: [ Debug ]  #mode: [Release, Debug]\n        cpp_version: [11, 20]\n        \n    runs-on: macos-latest\n    \n    steps:\n    - name: check out\n      uses: actions/checkout@v4\n\n    - name: Install Dependencies\n      run: HOMEBREW_NO_INSTALL_CLEANUP=1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 brew install openssl\n      \n    - name: configure cmake\n      run:  OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 CXX=clang++ CC=clang cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ matrix.mode }} -DCMAKE_CXX_STANDARD=${{ matrix.cpp_version }}\n      \n    - name: build project\n      run: cmake --build ${{ github.workspace }}/build --config ${{ matrix.mode }}\n\n"
  },
  {
    "path": ".github/workflows/windows.yml",
    "content": "name: Windows Server 2022\n\non: \n  push:\n    branches: [ master, develop ]\n  pull_request:\n    branches: [ master, develop ]\n    \njobs:\n  build:\n    runs-on: windows-latest\n    \n    strategy: \n      matrix:\n        mode: [Debug, Release]\n        cpp_version: [11, 20]\n        arch: [x64]\n    \n    env: \n      CXX: cl.exe\n      CC: cl.exe\n    \n    steps:\n      - name: check out\n        uses: actions/checkout@v3\n        \n      - name: generate project\n        run: cmake -B ${{ github.workspace }}\\build -DCMAKE_BUILD_TYPE=${{ matrix.mode }} -A${{ matrix.arch }} -DCMAKE_CXX_STANDARD=${{ matrix.cpp_version }}\n        \n      - name: build project\n        run: cmake --build ${{ github.workspace }}\\build --config ${{ matrix.mode }}\n"
  },
  {
    "path": ".gitignore",
    "content": ".cache\n.vs\n.vscode\nbuild\nwinbuild\n"
  },
  {
    "path": "CHANGELOG",
    "content": "2018-10-08 Version: 1.0.0\n1. pre-release version for oss sdk\n\n"
  },
  {
    "path": "CMakeLists.txt",
    "content": "#\n# Copyright 2009-2017 Alibaba Cloud All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# \n#      http://www.apache.org/licenses/LICENSE-2.0\n# \n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\ncmake_minimum_required(VERSION 3.5)\n\ncmake_policy(SET CMP0048 NEW)\nset_property(GLOBAL PROPERTY USE_FOLDERS ON)\n\n#Project setting\nfile(STRINGS \"VERSION\" version)\nproject(alibabacloud-oss-cpp-sdk VERSION ${version})\nmessage(STATUS \"Project version: ${PROJECT_VERSION}\")\nset(SDK_ROOT \"${CMAKE_CURRENT_SOURCE_DIR}\")\nset(TARGET_OUTPUT_NAME_PREFIX \"alibabacloud-oss-\" CACHE STRING \"The target's output name prefix\")\n\n#Options\noption(BUILD_SHARED_LIBS  \"Enable shared library\" OFF)\noption(BUILD_SAMPLE \"Build sample\" ON)\noption(BUILD_TESTS \"Build unit and perfermence tests\" OFF)\noption(ENABLE_COVERAGE \"Flag to enable/disable building code with -fprofile-arcs and -ftest-coverage. Gcc only\" OFF)\noption(ENABLE_RTTI \"Flag to enable/disable building code with RTTI information\" ON)\n\n#Platform\nif (CMAKE_CROSSCOMPILING)\n\tif (${CMAKE_SYSTEM_NAME} STREQUAL \"Android\")\n\t\tset(PLATFORM_ANDROID 1)\n\t\tset(TARGET_OS \"ANDROID\")\n\telse()\n\t\tmessage(FATAL_ERROR \"Do not support target platform\")\n\tendif()\nelse()\n\tif(CMAKE_HOST_APPLE)\n\t\tset(PLATFORM_APPLE 1)\n\t\tset(TARGET_OS \"APPLE\")\n\telseif(CMAKE_HOST_UNIX)\n\t\tset(PLATFORM_LINUX 1)\n\t\tset(TARGET_OS \"LINUX\")\n\telseif(CMAKE_HOST_WIN32)\n\t\tset(PLATFORM_WINDOWS 1)\n\t\tset(TARGET_OS \"WINDOWS\")\n\telse()\n\t\tmessage(FATAL_ERROR \"Do not support unknown host OS\")\n\tendif()\nendif()\n\nmessage(STATUS \"TARGET_OS: ${TARGET_OS}\")\n\nadd_definitions(-DPLATFORM_${TARGET_OS})\n\n#Find dependency Library, curl, openssl\nif (${TARGET_OS} STREQUAL \"WINDOWS\")\n\tset(WLIB_TARGET \"Win32\")\n\tif (CMAKE_CL_64)\n\tset(WLIB_TARGET \"x64\")\n\tendif()\n\tset(CRYPTO_LIBS \n\t\t${CMAKE_SOURCE_DIR}/third_party/lib/${WLIB_TARGET}/ssleay32.lib \n\t\t${CMAKE_SOURCE_DIR}/third_party/lib/${WLIB_TARGET}/libeay32.lib)\n\tset(CRYPTO_INCLUDE_DIRS \n\t\t${CMAKE_SOURCE_DIR}/third_party/include) \n\n\tset(CLIENT_LIBS \n\t\t${CMAKE_SOURCE_DIR}/third_party/lib/${WLIB_TARGET}/libcurl.lib) \n\tset(CLIENT_INCLUDE_DIRS \n\t\t${CMAKE_SOURCE_DIR}/third_party/include) \nelse()\n\tinclude(FindCURL)\n\tinclude(FindOpenSSL)\n\n\tif(NOT CURL_FOUND)\n\t\tmessage(FATAL_ERROR \"Could not find curl\")\n\tendif()\n\n\tif(NOT OPENSSL_FOUND)\n\t\tmessage(FATAL_ERROR \"Could not find openssl\")\n\tendif()\n\n\tset(CRYPTO_LIBS ${OPENSSL_LIBRARIES})\n\tset(CRYPTO_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) \n\tset(CRYPTO_LIBS_ABSTRACT_NAME crypto ssl)\n\n\tset(CLIENT_LIBS ${CURL_LIBRARIES})\n\tset(CLIENT_INCLUDE_DIRS ${CURL_INCLUDE_DIRS}) \n\tset(CLIENT_LIBS_ABSTRACT_NAME curl)\nendif()\n\n#Compiler flags\nset(CMAKE_CXX_STANDARD 11 CACHE STRING \"C++ standard to use\")\nmessage(STATUS \"CXX Standard: ${CMAKE_CXX_STANDARD}\")\nif(CMAKE_CXX_COMPILER_ID MATCHES \"MSVC\")\n\tlist(APPEND SDK_COMPILER_FLAGS \"/MP\")\n\tif (NOT ENABLE_RTTI)\n\tlist(APPEND SDK_COMPILER_FLAGS \"/GR-\")\n\tendif()\n\t# disable some warning\n\tlist(APPEND SDK_COMPILER_FLAGS \"/D_CRT_SECURE_NO_WARNINGS\")\n\tif(CMAKE_CXX_STANDARD GREATER_EQUAL 17)\n\tlist(APPEND SDK_COMPILER_FLAGS \"/D_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING\")\n\tendif()\nelseif (CMAKE_CXX_COMPILER_ID MATCHES \"Clang\")\n\tlist(APPEND SDK_COMPILER_FLAGS \"-fno-exceptions\" \"-fPIC\")\n\tif (NOT ENABLE_RTTI)\n\tlist(APPEND SDK_COMPILER_FLAGS \"-fno-rtti\")\n\tendif()\n\t\n\tlist(APPEND SDK_COMPILER_FLAGS \"-Wall\" \"-Werror\" \"-pedantic\" \"-Wextra\")\nelse()\n\tlist(APPEND SDK_COMPILER_FLAGS \"-fno-exceptions\" \"-fPIC\")\n\tif (NOT ENABLE_RTTI)\n\tlist(APPEND SDK_COMPILER_FLAGS \"-fno-rtti\")\n\tendif()\n\t\n\tlist(APPEND SDK_COMPILER_FLAGS \"-Wall\" \"-Werror\" \"-pedantic\" \"-Wextra\")\n\t\n\tif (ENABLE_COVERAGE)\n\tSET(CMAKE_CXX_FLAGS_DEBUG \"${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage\")\n\tSET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage\")\n\tSET(CMAKE_EXE_LINKER_FLAGS_DEBUG \"${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage\")\n\tendif()\nendif()\n\n\nif (BUILD_SHARED_LIBS)\n\tset(STATIC_LIB_SUFFIX \"-static\")\nelse()\n\tset(STATIC_LIB_SUFFIX \"\")\nendif()\n\ninclude(ExternalProject)\ninclude(GNUInstallDirs)\n\nadd_subdirectory(sdk)\n\nif(BUILD_SAMPLE)\n\tadd_subdirectory(sample)\nendif()\n\nif(BUILD_TESTS)\n\tadd_subdirectory(test)\n\tadd_subdirectory(ptest)\nendif()\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright 2009-2017 Alibaba Cloud All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License."
  },
  {
    "path": "README.md",
    "content": "# Alibaba Cloud OSS C++ Software Development Kit\r\n[中文文档](./README_zh.md)\r\n\r\nAlibaba Cloud Object Storage Service (OSS) is a cloud storage service provided by Alibaba Cloud, featuring massive capacity, security, a low cost, and high reliability. You can upload and download data on any application anytime and anywhere by calling APIs, and perform simple management of data through the web console. The OSS can store any type of files and therefore applies to various websites, development enterprises and developers.\r\n\r\nThe OSS SDK for C++ provides a variety of modern C++ (version C++ 11 or later) interfaces for convenient use of the OSS.\r\n\r\nThis document introduces how to obtain and call Alibaba Cloud OSS C++ SDK.\r\n\r\nIf you have any problem while using C++ SDK, please contact us.\r\n\r\n\r\n## Prerequisites\r\n\r\nTo use Alibaba Cloud OSS C++ SDK, you must:\r\n\r\n* Have an Alibaba Cloud account and an AccessKey. The AccessKey is required when initializing the client. You can create an AccessKey in the Alibaba Cloud console. For more information, see [Create an AccessKey](https://usercenter.console.aliyun.com/?spm=5176.doc52740.2.3.QKZk8w#/manage/ak)\r\n\r\n> **Note:** To increase the security of your account, we recommend that you use the AccessKey of the RAM user to access Alibaba Cloud services.\r\n\r\n\r\n* Install a compiler that supports C + + 11 or later:\r\n\t* Visual Studio 2013 or later:\r\n\t* or GCC 4.8 or later:\r\n\t* or Clang 3.3 or later:\r\n\r\n## Building the SDK\r\n\r\n1. Download or clone from GitHub [aliyun-oss-cpp-sdk](https://github.com/aliyun/aliyun-oss-cpp-sdk)\r\n\r\n* Download https://github.com/aliyun/aliyun-oss-cpp-sdk/archive/master.zip\r\n* Clone source codes\r\n\r\n```\r\ngit clone https://github.com/aliyun/aliyun-oss-cpp-sdk.git\r\n```\r\n\r\n2. Install CMake 3.1 or later, enter SDK to create build files required for the build\r\n\r\n```\r\ncd <path/to/aliyun-oss-cpp-sdk>\r\nmkdir build\r\ncd build\r\ncmake ..\r\n```\r\n\r\n### Windows\r\n\r\nEnter build folder, open alibabacloud-oss-cpp-sdk.sln with Visual Studio.\r\n\r\nOr run the the following commands to build and install:\r\n\r\n```\r\nmsbuild ALL_BUILD.vcxproj\r\nmsbuild INSTALL.vcxproj\r\n```\r\n\r\n### Linux\r\n\r\nInstall third-party libraries on the Linux platform, including `libcurl` and `libopenssl`.\r\n\r\nRun the following commands on the Redhat/Fedora system to install third-party libraries.\r\n```\r\nsudo dnf install libcurl-devel openssl-devel\r\n```\r\n\r\nRun the following commands on the Debian/Ubuntu system to install third-party libraries.\r\n```\r\nsudo apt-get install libcurl4-openssl-dev libssl-dev\r\n```\r\n\r\nRun the following commands to build and install sdk:\r\n```\r\nmake\r\nsudo make install\r\n```\r\n\r\n### Mac\r\nOn Mac you should specify openssl path. For example, openssl is installed in /usr/local/Cellar/openssl/1.0.2p, run the following commands\r\n```\r\ncmake -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2p  \\\r\n      -DOPENSSL_LIBRARIES=/usr/local/Cellar/openssl/1.0.2p/lib  \\\r\n      -DOPENSSL_INCLUDE_DIRS=/usr/local/Cellar/openssl/1.0.2p/include/ ..\r\nmake\r\n```\r\n\r\n### Android\r\nBuild and install third-party libraries, including `libcurl` and `libopenssl` to `$ANDROID_NDK/sysroot`, run the following commands\r\n```\r\ncmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake  \\\r\n      -DANDROID_NDK=$ANDROID_NDK    \\\r\n      -DANDROID_ABI=armeabi-v7a     \\\r\n      -DANDROID_TOOLCHAIN=clang     \\\r\n      -DANDROID_PLATFORM=android-21 \\\r\n      -DANDROID_STL=c++_shared ..\r\nmake\r\n```\r\n\r\n### CMake Option\r\n\r\n#### BUILD_SHARED_LIBS\r\n(Default OFF) If turned on, both static and shared libraries are built, and the static library name has a -static suffix. At the same time, the sample project will be linked to the shared library.\r\n```\r\ncmake .. -DBUILD_SHARED_LIBS=ON\r\n```\r\n\r\n#### BUILD_TESTS\r\n(Default OFF) If turned on, both test and ptest project will be built.\r\n```\r\ncmake .. -DBUILD_TESTS=ON\r\n```\r\n\r\n#### ENABLE_RTTI\r\n(Default ON) If turned off, the SDK is built without RTTI information.\r\n```\r\ncmake .. -DENABLE_RTTI=OFF\r\n```\r\n\r\n#### OSS_DISABLE_BUCKET\r\n(Default OFF) If turned ON, the SDK is built without the bucket's API.\r\n```\r\ncmake .. -DOSS_DISABLE_BUCKET=ON\r\n```\r\n#### OSS_DISABLE_LIVECHANNEL\r\n(Default OFF) If turned ON, the SDK is built without the livechannel's API.\r\n```\r\ncmake .. -DOSS_DISABLE_LIVECHANNEL=ON\r\n```\r\n\r\n#### OSS_DISABLE_RESUAMABLE\r\n(Default OFF) If turned ON, the SDK is built without the resumable operation feature.\r\n```\r\ncmake .. -DOSS_DISABLE_RESUAMABLE=ON\r\n```\r\n\r\n#### OSS_DISABLE_ENCRYPTION\r\n(Default OFF) If turned ON, the SDK is built without the client-side encryption feature.\r\n```\r\ncmake .. -DOSS_DISABLE_ENCRYPTION=ON\r\n```\r\n\r\n## Use the C++ SDK\r\n\r\nThe following code shows how to list buckets owned by the requester. \r\n\r\n> **Note:** Please replace the your-region-id,your-access-key-id and your-access-key-secret in the sample.\r\n\r\n```\r\n#include <alibabacloud/oss/OssClient.h>\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nint main(int argc, char** argv)\r\n{\r\n    // Initialize the SDK\r\n    InitializeSdk();\r\n\r\n    // Configure the instance\r\n    ClientConfiguration conf;\r\n    OssClient client(\"your-region-id\", \"your-access-key-id\", \"your-access-key-secret\", conf);\r\n\r\n    // Create an API request\r\n    ListBucketsRequest request;\r\n    auto outcome = client.ListBuckets(request);\r\n    if (!outcome.isSuccess()) {\r\n        // Handle exceptions\r\n        std::cout << \"ListBuckets fail\" <<\r\n            \",code:\" << outcome.error().Code() <<\r\n            \",message:\" << outcome.error().Message() <<\r\n            \",requestId:\" << outcome.error().RequestId() << std::endl;\r\n        ShutdownSdk();\r\n        return -1;\r\n    }\r\n\r\n    // Close the SDK\r\n    ShutdownSdk();\r\n    return 0;\r\n}\r\n```\r\n\r\n## License\r\nSee the LICENSE file (Apache 2.0 license).\r\n\r\n\r\n\r\n\r\n"
  },
  {
    "path": "README_zh.md",
    "content": "# 阿里云OSS C++工具套件\r\n\r\n阿里云对象存储（Object Storage Service，简称OSS），是阿里云对外提供的海量、安全、低成本、高可靠的云存储服务。用户可以通过调用API，在任何应用、任何时间、任何地点上传和下载数据，也可以通过用户Web控制台对数据进行简单的管理。OSS适合存放任意文件类型，适合各种网站、开发企业及开发者使用。\r\n\r\n适用于阿里云OSS的 C++ SDK提供了一组现代化的 C++（C++ 11）接口,让您不用复杂编程即可访问阿里云OSS服务。\r\n\r\n如果您在使用SDK的过程中遇到任何问题，欢迎前往阿里云SDK问答社区提问，提问前请阅读提问引导。亦可在当前GitHub提交Issues。\r\n\r\n完成本文档中的操作开始使用 C++ SDK。\r\n\r\n\r\n## 前提条件\r\n\r\n在使用 C++ SDK 前，确保您已经：\r\n\r\n* 注册了阿里云账号并获取了访问密钥（AccessKey）。\r\n\r\n> **说明：** 为了保证您的账号安全，建议您使用RAM账号来访问阿里云服务。阿里云账号对拥有的资源有全部权限。RAM账号由阿里云账号授权创建，仅有对特定资源限定的操作权限。详情[参见RAM](https://help.aliyun.com/document_detail/28647.html)。\r\n\r\n\r\n* 安装支持 C++ 11 或更高版本的编译器：\r\n\t* Visual Studio 2013 或以上版本\r\n\t* 或 GCC 4.8 或以上版本\r\n\t* 或 Clang 3.3 或以上版本\r\n\r\n## 从源代码构建 SDK\r\n\r\n1. 从 GitHub 下载或 Git 克隆 [aliyun-oss-cpp-sdk](https://github.com/aliyun/aliyun-oss-cpp-sdk)\r\n\r\n* 直接下载 https://github.com/aliyun/aliyun-oss-cpp-sdk/archive/master.zip\r\n* 使用 Git 命令获取\r\n\r\n```\r\ngit clone https://github.com/aliyun/aliyun-oss-cpp-sdk.git\r\n```\r\n\r\n2. 安装 cmake 3.1 或以上版本，进入 SDK 创建生成必要的构建文件\r\n\r\n```\r\ncd <path/to/aliyun-oss-cpp-sdk>\r\nmkdir build\r\ncd build\r\ncmake ..\r\n```\r\n\r\n### Windows\r\n\r\n进入 build 目录使用 Visual Studio 打开 alibabacloud-oss-cpp-sdk.sln 生成解决方案。\r\n\r\n或者您也可以使用 VS 的开发人员命令提示符，执行以下命令编译并安装：\r\n\r\n```\r\nmsbuild ALL_BUILD.vcxproj\r\nmsbuild INSTALL.vcxproj\r\n```\r\n\r\n### Linux\r\n\r\n要在 Linux 平台进行编译, 您必须安装依赖的外部库文件 libcurl、libopenssl, 通常情况下，系统的包管理器中的会有提供。\r\n\r\n例如：在基于 Redhat / Fedora 的系统上安装这些软件包\r\n\r\n```\r\nsudo dnf install libcurl-devel openssl-devel\r\n```\r\n例如：在基于 Debian / Ubuntu 的系统上安装这些软件包\r\n```\r\nsudo apt-get install libcurl4-openssl-dev libssl-dev\r\n```\r\n\r\n在安装依赖库后执行以下命令编译并安装：\r\n\r\n```\r\nmake\r\nsudo make install\r\n```\r\n\r\n### Mac\r\n在Mac平台编译时，需要指定openssl 库的路径。例如 openssl安装在 /usr/local/Cellar/openssl/1.0.2p, 请使用如下命令\r\n```\r\ncmake -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2p  \\\r\n      -DOPENSSL_LIBRARIES=/usr/local/Cellar/openssl/1.0.2p/lib  \\\r\n      -DOPENSSL_INCLUDE_DIRS=/usr/local/Cellar/openssl/1.0.2p/include/ ..\r\nmake\r\n```\r\n\r\n### Android\r\n例如，在linux 环境下，基于android-ndk-r16 工具链构建工程。可以先把第三方库 `libcurl` 和 `libopenssl` 编译并安装到 `$ANDROID_NDK/sysroot` 下，然后使用如下命令\r\n```\r\ncmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake  \\\r\n      -DANDROID_NDK=$ANDROID_NDK    \\\r\n      -DANDROID_ABI=armeabi-v7a     \\\r\n      -DANDROID_TOOLCHAIN=clang     \\\r\n      -DANDROID_PLATFORM=android-21 \\\r\n      -DANDROID_STL=c++_shared ..\r\nmake\r\n```\r\n\r\n### CMake 选项\r\n\r\n#### BUILD_SHARED_LIBS\r\n(默认为关，即OFF) 如果打开，会同时构建静态库和动态库， 静态库名字增加-static后缀。同时，sample工程会链接到sdk的动态库上。\r\n```\r\ncmake .. -DBUILD_SHARED_LIBS=ON\r\n```\r\n\r\n#### BUILD_TESTS\r\n(默认为关，即OFF) 如果打开，会构建出test 及 ptest两个测试工程。\r\n```\r\ncmake .. -DBUILD_TESTS=ON\r\n```\r\n\r\n#### ENABLE_RTTI\r\n(默认为开，即ON) 如果关闭, 构建的库不会添加运行时类型信息.\r\n```\r\ncmake .. -DENABLE_RTTI=OFF\r\n```\r\n\r\n#### OSS_DISABLE_BUCKET\r\n(默认为关，即OFF) 如果打开, 构建的库不会包含和 bucket 有关的接口.\r\n```\r\ncmake .. -DOSS_DISABLE_BUCKET=ON\r\n```\r\n#### OSS_DISABLE_LIVECHANNEL\r\n(默认为关，即OFF) 如果打开, 构建的库不会包含和 livechannel 有关的接口.\r\n```\r\ncmake .. -DOSS_DISABLE_LIVECHANNEL=ON\r\n```\r\n\r\n#### OSS_DISABLE_RESUAMABLE\r\n(默认为关，即OFF) 如果打开, 构建的库不会包含断点续传功能.\r\n```\r\ncmake .. -DOSS_DISABLE_RESUAMABLE=ON\r\n```\r\n\r\n#### OSS_DISABLE_ENCRYPTION\r\n(默认为关，即OFF) 如果打开, 构建的库不会包含客户端加密功能.\r\n```\r\ncmake .. -DOSS_DISABLE_ENCRYPTION=ON\r\n```\r\n\r\n## 如何使用 C++ SDK\r\n\r\n以下代码展示了如何获取请求者拥有的Bucket。\r\n\r\n> **说明：** 您需要替换示例中的 your-region-id、your-access-key-id 和 your-access-key-secret 的值。\r\n\r\n```\r\n#include <alibabacloud/oss/OssClient.h>\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nint main(int argc, char** argv)\r\n{\r\n    // 初始化SDK\r\n    InitializeSdk();\r\n\r\n    // 配置实例\r\n    ClientConfiguration conf;\r\n    OssClient client(\"your-region-id\", \"your-access-key-id\", \"your-access-key-secret\", conf);\r\n\r\n    // 创建API请求\r\n    ListBucketsRequest request;\r\n    auto outcome = client.ListBuckets(request);\r\n    if (!outcome.isSuccess()) {\r\n        // 异常处理\r\n        std::cout << \"ListBuckets fail\" <<\r\n            \",code:\" << outcome.error().Code() <<\r\n            \",message:\" << outcome.error().Message() <<\r\n            \",requestId:\" << outcome.error().RequestId() << std::endl;\r\n        ShutdownSdk();\r\n        return -1;\r\n    }\r\n\r\n    // 关闭SDK\r\n    ShutdownSdk();\r\n    return 0;\r\n}\r\n```\r\n\r\n## 许可协议\r\n请参阅 LICENSE 文件（Apache 2.0 许可证）。\r\n"
  },
  {
    "path": "VERSION",
    "content": "1.10.1"
  },
  {
    "path": "ptest/CMakeLists.txt",
    "content": "#\n# Copyright 2009-2017 Alibaba Cloud All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# \n#      http://www.apache.org/licenses/LICENSE-2.0\n# \n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\nproject(cpp-sdk-ptest VERSION ${version})\n\t\nfile(GLOB ptest_src \"src/*\")\n\n\nadd_executable(${PROJECT_NAME} \t${ptest_src})\n\ntarget_include_directories(${PROJECT_NAME}\n\tPRIVATE ${CMAKE_SOURCE_DIR}/sdk/include)\n\ntarget_link_libraries(${PROJECT_NAME} cpp-sdk${STATIC_LIB_SUFFIX})\t\ntarget_link_libraries(${PROJECT_NAME} ${CRYPTO_LIBS})\ntarget_link_libraries(${PROJECT_NAME} ${CLIENT_LIBS})\nif (${TARGET_OS} STREQUAL \"LINUX\")\ntarget_link_libraries(${PROJECT_NAME} pthread)\t\nendif()\n\ntarget_compile_options(${PROJECT_NAME} \n\tPRIVATE \"${SDK_COMPILER_FLAGS}\")\n"
  },
  {
    "path": "ptest/src/Config.cc",
    "content": "#include <string.h>\r\n#include <string>\r\n#include \"Config.h\"\r\n#include <sstream>\r\n#include <iostream>\r\n#include <fstream>\r\n#include <algorithm>\r\n\r\nusing namespace AlibabaCloud::OSS::PTest;\r\n\r\n\r\nstd::string Config::Version = \"cpp-sdk-perf-test-1.0.0 \";\r\nstd::string Config::Endpoint = \"\";\r\nstd::string Config::AccessKeyId = \"\";\r\nstd::string Config::AccessKeySecret = \"\";\r\nstd::string Config::BucketName = \"\";\r\nstd::string Config::OssCfgFile = \"oss.ini\";\r\n\r\nstd::string Config::Command = \"\";\r\nstd::string Config::BaseLocalFile = \"\";\r\nstd::string Config::BaseRemoteKey = \"\";\r\n\r\nint Config::PartSize = 100 * 1024 * 1024;\r\nint Config::Parallel = 5;\r\nint Config::Multithread = 1;\r\nint Config::LoopTimes = 1;\r\nint Config::LoopDurationS = -1;\r\nbool Config::Persistent = false;\r\nbool Config::DifferentSource = false;\r\nbool Config::CrcCheck = true;\r\nint Config::SpeedKBPerSec = 0;   //\r\n\r\nbool Config::Debug = false;\r\nbool Config::DumpDetail = false;\r\nbool Config::PrintPercentile = false;\r\n\r\nstatic std::string LeftTrim(const char* source)\r\n{\r\n    std::string copy(source);\r\n    copy.erase(copy.begin(), std::find_if(copy.begin(), copy.end(), [](unsigned char ch) { return !::isspace(ch); }));\r\n    return copy;\r\n}\r\n\r\nstatic std::string RightTrim(const char* source)\r\n{\r\n    std::string copy(source);\r\n    copy.erase(std::find_if(copy.rbegin(), copy.rend(), [](unsigned char ch) { return !::isspace(ch); }).base(), copy.end());\r\n    return copy;\r\n}\r\n\r\nstatic std::string Trim(const char* source)\r\n{\r\n    return LeftTrim(RightTrim(source).c_str());\r\n}\r\n\r\nstatic std::string LeftTrimQuotes(const char* source)\r\n{\r\n    std::string copy(source);\r\n    copy.erase(copy.begin(), std::find_if(copy.begin(), copy.end(), [](int ch) { return !(ch == '\"'); }));\r\n    return copy;\r\n}\r\n\r\nstatic std::string RightTrimQuotes(const char* source)\r\n{\r\n    std::string copy(source);\r\n    copy.erase(std::find_if(copy.rbegin(), copy.rend(), [](int ch) { return !(ch == '\"'); }).base(), copy.end());\r\n    return copy;\r\n}\r\n\r\nstatic std::string TrimQuotes(const char* source)\r\n{\r\n    return LeftTrimQuotes(RightTrimQuotes(source).c_str());\r\n}\r\n\r\nvoid Config::PrintHelp()\r\n{\r\n    std::cout << \"\\n\";\r\n    std::cout << \"Usage: cpp-sdk-ptest  [-h] [-v] [-c COMMAND] [-f LOCALFILE]      \\n\";\r\n    std::cout << \"                      [-k REMOTEKEY] [-p PARALLEL]      \\n\";\r\n    std::cout << \"                      [-m MULTITHREAD] [--partSize PARTSIZE]      \\n\";\r\n    std::cout << \"                      [-loopTimes TIMES]|[--loopDuration SEC]|[--persistent]      \\n\";\r\n    std::cout << \"                      [--differentsource]      \\n\";\r\n    std::cout << \"Optional arguments:      \\n\";\r\n    std::cout << \"  -h, --help          show this help mestd::coutage and exit.           \\n\";\r\n    std::cout << \"  -v                  show program's version number and exit.    \\n\";\r\n    std::cout << \"  -c COMMAND          Command Type : upload(up), upload_resumable(upr), upload_async(upa), download(dn), download_async(dna) .  \\n\";\r\n    std::cout << \"  -b BUCKETNAME       bucket name.                \\n\";\r\n    std::cout << \"  -f LOCALFILE        local filename to transfer.                \\n\";\r\n    std::cout << \"  -k REMOTEKEY        remote object key.                         \\n\";\r\n    std::cout << \"  -p PARALLEL         parallel threads parameter for resumable breakpoint transfer.      \\n\";\r\n    std::cout << \"  -m MULTITHREAD      multithread number for transfer.           \\n\";\r\n    std::cout << \"  --partSize PARTSIZE part size parameter for resume breakpoint transfer.                \\n\";\r\n    std::cout << \"  --loopTimes TIMES   how many times to do test.                   \\n\";\r\n    std::cout << \"  --loopDuration SEC  how many seconds to do test.                   \\n\";\r\n    std::cout << \"  --persistent        Whether run the command persistantly.      \\n\";\r\n    std::cout << \"  --differentsource   Whether transfer from different source files.  \\n\";\r\n    std::cout << \"  --limit SPEED       Whether to limit the upload or download speed, in kB/s.  \\n\";\r\n    std::cout << \"  --detail            print detail inforamtion for each testcase. \\n\";\r\n    std::cout << \"  --percentile        print the 90th and 95th percentile value. \\n\";\r\n\r\n\r\n    std::cout << \"\\nExamples :  \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c upload -f mylocalfilename -k myobjectkeyname \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c up -f mylocalfilename -k myobjectkeyname -b mybucketname\\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c upload_resumable -f mylocalfilename -k myobjectkeyname -p 5 \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c upload_multipart -f mylocalfilename -k myobjectkeyname -p 5 \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c upr -f mylocalfilename -k myobjectkeyname -p 10 \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c upload_async -f mylocalfilename -k myobjectkeyname \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c upa -f mylocalfilename -k myobjectkeyname -m 5 \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c up -f mylocalfilename -k myobjectkeyname -m 5 \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c download -f mylocalfilename -k myobjectkeyname \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c download_resumable -f mylocalfilename -k myobjectkeyname -p 5 \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c dnr -f mylocalfilename -k myobjectkeyname \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c dnr -f mylocalfilename -k myobjectkeyname -p 5 \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c download_async -f mylocalfilename -k myobjectkeyname \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c dna -f mylocalfilename -k myobjectkeyname -m 5 \\n\";\r\n    std::cout << \"    cpp-sdk-ptest -c dn -f mylocalfilename -k myobjectkeyname -m 5 \\n\";\r\n}\r\n\r\nvoid Config::PrintCfgInfo()\r\n{\r\n    std::cout << \"\\n\";\r\n    std::cout << \"version         : \" << Config::Version << std::endl;\r\n    std::cout << \"endpoint        : \" << Config::Endpoint << std::endl;\r\n    std::cout << \"accessKeyId     : \" << Config::AccessKeyId << std::endl;\r\n    std::cout << \"bucketName      : \" << Config::BucketName << std::endl;\r\n    std::cout << \"command         : \" << Config::Command << std::endl;\r\n    std::cout << \"localfile       : \" << Config::BaseLocalFile << std::endl;\r\n    std::cout << \"remotekey       : \" << Config::BaseRemoteKey << std::endl;\r\n    if (!Config::Command.compare(\"upload_resumable\") || Config::Command.compare(\"download_resumable\")) \r\n    {\r\n    std::cout << \"parallel        : \" << Config::Parallel << std::endl;\r\n    std::cout << \"partSize        : \" << Config::PartSize << std::endl;\r\n    }\r\n    std::cout << \"multithread     : \" << Config::Multithread << std::endl;\r\n    std::cout << \"loopTimes       : \" << Config::LoopTimes << std::endl;\r\n    std::cout << \"loopDuration    : \" << Config::LoopDurationS << std::endl;\r\n    std::cout << \"persistent      : \" << Config::Persistent << std::endl;\r\n    std::cout << \"differentsource : \" << Config::DifferentSource << std::endl;\r\n    std::cout << \"limit speed     : \" << Config::SpeedKBPerSec << std::endl;\r\n}\r\n\r\nint Config::ParseArg(int argc, char **argv)\r\n{\r\n    if (argc < 2)\r\n    {\r\n        PrintHelp();\r\n        return -1;\r\n    }\r\n\r\n    int i = 1;\r\n\r\n    while (i < argc)\r\n    {\r\n        if (argv[i][0] == '-')\r\n        {\r\n            if (!strcmp(\"--help\", argv[i]) || !strcmp(\"-h\", argv[i])) {\r\n                PrintHelp();\r\n                return -1;\r\n            }\r\n            else if (!strcmp(\"-v\", argv[i])) {\r\n                std::cout << Config::Version << std::endl;\r\n                return -1;\r\n            }\r\n            else if (!strcmp(\"-c\", argv[i])) {\r\n                Config::Command = argv[i + 1];\r\n                if (Config::Command == \"up\")\r\n                {\r\n                    Config::Command = \"upload\";\r\n                }\r\n                else if (Config::Command == \"upr\")\r\n                {\r\n                    Config::Command = \"upload_resumable\";\r\n                }\r\n                else if (Config::Command == \"upa\")\r\n                {\r\n                    Config::Command = \"upload_async\";\r\n                }\r\n                else if (Config::Command == \"dn\")\r\n                {\r\n                    Config::Command = \"download\";\r\n                }\r\n                else if (Config::Command == \"dnr\")\r\n                {\r\n                    Config::Command = \"download_resumable\";\r\n                }\r\n                else if (Config::Command == \"dna\")\r\n                {\r\n                    Config::Command = \"download_async\";\r\n                }\r\n                i++;\r\n            }\r\n            else if (!strcmp(\"-b\", argv[i])) {\r\n                Config::BucketName = argv[i + 1];\r\n                i++;\r\n            }\r\n            else if (!strcmp(\"-f\", argv[i])) {\r\n                Config::BaseLocalFile = argv[i + 1];\r\n                i++;\r\n            }\r\n            else if (!strcmp(\"-k\", argv[i])) {\r\n                Config::BaseRemoteKey = argv[i + 1];\r\n                i++;\r\n            }\r\n            else if (!strcmp(\"-p\", argv[i])) {\r\n                Config::Parallel = std::atoi(argv[i + 1]);\r\n                i++;\r\n            }\r\n            else if (!strcmp(\"-m\", argv[i])) {\r\n                Config::Multithread = std::atoi(argv[i + 1]);\r\n                i++;\r\n            }\r\n            else if (!strcmp(\"-d\", argv[i])) {\r\n                Config::Debug = true;\r\n            }\r\n            else if (!strcmp(\"--partSize\", argv[i])) {\r\n                Config::PartSize = std::atoi(argv[i + 1]);\r\n                i++;\r\n            }\r\n            else if (!strcmp(\"--loopTimes\", argv[i])) {\r\n                Config::LoopTimes = std::atoi(argv[i + 1]);\r\n                Config::LoopDurationS = -1;\r\n                i++;\r\n            }\r\n            else if (!strcmp(\"--loopDuration\", argv[i])) {\r\n                Config::LoopDurationS = std::atoi(argv[i + 1]);\r\n                Config::LoopTimes = -1;\r\n                i++;\r\n            }\r\n            else if (!strcmp(\"--persistent\", argv[i])) {\r\n                Config::Persistent = true;\r\n                i++;\r\n            }\r\n            else if (!strcmp(\"--differentsource\", argv[i])) {\r\n                i++;\r\n            }\r\n            else if (!strcmp(\"--limit\", argv[i])) {\r\n                Config::SpeedKBPerSec = std::atoi(argv[i + 1]);\r\n                i++;\r\n            }\r\n            else if (!strcmp(\"--detail\", argv[i])) {\r\n                Config::DumpDetail = true;\r\n            }\r\n            else if (!strcmp(\"--percentile\", argv[i])) {\r\n                Config::PrintPercentile = true;\r\n            }\r\n        }\r\n        i++;\r\n    };\r\n    return 0;\r\n}\r\n\r\n\r\nint Config::LoadCfgFile()\r\n{\r\n    std::fstream in(Config::OssCfgFile, std::ios::in | std::ios::binary);\r\n    if (!in.good()) {\r\n        std::cout << \"Open oss.ini file fail.\" << std::endl;\r\n        return 1;\r\n    }\r\n\r\n    char buffer[256];\r\n    char *ptr;\r\n\r\n    while (in.getline(buffer, 256)) {\r\n        ptr = strchr(buffer, '=');\r\n        if (!ptr) {\r\n            continue;\r\n        }\r\n        if (!strncmp(buffer, \"AccessKeyId\", 11)) {\r\n            Config::AccessKeyId = TrimQuotes(Trim(ptr + 1).c_str());\r\n        } \r\n        else if (!strncmp(buffer, \"AccessKeySecret\", 15)) {\r\n            Config::AccessKeySecret = TrimQuotes(Trim(ptr + 1).c_str());\r\n        }\r\n        else if (!strncmp(buffer, \"Endpoint\", 8)) {\r\n            Config::Endpoint = TrimQuotes(Trim(ptr + 1).c_str());\r\n        }\r\n        else if (!strncmp(buffer, \"BucketName\", 10)) {\r\n            Config::BucketName = TrimQuotes(Trim(ptr + 1).c_str());\r\n        }\r\n    }\r\n\r\n    if (Config::AccessKeyId.empty() ||\r\n        Config::AccessKeySecret.empty() ||\r\n        Config::Endpoint.empty() ||\r\n        Config::BucketName.empty()) {\r\n        std::cout << \"one of AK, SK, endpoint and BucketName is not config, please set the oss.ini file.\" << std::endl;\r\n        return 1;\r\n    }\r\n\r\n    return 0;\r\n}"
  },
  {
    "path": "ptest/src/Config.h",
    "content": "#include <string>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\nnamespace PTest\r\n{\r\n    class Config\r\n    {\r\n    public:\r\n        Config() = default;\r\n        static void PrintHelp();\r\n        static void PrintCfgInfo();\r\n        static int ParseArg(int argc, char **argv);\r\n        static int LoadCfgFile();\r\n\r\n\r\n    public:\r\n        static std::string Version;\r\n        static std::string Endpoint;\r\n        static std::string AccessKeyId;\r\n        static std::string AccessKeySecret;\r\n        static std::string BucketName;\r\n        static std::string OssCfgFile;\r\n\r\n        static std::string Command;\r\n        static std::string BaseLocalFile;\r\n        static std::string BaseRemoteKey;\r\n\r\n        static int PartSize;\r\n        static int Parallel;\r\n        static int Multithread;\r\n        static int LoopTimes;\r\n        static int LoopDurationS;\r\n        static bool Persistent;\r\n        static bool DifferentSource;\r\n        static bool CrcCheck;\r\n\r\n        static int SpeedKBPerSec;\r\n\r\n        static bool Debug;\r\n        static bool DumpDetail;\r\n        static bool PrintPercentile;\r\n    };\r\n}\r\n}\r\n}\r\n\r\n"
  },
  {
    "path": "ptest/src/Program.cc",
    "content": "#include <alibabacloud/oss/OssClient.h>\r\n#include <alibabacloud/oss/client/RateLimiter.h>\r\n#include <iostream>\r\n#include <memory>\r\n#include \"Config.h\"\r\n#include <fstream>\r\n#include <future>\r\n#include <thread>\r\n#include <chrono>\r\n#include <iomanip>\r\n#include <atomic>\r\n#include<algorithm>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace AlibabaCloud::OSS::PTest;\r\n\r\nstatic std::chrono::system_clock::time_point totalStartTimePoint;\r\nstatic std::chrono::system_clock::time_point totalStopTimePoint;\r\nstatic int64_t totalTransferSize;\r\nstatic int64_t totalTransferDurationMS;\r\nstatic int64_t minTransferDurationMS;\r\nstatic int64_t maxTransferDurationMS;\r\nstatic int totalSucessCnt;\r\nstatic int totalFailCnt;\r\nstatic std::mutex logMtx;\r\nstatic std::mutex updateMtx;\r\n\r\nstatic uint64_t uploadFileCRC64;\r\n\r\nstruct taskResult\r\n{\r\n    int taskId;\r\n    bool success;\r\n    int64_t seqNum;\r\n    int64_t transferSize;\r\n    std::chrono::system_clock::time_point startTimePoint;\r\n    std::chrono::system_clock::time_point stopTimePoint;\r\n};\r\n\r\nusing TaskResultVector = std::vector<taskResult>;\r\n\r\nstatic std::vector<TaskResultVector> totalResults;\r\n\r\nclass  DefaultRateLimiter : public RateLimiter\r\n{\r\npublic:\r\n    DefaultRateLimiter() :rate_(0) {};\r\n    ~DefaultRateLimiter() {};\r\n    virtual void setRate(int rate) { rate_ = rate; };\r\n    virtual int Rate() const { return rate_; };\r\nprivate:\r\n    int rate_;\r\n};\r\n\r\nstatic std::string to_datetime_string(const std::chrono::system_clock::time_point tp)\r\n{\r\n    auto tt = std::chrono::system_clock::to_time_t(tp);\r\n    struct tm tm;\r\n    char date[60] = { 0 };\r\n#ifdef _WIN32\r\n    localtime_s(&tm, &tt);\r\n    sprintf_s(date, \"%d-%02d-%02d %02d:%02d:%02d\",\r\n#else\r\n    localtime_r(&tt, &tm);\r\n    sprintf(date, \"%d-%02d-%02d %02d:%02d:%02d\",\r\n#endif // _WIN32\r\n        (int)tm.tm_year + 1900, (int)tm.tm_mon + 1, (int)tm.tm_mday,\r\n        (int)tm.tm_hour, (int)tm.tm_min, (int)tm.tm_sec);\r\n    return std::string(date);\r\n}\r\n\r\nstatic int64_t get_file_size(const std::string& file)\r\n{\r\n    std::fstream f(file, std::ios::in | std::ios::binary);\r\n    f.seekg(0, f.end);\r\n    int64_t size = f.tellg();\r\n    f.close();\r\n    return size;\r\n}\r\n\r\nstatic uint64_t get_file_crc64(const std::string& file)\r\n{\r\n    std::fstream f(file, std::ios::in | std::ios::binary);\r\n    const int buffer_size = 2048;\r\n    char streamBuffer[buffer_size];\r\n    uint64_t initcrc = 0;\r\n    while (f.good())\r\n    {\r\n        f.read(streamBuffer, buffer_size);\r\n        auto bytesRead = f.gcount();\r\n        if (bytesRead > 0)\r\n        {\r\n            initcrc = ComputeCRC64(initcrc, static_cast<void *>(streamBuffer), static_cast<size_t>(bytesRead));\r\n        }\r\n    }\r\n    f.close();\r\n    return initcrc;\r\n}\r\n\r\nstatic int calculate_part_count(int64_t totalSize, int singleSize)\r\n{\r\n    auto partCount = totalSize / singleSize;\r\n    if (totalSize % singleSize != 0)\r\n    {\r\n        partCount++;\r\n    }\r\n    return static_cast<int>(partCount);\r\n}\r\n\r\nstatic bool is_test_done(int loopcnt, std::chrono::system_clock::time_point startTp)\r\n{\r\n    if (Config::Persistent)\r\n        return false;\r\n\r\n    if ((Config::LoopTimes > 0) && (loopcnt <= Config::LoopTimes))\r\n        return false;\r\n\r\n    if (Config::LoopDurationS > 0) {\r\n        auto currTp = std::chrono::system_clock::now();\r\n        int  diff = (int)(std::chrono::duration_cast<std::chrono::seconds>(currTp - startTp)).count();\r\n\r\n        if (diff < Config::LoopDurationS)\r\n            return false;\r\n    }\r\n\r\n    return true;\r\n}\r\n\r\nstatic void log_msg(std::ostream & out, const std::string &msg)\r\n{\r\n    std::unique_lock<std::mutex> lck(logMtx);\r\n    out << msg;\r\n    out.flush();\r\n}\r\n\r\nstatic void log_result_detail_msg(std::ostream& out)\r\n{\r\n    std::unique_lock<std::mutex> lck(logMtx);\r\n    std::stringstream ss;\r\n    out << \"Dump Detail:\" << std::endl;\r\n    out << \"Result, TaskId, SeqNum, DurationMs, TransferSize, TransferRate MB/s\" << std::endl;\r\n    for (const auto& results : totalResults) {\r\n        for (const auto& result : results) {\r\n            ss.str(\"\");\r\n            ss << std::setiosflags(std::ios::fixed) << std::setprecision(2);\r\n            int64_t durationMs = (std::chrono::duration_cast<std::chrono::milliseconds>(result.stopTimePoint - result.startTimePoint)).count();\r\n            ss << (result.success ? \"OK\" : \"NG\") <<\r\n                \",\" << result.taskId <<\r\n                \",\" << result.seqNum <<\r\n                \",\" << durationMs;\r\n            if (result.success) {\r\n                ss << \",\" << result.transferSize;\r\n                ss << \",\" << ((double)result.transferSize / 1024.0f / 1024.0f) / ((double)durationMs / 1000.0f);\r\n            }\r\n            else {\r\n                ss << \", ,\";\r\n            }\r\n            ss << std::endl;\r\n            out << ss.str();\r\n        }\r\n    }\r\n    out.flush();\r\n}\r\n\r\nstatic void get_90th_95th_latency_percentile(int64_t &per90, int64_t &per95)\r\n{\r\n    std::vector<int64_t> latentcy;\r\n    for (const auto& results : totalResults) {\r\n        for (const auto& result : results) {\r\n            int64_t durationMs = (std::chrono::duration_cast<std::chrono::milliseconds>(result.stopTimePoint - result.startTimePoint)).count();\r\n            latentcy.push_back(durationMs);\r\n        }\r\n    }\r\n    std::sort(latentcy.begin(), latentcy.end());\r\n\r\n    per90 = latentcy[latentcy.size() * 90 / 100];\r\n    per95 = latentcy[latentcy.size() * 95 / 100];\r\n}\r\n\r\nstatic std::string get_task_key(int taskId)\r\n{\r\n    std::string key(Config::BaseRemoteKey);\r\n    if (Config::Command == \"upload\") {\r\n        key.append(\"-\").append(std::to_string(taskId));\r\n    }\r\n    else if (Config::Command == \"upload_resumable\") {\r\n        key.append(\"-resumable\").append(std::to_string(taskId));\r\n    }\r\n    else if (Config::Command == \"upload_async\") {\r\n        key.append(\"-async\").append(std::to_string(taskId));\r\n    }\r\n    return key;\r\n}\r\n\r\nstatic std::string get_task_fileName(int taskId)\r\n{\r\n    std::string fileName(Config::BaseLocalFile);\r\n    if (Config::Command == \"download\") {\r\n        fileName.append(\"-\").append(std::to_string(taskId));\r\n    }\r\n    else if (Config::Command == \"download_resumable\") {\r\n        fileName.append(\"-resumable\").append(std::to_string(taskId));\r\n    }\r\n    else if (Config::Command == \"download_async\") {\r\n        fileName.append(\"-async\").append(std::to_string(taskId));\r\n    }\r\n    return fileName;\r\n}\r\n\r\nstatic taskResult upload(const OssClient &client, const std::string &key, const std::string &fileToUpload)\r\n{\r\n    taskResult result;\r\n    std::stringstream ss;\r\n    result.transferSize = get_file_size(fileToUpload);\r\n    result.startTimePoint = std::chrono::system_clock::now();\r\n\r\n    auto outcome = client.PutObject(Config::BucketName, key, fileToUpload);\r\n\r\n    result.success = outcome.isSuccess();\r\n    result.stopTimePoint = std::chrono::system_clock::now();\r\n    return result;\r\n}\r\n\r\nstatic taskResult upload_async(const OssClient &client, const std::string &key, const std::string &fileToUpload)\r\n{\r\n    taskResult result;\r\n    result.transferSize = get_file_size(fileToUpload);\r\n\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(fileToUpload, std::ios::in|std::ios::binary);\r\n    auto outcomeCallable = client.PutObjectCallable(PutObjectRequest(Config::BucketName, key, content));\r\n    auto outcome = outcomeCallable.get();\r\n\r\n    result.startTimePoint = std::chrono::system_clock::now();\r\n\r\n    result.success = outcome.isSuccess();\r\n    result.stopTimePoint = std::chrono::system_clock::now();\r\n    return result;\r\n}\r\n\r\nstatic taskResult upload_resumable(const OssClient &client, const std::string &key, const std::string &fileToUpload)\r\n{\r\n    taskResult result;\r\n    result.transferSize = get_file_size(fileToUpload);\r\n\r\n    UploadObjectRequest request(Config::BucketName, key, fileToUpload);\r\n    request.setPartSize(Config::PartSize);\r\n    request.setThreadNum(Config::Parallel);\r\n\r\n    result.startTimePoint = std::chrono::system_clock::now();\r\n\r\n    auto outcome = client.ResumableUploadObject(request);\r\n\r\n    result.stopTimePoint = std::chrono::system_clock::now();\r\n    result.success = outcome.isSuccess();\r\n\r\n    return result;\r\n}\r\n\r\nstruct SubTaskInfo {\r\n    int partNum;\r\n    int64_t offset;\r\n};\r\n\r\nstatic taskResult upload_multipart(const OssClient &client, const std::string &key, const std::string &fileToUpload)\r\n{\r\n    taskResult result;\r\n    result.transferSize = get_file_size(fileToUpload);\r\n    result.startTimePoint = std::chrono::system_clock::now();\r\n\r\n    // Set the part size \r\n    const int partSize = Config::PartSize;\r\n    const int64_t fileLength = result.transferSize;\r\n    auto partCount = calculate_part_count(fileLength, partSize);\r\n\r\n    std::vector< SubTaskInfo> SubTaskInfos;\r\n    for (auto i = 0; i < partCount; i++) {\r\n        SubTaskInfo subinfo;\r\n        subinfo.partNum = i + 1;\r\n        subinfo.offset  = partSize;\r\n        subinfo.offset *= i;\r\n        SubTaskInfos.push_back(subinfo);\r\n    }\r\n\r\n    std::vector<PutObjectOutcomeCallable> outcomes;\r\n    bool failed = false;\r\n    std::string code;\r\n    std::string message;\r\n    InitiateMultipartUploadRequest imuRequest(Config::BucketName, key);\r\n    auto initOutcome = client.InitiateMultipartUpload(imuRequest);\r\n    if (initOutcome.isSuccess()) {\r\n        while (!SubTaskInfos.empty() && !failed) {\r\n            if (outcomes.size() < static_cast<size_t>(Config::Parallel)) {\r\n                SubTaskInfo subinfo = *SubTaskInfos.begin();\r\n                SubTaskInfos.erase(SubTaskInfos.begin());\r\n                std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(fileToUpload, std::ios::in | std::ios::binary);\r\n                content->seekg(subinfo.offset);\r\n                UploadPartRequest request(Config::BucketName, key, content);\r\n                request.setPartNumber(subinfo.partNum);\r\n                request.setUploadId(initOutcome.result().UploadId());\r\n                request.setContentLength(Config::PartSize);\r\n                auto outcomeCallable = client.UploadPartCallable(request);\r\n                outcomes.emplace_back(std::move(outcomeCallable));\r\n            }\r\n            //check all outcomes \r\n            for (auto it = outcomes.begin(); !failed && it != outcomes.end();) {\r\n                auto status = it->wait_for(std::chrono::milliseconds(100));\r\n                if (status == std::future_status::ready) {\r\n                    auto outcome = it->get();\r\n                    if (!outcome.isSuccess()) {\r\n                        failed  = true;\r\n                        code    = outcome.error().Code();\r\n                        message = outcome.error().Message();\r\n                    }\r\n                    it = outcomes.erase(it);\r\n                }\r\n                else {\r\n                    it++;\r\n                }\r\n            }\r\n        }\r\n\r\n        for (auto it = outcomes.begin(); !failed && it != outcomes.end(); it++) {\r\n            auto outcome = it->get();\r\n            if (!outcome.isSuccess()) {\r\n                failed  = true;\r\n                code    = outcome.error().Code();\r\n                message = outcome.error().Message();\r\n            }\r\n        }\r\n\r\n        if (!failed) {\r\n            auto listOutcome = client.ListParts(ListPartsRequest(Config::BucketName, key, initOutcome.result().UploadId()));\r\n            if (listOutcome.isSuccess()) {\r\n                auto cOutcome = client.CompleteMultipartUpload(\r\n                    CompleteMultipartUploadRequest(Config::BucketName, key, \r\n                        listOutcome.result().PartList(),\r\n                        initOutcome.result().UploadId()));\r\n                if (!cOutcome.isSuccess()) {\r\n                    failed = true;\r\n                    code = listOutcome.error().Code();\r\n                    message = listOutcome.error().Message();\r\n                }\r\n                else {\r\n                    if (cOutcome.result().CRC64() != uploadFileCRC64) {\r\n                        failed  = true;\r\n                        code    = \"CRC64 check fail.\";\r\n                        message = \"CRC64 check fail.\";\r\n                    }\r\n                }\r\n            }\r\n            else {\r\n                failed  = true;\r\n                code    = listOutcome.error().Code();\r\n                message = listOutcome.error().Message();\r\n            }\r\n        }\r\n    }\r\n    else {\r\n        failed = true;\r\n        code = initOutcome.error().Code();\r\n        message = initOutcome.error().Message();\r\n    }\r\n\r\n    result.stopTimePoint = std::chrono::system_clock::now();\r\n    result.success = !failed;\r\n\r\n    return result;\r\n}\r\n\r\nstatic taskResult download(const OssClient &client, const std::string &key, const std::string &fileToSave)\r\n{\r\n    taskResult result;\r\n    result.startTimePoint = std::chrono::system_clock::now();\r\n\r\n    auto outcome = client.GetObject(Config::BucketName, key, fileToSave);\r\n\r\n    result.stopTimePoint = std::chrono::system_clock::now();\r\n    result.success = outcome.isSuccess();\r\n    if (outcome.isSuccess()) {\r\n        result.transferSize = outcome.result().Metadata().ContentLength();\r\n    }\r\n    return result;\r\n}\r\n\r\nstatic taskResult download_async(const OssClient &client, const std::string &key, const std::string &fileToSave)\r\n{\r\n    taskResult result;\r\n\r\n    GetObjectRequest request(Config::BucketName, key);\r\n    request.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(fileToSave, std::ios_base::out | std::ios_base::trunc | std::ios::binary); });\r\n    result.startTimePoint = std::chrono::system_clock::now();\r\n\r\n    auto outcomeCallable = client.GetObjectCallable(request);\r\n    auto outcome = outcomeCallable.get();\r\n\r\n    result.stopTimePoint = std::chrono::system_clock::now();\r\n    result.success = outcome.isSuccess();\r\n    if (outcome.isSuccess()) {\r\n        result.transferSize = outcome.result().Metadata().ContentLength();\r\n    }\r\n    return result;\r\n}\r\n\r\nstatic taskResult download_resumable(const OssClient &client, const std::string &key, const std::string &fileToSave)\r\n{\r\n    taskResult result;\r\n    DownloadObjectRequest request(Config::BucketName, key, fileToSave);\r\n    request.setPartSize(Config::PartSize);\r\n    request.setThreadNum(Config::Parallel);\r\n    result.startTimePoint = std::chrono::system_clock::now();\r\n\r\n    auto outcome = client.ResumableDownloadObject(request);\r\n\r\n    result.stopTimePoint = std::chrono::system_clock::now();\r\n    result.success = outcome.isSuccess();\r\n    if (outcome.isSuccess()) {\r\n        result.transferSize = outcome.result().Metadata().ContentLength();\r\n    }\r\n    return result;\r\n}\r\n\r\nstatic void runSingleTask(int taskId)\r\n{\r\n    taskResult result;\r\n    TaskResultVector &resultVec = totalResults[taskId];\r\n    std::string key = get_task_key(taskId);\r\n    std::string fileName = get_task_fileName(taskId);\r\n    std::stringstream ss;\r\n    auto startTime = std::chrono::system_clock::now();\r\n\r\n    int64_t taskMinTransferDurationMs = 0x7FFFFFFF;\r\n    int64_t taskMaxTransferDurationMs = -1;\r\n    int64_t taskAvgTrasnferDurationMs = -1;\r\n    int64_t taskTransferSize = 0;\r\n    int64_t taskTransferDurationMs = 0;\r\n    int taskSucessCnt = 0;\r\n    int taskFailCnt   = 0;\r\n\r\n    ClientConfiguration conf;\r\n    auto rateLimiter = std::make_shared<DefaultRateLimiter>();\r\n    if (Config::SpeedKBPerSec > 0) {\r\n        rateLimiter->setRate(Config::SpeedKBPerSec);\r\n        conf.sendRateLimiter = rateLimiter;\r\n        conf.recvRateLimiter = rateLimiter;\r\n    }\r\n\r\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n\r\n    if (Config::LoopTimes == 0)\r\n    {\r\n        Config::Persistent = true;\r\n    }\r\n\r\n    auto _ = ss.str();\r\n    ss << \"\\n++++ START \" << Config::Command << \r\n        \" : taskID=\" << taskId << \r\n        \", LocalFile=\" << fileName <<\r\n        \", RemoteKey=\" << key <<\r\n        \", StartTime=\" << to_datetime_string(startTime) << std::endl;\r\n    log_msg(std::cout, ss.str());\r\n\r\n    int runIndex = 1;\r\n    //while ((runIndex <= Config::LoopTimes) || Config::Persistent)\r\n    while (!is_test_done(runIndex, startTime))\r\n    {\r\n        if (Config::Command == \"upload\") {\r\n            result = upload(client, key, fileName);\r\n        }\r\n        else if (Config::Command == \"upload_resumable\") {\r\n            result = upload_resumable(client, key, fileName);\r\n        }\r\n        else if (Config::Command == \"upload_async\") {\r\n            result = upload_async(client, key, fileName);\r\n        }\r\n        else if (Config::Command == \"upload_multipart\") {\r\n            result = upload_multipart(client, key, fileName);\r\n        }\r\n        else if (Config::Command == \"download\") {\r\n            result = download(client, key, fileName);\r\n        }\r\n        else if (Config::Command == \"download_resumable\") {\r\n            result = download_resumable(client, key, fileName);\r\n        }\r\n        else if (Config::Command == \"download_async\") {\r\n            result = download_async(client, key, fileName);\r\n        } \r\n        else {\r\n            std::cout << \"The Command Type Error \" << Config::Command << std::endl;\r\n            Config::PrintHelp();\r\n            break;\r\n        }\r\n\r\n        if (result.success) {\r\n            int64_t trasnferDuration = (std::chrono::duration_cast<std::chrono::milliseconds>(result.stopTimePoint - result.startTimePoint)).count();\r\n            taskTransferSize += result.transferSize;\r\n            taskTransferDurationMs += trasnferDuration;\r\n            taskSucessCnt += 1;\r\n\r\n            taskMinTransferDurationMs = std::min(trasnferDuration, taskMinTransferDurationMs);\r\n            taskMaxTransferDurationMs = std::max(trasnferDuration, taskMaxTransferDurationMs);\r\n        }\r\n        else {\r\n            taskFailCnt += 1;\r\n        }\r\n\r\n        if (Config::DumpDetail || Config::PrintPercentile) {\r\n            result.taskId = taskId;\r\n            result.seqNum = runIndex;\r\n            resultVec.push_back(result);\r\n        }\r\n        runIndex++;\r\n    }\r\n\r\n    if (taskSucessCnt > 0) {\r\n        taskAvgTrasnferDurationMs = taskTransferDurationMs / taskSucessCnt;\r\n    }\r\n\r\n    double taskTransferRateMBPerS = ((double)taskTransferSize / 1024.0f / 1024.0f) / ((double)taskTransferDurationMs / 1000.0f);\r\n\r\n    ss.str(\"\");\r\n    ss << \"\\n---- STOP  \" << Config::Command <<\r\n        \" : taskID=\" << taskId <<\r\n        \", LocalFile=\" << fileName <<\r\n        \", RemoteKey=\" << key <<\r\n        \", StopTime=\" << to_datetime_string(result.stopTimePoint) << \" \" <<\r\n        \", runTimes=\" << runIndex <<\r\n        \", OK=\" << taskSucessCnt << \r\n        \", NG=\" << taskFailCnt << std::setiosflags(std::ios::fixed) << std::setprecision(2) <<\r\n        \", AvgTransferRate=\"<< taskTransferRateMBPerS << \" MB / S\" <<\r\n        \", Latency(min,max,avg)=(\" << taskMinTransferDurationMs << \",\" << taskMaxTransferDurationMs << \",\" << taskAvgTrasnferDurationMs << \") Ms\"<< std::endl;\r\n    log_msg(std::cout, ss.str());\r\n\r\n    {\r\n    std::unique_lock<std::mutex> lck(updateMtx);\r\n    totalTransferSize += taskTransferSize;\r\n    totalTransferDurationMS += taskTransferDurationMs;\r\n    totalSucessCnt += taskSucessCnt;\r\n    totalFailCnt += taskFailCnt;\r\n    minTransferDurationMS = std::min(minTransferDurationMS, taskMinTransferDurationMs);\r\n    maxTransferDurationMS = std::max(maxTransferDurationMS, taskMaxTransferDurationMs);\r\n    }\r\n\r\n}\r\n\r\nvoid statistic_report_begin()\r\n{\r\n    //calc upload file crc64 for\r\n    if (Config::Command.compare(0, 6, \"upload\") == 0) {\r\n        uploadFileCRC64 = get_file_crc64(Config::BaseLocalFile);\r\n    }\r\n\r\n    totalTransferDurationMS = 1;\r\n    minTransferDurationMS = 0x7FFFFFFF;\r\n    maxTransferDurationMS = -1;\r\n    totalTransferSize = 0;\r\n    totalStartTimePoint = std::chrono::system_clock::now();\r\n    totalSucessCnt = 0;\r\n    totalFailCnt = 0;\r\n    totalResults.resize(Config::Multithread);\r\n    std::stringstream ss;\r\n    ss << std::endl <<\"The Begin : StartTime =\" << to_datetime_string(totalStartTimePoint) << std::endl;\r\n    log_msg(std::cout, ss.str());\r\n}\r\n\r\nvoid statistic_report_end()\r\n{\r\n    totalStopTimePoint = std::chrono::system_clock::now();\r\n    auto tp_diff = std::chrono::duration_cast<std::chrono::milliseconds>(totalStopTimePoint - totalStartTimePoint);\r\n    int64_t totalTimeMS = tp_diff.count();\r\n    std::stringstream ss;\r\n    ss << std::endl << std::setiosflags(std::ios::fixed) << std::setprecision(2);\r\n    ss << std::endl << \"The End : StopTime =\" << to_datetime_string(totalStopTimePoint) << \", TotalTime= \" << tp_diff.count()/1000LL << \" S\" <<\r\n                    \", Command=\" << Config::Command <<\r\n                    \", LocalFile=\" << Config::BaseLocalFile <<\r\n                    \", RemoteKey=\" << Config::BaseRemoteKey <<\r\n                    \", Parallel=\" << Config::Parallel <<\r\n                    \", Multithread=\" << Config::Multithread << std::endl <<\r\n                    \", LimitSpeed=\" << Config::SpeedKBPerSec << \" KB/S\" << std::endl;\r\n\r\n    double transferSizeMB    = (double)totalTransferSize / 1024.0f / 1024.0f;\r\n    double transferDurationS = (double)totalTimeMS / 1000.0f;\r\n    double transferRateMBPerS = transferSizeMB / transferDurationS;\r\n    int64_t avgTrasnferDurationMs = totalSucessCnt ? (totalTransferDurationMS / totalSucessCnt) : -1;\r\n    ss << \"#### StatisticReport: AvgTransferRate=\"<< transferRateMBPerS << \" MB/S\" <<\r\n                                \", TotalSize=\" << transferSizeMB << \" MB\"\r\n                                \", TotalDuration=\" << transferDurationS << \" Seconds.\" << \r\n                                \", OK=\" << totalSucessCnt << \r\n                                \", NG=\" << totalFailCnt  << \r\n                                \", Latency(min,max,avg)=(\" << minTransferDurationMS << \",\" << maxTransferDurationMS << \",\" << avgTrasnferDurationMs << \") Ms\";\r\n    \r\n    if (Config::PrintPercentile) {\r\n        int64_t per90, per95;\r\n        get_90th_95th_latency_percentile(per90, per95);\r\n        ss << \", Latency Percentile(90th, 95th) Ms=(\" << per90 << \",\" << per95 << \")\";\r\n    }\r\n    ss << std::endl;\r\n    log_msg(std::cout, ss.str());\r\n\r\n    if (Config::DumpDetail) {\r\n        log_result_detail_msg(std::cout);\r\n    }\r\n}\r\n\r\nvoid LogCallbackFunc(LogLevel level, const std::string &stream)\r\n{\r\n    if (level == LogLevel::LogOff)\r\n        return;\r\n\r\n    std::cout << stream;\r\n}\r\n\r\nint main(int argc, char **argv)\r\n{\r\n    std::vector<std::future<void>> taskVec;\r\n    if (Config::ParseArg(argc, argv) != 0) {\r\n        return 0;\r\n    }\r\n\r\n    if (Config::LoadCfgFile() != 0) {\r\n        return 0;\r\n    }\r\n\r\n    AlibabaCloud::OSS::InitializeSdk();\r\n\r\n    if (Config::Debug) {\r\n        AlibabaCloud::OSS::SetLogLevel(AlibabaCloud::OSS::LogLevel::LogAll);\r\n        AlibabaCloud::OSS::SetLogCallback(LogCallbackFunc);\r\n    }\r\n\r\n    statistic_report_begin();\r\n\r\n    for (int i = 0; i < Config::Multithread; i++) {\r\n        auto task = std::async(std::launch::async, runSingleTask, i);\r\n        taskVec.emplace_back(std::move(task));\r\n    }\r\n\r\n    for (int i = 0; i < Config::Multithread; i++) {\r\n        taskVec[i].get();\r\n    }\r\n\r\n    statistic_report_end();\r\n\r\n    AlibabaCloud::OSS::ShutdownSdk();\r\n\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "sample/CMakeLists.txt",
    "content": "#\n# Copyright 2009-2017 Alibaba Cloud All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# \n#      http://www.apache.org/licenses/LICENSE-2.0\n# \n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\nproject(cpp-sdk-sample VERSION ${version})\n\t\nfile(GLOB sample_src \"src/*\")\n\nif (NOT OSS_DISABLE_BUCKET)\nfile(GLOB sample_service_src \"src/service/*\")\nfile(GLOB sample_bucket_src \"src/bucket/*\")\nendif()\n\nfile(GLOB sample_object_src \"src/object/*\")\nfile(GLOB sample_presignedurl_src \"src/presignedurl/*\")\n\r\nif (NOT OSS_DISABLE_LIVECHANNEL)\r\nfile(GLOB sample_livechannel_src \"src/LiveChannel/*\")\nendif()\n\nif (NOT OSS_DISABLE_ENCRYPTION)\r\nfile(GLOB sample_encryption_src \"src/encryption/*\")\nendif()\n\nadd_executable(${PROJECT_NAME} \n\t${sample_src} \n\t${sample_service_src}\n\t${sample_bucket_src}\n\t${sample_object_src}\n\t${sample_presignedurl_src}\n\t${sample_livechannel_src}\n\t${sample_encryption_src})\n\ntarget_include_directories(${PROJECT_NAME}\n\tPRIVATE ${CMAKE_SOURCE_DIR}/sdk/include)\n\ntarget_link_libraries(${PROJECT_NAME} cpp-sdk)\t\ntarget_link_libraries(${PROJECT_NAME} ${CRYPTO_LIBS})\ntarget_link_libraries(${PROJECT_NAME} ${CLIENT_LIBS})\nif (${TARGET_OS} STREQUAL \"LINUX\")\ntarget_link_libraries(${PROJECT_NAME} pthread)\t\nendif()\n\ntarget_compile_options(${PROJECT_NAME} \n\tPRIVATE \"${SDK_COMPILER_FLAGS}\")\n\ninstall(TARGETS  ${PROJECT_NAME}\n\tARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}\n\tLIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}\n\tRUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}\n\t)"
  },
  {
    "path": "sample/src/Config.cc",
    "content": "#include <string>\n#include \"Config.h\"\n\nstd::string Config::AccessKeyId = \"\";\nstd::string Config::AccessKeySecret = \"\";\nstd::string Config::Endpoint = \"\";\nstd::string Config::DirToDownload = \"\";\nstd::string Config::FileToUpload = \"\";\nstd::string Config::FileDownloadTo = \"\";\nstd::string Config::BigFileToUpload = \"\";\nstd::string Config::ImageFileToUpload = \"\";\nstd::string Config::CallbackServer = \"\";\nstd::string Config::CheckpointDir = \"\";\nstd::string Config::PublicKeyPath = \"\";\nstd::string Config::PrivateKeyPath = \"\";"
  },
  {
    "path": "sample/src/Config.h",
    "content": "#include <string>\nclass Config\n{\npublic:\n    static std::string AccessKeyId;\n    static std::string AccessKeySecret;\n    static std::string Endpoint;\n    static std::string DirToDownload;\n    static std::string FileToUpload;\n    static std::string FileDownloadTo;\n    static std::string BigFileToUpload;\n    static std::string ImageFileToUpload;\n\tstatic std::string CallbackServer;\n    static std::string CheckpointDir;\n    static std::string PublicKeyPath;\n    static std::string PrivateKeyPath;\n\n};\n\n"
  },
  {
    "path": "sample/src/LiveChannel/LiveChannelSample.cc",
    "content": "#include <iostream>\n#include <time.h>\n#include \"../Config.h\"\n#include \"LiveChannelSample.h\"\n\n#ifdef _WIN32\n#include <Windows.h>\n#else\n#include <unistd.h>\n#endif\n\nusing namespace AlibabaCloud::OSS; \n\nstatic void waitTimeinSec(int time)\n{\n#ifdef _WIN32\n    Sleep(time * 1000);\n#else\n    sleep(time);\n#endif\n}\n\nLiveChannelSample::LiveChannelSample(const std::string& bucket, const std::string& channelName):bucket_(bucket),channelName_(channelName),\n    timeStart_(0),timeEnd_(0),isSuccess_(false)\n{\n    ClientConfiguration conf;\n    client = new OssClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    //CreateBucketRequest request(bucket_);\n    //client->CreateBucket(request);\n}\n\nLiveChannelSample::~LiveChannelSample()\n{\n    if(nullptr != client)\n    {\n        delete client;\n        client = nullptr;\n    }\n}\n\nint LiveChannelSample::PutLiveChannel()\n{\n    PutLiveChannelRequest request(bucket_, channelName_, \"HLS\");\n    auto putOutcome = client->PutLiveChannel(request);\n    if(putOutcome.isSuccess())\n    {\n        isSuccess_ = true;\n        rtmpUrl_ = putOutcome.result().PublishUrl();\n        std::cout << \"rtmp publish url is \"+rtmpUrl_ << std::endl;\n        std::cout << \"rtmp play url is \" + putOutcome.result().PlayUrl() << std::endl;\n        return 0;\n    }\n    return -1;\n}\n\nint LiveChannelSample::GetLiveChannelInfo()\n{\n    isSuccess_ = false;\n    GetLiveChannelInfoRequest request(bucket_, channelName_);\n    auto getOutcome= client->GetLiveChannelInfo(request);\n    if(getOutcome.isSuccess())\n    {\n        isSuccess_ = true;\n        const GetLiveChannelInfoResult& result = getOutcome.result();\n        std::cout << \"LiveChannel Info :\" << std::endl;\n        std::cout << \"Description: \" << result.Description() << std::endl;\n        std::cout << \"Status: \" << result.Status() << std::endl;\n        std::cout << \"ChannelType: \" << result.Type() << std::endl;\n        std::cout << \"FragDuration: \" << result.FragDuration() << std::endl;\n        std::cout << \"FragCount: \" << result.FragCount() << std::endl;\n        std::cout << \"PlaylistName: \" << result.PlaylistName() << std::endl;\n        return 0;\n    }\n    return -1;\n}\n\nint LiveChannelSample::GetLiveChannelStat()\n{\n    isSuccess_ = false;\n    GetLiveChannelStatRequest request(bucket_, channelName_);\n    auto getOutcome = client->GetLiveChannelStat(request);\n    if(getOutcome.isSuccess())\n    {\n        isSuccess_ = true;\n        const GetLiveChannelStatResult& result = getOutcome.result();\n        // before push rtmp stream, the live channel is in Idle status\n        std::cout << \"LiveChannelStatus: \" << result.Status() << std::endl;\n        return 0;\n    }\n    return -1;\n}\n\nint LiveChannelSample::ListLiveChannel()\n{\n    isSuccess_ = false;\n    ListLiveChannelRequest request(bucket_);\n    auto listOutcome = client->ListLiveChannel(request);\n    if(listOutcome.isSuccess())\n    {\n        isSuccess_ = true;\n        const ListLiveChannelResult& result = listOutcome.result();\n        std::cout << \"ListLiveChannelResult: \" << std::endl;\n        std::cout << \"Prefix: \" << result.Prefix() << std::endl;\n        std::cout << \"Marker: \" << result.Marker() << std::endl;\n        std::cout << \"NextMarker: \" << result.NextMarker() << std::endl;\n        std::cout << \"IsTruncated: \" << result.IsTruncated() << std::endl;\n        std::cout << \"MaxKeys: \" << result.MaxKeys() << std::endl;\n        std::vector<LiveChannelInfo> vec = result.LiveChannelList();\n        for(std::size_t i=0; i<vec.size(); i++)\n        {\n            std::cout << \"   LiveChannelInfo: \" << std::endl;\n            std::cout << \"    Name: \" << vec[i].name << std::endl;\n            std::cout << \"    description: \" << vec[i].description << std::endl;\n            std::cout << \"    status: \" << vec[i].status << std::endl;\n            std::cout << \"    lastModified: \" << vec[i].lastModified << std::endl;\n            std::cout << \"    publishUrl: \" << vec[i].publishUrl << std::endl;\n            std::cout << \"    playUrl: \" << vec[i].playUrl << std::endl;\n        }\n        return 0;\n    }\n    return -1;\n}\n\nint LiveChannelSample::GetLiveChannelHistory()\n{\n    isSuccess_ = false;\n    int i = 0;\n    GetLiveChannelHistoryResult result;\n    \n    timeStart_ = time(NULL);\n    timeEnd_ = timeStart_ + 3600;\n    std::cout << \"timeStart: \" << timeStart_ << \" End: \" << timeEnd_ << std::endl;\n    time_t expireTime = timeEnd_;\n    GenerateRTMPSignedUrlRequest request(bucket_, channelName_, \"test_play_list.m3u8\", expireTime);\n    auto generateOutcome = client->GenerateRTMPSignedUrl(request);\n    if(!generateOutcome.isSuccess())\n    {\n        std::cout << \"GenerateRTMPSignedUrl fail\" <<std::endl;\n        return -1;\n    }else{\n        signedRTMPUrl_ = generateOutcome.result();\n        std::cout << \"GenerateRTMPSignedUrl success URL: \" << signedRTMPUrl_ << std::endl;\n    }\n\n    // use ffmpeg or some other tools to push rtmp stream asynchronizely to signed url\n    // we will wait 15 minutes at most\n\n    while(1)\n    {\n        if(i>MAX_LOOP_TIMES)\n            break;\n\n        auto getOutcome = client->GetLiveChannelHistory(GetLiveChannelHistoryRequest(bucket_, channelName_));\n        if(getOutcome.isSuccess())\n        {\n            std::vector<LiveRecord> vec = getOutcome.result().LiveRecordList();\n            if(vec.size() > 0)\n            {\n                isSuccess_ = true;\n                result = getOutcome.result();\n                std::cout << \"LiveRecordList size \" << vec.size() << std::endl;\n                for(size_t j=0; j <vec.size(); j++)\n                {\n                    std::cout << \"    LiveRecord: \" << std::endl;\n                    std::cout << \"       startTime: \" << vec[j].startTime << std::endl;\n                    std::cout << \"       endTime: \" << vec[j].endTime << std::endl;\n                    std::cout << \"       remoteAddr: \" << vec[j].remoteAddr << std::endl;\n                }\n                waitTimeinSec(30);\n                break;\n            }else{\n                std::cout << \"warning: LiveRecordList size is 0\" << std::endl;\n                waitTimeinSec(15);\n            }\n        }\n        i++;\n    }\n    return 0;\n}\n\nint LiveChannelSample::PostVodPlayList()\n{\n    isSuccess_ = false;\n    uint64_t startTime = time(NULL) - 3600;\n    uint64_t endTime = time(NULL) + 3600;\n    PostVodPlaylistRequest request(bucket_, channelName_, \"test_play_list.m3u8\", startTime, endTime);\n    auto postOutcome = client->PostVodPlaylist(request);\n    if(postOutcome.isSuccess())\n    {\n        isSuccess_ = true;\n        std::cout << \"PostVodPlayList Success \" << std::endl;\n    }\n    return 0;\n}\n\nint LiveChannelSample::GetVodPlayList()\n{\n    isSuccess_ = false;\n    uint64_t startTime = time(NULL) - 3600;\n    uint64_t endTime = time(NULL) + 3600;\n    GetVodPlaylistRequest request(bucket_, channelName_, startTime, endTime);\n    auto getOutcome = client->GetVodPlaylist(request);\n    \n    if(getOutcome.isSuccess())\n    {\n        isSuccess_ = true;\n        std::cout << \"GetVodPlayList Success \" << std::endl;\n        std::cout << \"GetVodPlaylist result \" << getOutcome.result().PlaylistContent() << std::endl;\n    }\n    return 0;\n}\nint LiveChannelSample::PutLiveChannelStatus()\n{\n    isSuccess_ = false;\n    PutLiveChannelStatusRequest request(bucket_, channelName_, LiveChannelStatus::DisabledStatus);\n    auto putOutcome = client->PutLiveChannelStatus(request);\n    if(putOutcome.isSuccess())\n    {\n        isSuccess_ = true;\n        std::cout << \"PutLiveChannelStatus Success \" << std::endl;\n    }\n    return 0;\n}\n\nint LiveChannelSample::DeleteLiveChannel()\n{\n    isSuccess_ = false;\n    DeleteLiveChannelRequest request(bucket_, channelName_);\n    auto deleteOutcome = client->DeleteLiveChannel(request);\n    if(deleteOutcome.isSuccess())\n    {\n        isSuccess_ = true;\n        std::cout << \"DeleteLiveChannelSuccess \" << std::endl;\n    }\n    return 0;\n}\n"
  },
  {
    "path": "sample/src/LiveChannel/LiveChannelSample.h",
    "content": "#include <iostream>\n#include <alibabacloud/oss/OssClient.h>\n\n#define MAX_LOOP_TIMES 60\n\nclass LiveChannelSample\n{\npublic:\n    LiveChannelSample(const std::string& bucket, const std::string& channeName);\n    ~LiveChannelSample();\n\n    int PutLiveChannel();\n    int GetLiveChannelInfo();\n    int GetLiveChannelStat();\n    int ListLiveChannel();\n    int GetLiveChannelHistory();\n    int PostVodPlayList();\n    int GetVodPlayList();\n    int PutLiveChannelStatus();\n    int DeleteLiveChannel();\nprivate:\n    AlibabaCloud::OSS::OssClient *client;\n    std::string bucket_;\n    std::string channelName_;\n    std::string rtmpUrl_;\n    std::string signedRTMPUrl_;\n    time_t timeStart_;\n    time_t timeEnd_;\n    bool isSuccess_;\n};\n"
  },
  {
    "path": "sample/src/Program.cc",
    "content": "#include <alibabacloud/oss/OssClient.h>\n#include <iostream>\n#include \"Config.h\"\n\n#if !defined(OSS_DISABLE_BUCKET)\r\n#include \"service/ServiceSample.h\"\n#include \"bucket/BucketSample.h\"\n#endif\n\n#include \"object/ObjectSample.h\"\n#include \"presignedurl/PresignedUrlSample.h\"\n\n#if !defined(OSS_DISABLE_LIVECHANNEL)\n#include \"LiveChannel/LiveChannelSample.h\"\n#endif\n\n#if !defined(OSS_DISABLE_ENCRYPTION)\n#include \"encryption/EncryptionSample.h\"\n#endif\n\nusing namespace AlibabaCloud::OSS;\n\nvoid LogCallbackFunc(LogLevel level, const std::string &stream)\n{\n    if (level == LogLevel::LogOff)\n        return;\n\n    std::cout << stream;\n}\n\nint main(void)\n{\n    std::cout << \"oss-cpp-sdk samples\" << std::endl;\n    std::string bucketName = \"<YourBucketName>\";\n\n    InitializeSdk();\n\n    SetLogLevel(LogLevel::LogDebug);\n    SetLogCallback(LogCallbackFunc);\n\n#if !defined(OSS_DISABLE_BUCKET)\r\n    ServiceSample serviceSample;\n    serviceSample.ListBuckets();\n    serviceSample.ListBucketsWithMarker();\n    serviceSample.ListBucketsWithPrefix();\n\n    BucketSample bucketSample(bucketName);\n    bucketSample.InvalidBucketName();\n    bucketSample.CreateAndDeleteBucket();\n    bucketSample.SetBucketAcl();\n    bucketSample.SetBucketLogging();\n    bucketSample.SetBucketWebsite();\n    bucketSample.SetBucketReferer();\n    bucketSample.SetBucketLifecycle();\n    bucketSample.SetBucketCors();\n    bucketSample.GetBucketCors();\n\n    bucketSample.DeleteBucketLogging();\n    bucketSample.DeleteBucketWebsite();\n    bucketSample.DeleteBucketLifecycle();\n    bucketSample.DeleteBucketCors();\n\n    bucketSample.GetBucketAcl();\n    bucketSample.GetBucketLocation();\n    bucketSample.GetBucketLogging();\n    bucketSample.GetBucketWebsite();\n    bucketSample.GetBucketReferer();\n    bucketSample.GetBucketStat();\n    bucketSample.GetBucketLifecycle();\n    //bucketSample.DeleteBucketsByPrefix();\n#endif\n\n    ObjectSample objectSample(bucketName);\n    objectSample.PutObjectFromBuffer();\n    objectSample.PutObjectFromFile();\n    objectSample.GetObjectToBuffer();\n    objectSample.GetObjectToFile();\n    objectSample.DeleteObject();\n    objectSample.DeleteObjects();\n    objectSample.HeadObject();\n    objectSample.GetObjectMeta();\n    objectSample.AppendObject();\n    objectSample.PutObjectProgress();\n    objectSample.GetObjectProgress();\n    objectSample.PutObjectCallable();\n    objectSample.GetObjectCallable();\n    objectSample.CopyObject();\n    //objectSample.RestoreArchiveObject(\"your-archive\", \"oss_archive_object.PNG\", 1);\n\n    objectSample.ListObjects();\n    objectSample.ListObjectWithMarker();\n    objectSample.ListObjectWithEncodeType();\n\n#if !defined(OSS_DISABLE_RESUAMABLE)\r\n    objectSample.UploadObjectProgress();\n    objectSample.MultiCopyObjectProcess();\n    objectSample.DownloadObjectProcess();\n#endif\n\n    PresignedUrlSample signedUrlSample(bucketName);\n    signedUrlSample.GenGetPresignedUrl();\n    signedUrlSample.PutObjectByUrlFromBuffer();\n    signedUrlSample.PutObjectByUrlFromFile();\n    signedUrlSample.GetObjectByUrlToBuffer();\n    signedUrlSample.GetObjectByUrlToFile();\n\n\n#if !defined(OSS_DISABLE_LIVECHANNEL)\r\n    // LiveChannel\n    LiveChannelSample liveChannelSample(bucketName, \"test_channel\");\n    liveChannelSample.PutLiveChannel();\n    liveChannelSample.GetLiveChannelInfo();\n    liveChannelSample.GetLiveChannelStat();\n    liveChannelSample.ListLiveChannel();\n    liveChannelSample.GetLiveChannelHistory();\n    liveChannelSample.PostVodPlayList();\n    liveChannelSample.GetVodPlayList();\n    liveChannelSample.PutLiveChannelStatus();\n    liveChannelSample.DeleteLiveChannel();\n#endif\n\n#if !defined(OSS_DISABLE_ENCRYPTION)\n    // Encryption\n    EncryptionSample encryptionSample(bucketName);\n    encryptionSample.PutObjectFromBuffer();\n    encryptionSample.PutObjectFromFile();\n    encryptionSample.GetObjectToBuffer();\n    encryptionSample.GetObjectToFile();\n#if !defined(DISABLE_RESUAMABLE)\r\n    encryptionSample.UploadObjectProgress();\n    encryptionSample.DownloadObjectProcess();\n    encryptionSample.MultipartUploadObject();\n#endif\n#endif\n\n    ShutdownSdk();\n    return 0;\n}\n"
  },
  {
    "path": "sample/src/bucket/BucketSample.cc",
    "content": "#include <iostream>\r\n#include \"../Config.h\"\r\n#include \"BucketSample.h\"\r\n#ifdef _WIN32\r\n#include <Windows.h>\r\n#else\r\n#include <unistd.h>\r\n#endif\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nstatic void waitTimeinSec(int time)\r\n{\r\n#ifdef _WIN32\r\n    Sleep(time * 1000);\r\n#else\r\n    sleep(time);\r\n#endif\r\n}\r\n\r\nBucketSample::BucketSample(const std::string &bucket):\r\n    bucket_(bucket)\r\n{\r\n    ClientConfiguration conf;\r\n    client = new OssClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n    CreateBucketRequest request(bucket_);\r\n    client->CreateBucket(request);\r\n}\r\n\r\nBucketSample::~BucketSample() {\r\n    delete client;\r\n}\r\n\r\nvoid BucketSample::PrintError(const std::string &funcName, const OssError &error)\r\n{\r\n    std::cout << funcName << \" fail\" <<\r\n        \",code:\" << error.Code() <<\r\n        \",message:\" << error.Message() <<\r\n        \",request_id:\" << error.RequestId() << std::endl;\r\n}\r\n\r\nvoid BucketSample::InvalidBucketName()\r\n{\r\n    SetBucketAclRequest request(\"invalid-BucketName\", CannedAccessControlList::Private);\r\n    auto outcome = client->SetBucketAcl(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" to private success \" << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n\r\n    SetBucketLoggingRequest log_request(\"invalid-BucketName\", bucket_, \"LogPrefix\");\r\n    auto log_outcome = client->SetBucketLogging(log_request);\r\n    if (log_outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success \" << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, log_outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::CreateAndDeleteBucket()\r\n{\r\n    std::string bucket = bucket_ + \"-createbucketsample\";\r\n    CreateBucketRequest request(bucket, StorageClass::IA, CannedAccessControlList::PublicReadWrite);\r\n    auto outcome = client->CreateBucket(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" create bucket success \" << std::endl;\r\n    } else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n\r\n    DeleteBucketRequest drequest(bucket);\r\n    auto doutcome = client->DeleteBucket(drequest);\r\n    if (doutcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" delete bucket success \" << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, doutcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::SetBucketAcl()\r\n{\r\n    SetBucketAclRequest request(bucket_, CannedAccessControlList::Private);\r\n    auto outcome = client->SetBucketAcl(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" to private success \" << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n\r\n    request.setAcl(CannedAccessControlList::PublicReadWrite);\r\n    auto outcome1 = client->SetBucketAcl(request);\r\n    if (outcome1.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" to public-read-write success \" << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome1.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::SetBucketLogging()\r\n{\r\n    SetBucketLoggingRequest request(bucket_, bucket_, \"LogPrefix\");\r\n    auto outcome = client->SetBucketLogging(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, request_id:\" << outcome.result().RequestId().c_str() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::SetBucketWebsite()\r\n{\r\n    SetBucketWebsiteRequest request(bucket_);\r\n    request.setIndexDocument(\"index.html\");\r\n    request.setIndexDocument(\"error.html\");\r\n    auto outcome = client->SetBucketWebsite(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, request_id:\" << outcome.result().RequestId() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::SetBucketReferer()\r\n{\r\n    SetBucketRefererRequest request(bucket_);\r\n    request.addReferer(\"http://www.referersample.com\");\r\n    request.addReferer(\"https://www.referersample.com\");\r\n    request.addReferer(\"https://www.?.referersample.com\");\r\n    request.addReferer(\"https://www.*.cn\");\r\n    auto outcome = client->SetBucketReferer(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, request_id:\" << outcome.result().RequestId() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::SetBucketLifecycle()\r\n{\r\n    SetBucketLifecycleRequest request(bucket_);\r\n    std::string date(\"2022 - 10 - 12T00:00 : 00.000Z\");\r\n    \r\n    auto rule1 = LifecycleRule();\r\n    rule1.setID(\"rule1\");\r\n    rule1.setPrefix(\"test/\");\r\n    rule1.setStatus(RuleStatus::Enabled);\r\n    rule1.setExpiration(3);\r\n    \r\n    auto rule2 = LifecycleRule();\r\n    rule2.setID(\"rule2\");\r\n    rule2.setPrefix(\"test/\");\r\n    rule2.setStatus(RuleStatus::Disabled);\r\n    rule2.setExpiration(date);\r\n    \r\n    auto rule3 = LifecycleRule();\r\n    rule3.setID(\"rule3\");\r\n    rule3.setPrefix(\"test1/\");\r\n    rule3.setStatus(RuleStatus::Enabled);\r\n    rule3.setAbortMultipartUpload(3);\r\n    \r\n    auto rule4 = LifecycleRule();\r\n    rule4.setID(\"rule4\");\r\n    rule4.setPrefix(\"test1/\");\r\n    rule4.setStatus(RuleStatus::Enabled);\r\n    rule4.setAbortMultipartUpload(date);\r\n    \r\n    LifecycleRuleList list{rule1, rule2, rule3, rule4};\r\n    request.setLifecycleRules(list);\r\n    auto outcome = client->SetBucketLifecycle(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, request_id:\" << outcome.result().RequestId() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::SetBucketCors()\r\n{\r\n    SetBucketCorsRequest request(bucket_);\r\n    auto rule1 = CORSRule();\r\n    // Note: AllowedOrigin & AllowdMethod must not be empty.\r\n    rule1.addAllowedOrigin(\"http://www.a.com\");\r\n    rule1.addAllowedMethod(\"POST\");\r\n    rule1.addAllowedHeader(\"*\");\r\n    rule1.addExposeHeader(\"x-oss-test\");\r\n    request.addCORSRule(rule1);\r\n    \r\n    auto rule2 = CORSRule();\r\n    rule2.addAllowedOrigin(\"http://www.b.com\");\r\n    rule2.addAllowedMethod(\"GET\");\r\n    rule2.addExposeHeader(\"x-oss-test2\");\r\n    rule2.setMaxAgeSeconds(100);\r\n    request.addCORSRule(rule2);\r\n    \r\n    auto outcome = client->SetBucketCors(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, request_id:\" << outcome.result().RequestId() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::DeleteBucketLogging()\r\n{\r\n    DeleteBucketLoggingRequest request(bucket_);\r\n    auto outcome = client->DeleteBucketLogging(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, request_id:\" << outcome.result().RequestId() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::DeleteBucketWebsite()\r\n{\r\n    DeleteBucketWebsiteRequest request(bucket_);\r\n    auto outcome = client->DeleteBucketWebsite(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, request_id:\" << outcome.result().RequestId() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::DeleteBucketLifecycle()\r\n{\r\n    DeleteBucketLifecycleRequest request(bucket_);\r\n    auto outcome = client->DeleteBucketLifecycle(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, request_id:\" << outcome.result().RequestId() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::DeleteBucketCors()\r\n{\r\n    auto outcome = client->DeleteBucketCors(bucket_);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, request_id:\" << outcome.result().RequestId() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::GetBucketAcl()\r\n{\r\n    GetBucketAclRequest request(bucket_);\r\n    auto outcome = client->GetBucketAcl(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, ori acl: \" << outcome.result().Acl() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n\r\n    SetBucketAclRequest request1(bucket_, CannedAccessControlList::PublicRead);\r\n    client->SetBucketAcl(request1);\r\n    waitTimeinSec(1);\r\n\r\n    outcome = client->GetBucketAcl(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, after set public-read, acl:\" << outcome.result().Acl() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::GetBucketLocation()\r\n{\r\n    GetBucketLocationRequest request(bucket_);\r\n    auto outcome = client->GetBucketLocation(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, location: \" << outcome.result().Location() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n\r\n    outcome = client->GetBucketLocation(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, location: \" << outcome.result().Location() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::GetBucketLogging()\r\n{\r\n    GetBucketLoggingRequest request(bucket_);\r\n    auto outcome = client->GetBucketLogging(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, default TargetBucket: \" << outcome.result().TargetBucket() << \r\n            \",TargetPrefix: \" << outcome.result().TargetPrefix() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n\r\n    SetBucketLoggingRequest request1(bucket_, bucket_, \"LogPrefix-00\");\r\n    client->SetBucketLogging(request1);\r\n    waitTimeinSec(1);\r\n\r\n    outcome = client->GetBucketLogging(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, after set itself with LogPrefix-00 , TargetBucket: \" << outcome.result().TargetBucket() <<\r\n            \" ,TargetPrefix: \" << outcome.result().TargetPrefix() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n\r\n    std::string bucket_01 = bucket_ + \"01\";\r\n    CreateBucketRequest request0(bucket_01);\r\n    client->CreateBucket(request0);\r\n\r\n    SetBucketLoggingRequest request2(bucket_, bucket_01, \"LogPrefix-01\");\r\n    client->SetBucketLogging(request2);\r\n    waitTimeinSec(1);\r\n\r\n    outcome = client->GetBucketLogging(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, after set other with LogPrefix-01 TargetBucket: \" << outcome.result().TargetBucket() <<\r\n            \" ,TargetPrefix: \" << outcome.result().TargetPrefix() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::GetBucketWebsite()\r\n{\r\n    GetBucketWebsiteRequest request(bucket_);\r\n    auto outcome = client->GetBucketWebsite(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, default, IndexDocument: \" << outcome.result().IndexDocument() <<\r\n            \" ,ErrorDocument: \" << outcome.result().ErrorDocument() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n\r\n    SetBucketWebsiteRequest request0(bucket_);\r\n    request0.setIndexDocument(\"index.html\");\r\n    client->SetBucketWebsite(request0);\r\n    waitTimeinSec(15);\r\n\r\n    outcome = client->GetBucketWebsite(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, after set index.html, IndexDocument: \" << outcome.result().IndexDocument() <<\r\n            \" ,ErrorDocument: \" << outcome.result().ErrorDocument() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n\r\n    request0.setIndexDocument(\"index1.html\");\r\n    request0.setErrorDocument(\"error1.html\");\r\n    client->SetBucketWebsite(request0);\r\n    waitTimeinSec(15);\r\n\r\n    outcome = client->GetBucketWebsite(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, after set index1.html, error1.html,IndexDocument: \" << outcome.result().IndexDocument() <<\r\n            \" ,ErrorDocument: \" << outcome.result().ErrorDocument() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::GetBucketReferer()\r\n{\r\n    GetBucketRefererRequest request(bucket_);\r\n    auto outcome = client->GetBucketReferer(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, deffault AllowEmptyReferer: \" << outcome.result().AllowEmptyReferer() <<\r\n            \" ,Referer size: \" << outcome.result().RefererList().size() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n\r\n    SetBucketRefererRequest request0(bucket_);\r\n    request0.addReferer(\"http://www.referersample.com\");\r\n    request0.addReferer(\"https://www.referersample.com\");\r\n    request0.addReferer(\"https://www.?.referersample.com\");\r\n    request0.addReferer(\"https://www.*.cn\");\r\n    client->SetBucketReferer(request0);\r\n    waitTimeinSec(15);\r\n\r\n    outcome = client->GetBucketReferer(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, after set 4 refer, AllowEmptyReferer: \" << outcome.result().AllowEmptyReferer() <<\r\n            \" ,Referer size: \" << outcome.result().RefererList().size() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n\r\n\r\n    request0.clearRefererList();\r\n    request0.addReferer(\"https://www.?.referersample.com\");\r\n    request0.addReferer(\"https://www.*.cn\");\r\n    client->SetBucketReferer(request0);\r\n    waitTimeinSec(15);\r\n\r\n    outcome = client->GetBucketReferer(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, after set 2 refer, AllowEmptyReferer: \" << outcome.result().AllowEmptyReferer() <<\r\n            \" ,Referer size: \" << outcome.result().RefererList().size() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::GetBucketLifecycle()\r\n{\r\n    auto outcome = client->GetBucketLifecycle(bucket_);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, rule size:%d, rules:\" << std::endl;\r\n        for (auto const& rule : outcome.result().LifecycleRules()) {\r\n            std::cout << \"rule:\" << rule.ID() << \",\" << rule.Prefix() << \",\" << rule.Status() << \",\"\r\n                \"hasExpiration:\" << rule.hasExpiration() << \",\" <<\r\n                \"hasTransitionList:\" << rule.hasTransitionList() << \",\" <<\r\n                \"hasAbortMultipartUpload:\" << rule.hasAbortMultipartUpload() << std::endl;\r\n        }\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::GetBucketStat()\r\n{\r\n    GetBucketStatRequest request(bucket_);\r\n    auto outcome = client->GetBucketStat(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success, storage: \" << outcome.result().Storage() <<\r\n            \" ,ObjectCount: \" << outcome.result().ObjectCount() << \r\n            \" ,MultipartUploadCount:\" << outcome.result().MultipartUploadCount() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::GetBucketCors()\r\n{\r\n    auto outcome = client->GetBucketCors(bucket_);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success\" << std::endl;\r\n        for (auto const& rule : outcome.result().CORSRules()) {\r\n            std::cout << \"Get Bucket Cors List:\" << std::endl;\r\n            for (auto const& origin : rule.AllowedOrigins()) {\r\n                std::cout << \"Allowed origin:\" << origin << std::endl;\r\n            }\r\n        }\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid BucketSample::CleanAndDeleteBucket(const std::string &bucket)\r\n{\r\n    if (!client->DoesBucketExist(bucket))\r\n        return;\r\n\r\n    //versioning\r\n    auto infoOutcome = client->GetBucketInfo(bucket);\r\n    if (infoOutcome.isSuccess() && infoOutcome.result().VersioningStatus() != VersioningStatus::NotSet) {\r\n        //list objects by ListObjectVersions  and delete object with versionId\r\n        ListObjectVersionsRequest request(bucket);\r\n        bool IsTruncated = false;\r\n        do {\r\n            auto outcome = client->ListObjectVersions(request);\r\n            if (outcome.isSuccess()) {\r\n                for (auto const &marker : outcome.result().DeleteMarkerSummarys()) {\r\n                    client->DeleteObject(DeleteObjectRequest(bucket, marker.Key(), marker.VersionId()));\r\n                }\r\n\r\n                for (auto const &obj : outcome.result().ObjectVersionSummarys()) {\r\n                    client->DeleteObject(DeleteObjectRequest(bucket, obj.Key(), obj.VersionId()));\r\n                }\r\n            }\r\n            else {\r\n                break;\r\n            }\r\n            request.setKeyMarker(outcome.result().NextKeyMarker());\r\n            request.setVersionIdMarker(outcome.result().NextVersionIdMarker());\r\n\r\n            IsTruncated = outcome.result().IsTruncated();\r\n        } while (IsTruncated);\r\n    }\r\n\r\n    //abort in progress multipart uploading\r\n    auto listOutcome = client->ListMultipartUploads(ListMultipartUploadsRequest(bucket));\r\n    if (listOutcome.isSuccess()) {\r\n        for (auto const &upload : listOutcome.result().MultipartUploadList())\r\n        {\r\n            client->AbortMultipartUpload(AbortMultipartUploadRequest(bucket, upload.Key, upload.UploadId));\r\n        }\r\n    }\r\n\r\n    //List And Delete Object\r\n    ListObjectsRequest request(bucket);\r\n    bool IsTruncated = false;\r\n    do {\r\n        auto outcome = client->ListObjects(request);\r\n        if (outcome.isSuccess()) {\r\n            for (auto const &obj : outcome.result().ObjectSummarys()) {\r\n                auto dOutcome = client->DeleteObject(DeleteObjectRequest(bucket, obj.Key()));\r\n                std::cout << __FUNCTION__ << \"Delete Object:\" << obj.Key() << \r\n                    \", result:\" << dOutcome.isSuccess() << std::endl;\r\n            }\r\n        }\r\n        else {\r\n            PrintError(__FUNCTION__, outcome.error());\r\n            break;\r\n        }\r\n        request.setMarker(outcome.result().NextMarker());\r\n        IsTruncated = outcome.result().IsTruncated();\r\n    } while (IsTruncated);\r\n\r\n    // Delete the bucket.\r\n    client->DeleteBucket(DeleteBucketRequest(bucket));\r\n    std::cout << __FUNCTION__ << \" done\" << std::endl;\r\n}\r\n\r\nvoid BucketSample::DeleteBucketsByPrefix()\r\n{\r\n    std::string prefix = \"cpp-sdk-\";\r\n    ListBucketsRequest request;\r\n    request.setPrefix(prefix);\r\n    auto outcome = client->ListBuckets(request);\r\n    if (!outcome.isSuccess()) {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n        return;\r\n    }\r\n\r\n    for (auto const &bucket : outcome.result().Buckets()) \r\n    {\r\n        CleanAndDeleteBucket(bucket.Name());\r\n    }\r\n\r\n    std::cout << __FUNCTION__ << \" done, and total is \" << outcome.result().Buckets().size() << std::endl;\r\n}\r\n\r\nvoid BucketSample::DoesBucketExist()\r\n{\r\n    auto outcome = client->DoesBucketExist(bucket_);\r\n    std::cout << __FUNCTION__ << \" success, Bucket exist ? \" << outcome << std::endl;\r\n}"
  },
  {
    "path": "sample/src/bucket/BucketSample.h",
    "content": "#include <alibabacloud/oss/OssClient.h>\r\n\r\nclass BucketSample\r\n{\r\npublic:\r\n    BucketSample(const std::string &bucket);\r\n    ~BucketSample();\r\n\r\n    void DoesBucketExist();\r\n\r\n    void InvalidBucketName();\r\n    void CreateAndDeleteBucket();\r\n    void SetBucketAcl();\r\n    void SetBucketLogging();\r\n    void SetBucketWebsite();\r\n    void SetBucketReferer();\r\n    void SetBucketLifecycle();\r\n    void SetBucketCors();\r\n\r\n    void DeleteBucketLogging();\r\n    void DeleteBucketWebsite();\r\n    void DeleteBucketLifecycle();\r\n    void DeleteBucketCors();\r\n\r\n    void GetBucketAcl();\r\n    void GetBucketLocation();\r\n    void GetBucketLogging();\r\n    void GetBucketWebsite();\r\n    void GetBucketReferer();\r\n    void GetBucketLifecycle();\r\n    void GetBucketStat();\r\n    void GetBucketCors();\r\n\r\n    void CleanAndDeleteBucket(const std::string &bucket);\r\n    void DeleteBucketsByPrefix();\r\n\r\nprivate:\r\n    void PrintError(const std::string &funcName, const AlibabaCloud::OSS::OssError &error);\r\n    AlibabaCloud::OSS::OssClient *client;\r\n    std::string bucket_;\r\n};\r\n"
  },
  {
    "path": "sample/src/encryption/EncryptionSample.cc",
    "content": "#include <iostream>\n#include \"../Config.h\"\n#include \"EncryptionSample.h\"\n#include <alibabacloud/oss/Const.h>\n#include <memory>\n#include <sstream>\n#include <fstream>\n#include <algorithm>\n\nusing namespace AlibabaCloud::OSS;\n\nstatic int64_t getFileSize(const std::string& file)\n{\n    std::fstream f(file, std::ios::in | std::ios::binary);\n    f.seekg(0, f.end);\n    int64_t size = f.tellg();\n    f.close();\n    return size;\n}\n\nstatic std::string readFromFile(const std::string& file)\n{\n    std::fstream f(file, std::ios::in | std::ios::binary);\n    std::stringstream ss;\n    ss << f.rdbuf();\n    return ss.str();\n}\n\nEncryptionSample::EncryptionSample(const std::string &bucket) :\n    bucket_(bucket)\n{\n    std::string publicKey = readFromFile(Config::PublicKeyPath);\n    std::string privateKey = readFromFile(Config::PrivateKeyPath);\n    ClientConfiguration conf;\n    CryptoConfiguration cryptoConf;\n    auto materials = std::make_shared<SimpleRSAEncryptionMaterials>(publicKey, privateKey);\r\n    client = new OssEncryptionClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, \n        conf, materials, cryptoConf);\n    //CreateBucketRequest request(bucket_);\n}\n\nEncryptionSample::~EncryptionSample() {\n    delete client;\n}\n\nvoid EncryptionSample::PrintError(const std::string &funcName, const OssError &error)\n{\n    std::cout << funcName << \" fail\" <<\n        \",code:\" << error.Code() <<\n        \",message:\" << error.Message() <<\n        \",request_id:\" << error.RequestId() << std::endl;\n}\n\nvoid EncryptionSample::PutObjectFromBuffer()\n{\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << __FUNCTION__;\n    PutObjectRequest request(bucket_, \"PutObjectFromBuffer\", content);\n    auto outcome = client->PutObject(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nvoid EncryptionSample::PutObjectFromFile()\n{\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(Config::FileToUpload, std::ios::in | std::ios::binary);\n    PutObjectRequest request(bucket_, \"PutObjectFromFile\", content);\n    auto outcome = client->PutObject(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nvoid EncryptionSample::GetObjectToBuffer()\n{\n    GetObjectRequest request(bucket_, \"PutObjectFromBuffer\");\n    auto outcome = client->GetObject(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, Content-Length:\" << outcome.result().Metadata().ContentLength() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nvoid EncryptionSample::GetObjectToFile()\n{\n    GetObjectRequest request(bucket_, \"PutObjectFromFile\");\n    request.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(\"GetObjectToFile\", std::ios_base::out | std::ios_base::in | std::ios_base::trunc| std::ios_base::binary); });\n    auto outcome = client->GetObject(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success\" << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nstatic void ProgressCallback(size_t increment, int64_t transfered, int64_t total, void* userData)\n{\n    std::cout << \"ProgressCallback[\" << userData << \"] => \" <<\n                 increment <<\" ,\" << transfered << \",\" << total << std::endl;\n}\n\n#if !defined(DISABLE_RESUAMABLE)\r\nvoid EncryptionSample::UploadObjectProgress()\n{\n    //case 1: checkpoint dir is not enabled\n    {\n        UploadObjectRequest request(bucket_, \"UploadObjectProgress\", Config::FileToUpload);\n\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableUploadObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n\n    //case 2: checkpoint dir is enabled\n    {\n        UploadObjectRequest request(bucket_, \"UploadObjectProgress\", Config::FileToUpload, Config::CheckpointDir);\n  \n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableUploadObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n\n    //case 3: checkpoint dir, multi threads is enabled\n    {\n        UploadObjectRequest request(bucket_, \"UploadObjectProgress\", Config::FileToUpload, Config::CheckpointDir, DefaultPartSize, 4);\n\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableUploadObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n}\n\nvoid EncryptionSample::DownloadObjectProcess()\n{\n    //case 1: no checkpoint dir is coinfig\n    {\n        DownloadObjectRequest request(bucket_, \"DownloadObjectProgress\", Config::FileDownloadTo);\n\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableDownloadObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().Metadata().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n\n    //case 2: checkpoint dir is config\n    {\n        DownloadObjectRequest request(bucket_, \"DownloadObjectProgress\", Config::FileDownloadTo, Config::CheckpointDir);\n\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableDownloadObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().Metadata().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n\n    //case 3: checkpoint dir is config, multi threads is config\n    {\n        DownloadObjectRequest request(bucket_, \"DownloadObjectProgress\", Config::FileDownloadTo, Config::CheckpointDir, DefaultPartSize, 4);\n\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableDownloadObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().Metadata().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n}\n#endif\n\nvoid EncryptionSample::MultipartUploadObject()\n{\n    std::string fileToUpload = Config::BigFileToUpload;\n    std::string key = \"MultipartUploadObject\";\n    auto fileSize = getFileSize(fileToUpload);\n    \n    //must be 16 bytes alignment\n    int64_t partSize = 100 * 1024;\n\n    MultipartUploadCryptoContext cryptoCtx;\n    cryptoCtx.setPartSize(partSize);\n    cryptoCtx.setDataSize(fileSize);\n\n    InitiateMultipartUploadRequest initUploadRequest(bucket_, key);\n    auto uploadIdResult = client->InitiateMultipartUpload(initUploadRequest, cryptoCtx);\n    auto uploadId = uploadIdResult.result().UploadId();\n    PartList partETagList;\n\n    int partCount = static_cast<int>(fileSize / partSize);\n    // Calculate how many parts to be divided\n    if (fileSize % partSize != 0) {\n        partCount++;\n    }\n\n    // Upload multiparts to bucket\n    for (int i = 1; i <= partCount; i++) {\n        auto skipBytes = partSize * (i - 1);\n        auto size = (partSize < fileSize - skipBytes) ? partSize : (fileSize - skipBytes);\n        std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(fileToUpload, std::ios::in|std::ios::binary);\n        content->seekg(skipBytes, std::ios::beg);\n\t\t\n        UploadPartRequest uploadPartRequest(bucket_, key, content);\n        uploadPartRequest.setContentLength(size);\n        uploadPartRequest.setUploadId(uploadId);\n        uploadPartRequest.setPartNumber(i);\n        auto uploadPartOutcome = client->UploadPart(uploadPartRequest, cryptoCtx);\n        if (uploadPartOutcome.isSuccess()) {\n            Part part(i, uploadPartOutcome.result().ETag());\n            partETagList.push_back(part);\n        }\n        else {\n            PrintError(__FUNCTION__, uploadPartOutcome.error());\n        }\n    }\n\n    // Complete to upload multiparts\n    CompleteMultipartUploadRequest request(bucket_, key);\n    request.setUploadId(uploadId);\n    request.setPartList(partETagList);\n    auto outcome = client->CompleteMultipartUpload(request, cryptoCtx);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, UploadID : \" << uploadId << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n"
  },
  {
    "path": "sample/src/encryption/EncryptionSample.h",
    "content": "#include <alibabacloud/oss/OssEncryptionClient.h>\r\n\r\nclass EncryptionSample\r\n{\r\npublic:\r\n    EncryptionSample(const std::string &bucket);\r\n    ~EncryptionSample();\r\n \r\n    void PutObjectFromBuffer();\r\n    void PutObjectFromFile();\r\n    void GetObjectToBuffer();\r\n    void GetObjectToFile();\r\n    void MultipartUploadObject();\r\n\r\n#if !defined(OSS_DISABLE_RESUAMABLE)\r\n    void UploadObjectProgress();\r\n    void DownloadObjectProcess();\r\n#endif\r\n\r\nprivate:\r\n    void PrintError(const std::string &funcName, const AlibabaCloud::OSS::OssError &error);\r\n    AlibabaCloud::OSS::OssEncryptionClient *client;\r\n    std::string bucket_;\r\n};\r\n"
  },
  {
    "path": "sample/src/object/ObjectSample.cc",
    "content": "#include <iostream>\n#include \"../Config.h\"\n#include \"ObjectSample.h\"\n#include <alibabacloud/oss/Const.h>\n#include <memory>\n#include <sstream>\n#include <fstream>\n#include <algorithm>\n\n\nstatic void waitTimeinSec(int time)\n{\n    std::this_thread::sleep_for(std::chrono::seconds(time));\n}\n\nstatic int64_t getFileSize(const std::string& file)\n{\n    std::fstream f(file, std::ios::in | std::ios::binary);\n    f.seekg(0, f.end);\n    int64_t size = f.tellg();\n    f.close();\n    return size;\n}\n\nusing namespace AlibabaCloud::OSS;\n\nObjectSample::ObjectSample(const std::string &bucket) :\n    bucket_(bucket)\n{\n    ClientConfiguration conf;\n    client = new OssClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    //CreateBucketRequest request(bucket_);\n    //client->CreateBucket(request);\n}\n\nObjectSample::~ObjectSample() {\n    delete client;\n}\n\nvoid ObjectSample::PrintError(const std::string &funcName, const OssError &error)\n{\n    std::cout << funcName << \" fail\" <<\n        \",code:\" << error.Code() <<\n        \",message:\" << error.Message() <<\n        \",request_id:\" << error.RequestId() << std::endl;\n}\n\nvoid ObjectSample::DoesObjectExist()\n{\n    auto outcome = client->DoesObjectExist(bucket_, \"DoesObjectExist\");\n    std::cout << __FUNCTION__ << \" success, Object exist ? \" << outcome << std::endl;\n}\n\nvoid ObjectSample::PutFolder()\n{\n    const std::string key(\"yourfolder/\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    auto outcome = client->PutObject(bucket_, key, content);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, dir : \" << key << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nvoid ObjectSample::PutObjectFromBuffer()\n{\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << __FUNCTION__;\n    PutObjectRequest request(bucket_, \"PutObjectFromBuffer\", content);\n    auto outcome = client->PutObject(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nvoid ObjectSample::PutObjectFromFile()\n{\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(__FILE__, std::ios::in | std::ios::binary);\n    PutObjectRequest request(bucket_, \"PutObjectFromFile\", content);\n    auto outcome = client->PutObject(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nvoid ObjectSample::GetObjectToBuffer()\n{\n    GetObjectRequest request(bucket_, \"PutObjectFromBuffer\");\n    auto outcome = client->GetObject(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, Content-Length:\" << outcome.result().Metadata().ContentLength() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nvoid ObjectSample::GetObjectToFile()\n{\n    GetObjectRequest request(bucket_, \"PutObjectFromFile\");\n    request.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(\"GetObjectToFile.txt\", std::ios_base::out | std::ios_base::in | std::ios_base::trunc| std::ios_base::binary); });\n    auto outcome = client->GetObject(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success\" << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nvoid ObjectSample::DeleteObject()\n{\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    PutObjectRequest request(bucket_, \"DeleteObject\", content);\n    auto outcome = client->PutObject(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, Put Object ETag:\" << outcome.result().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n\n    GetObjectRequest getRequest(bucket_, \"DeleteObject\");\n    auto getOutcome = client->GetObject(getRequest);\n    if (getOutcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, Get Object ETag:\" << getOutcome.result().Metadata().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, getOutcome.error());\n    }\n\n    DeleteObjectRequest delRequest(bucket_, \"DeleteObject\");\n    auto delOutcome = client->DeleteObject(delRequest);\n    if (delOutcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, Del Object\" << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, delOutcome.error());\n    }\n\n    getOutcome = client->GetObject(getRequest);\n    if (getOutcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, ReGet Object ETag:\" << getOutcome.result().Metadata().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, getOutcome.error());\n    }\n}\n\nvoid ObjectSample::DeleteObjects()\n{\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << __FUNCTION__;\n    PutObjectRequest request(bucket_, \"\", content);\n    for (int i = 0; i < 10; i++) {\n        std::string key(\"DeleteObjects-\");\n        key.append(std::to_string(i)).append(\".txt\");\n        request.setKey(key);\n        auto outcome = client->PutObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \" success, Gen Object:\" << key << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n\n    DeleteObjectsRequest delRequest(bucket_);\n    for (int i = 0; i < 5; i++) {\n        std::string key(\"DeleteObjects-\");\n        key.append(std::to_string(i)).append(\".txt\");\n        delRequest.addKey(key);\n    }\n    auto outcome = client->DeleteObjects(delRequest);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, no quiet mode, Deleted Object count:\" << outcome.result().keyList().size() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n\n    delRequest.clearKeyList();\n    delRequest.setQuiet(true);\n    for (int i = 5; i < 10; i++) {\n        std::string key(\"DeleteObjects-\");\n        key.append(std::to_string(i)).append(\".txt\");\n        delRequest.addKey(key);\n    }\n    outcome = client->DeleteObjects(delRequest);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, quiet mode\" << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nvoid ObjectSample::HeadObject()\n{\n    // uploads the file\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << \"Thank you for using Aliyun Object Storage Service!\";\n    client->PutObject(bucket_, \"HeadObject\", content);\n\n    auto outcome = client->HeadObject(bucket_, \"HeadObject\");\n    if (outcome.isSuccess()) {\n        auto headMeta = outcome.result();\n        std::cout << __FUNCTION__ << \" success, ContentType:\" \n            << headMeta.ContentType() << \"; ContentLength:\" << headMeta.ContentLength() \n            << \"; CacheControl:\" << headMeta.CacheControl() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n\n    // delete the object\n    client->DeleteObject(bucket_, \"HeadObject\");\n}\n\nvoid ObjectSample::GetObjectMeta()\n{\n    auto meta = ObjectMetaData();\n    // sets the content type.\n    meta.setContentType(\"text/plain\");\n    // sets the cache control\n    meta.setCacheControl(\"max-age=3\");\n    // sets the custom metadata.\n    meta.UserMetaData()[\"meta\"] = \"meta-value\";\n\n    // uploads the file\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << \"Thank you for using Aliyun Object Storage Service!\";\n    client->PutObject(bucket_, \"GetObjectMeta\", content);\n    \n    // get the object meta information\n    auto outcome = client->GetObjectMeta(bucket_, \"GetObjectMeta\");\n    if (outcome.isSuccess()) {\n        auto metadata = outcome.result();\n        std::cout << __FUNCTION__ << \" success, ETag:\" << metadata.ETag() << \"; LastModified:\" \n            << metadata.LastModified() << \"; Size:\" << metadata.ContentLength() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n\n    // delete the object\n    client->DeleteObject(bucket_, \"GetObjectMeta\");\n}\n\nvoid ObjectSample::AppendObject()\n{\n    auto meta = ObjectMetaData();\n    meta.setContentType(\"text/plain\");\n    std::string key(\"AppendObject\");\n    \n    // Append an object from buffer, keep in mind that position should be set to zero at first time.\n    std::shared_ptr<std::iostream> content1 = std::make_shared<std::stringstream>();\n    *content1 << __FUNCTION__;\n    AppendObjectRequest request(bucket_, key, content1, meta);\n    request.setPosition(0L);\n    auto result = client->AppendObject(request);\n    \n    // Continue to append the object from file descriptor at last position\n    std::shared_ptr<std::iostream> content2 = std::make_shared<std::stringstream>();\n    *content2 << __FUNCTION__;\n    auto position = result.result().Length();\n    AppendObjectRequest appendObjectRequest(bucket_, key, content2);\n    appendObjectRequest.setPosition(position);\n    auto outcome = client->AppendObject(appendObjectRequest);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, CRC64:\" << outcome.result().CRC64() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n\n    // View object content\n    auto object = client->GetObject(bucket_, key);\n    if (object.isSuccess()) {\n        char ch[100];\n        *(object.result().Content()) >> ch;\n        std::string str = ch;\n        std::cout << \"AppendObject Content:\" << str << std::endl;\n    }\n    // Delete the appendable object\n    client->DeleteObject(bucket_, key);\n}\n\nstatic void ProgressCallback(size_t increment, int64_t transfered, int64_t total, void* userData)\n{\n    std::cout << \"ProgressCallback[\" << userData << \"] => \" <<\n                 increment <<\" ,\" << transfered << \",\" << total << std::endl;\n}\n\nvoid ObjectSample::PutObjectProgress()\n{\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(__FILE__, std::ios::in|std::ios::binary);\n    PutObjectRequest request(bucket_, \"PutObjectProgress\", content);\n    TransferProgress progressCallback = { ProgressCallback , this };\n    request.setTransferProgress(progressCallback);\n    auto outcome = client->PutObject(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ <<\"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\n#if !defined(OSS_DISABLE_RESUAMABLE)\r\nvoid ObjectSample::UploadObjectProgress() \n{\n    //case 1: checkpoint dir is not enabled\n    {\n        UploadObjectRequest request(bucket_, \"UploadObjectProgress\", Config::FileToUpload);\n\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableUploadObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n\n    //case 2: checkpoint dir is enabled\n    {\n        UploadObjectRequest request(bucket_, \"UploadObjectProgress\", Config::FileToUpload, Config::CheckpointDir);\n  \n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableUploadObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n\n    //case 3: checkpoint dir, multi threads is enabled\n    {\n        UploadObjectRequest request(bucket_, \"UploadObjectProgress\", Config::FileToUpload, Config::CheckpointDir, DefaultPartSize, 4);\n\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableUploadObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n}\n\nvoid ObjectSample::MultiCopyObjectProcess() \n{\n    //case 1: checkpoint dir is not enabled\n    {\n        MultiCopyObjectRequest request(bucket_, \"MultiCopyObjectProcess\", bucket_, \"MultiCopyObjectProcess_Src\");\n\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableCopyObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n\n    //case 2: checkpoint dir is config\n    {\n        MultiCopyObjectRequest request(bucket_, \"MultiCopyObjectProcess\", bucket_, \"MultiCopyObjectProcess_Src\", Config::CheckpointDir);\n\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableCopyObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n\n    //case 3: checkpoint dir is config, multi threads is config\n    {\n        MultiCopyObjectRequest request(bucket_, \"MultiCopyObjectProcess\", bucket_, \"MultiCopyObjectProcess_Src\", Config::CheckpointDir, DefaultPartSize, 4);\n\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableCopyObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n}\n\nvoid ObjectSample::DownloadObjectProcess() \n{\n    //case 1: no checkpoint dir is coinfig\n    {\n        DownloadObjectRequest request(bucket_, \"DownloadObjectProgress\", Config::FileDownloadTo);\n\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableDownloadObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().Metadata().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n\n    //case 2: checkpoint dir is config\n    {\n        DownloadObjectRequest request(bucket_, \"DownloadObjectProgress\", Config::FileDownloadTo, Config::CheckpointDir);\n\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableDownloadObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().Metadata().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n\n    //case 3: checkpoint dir is config, multi threads is config\n    {\n        DownloadObjectRequest request(bucket_, \"DownloadObjectProgress\", Config::FileDownloadTo, Config::CheckpointDir, DefaultPartSize, 4);\n\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcome = client->ResumableDownloadObject(request);\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().Metadata().ETag() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n}\n#endif\n\nvoid ObjectSample::GetObjectProgress()\n{\n    GetObjectRequest request(bucket_, \"PutObjectProgress\");\n    TransferProgress progressCallback = { ProgressCallback , this };\n    request.setTransferProgress(progressCallback);\n    request.setRange(0, 99);\n    auto outcome = client->GetObject(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().RequestId() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nvoid ObjectSample::PutObjectCallable()\n{\n    std::vector<PutObjectOutcomeCallable> outcomes;\n\n    for (int i = 0; i < 5; i++) {\n        std::string key = \"PutObjectCallable_\";\n        key.append(std::to_string(i));\n        //std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(__FILE__, std::ios::in | std::ios::binary);\n        std::shared_ptr<std::stringstream> content = std::make_shared<std::stringstream>();\n        *content << __FUNCTION__ << __FILE__ << std::endl;\n        PutObjectRequest request(bucket_, key, content);\n        TransferProgress progressCallback = { ProgressCallback , this };\n        request.setTransferProgress(progressCallback);\n        auto outcomeCallable = client->PutObjectCallable(request);\n        outcomes.emplace_back(std::move(outcomeCallable));\n    }\n\n    std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" start put object\" << std::endl;\n\n    waitTimeinSec(10);\n\n\n    for (size_t i = 0; i < outcomes.size(); i++) {\n        auto outcome = outcomes[i].get();\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, ETag:\" << outcome.result().ETag().c_str() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n\n}\n\nvoid ObjectSample::GetObjectCallable()\n{\n    std::vector<GetObjectOutcomeCallable> outcomes;\n    std::shared_ptr<std::stringstream> content = std::make_shared<std::stringstream>();\n    *content << __FUNCTION__ << __FILE__ << __FILE__ << __FILE__ << __FILE__ << __FILE__ << std::endl;\n    client->PutObject(PutObjectRequest(bucket_, \"GetObjectCallable\", content));\n\n    GetObjectRequest request(bucket_, \"GetObjectCallable\");\n    TransferProgress progressCallback = { ProgressCallback , this };\n    request.setTransferProgress(progressCallback);\n    //request.setRange(0, 29);\n\n    for (int i = 0; i < 5; i++) {\n        auto outcomeCallable = client->GetObjectCallable(request);\n        outcomes.emplace_back(std::move(outcomeCallable));\n    }\n\n    std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" start get object\" << std::endl;\n    waitTimeinSec(5);\n\n    for (size_t i = 0; i < outcomes.size(); i++) {\n        auto outcome = outcomes[i].get();\n        if (outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \"[\" << this << \"]\" << \" success, RequestId:\" << outcome.result().RequestId().c_str() << std::endl;\n        }\n        else {\n            PrintError(__FUNCTION__, outcome.error());\n        }\n    }\n}\n\nvoid ObjectSample::MultipartUploadObject()\n{\n    std::string key = \"MultipartUploadObject\";\n    InitiateMultipartUploadRequest initUploadRequest(bucket_, key);\n    auto uploadIdResult = client->InitiateMultipartUpload(initUploadRequest);\n    auto uploadId = uploadIdResult.result().UploadId();\n    std::string fileToUpload = Config::BigFileToUpload;\n    int64_t partSize = 100 * 1024;\n    PartList partETagList;\n\n    auto fileSize = getFileSize(fileToUpload);\n    int partCount = static_cast<int>(fileSize / partSize);\n    // Calculate how many parts to be divided\n    if (fileSize % partSize != 0) {\n        partCount++;\n    }\n\n    // Upload multiparts to bucket\n    for (int i = 1; i <= partCount; i++) {\n        auto skipBytes = partSize * (i - 1);\n        auto size = (partSize < fileSize - skipBytes) ? partSize : (fileSize - skipBytes);\n        std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(fileToUpload, std::ios::in|std::ios::binary);\n        content->seekg(skipBytes, std::ios::beg);\n\t\t\n        UploadPartRequest uploadPartRequest(bucket_, key, content);\n        uploadPartRequest.setContentLength(size);\n        uploadPartRequest.setUploadId(uploadId);\n        uploadPartRequest.setPartNumber(i);\n        auto uploadPartOutcome = client->UploadPart(uploadPartRequest);\n        if (uploadPartOutcome.isSuccess()) {\n            Part part(i, uploadPartOutcome.result().ETag());\n            partETagList.push_back(part);\n        }\n        else {\n            PrintError(__FUNCTION__, uploadPartOutcome.error());\n        }\n    }\n\n    // Complete to upload multiparts\n    CompleteMultipartUploadRequest request(bucket_, key);\n    request.setUploadId(uploadId);\n    request.setPartList(partETagList);\n    auto outcome = client->CompleteMultipartUpload(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, UploadID : \" << uploadId << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nvoid ObjectSample::ResumableObject()\n{\n    \n}\n\nvoid ObjectSample::RestoreArchiveObject(const std::string bucket, const std::string key, int maxWaitTimeInSeconds = 600)\n{\n    auto result = client->RestoreObject(bucket, key);\n    if (!result.isSuccess()) {\n        // not the archive object\n        PrintError(__FUNCTION__, result.error());\n        return ;\n    }\n\n    std::string onGoingRestore(\"ongoing-request=\\\"false\\\"\");\n    while (maxWaitTimeInSeconds > 0) {\n        auto meta = client->HeadObject(bucket, key);\n\n        std::string\trestoreStatus = meta.result().HttpMetaData()[\"x-oss-restore\"];\n        std::transform(restoreStatus.begin(), restoreStatus.end(), restoreStatus.begin(), ::tolower);\n        if (!restoreStatus.empty() && \n            restoreStatus.compare(0, onGoingRestore.size(), onGoingRestore)==0) {\n            std::cout << __FUNCTION__ << \" success, restore status:\" << restoreStatus << std::endl;\n            // success to restore archive object\n            break;\n        }\n\n        std::cout << __FUNCTION__ << \" info, WaitTime:\" << maxWaitTimeInSeconds\n            << \"; restore status:\" << restoreStatus << std::endl;\n\n        waitTimeinSec(10);\n        maxWaitTimeInSeconds--;\n\t}\n\n    if (maxWaitTimeInSeconds == 0) {\n        std::cout << __FUNCTION__ << \" fail, TimeoutException\" << std::endl;\n    }\n}\n\nvoid ObjectSample::CopyObject()\n{\n    // put a object as source object key\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << __FUNCTION__;\n    PutObjectRequest putObjectRequest(bucket_, \"CopyObjectSourceKey\", content);\n    client->PutObject(putObjectRequest);\n\n    CopyObjectRequest request(bucket_, \"CopyObjectTargetKey\");\n    request.setCopySource(bucket_, \"CopyObjectSourceKey\");\n    auto outcome = client->CopyObject(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, ETag:\" << outcome.result().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\n\nvoid ObjectSample::PutObjectCallback()\n{\n    std::string callbackUrl = Config::CallbackServer;\n    std::string callbackBody = \"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var1=${x:var1}\";\n\n    ObjectCallbackBuilder builder(callbackUrl, callbackBody, \"\", ObjectCallbackBuilder::Type::URL);\n    std::string value = builder.build();\n\n    ObjectCallbackVariableBuilder varBuilder;\n    varBuilder.addCallbackVariable(\"x:var1\", \"value1\");\n    varBuilder.addCallbackVariable(\"x:var2\", \"value2\");\n    std::string varValue = varBuilder.build();\n\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << __FUNCTION__;\n    PutObjectRequest request(bucket_, \"PutObjectCallback\", content);\n    request.MetaData().addHeader(\"x-oss-callback\", value);\n    request.MetaData().addHeader(\"x-oss-callback-var\", varValue);\n    auto outcome = client->PutObject(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, ETag:\" << outcome.result().ETag();\n        if (outcome.result().Content() != nullptr) {\n            std::istreambuf_iterator<char> isb(*outcome.result().Content().get()), end;\n            std::cout << \", callback data:\" << std::string(isb, end);\n        }\n        std::cout << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nvoid ObjectSample::ListObjects()\r\n{\r\n    ListObjectsRequest request(bucket_);\r\n    auto outcome = client->ListObjects(request);\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ << \" success \" <<\r\n            \"and object count is \" << outcome.result().ObjectSummarys().size() << std::endl;\r\n    }\r\n    else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid ObjectSample::ListObjectWithMarker()\r\n{\r\n    ListObjectsRequest request(bucket_);\r\n    request.setMaxKeys(1);\r\n    bool IsTruncated = false;\r\n    size_t total = 0;\r\n    do {\r\n        auto outcome = client->ListObjects(request);\r\n\r\n        if (outcome.isSuccess()) {\r\n            std::cout << __FUNCTION__ << \" success, \" <<\r\n                \"and object count is \" << outcome.result().ObjectSummarys().size() <<\r\n                \"next marker is \" << outcome.result().NextMarker() << std::endl;\r\n            total += outcome.result().ObjectSummarys().size();\r\n        }\r\n        else {\r\n            PrintError(__FUNCTION__, outcome.error());\r\n            break;\r\n        }\r\n\r\n        request.setMarker(outcome.result().NextMarker());\r\n        IsTruncated = outcome.result().IsTruncated();\r\n    } while (IsTruncated);\r\n\r\n    std::cout << __FUNCTION__ << \" done, and total is \" << total << std::endl;\r\n}\r\n\r\nvoid ObjectSample::ListObjectWithEncodeType()\r\n{\r\n    ListObjectsRequest request(bucket_);\r\n    request.setEncodingType(\"url\");\r\n    bool IsTruncated = false;\r\n    size_t total = 0;\r\n    request.setMaxKeys(1);\r\n    ListObjectOutcome outcome;\r\n    do {\r\n        outcome = client->ListObjects(request);\r\n\r\n        if (outcome.isSuccess()) {\r\n            std::cout << __FUNCTION__ << \" success, \" <<\r\n                \"and object count is \" << outcome.result().ObjectSummarys().size() <<\r\n                \"next marker is \" << outcome.result().NextMarker() << std::endl;\r\n            total += outcome.result().ObjectSummarys().size();\r\n        }\r\n        else {\r\n            PrintError(__FUNCTION__, outcome.error());\r\n            break;\r\n        }\r\n\r\n        request.setMarker(outcome.result().NextMarker());\r\n        IsTruncated = outcome.result().IsTruncated();\r\n    } while (IsTruncated);\r\n\r\n    std::cout << __FUNCTION__ << \" done, and total is \" << total << std::endl;\r\n}\n"
  },
  {
    "path": "sample/src/object/ObjectSample.h",
    "content": "#include <alibabacloud/oss/OssClient.h>\r\n\r\nclass ObjectSample\r\n{\r\npublic:\r\n    ObjectSample(const std::string &bucket);\r\n    ~ObjectSample();\r\n \r\n    void DoesObjectExist();\r\n    void PutFolder();\r\n    void PutObjectFromBuffer();\r\n    void PutObjectFromFile();\r\n    void GetObjectToBuffer();\r\n    void GetObjectToFile();\r\n    void DeleteObject();\r\n    void DeleteObjects();\r\n    void HeadObject();\r\n    void GetObjectMeta();\r\n    void AppendObject();\r\n    void MultipartUploadObject();\r\n    void ResumableObject();\r\n\r\n    void PutObjectProgress();\r\n    void GetObjectProgress();\r\n\r\n    void PutObjectCallable();\r\n    void GetObjectCallable();\r\n\r\n#if !defined(OSS_DISABLE_RESUAMABLE)\r\n    void UploadObjectProgress();\r\n    void MultiCopyObjectProcess();\r\n    void DownloadObjectProcess();\r\n#endif\r\n\r\n    void CopyObject();\r\n    void RestoreArchiveObject(const std::string bucket, const std::string key, int maxWaitTimeInSeconds);\r\n\r\n    void PutObjectCallback();\r\n\r\n    void ListObjects();\r\n    void ListObjectWithMarker();\r\n    void ListObjectWithEncodeType();\r\n\r\nprivate:\r\n    void PrintError(const std::string &funcName, const AlibabaCloud::OSS::OssError &error);\r\n    AlibabaCloud::OSS::OssClient *client;\r\n    std::string bucket_;\r\n};\r\n"
  },
  {
    "path": "sample/src/presignedurl/PresignedUrlSample.cc",
    "content": "#include <iostream>\n#include \"../Config.h\"\n#include \"PresignedUrlSample.h\"\n#include <memory>\n#include <sstream>\n#include <fstream>\n#include <ctime>\n\nusing namespace AlibabaCloud::OSS;\n\nPresignedUrlSample::PresignedUrlSample(const std::string &bucket) :\n    bucket_(bucket)\n{\n    ClientConfiguration conf;\n    client = new OssClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    //CreateBucketRequest request(bucket_);\n    //client->CreateBucket(request);\n\n    key_ = \"PresignedUrlSample\";\n    auto content = std::make_shared<std::stringstream>(\"PresignedUrlSample For Test\");\n    client->PutObject(PutObjectRequest(bucket_, key_, content));\n}\n\nPresignedUrlSample::~PresignedUrlSample() {\n    delete client;\n}\n\nvoid PresignedUrlSample::PrintError(const std::string &funcName, const OssError &error)\n{\n    std::cout << funcName << \" fail\" <<\n        \",code:\" << error.Code() <<\n        \",message:\" << error.Message() <<\n        \",request_id:\" << error.RequestId() << std::endl;\n}\n\nvoid PresignedUrlSample::GenPutPresignedUrl()\n{\n    std::string key = \"GenPutPresignedUrl\";\n    GeneratePresignedUrlRequest request(bucket_, key, Http::Put);\n    std::time_t t = std::time(nullptr) + 1200;\n    request.setExpires(t);\n\n    auto outcome = client->GeneratePresignedUrl(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, url:\" << outcome.result().c_str() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\n\nvoid PresignedUrlSample::GenGetPresignedUrl()\n{\n    GeneratePresignedUrlRequest request(bucket_, key_, Http::Get);\n    std::time_t t = std::time(nullptr) + 1200;\n    request.setExpires(t);\n    auto outcome = client->GeneratePresignedUrl(request);\n    if (outcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, url:\" << outcome.result().c_str() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outcome.error());\n    }\n}\n\nvoid PresignedUrlSample::PutObjectByUrlFromBuffer() \n{\n    std::time_t t = std::time(nullptr) + 1200;\n    auto genOutcome = client->GeneratePresignedUrl(bucket_, \"PutObjectByUrlFromBuffer\", t, Http::Put);\n    if (genOutcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, Gen url:\" << genOutcome.result().c_str() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, genOutcome.error());\n    }\n\n    auto content = std::make_shared<std::stringstream>();\n    *content << __FILE__ << __FUNCTION__ << std::endl;\n\n    auto outome = client->PutObjectByUrl(genOutcome.result(), content);\n    if (outome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, eTag:\" << outome.result().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outome.error());\n    }\n}\n\nvoid PresignedUrlSample::PutObjectByUrlFromFile()\n{\n    std::time_t t = std::time(nullptr) + 1200;\n    auto genOutcome = client->GeneratePresignedUrl(bucket_, \"PutObjectByUrlFromFile\", t, Http::Put);\n    if (genOutcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, Gen url:\" << genOutcome.result().c_str() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, genOutcome.error());\n    }\n\n    auto outome = client->PutObjectByUrl(genOutcome.result(), __FILE__);\n    if (outome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, eTag:\" << outome.result().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outome.error());\n    }\n}\n\nvoid PresignedUrlSample::GetObjectByUrlToBuffer()\n{\n    std::time_t t = std::time(nullptr) + 1200;\n    auto genOutcome = client->GeneratePresignedUrl(bucket_, \"GetObjectByUrlToBuffer\", t, Http::Put);\n    if (genOutcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, Gen url:\" << genOutcome.result().c_str() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, genOutcome.error());\n    }\n\n    auto content = std::make_shared<std::stringstream>();\n    *content << __FILE__ << __FUNCTION__ << std::endl;\n\n    auto outome = client->PutObjectByUrl(genOutcome.result(), content);\n    if (outome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, eTag:\" << outome.result().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outome.error());\n    }\n\n    genOutcome = client->GeneratePresignedUrl(bucket_, \"GetObjectByUrlToBuffer\", t, Http::Get);\n    auto getOutome = client->GetObjectByUrl(genOutcome.result());\n    if (getOutome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, eTag:\" << getOutome.result().Metadata().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outome.error());\n    }\n}\n\nvoid PresignedUrlSample::GetObjectByUrlToFile()\n{\n    std::time_t t = std::time(nullptr) + 1200;\n    auto genOutcome = client->GeneratePresignedUrl(bucket_, \"GetObjectByUrlToFile\", t, Http::Put);\n    if (genOutcome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, Gen url:\" << genOutcome.result().c_str() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, genOutcome.error());\n    }\n\n    auto outome = client->PutObjectByUrl(genOutcome.result(), __FILE__);\n    if (outome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, eTag:\" << outome.result().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outome.error());\n    }\n\n    genOutcome = client->GeneratePresignedUrl(bucket_, \"GetObjectByUrlToFile\", t, Http::Get);\n    auto getOutome = client->GetObjectByUrl(genOutcome.result(), \"GetObjectByUrlToFile_Donwload\");\n    if (getOutome.isSuccess()) {\n        std::cout << __FUNCTION__ << \" success, eTag:\" << getOutome.result().Metadata().ETag() << std::endl;\n    }\n    else {\n        PrintError(__FUNCTION__, outome.error());\n    }\n}\n"
  },
  {
    "path": "sample/src/presignedurl/PresignedUrlSample.h",
    "content": "#include <alibabacloud/oss/OssClient.h>\n\nclass PresignedUrlSample\n{\npublic:\n    PresignedUrlSample(const std::string &bucket);\n    ~PresignedUrlSample();\n\n    void GenPutPresignedUrl();\n    void GenGetPresignedUrl();\n    void PutObjectByUrlFromBuffer();\n    void PutObjectByUrlFromFile();\n    void GetObjectByUrlToBuffer();\n    void GetObjectByUrlToFile();\n\n\nprivate:\n    void PrintError(const std::string &funcName, const AlibabaCloud::OSS::OssError &error);\n    AlibabaCloud::OSS::OssClient *client;\n    std::string bucket_;\n    std::string key_;\n};\n"
  },
  {
    "path": "sample/src/service/ServiceSample.cc",
    "content": "#include <iostream>\r\n\r\n#include \"../Config.h\"\r\n#include \"ServiceSample.h\"\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nServiceSample::ServiceSample() {\r\n    ClientConfiguration conf;\r\n    client = new OssClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n}\r\n\r\nServiceSample::~ServiceSample() {\r\n    delete client;\r\n}\r\n\r\nvoid ServiceSample::PrintError(const std::string &funcName, const OssError &error)\r\n{\r\n    std::cout << funcName << \" fail\" <<\r\n        \",code:\" << error.Code() <<\r\n        \",message:\" << error.Message() <<\r\n        \",request_id:\" << error.RequestId() << std::endl;\r\n}\r\n\r\nvoid ServiceSample::ListBuckets()  \r\n{\r\n    ListBucketsRequest request;\r\n    auto outcome = client->ListBuckets(request);\r\n\r\n    if (outcome.isSuccess()) {\r\n        std::cout << __FUNCTION__ <<\" success, and bucket count is\" << outcome.result().Buckets().size() << std::endl;\r\n    } else {\r\n        PrintError(__FUNCTION__, outcome.error());\r\n    }\r\n}\r\n\r\nvoid ServiceSample::ListBucketsWithMarker()\r\n{\r\n    ListBucketsRequest request;\r\n    request.setMaxKeys(100);\r\n    bool IsTruncated = false;\r\n    size_t total = 0;\r\n    do {\r\n        auto outcome = client->ListBuckets(request);\r\n\r\n        if (outcome.isSuccess()) {\r\n            std::cout << __FUNCTION__ << \" success, \" <<\r\n                        \"and bucket count is \" << outcome.result().Buckets().size() <<\r\n                        \"next marker is \" << outcome.result().NextMarker() << std::endl;\r\n            total += outcome.result().Buckets().size();\r\n        } else {\r\n            PrintError(__FUNCTION__, outcome.error());\r\n            break;\r\n        }\r\n\r\n        request.setMarker(outcome.result().NextMarker());\r\n        IsTruncated = outcome.result().IsTruncated();\r\n    } while (IsTruncated);\r\n\r\n    std::cout << __FUNCTION__ <<\" done, and total is \" << total << std::endl;\r\n}\r\n\r\nvoid ServiceSample::ListBucketsWithPrefix()\r\n{\r\n    ListBucketsRequest request;\r\n    request.setMaxKeys(1);\r\n    request.setPrefix(\"cpp-sdk\");\r\n    bool IsTruncated = false;\r\n    size_t total = 0;\r\n    do {\r\n        auto outcome = client->ListBuckets(request);\r\n        if (outcome.isSuccess()) {\r\n            std::cout << __FUNCTION__ << \" success, \" <<\r\n                \"and bucket count is \" << outcome.result().Buckets().size() <<\r\n                \"next marker is \" << outcome.result().NextMarker() << std::endl;\r\n            total += outcome.result().Buckets().size();\r\n        }\r\n        else {\r\n            PrintError(__FUNCTION__, outcome.error());\r\n            break;\r\n        }\r\n\r\n        request.setMarker(outcome.result().NextMarker());\r\n        IsTruncated = outcome.result().IsTruncated();\r\n    } while (IsTruncated);\r\n\r\n    std::cout << __FUNCTION__ << \" done, and total is \" << total << std::endl;\r\n}\r\n\r\n"
  },
  {
    "path": "sample/src/service/ServiceSample.h",
    "content": "#include <alibabacloud/oss/OssClient.h>\n\nclass ServiceSample\n{\npublic:\n    ServiceSample();\n    ~ServiceSample();\n    void ListBuckets();\n    void ListBucketsWithMarker();\n    void ListBucketsWithPrefix();\nprivate:\n    void PrintError(const std::string &funcName, const AlibabaCloud::OSS::OssError &error);\n    AlibabaCloud::OSS::OssClient *client;\n};\n"
  },
  {
    "path": "sdk/CMakeLists.txt",
    "content": "#\r\n# Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n# \r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n# \r\n#      http://www.apache.org/licenses/LICENSE-2.0\r\n# \r\n# Unless required by applicable law or agreed to in writing, software\r\n# distributed under the License is distributed on an \"AS IS\" BASIS,\r\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n# See the License for the specific language governing permissions and\r\n# limitations under the License.\r\n#\r\n\r\nproject(cpp-sdk VERSION ${version})\r\n\r\nconfigure_file(src/Config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/include/alibabacloud/oss/Config.h @ONLY)\r\n\r\n\r\n#common header\r\nfile(GLOB sdk_auth_header \"include/alibabacloud/oss/auth/*.h\")\r\nfile(GLOB sdk_client_header \"include/alibabacloud/oss/client/*.h\")\r\nfile(GLOB sdk_http_header \"include/alibabacloud/oss/http/*.h\")\r\nfile(GLOB sdk_utils_header \"include/alibabacloud/oss/utils/*.h\")\r\nfile(GLOB sdk_model_header \"include/alibabacloud/oss/model/*.h\")\r\nfile(GLOB sdk_encryption_header \"include/alibabacloud/oss/encryption/*.h\")\r\nfile(GLOB sdk_public_header \"include/alibabacloud/oss/*.h\")\r\n\r\n#all header\r\nfile(GLOB sdk_header\r\n    ${sdk_auth_header}\r\n    ${sdk_client_header}\r\n    ${sdk_http_header}\r\n    ${sdk_utils_header}\r\n    ${sdk_model_header}\r\n    ${sdk_encryption_header}\r\n    ${sdk_public_header}\r\n)\r\n\r\n#common source\r\nfile(GLOB sdk_auth_src \"src/auth/*.cc\")\r\nfile(GLOB sdk_client_src \"src/client/*.cc\")\r\nfile(GLOB sdk_http_src \"src/http/*.cc\")\r\nfile(GLOB sdk_utils_src \"src/utils/*.cc\")\r\nfile(GLOB sdk_signer_src \"src/signer/*.cc\")\r\nfile(GLOB sdk_public_src \"src/*.cc\")\r\n\r\n#add source by DISABLE_XX option\r\nfile(GLOB sdk_model_common_src \r\n\t\"src/model/ModelError.cc\"\r\n)\r\n\r\nif (NOT OSS_DISABLE_BUCKET)\r\nfile(GLOB sdk_model_bucket_src \r\n\t\"src/model/*Bucket*.cc\"\r\n\t\"src/model/GetUserQos*.cc\"\r\n\t\"src/model/LifecycleRule.cc\"\r\n\t\"src/model/InventoryConfiguration.cc\"\r\n\t\"src/model/Tagging.cc\"\r\n)\r\nendif()\r\n\r\nfile(GLOB sdk_model_object_src \r\n\t\"src/model/*Object*.cc\"\r\n\t\"src/model/*Symlink*.cc\"\r\n\t\"src/model/InputFormat.cc\"\r\n\t\"src/model/OutputFormat.cc\"\r\n\t\"src/model/Tagging.cc\"\r\n\t\"src/model/GeneratePresignedUrlRequest.cc\"\r\n)\r\n\r\nfile(GLOB sdk_model_multipart_src \r\n\t\"src/model/*MultipartUpload*.cc\"\r\n\t\"src/model/UploadPart*.cc\"\r\n\t\"src/model/ListPart*.cc\"\r\n)\r\n\r\nif (NOT OSS_DISABLE_LIVECHANNEL)\r\nfile(GLOB sdk_model_livechannel_src \r\n\t\"src/model/*LiveChannel*.cc\"\r\n\t\"src/model/GetVod*.cc\"\r\n\t\"src/model/PostVod*.cc\"\r\n\t\"src/model/GenerateRTMPSignedUrlRequest.cc\"\r\n)\r\nendif()\r\n\r\nfile(GLOB sdk_model_src\r\n\t${sdk_model_common_src}\r\n\t${sdk_model_bucket_src}\r\n\t${sdk_model_object_src}\r\n\t${sdk_model_multipart_src}\r\n\t${sdk_model_livechannel_src}\r\n)\r\n\r\nif (NOT OSS_DISABLE_RESUAMABLE)\r\nfile(GLOB sdk_resumable_src \"src/resumable/*.cc\")\r\nendif()\r\n\r\nif (NOT OSS_DISABLE_ENCRYPTION)\r\nfile(GLOB sdk_encryption_src \"src/encryption/*.cc\")\r\nendif()\r\n\r\n#external source\r\nfile(GLOB sdk_external_tinnyxml2_src \"src/external/tinyxml2/*.cpp\")\r\n\r\nif (NOT OSS_DISABLE_ENCRYPTION OR NOT OSS_DISABLE_RESUAMABLE)\r\nfile(GLOB sdk_external_json_src \"src/external/json/*.cpp\")\r\nendif()\r\n\r\n\r\n#all source\r\nfile(GLOB sdk_src\r\n    ${sdk_auth_src}\r\n    ${sdk_client_src}\r\n    ${sdk_http_src}\r\n    ${sdk_utils_src}\r\n    ${sdk_signer_src}\r\n    ${sdk_model_src}\r\n    ${sdk_public_src}\r\n    ${sdk_resumable_src}\r\n    ${sdk_encryption_src}\r\n    ${sdk_external_json_src}\r\n    ${sdk_external_tinnyxml2_src}\r\n)\r\n\r\n#extra define pass to source code\r\nif (BUILD_TESTS)\r\n    set(EXTRA_DEFINE \"-DENABLE_OSS_TEST\")\r\nelse()\r\n    set(EXTRA_DEFINE \"\")\r\nendif()\r\n    \r\n#static lib\r\nadd_library(${PROJECT_NAME}${STATIC_LIB_SUFFIX} STATIC\r\n    ${sdk_header}\r\n    ${sdk_src})\r\n    \r\nset_target_properties(${PROJECT_NAME}${STATIC_LIB_SUFFIX}\r\n    PROPERTIES\r\n    LINKER_LANGUAGE CXX\r\n    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib\r\n    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib\r\n    RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib\r\n    OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}${PROJECT_NAME}${STATIC_LIB_SUFFIX}\r\n    )\r\n\r\ntarget_include_directories(${PROJECT_NAME}${STATIC_LIB_SUFFIX}\r\n    PRIVATE include\r\n    PRIVATE include/alibabacloud/oss    \r\n    PRIVATE src/external/)\r\n\r\ntarget_include_directories(${PROJECT_NAME}${STATIC_LIB_SUFFIX}\r\n    PRIVATE ${CRYPTO_INCLUDE_DIRS}\r\n    PRIVATE ${CLIENT_INCLUDE_DIRS})\r\n\r\ntarget_compile_options(${PROJECT_NAME}${STATIC_LIB_SUFFIX} \r\n    PRIVATE \"${SDK_COMPILER_FLAGS}\" \"${EXTRA_DEFINE}\")\r\n\r\n#shared lib\r\nif (BUILD_SHARED_LIBS)\r\n    add_library(${PROJECT_NAME} SHARED\r\n        ${sdk_header}\r\n        ${sdk_src})\r\n    \r\n    set_target_properties(${PROJECT_NAME}\r\n        PROPERTIES\r\n        LINKER_LANGUAGE CXX\r\n        ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib\r\n        LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib\r\n        RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib\r\n        OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}${PROJECT_NAME}\r\n        )\r\n    \r\n    target_include_directories(${PROJECT_NAME}\r\n        PRIVATE include\r\n        PRIVATE include/alibabacloud/oss    \r\n        PRIVATE src/external/)\r\n    \r\n    target_include_directories(${PROJECT_NAME}\r\n        PRIVATE ${CRYPTO_INCLUDE_DIRS}\r\n        PRIVATE ${CLIENT_INCLUDE_DIRS})\r\n\r\n    target_compile_options(${PROJECT_NAME} \r\n        PRIVATE \"${SDK_COMPILER_FLAGS}\" -DALIBABACLOUD_SHARED -DALIBABACLOUD_OSS_LIBRARY)\r\n    \r\n    if(NOT CMAKE_CXX_COMPILER_ID MATCHES \"MSVC\")\r\n    target_compile_options(${PROJECT_NAME} \r\n        PRIVATE \"-fvisibility=hidden\")\r\n    endif()\r\n\r\n    target_link_libraries(${PROJECT_NAME} ${CRYPTO_LIBS})\r\n    target_link_libraries(${PROJECT_NAME} ${CLIENT_LIBS})    \r\nendif()\r\n\r\n#install \r\ninstall(FILES ${sdk_auth_header}\r\n    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/oss/auth)\r\ninstall(FILES ${sdk_client_header}\r\n    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/oss/client)\r\ninstall(FILES ${sdk_http_header}\r\n    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/oss/http)\r\ninstall(FILES ${sdk_utils_header}\r\n    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/oss/utils)\r\ninstall(FILES ${sdk_model_header}\r\n    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/oss/model)\r\ninstall(FILES ${sdk_encryption_header}\r\n    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/oss/encryption)\r\ninstall(FILES ${sdk_public_header}\r\n    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/oss)\r\n\r\ninstall(TARGETS  ${PROJECT_NAME}${STATIC_LIB_SUFFIX}\r\n    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}\r\n    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}\r\n    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}\r\n    )\r\n\r\nif (BUILD_SHARED_LIBS)\r\ninstall(TARGETS  ${PROJECT_NAME}\r\n    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}\r\n    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}\r\n    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}\r\n    )\r\nendif()"
  },
  {
    "path": "sdk/include/alibabacloud/oss/Config.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n// version = (major << 16) + (minor << 8) + patch\r\n#define ALIBABACLOUD_OSS_VERSION ((1 << 16) + (10 << 8) + 1)\r\n\r\n#define ALIBABACLOUD_OSS_VERSION_STR \"1.10.1\"\r\n\r\n// auto generated by cmake option\r\n/* #undef OSS_DISABLE_BUCKET */\r\n/* #undef OSS_DISABLE_LIVECHANNEL */\r\n/* #undef OSS_DISABLE_RESUAMABLE */\r\n/* #undef OSS_DISABLE_ENCRYPTION */\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/Const.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <cstdint>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    const int64_t MaxFileSize = 5LL * 1024LL * 1024LL * 1024LL;\r\n    const int32_t MaxPrefixStringSize = 1024;\r\n    const int32_t MaxMarkerStringSize = 1024;\r\n    const int32_t MaxDelimiterStringSize = 1024;\r\n    const int32_t MaxReturnedKeys = 1000;\r\n    const int32_t MaxUploads = 1000;\r\n    const int32_t DeleteObjectsUpperLimit = 1000;\r\n    const int32_t BucketCorsRuleLimit = 10;\r\n    const int32_t LifecycleRuleLimit = 1000;\r\n    const int32_t ObjectNameLengthLimit = 1023;\r\n    const int32_t PartNumberUpperLimit = 10000;\r\n    const int32_t DefaultPartSize = 8 * 1024 * 1024;\r\n    const int32_t PartSizeLowerLimit = 100 * 1024;\r\n    const int32_t MaxPathLength = 124;\r\n    const int32_t MinPathLength = 4;\r\n    const int32_t DefaultResumableThreadNum = 3;\r\n    const uint32_t MaxLiveChannelNameLength = 1023;\r\n    const uint32_t MaxLiveChannelDescriptionLength = 128;\r\n    const uint32_t MinLiveChannelFragCount = 1;\r\n    const uint32_t MaxLiveChannelFragCount = 100;\r\n    const uint32_t MinLiveChannelFragDuration = 1;\r\n    const uint32_t MaxLiveChannelFragDuration = 100;\r\n    const uint32_t MinLiveChannelPlayListLength = 6;\r\n    const uint32_t MaxLiveChannelPlayListLength = 128;\r\n    const uint32_t MinLiveChannelInterval = 1;\r\n    const uint32_t MaxLiveChannelInterval = 100;\r\n    const uint64_t SecondsOfDay = 24*60*60;\r\n    const uint32_t MaxListLiveChannelKeys = 1000;\r\n    const uint32_t TagKeyLengthLimit = 128;\r\n    const uint32_t TagValueLengthLimit = 256;\r\n    const uint32_t MaxTagSize = 10;\r\n\r\n#ifdef _WIN32\r\n    const char PATH_DELIMITER = '\\\\';\r\n    const wchar_t WPATH_DELIMITER = L'\\\\';\r\n#else\r\n    const char PATH_DELIMITER = '/';\r\n    const wchar_t WPATH_DELIMITER = L'/';\r\n#endif\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/Export.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include \"Global.h\"\n\n#if defined(ALIBABACLOUD_SHARED)\n#   if defined(ALIBABACLOUD_OSS_LIBRARY)\n#       define ALIBABACLOUD_OSS_EXPORT ALIBABACLOUD_DECL_EXPORT\n#   else\n#       define ALIBABACLOUD_OSS_EXPORT ALIBABACLOUD_DECL_IMPORT\n#   endif\n#else\n#   define ALIBABACLOUD_OSS_EXPORT\n#endif\n\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/Global.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n\n#include \"Config.h\"\n\n#if defined(_WIN32)\n#   ifdef _MSC_VER\n#       pragma warning(disable : 4251)\n#   endif // _MSC_VER\n#   define ALIBABACLOUD_DECL_EXPORT __declspec(dllexport)\n#   define ALIBABACLOUD_DECL_IMPORT __declspec(dllimport)\n#elif __GNUC__ >= 4\n#   define ALIBABACLOUD_DECL_EXPORT __attribute__((visibility(\"default\")))\n#   define ALIBABACLOUD_DECL_IMPORT __attribute__((visibility(\"default\")))\n#endif\n\n#if !defined(ALIBABACLOUD_DECL_EXPORT)\n#   define ALIBABACLOUD_DECL_EXPORT\n#endif\n\n#if !defined(ALIBABACLOUD_DECL_IMPORT)\n#   define ALIBABACLOUD_DECL_IMPORT\n#endif\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/OssClient.h",
    "content": "/*\r\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n*\r\n* Licensed under the Apache License, Version 2.0 (the \"License\");\r\n* you may not use this file except in compliance with the License.\r\n* You may obtain a copy of the License at\r\n*\r\n*      http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing, software\r\n* distributed under the License is distributed on an \"AS IS\" BASIS,\r\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n* See the License for the specific language governing permissions and\r\n* limitations under the License.\r\n*/\r\n\r\n#pragma once\r\n\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/client/ClientConfiguration.h>\r\n#include <alibabacloud/oss/auth/CredentialsProvider.h>\r\n#include <alibabacloud/oss/OssFwd.h>\r\n#include <alibabacloud/oss/client/AsyncCallerContext.h>\r\n#include <future>\r\n#include <ctime>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    /*Global Init/Deinit*/\r\n    void ALIBABACLOUD_OSS_EXPORT InitializeSdk();\r\n    bool ALIBABACLOUD_OSS_EXPORT IsSdkInitialized();\r\n    void ALIBABACLOUD_OSS_EXPORT ShutdownSdk();\r\n\r\n    /*Log*/\r\n    void ALIBABACLOUD_OSS_EXPORT SetLogLevel(LogLevel level);\r\n    void ALIBABACLOUD_OSS_EXPORT SetLogCallback(LogCallback callback);\r\n\r\n    /*Utils*/\r\n    std::string ALIBABACLOUD_OSS_EXPORT ComputeContentMD5(const char *data, size_t size);\r\n    std::string ALIBABACLOUD_OSS_EXPORT ComputeContentMD5(std::istream& stream);\r\n    std::string ALIBABACLOUD_OSS_EXPORT ComputeContentETag(const char* data, size_t size);\r\n    std::string ALIBABACLOUD_OSS_EXPORT ComputeContentETag(std::istream& stream);\r\n    std::string ALIBABACLOUD_OSS_EXPORT UrlEncode(const std::string& src);\r\n    std::string ALIBABACLOUD_OSS_EXPORT UrlDecode(const std::string& src);\r\n    std::string ALIBABACLOUD_OSS_EXPORT Base64Encode(const std::string& src);\r\n    std::string ALIBABACLOUD_OSS_EXPORT Base64Encode(const char* src, int len);\r\n    std::string ALIBABACLOUD_OSS_EXPORT Base64EncodeUrlSafe(const std::string& src);\r\n    std::string ALIBABACLOUD_OSS_EXPORT Base64EncodeUrlSafe(const char* src, int len);\r\n    std::string ALIBABACLOUD_OSS_EXPORT ToGmtTime(std::time_t& t);\r\n    std::string ALIBABACLOUD_OSS_EXPORT ToUtcTime(std::time_t& t);\r\n    std::time_t ALIBABACLOUD_OSS_EXPORT UtcToUnixTime(const std::string& t);\r\n    uint64_t    ALIBABACLOUD_OSS_EXPORT ComputeCRC64(uint64_t crc, void* buf, size_t len);\r\n    uint64_t    ALIBABACLOUD_OSS_EXPORT CombineCRC64(uint64_t crc1, uint64_t crc2, uintmax_t len2);\r\n\r\n    /*Aysnc APIs*/\r\n    class OssClient;\r\n    using ListObjectAsyncHandler = std::function<void(const AlibabaCloud::OSS::OssClient*, const ListObjectsRequest&, const ListObjectOutcome&, const std::shared_ptr<const AsyncCallerContext>&)>;\r\n    using GetObjectAsyncHandler  = std::function<void(const AlibabaCloud::OSS::OssClient*, const GetObjectRequest&, const GetObjectOutcome&, const std::shared_ptr<const AsyncCallerContext>&)>;\r\n    using PutObjectAsyncHandler = std::function<void(const AlibabaCloud::OSS::OssClient*, const PutObjectRequest&, const PutObjectOutcome&, const std::shared_ptr<const AsyncCallerContext>&)>;\r\n    using UploadPartAsyncHandler = std::function<void(const AlibabaCloud::OSS::OssClient*, const UploadPartRequest&, const PutObjectOutcome&, const std::shared_ptr<const AsyncCallerContext>&)>;\r\n    using UploadPartCopyAsyncHandler = std::function<void(const AlibabaCloud::OSS::OssClient*, const UploadPartCopyRequest&, const UploadPartCopyOutcome&, const std::shared_ptr<const AsyncCallerContext>&)>;\r\n\r\n    /*Callable*/\r\n    using ListObjectOutcomeCallable = std::future<ListObjectOutcome>;\r\n    using GetObjectOutcomeCallable  = std::future<GetObjectOutcome>;\r\n    using PutObjectOutcomeCallable  = std::future<PutObjectOutcome>;\r\n    using UploadPartCopyOutcomeCallable = std::future<UploadPartCopyOutcome>;\r\n\r\n    class OssClientImpl;\r\n    class ALIBABACLOUD_OSS_EXPORT OssClient\r\n    {\r\n    public:\r\n\r\n        OssClient(const std::string& endpoint, const std::string& accessKeyId, const std::string& accessKeySecret, \r\n                                const ClientConfiguration& configuration);\r\n        OssClient(const std::string& endpoint, const std::string& accessKeyId, const std::string& accessKeySecret, const std::string& securityToken,\r\n                                const ClientConfiguration& configuration); \r\n        OssClient(const std::string& endpoint, const Credentials& credentials, const ClientConfiguration& configuration);\r\n        OssClient(const std::string& endpoint, const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration& configuration);\r\n        virtual ~OssClient();\r\n\r\n#if !defined(OSS_DISABLE_BUCKET)\r\n        /*Service*/\r\n        ListBucketsOutcome ListBuckets() const;\r\n        ListBucketsOutcome ListBuckets(const ListBucketsRequest& request) const;\r\n\r\n        /*Bucket*/\r\n        CreateBucketOutcome CreateBucket(const std::string& bucket, StorageClass storageClass = StorageClass::Standard) const;\r\n        CreateBucketOutcome CreateBucket(const std::string& bucket, StorageClass storageClass, CannedAccessControlList acl) const;\r\n        CreateBucketOutcome CreateBucket(const CreateBucketRequest& request) const;\r\n\r\n        ListBucketInventoryConfigurationsOutcome ListBucketInventoryConfigurations(const ListBucketInventoryConfigurationsRequest& request) const;\r\n\r\n        VoidOutcome SetBucketAcl(const std::string& bucket, CannedAccessControlList acl) const;\r\n        VoidOutcome SetBucketAcl(const SetBucketAclRequest& request) const;\r\n        VoidOutcome SetBucketLogging(const std::string& bucket, const std::string& targetBucket, const std::string& targetPrefix) const;\r\n        VoidOutcome SetBucketLogging(const SetBucketLoggingRequest& request) const;\r\n        VoidOutcome SetBucketWebsite(const std::string& bucket, const std::string& indexDocument) const;\r\n        VoidOutcome SetBucketWebsite(const std::string& bucket, const std::string& indexDocument, const std::string& errorDocument) const;\r\n        VoidOutcome SetBucketWebsite(const SetBucketWebsiteRequest& request) const;\r\n        VoidOutcome SetBucketReferer(const std::string& bucket, const RefererList& refererList, bool allowEmptyReferer) const;\r\n        VoidOutcome SetBucketReferer(const SetBucketRefererRequest& request) const;\r\n        VoidOutcome SetBucketLifecycle(const SetBucketLifecycleRequest& request) const;\r\n        VoidOutcome SetBucketCors(const std::string& bucket, const CORSRuleList& rules) const;\r\n        VoidOutcome SetBucketCors(const SetBucketCorsRequest& request) const;\r\n        VoidOutcome SetBucketStorageCapacity(const std::string& bucket, int64_t storageCapacity) const;\r\n        VoidOutcome SetBucketStorageCapacity(const SetBucketStorageCapacityRequest& request) const;\r\n        VoidOutcome SetBucketPolicy(const SetBucketPolicyRequest& request) const;\r\n        VoidOutcome SetBucketRequestPayment(const SetBucketRequestPaymentRequest& request) const;\r\n        VoidOutcome SetBucketEncryption(const SetBucketEncryptionRequest& request) const;\r\n        VoidOutcome SetBucketTagging(const SetBucketTaggingRequest& request) const;\r\n        VoidOutcome SetBucketQosInfo(const SetBucketQosInfoRequest& request) const;\r\n        VoidOutcome SetBucketVersioning(const SetBucketVersioningRequest& request) const;\r\n        VoidOutcome SetBucketInventoryConfiguration(const SetBucketInventoryConfigurationRequest& request) const;\r\n\r\n        VoidOutcome DeleteBucket(const std::string& bucket) const;\r\n        VoidOutcome DeleteBucket(const DeleteBucketRequest& request) const;\r\n        VoidOutcome DeleteBucketLogging(const std::string& bucket) const;\r\n        VoidOutcome DeleteBucketLogging(const DeleteBucketLoggingRequest& request) const;\r\n        VoidOutcome DeleteBucketPolicy(const DeleteBucketPolicyRequest& request) const;\r\n        VoidOutcome DeleteBucketWebsite(const std::string& bucket) const;\r\n        VoidOutcome DeleteBucketWebsite(const DeleteBucketWebsiteRequest& request) const;\r\n        VoidOutcome DeleteBucketLifecycle(const std::string& bucket) const;\r\n        VoidOutcome DeleteBucketLifecycle(const DeleteBucketLifecycleRequest& request) const;\r\n        VoidOutcome DeleteBucketCors(const std::string& bucket) const;\r\n        VoidOutcome DeleteBucketCors(const DeleteBucketCorsRequest& request) const;\r\n        VoidOutcome DeleteBucketEncryption(const DeleteBucketEncryptionRequest& request) const;\r\n        VoidOutcome DeleteBucketTagging(const DeleteBucketTaggingRequest& request) const;\r\n        VoidOutcome DeleteBucketQosInfo(const DeleteBucketQosInfoRequest& request) const;\r\n        VoidOutcome DeleteBucketInventoryConfiguration(const DeleteBucketInventoryConfigurationRequest& request) const;\r\n\r\n        GetBucketAclOutcome GetBucketAcl(const std::string& bucket) const;\r\n        GetBucketAclOutcome GetBucketAcl(const GetBucketAclRequest& request) const;\r\n        GetBucketLocationOutcome GetBucketLocation(const std::string& bucket) const;\r\n        GetBucketLocationOutcome GetBucketLocation(const GetBucketLocationRequest& request) const;\r\n        GetBucketInfoOutcome  GetBucketInfo(const std::string& bucket) const;\r\n        GetBucketInfoOutcome  GetBucketInfo(const GetBucketInfoRequest& request) const;\r\n        GetBucketLoggingOutcome GetBucketLogging(const std::string& bucket) const;\r\n        GetBucketLoggingOutcome GetBucketLogging(const GetBucketLoggingRequest& request) const;\r\n        GetBucketWebsiteOutcome GetBucketWebsite(const std::string& bucket) const;\r\n        GetBucketWebsiteOutcome GetBucketWebsite(const GetBucketWebsiteRequest& request) const;\r\n        GetBucketRefererOutcome GetBucketReferer(const std::string& bucket) const;\r\n        GetBucketRefererOutcome GetBucketReferer(const GetBucketRefererRequest& request) const;\r\n        GetBucketLifecycleOutcome GetBucketLifecycle(const std::string& bucket) const;\r\n        GetBucketLifecycleOutcome GetBucketLifecycle(const GetBucketLifecycleRequest& request) const;\r\n        GetBucketStatOutcome GetBucketStat(const std::string& bucket) const;\r\n        GetBucketStatOutcome GetBucketStat(const GetBucketStatRequest& request) const;\r\n        GetBucketCorsOutcome GetBucketCors(const std::string& bucket) const;\r\n        GetBucketCorsOutcome GetBucketCors(const GetBucketCorsRequest& request) const;\r\n        GetBucketStorageCapacityOutcome GetBucketStorageCapacity(const std::string& bucket) const;\r\n        GetBucketStorageCapacityOutcome GetBucketStorageCapacity(const GetBucketStorageCapacityRequest& request) const;\r\n        GetBucketPolicyOutcome GetBucketPolicy(const GetBucketPolicyRequest& request) const;\r\n        GetBucketPaymentOutcome GetBucketRequestPayment(const GetBucketRequestPaymentRequest& request) const;\r\n        GetBucketEncryptionOutcome GetBucketEncryption(const GetBucketEncryptionRequest& request) const;\r\n        GetBucketTaggingOutcome GetBucketTagging(const GetBucketTaggingRequest& request) const;\r\n        GetBucketQosInfoOutcome GetBucketQosInfo(const GetBucketQosInfoRequest& request) const;\r\n        GetUserQosInfoOutcome GetUserQosInfo(const GetUserQosInfoRequest& request) const;\r\n        GetBucketVersioningOutcome GetBucketVersioning(const GetBucketVersioningRequest& request) const;\r\n        GetBucketInventoryConfigurationOutcome GetBucketInventoryConfiguration(const GetBucketInventoryConfigurationRequest& request) const;\r\n        InitiateBucketWormOutcome InitiateBucketWorm(const InitiateBucketWormRequest& request) const;\r\n        VoidOutcome AbortBucketWorm(const AbortBucketWormRequest& request) const;\r\n        VoidOutcome CompleteBucketWorm(const CompleteBucketWormRequest& request) const;\r\n        VoidOutcome ExtendBucketWormWorm(const ExtendBucketWormRequest& request) const;\r\n        GetBucketWormOutcome GetBucketWorm(const GetBucketWormRequest& request) const;\r\n#endif\r\n\r\n        /*Object*/\r\n        ListObjectOutcome ListObjects(const std::string& bucket) const;\r\n        ListObjectOutcome ListObjects(const std::string& bucket, const std::string& prefix) const;\r\n        ListObjectOutcome ListObjects(const ListObjectsRequest& request) const;\r\n        ListObjectsV2Outcome ListObjectsV2(const ListObjectsV2Request& request) const;\r\n        ListObjectVersionsOutcome ListObjectVersions(const std::string& bucket) const;\r\n        ListObjectVersionsOutcome ListObjectVersions(const std::string& bucket, const std::string& prefix) const;\r\n        ListObjectVersionsOutcome ListObjectVersions(const ListObjectVersionsRequest& request) const;\r\n\r\n        GetObjectOutcome GetObject(const std::string& bucket, const std::string& key) const;\r\n        GetObjectOutcome GetObject(const std::string& bucket, const std::string& key, const std::shared_ptr<std::iostream>& content) const;\r\n        GetObjectOutcome GetObject(const std::string& bucket, const std::string& key, const std::string& fileToSave) const;\r\n        GetObjectOutcome GetObject(const GetObjectRequest& request) const;\r\n        PutObjectOutcome PutObject(const std::string& bucket, const std::string& key, const std::shared_ptr<std::iostream>& content) const;\r\n        PutObjectOutcome PutObject(const std::string& bucket, const std::string& key, const std::string& fileToUpload) const;\r\n        PutObjectOutcome PutObject(const std::string& bucket, const std::string& key, const std::shared_ptr<std::iostream>& content, const ObjectMetaData& meta) const;\r\n        PutObjectOutcome PutObject(const std::string& bucket, const std::string& key, const std::string& fileToUpload, const ObjectMetaData& meta) const;\r\n        PutObjectOutcome PutObject(const PutObjectRequest& request) const;\r\n        DeleteObjectOutcome DeleteObject(const std::string& bucket, const std::string& key) const;\r\n        DeleteObjectOutcome DeleteObject(const DeleteObjectRequest& request) const;\r\n        DeleteObjecstOutcome DeleteObjects(const std::string bucket, const DeletedKeyList &keyList) const;\r\n        DeleteObjecstOutcome DeleteObjects(const DeleteObjectsRequest& request) const;\r\n        DeleteObjecVersionstOutcome DeleteObjectVersions(const std::string bucket, const ObjectIdentifierList &objectList) const;\r\n        DeleteObjecVersionstOutcome DeleteObjectVersions(const DeleteObjectVersionsRequest& request) const;\r\n        ObjectMetaDataOutcome HeadObject(const std::string& bucket, const std::string& key) const;\r\n        ObjectMetaDataOutcome HeadObject(const HeadObjectRequest& request) const;\r\n        ObjectMetaDataOutcome GetObjectMeta(const std::string& bucket, const std::string& key) const;\r\n        ObjectMetaDataOutcome GetObjectMeta(const GetObjectMetaRequest& request) const;\r\n        AppendObjectOutcome AppendObject(const AppendObjectRequest& request) const;\r\n        CopyObjectOutcome CopyObject(const CopyObjectRequest& request) const;\r\n        RestoreObjectOutcome RestoreObject(const std::string& bucket, const std::string& key) const;\r\n        RestoreObjectOutcome RestoreObject(const RestoreObjectRequest& request) const;\r\n        SetObjectAclOutcome SetObjectAcl(const SetObjectAclRequest& request) const;\r\n        GetObjectAclOutcome GetObjectAcl(const GetObjectAclRequest& request) const;\r\n        CreateSymlinkOutcome CreateSymlink(const CreateSymlinkRequest& request) const;\r\n        GetSymlinkOutcome GetSymlink(const GetSymlinkRequest& request) const;\r\n        GetObjectOutcome ProcessObject(const ProcessObjectRequest& request) const;\r\n\r\n        GetObjectOutcome SelectObject(const SelectObjectRequest& request) const;\r\n        CreateSelectObjectMetaOutcome CreateSelectObjectMeta(const CreateSelectObjectMetaRequest& request) const;\r\n\r\n        SetObjectTaggingOutcome SetObjectTagging(const SetObjectTaggingRequest& request) const;\r\n        DeleteObjectTaggingOutcome DeleteObjectTagging(const DeleteObjectTaggingRequest& request) const;\r\n        GetObjectTaggingOutcome GetObjectTagging(const GetObjectTaggingRequest& request) const;\r\n\r\n        /*MultipartUpload*/\r\n        InitiateMultipartUploadOutcome InitiateMultipartUpload(const InitiateMultipartUploadRequest& request) const;\r\n        PutObjectOutcome UploadPart(const UploadPartRequest& request) const;\r\n        UploadPartCopyOutcome UploadPartCopy(const UploadPartCopyRequest& request) const;\r\n        CompleteMultipartUploadOutcome CompleteMultipartUpload(const CompleteMultipartUploadRequest& request) const;\r\n        VoidOutcome AbortMultipartUpload(const AbortMultipartUploadRequest& request) const;\r\n        ListMultipartUploadsOutcome ListMultipartUploads(const ListMultipartUploadsRequest& request) const;\r\n        ListPartsOutcome ListParts(const ListPartsRequest& request) const;\r\n\r\n        /*Generate URL*/\r\n        StringOutcome GeneratePresignedUrl(const GeneratePresignedUrlRequest& request) const;\r\n        StringOutcome GeneratePresignedUrl(const std::string& bucket, const std::string& key) const;\r\n        StringOutcome GeneratePresignedUrl(const std::string& bucket, const std::string& key, int64_t expires) const;\r\n        StringOutcome GeneratePresignedUrl(const std::string& bucket, const std::string& key, int64_t expires, Http::Method method) const;\r\n        GetObjectOutcome GetObjectByUrl(const GetObjectByUrlRequest& request) const;\r\n        GetObjectOutcome GetObjectByUrl(const std::string& url) const;\r\n        GetObjectOutcome GetObjectByUrl(const std::string& url, const std::string& file) const;\r\n        PutObjectOutcome PutObjectByUrl(const PutObjectByUrlRequest& request) const;\r\n        PutObjectOutcome PutObjectByUrl(const std::string& url, const std::string& file) const;\r\n        PutObjectOutcome PutObjectByUrl(const std::string& url, const std::string& file, const ObjectMetaData& metaData) const;\r\n        PutObjectOutcome PutObjectByUrl(const std::string& url, const std::shared_ptr<std::iostream>& content) const;\r\n        PutObjectOutcome PutObjectByUrl(const std::string& url, const std::shared_ptr<std::iostream>& content, const ObjectMetaData& metaData) const;\r\n\r\n        /*Generate Post Policy*/\r\n\r\n        /*Resumable Operation*/\r\n#if !defined(OSS_DISABLE_RESUAMABLE)\r\n        PutObjectOutcome ResumableUploadObject(const UploadObjectRequest& request) const;\r\n        CopyObjectOutcome ResumableCopyObject(const MultiCopyObjectRequest& request) const;\r\n        GetObjectOutcome ResumableDownloadObject(const DownloadObjectRequest& request) const;\r\n#endif\r\n\r\n#if !defined(OSS_DISABLE_LIVECHANNEL)\r\n        /*Live Channel*/\r\n        VoidOutcome PutLiveChannelStatus(const PutLiveChannelStatusRequest& request) const;\r\n        PutLiveChannelOutcome PutLiveChannel(const PutLiveChannelRequest& request) const;\r\n        VoidOutcome PostVodPlaylist(const PostVodPlaylistRequest& request) const;\r\n        GetVodPlaylistOutcome GetVodPlaylist(const GetVodPlaylistRequest& request) const;\r\n        GetLiveChannelStatOutcome GetLiveChannelStat(const GetLiveChannelStatRequest& request) const;\r\n        GetLiveChannelInfoOutcome GetLiveChannelInfo(const GetLiveChannelInfoRequest& request) const;\r\n        GetLiveChannelHistoryOutcome GetLiveChannelHistory(const GetLiveChannelHistoryRequest& request) const;\r\n        ListLiveChannelOutcome ListLiveChannel(const ListLiveChannelRequest& request) const;\r\n        VoidOutcome DeleteLiveChannel(const DeleteLiveChannelRequest& request) const;\r\n        StringOutcome GenerateRTMPSignedUrl(const GenerateRTMPSignedUrlRequest& request) const;\r\n#endif\r\n\r\n        /*Aysnc APIs*/\r\n        void ListObjectsAsync(const ListObjectsRequest& request, const ListObjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;\r\n        void GetObjectAsync(const GetObjectRequest& request, const GetObjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;\r\n        void PutObjectAsync(const PutObjectRequest& request, const PutObjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;\r\n        void UploadPartAsync(const UploadPartRequest& request, const UploadPartAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;\r\n        void UploadPartCopyAsync(const UploadPartCopyRequest& request, const UploadPartCopyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;\r\n\r\n        /*Callable APIs*/\r\n        ListObjectOutcomeCallable ListObjectsCallable(const ListObjectsRequest& request) const;\r\n        GetObjectOutcomeCallable GetObjectCallable(const GetObjectRequest& request) const;\r\n        PutObjectOutcomeCallable PutObjectCallable(const PutObjectRequest& request) const;\r\n        PutObjectOutcomeCallable UploadPartCallable(const UploadPartRequest& request) const;\r\n        UploadPartCopyOutcomeCallable UploadPartCopyCallable(const UploadPartCopyRequest& request) const;\r\n\r\n        /*Extended APIs*/\r\n#if !defined(OSS_DISABLE_BUCKET)\r\n        bool DoesBucketExist(const std::string& bucket) const;\r\n#endif\r\n        bool DoesObjectExist(const std::string& bucket, const std::string& key) const;\r\n        CopyObjectOutcome ModifyObjectMeta(const std::string& bucket, const std::string& key, const ObjectMetaData& meta);\r\n\r\n        /*Requests control*/\r\n        void DisableRequest();\r\n        void EnableRequest();\r\n\r\n        /*Others*/\r\n        void SetRegion(const std::string& region);\r\n        void SetCloudBoxId(const std::string& cloudboxId);\r\n    protected:\r\n        std::shared_ptr<OssClientImpl> client_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/OssEncryptionClient.h",
    "content": "/*\r\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n*\r\n* Licensed under the Apache License, Version 2.0 (the \"License\");\r\n* you may not use this file except in compliance with the License.\r\n* You may obtain a copy of the License at\r\n*\r\n*      http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing, software\r\n* distributed under the License is distributed on an \"AS IS\" BASIS,\r\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n* See the License for the specific language governing permissions and\r\n* limitations under the License.\r\n*/\r\n\r\n#pragma once\r\n\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include <alibabacloud/oss/encryption/EncryptionMaterials.h>\r\n#include <alibabacloud/oss/encryption/CryptoConfiguration.h>\r\n#include <alibabacloud/oss/model/MultipartUploadCryptoContext.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class EncryptionResumableDownloader;\r\n    class EncryptionResumableUploader;\r\n    class ALIBABACLOUD_OSS_EXPORT OssEncryptionClient : public OssClient\r\n    {\r\n    public:\r\n        OssEncryptionClient(const std::string& endpoint, const std::string& accessKeyId, const std::string& accessKeySecret,\r\n            const ClientConfiguration& configuration,\r\n            const std::shared_ptr<EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig);\r\n\r\n        OssEncryptionClient(const std::string& endpoint, const std::string& accessKeyId, const std::string& accessKeySecret, const std::string& securityToken,\r\n            const ClientConfiguration& configuration,\r\n            const std::shared_ptr<EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig);\r\n\r\n        OssEncryptionClient(const std::string& endpoint, \r\n            const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration& configuration,\r\n            const std::shared_ptr<EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig);\r\n        virtual ~OssEncryptionClient();\r\n\r\n        /*Object*/\r\n        GetObjectOutcome GetObject(const GetObjectRequest& request) const;\r\n        GetObjectOutcome GetObject(const std::string &bucket, const std::string &key, const std::shared_ptr<std::iostream> &content) const;\r\n        GetObjectOutcome GetObject(const std::string &bucket, const std::string &key, const std::string &fileToSave) const;\r\n        PutObjectOutcome PutObject(const PutObjectRequest& request) const;\r\n        PutObjectOutcome PutObject(const std::string &bucket, const std::string &key, const std::shared_ptr<std::iostream> &content) const;\r\n        PutObjectOutcome PutObject(const std::string &bucket, const std::string &key, const std::string &fileToUpload) const;\r\n\r\n        /*MultipartUpload*/\r\n        InitiateMultipartUploadOutcome InitiateMultipartUpload(const InitiateMultipartUploadRequest& request, MultipartUploadCryptoContext& ctx) const;\r\n        PutObjectOutcome UploadPart(const UploadPartRequest& request, const MultipartUploadCryptoContext& ctx) const;\r\n        CompleteMultipartUploadOutcome CompleteMultipartUpload(const CompleteMultipartUploadRequest& request, const MultipartUploadCryptoContext& ctx) const;\r\n\r\n#if !defined(OSS_DISABLE_RESUAMABLE)\r\n        /*Resumable Operation*/\r\n        PutObjectOutcome ResumableUploadObject(const UploadObjectRequest& request) const;\r\n        GetObjectOutcome ResumableDownloadObject(const DownloadObjectRequest& request) const;\r\n#endif\r\n\r\n        /*Aysnc APIs*/\r\n        void GetObjectAsync(const GetObjectRequest& request, const GetObjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;\r\n        void PutObjectAsync(const PutObjectRequest& request, const PutObjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;\r\n        void UploadPartAsync(const UploadPartRequest& request, const UploadPartAsyncHandler& handler, const MultipartUploadCryptoContext& cryptoCtx, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;\r\n\r\n        /*Callable APIs*/\r\n        GetObjectOutcomeCallable GetObjectCallable(const GetObjectRequest& request) const;\r\n        PutObjectOutcomeCallable PutObjectCallable(const PutObjectRequest& request) const;\r\n        PutObjectOutcomeCallable UploadPartCallable(const UploadPartRequest& request, const MultipartUploadCryptoContext& cryptoCtx) const;\r\n\r\n    protected:\r\n        AppendObjectOutcome AppendObject(const AppendObjectRequest& request) const;\r\n        UploadPartCopyOutcome UploadPartCopy(const UploadPartCopyRequest& request, const MultipartUploadCryptoContext& ctx) const;\r\n        void UploadPartCopyAsync(const UploadPartCopyRequest& request, const UploadPartCopyAsyncHandler& handler, const MultipartUploadCryptoContext& cryptoCtx, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;\r\n        UploadPartCopyOutcomeCallable UploadPartCopyCallable(const UploadPartCopyRequest& request, const MultipartUploadCryptoContext& cryptoCtx) const;\r\n        CopyObjectOutcome ResumableCopyObject(const MultiCopyObjectRequest& request) const;\r\n        GetObjectOutcome GetObjectByUrl(const GetObjectByUrlRequest& request) const;\r\n        PutObjectOutcome PutObjectByUrl(const PutObjectByUrlRequest& request) const;\r\n\r\n    private:\r\n        friend class EncryptionResumableDownloader;\r\n        friend class EncryptionResumableUploader;\r\n        GetObjectOutcome GetObjectInternal(const GetObjectRequest& request, const ObjectMetaData& meta) const;\r\n    private:\r\n        std::shared_ptr<EncryptionMaterials> encryptionMaterials_;\r\n        CryptoConfiguration cryptoConfig_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/OssError.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n\n#include <string>\n#include <alibabacloud/oss/Export.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT OssError\n    {\n    public:\n        OssError() = default;\n        OssError(const std::string& code, const std::string& message) :\n            code_(code),\n            message_(message)\n        {\n        }\n        OssError(const OssError& rhs) :\n            code_(rhs.code_),\n            message_(rhs.message_),\n            requestId_(rhs.requestId_),\n            host_(rhs.host_)\n        {\n        }\n        OssError(OssError&& lhs) :\n            code_(std::move(lhs.code_)),\n            message_(std::move(lhs.message_)),\n            requestId_(std::move(lhs.requestId_)),\n            host_(std::move(lhs.host_))\n        {\n        }\n        OssError& operator=(OssError&& lhs)\n        {\n            code_ = std::move(lhs.code_);\n            message_ = std::move(lhs.message_);\n            requestId_ = std::move(lhs.requestId_);\n            host_ = std::move(lhs.host_);\n            return *this;\n        }\n        OssError& operator=(const OssError& rhs)\n        {\n            code_ = rhs.code_;\n            message_ = rhs.message_;\n            requestId_ = rhs.requestId_;\n            host_ = rhs.host_;\n            return *this;\n        }\n\n        ~OssError() = default;\n        const std::string& Code()const { return code_; }\n        const std::string& Message() const { return message_; }\n        const std::string& RequestId() const { return requestId_; }\n        const std::string& Host() const { return host_; }\n        void setCode(const std::string& value) { code_ = value; }\n        void setCode(const char *value) { code_ = value; }\n        void setMessage(const std::string& value) { message_ = value; }\n        void setMessage(const char *value) { message_ = value; }\n        void setRequestId(const std::string& value) { requestId_ = value; }\n        void setRequestId(const char *value) { requestId_ = value; }\n        void setHost(const std::string& value) { host_ = value; }\n        void setHost(const char *value) { host_ = value; }\n    private:\n        std::string code_;\n        std::string message_;\n        std::string requestId_;\n        std::string host_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/OssFwd.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n#include <memory>\r\n#include <iostream>\r\n#include <alibabacloud/oss/Global.h>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/OssError.h>\r\n#include <alibabacloud/oss/ServiceResult.h>\r\n#include <alibabacloud/oss/utils/Outcome.h>\r\n#include <alibabacloud/oss/model/VoidResult.h>\r\n\r\n#if !defined(OSS_DISABLE_BUCKET)\r\n#include <alibabacloud/oss/model/ListBucketsRequest.h>\r\n#include <alibabacloud/oss/model/ListBucketsResult.h>\r\n#include <alibabacloud/oss/model/CreateBucketRequest.h>\r\n#include <alibabacloud/oss/model/SetBucketAclRequest.h>\r\n#include <alibabacloud/oss/model/SetBucketLoggingRequest.h>\r\n#include <alibabacloud/oss/model/SetBucketWebsiteRequest.h>\r\n#include <alibabacloud/oss/model/SetBucketRefererRequest.h>\r\n#include <alibabacloud/oss/model/SetBucketLifecycleRequest.h>\r\n#include <alibabacloud/oss/model/SetBucketCorsRequest.h>\r\n#include <alibabacloud/oss/model/SetBucketStorageCapacityRequest.h>\r\n#include <alibabacloud/oss/model/DeleteBucketRequest.h>\r\n#include <alibabacloud/oss/model/DeleteBucketLoggingRequest.h>\r\n#include <alibabacloud/oss/model/DeleteBucketWebsiteRequest.h>\r\n#include <alibabacloud/oss/model/DeleteBucketLifecycleRequest.h>\r\n#include <alibabacloud/oss/model/DeleteBucketCorsRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketAclRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketAclResult.h>\r\n#include <alibabacloud/oss/model/GetBucketLocationRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketLocationResult.h>\r\n#include <alibabacloud/oss/model/GetBucketInfoRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketInfoResult.h>\r\n#include <alibabacloud/oss/model/GetBucketLoggingRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketLoggingResult.h>\r\n#include <alibabacloud/oss/model/GetBucketWebsiteRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketWebsiteResult.h>\r\n#include <alibabacloud/oss/model/GetBucketRefererRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketRefererResult.h>\r\n#include <alibabacloud/oss/model/GetBucketLifecycleRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketLifecycleResult.h>\r\n#include <alibabacloud/oss/model/GetBucketStatRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketStatResult.h>\r\n#include <alibabacloud/oss/model/GetBucketCorsRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketCorsResult.h>\r\n#include <alibabacloud/oss/model/GetBucketStorageCapacityRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketStorageCapacityResult.h>\r\n#include <alibabacloud/oss/model/SetBucketPolicyRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketPolicyRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketPolicyResult.h>\r\n#include <alibabacloud/oss/model/DeleteBucketPolicyRequest.h>\r\n#include <alibabacloud/oss/model/SetBucketPaymentRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketPaymentRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketPaymentResult.h>\r\n#include <alibabacloud/oss/model/SetBucketEncryptionRequest.h>\r\n#include <alibabacloud/oss/model/DeleteBucketEncryptionRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketEncryptionRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketEncryptionResult.h>\r\n#include <alibabacloud/oss/model/SetBucketTaggingRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketTaggingRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketTaggingResult.h>\r\n#include <alibabacloud/oss/model/DeleteBucketTaggingRequest.h>\r\n#include <alibabacloud/oss/model/SetBucketQosInfoRequest.h>\r\n#include <alibabacloud/oss/model/DeleteBucketQosInfoRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketQosInfoRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketQosInfoResult.h>\r\n#include <alibabacloud/oss/model/GetUserQosInfoRequest.h>\r\n#include <alibabacloud/oss/model/GetUserQosInfoResult.h>\r\n#include <alibabacloud/oss/model/SetBucketVersioningRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketVersioningRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketVersioningResult.h>\r\n#include <alibabacloud/oss/model/SetBucketInventoryConfigurationRequest.h>\r\n#include <alibabacloud/oss/model/DeleteBucketInventoryConfigurationRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketInventoryConfigurationResult.h>\r\n#include <alibabacloud/oss/model/GetBucketInventoryConfigurationRequest.h>\r\n#include <alibabacloud/oss/model/ListBucketInventoryConfigurationsRequest.h>\r\n#include <alibabacloud/oss/model/ListBucketInventoryConfigurationsResult.h>\r\n#include <alibabacloud/oss/model/InitiateBucketWormRequest.h>\r\n#include <alibabacloud/oss/model/InitiateBucketWormResult.h>\r\n#include <alibabacloud/oss/model/AbortBucketWormRequest.h>\r\n#include <alibabacloud/oss/model/CompleteBucketWormRequest.h>\r\n#include <alibabacloud/oss/model/ExtendBucketWormRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketWormRequest.h>\r\n#include <alibabacloud/oss/model/GetBucketWormResult.h>\r\n#endif\r\n\r\n#include <alibabacloud/oss/model/ListObjectsRequest.h>\r\n#include <alibabacloud/oss/model/ListObjectsResult.h>\r\n#include <alibabacloud/oss/model/ListObjectsV2Request.h>\r\n#include <alibabacloud/oss/model/ListObjectsV2Result.h>\r\n#include <alibabacloud/oss/model/ListObjectVersionsRequest.h>\r\n#include <alibabacloud/oss/model/ListObjectVersionsResult.h>\r\n#include <alibabacloud/oss/model/GetObjectRequest.h>\r\n#include <alibabacloud/oss/model/GetObjectResult.h>\r\n#include <alibabacloud/oss/model/PutObjectRequest.h>\r\n#include <alibabacloud/oss/model/PutObjectResult.h>\r\n#include <alibabacloud/oss/model/DeleteObjectRequest.h>\r\n#include <alibabacloud/oss/model/DeleteObjectResult.h>\r\n#include <alibabacloud/oss/model/DeleteObjectsRequest.h>\r\n#include <alibabacloud/oss/model/DeleteObjectsResult.h>\r\n#include <alibabacloud/oss/model/DeleteObjectVersionsRequest.h>\r\n#include <alibabacloud/oss/model/DeleteObjectVersionsResult.h>\r\n#include <alibabacloud/oss/model/HeadObjectRequest.h>\r\n#include <alibabacloud/oss/model/GetObjectMetaRequest.h>\r\n#include <alibabacloud/oss/model/GeneratePresignedUrlRequest.h>\r\n#include <alibabacloud/oss/model/GetObjectByUrlRequest.h>\r\n#include <alibabacloud/oss/model/PutObjectByUrlRequest.h>\r\n#include <alibabacloud/oss/model/GetObjectAclRequest.h>\r\n#include <alibabacloud/oss/model/GetObjectAclResult.h>\r\n#include <alibabacloud/oss/model/AppendObjectRequest.h>\r\n#include <alibabacloud/oss/model/AppendObjectResult.h>\r\n#include <alibabacloud/oss/model/CopyObjectRequest.h>\r\n#include <alibabacloud/oss/model/CopyObjectResult.h>\r\n#include <alibabacloud/oss/model/GetSymlinkRequest.h>\r\n#include <alibabacloud/oss/model/GetSymlinkResult.h>\r\n#include <alibabacloud/oss/model/RestoreObjectRequest.h>\r\n#include <alibabacloud/oss/model/RestoreObjectResult.h>\r\n#include <alibabacloud/oss/model/CreateSymlinkRequest.h>\r\n#include <alibabacloud/oss/model/CreateSymlinkResult.h>\r\n#include <alibabacloud/oss/model/SetObjectAclRequest.h>\r\n#include <alibabacloud/oss/model/SetObjectAclResult.h>\r\n#include <alibabacloud/oss/model/ProcessObjectRequest.h>\r\n#include <alibabacloud/oss/model/ObjectCallbackBuilder.h>\r\n#include <alibabacloud/oss/model/SelectObjectRequest.h>\r\n#include <alibabacloud/oss/model/CreateSelectObjectMetaRequest.h>\r\n#include <alibabacloud/oss/model/CreateSelectObjectMetaResult.h>\r\n#include <alibabacloud/oss/model/SetObjectTaggingRequest.h>\r\n#include <alibabacloud/oss/model/SetObjectTaggingResult.h>\r\n#include <alibabacloud/oss/model/GetObjectTaggingRequest.h>\r\n#include <alibabacloud/oss/model/GetObjectTaggingResult.h>\r\n#include <alibabacloud/oss/model/DeleteObjectTaggingRequest.h>\r\n#include <alibabacloud/oss/model/DeleteObjectTaggingResult.h>\r\n\r\n#include <alibabacloud/oss/model/InitiateMultipartUploadRequest.h>\r\n#include <alibabacloud/oss/model/InitiateMultipartUploadResult.h>\r\n#include <alibabacloud/oss/model/UploadPartRequest.h>\r\n#include <alibabacloud/oss/model/UploadPartCopyRequest.h>\r\n#include <alibabacloud/oss/model/UploadPartCopyResult.h>\r\n#include <alibabacloud/oss/model/CompleteMultipartUploadRequest.h>\r\n#include <alibabacloud/oss/model/CompleteMultipartUploadResult.h>\r\n#include <alibabacloud/oss/model/AbortMultipartUploadRequest.h>\r\n#include <alibabacloud/oss/model/ListMultipartUploadsRequest.h>\r\n#include <alibabacloud/oss/model/ListMultipartUploadsResult.h>\r\n#include <alibabacloud/oss/model/ListPartsRequest.h>\r\n#include <alibabacloud/oss/model/ListPartsResult.h>\r\n\r\n#if !defined(OSS_DISABLE_RESUAMABLE)\r\n#include <alibabacloud/oss/model/UploadObjectRequest.h>\r\n#include <alibabacloud/oss/model/MultiCopyObjectRequest.h>\r\n#include <alibabacloud/oss/model/DownloadObjectRequest.h>\r\n#endif\r\n\r\n#if !defined(OSS_DISABLE_LIVECHANNEL)\r\n#include <alibabacloud/oss/model/PutLiveChannelStatusRequest.h>\r\n#include <alibabacloud/oss/model/PutLiveChannelRequest.h>\r\n#include <alibabacloud/oss/model/PutLiveChannelResult.h>\r\n#include <alibabacloud/oss/model/PostVodPlaylistRequest.h>\r\n#include <alibabacloud/oss/model/GetVodPlaylistRequest.h>\r\n#include <alibabacloud/oss/model/GetVodPlaylistResult.h>\r\n#include <alibabacloud/oss/model/GetLiveChannelStatRequest.h>\r\n#include <alibabacloud/oss/model/GetLiveChannelStatResult.h>\r\n#include <alibabacloud/oss/model/GetLiveChannelInfoRequest.h>\r\n#include <alibabacloud/oss/model/GetLiveChannelInfoResult.h>\r\n#include <alibabacloud/oss/model/GetLiveChannelHistoryRequest.h>\r\n#include <alibabacloud/oss/model/GetLiveChannelHistoryResult.h>\r\n#include <alibabacloud/oss/model/ListLiveChannelRequest.h>\r\n#include <alibabacloud/oss/model/ListLiveChannelResult.h>\r\n#include <alibabacloud/oss/model/DeleteLiveChannelRequest.h>\r\n#include <alibabacloud/oss/model/GenerateRTMPSignedUrlRequest.h>\r\n#endif\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    using OssOutcome = Outcome<OssError, ServiceResult>;\r\n    using VoidOutcome = Outcome<OssError, VoidResult>;\r\n    using StringOutcome = Outcome<OssError, std::string>;\r\n\r\n#if !defined(OSS_DISABLE_BUCKET)\r\n    using ListBucketsOutcome = Outcome<OssError, ListBucketsResult>;\r\n    using CreateBucketOutcome = Outcome<OssError, Bucket>;\r\n    using ListBucketInventoryConfigurationsOutcome = Outcome<OssError, ListBucketInventoryConfigurationsResult>;\r\n\r\n    using GetBucketAclOutcome = Outcome<OssError, GetBucketAclResult>;\r\n    using GetBucketLocationOutcome = Outcome<OssError, GetBucketLocationResult>;\r\n    using GetBucketInfoOutcome = Outcome<OssError, GetBucketInfoResult>;\r\n    using GetBucketLoggingOutcome = Outcome<OssError, GetBucketLoggingResult>;\r\n    using GetBucketWebsiteOutcome = Outcome<OssError, GetBucketWebsiteResult>;\r\n    using GetBucketRefererOutcome = Outcome<OssError, GetBucketRefererResult>;\r\n    using GetBucketLifecycleOutcome = Outcome<OssError, GetBucketLifecycleResult>;\r\n    using GetBucketStatOutcome = Outcome<OssError, GetBucketStatResult>;\r\n    using GetBucketCorsOutcome = Outcome<OssError, GetBucketCorsResult>;\r\n    using GetBucketStorageCapacityOutcome = Outcome<OssError, GetBucketStorageCapacityResult>;\r\n    using GetBucketPolicyOutcome = Outcome<OssError, GetBucketPolicyResult>;\r\n    using GetBucketPaymentOutcome = Outcome<OssError, GetBucketPaymentResult>;\r\n    using GetBucketEncryptionOutcome = Outcome<OssError, GetBucketEncryptionResult>;\r\n    using GetBucketTaggingOutcome = Outcome<OssError, GetBucketTaggingResult>;\r\n    using GetBucketQosInfoOutcome = Outcome<OssError, GetBucketQosInfoResult>;\r\n    using GetUserQosInfoOutcome = Outcome<OssError, GetUserQosInfoResult>;\r\n    using GetBucketVersioningOutcome = Outcome<OssError, GetBucketVersioningResult>;\r\n    using GetBucketInventoryConfigurationOutcome = Outcome<OssError, GetBucketInventoryConfigurationResult>;\r\n    using InitiateBucketWormOutcome = Outcome<OssError, InitiateBucketWormResult>;\r\n    using GetBucketWormOutcome = Outcome<OssError, GetBucketWormResult>;\r\n#endif\r\n\r\n    using ListObjectOutcome = Outcome<OssError, ListObjectsResult>;\r\n    using ListObjectsV2Outcome = Outcome<OssError, ListObjectsV2Result>;\r\n    using ListObjectVersionsOutcome = Outcome<OssError, ListObjectVersionsResult>;\r\n\r\n    using GetObjectOutcome = Outcome<OssError, GetObjectResult>;\r\n    using PutObjectOutcome = Outcome<OssError, PutObjectResult>;\r\n    using DeleteObjectOutcome = Outcome<OssError, DeleteObjectResult>;\r\n    using DeleteObjecstOutcome = Outcome<OssError, DeleteObjectsResult>;\r\n    using DeleteObjecVersionstOutcome = Outcome<OssError, DeleteObjectVersionsResult>;\r\n    using ObjectMetaDataOutcome = Outcome<OssError, ObjectMetaData>;\r\n\r\n    using GetObjectAclOutcome = Outcome<OssError, GetObjectAclResult>;\r\n    using SetObjectAclOutcome = Outcome<OssError, SetObjectAclResult>;\r\n    using AppendObjectOutcome = Outcome<OssError, AppendObjectResult>;\r\n    using CopyObjectOutcome = Outcome<OssError, CopyObjectResult>;\r\n    using RestoreObjectOutcome = Outcome<OssError, RestoreObjectResult>;\r\n    using GetSymlinkOutcome = Outcome<OssError, GetSymlinkResult>;\r\n    using CreateSymlinkOutcome = Outcome<OssError, CreateSymlinkResult>;\r\n    using CreateSelectObjectMetaOutcome = Outcome<OssError, CreateSelectObjectMetaResult>;\r\n    using SetObjectTaggingOutcome = Outcome<OssError, SetObjectTaggingResult>;\r\n    using GetObjectTaggingOutcome = Outcome<OssError, GetObjectTaggingResult>;\r\n    using DeleteObjectTaggingOutcome = Outcome<OssError, DeleteObjectTaggingResult>;\r\n\r\n    /*multipart*/\r\n    using InitiateMultipartUploadOutcome = Outcome<OssError, InitiateMultipartUploadResult>;\r\n    using UploadPartCopyOutcome = Outcome<OssError, UploadPartCopyResult>;\r\n    using CompleteMultipartUploadOutcome = Outcome<OssError, CompleteMultipartUploadResult>;\r\n    using ListMultipartUploadsOutcome = Outcome<OssError, ListMultipartUploadsResult>;\r\n    using ListPartsOutcome = Outcome<OssError, ListPartsResult>;\r\n\r\n#if !defined(OSS_DISABLE_LIVECHANNEL)\r\n    /*livechannel*/\r\n    using PutLiveChannelOutcome = Outcome<OssError, PutLiveChannelResult>;\r\n    using GetLiveChannelStatOutcome = Outcome<OssError, GetLiveChannelStatResult>;\r\n    using GetLiveChannelInfoOutcome = Outcome<OssError, GetLiveChannelInfoResult>;\r\n    using GetLiveChannelHistoryOutcome = Outcome<OssError, GetLiveChannelHistoryResult>;\r\n    using ListLiveChannelOutcome = Outcome<OssError, ListLiveChannelResult>;\r\n    using GetVodPlaylistOutcome = Outcome<OssError, GetVodPlaylistResult>;\r\n#endif\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/OssRequest.h",
    "content": "/*\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n*      http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n#pragma once\n\n#include <string>\n#include <alibabacloud/oss/ServiceRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class OssClientImpl;\n    class OssEncryptionClient;\n    class  ALIBABACLOUD_OSS_EXPORT OssRequest : public ServiceRequest\n    {\n    public:\n        OssRequest();\n        virtual ~ OssRequest() = default;\n        virtual HeaderCollection Headers() const;\n        virtual ParameterCollection Parameters() const;\n        virtual std::shared_ptr<std::iostream> Body() const;\n    protected:\n        OssRequest(const std::string& bucket, const std::string& key);\n        friend class OssClientImpl;\n        friend class OssEncryptionClient;\n\n        virtual int validate() const;\n        const char *validateMessage(int code) const;\n        \n        virtual std::string payload() const;\n        virtual HeaderCollection specialHeaders() const;\n        virtual ParameterCollection specialParameters() const;\n        \n        const std::string& bucket() const;\n        const std::string& key()  const;\n    protected:\n        std::string bucket_;\n        std::string key_;\n    };\n\n    class ALIBABACLOUD_OSS_EXPORT OssBucketRequest : public OssRequest\n    {\n    public:\n        OssBucketRequest(const std::string& bucket):\n            OssRequest(bucket, \"\")\n        {}\n        void setBucket(const std::string& bucket);\n        const std::string& Bucket() const;\n    protected:\n        virtual int validate() const;\n    };\n\n    class ALIBABACLOUD_OSS_EXPORT OssObjectRequest : public OssRequest\n    {\n    public:\n        OssObjectRequest(const std::string& bucket, const std::string& key) :\n            OssRequest(bucket, key),\n            requestPayer_(AlibabaCloud::OSS::RequestPayer::NotSet),\n            versionId_()\n        {}\n        void setBucket(const std::string& bucket);\n        const std::string& Bucket() const;\n\n        void setKey(const std::string& key);\n        const std::string& Key() const;\n\n        void setRequestPayer(AlibabaCloud::OSS::RequestPayer value);\n        AlibabaCloud::OSS::RequestPayer RequestPayer() const;\n        void setVersionId(const std::string& versionId);\n        const std::string& VersionId() const;\n    protected:\n        virtual int validate() const;\n        virtual HeaderCollection specialHeaders() const;\n        virtual ParameterCollection specialParameters() const;\n        AlibabaCloud::OSS::RequestPayer requestPayer_;\n        std::string versionId_;\n    };\n\n    class ALIBABACLOUD_OSS_EXPORT OssResumableBaseRequest : public OssRequest\n    {\n    public:\n        OssResumableBaseRequest(const std::string& bucket, const std::string& key,\n            const std::string& checkpointDir, const uint64_t partSize, const uint32_t threadNum) :\n            OssRequest(bucket, key), \n            partSize_(partSize),\n            checkpointDir_(checkpointDir),\n            requestPayer_(AlibabaCloud::OSS::RequestPayer::NotSet),\n            trafficLimit_(0),\n            versionId_()\n        {\n            threadNum_ = threadNum == 0 ? 1 : threadNum;\n        }\n\n        OssResumableBaseRequest(const std::string& bucket, const std::string& key,\n            const std::wstring& checkpointDir, const uint64_t partSize, const uint32_t threadNum) :\n            OssRequest(bucket, key),\n            partSize_(partSize),\n            checkpointDirW_(checkpointDir),\n            requestPayer_(AlibabaCloud::OSS::RequestPayer::NotSet),\n            trafficLimit_(0),\n            versionId_()\n        {\n            threadNum_ = threadNum == 0 ? 1 : threadNum;\n        }\n\n        void setBucket(const std::string& bucket);\n        const std::string& Bucket() const;\n\n        void setKey(const std::string& key);\n        const std::string& Key() const;\n        \n        void setPartSize(uint64_t partSize);\n        uint64_t PartSize() const;\n\n        void setObjectSize(uint64_t objectSize);\n        uint64_t ObjectSize() const;\n        \n        void setThreadNum(uint32_t threadNum);\n        uint32_t ThreadNum() const;\n\n        void setCheckpointDir(const std::string& checkpointDir);\n        const std::string& CheckpointDir() const;\n\n        void setCheckpointDir(const std::wstring& checkpointDir);\n        const std::wstring& CheckpointDirW() const;\n\n        bool hasCheckpointDir() const;\n\n        void setObjectMtime(const std::string& mtime);\n        const std::string& ObjectMtime() const;\n\n        void setRequestPayer(RequestPayer value);\n        AlibabaCloud::OSS::RequestPayer RequestPayer() const;\n\t\t\n        void setTrafficLimit(uint64_t value);\n        uint64_t TrafficLimit() const;\n\n        void setVersionId(const std::string& versionId);\n        const std::string& VersionId() const;\n\n    protected:\n        friend class OssClientImpl;\n        friend class OssEncryptionClient;\n        virtual int validate() const;\n        const char *validateMessage(int code) const;\n\n    protected:\n        uint64_t partSize_;\n        uint64_t objectSize_;\n        uint32_t threadNum_;\n        std::string checkpointDir_;\n        std::wstring checkpointDirW_;\r\n        std::string mtime_;\n        AlibabaCloud::OSS::RequestPayer requestPayer_;\n        uint64_t trafficLimit_;\n        std::string versionId_;\n    };\n\n    class ALIBABACLOUD_OSS_EXPORT LiveChannelRequest : public OssRequest\n    {\n    public:\n        LiveChannelRequest(const std::string &bucket, const std::string &channelName) :\n            OssRequest(bucket, channelName),\n            channelName_(channelName)\n        {}\n        void setBucket(const std::string &bucket);\n        const std::string& Bucket() const;\n\n        void setChannelName(const std::string &channelName);\n        const std::string& ChannelName() const;\n    protected:\n        virtual int validate() const;\n    protected:\n        std::string channelName_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/OssResponse.h",
    "content": "/*\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n*      http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n#pragma once\n\n#include <string>\n#include <alibabacloud/oss/Export.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT OssResponse\n    {\n    public:\n        OssResponse();\n        explicit OssResponse(const std::string& payload);\n        ~OssResponse();\n        std::string payload()const;\n    private:\n        std::string payload_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/OssResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <string>\r\n#include <vector>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    using CommonPrefixeList = std::vector<std::string>;\r\n\r\n    class OssClientImpl;\r\n    class ALIBABACLOUD_OSS_EXPORT OssResult\r\n    {\r\n    public:\r\n        OssResult();\r\n        OssResult(const HeaderCollection& value);\r\n        virtual ~OssResult() {};\r\n        const std::string& RequestId() const {return requestId_;}\r\n    protected:\r\n        friend class OssClientImpl;\r\n        bool ParseDone() { return parseDone_; };\r\n        bool parseDone_;\r\n        std::string requestId_;\r\n    };\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT OssObjectResult : public OssResult\r\n    {\r\n    public:\r\n        OssObjectResult();\r\n        OssObjectResult(const HeaderCollection& value);\r\n        virtual ~OssObjectResult() {};\r\n        const std::string& VersionId() const { return versionId_; }\r\n    protected:\r\n        std::string versionId_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/ServiceRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    const int REQUEST_FLAG_CONTENTMD5    = (1 << 0);\n    const int REQUEST_FLAG_PARAM_IN_PATH = (1 << 1);\n    const int REQUEST_FLAG_CHECK_CRC64   = (1 << 2);\n    const int REQUEST_FLAG_SAVE_CLIENT_CRC64 = (1 << 3);\n    const int REQUEST_FLAG_CHUNKED_ENCODING = (1 << 4);\n\n    class ALIBABACLOUD_OSS_EXPORT ServiceRequest\n    {\n    public:\n        virtual ~ServiceRequest() = default;\n\n        std::string Path() const;\n        virtual HeaderCollection Headers() const = 0;\n        virtual ParameterCollection Parameters() const = 0;\n        virtual std::shared_ptr<std::iostream> Body() const = 0;\n\n        int Flags() const;\n        void setFlags(int flags);\n\n        const IOStreamFactory& ResponseStreamFactory() const;\n        void setResponseStreamFactory(const IOStreamFactory& factory);\n        \n        const AlibabaCloud::OSS::TransferProgress& TransferProgress() const;\n        void setTransferProgress(const AlibabaCloud::OSS::TransferProgress& arg);\n\n    protected:\n        ServiceRequest();\n        void setPath(const std::string &path);\n    private:\n        int flags_;\n        std::string path_;\n        IOStreamFactory responseStreamFactory_;\n        AlibabaCloud::OSS::TransferProgress transferProgress_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/ServiceResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n\n#include <string>\n#include <memory>\n#include <iostream>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class  ServiceResult\n    {\n    public:\n        ServiceResult() {}\n        virtual ~ServiceResult() {};\n\n        inline const std::string& RequestId() const {return requestId_;}\n        inline const std::shared_ptr<std::iostream>& payload() const {return payload_;}\n        inline const HeaderCollection& headerCollection() const {return headerCollection_;}\n        inline int responseCode() const {return responseCode_;}\n\n        void setRequestId(const std::string& requestId) {requestId_ = requestId;}\n        void setPlayload(const std::shared_ptr<std::iostream>& payload) {payload_ = payload;}\n        void setHeaderCollection(const HeaderCollection& values) { headerCollection_ = values;}\n        void setResponseCode(const int code) { responseCode_ = code;} \n    private:\n        std::string requestId_;\n        std::shared_ptr<std::iostream> payload_;\n        HeaderCollection headerCollection_;\n        int responseCode_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/Types.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n#include <cstdint> \r\n#include <vector>\r\n#include <string>\r\n#include <map>\r\n#include <set>\r\n#include <memory>\r\n#include <functional>\r\n#include <alibabacloud/oss/Export.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    enum StorageClass\r\n    {\r\n        Standard,       // Standard bucket\r\n        IA,             // Infrequent Access bucket\r\n        Archive,        // Archive bucket\r\n        ColdArchive     // Cold Archive bucket\r\n    };\r\n\r\n    enum CannedAccessControlList\r\n    {\r\n        Private = 0,\r\n        PublicRead,\r\n        PublicReadWrite,\r\n        Default\r\n    };\r\n\r\n    enum CopyActionList\r\n    {\r\n        Copy = 0,\r\n        Replace\r\n    };\r\n\r\n    enum EncodingType {\r\n        STRING_ANY,\r\n        URL,\r\n    };\r\n\r\n    enum RequestResponseHeader {\r\n        ContentType,\r\n        ContentLanguage,\r\n        Expires,\r\n        CacheControl,\r\n        ContentDisposition,\r\n        ContentEncoding,\r\n    };\r\n\r\n    enum RuleStatus\r\n    {\r\n        Enabled,\r\n        Disabled\r\n    };\r\n\r\n    enum LogLevel\r\n    {\r\n        LogOff = 0,\r\n        LogFatal,\r\n        LogError,\r\n        LogWarn,\r\n        LogInfo,\r\n        LogDebug,\r\n        LogTrace,\r\n        LogAll,\r\n    };\r\n\r\n    enum LiveChannelStatus\r\n    {\r\n        EnabledStatus,\r\n        DisabledStatus,\r\n        IdleStatus,\r\n        LiveStatus,\r\n        UnknownStatus=99\r\n    };\r\n\r\n\r\n    enum class RequestPayer\r\n    {\r\n        NotSet = 0,\r\n        BucketOwner,\r\n        Requester\r\n    };\r\n\r\n    enum class SSEAlgorithm\r\n    {\r\n        NotSet = 0,\r\n        KMS,\r\n        AES256\r\n    };\r\n\r\n    enum class DataRedundancyType\r\n    {\r\n        NotSet = 0,\r\n        LRS,\r\n        ZRS\r\n    };\r\n\r\n    enum class VersioningStatus\r\n    {\r\n        NotSet,\r\n        Enabled,\r\n        Suspended\r\n    };\r\n\r\n    enum class InventoryFormat\r\n    {\r\n        NotSet,\r\n        CSV\r\n    };\r\n\r\n    enum class InventoryFrequency\r\n    {\r\n        NotSet,\r\n        Daily,\r\n        Weekly\r\n    };\r\n\r\n    enum class InventoryOptionalField\r\n    {\r\n        NotSet,\r\n        Size,\r\n        LastModifiedDate,\r\n        ETag,\r\n        StorageClass,\r\n        IsMultipartUploaded,\r\n        EncryptionStatus\r\n    };\r\n\r\n    enum class InventoryIncludedObjectVersions\r\n    { \r\n        NotSet,\r\n        All,\r\n        Current\r\n    };\r\n\r\n    enum class TierType\r\n    {\r\n        Expedited,\r\n        Standard,\r\n        Bulk\r\n    };\r\n\r\n    enum class SignatureVersionType\r\n    {\r\n        V1,\r\n        V4,\r\n    };\r\n\r\n\r\n    typedef void(*LogCallback)(LogLevel level, const std::string& stream);\r\n\r\n    struct  ALIBABACLOUD_OSS_EXPORT caseSensitiveLess\r\n    {\r\n        bool operator() (const std::string& lhs, const std::string& rhs) const\r\n        {\r\n            return lhs < rhs;\r\n        }\r\n    };\r\n\r\n    struct  ALIBABACLOUD_OSS_EXPORT caseInsensitiveLess\r\n    {\r\n        bool operator() (const std::string& lhs, const std::string& rhs) const\r\n        {\r\n            auto first1 = lhs.begin(), last1 = lhs.end();\r\n            auto first2 = rhs.begin(), last2 = rhs.end();\r\n            while (first1 != last1) {\r\n                if (first2 == last2)\r\n                    return false;\r\n                auto first1_ch = ::tolower(*first1);\r\n                auto first2_ch = ::tolower(*first2);\r\n                if (first1_ch != first2_ch) {\r\n                    return (first1_ch < first2_ch);\r\n                }\r\n                ++first1; ++first2;\r\n            }\r\n            return (first2 != last2);\r\n        }\r\n    };\r\n\r\n    using TransferProgressHandler = std::function<void(size_t increment, int64_t transferred, int64_t total, void *userData)>;\r\n    struct  ALIBABACLOUD_OSS_EXPORT TransferProgress\r\n    {\r\n        TransferProgressHandler Handler;\r\n        void *UserData;\r\n    };\r\n\r\n    using RefererList = std::vector<std::string>;\r\n    using MetaData = std::map<std::string, std::string, caseInsensitiveLess>;\r\n    using HeaderCollection = std::map<std::string, std::string, caseInsensitiveLess>;\r\n    using ParameterCollection = std::map<std::string, std::string, caseSensitiveLess>;\r\n    using IOStreamFactory = std::function< std::shared_ptr<std::iostream>(void)>;\r\n    using ByteBuffer = std::vector<unsigned char>;\r\n    using HeaderSet = std::set<std::string, caseInsensitiveLess>;\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/auth/Credentials.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <string>\n#include <alibabacloud/oss/Export.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT Credentials\n    {\n        public:\n            Credentials(const std::string& accessKeyId, const std::string& accessKeySecret,\n                const std::string& sessionToken=\"\");\n            ~Credentials();\n            const std::string& AccessKeyId () const;\n            const std::string& AccessKeySecret () const;\n            const std::string& SessionToken () const;\n            void setAccessKeyId(const std::string& accessKeyId);\n            void setAccessKeySecret(const std::string& accessKeySecret);\n            void setSessionToken (const std::string& sessionToken);\n        private:\n            std::string accessKeyId_;\n            std::string accessKeySecret_;\n            std::string sessionToken_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/auth/CredentialsProvider.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include \"Credentials.h\"\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT CredentialsProvider\n    {\n    public:\n        CredentialsProvider() = default;\n        virtual ~CredentialsProvider();\n        virtual Credentials getCredentials() = 0;\n    private:\n\n    };\n\n    class ALIBABACLOUD_OSS_EXPORT SimpleCredentialsProvider : public CredentialsProvider\n    {\n    public:\n        SimpleCredentialsProvider(const Credentials& credentials);\n        SimpleCredentialsProvider(const std::string& accessKeyId,\n            const std::string& accessKeySecret, const std::string& securityToken = \"\");\n        ~SimpleCredentialsProvider();\n\n        virtual Credentials getCredentials() override;\n    private:\n        Credentials credentials_;\n    };\n\n    class ALIBABACLOUD_OSS_EXPORT EnvironmentVariableCredentialsProvider : public CredentialsProvider\n    {\n    public:\n        Credentials getCredentials() override;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/client/AsyncCallerContext.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <string>\n#include <alibabacloud/oss/Export.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT AsyncCallerContext\n    {\n    public:\n        AsyncCallerContext();\n        explicit AsyncCallerContext(const std::string &uuid);\n        virtual ~AsyncCallerContext();\n        \n        const std::string &Uuid()const;\n        void setUuid(const std::string &uuid);\n    private:\n        std::string uuid_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/client/ClientConfiguration.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <memory>\r\n#include <string>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/auth/CredentialsProvider.h>\r\n#include <alibabacloud/oss/http/HttpClient.h>\r\n#include <alibabacloud/oss/http/HttpInterceptor.h>\r\n#include <alibabacloud/oss/utils/Executor.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class RetryStrategy;\r\n    class RateLimiter;\r\n    class ALIBABACLOUD_OSS_EXPORT ClientConfiguration\r\n    {\r\n    public:\r\n        ClientConfiguration();\r\n        ~ClientConfiguration() = default;\r\n    public:\r\n        /**\r\n        * User Agent string user for http calls.\r\n        */\r\n        std::string userAgent;\r\n        /**\r\n        * Http scheme to use. E.g. Http or Https.\r\n        */\r\n        Http::Scheme scheme;\r\n        /**\r\n        * Max concurrent tcp connections for a single http client to use.\r\n        */\r\n        unsigned maxConnections;\r\n        /**\r\n        * Socket read timeouts. Default 3000 ms. \r\n        */\r\n        long requestTimeoutMs;\r\n        /**\r\n        * Socket connect timeout. \r\n        */\r\n        long connectTimeoutMs;\r\n        /**\r\n        * Strategy to use in case of failed requests.\r\n        */\r\n        std::shared_ptr<RetryStrategy> retryStrategy;\r\n        /**\r\n        * The proxy scheme. Default HTTP\r\n        */\r\n        Http::Scheme proxyScheme;\r\n        /**\r\n        * The proxy host.\r\n        */\r\n        std::string proxyHost;\r\n        /**\r\n        * The proxy port.\r\n        */\r\n        unsigned int proxyPort;\r\n        /**\r\n        * The proxy username.\r\n        */\r\n        std::string proxyUserName;\r\n        /**\r\n        *  The proxy password\r\n        */\r\n        std::string proxyPassword;\r\n        /**\r\n        * set false to bypass SSL check.\r\n        */\r\n        bool verifySSL;\r\n        /**\r\n        * your Certificate Authority path. \r\n        */\r\n        std::string caPath;\r\n        /**\r\n        * your certificate file.\r\n        */\r\n        std::string caFile;\r\n        /**\r\n        * enable or disable cname, default is false.\r\n        */\r\n        bool isCname;\r\n        /**\r\n        * enable or disable crc64 check.\r\n        */\r\n        bool enableCrc64;\r\n        /**\r\n        * enable or disable auto correct http request date.\r\n        */\r\n        bool enableDateSkewAdjustment;\r\n        /**\r\n        * Rate limit data upload speed.\r\n        */\r\n        std::shared_ptr<RateLimiter> sendRateLimiter;\r\n        /**\r\n        * Rate limit data download speed.\r\n        */\r\n        std::shared_ptr<RateLimiter> recvRateLimiter;\r\n        /**\r\n        * The interface for outgoing traffic. E.g. eth0 in linux\r\n        */\r\n        std::string networkInterface;\r\n        /**\r\n        * Your executor's implement\r\n        */\r\n        std::shared_ptr<Executor> executor;\r\n        /**\r\n        * Your http client' implement\r\n        */\r\n        std::shared_ptr<HttpClient> httpClient;\r\n        /**\r\n        * enable or disable path style, default is false.\r\n        */\r\n        bool isPathStyle;\r\n        /**\r\n        * enable or disable verify object name strictly. defualt is true\r\n        */\r\n        bool isVerifyObjectStrict;\r\n\r\n        /**\r\n        * signature version. default is V1.\r\n        */\r\n        SignatureVersionType signatureVersion;\r\n\r\n        /**\r\n        * Your http interceptor implement\r\n        */\r\n        std::shared_ptr<HttpInterceptor> httpInterceptor;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/client/Error.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <string>\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    /*\n    The status comes from the following modules: client, server, httpclient(ex. curl).\n    server: [100-600)  \n    client: [100000-199999]\n    curl  : [200000-299999], 200000 + CURLcode\n\n    it's sucessful only if the status/100 equals to 2.\n    */\n    const int ERROR_CLIENT_BASE      = 100000;\n    const int ERROR_CRC_INCONSISTENT = ERROR_CLIENT_BASE + 1;\n    const int ERROR_REQUEST_DISABLE  = ERROR_CLIENT_BASE + 2;\n\n    const int ERROR_CURL_BASE = 200000;\n\n    class ALIBABACLOUD_OSS_EXPORT Error\n    {\n    public:\n        Error() = default;\n        Error(const std::string& code, const std::string& message):\n            status_(0),\n            code_(code),\n            message_(message)\n        {\n        }\n        ~Error() = default;\n\n        long Status() const {return status_;}\n        const std::string& Code()const {return code_;}\n        const std::string& Message() const {return message_;}\n        const HeaderCollection& Headers() const { return headers_; }\n        void setStatus(long status) { status_ = status;}\n        void setCode(const std::string& code) { code_ = code;}\n        void setMessage(const std::string& message) { message_ = message;}\n        void setHeaders(const HeaderCollection& headers) { headers_ = headers; }\n    private:\n        long status_;\n        std::string code_;\n        std::string message_;\n        HeaderCollection headers_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/client/RateLimiter.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n\n#include <alibabacloud/oss/Export.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    /*the unit of rate is kB/S*/\n    class  ALIBABACLOUD_OSS_EXPORT RateLimiter\n    {\n    public:\n        virtual ~RateLimiter() {}\n        virtual void setRate(int rate) = 0;\n        virtual int Rate() const = 0;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/client/RetryStrategy.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n#include <alibabacloud/oss/client/Error.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class  ALIBABACLOUD_OSS_EXPORT RetryStrategy\r\n    {\r\n    public:\r\n        virtual ~RetryStrategy() {}\r\n        virtual bool shouldRetry(const Error& error, long attemptedRetries) const = 0;\r\n        virtual long calcDelayTimeMs(const Error& error, long attemptedRetries) const = 0;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/encryption/Cipher.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <memory>\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/Types.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    enum class CipherAlgorithm {\r\n        AES,\r\n        RSA,\r\n    };\r\n\r\n    enum class CipherMode {\r\n        NONE,\r\n        ECB,\r\n        CBC,\r\n        CTR,\r\n    };\r\n\r\n    enum class CipherPadding {\r\n        NoPadding,\r\n        PKCS1Padding,\r\n        PKCS5Padding,\r\n        PKCS7Padding,\r\n        ZeroPadding,\r\n    };\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT SymmetricCipher\r\n    {\r\n    public:\r\n        virtual ~SymmetricCipher() {};\r\n\r\n        //algorithm/mode/padding format. ex. AES/CBC/NoPadding\r\n        const std::string& Name() const { return name_; }\r\n        CipherAlgorithm Algorithm() { return algorithm_; }\r\n        CipherMode Mode() { return mode_; }\r\n        CipherPadding Padding() { return padding_; }\r\n\r\n        int BlockSize() { return blockSize_; }\r\n\r\n        virtual void EncryptInit(const ByteBuffer& key, const ByteBuffer& iv) = 0;\r\n        virtual ByteBuffer Encrypt(const ByteBuffer& data) = 0;\r\n        virtual int Encrypt(unsigned char * dst, int dstLen, const unsigned char* src, int srcLen) = 0;\r\n        virtual ByteBuffer EncryptFinish() = 0;\r\n\r\n        virtual void DecryptInit(const ByteBuffer& key, const ByteBuffer& iv) = 0;\r\n        virtual ByteBuffer Decrypt(const ByteBuffer& data) = 0;\r\n        virtual int Decrypt(unsigned char * dst, int dstLen, const unsigned char* src, int srcLen) = 0;\r\n        virtual ByteBuffer DecryptFinish() = 0;\r\n    \r\n    public:\r\n        static ByteBuffer GenerateIV(size_t length);\r\n        static ByteBuffer GenerateKey(size_t length);\r\n        static ByteBuffer IncCTRCounter(const ByteBuffer& counter, uint64_t numberOfBlocks);\r\n\r\n        static std::shared_ptr<SymmetricCipher> CreateAES128_CTRImpl();\r\n        static std::shared_ptr<SymmetricCipher> CreateAES128_CBCImpl();\r\n        static std::shared_ptr<SymmetricCipher> CreateAES256_CTRImpl();\r\n    protected:\r\n        SymmetricCipher(const std::string& impl, CipherAlgorithm algo, CipherMode mode, CipherPadding pad);\r\n    private:\r\n        std::string impl_;\r\n        std::string name_;\r\n        CipherAlgorithm algorithm_;\r\n        CipherMode mode_;\r\n        CipherPadding padding_;\r\n        int blockSize_;\r\n    };\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT AsymmetricCipher\r\n    {\r\n    public:\r\n        virtual ~AsymmetricCipher() {};\r\n        const std::string& Name() const { return name_; }\r\n        CipherAlgorithm Algorithm() { return algorithm_; }\r\n        CipherMode Mode() { return mode_; }\r\n        CipherPadding Padding() { return padding_; }\r\n\r\n        void setPublicKey(const std::string& key) { publicKey_ = key; }\r\n        void setPrivateKey(const std::string& key) { privateKey_ = key; }\r\n\r\n        const std::string& PublicKey() const { return publicKey_; }\r\n        const std::string& PrivateKey() const { return privateKey_; }\r\n\r\n        virtual ByteBuffer Encrypt(const ByteBuffer& data) = 0;\r\n        virtual ByteBuffer Decrypt(const ByteBuffer& data) = 0;\r\n\r\n    public:\r\n        static std::shared_ptr<AsymmetricCipher> CreateRSA_NONEImpl();\r\n\r\n    protected:\r\n        AsymmetricCipher(const std::string& impl, CipherAlgorithm algo, CipherMode mode, CipherPadding pad);\r\n    private:\r\n        std::string impl_;\r\n        std::string name_;\r\n        CipherAlgorithm algorithm_;\r\n        CipherMode mode_;\r\n        CipherPadding padding_;\r\n        std::string publicKey_;\r\n        std::string privateKey_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/encryption/ContentCryptoMaterial.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/Types.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT ContentCryptoMaterial\r\n    {\r\n    public:\r\n        ContentCryptoMaterial();\r\n        ~ContentCryptoMaterial();\r\n        std::string Tag() const { return \"Material\"; }\r\n\r\n        const ByteBuffer& ContentKey() const { return contentKey_; }\r\n        const ByteBuffer& ContentIV() const { return contentIV_; }\r\n        const std::string& CipherName() const { return cipherName_; }\r\n\r\n        const std::string& KeyWrapAlgorithm() const { return keyWrapAlgorithm_; }\r\n        const std::map<std::string, std::string>& Description() const { return description_; }\r\n        const ByteBuffer& EncryptedContentKey() const { return encryptedContentKey_; }\r\n        const ByteBuffer& EncryptedContentIV() const { return encryptedContentIV_; }\r\n\r\n        const std::string& MagicNumber() const { return magicNumber_; }\r\n\r\n        void setContentKey(const ByteBuffer& key) { contentKey_ = key; }\r\n        void setContentIV(const ByteBuffer& iv) { contentIV_ = iv; }\r\n        void setCipherName(const std::string& name) { cipherName_ = name; }\r\n\r\n        void setKeyWrapAlgorithm(const std::string& algo) { keyWrapAlgorithm_ = algo; }\r\n        void setDescription(const std::map<std::string, std::string>& desc) { description_ = desc; }\r\n        void setEncryptedContentKey(const ByteBuffer& key) { encryptedContentKey_ = key; }\r\n        void setEncryptedContentIV(const ByteBuffer& iv) { encryptedContentIV_ = iv; }\r\n\r\n        void setMagicNumber(const std::string& value) { magicNumber_ = value; }\r\n    private:\r\n        ByteBuffer contentKey_;\r\n        ByteBuffer contentIV_;\r\n        std::string cipherName_;\r\n\r\n        std::string keyWrapAlgorithm_;\r\n        std::map<std::string, std::string> description_;\r\n        ByteBuffer encryptedContentKey_;\r\n        ByteBuffer encryptedContentIV_;\r\n\r\n        std::string magicNumber_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/encryption/CryptoConfiguration.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/auth/CredentialsProvider.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n#include <string>\r\n#include <vector>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    enum class CryptoStorageMethod\r\n    {\r\n        METADATA,\r\n    };\r\n\r\n    enum class CryptoMode\r\n    {\r\n        ENCRYPTION_AESCTR,\r\n    };\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT CryptoConfiguration\r\n    {\r\n    public:\r\n        CryptoConfiguration();\r\n        ~CryptoConfiguration();\r\n\r\n    public:\r\n        CryptoMode cryptoMode;\r\n        CryptoStorageMethod cryptoStorageMethod;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/encryption/EncryptionMaterials.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n#include <alibabacloud/oss/encryption/ContentCryptoMaterial.h>\r\n#include <map>\r\n#include <string>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT EncryptionMaterials\r\n    {\r\n    public:\r\n        virtual ~EncryptionMaterials();\r\n\r\n        virtual int EncryptCEK(ContentCryptoMaterial& contentCryptoMaterial) = 0;\r\n        virtual int DecryptCEK(ContentCryptoMaterial& contentCryptoMaterial) = 0;\r\n    };\r\n\r\n    using RSAEncryptionMaterial = std::pair<std::pair<std::string, std::string>, std::map<std::string, std::string>>;\n    class ALIBABACLOUD_OSS_EXPORT SimpleRSAEncryptionMaterials : public EncryptionMaterials\r\n    {\r\n    public:\r\n        SimpleRSAEncryptionMaterials(const std::string& publicKey, const std::string& privateKey);\r\n        SimpleRSAEncryptionMaterials(const std::string& publicKey, const std::string& privateKey,\r\n            const std::map<std::string, std::string>& description);\r\n        ~SimpleRSAEncryptionMaterials();\r\n        void addEncryptionMaterial(const std::string& publicKey, const std::string& privateKey,\r\n            const std::map<std::string, std::string>& description);\r\n        virtual int EncryptCEK(ContentCryptoMaterial& contentCryptoMaterial);\r\n        virtual int DecryptCEK(ContentCryptoMaterial& contentCryptoMaterial);\r\n    private:\r\n        int findIndexByDescription(const std::map<std::string, std::string>& description);\r\n        std::string publicKey_;\r\n        std::map<std::string, std::string> description_;\r\n        std::vector<RSAEncryptionMaterial> encryptionMaterials_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/http/HttpClient.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n#include <memory>\r\n#include <atomic>\r\n#include <mutex>\r\n#include <condition_variable>\r\n#include <alibabacloud/oss/http/HttpRequest.h>\r\n#include <alibabacloud/oss/http/HttpResponse.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT HttpClient\r\n    {\r\n    public:\r\n        HttpClient();\r\n        virtual ~HttpClient();\r\n\r\n        virtual std::shared_ptr<HttpResponse> makeRequest(const std::shared_ptr<HttpRequest> &request) = 0;\r\n\r\n        bool isEnable();\r\n        void disable();\r\n        void enable();\r\n        void waitForRetry(long milliseconds);\r\n        \r\n    protected:\r\n        std::atomic<bool> disable_;\r\n        std::mutex requestLock_;\r\n        std::condition_variable requestSignal_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/http/HttpInterceptor.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n\n#include <string>\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/http/HttpRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT HttpInterceptor\n    {\n    public:\n        HttpInterceptor() = default;\n        virtual ~HttpInterceptor() = default;\n        virtual void preSendRequest(void *handler, const std::shared_ptr<HttpRequest> &request) = 0;\n    };\n}\n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/http/HttpMessage.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n#include <iostream>\r\n#include <memory>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT HttpMessage\r\n    {\r\n    public:\r\n\r\n        HttpMessage(const HttpMessage &other);\r\n        HttpMessage(HttpMessage &&other);\r\n        HttpMessage& operator=(const HttpMessage &other);\r\n        HttpMessage& operator=(HttpMessage &&other);\r\n        virtual ~HttpMessage();\r\n\r\n        void addHeader(const std::string &name, const std::string &value);\r\n        void setHeader(const std::string &name, const std::string &value);\r\n        void removeHeader(const std::string &name);\r\n        bool hasHeader(const std::string &name) const ;\r\n        std::string Header(const std::string &name)const;\r\n        const HeaderCollection &Headers()const;\r\n\r\n        void addBody(const std::shared_ptr<std::iostream>& body) { body_ = body;}\r\n        std::shared_ptr<std::iostream>& Body() { return body_;}\r\n    protected:\r\n        HttpMessage();\r\n    private:\r\n        HeaderCollection headers_;\r\n        std::shared_ptr<std::iostream> body_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/http/HttpRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n\n#include <string>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/ServiceRequest.h>\n#include <alibabacloud/oss/http/HttpMessage.h>\n#include <alibabacloud/oss/http/Url.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\n    class ALIBABACLOUD_OSS_EXPORT HttpRequest : public HttpMessage\n    {\n        public:\n            HttpRequest(Http::Method method = Http::Method::Get);\n            ~HttpRequest();\n\n            Http::Method method() const;\n            Url url() const;\n            void setMethod(Http::Method method);\n            void setUrl(const Url &url);\n            \n            const IOStreamFactory& ResponseStreamFactory() const { return responseStreamFactory_; }\n            void setResponseStreamFactory(const IOStreamFactory& factory) { responseStreamFactory_ = factory; }\n\n            const AlibabaCloud::OSS::TransferProgress & TransferProgress() const {  return transferProgress_; }\n            void setTransferProgress(const AlibabaCloud::OSS::TransferProgress &arg) { transferProgress_ = arg;}\n\n            void setCheckCrc64(bool enable) { hasCheckCrc64_ = enable; }\n            bool hasCheckCrc64() const { return hasCheckCrc64_; }\n            void setCrc64Result(uint64_t crc) { crc64Result_ = crc; }\n            uint64_t Crc64Result() const { return crc64Result_; }\n\n            void setTransferedBytes(int64_t value) { transferedBytes_ = value; }\n            uint64_t TransferedBytes() const { return transferedBytes_;}\n\n            void setChunkedEncoding(bool value) { chunkedEncoding_ = value; }\n            bool chunkedEncoding() const { return chunkedEncoding_; }\n\n        private:\n            Http::Method method_;\n            Url url_;\n            IOStreamFactory responseStreamFactory_;\n            AlibabaCloud::OSS::TransferProgress transferProgress_;\n            bool hasCheckCrc64_;\n            uint64_t crc64Result_;\n            int64_t transferedBytes_;\n            bool chunkedEncoding_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/http/HttpResponse.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n#include <string>\r\n#include <memory>\r\n#include <alibabacloud/oss/http/HttpMessage.h>\n#include <alibabacloud/oss/http/HttpRequest.h>\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT HttpResponse : public HttpMessage\r\n    {\r\n        public:\r\n            HttpResponse(const std::shared_ptr<HttpRequest> & request);\r\n            ~HttpResponse();\r\n\r\n            const HttpRequest &request()const;\r\n            void setStatusCode(int code);\r\n            int statusCode()const;\r\n            void setStatusMsg(std::string &msg);\r\n            void setStatusMsg(const char *msg);\r\n            std::string statusMsg()const;\r\n        private:\r\n            HttpResponse() = delete;\r\n            std::shared_ptr<HttpRequest> request_;\r\n            mutable int statusCode_;\r\n            mutable std::string statusMsg_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/http/HttpType.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n\n#include <string>\n#include <map>\n#include <alibabacloud/oss/Export.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\n    class  ALIBABACLOUD_OSS_EXPORT Http\n    {\n        public:\n            enum Method\n            {\n                Get,\n                Head,\n                Post,\n                Put,\n                Delete,\n                Connect,\n                Options,\n                Patch,\n                Trace\n            };\n            enum Scheme\n            {\n                HTTP,\n                HTTPS\n            };\n            static std::string MethodToString(Method method);\n            static std::string SchemeToString(Scheme scheme);\n\n            //HEADERS\n            static const char* ACCEPT;\n            static const char* ACCEPT_CHARSET;\n            static const char* ACCEPT_ENCODING;\n            static const char* ACCEPT_LANGUAGE;\n            static const char* AUTHORIZATION;\n            static const char* CACHE_CONTROL;\n            static const char* CONTENT_DISPOSITION;\n            static const char* CONTENT_ENCODING;\n            static const char* CONTENT_LENGTH;\n            static const char* CONTENT_MD5;\n            static const char* CONTENT_RANGE;\n            static const char* CONTENT_TYPE;\n            static const char* DATE;\n            static const char* EXPECT;\n            static const char* EXPIRES;\n            static const char* ETAG;\n            static const char* LAST_MODIFIED;\n            static const char* RANGE;\n            static const char* USER_AGENT;\n\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/http/Url.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n#include <string>\r\n#include <alibabacloud/oss/Export.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT Url\r\n    {\r\n    public:\r\n        explicit Url(const std::string &url = \"\");\r\n        ~Url();\r\n        bool operator==(const Url &url) const;\r\n        bool operator!=(const Url &url) const;\r\n\r\n        std::string authority() const;\r\n        void clear();\r\n        std::string fragment() const;\r\n        void fromString(const std::string &url);\r\n        bool hasFragment() const;\r\n        bool hasQuery() const;\r\n        std::string host()const;\r\n        bool isEmpty() const;\r\n        bool isValid() const;\r\n        int port()const;\r\n        std::string password() const;\r\n        std::string path() const;\r\n        std::string query() const;\r\n        std::string scheme() const;\r\n        void setAuthority(const std::string &authority);\r\n        void setFragment(const std::string &fragment);\r\n        void setHost(const std::string &host);\r\n        void setPassword(const std::string &password);\r\n        void setPath(const std::string &path);\r\n        void setPort(int port);\r\n        void setQuery(const std::string &query);\r\n        void setScheme(const std::string &scheme);\r\n        void setUserInfo(const std::string &userInfo);\r\n        void setUserName(const std::string &userName);\r\n        std::string toString()const;\r\n        std::string userInfo() const;\r\n        std::string userName() const;\r\n    private:\r\n        std::string scheme_;\r\n        std::string userName_;\r\n        std::string password_;\r\n        std::string host_;\r\n        std::string path_;\r\n        int port_;\r\n        std::string query_;\r\n        std::string fragment_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/AbortBucketWormRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT AbortBucketWormRequest : public OssBucketRequest\n    {\n    public:\n        AbortBucketWormRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/AbortMultipartUploadRequest.h",
    "content": "/*\n * Copyright 2009-2018 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <iostream>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT AbortMultipartUploadRequest: public OssObjectRequest\n    {\n    public:\n        AbortMultipartUploadRequest(const std::string& bucket, const std::string& key, \n            const std::string& uploadId);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    private:\n        std::string uploadId_;\n    };\n} \n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/AppendObjectRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/model/ObjectMetaData.h>\r\n\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT AppendObjectRequest: public OssObjectRequest\r\n    {\r\n    public:\r\n        AppendObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::shared_ptr<std::iostream>& content);\r\n        AppendObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::shared_ptr<std::iostream>& content,\r\n            const ObjectMetaData& meta);\r\n        void setPosition(uint64_t position);\r\n        void setCacheControl(const std::string& value);\r\n        void setContentDisposition(const std::string& value);\r\n        void setContentEncoding(const std::string& value);\r\n        void setContentMd5(const std::string& value);\r\n        void setExpires(uint64_t expires);\r\n        void setExpires(const std::string& value);\r\n        void setAcl(const CannedAccessControlList& acl);\r\n        void setTagging(const std::string& value);\r\n        void setTrafficLimit(uint64_t value);\r\n        virtual std::shared_ptr<std::iostream> Body() const;\r\n    protected:\r\n        virtual HeaderCollection specialHeaders() const ;\r\n        virtual ParameterCollection specialParameters() const;\r\n    private:\r\n        uint64_t position_;\r\n        std::shared_ptr<std::iostream> content_;\r\n        ObjectMetaData metaData_;\r\n    };\r\n}\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/AppendObjectResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <string>\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <alibabacloud/oss/ServiceRequest.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT AppendObjectResult : public OssObjectResult\r\n    {\r\n    public:\r\n       public:\r\n        AppendObjectResult();\r\n        AppendObjectResult(const HeaderCollection& header);\r\n        uint64_t Length() const { return length_ ; }\r\n        uint64_t CRC64() const { return crc64_ ; }\r\n     private:\r\n        uint64_t length_;\r\n        uint64_t crc64_;\r\n    };\r\n} \r\n}\r\n\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/Bucket.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <string>\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/model/Owner.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ListBucketsResult;\n    class ALIBABACLOUD_OSS_EXPORT Bucket\n    {\n    public:\n        Bucket() = default;\n        ~Bucket();\n        const std::string& Location() const { return location_; }\n        const std::string& Name() const { return name_; }\n        const std::string& CreationDate() const { return creationDate_; }\n        const std::string& IntranetEndpoint() const { return intranetEndpoint_; }\n        const std::string& ExtranetEndpoint() const { return extranetEndpoint_; }\n        AlibabaCloud::OSS::StorageClass StorageClass() const { return storageClass_; }\n        const AlibabaCloud::OSS::Owner& Owner() const { return owner_; }\n    private:\n        friend class ListBucketsResult;\n        std::string location_;\n        std::string name_;\n        std::string creationDate_;\n        std::string intranetEndpoint_;\n        std::string extranetEndpoint_;\n        AlibabaCloud::OSS::StorageClass storageClass_;\n        AlibabaCloud::OSS::Owner owner_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/CORSRule.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <string>\n#include <list>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    using CORSAllowedList = std::list<std::string>;\n    class ALIBABACLOUD_OSS_EXPORT CORSRule\n    {\n    public:\n        static const int UNSET_AGE_SEC = -1;\n    public:\n        CORSRule() : maxAgeSeconds_(UNSET_AGE_SEC) {}\n        const CORSAllowedList& AllowedOrigins() const { return allowedOrigins_; }\n        const CORSAllowedList& AllowedMethods() const { return allowedMethods_; }\n        const CORSAllowedList& AllowedHeaders() const { return allowedHeaders_; }\n        const CORSAllowedList& ExposeHeaders() const { return exposeHeaders_; }\n        int MaxAgeSeconds() const { return maxAgeSeconds_; }\n        void addAllowedOrigin(const std::string& origin) { allowedOrigins_.push_back(origin); }\n        void addAllowedMethod(const std::string& method) { allowedMethods_.push_back(method); }\n        void addAllowedHeader(const std::string& header) { allowedHeaders_.push_back(header); }\n        void addExposeHeader(const std::string& header) { exposeHeaders_.push_back(header); }\n        void setMaxAgeSeconds(int value) { maxAgeSeconds_ = value; }\n        void clear()\n        {\n            allowedOrigins_.clear();\n            allowedMethods_.clear();\n            allowedHeaders_.clear();\n            exposeHeaders_.clear();\n            maxAgeSeconds_ = UNSET_AGE_SEC;\n        }\n    private:\n        CORSAllowedList allowedOrigins_;\n        CORSAllowedList allowedMethods_;\n        CORSAllowedList allowedHeaders_;\n        CORSAllowedList exposeHeaders_;\n        int maxAgeSeconds_;\n    };\n\n    using CORSRuleList = std::list<CORSRule>;\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/CompleteBucketWormRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT CompleteBucketWormRequest : public OssBucketRequest\n    {\n    public:\n        CompleteBucketWormRequest(const std::string& bucket, const std::string& wormId);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    private:\n        std::string wormId_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/CompleteMultipartUploadRequest.h",
    "content": "/*\n * Copyright 2009-2018 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/model/Part.h>\n#include <alibabacloud/oss/model/ObjectMetaData.h>\n#include <sstream>\n#include <iostream>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT CompleteMultipartUploadRequest: public OssObjectRequest\n    {\n    public:\n        CompleteMultipartUploadRequest(const std::string& bucket, const std::string& key);\n        CompleteMultipartUploadRequest(const std::string& bucket, const std::string& key,\n            const PartList& partList);\n        CompleteMultipartUploadRequest(const std::string& bucket, const std::string& key, \n            const PartList& partList, \n            const std::string& uploadId);\n        void setEncodingType(const std::string& encodingType);\n        void setPartList(const AlibabaCloud::OSS::PartList& partList);\n        void setUploadId(const std::string& uploadId);\n        void setAcl(CannedAccessControlList acl);\n        void setCallback(const std::string& callback, const std::string& callbackVar = \"\");\n        ObjectMetaData& MetaData();\n    protected:\n        virtual std::string payload() const;\n        virtual ParameterCollection specialParameters() const;\n        virtual HeaderCollection specialHeaders() const;\n        virtual int validate() const;\n    private:\n        AlibabaCloud::OSS::PartList partList_;\n        std::string uploadId_;\n        std::string encodingType_;\n        bool encodingTypeIsSet_;\n        ObjectMetaData metaData_;\n    };\n} \n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/CompleteMultipartUploadResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <memory>\r\n#include <iostream>\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssResult.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT CompleteMultipartUploadResult: public OssObjectResult\r\n    {\r\n    public:\r\n        CompleteMultipartUploadResult();\r\n        CompleteMultipartUploadResult(const std::string& data);\r\n        CompleteMultipartUploadResult(const std::shared_ptr<std::iostream>& data, \r\n            const HeaderCollection& headers);\r\n        CompleteMultipartUploadResult& operator=(const std::string& data);\r\n        const std::string& Location() const;\r\n        const std::string& Bucket() const;\r\n        const std::string& Key() const;\r\n        const std::string& ETag() const;\r\n        const std::string& EncodingType() const;\r\n        uint64_t CRC64() const;\r\n        const std::shared_ptr<std::iostream>& Content() const;\r\n    private:\r\n        std::string location_;\r\n        std::string bucket_;\r\n        std::string key_;\r\n        std::string eTag_;\r\n        std::string encodingType_;\r\n        uint64_t crc64_;\r\n        std::shared_ptr<std::iostream> content_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/CopyObjectRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/model/ObjectMetaData.h>\r\n\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT CopyObjectRequest: public OssObjectRequest\r\n    {\r\n    public:\r\n        CopyObjectRequest(const std::string& bucket, const std::string& key);\r\n        CopyObjectRequest(const std::string& bucket, const std::string& key,\r\n            const ObjectMetaData& meta);\r\n        void setCopySource(const std::string& srcBucket,const std::string& srcObject);\r\n        void setSourceIfMatchETag(const std::string& value);\r\n        void setSourceIfNotMatchETag(const std::string& value);\r\n        void setSourceIfUnModifiedSince(const std::string& value);\r\n        void setSourceIfModifiedSince(const std::string& value);\r\n        void setMetadataDirective(const CopyActionList& action);\r\n        void setAcl(const CannedAccessControlList& acl);\r\n        void setTagging(const std::string& value);\r\n        void setTaggingDirective(const CopyActionList& action);\r\n        void setTrafficLimit(uint64_t value);\r\n\r\n    protected:\r\n        virtual HeaderCollection specialHeaders() const ;\r\n        virtual ParameterCollection specialParameters() const;\r\n    private:\r\n        std::string sourceBucket_;\r\n        std::string sourceKey_;\r\n        ObjectMetaData metaData_;\r\n    };\r\n}\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/CopyObjectResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <string>\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <alibabacloud/oss/ServiceRequest.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT CopyObjectResult : public OssObjectResult\r\n    {\r\n    public:\r\n        CopyObjectResult();\r\n        CopyObjectResult(const std::string& data);\r\n        CopyObjectResult(const std::shared_ptr<std::iostream>& data);\r\n        CopyObjectResult(const HeaderCollection& headers, const std::shared_ptr<std::iostream>& data);\r\n        CopyObjectResult& operator=(const std::string& data);\r\n        const std::string& ETag() const { return etag_; }\r\n        const std::string& LastModified() const { return lastModified_; }\r\n        const std::string& SourceVersionId() { return sourceVersionId_; }\r\n\r\n        void setEtag(const std::string& etag) { etag_ = etag; }\r\n        void setLastModified(const std::string& lastModified) { lastModified_ = lastModified; }\r\n        void setVersionId(const std::string& versionId) { versionId_ = versionId; }\r\n        void setRequestId(const std::string& requestId) { requestId_ = requestId; }\r\n     private:\r\n        std::string etag_;\r\n        std::string lastModified_;\r\n        std::string sourceVersionId_;\r\n    };\r\n} \r\n}\r\n\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/CreateBucketRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n#include <alibabacloud/oss/Types.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT CreateBucketRequest: public OssBucketRequest\r\n    {\r\n    public:\r\n        CreateBucketRequest(const std::string& bucket, StorageClass storageClass = StorageClass::Standard);\r\n        CreateBucketRequest(const std::string& bucket, StorageClass storageClass, \r\n            CannedAccessControlList acl);\r\n        void setDataRedundancyType(DataRedundancyType type) { dataRedundancyType_ = type; }\r\n    protected:\r\n        virtual std::string payload() const;\r\n        virtual HeaderCollection specialHeaders() const;\r\n    private:\r\n        StorageClass storageClass_;\r\n        CannedAccessControlList acl_;\r\n        DataRedundancyType dataRedundancyType_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/CreateSelectObjectMetaRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/model/InputFormat.h>\n\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\n    class ALIBABACLOUD_OSS_EXPORT CreateSelectObjectMetaRequest : public OssObjectRequest\n    {\n    public:\n        CreateSelectObjectMetaRequest(const std::string& bucket, const std::string& key);\n\n        void setOverWriteIfExists(bool overWriteIfExist);\n        void setInputFormat(InputFormat& inputFormat);\n   \n    protected:\n        virtual int validate() const;\n        virtual std::string payload() const;\n        virtual ParameterCollection specialParameters() const;\n\n    private:\n        InputFormat *inputFormat_;\n        bool overWriteIfExists_;\n    };\n}\n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/CreateSelectObjectMetaResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/OssResult.h>\n#include <memory>\n#include <iostream>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT CreateSelectObjectMetaResult : public OssResult\n    {\n    public:\n        CreateSelectObjectMetaResult();\n        CreateSelectObjectMetaResult(\n            const std::string& bucket,\n            const std::string& key,\n            const std::string& requestId,\n            const std::shared_ptr<std::iostream>& data);\n        CreateSelectObjectMetaResult& operator=(const std::shared_ptr<std::iostream>& data);\n\n        const std::string& Bucket() const { return bucket_; }\n        const std::string& Key()  const { return key_; }\n        uint64_t Offset() const { return offset_; }\n        uint64_t TotalScanned() const { return totalScanned_; }\n        uint32_t Status() const { return status_; }\n        uint32_t SplitsCount() const { return splitsCount_; }\n        uint64_t RowsCount() const { return rowsCount_; }\n        uint32_t ColsCount() const { return colsCount_; }\n        const std::string& ErrorMessage() const { return errorMessage_; }\n\n    private:\n        std::string bucket_;\n        std::string key_;\n        uint64_t offset_;\n        uint64_t totalScanned_;\n        uint32_t status_;\n        uint32_t splitsCount_;\n        uint64_t rowsCount_;\n        uint32_t colsCount_;\n        std::string errorMessage_;\n    };\n\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/CreateSymlinkRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/model/ObjectMetaData.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT CreateSymlinkRequest: public OssObjectRequest\r\n    {\r\n    public:\r\n        CreateSymlinkRequest(const std::string& bucket, const std::string& key);\r\n        CreateSymlinkRequest(const std::string& bucket, const std::string& key,\r\n            const ObjectMetaData& meta);\r\n        void SetSymlinkTarget(const std::string& value);\r\n        void setTagging(const std::string& value);\r\n    protected:\r\n        virtual HeaderCollection specialHeaders() const ;\r\n        virtual ParameterCollection specialParameters() const;\r\n    private:\r\n        ObjectMetaData metaData_;\r\n    };\r\n}\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/CreateSymlinkResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <string>\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <alibabacloud/oss/ServiceRequest.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT CreateSymlinkResult : public OssObjectResult\r\n    {\r\n    public:\r\n        CreateSymlinkResult();\r\n        CreateSymlinkResult(const std::string& etag);\r\n        CreateSymlinkResult(const HeaderCollection& headers);\r\n        const std::string& ETag() const { return etag_; }\r\n    private:\r\n        std::string etag_;\r\n    };\r\n} \r\n}\r\n\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteBucketCorsRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT DeleteBucketCorsRequest : public OssBucketRequest\n    {\n    public:\n        DeleteBucketCorsRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteBucketEncryptionRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT DeleteBucketEncryptionRequest : public OssBucketRequest\n    {\n    public:\n        DeleteBucketEncryptionRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteBucketInventoryConfigurationRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT DeleteBucketInventoryConfigurationRequest : public OssBucketRequest\n    {\n    public:\n        DeleteBucketInventoryConfigurationRequest(const std::string& bucket);\n        DeleteBucketInventoryConfigurationRequest(const std::string& bucket, const std::string& id);\n        void setId(const std::string& id) { id_ = id; }\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    private:\n        std::string id_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteBucketLifecycleRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/model/LifecycleRule.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\n    class ALIBABACLOUD_OSS_EXPORT DeleteBucketLifecycleRequest : public OssBucketRequest\n    {\n    public:\n        DeleteBucketLifecycleRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteBucketLoggingRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\n    class ALIBABACLOUD_OSS_EXPORT DeleteBucketLoggingRequest : public OssBucketRequest\n    {\n    public:\n        DeleteBucketLoggingRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteBucketPolicyRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\n    class ALIBABACLOUD_OSS_EXPORT DeleteBucketPolicyRequest : public OssBucketRequest\n    {\n    public:\n        DeleteBucketPolicyRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteBucketQosInfoRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT DeleteBucketQosInfoRequest : public OssBucketRequest\n    {\n    public:\n        DeleteBucketQosInfoRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteBucketRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT DeleteBucketRequest : public OssBucketRequest\n    {\n    public:\n        DeleteBucketRequest(const std::string& bucket):\n            OssBucketRequest(bucket)\n        {\n        }\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteBucketTaggingRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/model/Tagging.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT DeleteBucketTaggingRequest : public OssBucketRequest\n    {\n    public:\n        DeleteBucketTaggingRequest(const std::string& bucket);\n        void setTagging(const Tagging& tagging);\n\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    private:\n        Tagging tagging_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteBucketWebsiteRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT DeleteBucketWebsiteRequest : public OssBucketRequest\n    {\n    public:\n        DeleteBucketWebsiteRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteLiveChannelRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT DeleteLiveChannelRequest : public LiveChannelRequest\n    {\n    public:\n        DeleteLiveChannelRequest(const std::string& bucket, const std::string& channelName);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual int validate() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteObjectRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT DeleteObjectRequest : public OssObjectRequest\n    {\n    public:\n        DeleteObjectRequest(const std::string& bucket, const std::string& key):\n            OssObjectRequest(bucket, key)\n        {\n        }\n\n        DeleteObjectRequest(const std::string& bucket, const std::string& key, const std::string& versionId) :\n            OssObjectRequest(bucket, key)\n        {\n            versionId_ = versionId;\n        }\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteObjectResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <alibabacloud/oss/Types.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT DeleteObjectResult : public OssObjectResult\r\n    {\r\n    public:\r\n        DeleteObjectResult();\r\n        DeleteObjectResult(const HeaderCollection& header);\r\n        bool DeleteMarker() const;\r\n    private:\r\n        bool deleteMarker_;\r\n    };\r\n} \r\n}\r\n\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteObjectTaggingRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT DeleteObjectTaggingRequest : public OssObjectRequest\r\n    {\r\n    public:\r\n        DeleteObjectTaggingRequest(const std::string& bucket, const std::string& key);\r\n    protected:\r\n        virtual ParameterCollection specialParameters() const;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteObjectTaggingResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssResult.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT DeleteObjectTaggingResult : public OssObjectResult\r\n    {\r\n    public:\r\n        DeleteObjectTaggingResult():OssObjectResult(){}\r\n        DeleteObjectTaggingResult(const HeaderCollection& headers) : OssObjectResult(headers) {}\r\n    };\r\n} \r\n}\r\n\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteObjectVersionsRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <list>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ObjectIdentifier\r\n    {\r\n    public:\r\n        ObjectIdentifier() {};\r\n        ObjectIdentifier(const std::string& key) : key_(key) {};\r\n        ObjectIdentifier(const std::string& key, const std::string& versionId) : key_(key), versionId_(versionId) {};\r\n        void setKey(const std::string& key) { key_ = key; };\r\n        void setVersionId(const std::string& versionId) { versionId_ = versionId; };\r\n        const std::string& Key() const { return key_; }\r\n        const std::string& VersionId() const { return versionId_; }\r\n    private:\r\n        std::string key_;\r\n        std::string versionId_;\r\n    };\r\n\n    using ObjectIdentifierList = std::vector<ObjectIdentifier>;\r\n\n    class ALIBABACLOUD_OSS_EXPORT DeleteObjectVersionsRequest : public OssBucketRequest\n    {\n    public:\n        DeleteObjectVersionsRequest(const std::string& bucket);\n        bool Quiet() const;\n        const std::string& EncodingType() const;\n        void setQuiet(bool quiet);\n        void setEncodingType(const std::string& value);\n\n        void addObject(const ObjectIdentifier& object);\r\n        void setObjects(const ObjectIdentifierList& objects);\r\n        const ObjectIdentifierList& Objects() const;\r\n        void clearObjects();\r\n\n        void setRequestPayer(RequestPayer value);\n    protected:\n        virtual std::string payload() const;\n        virtual ParameterCollection specialParameters() const;\n        virtual HeaderCollection specialHeaders() const;\n    private:\n        bool quiet_;\n        std::string encodingType_;\n        ObjectIdentifierList objects_;\n        RequestPayer requestPayer_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteObjectVersionsResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <memory>\r\n#include <iostream>\r\n#include <list>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT DeletedObject\r\n    {\r\n    public:\r\n        DeletedObject():deleteMarker_(false) {}\r\n        const std::string& Key() const { return key_; }\r\n        const std::string& VersionId() const { return versionId_; }\r\n        const std::string& DeleteMarkerVersionId() const { return deleteMarkerVersionId_; }\r\n        bool DeleteMarker() const { return deleteMarker_; }\r\n        void setKey(const std::string& value) { key_ = value; }\r\n        void setVersionId(const std::string& value) { versionId_ = value; }\r\n        void setDeleteMarkerVersionId(const std::string& value) { deleteMarkerVersionId_ = value; }\r\n        void setDeleteMarker(bool value) { deleteMarker_ = value; }\r\n    private:\r\n        std::string key_;\r\n        std::string versionId_;\r\n        std::string deleteMarkerVersionId_;\r\n        bool deleteMarker_;\r\n    };\r\n    using DeletedObjectList = std::vector<DeletedObject>;\r\n    \r\n    class ALIBABACLOUD_OSS_EXPORT DeleteObjectVersionsResult : public OssResult\r\n    {\r\n    public:\r\n        DeleteObjectVersionsResult();\r\n        DeleteObjectVersionsResult(const std::string& data);\r\n        DeleteObjectVersionsResult(const std::shared_ptr<std::iostream>& data);\r\n        DeleteObjectVersionsResult& operator=(const std::string& data);\r\n        bool Quiet() const;\r\n        const DeletedObjectList& DeletedObjects() const;\r\n    private:\r\n        bool quiet_;\r\n        DeletedObjectList deletedObjects_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteObjectsRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <list>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    using DeletedKeyList = std::list<std::string>;\n    class ALIBABACLOUD_OSS_EXPORT DeleteObjectsRequest : public OssBucketRequest\n    {\n    public:\n        DeleteObjectsRequest(const std::string& bucket);\n        bool Quiet() const;\n        const std::string& EncodingType() const;\n        const DeletedKeyList& KeyList() const;\n        void setQuiet(bool quiet);\n        void setEncodingType(const std::string& value);\n        void addKey(const std::string& key);\n        void setKeyList(const DeletedKeyList& keyList);\n        void clearKeyList();\n        void setRequestPayer(RequestPayer value);\n    protected:\n        virtual std::string payload() const;\n        virtual ParameterCollection specialParameters() const;\n        virtual HeaderCollection specialHeaders() const;\n    private:\n        bool quiet_;\n        std::string encodingType_;\n        DeletedKeyList keyList_;\n        RequestPayer requestPayer_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DeleteObjectsResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/OssResult.h>\n#include <memory>\n#include <iostream>\n#include <list>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT DeleteObjectsResult : public OssResult\n    {\n    public:\n        DeleteObjectsResult();\n        DeleteObjectsResult(const std::string& data);\n        DeleteObjectsResult(const std::shared_ptr<std::iostream>& data);\n        DeleteObjectsResult& operator=(const std::string& data);\n        bool Quiet() const;\n        const std::list<std::string>& keyList() const;\n    private:\n        bool quiet_;\n        std::list<std::string> keyList_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/DownloadObjectRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n#include <alibabacloud/oss/model/ObjectMetaData.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT DownloadObjectRequest : public OssResumableBaseRequest \r\n    {\r\n    public:\r\n        DownloadObjectRequest(const std::string& bucket, const std::string& key, \r\n            const std::string& filePath);\r\n        DownloadObjectRequest(const std::string& bucket, const std::string& key, \r\n            const std::string& filePath, const std::string& checkpointDir, \r\n            const uint64_t partSize, const uint32_t threadNum);\r\n        DownloadObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::string& filePath, const std::string& checkpointDir);\r\n\r\n        const std::string& FilePath() const { return filePath_; }\r\n        const std::string& TempFilePath() const { return tempFilePath_; }\r\n\r\n        DownloadObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::wstring& filePath);\r\n        DownloadObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::wstring& filePath, const std::wstring& checkpointDir,\r\n            const uint64_t partSize, const uint32_t threadNum);\r\n        DownloadObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::wstring& filePath, const std::wstring& checkpointDir);\r\n\r\n        const std::wstring& FilePathW() const { return filePathW_; }\r\n        const std::wstring& TempFilePathW() const { return tempFilePathW_; }\r\n\r\n        std::shared_ptr<std::iostream> Content() { return content_; }\r\n        bool RangeIsSet() const{ return rangeIsSet_; }\r\n        int64_t RangeStart() const { return range_[0]; }\r\n        int64_t RangeEnd() const { return range_[1]; }\r\n        const std::string& ModifiedSinceConstraint() const { return modifiedSince_; }\r\n        const std::string& UnmodifiedSinceConstraint() const { return unmodifiedSince_; }\r\n        const std::vector<std::string>& MatchingETagsConstraint() const { return matchingETags_; }\r\n        const std::vector<std::string>& NonmatchingETagsConstraint() const { return nonmatchingETags_;}\r\n        const std::map<std::string, std::string>& ResponseHeaderParameters() const { return responseHeaderParameters_; }\r\n\r\n        void setRange(int64_t start, int64_t end);\r\n        void setModifiedSinceConstraint(const std::string& gmt);\r\n        void setUnmodifiedSinceConstraint(const std::string& gmt);\r\n        void setMatchingETagConstraints(const std::vector<std::string>& match);\r\n        void setNonmatchingETagConstraints(const std::vector<std::string>& match);\r\n        void addResponseHeaders(RequestResponseHeader header, const std::string& value);\r\n\r\n    protected:\r\n        virtual int validate() const;\r\n\r\n    private:\t\r\n        bool rangeIsSet_;\r\n        int64_t range_[2];\r\n        std::string modifiedSince_;\r\n        std::string unmodifiedSince_;\r\n        std::vector<std::string> matchingETags_;\r\n        std::vector<std::string> nonmatchingETags_;\r\n\t\t\r\n        std::string filePath_;\r\n        std::string tempFilePath_;\r\n        std::shared_ptr<std::iostream> content_;\r\n\r\n        std::map<std::string, std::string> responseHeaderParameters_;\r\n\r\n        std::wstring filePathW_;\r\n        std::wstring tempFilePathW_;\r\n    };\r\n}\r\n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ExtendBucketWormRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ExtendBucketWormRequest : public OssBucketRequest\n    {\n    public:\n        ExtendBucketWormRequest(const std::string& bucket, const std::string& wormId, uint32_t day);\n    protected:\n        virtual std::string payload() const;\n        virtual ParameterCollection specialParameters() const;\n    private:\n        std::string wormId_;\n        uint32_t day_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GeneratePresignedUrlRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/model/ObjectMetaData.h>\n#include <alibabacloud/oss/http/HttpType.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class OssClientImpl;\n    class ALIBABACLOUD_OSS_EXPORT GeneratePresignedUrlRequest\n    {\n    public:\n        GeneratePresignedUrlRequest(const std::string& bucket, const std::string& key);\n        GeneratePresignedUrlRequest(const std::string& bucket, const std::string& key,\n            Http::Method method);\n        void setBucket(const std::string& bucket);\n        void setKey(const std::string& key);\n        void setContentType(const std::string& value);\n        void setContentMd5(const std::string& value);\n        void setExpires(int64_t unixTime);\n        void setProcess(const std::string& process);\n        void setTrafficLimit(uint64_t value);\n        void setVersionId(const std::string& versionId);\n        void setRequestPayer(RequestPayer value);\n        void addResponseHeaders(RequestResponseHeader header, const std::string& value);\n        void addParameter(const std::string& key, const std::string& value);\n        MetaData& UserMetaData();\n        MetaData& HttpMetaData();\n        void setUnencodedSlash(bool value);\n        void addAdditionalSignHeader(const std::string& key);\n    private:\n        friend class OssClientImpl;\n        std::string bucket_;\n        std::string key_;\n        Http::Method method_;\n        ObjectMetaData metaData_;\n        ParameterCollection parameters_;\n        bool unencodedSlash_;\n        int64_t expires_;\n        HeaderSet additionalSignHeaders_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GenerateRTMPSignedUrlRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <string>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GenerateRTMPSignedUrlRequest: public LiveChannelRequest\n    {\n    public:\n        GenerateRTMPSignedUrlRequest(const std::string& bucket, \n            const std::string& channelName, const std::string& playlist, \n            uint64_t expires);\n\n        void setExpires(uint64_t expires);\n        void setPlayList(const std::string &playList);\n        const std::string& PlayList() const;\n        uint64_t Expires() const;\n        virtual ParameterCollection Parameters() const;\n    private:\n        std::string playList_;\n        uint64_t expires_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketAclRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketAclRequest: public OssBucketRequest\n    {\n    public:\n        GetBucketAclRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketAclResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/Owner.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketAclResult : public OssResult\n    {\n    public:\n        GetBucketAclResult();\n        GetBucketAclResult(const std::string& data);\n        GetBucketAclResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketAclResult& operator=(const std::string& data);\n        const AlibabaCloud::OSS::Owner& Owner() { return owner_; }\n        CannedAccessControlList Acl()const  { return acl_; }\n    private:\n        AlibabaCloud::OSS::Owner owner_;\n        CannedAccessControlList acl_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketCorsRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketCorsRequest: public OssBucketRequest\n    {\n    public:\n        GetBucketCorsRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketCorsResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/CORSRule.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketCorsResult : public OssResult\n    {\n    public:\n        GetBucketCorsResult();\n        GetBucketCorsResult(const std::string& data);\n        GetBucketCorsResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketCorsResult& operator=(const std::string& data);\n        const CORSRuleList& CORSRules() const { return ruleList_; };\n    private:\n        CORSRuleList ruleList_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketEncryptionRequest.h",
    "content": "#pragma once\n/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketEncryptionRequest : public OssBucketRequest\n    {\n    public:\n        GetBucketEncryptionRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketEncryptionResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketEncryptionResult : public OssResult\n    {\n    public:\n        GetBucketEncryptionResult();\n        GetBucketEncryptionResult(const std::string& data);\n        GetBucketEncryptionResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketEncryptionResult& operator=(const std::string& data);\n        AlibabaCloud::OSS::SSEAlgorithm SSEAlgorithm() const { return SSEAlgorithm_; }\n        const std::string& KMSMasterKeyID() const { return KMSMasterKeyID_; }\n    private:\n        AlibabaCloud::OSS::SSEAlgorithm SSEAlgorithm_;\n        std::string KMSMasterKeyID_;\n    };\n}\n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketInfoRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketInfoRequest: public OssBucketRequest\n    {\n    public:\n        GetBucketInfoRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketInfoResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <memory>\r\n#include <iostream>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <alibabacloud/oss/model/Owner.h>\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT GetBucketInfoResult : public OssResult\r\n    {\r\n    public:\r\n        GetBucketInfoResult();\r\n        GetBucketInfoResult(const std::string& data);\r\n        GetBucketInfoResult(const std::shared_ptr<std::iostream>& data);\r\n        GetBucketInfoResult& operator=(const std::string& data);\r\n        const std::string& Location() const { return location_; }\r\n        const std::string& Name() const { return name_; }\r\n        const std::string& CreationDate() const { return creationDate_; }\r\n        const std::string& IntranetEndpoint() const { return intranetEndpoint_; }\r\n        const std::string& ExtranetEndpoint() const { return extranetEndpoint_; }\r\n        AlibabaCloud::OSS::StorageClass StorageClass() const { return storageClass_; }\r\n        CannedAccessControlList Acl() const { return acl_; }\r\n        const AlibabaCloud::OSS::Owner& Owner() { return owner_; }\r\n        AlibabaCloud::OSS::DataRedundancyType DataRedundancyType() const { return dataRedundancyType_; }\r\n        const std::string& Comment() const { return comment_; }\r\n        AlibabaCloud::OSS::SSEAlgorithm SSEAlgorithm() { return sseAlgorithm_; }\r\n        const std::string& KMSMasterKeyID() { return kmsMasterKeyID_; }\r\n        AlibabaCloud::OSS::VersioningStatus VersioningStatus() { return versioningStatus_; }\r\n    private:\r\n        std::string location_;\r\n        std::string name_;\r\n        std::string creationDate_;\r\n        std::string intranetEndpoint_;\r\n        std::string extranetEndpoint_;\r\n        AlibabaCloud::OSS::StorageClass storageClass_;\r\n        CannedAccessControlList acl_;\r\n        AlibabaCloud::OSS::Owner owner_;\r\n        AlibabaCloud::OSS::DataRedundancyType dataRedundancyType_;\r\n        std::string comment_;\r\n        AlibabaCloud::OSS::SSEAlgorithm sseAlgorithm_;\r\n        std::string kmsMasterKeyID_;\r\n        AlibabaCloud::OSS::VersioningStatus versioningStatus_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketInventoryConfigurationRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketInventoryConfigurationRequest : public OssBucketRequest\n    {\n    public:\n        GetBucketInventoryConfigurationRequest(const std::string& bucket);\n        GetBucketInventoryConfigurationRequest(const std::string& bucket, const std::string& id);\n        void setId(const std::string& id) { id_ = id; }\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    private:\n        std::string id_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketInventoryConfigurationResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/InventoryConfiguration.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketInventoryConfigurationResult : public OssResult\n    {\n    public:\n        GetBucketInventoryConfigurationResult();\n        GetBucketInventoryConfigurationResult(const std::string& data);\n        GetBucketInventoryConfigurationResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketInventoryConfigurationResult& operator=(const std::string& data);\n        AlibabaCloud::OSS::InventoryConfiguration InventoryConfiguration()const { return inventoryConfiguration_; }\n    private:\n        AlibabaCloud::OSS::InventoryConfiguration inventoryConfiguration_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketLifecycleRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketLifecycleRequest: public OssBucketRequest\n    {\n    public:\n        GetBucketLifecycleRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketLifecycleResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/LifecycleRule.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketLifecycleResult : public OssResult\n    {\n    public:\n        GetBucketLifecycleResult();\n        GetBucketLifecycleResult(const std::string& data);\n        GetBucketLifecycleResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketLifecycleResult& operator=(const std::string& data);\n        const LifecycleRuleList& LifecycleRules() { return lifecycleRuleList_; }\n    private:\n        LifecycleRuleList lifecycleRuleList_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketLocationRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketLocationRequest: public OssBucketRequest\n    {\n    public:\n        GetBucketLocationRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketLocationResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketLocationResult : public OssResult\n    {\n    public:\n        GetBucketLocationResult();\n        GetBucketLocationResult(const std::string& data);\n        GetBucketLocationResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketLocationResult& operator=(const std::string& data);\n        const std::string& Location() const { return location_; }\n    private:\n        std::string location_;\n    public:\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketLoggingRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketLoggingRequest: public OssBucketRequest\n    {\n    public:\n        GetBucketLoggingRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketLoggingResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketLoggingResult : public OssResult\n    {\n    public:\n        GetBucketLoggingResult();\n        GetBucketLoggingResult(const std::string& data);\n        GetBucketLoggingResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketLoggingResult& operator=(const std::string& data);\n        const std::string& TargetBucket() const { return targetBucket_; }\n        const std::string& TargetPrefix() const { return targetPrefix_; }\n    private:\n        std::string targetBucket_;\n        std::string targetPrefix_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketPaymentRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketRequestPaymentRequest: public OssBucketRequest\n    {\n    public:\n        GetBucketRequestPaymentRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketPaymentResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketPaymentResult : public OssResult\n    {\n    public:\n        GetBucketPaymentResult();\n        GetBucketPaymentResult(const std::string& data);\n        GetBucketPaymentResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketPaymentResult& operator=(const std::string& data);\n        RequestPayer Payer()const { return payer_; }\n    private:\n        RequestPayer payer_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketPolicyRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketPolicyRequest : public OssBucketRequest\n    {\n    public:\n        GetBucketPolicyRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketPolicyResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketPolicyResult : public OssResult\n    {\n    public:\n        GetBucketPolicyResult();\n        GetBucketPolicyResult(const std::string& data);\n        GetBucketPolicyResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketPolicyResult& operator=(const std::string& data);\n        const std::string& Policy()const  { return policy_; }\n    private:\n        std::string policy_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketQosInfoRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketQosInfoRequest : public OssBucketRequest\n    {\n    public:\n        GetBucketQosInfoRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketQosInfoResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/QosConfiguration.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketQosInfoResult : public OssResult\n    {\n    public:\n        GetBucketQosInfoResult();\n        GetBucketQosInfoResult(const std::string& data);\n        GetBucketQosInfoResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketQosInfoResult& operator=(const std::string& data);\n        const QosConfiguration& QosInfo() const { return qosInfo_; }\n    private:\n        QosConfiguration qosInfo_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketRefererRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketRefererRequest : public OssBucketRequest\n    {\n    public:\n        GetBucketRefererRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketRefererResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketRefererResult : public OssResult\n    {\n    public:\n        GetBucketRefererResult();\n        GetBucketRefererResult(const std::string& data);\n        GetBucketRefererResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketRefererResult& operator=(const std::string& data);\n        const AlibabaCloud::OSS::RefererList& RefererList() const { return refererList_;}\n        bool AllowEmptyReferer() const { return allowEmptyReferer_; }\n    private:\n        AlibabaCloud::OSS::RefererList refererList_;\n        bool allowEmptyReferer_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketStatRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketStatRequest: public OssBucketRequest\n    {\n    public:\n        GetBucketStatRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketStatResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketStatResult : public OssResult\n    {\n    public:\n        GetBucketStatResult();\n        GetBucketStatResult(const std::string& data);\n        GetBucketStatResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketStatResult& operator=(const std::string& data);\n        uint64_t Storage() const { return storage_; }\n        uint64_t ObjectCount() const { return objectCount_; }\n        uint64_t MultipartUploadCount() const { return multipartUploadCount_; }\n        uint64_t LiveChannelCount() const { return liveChannelCount_; }\n        uint64_t LastModifiedTime() const { return lastModifiedTime_; }\n        uint64_t StandardStorage() const { return standardStorage_; }\n        uint64_t StandardObjectCount() const { return standardObjectCount_; }\n        uint64_t InfrequentAccessStorage() const { return infrequentAccessStorage_; }\n        uint64_t InfrequentAccessObjectCount() const { return infrequentAccessObjectCount_; }\n        uint64_t ArchiveStorage() const { return archiveStorage_; }\n        uint64_t ArchiveObjectCount() const { return archiveObjectCount_; }\n        uint64_t ColdArchiveStorage() const { return coldArchiveStorage_; }\n        uint64_t ColdArchiveObjectCount() const { return coldArchiveObjectCount_; }\n\n    private:\n        uint64_t storage_;\n        uint64_t objectCount_;\n        uint64_t multipartUploadCount_;\n        uint64_t liveChannelCount_;\n        uint64_t lastModifiedTime_;\n        uint64_t standardStorage_;\n        uint64_t standardObjectCount_;\n        uint64_t infrequentAccessStorage_;\n        uint64_t infrequentAccessObjectCount_;\n        uint64_t archiveStorage_;\n        uint64_t archiveObjectCount_;\n        uint64_t coldArchiveStorage_;\n        uint64_t coldArchiveObjectCount_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketStorageCapacityRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketStorageCapacityRequest : public OssBucketRequest\n    {\n    public:\n        GetBucketStorageCapacityRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketStorageCapacityResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketStorageCapacityResult : public OssResult\n    {\n    public:\n        GetBucketStorageCapacityResult();\n        GetBucketStorageCapacityResult(const std::string& data);\n        GetBucketStorageCapacityResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketStorageCapacityResult& operator=(const std::string& data);\n        int64_t StorageCapacity() const  { return storageCapacity_; }\n    private:\n        int64_t storageCapacity_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketTaggingRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketTaggingRequest : public OssBucketRequest\n    {\n    public:\n        GetBucketTaggingRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketTaggingResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/Tagging.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketTaggingResult : public OssResult\n    {\n    public:\n        GetBucketTaggingResult();\n        GetBucketTaggingResult(const std::string& data);\n        GetBucketTaggingResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketTaggingResult& operator=(const std::string& data);\n        const AlibabaCloud::OSS::Tagging& Tagging() const { return tagging_; };\n    private:\n        AlibabaCloud::OSS::Tagging tagging_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketVersioningRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT GetBucketVersioningRequest: public OssBucketRequest\r\n    {\r\n    public:\r\n        GetBucketVersioningRequest(const std::string& bucket);\r\n    protected:\r\n        virtual ParameterCollection specialParameters() const;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketVersioningResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <memory>\r\n#include <iostream>\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <alibabacloud/oss/Types.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT GetBucketVersioningResult : public OssResult\r\n    {\r\n    public:\r\n        GetBucketVersioningResult();\r\n        GetBucketVersioningResult(const std::string& data);\r\n        GetBucketVersioningResult(const std::shared_ptr<std::iostream>& data);\r\n        GetBucketVersioningResult& operator=(const std::string& data);\r\n        VersioningStatus Status() const { return status_; }\r\n    private:\r\n        VersioningStatus status_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketWebsiteRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketWebsiteRequest : public OssBucketRequest\n    {\n    public:\n        GetBucketWebsiteRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketWebsiteResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketWebsiteResult: public OssResult\n    {\n    public:\n        GetBucketWebsiteResult();\n        GetBucketWebsiteResult(const std::string& data);\n        GetBucketWebsiteResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketWebsiteResult& operator=(const std::string& data);\n        const std::string& IndexDocument() const { return indexDocument_; }\n        const std::string& ErrorDocument() const { return errorDocument_; }\n    private:\n        std::string indexDocument_;\n        std::string errorDocument_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketWormRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketWormRequest : public OssBucketRequest\n    {\n    public:\n        GetBucketWormRequest(const std::string& bucket);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetBucketWormResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetBucketWormResult : public OssResult\n    {\n    public:\n        GetBucketWormResult();\n        GetBucketWormResult(const std::string& data);\n        GetBucketWormResult(const std::shared_ptr<std::iostream>& data);\n        GetBucketWormResult& operator=(const std::string& data);\n        const std::string& WormId() const { return wormId_; }\n        const std::string& CreationDate() const { return creationDate_; }\n        const std::string& State() const { return state_; }\n        uint32_t Day() const { return day_; }\n    private:\n        std::string wormId_;\n        std::string creationDate_;\n        std::string state_;\n        uint32_t day_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetLiveChannelHistoryRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/model/ObjectMetaData.h>\n#include <alibabacloud/oss/http/HttpType.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetLiveChannelHistoryRequest : public LiveChannelRequest\n    {\n    public:\n        GetLiveChannelHistoryRequest(const std::string& bucket, const std::string& channelName);\n\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual int validate() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetLiveChannelHistoryResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <string>\n#include <vector>\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/Owner.h>\n#include <alibabacloud/oss/ServiceRequest.h>\n\nusing std::vector;\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    struct LiveRecord\n    {\n        std::string startTime;\n        std::string endTime;\n        std::string remoteAddr;\n    };\n\n    using LiveRecordVec = vector<LiveRecord>;\n\n    class ALIBABACLOUD_OSS_EXPORT GetLiveChannelHistoryResult : public OssResult\n    {\n    public:\n        GetLiveChannelHistoryResult();\n        GetLiveChannelHistoryResult(const std::string& data);\n        GetLiveChannelHistoryResult(const std::shared_ptr<std::iostream>& data);\n        GetLiveChannelHistoryResult& operator=(const std::string& data);\n\n        const LiveRecordVec& LiveRecordList() const;\n    private:\n        LiveRecordVec recordList_;\n    };\n} \n}\n\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetLiveChannelInfoRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/model/ObjectMetaData.h>\n#include <alibabacloud/oss/http/HttpType.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetLiveChannelInfoRequest : public LiveChannelRequest\n    {\n    public:\n        GetLiveChannelInfoRequest(const std::string& bucket, const std::string& channelName);\n\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual int validate() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetLiveChannelInfoResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <string>\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/Owner.h>\n#include <alibabacloud/oss/ServiceRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetLiveChannelInfoResult : public OssResult\n    {\n    public:\n        GetLiveChannelInfoResult();\n        GetLiveChannelInfoResult(const std::string& data);\n        GetLiveChannelInfoResult(const std::shared_ptr<std::iostream>& data);\n        GetLiveChannelInfoResult& operator=(const std::string& data);\n\n        const std::string& Description() const;\n        LiveChannelStatus Status() const;\n\n        const std::string& Type() const;\n        uint64_t FragDuration() const;\n        uint64_t FragCount() const;\n        const std::string& PlaylistName() const;\n    private:\n        std::string channelType_;\n        LiveChannelStatus status_;\n        std::string description_;\n        std::string playListName_;\n        uint64_t fragDuration_;\n        uint64_t fragCount_;\n    };\n} \n}\n\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetLiveChannelStatRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/model/ObjectMetaData.h>\n#include <alibabacloud/oss/http/HttpType.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetLiveChannelStatRequest : public LiveChannelRequest\n    {\n    public:\n        GetLiveChannelStatRequest(const std::string& bucket, const std::string& channelName);\n\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual int validate() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetLiveChannelStatResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <string>\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/Owner.h>\n#include <alibabacloud/oss/ServiceRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetLiveChannelStatResult : public OssResult\n    {\n    public:\n        GetLiveChannelStatResult();\n        GetLiveChannelStatResult(const std::string& data);\n        GetLiveChannelStatResult(const std::shared_ptr<std::iostream>& data);\n        GetLiveChannelStatResult& operator=(const std::string& data);\n\n        LiveChannelStatus Status() const;\n        const std::string& ConnectedTime() const;\n        const std::string& RemoteAddr() const;\n        uint32_t Width() const;\n        uint32_t Height() const;\n        uint64_t FrameRate() const;\n        uint64_t VideoBandWidth() const;\n        const std::string& VideoCodec() const;\n        uint64_t SampleRate() const;\n        uint64_t AudioBandWidth() const;\n        const std::string& AudioCodec() const;\n    private:\n        std::string connectedTime_;\n        LiveChannelStatus status_;\n        std::string remoteAddr_;\n        uint32_t width_;\n        uint32_t height_;\n        uint64_t frameRate_;\n        uint64_t videoBandWidth_;\n        std::string videoCodec_;\n        uint64_t sampleRate_;\n        uint64_t audioBandWidth_;\n        std::string audioCodec_;\n    };\n} \n}\n\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetObjectAclRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetObjectAclRequest: public OssObjectRequest\n    {\n    public:\n        GetObjectAclRequest(const std::string& bucket, const std::string& key);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetObjectAclResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <string>\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <alibabacloud/oss/model/Owner.h>\r\n#include <alibabacloud/oss/ServiceRequest.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT GetObjectAclResult : public OssObjectResult\r\n    {\r\n    public:\r\n        GetObjectAclResult();\r\n        GetObjectAclResult(const std::string& data);\r\n        GetObjectAclResult(const std::shared_ptr<std::iostream>& data);\r\n        GetObjectAclResult(const HeaderCollection& headers, const std::shared_ptr<std::iostream>& data);\r\n        GetObjectAclResult& operator=(const std::string& data);\r\n        const AlibabaCloud::OSS::Owner& Owner() { return owner_; }\r\n        CannedAccessControlList Acl()const  { return acl_; }\r\n    private:\r\n        AlibabaCloud::OSS::Owner owner_;\r\n        CannedAccessControlList acl_;\r\n    };\r\n} \r\n}\r\n\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetObjectByUrlRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/model/ObjectMetaData.h>\n#include <alibabacloud/oss/http/HttpType.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetObjectByUrlRequest: public ServiceRequest\n    {\n    public:\n        GetObjectByUrlRequest(const std::string& url);\n        GetObjectByUrlRequest(const std::string& url, const ObjectMetaData& metaData);\n        virtual HeaderCollection Headers() const;\n        virtual ParameterCollection Parameters() const;\n        virtual std::shared_ptr<std::iostream> Body() const;\n    private:\n        ObjectMetaData metaData_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetObjectMetaRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetObjectMetaRequest : public OssObjectRequest\n    {\n    public:\n        GetObjectMetaRequest(const std::string& bucket, const std::string& key):\n            OssObjectRequest(bucket, key)\n        {\n        }\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetObjectRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <vector>\n#include <map>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetObjectRequest: public OssObjectRequest\n    {\n    public:\n        GetObjectRequest(const std::string& bucket, const std::string& key);\n        GetObjectRequest(const std::string& bucket, const std::string& key, \n            const std::string& process);\n        GetObjectRequest(const std::string &bucket, const std::string &key, \n            const std::string &modifiedSince, const std::string &unmodifiedSince, \n            const std::vector<std::string> &matchingETags, const std::vector<std::string> &nonmatchingETags, \n            const std::map<std::string, std::string> &responseHeaderParameters_);\n        void setRange(int64_t start, int64_t end);\n        void setRange(int64_t start, int64_t end, bool standard);\n        void setModifiedSinceConstraint(const std::string& gmt);\n        void setUnmodifiedSinceConstraint(const std::string& gmt);\n        void setMatchingETagConstraints(const std::vector<std::string>& match);\n        void addMatchingETagConstraint(const std::string& match);\n        void setNonmatchingETagConstraints(const std::vector<std::string>& match);\n        void addNonmatchingETagConstraint(const std::string& match);\n        void setProcess(const std::string& process);\n        void addResponseHeaders(RequestResponseHeader header, const std::string& value);\n        void setTrafficLimit(uint64_t value);\n        void setUserAgent(const std::string& ua);\n\n        std::pair<int64_t, int64_t> Range() const;\n    protected:\n        virtual HeaderCollection specialHeaders() const ;\n        virtual ParameterCollection specialParameters() const;\n        virtual int validate() const;\n    private:\n        int64_t range_[2];\n        bool rangeIsSet_;\n        std::string modifiedSince_;\n        std::string unmodifiedSince_;\n        std::vector<std::string> matchingETags_;\n        std::vector<std::string> nonmatchingETags_;\n        std::string process_;\n        std::map<std::string, std::string> responseHeaderParameters_;\n        uint64_t trafficLimit_;\n        bool rangeIsStandardMode_;\n        std::string userAgent_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetObjectResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <string>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/ObjectMetaData.h>\n#include <alibabacloud/oss/ServiceRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetObjectResult :public OssObjectResult\n    {\n    public:\n        GetObjectResult();\n        GetObjectResult(const std::string& bucket, const std::string& key, \n            const std::shared_ptr<std::iostream>& content,\n            const HeaderCollection& headers);\n        GetObjectResult(const std::string& bucket, const std::string& key,\n            const ObjectMetaData& metaData);\n        const std::string& Bucket() const { return bucket_; }\n        const std::string& Key()  const { return key_; }\n        const ObjectMetaData& Metadata()  const { return metaData_; }\n        const std::shared_ptr<std::iostream>& Content() const { return content_; }\n        void setContent(const std::shared_ptr<std::iostream>& content) { content_ = content; }\n        void setMetaData(const ObjectMetaData& meta) { metaData_ = meta; }\n    private:\n        std::string bucket_;\n        std::string key_;\n        ObjectMetaData metaData_;\n        std::shared_ptr<std::iostream> content_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetObjectTaggingRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT GetObjectTaggingRequest : public OssObjectRequest\r\n    {\r\n    public:\r\n        GetObjectTaggingRequest(const std::string& bucket, const std::string& key);\r\n    protected:\r\n        virtual ParameterCollection specialParameters() const;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetObjectTaggingResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <alibabacloud/oss/model/Tagging.h>\r\n#include <alibabacloud/oss/Types.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT GetObjectTaggingResult : public OssObjectResult\r\n    {\r\n    public:\r\n        GetObjectTaggingResult();\r\n        GetObjectTaggingResult(const std::string& data);\r\n        GetObjectTaggingResult(const std::shared_ptr<std::iostream>& data);\r\n        GetObjectTaggingResult(const HeaderCollection& headers, const std::shared_ptr<std::iostream>& data);\r\n        GetObjectTaggingResult& operator=(const std::string& data);\r\n        const AlibabaCloud::OSS::Tagging& Tagging() const { return tagging_; };\r\n    private:\r\n        AlibabaCloud::OSS::Tagging tagging_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetSymlinkRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n\n#include <string>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetSymlinkRequest: public OssObjectRequest\n    {\n    public:\n        GetSymlinkRequest(const std::string& bucket, const std::string& key);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n}\n}\n\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetSymlinkResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <string>\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <alibabacloud/oss/ServiceRequest.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT GetSymlinkResult : public OssObjectResult\r\n    {\r\n    public:\r\n       public:\r\n        GetSymlinkResult();\r\n        GetSymlinkResult(const std::string& symlink,const std::string& etag);\r\n        GetSymlinkResult(const HeaderCollection& headers);\r\n        const std::string& SymlinkTarget() const { return symlink_; }\r\n        const std::string& ETag() const { return etag_; }\r\n     private:\r\n        std::string symlink_;\r\n        std::string etag_;\r\n    };\r\n} \r\n}\r\n\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetUserQosInfoRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetUserQosInfoRequest : public OssRequest\n    {\n    public:\n        GetUserQosInfoRequest();\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetUserQosInfoResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/QosConfiguration.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetUserQosInfoResult : public OssResult\n    {\n    public:\n        GetUserQosInfoResult();\n        GetUserQosInfoResult(const std::string& data);\n        GetUserQosInfoResult(const std::shared_ptr<std::iostream>& data);\n        GetUserQosInfoResult& operator=(const std::string& data);\n        const QosConfiguration& QosInfo() const { return qosInfo_; }\n        const std::string& Region() const { return region_; }\n    private:\n        std::string region_;\n        QosConfiguration qosInfo_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetVodPlaylistRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/model/ObjectMetaData.h>\n#include <alibabacloud/oss/http/HttpType.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT GetVodPlaylistRequest : public LiveChannelRequest\n    {\n    public:\n        GetVodPlaylistRequest(const std::string& bucket, \n            const std::string& channelName);\n\n        GetVodPlaylistRequest(const std::string& bucket, \n            const std::string& channelName, uint64_t startTime, \n            uint64_t endTime);\n\n        void setStartTime(uint64_t startTime);\n        void setEndTime(uint64_t endTime);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual int validate() const;\n    private:\n        uint64_t startTime_;\n        uint64_t endTime_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/GetVodPlaylistResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <vector>\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\n    class ALIBABACLOUD_OSS_EXPORT GetVodPlaylistResult: public OssResult\n    {\n    public:\n        GetVodPlaylistResult();\n        GetVodPlaylistResult(const std::string& data);\n        GetVodPlaylistResult(const std::shared_ptr<std::iostream>& data);\n        GetVodPlaylistResult& operator=(const std::string& data);\n\n        const std::string& PlaylistContent() const;\n\n    private:\n        std::string playListContent_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/HeadObjectRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT HeadObjectRequest : public OssObjectRequest\n    {\n    public:\n        HeadObjectRequest(const std::string& bucket, const std::string& key):\n            OssObjectRequest(bucket, key)\n        {\n        }\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/InitiateBucketWormRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT InitiateBucketWormRequest : public OssBucketRequest\n    {\n    public:\n        InitiateBucketWormRequest(const std::string& bucket, uint32_t day);\n    protected:\n        virtual std::string payload() const;\n        virtual ParameterCollection specialParameters() const;\n    private:\n        uint32_t day_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/InitiateBucketWormResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT InitiateBucketWormResult : public OssResult\n    {\n    public:\n        InitiateBucketWormResult();\n        InitiateBucketWormResult(const HeaderCollection& header);\n        const std::string& WormId()const  { return wormId_; }\n    private:\n        std::string wormId_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/InitiateMultipartUploadRequest.h",
    "content": "/*\r\n * Copyright 2009-2018 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n#include <alibabacloud/oss/model/ObjectMetaData.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT InitiateMultipartUploadRequest: public OssObjectRequest\r\n    {\r\n    public:\r\n        InitiateMultipartUploadRequest(const std::string& bucket, const std::string& key);\r\n        InitiateMultipartUploadRequest(const std::string& bucket, const std::string& key,\r\n            const ObjectMetaData& metaData);\r\n        void setCacheControl(const std::string& value);\r\n        void setContentDisposition(const std::string& value);\r\n        void setContentEncoding(const std::string& value);\r\n        void setExpires(const std::string& value);\r\n        ObjectMetaData& MetaData();\r\n        void setEncodingType(const std::string& encodingType);\r\n        void setTagging(const std::string& value);\r\n        void setSequential(bool value);\r\n    protected:\r\n        virtual HeaderCollection specialHeaders() const;\r\n        virtual ParameterCollection specialParameters() const;\r\n    private:\r\n        ObjectMetaData metaData_;\r\n        std::string encodingType_;\r\n        bool encodingTypeIsSet_;\r\n        bool sequential_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/InitiateMultipartUploadResult.h",
    "content": "/*\n * Copyright 2009-2018 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <string>\n#include <memory>\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssResult.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT InitiateMultipartUploadResult :public OssResult\n    {\n    public:\n        InitiateMultipartUploadResult();\n        InitiateMultipartUploadResult(const std::string& data);\n        InitiateMultipartUploadResult(const std::shared_ptr<std::iostream>& data);\n        InitiateMultipartUploadResult& operator=(const std::string& data);\n\n        const std::string& Bucket() const { return bucket_; }\n        const std::string& Key() const { return key_; }\n        const std::string& UploadId() const { return uploadId_; }\n        const std::string& EncodingType() const { return encodingType_; }\n    private:\n        std::string bucket_;\n        std::string key_;\n        std::string uploadId_;\n        std::string encodingType_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/InputFormat.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\tenum CompressionType\n\t{\n\t\tNONE = 0,\n\t\tGZIP\n\t};\n\n    enum CSVHeader\n    {\n        None = 0, // there is no csv header\n        Ignore,   // we should ignore csv header and should not use csv header in select sql\n        Use       // we can use csv header in select sql\n    };\n\n    enum JsonType\n    {\n        DOCUMENT = 0,\n        LINES\n    };\n\n    class SelectObjectRequest;\n    class CreateSelectObjectMetaRequest;\n\n\tclass ALIBABACLOUD_OSS_EXPORT InputFormat\n\t{\n\tpublic:\n        void setCompressionType(CompressionType compressionType);\n\n        void setLineRange(int64_t start, int64_t end);\n        void setSplitRange(int64_t start, int64_t end);\n\n\t\tconst std::string CompressionTypeInfo() const;\n\n        \n\n    protected:\n        InputFormat();\n        friend SelectObjectRequest;\n        friend CreateSelectObjectMetaRequest;\n        virtual int validate() const;\n        virtual std::string toXML(int flag) const = 0;\n        virtual std::string Type() const = 0;\n        std::string RangeToString() const;\n\tprivate:\n\t\tCompressionType compressionType_;\n        bool lineRangeIsSet_;\n        int64_t lineRange_[2];\n        bool splitRangeIsSet_;\n        int64_t splitRange_[2];\n\t};\n\n    class ALIBABACLOUD_OSS_EXPORT CSVInputFormat : public InputFormat\n    {\n    public:\n        CSVInputFormat();\n        CSVInputFormat(CSVHeader headerInfo,\n            const std::string& recordDelimiter,\n            const std::string& fieldDelimiter,\n            const std::string& quoteChar,\n            const std::string& commentChar);\n\n        void setHeaderInfo(CSVHeader headerInfo);\n        void setRecordDelimiter(const std::string& recordDelimiter);\n        void setFieldDelimiter(const std::string& fieldDelimiter);\n        void setQuoteChar(const std::string& quoteChar);\n        void setCommentChar(const std::string& commentChar);\n\n        CSVHeader HeaderInfo() const;\n        const std::string& RecordDelimiter() const;\n        const std::string& FieldDelimiter() const;\n        const std::string& QuoteChar() const;\n        const std::string& CommentChar() const;\n\n    protected:\n        std::string Type() const;\n        std::string toXML(int flag) const;\n        \n    private:\n        CSVHeader headerInfo_;\n        std::string recordDelimiter_;\n        std::string fieldDelimiter_;\n        std::string quoteChar_;\n        std::string commentChar_;\n    };\n\n    class ALIBABACLOUD_OSS_EXPORT JSONInputFormat : public InputFormat\n    {\n    public:\n        JSONInputFormat();\n        JSONInputFormat(JsonType jsonType);\n\n        void setJsonType(JsonType jsonType);\n        void setParseJsonNumberAsString(bool parseJsonNumberAsString);\n\n        JsonType JsonInfo() const;\n        bool ParseJsonNumberAsString() const;\n\n    protected:\n        std::string Type() const;\n        std::string toXML(int flag) const;\n\n    private:\n        JsonType jsonType_;\n        bool parseJsonNumberAsString_;\n    };\n\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/InventoryConfiguration.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n#pragma once\n\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/Types.h>\n#include <string>\n#include <vector>\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT InventoryFilter\n    {\n    public:\n        InventoryFilter();\n        InventoryFilter(const std::string& prefix);\n        const std::string& Prefix() const { return prefix_; }\n        void setPrefix(const std::string& prefix) { prefix_ = prefix; }\n    private:\n        std::string prefix_;\n    };\n\n    class ALIBABACLOUD_OSS_EXPORT InventorySSEOSS\r\n    {\r\n    public:\r\n        InventorySSEOSS();\r\n    };\n\n    class ALIBABACLOUD_OSS_EXPORT InventorySSEKMS\r\n    {\r\n    public:\r\n        InventorySSEKMS();\r\n        InventorySSEKMS(const std::string& key);\r\n        const std::string& KeyId() const { return keyId_; }\r\n        void setKeyId(const std::string& key) { keyId_ = key; }\r\n    private:\r\n        std::string keyId_;\r\n    };\n\n    class ALIBABACLOUD_OSS_EXPORT InventoryEncryption\n    {\n    public:\n        InventoryEncryption();\n        InventoryEncryption(const InventorySSEOSS& value);\n        InventoryEncryption(const InventorySSEKMS& value);\n\n        const InventorySSEOSS& SSEOSS() const { return inventorySSEOSS_; }\n        void setSSEOSS(const InventorySSEOSS& value) { inventorySSEOSS_ = value;  inventorySSEOSIsSet_ = true; }\n        bool hasSSEOSS() const { return inventorySSEOSIsSet_; }\n\n        const InventorySSEKMS& SSEKMS() const { return inventorySSEKMS_; }\n        void setSSEKMS(const InventorySSEKMS& value) { inventorySSEKMS_ = value;  inventorySSEKMSIsSet_ = true; }\n        bool hasSSEKMS() const { return inventorySSEKMSIsSet_; }\n\n    private:\n        InventorySSEOSS inventorySSEOSS_;\n        bool inventorySSEOSIsSet_;\n\n        InventorySSEKMS inventorySSEKMS_;\n        bool inventorySSEKMSIsSet_;\n    };\n\n    class ALIBABACLOUD_OSS_EXPORT InventoryOSSBucketDestination\n    {\n    public:\n        InventoryOSSBucketDestination();\n        InventoryFormat Format() const { return format_; }\n        const std::string& AccountId() const { return accountId_; }\n        const std::string& RoleArn() const { return roleArn_; }\n        const std::string& Bucket() const { return bucket_; }\n        const std::string& Prefix() const { return prefix_; }\n        const InventoryEncryption& Encryption() const { return encryption_; }\n\n        void setFormat(InventoryFormat format) { format_ = format; }\n        void setAccountId(const std::string& accountId) { accountId_ = accountId; }\n        void setRoleArn(const std::string& roleArn) { roleArn_ = roleArn; }\n        void setBucket(const std::string& bucket) { bucket_ = bucket; }\n        void setPrefix(const std::string& prefix) { prefix_ = prefix; }\n        void setEncryption(const InventoryEncryption& encryption) { encryption_ = encryption; }\n\n    private:\n        InventoryFormat format_;\n        std::string accountId_;\n        std::string roleArn_;\n        std::string bucket_;\n        std::string prefix_;\n        InventoryEncryption encryption_;\n    };\n\n    class InventoryDestination\n    {\n    public:\n        InventoryDestination() {}\n        InventoryDestination(const InventoryOSSBucketDestination& destination):InventoryOSSBucketDestination_(destination){}\n        const InventoryOSSBucketDestination& OSSBucketDestination() const { return InventoryOSSBucketDestination_; }\n        void setOSSBucketDestination(const InventoryOSSBucketDestination& destination) { InventoryOSSBucketDestination_ = destination; }\n    private:\n        InventoryOSSBucketDestination InventoryOSSBucketDestination_;\n    };\n\n    using InventoryOptionalFields = std::vector<InventoryOptionalField>;\n\n    class ALIBABACLOUD_OSS_EXPORT InventoryConfiguration\n    {\n    public:\n        InventoryConfiguration();\n        const std::string& Id() const { return id_; }\n        bool IsEnabled() const { return isEnabled_; }\n        const InventoryFilter& Filter() const { return filter_; }\n        const InventoryDestination& Destination() const { return destination_; }\n        const InventoryFrequency& Schedule() const { return schedule_; }\n        const InventoryIncludedObjectVersions& IncludedObjectVersions() const { return includedObjectVersions_; }\n        const InventoryOptionalFields& OptionalFields() const { return optionalFields_; }\n\n        void setId(const std::string& id) { id_ = id; }\n        void setIsEnabled(bool isEnabled) { isEnabled_ = isEnabled; }\n        void setFilter(const InventoryFilter& prefix) { filter_ = prefix; }\n        void setDestination(const InventoryDestination& destination) { destination_ = destination; }\n        void setSchedule(const InventoryFrequency& schedule) { schedule_ = schedule; }\n        void setIncludedObjectVersions(const InventoryIncludedObjectVersions& includedObjectVersions) { includedObjectVersions_ = includedObjectVersions; }\n        void setOptionalFields(const InventoryOptionalFields& opt) { optionalFields_ = opt; }\n\n    private:\n        std::string id_;\n        bool isEnabled_;\n        InventoryFilter filter_;\n        InventoryDestination destination_;\n        InventoryFrequency schedule_;\n        InventoryIncludedObjectVersions includedObjectVersions_;\n        InventoryOptionalFields optionalFields_;\n    };\n\n    using InventoryConfigurationList = std::vector<InventoryConfiguration>;\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/LifecycleRule.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <string>\r\n#include <vector>\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/model/Tagging.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT LifeCycleExpiration\r\n    {\r\n    public:\r\n        LifeCycleExpiration();\r\n        LifeCycleExpiration(uint32_t days);\r\n        LifeCycleExpiration(const std::string& createdBeforeDate);\r\n        void setDays(uint32_t days);\r\n        void setCreatedBeforeDate(const std::string& date);\r\n        uint32_t Days() const { return days_; }\r\n        const std::string& CreatedBeforeDate() const { return createdBeforeDate_; }\r\n    private:\r\n        uint32_t days_;\r\n        std::string createdBeforeDate_;\r\n    };\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT LifeCycleTransition\r\n    {\r\n    public:\r\n        LifeCycleTransition() = default;\r\n        LifeCycleTransition(const LifeCycleExpiration& expiration, AlibabaCloud::OSS::StorageClass storageClass);\r\n        void setExpiration(const LifeCycleExpiration& expiration);\r\n        void setStorageClass(AlibabaCloud::OSS::StorageClass storageClass);\r\n        const LifeCycleExpiration& Expiration() const { return expiration_; }\r\n        LifeCycleExpiration& Expiration() { return expiration_; }\r\n        AlibabaCloud::OSS::StorageClass StorageClass() const { return storageClass_; }\r\n    private:\r\n        LifeCycleExpiration expiration_;\r\n        AlibabaCloud::OSS::StorageClass storageClass_;\r\n    };\r\n\r\n    using LifeCycleTransitionList = std::vector<LifeCycleTransition>;\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT LifecycleRule\r\n    {\r\n    public:\r\n        LifecycleRule();\r\n        const std::string& ID() const { return id_; }\r\n        const std::string& Prefix() const { return prefix_; }\r\n        RuleStatus Status() const {  return status_;}\r\n        const LifeCycleExpiration& Expiration() const { return expiration_; }\r\n        const LifeCycleTransitionList& TransitionList() const { return transitionList_; }\r\n        const LifeCycleExpiration& AbortMultipartUpload() const { return abortMultipartUpload_; }\r\n        LifeCycleExpiration& Expiration() { return expiration_; }\r\n        LifeCycleTransitionList& TransitionList() { return transitionList_; }\r\n        LifeCycleExpiration& AbortMultipartUpload() { return abortMultipartUpload_; }\r\n\r\n        const TagSet& Tags() const { return tagSet_; }\r\n        TagSet& Tags() { return tagSet_; }\r\n\r\n        void setID(const std::string& id) { id_ = id; }\r\n        void setPrefix(const std::string& prefix) { prefix_ = prefix; }\r\n        void setStatus(RuleStatus status) { status_ = status; }\r\n        void setExpiration(const LifeCycleExpiration& expiration) { expiration_ = expiration; }\r\n        void addTransition(const LifeCycleTransition&transition) { transitionList_.push_back(transition); }\r\n        void setTransitionList(const LifeCycleTransitionList& transitionList) { transitionList_ = transitionList; }\r\n        void setAbortMultipartUpload(const LifeCycleExpiration& expiration) { abortMultipartUpload_ = expiration; }\r\n        void addTag(const Tag& tag) { tagSet_.push_back(tag); }\r\n        void setTags(const TagSet& tags) { tagSet_ = tags; }\r\n        bool hasExpiration() const;\r\n        bool hasTransitionList() const;\r\n        bool hasAbortMultipartUpload() const;\r\n        bool operator==(const LifecycleRule& right) const;\r\n\r\n        bool ExpiredObjectDeleteMarker() const { return expiredObjectDeleteMarker_; };\r\n        const LifeCycleExpiration& NoncurrentVersionExpiration() const { return noncurrentVersionExpiration_; }\r\n        const LifeCycleTransitionList& NoncurrentVersionTransitionList() const { return noncurrentVersionTransitionList_; }\r\n        LifeCycleExpiration& NoncurrentVersionExpiration() { return noncurrentVersionExpiration_; }\r\n        LifeCycleTransitionList& NoncurrentVersionTransitionList() { return noncurrentVersionTransitionList_; }\r\n        void setExpiredObjectDeleteMarker(bool value) { expiredObjectDeleteMarker_ = value; };\r\n        void setNoncurrentVersionExpiration(const LifeCycleExpiration& expiration) { noncurrentVersionExpiration_ = expiration; }\r\n        void addNoncurrentVersionTransition(const LifeCycleTransition&transition) { noncurrentVersionTransitionList_.push_back(transition); }\r\n        void setNoncurrentVersionTransitionList(const LifeCycleTransitionList& transitionList) { noncurrentVersionTransitionList_ = transitionList; }\r\n        bool hasNoncurrentVersionExpiration() const;\r\n        bool hasNoncurrentVersionTransitionList() const;\r\n\r\n    private:\r\n        std::string id_;\r\n        std::string prefix_;\r\n        RuleStatus status_;\r\n        LifeCycleExpiration expiration_;\r\n        LifeCycleTransitionList transitionList_;\r\n        LifeCycleExpiration abortMultipartUpload_;\r\n        TagSet tagSet_;\r\n\r\n        bool expiredObjectDeleteMarker_;\r\n        LifeCycleExpiration noncurrentVersionExpiration_;\r\n        LifeCycleTransitionList noncurrentVersionTransitionList_;\r\n    };\r\n    using LifecycleRuleList = std::vector<LifecycleRule>;\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListBucketInventoryConfigurationsRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ListBucketInventoryConfigurationsRequest : public OssBucketRequest\n    {\n    public:\n        ListBucketInventoryConfigurationsRequest(const std::string& bucket);\n        void setContinuationToken(const std::string& token) { continuationToken_ = token; }\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    private:\n        std::string continuationToken_;\n    };\n}\n}\n\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListBucketInventoryConfigurationsResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/InventoryConfiguration.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ListBucketInventoryConfigurationsResult : public OssResult\n    {\n    public:\n        ListBucketInventoryConfigurationsResult();\n        ListBucketInventoryConfigurationsResult(const std::string& data);\n        ListBucketInventoryConfigurationsResult(const std::shared_ptr<std::iostream>& data);\n        ListBucketInventoryConfigurationsResult& operator=(const std::string& data);\n        const AlibabaCloud::OSS::InventoryConfigurationList& InventoryConfigurationList()const { return inventoryConfigurationList_; }\n        bool IsTruncated() const { return isTruncated_; }\n        const std::string& NextContinuationToken() const { return nextContinuationToken_; }\n\n    private:\n        AlibabaCloud::OSS::InventoryConfigurationList inventoryConfigurationList_;\n        bool isTruncated_;\n        std::string nextContinuationToken_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListBucketsRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/model/Tagging.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ListBucketsRequest: public OssRequest\n    {\n    public:\n        ListBucketsRequest();\n        ListBucketsRequest(const std::string& prefix, const std::string& marker, int maxKeys = 100);\n\n        void setPrefix(const std::string& prefix) {prefix_ = prefix; prefixIsSet_ = true;}    \n        void setMarker(const std::string& marker) {marker_ = marker; markerIsSet_ = true;}    \n        void setMaxKeys(int maxKeys) {maxKeys_ = maxKeys; maxKeysIsSet_ = true;} \n        void setTag(const Tag& tag) { tag_ = tag; tagIsSet = true; }\n        void setRegionList(bool flag) { regionList_ = flag;}\n    protected:\n        virtual ParameterCollection specialParameters() const;\n\n    private:\n        std::string prefix_;\n        bool prefixIsSet_;\n        std::string marker_;\n        bool markerIsSet_;\n        int maxKeys_;\n        bool maxKeysIsSet_;\n        Tag tag_;\n        bool tagIsSet;\n        bool regionList_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListBucketsResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include \"Bucket.h\"\n#include <vector>\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ListBucketsResult: public OssResult\n    {\n    public:\n        ListBucketsResult();\n        ListBucketsResult(const std::string& data);\n        ListBucketsResult(const std::shared_ptr<std::iostream>& data);\n        ListBucketsResult& operator=(const std::string& data);\n        const std::string& Prefix() const { return prefix_; }\n        const std::string& Marker() const { return marker_; }\n        const std::string& NextMarker() const { return nextMarker_; }\n        int MaxKeys() const { return maxKeys_; }\n        bool IsTruncated() const { return isTruncated_; }\n        const std::vector<Bucket>& Buckets() const { return buckets_; }\n    private:\n        std::string prefix_;\n        std::string marker_;\n        std::string nextMarker_;\n        bool        isTruncated_;\n        int         maxKeys_;\n        std::vector<Bucket> buckets_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListLiveChannelRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ListLiveChannelRequest: public OssBucketRequest\n    {\n    public:\n        ListLiveChannelRequest(const std::string &bucket);\n\n        void setMarker(const std::string& marker);   \n        void setMaxKeys(uint32_t maxKeys);\n        void setPrefix(const std::string& prefix);    \n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual int validate() const;\n    private:\n        std::string prefix_;\n        std::string marker_;\n        uint32_t maxKeys_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListLiveChannelResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <vector>\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    struct LiveChannelInfo\n    {\n        std::string name;\n        std::string description;\n        std::string status;\n        std::string lastModified;\n        std::string publishUrl;\n        std::string playUrl;\n    };\n\n    using LiveChannelListInfo = std::vector<LiveChannelInfo>;\n\n    class ALIBABACLOUD_OSS_EXPORT ListLiveChannelResult: public OssResult\n    {\n    public:\n        ListLiveChannelResult();\n        ListLiveChannelResult(const std::string& data);\n        ListLiveChannelResult(const std::shared_ptr<std::iostream>& data);\n        ListLiveChannelResult& operator=(const std::string& data);\n\n        const std::string& Prefix() const;\n        const std::string& Marker() const;\n        const std::string& NextMarker() const;\n        bool IsTruncated() const;\n        const LiveChannelListInfo& LiveChannelList() const;\n        uint32_t MaxKeys() const;\n    private:\n        std::string prefix_;\n        std::string marker_;\n        std::string nextMarker_;\n        LiveChannelListInfo liveChannelList_;\n        uint32_t maxKeys_;\n        bool     isTruncated_;\n        \n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListMultipartUploadsRequest.h",
    "content": "/*\n * Copyright 2009-2018 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <sstream>\n#include <iostream>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ListMultipartUploadsRequest: public OssBucketRequest\n    {\n    public:\n        ListMultipartUploadsRequest(const std::string& bucket);\n        void setDelimiter(const std::string& delimiter);\n        void setMaxUploads(uint32_t maxUploads);\n        void setKeyMarker(const std::string& keyMarker);\n        void setPrefix(const std::string& prefix);\n        void setUploadIdMarker(const std::string& uploadIdMarker);\n        void setEncodingType(const std::string& encodingType);\n        void setRequestPayer(RequestPayer value);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual HeaderCollection specialHeaders() const;\n    private:\n        std::string delimiter_;\n        bool delimiterIsSet_;\n        std::string keyMarker_;\n        bool keyMarkerIsSet_;\n        std::string prefix_;\n        bool prefixIsSet_;\n        std::string uploadIdMarker_;\n        bool uploadIdMarkerIsSet_;\n        std::string encodingType_;\n        bool encodingTypeIsSet_;\n        int maxUploads_;\n        bool maxUploadsIsSet_;\n        RequestPayer requestPayer_;\n    };\n} \n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListMultipartUploadsResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssResult.h>\n#include <vector>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class MultipartUpload\n    {\n    public:\n        MultipartUpload() = default;\n    public:\n        std::string Key;\n        std::string UploadId;\n        std::string Initiated;\n    };\n\n    using MultipartUploadList = std::vector<MultipartUpload>;\n    class ALIBABACLOUD_OSS_EXPORT ListMultipartUploadsResult : public OssResult\n    {\n    public:\n        ListMultipartUploadsResult();\n        ListMultipartUploadsResult(const std::string& data);\n        ListMultipartUploadsResult(const std::shared_ptr<std::iostream>& data);\n        ListMultipartUploadsResult& operator=(const std::string& data);\n\n        const std::string& Bucket() const { return bucket_; }\n        const std::string& KeyMarker() const { return keyMarker_; }\n        const std::string& UploadIdMarker() const { return uploadIdMarker_; }\n        const std::string& EncodingType() const { return encodingType_; }\n        const std::string& NextKeyMarker() const { return nextKeyMarker_; }\n        const std::string& NextUploadIdMarker() const { return nextUploadIdMarker_; }\n        uint32_t MaxUploads() const { return maxUploads_; }\n        bool IsTruncated() const { return isTruncated_; }\n        const CommonPrefixeList& CommonPrefixes() const { return commonPrefixes_; }\n        const AlibabaCloud::OSS::MultipartUploadList& MultipartUploadList() const { return multipartUploadList_; }\n    private:\n        std::string bucket_;\n        std::string keyMarker_;\n        std::string uploadIdMarker_;\n        std::string encodingType_;\n        std::string nextKeyMarker_;\n        std::string nextUploadIdMarker_;\n        uint32_t maxUploads_;\n        bool isTruncated_;\n        CommonPrefixeList commonPrefixes_;\n        AlibabaCloud::OSS::MultipartUploadList multipartUploadList_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListObjectVersionsRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT ListObjectVersionsRequest : public OssBucketRequest\r\n    {\r\n    public:\r\n        ListObjectVersionsRequest(const std::string& bucket):\r\n            OssBucketRequest(bucket),\r\n            delimiterIsSet_(false),\r\n            keyMarkerIsSet_(false),\r\n            maxKeysIsSet_(false),\r\n            prefixIsSet_(false),\r\n            encodingTypeIsSet_(false),\r\n            versionIdMarkerIsSet_(false)\r\n        {\r\n        }\r\n        void setDelimiter(const std::string& delimiter) { delimiter_ = delimiter; delimiterIsSet_ = true; }\r\n        void setKeyMarker(const std::string& marker) { keyMarker_ = marker; keyMarkerIsSet_ = true;}\r\n        void setMaxKeys(int maxKeys) {maxKeys_ = maxKeys; maxKeysIsSet_ = true;} \r\n        void setPrefix(const std::string& prefix) { prefix_ = prefix; prefixIsSet_ = true; }\r\n        void setEncodingType(const std::string& type) { encodingType_ = type; encodingTypeIsSet_ = true; }\r\n        void setVersionIdMarker(const std::string& marker) { versionIdMarker_ = marker; versionIdMarkerIsSet_ = true; }\r\n\r\n    protected:\r\n        virtual ParameterCollection specialParameters() const \r\n        {\r\n            ParameterCollection params;\r\n            params[\"versions\"] = \"\";\r\n            if (delimiterIsSet_) params[\"delimiter\"] = delimiter_;\r\n            if (keyMarkerIsSet_) params[\"key-marker\"] = keyMarker_;\r\n            if (maxKeysIsSet_) params[\"max-keys\"] = std::to_string(maxKeys_);\r\n            if (prefixIsSet_) params[\"prefix\"] = prefix_;\r\n            if (encodingTypeIsSet_) params[\"encoding-type\"] = encodingType_;\r\n            if (versionIdMarkerIsSet_) params[\"version-id-marker\"] = versionIdMarker_;\r\n            return params;\r\n        }\r\n    private:\r\n        std::string delimiter_;\r\n        bool delimiterIsSet_;\r\n        std::string keyMarker_;\r\n        bool keyMarkerIsSet_;\r\n        int maxKeys_;\r\n        bool maxKeysIsSet_;\r\n        std::string prefix_;\r\n        bool prefixIsSet_;\r\n        std::string encodingType_;\r\n        bool encodingTypeIsSet_;\r\n        std::string versionIdMarker_;\r\n        bool versionIdMarkerIsSet_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListObjectVersionsResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/model/Bucket.h>\r\n#include <vector>\r\n#include <memory>\r\n#include <iostream>\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <alibabacloud/oss/model/Owner.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ListObjectVersionsResult;\r\n    class ALIBABACLOUD_OSS_EXPORT ObjectVersionSummary\r\n    {\r\n    public:\r\n        ObjectVersionSummary() = default;\r\n        const std::string& Key() const { return key_; }\r\n        const std::string& VersionId() const { return versionid_; }\r\n        const std::string& ETag()const { return eTag_; }\r\n        const std::string& LastModified() const { return lastModified_; }\r\n        const std::string& StorageClass() const { return storageClass_; }\r\n        const std::string& Type() const { return type_; }\r\n        int64_t Size() const { return size_; }\r\n        bool IsLatest() const { return isLatest_; }\r\n        const AlibabaCloud::OSS::Owner& Owner() const { return owner_; }\r\n    private:\r\n        friend class ListObjectVersionsResult;\r\n        std::string key_;\r\n        std::string versionid_;\r\n        std::string eTag_;\r\n        std::string lastModified_;\r\n        std::string storageClass_;\r\n        std::string type_;\r\n        int64_t size_;\r\n        bool isLatest_;\r\n        AlibabaCloud::OSS::Owner owner_;\r\n    };\r\n    using ObjectVersionSummaryList = std::vector<ObjectVersionSummary>;\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT DeleteMarkerSummary\r\n    {\r\n    public:\r\n        DeleteMarkerSummary() = default;\r\n        const std::string& Key() const { return key_; }\r\n        const std::string& VersionId() const { return versionid_; }\r\n        const std::string& LastModified() const { return lastModified_; }\r\n        bool IsLatest() const { return isLatest_; }\r\n        const AlibabaCloud::OSS::Owner& Owner() const { return owner_; }\r\n    private:\r\n        friend class ListObjectVersionsResult;\r\n        std::string key_;\r\n        std::string versionid_;\r\n        std::string lastModified_;\r\n        bool isLatest_;\r\n        AlibabaCloud::OSS::Owner owner_;\r\n    };\r\n    using DeleteMarkerSummaryList = std::vector<DeleteMarkerSummary>;\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT ListObjectVersionsResult : public OssResult\r\n    {\r\n    public:\r\n        ListObjectVersionsResult();\r\n        ListObjectVersionsResult(const std::string& data);\r\n        ListObjectVersionsResult(const std::shared_ptr<std::iostream>& data);\r\n        ListObjectVersionsResult& operator=(const std::string& data);\r\n        const std::string& Name() const { return name_; }\r\n        const std::string& Prefix() const { return prefix_; }\r\n        const std::string& KeyMarker() const { return keyMarker_; }\r\n        const std::string& NextKeyMarker() const { return nextKeyMarker_; }\r\n        const std::string& VersionIdMarker() const { return versionIdMarker_; }\r\n        const std::string& NextVersionIdMarker() const { return nextVersionIdMarker_; }\r\n        const std::string& Delimiter() const { return delimiter_; }\r\n        const std::string& EncodingType() const { return encodingType_; }\r\n        int MaxKeys() const { return maxKeys_; }\r\n        bool IsTruncated() const { return isTruncated_; }\r\n        const CommonPrefixeList& CommonPrefixes() const { return commonPrefixes_; }\r\n        const ObjectVersionSummaryList& ObjectVersionSummarys() const { return objectVersionSummarys_; }\r\n        const DeleteMarkerSummaryList& DeleteMarkerSummarys() const { return deleteMarkerSummarys_; }\r\n    private:\r\n        std::string name_;\r\n        std::string prefix_;\r\n        std::string keyMarker_;\r\n        std::string nextKeyMarker_;\r\n        std::string versionIdMarker_;\r\n        std::string nextVersionIdMarker_;\r\n        std::string delimiter_;\r\n        std::string encodingType_;\r\n        bool        isTruncated_;\r\n        int         maxKeys_;\r\n        CommonPrefixeList commonPrefixes_;\r\n        ObjectVersionSummaryList objectVersionSummarys_;\r\n        DeleteMarkerSummaryList deleteMarkerSummarys_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListObjectsRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\n    class ALIBABACLOUD_OSS_EXPORT ListObjectsRequest: public OssBucketRequest\n    {\n    public:\n        ListObjectsRequest(const std::string& bucket):\n            OssBucketRequest(bucket),\n            delimiterIsSet_(false),\n            markerIsSet_(false),\n            maxKeysIsSet_(false),\n            prefixIsSet_(false),\n            encodingTypeIsSet_(false),\n            requestPayer_(RequestPayer::NotSet)\n        {\n        }\n        void setDelimiter(const std::string& delimiter) { delimiter_ = delimiter; delimiterIsSet_ = true; }\n        void setMarker(const std::string& marker) {marker_ = marker; markerIsSet_ = true;}    \n        void setMaxKeys(int maxKeys) {maxKeys_ = maxKeys; maxKeysIsSet_ = true;} \n        void setPrefix(const std::string& prefix) { prefix_ = prefix; prefixIsSet_ = true; }\n        void setEncodingType(const std::string& type) { encodingType_ = type; encodingTypeIsSet_ = true; }\n        void setRequestPayer(RequestPayer value) { requestPayer_ = value; }\n\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual HeaderCollection specialHeaders() const;\n    private:\n        std::string delimiter_;\n        bool delimiterIsSet_;\n        std::string marker_;\n        bool markerIsSet_;\n        int maxKeys_;\n        bool maxKeysIsSet_;\n        std::string prefix_;\n        bool prefixIsSet_;\n        std::string encodingType_;\n        bool encodingTypeIsSet_;\n        RequestPayer requestPayer_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListObjectsResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/model/Bucket.h>\n#include <vector>\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/Owner.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ListObjectsResult;\n    class ListObjectsV2Result;\n    class ALIBABACLOUD_OSS_EXPORT ObjectSummary\n    {\n    public:\n        ObjectSummary() = default;\n        const std::string& Key() const { return key_; }\n        const std::string& ETag()const { return eTag_; }\n        int64_t Size() const { return size_; }\n        const std::string& LastModified() const { return lastModified_; }\n        const std::string& StorageClass() const { return storageClass_; }\n        const std::string& Type() const { return type_; }\n        const AlibabaCloud::OSS::Owner& Owner() const { return owner_; }\n        const std::string& RestoreInfo() const { return restoreInfo_; }\n    private:\n        friend class ListObjectsResult;\n        friend class ListObjectsV2Result;\n        std::string key_;\n        std::string eTag_;\n        int64_t size_;\n        std::string lastModified_;\n        std::string storageClass_;\n        std::string type_;\n        AlibabaCloud::OSS::Owner owner_;\n        std::string restoreInfo_;\n    };\n\n    using ObjectSummaryList = std::vector<ObjectSummary>;\n\n    class ALIBABACLOUD_OSS_EXPORT ListObjectsResult : public OssResult\n    {\n    public:\n        ListObjectsResult();\n        ListObjectsResult(const std::string& data);\n        ListObjectsResult(const std::shared_ptr<std::iostream>& data);\n        ListObjectsResult& operator=(const std::string& data);\n        const std::string& Name() const { return name_; }\n        const std::string& Prefix() const { return prefix_; }\n        const std::string& Marker() const { return marker_; }\n        const std::string& NextMarker() const { return nextMarker_; }\n        const std::string& Delimiter() const { return delimiter_; }\n        const std::string& EncodingType() const { return encodingType_; }\n        int MaxKeys() const { return maxKeys_; }\n        bool IsTruncated() const { return isTruncated_; }\n        const CommonPrefixeList& CommonPrefixes() const { return commonPrefixes_; }\n        const ObjectSummaryList& ObjectSummarys() const { return objectSummarys_; }\n    private:\n        std::string name_;\n        std::string prefix_;\n        std::string marker_;\n        std::string delimiter_;\n        std::string nextMarker_;\n        std::string encodingType_;\n        bool        isTruncated_;\n        int         maxKeys_;\n        CommonPrefixeList commonPrefixes_;\n        ObjectSummaryList objectSummarys_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListObjectsV2Request.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ListObjectsV2Request: public OssBucketRequest\n    {\n    public:\n        ListObjectsV2Request(const std::string& bucket):\n            OssBucketRequest(bucket),\n            delimiterIsSet_(false),\n            startAfterIsSet_(false),\n            continuationTokenIsSet_(false),\n            maxKeysIsSet_(false),\n            prefixIsSet_(false),\n            encodingTypeIsSet_(false),\n            fetchOwnerIsSet_(false),\n            requestPayer_(RequestPayer::NotSet)\n        {\n        }\n        void setDelimiter(const std::string& delimiter) { delimiter_ = delimiter; delimiterIsSet_ = true; }\n        void setStartAfter(const std::string& value) { startAfter_ = value; startAfterIsSet_ = true;}\n        void setContinuationToken(const std::string& value) { continuationToken_ = value; continuationTokenIsSet_ = true; }\n        void setMaxKeys(int maxKeys) {maxKeys_ = maxKeys; maxKeysIsSet_ = true;}\n        void setPrefix(const std::string& prefix) { prefix_ = prefix; prefixIsSet_ = true; }\n        void setEncodingType(const std::string& type) { encodingType_ = type; encodingTypeIsSet_ = true; }\n        void setFetchOwner(bool value) { fetchOwner_ = value; fetchOwnerIsSet_ = true; }\n        void setRequestPayer(RequestPayer value) { requestPayer_ = value; }\n\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual HeaderCollection specialHeaders() const;\n    private:\n        std::string delimiter_;\n        bool delimiterIsSet_;\n        std::string startAfter_;\n        bool startAfterIsSet_;\n        std::string continuationToken_;\n        bool continuationTokenIsSet_;\n        int maxKeys_;\n        bool maxKeysIsSet_;\n        std::string prefix_;\n        bool prefixIsSet_;\n        std::string encodingType_;\n        bool encodingTypeIsSet_;\n        bool fetchOwner_;\n        bool fetchOwnerIsSet_;\n        RequestPayer requestPayer_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListObjectsV2Result.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/model/Bucket.h>\n#include <alibabacloud/oss/model/ListObjectsResult.h>\n#include <vector>\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/Owner.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ListObjectsV2Result : public OssResult\n    {\n    public:\n        ListObjectsV2Result();\n        ListObjectsV2Result(const std::string& data);\n        ListObjectsV2Result(const std::shared_ptr<std::iostream>& data);\n        ListObjectsV2Result& operator=(const std::string& data);\n        const std::string& Name() const { return name_; }\n        const std::string& Prefix() const { return prefix_; }\n        const std::string& StartAfter() const { return startAfter_; }\n        const std::string& ContinuationToken() const { return continuationToken_; }\n        const std::string& NextContinuationToken() const { return nextContinuationToken_; }\n        const std::string& Delimiter() const { return delimiter_; }\n        const std::string& EncodingType() const { return encodingType_; }\n        int MaxKeys() const { return maxKeys_; }\n        int KeyCount() const { return keyCount_; }\n        bool IsTruncated() const { return isTruncated_; }\n        const CommonPrefixeList& CommonPrefixes() const { return commonPrefixes_; }\n        const ObjectSummaryList& ObjectSummarys() const { return objectSummarys_; }\n    private:\n        std::string name_;\n        std::string prefix_;\n        std::string startAfter_;\n        std::string continuationToken_;\n        std::string nextContinuationToken_;\n        std::string delimiter_;\n        std::string encodingType_;\n        int         maxKeys_;\n        int         keyCount_;\n        bool        isTruncated_;\n        CommonPrefixeList commonPrefixes_;\n        ObjectSummaryList objectSummarys_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListPartsRequest.h",
    "content": "/*\n * Copyright 2009-2018 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <sstream>\n#include <iostream>\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ListPartsRequest: public OssObjectRequest\n    {\n    public:\n        ListPartsRequest(const std::string& bucket, const std::string& key);\n        ListPartsRequest(const std::string& bucket, const std::string& key,\n            const std::string& uploadId);\n        void setUploadId(const std::string& uploadId);\n        void setMaxParts(uint32_t maxParts);\n        void setPartNumberMarker(uint32_t partNumberMarker);\n        void setEncodingType(const std::string& encodingType);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n    private:\n        std::string uploadId_;\n        uint32_t maxParts_;\n        bool maxPartsIsSet_;\n        uint32_t partNumberMarker_;\n        bool partNumberMarkerIsSet_;\n        std::string encodingType_;\n        bool encodingTypeIsSet_;\n    };\n} \n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ListPartsResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/model/Bucket.h>\n#include <vector>\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/model/Owner.h>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/Part.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ListPartsResult :public OssResult\n    {\n    public:\n        ListPartsResult();\n        ListPartsResult(const std::string& data);\n        ListPartsResult(const std::shared_ptr<std::iostream>& data);\n        ListPartsResult& operator=(const std::string& data);\n        const std::string& Bucket() const;\n        const std::string& Key() const;\n        const std::string& UploadId() const;\n        const std::string& EncodingType() const;\n        uint32_t MaxParts() const;\n        uint32_t PartNumberMarker() const;\n        uint32_t NextPartNumberMarker() const;\n        const AlibabaCloud::OSS::PartList& PartList()const;\n        bool IsTruncated() const;\n    private:\n        std::string uploadId_;\n        uint32_t maxParts_;\n        uint32_t partNumberMarker_;\n        uint32_t nextPartNumberMarker_;\n        std::string encodingType_;\n        std::string key_;\n        std::string bucket_;\n        bool isTruncated_;\n        AlibabaCloud::OSS::PartList partList_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/MultiCopyObjectRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n#include <alibabacloud/oss/model/ObjectMetaData.h>\r\n#include <iostream>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT MultiCopyObjectRequest : public OssResumableBaseRequest\r\n    {\r\n    public:\r\n        MultiCopyObjectRequest(const std::string& bucket, const std::string& key, \r\n            const std::string& srcBucket, const std::string& srcKey);\r\n        MultiCopyObjectRequest(const std::string& bucket, const std::string& key, \r\n            const std::string& srcBucket, const std::string& srcKey, \r\n            const std::string& checkpointDir);\r\n        MultiCopyObjectRequest(const std::string& bucket, const std::string& key, \r\n            const std::string& srcBucket, const std::string& srcKey, \r\n            const std::string& checkpointDir, const ObjectMetaData& meta);\r\n        MultiCopyObjectRequest(const std::string& bucket, const std::string& key, \r\n            const std::string& srcBucket, const std::string& srcKey, \r\n            const std::string& checkpointDir, uint64_t partSize, uint32_t threadNum);\r\n        MultiCopyObjectRequest(const std::string& bucket, const std::string& key, \r\n            const std::string& srcBucket, const std::string& srcKey,\r\n            const std::string& checkpointDir, uint64_t partSize, uint32_t threadNum, \r\n            const ObjectMetaData& metaData);\r\n\r\n        MultiCopyObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::string& srcBucket, const std::string& srcKey,\r\n            const std::wstring& checkpointDir);\r\n        MultiCopyObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::string& srcBucket, const std::string& srcKey,\r\n            const std::wstring& checkpointDir, const ObjectMetaData& meta);\r\n        MultiCopyObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::string& srcBucket, const std::string& srcKey,\r\n            const std::wstring& checkpointDir, uint64_t partSize, uint32_t threadNum);\r\n        MultiCopyObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::string& srcBucket, const std::string& srcKey,\r\n            const std::wstring& checkpointDir, uint64_t partSize, uint32_t threadNum,\r\n            const ObjectMetaData& metaData);\r\n\r\n        const std::string& SrcBucket() const { return srcBucket_; }\r\n        const std::string& SrcKey() const { return srcKey_; }\r\n\r\n        const std::string& EncodingType() const { return encodingType_; }\r\n        const ObjectMetaData& MetaData() const { return metaData_; }\r\n\r\n        void setCopySource(const std::string& srcBucket, const std::string& srcObject);\r\n        void setSourceIfMatchEtag(const std::string& value);\r\n        void setSourceIfNotMatchEtag(const std::string& value);\r\n        void setSourceIfUnModifiedSince(const std::string& value);\r\n        void setSourceIfModifiedSince(const std::string& value);\r\n        void setMetadataDirective(const CopyActionList& action);\r\n        void setAcl(const CannedAccessControlList& acl);\r\n\r\n        void setEncodingType(const std::string& type) { encodingType_ = type; }\r\n\r\n        const std::string& SourceIfMatchEtag() const;\r\n        const std::string& SourceIfNotMatchEtag() const;\r\n        const std::string& SourceIfUnModifiedSince() const;\r\n        const std::string& SourceIfModifiedSince() const;\r\n\r\n    protected:\r\n        virtual int validate() const;\r\n\r\n    private:\r\n        std::string srcBucket_;\r\n        std::string srcKey_;\r\n        std::string encodingType_;\r\n\r\n        ObjectMetaData metaData_;\r\n    };\r\n}\r\n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/MultipartUploadCryptoContext.h",
    "content": "/*\r\n * Copyright 2009-2018 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/encryption/ContentCryptoMaterial.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT MultipartUploadCryptoContext\r\n    {\r\n    public:\r\n        MultipartUploadCryptoContext():dataSize_(0), partSize_(0) {}\r\n        ~MultipartUploadCryptoContext() {}\r\n        const ContentCryptoMaterial& ContentMaterial() const { return content_; }\r\n        const std::string& UploadId() const { return uploadId_; }\r\n        int64_t PartSize() const { return partSize_; }\r\n        int64_t DataSize() const { return dataSize_; }\r\n\r\n        void setContentMaterial(const ContentCryptoMaterial& content) { content_ = content; }\r\n        void setUploadId(const std::string& uploadId) { uploadId_ = uploadId; }\r\n        void setPartSize(int64_t size) { partSize_ = size; }\r\n        void setDataSize(int64_t size) { dataSize_ = size; }\r\n    private:\r\n        ContentCryptoMaterial content_;\r\n        int64_t dataSize_;\r\n        int64_t partSize_;\r\n        std::string uploadId_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ObjectCallbackBuilder.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <string>\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ObjectCallbackBuilder\n    {\n    public:\n        enum Type\n        {\n            URL = 0,\n            JSON\n        };\n        ObjectCallbackBuilder(const std::string& url, const std::string& body);\n        ObjectCallbackBuilder(const std::string& url, const std::string& body,\n            const std::string& host, Type type);\n        const std::string& CallbackUrl() const { return callbackUrl_; }\n        const std::string& CallbackHost() const { return callbackHost_; }\n        const std::string& CallbackBody() const { return callbackBody_; }\n        Type CallbackBodyType() const { return callbackBodyType_; }\n        void setCallbackUrl(const std::string& url) { callbackUrl_ = url; }\n        void setCallbackHost(const std::string& host) { callbackHost_ = host; }\n        void setCallbackBody(const std::string& body) { callbackBody_ = body; }\n        void setCallbackBodyType(Type type) { callbackBodyType_ = type; }\n        std::string build();\n    private:\n        std::string callbackUrl_;\n        std::string callbackHost_;\n        std::string callbackBody_;\n        Type callbackBodyType_;\n    };\n\n    class ALIBABACLOUD_OSS_EXPORT ObjectCallbackVariableBuilder\n    {\n    public:\n        ObjectCallbackVariableBuilder() {};\n        const HeaderCollection& CallbackVariable() const { return callbackVariable_; }\n        bool addCallbackVariable(const std::string &key, const std::string& value);\n        std::string build();\n    private:\n        HeaderCollection callbackVariable_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ObjectMetaData.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <string>\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/Types.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT ObjectMetaData\r\n    {\r\n    public:\r\n        ObjectMetaData() = default;\r\n        ObjectMetaData(const HeaderCollection& data);\r\n        ObjectMetaData& operator=(const HeaderCollection& data);\r\n        const std::string& LastModified() const;\r\n        const std::string& ExpirationTime() const;\r\n        int64_t ContentLength() const ;\r\n        const std::string& ContentType() const;\r\n        const std::string& ContentEncoding() const;\r\n        const std::string& CacheControl() const;\r\n        const std::string& ContentDisposition() const;\r\n        const std::string& ETag() const;\r\n        const std::string& ContentMd5() const;\r\n        const std::string& ObjectType() const;\r\n        const std::string& VersionId() const;\r\n        uint64_t CRC64() const;\r\n        void setExpirationTime(const std::string& value);\r\n        void setContentLength(int64_t value);\r\n        void setContentType(const std::string& value);\r\n        void setContentEncoding(const std::string& value);\r\n        void setCacheControl(const std::string& value);\r\n        void setContentDisposition(const std::string& value);\r\n        void setETag(const std::string& value);\r\n        void setContentMd5(const std::string& value);\r\n        void setCrc64(uint64_t value);\r\n        void addHeader(const std::string& key, const std::string& value);\r\n        bool hasHeader(const std::string& key) const;\r\n        void removeHeader(const std::string& key);\r\n        MetaData& HttpMetaData();\r\n        const MetaData& HttpMetaData() const;\r\n        void addUserHeader(const std::string& key, const std::string& value);\r\n        bool hasUserHeader(const std::string& key) const;\r\n        void removeUserHeader(const std::string& key);\r\n        MetaData& UserMetaData();\r\n        const MetaData& UserMetaData() const;\r\n        HeaderCollection toHeaderCollection() const;\r\n    private:\r\n        MetaData userMetaData_;\r\n        MetaData metaData_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/OutputFormat.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class SelectObjectRequest;\n\tclass ALIBABACLOUD_OSS_EXPORT OutputFormat\n\t{\n\tpublic:\n        virtual ~OutputFormat() {};\n\t\tvoid setKeepAllColumns(bool keepAllColumns);\n\t\tvoid setOutputRawData(bool outputRawData);\n\t\tvoid setEnablePayloadCrc(bool enablePayloadCrc);\n\t\tvoid setOutputHeader(bool outputHeader);\n\n        bool OutputRawData() const;\n        bool KeepAllColumns() const;\n        bool EnablePayloadCrc() const;\n        bool OutputHeader() const;\n    protected:\n        OutputFormat();\n        friend SelectObjectRequest;\n        virtual int validate() const;\n        virtual std::string toXML() const = 0;\n        virtual std::string Type() const = 0;\n\tprivate:\n\t\tbool keepAllColumns_;\n\t\tbool outputRawData_;\n\t\tbool enablePayloadCrc_;\n\t\tbool outputHeader_;\n\t};\n\n    class ALIBABACLOUD_OSS_EXPORT CSVOutputFormat : public OutputFormat\n    {\n    public:\n        CSVOutputFormat();\n        CSVOutputFormat(\n            const std::string& recordDelimiter,\n            const std::string& fieldDelimiter);\n\n        void setRecordDelimiter(const std::string& recordDelimiter);\n        void setFieldDelimiter(const std::string& fieldDelimiter);\n\n        const std::string& RecordDelimiter() const;\n        const std::string& FieldDelimiter() const;\n    protected:\n        virtual std::string toXML() const;\n        virtual std::string Type() const;\n    private:\n        std::string recordDelimiter_;\n        std::string fieldDelimiter_;\n    };\n\n    class ALIBABACLOUD_OSS_EXPORT JSONOutputFormat : public OutputFormat\n    {\n    public:\n        JSONOutputFormat();\n        JSONOutputFormat(const std::string& recordDelimiter);\n\n        void setRecordDelimiter(const std::string& recordDelimiter);\n        const std::string& RecordDelimiter() const;\n    protected:\n        virtual std::string toXML() const;\n        virtual std::string Type() const;\n    private:\n        std::string recordDelimiter_;\n    };\n\n}\n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/Owner.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <string>\n#include <alibabacloud/oss/Export.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT Owner\n    {\n    public:\n        Owner() = default;\n        Owner(const std::string& id, const std::string& name) :\n            id_(id),\n            displayName_(name)\n        {}\n        Owner(const Owner& rhs) :\n            id_(rhs.id_),\n            displayName_(rhs.displayName_)\n        {}\n        Owner(Owner&& lhs) :\n            id_(std::move(lhs.id_)),\n            displayName_(std::move(lhs.displayName_))\n        {}\n        Owner& operator=(const Owner& rhs)\n        {\n            id_ = rhs.id_;\n            displayName_ = rhs.displayName_;\n            return *this;\n        }\n        Owner& operator=(Owner&& lhs)\n        {\n            id_ = std::move(lhs.id_);\n            displayName_ = std::move(lhs.displayName_);\n            return *this;\n        }\n        const std::string& Id() const { return id_; }\n        const std::string& DisplayName() const { return displayName_; };\n    private:\n        std::string id_;\n        std::string displayName_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/Part.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/Types.h>\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ListPartsResult;\n    class ResumableUploader;\n    class ResumableCopier;\n    class ALIBABACLOUD_OSS_EXPORT Part\n    {\n    public:\n        Part() :partNumber_(0), size_(0), cRC64_(0) {}\n        Part(int32_t partNumber, const std::string& eTag):partNumber_(partNumber), eTag_(eTag){}\n        int32_t PartNumber() const { return partNumber_; }\n        int64_t Size() const { return size_; }\n        uint64_t CRC64() const { return cRC64_; }\n        const std::string& LastModified() const { return lastModified_; }\n        const std::string& ETag() const { return eTag_; }\n    private:\n        friend class ListPartsResult;\n        friend class ResumableUploader;\n        friend class ResumableCopier;\n        int32_t partNumber_;\n        int64_t size_;\n        uint64_t cRC64_;\n        std::string lastModified_;\n        std::string eTag_;\n    };\n    using PartList = std::vector<Part>;\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/PostVodPlaylistRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/model/ObjectMetaData.h>\n#include <alibabacloud/oss/http/HttpType.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT PostVodPlaylistRequest : public LiveChannelRequest\n    {\n    public:\n        PostVodPlaylistRequest(const std::string& bucket, const std::string& channelName, \n            const std::string& playList, uint64_t startTime, uint64_t endTime);\n\n        void setPlayList(const std::string& playList);\n        void setStartTime(uint64_t startTime);\n        void setEndTime(uint64_t endTime);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual int validate() const;\n    private:\n        std::string playList_;\n        uint64_t startTime_;\n        uint64_t endTime_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/ProcessObjectRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT ProcessObjectRequest: public OssObjectRequest\n    {\n    public:\n        ProcessObjectRequest(const std::string& bucket, const std::string& key);\n        ProcessObjectRequest(const std::string& bucket, const std::string& key,\n            const std::string& process);\n        void setProcess(const std::string& process);\n\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual std::string payload() const;\n    private:\n        std::string process_;\n    };\n} \n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/PutLiveChannelRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/model/ObjectMetaData.h>\n#include <alibabacloud/oss/http/HttpType.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT PutLiveChannelRequest : public LiveChannelRequest\n    {\n    public:\n        PutLiveChannelRequest(const std::string& bucket, const std::string& channelName, \n            const std::string& type);\n\n        void setChannelType(const std::string& type);\n        void setStatus(LiveChannelStatus status);\n        void setDescripition(const std::string& description);\n        void setPlayListName(const std::string& playListName);\n        void setRoleName(const std::string& roleName);\n        void setDestBucket(const std::string& destBucket);\n        void setNotifyTopic(const std::string& notifyTopic);\n        void setFragDuration(uint64_t fragDuration);\n        void setFragCount(uint64_t fragCount);\n        void setInterval(uint64_t interval);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual std::string payload() const;\n        virtual int validate() const;\n    private:\n        std::string channelType_;\n        std::string description_;\n        std::string playListName_;\n        std::string roleName_;\n        std::string destBucket_;\n        std::string notifyTopic_;\n        LiveChannelStatus status_;\n        uint64_t fragDuration_;\n        uint64_t fragCount_;\n        uint64_t interval_;\n        bool snapshot_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/PutLiveChannelResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <memory>\n#include <iostream>\n#include <alibabacloud/oss/OssResult.h>\n#include <alibabacloud/oss/model/Owner.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT PutLiveChannelResult : public OssResult\n    {\n    public:\n        PutLiveChannelResult();\n        PutLiveChannelResult(const std::string& data);\n        PutLiveChannelResult(const std::shared_ptr<std::iostream>& data);\n        PutLiveChannelResult& operator=(const std::string& data);\n\n        const std::string& PublishUrl() const;\n        const std::string& PlayUrl() const;\n    private:\n        std::string publishUrl_;\n        std::string playUrl_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/PutLiveChannelStatusRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/model/ObjectMetaData.h>\n#include <alibabacloud/oss/http/HttpType.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT PutLiveChannelStatusRequest : public LiveChannelRequest\n    {\n    public:\n        PutLiveChannelStatusRequest(const std::string& bucket, const std::string& channelName);\n        PutLiveChannelStatusRequest(const std::string& bucket, const std::string& channelName, \n            LiveChannelStatus status);\n\n        void setStatus(LiveChannelStatus status);\n\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual int validate() const;\n    private:\n        std::string channelName_;\n        LiveChannelStatus status_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/PutObjectByUrlRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/ServiceRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/model/ObjectMetaData.h>\n#include <alibabacloud/oss/http/HttpType.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT PutObjectByUrlRequest : public ServiceRequest\n    {\n    public:\n        PutObjectByUrlRequest(const std::string& url, \n            const std::shared_ptr<std::iostream>& content);\n        PutObjectByUrlRequest(const std::string& url, \n            const std::shared_ptr<std::iostream>& content,\n            const ObjectMetaData& metaData);\n        virtual HeaderCollection Headers() const;\n        virtual ParameterCollection Parameters() const;\n        virtual std::shared_ptr<std::iostream> Body() const;\n    private:\n        std::shared_ptr<std::iostream> content_;\n        ObjectMetaData metaData_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/PutObjectRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/model/ObjectMetaData.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT PutObjectRequest: public OssObjectRequest\r\n    {\r\n    public:\r\n        PutObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::shared_ptr<std::iostream>& content);\r\n        PutObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::shared_ptr<std::iostream>& content, \r\n            const ObjectMetaData& meta);\r\n        void setCacheControl(const std::string& value);\r\n        void setContentDisposition(const std::string& value);\r\n        void setContentEncoding(const std::string& value);\r\n        void setContentMd5(const std::string& value);\r\n        void setExpires(const std::string& value);\r\n        void setCallback(const std::string& callback, const std::string& callbackVar = \"\");\r\n        void setTrafficLimit(uint64_t value);\r\n        void setTagging(const std::string& value);\r\n        ObjectMetaData& MetaData();\r\n        virtual std::shared_ptr<std::iostream> Body() const;\r\n    protected:\r\n        virtual HeaderCollection specialHeaders() const;\r\n        virtual int validate() const;\r\n    private:\r\n        std::shared_ptr<std::iostream> content_;\r\n        ObjectMetaData metaData_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/PutObjectResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <alibabacloud/oss/Types.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT PutObjectResult :public OssObjectResult\r\n    {\r\n    public:\r\n        PutObjectResult();\r\n        PutObjectResult(const HeaderCollection& header);\r\n        PutObjectResult(const HeaderCollection& header, const std::shared_ptr<std::iostream>& content);\r\n        PutObjectResult(const std::string eTag, const uint64_t crc64) :eTag_(eTag), crc64_(crc64) {}\r\n        const std::string& ETag() const;\r\n        uint64_t CRC64();\r\n        const std::shared_ptr<std::iostream>& Content() const;\r\n     private:\r\n        std::string eTag_;\r\n        uint64_t crc64_;\r\n        std::shared_ptr<std::iostream> content_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/QosConfiguration.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <string>\n#include <alibabacloud/oss/Export.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT QosConfiguration\n    {\n    public:\n        QosConfiguration():\n            totalUploadBandwidth_(-1), intranetUploadBandwidth_(-1),\n            extranetUploadBandwidth_(-1), totalDownloadBandwidth_(-1),\n            intranetDownloadBandwidth_(-1), extranetDownloadBandwidth_(-1),\n            totalQps_(-1), intranetQps_(-1), extranetQps_(-1)\n        {\n        }\n        int64_t TotalUploadBandwidth() const { return totalUploadBandwidth_; }\n        int64_t IntranetUploadBandwidth() const { return intranetUploadBandwidth_; }\n        int64_t ExtranetUploadBandwidth() const { return extranetUploadBandwidth_; }\n        int64_t TotalDownloadBandwidth() const { return totalDownloadBandwidth_; }\n        int64_t IntranetDownloadBandwidth() const { return intranetDownloadBandwidth_; }\n        int64_t ExtranetDownloadBandwidth() const { return extranetDownloadBandwidth_; }\n        int64_t TotalQps() const { return totalQps_; }\n        int64_t IntranetQps() const { return intranetQps_; }\n        int64_t ExtranetQps() const { return extranetQps_; }\n\n        void setTotalUploadBandwidth(int64_t value) { totalUploadBandwidth_ = value; }\n        void setIntranetUploadBandwidth(int64_t value) { intranetUploadBandwidth_ = value; }\n        void setExtranetUploadBandwidth(int64_t value) { extranetUploadBandwidth_ = value; }\n        void setTotalDownloadBandwidth(int64_t value) { totalDownloadBandwidth_ = value; }\n        void setIntranetDownloadBandwidth(int64_t value) { intranetDownloadBandwidth_ = value; }\n        void setExtranetDownloadBandwidth(int64_t value) { extranetDownloadBandwidth_ = value; }\n        void setTotalQps(int64_t value) { totalQps_ = value; }\n        void setIntranetQps(int64_t value) { intranetQps_ = value; }\n        void setExtranetQps(int64_t value) { extranetQps_ = value; }\n\n    private:\n        int64_t totalUploadBandwidth_;\n        int64_t intranetUploadBandwidth_;\n        int64_t extranetUploadBandwidth_;\n        int64_t totalDownloadBandwidth_;\n        int64_t intranetDownloadBandwidth_;\n        int64_t extranetDownloadBandwidth_;\n        int64_t totalQps_;\n        int64_t intranetQps_;\n        int64_t extranetQps_;\n    };\n}\n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/RestoreObjectRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\n#include <string>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT RestoreObjectRequest: public OssObjectRequest\n    {\n    public:\n        RestoreObjectRequest(const std::string& bucket, const std::string& key);\n        void setDays(uint32_t days);\n        void setTierType(TierType type);\n    protected:\n        virtual std::string payload() const;\n        virtual ParameterCollection specialParameters() const;\n    private:\n        uint32_t days_;\n        TierType tierType_;\n        bool tierTypeIsSet_;\n    };\n}\n}\n\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/RestoreObjectResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <alibabacloud/oss/Types.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT RestoreObjectResult : public OssObjectResult\r\n    {\r\n    public:\r\n        RestoreObjectResult();\r\n        RestoreObjectResult(const HeaderCollection& header);\r\n    };\r\n} \r\n}\r\n\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SelectObjectRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/model/GetObjectRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/model/InputFormat.h>\n#include <alibabacloud/oss/model/OutputFormat.h>\n#include <alibabacloud/oss/model/CreateSelectObjectMetaRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\tenum ExpressionType\n\t{\n\t\tSQL,\n\t};\n    class OssClientImpl;\r\n\tclass ALIBABACLOUD_OSS_EXPORT SelectObjectRequest : public GetObjectRequest\n\t{\n\tpublic:\n\t\tSelectObjectRequest(const std::string& bucket, const std::string& key);\n\n\t\tvoid setExpression(const std::string& expression, ExpressionType type = SQL);\n        void setSkippedRecords(bool skipPartialDataRecord, uint64_t maxSkippedRecords);\n        void setInputFormat(InputFormat& inputFormat);\n        void setOutputFormat(OutputFormat& OutputFormat);\n\n        uint64_t MaxSkippedRecordsAllowed() const;\n        void setResponseStreamFactory(const IOStreamFactory& factory);\n\n\tprotected:\n        friend class OssClientImpl;\n\t\tvirtual std::string payload() const;\n\t\tvirtual int validate() const;\n        virtual ParameterCollection specialParameters() const;\n        int dispose() const;\n\tprivate:\n\t\tExpressionType expressionType_;\n\t\tstd::string expression_;\n\t\tbool skipPartialDataRecord_;\n\t\tuint64_t maxSkippedRecordsAllowed_;\n\t\tInputFormat *inputFormat_;\n\t\tOutputFormat *outputFormat_;\n\n        mutable std::shared_ptr<std::streambuf> streamBuffer_;\n        mutable std::shared_ptr<std::iostream> upperContent_;\n        IOStreamFactory upperResponseStreamFactory_;\n\t};\n\n}\n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketAclRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT SetBucketAclRequest: public OssBucketRequest\n    {\n    public:\n        SetBucketAclRequest(const std::string& bucket, CannedAccessControlList acl);\n        void setAcl(CannedAccessControlList acl);\n    protected:\n        virtual HeaderCollection specialHeaders() const;\n        virtual ParameterCollection specialParameters() const;\n    private:\n        CannedAccessControlList acl_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketCorsRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/model/CORSRule.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT SetBucketCorsRequest : public OssBucketRequest\n    {\n    public:\n        SetBucketCorsRequest(const std::string& bucket);\n        void addCORSRule(const CORSRule& rule);\n        void setCORSRules(const CORSRuleList& rules);\n        void clearCORSRules() { ruleList_.clear(); }\n        const CORSRuleList& CORSRules() const { return ruleList_; }\n    protected:\n        virtual std::string payload() const;\n        virtual ParameterCollection specialParameters() const;\n        virtual int validate() const;\n    private:\n        CORSRuleList ruleList_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketEncryptionRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT SetBucketEncryptionRequest : public OssBucketRequest\n    {\n    public:\n        SetBucketEncryptionRequest(const std::string& bucket, SSEAlgorithm sse = SSEAlgorithm::AES256, const std::string& key = \"\");\n        void setSSEAlgorithm(SSEAlgorithm sse);\n        void setKMSMasterKeyID(const std::string& key);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual std::string payload() const;\n    private:\n        SSEAlgorithm SSEAlgorithm_;\n        std::string KMSMasterKeyID_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketInventoryConfigurationRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/model/InventoryConfiguration.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT SetBucketInventoryConfigurationRequest : public OssBucketRequest\n    {\n    public:\n        SetBucketInventoryConfigurationRequest(const std::string& bucket);\n        SetBucketInventoryConfigurationRequest(const std::string& bucket, const InventoryConfiguration& conf);\n        void setInventoryConfiguration(InventoryConfiguration conf);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual std::string payload() const;\n    private:\n        InventoryConfiguration inventoryConfiguration_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketLifecycleRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n#include <alibabacloud/oss/model/LifecycleRule.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT SetBucketLifecycleRequest : public OssBucketRequest\r\n    {\r\n    public:\r\n        SetBucketLifecycleRequest(const std::string& bucket);\r\n        void addLifecycleRule(const LifecycleRule& rule) { lifecycleRules_.push_back(rule); }\r\n        void setLifecycleRules(const LifecycleRuleList& ruleList) { lifecycleRules_= ruleList; }\r\n        void clearLifecycleRules() { lifecycleRules_.clear(); }\r\n        const LifecycleRuleList& LifecycleRules() const { return lifecycleRules_; }\r\n    protected:\r\n        virtual std::string payload() const;\r\n        virtual ParameterCollection specialParameters() const;\r\n        virtual int validate() const;\r\n    private:\r\n        LifecycleRuleList lifecycleRules_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketLoggingRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT SetBucketLoggingRequest : public OssBucketRequest\r\n    {\r\n    public:\r\n        SetBucketLoggingRequest(const std::string& bucket);\r\n        SetBucketLoggingRequest(const std::string& bucket,\r\n            const std::string& targetBucket, const std::string& targetPrefix);\r\n        void setTargetBucket(const std::string& bucket) { targetBucket_ = bucket; }\r\n        void setTargetPrefix(const std::string& prefix) { targetPrefix_ = prefix; }\r\n    protected:\r\n        virtual std::string payload() const;\r\n        virtual ParameterCollection specialParameters() const;\r\n        virtual int validate() const;\r\n    private:\r\n        std::string targetBucket_;\r\n        std::string targetPrefix_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketPaymentRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT SetBucketRequestPaymentRequest : public OssBucketRequest\n    {\n    public:\n        SetBucketRequestPaymentRequest(const std::string& bucket);\n        SetBucketRequestPaymentRequest(const std::string& bucket, RequestPayer payer);\n        void setRequestPayer(RequestPayer payer) { payer_ = payer; }\n    protected:\n        virtual std::string payload() const;\n        virtual ParameterCollection specialParameters() const;\n    private:\n        RequestPayer payer_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketPolicyRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT SetBucketPolicyRequest : public OssBucketRequest\n    {\n    public:\n        SetBucketPolicyRequest(const std::string& bucket);\n        SetBucketPolicyRequest(const std::string& bucket, const std::string& policy);\n        void setPolicy(const std::string& policy) { policy_ = policy; }\n    protected:\n        virtual std::string payload() const;\n        virtual ParameterCollection specialParameters() const;\n    private:\n        std::string policy_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketQosInfoRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/model/QosConfiguration.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT SetBucketQosInfoRequest : public OssBucketRequest\n    {\n    public:\n        SetBucketQosInfoRequest(const std::string& bucket);\n        SetBucketQosInfoRequest(const std::string& bucket, const QosConfiguration& qos);\n    protected:\n        virtual std::string payload() const;\n        virtual ParameterCollection specialParameters() const;\n    private:\n        QosConfiguration qosInfo_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketRefererRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <vector>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT SetBucketRefererRequest : public OssBucketRequest\r\n    {\r\n    public:\r\n        SetBucketRefererRequest(const std::string& bucket);\r\n        SetBucketRefererRequest(const std::string& bucket, const RefererList& refererList);\r\n        SetBucketRefererRequest(const std::string& bucket, const RefererList& refererList,\r\n            bool allowEmptyReferer);\r\n        void setAllowEmptyReferer(bool allow) \r\n        { \r\n            allowEmptyReferer_ = allow; \r\n        }\r\n        void addReferer(const std::string& referer)\r\n        {\r\n            refererList_.push_back(referer);\r\n        }\r\n        void clearRefererList()\r\n        {\r\n            refererList_.clear();\r\n        }\r\n    protected:\r\n        virtual std::string payload() const;\r\n        virtual ParameterCollection specialParameters() const;\r\n    private:\r\n        bool allowEmptyReferer_;\r\n        RefererList refererList_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketStorageCapacityRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT SetBucketStorageCapacityRequest : public OssBucketRequest\n    {\n    public:\n        SetBucketStorageCapacityRequest(const std::string& bucket, int64_t storageCapacity);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual std::string payload() const;\n        virtual int validate() const;\n    private:\n        int64_t storageCapacity_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketTaggingRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/model/Tagging.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT SetBucketTaggingRequest : public OssBucketRequest\n    {\n    public:\n        SetBucketTaggingRequest(const std::string& bucket);\n        SetBucketTaggingRequest(const std::string& bucket, const Tagging& tagging);\n        void setTagging(const Tagging& tagging);\n    protected:\n        virtual std::string payload() const;\n        virtual ParameterCollection specialParameters() const;\n        virtual int validate() const;\n    private:\n        Tagging tagging_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketVersioningRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT SetBucketVersioningRequest : public OssBucketRequest\r\n    {\r\n    public:\r\n        SetBucketVersioningRequest(const std::string& bucket, VersioningStatus status);\r\n        void setStatus(VersioningStatus status);\r\n    protected:\r\n        virtual std::string payload() const;\r\n        virtual ParameterCollection specialParameters() const;\r\n    private:\r\n        VersioningStatus status_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetBucketWebsiteRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT SetBucketWebsiteRequest : public OssBucketRequest\r\n    {\r\n    public:\r\n        SetBucketWebsiteRequest(const std::string& bucket);\r\n        void setIndexDocument(const std::string& document)\r\n        { \r\n            indexDocument_ = document; \r\n            indexDocumentIsSet_ = true;\r\n        }\r\n        void setErrorDocument(const std::string& document)\r\n        {\r\n            errorDocument_ = document;\r\n            errorDocumentIsSet_ = true;\r\n        }\r\n    protected:\r\n        virtual std::string payload() const;\r\n        virtual ParameterCollection specialParameters() const;\r\n        virtual int validate() const;\r\n    private:\r\n        std::string indexDocument_;\r\n        bool indexDocumentIsSet_;\r\n        std::string errorDocument_;\r\n        bool errorDocumentIsSet_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetObjectAclRequest.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Types.h>\n#include <string>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT SetObjectAclRequest: public OssObjectRequest\n    {\n    public:\n        SetObjectAclRequest(const std::string& bucket, const std::string& key);\n        SetObjectAclRequest(const std::string& bucket, const std::string& key,\n            CannedAccessControlList acl);\n        void setAcl(CannedAccessControlList acl);\n    protected:\n        virtual HeaderCollection specialHeaders() const;\n        virtual ParameterCollection specialParameters() const;\n    private:\n        CannedAccessControlList acl_;\n        bool hasSetAcl_ ;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetObjectAclResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <alibabacloud/oss/Types.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT SetObjectAclResult : public OssObjectResult\r\n    {\r\n    public:\r\n        SetObjectAclResult();\r\n        SetObjectAclResult(const HeaderCollection& header);\r\n    };\r\n} \r\n}\r\n\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetObjectTaggingRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n#include <alibabacloud/oss/model/Tagging.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT SetObjectTaggingRequest : public OssObjectRequest\r\n    {\r\n    public:\r\n        SetObjectTaggingRequest(const std::string& bucket, const std::string& key);\r\n        SetObjectTaggingRequest(const std::string& bucket, const std::string& key, \r\n            const Tagging& tagging);\r\n        void setTagging(const Tagging& tagging);\r\n    protected:\r\n        virtual std::string payload() const;\r\n        virtual ParameterCollection specialParameters() const;\r\n        virtual int validate() const;\r\n    private:\r\n        Tagging tagging_;\r\n    };\r\n} \r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/SetObjectTaggingResult.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssResult.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT SetObjectTaggingResult : public OssObjectResult\r\n    {\r\n    public:\r\n        SetObjectTaggingResult(): OssObjectResult() {}\r\n        SetObjectTaggingResult(const HeaderCollection& headers): OssObjectResult(headers) {}\r\n    };\r\n} \r\n}\r\n\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/Tagging.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/Types.h>\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT Tag\r\n    {\r\n    public:\r\n        Tag() {};\r\n        Tag(const std::string& key, const std::string& value) :\r\n            key_(key), value_(value) \r\n        {}\r\n        void setKey(const std::string& key) { key_ = key; }\r\n        void setValue(const std::string& value) { value_ = value; }\r\n        const std::string& Key() const { return key_; }\r\n        const std::string& Value() const { return value_; }\r\n    private:\r\n        std::string key_;\r\n        std::string value_;\r\n    };\r\n\r\n    using TagSet = std::vector<Tag>;\r\n\r\n    class ALIBABACLOUD_OSS_EXPORT Tagging\r\n    {\r\n    public:\r\n        Tagging() {};\r\n        Tagging(const TagSet& tags) { tagSet_ = tags;}\r\n\r\n        const TagSet& Tags() const { return tagSet_; }\r\n        void setTags(const TagSet& tags) { tagSet_ = tags; }\r\n        void setTags(TagSet&& tags) { tagSet_ = std::move(tags); }\r\n        void addTag(const Tag& tag)  { tagSet_.push_back(tag) ; }\r\n        void addTag(Tag&& tag) { tagSet_.push_back(std::move(tag)); }\r\n        void clear() { tagSet_.clear();}\r\n        std::string toQueryParameters();\r\n    private:\r\n        TagSet tagSet_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/UploadObjectRequest.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/model/ObjectMetaData.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT UploadObjectRequest : public OssResumableBaseRequest\r\n    {\r\n    public:\r\n        UploadObjectRequest(const std::string& bucket, const std::string& key, \r\n            const std::string& filePath, const std::string& checkpointDir,\r\n            const uint64_t partSize, const uint32_t threadNum);\r\n        UploadObjectRequest(const std::string& bucket, const std::string& key, \r\n            const std::string& filePath, const std::string &checkpointDir,\r\n            const uint64_t partSize, const uint32_t threadNum, const ObjectMetaData& meta);\r\n        UploadObjectRequest(const std::string& bucket, const std::string& key, \r\n            const std::string& filePath, const std::string& checkpointDir,\r\n            const ObjectMetaData& meta);\r\n        UploadObjectRequest(const std::string& bucket, const std::string& key, \r\n            const std::string& filePath, const std::string& checkpointDir);\r\n        UploadObjectRequest(const std::string& bucket, const std::string& key, \r\n            const std::string& filePath);\r\n\r\n        std::shared_ptr<std::iostream> Content(){ return content_; }\r\n        const std::string& EncodingType() const{return encodingType_;}\r\n        const std::string& FilePath() const{return filePath_;}\r\n        const ObjectMetaData& MetaData() const { return metaData_; }\r\n        ObjectMetaData& MetaData() { return metaData_; }\r\n\r\n        UploadObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::wstring& filePath, const std::wstring& checkpointDir,\r\n            const uint64_t partSize, const uint32_t threadNum);\r\n        UploadObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::wstring& filePath, const std::wstring &checkpointDir,\r\n            const uint64_t partSize, const uint32_t threadNum, const ObjectMetaData& meta);\r\n        UploadObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::wstring& filePath, const std::wstring& checkpointDir,\r\n            const ObjectMetaData& meta);\r\n        UploadObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::wstring& filePath, const std::wstring& checkpointDir);\r\n        UploadObjectRequest(const std::string& bucket, const std::string& key,\r\n            const std::wstring& filePath);\r\n        const std::wstring& FilePathW() const { return filePathW_; }\r\n\r\n        void setCacheControl(const std::string& value){metaData_.addHeader(Http::CACHE_CONTROL, value);}\r\n        void setContentDisposition(const std::string& value){metaData_.addHeader(Http::CONTENT_DISPOSITION, value);}\r\n        void setContentEncoding(const std::string& value){metaData_.addHeader(Http::CONTENT_ENCODING, value);}\r\n        void setExpires(const std::string& value){metaData_.addHeader(Http::EXPIRES, value);}\r\n        void setAcl(CannedAccessControlList& acl);\r\n        void setCallback(const std::string& callback, const std::string& callbackVar = \"\");\r\n        void setEncodingType(const std::string& type) {encodingType_ = type; }       \r\n        void setTagging(const std::string& value);\r\n\r\n    protected:\r\n        virtual int validate() const;\r\n    private:\r\n        std::string filePath_;\r\n        std::shared_ptr<std::iostream> content_;\r\n        ObjectMetaData metaData_;\r\n        std::string encodingType_;\r\n        std::wstring filePathW_;\r\n        bool isFileExist_;\r\n    };\r\n} \r\n}"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/UploadPartCopyRequest.h",
    "content": "/*\n * Copyright 2009-2018 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <sstream>\n#include <iostream>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT UploadPartCopyRequest: public OssObjectRequest\n    {\n    public:\n        UploadPartCopyRequest(const std::string& bucket, const std::string& key);\n        UploadPartCopyRequest(const std::string& bucket, const std::string& key,\n                              const std::string& srcBucket, const std::string& srcKey);\n        UploadPartCopyRequest(const std::string& bucket, const std::string& key,\n                              const std::string& srcBucket, const std::string& srcKey,\n                              const std::string& uploadId, int partNumber);\n        UploadPartCopyRequest(const std::string& bucket, const std::string& key,\n                              const std::string& srcBucket, const std::string& srcKey,\n                              const std::string& uploadId, int partNumber,\n                              const std::string& sourceIfMatchETag,\n                              const std::string& sourceIfNotMatchETag,\n                              const std::string& sourceIfModifiedSince,\n                              const std::string& sourceIfUnModifiedSince);\n\n        void setPartNumber(uint32_t partNumber); \n        void setUploadId(const std::string& uploadId);\n        void SetCopySource(const std::string& srcBucket, const std::string& srcKey);\n        void setCopySourceRange(uint64_t begin, uint64_t end); \n        void SetSourceIfMatchETag(const std::string& value);\n        void SetSourceIfNotMatchETag(const std::string& value);\n        void SetSourceIfModifiedSince(const std::string& value);\n        void SetSourceIfUnModifiedSince(const std::string& value);\n        void setTrafficLimit(uint64_t value);\n    protected:\n        virtual ParameterCollection specialParameters() const;\n        virtual HeaderCollection specialHeaders() const;\n        virtual int validate() const;\n    private:\n        std::string uploadId_;\n        std::string sourceBucket_;\n        std::string sourceKey_;\n        uint32_t partNumber_;\n        uint64_t sourceRange_[2];\n        bool sourceRangeIsSet_;\n        std::string sourceIfMatchETag_;\n        bool sourceIfMatchETagIsSet_;\n        std::string sourceIfNotMatchETag_;\n        bool sourceIfNotMatchETagIsSet_;\n        std::string sourceIfModifiedSince_;\n        bool sourceIfModifiedSinceIsSet_;\n        std::string sourceIfUnModifiedSince_;\n        bool sourceIfUnModifiedSinceIsSet_;\n        uint64_t trafficLimit_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/UploadPartCopyResult.h",
    "content": "/*\r\n * Copyright 2009-2018 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <string>\r\n#include <memory>\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/OssResult.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT UploadPartCopyResult :public OssObjectResult\r\n    {\r\n    public:\r\n        UploadPartCopyResult();\r\n        UploadPartCopyResult(const std::string& data);\r\n        UploadPartCopyResult(const std::shared_ptr<std::iostream>& data,\r\n             const HeaderCollection &header);\r\n        UploadPartCopyResult& operator=(const std::string& data);\r\n        const std::string& LastModified() const;\r\n        const std::string& ETag() const;\r\n        const std::string& SourceVersionId() { return sourceVersionId_; }\r\n\r\n     private:\r\n        std::string lastModified_;\r\n        std::string eTag_;\r\n        std::string sourceVersionId_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/UploadPartRequest.h",
    "content": "/*\n * Copyright 2009-2018 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/Export.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include <sstream>\n#include <iostream>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\n    class ALIBABACLOUD_OSS_EXPORT UploadPartRequest: public OssObjectRequest\n    {\n    public:\n        UploadPartRequest(const std::string& bucket, const std::string& key,\n            const std::shared_ptr<std::iostream>& content);\n        UploadPartRequest(const std::string &bucket, const std::string& key,\n            int partNumber, const std::string& uploadId,\n            const std::shared_ptr<std::iostream>& content);\n        virtual std::shared_ptr<std::iostream> Body() const;\n        void setPartNumber(int partNumber);\n        void setUploadId(const std::string& uploadId);\n        void setContent(const std::shared_ptr<std::iostream>& content);\n        void setConetent(const std::shared_ptr<std::iostream>& content);\n        void setContentLength(uint64_t length);\n        void setTrafficLimit(uint64_t value);\n        void setUserAgent(const std::string& ua);\n        void setContentMd5(const std::string& value);\n        int PartNumber() const;\n    protected:\n        virtual HeaderCollection specialHeaders() const;\n        virtual ParameterCollection specialParameters() const;\n        virtual int validate() const;\n    private:\n        int partNumber_;\n        std::string uploadId_;\n        std::shared_ptr<std::iostream> content_;\n        uint64_t contentLength_;\n        bool contentLengthIsSet_;\n        uint64_t trafficLimit_;\n        std::string userAgent_;\n        std::string contentMd5_;\n        bool contentMd5IsSet_;\n    };\n} \n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/model/VoidResult.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/OssResult.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ALIBABACLOUD_OSS_EXPORT VoidResult :public OssResult\n    {\n    public:\n        VoidResult() = default;\n        ~VoidResult() = default;\n    private:\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/utils/Executor.h",
    "content": "/*\r\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n*\r\n* Licensed under the Apache License, Version 2.0 (the \"License\");\r\n* you may not use this file except in compliance with the License.\r\n* You may obtain a copy of the License at\r\n*\r\n*      http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing, software\r\n* distributed under the License is distributed on an \"AS IS\" BASIS,\r\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n* See the License for the specific language governing permissions and\r\n* limitations under the License.\r\n*/\r\n\r\n#pragma once\r\n\r\n#include <atomic>\r\n#include <condition_variable>\r\n#include <queue>\r\n#include <vector>\r\n#include <thread>\r\n#include <mutex>\r\n#include <unordered_map>\r\n#include <alibabacloud/oss/Export.h>\r\n#include <alibabacloud/oss/utils/Runnable.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT Executor\r\n    {\r\n    public:\r\n        Executor();\r\n        virtual ~Executor();\r\n        virtual void execute(Runnable* task) = 0;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/utils/Outcome.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\n    template<typename E, typename R>\n    class Outcome\n    {\n    public:\n        Outcome():success_(false), e_(), r_() \n        {\n        }\n        Outcome(const E& e) :success_(false), e_(e) \n        {\n        }\n        Outcome(const R& r): success_(true), r_(r)  \n        {\n        }\n        Outcome(E&& e) : success_(false), e_(std::forward<E>(e))\n        {\n        } // Error move constructor\n        Outcome(R&& r) : success_(true), r_(std::forward<R>(r)) \n        {\n        } // Result move constructor\n        Outcome(const Outcome& other) :\n            success_(other.success_),\n            e_(other.e_),\n            r_(other.r_)\n        {\n        }\n        Outcome(Outcome&& other):\n            success_(other.success_),\n            e_(std::move(other.e_)),\n            r_(std::move(other.r_))\n        {\n            //*this = std::move(other);\n        }\n        Outcome& operator=(const Outcome& other)\n        {\n            if (this != &other) {\n                success_ = other.success_;\n                e_ = other.e_;\n                r_ = other.r_;\n            }\n            return *this;\n        }\n        Outcome& operator=(Outcome&& other)\n        {\n            if (this != &other)\n            {\n                success_ = other.success_;\n                r_ = std::move(other.r_);\n                e_ = std::move(other.e_);\n            }\n            return *this;\n        }\n\n        bool isSuccess()const { return success_; }\n        const E& error()const { return e_; }\n        const R& result()const { return r_; }\n        E& error() { return e_; }\n        R& result() { return r_; }\n    private:\n        bool success_;\n        E e_;\n        R r_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/include/alibabacloud/oss/utils/Runnable.h",
    "content": "/*\r\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n*\r\n* Licensed under the Apache License, Version 2.0 (the \"License\");\r\n* you may not use this file except in compliance with the License.\r\n* You may obtain a copy of the License at\r\n*\r\n*      http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing, software\r\n* distributed under the License is distributed on an \"AS IS\" BASIS,\r\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n* See the License for the specific language governing permissions and\r\n* limitations under the License.\r\n*/\r\n\r\n#pragma once\r\n\r\n#include <functional>\r\n#include <alibabacloud/oss/Export.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class ALIBABACLOUD_OSS_EXPORT Runnable\r\n    {\r\n    public:\r\n        explicit Runnable(const std::function<void()> f);\r\n        void run()const;\r\n    private:\r\n        std::function<void()> f_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/src/Config.h.in",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n// version = (major << 16) + (minor << 8) + patch\r\n#define ALIBABACLOUD_OSS_VERSION ((@PROJECT_VERSION_MAJOR@ << 16) + (@PROJECT_VERSION_MINOR@ << 8) + @PROJECT_VERSION_PATCH@)\r\n\r\n#define ALIBABACLOUD_OSS_VERSION_STR \"@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@\"\r\n\r\n// auto generated by cmake option\r\n#cmakedefine OSS_DISABLE_BUCKET\r\n#cmakedefine OSS_DISABLE_LIVECHANNEL\r\n#cmakedefine OSS_DISABLE_RESUAMABLE\r\n#cmakedefine OSS_DISABLE_ENCRYPTION"
  },
  {
    "path": "sdk/src/OssClient.cc",
    "content": "/*\r\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n*\r\n* Licensed under the Apache License, Version 2.0 (the \"License\");\r\n* you may not use this file except in compliance with the License.\r\n* You may obtain a copy of the License at\r\n*\r\n*      http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing, software\r\n* distributed under the License is distributed on an \"AS IS\" BASIS,\r\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n* See the License for the specific language governing permissions and\r\n* limitations under the License.\r\n*/\r\n\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include \"http/CurlHttpClient.h\"\r\n#include \"OssClientImpl.h\"\r\n#include <fstream>\r\n#include \"utils/LogUtils.h\"\r\n#include \"utils/Crc64.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nstatic bool SdkInitDone = false;\r\n\r\nbool AlibabaCloud::OSS::IsSdkInitialized()\r\n{\r\n    return SdkInitDone;\r\n}\r\n\r\nvoid AlibabaCloud::OSS::InitializeSdk()\r\n{\r\n    if (IsSdkInitialized())\r\n        return;\r\n    InitLogInner();\r\n    CurlHttpClient::initGlobalState();\r\n    SdkInitDone = true;\r\n}\r\n\r\nvoid AlibabaCloud::OSS::ShutdownSdk()\r\n{\r\n    if (!IsSdkInitialized())\r\n        return;\r\n    \r\n    CurlHttpClient::cleanupGlobalState();\r\n    DeinitLogInner();\r\n    SdkInitDone = false;\r\n}\r\n///////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\r\nvoid AlibabaCloud::OSS::SetLogLevel(LogLevel level)\r\n{\r\n    SetLogLevelInner(level);\r\n}\r\n\r\nvoid AlibabaCloud::OSS::SetLogCallback(LogCallback callback)\r\n{\r\n    SetLogCallbackInner(callback);\r\n}\r\n////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\r\nuint64_t AlibabaCloud::OSS::ComputeCRC64(uint64_t crc, void *buf, size_t len)\r\n{\r\n    return CRC64::CalcCRC(crc, buf, len);\r\n}\r\n\r\nuint64_t AlibabaCloud::OSS::CombineCRC64(uint64_t crc1, uint64_t crc2, uintmax_t len2)\r\n{\r\n    return CRC64::CombineCRC(crc1, crc2, len2);\r\n}\r\n///////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\r\nOssClient::OssClient(const std::string &endpoint, const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :\r\n    OssClient(endpoint, accessKeyId, accessKeySecret, \"\", configuration)\r\n{\r\n}\r\n\r\nOssClient::OssClient(const std::string &endpoint, const std::string & accessKeyId, const std::string & accessKeySecret, const std::string & securityToken,\r\n    const ClientConfiguration & configuration) :\r\n    OssClient(endpoint, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret, securityToken), configuration)\r\n{\r\n}\r\n\r\nOssClient::OssClient(const std::string &endpoint, const Credentials &credentials, const ClientConfiguration &configuration) :\r\n    OssClient(endpoint, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)\r\n{\r\n}\r\n\r\nOssClient::OssClient(const std::string &endpoint, const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :\r\n    client_(std::make_shared<OssClientImpl>(endpoint, credentialsProvider, configuration))\r\n{\r\n}\r\n\r\nOssClient::~OssClient()\r\n{\r\n}\r\n\r\n#if !defined(OSS_DISABLE_BUCKET)\r\n\r\nListBucketsOutcome OssClient::ListBuckets() const\r\n{\r\n    return client_->ListBuckets(ListBucketsRequest());\r\n}\r\n\r\nListBucketsOutcome OssClient::ListBuckets(const ListBucketsRequest &request) const\r\n{\r\n    return client_->ListBuckets(request);\r\n}\r\n\r\nListBucketInventoryConfigurationsOutcome OssClient::ListBucketInventoryConfigurations(const ListBucketInventoryConfigurationsRequest& request) const\r\n{\r\n    return client_->ListBucketInventoryConfigurations(request);\r\n}\r\n\r\nCreateBucketOutcome OssClient::CreateBucket(const std::string &bucket, StorageClass storageClass) const\r\n{\r\n    return client_->CreateBucket(CreateBucketRequest(bucket, storageClass));\r\n}\r\n\r\nCreateBucketOutcome OssClient::CreateBucket(const std::string &bucket, StorageClass storageClass, CannedAccessControlList acl) const\r\n{\r\n    return client_->CreateBucket(CreateBucketRequest(bucket, storageClass, acl));\r\n}\r\n\r\nCreateBucketOutcome OssClient::CreateBucket(const CreateBucketRequest &request) const\r\n{\r\n    return client_->CreateBucket(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketAcl(const std::string &bucket, CannedAccessControlList acl) const\r\n{\r\n    return client_->SetBucketAcl(SetBucketAclRequest(bucket, acl));\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketAcl(const SetBucketAclRequest& request) const\r\n{\r\n    return client_->SetBucketAcl(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketLogging(const std::string &bucket, const std::string &targetBucket, const std::string &targetPrefix) const\r\n{\r\n    return client_->SetBucketLogging(SetBucketLoggingRequest(bucket, targetBucket, targetPrefix));\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketLogging(const SetBucketLoggingRequest& request) const\r\n{\r\n    return client_->SetBucketLogging(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketWebsite(const std::string &bucket, const std::string &indexDocument) const\r\n{\r\n    SetBucketWebsiteRequest request(bucket);\r\n    request.setIndexDocument(indexDocument);\r\n    return client_->SetBucketWebsite(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketWebsite(const std::string &bucket, const std::string &indexDocument, const std::string &errorDocument) const\r\n{\r\n    SetBucketWebsiteRequest request(bucket);\r\n    request.setIndexDocument(indexDocument);\r\n    request.setErrorDocument(errorDocument);\r\n    return client_->SetBucketWebsite(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketWebsite(const SetBucketWebsiteRequest& request) const\r\n{\r\n    return client_->SetBucketWebsite(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketReferer(const std::string &bucket, const RefererList &refererList, bool allowEmptyReferer) const\r\n{\r\n    return client_->SetBucketReferer(SetBucketRefererRequest(bucket, refererList, allowEmptyReferer));\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketReferer(const SetBucketRefererRequest& request) const\r\n{\r\n    return client_->SetBucketReferer(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketLifecycle(const SetBucketLifecycleRequest& request) const\r\n{\r\n    return client_->SetBucketLifecycle(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketCors(const std::string &bucket, const CORSRuleList &rules) const\r\n{\r\n    SetBucketCorsRequest request(bucket);\r\n    request.setCORSRules(rules);\r\n    return client_->SetBucketCors(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketCors(const SetBucketCorsRequest& request) const\r\n{\r\n    return client_->SetBucketCors(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketStorageCapacity(const std::string &bucket, int64_t storageCapacity) const\r\n{\r\n    return client_->SetBucketStorageCapacity(SetBucketStorageCapacityRequest(bucket, storageCapacity));\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketStorageCapacity(const SetBucketStorageCapacityRequest& request) const\r\n{\r\n    return client_->SetBucketStorageCapacity(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketPolicy(const SetBucketPolicyRequest& request) const\r\n{\r\n    return client_->SetBucketPolicy(request);\r\n}\r\nVoidOutcome OssClient::SetBucketRequestPayment(const SetBucketRequestPaymentRequest& request) const\r\n{\r\n    return client_->SetBucketRequestPayment(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketEncryption(const SetBucketEncryptionRequest& request) const\r\n{\r\n    return client_->SetBucketEncryption(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketTagging(const SetBucketTaggingRequest& request) const\r\n{\r\n    return client_->SetBucketTagging(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketQosInfo(const SetBucketQosInfoRequest& request) const\r\n{\r\n    return client_->SetBucketQosInfo(request);\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucketPolicy(const DeleteBucketPolicyRequest& request) const\r\n{\r\n    return client_->DeleteBucketPolicy(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketVersioning(const SetBucketVersioningRequest& request) const\r\n{\r\n    return client_->SetBucketVersioning(request);\r\n}\r\n\r\nVoidOutcome OssClient::SetBucketInventoryConfiguration(const SetBucketInventoryConfigurationRequest& request) const\r\n{\r\n    return client_->SetBucketInventoryConfiguration(request);\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucket(const std::string &bucket) const\r\n{\r\n    return client_->DeleteBucket(DeleteBucketRequest(bucket));\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucket(const DeleteBucketRequest &request) const\r\n{\r\n    return client_->DeleteBucket(request);\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucketLogging(const std::string &bucket) const\r\n{\r\n    return client_->DeleteBucketLogging(DeleteBucketLoggingRequest(bucket));\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucketLogging(const DeleteBucketLoggingRequest& request) const\r\n{\r\n    return client_->DeleteBucketLogging(request);\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucketWebsite(const std::string &bucket) const\r\n{\r\n    return client_->DeleteBucketWebsite(DeleteBucketWebsiteRequest(bucket));\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucketWebsite(const DeleteBucketWebsiteRequest& request) const\r\n{\r\n    return client_->DeleteBucketWebsite(request);\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucketLifecycle(const std::string &bucket) const\r\n{\r\n    return client_->DeleteBucketLifecycle(DeleteBucketLifecycleRequest(bucket));\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucketLifecycle(const DeleteBucketLifecycleRequest& request) const\r\n{\r\n    return client_->DeleteBucketLifecycle(request);\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucketCors(const std::string &bucket) const\r\n{\r\n    return client_->DeleteBucketCors(DeleteBucketCorsRequest(bucket));\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucketCors(const DeleteBucketCorsRequest& request) const\r\n{\r\n    return client_->DeleteBucketCors(request);\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucketEncryption(const DeleteBucketEncryptionRequest& request) const\r\n{\r\n    return client_->DeleteBucketEncryption(request);\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucketTagging(const DeleteBucketTaggingRequest& request) const\r\n{\r\n    return client_->DeleteBucketTagging(request);\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucketQosInfo(const DeleteBucketQosInfoRequest& request) const\r\n{\r\n    return client_->DeleteBucketQosInfo(request);\r\n}\r\n\r\nVoidOutcome OssClient::DeleteBucketInventoryConfiguration(const DeleteBucketInventoryConfigurationRequest& request) const\r\n{\r\n    return client_->DeleteBucketInventoryConfiguration(request);\r\n}\r\n\r\nGetBucketAclOutcome OssClient::GetBucketAcl(const std::string &bucket) const\r\n{\r\n    return client_->GetBucketAcl(GetBucketAclRequest(bucket));\r\n}\r\n\r\nGetBucketAclOutcome OssClient::GetBucketAcl(const GetBucketAclRequest &request) const\r\n{\r\n    return client_->GetBucketAcl(request);\r\n}\r\n\r\nGetBucketLocationOutcome OssClient::GetBucketLocation(const std::string &bucket) const\r\n{\r\n    return client_->GetBucketLocation(GetBucketLocationRequest(bucket));\r\n}\r\n\r\nGetBucketLocationOutcome OssClient::GetBucketLocation(const GetBucketLocationRequest &request) const\r\n{\r\n    return client_->GetBucketLocation(request);\r\n}\r\n\r\nGetBucketInfoOutcome OssClient::GetBucketInfo(const std::string &bucket) const\r\n{\r\n    return client_->GetBucketInfo(GetBucketInfoRequest(bucket));\r\n}\r\n\r\nGetBucketInfoOutcome  OssClient::GetBucketInfo(const  GetBucketInfoRequest &request) const\r\n{\r\n    return client_->GetBucketInfo(request);\r\n}\r\n\r\nGetBucketLoggingOutcome OssClient::GetBucketLogging(const std::string &bucket) const\r\n{\r\n    return client_->GetBucketLogging(GetBucketLoggingRequest(bucket));\r\n}\r\n\r\nGetBucketLoggingOutcome OssClient::GetBucketLogging(const GetBucketLoggingRequest &request) const\r\n{\r\n    return client_->GetBucketLogging(request);\r\n}\r\n\r\nGetBucketWebsiteOutcome OssClient::GetBucketWebsite(const std::string &bucket) const\r\n{\r\n    return client_->GetBucketWebsite(GetBucketWebsiteRequest(bucket));\r\n}\r\n\r\nGetBucketWebsiteOutcome OssClient::GetBucketWebsite(const GetBucketWebsiteRequest &request) const\r\n{\r\n    return client_->GetBucketWebsite(request);\r\n}\r\n\r\nGetBucketRefererOutcome OssClient::GetBucketReferer(const std::string &bucket) const\r\n{\r\n    return client_->GetBucketReferer(GetBucketRefererRequest(bucket));\r\n}\r\n\r\nGetBucketRefererOutcome OssClient::GetBucketReferer(const GetBucketRefererRequest &request) const\r\n{\r\n    return client_->GetBucketReferer(request);\r\n}\r\n\r\nGetBucketLifecycleOutcome OssClient::GetBucketLifecycle(const std::string &bucket) const\r\n{\r\n    return client_->GetBucketLifecycle(GetBucketLifecycleRequest(bucket));\r\n}\r\n\r\nGetBucketLifecycleOutcome OssClient::GetBucketLifecycle(const GetBucketLifecycleRequest &request) const\r\n{\r\n    return client_->GetBucketLifecycle(request);\r\n}\r\n\r\nGetBucketStatOutcome OssClient::GetBucketStat(const std::string &bucket) const\r\n{\r\n    return client_->GetBucketStat(GetBucketStatRequest(bucket));\r\n}\r\n\r\nGetBucketStatOutcome OssClient::GetBucketStat(const GetBucketStatRequest &request) const\r\n{\r\n    return client_->GetBucketStat(request);\r\n}\r\n\r\nGetBucketCorsOutcome OssClient::GetBucketCors(const std::string &bucket) const\r\n{\r\n    return client_->GetBucketCors(GetBucketCorsRequest(bucket));\r\n}\r\n\r\nGetBucketCorsOutcome OssClient::GetBucketCors(const GetBucketCorsRequest &request) const\r\n{\r\n    return client_->GetBucketCors(request);\r\n}\r\n\r\nGetBucketStorageCapacityOutcome OssClient::GetBucketStorageCapacity(const std::string &bucket) const\r\n{\r\n    return client_->GetBucketStorageCapacity(GetBucketStorageCapacityRequest(bucket));\r\n}\r\n\r\nGetBucketStorageCapacityOutcome OssClient::GetBucketStorageCapacity(const GetBucketStorageCapacityRequest& request) const\r\n{\r\n    return client_->GetBucketStorageCapacity(request);\r\n}\r\n\r\nGetBucketPolicyOutcome OssClient::GetBucketPolicy(const GetBucketPolicyRequest& request) const\r\n{\r\n    return client_->GetBucketPolicy(request);\r\n}\r\nGetBucketPaymentOutcome OssClient::GetBucketRequestPayment(const GetBucketRequestPaymentRequest& request) const\r\n{\r\n    return client_->GetBucketRequestPayment(request);\r\n}\r\n\r\nGetBucketEncryptionOutcome OssClient::GetBucketEncryption(const GetBucketEncryptionRequest& request) const\r\n{\r\n    return client_->GetBucketEncryption(request);\r\n}\r\n\r\nGetBucketTaggingOutcome OssClient::GetBucketTagging(const GetBucketTaggingRequest& request) const\r\n{\r\n    return client_->GetBucketTagging(request);\r\n}\r\n\r\nGetBucketQosInfoOutcome OssClient::GetBucketQosInfo(const GetBucketQosInfoRequest& request) const\r\n{\r\n    return client_->GetBucketQosInfo(request);\r\n}\r\n\r\nGetUserQosInfoOutcome OssClient::GetUserQosInfo(const GetUserQosInfoRequest& request) const\r\n{\r\n    return client_->GetUserQosInfo(request);\r\n}\r\n\r\nGetBucketVersioningOutcome OssClient::GetBucketVersioning(const GetBucketVersioningRequest& request) const\r\n{\r\n    return client_->GetBucketVersioning(request);\r\n}\r\n\r\nGetBucketInventoryConfigurationOutcome OssClient::GetBucketInventoryConfiguration(const GetBucketInventoryConfigurationRequest& request) const\r\n{\r\n    return client_->GetBucketInventoryConfiguration(request);\r\n}\r\n\r\nInitiateBucketWormOutcome OssClient::InitiateBucketWorm(const InitiateBucketWormRequest& request) const\r\n{\r\n    return client_->InitiateBucketWorm(request);\r\n}\r\n\r\nVoidOutcome OssClient::AbortBucketWorm(const AbortBucketWormRequest& request) const\r\n{\r\n    return client_->AbortBucketWorm(request);\r\n}\r\n\r\nVoidOutcome OssClient::CompleteBucketWorm(const CompleteBucketWormRequest& request) const\r\n{\r\n    return client_->CompleteBucketWorm(request);\r\n}\r\n\r\nVoidOutcome OssClient::ExtendBucketWormWorm(const ExtendBucketWormRequest& request) const\r\n{\r\n    return client_->ExtendBucketWormWorm(request);\r\n}\r\n\r\nGetBucketWormOutcome OssClient::GetBucketWorm(const GetBucketWormRequest& request) const\r\n{\r\n    return client_->GetBucketWorm(request);\r\n}\r\n\r\n#endif\r\n\r\nListObjectOutcome OssClient::ListObjects(const std::string &bucket) const\r\n{\r\n    return client_->ListObjects(ListObjectsRequest(bucket));\r\n}\r\n\r\nListObjectOutcome OssClient::ListObjects(const std::string &bucket, const std::string &prefix) const\r\n{\r\n    ListObjectsRequest request(bucket);\r\n    request.setPrefix(prefix);\r\n    return client_->ListObjects(request);\r\n}\r\n\r\nListObjectOutcome OssClient::ListObjects(const ListObjectsRequest &request) const\r\n{\r\n    return client_->ListObjects(request);\r\n}\r\n\r\nListObjectsV2Outcome OssClient::ListObjectsV2(const ListObjectsV2Request& request) const\r\n{\r\n    return client_->ListObjectsV2(request);\r\n}\r\n\r\nListObjectVersionsOutcome OssClient::ListObjectVersions(const std::string &bucket) const\r\n{\r\n    return client_->ListObjectVersions(ListObjectVersionsRequest(bucket));\r\n}\r\n\r\nListObjectVersionsOutcome OssClient::ListObjectVersions(const std::string &bucket, const std::string &prefix) const\r\n{\r\n    ListObjectVersionsRequest request(bucket);\r\n    request.setPrefix(prefix);\r\n    return client_->ListObjectVersions(request);\r\n}\r\n\r\nListObjectVersionsOutcome OssClient::ListObjectVersions(const ListObjectVersionsRequest& request) const\r\n{\r\n    return client_->ListObjectVersions(request);\r\n}\r\n\r\nGetObjectOutcome OssClient::GetObject(const std::string &bucket, const std::string &key) const\r\n{\r\n    return client_->GetObject(GetObjectRequest(bucket, key));\r\n}\r\n\r\nGetObjectOutcome OssClient::GetObject(const std::string &bucket, const std::string &key, const std::shared_ptr<std::iostream> &content) const\r\n{\r\n    GetObjectRequest request(bucket, key);\r\n    request.setResponseStreamFactory([=]() { return content; });\r\n    return client_->GetObject(request);\r\n}\r\n\r\nGetObjectOutcome OssClient::GetObject(const std::string &bucket, const std::string &key, const std::string &fileToSave) const\r\n{\r\n    GetObjectRequest request(bucket, key);\r\n    request.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(fileToSave, std::ios_base::out | std::ios_base::trunc | std::ios::binary); });\r\n    return client_->GetObject(request);\r\n}\r\n\r\nGetObjectOutcome OssClient::GetObject(const GetObjectRequest &request) const\r\n{\r\n    return client_->GetObject(request);\r\n}\r\n\r\nPutObjectOutcome OssClient::PutObject(const std::string &bucket, const std::string &key, const std::shared_ptr<std::iostream> &content) const\r\n{\r\n    return client_->PutObject(PutObjectRequest(bucket, key, content));\r\n}\r\n\r\nPutObjectOutcome OssClient::PutObject(const std::string &bucket, const std::string &key, const std::string &fileToUpload) const\r\n{\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(fileToUpload, std::ios::in|std::ios::binary);\r\n    return client_->PutObject(PutObjectRequest(bucket, key, content));\r\n}\r\n\r\nPutObjectOutcome OssClient::PutObject(const std::string &bucket, const std::string &key, const std::shared_ptr<std::iostream> &content, const ObjectMetaData &meta) const\r\n{\r\n    return client_->PutObject(PutObjectRequest(bucket, key, content, meta));\r\n}\r\n\r\nPutObjectOutcome OssClient::PutObject(const std::string &bucket, const std::string &key, const std::string &fileToUpload, const ObjectMetaData &meta) const\r\n{\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(fileToUpload, std::ios::in | std::ios::binary);\r\n    return client_->PutObject(PutObjectRequest(bucket, key, content, meta));\r\n}\r\n\r\nPutObjectOutcome OssClient::PutObject(const PutObjectRequest &request) const\r\n{\r\n    return client_->PutObject(request);\r\n}\r\n\r\nDeleteObjectOutcome OssClient::DeleteObject(const std::string &bucket, const std::string &key) const\r\n{\r\n    return client_->DeleteObject(DeleteObjectRequest(bucket, key));\r\n}\r\n\r\nDeleteObjectOutcome OssClient::DeleteObject(const DeleteObjectRequest &request) const\r\n{\r\n    return client_->DeleteObject(request);\r\n}\r\n\r\nDeleteObjecstOutcome OssClient::DeleteObjects(const std::string bucket, const DeletedKeyList &keyList) const\r\n{\r\n    DeleteObjectsRequest request(bucket);\r\n    request.setKeyList(keyList);\r\n    return client_->DeleteObjects(request);\r\n}\r\n\r\nDeleteObjecstOutcome OssClient::DeleteObjects(const DeleteObjectsRequest &request) const\r\n{\r\n    return client_->DeleteObjects(request);\r\n}\r\n\r\nDeleteObjecVersionstOutcome OssClient::DeleteObjectVersions(const std::string bucket, const ObjectIdentifierList &objectList) const\r\n{\r\n    DeleteObjectVersionsRequest request(bucket);\r\n    request.setObjects(objectList);\r\n    return client_->DeleteObjectVersions(request);\r\n}\r\n\r\nDeleteObjecVersionstOutcome OssClient::DeleteObjectVersions(const DeleteObjectVersionsRequest &request) const\r\n{\r\n    return client_->DeleteObjectVersions(request);\r\n}\r\n\r\nObjectMetaDataOutcome OssClient::HeadObject(const std::string &bucket, const std::string &key) const\r\n{\r\n    return client_->HeadObject(HeadObjectRequest(bucket, key));\r\n}\r\n\r\nObjectMetaDataOutcome OssClient::HeadObject(const HeadObjectRequest &request) const\r\n{\r\n    return client_->HeadObject(request);\r\n}\r\n\r\nObjectMetaDataOutcome OssClient::GetObjectMeta(const std::string &bucket, const std::string &key) const\r\n{\r\n    return client_->GetObjectMeta(GetObjectMetaRequest(bucket, key));\r\n}\r\n\r\nObjectMetaDataOutcome OssClient::GetObjectMeta(const GetObjectMetaRequest &request) const\r\n{\r\n    return client_->GetObjectMeta(request);\r\n}\r\n\r\nGetObjectAclOutcome OssClient::GetObjectAcl(const GetObjectAclRequest &request) const\r\n{\r\n    return client_->GetObjectAcl(request);\r\n}\r\n\r\nAppendObjectOutcome OssClient::AppendObject(const AppendObjectRequest &request) const\r\n{\r\n    return client_->AppendObject(request);\r\n}\r\n\r\nCopyObjectOutcome OssClient::CopyObject(const CopyObjectRequest &request) const\r\n{\r\n    return client_->CopyObject(request);\r\n}\r\n\r\nGetSymlinkOutcome OssClient::GetSymlink(const GetSymlinkRequest &request) const\r\n{\r\n    return client_->GetSymlink(request);\r\n}\r\n\r\nGetObjectOutcome OssClient::ProcessObject(const ProcessObjectRequest &request) const\r\n{\r\n    return client_->ProcessObject(request);\r\n}\r\n\r\nRestoreObjectOutcome OssClient::RestoreObject(const std::string &bucket, const std::string &key) const\r\n{\r\n    return client_->RestoreObject(RestoreObjectRequest(bucket, key));\r\n}\r\n\r\nRestoreObjectOutcome OssClient::RestoreObject(const RestoreObjectRequest &request) const\r\n{\r\n    return client_->RestoreObject(request);\r\n}\r\n\r\nCreateSymlinkOutcome OssClient::CreateSymlink(const CreateSymlinkRequest &request) const\r\n{\r\n    return client_->CreateSymlink(request);\r\n}\r\n\r\nSetObjectAclOutcome OssClient::SetObjectAcl(const SetObjectAclRequest &request) const\r\n{\r\n    return client_->SetObjectAcl(request);\r\n}\r\n\r\nGetObjectOutcome OssClient::SelectObject(const SelectObjectRequest &request) const\r\n{\r\n    return client_->SelectObject(request);\r\n}\r\n\r\nCreateSelectObjectMetaOutcome OssClient::CreateSelectObjectMeta(const CreateSelectObjectMetaRequest &request) const\r\n{\r\n    return client_->CreateSelectObjectMeta(request);\r\n}\r\n\r\nSetObjectTaggingOutcome OssClient::SetObjectTagging(const SetObjectTaggingRequest& request) const\r\n{\r\n    return client_->SetObjectTagging(request);\r\n}\r\n\r\nDeleteObjectTaggingOutcome OssClient::DeleteObjectTagging(const DeleteObjectTaggingRequest& request) const\r\n{\r\n    return client_->DeleteObjectTagging(request);\r\n}\r\n\r\nGetObjectTaggingOutcome OssClient::GetObjectTagging(const GetObjectTaggingRequest& request) const\r\n{\r\n    return client_->GetObjectTagging(request);\r\n}\r\n\r\nStringOutcome OssClient::GeneratePresignedUrl(const GeneratePresignedUrlRequest &request) const\r\n{\r\n    return client_->GeneratePresignedUrl(request);\r\n}\r\n\r\nStringOutcome OssClient::GeneratePresignedUrl(const std::string &bucket, const std::string &key) const\r\n{\r\n    return GeneratePresignedUrl(GeneratePresignedUrlRequest(bucket, key));\r\n}\r\n\r\nStringOutcome OssClient::GeneratePresignedUrl(const std::string &bucket, const std::string &key, int64_t expires) const\r\n{\r\n    GeneratePresignedUrlRequest request(bucket, key);\r\n    request.setExpires(expires);\r\n    return GeneratePresignedUrl(request);\r\n}\r\n\r\nStringOutcome OssClient::GeneratePresignedUrl(const std::string &bucket, const std::string &key, int64_t expires, Http::Method method) const\r\n{\r\n    GeneratePresignedUrlRequest request(bucket, key, method);\r\n    request.setExpires(expires);\r\n    return GeneratePresignedUrl(request);\r\n}\r\n\r\nGetObjectOutcome OssClient::GetObjectByUrl(const GetObjectByUrlRequest &request) const\r\n{\r\n    return client_->GetObjectByUrl(request);\r\n}\r\n\r\nGetObjectOutcome OssClient::GetObjectByUrl(const std::string &url) const\r\n{\r\n    return client_->GetObjectByUrl(GetObjectByUrlRequest(url));\r\n}\r\n\r\nGetObjectOutcome OssClient::GetObjectByUrl(const std::string &url, const std::string &file) const\r\n{\r\n    GetObjectByUrlRequest request(url);\r\n    request.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(file, std::ios_base::out | std::ios_base::in | std::ios_base::trunc); });\r\n    return client_->GetObjectByUrl(request);\r\n}\r\n\r\nPutObjectOutcome OssClient::PutObjectByUrl(const PutObjectByUrlRequest &request) const\r\n{\r\n    return client_->PutObjectByUrl(request);\r\n}\r\n\r\nPutObjectOutcome OssClient::PutObjectByUrl(const std::string &url, const std::string &file) const\r\n{\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(file, std::ios::in|std::ios::binary);\r\n    return client_->PutObjectByUrl(PutObjectByUrlRequest(url, content));\r\n}\r\n\r\nPutObjectOutcome OssClient::PutObjectByUrl(const std::string &url, const std::string &file, const ObjectMetaData &metaData) const\r\n{\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(file, std::ios::in | std::ios::binary);\r\n    return client_->PutObjectByUrl(PutObjectByUrlRequest(url, content, metaData));\r\n}\r\n\r\nPutObjectOutcome OssClient::PutObjectByUrl(const std::string &url, const std::shared_ptr<std::iostream> &content) const\r\n{\r\n    return client_->PutObjectByUrl(PutObjectByUrlRequest(url, content));\r\n}\r\n\r\nPutObjectOutcome OssClient::PutObjectByUrl(const std::string &url, const std::shared_ptr<std::iostream> &content, const ObjectMetaData &metaData) const\r\n{\r\n    return client_->PutObjectByUrl(PutObjectByUrlRequest(url, content, metaData));\r\n}\r\n\r\nInitiateMultipartUploadOutcome OssClient::InitiateMultipartUpload(const InitiateMultipartUploadRequest &request)const\r\n{\r\n    return client_->InitiateMultipartUpload(request);\r\n}\r\n\r\nPutObjectOutcome OssClient::UploadPart(const UploadPartRequest &request) const\r\n{\r\n    return client_->UploadPart(request);\r\n}\r\n\r\nUploadPartCopyOutcome OssClient::UploadPartCopy(const UploadPartCopyRequest &request) const\r\n{\r\n    return client_->UploadPartCopy(request);\r\n}\r\n\r\nCompleteMultipartUploadOutcome OssClient::CompleteMultipartUpload(const CompleteMultipartUploadRequest &request) const\r\n{\r\n    return client_->CompleteMultipartUpload(request);\r\n}\r\n\r\nVoidOutcome OssClient::AbortMultipartUpload(const AbortMultipartUploadRequest &request) const\r\n{\r\n    return client_->AbortMultipartUpload(request);\r\n}\r\n\r\nListMultipartUploadsOutcome OssClient::ListMultipartUploads(const ListMultipartUploadsRequest &request) const\r\n{\r\n    return client_->ListMultipartUploads(request);\r\n}\r\n\r\nListPartsOutcome OssClient::ListParts(const ListPartsRequest &request) const\r\n{\r\n    return client_->ListParts(request);\r\n}\r\n\r\n/*Aysnc APIs*/\r\nvoid OssClient::ListObjectsAsync(const ListObjectsRequest &request, const ListObjectAsyncHandler &handler, const std::shared_ptr<const AsyncCallerContext>& context) const\r\n{\r\n    auto fn = [this, request, handler, context]()\r\n    {\r\n        handler(this, request, client_->ListObjects(request), context);\r\n    };\r\n\r\n    client_->asyncExecute(new Runnable(fn));\r\n}\r\n\r\nvoid OssClient::GetObjectAsync(const GetObjectRequest &request, const GetObjectAsyncHandler &handler, const std::shared_ptr<const AsyncCallerContext>& context) const\r\n{\r\n    auto fn = [this, request, handler, context]()\r\n    {\r\n        handler(this, request, client_->GetObject(request), context);\r\n    };\r\n\r\n    client_->asyncExecute(new Runnable(fn));\r\n}\r\n\r\nvoid OssClient::PutObjectAsync(const PutObjectRequest &request, const PutObjectAsyncHandler &handler, const std::shared_ptr<const AsyncCallerContext>& context) const\r\n{\r\n    auto fn = [this, request, handler, context]()\r\n    {\r\n        handler(this, request, client_->PutObject(request), context);\r\n    };\r\n\r\n    client_->asyncExecute(new Runnable(fn));\r\n}\r\n\r\nvoid OssClient::UploadPartAsync(const UploadPartRequest &request, const UploadPartAsyncHandler &handler, const std::shared_ptr<const AsyncCallerContext>& context) const\r\n{\r\n    auto fn = [this, request, handler, context]()\r\n    {\r\n        handler(this, request, client_->UploadPart(request), context);\r\n    };\r\n\r\n    client_->asyncExecute(new Runnable(fn));\r\n}\r\n\r\nvoid OssClient::UploadPartCopyAsync(const UploadPartCopyRequest &request, const UploadPartCopyAsyncHandler &handler, const std::shared_ptr<const AsyncCallerContext>& context) const\r\n{\r\n    auto fn = [this, request, handler, context]()\r\n    {\r\n        handler(this, request, client_->UploadPartCopy(request), context);\r\n    };\r\n\r\n    client_->asyncExecute(new Runnable(fn));\r\n}\r\n\r\n\r\n/*Callable APIs*/\r\nListObjectOutcomeCallable OssClient::ListObjectsCallable(const ListObjectsRequest &request) const\r\n{\r\n    auto task = std::make_shared<std::packaged_task<ListObjectOutcome()>>(\r\n        [this, request]()\r\n    {\r\n        return this->ListObjects(request);\r\n    });\r\n    client_->asyncExecute(new Runnable([task]() { (*task)(); }));\r\n    return task->get_future();\r\n}\r\n\r\nGetObjectOutcomeCallable OssClient::GetObjectCallable(const GetObjectRequest &request) const\r\n{\r\n    auto task = std::make_shared<std::packaged_task<GetObjectOutcome()>>(\r\n        [this, request]()\r\n    {\r\n        return this->GetObject(request);\r\n    });\r\n    client_->asyncExecute(new Runnable([task]() { (*task)(); }));\r\n    return task->get_future();\r\n\r\n}\r\n\r\nPutObjectOutcomeCallable OssClient::PutObjectCallable(const PutObjectRequest &request) const\r\n{\r\n    auto task = std::make_shared<std::packaged_task<PutObjectOutcome()>>(\r\n        [this, request]()\r\n    {\r\n        return this->PutObject(request);\r\n    });\r\n    client_->asyncExecute(new Runnable([task]() { (*task)(); }));\r\n    return task->get_future();\r\n}\r\n\r\nPutObjectOutcomeCallable OssClient::UploadPartCallable(const UploadPartRequest &request) const\r\n{\r\n    auto task = std::make_shared<std::packaged_task<PutObjectOutcome()>>(\r\n        [this, request]()\r\n    {\r\n        return this->UploadPart(request);\r\n    });\r\n    client_->asyncExecute(new Runnable([task]() { (*task)(); }));\r\n    return task->get_future();\r\n}\r\n\r\nUploadPartCopyOutcomeCallable OssClient::UploadPartCopyCallable(const UploadPartCopyRequest &request) const\r\n{\r\n    auto task = std::make_shared<std::packaged_task<UploadPartCopyOutcome()>>(\r\n        [this, request]()\r\n    {\r\n        return this->UploadPartCopy(request);\r\n    });\r\n    client_->asyncExecute(new Runnable([task]() { (*task)(); }));\r\n    return task->get_future();\r\n}\r\n\r\n/*Extended APIs*/\r\n#if !defined(OSS_DISABLE_BUCKET)\r\nbool OssClient::DoesBucketExist(const std::string &bucket) const\r\n{\r\n    return client_->GetBucketAcl(GetBucketAclRequest(bucket)).isSuccess();\r\n}\r\n#endif\r\n\r\nbool OssClient::DoesObjectExist(const std::string &bucket, const std::string &key) const\r\n{\r\n    return client_->GetObjectMeta(GetObjectMetaRequest(bucket, key)).isSuccess();\r\n}\r\n\r\nCopyObjectOutcome OssClient::ModifyObjectMeta(const std::string& bucket, const std::string& key, const ObjectMetaData& meta)\r\n{\r\n    CopyObjectRequest copyRequest(bucket, key, meta);\r\n    copyRequest.setCopySource(bucket, key);\r\n    copyRequest.setMetadataDirective(CopyActionList::Replace);\r\n    return client_->CopyObject(copyRequest);\r\n}\r\n\r\n#if !defined(OSS_DISABLE_LIVECHANNEL)\r\nVoidOutcome OssClient::PutLiveChannelStatus(const PutLiveChannelStatusRequest &request) const\r\n{\r\n    return client_->PutLiveChannelStatus(request);\r\n}\r\n\r\nPutLiveChannelOutcome OssClient::PutLiveChannel(const PutLiveChannelRequest &request) const\r\n{\r\n    return client_->PutLiveChannel(request);\r\n}\r\n\r\nVoidOutcome OssClient::PostVodPlaylist(const PostVodPlaylistRequest &request) const\r\n{\r\n    return client_->PostVodPlaylist(request);\r\n}\r\n\r\nGetVodPlaylistOutcome OssClient::GetVodPlaylist(const GetVodPlaylistRequest &request) const\r\n{\r\n    return client_->GetVodPlaylist(request);\r\n}\r\n\r\nGetLiveChannelStatOutcome OssClient::GetLiveChannelStat(const GetLiveChannelStatRequest &request) const\r\n{\r\n    return client_->GetLiveChannelStat(request);\r\n}\r\n\r\nGetLiveChannelInfoOutcome OssClient::GetLiveChannelInfo(const GetLiveChannelInfoRequest &request) const\r\n{\r\n    return client_->GetLiveChannelInfo(request);\r\n}\r\n\r\nGetLiveChannelHistoryOutcome OssClient::GetLiveChannelHistory(const GetLiveChannelHistoryRequest &request) const\r\n{\r\n    return client_->GetLiveChannelHistory(request);\r\n}\r\n\r\nListLiveChannelOutcome OssClient::ListLiveChannel(const ListLiveChannelRequest &request) const\r\n{\r\n    return client_->ListLiveChannel(request);\r\n}\r\n\r\nVoidOutcome OssClient::DeleteLiveChannel(const DeleteLiveChannelRequest &request) const\r\n{\r\n    return client_->DeleteLiveChannel(request);\r\n}\r\n\r\nStringOutcome OssClient::GenerateRTMPSignedUrl(const GenerateRTMPSignedUrlRequest &request) const\r\n{\r\n    return client_->GenerateRTMPSignedUrl(request);\r\n}\r\n#endif\r\n\r\nvoid OssClient::DisableRequest()\r\n{\r\n    client_->DisableRequest();\r\n}\r\n\r\nvoid OssClient::EnableRequest()\r\n{\r\n    client_->EnableRequest();\r\n}\r\n\r\n#if !defined(OSS_DISABLE_RESUAMABLE)\r\nPutObjectOutcome OssClient::ResumableUploadObject(const UploadObjectRequest &request) const\r\n{\r\n    return client_->ResumableUploadObject(request);\r\n}\r\n\r\nCopyObjectOutcome OssClient::ResumableCopyObject(const MultiCopyObjectRequest &request) const \r\n{\r\n    return client_->ResumableCopyObject(request);\r\n}\r\n\r\nGetObjectOutcome OssClient::ResumableDownloadObject(const DownloadObjectRequest &request) const \r\n{\r\n    return client_->ResumableDownloadObject(request);\r\n}\r\n#endif\r\n\r\n/*Others*/\r\nvoid OssClient::SetRegion(const std::string& region)\r\n{\r\n    return client_->SetRegion(region);\r\n}\r\n\r\nvoid OssClient::SetCloudBoxId(const std::string& cloudboxId)\r\n{\r\n    return client_->SetCloudBoxId(cloudboxId);\r\n}\r\n"
  },
  {
    "path": "sdk/src/OssClientImpl.cc",
    "content": "/*\r\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n*\r\n* Licensed under the Apache License, Version 2.0 (the \"License\");\r\n* you may not use this file except in compliance with the License.\r\n* You may obtain a copy of the License at\r\n*\r\n*      http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing, software\r\n* distributed under the License is distributed on an \"AS IS\" BASIS,\r\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n* See the License for the specific language governing permissions and\r\n* limitations under the License.\r\n*/\r\n\r\n#include <ctime>\r\n#include <algorithm>\r\n#include <sstream>\r\n#include <set>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n#include <alibabacloud/oss/Const.h>\r\n#include <fstream>\r\n#include \"utils/Utils.h\"\r\n#include \"utils/SignUtils.h\"\r\n#include \"utils/ThreadExecutor.h\"\r\n#include \"signer/Signer.h\"\r\n#include \"signer/HmacSha1Signer.h\"\r\n#include \"OssClientImpl.h\"\r\n#include \"utils/LogUtils.h\"\r\n#include \"utils/FileSystemUtils.h\"\r\n#if !defined(OSS_DISABLE_RESUAMABLE)\r\n#include \"resumable/ResumableUploader.h\"\r\n#include \"resumable/ResumableDownloader.h\"\r\n#include \"resumable/ResumableCopier.h\"\r\n#endif\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\nnamespace\r\n{\r\nconst std::string SERVICE_NAME = \"OSS\";\r\nconst char *TAG = \"OssClientImpl\";\r\n\r\nconst std::string DEFAULT_PRODUCT_NAME = \"oss\";\r\nconst std::string CLOUDBOX_PRODUCT_NAME = \"oss-cloudbox\";\r\n}\r\n\r\nOssClientImpl::OssClientImpl(const std::string &endpoint, const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :\r\n    Client(SERVICE_NAME, configuration),\r\n    endpoint_(endpoint),\r\n    credentialsProvider_(credentialsProvider),\r\n    signer_(Signer::createSigner(configuration.signatureVersion)),\r\n    executor_(configuration.executor ? configuration.executor :std::make_shared<ThreadExecutor>()),\r\n    isValidEndpoint_(IsValidEndpoint(endpoint))\r\n{\r\n}\r\n\r\nOssClientImpl::~OssClientImpl()\r\n{\r\n}\r\n\r\nint OssClientImpl::asyncExecute(Runnable * r) const\r\n{\r\n    if (executor_ == nullptr)\r\n        return 1;\r\n    \r\n    executor_->execute(r);\r\n    return 0;\r\n}\r\n\r\nstd::shared_ptr<HttpRequest> OssClientImpl::buildHttpRequest(const std::string & endpoint, const ServiceRequest & msg, Http::Method method) const\r\n{\r\n    auto httpRequest = std::make_shared<HttpRequest>(method);\r\n    auto calcContentMD5 = !!(msg.Flags()&REQUEST_FLAG_CONTENTMD5);\r\n    auto paramInPath = !!(msg.Flags()&REQUEST_FLAG_PARAM_IN_PATH);\r\n    httpRequest->setResponseStreamFactory(msg.ResponseStreamFactory());\r\n    addHeaders(httpRequest, msg.Headers());\r\n    addBody(httpRequest, msg.Body(), calcContentMD5);\r\n    if (paramInPath) {\r\n        httpRequest->setUrl(Url(msg.Path()));\r\n    }\r\n    else {\r\n        addSignInfo(httpRequest, msg);\r\n        addUrl(httpRequest, endpoint, msg);\r\n    }\r\n    addOther(httpRequest, msg);\r\n    return httpRequest;\r\n}\r\n\r\nbool OssClientImpl::hasResponseError(const std::shared_ptr<HttpResponse>&response) const\r\n{\r\n    if (BASE::hasResponseError(response)) {\r\n        return true;\r\n    }\r\n\r\n    //check crc64\r\n    if (response->request().hasCheckCrc64() && \r\n        !response->request().hasHeader(Http::RANGE) &&\r\n        response->hasHeader(\"x-oss-hash-crc64ecma\")) {\r\n        uint64_t clientCrc64 = response->request().Crc64Result();\r\n        uint64_t serverCrc64 = std::strtoull(response->Header(\"x-oss-hash-crc64ecma\").c_str(), nullptr, 10);\r\n        if (clientCrc64 != serverCrc64) {\r\n            response->setStatusCode(ERROR_CRC_INCONSISTENT);\r\n            std::stringstream ss;\r\n            ss << \"Crc64 validation failed. Expected hash:\" << serverCrc64\r\n                << \" not equal to calculated hash:\" << clientCrc64\r\n                << \". Transferd bytes:\" << response->request().TransferedBytes()\r\n                << \". RequestId:\" << response->Header(\"x-oss-request-id\").c_str();\r\n            response->setStatusMsg(ss.str().c_str());\r\n            return true;\r\n        }\r\n    }\r\n\r\n    //check Calback \r\n    if (response->statusCode() == 203 &&\r\n        (response->request().hasHeader(\"x-oss-callback\") ||\r\n        (response->request().url().query().find(\"callback=\") != std::string::npos))) {\r\n        return true;\r\n    }\r\n\r\n    return false;\r\n}\r\n\r\nvoid OssClientImpl::addHeaders(const std::shared_ptr<HttpRequest> &httpRequest, const HeaderCollection &headers) const\r\n{\r\n    for (auto const& header : headers) {\r\n        httpRequest->addHeader(header.first, header.second);\r\n    }\r\n\r\n    //common headers\r\n    httpRequest->addHeader(Http::USER_AGENT, configuration().userAgent);\r\n}\r\n\r\nvoid OssClientImpl::addBody(const std::shared_ptr<HttpRequest> &httpRequest, const std::shared_ptr<std::iostream>& body, bool contentMd5) const\r\n{\r\n    if (body == nullptr) {\r\n        Http::Method methold = httpRequest->method();\r\n        if (methold == Http::Method::Get || methold == Http::Method::Post) {\r\n            httpRequest->setHeader(Http::CONTENT_LENGTH, \"0\");\r\n        } else {\r\n            httpRequest->removeHeader(Http::CONTENT_LENGTH);\r\n        }\r\n    }\r\n    \r\n    if ((body != nullptr) && !httpRequest->hasHeader(Http::CONTENT_LENGTH)) {\r\n        auto streamSize = GetIOStreamLength(*body);\r\n        httpRequest->setHeader(Http::CONTENT_LENGTH, std::to_string(streamSize));\r\n    }\r\n\r\n    if (contentMd5 && body && !httpRequest->hasHeader(Http::CONTENT_MD5)) {\r\n        auto md5 = ComputeContentMD5(*body);\r\n        httpRequest->setHeader(Http::CONTENT_MD5, md5);\r\n    }\r\n\r\n    httpRequest->addBody(body);\r\n}\r\n\r\nvoid OssClientImpl::addSignInfo(const std::shared_ptr<HttpRequest> &httpRequest, const ServiceRequest &request) const\r\n{\r\n    auto credentials = credentialsProvider_->getCredentials();\r\n    auto parameters = request.Parameters();\r\n    auto ossRequest = static_cast<const OssRequest&>(request);\r\n    auto bucket = ossRequest.bucket();\r\n    auto key = ossRequest.key();\r\n    auto region = region_;\r\n    auto product = DEFAULT_PRODUCT_NAME;\r\n    auto t = std::time(nullptr) + getRequestDateOffset();\r\n\r\n    if (!cloudboxId_.empty()) {\r\n        region = cloudboxId_;\r\n        product = CLOUDBOX_PRODUCT_NAME;\r\n    }\r\n\r\n    if (httpRequest->hasHeader(\"x-oss-date\")) {\r\n        t = ToUnixTime(httpRequest->Header(\"x-oss-date\"), \"%a, %d %b %Y %H:%M:%S GMT\");\r\n    }\r\n\r\n    SignerParam signerParam(std::move(region), std::move(product), \r\n        std::move(bucket), std::move(key), std::move(credentials), t);\r\n\r\n    signer_->sign(httpRequest, parameters, signerParam);\r\n}\r\n\r\nvoid OssClientImpl::addUrl(const std::shared_ptr<HttpRequest> &httpRequest, const std::string &endpoint, const ServiceRequest &request) const\r\n{\r\n    const OssRequest& ossRequest = static_cast<const OssRequest&>(request);\r\n\r\n    auto host = CombineHostString(endpoint, ossRequest.bucket(), configuration().isCname, configuration().isPathStyle);\r\n    auto path = CombinePathString(endpoint, ossRequest.bucket(), ossRequest.key(), configuration().isPathStyle);\r\n\r\n    Url url(host);\r\n    url.setPath(path);\r\n\r\n    OSS_LOG(LogLevel::LogDebug, TAG, \"client(%p) request(%p) host:%s, path:%s\", this, httpRequest.get(), host.c_str(), path.c_str());\r\n    \r\n    auto parameters = request.Parameters();\r\n    if (!parameters.empty()) {\r\n        std::stringstream queryString;\r\n        for (const auto &p : parameters)\r\n        {\r\n            if (p.second.empty())\r\n                queryString << \"&\" << UrlEncode(p.first);\r\n            else\r\n                queryString << \"&\" << UrlEncode(p.first) << \"=\" << UrlEncode(p.second);\r\n        }\r\n        url.setQuery(queryString.str().substr(1));\r\n    }\r\n    httpRequest->setUrl(url);\r\n}\r\n\r\nvoid OssClientImpl::addOther(const std::shared_ptr<HttpRequest> &httpRequest, const ServiceRequest &request) const\r\n{\r\n    //progress\r\n    httpRequest->setTransferProgress(request.TransferProgress());\r\n\r\n    //crc64 check\r\n    auto checkCRC64 = !!(request.Flags()&REQUEST_FLAG_CHECK_CRC64);\r\n    if (configuration().enableCrc64 && checkCRC64 ) {\r\n        httpRequest->setCheckCrc64(true);\r\n#ifdef ENABLE_OSS_TEST\r\n        if (!!(request.Flags()&0x80000000)) {\r\n            httpRequest->addHeader(\"oss-test-crc64\", \"1\");\r\n        }\r\n#endif\r\n    }\r\n\r\n    // if use chunked encoding mode\r\n    if (request.Flags() & REQUEST_FLAG_CHUNKED_ENCODING) {\r\n        httpRequest->setChunkedEncoding(true);\r\n    }\r\n}\r\n\r\nOssError OssClientImpl::buildError(const Error &error) const\r\n{\r\n    OssError err;\r\n    if (((error.Status() == 203) || (error.Status() > 299 && error.Status() < 600)) && \r\n        !error.Message().empty()) {\r\n        XMLDocument doc;\r\n        XMLError xml_err;\r\n        if ((xml_err = doc.Parse(error.Message().c_str(), error.Message().size())) == XML_SUCCESS) {\r\n            XMLElement* root =doc.RootElement();\r\n            if (root && !std::strncmp(\"Error\", root->Name(), 5)) {\r\n                XMLElement *node;\r\n                node = root->FirstChildElement(\"Code\");\r\n                err.setCode(node ? node->GetText(): \"\");\r\n                node = root->FirstChildElement(\"Message\");\r\n                err.setMessage(node ? node->GetText(): \"\");\r\n                node = root->FirstChildElement(\"RequestId\");\r\n                err.setRequestId(node ? node->GetText(): \"\");\r\n                node = root->FirstChildElement(\"HostId\");\r\n                err.setHost(node ? node->GetText(): \"\");\r\n            } else {\r\n                err.setCode(\"ParseXMLError\");\r\n                err.setMessage(\"Xml format invalid, root node name is not Error. the content is:\\n\" + error.Message());\r\n            }\r\n        } else {\r\n            std::stringstream ss;\r\n            ss << \"ParseXMLError:\" << xml_err;\r\n            err.setCode(ss.str());\r\n            err.setMessage(XMLDocument::ErrorIDToName(xml_err));\r\n        }\r\n    } \r\n    else {\r\n        err.setCode(error.Code());\r\n        err.setMessage(error.Message());\r\n    }\r\n\r\n    //get from header if body has nothing\r\n    if (err.RequestId().empty()) {\r\n        auto it = error.Headers().find(\"x-oss-request-id\");\r\n        if (it != error.Headers().end()) {\r\n            err.setRequestId(it->second);\r\n        }\r\n    }\r\n\r\n    return err;\r\n}\r\n\r\nServiceResult OssClientImpl::buildResult(const OssRequest &request, const std::shared_ptr<HttpResponse> &httpResponse) const\r\n{\r\n    ServiceResult result;\r\n    auto flag = request.Flags();\r\n    if ((flag & REQUEST_FLAG_CHECK_CRC64) &&\r\n        (flag & REQUEST_FLAG_SAVE_CLIENT_CRC64)) {\r\n        httpResponse->addHeader(\"x-oss-hash-crc64ecma-by-client\", std::to_string(httpResponse->request().Crc64Result()));\r\n    }\r\n    result.setRequestId(httpResponse->Header(\"x-oss-request-id\"));\r\n    result.setPlayload(httpResponse->Body());\r\n    result.setResponseCode(httpResponse->statusCode());\r\n    result.setHeaderCollection(httpResponse->Headers());\r\n    return result;\r\n}\r\n\r\nOssOutcome OssClientImpl::MakeRequest(const OssRequest &request, Http::Method method) const\r\n{\r\n    int ret = request.validate();\r\n    if (ret != 0) {\r\n        return OssOutcome(OssError(\"ValidateError\", request.validateMessage(ret)));\r\n    }\r\n\r\n    if (!isValidEndpoint_) {\r\n        return OssOutcome(OssError(\"ValidateError\", \"The endpoint is invalid.\"));\r\n    }\r\n\r\n    auto outcome = BASE::AttemptRequest(endpoint_, request, method);\r\n    if (outcome.isSuccess()) {\r\n        return OssOutcome(buildResult(request, outcome.result()));\r\n    } else {\r\n        return OssOutcome(buildError(outcome.error()));\r\n    }\r\n}\r\n\r\n#if !defined(OSS_DISABLE_BUCKET)\r\n\r\nListBucketsOutcome OssClientImpl::ListBuckets(const ListBucketsRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        ListBucketsResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? ListBucketsOutcome(std::move(result)) :\r\n            ListBucketsOutcome(OssError(\"ParseXMLError\", \"Parsing ListBuckets result fail.\"));\r\n    } else {\r\n        return ListBucketsOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nCreateBucketOutcome OssClientImpl::CreateBucket(const CreateBucketRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        return  CreateBucketOutcome(Bucket());\r\n    } else {\r\n        return CreateBucketOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::SetBucketAcl(const SetBucketAclRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    } else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::SetBucketLogging(const SetBucketLoggingRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::SetBucketWebsite(const SetBucketWebsiteRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::SetBucketReferer(const SetBucketRefererRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::SetBucketLifecycle(const SetBucketLifecycleRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::SetBucketCors(const SetBucketCorsRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::SetBucketStorageCapacity(const SetBucketStorageCapacityRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::SetBucketPolicy(const SetBucketPolicyRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\nVoidOutcome OssClientImpl::SetBucketRequestPayment(const SetBucketRequestPaymentRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome AlibabaCloud::OSS::OssClientImpl::SetBucketEncryption(const SetBucketEncryptionRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::SetBucketTagging(const SetBucketTaggingRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::SetBucketQosInfo(const SetBucketQosInfoRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::SetBucketVersioning(const SetBucketVersioningRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::SetBucketInventoryConfiguration(const SetBucketInventoryConfigurationRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::DeleteBucket(const DeleteBucketRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Delete);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::DeleteBucketLogging(const DeleteBucketLoggingRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Delete);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::DeleteBucketWebsite(const DeleteBucketWebsiteRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Delete);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::DeleteBucketLifecycle(const DeleteBucketLifecycleRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Delete);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::DeleteBucketCors(const DeleteBucketCorsRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Delete);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::DeleteBucketPolicy(const DeleteBucketPolicyRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Delete);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::DeleteBucketEncryption(const DeleteBucketEncryptionRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Delete);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::DeleteBucketTagging(const DeleteBucketTaggingRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Delete);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::DeleteBucketQosInfo(const DeleteBucketQosInfoRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Delete);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::DeleteBucketInventoryConfiguration(const DeleteBucketInventoryConfigurationRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Delete);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketAclOutcome OssClientImpl::GetBucketAcl(const GetBucketAclRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketAclResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketAclOutcome(std::move(result)) :\r\n            GetBucketAclOutcome(OssError(\"ParseXMLError\", \"Parsing ListObject result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketAclOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketLocationOutcome OssClientImpl::GetBucketLocation(const GetBucketLocationRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketLocationResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketLocationOutcome(std::move(result)) :\r\n            GetBucketLocationOutcome(OssError(\"ParseXMLError\", \"Parsing ListObject result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketLocationOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketInfoOutcome  OssClientImpl::GetBucketInfo(const  GetBucketInfoRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketInfoResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketInfoOutcome(std::move(result)) :\r\n            GetBucketInfoOutcome(OssError(\"ParseXMLError\", \"Parsing ListObject result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketInfoOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketLoggingOutcome OssClientImpl::GetBucketLogging(const GetBucketLoggingRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketLoggingResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketLoggingOutcome(std::move(result)) :\r\n            GetBucketLoggingOutcome(OssError(\"ParseXMLError\", \"Parsing ListObject result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketLoggingOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketWebsiteOutcome OssClientImpl::GetBucketWebsite(const GetBucketWebsiteRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketWebsiteResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketWebsiteOutcome(std::move(result)) :\r\n            GetBucketWebsiteOutcome(OssError(\"ParseXMLError\", \"Parsing ListObject result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketWebsiteOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketRefererOutcome OssClientImpl::GetBucketReferer(const GetBucketRefererRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketRefererResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketRefererOutcome(std::move(result)) :\r\n            GetBucketRefererOutcome(OssError(\"ParseXMLError\", \"Parsing ListObject result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketRefererOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketLifecycleOutcome OssClientImpl::GetBucketLifecycle(const GetBucketLifecycleRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketLifecycleResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketLifecycleOutcome(std::move(result)) :\r\n            GetBucketLifecycleOutcome(OssError(\"ParseXMLError\", \"Parsing ListObject result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketLifecycleOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketStatOutcome OssClientImpl::GetBucketStat(const GetBucketStatRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketStatResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketStatOutcome(std::move(result)) :\r\n            GetBucketStatOutcome(OssError(\"ParseXMLError\", \"Parsing ListObject result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketStatOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketCorsOutcome OssClientImpl::GetBucketCors(const GetBucketCorsRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketCorsResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketCorsOutcome(std::move(result)) :\r\n            GetBucketCorsOutcome(OssError(\"ParseXMLError\", \"Parsing ListObject result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketCorsOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketStorageCapacityOutcome OssClientImpl::GetBucketStorageCapacity(const GetBucketStorageCapacityRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketStorageCapacityResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketStorageCapacityOutcome(std::move(result)) :\r\n            GetBucketStorageCapacityOutcome(OssError(\"ParseXMLError\", \"Parsing ListObject result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketStorageCapacityOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketPolicyOutcome OssClientImpl::GetBucketPolicy(const GetBucketPolicyRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketPolicyResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketPolicyOutcome(std::move(result)) :\r\n            GetBucketPolicyOutcome(OssError(\"ParseXMLError\", \"Parsing ListObject result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketPolicyOutcome(outcome.error());\r\n    }\r\n}\r\nGetBucketPaymentOutcome OssClientImpl::GetBucketRequestPayment(const GetBucketRequestPaymentRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketPaymentResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketPaymentOutcome(std::move(result)) :\r\n            GetBucketPaymentOutcome(OssError(\"ParseXMLError\", \"Parsing GetBucketPayment result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketPaymentOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketEncryptionOutcome OssClientImpl::GetBucketEncryption(const GetBucketEncryptionRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketEncryptionResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketEncryptionOutcome(std::move(result)) :\r\n            GetBucketEncryptionOutcome(OssError(\"ParseXMLError\", \"Parsing GetBucketEncryption result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketEncryptionOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketTaggingOutcome OssClientImpl::GetBucketTagging(const GetBucketTaggingRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketTaggingResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketTaggingOutcome(std::move(result)) :\r\n            GetBucketTaggingOutcome(OssError(\"ParseXMLError\", \"Parsing GetBucketTagging result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketTaggingOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketQosInfoOutcome OssClientImpl::GetBucketQosInfo(const GetBucketQosInfoRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketQosInfoResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketQosInfoOutcome(std::move(result)) :\r\n            GetBucketQosInfoOutcome(OssError(\"ParseXMLError\", \"Parsing GetBucketQosInfo result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketQosInfoOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetUserQosInfoOutcome OssClientImpl::GetUserQosInfo(const GetUserQosInfoRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetUserQosInfoResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetUserQosInfoOutcome(std::move(result)) :\r\n            GetUserQosInfoOutcome(OssError(\"ParseXMLError\", \"Parsing GetUserQosInfo result fail.\"));\r\n    }\r\n    else {\r\n        return GetUserQosInfoOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketVersioningOutcome OssClientImpl::GetBucketVersioning(const GetBucketVersioningRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketVersioningResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketVersioningOutcome(std::move(result)) :\r\n            GetBucketVersioningOutcome(OssError(\"ParseXMLError\", \"Parsing GetBucketVersioning result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketVersioningOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketInventoryConfigurationOutcome OssClientImpl::GetBucketInventoryConfiguration(const GetBucketInventoryConfigurationRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketInventoryConfigurationResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketInventoryConfigurationOutcome(std::move(result)) :\r\n            GetBucketInventoryConfigurationOutcome(OssError(\"ParseXMLError\", \"Parsing GetBucketInventoryConfiguration result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketInventoryConfigurationOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nListBucketInventoryConfigurationsOutcome OssClientImpl::ListBucketInventoryConfigurations(const ListBucketInventoryConfigurationsRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        ListBucketInventoryConfigurationsResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? ListBucketInventoryConfigurationsOutcome(std::move(result)) :\r\n            ListBucketInventoryConfigurationsOutcome(OssError(\"ParseXMLError\", \"Parsing ListBucketInventoryConfigurations result fail.\"));\r\n    }\r\n    else {\r\n        return ListBucketInventoryConfigurationsOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nInitiateBucketWormOutcome OssClientImpl::InitiateBucketWorm(const InitiateBucketWormRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Post);\r\n    if (outcome.isSuccess()) {\r\n        return InitiateBucketWormOutcome(InitiateBucketWormResult(outcome.result().headerCollection()));\r\n    }\r\n    else {\r\n        return InitiateBucketWormOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::AbortBucketWorm(const AbortBucketWormRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Delete);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::CompleteBucketWorm(const CompleteBucketWormRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Post);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::ExtendBucketWormWorm(const ExtendBucketWormRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Post);\r\n    if (outcome.isSuccess()) {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetBucketWormOutcome OssClientImpl::GetBucketWorm(const GetBucketWormRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetBucketWormResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? GetBucketWormOutcome(std::move(result)) :\r\n            GetBucketWormOutcome(OssError(\"ParseXMLError\", \"Parsing GetBucketWorm result fail.\"));\r\n    }\r\n    else {\r\n        return GetBucketWormOutcome(outcome.error());\r\n    }\r\n}\r\n#endif\r\n\r\nListObjectOutcome OssClientImpl::ListObjects(const ListObjectsRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        ListObjectsResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? ListObjectOutcome(std::move(result)) :\r\n            ListObjectOutcome(OssError(\"ParseXMLError\", \"Parsing ListObject result fail.\"));\r\n    }\r\n    else {\r\n        return ListObjectOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nListObjectsV2Outcome OssClientImpl::ListObjectsV2(const ListObjectsV2Request &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        ListObjectsV2Result result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? ListObjectsV2Outcome(std::move(result)) :\r\n            ListObjectsV2Outcome(OssError(\"ParseXMLError\", \"Parsing ListObjectV2 result fail.\"));\r\n    }\r\n    else {\r\n        return ListObjectsV2Outcome(outcome.error());\r\n    }\r\n}\r\n\r\nListObjectVersionsOutcome OssClientImpl::ListObjectVersions(const ListObjectVersionsRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        ListObjectVersionsResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? ListObjectVersionsOutcome(std::move(result)) :\r\n            ListObjectVersionsOutcome(OssError(\"ParseXMLError\", \"Parsing ListObjectVersions result fail.\"));\r\n    }\r\n    else {\r\n        return ListObjectVersionsOutcome(outcome.error());\r\n    }\r\n}\r\n\r\n#undef GetObject\r\nGetObjectOutcome OssClientImpl::GetObject(const GetObjectRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        return GetObjectOutcome(GetObjectResult(request.Bucket(), request.Key(),\r\n            outcome.result().payload(),outcome.result().headerCollection()));\r\n    }\r\n    else {\r\n        return GetObjectOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nPutObjectOutcome OssClientImpl::PutObject(const PutObjectRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        return PutObjectOutcome(PutObjectResult(outcome.result().headerCollection(), \r\n            outcome.result().payload()));\r\n    }\r\n    else {\r\n        return PutObjectOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nDeleteObjectOutcome OssClientImpl::DeleteObject(const DeleteObjectRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Delete);\r\n    if (outcome.isSuccess()) {\r\n        return DeleteObjectOutcome(DeleteObjectResult(outcome.result().headerCollection()));\r\n    }\r\n    else {\r\n        return DeleteObjectOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nDeleteObjecstOutcome OssClientImpl::DeleteObjects(const DeleteObjectsRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Post);\r\n    if (outcome.isSuccess()) {\r\n        DeleteObjectsResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? DeleteObjecstOutcome(std::move(result)) :\r\n            DeleteObjecstOutcome(OssError(\"ParseXMLError\", \"Parsing DeleteObjects result fail.\"));\r\n    }\r\n    else {\r\n        return DeleteObjecstOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nDeleteObjecVersionstOutcome OssClientImpl::DeleteObjectVersions(const DeleteObjectVersionsRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Post);\r\n    if (outcome.isSuccess()) {\r\n        DeleteObjectVersionsResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? DeleteObjecVersionstOutcome(std::move(result)) :\r\n            DeleteObjecVersionstOutcome(OssError(\"ParseXMLError\", \"Parsing DeleteObjectVersions result fail.\"));\r\n    }\r\n    else {\r\n        return DeleteObjecVersionstOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nObjectMetaDataOutcome OssClientImpl::HeadObject(const HeadObjectRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Head);\r\n    if (outcome.isSuccess()) {\r\n        ObjectMetaData metaData = outcome.result().headerCollection();\r\n        return ObjectMetaDataOutcome(std::move(metaData));\r\n    }\r\n    else {\r\n        return ObjectMetaDataOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nObjectMetaDataOutcome OssClientImpl::GetObjectMeta(const GetObjectMetaRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Head);\r\n    if (outcome.isSuccess()) {\r\n        ObjectMetaData metaData = outcome.result().headerCollection();\r\n        return ObjectMetaDataOutcome(std::move(metaData));\r\n    }\r\n    else {\r\n        return ObjectMetaDataOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetObjectAclOutcome OssClientImpl::GetObjectAcl(const GetObjectAclRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetObjectAclResult result(outcome.result().headerCollection(), outcome.result().payload());\r\n        return result.ParseDone() ? GetObjectAclOutcome(std::move(result)) :\r\n            GetObjectAclOutcome(OssError(\"ParseXMLError\", \"Parsing GetObjectAcl result fail.\"));\r\n    }\r\n    else {\r\n        return GetObjectAclOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nAppendObjectOutcome OssClientImpl::AppendObject(const AppendObjectRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Post);\r\n    if (outcome.isSuccess()) {\r\n\t\tAppendObjectResult result(outcome.result().headerCollection());\r\n        return result.ParseDone() ? AppendObjectOutcome(std::move(result)) :\r\n            AppendObjectOutcome(OssError(\"ParseXMLError\", \"no position or no crc64\"));\r\n    }\r\n    else {\r\n        return AppendObjectOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nCopyObjectOutcome OssClientImpl::CopyObject(const CopyObjectRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        return CopyObjectOutcome(CopyObjectResult(outcome.result().headerCollection(), outcome.result().payload()));\r\n    }\r\n    else {\r\n        return CopyObjectOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetSymlinkOutcome OssClientImpl::GetSymlink(const GetSymlinkRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        return GetSymlinkOutcome(GetSymlinkResult(outcome.result().headerCollection()));\r\n    }\r\n    else {\r\n        return GetSymlinkOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nRestoreObjectOutcome OssClientImpl::RestoreObject(const RestoreObjectRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Post);\r\n    if (outcome.isSuccess()) {\r\n        return RestoreObjectOutcome(RestoreObjectResult(outcome.result().headerCollection()));\r\n    }\r\n    else {\r\n        return RestoreObjectOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nCreateSymlinkOutcome OssClientImpl::CreateSymlink(const CreateSymlinkRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        return CreateSymlinkOutcome(CreateSymlinkResult(outcome.result().headerCollection()));\r\n    }\r\n    else {\r\n        return CreateSymlinkOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nSetObjectAclOutcome OssClientImpl::SetObjectAcl(const SetObjectAclRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        return SetObjectAclOutcome(SetObjectAclResult(outcome.result().headerCollection()));\r\n    }\r\n    else {\r\n        return SetObjectAclOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetObjectOutcome OssClientImpl::ProcessObject(const ProcessObjectRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Post);\r\n    if (outcome.isSuccess()) {\r\n        return GetObjectOutcome(GetObjectResult(request.Bucket(), request.Key(),\r\n            outcome.result().payload(), outcome.result().headerCollection()));\r\n    }\r\n    else {\r\n        return GetObjectOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetObjectOutcome OssClientImpl::SelectObject(const SelectObjectRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Post);\r\n    int ret = request.dispose();\r\n    if (outcome.isSuccess()) {\r\n        return GetObjectOutcome(GetObjectResult(request.Bucket(), request.Key(),\r\n            outcome.result().payload(), outcome.result().headerCollection()));\r\n    }\r\n    else {\r\n        if (ret != 0) {\r\n            return GetObjectOutcome(OssError(\"SelectObjectError\", request.validateMessage(ret)));\r\n        }\r\n        return GetObjectOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nCreateSelectObjectMetaOutcome OssClientImpl::CreateSelectObjectMeta(const CreateSelectObjectMetaRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Post);\r\n    if (outcome.isSuccess()) {\r\n        CreateSelectObjectMetaResult result(request.Bucket(), request.Key(),\r\n            outcome.result().RequestId(), outcome.result().payload());\r\n        return result.ParseDone() ? CreateSelectObjectMetaOutcome(result) :\r\n            CreateSelectObjectMetaOutcome(OssError(\"ParseIOStreamError\", \"Parse create select object meta IOStream fail.\"));\r\n    }\r\n    else {\r\n        return CreateSelectObjectMetaOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nSetObjectTaggingOutcome OssClientImpl::SetObjectTagging(const SetObjectTaggingRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        return SetObjectTaggingOutcome(SetObjectTaggingResult(outcome.result().headerCollection()));\r\n    }\r\n    else {\r\n        return SetObjectTaggingOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nDeleteObjectTaggingOutcome OssClientImpl::DeleteObjectTagging(const DeleteObjectTaggingRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Delete);\r\n    if (outcome.isSuccess()) {\r\n        return DeleteObjectTaggingOutcome(DeleteObjectTaggingResult(outcome.result().headerCollection()));\r\n    }\r\n    else {\r\n        return DeleteObjectTaggingOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetObjectTaggingOutcome OssClientImpl::GetObjectTagging(const GetObjectTaggingRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        GetObjectTaggingResult result(outcome.result().headerCollection(), outcome.result().payload());\r\n        return result.ParseDone() ? GetObjectTaggingOutcome(std::move(result)) :\r\n            GetObjectTaggingOutcome(OssError(\"ParseXMLError\", \"Parsing ObjectTagging result fail.\"));\r\n    }\r\n    else {\r\n        return GetObjectTaggingOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nStringOutcome OssClientImpl::GeneratePresignedUrl(const GeneratePresignedUrlRequest &request) const\r\n{\r\n    if (!IsValidBucketName(request.bucket_) ||\r\n        !IsValidObjectKey(request.key_, configuration().isVerifyObjectStrict)) {\r\n        return StringOutcome(OssError(\"ValidateError\", \"The Bucket or Key is invalid.\"));\r\n    }\r\n\r\n    auto credentials = credentialsProvider_->getCredentials();\r\n    auto bucket = request.bucket_;\r\n    auto key = request.key_;\r\n    auto region = region_;\r\n    auto product = DEFAULT_PRODUCT_NAME;\r\n    auto t = std::time(nullptr)  + getRequestDateOffset();\r\n\r\n    if (!cloudboxId_.empty()) {\r\n        region = cloudboxId_;\r\n        product = CLOUDBOX_PRODUCT_NAME;\r\n    }\r\n\r\n    auto httpRequest = std::make_shared<HttpRequest>(request.method_);\r\n    for (auto const& header : request.metaData_.toHeaderCollection()) {\r\n        httpRequest->addHeader(header.first, header.second);\r\n    }\r\n    auto parameters = request.parameters_;\r\n\r\n    SignerParam signerParam(std::move(region), std::move(product), \r\n        std::move(bucket), std::move(key), std::move(credentials), t);\r\n    signerParam.setExpires(request.expires_);\r\n\r\n    signer_->presign(httpRequest, parameters, signerParam);\r\n\r\n    //host\r\n    std::stringstream ss;\r\n    ss << CombineHostString(endpoint_, bucket, configuration().isCname, configuration().isPathStyle);\r\n    //path\r\n    ss << CombinePathString(endpoint_, bucket, key, configuration().isPathStyle, request.unencodedSlash_);\r\n    //query\r\n    ss << \"?\";\r\n    ss << CombineQueryString(parameters);\r\n\r\n    return StringOutcome(ss.str());\r\n}\r\n\r\nGetObjectOutcome OssClientImpl::GetObjectByUrl(const GetObjectByUrlRequest &request) const\r\n{\r\n    auto outcome = BASE::AttemptRequest(endpoint_, request, Http::Method::Get);\r\n    if (outcome.isSuccess()) {\r\n        return GetObjectOutcome(GetObjectResult(\"\", \"\", \r\n            outcome.result()->Body(),\r\n            outcome.result()->Headers()));\r\n    }\r\n    else {\r\n        return GetObjectOutcome(buildError(outcome.error()));\r\n    }\r\n}\r\n\r\nPutObjectOutcome OssClientImpl::PutObjectByUrl(const PutObjectByUrlRequest &request) const\r\n{\r\n    auto outcome = BASE::AttemptRequest(endpoint_, request, Http::Method::Put);\r\n    if (outcome.isSuccess()) {\r\n        return PutObjectOutcome(PutObjectResult(outcome.result()->Headers(), \r\n            outcome.result()->Body()));\r\n    }\r\n    else {\r\n        return PutObjectOutcome(buildError(outcome.error()));\r\n    }\r\n}\r\n\r\nInitiateMultipartUploadOutcome OssClientImpl::InitiateMultipartUpload(const InitiateMultipartUploadRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Post);\r\n    if(outcome.isSuccess()){\r\n        InitiateMultipartUploadResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? InitiateMultipartUploadOutcome(std::move(result)):\r\n                InitiateMultipartUploadOutcome(\r\n                    OssError(\"InitiateMultipartUploadError\",\r\n                    \"Parsing InitiateMultipartUploadResult fail\"));\r\n    }\r\n    else{\r\n        return InitiateMultipartUploadOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nPutObjectOutcome OssClientImpl::UploadPart(const UploadPartRequest &request)const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Put);\r\n    if(outcome.isSuccess()){\r\n        const HeaderCollection& header = outcome.result().headerCollection();\r\n        return PutObjectOutcome(PutObjectResult(header));\r\n    }else{\r\n        return PutObjectOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nUploadPartCopyOutcome OssClientImpl::UploadPartCopy(const UploadPartCopyRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Put);\r\n    if(outcome.isSuccess()){\r\n        const HeaderCollection& header = outcome.result().headerCollection();\r\n        return UploadPartCopyOutcome(\r\n            UploadPartCopyResult(outcome.result().payload(), header));\r\n    }\r\n    else{\r\n        return UploadPartCopyOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nCompleteMultipartUploadOutcome OssClientImpl::CompleteMultipartUpload(const CompleteMultipartUploadRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Post);\r\n    if (outcome.isSuccess()){\r\n        CompleteMultipartUploadResult result(outcome.result().payload(), outcome.result().headerCollection());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ?\r\n            CompleteMultipartUploadOutcome(std::move(result)) : \r\n            CompleteMultipartUploadOutcome(OssError(\"CompleteMultipartUpload\", \"\"));\r\n    }\r\n    else {\r\n        return CompleteMultipartUploadOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::AbortMultipartUpload(const AbortMultipartUploadRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Delete);\r\n    if(outcome.isSuccess()){\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }\r\n    else {\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nListMultipartUploadsOutcome OssClientImpl::ListMultipartUploads(\r\n    const ListMultipartUploadsRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Get);\r\n    if(outcome.isSuccess())\r\n    {\r\n        ListMultipartUploadsResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ?\r\n            ListMultipartUploadsOutcome(std::move(result)) :\r\n            ListMultipartUploadsOutcome(OssError(\"ListMultipartUploads\", \"Parse Error\"));\r\n    }\r\n    else {\r\n        return ListMultipartUploadsOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nListPartsOutcome OssClientImpl::ListParts(const ListPartsRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Get);\r\n    if(outcome.isSuccess())\r\n    {\r\n        ListPartsResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone() ? \r\n            ListPartsOutcome(std::move(result)) :\r\n            ListPartsOutcome(OssError(\"ListParts\", \"Parse Error\"));\r\n    }else{\r\n        return ListPartsOutcome(outcome.error());\r\n    }\r\n}\r\n\r\n#if !defined(OSS_DISABLE_RESUAMABLE)\r\n/*Resumable Operation*/\r\nPutObjectOutcome OssClientImpl::ResumableUploadObject(const UploadObjectRequest& request) const \r\n{\r\n    const auto& reqeustBase = static_cast<const OssResumableBaseRequest &>(request);\r\n    int code = reqeustBase.validate();\r\n    if (code != 0) {\r\n        return PutObjectOutcome(OssError(\"ValidateError\", reqeustBase.validateMessage(code)));\r\n    }\r\n\r\n    if (request.ObjectSize() <= request.PartSize())\r\n    {\r\n        auto content = GetFstreamByPath(request.FilePath(), request.FilePathW(),\r\n            std::ios::in | std::ios::binary);\r\n        PutObjectRequest putObjectReq(request.Bucket(), request.Key(), content, request.MetaData());\r\n        if (request.TransferProgress().Handler) {\r\n            putObjectReq.setTransferProgress(request.TransferProgress());\r\n        }\r\n        if (request.RequestPayer() == RequestPayer::Requester) {\r\n            putObjectReq.setRequestPayer(request.RequestPayer());\r\n        }\r\n        if (request.TrafficLimit() != 0) {\r\n            putObjectReq.setTrafficLimit(request.TrafficLimit());\r\n        }\r\n        return PutObject(putObjectReq);\r\n    }\r\n    else\r\n    {\r\n        ResumableUploader uploader(request, this);\r\n        return uploader.Upload();\r\n    }\r\n}\r\n\r\nCopyObjectOutcome OssClientImpl::ResumableCopyObject(const MultiCopyObjectRequest& request) const \r\n{\r\n    const auto& reqeustBase = static_cast<const OssResumableBaseRequest &>(request);\r\n    int code = reqeustBase.validate();\r\n    if (code != 0) {\r\n        return CopyObjectOutcome(OssError(\"ValidateError\", reqeustBase.validateMessage(code)));\r\n    }\r\n\r\n    auto getObjectMetaReq = GetObjectMetaRequest(request.SrcBucket(), request.SrcKey());\r\n    if (request.RequestPayer() == RequestPayer::Requester) {\r\n        getObjectMetaReq.setRequestPayer(request.RequestPayer());\r\n    }\r\n    if (!request.VersionId().empty()) {\r\n        getObjectMetaReq.setVersionId(request.VersionId());\r\n    }\r\n    auto outcome = GetObjectMeta(getObjectMetaReq);\r\n    if (!outcome.isSuccess()) {\r\n        return CopyObjectOutcome(outcome.error());\r\n    }\r\n\r\n    auto objectSize = outcome.result().ContentLength();\r\n    if (objectSize < (int64_t)request.PartSize()) {\r\n        auto copyObjectReq = CopyObjectRequest(request.Bucket(), request.Key(), request.MetaData());\r\n        copyObjectReq.setCopySource(request.SrcBucket(), request.SrcKey());\r\n        if (request.RequestPayer() == RequestPayer::Requester) {\r\n            copyObjectReq.setRequestPayer(request.RequestPayer());\r\n        }\r\n        if (request.TrafficLimit() != 0) {\r\n            copyObjectReq.setTrafficLimit(request.TrafficLimit());\r\n        }\r\n        if (!request.VersionId().empty()) {\r\n            copyObjectReq.setVersionId(request.VersionId());\r\n        }\r\n        return CopyObject(copyObjectReq);\r\n    }\r\n\r\n    ResumableCopier copier(request, this, objectSize);\r\n    return copier.Copy();\r\n}\r\n\r\nGetObjectOutcome OssClientImpl::ResumableDownloadObject(const DownloadObjectRequest &request) const \r\n{\r\n    const auto& reqeustBase = static_cast<const OssResumableBaseRequest &>(request);\r\n    int code = reqeustBase.validate();\r\n    if (code != 0) {\r\n        return GetObjectOutcome(OssError(\"ValidateError\", reqeustBase.validateMessage(code)));\r\n    }\r\n\r\n    auto getObjectMetaReq = GetObjectMetaRequest(request.Bucket(), request.Key());\r\n    if (request.RequestPayer() == RequestPayer::Requester) {\r\n        getObjectMetaReq.setRequestPayer(request.RequestPayer());\r\n    }\r\n    if (!request.VersionId().empty()) {\r\n        getObjectMetaReq.setVersionId(request.VersionId());\r\n    }\r\n    auto hOutcome = GetObjectMeta(getObjectMetaReq);\r\n    if (!hOutcome.isSuccess()) {\r\n        return GetObjectOutcome(hOutcome.error());\r\n    }\r\n\r\n    auto objectSize = hOutcome.result().ContentLength();\r\n    if (objectSize < (int64_t)request.PartSize()) {\r\n        auto getObjectReq = GetObjectRequest(request.Bucket(), request.Key(), request.ModifiedSinceConstraint(), request.UnmodifiedSinceConstraint(),request.MatchingETagsConstraint(), request.NonmatchingETagsConstraint(), request.ResponseHeaderParameters());\r\n        if (request.RangeIsSet()) {\r\n            getObjectReq.setRange(request.RangeStart(), request.RangeEnd());\r\n        }\r\n        if (request.TransferProgress().Handler) {\r\n            getObjectReq.setTransferProgress(request.TransferProgress());\r\n        }\r\n        if (request.RequestPayer() == RequestPayer::Requester) {\r\n            getObjectReq.setRequestPayer(request.RequestPayer());\r\n        }\r\n        if (request.TrafficLimit() != 0) {\r\n            getObjectReq.setTrafficLimit(request.TrafficLimit());\r\n        }\r\n        if (!request.VersionId().empty()) {\r\n            getObjectReq.setVersionId(request.VersionId());\r\n        }\r\n        getObjectReq.setResponseStreamFactory([=]() {\r\n            return GetFstreamByPath(request.FilePath(), request.FilePathW(),\r\n                std::ios_base::out | std::ios_base::in | std::ios_base::trunc | std::ios_base::binary);\r\n        });\r\n        auto outcome = this->GetObject(getObjectReq);\r\n        std::shared_ptr<std::iostream> content = nullptr;\r\n        outcome.result().setContent(content);\r\n        if (IsFileExist(request.TempFilePath())) {\r\n            RemoveFile(request.TempFilePath());\r\n        }\r\n#ifdef _WIN32\r\n        else if (IsFileExist(request.TempFilePathW())) {\r\n            RemoveFile(request.TempFilePathW());\r\n        }\r\n#endif\r\n        return outcome;\r\n    }\r\n\r\n    ResumableDownloader downloader(request, this, objectSize);\r\n    return downloader.Download();\r\n}\r\n#endif\r\n\r\n#if !defined(OSS_DISABLE_LIVECHANNEL)\r\n/*Live Channel*/\r\nVoidOutcome OssClientImpl::PutLiveChannelStatus(const PutLiveChannelStatusRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Put);\r\n    if(outcome.isSuccess())\r\n    {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(result);\r\n    }else{\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nPutLiveChannelOutcome OssClientImpl::PutLiveChannel(const PutLiveChannelRequest& request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Put);\r\n    if(outcome.isSuccess())\r\n    {\r\n        PutLiveChannelResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone()?\r\n            PutLiveChannelOutcome(std::move(result)):\r\n            PutLiveChannelOutcome(OssError(\"PutLiveChannelError\", \"Parse Error\"));\r\n    }else{\r\n        return PutLiveChannelOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::PostVodPlaylist(const PostVodPlaylistRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Post);\r\n    if(outcome.isSuccess())\r\n    {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(std::move(result));\r\n    }else{\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetVodPlaylistOutcome OssClientImpl::GetVodPlaylist(const GetVodPlaylistRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Get);\r\n    if(outcome.isSuccess())\r\n    {\r\n        GetVodPlaylistResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return GetVodPlaylistOutcome(std::move(result));\r\n    }else{\r\n        return GetVodPlaylistOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetLiveChannelStatOutcome OssClientImpl::GetLiveChannelStat(const GetLiveChannelStatRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Get);\r\n    if(outcome.isSuccess())\r\n    {\r\n        GetLiveChannelStatResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone()?\r\n            GetLiveChannelStatOutcome(std::move(result)):\r\n            GetLiveChannelStatOutcome(OssError(\"GetLiveChannelStatError\", \"Parse Error\"));\r\n    }else{\r\n        return GetLiveChannelStatOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetLiveChannelInfoOutcome OssClientImpl::GetLiveChannelInfo(const GetLiveChannelInfoRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Get);\r\n    if(outcome.isSuccess())\r\n    {\r\n        GetLiveChannelInfoResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone()?\r\n            GetLiveChannelInfoOutcome(std::move(result)):\r\n            GetLiveChannelInfoOutcome(OssError(\"GetLiveChannelStatError\", \"Parse Error\"));\r\n    }else{\r\n        return GetLiveChannelInfoOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nGetLiveChannelHistoryOutcome OssClientImpl::GetLiveChannelHistory(const GetLiveChannelHistoryRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Get);\r\n    if(outcome.isSuccess())\r\n    {\r\n        GetLiveChannelHistoryResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone()?\r\n            GetLiveChannelHistoryOutcome(std::move(result)):\r\n            GetLiveChannelHistoryOutcome(OssError(\"GetLiveChannelStatError\", \"Parse Error\"));\r\n    }else{\r\n        return GetLiveChannelHistoryOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nListLiveChannelOutcome OssClientImpl::ListLiveChannel(const ListLiveChannelRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Get);\r\n    if(outcome.isSuccess())\r\n    {\r\n        ListLiveChannelResult result(outcome.result().payload());\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return result.ParseDone()?\r\n            ListLiveChannelOutcome(std::move(result)):\r\n            ListLiveChannelOutcome(OssError(\"GetLiveChannelStatError\", \"Parse Error\"));\r\n    }else{\r\n        return ListLiveChannelOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nVoidOutcome OssClientImpl::DeleteLiveChannel(const DeleteLiveChannelRequest &request) const\r\n{\r\n    auto outcome = MakeRequest(request, Http::Delete);\r\n    if(outcome.isSuccess())\r\n    {\r\n        VoidResult result;\r\n        result.requestId_ = outcome.result().RequestId();\r\n        return VoidOutcome(std::move(result));\r\n    }else{\r\n        return VoidOutcome(outcome.error());\r\n    }\r\n}\r\n\r\nStringOutcome OssClientImpl::GenerateRTMPSignedUrl(const GenerateRTMPSignedUrlRequest &request) const\r\n{\r\n    if (!IsValidBucketName(request.bucket_) ||\r\n        !IsValidChannelName(request.ChannelName()) || \r\n        !IsValidPlayListName(request.PlayList()) ||\r\n        0 == request.Expires()) {\r\n        return StringOutcome(OssError(\"ValidateError\", \"The Bucket or ChannelName or \"\r\n            \"PlayListName or Expires is invalid.\"));\r\n    }\r\n\r\n    ParameterCollection parameters;\r\n    const Credentials credentials = credentialsProvider_->getCredentials();\r\n    if (!credentials.SessionToken().empty()) {\r\n        parameters[\"security-token\"] = credentials.SessionToken();\r\n    }\r\n    \r\n    parameters = request.Parameters();\r\n\r\n    std::string expireStr;\r\n    std::stringstream ss;\r\n    ss << request.Expires();\r\n    expireStr = ss.str();\r\n\r\n    SignUtils signUtils(signer_->version());\r\n    auto resource = std::string().append(\"/\").append(request.Bucket()).append(\"/\").append(request.ChannelName());\r\n    signUtils.build(expireStr, resource, parameters);\r\n    auto signature = HmacSha1Signer::generate(signUtils.CanonicalString(), credentials.AccessKeySecret());\r\n    parameters[\"Expires\"] = expireStr;\r\n    parameters[\"OSSAccessKeyId\"] = credentials.AccessKeyId();\r\n    parameters[\"Signature\"] = signature;\r\n\r\n    ss.str(\"\");\r\n    ss << CombineRTMPString(endpoint_, request.bucket_, configuration().isCname, configuration().isPathStyle);\r\n    ss << \"/live\";\r\n    ss << CombinePathString(endpoint_, request.bucket_, request.key_, configuration().isPathStyle);\r\n    ss << \"?\";\r\n    ss << CombineQueryString(parameters);\r\n\r\n    return StringOutcome(ss.str());\r\n}\r\n#endif\r\n\r\n/*Requests control*/\r\nvoid OssClientImpl::DisableRequest()\r\n{\r\n    BASE::disableRequest();\r\n    OSS_LOG(LogLevel::LogDebug, TAG, \"client(%p) DisableRequest\", this);\r\n}\r\n\r\nvoid OssClientImpl::EnableRequest()\r\n{\r\n    BASE::enableRequest();\r\n    OSS_LOG(LogLevel::LogDebug, TAG, \"client(%p) EnableRequest\", this);\r\n}\r\n\r\n/*Others*/\r\nvoid OssClientImpl::SetRegion(const std::string &region)\r\n{\r\n    OSS_LOG(LogLevel::LogDebug, TAG, \"client(%p) SetRegion, from:%s  to:%s\", this, region_.c_str(), region.c_str());\r\n    region_ = region;\r\n}\r\n\r\nvoid OssClientImpl::SetCloudBoxId(const std::string &cloudboxId)\r\n{\r\n    OSS_LOG(LogLevel::LogDebug, TAG, \"client(%p) SetCloudBoxId, from:%s  to:%s\", this, cloudboxId_.c_str(), cloudboxId.c_str());\r\n    cloudboxId_ = cloudboxId;\r\n}"
  },
  {
    "path": "sdk/src/OssClientImpl.h",
    "content": "/*\r\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n*\r\n* Licensed under the Apache License, Version 2.0 (the \"License\");\r\n* you may not use this file except in compliance with the License.\r\n* You may obtain a copy of the License at\r\n*\r\n*      http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing, software\r\n* distributed under the License is distributed on an \"AS IS\" BASIS,\r\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n* See the License for the specific language governing permissions and\r\n* limitations under the License.\r\n*/\r\n\r\n#ifndef ALIBABACLOUD_OSS_OSSCLIENTIMPL_H_\r\n#define ALIBABACLOUD_OSS_OSSCLIENTIMPL_H_\r\n\r\n#include <alibabacloud/oss/client/ClientConfiguration.h>\r\n#include <alibabacloud/oss/auth/CredentialsProvider.h>\r\n#include <alibabacloud/oss/OssRequest.h>\r\n#include <alibabacloud/oss/OssResponse.h>\r\n#include <alibabacloud/oss/utils/Executor.h>\r\n#include <alibabacloud/oss/OssFwd.h>\r\n#include \"signer/Signer.h\"\r\n#include \"client/Client.h\"\r\n#ifdef GetObject\r\n#undef GetObject\r\n#endif\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class OssClientImpl : public Client\r\n    {\r\n    public:\r\n        typedef Client BASE;\r\n\r\n        OssClientImpl(const std::string &endpoint, const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration);\r\n        virtual ~OssClientImpl();\r\n        int asyncExecute(Runnable * r) const;\r\n\r\n#if !defined(OSS_DISABLE_BUCKET)\r\n        ListBucketsOutcome ListBuckets(const ListBucketsRequest &request) const;\r\n        CreateBucketOutcome CreateBucket(const CreateBucketRequest &request) const;\r\n        VoidOutcome SetBucketAcl(const SetBucketAclRequest& request) const;\r\n        VoidOutcome SetBucketLogging(const SetBucketLoggingRequest& request) const;\r\n        VoidOutcome SetBucketWebsite(const SetBucketWebsiteRequest& request) const;\r\n        VoidOutcome SetBucketReferer(const SetBucketRefererRequest& request) const;\r\n        VoidOutcome SetBucketLifecycle(const SetBucketLifecycleRequest& request) const;\r\n        VoidOutcome SetBucketCors(const SetBucketCorsRequest& request) const;\r\n        VoidOutcome SetBucketStorageCapacity(const SetBucketStorageCapacityRequest& request) const;\r\n        VoidOutcome SetBucketPolicy(const SetBucketPolicyRequest& request) const;\r\n        VoidOutcome SetBucketRequestPayment(const SetBucketRequestPaymentRequest& request) const;\r\n        VoidOutcome SetBucketEncryption(const SetBucketEncryptionRequest& request) const;\r\n        VoidOutcome SetBucketTagging(const SetBucketTaggingRequest& request) const;\r\n        VoidOutcome SetBucketQosInfo(const SetBucketQosInfoRequest& request) const;\r\n        VoidOutcome SetBucketVersioning(const SetBucketVersioningRequest& request) const;\r\n        VoidOutcome SetBucketInventoryConfiguration(const SetBucketInventoryConfigurationRequest& request) const;\r\n\r\n        VoidOutcome DeleteBucket(const DeleteBucketRequest &request) const;\r\n        VoidOutcome DeleteBucketLogging(const DeleteBucketLoggingRequest& request) const;\r\n        VoidOutcome DeleteBucketWebsite(const DeleteBucketWebsiteRequest& request) const;\r\n        VoidOutcome DeleteBucketLifecycle(const DeleteBucketLifecycleRequest& request) const;\r\n        VoidOutcome DeleteBucketCors(const DeleteBucketCorsRequest& request) const;\r\n        VoidOutcome DeleteBucketPolicy(const DeleteBucketPolicyRequest& request) const;\r\n        VoidOutcome DeleteBucketEncryption(const DeleteBucketEncryptionRequest& request) const;\r\n        VoidOutcome DeleteBucketTagging(const DeleteBucketTaggingRequest& request) const;\r\n        VoidOutcome DeleteBucketQosInfo(const DeleteBucketQosInfoRequest& request) const;\r\n        VoidOutcome DeleteBucketInventoryConfiguration(const DeleteBucketInventoryConfigurationRequest& request) const;\r\n\r\n        ListBucketInventoryConfigurationsOutcome ListBucketInventoryConfigurations(const ListBucketInventoryConfigurationsRequest& request) const;\r\n\r\n        GetBucketAclOutcome GetBucketAcl(const GetBucketAclRequest &request) const;\r\n        GetBucketLocationOutcome GetBucketLocation(const GetBucketLocationRequest &request) const;\r\n        GetBucketInfoOutcome  GetBucketInfo(const  GetBucketInfoRequest &request) const;\r\n        GetBucketLoggingOutcome GetBucketLogging(const GetBucketLoggingRequest &request) const;\r\n        GetBucketWebsiteOutcome GetBucketWebsite(const GetBucketWebsiteRequest &request) const;\r\n        GetBucketRefererOutcome GetBucketReferer(const GetBucketRefererRequest &request) const;\r\n        GetBucketLifecycleOutcome GetBucketLifecycle(const GetBucketLifecycleRequest &request) const;\r\n        GetBucketStatOutcome GetBucketStat(const GetBucketStatRequest &request) const;\r\n        GetBucketCorsOutcome GetBucketCors(const GetBucketCorsRequest &request) const;\r\n        GetBucketStorageCapacityOutcome GetBucketStorageCapacity(const GetBucketStorageCapacityRequest& request) const;\r\n        GetBucketPolicyOutcome GetBucketPolicy(const GetBucketPolicyRequest& request) const;\r\n        GetBucketPaymentOutcome GetBucketRequestPayment(const GetBucketRequestPaymentRequest& request) const;\r\n        GetBucketEncryptionOutcome GetBucketEncryption(const GetBucketEncryptionRequest& request) const;\r\n        GetBucketTaggingOutcome GetBucketTagging(const GetBucketTaggingRequest& request) const;\r\n        GetBucketQosInfoOutcome GetBucketQosInfo(const GetBucketQosInfoRequest& request) const;\r\n        GetUserQosInfoOutcome GetUserQosInfo(const GetUserQosInfoRequest& request) const;\r\n        GetBucketVersioningOutcome GetBucketVersioning(const GetBucketVersioningRequest& request) const;\r\n        GetBucketInventoryConfigurationOutcome GetBucketInventoryConfiguration(const GetBucketInventoryConfigurationRequest& request) const;\r\n        InitiateBucketWormOutcome InitiateBucketWorm(const InitiateBucketWormRequest& request) const;\r\n        VoidOutcome AbortBucketWorm(const AbortBucketWormRequest& request) const;\r\n        VoidOutcome CompleteBucketWorm(const CompleteBucketWormRequest& request) const;\r\n        VoidOutcome ExtendBucketWormWorm(const ExtendBucketWormRequest& request) const;\r\n        GetBucketWormOutcome GetBucketWorm(const GetBucketWormRequest& request) const;\r\n#endif\r\n\r\n        /*Object*/\r\n        ListObjectOutcome ListObjects(const ListObjectsRequest &request) const;\r\n        ListObjectsV2Outcome ListObjectsV2(const ListObjectsV2Request &request) const;\r\n        ListObjectVersionsOutcome ListObjectVersions(const ListObjectVersionsRequest &request) const;\r\n\r\n        GetObjectOutcome GetObject(const GetObjectRequest &request) const;\r\n        PutObjectOutcome PutObject(const PutObjectRequest &request) const;\r\n        DeleteObjectOutcome DeleteObject(const DeleteObjectRequest &request) const;\r\n        DeleteObjecstOutcome DeleteObjects(const DeleteObjectsRequest &request) const;\r\n        DeleteObjecVersionstOutcome DeleteObjectVersions(const DeleteObjectVersionsRequest& request) const;\r\n        ObjectMetaDataOutcome HeadObject(const HeadObjectRequest &request) const;\r\n        ObjectMetaDataOutcome GetObjectMeta(const GetObjectMetaRequest &request) const;\r\n\r\n        GetObjectAclOutcome GetObjectAcl(const GetObjectAclRequest &request) const;\r\n        AppendObjectOutcome AppendObject(const AppendObjectRequest &request) const;\r\n        CopyObjectOutcome CopyObject(const CopyObjectRequest &request) const;\r\n        GetSymlinkOutcome GetSymlink(const GetSymlinkRequest &request) const;\r\n        RestoreObjectOutcome RestoreObject(const RestoreObjectRequest &request) const;\r\n        CreateSymlinkOutcome CreateSymlink(const CreateSymlinkRequest &request) const;\r\n        SetObjectAclOutcome SetObjectAcl(const SetObjectAclRequest &request) const;\r\n        GetObjectOutcome ProcessObject(const ProcessObjectRequest &request) const;\r\n\r\n        GetObjectOutcome SelectObject(const SelectObjectRequest &request) const;\r\n        CreateSelectObjectMetaOutcome CreateSelectObjectMeta(const CreateSelectObjectMetaRequest &request) const;\r\n\r\n        SetObjectTaggingOutcome SetObjectTagging(const SetObjectTaggingRequest& request) const;\r\n        DeleteObjectTaggingOutcome DeleteObjectTagging(const DeleteObjectTaggingRequest& request) const;\r\n        GetObjectTaggingOutcome GetObjectTagging(const GetObjectTaggingRequest& request) const;\r\n\r\n        /*MultipartUpload*/\r\n        InitiateMultipartUploadOutcome InitiateMultipartUpload(const InitiateMultipartUploadRequest &request) const;\r\n        PutObjectOutcome UploadPart(const UploadPartRequest& request) const;\r\n        UploadPartCopyOutcome UploadPartCopy(const UploadPartCopyRequest &request) const;\r\n        CompleteMultipartUploadOutcome CompleteMultipartUpload(const CompleteMultipartUploadRequest &request) const;\r\n        VoidOutcome AbortMultipartUpload(const AbortMultipartUploadRequest &request) const;\r\n        ListMultipartUploadsOutcome ListMultipartUploads(const ListMultipartUploadsRequest &request) const;\r\n        ListPartsOutcome ListParts(const ListPartsRequest &request) const;\r\n        \r\n        /*Generate URL*/\r\n        StringOutcome GeneratePresignedUrl(const GeneratePresignedUrlRequest &request) const;\r\n        GetObjectOutcome GetObjectByUrl(const GetObjectByUrlRequest &request) const;\r\n        PutObjectOutcome PutObjectByUrl(const PutObjectByUrlRequest &request) const;\r\n\r\n\r\n        /*Generate Post Policy*/\r\n\r\n#if !defined(OSS_DISABLE_RESUAMABLE)\r\n        /*Resumable Operation*/\r\n        PutObjectOutcome ResumableUploadObject(const UploadObjectRequest& request) const;\r\n        CopyObjectOutcome ResumableCopyObject(const MultiCopyObjectRequest& request) const;\r\n        GetObjectOutcome ResumableDownloadObject(const DownloadObjectRequest& request) const;\r\n#endif\r\n\r\n#if !defined(OSS_DISABLE_LIVECHANNEL)\r\n        /*Live Channel*/\r\n        VoidOutcome PutLiveChannelStatus(const PutLiveChannelStatusRequest &request) const;\r\n        PutLiveChannelOutcome PutLiveChannel(const PutLiveChannelRequest &request) const;\r\n        VoidOutcome PostVodPlaylist(const PostVodPlaylistRequest &request) const;\r\n        GetVodPlaylistOutcome GetVodPlaylist(const GetVodPlaylistRequest& request) const;\r\n        GetLiveChannelStatOutcome GetLiveChannelStat(const GetLiveChannelStatRequest &request) const;\r\n        GetLiveChannelInfoOutcome GetLiveChannelInfo(const GetLiveChannelInfoRequest &request) const;\r\n        GetLiveChannelHistoryOutcome GetLiveChannelHistory(const GetLiveChannelHistoryRequest &request) const;\r\n        ListLiveChannelOutcome ListLiveChannel(const ListLiveChannelRequest &request) const;\r\n        VoidOutcome DeleteLiveChannel(const DeleteLiveChannelRequest &request) const;\r\n        StringOutcome GenerateRTMPSignedUrl(const GenerateRTMPSignedUrlRequest &request) const;\r\n#endif\r\n\r\n        /*Requests control*/\r\n        void DisableRequest();\r\n        void EnableRequest();\r\n\r\n        /*Others*/\r\n        void SetRegion(const std::string &region);\r\n        void SetCloudBoxId(const std::string &cloudboxId);\r\n\r\n    protected:\r\n        virtual std::shared_ptr<HttpRequest> buildHttpRequest(const std::string & endpoint, const ServiceRequest &msg, Http::Method method) const;\r\n        virtual bool hasResponseError(const std::shared_ptr<HttpResponse>&response)  const;\r\n        OssOutcome MakeRequest(const OssRequest &request, Http::Method method) const;\r\n\r\n    private:\r\n        void addHeaders(const std::shared_ptr<HttpRequest> &httpRequest, const HeaderCollection &headers) const;\r\n        void addBody(const std::shared_ptr<HttpRequest> &httpRequest, const std::shared_ptr<std::iostream>& body, bool contentMd5 = false) const;\r\n        void addSignInfo(const std::shared_ptr<HttpRequest> &httpRequest, const ServiceRequest &request) const;\r\n        void addUrl(const std::shared_ptr<HttpRequest> &httpRequest, const std::string &endpoint, const ServiceRequest &request) const;\r\n        void addOther(const std::shared_ptr<HttpRequest> &httpRequest, const ServiceRequest &request) const;\r\n\r\n        OssError buildError(const Error &error) const;\r\n        ServiceResult buildResult(const OssRequest &request, const std::shared_ptr<HttpResponse> &httpResponse) const;\r\n\r\n    private:\r\n        std::string endpoint_;\r\n        std::shared_ptr<CredentialsProvider> credentialsProvider_;\r\n        std::shared_ptr<Signer> signer_;\r\n        std::shared_ptr<Executor> executor_;\r\n        bool isValidEndpoint_;\r\n        std::string region_;\r\n        std::string cloudboxId_;\r\n    };\r\n}\r\n}\r\n#endif // !ALIBABACLOUD_OSS_OSSCLIENTIMPL_H_\r\n"
  },
  {
    "path": "sdk/src/OssRequest.cc",
    "content": "/*\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n*      http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n#include <alibabacloud/oss/OssRequest.h>\n#include <alibabacloud/oss/Const.h>\r\n#include <sstream>\n#include \"http/HttpType.h\"\n#include \"utils/Utils.h\"\n#include \"model/ModelError.h\"\n#include \"utils/FileSystemUtils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\n OssRequest:: OssRequest():\n    ServiceRequest(),\n    bucket_(),\n    key_()\n{\n}\n\nOssRequest:: OssRequest(const std::string &bucket, const std::string &key):\n    ServiceRequest(),\n    bucket_(bucket),\n    key_(key)\n{\n}\n\n\nHeaderCollection OssRequest::Headers() const\n{\n    auto headers = specialHeaders();\n\n    if(headers.size() == 0 || (headers.size() > 0 && headers.count(Http::CONTENT_TYPE) == 0))\n    {\n        headers[Http::CONTENT_TYPE] = \"application/xml\";\n    }\n\n    return headers;\n}\n\nParameterCollection OssRequest::Parameters() const\n{\n    return  specialParameters();\n}\n\nstd::shared_ptr<std::iostream> OssRequest::Body() const\n{\n    std::string&& p = payload();\n    std::shared_ptr<std::iostream> payloadBody;\n    if (!p.empty())\n    {\n      payloadBody = std::make_shared<std::stringstream>();\n      *payloadBody << p;\n    }\n    return payloadBody;\n}\n\nint OssRequest::validate() const \n{ \n    return 0; \n}\n\nconst char * OssRequest::validateMessage(int code) const\n{\n    return GetModelErrorMsg(code);\n}\n\nstd::string OssRequest::payload() const\n{\n    return \"\";\n}\n\nHeaderCollection OssRequest::specialHeaders() const\n{\n    return HeaderCollection();\n}\n\nParameterCollection OssRequest::specialParameters() const\n{\n    return ParameterCollection();\n}\n\nconst std::string& OssRequest::bucket() const \n{ \n    return bucket_; \n}\n\nconst std::string& OssRequest::key()  const \n{ \n    return key_; \n}\n\nint OssBucketRequest::validate() const\n{\n    if (!IsValidBucketName(Bucket())) {\n        return ARG_ERROR_BUCKET_NAME;\n    }\n    return 0; \n}\n\nvoid OssBucketRequest::setBucket(const std::string &bucket) \n{ \n    bucket_ = bucket;\n}\n\nconst std::string& OssBucketRequest::Bucket() const\n{ \n    return OssRequest::bucket(); \n}\n\nint OssObjectRequest::validate() const\n{\n    if (!IsValidBucketName(Bucket())) {\n        return ARG_ERROR_BUCKET_NAME;\n    }\n\n    if (!IsValidObjectKey(Key())) {\n        return ARG_ERROR_OBJECT_NAME;\n    }\n\n    return 0;\n}\n\nvoid OssObjectRequest::setBucket(const std::string &bucket)\n{\n    bucket_ = bucket;\n}\n\nconst std::string& OssObjectRequest::Bucket() const\n{\n    return OssRequest::bucket();\n}\n\nvoid OssObjectRequest::setKey(const std::string &key)\n{\n    key_ = key;\n}\n\nconst std::string& OssObjectRequest::Key() const\n{\n    return OssRequest::key();\n}\n\n\nvoid OssObjectRequest::setRequestPayer(AlibabaCloud::OSS::RequestPayer key)\n{\n    requestPayer_ = key;\n}\n\nAlibabaCloud::OSS::RequestPayer OssObjectRequest::RequestPayer() const\n{\n    return requestPayer_;\n}\n\nvoid OssObjectRequest::setVersionId(const std::string& versionId)\n{\n    versionId_ = versionId;\n}\n\nconst std::string& OssObjectRequest::VersionId() const\n{\n    return versionId_;\n}\n\nHeaderCollection OssObjectRequest::specialHeaders() const\n{\n    auto headers = OssRequest::specialHeaders();\n    if (requestPayer_ == AlibabaCloud::OSS::RequestPayer::Requester) {\n        headers[\"x-oss-request-payer\"] = ToLower(ToRequestPayerName(AlibabaCloud::OSS::RequestPayer::Requester));\n    }\n    return headers;\n}\n\nParameterCollection OssObjectRequest::specialParameters() const\n{\n    auto parameters = OssRequest::specialParameters();\n    if (!versionId_.empty()) {\n        parameters[\"versionId\"] = versionId_;\n    }\n    return parameters;\n}\n\nint OssResumableBaseRequest::validate() const\n{\n    if (!IsValidBucketName(Bucket())) {\n        return ARG_ERROR_BUCKET_NAME;\n    }\n\n    if (!IsValidObjectKey(Key())) {\n        return ARG_ERROR_OBJECT_NAME;\n    }\n\n    if (partSize_ < PartSizeLowerLimit) {\r\n        return ARG_ERROR_CHECK_PART_SIZE_LOWER;\r\n    }\r\n\r\n    if (threadNum_ <= 0) {\r\n        return ARG_ERROR_CHECK_THREAD_NUM_LOWER;\r\n    }\n\r\n#if !defined(_WIN32)\r\n    if (!checkpointDirW_.empty()) {\r\n        return ARG_ERROR_PATH_NOT_SUPPORT_WSTRING_TYPE;\r\n    }\r\n#endif\r\n\n    // if directory do not exist, return error\r\n    if (hasCheckpointDir()) {\r\n        if ((!checkpointDir_.empty() && !IsDirectoryExist(checkpointDir_))\r\n#ifdef _WIN32\r\n            || (!checkpointDirW_.empty() && !IsDirectoryExist(checkpointDirW_))\r\n#endif\r\n            ) {\r\n            return ARG_ERROR_CHECK_POINT_DIR_NONEXIST;\r\n        }\r\n    }\n\n    return 0;\n}\n\nconst char *OssResumableBaseRequest::validateMessage(int code) const\n{\n    return GetModelErrorMsg(code);\n}\n\nvoid OssResumableBaseRequest::setBucket(const std::string &bucket)\n{\n    bucket_ = bucket;\n}\n\nconst std::string& OssResumableBaseRequest::Bucket() const\n{\n    return OssRequest::bucket();\n}\n\nvoid OssResumableBaseRequest::setKey(const std::string &key)\n{\n    key_ = key;\n}\n\nconst std::string& OssResumableBaseRequest::Key() const\n{\n    return OssRequest::key();\n}\n\nvoid OssResumableBaseRequest::setPartSize(uint64_t partSize)\n{\n    partSize_ = partSize;\n}\n\nuint64_t OssResumableBaseRequest::PartSize() const\n{\n    return partSize_;\n}\n\nvoid OssResumableBaseRequest::setObjectSize(uint64_t objectSize)\n{\n    objectSize_ = objectSize;\n}\n\nuint64_t OssResumableBaseRequest::ObjectSize() const\n{\n    return objectSize_;\n}\n\nvoid OssResumableBaseRequest::setThreadNum(uint32_t threadNum)\n{\n    threadNum_ = threadNum;\n}\n\nuint32_t OssResumableBaseRequest::ThreadNum() const\n{\n    return threadNum_;\n}\n\nvoid OssResumableBaseRequest::setCheckpointDir(const std::string &checkpointDir)\n{\n    checkpointDir_ = checkpointDir;\n    checkpointDirW_.clear();\n}\n\nconst std::string& OssResumableBaseRequest::CheckpointDir() const\n{\n    return checkpointDir_;\n}\n\nvoid OssResumableBaseRequest::setCheckpointDir(const std::wstring& checkpointDir)\n{\n    checkpointDirW_ = checkpointDir;\n    checkpointDir_.clear();\n}\n\nconst std::wstring& OssResumableBaseRequest::CheckpointDirW() const\n{\n    return checkpointDirW_;\n}\n\nvoid OssResumableBaseRequest::setObjectMtime(const std::string &mtime)\n{\n    mtime_ = mtime;\n}\n\nconst std::string& OssResumableBaseRequest::ObjectMtime() const\n{\n    return mtime_;\n}\n\nvoid OssResumableBaseRequest::setRequestPayer(AlibabaCloud::OSS::RequestPayer value)\n{\n    requestPayer_ = value;\n}\n\nAlibabaCloud::OSS::RequestPayer OssResumableBaseRequest::RequestPayer() const\n{\n    return requestPayer_;\n}\n\nvoid OssResumableBaseRequest::setTrafficLimit(uint64_t value)\n{\n    trafficLimit_ = value;\n}\n\nuint64_t OssResumableBaseRequest::TrafficLimit() const\n{\n    return trafficLimit_;\n}\n\nvoid OssResumableBaseRequest::setVersionId(const std::string& versionId)\n{\n    versionId_ = versionId;\n}\n\nconst std::string& OssResumableBaseRequest::VersionId() const\n{\n    return versionId_;\n}\n\nbool OssResumableBaseRequest::hasCheckpointDir() const\n{\n    return (!checkpointDir_.empty() || !checkpointDirW_.empty());\n}\n\nvoid LiveChannelRequest::setBucket(const std::string &bucket)\n{\n    bucket_ = bucket;\n}\n\nconst std::string& LiveChannelRequest::Bucket() const\n{\n    return bucket_;\n}\n\nvoid LiveChannelRequest::setChannelName(const std::string &channelName)\n{\n    channelName_ = channelName;\n    key_ = channelName;\n}\n\nconst std::string& LiveChannelRequest::ChannelName() const\n{\n    return channelName_;\n}\n\nint LiveChannelRequest::validate() const\n{\n    if (!IsValidBucketName(Bucket())) {\n        return ARG_ERROR_BUCKET_NAME;\n    }\n\n    if(!IsValidChannelName(channelName_))\n    {\n        return ARG_ERROR_LIVECHANNEL_BAD_CHANNELNAME_PARAM;\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "sdk/src/OssResponse.cc",
    "content": "/*\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n*      http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n#include <alibabacloud/oss/OssResponse.h>\n\nusing namespace AlibabaCloud::OSS;\n\nOssResponse::OssResponse() :\n    payload_()\n{\n}\n\nOssResponse::OssResponse(const std::string &payload) :\n    payload_(payload)\n{\n}\n\nOssResponse::~OssResponse()\n{\n}\n\nstd::string OssResponse::payload() const\n{\n    return payload_;\n}\n"
  },
  {
    "path": "sdk/src/OssResult.cc",
    "content": "/*\r\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n*\r\n* Licensed under the Apache License, Version 2.0 (the \"License\");\r\n* you may not use this file except in compliance with the License.\r\n* You may obtain a copy of the License at\r\n*\r\n*      http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing, software\r\n* distributed under the License is distributed on an \"AS IS\" BASIS,\r\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n* See the License for the specific language governing permissions and\r\n* limitations under the License.\r\n*/\r\n\r\n#include <alibabacloud/oss/OssResult.h>\r\n#include <sstream>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nOssResult::OssResult() :\r\n    parseDone_(false) \r\n{\r\n}\r\n\r\nOssResult::OssResult(const HeaderCollection& header):\r\n    OssResult()\r\n{\r\n    if (header.find(\"x-oss-request-id\") != header.end()) {\r\n        requestId_ = header.at(\"x-oss-request-id\");\r\n    }\r\n}\r\n\r\nOssObjectResult::OssObjectResult() :\r\n    OssResult()\r\n{\r\n}\r\n\r\nOssObjectResult::OssObjectResult(const HeaderCollection& header) :\r\n    OssResult(header)\r\n{\r\n    if (header.find(\"x-oss-version-id\") != header.end()) {\r\n        versionId_ = header.at(\"x-oss-version-id\");\r\n    }\r\n}\r\n"
  },
  {
    "path": "sdk/src/ServiceRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/ServiceRequest.h>\n#include <sstream>\n\nusing namespace AlibabaCloud::OSS;\n\nServiceRequest::ServiceRequest() :\n    flags_(0),\n    path_(\"/\"),\n    responseStreamFactory_([] { return std::make_shared<std::stringstream>(); })\n{\n    transferProgress_.Handler = nullptr;\n    transferProgress_.UserData = nullptr;\n}\n\nstd::string ServiceRequest::Path() const\n{\n    return path_;\n}\n\nint ServiceRequest::Flags() const \n{ \n    return flags_; \n}\n\nconst IOStreamFactory& ServiceRequest::ResponseStreamFactory() const \n{ \n    return responseStreamFactory_; \n}\n\nvoid ServiceRequest::setResponseStreamFactory(const IOStreamFactory& factory) \n{\n    responseStreamFactory_ = factory; \n}\n\nconst AlibabaCloud::OSS::TransferProgress & ServiceRequest::TransferProgress() const \n{\n    return transferProgress_; \n}\n\nvoid ServiceRequest::setTransferProgress(const AlibabaCloud::OSS::TransferProgress &arg) \n{ \n    transferProgress_ = arg; \n}\n\nvoid ServiceRequest::setPath(const std::string & path)\n{\n    path_ = path;\n}\n\nvoid ServiceRequest::setFlags(int flags)\n{\n    flags_ = flags;\n}\n"
  },
  {
    "path": "sdk/src/auth/Credentials.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/auth/Credentials.h>\n\nusing namespace AlibabaCloud::OSS;\n\nCredentials::Credentials(const std::string &accessKeyId,\n        const std::string &accessKeySecret,\n        const std::string &sessionToken) :\n    accessKeyId_(accessKeyId),\n    accessKeySecret_(accessKeySecret),\n    sessionToken_(sessionToken)\n{\n}\n\nCredentials::~Credentials()\n{\n}\n\nconst std::string& Credentials::AccessKeyId () const\n{\n    return accessKeyId_;\n}\n\nconst std::string& Credentials::AccessKeySecret () const\n{\n    return accessKeySecret_;\n}\n\nconst std::string& Credentials::SessionToken () const\n{\n    return sessionToken_;\n}\n\nvoid Credentials::setAccessKeyId(const std::string &accessKeyId)\n{\n    accessKeyId_ = accessKeyId;\n}\n\nvoid Credentials::setAccessKeySecret(const std::string &accessKeySecret)\n{\n    accessKeySecret_ = accessKeySecret;\n}\n\nvoid Credentials::setSessionToken (const std::string &sessionToken)\n{\n    sessionToken_ = sessionToken;\n}\n\n"
  },
  {
    "path": "sdk/src/auth/CredentialsProvider.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/auth/CredentialsProvider.h>\n\nusing namespace AlibabaCloud::OSS;\n\nCredentialsProvider::~CredentialsProvider()\n{\n}\n\nCredentials EnvironmentVariableCredentialsProvider::getCredentials()\n{\n    auto value = std::getenv(\"OSS_ACCESS_KEY_ID\");\n    Credentials credentials(\"\", \"\");\n\n    if (value)\n    {\n        credentials.setAccessKeyId(value);\n\n        value = std::getenv(\"OSS_ACCESS_KEY_SECRET\");\n\n        if (value)\n        {\n            credentials.setAccessKeySecret(value);\n        }\n\n        value = std::getenv(\"OSS_SESSION_TOKEN\");\n\n        if (value)\n        {\n            credentials.setSessionToken(value);\n        }\n    }\n\n    return credentials;\n}\n\n"
  },
  {
    "path": "sdk/src/auth/SimpleCredentialsProvider.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/auth/CredentialsProvider.h>\n\nusing namespace AlibabaCloud::OSS;\n\nSimpleCredentialsProvider::SimpleCredentialsProvider(const Credentials &credentials):\n    CredentialsProvider(),\n    credentials_(credentials)\n{\n}\n\nSimpleCredentialsProvider::SimpleCredentialsProvider(const std::string & accessKeyId, \n    const std::string & accessKeySecret,\n    const std::string &securityToken) :\n    CredentialsProvider(),\n    credentials_(accessKeyId, accessKeySecret, securityToken)\n{\n}\n\nSimpleCredentialsProvider::~SimpleCredentialsProvider()\n{\n}\n\nCredentials SimpleCredentialsProvider::getCredentials()\n{\n    return credentials_;\n}\n"
  },
  {
    "path": "sdk/src/client/AsyncCallerContext.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/client/AsyncCallerContext.h>\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nAsyncCallerContext::AsyncCallerContext() :\n    uuid_(GenerateUuid())\n{\n}\n\nAsyncCallerContext::AsyncCallerContext(const std::string &uuid) :\n    uuid_(uuid)\n{\n}\n\nAsyncCallerContext::~AsyncCallerContext()\n{\n}\n\nconst std::string &AsyncCallerContext::Uuid()const\n{\n    return uuid_;\n}\n\nvoid AsyncCallerContext::setUuid(const std::string &uuid)\n{\n    uuid_ = uuid;\n}\n"
  },
  {
    "path": "sdk/src/client/Client.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/client/RetryStrategy.h>\n#include <alibabacloud/oss/utils/Executor.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"Client.h\"\n#include \"../http/CurlHttpClient.h\"\n#include \"../utils/Utils.h\"\n#include \"../signer/Signer.h\"\n#include <sstream>\n#include <ctime>\n\n\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nClient::Client(const std::string & servicename, const ClientConfiguration &configuration) :\n    requestDateOffset_(0),\n    serviceName_(servicename),\n    configuration_(configuration),\n    httpClient_(configuration.httpClient? configuration.httpClient:std::make_shared<CurlHttpClient>(configuration))\n{\n}\n\nClient::~Client()\n{\n}\n\nconst ClientConfiguration& Client::configuration()const\n{\n    return configuration_;\n}\n\nstd::string Client::serviceName()const\n{\n    return serviceName_;\n}\n\nClient::ClientOutcome Client::AttemptRequest(const std::string & endpoint, const ServiceRequest & request, Http::Method method) const\n{\n    for (int retry =0; ;retry++) {\n        auto outcome = AttemptOnceRequest(endpoint, request, method);\n        if (outcome.isSuccess()) {\n            return outcome;\n        } \n        else if (!httpClient_->isEnable()) {\n            return outcome;\n        }\n        else {\n            if (configuration_.enableDateSkewAdjustment &&\n                outcome.error().Status() == 403 &&\n                outcome.error().Message().find(\"RequestTimeTooSkewed\")) {\n                auto serverTimeStr = analyzeServerTime(outcome.error().Message());\n                auto serverTime = UtcToUnixTime(serverTimeStr);\n                if (serverTime != -1) {\n                    std::time_t localTime = std::time(nullptr);\n                    setRequestDateOffset(serverTime - localTime);\n                }\n            }\n            RetryStrategy *retryStrategy = configuration().retryStrategy.get();\n            if (retryStrategy == nullptr || !retryStrategy->shouldRetry(outcome.error(), retry)) {\n                return outcome;\n            }\n            long sleepTmeMs = retryStrategy->calcDelayTimeMs(outcome.error(), retry);\n            httpClient_->waitForRetry(sleepTmeMs);\n        }\n    }\n}\n\nClient::ClientOutcome Client::AttemptOnceRequest(const std::string & endpoint, const ServiceRequest & request, Http::Method method) const\n{\n    if (!httpClient_->isEnable()) {\n        return ClientOutcome(Error(\"ClientError:100002\", \"Disable all requests by upper.\"));\n    }\n\n    auto r = buildHttpRequest(endpoint, request, method);\n    auto response = httpClient_->makeRequest(r); \n    \n    if(hasResponseError(response)) {\n        return ClientOutcome(buildError(response));\n    } else {\n        return ClientOutcome(response);\n    }\n}\n\nstd::string Client::analyzeServerTime(const std::string &message) const\n{\n    XMLDocument doc;\n    if (doc.Parse(message.c_str(), message.size()) == XML_SUCCESS) {\n        XMLElement* root = doc.RootElement();\n        if (root && !std::strncmp(\"Error\", root->Name(), 5)) {\n            XMLElement *node;\n            node = root->FirstChildElement(\"ServerTime\");\n            return (node ? node->GetText() : \"\");\n        }\n    }\n    return \"\";\n}\n\nError Client::buildError(const std::shared_ptr<HttpResponse> &response) const\n{\n    Error error;\n    if (response == nullptr) {\n        error.setCode(\"NullptrError\");\n        error.setMessage(\"HttpResponse is nullptr, should not be here.\");\n        return error;\n    }\n    \n    long responseCode = response->statusCode();\n    error.setStatus(responseCode);\n    std::stringstream ss;\n    if ((responseCode == 203) || \n        (responseCode > 299 && responseCode < 600)) {\n        ss << \"ServerError:\" << responseCode;\n        error.setCode(ss.str());\n        if (response->Body() != nullptr) {\n            std::istreambuf_iterator<char> isb(*response->Body().get()), end;\n            error.setMessage(std::string(isb, end));\n        }\n        // get error xml from header\n        if (error.Message().empty() && response->hasHeader(\"x-oss-err\")) {\n            auto errstr = Base64Decode(response->Header(\"x-oss-err\"));\n            error.setMessage(std::string(errstr.begin(), errstr.end()));\n        }\n    } else {\n        ss << \"ClientError:\" << responseCode;\n        error.setCode(ss.str());\n        error.setMessage(response->statusMsg());\n    }\n    error.setHeaders(response->Headers());\n    return error;\n}\n\nbool Client::hasResponseError(const std::shared_ptr<HttpResponse>&response)const\n{\n    if (!response) {\n        return true;\n    }\n    return (response->statusCode()/100 != 2);\n}\n\nvoid Client::disableRequest()\n{\n    httpClient_->disable();\n}\n\nvoid Client::enableRequest()\n{\n    httpClient_->enable();\n}\n\nbool Client::isEnableRequest() const\n{\n    return httpClient_->isEnable();\n}\n   \nvoid Client::setRequestDateOffset(uint64_t offset) const\n{\n    requestDateOffset_ = offset;\n}\n\nuint64_t Client::getRequestDateOffset() const\n{\n    return requestDateOffset_;\n}"
  },
  {
    "path": "sdk/src/client/Client.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n#include <functional>\r\n#include <memory>\r\n#include <alibabacloud/oss/ServiceRequest.h>\r\n#include <alibabacloud/oss/ServiceResult.h>\r\n#include <alibabacloud/oss/client/ClientConfiguration.h>\r\n#include <alibabacloud/oss/client/Error.h>\r\n#include <alibabacloud/oss/utils/Outcome.h>\r\n#include <alibabacloud/oss/http/HttpClient.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n\r\n    class  Client\r\n    {\r\n    public:\r\n        using ClientOutcome =  Outcome<Error, std::shared_ptr<HttpResponse>> ;\r\n\r\n        Client(const std::string & servicename, const ClientConfiguration &configuration);\r\n        virtual ~Client();\r\n\r\n        std::string serviceName()const;\r\n        const ClientConfiguration &configuration()const;\r\n\r\n        bool isEnableRequest() const;\r\n\r\n    protected:\r\n        ClientOutcome AttemptRequest(const std::string & endpoint, const ServiceRequest &request, Http::Method method) const;\r\n        ClientOutcome AttemptOnceRequest(const std::string & endpoint, const ServiceRequest &request, Http::Method method) const;\r\n        virtual std::shared_ptr<HttpRequest> buildHttpRequest(const std::string & endpoint, const ServiceRequest &msg, Http::Method method) const = 0;\r\n        virtual bool hasResponseError(const std::shared_ptr<HttpResponse>&response) const;\r\n        \r\n        void setRequestDateOffset(uint64_t offset) const;\r\n        uint64_t getRequestDateOffset() const;\r\n\r\n        void disableRequest();\r\n        void enableRequest();\r\n    private:\r\n        Error buildError(const std::shared_ptr<HttpResponse> &response) const ;\r\n        std::string analyzeServerTime(const std::string &message) const;\r\n\r\n        mutable uint64_t requestDateOffset_;\r\n        std::string serviceName_;\r\n        ClientConfiguration configuration_;\r\n        std::shared_ptr<HttpClient> httpClient_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/src/client/ClientConfiguration.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/Config.h>\r\n#include <alibabacloud/oss/client/ClientConfiguration.h>\r\n#include <alibabacloud/oss/client/RetryStrategy.h>\r\n#include <sstream>\r\n#include \"../utils/Utils.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\n//default for configuration begin\r\n#if defined(PLATFORM_WINDOWS)\r\nstatic const char* PLATFORM_NAME = \"Windows\";\r\n#elif defined(PLATFORM_LINUX)\r\nstatic const char* PLATFORM_NAME = \"Linux\";\r\n#elif defined(PLATFORM_APPLE)\r\nstatic const char* PLATFORM_NAME = \"MacOS\";\r\n#elif defined(PLATFORM_ANDROID)\r\nstatic const char* PLATFORM_NAME = \"Android\";\r\n#else\r\nstatic const char* PLATFORM_NAME = \"Unknown\";\r\n#endif\r\nstatic std::string DefaultUserAgent()\r\n{\r\n  std::stringstream ss;\r\n  ss << \"aliyun-sdk-cpp/\" << ALIBABACLOUD_OSS_VERSION_STR << \" (\" << PLATFORM_NAME << \")\";\r\n  return ss.str();\r\n}\r\n\r\nclass DefaultRetryStrategy : public RetryStrategy\r\n{\r\npublic:\r\n\r\n    DefaultRetryStrategy(long maxRetries = 3, long scaleFactor = 300) :\r\n        m_scaleFactor(scaleFactor), m_maxRetries(maxRetries)  \r\n    {}\r\n\r\n    bool shouldRetry(const Error & error, long attemptedRetries) const;\r\n\r\n    long calcDelayTimeMs(const Error & error, long attemptedRetries) const;\r\n\r\nprivate:\r\n    long m_scaleFactor;\r\n    long m_maxRetries;\r\n};\r\n\r\nbool DefaultRetryStrategy::shouldRetry(const Error & error, long attemptedRetries) const\r\n{    \r\n    if (attemptedRetries >= m_maxRetries)\r\n        return false;\r\n\r\n    long responseCode = error.Status();\r\n\r\n    //http code\r\n    if ((responseCode == 403 && error.Message().find(\"RequestTimeTooSkewed\") != std::string::npos) ||\r\n        (responseCode > 499 && responseCode < 599)) {\r\n        return true;\r\n    }\r\n    else {\r\n        switch (responseCode)\r\n        {\r\n        //curl error code\r\n        case (ERROR_CURL_BASE + 7):  //CURLE_COULDNT_CONNECT\r\n        case (ERROR_CURL_BASE + 18): //CURLE_PARTIAL_FILE\r\n        case (ERROR_CURL_BASE + 23): //CURLE_WRITE_ERROR\r\n        case (ERROR_CURL_BASE + 28): //CURLE_OPERATION_TIMEDOUT\r\n        case (ERROR_CURL_BASE + 52): //CURLE_GOT_NOTHING\r\n        case (ERROR_CURL_BASE + 55): //CURLE_SEND_ERROR\r\n        case (ERROR_CURL_BASE + 56): //CURLE_RECV_ERROR\r\n        case (ERROR_CURL_BASE + 65): //CURLE_SEND_FAIL_REWIND\r\n            return true;\r\n        default:\r\n            break;\r\n        };\r\n    }\r\n\r\n    return false;\r\n}\r\n\r\nlong DefaultRetryStrategy::calcDelayTimeMs(const Error & error, long attemptedRetries) const\r\n{\r\n    UNUSED_PARAM(error);\r\n    return (1 << attemptedRetries) * m_scaleFactor;\r\n}\r\n\r\n//default for configuration end\r\n\r\nClientConfiguration::ClientConfiguration() : \r\n    userAgent(DefaultUserAgent()), \r\n    scheme(Http::Scheme::HTTP), \r\n    maxConnections(16), \r\n    requestTimeoutMs(10000), \r\n    connectTimeoutMs(5000),\r\n    retryStrategy(std::make_shared<DefaultRetryStrategy>()),\r\n    proxyScheme(Http::Scheme::HTTP),\r\n    proxyPort(0),\r\n    verifySSL(true),\r\n    isCname(false),\r\n    enableCrc64(true),\r\n    enableDateSkewAdjustment(true),\r\n    sendRateLimiter(nullptr),\r\n    recvRateLimiter(nullptr),\r\n    executor(nullptr),\r\n    httpClient(nullptr),\r\n    isPathStyle(false),\r\n    isVerifyObjectStrict(true),\r\n    signatureVersion(SignatureVersionType::V1),\r\n    httpInterceptor(nullptr)\r\n{\r\n\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/encryption/Cipher.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include \"CipherOpenssl.h\"\r\n#include <openssl/rand.h>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\ninline static std::string toAlgorithmName(CipherAlgorithm algo)\r\n{\r\n    static const char* name[] = { \"AES\", \"RSA\"};\r\n    return name[static_cast<int>(algo) - static_cast<int>(CipherAlgorithm::AES)];\r\n}\r\n\r\ninline static std::string toModeName(CipherMode mode)\r\n{\r\n    static const char* name[] = { \"NONE\", \"ECB\", \"CBC\", \"CTR\"};\r\n    return name[static_cast<int>(mode) - static_cast<int>(CipherMode::NONE)];\r\n}\r\n\r\ninline static std::string toPaddingName(CipherPadding pad)\r\n{\r\n    static const char* name[] = { \"NoPadding\", \"PKCS1Padding\", \"PKCS5Padding\", \"PKCS7Padding\", \"ZeroPadding\"};\r\n    return name[static_cast<int>(pad) - static_cast<int>(CipherPadding::NoPadding)];\r\n}\r\n\r\nSymmetricCipher::SymmetricCipher(const std::string& impl, CipherAlgorithm algo, CipherMode mode, CipherPadding pad):\r\n    impl_(impl),\r\n    algorithm_(algo),\r\n    mode_(mode),\r\n    padding_(pad),\r\n    blockSize_(16)\r\n{\r\n    name_ = toAlgorithmName(algo);\r\n    name_.append(\"/\");\r\n    name_.append(toModeName(mode));\r\n    name_.append(\"/\");\r\n    name_.append(toPaddingName(pad));\r\n}\r\n\r\nByteBuffer SymmetricCipher::GenerateIV(size_t length)\r\n{\r\n    //use openssl rand func\r\n    ByteBuffer out = ByteBuffer(length);\r\n    RAND_bytes((unsigned char *)out.data(), static_cast<int>(length));\r\n    return out;\r\n}\r\n\r\nByteBuffer SymmetricCipher::GenerateKey(size_t length)\r\n{\r\n    //use openssl rand func\r\n    ByteBuffer out = ByteBuffer(length);\r\n    RAND_bytes((unsigned char *)out.data(), static_cast<int>(length));\r\n    return out;\r\n}\r\n\r\ntemplate<class T>\r\ntypename std::enable_if<std::is_unsigned<T>::value, T>::type\r\nbswap(T i, T j = 0u, std::size_t n = 0u)\r\n{\r\n    return n == sizeof(T) ? j :\r\n        bswap<T>(i >> CHAR_BIT, (j << CHAR_BIT) | (i & (T)(unsigned char)(-1)), n + 1);\r\n}\r\n\r\nByteBuffer SymmetricCipher::IncCTRCounter(const ByteBuffer& counter, uint64_t numberOfBlocks)\r\n{\r\n    ByteBuffer ctrCounter(counter);\r\n    uint64_t *ctrPtr = (uint64_t*)(ctrCounter.data() + ctrCounter.size() - sizeof(uint64_t));\r\n\r\n    uint64_t n = 1;\r\n    if (*(char *)&n) {\r\n        //little\r\n        *ctrPtr = bswap<uint64_t>(bswap<uint64_t>(*ctrPtr) + numberOfBlocks);\r\n    }\r\n    else {\r\n        //big\r\n        *ctrPtr += numberOfBlocks;\r\n    }\r\n\r\n    return ctrCounter;\r\n}\r\n\r\nstd::shared_ptr<SymmetricCipher> SymmetricCipher::CreateAES128_CTRImpl()\r\n{\r\n    return std::make_shared<SymmetricCipherOpenssl>(EVP_aes_128_ctr(), \r\n        CipherAlgorithm::AES, CipherMode::CTR, CipherPadding::NoPadding);\r\n}\r\n\r\nstd::shared_ptr<SymmetricCipher> SymmetricCipher::CreateAES128_CBCImpl()\r\n{\r\n    return std::make_shared<SymmetricCipherOpenssl>(EVP_aes_128_cbc(), \r\n        CipherAlgorithm::AES, CipherMode::CBC, CipherPadding::PKCS5Padding);\r\n}\r\n\r\nstd::shared_ptr<SymmetricCipher> SymmetricCipher::CreateAES256_CTRImpl()\r\n{\r\n    return std::make_shared<SymmetricCipherOpenssl>(EVP_aes_256_ctr(),\r\n        CipherAlgorithm::AES, CipherMode::CTR, CipherPadding::NoPadding);\r\n}\r\n\r\n\r\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\r\nAsymmetricCipher::AsymmetricCipher(const std::string& impl, CipherAlgorithm algo, CipherMode mode, CipherPadding pad) :\r\n    impl_(impl),\r\n    algorithm_(algo),\r\n    mode_(mode),\r\n    padding_(pad)\r\n{\r\n    name_ = toAlgorithmName(algo);\r\n    name_.append(\"/\");\r\n    name_.append(toModeName(mode));\r\n    name_.append(\"/\");\r\n    name_.append(toPaddingName(pad));\r\n}\r\n\r\nstd::shared_ptr<AsymmetricCipher> AsymmetricCipher::CreateRSA_NONEImpl()\r\n{\r\n    return std::make_shared<AsymmetricCipherOpenssl>(CipherAlgorithm::RSA, CipherMode::NONE, CipherPadding::PKCS1Padding);\r\n}\r\n\r\n\r\n\r\n"
  },
  {
    "path": "sdk/src/encryption/CipherOpenssl.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include \"CipherOpenssl.h\"\r\n#include <openssl/evp.h>\r\n#include <openssl/rand.h>\r\n#include <openssl/engine.h>\r\n#include <openssl/rsa.h>\r\n#include <openssl/pem.h>\r\n#include <cstring>\r\n#if defined(OPENSSL_API_LEVEL) && OPENSSL_API_LEVEL >= 30000\r\n#include <openssl/decoder.h>\r\n#endif\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nSymmetricCipherOpenssl::SymmetricCipherOpenssl(const EVP_CIPHER* cipher, CipherAlgorithm algo, CipherMode mode, CipherPadding pad):\r\n    SymmetricCipher(\"openssl-impl\", algo, mode, pad),\r\n    encryptCtx_(nullptr),\r\n    decryptCtx_(nullptr),\r\n    cipher_(cipher)\r\n{\r\n    blockSize_  = EVP_CIPHER_block_size(cipher_);\r\n}\r\n\r\nSymmetricCipherOpenssl::~SymmetricCipherOpenssl()\r\n{\r\n    if (encryptCtx_) {\r\n        EVP_CIPHER_CTX_cleanup(encryptCtx_);\r\n        EVP_CIPHER_CTX_free(encryptCtx_);\r\n        encryptCtx_ = nullptr;\r\n    }\r\n\r\n    if (decryptCtx_) {\r\n        EVP_CIPHER_CTX_cleanup(decryptCtx_);\r\n        EVP_CIPHER_CTX_free(decryptCtx_);\r\n        decryptCtx_ = nullptr;\r\n    }\r\n}\r\n\r\nvoid SymmetricCipherOpenssl::EncryptInit(const ByteBuffer& key, const ByteBuffer& iv)\r\n{\r\n    if (!encryptCtx_) {\r\n        encryptCtx_ = EVP_CIPHER_CTX_new();\r\n    }\r\n\r\n    EVP_EncryptInit_ex(encryptCtx_, cipher_, nullptr, key.data(), iv.data());\r\n}\r\n\r\nByteBuffer SymmetricCipherOpenssl::Encrypt(const ByteBuffer& data)\r\n{\r\n    if (data.empty()) {\r\n        return ByteBuffer();\r\n    }\r\n\r\n    int outlen = static_cast<int>(data.size() + EVP_MAX_BLOCK_LENGTH);\r\n    ByteBuffer out(static_cast<size_t>(outlen));\r\n\r\n    if (!EVP_EncryptUpdate(encryptCtx_, out.data(), &outlen, data.data(), static_cast<int>(data.size()))) {\r\n        return ByteBuffer();\r\n    }\r\n    out.resize(outlen);\r\n    return out;\r\n}\r\n\r\nint SymmetricCipherOpenssl::Encrypt(unsigned char* dst, int dstLen, const unsigned char* src, int srcLen)\r\n{\r\n    if (!dst || !src) {\r\n        return -1;\r\n    }\r\n\r\n    if (!EVP_EncryptUpdate(encryptCtx_, dst, &dstLen, src, srcLen)) {\r\n        return -1;\r\n    }\r\n\r\n    return dstLen;\r\n}\r\n\r\n\r\nByteBuffer SymmetricCipherOpenssl::EncryptFinish()\r\n{\r\n    ByteBuffer out(EVP_MAX_BLOCK_LENGTH);\r\n    int outlen = 0;\r\n    if (!EVP_EncryptFinal_ex(encryptCtx_, out.data(), &outlen)) {\r\n        return ByteBuffer();\r\n    }\r\n    out.resize(static_cast<size_t>(outlen));\r\n    return out;\r\n}\r\n\r\nvoid SymmetricCipherOpenssl::DecryptInit(const ByteBuffer& key, const ByteBuffer& iv)\r\n{\r\n    if (!decryptCtx_) {\r\n        decryptCtx_ = EVP_CIPHER_CTX_new();\r\n    }\r\n\r\n    EVP_DecryptInit_ex(decryptCtx_, cipher_, nullptr, key.data(), iv.data());\r\n}\r\n\r\nByteBuffer SymmetricCipherOpenssl::Decrypt(const ByteBuffer& data)\r\n{\r\n    if (data.empty()) {\r\n        return ByteBuffer();\r\n    }\r\n\r\n    int outlen = static_cast<int>(data.size() + EVP_MAX_BLOCK_LENGTH);\r\n    ByteBuffer out(static_cast<size_t>(outlen));\r\n\r\n    if (!EVP_DecryptUpdate(decryptCtx_, out.data(), &outlen, data.data(), static_cast<int>(data.size()))) {\r\n        return ByteBuffer();\r\n    }\r\n    out.resize(outlen);\r\n    return out;\r\n}\r\n\r\nint SymmetricCipherOpenssl::Decrypt(unsigned char * dst, int dstLen, const unsigned char* src, int srcLen)\r\n{\r\n    if (!dst || !src) {\r\n        return -1;\r\n    }\r\n\r\n    if (!EVP_DecryptUpdate(decryptCtx_, dst, &dstLen, (const unsigned char *)src, srcLen)) {\r\n        return -1;\r\n    }\r\n\r\n    return dstLen;\r\n}\r\n\r\nByteBuffer SymmetricCipherOpenssl::DecryptFinish()\r\n{\r\n    ByteBuffer out(EVP_MAX_BLOCK_LENGTH);\r\n    int outlen = 0;\r\n    if (!EVP_DecryptFinal_ex(decryptCtx_, (unsigned char *)out.data(), &outlen)) {\r\n        return ByteBuffer();\r\n    }\r\n    out.resize(static_cast<size_t>(outlen));\r\n    return out;\r\n}\r\n\r\n//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\r\nAsymmetricCipherOpenssl::AsymmetricCipherOpenssl(CipherAlgorithm algo, CipherMode mode, CipherPadding pad) :\r\n    AsymmetricCipher(\"openssl-impl\", algo, mode, pad)\r\n{\r\n}\r\n\r\nAsymmetricCipherOpenssl::~AsymmetricCipherOpenssl()\r\n{\r\n}\r\n\r\nByteBuffer AsymmetricCipherOpenssl::Encrypt(const ByteBuffer& data)\r\n{\r\n#if defined(OPENSSL_API_LEVEL) && OPENSSL_API_LEVEL >= 30000\r\n    BIO* bio = NULL;\r\n    OSSL_DECODER_CTX* dctx = NULL;\r\n    EVP_PKEY* pkey = NULL;\r\n    EVP_PKEY_CTX* ctx = NULL;\r\n    ByteBuffer enc;\r\n\r\n    do {\r\n\r\n        if (data.empty()) {\r\n            break;\r\n        }\r\n\r\n        dctx = OSSL_DECODER_CTX_new_for_pkey(&pkey, \"PEM\", NULL, \"RSA\", EVP_PKEY_PUBLIC_KEY, NULL, NULL);\r\n\r\n        if (dctx == NULL) {\r\n            break;\r\n        }\r\n\r\n        bio = BIO_new(BIO_s_mem());\r\n        BIO_puts(bio, PublicKey().c_str());\r\n\r\n        if (OSSL_DECODER_from_bio(dctx, bio) == 0) {\r\n            break;\r\n        }\r\n\r\n        ctx = EVP_PKEY_CTX_new_from_pkey(NULL, pkey, NULL);\r\n        if (ctx == NULL) {\r\n            break;\r\n        }\r\n\r\n        if (EVP_PKEY_encrypt_init_ex(ctx, NULL) <= 0) {\r\n            break;\r\n        }\r\n\r\n        if (EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PADDING) <= 0) {\r\n            break;\r\n        }\r\n\r\n        size_t enc_len = 0;\r\n        if (EVP_PKEY_encrypt(ctx, NULL, &enc_len, (unsigned char*)data.data(), data.size()) <= 0) {\r\n            break;\r\n        }\r\n        enc.resize(enc_len, 0);\r\n        \r\n        if (EVP_PKEY_encrypt(ctx, (unsigned char*)enc.data(), &enc_len, (unsigned char*)data.data(), data.size()) <= 0) {\r\n            enc.resize(0);\r\n            break;\r\n        }\r\n    } while (0);\r\n\r\n    if (bio) {\r\n        BIO_free(bio);\r\n    }\r\n\r\n    if (dctx != NULL) {\r\n        OSSL_DECODER_CTX_free(dctx);\r\n    }\r\n\r\n    if (pkey) {\r\n        EVP_PKEY_free(pkey);\r\n    }\r\n\r\n    if (ctx != NULL) {\r\n        EVP_PKEY_CTX_free(ctx);\r\n    }\r\n\r\n    return enc;\r\n#else \r\n    RSA* rsa = NULL;\r\n    BIO* bio = NULL;\r\n    EVP_PKEY* pkey = NULL;\r\n    ByteBuffer enc;\r\n    do {\r\n        if (data.empty()) {\r\n            break;\r\n        }\r\n\r\n        bio = BIO_new(BIO_s_mem());\r\n        BIO_puts(bio, PublicKey().c_str());\r\n\r\n        if (strncmp(\"-----BEGIN RSA\", PublicKey().c_str(), 14) == 0) {\r\n            rsa = PEM_read_bio_RSAPublicKey(bio, &rsa, NULL, NULL);\r\n        }\r\n        else {\r\n            pkey = PEM_read_bio_PUBKEY(bio, &pkey, NULL, NULL);\r\n            rsa = pkey ? EVP_PKEY_get1_RSA(pkey) : NULL;\r\n        }\r\n\r\n        if (rsa == NULL) {\r\n            break;\r\n        }\r\n\r\n        int rsa_len = RSA_size(rsa);\r\n        enc.resize(rsa_len, 0);\r\n\r\n        if (RSA_public_encrypt((int)data.size(), (unsigned char*)data.data(), (unsigned char*)enc.data(), rsa, RSA_PKCS1_PADDING) < 0) {\r\n            enc.resize(0);\r\n        }\r\n\r\n    } while (0);\r\n\r\n    if (bio) {\r\n        BIO_free(bio);\r\n    }\r\n\r\n    if (pkey) {\r\n        EVP_PKEY_free(pkey);\r\n    }\r\n\r\n    if (rsa) {\r\n        RSA_free(rsa);\r\n    }\r\n\r\n    return enc;\r\n\r\n#endif\r\n}\r\n\r\nByteBuffer AsymmetricCipherOpenssl::Decrypt(const ByteBuffer& data)\r\n{\r\n#if defined(OPENSSL_API_LEVEL) && OPENSSL_API_LEVEL >= 30000\r\n    BIO* bio = NULL;\r\n    EVP_PKEY* pkey = NULL;\r\n    EVP_PKEY_CTX* ctx = NULL;\r\n    ByteBuffer dec;\r\n\r\n    do {\r\n\r\n        if (data.empty()) {\r\n            break;\r\n        }\r\n\r\n        bio = BIO_new(BIO_s_mem());\r\n        BIO_puts(bio, PrivateKey().c_str());\r\n\r\n        pkey = PEM_read_bio_PrivateKey(bio, &pkey, NULL, NULL);\r\n\r\n        ctx = EVP_PKEY_CTX_new_from_pkey(NULL, pkey, NULL);\r\n        if (ctx == NULL) {\r\n            break;\r\n        }\r\n\r\n        if (EVP_PKEY_decrypt_init_ex(ctx, NULL) <= 0) {\r\n            break;\r\n        }\r\n\r\n        if (EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PADDING) <= 0) {\r\n            break;\r\n        }\r\n\r\n        size_t dec_len = 0;\r\n        if (EVP_PKEY_decrypt(ctx, NULL, &dec_len, (unsigned char*)data.data(), data.size()) <= 0) {\r\n            break;\r\n        }\r\n        dec.resize(dec_len, 0);\r\n        \r\n        if (EVP_PKEY_decrypt(ctx, (unsigned char*)dec.data(), &dec_len, (unsigned char*)data.data(), data.size()) <= 0) {\r\n            dec_len = 0;\r\n        }\r\n        dec.resize(dec_len);\r\n\r\n    } while (0);\r\n\r\n    if (bio) {\r\n        BIO_free(bio);\r\n    }\r\n\r\n    if (pkey) {\r\n        EVP_PKEY_free(pkey);\r\n    }\r\n\r\n    if (ctx != NULL) {\r\n        EVP_PKEY_CTX_free(ctx);\r\n    }\r\n\r\n    return dec;\r\n#else\r\n    RSA* rsa = NULL;\r\n    BIO* bio = NULL;\r\n    EVP_PKEY* pkey = NULL;\r\n    ByteBuffer dec;\r\n    do {\r\n        if (data.empty()) {\r\n            break;\r\n        }\r\n\r\n        bio = BIO_new(BIO_s_mem());\r\n        BIO_puts(bio, PrivateKey().c_str());\r\n\r\n        if (strncmp(\"-----BEGIN RSA\", PublicKey().c_str(), 14) == 0) {\r\n            rsa = PEM_read_bio_RSAPrivateKey(bio, &rsa, NULL, NULL);\r\n        }\r\n        else {\r\n            pkey = PEM_read_bio_PrivateKey(bio, &pkey, NULL, NULL);\r\n            rsa = pkey ? EVP_PKEY_get1_RSA(pkey) : NULL;\r\n        }\r\n\r\n        if (rsa == NULL) {\r\n            break;\r\n        }\r\n\r\n        int rsa_len = RSA_size(rsa);\r\n        dec.resize(rsa_len, 0);\r\n\r\n        auto dec_len = RSA_private_decrypt(rsa_len, (unsigned char*)data.data(), (unsigned char*)dec.data(), rsa, RSA_PKCS1_PADDING);\r\n        dec.resize(dec_len < 0 ? 0 : static_cast<size_t>(dec_len));\r\n\r\n    } while (0);\r\n\r\n    if (bio) {\r\n        BIO_free(bio);\r\n    }\r\n\r\n    if (pkey) {\r\n        EVP_PKEY_free(pkey);\r\n    }\r\n\r\n    if (rsa) {\r\n        RSA_free(rsa);\r\n    }\r\n\r\n    return dec;\r\n#endif\r\n}\r\n"
  },
  {
    "path": "sdk/src/encryption/CipherOpenssl.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/encryption/Cipher.h>\r\n#include <openssl/evp.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class SymmetricCipherOpenssl : public  SymmetricCipher\r\n    {\r\n    public:\r\n        ~SymmetricCipherOpenssl();\r\n        SymmetricCipherOpenssl(const EVP_CIPHER* cipher, CipherAlgorithm algo, CipherMode mode, CipherPadding pad);\r\n\r\n        virtual void EncryptInit(const ByteBuffer& key, const ByteBuffer& iv);\r\n        virtual ByteBuffer Encrypt(const ByteBuffer& data);\r\n        virtual int Encrypt(unsigned char * dst, int dstLen, const unsigned char* src, int srcLen);\r\n        virtual ByteBuffer EncryptFinish();\r\n\r\n        virtual void DecryptInit(const ByteBuffer& key, const ByteBuffer& iv);\r\n        virtual ByteBuffer Decrypt(const ByteBuffer& data);\r\n        virtual int Decrypt(unsigned char * dst, int dstLen, const unsigned char* src, int srcLen);\r\n        virtual ByteBuffer DecryptFinish();\r\n\r\n    private:\r\n        EVP_CIPHER_CTX* encryptCtx_;\r\n        EVP_CIPHER_CTX* decryptCtx_;\r\n        const EVP_CIPHER* cipher_;\r\n        int blockSize_;\r\n    };\r\n\r\n    class AsymmetricCipherOpenssl : public  AsymmetricCipher\r\n    {\r\n    public:\r\n        ~AsymmetricCipherOpenssl();\r\n        AsymmetricCipherOpenssl(CipherAlgorithm algo, CipherMode mode, CipherPadding pad);\r\n\r\n        virtual ByteBuffer Encrypt(const ByteBuffer& data);\r\n        virtual ByteBuffer Decrypt(const ByteBuffer& data);\r\n    private:\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/src/encryption/ContentCryptoMaterial.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/encryption/ContentCryptoMaterial.h>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nContentCryptoMaterial::ContentCryptoMaterial()\r\n{\r\n}\r\n\r\nContentCryptoMaterial::~ContentCryptoMaterial()\r\n{\r\n}\r\n"
  },
  {
    "path": "sdk/src/encryption/CryptoConfiguration.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n#include <alibabacloud/oss/encryption/CryptoConfiguration.h>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nCryptoConfiguration::CryptoConfiguration():\r\n    cryptoMode(CryptoMode::ENCRYPTION_AESCTR),\r\n    cryptoStorageMethod(CryptoStorageMethod::METADATA)\r\n{\r\n}\r\n\r\nCryptoConfiguration::~CryptoConfiguration()\r\n{\r\n}\r\n"
  },
  {
    "path": "sdk/src/encryption/CryptoModule.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/Const.h>\n#include \"CryptoModule.h\"\n#include \"CryptoStreamBuf.h\"\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\n#define CHECK_FUNC_RET(outcome, func, ret) \\\n    do { \\\n        if (ret != 0) { \\\n            std::string errMsg(#func\" fail, return value:\"); errMsg.append(std::to_string(ret));\\\n            return outcome(OssError(\"EncryptionClientError\", errMsg)); \\\n        } \\\n    } while (0)\n\n\n\nstatic std::string getUserAgent(const std::string& prefix)\n{\n    std::stringstream ss;\n    ss << prefix << \"/OssEncryptionClient\";\n    return ss.str();\n}\n\nstd::shared_ptr<CryptoModule> CryptoModule::CreateCryptoModule(const std::shared_ptr<EncryptionMaterials>& encryptionMaterials,\n    const CryptoConfiguration& cryptoConfig)\n{\n    switch(cryptoConfig.cryptoMode) {\n    case CryptoMode::ENCRYPTION_AESCTR:\n    default:\n        return std::make_shared<CryptoModuleAESCTR>(encryptionMaterials, cryptoConfig);\n    };\n}\n\nCryptoModule::CryptoModule(const std::shared_ptr<EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig):\n    encryptionMaterials_(encryptionMaterials),\n    cryptoConfig_(cryptoConfig)\n{\n}\n\nCryptoModule::~CryptoModule()\n{\n}\n\nPutObjectOutcome CryptoModule::PutObjectSecurely(const std::shared_ptr<OssClientImpl>& client, const PutObjectRequest& request)\n{\n    PutObjectRequest putRequest(request);\n    ContentCryptoMaterial material;\n\n    initEncryptionCipher(material);\n    generateKeyIV(material);\n    auto ret = encryptionMaterials_->EncryptCEK(material);\n    CHECK_FUNC_RET(PutObjectOutcome, EncryptCEK, ret);\n    addMetaData(material, putRequest.MetaData());\n    addUserAgent(putRequest.MetaData(), client->configuration().userAgent);\n    CryptoStreamBuf cryptoStream(*putRequest.Body(), cipher_, material.ContentKey(), material.ContentIV());\n\n    return client->PutObject(putRequest);\n}\n\nGetObjectOutcome CryptoModule::GetObjectSecurely(const std::shared_ptr<OssClientImpl>& client, const GetObjectRequest& request, const ObjectMetaData& meta)\n{\n    GetObjectRequest getRequest(request);\n    ContentCryptoMaterial material;\n\n    readMetaData(material, meta);\n    initDecryptionCipher(material);\n\n    if (material.CipherName() != cipher_->Name()) {\n        std::stringstream ss;\n        ss << \"Cipher name is not support, \" << \n              \"expect \" << cipher_->Name() << \", \"\n              \"got \" << material.CipherName() << \".\";\n        return GetObjectOutcome(OssError(\"EncryptionClientError\", ss.str()));\n    }\n\n    auto ret = encryptionMaterials_->DecryptCEK(material);\n    CHECK_FUNC_RET(GetObjectOutcome, DecryptCEK, ret);\n\n    //range\n    auto iv = material.ContentIV();\n    auto range = request.Range();\n    int64_t skipCnt = 0;\n    int64_t blkSize = static_cast<int64_t>(cipher_->BlockSize());\n    if (range.first > 0) {\n        auto blockOfNum = range.first / blkSize;\n        auto newBegin = blockOfNum * blkSize;\n        skipCnt = range.first % blkSize;\n        getRequest.setRange(newBegin, range.second);\n        iv = cipher_->IncCTRCounter(iv, static_cast<uint64_t>(blockOfNum));\n    }\n\n    //ua\n    getRequest.setUserAgent(getUserAgent(client->configuration().userAgent));\n\n    std::shared_ptr<CryptoStreamBuf> cryptoStream = nullptr;\n    std::shared_ptr<std::iostream> userContent = nullptr;\n    getRequest.setResponseStreamFactory([&]() { \n            auto content = request.ResponseStreamFactory()();\n            cryptoStream = std::make_shared<CryptoStreamBuf>(*content, cipher_, material.ContentKey(), iv, static_cast<int>(skipCnt));\n            userContent = content;\n            return content;\n        }\n    );\n\n    auto outcome = client->GetObject(getRequest);\n    if (skipCnt > 0 && outcome.isSuccess()) {\n        ObjectMetaData ometa = outcome.result().Metadata();\n        auto len = ometa.ContentLength();\n        ometa.setContentLength(len - skipCnt);\n        outcome.result().setMetaData(ometa);\n    }\n\n    cryptoStream = nullptr;\n    userContent = nullptr;\n    return outcome;\n}\n\nInitiateMultipartUploadOutcome CryptoModule::InitiateMultipartUploadSecurely(const std::shared_ptr<OssClientImpl>& client,\n    const InitiateMultipartUploadRequest& request, MultipartUploadCryptoContext& ctx)\n{\n    std::string errMsg1;\n    if (!checkUserParameter(ctx, errMsg1)) {\n        return InitiateMultipartUploadOutcome(OssError(\"EncryptionClientError\", errMsg1));\n    }\n\n    InitiateMultipartUploadRequest initRequest(request);\n    ContentCryptoMaterial material;\n\n    initEncryptionCipher(material);\n    generateKeyIV(material);\n    auto ret = encryptionMaterials_->EncryptCEK(material);\n    CHECK_FUNC_RET(InitiateMultipartUploadOutcome, EncryptCEK, ret);\n    addMetaData(material, initRequest.MetaData());\n    addMetaDataMultipart(ctx, initRequest.MetaData());\n    addUserAgent(initRequest.MetaData(), client->configuration().userAgent);\n\n    auto outcome = client->InitiateMultipartUpload(initRequest);\n    if (outcome.isSuccess()) {\n        ctx.setContentMaterial(material);\n        ctx.setUploadId(outcome.result().UploadId());\n    }\n    return outcome;\n}\n\nPutObjectOutcome CryptoModule::UploadPartSecurely(const std::shared_ptr<OssClientImpl>& client, const UploadPartRequest& request,\n    const MultipartUploadCryptoContext& ctx)\n{\n    std::string errMsg;\n    if (!checkUserParameter(ctx, errMsg)) {\n        return PutObjectOutcome(OssError(\"EncryptionClientError\", errMsg));\n    }\n\n    //check material\n    if (ctx.ContentMaterial().ContentKey().empty() ||\n        ctx.ContentMaterial().ContentIV().empty()) {\n        return PutObjectOutcome(OssError(\"EncryptionClientError\", \"ContentKey/IV in CryptoContext is empty.\"));\n    }\n\n    UploadPartRequest uRequest(request);\n    ContentCryptoMaterial material;\n    initEncryptionCipher(material);\n#if 0\n    ObjectMetaData meta;\n    addMetaData(ctx.ContentMaterial(), meta);\n    addMetaDataMultipart(ctx, meta);\n    uRequest.setMetaData(meta);\n#endif\n    //ua\n    uRequest.setUserAgent(getUserAgent(client->configuration().userAgent));\n\n    auto fileOffset = ctx.PartSize() * static_cast<int64_t>(uRequest.PartNumber() - 1);\n    auto blockNum = fileOffset / static_cast<int64_t>(cipher_->BlockSize());\n    auto iv = cipher_->IncCTRCounter(ctx.ContentMaterial().ContentIV(), static_cast<uint64_t>(blockNum));\n    CryptoStreamBuf cryptoStream(*uRequest.Body(), cipher_, ctx.ContentMaterial().ContentKey(), iv);\n    return client->UploadPart(uRequest);\n}\n\nvoid CryptoModule::addMetaData(const ContentCryptoMaterial& content, ObjectMetaData& meta)\n{\n    //x-oss-meta-client-side-encryption-key\n    meta.addUserHeader(\"client-side-encryption-key\",\n        Base64Encode((const char*)content.EncryptedContentKey().data(), static_cast<int>(content.EncryptedContentKey().size())));\n\n    //x-oss-meta-client-side-encryption-start //iv\n    meta.addUserHeader(\"client-side-encryption-start\",\n        Base64Encode((const char*)content.EncryptedContentIV().data(), static_cast<int>(content.EncryptedContentIV().size())));\n\n    //x-oss-meta-client-side-encryption-cek-alg \n    meta.addUserHeader(\"client-side-encryption-cek-alg\", content.CipherName());\n\n    //x-oss-meta-client-side-encryption-wrap-alg \n    meta.addUserHeader(\"client-side-encryption-wrap-alg\", content.KeyWrapAlgorithm());\n\n    //x-oss-meta-client-side-encryption-matdesc,json format \n    if (!content.Description().empty()) {\n        std::string jsonStr = MapToJsonString(content.Description());\n        if (!jsonStr.empty()) {\n            meta.addUserHeader(\"client-side-encryption-matdesc\", jsonStr);\n        }\n    }\n\n    //x-oss-meta-client-side-encryption-magic-number-hmac\n    if (!content.MagicNumber().empty()) {\n        meta.addUserHeader(\"client-side-encryption-magic-number-hmac\", content.MagicNumber());\n    }\n\n    //x-oss-meta-client-side-encryption-unencrypted-content-md5\n    if (meta.hasHeader(Http::CONTENT_MD5)) {\n        meta.addUserHeader(\"client-side-encryption-unencrypted-content-md5\", meta.ContentMd5());\n        meta.removeHeader(Http::CONTENT_MD5);\n    }\n\n    //x-oss-meta-client-side-encryption-unencrypted-content-length\n    //ToDo\n}\n\nvoid CryptoModule::addMetaDataMultipart(const MultipartUploadCryptoContext& ctx, ObjectMetaData& meta)\n{\n    if (ctx.DataSize() > 0) {\n        meta.addUserHeader(\"client-side-encryption-data-size\", std::to_string(ctx.DataSize()));\n    }\n    meta.addUserHeader(\"client-side-encryption-part-size\", std::to_string(ctx.PartSize()));\n}\n\nvoid CryptoModule::readMetaData(ContentCryptoMaterial& content, const ObjectMetaData& meta)\n{\n    //x-oss-meta-client-side-encryption-key\n    if (meta.hasUserHeader(\"client-side-encryption-key\")) {\n        content.setEncryptedContentKey(Base64Decode(meta.UserMetaData().at(\"client-side-encryption-key\")));\n    }\n\n    //x-oss-meta-client-side-encryption-start //iv\n    if (meta.hasUserHeader(\"client-side-encryption-start\")) {\n        content.setEncryptedContentIV(Base64Decode(meta.UserMetaData().at(\"client-side-encryption-start\")));\n    }\n\n    //x-oss-meta-client-side-encryption-cek-alg \n    if (meta.hasUserHeader(\"client-side-encryption-cek-alg\")) {\n        content.setCipherName(meta.UserMetaData().at(\"client-side-encryption-cek-alg\"));\n    }\n\n    //x-oss-meta-client-side-encryption-wrap-alg \n    if (meta.hasUserHeader(\"client-side-encryption-wrap-alg\")) {\n        content.setKeyWrapAlgorithm(meta.UserMetaData().at(\"client-side-encryption-wrap-alg\"));\n    }\n\n    //x-oss-meta-client-side-encryption-matdesc \n    if (meta.hasUserHeader(\"client-side-encryption-matdesc\")) {\n        content.setDescription(JsonStringToMap(meta.UserMetaData().at(\"client-side-encryption-matdesc\")));\n    }\n}\n\nvoid CryptoModule::addUserAgent(ObjectMetaData& meta, const std::string& prefix)\n{\n    if (!meta.hasHeader(Http::USER_AGENT)) {\n        meta.addHeader(Http::USER_AGENT, getUserAgent(prefix));\n    }\n}\n\n//////////////////////////////////////////////////////////////////////////////////////////////////////////\n//CryptoModuleAES265_CTR\n\nCryptoModuleAESCTR::CryptoModuleAESCTR(const std::shared_ptr<EncryptionMaterials>& encryptionMaterials, \n    const CryptoConfiguration& cryptoConfig):\n    CryptoModule(encryptionMaterials, cryptoConfig)\n{\n}\n\nCryptoModuleAESCTR::~CryptoModuleAESCTR()\n{\n}\n\nvoid CryptoModuleAESCTR::initEncryptionCipher(ContentCryptoMaterial& content)\n{\n    cipher_ = SymmetricCipher::CreateAES256_CTRImpl();\n    content.setCipherName(cipher_->Name());\n}\n\nvoid CryptoModuleAESCTR::generateKeyIV(ContentCryptoMaterial& content)\n{\n    content.setContentKey(SymmetricCipher::GenerateKey(32));\n    auto iv = SymmetricCipher::GenerateIV(16);\n    iv[8] = iv[9] = iv[10] = iv[11] = 0;\n    content.setContentIV(iv);\n}\n\nvoid CryptoModuleAESCTR::initDecryptionCipher(ContentCryptoMaterial& content)\n{\n    UNUSED_PARAM(content);\n    cipher_ = SymmetricCipher::CreateAES256_CTRImpl();\n}\n\nbool CryptoModuleAESCTR::checkUserParameter(const MultipartUploadCryptoContext& ctx, std::string& errMsg)\n{\n    if (ctx.PartSize() < PartSizeLowerLimit) {\n        errMsg = \"PartSize should not be less than 102400.\";\n        return false;\n    }\n\n    if (ctx.PartSize() % 16) {\n        errMsg = \"PartSize is not 16 bytes alignment.\";\n        return false;\n    }\n    return true;\n}\n"
  },
  {
    "path": "sdk/src/encryption/CryptoModule.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <alibabacloud/oss/encryption/CryptoConfiguration.h>\n#include <alibabacloud/oss/encryption/EncryptionMaterials.h>\n#include <alibabacloud/oss/encryption/Cipher.h>\n#include <alibabacloud/oss/OssFwd.h>\n#include <alibabacloud/oss/model/MultipartUploadCryptoContext.h>\n#include \"../OssClientImpl.h\"\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class CryptoModule\n    {\n    public:\n        virtual ~CryptoModule();\n\n        PutObjectOutcome PutObjectSecurely(const std::shared_ptr<OssClientImpl>& client, const PutObjectRequest& request);\n        GetObjectOutcome GetObjectSecurely(const std::shared_ptr<OssClientImpl>& client, const GetObjectRequest& request, const ObjectMetaData& meta);\n\n        InitiateMultipartUploadOutcome InitiateMultipartUploadSecurely(const std::shared_ptr<OssClientImpl>& client, \n            const InitiateMultipartUploadRequest& request, MultipartUploadCryptoContext& ctx);\n        PutObjectOutcome UploadPartSecurely(const std::shared_ptr<OssClientImpl>& client, const UploadPartRequest& request,\n            const MultipartUploadCryptoContext& ctx);\n    public:\n        static std::shared_ptr<CryptoModule> CreateCryptoModule(const std::shared_ptr<EncryptionMaterials>& encryptionMaterials,\n            const CryptoConfiguration& cryptoConfig);\n\n    protected:\n        CryptoModule(const std::shared_ptr<EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig);\n        void addMetaData(const ContentCryptoMaterial& content, ObjectMetaData& meta);\n        void addMetaDataMultipart(const MultipartUploadCryptoContext& ctx, ObjectMetaData& meta);\n        void readMetaData(ContentCryptoMaterial& content, const ObjectMetaData& meta);\n        void addUserAgent(ObjectMetaData& meta, const std::string& prefix);\n\n        virtual void initEncryptionCipher(ContentCryptoMaterial& content) = 0;\n        virtual void generateKeyIV(ContentCryptoMaterial& content) = 0;\n        virtual void initDecryptionCipher(ContentCryptoMaterial& content) = 0;\n        virtual bool checkUserParameter(const MultipartUploadCryptoContext& ctx, std::string& errMsg) = 0;\n\n    protected:\n        std::shared_ptr<EncryptionMaterials> encryptionMaterials_;\n        CryptoConfiguration cryptoConfig_;\n        std::shared_ptr<SymmetricCipher> cipher_;\n    };\n\n    class CryptoModuleAESCTR :public CryptoModule\n    {\n    public:\n        CryptoModuleAESCTR(const std::shared_ptr<EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig);\n        ~CryptoModuleAESCTR();\n    protected:\n        virtual void initEncryptionCipher(ContentCryptoMaterial& content);\n        virtual void generateKeyIV(ContentCryptoMaterial& content);\n        virtual void initDecryptionCipher(ContentCryptoMaterial& content);\n        virtual bool checkUserParameter(const MultipartUploadCryptoContext& ctx, std::string& errMsg);\n    private:\n\n    };\n\n}\n}\n"
  },
  {
    "path": "sdk/src/encryption/CryptoStreamBuf.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include \"CryptoStreamBuf.h\"\r\n#include <algorithm>\r\n#include <cstring>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\n\r\nCryptoStreamBuf::CryptoStreamBuf(std::iostream& stream, \n    const std::shared_ptr<SymmetricCipher>& cipher,\n    const ByteBuffer& key, const ByteBuffer& iv,\n    const int skipCnt) :\n    StreamBufProxy(stream),\n    cipher_(cipher),\n    encBufferCnt_(0),\n    encBufferOff_(0),\n    decBufferCnt_(0),\n    decBufferOff_(0),\n    key_(key),\n    iv_(iv),\n    initEncrypt(false),\n    initDecrypt(false),\n    skipCnt_(skipCnt)\n{\n    StartPosForIV_ = StreamBufProxy::seekoff(std::streamoff(0), std::ios_base::cur, std::ios_base::in);\n}\n\r\nCryptoStreamBuf::~CryptoStreamBuf()\n{\n    //flush decBuffer when its size is BLK_SIZE\r\n    if (decBufferCnt_ > 0) {\r\n        unsigned char block[BLK_SIZE];\r\n        auto ret = cipher_->Decrypt(block, static_cast<int>(decBufferCnt_), decBuffer_, static_cast<int>(decBufferCnt_));\r\n        decBufferCnt_ = 0;\r\n        if (ret < 0) {\r\n            return;\r\n        }\r\n        xsputn_with_skip(reinterpret_cast<char *>(block), ret);\r\n    }\n}\n\r\nstd::streamsize CryptoStreamBuf::xsgetn(char * _Ptr, std::streamsize _Count)\r\n{\r\n    const std::streamsize startCount = _Count;\r\n    std::streamsize readCnt;\r\n    unsigned char block[BLK_SIZE];\r\n\r\n    //update iv base the pos\r\n    if (!initEncrypt) {\r\n        auto currPos = StreamBufProxy::seekoff(std::streamoff(0), std::ios_base::cur, std::ios_base::in);\r\n        currPos -= StartPosForIV_;\r\n        auto blkOff = currPos / BLK_SIZE;\r\n        auto blkIdx = currPos % BLK_SIZE;\r\n        auto iv = SymmetricCipher::IncCTRCounter(iv_, blkOff);\r\n        cipher_->EncryptInit(key_, iv);\r\n        encBufferCnt_ = 0;\r\n        encBufferOff_ = 0;\r\n        if (blkIdx > 0) {\r\n            StreamBufProxy::seekpos(blkOff * BLK_SIZE, std::ios_base::in);\r\n            readCnt = StreamBufProxy::xsgetn(reinterpret_cast<char *>(block), BLK_SIZE);\r\n            auto ret = cipher_->Encrypt(encBuffer_, static_cast<int>(readCnt), block, static_cast<int>(readCnt));\r\n            if (ret < 0) {\r\n                return -1;\r\n            }\r\n            encBufferCnt_ = ret - blkIdx;\r\n            encBufferOff_ = blkIdx;\r\n        }\r\n        initEncrypt = true;\r\n    }\r\n\r\n    //read from inner encBuffer_ first\r\n    readCnt = read_from_encrypted_buffer(_Ptr, _Count);\r\n    if (readCnt > 0) {\r\n        _Count -= readCnt;\r\n        _Ptr += readCnt;\r\n    }\r\n\r\n    //read from streambuf by BLK_SIZE\r\n    while (_Count > 0) {\r\n        readCnt = StreamBufProxy::xsgetn(reinterpret_cast<char *>(block), BLK_SIZE);\r\n        if (readCnt <= 0)\r\n            break;\r\n\r\n        if (_Count < readCnt) {\r\n            auto ret = cipher_->Encrypt(encBuffer_, static_cast<int>(readCnt), block, static_cast<int>(readCnt));\r\n            if (ret < 0) {\r\n                return -1;\r\n            }\r\n            encBufferCnt_ = ret;\r\n            encBufferOff_ = 0;\r\n            break;\r\n        }\r\n        else {\r\n            auto ret = cipher_->Encrypt(reinterpret_cast<unsigned char *>(_Ptr), static_cast<int>(readCnt), block, static_cast<int>(readCnt));\r\n            if (ret < 0) {\r\n                return -1;\r\n            }\r\n            _Count -= ret;\r\n            _Ptr += ret;\r\n        }\r\n    }\r\n\r\n    //read from inner encBuffer_ again\r\n    readCnt = read_from_encrypted_buffer(_Ptr, _Count);\r\n    if (readCnt > 0) {\r\n        _Count -= readCnt;\r\n        _Ptr += readCnt;\r\n    }\r\n\r\n    return startCount - _Count;\r\n}\r\n\r\nstd::streamsize CryptoStreamBuf::read_from_encrypted_buffer(char * _Ptr, std::streamsize _Count)\n{\n    const std::streamsize startCount = _Count;\r\n    if (_Count > 0 && encBufferCnt_ > 0) {\r\n        auto cnt = std::min(_Count, encBufferCnt_);\r\n        memcpy(_Ptr, encBuffer_ + encBufferOff_, static_cast<size_t>(cnt));\r\n        _Ptr += cnt;\r\n        _Count -= cnt;\r\n        encBufferCnt_ -= cnt;\r\n        encBufferOff_ += cnt;\r\n    }\r\n    return startCount - _Count;\r\n}\r\n\r\nstd::streampos CryptoStreamBuf::seekoff(off_type _Off, std::ios_base::seekdir _Way, std::ios_base::openmode _Mode)\r\n{\r\n    if (_Mode & std::ios_base::in) {\r\n        initEncrypt = false;\r\n    }\r\n    if (_Mode & std::ios_base::out) {\r\n        initDecrypt = false;\r\n    }\r\n    return StreamBufProxy::seekoff(_Off, _Way, _Mode);\r\n}\r\n\r\nstd::streampos CryptoStreamBuf::seekpos(pos_type _Pos, std::ios_base::openmode _Mode)\r\n{\r\n    if (_Mode & std::ios_base::in) {\r\n        initEncrypt = false;\r\n    }\r\n    if (_Mode & std::ios_base::out) {\r\n        initDecrypt = false;\r\n    }\r\n    return StreamBufProxy::seekpos(_Pos, _Mode);\r\n}\r\n\r\nstd::streamsize CryptoStreamBuf::xsputn(const char *_Ptr, std::streamsize _Count)\r\n{\r\n    const std::streamsize startCount = _Count;\r\n    unsigned char block[BLK_SIZE * 2];\r\n    std::streamsize writeCnt;\r\n    //update iv\r\n    if (!initDecrypt) {\r\n        cipher_->DecryptInit(key_, iv_);\r\n        decBufferCnt_ = 0;\r\n        decBufferOff_ = 0;\r\n        initDecrypt = true;\r\n    }\r\n\r\n    //append to decBuffer first\r\n    if (decBufferCnt_ > 0) {\r\n        writeCnt = std::min(_Count, (BLK_SIZE - decBufferCnt_));\r\n        memcpy(decBuffer_ + decBufferOff_, _Ptr, static_cast<int>(writeCnt));\r\n        decBufferOff_ += writeCnt;\r\n        decBufferCnt_ += writeCnt;\r\n        _Ptr += writeCnt;\r\n        _Count -= writeCnt;\r\n    }\r\n\r\n    //flush decBuffer when its size is BLK_SIZE\r\n    if (decBufferCnt_ == BLK_SIZE) {\r\n        auto ret = cipher_->Decrypt(block, static_cast<int>(BLK_SIZE), decBuffer_, static_cast<int>(BLK_SIZE));\r\n        if (ret < 0) {\r\n            return -1;\r\n        }\r\n        decBufferCnt_ = 0;\r\n        decBufferOff_ = 0;\r\n        writeCnt = xsputn_with_skip(reinterpret_cast<char *>(block), BLK_SIZE);\r\n        if (writeCnt != BLK_SIZE) {\r\n            //Todo Save decrypted data\r\n            return startCount - _Count;\r\n        }\r\n    }\r\n\r\n    auto blkOff = _Count / BLK_SIZE;\r\n    auto blkIdx = _Count % BLK_SIZE;\r\n\r\n    //decrypt by BLK_SIZE\r\n    for (auto i = std::streamsize(0); i < blkOff; i++) {\r\n        auto ret = cipher_->Decrypt(block, static_cast<int>(BLK_SIZE), reinterpret_cast<const unsigned char *>(_Ptr), static_cast<int>(BLK_SIZE));\r\n        if (ret < 0) {\r\n            return -1;\r\n        }\r\n        _Ptr += BLK_SIZE;\r\n        _Count -= BLK_SIZE;\r\n        writeCnt = xsputn_with_skip(reinterpret_cast<char *>(block), BLK_SIZE);\r\n        if (writeCnt != BLK_SIZE) {\r\n            //Todo Save decrypted data\r\n            return startCount - _Count;\r\n        }\r\n    }\r\n\r\n    //save to decBuffer and decrypt next time\r\n    if (blkIdx > 0) {\r\n        memcpy(decBuffer_, _Ptr, static_cast<int>(blkIdx));\r\n        _Ptr += blkIdx;\r\n        _Count -= blkIdx;\r\n        decBufferCnt_ = blkIdx;\r\n        decBufferOff_ = blkIdx;\r\n    }\r\n\r\n    return startCount - _Count;\r\n}\r\n\r\nstd::streamsize CryptoStreamBuf::xsputn_with_skip(const char *_Ptr, std::streamsize _Count)\n{\r\n    const std::streamsize startCount = _Count;\r\n    if (skipCnt_ > 0) {\r\n        auto min = std::min(skipCnt_, _Count);\r\n        skipCnt_ -= min;\r\n        _Count -= min;\r\n        _Ptr += min;\r\n    }\r\n\r\n    if (_Count > 0) {\r\n        _Count -= StreamBufProxy::xsputn(_Ptr, _Count);\r\n    }\r\n    return startCount - _Count;\r\n}"
  },
  {
    "path": "sdk/src/encryption/CryptoStreamBuf.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/encryption/Cipher.h>\r\n#include \"../utils/StreamBuf.h\"\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    class CryptoStreamBuf : public StreamBufProxy\n    {\n    public:\n        static const std::streamsize BLK_SIZE = 16;\n\n        CryptoStreamBuf(std::iostream& stream,\n            const std::shared_ptr<SymmetricCipher>& cipher,\n            const ByteBuffer& key, const ByteBuffer& iv,\n            const int skipCnt = 0);\n        ~CryptoStreamBuf();\n    protected:\n        std::streamsize xsgetn(char * _Ptr, std::streamsize _Count);\r\n        std::streamsize xsputn(const char *_Ptr, std::streamsize _Count);\r\n        std::streampos seekoff(off_type _Off, std::ios_base::seekdir _Way, std::ios_base::openmode _Mode = std::ios_base::in | std::ios_base::out);\r\n        std::streampos seekpos(pos_type _Pos, std::ios_base::openmode _Mode = std::ios_base::in | std::ios_base::out);\r\n    private:\n        std::streamsize read_from_encrypted_buffer(char * _Ptr, std::streamsize _Count);\n        std::streamsize xsputn_with_skip(const char *_Ptr, std::streamsize _Count);\n        std::shared_ptr<SymmetricCipher> cipher_;\n        unsigned char encBuffer_[BLK_SIZE * 2];\n        std::streamsize encBufferCnt_;\n        std::streamsize encBufferOff_;\n        unsigned char decBuffer_[BLK_SIZE * 2];\n        std::streamsize decBufferCnt_;\n        std::streamsize decBufferOff_;\n        ByteBuffer key_;\n        ByteBuffer iv_;\n        bool initEncrypt;\n        bool initDecrypt;\n        std::streamsize skipCnt_; // for decrypt, must be less BLK_SIZE\n        std::streampos StartPosForIV_;\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/src/encryption/EncryptionMaterials.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/encryption/EncryptionMaterials.h>\r\n#include <alibabacloud/oss/encryption/Cipher.h>\r\n#include <map>\r\n#include <string>\r\n#include \"../utils/Utils.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nEncryptionMaterials::~EncryptionMaterials()\r\n{\r\n}\r\n\r\n/////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\nSimpleRSAEncryptionMaterials::SimpleRSAEncryptionMaterials(const std::string& publicKey, const std::string& privateKey):\r\n    SimpleRSAEncryptionMaterials(publicKey, privateKey, std::map< std::string, std::string>())\r\n{\r\n}\r\n\r\nSimpleRSAEncryptionMaterials::SimpleRSAEncryptionMaterials(const std::string& publicKey, const std::string& privateKey,\r\n    const std::map<std::string, std::string>& description):\r\n    publicKey_(publicKey),\r\n    description_(description)\r\n{\r\n    encryptionMaterials_.push_back(RSAEncryptionMaterial(std::pair<std::string, std::string>(publicKey, privateKey), description));\r\n}\r\n\r\nSimpleRSAEncryptionMaterials::~SimpleRSAEncryptionMaterials()\r\n{\r\n}\r\n\r\nvoid SimpleRSAEncryptionMaterials::addEncryptionMaterial(const std::string& publicKey, const std::string& privateKey,\r\n    const std::map<std::string, std::string>& description)\r\n{\r\n    encryptionMaterials_.push_back(RSAEncryptionMaterial(std::pair<std::string, std::string>(publicKey, privateKey), description));\r\n}\r\n\r\nint SimpleRSAEncryptionMaterials::EncryptCEK(ContentCryptoMaterial& contentCryptoMaterial)\r\n{\r\n    auto cipher = AsymmetricCipher::CreateRSA_NONEImpl();\r\n    cipher->setPublicKey(publicKey_);\r\n\r\n    auto encrptedKey = cipher->Encrypt(contentCryptoMaterial.ContentKey());\r\n    auto encrptedKeyIV = cipher->Encrypt(contentCryptoMaterial.ContentIV());\r\n\r\n    if (encrptedKey.empty() || encrptedKeyIV.empty()) {\r\n        return -1;\r\n    }\r\n\r\n    contentCryptoMaterial.setDescription(description_);\r\n    contentCryptoMaterial.setKeyWrapAlgorithm(cipher->Name());\r\n    contentCryptoMaterial.setEncryptedContentKey(encrptedKey);\r\n    contentCryptoMaterial.setEncryptedContentIV(encrptedKeyIV);\r\n\r\n    return 0;\r\n}\r\n\r\nint SimpleRSAEncryptionMaterials::DecryptCEK(ContentCryptoMaterial& contentCryptoMaterial)\r\n{\r\n    auto cipher = AsymmetricCipher::CreateRSA_NONEImpl();\r\n\r\n    auto keyWarpAlgo = ToLower(contentCryptoMaterial.KeyWrapAlgorithm().c_str());\r\n    auto cipherName  = ToLower(cipher->Name().c_str());\r\n\r\n    if (keyWarpAlgo != cipherName) {\r\n        return -1;\r\n    }\r\n    \r\n    int index = findIndexByDescription(contentCryptoMaterial.Description());\r\n    if (index < 0) {\r\n        return -1;\r\n    }\r\n    const std::string& privateKey = encryptionMaterials_[index].first.second;\r\n\r\n    cipher->setPrivateKey(privateKey);\r\n\r\n    auto key = cipher->Decrypt(contentCryptoMaterial.EncryptedContentKey());\r\n    auto iv = cipher->Decrypt(contentCryptoMaterial.EncryptedContentIV());\r\n\r\n    if (key.empty() || iv.empty()) {\r\n        return -1;\r\n    }\r\n\r\n    contentCryptoMaterial.setContentKey(key);\r\n    contentCryptoMaterial.setContentIV(iv);\r\n\r\n    return 0;\r\n}\r\n\r\nint SimpleRSAEncryptionMaterials::findIndexByDescription(const std::map<std::string, std::string>& description)\r\n{\r\n    bool found = false;\r\n    int index = 0;\r\n    for (const auto& item : encryptionMaterials_) {\r\n        if (item.second == description) {\r\n            found = true;\r\n            break;\r\n        }\r\n        index++;\r\n    }\r\n    return found ? index: -1;\r\n}\r\n"
  },
  {
    "path": "sdk/src/encryption/OssEncryptionClient.cc",
    "content": "/*\r\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n*\r\n* Licensed under the Apache License, Version 2.0 (the \"License\");\r\n* you may not use this file except in compliance with the License.\r\n* You may obtain a copy of the License at\r\n*\r\n*      http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing, software\r\n* distributed under the License is distributed on an \"AS IS\" BASIS,\r\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n* See the License for the specific language governing permissions and\r\n* limitations under the License.\r\n*/\r\n\r\n#include <fstream>\r\n#include <alibabacloud/oss/OssEncryptionClient.h>\r\n#include \"../encryption/CryptoModule.h\"\r\n#include \"../utils/Utils.h\"\r\n#include \"../utils/FileSystemUtils.h\"\r\n#include \"../resumable/ResumableDownloader.h\"\r\n#include \"../resumable/ResumableUploader.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\n///////////////////////////////////////////////////////////////////////////////////////////////////////\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n#if !defined(DISABLE_RESUAMABLE)\r\nstatic GetObjectRequest ConvertToGetObjectRequest(const DownloadObjectRequest& request)\r\n{\r\n    auto gRequest = GetObjectRequest(request.Bucket(), request.Key(), request.ModifiedSinceConstraint(), request.UnmodifiedSinceConstraint(), request.MatchingETagsConstraint(), request.NonmatchingETagsConstraint(), request.ResponseHeaderParameters());\r\n    if (request.RangeIsSet()) {\r\n        gRequest.setRange(request.RangeStart(), request.RangeEnd());\r\n    }\r\n    if (request.TransferProgress().Handler) {\r\n        gRequest.setTransferProgress(request.TransferProgress());\r\n    }\r\n    if (request.RequestPayer() == RequestPayer::Requester) {\r\n        gRequest.setRequestPayer(request.RequestPayer());\r\n    }\r\n    if (request.TrafficLimit() != 0) {\r\n        gRequest.setTrafficLimit(request.TrafficLimit());\r\n    }\r\n    if (!request.VersionId().empty()) {\r\n        gRequest.setVersionId(request.VersionId());\r\n    }\r\n    gRequest.setResponseStreamFactory([&]() {return std::make_shared<std::fstream>(request.FilePath(), std::ios_base::out | std::ios_base::in | std::ios_base::trunc | std::ios_base::binary); });\r\n    return gRequest;\r\n}\r\n\r\nstatic PutObjectRequest ConvertToPutObjectRequest(const UploadObjectRequest& request)\r\n{\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(request.FilePath(), std::ios::in | std::ios::binary);\r\n    PutObjectRequest pRequest(request.Bucket(), request.Key(), content, request.MetaData());\r\n    if (request.TransferProgress().Handler) {\r\n        pRequest.setTransferProgress(request.TransferProgress());\r\n    }\r\n    if (request.RequestPayer() == RequestPayer::Requester) {\r\n        pRequest.setRequestPayer(request.RequestPayer());\r\n    }\r\n    if (request.TrafficLimit() != 0) {\r\n        pRequest.setTrafficLimit(request.TrafficLimit());\r\n    }\r\n    return pRequest;\r\n}\r\n\r\nclass EncryptionResumableDownloader : public ResumableDownloader\r\n{\r\npublic:\r\n    EncryptionResumableDownloader(const DownloadObjectRequest& request, const  ObjectMetaData& meta,\r\n        const OssEncryptionClient* enClient, const OssClientImpl *client, uint64_t objectSize)\r\n        : ResumableDownloader(request, client, objectSize)\r\n        , encryptionClient_(enClient)\r\n        , metaData_(meta)\r\n    {\r\n        //16 bytes alignment\r\n        partSize_ = (partSize_ >> 4) << 4;\r\n    }\r\nprotected:\r\n    virtual GetObjectOutcome GetObjectWrap(const GetObjectRequest &request) const\r\n    {\r\n        return encryptionClient_->GetObjectInternal(request, metaData_);\r\n    }\r\nprivate:\r\n    const OssEncryptionClient* encryptionClient_;\r\n    const ObjectMetaData& metaData_;\r\n};\r\n\r\nclass EncryptionResumableUploader : public ResumableUploader\r\n{\r\npublic:\r\n    EncryptionResumableUploader(const UploadObjectRequest& request,\r\n        const OssEncryptionClient* enClient, const OssClientImpl *client)\r\n        : ResumableUploader(request, client)\r\n        , encryptionClient_(enClient)\r\n    {\r\n        //16 bytes alignment\r\n        partSize_ = (partSize_ >> 4) << 4;\r\n    }\r\nprotected:\r\n    virtual void initRecordInfo()\r\n    {\r\n        ResumableUploader::initRecordInfo();\r\n        encryptionCheckData_ = cryptoContext_.ContentMaterial().ContentIV();\r\n    }\r\n\r\n    virtual void buildRecordInfo(const Json::Value& value)\r\n    {\r\n        ResumableUploader::buildRecordInfo(value);\r\n        ContentCryptoMaterial material;\r\n        material.setEncryptedContentKey(Base64Decode(value[\"encryption-key\"].asString()));\r\n        material.setEncryptedContentIV(Base64Decode(value[\"encryption-iv\"].asString()));\r\n        material.setKeyWrapAlgorithm(value[\"encryption-wrap-alg\"].asString());\r\n        material.setDescription(JsonStringToMap(value[\"encryption-matdesc\"].asString()));\r\n        encryptionClient_->encryptionMaterials_->DecryptCEK(material);\r\n\r\n        material.setCipherName(value[\"encryption-cek-alg\"].asString());\r\n\r\n        cryptoContext_.setUploadId(value[\"uploadID\"].asString());\r\n        cryptoContext_.setDataSize(value[\"size\"].asInt64());\r\n        cryptoContext_.setPartSize(value[\"partSize\"].asInt64());\r\n        cryptoContext_.setContentMaterial(material);\r\n\r\n        encryptionCheckData_ = Base64Decode(value[\"encryption-check-data\"].asString());\r\n    }\r\n\r\n    virtual void dumpRecordInfo(Json::Value& value)\r\n    {\r\n        ResumableUploader::dumpRecordInfo(value);\r\n        const ByteBuffer& buff1 = cryptoContext_.ContentMaterial().EncryptedContentKey();\r\n        value[\"encryption-key\"] = Base64Encode((const char*)buff1.data(), (int)buff1.size());\r\n        const ByteBuffer& buff2 = cryptoContext_.ContentMaterial().EncryptedContentIV();\r\n        value[\"encryption-iv\"] = Base64Encode((const char*)buff2.data(), (int)buff2.size());\r\n        value[\"encryption-cek-alg\"] = cryptoContext_.ContentMaterial().CipherName();\r\n        value[\"encryption-wrap-alg\"] = cryptoContext_.ContentMaterial().KeyWrapAlgorithm();\r\n        value[\"encryption-matdesc\"] = MapToJsonString(cryptoContext_.ContentMaterial().Description());\r\n\r\n        const ByteBuffer& buff3 = cryptoContext_.ContentMaterial().ContentIV();\r\n        value[\"encryption-check-data\"] = Base64Encode((const char*)buff3.data(), (int)buff3.size());\r\n    }\r\n\r\n    virtual int validateRecord()\r\n    {\r\n        int ret = ResumableUploader::validateRecord();\r\n        if (ret != 0) {\r\n            return ret;\r\n        }\r\n\r\n        if (cryptoContext_.ContentMaterial().ContentKey().empty()||\r\n            cryptoContext_.ContentMaterial().ContentIV().empty() ||\r\n            cryptoContext_.ContentMaterial().CipherName().empty()) {\r\n            return -2;\r\n        }\r\n\r\n        if (encryptionCheckData_ != cryptoContext_.ContentMaterial().ContentIV()) {\r\n            return -2;\r\n        }\r\n\r\n        return 0;\r\n    }\r\n\r\n    virtual InitiateMultipartUploadOutcome InitiateMultipartUploadWrap(const InitiateMultipartUploadRequest &request) const\r\n    {\r\n        cryptoContext_.setPartSize(static_cast<int64_t>(partSize_));\r\n        cryptoContext_.setDataSize(static_cast<int64_t>(objectSize_));\r\n        return encryptionClient_->InitiateMultipartUpload(request, cryptoContext_);\r\n    }\r\n\r\n    virtual PutObjectOutcome UploadPartWrap(const UploadPartRequest &request) const\r\n    {\r\n        return encryptionClient_->UploadPart(request, cryptoContext_);\r\n    }\r\n\r\n    virtual ListPartsOutcome ListPartsWrap(const ListPartsRequest &request) const\r\n    {\r\n        return encryptionClient_->ListParts(request);\r\n    }\r\n\r\n    virtual CompleteMultipartUploadOutcome CompleteMultipartUploadWrap(const CompleteMultipartUploadRequest &request) const\r\n    {\r\n        return encryptionClient_->CompleteMultipartUpload(request, cryptoContext_);\r\n    }\r\nprivate:\r\n    const OssEncryptionClient* encryptionClient_;\r\n    mutable MultipartUploadCryptoContext cryptoContext_;\r\n    ByteBuffer encryptionCheckData_;\r\n};\r\n#endif\r\n}\r\n}\r\n///////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\r\nOssEncryptionClient::OssEncryptionClient(const std::string& endpoint, const std::string& accessKeyId, const std::string& accessKeySecret,\r\n    const ClientConfiguration& configuration,\r\n    const std::shared_ptr<EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig):\r\n    OssEncryptionClient(endpoint, accessKeyId, accessKeySecret, \"\", configuration, encryptionMaterials, cryptoConfig)\r\n{\r\n}\r\n\r\nOssEncryptionClient::OssEncryptionClient(const std::string& endpoint, const std::string& accessKeyId, const std::string& accessKeySecret, const std::string& securityToken,\r\n    const ClientConfiguration& configuration, const std::shared_ptr<EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig):\r\n    OssClient(endpoint, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret, securityToken), configuration),\r\n    encryptionMaterials_(encryptionMaterials),\r\n    cryptoConfig_(cryptoConfig)\r\n{\r\n}\r\n\r\nOssEncryptionClient::OssEncryptionClient(const std::string &endpoint, \r\n    const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration& configuration,\r\n    const std::shared_ptr<EncryptionMaterials>& encryptionMaterials, const CryptoConfiguration& cryptoConfig) :\r\n    OssClient(endpoint, credentialsProvider, configuration),\r\n    encryptionMaterials_(encryptionMaterials),\r\n    cryptoConfig_(cryptoConfig)\r\n{\r\n}\r\n\r\nOssEncryptionClient::~OssEncryptionClient()\r\n{\r\n}\r\n\r\nGetObjectOutcome OssEncryptionClient::GetObjectInternal(const GetObjectRequest& request, const ObjectMetaData& meta) const\r\n{\r\n    if (meta.hasUserHeader(\"client-side-encryption-key\")) {\r\n        auto module = CryptoModule::CreateCryptoModule(encryptionMaterials_, cryptoConfig_);\r\n        return module->GetObjectSecurely(client_, request, meta);\r\n    }\r\n    else {\r\n        return client_->GetObject(request);\r\n    }\r\n}\r\n\r\nGetObjectOutcome OssEncryptionClient::GetObject(const GetObjectRequest& request) const\r\n{\r\n    const auto& reqeustBase = static_cast<const OssRequest &>(request);\r\n    int ret = reqeustBase.validate();\r\n    if (ret != 0) {\r\n        return GetObjectOutcome(OssError(\"ValidateError\", request.validateMessage(ret)));\r\n    }\r\n\r\n    HeadObjectRequest hRequest(request.Bucket(), request.Key());\r\n    if (request.RequestPayer() == RequestPayer::Requester) {\r\n        hRequest.setRequestPayer(request.RequestPayer());\r\n    }\r\n    if (!request.VersionId().empty()) {\r\n        hRequest.setVersionId(request.VersionId());\r\n    }\r\n    auto outcome = client_->HeadObject(hRequest);\r\n    if (!outcome.isSuccess()) {\r\n        return GetObjectOutcome(outcome.error());\r\n    }\r\n\r\n    return GetObjectInternal(request, outcome.result());\r\n}\r\n\r\nGetObjectOutcome OssEncryptionClient::GetObject(const std::string &bucket, const std::string &key, const std::shared_ptr<std::iostream> &content) const\r\n{\r\n    GetObjectRequest request(bucket, key);\r\n    request.setResponseStreamFactory([=]() { return content; });\r\n    return GetObject(request);\r\n}\r\n\r\nGetObjectOutcome OssEncryptionClient::GetObject(const std::string &bucket, const std::string &key, const std::string &fileToSave) const\r\n{\r\n    GetObjectRequest request(bucket, key);\r\n    request.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(fileToSave, std::ios_base::out | std::ios_base::trunc | std::ios::binary); });\r\n    return GetObject(request);\r\n}\r\n\r\nPutObjectOutcome OssEncryptionClient::PutObject(const PutObjectRequest& request) const\r\n{\r\n    const auto& reqeustBase = static_cast<const OssRequest &>(request);\r\n    int ret = reqeustBase.validate();\r\n    if (ret != 0) {\r\n        return PutObjectOutcome(OssError(\"ValidateError\", request.validateMessage(ret)));\r\n    }\r\n    auto module = CryptoModule::CreateCryptoModule(encryptionMaterials_, cryptoConfig_);\r\n    return module->PutObjectSecurely(client_, request);\r\n}\r\n\r\nPutObjectOutcome OssEncryptionClient::PutObject(const std::string &bucket, const std::string &key, const std::shared_ptr<std::iostream> &content) const\r\n{\r\n    return PutObject(PutObjectRequest(bucket, key, content));\r\n}\r\n\r\nPutObjectOutcome OssEncryptionClient::PutObject(const std::string &bucket, const std::string &key, const std::string &fileToUpload) const\r\n{\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(fileToUpload, std::ios::in | std::ios::binary);\r\n    return PutObject(PutObjectRequest(bucket, key, content));\r\n}\r\n\r\nAppendObjectOutcome OssEncryptionClient::AppendObject(const AppendObjectRequest& request) const\r\n{\r\n    UNUSED_PARAM(request);\r\n    return AppendObjectOutcome(OssError(\"EncryptionClientError\", \"Not Support this operation.\"));\r\n}\r\n\r\n/*MultipartUpload*/\r\nInitiateMultipartUploadOutcome OssEncryptionClient::InitiateMultipartUpload(const InitiateMultipartUploadRequest& request, MultipartUploadCryptoContext& ctx) const\r\n{\r\n    auto module = CryptoModule::CreateCryptoModule(encryptionMaterials_, cryptoConfig_);\r\n    return module->InitiateMultipartUploadSecurely(client_, request, ctx);\r\n}\r\n\r\nPutObjectOutcome OssEncryptionClient::UploadPart(const UploadPartRequest& request, const MultipartUploadCryptoContext& ctx) const\r\n{\r\n    const auto& reqeustBase = static_cast<const OssRequest &>(request);\r\n    int ret = reqeustBase.validate();\r\n    if (ret != 0) {\r\n        return PutObjectOutcome(OssError(\"ValidateError\", request.validateMessage(ret)));\r\n    }\r\n    auto module = CryptoModule::CreateCryptoModule(encryptionMaterials_, cryptoConfig_);\r\n    return module->UploadPartSecurely(client_, request, ctx);\r\n}\r\n\r\nUploadPartCopyOutcome OssEncryptionClient::UploadPartCopy(const UploadPartCopyRequest& request, const MultipartUploadCryptoContext& ctx) const\r\n{\r\n    UNUSED_PARAM(request);\r\n    UNUSED_PARAM(ctx);\r\n    return UploadPartCopyOutcome(OssError(\"EncryptionClientError\", \"Not Support this operation.\"));\r\n}\r\n\r\nCompleteMultipartUploadOutcome OssEncryptionClient::CompleteMultipartUpload(const CompleteMultipartUploadRequest& request, const MultipartUploadCryptoContext& ctx) const\r\n{   \r\n    UNUSED_PARAM(ctx);\r\n    return OssClient::CompleteMultipartUpload(request);\r\n}\r\n\r\n#if !defined(DISABLE_RESUAMABLE)\r\n/*Resumable Operation*/\r\nPutObjectOutcome OssEncryptionClient::ResumableUploadObject(const UploadObjectRequest& request) const\r\n{\r\n    const auto& reqeustBase = static_cast<const OssResumableBaseRequest &>(request);\r\n    int code = reqeustBase.validate();\r\n    if (code != 0) {\r\n        return PutObjectOutcome(OssError(\"ValidateError\", reqeustBase.validateMessage(code)));\r\n    }\r\n\r\n    if (request.ObjectSize() <= request.PartSize()) {\r\n        auto pRequest = ConvertToPutObjectRequest(request);\r\n        return PutObject(pRequest);\r\n    }\r\n    else {\r\n        EncryptionResumableUploader uploader(request, this, client_.get());\r\n        return uploader.Upload();\r\n    }\r\n}\r\n\r\nCopyObjectOutcome OssEncryptionClient::ResumableCopyObject(const MultiCopyObjectRequest& request) const\r\n{\r\n    UNUSED_PARAM(request);\r\n    return CopyObjectOutcome(OssError(\"EncryptionClientError\", \"Not Support this operation.\"));\r\n}\r\n\r\nGetObjectOutcome OssEncryptionClient::ResumableDownloadObject(const DownloadObjectRequest& request) const\r\n{\r\n    HeadObjectRequest hRequest(request.Bucket(), request.Key());\r\n    if (request.RequestPayer() == RequestPayer::Requester) {\r\n        hRequest.setRequestPayer(request.RequestPayer());\r\n    }\r\n    if (!request.VersionId().empty()) {\r\n        hRequest.setVersionId(request.VersionId());\r\n    }\r\n    auto hOutcome = client_->HeadObject(hRequest);\r\n    if (!hOutcome.isSuccess()) {\r\n        return GetObjectOutcome(hOutcome.error());\r\n    }\r\n    auto objectSize = static_cast<uint64_t>(hOutcome.result().ContentLength());\r\n    if (objectSize <= request.PartSize()) {\r\n        auto gRequest = ConvertToGetObjectRequest(request);\r\n        auto gOutcome = GetObjectInternal(gRequest, hOutcome.result());\r\n        if (gOutcome.isSuccess()) {\r\n            gOutcome.result().setContent(nullptr);\r\n        }\r\n        return gOutcome;\r\n    }\r\n    else {\r\n        const auto& reqeustBase = static_cast<const OssResumableBaseRequest &>(request);\r\n        int code = reqeustBase.validate();\r\n        if (code != 0) {\r\n            return GetObjectOutcome(OssError(\"ValidateError\", reqeustBase.validateMessage(code)));\r\n        }\r\n        if (hOutcome.result().UserMetaData().find(\"client-side-encryption-key\") != hOutcome.result().UserMetaData().end()) {\r\n            EncryptionResumableDownloader downloader(request, hOutcome.result(), this, client_.get(), objectSize);\r\n            return downloader.Download();\r\n        }\r\n        else {\r\n            ResumableDownloader downloader(request, client_.get(), objectSize);\r\n            return downloader.Download();\r\n        }\r\n    }\r\n}\r\n#endif\r\n\r\n/*Aysnc APIs*/\r\nvoid OssEncryptionClient::GetObjectAsync(const GetObjectRequest& request, const GetObjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const\r\n{\r\n    auto fn = [this, request, handler, context]()\r\n    {\r\n        handler(this, request, GetObject(request), context);\r\n    };\r\n\r\n    client_->asyncExecute(new Runnable(fn));\r\n}\r\n\r\nvoid OssEncryptionClient::PutObjectAsync(const PutObjectRequest& request, const PutObjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const\r\n{\r\n    auto fn = [this, request, handler, context]()\r\n    {\r\n        handler(this, request, PutObject(request), context);\r\n    };\r\n\r\n    client_->asyncExecute(new Runnable(fn));\r\n}\r\n\r\nvoid OssEncryptionClient::UploadPartAsync(const UploadPartRequest& request, const UploadPartAsyncHandler& handler, const MultipartUploadCryptoContext& cryptoCtx, const std::shared_ptr<const AsyncCallerContext>& context) const\r\n{\r\n    auto fn = [this, request, handler, cryptoCtx, context]()\r\n    {\r\n        handler(this, request, UploadPart(request, cryptoCtx), context);\r\n    };\r\n\r\n    client_->asyncExecute(new Runnable(fn));\r\n}\r\n\r\nvoid OssEncryptionClient::UploadPartCopyAsync(const UploadPartCopyRequest& request, const UploadPartCopyAsyncHandler& handler, const MultipartUploadCryptoContext& cryptoCtx, const std::shared_ptr<const AsyncCallerContext>& context) const\r\n{\r\n    auto fn = [this, request, handler, cryptoCtx, context]()\r\n    {\r\n        handler(this, request, UploadPartCopy(request, cryptoCtx), context);\r\n    };\r\n\r\n    client_->asyncExecute(new Runnable(fn));\r\n}\r\n\r\n/*Callable APIs*/\r\nGetObjectOutcomeCallable OssEncryptionClient::GetObjectCallable(const GetObjectRequest& request) const\r\n{\r\n    auto task = std::make_shared<std::packaged_task<GetObjectOutcome()>>(\r\n        [this, request]()\r\n    {\r\n        return GetObject(request);\r\n    });\r\n    client_->asyncExecute(new Runnable([task]() { (*task)(); }));\r\n    return task->get_future();\r\n}\r\n\r\nPutObjectOutcomeCallable OssEncryptionClient::PutObjectCallable(const PutObjectRequest& request) const\r\n{\r\n    auto task = std::make_shared<std::packaged_task<PutObjectOutcome()>>(\r\n        [this, request]()\r\n    {\r\n        return PutObject(request);\r\n    });\r\n    client_->asyncExecute(new Runnable([task]() { (*task)(); }));\r\n    return task->get_future();\r\n}\r\n\r\nPutObjectOutcomeCallable OssEncryptionClient::UploadPartCallable(const UploadPartRequest& request, const MultipartUploadCryptoContext& cryptoCtx) const\r\n{\r\n    auto task = std::make_shared<std::packaged_task<PutObjectOutcome()>>(\r\n        [this, request, cryptoCtx]()\r\n    {\r\n        return UploadPart(request, cryptoCtx);\r\n    });\r\n    client_->asyncExecute(new Runnable([task]() { (*task)(); }));\r\n    return task->get_future();\r\n}\r\n\r\nUploadPartCopyOutcomeCallable OssEncryptionClient::UploadPartCopyCallable(const UploadPartCopyRequest& request, const MultipartUploadCryptoContext& cryptoCtx) const\r\n{\r\n    auto task = std::make_shared<std::packaged_task<UploadPartCopyOutcome()>>(\r\n        [this, request, cryptoCtx]()\r\n    {\r\n        return UploadPartCopy(request, cryptoCtx);\r\n    });\r\n    client_->asyncExecute(new Runnable([task]() { (*task)(); }));\r\n    return task->get_future();\r\n}\r\n\r\n/*Generate URL*/\r\nGetObjectOutcome OssEncryptionClient::GetObjectByUrl(const GetObjectByUrlRequest& request) const\r\n{\r\n    UNUSED_PARAM(request);\r\n    return GetObjectOutcome(OssError(\"EncryptionClientError\", \"Not Support this operation.\"));\r\n}\r\n\r\nPutObjectOutcome OssEncryptionClient::PutObjectByUrl(const PutObjectByUrlRequest& request) const\r\n{\r\n    UNUSED_PARAM(request);\r\n    return PutObjectOutcome(OssError(\"EncryptionClientError\", \"Not Support this operation.\"));\r\n}"
  },
  {
    "path": "sdk/src/external/json/json-forwards.h",
    "content": "/// Json-cpp amalgamated forward header (http://jsoncpp.sourceforge.net/).\n/// It is intended to be used with #include \"json/json-forwards.h\"\n/// This header provides forward declaration for all JsonCpp types.\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: LICENSE\n// //////////////////////////////////////////////////////////////////////\n\n/*\nThe JsonCpp library's source code, including accompanying documentation, \ntests and demonstration applications, are licensed under the following\nconditions...\n\nBaptiste Lepilleur and The JsonCpp Authors explicitly disclaim copyright in all \njurisdictions which recognize such a disclaimer. In such jurisdictions, \nthis software is released into the Public Domain.\n\nIn jurisdictions which do not recognize Public Domain property (e.g. Germany as of\n2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur and\nThe JsonCpp Authors, and is released under the terms of the MIT License (see below).\n\nIn jurisdictions which recognize Public Domain property, the user of this \nsoftware may choose to accept it either as 1) Public Domain, 2) under the \nconditions of the MIT License (see below), or 3) under the terms of dual \nPublic Domain/MIT License conditions described here, as they choose.\n\nThe MIT License is about as close to Public Domain as a license can get, and is\ndescribed in clear, concise terms at:\n\n   http://en.wikipedia.org/wiki/MIT_License\n   \nThe full text of the MIT License follows:\n\n========================================================================\nCopyright (c) 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use, copy,\nmodify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\nBE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\nACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n========================================================================\n(END LICENSE TEXT)\n\nThe MIT license is compatible with both the GPL and commercial\nsoftware, affording one all of the rights of Public Domain with the\nminor nuisance of being required to keep the above copyright notice\nand license text in the source code. Note also that by accepting the\nPublic Domain \"license\" you can re-license your copy using whatever\nlicense you like.\n\n*/\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: LICENSE\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n#ifndef JSON_FORWARD_AMALGAMATED_H_INCLUDED\n# define JSON_FORWARD_AMALGAMATED_H_INCLUDED\n/// If defined, indicates that the source file is amalgamated\n/// to prevent private header inclusion.\n#define JSON_IS_AMALGAMATION\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: include/json/config.h\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#ifndef JSON_CONFIG_H_INCLUDED\n#define JSON_CONFIG_H_INCLUDED\n#include <stddef.h>\n#include <string> //typedef String\n#include <stdint.h> //typedef int64_t, uint64_t\n\n/// If defined, indicates that json library is embedded in CppTL library.\n//# define JSON_IN_CPPTL 1\n\n/// If defined, indicates that json may leverage CppTL library\n//#  define JSON_USE_CPPTL 1\n/// If defined, indicates that cpptl vector based map should be used instead of\n/// std::map\n/// as Value container.\n//#  define JSON_USE_CPPTL_SMALLMAP 1\n#define JSON_USE_EXCEPTION 0\n// If non-zero, the library uses exceptions to report bad input instead of C\n// assertion macros. The default is to use exceptions.\n#ifndef JSON_USE_EXCEPTION\n#define JSON_USE_EXCEPTION 1\n#endif\n\n/// If defined, indicates that the source file is amalgamated\n/// to prevent private header inclusion.\n/// Remarks: it is automatically defined in the generated amalgamated header.\n// #define JSON_IS_AMALGAMATION\n\n#ifdef JSON_IN_CPPTL\n#include <cpptl/config.h>\n#ifndef JSON_USE_CPPTL\n#define JSON_USE_CPPTL 1\n#endif\n#endif\n\n#ifdef JSON_IN_CPPTL\n#define JSON_API CPPTL_API\n#elif defined(JSON_DLL_BUILD)\n#if defined(_MSC_VER) || defined(__MINGW32__)\n#define JSON_API __declspec(dllexport)\n#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING\n#endif // if defined(_MSC_VER)\n#elif defined(JSON_DLL)\n#if defined(_MSC_VER) || defined(__MINGW32__)\n#define JSON_API __declspec(dllimport)\n#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING\n#endif // if defined(_MSC_VER)\n#endif // ifdef JSON_IN_CPPTL\n#if !defined(JSON_API)\n#define JSON_API\n#endif\n\n// If JSON_NO_INT64 is defined, then Json only support C++ \"int\" type for\n// integer\n// Storages, and 64 bits integer support is disabled.\n// #define JSON_NO_INT64 1\n\n#if defined(_MSC_VER) // MSVC\n#  if _MSC_VER <= 1200 // MSVC 6\n    // Microsoft Visual Studio 6 only support conversion from __int64 to double\n    // (no conversion from unsigned __int64).\n#    define JSON_USE_INT64_DOUBLE_CONVERSION 1\n    // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'\n    // characters in the debug information)\n    // All projects I've ever seen with VS6 were using this globally (not bothering\n    // with pragma push/pop).\n#    pragma warning(disable : 4786)\n#  endif // MSVC 6\n\n#  if _MSC_VER >= 1500 // MSVC 2008\n    /// Indicates that the following function is deprecated.\n#    define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))\n#  endif\n\n#endif // defined(_MSC_VER)\n\n// In c++11 the override keyword allows you to explicitly define that a function\n// is intended to override the base-class version.  This makes the code more\n// managable and fixes a set of common hard-to-find bugs.\n#if __cplusplus >= 201103L\n# define JSONCPP_OVERRIDE override\n# define JSONCPP_NOEXCEPT noexcept\n#elif defined(_MSC_VER) && _MSC_VER > 1600 && _MSC_VER < 1900\n# define JSONCPP_OVERRIDE override\n# define JSONCPP_NOEXCEPT throw()\n#elif defined(_MSC_VER) && _MSC_VER >= 1900\n# define JSONCPP_OVERRIDE override\n# define JSONCPP_NOEXCEPT noexcept\n#else\n# define JSONCPP_OVERRIDE\n# define JSONCPP_NOEXCEPT throw()\n#endif\n\n#ifndef JSON_HAS_RVALUE_REFERENCES\n\n#if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010\n#define JSON_HAS_RVALUE_REFERENCES 1\n#endif // MSVC >= 2010\n\n#ifdef __clang__\n#if __has_feature(cxx_rvalue_references)\n#define JSON_HAS_RVALUE_REFERENCES 1\n#endif  // has_feature\n\n#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)\n#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)\n#define JSON_HAS_RVALUE_REFERENCES 1\n#endif  // GXX_EXPERIMENTAL\n\n#endif // __clang__ || __GNUC__\n\n#endif // not defined JSON_HAS_RVALUE_REFERENCES\n\n#ifndef JSON_HAS_RVALUE_REFERENCES\n#define JSON_HAS_RVALUE_REFERENCES 0\n#endif\n\n#ifdef __clang__\n#  if __has_extension(attribute_deprecated_with_message)\n#    define JSONCPP_DEPRECATED(message)  __attribute__ ((deprecated(message)))\n#  endif\n#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)\n#  if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))\n#    define JSONCPP_DEPRECATED(message)  __attribute__ ((deprecated(message)))\n#  elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))\n#    define JSONCPP_DEPRECATED(message)  __attribute__((__deprecated__))\n#  endif  // GNUC version\n#endif // __clang__ || __GNUC__\n\n#if !defined(JSONCPP_DEPRECATED)\n#define JSONCPP_DEPRECATED(message)\n#endif // if !defined(JSONCPP_DEPRECATED)\n\n#if __GNUC__ >= 6\n#  define JSON_USE_INT64_DOUBLE_CONVERSION 1\n#endif\n\n#if !defined(JSON_IS_AMALGAMATION)\n\n# include \"version.h\"\n\n# if JSONCPP_USING_SECURE_MEMORY\n#  include \"allocator.h\" //typedef Allocator\n# endif\n\n#endif // if !defined(JSON_IS_AMALGAMATION)\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\nnamespace Json {\ntypedef int Int;\ntypedef unsigned int UInt;\n#if defined(JSON_NO_INT64)\ntypedef int LargestInt;\ntypedef unsigned int LargestUInt;\n#undef JSON_HAS_INT64\n#else                 // if defined(JSON_NO_INT64)\n// For Microsoft Visual use specific types as long long is not supported\n#if defined(_MSC_VER) // Microsoft Visual Studio\ntypedef __int64 Int64;\ntypedef unsigned __int64 UInt64;\n#else                 // if defined(_MSC_VER) // Other platforms, use long long\ntypedef int64_t Int64;\ntypedef uint64_t UInt64;\n#endif // if defined(_MSC_VER)\ntypedef Int64 LargestInt;\ntypedef UInt64 LargestUInt;\n#define JSON_HAS_INT64\n#endif // if defined(JSON_NO_INT64)\n#if JSONCPP_USING_SECURE_MEMORY\n#define JSONCPP_STRING        std::basic_string<char, std::char_traits<char>, Json::SecureAllocator<char> >\n#define JSONCPP_OSTRINGSTREAM std::basic_ostringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >\n#define JSONCPP_OSTREAM       std::basic_ostream<char, std::char_traits<char>>\n#define JSONCPP_ISTRINGSTREAM std::basic_istringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >\n#define JSONCPP_ISTREAM       std::istream\n#else\n#define JSONCPP_STRING        std::string\n#define JSONCPP_OSTRINGSTREAM std::ostringstream\n#define JSONCPP_OSTREAM       std::ostream\n#define JSONCPP_ISTRINGSTREAM std::istringstream\n#define JSONCPP_ISTREAM       std::istream\n#endif // if JSONCPP_USING_SECURE_MEMORY\n} // end namespace Json\n}\n}\n#endif // JSON_CONFIG_H_INCLUDED\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: include/json/config.h\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: include/json/forwards.h\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#ifndef JSON_FORWARDS_H_INCLUDED\n#define JSON_FORWARDS_H_INCLUDED\n\n#if !defined(JSON_IS_AMALGAMATION)\n#include \"config.h\"\n#endif // if !defined(JSON_IS_AMALGAMATION)\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\nnamespace Json {\n\n// writer.h\nclass FastWriter;\nclass StyledWriter;\n\n// reader.h\nclass Reader;\n\n// features.h\nclass Features;\n\n// value.h\ntypedef unsigned int ArrayIndex;\nclass StaticString;\nclass Path;\nclass PathArgument;\nclass Value;\nclass ValueIteratorBase;\nclass ValueIterator;\nclass ValueConstIterator;\n\n} // namespace Json\n}\n}\n#endif // JSON_FORWARDS_H_INCLUDED\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: include/json/forwards.h\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n#endif //ifndef JSON_FORWARD_AMALGAMATED_H_INCLUDED\n"
  },
  {
    "path": "sdk/src/external/json/json.h",
    "content": "/// Json-cpp amalgamated header (http://jsoncpp.sourceforge.net/).\n/// It is intended to be used with #include \"json/json.h\"\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: LICENSE\n// //////////////////////////////////////////////////////////////////////\n\n/*\nThe JsonCpp library's source code, including accompanying documentation, \ntests and demonstration applications, are licensed under the following\nconditions...\n\nBaptiste Lepilleur and The JsonCpp Authors explicitly disclaim copyright in all \njurisdictions which recognize such a disclaimer. In such jurisdictions, \nthis software is released into the Public Domain.\n\nIn jurisdictions which do not recognize Public Domain property (e.g. Germany as of\n2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur and\nThe JsonCpp Authors, and is released under the terms of the MIT License (see below).\n\nIn jurisdictions which recognize Public Domain property, the user of this \nsoftware may choose to accept it either as 1) Public Domain, 2) under the \nconditions of the MIT License (see below), or 3) under the terms of dual \nPublic Domain/MIT License conditions described here, as they choose.\n\nThe MIT License is about as close to Public Domain as a license can get, and is\ndescribed in clear, concise terms at:\n\n   http://en.wikipedia.org/wiki/MIT_License\n   \nThe full text of the MIT License follows:\n\n========================================================================\nCopyright (c) 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use, copy,\nmodify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\nBE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\nACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n========================================================================\n(END LICENSE TEXT)\n\nThe MIT license is compatible with both the GPL and commercial\nsoftware, affording one all of the rights of Public Domain with the\nminor nuisance of being required to keep the above copyright notice\nand license text in the source code. Note also that by accepting the\nPublic Domain \"license\" you can re-license your copy using whatever\nlicense you like.\n\n*/\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: LICENSE\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n#ifndef JSON_AMALGAMATED_H_INCLUDED\n# define JSON_AMALGAMATED_H_INCLUDED\n/// If defined, indicates that the source file is amalgamated\n/// to prevent private header inclusion.\n#define JSON_IS_AMALGAMATION\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: include/json/version.h\n// //////////////////////////////////////////////////////////////////////\n\n// DO NOT EDIT. This file (and \"version\") is generated by CMake.\n// Run CMake configure step to update it.\n#ifndef JSON_VERSION_H_INCLUDED\n# define JSON_VERSION_H_INCLUDED\n\n# define JSONCPP_VERSION_STRING \"1.8.4\"\n# define JSONCPP_VERSION_MAJOR 1\n# define JSONCPP_VERSION_MINOR 8\n# define JSONCPP_VERSION_PATCH 4\n# define JSONCPP_VERSION_QUALIFIER\n# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))\n\n#ifdef JSONCPP_USING_SECURE_MEMORY\n#undef JSONCPP_USING_SECURE_MEMORY\n#endif\n#define JSONCPP_USING_SECURE_MEMORY 0\n// If non-zero, the library zeroes any memory that it has allocated before\n// it frees its memory.\n\n#endif // JSON_VERSION_H_INCLUDED\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: include/json/version.h\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: include/json/config.h\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#ifndef JSON_CONFIG_H_INCLUDED\n#define JSON_CONFIG_H_INCLUDED\n#include <stddef.h>\n#include <string> //typedef String\n#include <stdint.h> //typedef int64_t, uint64_t\n\n/// If defined, indicates that json library is embedded in CppTL library.\n//# define JSON_IN_CPPTL 1\n\n/// If defined, indicates that json may leverage CppTL library\n//#  define JSON_USE_CPPTL 1\n/// If defined, indicates that cpptl vector based map should be used instead of\n/// std::map\n/// as Value container.\n//#  define JSON_USE_CPPTL_SMALLMAP 1\n\n// If non-zero, the library uses exceptions to report bad input instead of C\n// assertion macros. The default is to use exceptions.\n#define JSON_USE_EXCEPTION 0\n#ifndef JSON_USE_EXCEPTION\n#define JSON_USE_EXCEPTION 1\n#endif\n\n/// If defined, indicates that the source file is amalgamated\n/// to prevent private header inclusion.\n/// Remarks: it is automatically defined in the generated amalgamated header.\n// #define JSON_IS_AMALGAMATION\n\n#ifdef JSON_IN_CPPTL\n#include <cpptl/config.h>\n#ifndef JSON_USE_CPPTL\n#define JSON_USE_CPPTL 1\n#endif\n#endif\n\n#ifdef JSON_IN_CPPTL\n#define JSON_API CPPTL_API\n#elif defined(JSON_DLL_BUILD)\n#if defined(_MSC_VER) || defined(__MINGW32__)\n#define JSON_API __declspec(dllexport)\n#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING\n#endif // if defined(_MSC_VER)\n#elif defined(JSON_DLL)\n#if defined(_MSC_VER) || defined(__MINGW32__)\n#define JSON_API __declspec(dllimport)\n#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING\n#endif // if defined(_MSC_VER)\n#endif // ifdef JSON_IN_CPPTL\n#if !defined(JSON_API)\n#define JSON_API\n#endif\n\n// If JSON_NO_INT64 is defined, then Json only support C++ \"int\" type for\n// integer\n// Storages, and 64 bits integer support is disabled.\n// #define JSON_NO_INT64 1\n\n#if defined(_MSC_VER) // MSVC\n#  if _MSC_VER <= 1200 // MSVC 6\n    // Microsoft Visual Studio 6 only support conversion from __int64 to double\n    // (no conversion from unsigned __int64).\n#    define JSON_USE_INT64_DOUBLE_CONVERSION 1\n    // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'\n    // characters in the debug information)\n    // All projects I've ever seen with VS6 were using this globally (not bothering\n    // with pragma push/pop).\n#    pragma warning(disable : 4786)\n#  endif // MSVC 6\n\n#  if _MSC_VER >= 1500 // MSVC 2008\n    /// Indicates that the following function is deprecated.\n#    define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))\n#  endif\n\n#endif // defined(_MSC_VER)\n\n// In c++11 the override keyword allows you to explicitly define that a function\n// is intended to override the base-class version.  This makes the code more\n// managable and fixes a set of common hard-to-find bugs.\n#if __cplusplus >= 201103L\n# define JSONCPP_OVERRIDE override\n# define JSONCPP_NOEXCEPT noexcept\n#elif defined(_MSC_VER) && _MSC_VER > 1600 && _MSC_VER < 1900\n# define JSONCPP_OVERRIDE override\n# define JSONCPP_NOEXCEPT throw()\n#elif defined(_MSC_VER) && _MSC_VER >= 1900\n# define JSONCPP_OVERRIDE override\n# define JSONCPP_NOEXCEPT noexcept\n#else\n# define JSONCPP_OVERRIDE\n# define JSONCPP_NOEXCEPT throw()\n#endif\n\n#ifndef JSON_HAS_RVALUE_REFERENCES\n\n#if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010\n#define JSON_HAS_RVALUE_REFERENCES 1\n#endif // MSVC >= 2010\n\n#ifdef __clang__\n#if __has_feature(cxx_rvalue_references)\n#define JSON_HAS_RVALUE_REFERENCES 1\n#endif  // has_feature\n\n#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)\n#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)\n#define JSON_HAS_RVALUE_REFERENCES 1\n#endif  // GXX_EXPERIMENTAL\n\n#endif // __clang__ || __GNUC__\n\n#endif // not defined JSON_HAS_RVALUE_REFERENCES\n\n#ifndef JSON_HAS_RVALUE_REFERENCES\n#define JSON_HAS_RVALUE_REFERENCES 0\n#endif\n\n#ifdef __clang__\n#  if __has_extension(attribute_deprecated_with_message)\n#    define JSONCPP_DEPRECATED(message)  __attribute__ ((deprecated(message)))\n#  endif\n#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)\n#  if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))\n#    define JSONCPP_DEPRECATED(message)  __attribute__ ((deprecated(message)))\n#  elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))\n#    define JSONCPP_DEPRECATED(message)  __attribute__((__deprecated__))\n#  endif  // GNUC version\n#endif // __clang__ || __GNUC__\n\n#if !defined(JSONCPP_DEPRECATED)\n#define JSONCPP_DEPRECATED(message)\n#endif // if !defined(JSONCPP_DEPRECATED)\n\n#if __GNUC__ >= 6\n#  define JSON_USE_INT64_DOUBLE_CONVERSION 1\n#endif\n\n#if !defined(JSON_IS_AMALGAMATION)\n\n# include \"version.h\"\n\n# if JSONCPP_USING_SECURE_MEMORY\n#  include \"allocator.h\" //typedef Allocator\n# endif\n\n#endif // if !defined(JSON_IS_AMALGAMATION)\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\nnamespace Json {\ntypedef int Int;\ntypedef unsigned int UInt;\n#if defined(JSON_NO_INT64)\ntypedef int LargestInt;\ntypedef unsigned int LargestUInt;\n#undef JSON_HAS_INT64\n#else                 // if defined(JSON_NO_INT64)\n// For Microsoft Visual use specific types as long long is not supported\n#if defined(_MSC_VER) // Microsoft Visual Studio\ntypedef __int64 Int64;\ntypedef unsigned __int64 UInt64;\n#else                 // if defined(_MSC_VER) // Other platforms, use long long\ntypedef int64_t Int64;\ntypedef uint64_t UInt64;\n#endif // if defined(_MSC_VER)\ntypedef Int64 LargestInt;\ntypedef UInt64 LargestUInt;\n#define JSON_HAS_INT64\n#endif // if defined(JSON_NO_INT64)\n#if JSONCPP_USING_SECURE_MEMORY\n#define JSONCPP_STRING        std::basic_string<char, std::char_traits<char>, Json::SecureAllocator<char> >\n#define JSONCPP_OSTRINGSTREAM std::basic_ostringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >\n#define JSONCPP_OSTREAM       std::basic_ostream<char, std::char_traits<char>>\n#define JSONCPP_ISTRINGSTREAM std::basic_istringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >\n#define JSONCPP_ISTREAM       std::istream\n#else\n#define JSONCPP_STRING        std::string\n#define JSONCPP_OSTRINGSTREAM std::ostringstream\n#define JSONCPP_OSTREAM       std::ostream\n#define JSONCPP_ISTRINGSTREAM std::istringstream\n#define JSONCPP_ISTREAM       std::istream\n#endif // if JSONCPP_USING_SECURE_MEMORY\n} // end namespace Json\n}\n}\n#endif // JSON_CONFIG_H_INCLUDED\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: include/json/config.h\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: include/json/forwards.h\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#ifndef JSON_FORWARDS_H_INCLUDED\n#define JSON_FORWARDS_H_INCLUDED\n\n#if !defined(JSON_IS_AMALGAMATION)\n#include \"config.h\"\n#endif // if !defined(JSON_IS_AMALGAMATION)\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\nnamespace Json {\n\n// writer.h\nclass FastWriter;\nclass StyledWriter;\n\n// reader.h\nclass Reader;\n\n// features.h\nclass Features;\n\n// value.h\ntypedef unsigned int ArrayIndex;\nclass StaticString;\nclass Path;\nclass PathArgument;\nclass Value;\nclass ValueIteratorBase;\nclass ValueIterator;\nclass ValueConstIterator;\n\n} // namespace Json\n}\n}\n#endif // JSON_FORWARDS_H_INCLUDED\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: include/json/forwards.h\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: include/json/features.h\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#ifndef CPPTL_JSON_FEATURES_H_INCLUDED\n#define CPPTL_JSON_FEATURES_H_INCLUDED\n\n#if !defined(JSON_IS_AMALGAMATION)\n#include \"forwards.h\"\n#endif // if !defined(JSON_IS_AMALGAMATION)\n\n#pragma pack(push, 8)\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\nnamespace Json {\n\n/** \\brief Configuration passed to reader and writer.\n * This configuration object can be used to force the Reader or Writer\n * to behave in a standard conforming way.\n */\nclass JSON_API Features {\npublic:\n  /** \\brief A configuration that allows all features and assumes all strings\n   * are UTF-8.\n   * - C & C++ comments are allowed\n   * - Root object can be any JSON value\n   * - Assumes Value strings are encoded in UTF-8\n   */\n  static Features all();\n\n  /** \\brief A configuration that is strictly compatible with the JSON\n   * specification.\n   * - Comments are forbidden.\n   * - Root object must be either an array or an object value.\n   * - Assumes Value strings are encoded in UTF-8\n   */\n  static Features strictMode();\n\n  /** \\brief Initialize the configuration like JsonConfig::allFeatures;\n   */\n  Features();\n\n  /// \\c true if comments are allowed. Default: \\c true.\n  bool allowComments_;\n\n  /// \\c true if root must be either an array or an object value. Default: \\c\n  /// false.\n  bool strictRoot_;\n\n  /// \\c true if dropped null placeholders are allowed. Default: \\c false.\n  bool allowDroppedNullPlaceholders_;\n\n  /// \\c true if numeric object key are allowed. Default: \\c false.\n  bool allowNumericKeys_;\n};\n\n} // namespace Json\n}\n}\n#pragma pack(pop)\n\n#endif // CPPTL_JSON_FEATURES_H_INCLUDED\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: include/json/features.h\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: include/json/value.h\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#ifndef CPPTL_JSON_H_INCLUDED\n#define CPPTL_JSON_H_INCLUDED\n\n#if !defined(JSON_IS_AMALGAMATION)\n#include \"forwards.h\"\n#endif // if !defined(JSON_IS_AMALGAMATION)\n#include <string>\n#include <vector>\n#include <exception>\n\n#ifndef JSON_USE_CPPTL_SMALLMAP\n#include <map>\n#else\n#include <cpptl/smallmap.h>\n#endif\n#ifdef JSON_USE_CPPTL\n#include <cpptl/forwards.h>\n#endif\n\n//Conditional NORETURN attribute on the throw functions would:\n// a) suppress false positives from static code analysis\n// b) possibly improve optimization opportunities.\n#if !defined(JSONCPP_NORETURN)\n#  if defined(_MSC_VER)\n#    define JSONCPP_NORETURN __declspec(noreturn)\n#  elif defined(__GNUC__)\n#    define JSONCPP_NORETURN __attribute__ ((__noreturn__))\n#  else\n#    define JSONCPP_NORETURN\n#  endif\n#endif\n\n// Disable warning C4251: <data member>: <type> needs to have dll-interface to\n// be used by...\n#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)\n#pragma warning(push)\n#pragma warning(disable : 4251)\n#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)\n\n#pragma pack(push, 8)\n\n/** \\brief JSON (JavaScript Object Notation).\n */\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\nnamespace Json {\n\n/** Base class for all exceptions we throw.\n *\n * We use nothing but these internally. Of course, STL can throw others.\n */\nclass JSON_API Exception : public std::exception {\npublic:\n  Exception(JSONCPP_STRING const& msg);\n  ~Exception() JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;\n  char const* what() const JSONCPP_NOEXCEPT JSONCPP_OVERRIDE;\nprotected:\n  JSONCPP_STRING msg_;\n};\n\n/** Exceptions which the user cannot easily avoid.\n *\n * E.g. out-of-memory (when we use malloc), stack-overflow, malicious input\n *\n * \\remark derived from Json::Exception\n */\nclass JSON_API RuntimeError : public Exception {\npublic:\n  RuntimeError(JSONCPP_STRING const& msg);\n};\n\n/** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.\n *\n * These are precondition-violations (user bugs) and internal errors (our bugs).\n *\n * \\remark derived from Json::Exception\n */\nclass JSON_API LogicError : public Exception {\npublic:\n  LogicError(JSONCPP_STRING const& msg);\n};\n\n/// used internally\nJSONCPP_NORETURN void throwRuntimeError(JSONCPP_STRING const& msg);\n/// used internally\nJSONCPP_NORETURN void throwLogicError(JSONCPP_STRING const& msg);\n\n/** \\brief Type of the value held by a Value object.\n */\nenum ValueType {\n  nullValue = 0, ///< 'null' value\n  intValue,      ///< signed integer value\n  uintValue,     ///< unsigned integer value\n  realValue,     ///< double value\n  stringValue,   ///< UTF-8 string value\n  booleanValue,  ///< bool value\n  arrayValue,    ///< array value (ordered list)\n  objectValue    ///< object value (collection of name/value pairs).\n};\n\nenum CommentPlacement {\n  commentBefore = 0,      ///< a comment placed on the line before a value\n  commentAfterOnSameLine, ///< a comment just after a value on the same line\n  commentAfter, ///< a comment on the line after a value (only make sense for\n  /// root value)\n  numberOfCommentPlacement\n};\n\n//# ifdef JSON_USE_CPPTL\n//   typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;\n//   typedef CppTL::AnyEnumerator<const Value &> EnumValues;\n//# endif\n\n/** \\brief Lightweight wrapper to tag static string.\n *\n * Value constructor and objectValue member assignment takes advantage of the\n * StaticString and avoid the cost of string duplication when storing the\n * string or the member name.\n *\n * Example of usage:\n * \\code\n * Json::Value aValue( StaticString(\"some text\") );\n * Json::Value object;\n * static const StaticString code(\"code\");\n * object[code] = 1234;\n * \\endcode\n */\nclass JSON_API StaticString {\npublic:\n  explicit StaticString(const char* czstring) : c_str_(czstring) {}\n\n  operator const char*() const { return c_str_; }\n\n  const char* c_str() const { return c_str_; }\n\nprivate:\n  const char* c_str_;\n};\n\n/** \\brief Represents a <a HREF=\"http://www.json.org\">JSON</a> value.\n *\n * This class is a discriminated union wrapper that can represents a:\n * - signed integer [range: Value::minInt - Value::maxInt]\n * - unsigned integer (range: 0 - Value::maxUInt)\n * - double\n * - UTF-8 string\n * - boolean\n * - 'null'\n * - an ordered list of Value\n * - collection of name/value pairs (javascript object)\n *\n * The type of the held value is represented by a #ValueType and\n * can be obtained using type().\n *\n * Values of an #objectValue or #arrayValue can be accessed using operator[]()\n * methods.\n * Non-const methods will automatically create the a #nullValue element\n * if it does not exist.\n * The sequence of an #arrayValue will be automatically resized and initialized\n * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue.\n *\n * The get() methods can be used to obtain default value in the case the\n * required element does not exist.\n *\n * It is possible to iterate over the list of a #objectValue values using\n * the getMemberNames() method.\n *\n * \\note #Value string-length fit in size_t, but keys must be < 2^30.\n * (The reason is an implementation detail.) A #CharReader will raise an\n * exception if a bound is exceeded to avoid security holes in your app,\n * but the Value API does *not* check bounds. That is the responsibility\n * of the caller.\n */\nclass JSON_API Value {\n  friend class ValueIteratorBase;\npublic:\n  typedef std::vector<JSONCPP_STRING> Members;\n  typedef ValueIterator iterator;\n  typedef ValueConstIterator const_iterator;\n  typedef Json::UInt UInt;\n  typedef Json::Int Int;\n#if defined(JSON_HAS_INT64)\n  typedef Json::UInt64 UInt64;\n  typedef Json::Int64 Int64;\n#endif // defined(JSON_HAS_INT64)\n  typedef Json::LargestInt LargestInt;\n  typedef Json::LargestUInt LargestUInt;\n  typedef Json::ArrayIndex ArrayIndex;\n\n  // Required for boost integration, e. g. BOOST_TEST\n  typedef std::string value_type;\n\n  static const Value& null;  ///< We regret this reference to a global instance; prefer the simpler Value().\n  static const Value& nullRef;  ///< just a kludge for binary-compatibility; same as null\n  static Value const& nullSingleton(); ///< Prefer this to null or nullRef.\n\n  /// Minimum signed integer value that can be stored in a Json::Value.\n  static const LargestInt minLargestInt;\n  /// Maximum signed integer value that can be stored in a Json::Value.\n  static const LargestInt maxLargestInt;\n  /// Maximum unsigned integer value that can be stored in a Json::Value.\n  static const LargestUInt maxLargestUInt;\n\n  /// Minimum signed int value that can be stored in a Json::Value.\n  static const Int minInt;\n  /// Maximum signed int value that can be stored in a Json::Value.\n  static const Int maxInt;\n  /// Maximum unsigned int value that can be stored in a Json::Value.\n  static const UInt maxUInt;\n\n#if defined(JSON_HAS_INT64)\n  /// Minimum signed 64 bits int value that can be stored in a Json::Value.\n  static const Int64 minInt64;\n  /// Maximum signed 64 bits int value that can be stored in a Json::Value.\n  static const Int64 maxInt64;\n  /// Maximum unsigned 64 bits int value that can be stored in a Json::Value.\n  static const UInt64 maxUInt64;\n#endif // defined(JSON_HAS_INT64)\n\nprivate:\n#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION\n  class CZString {\n  public:\n    enum DuplicationPolicy {\n      noDuplication = 0,\n      duplicate,\n      duplicateOnCopy\n    };\n    CZString(ArrayIndex index);\n    CZString(char const* str, unsigned length, DuplicationPolicy allocate);\n    CZString(CZString const& other);\n#if JSON_HAS_RVALUE_REFERENCES\n    CZString(CZString&& other);\n#endif\n    ~CZString();\n    CZString& operator=(const CZString& other);\n\n#if JSON_HAS_RVALUE_REFERENCES\n    CZString& operator=(CZString&& other);\n#endif\n\n    bool operator<(CZString const& other) const;\n    bool operator==(CZString const& other) const;\n    ArrayIndex index() const;\n    //const char* c_str() const; ///< \\deprecated\n    char const* data() const;\n    unsigned length() const;\n    bool isStaticString() const;\n\n  private:\n    void swap(CZString& other);\n\n    struct StringStorage {\n      unsigned policy_: 2;\n      unsigned length_: 30; // 1GB max\n    };\n\n    char const* cstr_;  // actually, a prefixed string, unless policy is noDup\n    union {\n      ArrayIndex index_;\n      StringStorage storage_;\n    };\n  };\n\npublic:\n#ifndef JSON_USE_CPPTL_SMALLMAP\n  typedef std::map<CZString, Value> ObjectValues;\n#else\n  typedef CppTL::SmallMap<CZString, Value> ObjectValues;\n#endif // ifndef JSON_USE_CPPTL_SMALLMAP\n#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION\n\npublic:\n  /** \\brief Create a default Value of the given type.\n\n    This is a very useful constructor.\n    To create an empty array, pass arrayValue.\n    To create an empty object, pass objectValue.\n    Another Value can then be set to this one by assignment.\nThis is useful since clear() and resize() will not alter types.\n\n    Examples:\n\\code\nJson::Value null_value; // null\nJson::Value arr_value(Json::arrayValue); // []\nJson::Value obj_value(Json::objectValue); // {}\n\\endcode\n  */\n  Value(ValueType type = nullValue);\n  Value(Int value);\n  Value(UInt value);\n#if defined(JSON_HAS_INT64)\n  Value(Int64 value);\n  Value(UInt64 value);\n#endif // if defined(JSON_HAS_INT64)\n  Value(double value);\n  Value(const char* value); ///< Copy til first 0. (NULL causes to seg-fault.)\n  Value(const char* begin, const char* end); ///< Copy all, incl zeroes.\n  /** \\brief Constructs a value from a static string.\n\n   * Like other value string constructor but do not duplicate the string for\n   * internal storage. The given string must remain alive after the call to this\n   * constructor.\n   * \\note This works only for null-terminated strings. (We cannot change the\n   *   size of this class, so we have nowhere to store the length,\n   *   which might be computed later for various operations.)\n   *\n   * Example of usage:\n   * \\code\n   * static StaticString foo(\"some text\");\n   * Json::Value aValue(foo);\n   * \\endcode\n   */\n  Value(const StaticString& value);\n  Value(const JSONCPP_STRING& value); ///< Copy data() til size(). Embedded zeroes too.\n#ifdef JSON_USE_CPPTL\n  Value(const CppTL::ConstString& value);\n#endif\n  Value(bool value);\n  /// Deep copy.\n  Value(const Value& other);\n#if JSON_HAS_RVALUE_REFERENCES\n  /// Move constructor\n  Value(Value&& other);\n#endif\n  ~Value();\n\n  /// Deep copy, then swap(other).\n  /// \\note Over-write existing comments. To preserve comments, use #swapPayload().\n  Value& operator=(Value other);\n\n  /// Swap everything.\n  void swap(Value& other);\n  /// Swap values but leave comments and source offsets in place.\n  void swapPayload(Value& other);\n\n  /// copy everything.\n  void copy(const Value& other);\n  /// copy values but leave comments and source offsets in place.\n  void copyPayload(const Value& other);\n\n  ValueType type() const;\n\n  /// Compare payload only, not comments etc.\n  bool operator<(const Value& other) const;\n  bool operator<=(const Value& other) const;\n  bool operator>=(const Value& other) const;\n  bool operator>(const Value& other) const;\n  bool operator==(const Value& other) const;\n  bool operator!=(const Value& other) const;\n  int compare(const Value& other) const;\n\n  const char* asCString() const; ///< Embedded zeroes could cause you trouble!\n#if JSONCPP_USING_SECURE_MEMORY\n  unsigned getCStringLength() const; //Allows you to understand the length of the CString\n#endif\n  JSONCPP_STRING asString() const; ///< Embedded zeroes are possible.\n  /** Get raw char* of string-value.\n   *  \\return false if !string. (Seg-fault if str or end are NULL.)\n   */\n  bool getString(\n      char const** begin, char const** end) const;\n#ifdef JSON_USE_CPPTL\n  CppTL::ConstString asConstString() const;\n#endif\n  Int asInt() const;\n  UInt asUInt() const;\n#if defined(JSON_HAS_INT64)\n  Int64 asInt64() const;\n  UInt64 asUInt64() const;\n#endif // if defined(JSON_HAS_INT64)\n  LargestInt asLargestInt() const;\n  LargestUInt asLargestUInt() const;\n  float asFloat() const;\n  double asDouble() const;\n  bool asBool() const;\n\n  bool isNull() const;\n  bool isBool() const;\n  bool isInt() const;\n  bool isInt64() const;\n  bool isUInt() const;\n  bool isUInt64() const;\n  bool isIntegral() const;\n  bool isDouble() const;\n  bool isNumeric() const;\n  bool isString() const;\n  bool isArray() const;\n  bool isObject() const;\n\n  bool isConvertibleTo(ValueType other) const;\n\n  /// Number of values in array or object\n  ArrayIndex size() const;\n\n  /// \\brief Return true if empty array, empty object, or null;\n  /// otherwise, false.\n  bool empty() const;\n\n  /// Return !isNull()\n  explicit operator bool() const;\n\n  /// Remove all object members and array elements.\n  /// \\pre type() is arrayValue, objectValue, or nullValue\n  /// \\post type() is unchanged\n  void clear();\n\n  /// Resize the array to size elements.\n  /// New elements are initialized to null.\n  /// May only be called on nullValue or arrayValue.\n  /// \\pre type() is arrayValue or nullValue\n  /// \\post type() is arrayValue\n  void resize(ArrayIndex size);\n\n  /// Access an array element (zero based index ).\n  /// If the array contains less than index element, then null value are\n  /// inserted\n  /// in the array so that its size is index+1.\n  /// (You may need to say 'value[0u]' to get your compiler to distinguish\n  ///  this from the operator[] which takes a string.)\n  Value& operator[](ArrayIndex index);\n\n  /// Access an array element (zero based index ).\n  /// If the array contains less than index element, then null value are\n  /// inserted\n  /// in the array so that its size is index+1.\n  /// (You may need to say 'value[0u]' to get your compiler to distinguish\n  ///  this from the operator[] which takes a string.)\n  Value& operator[](int index);\n\n  /// Access an array element (zero based index )\n  /// (You may need to say 'value[0u]' to get your compiler to distinguish\n  ///  this from the operator[] which takes a string.)\n  const Value& operator[](ArrayIndex index) const;\n\n  /// Access an array element (zero based index )\n  /// (You may need to say 'value[0u]' to get your compiler to distinguish\n  ///  this from the operator[] which takes a string.)\n  const Value& operator[](int index) const;\n\n  /// If the array contains at least index+1 elements, returns the element\n  /// value,\n  /// otherwise returns defaultValue.\n  Value get(ArrayIndex index, const Value& defaultValue) const;\n  /// Return true if index < size().\n  bool isValidIndex(ArrayIndex index) const;\n  /// \\brief Append value to array at the end.\n  ///\n  /// Equivalent to jsonvalue[jsonvalue.size()] = value;\n  Value& append(const Value& value);\n\n#if JSON_HAS_RVALUE_REFERENCES\n  Value& append(Value&& value);\n#endif\n\n  /// Access an object value by name, create a null member if it does not exist.\n  /// \\note Because of our implementation, keys are limited to 2^30 -1 chars.\n  ///  Exceeding that will cause an exception.\n  Value& operator[](const char* key);\n  /// Access an object value by name, returns null if there is no member with\n  /// that name.\n  const Value& operator[](const char* key) const;\n  /// Access an object value by name, create a null member if it does not exist.\n  /// \\param key may contain embedded nulls.\n  Value& operator[](const JSONCPP_STRING& key);\n  /// Access an object value by name, returns null if there is no member with\n  /// that name.\n  /// \\param key may contain embedded nulls.\n  const Value& operator[](const JSONCPP_STRING& key) const;\n  /** \\brief Access an object value by name, create a null member if it does not\n   exist.\n\n   * If the object has no entry for that name, then the member name used to store\n   * the new entry is not duplicated.\n   * Example of use:\n   * \\code\n   * Json::Value object;\n   * static const StaticString code(\"code\");\n   * object[code] = 1234;\n   * \\endcode\n   */\n  Value& operator[](const StaticString& key);\n#ifdef JSON_USE_CPPTL\n  /// Access an object value by name, create a null member if it does not exist.\n  Value& operator[](const CppTL::ConstString& key);\n  /// Access an object value by name, returns null if there is no member with\n  /// that name.\n  const Value& operator[](const CppTL::ConstString& key) const;\n#endif\n  /// Return the member named key if it exist, defaultValue otherwise.\n  /// \\note deep copy\n  Value get(const char* key, const Value& defaultValue) const;\n  /// Return the member named key if it exist, defaultValue otherwise.\n  /// \\note deep copy\n  /// \\note key may contain embedded nulls.\n  Value get(const char* begin, const char* end, const Value& defaultValue) const;\n  /// Return the member named key if it exist, defaultValue otherwise.\n  /// \\note deep copy\n  /// \\param key may contain embedded nulls.\n  Value get(const JSONCPP_STRING& key, const Value& defaultValue) const;\n#ifdef JSON_USE_CPPTL\n  /// Return the member named key if it exist, defaultValue otherwise.\n  /// \\note deep copy\n  Value get(const CppTL::ConstString& key, const Value& defaultValue) const;\n#endif\n  /// Most general and efficient version of isMember()const, get()const,\n  /// and operator[]const\n  /// \\note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30\n  Value const* find(char const* begin, char const* end) const;\n  /// Most general and efficient version of object-mutators.\n  /// \\note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30\n  /// \\return non-zero, but JSON_ASSERT if this is neither object nor nullValue.\n  Value const* demand(char const* begin, char const* end);\n  /// \\brief Remove and return the named member.\n  ///\n  /// Do nothing if it did not exist.\n  /// \\return the removed Value, or null.\n  /// \\pre type() is objectValue or nullValue\n  /// \\post type() is unchanged\n  /// \\deprecated\n  void removeMember(const char* key);\n  /// Same as removeMember(const char*)\n  /// \\param key may contain embedded nulls.\n  /// \\deprecated\n  void removeMember(const JSONCPP_STRING& key);\n  /// Same as removeMember(const char* begin, const char* end, Value* removed),\n  /// but 'key' is null-terminated.\n  bool removeMember(const char* key, Value* removed);\n  /** \\brief Remove the named map member.\n\n      Update 'removed' iff removed.\n      \\param key may contain embedded nulls.\n      \\return true iff removed (no exceptions)\n  */\n  bool removeMember(JSONCPP_STRING const& key, Value* removed);\n  /// Same as removeMember(JSONCPP_STRING const& key, Value* removed)\n  bool removeMember(const char* begin, const char* end, Value* removed);\n  /** \\brief Remove the indexed array element.\n\n      O(n) expensive operations.\n      Update 'removed' iff removed.\n      \\return true iff removed (no exceptions)\n  */\n  bool removeIndex(ArrayIndex i, Value* removed);\n\n  /// Return true if the object has a member named key.\n  /// \\note 'key' must be null-terminated.\n  bool isMember(const char* key) const;\n  /// Return true if the object has a member named key.\n  /// \\param key may contain embedded nulls.\n  bool isMember(const JSONCPP_STRING& key) const;\n  /// Same as isMember(JSONCPP_STRING const& key)const\n  bool isMember(const char* begin, const char* end) const;\n#ifdef JSON_USE_CPPTL\n  /// Return true if the object has a member named key.\n  bool isMember(const CppTL::ConstString& key) const;\n#endif\n\n  /// \\brief Return a list of the member names.\n  ///\n  /// If null, return an empty list.\n  /// \\pre type() is objectValue or nullValue\n  /// \\post if type() was nullValue, it remains nullValue\n  Members getMemberNames() const;\n\n  //# ifdef JSON_USE_CPPTL\n  //      EnumMemberNames enumMemberNames() const;\n  //      EnumValues enumValues() const;\n  //# endif\n\n  /// \\deprecated Always pass len.\n  JSONCPP_DEPRECATED(\"Use setComment(JSONCPP_STRING const&) instead.\")\n  void setComment(const char* comment, CommentPlacement placement);\n  /// Comments must be //... or /* ... */\n  void setComment(const char* comment, size_t len, CommentPlacement placement);\n  /// Comments must be //... or /* ... */\n  void setComment(const JSONCPP_STRING& comment, CommentPlacement placement);\n  bool hasComment(CommentPlacement placement) const;\n  /// Include delimiters and embedded newlines.\n  JSONCPP_STRING getComment(CommentPlacement placement) const;\n\n  JSONCPP_STRING toStyledString() const;\n\n  const_iterator begin() const;\n  const_iterator end() const;\n\n  iterator begin();\n  iterator end();\n\n  // Accessors for the [start, limit) range of bytes within the JSON text from\n  // which this value was parsed, if any.\n  void setOffsetStart(ptrdiff_t start);\n  void setOffsetLimit(ptrdiff_t limit);\n  ptrdiff_t getOffsetStart() const;\n  ptrdiff_t getOffsetLimit() const;\n\nprivate:\n  void initBasic(ValueType type, bool allocated = false);\n\n  Value& resolveReference(const char* key);\n  Value& resolveReference(const char* key, const char* end);\n\n  struct CommentInfo {\n    CommentInfo();\n    ~CommentInfo();\n\n    void setComment(const char* text, size_t len);\n\n    char* comment_;\n  };\n\n  // struct MemberNamesTransform\n  //{\n  //   typedef const char *result_type;\n  //   const char *operator()( const CZString &name ) const\n  //   {\n  //      return name.c_str();\n  //   }\n  //};\n\n  union ValueHolder {\n    LargestInt int_;\n    LargestUInt uint_;\n    double real_;\n    bool bool_;\n    char* string_;  // actually ptr to unsigned, followed by str, unless !allocated_\n    ObjectValues* map_;\n  } value_;\n  ValueType type_ : 8;\n  unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.\n                               // If not allocated_, string_ must be null-terminated.\n  CommentInfo* comments_;\n\n  // [start, limit) byte offsets in the source JSON text from which this Value\n  // was extracted.\n  ptrdiff_t start_;\n  ptrdiff_t limit_;\n};\n\n/** \\brief Experimental and untested: represents an element of the \"path\" to\n * access a node.\n */\nclass JSON_API PathArgument {\npublic:\n  friend class Path;\n\n  PathArgument();\n  PathArgument(ArrayIndex index);\n  PathArgument(const char* key);\n  PathArgument(const JSONCPP_STRING& key);\n\nprivate:\n  enum Kind {\n    kindNone = 0,\n    kindIndex,\n    kindKey\n  };\n  JSONCPP_STRING key_;\n  ArrayIndex index_;\n  Kind kind_;\n};\n\n/** \\brief Experimental and untested: represents a \"path\" to access a node.\n *\n * Syntax:\n * - \".\" => root node\n * - \".[n]\" => elements at index 'n' of root node (an array value)\n * - \".name\" => member named 'name' of root node (an object value)\n * - \".name1.name2.name3\"\n * - \".[0][1][2].name1[3]\"\n * - \".%\" => member name is provided as parameter\n * - \".[%]\" => index is provied as parameter\n */\nclass JSON_API Path {\npublic:\n  Path(const JSONCPP_STRING& path,\n       const PathArgument& a1 = PathArgument(),\n       const PathArgument& a2 = PathArgument(),\n       const PathArgument& a3 = PathArgument(),\n       const PathArgument& a4 = PathArgument(),\n       const PathArgument& a5 = PathArgument());\n\n  const Value& resolve(const Value& root) const;\n  Value resolve(const Value& root, const Value& defaultValue) const;\n  /// Creates the \"path\" to access the specified node and returns a reference on\n  /// the node.\n  Value& make(Value& root) const;\n\nprivate:\n  typedef std::vector<const PathArgument*> InArgs;\n  typedef std::vector<PathArgument> Args;\n\n  void makePath(const JSONCPP_STRING& path, const InArgs& in);\n  void addPathInArg(const JSONCPP_STRING& path,\n                    const InArgs& in,\n                    InArgs::const_iterator& itInArg,\n                    PathArgument::Kind kind);\n  void invalidPath(const JSONCPP_STRING& path, int location);\n\n  Args args_;\n};\n\n/** \\brief base class for Value iterators.\n *\n */\nclass JSON_API ValueIteratorBase {\npublic:\n  typedef std::bidirectional_iterator_tag iterator_category;\n  typedef unsigned int size_t;\n  typedef int difference_type;\n  typedef ValueIteratorBase SelfType;\n\n  bool operator==(const SelfType& other) const { return isEqual(other); }\n\n  bool operator!=(const SelfType& other) const { return !isEqual(other); }\n\n  difference_type operator-(const SelfType& other) const {\n    return other.computeDistance(*this);\n  }\n\n  /// Return either the index or the member name of the referenced value as a\n  /// Value.\n  Value key() const;\n\n  /// Return the index of the referenced Value, or -1 if it is not an arrayValue.\n  UInt index() const;\n\n  /// Return the member name of the referenced Value, or \"\" if it is not an\n  /// objectValue.\n  /// \\note Avoid `c_str()` on result, as embedded zeroes are possible.\n  JSONCPP_STRING name() const;\n\n  /// Return the member name of the referenced Value. \"\" if it is not an\n  /// objectValue.\n  /// \\deprecated This cannot be used for UTF-8 strings, since there can be embedded nulls.\n  JSONCPP_DEPRECATED(\"Use `key = name();` instead.\")\n  char const* memberName() const;\n  /// Return the member name of the referenced Value, or NULL if it is not an\n  /// objectValue.\n  /// \\note Better version than memberName(). Allows embedded nulls.\n  char const* memberName(char const** end) const;\n\nprotected:\n  Value& deref() const;\n\n  void increment();\n\n  void decrement();\n\n  difference_type computeDistance(const SelfType& other) const;\n\n  bool isEqual(const SelfType& other) const;\n\n  void copy(const SelfType& other);\n\nprivate:\n  Value::ObjectValues::iterator current_;\n  // Indicates that iterator is for a null value.\n  bool isNull_;\n\npublic:\n  // For some reason, BORLAND needs these at the end, rather\n  // than earlier. No idea why.\n  ValueIteratorBase();\n  explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);\n};\n\n/** \\brief const iterator for object and array value.\n *\n */\nclass JSON_API ValueConstIterator : public ValueIteratorBase {\n  friend class Value;\n\npublic:\n  typedef const Value value_type;\n  //typedef unsigned int size_t;\n  //typedef int difference_type;\n  typedef const Value& reference;\n  typedef const Value* pointer;\n  typedef ValueConstIterator SelfType;\n\n  ValueConstIterator();\n  ValueConstIterator(ValueIterator const& other);\n\nprivate:\n/*! \\internal Use by Value to create an iterator.\n */\n  explicit ValueConstIterator(const Value::ObjectValues::iterator& current);\npublic:\n  SelfType& operator=(const ValueIteratorBase& other);\n\n  SelfType operator++(int) {\n    SelfType temp(*this);\n    ++*this;\n    return temp;\n  }\n\n  SelfType operator--(int) {\n    SelfType temp(*this);\n    --*this;\n    return temp;\n  }\n\n  SelfType& operator--() {\n    decrement();\n    return *this;\n  }\n\n  SelfType& operator++() {\n    increment();\n    return *this;\n  }\n\n  reference operator*() const { return deref(); }\n\n  pointer operator->() const { return &deref(); }\n};\n\n/** \\brief Iterator for object and array value.\n */\nclass JSON_API ValueIterator : public ValueIteratorBase {\n  friend class Value;\n\npublic:\n  typedef Value value_type;\n  typedef unsigned int size_t;\n  typedef int difference_type;\n  typedef Value& reference;\n  typedef Value* pointer;\n  typedef ValueIterator SelfType;\n\n  ValueIterator();\n  explicit ValueIterator(const ValueConstIterator& other);\n  ValueIterator(const ValueIterator& other);\n\nprivate:\n/*! \\internal Use by Value to create an iterator.\n */\n  explicit ValueIterator(const Value::ObjectValues::iterator& current);\npublic:\n  SelfType& operator=(const SelfType& other);\n\n  SelfType operator++(int) {\n    SelfType temp(*this);\n    ++*this;\n    return temp;\n  }\n\n  SelfType operator--(int) {\n    SelfType temp(*this);\n    --*this;\n    return temp;\n  }\n\n  SelfType& operator--() {\n    decrement();\n    return *this;\n  }\n\n  SelfType& operator++() {\n    increment();\n    return *this;\n  }\n\n  reference operator*() const { return deref(); }\n\n  pointer operator->() const { return &deref(); }\n};\n\n} // namespace Json\n}\n}\n\nnamespace std {\n/// Specialize std::swap() for Json::Value.\ntemplate<>\ninline void swap(AlibabaCloud::OSS::Json::Value& a, AlibabaCloud::OSS::Json::Value& b) { a.swap(b); }\n}\n\n#pragma pack(pop)\n\n#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)\n#pragma warning(pop)\n#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)\n\n#endif // CPPTL_JSON_H_INCLUDED\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: include/json/value.h\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: include/json/reader.h\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#ifndef CPPTL_JSON_READER_H_INCLUDED\n#define CPPTL_JSON_READER_H_INCLUDED\n\n#if !defined(JSON_IS_AMALGAMATION)\n#include \"features.h\"\n#include \"value.h\"\n#endif // if !defined(JSON_IS_AMALGAMATION)\n#include <deque>\n#include <iosfwd>\n#include <stack>\n#include <string>\n#include <istream>\n\n// Disable warning C4251: <data member>: <type> needs to have dll-interface to\n// be used by...\n#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)\n#pragma warning(push)\n#pragma warning(disable : 4251)\n#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)\n\n#pragma pack(push, 8)\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\nnamespace Json {\n\n/** \\brief Unserialize a <a HREF=\"http://www.json.org\">JSON</a> document into a\n *Value.\n *\n * \\deprecated Use CharReader and CharReaderBuilder.\n */\nclass JSON_API Reader {\npublic:\n  typedef char Char;\n  typedef const Char* Location;\n\n  /** \\brief An error tagged with where in the JSON text it was encountered.\n   *\n   * The offsets give the [start, limit) range of bytes within the text. Note\n   * that this is bytes, not codepoints.\n   *\n   */\n  struct StructuredError {\n    ptrdiff_t offset_start;\n    ptrdiff_t offset_limit;\n    JSONCPP_STRING message;\n  };\n\n  /** \\brief Constructs a Reader allowing all features\n   * for parsing.\n   */\n  Reader();\n\n  /** \\brief Constructs a Reader allowing the specified feature set\n   * for parsing.\n   */\n  Reader(const Features& features);\n\n  /** \\brief Read a Value from a <a HREF=\"http://www.json.org\">JSON</a>\n   * document.\n   * \\param document UTF-8 encoded string containing the document to read.\n   * \\param root [out] Contains the root value of the document if it was\n   *             successfully parsed.\n   * \\param collectComments \\c true to collect comment and allow writing them\n   * back during\n   *                        serialization, \\c false to discard comments.\n   *                        This parameter is ignored if\n   * Features::allowComments_\n   *                        is \\c false.\n   * \\return \\c true if the document was successfully parsed, \\c false if an\n   * error occurred.\n   */\n  bool\n  parse(const std::string& document, Value& root, bool collectComments = true);\n\n  /** \\brief Read a Value from a <a HREF=\"http://www.json.org\">JSON</a>\n   document.\n   * \\param beginDoc Pointer on the beginning of the UTF-8 encoded string of the\n   document to read.\n   * \\param endDoc Pointer on the end of the UTF-8 encoded string of the\n   document to read.\n   *               Must be >= beginDoc.\n   * \\param root [out] Contains the root value of the document if it was\n   *             successfully parsed.\n   * \\param collectComments \\c true to collect comment and allow writing them\n   back during\n   *                        serialization, \\c false to discard comments.\n   *                        This parameter is ignored if\n   Features::allowComments_\n   *                        is \\c false.\n   * \\return \\c true if the document was successfully parsed, \\c false if an\n   error occurred.\n   */\n  bool parse(const char* beginDoc,\n             const char* endDoc,\n             Value& root,\n             bool collectComments = true);\n\n  /// \\brief Parse from input stream.\n  /// \\see Json::operator>>(std::istream&, Json::Value&).\n  bool parse(JSONCPP_ISTREAM& is, Value& root, bool collectComments = true);\n\n  /** \\brief Returns a user friendly string that list errors in the parsed\n   * document.\n   * \\return Formatted error message with the list of errors with their location\n   * in\n   *         the parsed document. An empty string is returned if no error\n   * occurred\n   *         during parsing.\n   * \\deprecated Use getFormattedErrorMessages() instead (typo fix).\n   */\n  JSONCPP_DEPRECATED(\"Use getFormattedErrorMessages() instead.\")\n  JSONCPP_STRING getFormatedErrorMessages() const;\n\n  /** \\brief Returns a user friendly string that list errors in the parsed\n   * document.\n   * \\return Formatted error message with the list of errors with their location\n   * in\n   *         the parsed document. An empty string is returned if no error\n   * occurred\n   *         during parsing.\n   */\n  JSONCPP_STRING getFormattedErrorMessages() const;\n\n  /** \\brief Returns a vector of structured erros encounted while parsing.\n   * \\return A (possibly empty) vector of StructuredError objects. Currently\n   *         only one error can be returned, but the caller should tolerate\n   * multiple\n   *         errors.  This can occur if the parser recovers from a non-fatal\n   *         parse error and then encounters additional errors.\n   */\n  std::vector<StructuredError> getStructuredErrors() const;\n\n  /** \\brief Add a semantic error message.\n   * \\param value JSON Value location associated with the error\n   * \\param message The error message.\n   * \\return \\c true if the error was successfully added, \\c false if the\n   * Value offset exceeds the document size.\n   */\n  bool pushError(const Value& value, const JSONCPP_STRING& message);\n\n  /** \\brief Add a semantic error message with extra context.\n   * \\param value JSON Value location associated with the error\n   * \\param message The error message.\n   * \\param extra Additional JSON Value location to contextualize the error\n   * \\return \\c true if the error was successfully added, \\c false if either\n   * Value offset exceeds the document size.\n   */\n  bool pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra);\n\n  /** \\brief Return whether there are any errors.\n   * \\return \\c true if there are no errors to report \\c false if\n   * errors have occurred.\n   */\n  bool good() const;\n\nprivate:\n  enum TokenType {\n    tokenEndOfStream = 0,\n    tokenObjectBegin,\n    tokenObjectEnd,\n    tokenArrayBegin,\n    tokenArrayEnd,\n    tokenString,\n    tokenNumber,\n    tokenTrue,\n    tokenFalse,\n    tokenNull,\n    tokenArraySeparator,\n    tokenMemberSeparator,\n    tokenComment,\n    tokenError\n  };\n\n  class Token {\n  public:\n    TokenType type_;\n    Location start_;\n    Location end_;\n  };\n\n  class ErrorInfo {\n  public:\n    Token token_;\n    JSONCPP_STRING message_;\n    Location extra_;\n  };\n\n  typedef std::deque<ErrorInfo> Errors;\n\n  bool readToken(Token& token);\n  void skipSpaces();\n  bool match(Location pattern, int patternLength);\n  bool readComment();\n  bool readCStyleComment();\n  bool readCppStyleComment();\n  bool readString();\n  void readNumber();\n  bool readValue();\n  bool readObject(Token& token);\n  bool readArray(Token& token);\n  bool decodeNumber(Token& token);\n  bool decodeNumber(Token& token, Value& decoded);\n  bool decodeString(Token& token);\n  bool decodeString(Token& token, JSONCPP_STRING& decoded);\n  bool decodeDouble(Token& token);\n  bool decodeDouble(Token& token, Value& decoded);\n  bool decodeUnicodeCodePoint(Token& token,\n                              Location& current,\n                              Location end,\n                              unsigned int& unicode);\n  bool decodeUnicodeEscapeSequence(Token& token,\n                                   Location& current,\n                                   Location end,\n                                   unsigned int& unicode);\n  bool addError(const JSONCPP_STRING& message, Token& token, Location extra = 0);\n  bool recoverFromError(TokenType skipUntilToken);\n  bool addErrorAndRecover(const JSONCPP_STRING& message,\n                          Token& token,\n                          TokenType skipUntilToken);\n  void skipUntilSpace();\n  Value& currentValue();\n  Char getNextChar();\n  void\n  getLocationLineAndColumn(Location location, int& line, int& column) const;\n  JSONCPP_STRING getLocationLineAndColumn(Location location) const;\n  void addComment(Location begin, Location end, CommentPlacement placement);\n  void skipCommentTokens(Token& token);\n\n  static bool containsNewLine(Location begin, Location end);\n  static JSONCPP_STRING normalizeEOL(Location begin, Location end);\n\n  typedef std::stack<Value*> Nodes;\n  Nodes nodes_;\n  Errors errors_;\n  JSONCPP_STRING document_;\n  Location begin_;\n  Location end_;\n  Location current_;\n  Location lastValueEnd_;\n  Value* lastValue_;\n  JSONCPP_STRING commentsBefore_;\n  Features features_;\n  bool collectComments_;\n};  // Reader\n\n/** Interface for reading JSON from a char array.\n */\nclass JSON_API CharReader {\npublic:\n  virtual ~CharReader() {}\n  /** \\brief Read a Value from a <a HREF=\"http://www.json.org\">JSON</a>\n   document.\n   * The document must be a UTF-8 encoded string containing the document to read.\n   *\n   * \\param beginDoc Pointer on the beginning of the UTF-8 encoded string of the\n   document to read.\n   * \\param endDoc Pointer on the end of the UTF-8 encoded string of the\n   document to read.\n   *        Must be >= beginDoc.\n   * \\param root [out] Contains the root value of the document if it was\n   *             successfully parsed.\n   * \\param errs [out] Formatted error messages (if not NULL)\n   *        a user friendly string that lists errors in the parsed\n   * document.\n   * \\return \\c true if the document was successfully parsed, \\c false if an\n   error occurred.\n   */\n  virtual bool parse(\n      char const* beginDoc, char const* endDoc,\n      Value* root, JSONCPP_STRING* errs) = 0;\n\n  class JSON_API Factory {\n  public:\n    virtual ~Factory() {}\n    /** \\brief Allocate a CharReader via operator new().\n     * \\throw std::exception if something goes wrong (e.g. invalid settings)\n     */\n    virtual CharReader* newCharReader() const = 0;\n  };  // Factory\n};  // CharReader\n\n/** \\brief Build a CharReader implementation.\n\nUsage:\n\\code\n  using namespace Json;\n  CharReaderBuilder builder;\n  builder[\"collectComments\"] = false;\n  Value value;\n  JSONCPP_STRING errs;\n  bool ok = parseFromStream(builder, std::cin, &value, &errs);\n\\endcode\n*/\nclass JSON_API CharReaderBuilder : public CharReader::Factory {\npublic:\n  // Note: We use a Json::Value so that we can add data-members to this class\n  // without a major version bump.\n  /** Configuration of this builder.\n    These are case-sensitive.\n    Available settings (case-sensitive):\n    - `\"collectComments\": false or true`\n      - true to collect comment and allow writing them\n        back during serialization, false to discard comments.\n        This parameter is ignored if allowComments is false.\n    - `\"allowComments\": false or true`\n      - true if comments are allowed.\n    - `\"strictRoot\": false or true`\n      - true if root must be either an array or an object value\n    - `\"allowDroppedNullPlaceholders\": false or true`\n      - true if dropped null placeholders are allowed. (See StreamWriterBuilder.)\n    - `\"allowNumericKeys\": false or true`\n      - true if numeric object keys are allowed.\n    - `\"allowSingleQuotes\": false or true`\n      - true if '' are allowed for strings (both keys and values)\n    - `\"stackLimit\": integer`\n      - Exceeding stackLimit (recursive depth of `readValue()`) will\n        cause an exception.\n      - This is a security issue (seg-faults caused by deeply nested JSON),\n        so the default is low.\n    - `\"failIfExtra\": false or true`\n      - If true, `parse()` returns false when extra non-whitespace trails\n        the JSON value in the input string.\n    - `\"rejectDupKeys\": false or true`\n      - If true, `parse()` returns false when a key is duplicated within an object.\n    - `\"allowSpecialFloats\": false or true`\n      - If true, special float values (NaNs and infinities) are allowed \n        and their values are lossfree restorable.\n\n    You can examine 'settings_` yourself\n    to see the defaults. You can also write and read them just like any\n    JSON Value.\n    \\sa setDefaults()\n    */\n  Json::Value settings_;\n\n  CharReaderBuilder();\n  ~CharReaderBuilder() JSONCPP_OVERRIDE;\n\n  CharReader* newCharReader() const JSONCPP_OVERRIDE;\n\n  /** \\return true if 'settings' are legal and consistent;\n   *   otherwise, indicate bad settings via 'invalid'.\n   */\n  bool validate(Json::Value* invalid) const;\n\n  /** A simple way to update a specific setting.\n   */\n  Value& operator[](JSONCPP_STRING key);\n\n  /** Called by ctor, but you can use this to reset settings_.\n   * \\pre 'settings' != NULL (but Json::null is fine)\n   * \\remark Defaults:\n   * \\snippet src/lib_json/json_reader.cpp CharReaderBuilderDefaults\n   */\n  static void setDefaults(Json::Value* settings);\n  /** Same as old Features::strictMode().\n   * \\pre 'settings' != NULL (but Json::null is fine)\n   * \\remark Defaults:\n   * \\snippet src/lib_json/json_reader.cpp CharReaderBuilderStrictMode\n   */\n  static void strictMode(Json::Value* settings);\n};\n\n/** Consume entire stream and use its begin/end.\n  * Someday we might have a real StreamReader, but for now this\n  * is convenient.\n  */\nbool JSON_API parseFromStream(\n    CharReader::Factory const&,\n    JSONCPP_ISTREAM&,\n    Value* root, std::string* errs);\n\n/** \\brief Read from 'sin' into 'root'.\n\n Always keep comments from the input JSON.\n\n This can be used to read a file into a particular sub-object.\n For example:\n \\code\n Json::Value root;\n cin >> root[\"dir\"][\"file\"];\n cout << root;\n \\endcode\n Result:\n \\verbatim\n {\n \"dir\": {\n     \"file\": {\n     // The input stream JSON would be nested here.\n     }\n }\n }\n \\endverbatim\n \\throw std::exception on parse error.\n \\see Json::operator<<()\n*/\nJSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&, Value&);\n\n} // namespace Json\n}\n}\n#pragma pack(pop)\n\n#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)\n#pragma warning(pop)\n#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)\n\n#endif // CPPTL_JSON_READER_H_INCLUDED\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: include/json/reader.h\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: include/json/writer.h\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#ifndef JSON_WRITER_H_INCLUDED\n#define JSON_WRITER_H_INCLUDED\n\n#if !defined(JSON_IS_AMALGAMATION)\n#include \"value.h\"\n#endif // if !defined(JSON_IS_AMALGAMATION)\n#include <vector>\n#include <string>\n#include <ostream>\n\n// Disable warning C4251: <data member>: <type> needs to have dll-interface to\n// be used by...\n#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) && defined(_MSC_VER)\n#pragma warning(push)\n#pragma warning(disable : 4251)\n#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)\n\n#pragma pack(push, 8)\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\nnamespace Json {\n\nclass Value;\n\n/**\n\nUsage:\n\\code\n  using namespace Json;\n  void writeToStdout(StreamWriter::Factory const& factory, Value const& value) {\n    std::unique_ptr<StreamWriter> const writer(\n      factory.newStreamWriter());\n    writer->write(value, &std::cout);\n    std::cout << std::endl;  // add lf and flush\n  }\n\\endcode\n*/\nclass JSON_API StreamWriter {\nprotected:\n  JSONCPP_OSTREAM* sout_;  // not owned; will not delete\npublic:\n  StreamWriter();\n  virtual ~StreamWriter();\n  /** Write Value into document as configured in sub-class.\n      Do not take ownership of sout, but maintain a reference during function.\n      \\pre sout != NULL\n      \\return zero on success (For now, we always return zero, so check the stream instead.)\n      \\throw std::exception possibly, depending on configuration\n   */\n  virtual int write(Value const& root, JSONCPP_OSTREAM* sout) = 0;\n\n  /** \\brief A simple abstract factory.\n   */\n  class JSON_API Factory {\n  public:\n    virtual ~Factory();\n    /** \\brief Allocate a CharReader via operator new().\n     * \\throw std::exception if something goes wrong (e.g. invalid settings)\n     */\n    virtual StreamWriter* newStreamWriter() const = 0;\n  };  // Factory\n};  // StreamWriter\n\n/** \\brief Write into stringstream, then return string, for convenience.\n * A StreamWriter will be created from the factory, used, and then deleted.\n */\nJSONCPP_STRING JSON_API writeString(StreamWriter::Factory const& factory, Value const& root);\n\n\n/** \\brief Build a StreamWriter implementation.\n\nUsage:\n\\code\n  using namespace Json;\n  Value value = ...;\n  StreamWriterBuilder builder;\n  builder[\"commentStyle\"] = \"None\";\n  builder[\"indentation\"] = \"   \";  // or whatever you like\n  std::unique_ptr<Json::StreamWriter> writer(\n      builder.newStreamWriter());\n  writer->write(value, &std::cout);\n  std::cout << std::endl;  // add lf and flush\n\\endcode\n*/\nclass JSON_API StreamWriterBuilder : public StreamWriter::Factory {\npublic:\n  // Note: We use a Json::Value so that we can add data-members to this class\n  // without a major version bump.\n  /** Configuration of this builder.\n    Available settings (case-sensitive):\n    - \"commentStyle\": \"None\" or \"All\"\n    - \"indentation\":  \"<anything>\"\n    - \"enableYAMLCompatibility\": false or true\n      - slightly change the whitespace around colons\n    - \"dropNullPlaceholders\": false or true\n      - Drop the \"null\" string from the writer's output for nullValues.\n        Strictly speaking, this is not valid JSON. But when the output is being\n        fed to a browser's JavaScript, it makes for smaller output and the\n        browser can handle the output just fine.\n    - \"useSpecialFloats\": false or true\n      - If true, outputs non-finite floating point values in the following way:\n        NaN values as \"NaN\", positive infinity as \"Infinity\", and negative infinity\n        as \"-Infinity\".\n\n    You can examine 'settings_` yourself\n    to see the defaults. You can also write and read them just like any\n    JSON Value.\n    \\sa setDefaults()\n    */\n  Json::Value settings_;\n\n  StreamWriterBuilder();\n  ~StreamWriterBuilder() JSONCPP_OVERRIDE;\n\n  /**\n   * \\throw std::exception if something goes wrong (e.g. invalid settings)\n   */\n  StreamWriter* newStreamWriter() const JSONCPP_OVERRIDE;\n\n  /** \\return true if 'settings' are legal and consistent;\n   *   otherwise, indicate bad settings via 'invalid'.\n   */\n  bool validate(Json::Value* invalid) const;\n  /** A simple way to update a specific setting.\n   */\n  Value& operator[](JSONCPP_STRING key);\n\n  /** Called by ctor, but you can use this to reset settings_.\n   * \\pre 'settings' != NULL (but Json::null is fine)\n   * \\remark Defaults:\n   * \\snippet src/lib_json/json_writer.cpp StreamWriterBuilderDefaults\n   */\n  static void setDefaults(Json::Value* settings);\n};\n\n/** \\brief Abstract class for writers.\n * \\deprecated Use StreamWriter. (And really, this is an implementation detail.)\n */\nclass JSONCPP_DEPRECATED(\"Use StreamWriter instead\") JSON_API Writer {\npublic:\n  virtual ~Writer();\n\n  virtual JSONCPP_STRING write(const Value& root) = 0;\n};\n\n/** \\brief Outputs a Value in <a HREF=\"http://www.json.org\">JSON</a> format\n *without formatting (not human friendly).\n *\n * The JSON document is written in a single line. It is not intended for 'human'\n *consumption,\n * but may be usefull to support feature such as RPC where bandwith is limited.\n * \\sa Reader, Value\n * \\deprecated Use StreamWriterBuilder.\n */\n#if defined(_MSC_VER)\n#pragma warning(push)\n#pragma warning(disable:4996) // Deriving from deprecated class\n#endif\nclass JSONCPP_DEPRECATED(\"Use StreamWriterBuilder instead\") JSON_API FastWriter : public Writer {\npublic:\n  FastWriter();\n  ~FastWriter() JSONCPP_OVERRIDE {}\n\n  void enableYAMLCompatibility();\n\n  /** \\brief Drop the \"null\" string from the writer's output for nullValues.\n   * Strictly speaking, this is not valid JSON. But when the output is being\n   * fed to a browser's JavaScript, it makes for smaller output and the\n   * browser can handle the output just fine.\n   */\n  void dropNullPlaceholders();\n\n  void omitEndingLineFeed();\n\npublic: // overridden from Writer\n  JSONCPP_STRING write(const Value& root) JSONCPP_OVERRIDE;\n\nprivate:\n  void writeValue(const Value& value);\n\n  JSONCPP_STRING document_;\n  bool yamlCompatibilityEnabled_;\n  bool dropNullPlaceholders_;\n  bool omitEndingLineFeed_;\n};\n#if defined(_MSC_VER)\n#pragma warning(pop)\n#endif\n\n/** \\brief Writes a Value in <a HREF=\"http://www.json.org\">JSON</a> format in a\n *human friendly way.\n *\n * The rules for line break and indent are as follow:\n * - Object value:\n *     - if empty then print {} without indent and line break\n *     - if not empty the print '{', line break & indent, print one value per\n *line\n *       and then unindent and line break and print '}'.\n * - Array value:\n *     - if empty then print [] without indent and line break\n *     - if the array contains no object value, empty array or some other value\n *types,\n *       and all the values fit on one lines, then print the array on a single\n *line.\n *     - otherwise, it the values do not fit on one line, or the array contains\n *       object or non empty array, then print one value per line.\n *\n * If the Value have comments then they are outputed according to their\n *#CommentPlacement.\n *\n * \\sa Reader, Value, Value::setComment()\n * \\deprecated Use StreamWriterBuilder.\n */\n#if defined(_MSC_VER)\n#pragma warning(push)\n#pragma warning(disable:4996) // Deriving from deprecated class\n#endif\nclass JSONCPP_DEPRECATED(\"Use StreamWriterBuilder instead\") JSON_API StyledWriter : public Writer {\npublic:\n  StyledWriter();\n  ~StyledWriter() JSONCPP_OVERRIDE {}\n\npublic: // overridden from Writer\n  /** \\brief Serialize a Value in <a HREF=\"http://www.json.org\">JSON</a> format.\n   * \\param root Value to serialize.\n   * \\return String containing the JSON document that represents the root value.\n   */\n  JSONCPP_STRING write(const Value& root) JSONCPP_OVERRIDE;\n\nprivate:\n  void writeValue(const Value& value);\n  void writeArrayValue(const Value& value);\n  bool isMultilineArray(const Value& value);\n  void pushValue(const JSONCPP_STRING& value);\n  void writeIndent();\n  void writeWithIndent(const JSONCPP_STRING& value);\n  void indent();\n  void unindent();\n  void writeCommentBeforeValue(const Value& root);\n  void writeCommentAfterValueOnSameLine(const Value& root);\n  bool hasCommentForValue(const Value& value);\n  static JSONCPP_STRING normalizeEOL(const JSONCPP_STRING& text);\n\n  typedef std::vector<JSONCPP_STRING> ChildValues;\n\n  ChildValues childValues_;\n  JSONCPP_STRING document_;\n  JSONCPP_STRING indentString_;\n  unsigned int rightMargin_;\n  unsigned int indentSize_;\n  bool addChildValues_;\n};\n#if defined(_MSC_VER)\n#pragma warning(pop)\n#endif\n\n/** \\brief Writes a Value in <a HREF=\"http://www.json.org\">JSON</a> format in a\n human friendly way,\n     to a stream rather than to a string.\n *\n * The rules for line break and indent are as follow:\n * - Object value:\n *     - if empty then print {} without indent and line break\n *     - if not empty the print '{', line break & indent, print one value per\n line\n *       and then unindent and line break and print '}'.\n * - Array value:\n *     - if empty then print [] without indent and line break\n *     - if the array contains no object value, empty array or some other value\n types,\n *       and all the values fit on one lines, then print the array on a single\n line.\n *     - otherwise, it the values do not fit on one line, or the array contains\n *       object or non empty array, then print one value per line.\n *\n * If the Value have comments then they are outputed according to their\n #CommentPlacement.\n *\n * \\sa Reader, Value, Value::setComment()\n * \\deprecated Use StreamWriterBuilder.\n */\n#if defined(_MSC_VER)\n#pragma warning(push)\n#pragma warning(disable:4996) // Deriving from deprecated class\n#endif\nclass JSONCPP_DEPRECATED(\"Use StreamWriterBuilder instead\") JSON_API StyledStreamWriter {\npublic:\n/**\n * \\param indentation Each level will be indented by this amount extra.\n */\n  StyledStreamWriter(JSONCPP_STRING indentation = \"\\t\");\n  ~StyledStreamWriter() {}\n\npublic:\n  /** \\brief Serialize a Value in <a HREF=\"http://www.json.org\">JSON</a> format.\n   * \\param out Stream to write to. (Can be ostringstream, e.g.)\n   * \\param root Value to serialize.\n   * \\note There is no point in deriving from Writer, since write() should not\n   * return a value.\n   */\n  void write(JSONCPP_OSTREAM& out, const Value& root);\n\nprivate:\n  void writeValue(const Value& value);\n  void writeArrayValue(const Value& value);\n  bool isMultilineArray(const Value& value);\n  void pushValue(const JSONCPP_STRING& value);\n  void writeIndent();\n  void writeWithIndent(const JSONCPP_STRING& value);\n  void indent();\n  void unindent();\n  void writeCommentBeforeValue(const Value& root);\n  void writeCommentAfterValueOnSameLine(const Value& root);\n  bool hasCommentForValue(const Value& value);\n  static JSONCPP_STRING normalizeEOL(const JSONCPP_STRING& text);\n\n  typedef std::vector<JSONCPP_STRING> ChildValues;\n\n  ChildValues childValues_;\n  JSONCPP_OSTREAM* document_;\n  JSONCPP_STRING indentString_;\n  unsigned int rightMargin_;\n  JSONCPP_STRING indentation_;\n  bool addChildValues_ : 1;\n  bool indented_ : 1;\n};\n#if defined(_MSC_VER)\n#pragma warning(pop)\n#endif\n\n#if defined(JSON_HAS_INT64)\nJSONCPP_STRING JSON_API valueToString(Int value);\nJSONCPP_STRING JSON_API valueToString(UInt value);\n#endif // if defined(JSON_HAS_INT64)\nJSONCPP_STRING JSON_API valueToString(LargestInt value);\nJSONCPP_STRING JSON_API valueToString(LargestUInt value);\nJSONCPP_STRING JSON_API valueToString(double value);\nJSONCPP_STRING JSON_API valueToString(bool value);\nJSONCPP_STRING JSON_API valueToQuotedString(const char* value);\n\n/// \\brief Output using the StyledStreamWriter.\n/// \\see Json::operator>>()\nJSON_API JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM&, const Value& root);\n\n} // namespace Json\n}\n}\n#pragma pack(pop)\n\n#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)\n#pragma warning(pop)\n#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)\n\n#endif // JSON_WRITER_H_INCLUDED\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: include/json/writer.h\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: include/json/assertions.h\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED\n#define CPPTL_JSON_ASSERTIONS_H_INCLUDED\n\n#include <stdlib.h>\n#include <sstream>\n\n#if !defined(JSON_IS_AMALGAMATION)\n#include \"config.h\"\n#endif // if !defined(JSON_IS_AMALGAMATION)\n\n/** It should not be possible for a maliciously designed file to\n *  cause an abort() or seg-fault, so these macros are used only\n *  for pre-condition violations and internal logic errors.\n */\n#if JSON_USE_EXCEPTION\n\n// @todo <= add detail about condition in exception\n# define JSON_ASSERT(condition)                                                \\\n  {if (!(condition)) {Json::throwLogicError( \"assert json failed\" );}}\n\n# define JSON_FAIL_MESSAGE(message)                                            \\\n  {                                                                            \\\n    JSONCPP_OSTRINGSTREAM oss; oss << message;                                    \\\n    Json::throwLogicError(oss.str());                                          \\\n    abort();                                                                   \\\n  }\n\n#else // JSON_USE_EXCEPTION\n\n# define JSON_ASSERT(condition) assert(condition)\n\n// The call to assert() will show the failure message in debug builds. In\n// release builds we abort, for a core-dump or debugger.\n# define JSON_FAIL_MESSAGE(message)                                            \\\n  {                                                                            \\\n    JSONCPP_OSTRINGSTREAM oss; oss << message;                                    \\\n    assert(false && oss.str().c_str());                                        \\\n    abort();                                                                   \\\n  }\n\n\n#endif\n\n#define JSON_ASSERT_MESSAGE(condition, message)                                \\\n  if (!(condition)) {                                                          \\\n    JSON_FAIL_MESSAGE(message);                                                \\\n  }\n\n#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: include/json/assertions.h\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n#endif //ifndef JSON_AMALGAMATED_H_INCLUDED\n"
  },
  {
    "path": "sdk/src/external/json/jsoncpp.cpp",
    "content": "/// Json-cpp amalgamated source (http://jsoncpp.sourceforge.net/).\n/// It is intended to be used with #include \"json/json.h\"\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: LICENSE\n// //////////////////////////////////////////////////////////////////////\n\n/*\nThe JsonCpp library's source code, including accompanying documentation, \ntests and demonstration applications, are licensed under the following\nconditions...\n\nBaptiste Lepilleur and The JsonCpp Authors explicitly disclaim copyright in all \njurisdictions which recognize such a disclaimer. In such jurisdictions, \nthis software is released into the Public Domain.\n\nIn jurisdictions which do not recognize Public Domain property (e.g. Germany as of\n2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur and\nThe JsonCpp Authors, and is released under the terms of the MIT License (see below).\n\nIn jurisdictions which recognize Public Domain property, the user of this \nsoftware may choose to accept it either as 1) Public Domain, 2) under the \nconditions of the MIT License (see below), or 3) under the terms of dual \nPublic Domain/MIT License conditions described here, as they choose.\n\nThe MIT License is about as close to Public Domain as a license can get, and is\ndescribed in clear, concise terms at:\n\n   http://en.wikipedia.org/wiki/MIT_License\n   \nThe full text of the MIT License follows:\n\n========================================================================\nCopyright (c) 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use, copy,\nmodify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\nBE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\nACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n========================================================================\n(END LICENSE TEXT)\n\nThe MIT license is compatible with both the GPL and commercial\nsoftware, affording one all of the rights of Public Domain with the\nminor nuisance of being required to keep the above copyright notice\nand license text in the source code. Note also that by accepting the\nPublic Domain \"license\" you can re-license your copy using whatever\nlicense you like.\n\n*/\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: LICENSE\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n#include \"json/json.h\"\n\n#ifndef JSON_IS_AMALGAMATION\n#error \"Compile with -I PATH_TO_JSON_DIRECTORY\"\n#endif\n\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: src/lib_json/json_tool.h\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED\n#define LIB_JSONCPP_JSON_TOOL_H_INCLUDED\n\n\n// Also support old flag NO_LOCALE_SUPPORT\n#ifdef NO_LOCALE_SUPPORT\n#define JSONCPP_NO_LOCALE_SUPPORT\n#endif\n\n#ifndef JSONCPP_NO_LOCALE_SUPPORT\n#include <clocale>\n#endif\n\n/* This header provides common string manipulation support, such as UTF-8,\n * portable conversion from/to string...\n *\n * It is an internal header that must not be exposed.\n */\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\nnamespace Json {\nstatic char getDecimalPoint() {\n#ifdef JSONCPP_NO_LOCALE_SUPPORT\n  return '\\0';\n#else\n  struct lconv* lc = localeconv();\n  return lc ? *(lc->decimal_point) : '\\0';\n#endif\n}\n\n/// Converts a unicode code-point to UTF-8.\nstatic inline JSONCPP_STRING codePointToUTF8(unsigned int cp) {\n  JSONCPP_STRING result;\n\n  // based on description from http://en.wikipedia.org/wiki/UTF-8\n\n  if (cp <= 0x7f) {\n    result.resize(1);\n    result[0] = static_cast<char>(cp);\n  } else if (cp <= 0x7FF) {\n    result.resize(2);\n    result[1] = static_cast<char>(0x80 | (0x3f & cp));\n    result[0] = static_cast<char>(0xC0 | (0x1f & (cp >> 6)));\n  } else if (cp <= 0xFFFF) {\n    result.resize(3);\n    result[2] = static_cast<char>(0x80 | (0x3f & cp));\n    result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 6)));\n    result[0] = static_cast<char>(0xE0 | (0xf & (cp >> 12)));\n  } else if (cp <= 0x10FFFF) {\n    result.resize(4);\n    result[3] = static_cast<char>(0x80 | (0x3f & cp));\n    result[2] = static_cast<char>(0x80 | (0x3f & (cp >> 6)));\n    result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 12)));\n    result[0] = static_cast<char>(0xF0 | (0x7 & (cp >> 18)));\n  }\n\n  return result;\n}\n\nenum {\n  /// Constant that specify the size of the buffer that must be passed to\n  /// uintToString.\n  uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1\n};\n\n// Defines a char buffer for use with uintToString().\ntypedef char UIntToStringBuffer[uintToStringBufferSize];\n\n/** Converts an unsigned integer to string.\n * @param value Unsigned integer to convert to string\n * @param current Input/Output string buffer.\n *        Must have at least uintToStringBufferSize chars free.\n */\nstatic inline void uintToString(LargestUInt value, char*& current) {\n  *--current = 0;\n  do {\n    *--current = static_cast<char>(value % 10U + static_cast<unsigned>('0'));\n    value /= 10;\n  } while (value != 0);\n}\n\n/** Change ',' to '.' everywhere in buffer.\n *\n * We had a sophisticated way, but it did not work in WinCE.\n * @see https://github.com/open-source-parsers/jsoncpp/pull/9\n */\nstatic inline void fixNumericLocale(char* begin, char* end) {\n  while (begin < end) {\n    if (*begin == ',') {\n      *begin = '.';\n    }\n    ++begin;\n  }\n}\n\nstatic inline void fixNumericLocaleInput(char* begin, char* end) {\n  char decimalPoint = getDecimalPoint();\n  if (decimalPoint != '\\0' && decimalPoint != '.') {\n    while (begin < end) {\n      if (*begin == '.') {\n        *begin = decimalPoint;\n      }\n      ++begin;\n    }\n  }\n}\n\n} // namespace Json {\n}\n}\n#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED\n\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: src/lib_json/json_tool.h\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: src/lib_json/json_reader.cpp\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2007-2011 Baptiste Lepilleur and The JsonCpp Authors\n// Copyright (C) 2016 InfoTeCS JSC. All rights reserved.\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#if !defined(JSON_IS_AMALGAMATION)\n#include <json/assertions.h>\n#include <json/reader.h>\n#include <json/value.h>\n#include \"json_tool.h\"\n#endif // if !defined(JSON_IS_AMALGAMATION)\n#include <utility>\n#include <cstdio>\n#include <cassert>\n#include <cstring>\n#include <istream>\n#include <sstream>\n#include <memory>\n#include <set>\n#include <limits>\n\n#if defined(_MSC_VER)\n#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above \n#define snprintf sprintf_s\n#elif _MSC_VER >= 1900 // VC++ 14.0 and above\n#define snprintf std::snprintf\n#else\n#define snprintf _snprintf\n#endif\n#elif defined(__ANDROID__) || defined(__QNXNTO__)\n#define snprintf snprintf\n#elif __cplusplus >= 201103L\n#if !defined(__MINGW32__) && !defined(__CYGWIN__)\n#define snprintf std::snprintf\n#endif\n#endif\n\n#if defined(__QNXNTO__)\n#define sscanf std::sscanf\n#endif\n\n#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0\n// Disable warning about strdup being deprecated.\n#pragma warning(disable : 4996)\n#endif\n\n#if defined(__GNUG__) && __GNUC__ > 8\n#pragma GCC diagnostic ignored \"-Wstringop-overflow\"\n#endif\n\n// Define JSONCPP_DEPRECATED_STACK_LIMIT as an appropriate integer at compile time to change the stack limit\n#if !defined(JSONCPP_DEPRECATED_STACK_LIMIT)\n#define JSONCPP_DEPRECATED_STACK_LIMIT 1000\n#endif\n\nstatic size_t const stackLimit_g = JSONCPP_DEPRECATED_STACK_LIMIT; // see readValue()\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\nnamespace Json {\n\n#if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)\ntypedef std::unique_ptr<CharReader> CharReaderPtr;\n#else\ntypedef std::auto_ptr<CharReader>   CharReaderPtr;\n#endif\n\n// Implementation of class Features\n// ////////////////////////////////\n\nFeatures::Features()\n    : allowComments_(true), strictRoot_(false),\n      allowDroppedNullPlaceholders_(false), allowNumericKeys_(false) {}\n\nFeatures Features::all() { return Features(); }\n\nFeatures Features::strictMode() {\n  Features features;\n  features.allowComments_ = false;\n  features.strictRoot_ = true;\n  features.allowDroppedNullPlaceholders_ = false;\n  features.allowNumericKeys_ = false;\n  return features;\n}\n\n// Implementation of class Reader\n// ////////////////////////////////\n\nbool Reader::containsNewLine(Reader::Location begin, Reader::Location end) {\n  for (; begin < end; ++begin)\n    if (*begin == '\\n' || *begin == '\\r')\n      return true;\n  return false;\n}\n\n// Class Reader\n// //////////////////////////////////////////////////////////////////\n\nReader::Reader()\n    : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),\n      lastValue_(), commentsBefore_(), features_(Features::all()),\n      collectComments_() {}\n\nReader::Reader(const Features& features)\n    : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),\n      lastValue_(), commentsBefore_(), features_(features), collectComments_() {\n}\n\nbool\nReader::parse(const std::string& document, Value& root, bool collectComments) {\n  document_.assign(document.begin(), document.end());\n  const char* begin = document_.c_str();\n  const char* end = begin + document_.length();\n  return parse(begin, end, root, collectComments);\n}\n\nbool Reader::parse(std::istream& sin, Value& root, bool collectComments) {\n  // std::istream_iterator<char> begin(sin);\n  // std::istream_iterator<char> end;\n  // Those would allow streamed input from a file, if parse() were a\n  // template function.\n\n  // Since JSONCPP_STRING is reference-counted, this at least does not\n  // create an extra copy.\n  JSONCPP_STRING doc;\n  std::getline(sin, doc, (char)EOF);\n  return parse(doc.data(), doc.data() + doc.size(), root, collectComments);\n}\n\nbool Reader::parse(const char* beginDoc,\n                   const char* endDoc,\n                   Value& root,\n                   bool collectComments) {\n  if (!features_.allowComments_) {\n    collectComments = false;\n  }\n\n  begin_ = beginDoc;\n  end_ = endDoc;\n  collectComments_ = collectComments;\n  current_ = begin_;\n  lastValueEnd_ = 0;\n  lastValue_ = 0;\n  commentsBefore_.clear();\n  errors_.clear();\n  while (!nodes_.empty())\n    nodes_.pop();\n  nodes_.push(&root);\n\n  bool successful = readValue();\n  Token token;\n  skipCommentTokens(token);\n  if (collectComments_ && !commentsBefore_.empty())\n    root.setComment(commentsBefore_, commentAfter);\n  if (features_.strictRoot_) {\n    if (!root.isArray() && !root.isObject()) {\n      // Set error location to start of doc, ideally should be first token found\n      // in doc\n      token.type_ = tokenError;\n      token.start_ = beginDoc;\n      token.end_ = endDoc;\n      addError(\n          \"A valid JSON document must be either an array or an object value.\",\n          token);\n      return false;\n    }\n  }\n  return successful;\n}\n\nbool Reader::readValue() {\n  // readValue() may call itself only if it calls readObject() or ReadArray().\n  // These methods execute nodes_.push() just before and nodes_.pop)() just after calling readValue(). \n  // parse() executes one nodes_.push(), so > instead of >=.\n  if (nodes_.size() > stackLimit_g) throwRuntimeError(\"Exceeded stackLimit in readValue().\");\n\n  Token token;\n  skipCommentTokens(token);\n  bool successful = true;\n\n  if (collectComments_ && !commentsBefore_.empty()) {\n    currentValue().setComment(commentsBefore_, commentBefore);\n    commentsBefore_.clear();\n  }\n\n  switch (token.type_) {\n  case tokenObjectBegin:\n    successful = readObject(token);\n    currentValue().setOffsetLimit(current_ - begin_);\n    break;\n  case tokenArrayBegin:\n    successful = readArray(token);\n    currentValue().setOffsetLimit(current_ - begin_);\n    break;\n  case tokenNumber:\n    successful = decodeNumber(token);\n    break;\n  case tokenString:\n    successful = decodeString(token);\n    break;\n  case tokenTrue:\n    {\n    Value v(true);\n    currentValue().swapPayload(v);\n    currentValue().setOffsetStart(token.start_ - begin_);\n    currentValue().setOffsetLimit(token.end_ - begin_);\n    }\n    break;\n  case tokenFalse:\n    {\n    Value v(false);\n    currentValue().swapPayload(v);\n    currentValue().setOffsetStart(token.start_ - begin_);\n    currentValue().setOffsetLimit(token.end_ - begin_);\n    }\n    break;\n  case tokenNull:\n    {\n    Value v;\n    currentValue().swapPayload(v);\n    currentValue().setOffsetStart(token.start_ - begin_);\n    currentValue().setOffsetLimit(token.end_ - begin_);\n    }\n    break;\n  case tokenArraySeparator:\n  case tokenObjectEnd:\n  case tokenArrayEnd:\n    if (features_.allowDroppedNullPlaceholders_) {\n      // \"Un-read\" the current token and mark the current value as a null\n      // token.\n      current_--;\n      Value v;\n      currentValue().swapPayload(v);\n      currentValue().setOffsetStart(current_ - begin_ - 1);\n      currentValue().setOffsetLimit(current_ - begin_);\n      break;\n    } // Else, fall through...\n  default:\n    currentValue().setOffsetStart(token.start_ - begin_);\n    currentValue().setOffsetLimit(token.end_ - begin_);\n    return addError(\"Syntax error: value, object or array expected.\", token);\n  }\n\n  if (collectComments_) {\n    lastValueEnd_ = current_;\n    lastValue_ = &currentValue();\n  }\n\n  return successful;\n}\n\nvoid Reader::skipCommentTokens(Token& token) {\n  if (features_.allowComments_) {\n    do {\n      readToken(token);\n    } while (token.type_ == tokenComment);\n  } else {\n    readToken(token);\n  }\n}\n\nbool Reader::readToken(Token& token) {\n  skipSpaces();\n  token.start_ = current_;\n  Char c = getNextChar();\n  bool ok = true;\n  switch (c) {\n  case '{':\n    token.type_ = tokenObjectBegin;\n    break;\n  case '}':\n    token.type_ = tokenObjectEnd;\n    break;\n  case '[':\n    token.type_ = tokenArrayBegin;\n    break;\n  case ']':\n    token.type_ = tokenArrayEnd;\n    break;\n  case '\"':\n    token.type_ = tokenString;\n    ok = readString();\n    break;\n  case '/':\n    token.type_ = tokenComment;\n    ok = readComment();\n    break;\n  case '0':\n  case '1':\n  case '2':\n  case '3':\n  case '4':\n  case '5':\n  case '6':\n  case '7':\n  case '8':\n  case '9':\n  case '-':\n    token.type_ = tokenNumber;\n    readNumber();\n    break;\n  case 't':\n    token.type_ = tokenTrue;\n    ok = match(\"rue\", 3);\n    break;\n  case 'f':\n    token.type_ = tokenFalse;\n    ok = match(\"alse\", 4);\n    break;\n  case 'n':\n    token.type_ = tokenNull;\n    ok = match(\"ull\", 3);\n    break;\n  case ',':\n    token.type_ = tokenArraySeparator;\n    break;\n  case ':':\n    token.type_ = tokenMemberSeparator;\n    break;\n  case 0:\n    token.type_ = tokenEndOfStream;\n    break;\n  default:\n    ok = false;\n    break;\n  }\n  if (!ok)\n    token.type_ = tokenError;\n  token.end_ = current_;\n  return true;\n}\n\nvoid Reader::skipSpaces() {\n  while (current_ != end_) {\n    Char c = *current_;\n    if (c == ' ' || c == '\\t' || c == '\\r' || c == '\\n')\n      ++current_;\n    else\n      break;\n  }\n}\n\nbool Reader::match(Location pattern, int patternLength) {\n  if (end_ - current_ < patternLength)\n    return false;\n  int index = patternLength;\n  while (index--)\n    if (current_[index] != pattern[index])\n      return false;\n  current_ += patternLength;\n  return true;\n}\n\nbool Reader::readComment() {\n  Location commentBegin = current_ - 1;\n  Char c = getNextChar();\n  bool successful = false;\n  if (c == '*')\n    successful = readCStyleComment();\n  else if (c == '/')\n    successful = readCppStyleComment();\n  if (!successful)\n    return false;\n\n  if (collectComments_) {\n    CommentPlacement placement = commentBefore;\n    if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) {\n      if (c != '*' || !containsNewLine(commentBegin, current_))\n        placement = commentAfterOnSameLine;\n    }\n\n    addComment(commentBegin, current_, placement);\n  }\n  return true;\n}\n\nJSONCPP_STRING Reader::normalizeEOL(Reader::Location begin, Reader::Location end) {\n  JSONCPP_STRING normalized;\n  normalized.reserve(static_cast<size_t>(end - begin));\n  Reader::Location current = begin;\n  while (current != end) {\n    char c = *current++;\n    if (c == '\\r') {\n      if (current != end && *current == '\\n')\n         // convert dos EOL\n         ++current;\n      // convert Mac EOL\n      normalized += '\\n';\n    } else {\n      normalized += c;\n    }\n  }\n  return normalized;\n}\n\nvoid\nReader::addComment(Location begin, Location end, CommentPlacement placement) {\n  assert(collectComments_);\n  const JSONCPP_STRING& normalized = normalizeEOL(begin, end);\n  if (placement == commentAfterOnSameLine) {\n    assert(lastValue_ != 0);\n    lastValue_->setComment(normalized, placement);\n  } else {\n    commentsBefore_ += normalized;\n  }\n}\n\nbool Reader::readCStyleComment() {\n  while ((current_ + 1) < end_) {\n    Char c = getNextChar();\n    if (c == '*' && *current_ == '/')\n      break;\n  }\n  return getNextChar() == '/';\n}\n\nbool Reader::readCppStyleComment() {\n  while (current_ != end_) {\n    Char c = getNextChar();\n    if (c == '\\n')\n      break;\n    if (c == '\\r') {\n      // Consume DOS EOL. It will be normalized in addComment.\n      if (current_ != end_ && *current_ == '\\n')\n        getNextChar();\n      // Break on Moc OS 9 EOL.\n      break;\n    }\n  }\n  return true;\n}\n\nvoid Reader::readNumber() {\n  const char *p = current_;\n  char c = '0'; // stopgap for already consumed character\n  // integral part\n  while (c >= '0' && c <= '9')\n    c = (current_ = p) < end_ ? *p++ : '\\0';\n  // fractional part\n  if (c == '.') {\n    c = (current_ = p) < end_ ? *p++ : '\\0';\n    while (c >= '0' && c <= '9')\n      c = (current_ = p) < end_ ? *p++ : '\\0';\n  }\n  // exponential part\n  if (c == 'e' || c == 'E') {\n    c = (current_ = p) < end_ ? *p++ : '\\0';\n    if (c == '+' || c == '-')\n      c = (current_ = p) < end_ ? *p++ : '\\0';\n    while (c >= '0' && c <= '9')\n      c = (current_ = p) < end_ ? *p++ : '\\0';\n  }\n}\n\nbool Reader::readString() {\n  Char c = '\\0';\n  while (current_ != end_) {\n    c = getNextChar();\n    if (c == '\\\\')\n      getNextChar();\n    else if (c == '\"')\n      break;\n  }\n  return c == '\"';\n}\n\nbool Reader::readObject(Token& tokenStart) {\n  Token tokenName;\n  JSONCPP_STRING name;\n  Value init(objectValue);\n  currentValue().swapPayload(init);\n  currentValue().setOffsetStart(tokenStart.start_ - begin_);\n  while (readToken(tokenName)) {\n    bool initialTokenOk = true;\n    while (tokenName.type_ == tokenComment && initialTokenOk)\n      initialTokenOk = readToken(tokenName);\n    if (!initialTokenOk)\n      break;\n    if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object\n      return true;\n    name.clear();\n    if (tokenName.type_ == tokenString) {\n      if (!decodeString(tokenName, name))\n        return recoverFromError(tokenObjectEnd);\n    } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) {\n      Value numberName;\n      if (!decodeNumber(tokenName, numberName))\n        return recoverFromError(tokenObjectEnd);\n      name = JSONCPP_STRING(numberName.asCString());\n    } else {\n      break;\n    }\n\n    Token colon;\n    if (!readToken(colon) || colon.type_ != tokenMemberSeparator) {\n      return addErrorAndRecover(\n          \"Missing ':' after object member name\", colon, tokenObjectEnd);\n    }\n    Value& value = currentValue()[name];\n    nodes_.push(&value);\n    bool ok = readValue();\n    nodes_.pop();\n    if (!ok) // error already set\n      return recoverFromError(tokenObjectEnd);\n\n    Token comma;\n    if (!readToken(comma) ||\n        (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator &&\n         comma.type_ != tokenComment)) {\n      return addErrorAndRecover(\n          \"Missing ',' or '}' in object declaration\", comma, tokenObjectEnd);\n    }\n    bool finalizeTokenOk = true;\n    while (comma.type_ == tokenComment && finalizeTokenOk)\n      finalizeTokenOk = readToken(comma);\n    if (comma.type_ == tokenObjectEnd)\n      return true;\n  }\n  return addErrorAndRecover(\n      \"Missing '}' or object member name\", tokenName, tokenObjectEnd);\n}\n\nbool Reader::readArray(Token& tokenStart) {\n  Value init(arrayValue);\n  currentValue().swapPayload(init);\n  currentValue().setOffsetStart(tokenStart.start_ - begin_);\n  skipSpaces();\n  if (current_ != end_ && *current_ == ']') // empty array\n  {\n    Token endArray;\n    readToken(endArray);\n    return true;\n  }\n  int index = 0;\n  for (;;) {\n    Value& value = currentValue()[index++];\n    nodes_.push(&value);\n    bool ok = readValue();\n    nodes_.pop();\n    if (!ok) // error already set\n      return recoverFromError(tokenArrayEnd);\n\n    Token token;\n    // Accept Comment after last item in the array.\n    ok = readToken(token);\n    while (token.type_ == tokenComment && ok) {\n      ok = readToken(token);\n    }\n    bool badTokenType =\n        (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd);\n    if (!ok || badTokenType) {\n      return addErrorAndRecover(\n          \"Missing ',' or ']' in array declaration\", token, tokenArrayEnd);\n    }\n    if (token.type_ == tokenArrayEnd)\n      break;\n  }\n  return true;\n}\n\nbool Reader::decodeNumber(Token& token) {\n  Value decoded;\n  if (!decodeNumber(token, decoded))\n    return false;\n  currentValue().swapPayload(decoded);\n  currentValue().setOffsetStart(token.start_ - begin_);\n  currentValue().setOffsetLimit(token.end_ - begin_);\n  return true;\n}\n\nbool Reader::decodeNumber(Token& token, Value& decoded) {\n  // Attempts to parse the number as an integer. If the number is\n  // larger than the maximum supported value of an integer then\n  // we decode the number as a double.\n  Location current = token.start_;\n  bool isNegative = *current == '-';\n  if (isNegative)\n    ++current;\n  // TODO: Help the compiler do the div and mod at compile time or get rid of them.\n  Value::LargestUInt maxIntegerValue =\n      isNegative ? Value::LargestUInt(Value::maxLargestInt) + 1\n                 : Value::maxLargestUInt;\n  Value::LargestUInt threshold = maxIntegerValue / 10;\n  Value::LargestUInt value = 0;\n  while (current < token.end_) {\n    Char c = *current++;\n    if (c < '0' || c > '9')\n      return decodeDouble(token, decoded);\n    Value::UInt digit(static_cast<Value::UInt>(c - '0'));\n    if (value >= threshold) {\n      // We've hit or exceeded the max value divided by 10 (rounded down). If\n      // a) we've only just touched the limit, b) this is the last digit, and\n      // c) it's small enough to fit in that rounding delta, we're okay.\n      // Otherwise treat this number as a double to avoid overflow.\n      if (value > threshold || current != token.end_ ||\n          digit > maxIntegerValue % 10) {\n        return decodeDouble(token, decoded);\n      }\n    }\n    value = value * 10 + digit;\n  }\n  if (isNegative && value == maxIntegerValue)\n    decoded = Value::minLargestInt;\n  else if (isNegative)\n    decoded = -Value::LargestInt(value);\n  else if (value <= Value::LargestUInt(Value::maxInt))\n    decoded = Value::LargestInt(value);\n  else\n    decoded = value;\n  return true;\n}\n\nbool Reader::decodeDouble(Token& token) {\n  Value decoded;\n  if (!decodeDouble(token, decoded))\n    return false;\n  currentValue().swapPayload(decoded);\n  currentValue().setOffsetStart(token.start_ - begin_);\n  currentValue().setOffsetLimit(token.end_ - begin_);\n  return true;\n}\n\nbool Reader::decodeDouble(Token& token, Value& decoded) {\n  double value = 0;\n  JSONCPP_STRING buffer(token.start_, token.end_);\n  JSONCPP_ISTRINGSTREAM is(buffer);\n  if (!(is >> value))\n    return addError(\"'\" + JSONCPP_STRING(token.start_, token.end_) +\n                        \"' is not a number.\",\n                    token);\n  decoded = value;\n  return true;\n}\n\nbool Reader::decodeString(Token& token) {\n  JSONCPP_STRING decoded_string;\n  if (!decodeString(token, decoded_string))\n    return false;\n  Value decoded(decoded_string);\n  currentValue().swapPayload(decoded);\n  currentValue().setOffsetStart(token.start_ - begin_);\n  currentValue().setOffsetLimit(token.end_ - begin_);\n  return true;\n}\n\nbool Reader::decodeString(Token& token, JSONCPP_STRING& decoded) {\n  decoded.reserve(static_cast<size_t>(token.end_ - token.start_ - 2));\n  Location current = token.start_ + 1; // skip '\"'\n  Location end = token.end_ - 1;       // do not include '\"'\n  while (current != end) {\n    Char c = *current++;\n    if (c == '\"')\n      break;\n    else if (c == '\\\\') {\n      if (current == end)\n        return addError(\"Empty escape sequence in string\", token, current);\n      Char escape = *current++;\n      switch (escape) {\n      case '\"':\n        decoded += '\"';\n        break;\n      case '/':\n        decoded += '/';\n        break;\n      case '\\\\':\n        decoded += '\\\\';\n        break;\n      case 'b':\n        decoded += '\\b';\n        break;\n      case 'f':\n        decoded += '\\f';\n        break;\n      case 'n':\n        decoded += '\\n';\n        break;\n      case 'r':\n        decoded += '\\r';\n        break;\n      case 't':\n        decoded += '\\t';\n        break;\n      case 'u': {\n        unsigned int unicode;\n        if (!decodeUnicodeCodePoint(token, current, end, unicode))\n          return false;\n        decoded += codePointToUTF8(unicode);\n      } break;\n      default:\n        return addError(\"Bad escape sequence in string\", token, current);\n      }\n    } else {\n      decoded += c;\n    }\n  }\n  return true;\n}\n\nbool Reader::decodeUnicodeCodePoint(Token& token,\n                                    Location& current,\n                                    Location end,\n                                    unsigned int& unicode) {\n\n  if (!decodeUnicodeEscapeSequence(token, current, end, unicode))\n    return false;\n  if (unicode >= 0xD800 && unicode <= 0xDBFF) {\n    // surrogate pairs\n    if (end - current < 6)\n      return addError(\n          \"additional six characters expected to parse unicode surrogate pair.\",\n          token,\n          current);\n    unsigned int surrogatePair;\n    if (*(current++) == '\\\\' && *(current++) == 'u') {\n      if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) {\n        unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);\n      } else\n        return false;\n    } else\n      return addError(\"expecting another \\\\u token to begin the second half of \"\n                      \"a unicode surrogate pair\",\n                      token,\n                      current);\n  }\n  return true;\n}\n\nbool Reader::decodeUnicodeEscapeSequence(Token& token,\n                                         Location& current,\n                                         Location end,\n                                         unsigned int& ret_unicode) {\n  if (end - current < 4)\n    return addError(\n        \"Bad unicode escape sequence in string: four digits expected.\",\n        token,\n        current);\n  int unicode = 0;\n  for (int index = 0; index < 4; ++index) {\n    Char c = *current++;\n    unicode *= 16;\n    if (c >= '0' && c <= '9')\n      unicode += c - '0';\n    else if (c >= 'a' && c <= 'f')\n      unicode += c - 'a' + 10;\n    else if (c >= 'A' && c <= 'F')\n      unicode += c - 'A' + 10;\n    else\n      return addError(\n          \"Bad unicode escape sequence in string: hexadecimal digit expected.\",\n          token,\n          current);\n  }\n  ret_unicode = static_cast<unsigned int>(unicode);\n  return true;\n}\n\nbool\nReader::addError(const JSONCPP_STRING& message, Token& token, Location extra) {\n  ErrorInfo info;\n  info.token_ = token;\n  info.message_ = message;\n  info.extra_ = extra;\n  errors_.push_back(info);\n  return false;\n}\n\nbool Reader::recoverFromError(TokenType skipUntilToken) {\n  size_t const errorCount = errors_.size();\n  Token skip;\n  for (;;) {\n    if (!readToken(skip))\n      errors_.resize(errorCount); // discard errors caused by recovery\n    if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream)\n      break;\n  }\n  errors_.resize(errorCount);\n  return false;\n}\n\nbool Reader::addErrorAndRecover(const JSONCPP_STRING& message,\n                                Token& token,\n                                TokenType skipUntilToken) {\n  addError(message, token);\n  return recoverFromError(skipUntilToken);\n}\n\nValue& Reader::currentValue() { return *(nodes_.top()); }\n\nReader::Char Reader::getNextChar() {\n  if (current_ == end_)\n    return 0;\n  return *current_++;\n}\n\nvoid Reader::getLocationLineAndColumn(Location location,\n                                      int& line,\n                                      int& column) const {\n  Location current = begin_;\n  Location lastLineStart = current;\n  line = 0;\n  while (current < location && current != end_) {\n    Char c = *current++;\n    if (c == '\\r') {\n      if (*current == '\\n')\n        ++current;\n      lastLineStart = current;\n      ++line;\n    } else if (c == '\\n') {\n      lastLineStart = current;\n      ++line;\n    }\n  }\n  // column & line start at 1\n  column = int(location - lastLineStart) + 1;\n  ++line;\n}\n\nJSONCPP_STRING Reader::getLocationLineAndColumn(Location location) const {\n  int line, column;\n  getLocationLineAndColumn(location, line, column);\n  char buffer[18 + 16 + 16 + 1];\n  snprintf(buffer, sizeof(buffer), \"Line %d, Column %d\", line, column);\n  return buffer;\n}\n\n// Deprecated. Preserved for backward compatibility\nJSONCPP_STRING Reader::getFormatedErrorMessages() const {\n  return getFormattedErrorMessages();\n}\n\nJSONCPP_STRING Reader::getFormattedErrorMessages() const {\n  JSONCPP_STRING formattedMessage;\n  for (Errors::const_iterator itError = errors_.begin();\n       itError != errors_.end();\n       ++itError) {\n    const ErrorInfo& error = *itError;\n    formattedMessage +=\n        \"* \" + getLocationLineAndColumn(error.token_.start_) + \"\\n\";\n    formattedMessage += \"  \" + error.message_ + \"\\n\";\n    if (error.extra_)\n      formattedMessage +=\n          \"See \" + getLocationLineAndColumn(error.extra_) + \" for detail.\\n\";\n  }\n  return formattedMessage;\n}\n\nstd::vector<Reader::StructuredError> Reader::getStructuredErrors() const {\n  std::vector<Reader::StructuredError> allErrors;\n  for (Errors::const_iterator itError = errors_.begin();\n       itError != errors_.end();\n       ++itError) {\n    const ErrorInfo& error = *itError;\n    Reader::StructuredError structured;\n    structured.offset_start = error.token_.start_ - begin_;\n    structured.offset_limit = error.token_.end_ - begin_;\n    structured.message = error.message_;\n    allErrors.push_back(structured);\n  }\n  return allErrors;\n}\n\nbool Reader::pushError(const Value& value, const JSONCPP_STRING& message) {\n  ptrdiff_t const length = end_ - begin_;\n  if(value.getOffsetStart() > length\n    || value.getOffsetLimit() > length)\n    return false;\n  Token token;\n  token.type_ = tokenError;\n  token.start_ = begin_ + value.getOffsetStart();\n  token.end_ = end_ + value.getOffsetLimit();\n  ErrorInfo info;\n  info.token_ = token;\n  info.message_ = message;\n  info.extra_ = 0;\n  errors_.push_back(info);\n  return true;\n}\n\nbool Reader::pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra) {\n  ptrdiff_t const length = end_ - begin_;\n  if(value.getOffsetStart() > length\n    || value.getOffsetLimit() > length\n    || extra.getOffsetLimit() > length)\n    return false;\n  Token token;\n  token.type_ = tokenError;\n  token.start_ = begin_ + value.getOffsetStart();\n  token.end_ = begin_ + value.getOffsetLimit();\n  ErrorInfo info;\n  info.token_ = token;\n  info.message_ = message;\n  info.extra_ = begin_ + extra.getOffsetStart();\n  errors_.push_back(info);\n  return true;\n}\n\nbool Reader::good() const {\n  return !errors_.size();\n}\n\n// exact copy of Features\nclass OurFeatures {\npublic:\n  static OurFeatures all();\n  bool allowComments_;\n  bool strictRoot_;\n  bool allowDroppedNullPlaceholders_;\n  bool allowNumericKeys_;\n  bool allowSingleQuotes_;\n  bool failIfExtra_;\n  bool rejectDupKeys_;\n  bool allowSpecialFloats_;\n  int stackLimit_;\n};  // OurFeatures\n\n// exact copy of Implementation of class Features\n// ////////////////////////////////\n\nOurFeatures OurFeatures::all() { return OurFeatures(); }\n\n// Implementation of class Reader\n// ////////////////////////////////\n\n// exact copy of Reader, renamed to OurReader\nclass OurReader {\npublic:\n  typedef char Char;\n  typedef const Char* Location;\n  struct StructuredError {\n    ptrdiff_t offset_start;\n    ptrdiff_t offset_limit;\n    JSONCPP_STRING message;\n  };\n\n  OurReader(OurFeatures const& features);\n  bool parse(const char* beginDoc,\n             const char* endDoc,\n             Value& root,\n             bool collectComments = true);\n  JSONCPP_STRING getFormattedErrorMessages() const;\n  std::vector<StructuredError> getStructuredErrors() const;\n  bool pushError(const Value& value, const JSONCPP_STRING& message);\n  bool pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra);\n  bool good() const;\n\nprivate:\n  OurReader(OurReader const&);  // no impl\n  void operator=(OurReader const&);  // no impl\n\n  enum TokenType {\n    tokenEndOfStream = 0,\n    tokenObjectBegin,\n    tokenObjectEnd,\n    tokenArrayBegin,\n    tokenArrayEnd,\n    tokenString,\n    tokenNumber,\n    tokenTrue,\n    tokenFalse,\n    tokenNull,\n    tokenNaN,\n    tokenPosInf,\n    tokenNegInf,\n    tokenArraySeparator,\n    tokenMemberSeparator,\n    tokenComment,\n    tokenError\n  };\n\n  class Token {\n  public:\n    TokenType type_;\n    Location start_;\n    Location end_;\n  };\n\n  class ErrorInfo {\n  public:\n    Token token_;\n    JSONCPP_STRING message_;\n    Location extra_;\n  };\n\n  typedef std::deque<ErrorInfo> Errors;\n\n  bool readToken(Token& token);\n  void skipSpaces();\n  bool match(Location pattern, int patternLength);\n  bool readComment();\n  bool readCStyleComment();\n  bool readCppStyleComment();\n  bool readString();\n  bool readStringSingleQuote();\n  bool readNumber(bool checkInf);\n  bool readValue();\n  bool readObject(Token& token);\n  bool readArray(Token& token);\n  bool decodeNumber(Token& token);\n  bool decodeNumber(Token& token, Value& decoded);\n  bool decodeString(Token& token);\n  bool decodeString(Token& token, JSONCPP_STRING& decoded);\n  bool decodeDouble(Token& token);\n  bool decodeDouble(Token& token, Value& decoded);\n  bool decodeUnicodeCodePoint(Token& token,\n                              Location& current,\n                              Location end,\n                              unsigned int& unicode);\n  bool decodeUnicodeEscapeSequence(Token& token,\n                                   Location& current,\n                                   Location end,\n                                   unsigned int& unicode);\n  bool addError(const JSONCPP_STRING& message, Token& token, Location extra = 0);\n  bool recoverFromError(TokenType skipUntilToken);\n  bool addErrorAndRecover(const JSONCPP_STRING& message,\n                          Token& token,\n                          TokenType skipUntilToken);\n  void skipUntilSpace();\n  Value& currentValue();\n  Char getNextChar();\n  void\n  getLocationLineAndColumn(Location location, int& line, int& column) const;\n  JSONCPP_STRING getLocationLineAndColumn(Location location) const;\n  void addComment(Location begin, Location end, CommentPlacement placement);\n  void skipCommentTokens(Token& token);\n\n  static JSONCPP_STRING normalizeEOL(Location begin, Location end);\n  static bool containsNewLine(Location begin, Location end);\n\n  typedef std::stack<Value*> Nodes;\n  Nodes nodes_;\n  Errors errors_;\n  JSONCPP_STRING document_;\n  Location begin_;\n  Location end_;\n  Location current_;\n  Location lastValueEnd_;\n  Value* lastValue_;\n  JSONCPP_STRING commentsBefore_;\n\n  OurFeatures const features_;\n  bool collectComments_;\n};  // OurReader\n\n// complete copy of Read impl, for OurReader\n\nbool OurReader::containsNewLine(OurReader::Location begin, OurReader::Location end) {\n  for (; begin < end; ++begin)\n    if (*begin == '\\n' || *begin == '\\r')\n      return true;\n  return false;\n}\n\nOurReader::OurReader(OurFeatures const& features)\n    : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),\n      lastValue_(), commentsBefore_(),\n      features_(features), collectComments_() {\n}\n\nbool OurReader::parse(const char* beginDoc,\n                   const char* endDoc,\n                   Value& root,\n                   bool collectComments) {\n  if (!features_.allowComments_) {\n    collectComments = false;\n  }\n\n  begin_ = beginDoc;\n  end_ = endDoc;\n  collectComments_ = collectComments;\n  current_ = begin_;\n  lastValueEnd_ = 0;\n  lastValue_ = 0;\n  commentsBefore_.clear();\n  errors_.clear();\n  while (!nodes_.empty())\n    nodes_.pop();\n  nodes_.push(&root);\n\n  bool successful = readValue();\n  Token token;\n  skipCommentTokens(token);\n  if (features_.failIfExtra_) {\n    if ((features_.strictRoot_ || token.type_ != tokenError) && token.type_ != tokenEndOfStream) {\n      addError(\"Extra non-whitespace after JSON value.\", token);\n      return false;\n    }\n  }\n  if (collectComments_ && !commentsBefore_.empty())\n    root.setComment(commentsBefore_, commentAfter);\n  if (features_.strictRoot_) {\n    if (!root.isArray() && !root.isObject()) {\n      // Set error location to start of doc, ideally should be first token found\n      // in doc\n      token.type_ = tokenError;\n      token.start_ = beginDoc;\n      token.end_ = endDoc;\n      addError(\n          \"A valid JSON document must be either an array or an object value.\",\n          token);\n      return false;\n    }\n  }\n  return successful;\n}\n\nbool OurReader::readValue() {\n  //  To preserve the old behaviour we cast size_t to int.\n  if (static_cast<int>(nodes_.size()) > features_.stackLimit_) throwRuntimeError(\"Exceeded stackLimit in readValue().\");\n  Token token;\n  skipCommentTokens(token);\n  bool successful = true;\n\n  if (collectComments_ && !commentsBefore_.empty()) {\n    currentValue().setComment(commentsBefore_, commentBefore);\n    commentsBefore_.clear();\n  }\n\n  switch (token.type_) {\n  case tokenObjectBegin:\n    successful = readObject(token);\n    currentValue().setOffsetLimit(current_ - begin_);\n    break;\n  case tokenArrayBegin:\n    successful = readArray(token);\n    currentValue().setOffsetLimit(current_ - begin_);\n    break;\n  case tokenNumber:\n    successful = decodeNumber(token);\n    break;\n  case tokenString:\n    successful = decodeString(token);\n    break;\n  case tokenTrue:\n    {\n    Value v(true);\n    currentValue().swapPayload(v);\n    currentValue().setOffsetStart(token.start_ - begin_);\n    currentValue().setOffsetLimit(token.end_ - begin_);\n    }\n    break;\n  case tokenFalse:\n    {\n    Value v(false);\n    currentValue().swapPayload(v);\n    currentValue().setOffsetStart(token.start_ - begin_);\n    currentValue().setOffsetLimit(token.end_ - begin_);\n    }\n    break;\n  case tokenNull:\n    {\n    Value v;\n    currentValue().swapPayload(v);\n    currentValue().setOffsetStart(token.start_ - begin_);\n    currentValue().setOffsetLimit(token.end_ - begin_);\n    }\n    break;\n  case tokenNaN:\n    {\n    Value v(std::numeric_limits<double>::quiet_NaN());\n    currentValue().swapPayload(v);\n    currentValue().setOffsetStart(token.start_ - begin_);\n    currentValue().setOffsetLimit(token.end_ - begin_);\n    }\n    break;\n  case tokenPosInf:\n    {\n    Value v(std::numeric_limits<double>::infinity());\n    currentValue().swapPayload(v);\n    currentValue().setOffsetStart(token.start_ - begin_);\n    currentValue().setOffsetLimit(token.end_ - begin_);\n    }\n    break;\n  case tokenNegInf:\n    {\n    Value v(-std::numeric_limits<double>::infinity());\n    currentValue().swapPayload(v);\n    currentValue().setOffsetStart(token.start_ - begin_);\n    currentValue().setOffsetLimit(token.end_ - begin_);\n    }\n    break;\n  case tokenArraySeparator:\n  case tokenObjectEnd:\n  case tokenArrayEnd:\n    if (features_.allowDroppedNullPlaceholders_) {\n      // \"Un-read\" the current token and mark the current value as a null\n      // token.\n      current_--;\n      Value v;\n      currentValue().swapPayload(v);\n      currentValue().setOffsetStart(current_ - begin_ - 1);\n      currentValue().setOffsetLimit(current_ - begin_);\n      break;\n    } // else, fall through ...\n  default:\n    currentValue().setOffsetStart(token.start_ - begin_);\n    currentValue().setOffsetLimit(token.end_ - begin_);\n    return addError(\"Syntax error: value, object or array expected.\", token);\n  }\n\n  if (collectComments_) {\n    lastValueEnd_ = current_;\n    lastValue_ = &currentValue();\n  }\n\n  return successful;\n}\n\nvoid OurReader::skipCommentTokens(Token& token) {\n  if (features_.allowComments_) {\n    do {\n      readToken(token);\n    } while (token.type_ == tokenComment);\n  } else {\n    readToken(token);\n  }\n}\n\nbool OurReader::readToken(Token& token) {\n  skipSpaces();\n  token.start_ = current_;\n  Char c = getNextChar();\n  bool ok = true;\n  switch (c) {\n  case '{':\n    token.type_ = tokenObjectBegin;\n    break;\n  case '}':\n    token.type_ = tokenObjectEnd;\n    break;\n  case '[':\n    token.type_ = tokenArrayBegin;\n    break;\n  case ']':\n    token.type_ = tokenArrayEnd;\n    break;\n  case '\"':\n    token.type_ = tokenString;\n    ok = readString();\n    break;\n  case '\\'':\n    if (features_.allowSingleQuotes_) {\n    token.type_ = tokenString;\n    ok = readStringSingleQuote();\n    break;\n    } // else fall through\n  case '/':\n    token.type_ = tokenComment;\n    ok = readComment();\n    break;\n  case '0':\n  case '1':\n  case '2':\n  case '3':\n  case '4':\n  case '5':\n  case '6':\n  case '7':\n  case '8':\n  case '9':\n    token.type_ = tokenNumber;\n    readNumber(false);\n    break;\n  case '-':\n    if (readNumber(true)) {\n      token.type_ = tokenNumber;\n    } else {\n      token.type_ = tokenNegInf;\n      ok = features_.allowSpecialFloats_ && match(\"nfinity\", 7);\n    }\n    break;\n  case 't':\n    token.type_ = tokenTrue;\n    ok = match(\"rue\", 3);\n    break;\n  case 'f':\n    token.type_ = tokenFalse;\n    ok = match(\"alse\", 4);\n    break;\n  case 'n':\n    token.type_ = tokenNull;\n    ok = match(\"ull\", 3);\n    break;\n  case 'N':\n    if (features_.allowSpecialFloats_) {\n      token.type_ = tokenNaN;\n      ok = match(\"aN\", 2);\n    } else {\n      ok = false;\n    }\n    break;\n  case 'I':\n    if (features_.allowSpecialFloats_) {\n      token.type_ = tokenPosInf;\n      ok = match(\"nfinity\", 7);\n    } else {\n      ok = false;\n    }\n    break;\n  case ',':\n    token.type_ = tokenArraySeparator;\n    break;\n  case ':':\n    token.type_ = tokenMemberSeparator;\n    break;\n  case 0:\n    token.type_ = tokenEndOfStream;\n    break;\n  default:\n    ok = false;\n    break;\n  }\n  if (!ok)\n    token.type_ = tokenError;\n  token.end_ = current_;\n  return true;\n}\n\nvoid OurReader::skipSpaces() {\n  while (current_ != end_) {\n    Char c = *current_;\n    if (c == ' ' || c == '\\t' || c == '\\r' || c == '\\n')\n      ++current_;\n    else\n      break;\n  }\n}\n\nbool OurReader::match(Location pattern, int patternLength) {\n  if (end_ - current_ < patternLength)\n    return false;\n  int index = patternLength;\n  while (index--)\n    if (current_[index] != pattern[index])\n      return false;\n  current_ += patternLength;\n  return true;\n}\n\nbool OurReader::readComment() {\n  Location commentBegin = current_ - 1;\n  Char c = getNextChar();\n  bool successful = false;\n  if (c == '*')\n    successful = readCStyleComment();\n  else if (c == '/')\n    successful = readCppStyleComment();\n  if (!successful)\n    return false;\n\n  if (collectComments_) {\n    CommentPlacement placement = commentBefore;\n    if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) {\n      if (c != '*' || !containsNewLine(commentBegin, current_))\n        placement = commentAfterOnSameLine;\n    }\n\n    addComment(commentBegin, current_, placement);\n  }\n  return true;\n}\n\nJSONCPP_STRING OurReader::normalizeEOL(OurReader::Location begin, OurReader::Location end) {\n  JSONCPP_STRING normalized;\n  normalized.reserve(static_cast<size_t>(end - begin));\n  OurReader::Location current = begin;\n  while (current != end) {\n    char c = *current++;\n    if (c == '\\r') {\n      if (current != end && *current == '\\n')\n         // convert dos EOL\n         ++current;\n      // convert Mac EOL\n      normalized += '\\n';\n    } else {\n      normalized += c;\n    }\n  }\n  return normalized;\n}\n\nvoid\nOurReader::addComment(Location begin, Location end, CommentPlacement placement) {\n  assert(collectComments_);\n  const JSONCPP_STRING& normalized = normalizeEOL(begin, end);\n  if (placement == commentAfterOnSameLine) {\n    assert(lastValue_ != 0);\n    lastValue_->setComment(normalized, placement);\n  } else {\n    commentsBefore_ += normalized;\n  }\n}\n\nbool OurReader::readCStyleComment() {\n  while ((current_ + 1) < end_) {\n    Char c = getNextChar();\n    if (c == '*' && *current_ == '/')\n      break;\n  }\n  return getNextChar() == '/';\n}\n\nbool OurReader::readCppStyleComment() {\n  while (current_ != end_) {\n    Char c = getNextChar();\n    if (c == '\\n')\n      break;\n    if (c == '\\r') {\n      // Consume DOS EOL. It will be normalized in addComment.\n      if (current_ != end_ && *current_ == '\\n')\n        getNextChar();\n      // Break on Moc OS 9 EOL.\n      break;\n    }\n  }\n  return true;\n}\n\nbool OurReader::readNumber(bool checkInf) {\n  const char *p = current_;\n  if (checkInf && p != end_ && *p == 'I') {\n    current_ = ++p;\n    return false;\n  }\n  char c = '0'; // stopgap for already consumed character\n  // integral part\n  while (c >= '0' && c <= '9')\n    c = (current_ = p) < end_ ? *p++ : '\\0';\n  // fractional part\n  if (c == '.') {\n    c = (current_ = p) < end_ ? *p++ : '\\0';\n    while (c >= '0' && c <= '9')\n      c = (current_ = p) < end_ ? *p++ : '\\0';\n  }\n  // exponential part\n  if (c == 'e' || c == 'E') {\n    c = (current_ = p) < end_ ? *p++ : '\\0';\n    if (c == '+' || c == '-')\n      c = (current_ = p) < end_ ? *p++ : '\\0';\n    while (c >= '0' && c <= '9')\n      c = (current_ = p) < end_ ? *p++ : '\\0';\n  }\n  return true;\n}\nbool OurReader::readString() {\n  Char c = 0;\n  while (current_ != end_) {\n    c = getNextChar();\n    if (c == '\\\\')\n      getNextChar();\n    else if (c == '\"')\n      break;\n  }\n  return c == '\"';\n}\n\n\nbool OurReader::readStringSingleQuote() {\n  Char c = 0;\n  while (current_ != end_) {\n    c = getNextChar();\n    if (c == '\\\\')\n      getNextChar();\n    else if (c == '\\'')\n      break;\n  }\n  return c == '\\'';\n}\n\nbool OurReader::readObject(Token& tokenStart) {\n  Token tokenName;\n  JSONCPP_STRING name;\n  Value init(objectValue);\n  currentValue().swapPayload(init);\n  currentValue().setOffsetStart(tokenStart.start_ - begin_);\n  while (readToken(tokenName)) {\n    bool initialTokenOk = true;\n    while (tokenName.type_ == tokenComment && initialTokenOk)\n      initialTokenOk = readToken(tokenName);\n    if (!initialTokenOk)\n      break;\n    if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object\n      return true;\n    name.clear();\n    if (tokenName.type_ == tokenString) {\n      if (!decodeString(tokenName, name))\n        return recoverFromError(tokenObjectEnd);\n    } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) {\n      Value numberName;\n      if (!decodeNumber(tokenName, numberName))\n        return recoverFromError(tokenObjectEnd);\n      name = numberName.asString();\n    } else {\n      break;\n    }\n\n    Token colon;\n    if (!readToken(colon) || colon.type_ != tokenMemberSeparator) {\n      return addErrorAndRecover(\n          \"Missing ':' after object member name\", colon, tokenObjectEnd);\n    }\n    if (name.length() >= (1U<<30)) throwRuntimeError(\"keylength >= 2^30\");\n    if (features_.rejectDupKeys_ && currentValue().isMember(name)) {\n      JSONCPP_STRING msg = \"Duplicate key: '\" + name + \"'\";\n      return addErrorAndRecover(\n          msg, tokenName, tokenObjectEnd);\n    }\n    Value& value = currentValue()[name];\n    nodes_.push(&value);\n    bool ok = readValue();\n    nodes_.pop();\n    if (!ok) // error already set\n      return recoverFromError(tokenObjectEnd);\n\n    Token comma;\n    if (!readToken(comma) ||\n        (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator &&\n         comma.type_ != tokenComment)) {\n      return addErrorAndRecover(\n          \"Missing ',' or '}' in object declaration\", comma, tokenObjectEnd);\n    }\n    bool finalizeTokenOk = true;\n    while (comma.type_ == tokenComment && finalizeTokenOk)\n      finalizeTokenOk = readToken(comma);\n    if (comma.type_ == tokenObjectEnd)\n      return true;\n  }\n  return addErrorAndRecover(\n      \"Missing '}' or object member name\", tokenName, tokenObjectEnd);\n}\n\nbool OurReader::readArray(Token& tokenStart) {\n  Value init(arrayValue);\n  currentValue().swapPayload(init);\n  currentValue().setOffsetStart(tokenStart.start_ - begin_);\n  skipSpaces();\n  if (current_ != end_ && *current_ == ']') // empty array\n  {\n    Token endArray;\n    readToken(endArray);\n    return true;\n  }\n  int index = 0;\n  for (;;) {\n    Value& value = currentValue()[index++];\n    nodes_.push(&value);\n    bool ok = readValue();\n    nodes_.pop();\n    if (!ok) // error already set\n      return recoverFromError(tokenArrayEnd);\n\n    Token token;\n    // Accept Comment after last item in the array.\n    ok = readToken(token);\n    while (token.type_ == tokenComment && ok) {\n      ok = readToken(token);\n    }\n    bool badTokenType =\n        (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd);\n    if (!ok || badTokenType) {\n      return addErrorAndRecover(\n          \"Missing ',' or ']' in array declaration\", token, tokenArrayEnd);\n    }\n    if (token.type_ == tokenArrayEnd)\n      break;\n  }\n  return true;\n}\n\nbool OurReader::decodeNumber(Token& token) {\n  Value decoded;\n  if (!decodeNumber(token, decoded))\n    return false;\n  currentValue().swapPayload(decoded);\n  currentValue().setOffsetStart(token.start_ - begin_);\n  currentValue().setOffsetLimit(token.end_ - begin_);\n  return true;\n}\n\nbool OurReader::decodeNumber(Token& token, Value& decoded) {\n  // Attempts to parse the number as an integer. If the number is\n  // larger than the maximum supported value of an integer then\n  // we decode the number as a double.\n  Location current = token.start_;\n  bool isNegative = *current == '-';\n  if (isNegative)\n    ++current;\n  // TODO: Help the compiler do the div and mod at compile time or get rid of them.\n  Value::LargestUInt maxIntegerValue =\n      isNegative ? Value::LargestUInt(-Value::minLargestInt)\n                 : Value::maxLargestUInt;\n  Value::LargestUInt threshold = maxIntegerValue / 10;\n  Value::LargestUInt value = 0;\n  while (current < token.end_) {\n    Char c = *current++;\n    if (c < '0' || c > '9')\n      return decodeDouble(token, decoded);\n    Value::UInt digit(static_cast<Value::UInt>(c - '0'));\n    if (value >= threshold) {\n      // We've hit or exceeded the max value divided by 10 (rounded down). If\n      // a) we've only just touched the limit, b) this is the last digit, and\n      // c) it's small enough to fit in that rounding delta, we're okay.\n      // Otherwise treat this number as a double to avoid overflow.\n      if (value > threshold || current != token.end_ ||\n          digit > maxIntegerValue % 10) {\n        return decodeDouble(token, decoded);\n      }\n    }\n    value = value * 10 + digit;\n  }\n  if (isNegative)\n    decoded = -Value::LargestInt(value);\n  else if (value <= Value::LargestUInt(Value::maxInt))\n    decoded = Value::LargestInt(value);\n  else\n    decoded = value;\n  return true;\n}\n\nbool OurReader::decodeDouble(Token& token) {\n  Value decoded;\n  if (!decodeDouble(token, decoded))\n    return false;\n  currentValue().swapPayload(decoded);\n  currentValue().setOffsetStart(token.start_ - begin_);\n  currentValue().setOffsetLimit(token.end_ - begin_);\n  return true;\n}\n\nbool OurReader::decodeDouble(Token& token, Value& decoded) {\n  double value = 0;\n  const int bufferSize = 32;\n  int count;\n  ptrdiff_t const length = token.end_ - token.start_;\n\n  // Sanity check to avoid buffer overflow exploits.\n  if (length < 0) {\n    return addError(\"Unable to parse token length\", token);\n  }\n  size_t const ulength = static_cast<size_t>(length);\n\n  // Avoid using a string constant for the format control string given to\n  // sscanf, as this can cause hard to debug crashes on OS X. See here for more\n  // info:\n  //\n  //     http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html\n  char format[] = \"%lf\";\n\n  if (length <= bufferSize) {\n    Char buffer[bufferSize + 1];\n    memcpy(buffer, token.start_, ulength);\n    buffer[length] = 0;\n    fixNumericLocaleInput(buffer, buffer + length);\n    count = sscanf(buffer, format, &value);\n  } else {\n    JSONCPP_STRING buffer(token.start_, token.end_);\n    count = sscanf(buffer.c_str(), format, &value);\n  }\n\n  if (count != 1)\n    return addError(\"'\" + JSONCPP_STRING(token.start_, token.end_) +\n                        \"' is not a number.\",\n                    token);\n  decoded = value;\n  return true;\n}\n\nbool OurReader::decodeString(Token& token) {\n  JSONCPP_STRING decoded_string;\n  if (!decodeString(token, decoded_string))\n    return false;\n  Value decoded(decoded_string);\n  currentValue().swapPayload(decoded);\n  currentValue().setOffsetStart(token.start_ - begin_);\n  currentValue().setOffsetLimit(token.end_ - begin_);\n  return true;\n}\n\nbool OurReader::decodeString(Token& token, JSONCPP_STRING& decoded) {\n  decoded.reserve(static_cast<size_t>(token.end_ - token.start_ - 2));\n  Location current = token.start_ + 1; // skip '\"'\n  Location end = token.end_ - 1;       // do not include '\"'\n  while (current != end) {\n    Char c = *current++;\n    if (c == '\"')\n      break;\n    else if (c == '\\\\') {\n      if (current == end)\n        return addError(\"Empty escape sequence in string\", token, current);\n      Char escape = *current++;\n      switch (escape) {\n      case '\"':\n        decoded += '\"';\n        break;\n      case '/':\n        decoded += '/';\n        break;\n      case '\\\\':\n        decoded += '\\\\';\n        break;\n      case 'b':\n        decoded += '\\b';\n        break;\n      case 'f':\n        decoded += '\\f';\n        break;\n      case 'n':\n        decoded += '\\n';\n        break;\n      case 'r':\n        decoded += '\\r';\n        break;\n      case 't':\n        decoded += '\\t';\n        break;\n      case 'u': {\n        unsigned int unicode;\n        if (!decodeUnicodeCodePoint(token, current, end, unicode))\n          return false;\n        decoded += codePointToUTF8(unicode);\n      } break;\n      default:\n        return addError(\"Bad escape sequence in string\", token, current);\n      }\n    } else {\n      decoded += c;\n    }\n  }\n  return true;\n}\n\nbool OurReader::decodeUnicodeCodePoint(Token& token,\n                                    Location& current,\n                                    Location end,\n                                    unsigned int& unicode) {\n\n  if (!decodeUnicodeEscapeSequence(token, current, end, unicode))\n    return false;\n  if (unicode >= 0xD800 && unicode <= 0xDBFF) {\n    // surrogate pairs\n    if (end - current < 6)\n      return addError(\n          \"additional six characters expected to parse unicode surrogate pair.\",\n          token,\n          current);\n    unsigned int surrogatePair;\n    if (*(current++) == '\\\\' && *(current++) == 'u') {\n      if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) {\n        unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);\n      } else\n        return false;\n    } else\n      return addError(\"expecting another \\\\u token to begin the second half of \"\n                      \"a unicode surrogate pair\",\n                      token,\n                      current);\n  }\n  return true;\n}\n\nbool OurReader::decodeUnicodeEscapeSequence(Token& token,\n                                         Location& current,\n                                         Location end,\n                                         unsigned int& ret_unicode) {\n  if (end - current < 4)\n    return addError(\n        \"Bad unicode escape sequence in string: four digits expected.\",\n        token,\n        current);\n  int unicode = 0;\n  for (int index = 0; index < 4; ++index) {\n    Char c = *current++;\n    unicode *= 16;\n    if (c >= '0' && c <= '9')\n      unicode += c - '0';\n    else if (c >= 'a' && c <= 'f')\n      unicode += c - 'a' + 10;\n    else if (c >= 'A' && c <= 'F')\n      unicode += c - 'A' + 10;\n    else\n      return addError(\n          \"Bad unicode escape sequence in string: hexadecimal digit expected.\",\n          token,\n          current);\n  }\n  ret_unicode = static_cast<unsigned int>(unicode);\n  return true;\n}\n\nbool\nOurReader::addError(const JSONCPP_STRING& message, Token& token, Location extra) {\n  ErrorInfo info;\n  info.token_ = token;\n  info.message_ = message;\n  info.extra_ = extra;\n  errors_.push_back(info);\n  return false;\n}\n\nbool OurReader::recoverFromError(TokenType skipUntilToken) {\n  size_t errorCount = errors_.size();\n  Token skip;\n  for (;;) {\n    if (!readToken(skip))\n      errors_.resize(errorCount); // discard errors caused by recovery\n    if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream)\n      break;\n  }\n  errors_.resize(errorCount);\n  return false;\n}\n\nbool OurReader::addErrorAndRecover(const JSONCPP_STRING& message,\n                                Token& token,\n                                TokenType skipUntilToken) {\n  addError(message, token);\n  return recoverFromError(skipUntilToken);\n}\n\nValue& OurReader::currentValue() { return *(nodes_.top()); }\n\nOurReader::Char OurReader::getNextChar() {\n  if (current_ == end_)\n    return 0;\n  return *current_++;\n}\n\nvoid OurReader::getLocationLineAndColumn(Location location,\n                                      int& line,\n                                      int& column) const {\n  Location current = begin_;\n  Location lastLineStart = current;\n  line = 0;\n  while (current < location && current != end_) {\n    Char c = *current++;\n    if (c == '\\r') {\n      if (*current == '\\n')\n        ++current;\n      lastLineStart = current;\n      ++line;\n    } else if (c == '\\n') {\n      lastLineStart = current;\n      ++line;\n    }\n  }\n  // column & line start at 1\n  column = int(location - lastLineStart) + 1;\n  ++line;\n}\n\nJSONCPP_STRING OurReader::getLocationLineAndColumn(Location location) const {\n  int line, column;\n  getLocationLineAndColumn(location, line, column);\n  char buffer[18 + 16 + 16 + 1];\n  snprintf(buffer, sizeof(buffer), \"Line %d, Column %d\", line, column);\n  return buffer;\n}\n\nJSONCPP_STRING OurReader::getFormattedErrorMessages() const {\n  JSONCPP_STRING formattedMessage;\n  for (Errors::const_iterator itError = errors_.begin();\n       itError != errors_.end();\n       ++itError) {\n    const ErrorInfo& error = *itError;\n    formattedMessage +=\n        \"* \" + getLocationLineAndColumn(error.token_.start_) + \"\\n\";\n    formattedMessage += \"  \" + error.message_ + \"\\n\";\n    if (error.extra_)\n      formattedMessage +=\n          \"See \" + getLocationLineAndColumn(error.extra_) + \" for detail.\\n\";\n  }\n  return formattedMessage;\n}\n\nstd::vector<OurReader::StructuredError> OurReader::getStructuredErrors() const {\n  std::vector<OurReader::StructuredError> allErrors;\n  for (Errors::const_iterator itError = errors_.begin();\n       itError != errors_.end();\n       ++itError) {\n    const ErrorInfo& error = *itError;\n    OurReader::StructuredError structured;\n    structured.offset_start = error.token_.start_ - begin_;\n    structured.offset_limit = error.token_.end_ - begin_;\n    structured.message = error.message_;\n    allErrors.push_back(structured);\n  }\n  return allErrors;\n}\n\nbool OurReader::pushError(const Value& value, const JSONCPP_STRING& message) {\n  ptrdiff_t length = end_ - begin_;\n  if(value.getOffsetStart() > length\n    || value.getOffsetLimit() > length)\n    return false;\n  Token token;\n  token.type_ = tokenError;\n  token.start_ = begin_ + value.getOffsetStart();\n  token.end_ = end_ + value.getOffsetLimit();\n  ErrorInfo info;\n  info.token_ = token;\n  info.message_ = message;\n  info.extra_ = 0;\n  errors_.push_back(info);\n  return true;\n}\n\nbool OurReader::pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra) {\n  ptrdiff_t length = end_ - begin_;\n  if(value.getOffsetStart() > length\n    || value.getOffsetLimit() > length\n    || extra.getOffsetLimit() > length)\n    return false;\n  Token token;\n  token.type_ = tokenError;\n  token.start_ = begin_ + value.getOffsetStart();\n  token.end_ = begin_ + value.getOffsetLimit();\n  ErrorInfo info;\n  info.token_ = token;\n  info.message_ = message;\n  info.extra_ = begin_ + extra.getOffsetStart();\n  errors_.push_back(info);\n  return true;\n}\n\nbool OurReader::good() const {\n  return !errors_.size();\n}\n\n\nclass OurCharReader : public CharReader {\n  bool const collectComments_;\n  OurReader reader_;\npublic:\n  OurCharReader(\n    bool collectComments,\n    OurFeatures const& features)\n  : collectComments_(collectComments)\n  , reader_(features)\n  {}\n  bool parse(\n      char const* beginDoc, char const* endDoc,\n      Value* root, JSONCPP_STRING* errs) JSONCPP_OVERRIDE {\n    bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_);\n    if (errs) {\n      *errs = reader_.getFormattedErrorMessages();\n    }\n    return ok;\n  }\n};\n\nCharReaderBuilder::CharReaderBuilder()\n{\n  setDefaults(&settings_);\n}\nCharReaderBuilder::~CharReaderBuilder()\n{}\nCharReader* CharReaderBuilder::newCharReader() const\n{\n  bool collectComments = settings_[\"collectComments\"].asBool();\n  OurFeatures features = OurFeatures::all();\n  features.allowComments_ = settings_[\"allowComments\"].asBool();\n  features.strictRoot_ = settings_[\"strictRoot\"].asBool();\n  features.allowDroppedNullPlaceholders_ = settings_[\"allowDroppedNullPlaceholders\"].asBool();\n  features.allowNumericKeys_ = settings_[\"allowNumericKeys\"].asBool();\n  features.allowSingleQuotes_ = settings_[\"allowSingleQuotes\"].asBool();\n  features.stackLimit_ = settings_[\"stackLimit\"].asInt();\n  features.failIfExtra_ = settings_[\"failIfExtra\"].asBool();\n  features.rejectDupKeys_ = settings_[\"rejectDupKeys\"].asBool();\n  features.allowSpecialFloats_ = settings_[\"allowSpecialFloats\"].asBool();\n  return new OurCharReader(collectComments, features);\n}\nstatic void getValidReaderKeys(std::set<JSONCPP_STRING>* valid_keys)\n{\n  valid_keys->clear();\n  valid_keys->insert(\"collectComments\");\n  valid_keys->insert(\"allowComments\");\n  valid_keys->insert(\"strictRoot\");\n  valid_keys->insert(\"allowDroppedNullPlaceholders\");\n  valid_keys->insert(\"allowNumericKeys\");\n  valid_keys->insert(\"allowSingleQuotes\");\n  valid_keys->insert(\"stackLimit\");\n  valid_keys->insert(\"failIfExtra\");\n  valid_keys->insert(\"rejectDupKeys\");\n  valid_keys->insert(\"allowSpecialFloats\");\n}\nbool CharReaderBuilder::validate(Json::Value* invalid) const\n{\n  Json::Value my_invalid;\n  if (!invalid) invalid = &my_invalid;  // so we do not need to test for NULL\n  Json::Value& inv = *invalid;\n  std::set<JSONCPP_STRING> valid_keys;\n  getValidReaderKeys(&valid_keys);\n  Value::Members keys = settings_.getMemberNames();\n  size_t n = keys.size();\n  for (size_t i = 0; i < n; ++i) {\n    JSONCPP_STRING const& key = keys[i];\n    if (valid_keys.find(key) == valid_keys.end()) {\n      inv[key] = settings_[key];\n    }\n  }\n  return 0u == inv.size();\n}\nValue& CharReaderBuilder::operator[](JSONCPP_STRING key)\n{\n  return settings_[key];\n}\n// static\nvoid CharReaderBuilder::strictMode(Json::Value* settings)\n{\n//! [CharReaderBuilderStrictMode]\n  (*settings)[\"allowComments\"] = false;\n  (*settings)[\"strictRoot\"] = true;\n  (*settings)[\"allowDroppedNullPlaceholders\"] = false;\n  (*settings)[\"allowNumericKeys\"] = false;\n  (*settings)[\"allowSingleQuotes\"] = false;\n  (*settings)[\"stackLimit\"] = 1000;\n  (*settings)[\"failIfExtra\"] = true;\n  (*settings)[\"rejectDupKeys\"] = true;\n  (*settings)[\"allowSpecialFloats\"] = false;\n//! [CharReaderBuilderStrictMode]\n}\n// static\nvoid CharReaderBuilder::setDefaults(Json::Value* settings)\n{\n//! [CharReaderBuilderDefaults]\n  (*settings)[\"collectComments\"] = true;\n  (*settings)[\"allowComments\"] = true;\n  (*settings)[\"strictRoot\"] = false;\n  (*settings)[\"allowDroppedNullPlaceholders\"] = false;\n  (*settings)[\"allowNumericKeys\"] = false;\n  (*settings)[\"allowSingleQuotes\"] = false;\n  (*settings)[\"stackLimit\"] = 1000;\n  (*settings)[\"failIfExtra\"] = false;\n  (*settings)[\"rejectDupKeys\"] = false;\n  (*settings)[\"allowSpecialFloats\"] = false;\n//! [CharReaderBuilderDefaults]\n}\n\n//////////////////////////////////\n// global functions\n\nbool parseFromStream(\n    CharReader::Factory const& fact, JSONCPP_ISTREAM& sin,\n    Value* root, JSONCPP_STRING* errs)\n{\n  JSONCPP_OSTRINGSTREAM ssin;\n  ssin << sin.rdbuf();\n  JSONCPP_STRING doc = ssin.str();\n  char const* begin = doc.data();\n  char const* end = begin + doc.size();\n  // Note that we do not actually need a null-terminator.\n  CharReaderPtr const reader(fact.newCharReader());\n  return reader->parse(begin, end, root, errs);\n}\n\nJSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) {\n  CharReaderBuilder b;\n  JSONCPP_STRING errs;\n  bool ok = parseFromStream(b, sin, &root, &errs);\n  if (!ok) {\n    throwRuntimeError(errs);\n  }\n  return sin;\n}\n\n} // namespace Json\n}\n}\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: src/lib_json/json_reader.cpp\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: src/lib_json/json_valueiterator.inl\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n// included by json_value.cpp\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\nnamespace Json {\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class ValueIteratorBase\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\nValueIteratorBase::ValueIteratorBase()\n    : current_(), isNull_(true) {\n}\n\nValueIteratorBase::ValueIteratorBase(\n    const Value::ObjectValues::iterator& current)\n    : current_(current), isNull_(false) {}\n\nValue& ValueIteratorBase::deref() const {\n  return current_->second;\n}\n\nvoid ValueIteratorBase::increment() {\n  ++current_;\n}\n\nvoid ValueIteratorBase::decrement() {\n  --current_;\n}\n\nValueIteratorBase::difference_type\nValueIteratorBase::computeDistance(const SelfType& other) const {\n#ifdef JSON_USE_CPPTL_SMALLMAP\n  return other.current_ - current_;\n#else\n  // Iterator for null value are initialized using the default\n  // constructor, which initialize current_ to the default\n  // std::map::iterator. As begin() and end() are two instance\n  // of the default std::map::iterator, they can not be compared.\n  // To allow this, we handle this comparison specifically.\n  if (isNull_ && other.isNull_) {\n    return 0;\n  }\n\n  // Usage of std::distance is not portable (does not compile with Sun Studio 12\n  // RogueWave STL,\n  // which is the one used by default).\n  // Using a portable hand-made version for non random iterator instead:\n  //   return difference_type( std::distance( current_, other.current_ ) );\n  difference_type myDistance = 0;\n  for (Value::ObjectValues::iterator it = current_; it != other.current_;\n       ++it) {\n    ++myDistance;\n  }\n  return myDistance;\n#endif\n}\n\nbool ValueIteratorBase::isEqual(const SelfType& other) const {\n  if (isNull_) {\n    return other.isNull_;\n  }\n  return current_ == other.current_;\n}\n\nvoid ValueIteratorBase::copy(const SelfType& other) {\n  current_ = other.current_;\n  isNull_ = other.isNull_;\n}\n\nValue ValueIteratorBase::key() const {\n  const Value::CZString czstring = (*current_).first;\n  if (czstring.data()) {\n    if (czstring.isStaticString())\n      return Value(StaticString(czstring.data()));\n    return Value(czstring.data(), czstring.data() + czstring.length());\n  }\n  return Value(czstring.index());\n}\n\nUInt ValueIteratorBase::index() const {\n  const Value::CZString czstring = (*current_).first;\n  if (!czstring.data())\n    return czstring.index();\n  return Value::UInt(-1);\n}\n\nJSONCPP_STRING ValueIteratorBase::name() const {\n  char const* keey;\n  char const* end;\n  keey = memberName(&end);\n  if (!keey) return JSONCPP_STRING();\n  return JSONCPP_STRING(keey, end);\n}\n\nchar const* ValueIteratorBase::memberName() const {\n  const char* cname = (*current_).first.data();\n  return cname ? cname : \"\";\n}\n\nchar const* ValueIteratorBase::memberName(char const** end) const {\n  const char* cname = (*current_).first.data();\n  if (!cname) {\n    *end = NULL;\n    return NULL;\n  }\n  *end = cname + (*current_).first.length();\n  return cname;\n}\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class ValueConstIterator\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\nValueConstIterator::ValueConstIterator() {}\n\nValueConstIterator::ValueConstIterator(\n    const Value::ObjectValues::iterator& current)\n    : ValueIteratorBase(current) {}\n\nValueConstIterator::ValueConstIterator(ValueIterator const& other)\n    : ValueIteratorBase(other) {}\n\nValueConstIterator& ValueConstIterator::\noperator=(const ValueIteratorBase& other) {\n  copy(other);\n  return *this;\n}\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class ValueIterator\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\nValueIterator::ValueIterator() {}\n\nValueIterator::ValueIterator(const Value::ObjectValues::iterator& current)\n    : ValueIteratorBase(current) {}\n\nValueIterator::ValueIterator(const ValueConstIterator& other)\n    : ValueIteratorBase(other) {\n  throwRuntimeError(\"ConstIterator to Iterator should never be allowed.\");\n}\n\nValueIterator::ValueIterator(const ValueIterator& other)\n    : ValueIteratorBase(other) {}\n\nValueIterator& ValueIterator::operator=(const SelfType& other) {\n  copy(other);\n  return *this;\n}\n\n} // namespace Json\n}\n}\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: src/lib_json/json_valueiterator.inl\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: src/lib_json/json_value.cpp\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2011 Baptiste Lepilleur and The JsonCpp Authors\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#if !defined(JSON_IS_AMALGAMATION)\n#include <json/assertions.h>\n#include <json/value.h>\n#include <json/writer.h>\n#endif // if !defined(JSON_IS_AMALGAMATION)\n#include <math.h>\n#include <sstream>\n#include <utility>\n#include <cstring>\n#include <cassert>\n#ifdef JSON_USE_CPPTL\n#include <cpptl/conststring.h>\n#endif\n#include <cstddef> // size_t\n#include <algorithm> // min()\n\n#define JSON_ASSERT_UNREACHABLE assert(false)\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\nnamespace Json {\n\n// This is a walkaround to avoid the static initialization of Value::null.\n// kNull must be word-aligned to avoid crashing on ARM.  We use an alignment of\n// 8 (instead of 4) as a bit of future-proofing.\n#if defined(__ARMEL__)\n#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))\n#else\n#define ALIGNAS(byte_alignment)\n#endif\n//static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = { 0 };\n//const unsigned char& kNullRef = kNull[0];\n//const Value& Value::null = reinterpret_cast<const Value&>(kNullRef);\n//const Value& Value::nullRef = null;\n\n// static\nValue const& Value::nullSingleton()\n{\n static Value const nullStatic;\n return nullStatic;\n}\n\n// for backwards compatibility, we'll leave these global references around, but DO NOT\n// use them in JSONCPP library code any more!\nValue const& Value::null = Value::nullSingleton();\nValue const& Value::nullRef = Value::nullSingleton();\n\nconst Int Value::minInt = Int(~(UInt(-1) / 2));\nconst Int Value::maxInt = Int(UInt(-1) / 2);\nconst UInt Value::maxUInt = UInt(-1);\n#if defined(JSON_HAS_INT64)\nconst Int64 Value::minInt64 = Int64(~(UInt64(-1) / 2));\nconst Int64 Value::maxInt64 = Int64(UInt64(-1) / 2);\nconst UInt64 Value::maxUInt64 = UInt64(-1);\n// The constant is hard-coded because some compiler have trouble\n// converting Value::maxUInt64 to a double correctly (AIX/xlC).\n// Assumes that UInt64 is a 64 bits integer.\nstatic const double maxUInt64AsDouble = 18446744073709551615.0;\n#endif // defined(JSON_HAS_INT64)\nconst LargestInt Value::minLargestInt = LargestInt(~(LargestUInt(-1) / 2));\nconst LargestInt Value::maxLargestInt = LargestInt(LargestUInt(-1) / 2);\nconst LargestUInt Value::maxLargestUInt = LargestUInt(-1);\n\n#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)\ntemplate <typename T, typename U>\nstatic inline bool InRange(double d, T min, U max) {\n  // The casts can lose precision, but we are looking only for\n  // an approximate range. Might fail on edge cases though. ~cdunn\n  //return d >= static_cast<double>(min) && d <= static_cast<double>(max);\n  return d >= min && d <= max;\n}\n#else  // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)\nstatic inline double integerToDouble(Json::UInt64 value) {\n  return static_cast<double>(Int64(value / 2)) * 2.0 + static_cast<double>(Int64(value & 1));\n}\n\ntemplate <typename T> static inline double integerToDouble(T value) {\n  return static_cast<double>(value);\n}\n\ntemplate <typename T, typename U>\nstatic inline bool InRange(double d, T min, U max) {\n  return d >= integerToDouble(min) && d <= integerToDouble(max);\n}\n#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)\n\n/** Duplicates the specified string value.\n * @param value Pointer to the string to duplicate. Must be zero-terminated if\n *              length is \"unknown\".\n * @param length Length of the value. if equals to unknown, then it will be\n *               computed using strlen(value).\n * @return Pointer on the duplicate instance of string.\n */\nstatic inline char* duplicateStringValue(const char* value,\n                                         size_t length)\n{\n  // Avoid an integer overflow in the call to malloc below by limiting length\n  // to a sane value.\n  if (length >= static_cast<size_t>(Value::maxInt))\n    length = Value::maxInt - 1;\n\n  char* newString = static_cast<char*>(malloc(length + 1));\n  if (newString == NULL) {\n    throwRuntimeError(\n        \"in Json::Value::duplicateStringValue(): \"\n        \"Failed to allocate string value buffer\");\n  }\n  memcpy(newString, value, length);\n  newString[length] = 0;\n  return newString;\n}\n\n/* Record the length as a prefix.\n */\nstatic inline char* duplicateAndPrefixStringValue(\n    const char* value,\n    unsigned int length)\n{\n  // Avoid an integer overflow in the call to malloc below by limiting length\n  // to a sane value.\n  JSON_ASSERT_MESSAGE(length <= static_cast<unsigned>(Value::maxInt) - sizeof(unsigned) - 1U,\n                      \"in Json::Value::duplicateAndPrefixStringValue(): \"\n                      \"length too big for prefixing\");\n  unsigned actualLength = length + static_cast<unsigned>(sizeof(unsigned)) + 1U;\n  char* newString = static_cast<char*>(malloc(actualLength));\n  if (newString == 0) {\n    throwRuntimeError(\n        \"in Json::Value::duplicateAndPrefixStringValue(): \"\n        \"Failed to allocate string value buffer\");\n  }\n  *reinterpret_cast<unsigned*>(newString) = length;\n  memcpy(newString + sizeof(unsigned), value, length);\n  newString[actualLength - 1U] = 0; // to avoid buffer over-run accidents by users later\n  return newString;\n}\ninline static void decodePrefixedString(\n    bool isPrefixed, char const* prefixed,\n    unsigned* length, char const** value)\n{\n  if (!isPrefixed) {\n    *length = static_cast<unsigned>(strlen(prefixed));\n    *value = prefixed;\n  } else {\n    *length = *reinterpret_cast<unsigned const*>(prefixed);\n    *value = prefixed + sizeof(unsigned);\n  }\n}\n/** Free the string duplicated by duplicateStringValue()/duplicateAndPrefixStringValue().\n */\n#if JSONCPP_USING_SECURE_MEMORY\nstatic inline void releasePrefixedStringValue(char* value) {\n  unsigned length = 0;\n  char const* valueDecoded;\n  decodePrefixedString(true, value, &length, &valueDecoded);\n  size_t const size = sizeof(unsigned) + length + 1U;\n  memset(value, 0, size);\n  free(value);\n}\nstatic inline void releaseStringValue(char* value, unsigned length) {\n  // length==0 => we allocated the strings memory\n  size_t size = (length==0) ? strlen(value) : length;\n  memset(value, 0, size);\n  free(value);\n}\n#else // !JSONCPP_USING_SECURE_MEMORY\nstatic inline void releasePrefixedStringValue(char* value) {\n  free(value);\n}\nstatic inline void releaseStringValue(char* value, unsigned) {\n  free(value);\n}\n#endif // JSONCPP_USING_SECURE_MEMORY\n\n} // namespace Json\n}\n}\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// ValueInternals...\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n#if !defined(JSON_IS_AMALGAMATION)\n\n#include \"json_valueiterator.inl\"\n#endif // if !defined(JSON_IS_AMALGAMATION)\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\nnamespace Json {\n#if JSON_USE_EXCEPTION\nException::Exception(JSONCPP_STRING const& msg)\n  : msg_(msg)\n{}\nException::~Exception() JSONCPP_NOEXCEPT\n{}\nchar const* Exception::what() const JSONCPP_NOEXCEPT\n{\n  return msg_.c_str();\n}\nRuntimeError::RuntimeError(JSONCPP_STRING const& msg)\n  : Exception(msg)\n{}\nLogicError::LogicError(JSONCPP_STRING const& msg)\n  : Exception(msg)\n{}\nJSONCPP_NORETURN void throwRuntimeError(JSONCPP_STRING const& msg)\n{\n  throw RuntimeError(msg);\n}\nJSONCPP_NORETURN void throwLogicError(JSONCPP_STRING const& msg)\n{\n  throw LogicError(msg);\n}\n#else\n\nJSONCPP_NORETURN void throwRuntimeError(JSONCPP_STRING const& msg)\n{\n    JSON_FAIL_MESSAGE(msg);\n}\nJSONCPP_NORETURN void throwLogicError(JSONCPP_STRING const& msg)\n{\n    JSON_FAIL_MESSAGE(msg);\n}\t\n\n#endif\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class Value::CommentInfo\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\nValue::CommentInfo::CommentInfo() : comment_(0)\n{}\n\nValue::CommentInfo::~CommentInfo() {\n  if (comment_)\n    releaseStringValue(comment_, 0u);\n}\n\nvoid Value::CommentInfo::setComment(const char* text, size_t len) {\n  if (comment_) {\n    releaseStringValue(comment_, 0u);\n    comment_ = 0;\n  }\n  JSON_ASSERT(text != 0);\n  JSON_ASSERT_MESSAGE(\n      text[0] == '\\0' || text[0] == '/',\n      \"in Json::Value::setComment(): Comments must start with /\");\n  // It seems that /**/ style comments are acceptable as well.\n  comment_ = duplicateStringValue(text, len);\n}\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class Value::CZString\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\n// Notes: policy_ indicates if the string was allocated when\n// a string is stored.\n\nValue::CZString::CZString(ArrayIndex aindex) : cstr_(0), index_(aindex) {}\n\nValue::CZString::CZString(char const* str, unsigned ulength, DuplicationPolicy allocate)\n    : cstr_(str) {\n  // allocate != duplicate\n  storage_.policy_ = allocate & 0x3;\n  storage_.length_ = ulength & 0x3FFFFFFF;\n}\n\nValue::CZString::CZString(const CZString& other) {\n  cstr_ = (other.storage_.policy_ != noDuplication && other.cstr_ != 0\n\t\t\t\t ? duplicateStringValue(other.cstr_, other.storage_.length_)\n\t\t\t\t : other.cstr_);\n  storage_.policy_ = static_cast<unsigned>(other.cstr_\n                 ? (static_cast<DuplicationPolicy>(other.storage_.policy_) == noDuplication\n                     ? noDuplication : duplicate)\n                 : static_cast<DuplicationPolicy>(other.storage_.policy_)) & 3U;\n  storage_.length_ = other.storage_.length_;\n}\n\n#if JSON_HAS_RVALUE_REFERENCES\nValue::CZString::CZString(CZString&& other)\n  : cstr_(other.cstr_), index_(other.index_) {\n  other.cstr_ = nullptr;\n}\n#endif\n\nValue::CZString::~CZString() {\n  if (cstr_ && storage_.policy_ == duplicate) {\n\t  releaseStringValue(const_cast<char*>(cstr_), storage_.length_ + 1u); //+1 for null terminating character for sake of completeness but not actually necessary\n  }\n}\n\nvoid Value::CZString::swap(CZString& other) {\n  std::swap(cstr_, other.cstr_);\n  std::swap(index_, other.index_);\n}\n\nValue::CZString& Value::CZString::operator=(const CZString& other) {\n  cstr_ = other.cstr_;\n  index_ = other.index_;\n  return *this;\n}\n\n#if JSON_HAS_RVALUE_REFERENCES\nValue::CZString& Value::CZString::operator=(CZString&& other) {\n  cstr_ = other.cstr_;\n  index_ = other.index_;\n  other.cstr_ = nullptr;\n  return *this;\n}\n#endif\n\nbool Value::CZString::operator<(const CZString& other) const {\n  if (!cstr_) return index_ < other.index_;\n  //return strcmp(cstr_, other.cstr_) < 0;\n  // Assume both are strings.\n  unsigned this_len = this->storage_.length_;\n  unsigned other_len = other.storage_.length_;\n  unsigned min_len = std::min<unsigned>(this_len, other_len);\n  JSON_ASSERT(this->cstr_ && other.cstr_);\n  int comp = memcmp(this->cstr_, other.cstr_, min_len);\n  if (comp < 0) return true;\n  if (comp > 0) return false;\n  return (this_len < other_len);\n}\n\nbool Value::CZString::operator==(const CZString& other) const {\n  if (!cstr_) return index_ == other.index_;\n  //return strcmp(cstr_, other.cstr_) == 0;\n  // Assume both are strings.\n  unsigned this_len = this->storage_.length_;\n  unsigned other_len = other.storage_.length_;\n  if (this_len != other_len) return false;\n  JSON_ASSERT(this->cstr_ && other.cstr_);\n  int comp = memcmp(this->cstr_, other.cstr_, this_len);\n  return comp == 0;\n}\n\nArrayIndex Value::CZString::index() const { return index_; }\n\n//const char* Value::CZString::c_str() const { return cstr_; }\nconst char* Value::CZString::data() const { return cstr_; }\nunsigned Value::CZString::length() const { return storage_.length_; }\nbool Value::CZString::isStaticString() const { return storage_.policy_ == noDuplication; }\n\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// class Value::Value\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n// //////////////////////////////////////////////////////////////////\n\n/*! \\internal Default constructor initialization must be equivalent to:\n * memset( this, 0, sizeof(Value) )\n * This optimization is used in ValueInternalMap fast allocator.\n */\nValue::Value(ValueType vtype) {\n  static char const emptyString[] = \"\";\n  initBasic(vtype);\n  switch (vtype) {\n  case nullValue:\n    break;\n  case intValue:\n  case uintValue:\n    value_.int_ = 0;\n    break;\n  case realValue:\n    value_.real_ = 0.0;\n    break;\n  case stringValue:\n    // allocated_ == false, so this is safe.\n    value_.string_ = const_cast<char*>(static_cast<char const*>(emptyString));\n    break;\n  case arrayValue:\n  case objectValue:\n    value_.map_ = new ObjectValues();\n    break;\n  case booleanValue:\n    value_.bool_ = false;\n    break;\n  default:\n    JSON_ASSERT_UNREACHABLE;\n  }\n}\n\nValue::Value(Int value) {\n  initBasic(intValue);\n  value_.int_ = value;\n}\n\nValue::Value(UInt value) {\n  initBasic(uintValue);\n  value_.uint_ = value;\n}\n#if defined(JSON_HAS_INT64)\nValue::Value(Int64 value) {\n  initBasic(intValue);\n  value_.int_ = value;\n}\nValue::Value(UInt64 value) {\n  initBasic(uintValue);\n  value_.uint_ = value;\n}\n#endif // defined(JSON_HAS_INT64)\n\nValue::Value(double value) {\n  initBasic(realValue);\n  value_.real_ = value;\n}\n\nValue::Value(const char* value) {\n  initBasic(stringValue, true);\n  JSON_ASSERT_MESSAGE(value != NULL, \"Null Value Passed to Value Constructor\");\n  value_.string_ = duplicateAndPrefixStringValue(value, static_cast<unsigned>(strlen(value)));\n}\n\nValue::Value(const char* beginValue, const char* endValue) {\n  initBasic(stringValue, true);\n  value_.string_ =\n      duplicateAndPrefixStringValue(beginValue, static_cast<unsigned>(endValue - beginValue));\n}\n\nValue::Value(const JSONCPP_STRING& value) {\n  initBasic(stringValue, true);\n  value_.string_ =\n      duplicateAndPrefixStringValue(value.data(), static_cast<unsigned>(value.length()));\n}\n\nValue::Value(const StaticString& value) {\n  initBasic(stringValue);\n  value_.string_ = const_cast<char*>(value.c_str());\n}\n\n#ifdef JSON_USE_CPPTL\nValue::Value(const CppTL::ConstString& value) {\n  initBasic(stringValue, true);\n  value_.string_ = duplicateAndPrefixStringValue(value, static_cast<unsigned>(value.length()));\n}\n#endif\n\nValue::Value(bool value) {\n  initBasic(booleanValue);\n  value_.bool_ = value;\n}\n\nValue::Value(Value const& other)\n    : type_(other.type_), allocated_(false)\n      ,\n      comments_(0), start_(other.start_), limit_(other.limit_)\n{\n  switch (type_) {\n  case nullValue:\n  case intValue:\n  case uintValue:\n  case realValue:\n  case booleanValue:\n    value_ = other.value_;\n    break;\n  case stringValue:\n    if (other.value_.string_ && other.allocated_) {\n      unsigned len;\n      char const* str;\n      decodePrefixedString(other.allocated_, other.value_.string_,\n          &len, &str);\n      value_.string_ = duplicateAndPrefixStringValue(str, len);\n      allocated_ = true;\n    } else {\n      value_.string_ = other.value_.string_;\n      allocated_ = false;\n    }\n    break;\n  case arrayValue:\n  case objectValue:\n    value_.map_ = new ObjectValues(*other.value_.map_);\n    break;\n  default:\n    JSON_ASSERT_UNREACHABLE;\n  }\n  if (other.comments_) {\n    comments_ = new CommentInfo[numberOfCommentPlacement];\n    for (int comment = 0; comment < numberOfCommentPlacement; ++comment) {\n      const CommentInfo& otherComment = other.comments_[comment];\n      if (otherComment.comment_)\n        comments_[comment].setComment(\n            otherComment.comment_, strlen(otherComment.comment_));\n    }\n  }\n}\n\n#if JSON_HAS_RVALUE_REFERENCES\n// Move constructor\nValue::Value(Value&& other) {\n  initBasic(nullValue);\n  swap(other);\n}\n#endif\n\nValue::~Value() {\n  switch (type_) {\n  case nullValue:\n  case intValue:\n  case uintValue:\n  case realValue:\n  case booleanValue:\n    break;\n  case stringValue:\n    if (allocated_)\n      releasePrefixedStringValue(value_.string_);\n    break;\n  case arrayValue:\n  case objectValue:\n    delete value_.map_;\n    break;\n  default:\n    JSON_ASSERT_UNREACHABLE;\n  }\n\n  delete[] comments_;\n\n  value_.uint_ = 0;\n}\n\nValue& Value::operator=(Value other) {\n  swap(other);\n  return *this;\n}\n\nvoid Value::swapPayload(Value& other) {\n  ValueType temp = type_;\n  type_ = other.type_;\n  other.type_ = temp;\n  std::swap(value_, other.value_);\n  int temp2 = allocated_;\n  allocated_ = other.allocated_;\n  other.allocated_ = temp2 & 0x1;\n}\n\nvoid Value::copyPayload(const Value& other) {\n  type_ = other.type_;\n  value_ = other.value_;\n  allocated_ = other.allocated_;\n}\n\nvoid Value::swap(Value& other) {\n  swapPayload(other);\n  std::swap(comments_, other.comments_);\n  std::swap(start_, other.start_);\n  std::swap(limit_, other.limit_);\n}\n\nvoid Value::copy(const Value& other) {\n  copyPayload(other);\n  comments_ = other.comments_;\n  start_ = other.start_;\n  limit_ = other.limit_;\n}\n\nValueType Value::type() const { return type_; }\n\nint Value::compare(const Value& other) const {\n  if (*this < other)\n    return -1;\n  if (*this > other)\n    return 1;\n  return 0;\n}\n\nbool Value::operator<(const Value& other) const {\n  int typeDelta = type_ - other.type_;\n  if (typeDelta)\n    return typeDelta < 0 ? true : false;\n  switch (type_) {\n  case nullValue:\n    return false;\n  case intValue:\n    return value_.int_ < other.value_.int_;\n  case uintValue:\n    return value_.uint_ < other.value_.uint_;\n  case realValue:\n    return value_.real_ < other.value_.real_;\n  case booleanValue:\n    return value_.bool_ < other.value_.bool_;\n  case stringValue:\n  {\n    if ((value_.string_ == 0) || (other.value_.string_ == 0)) {\n      if (other.value_.string_) return true;\n      else return false;\n    }\n    unsigned this_len;\n    unsigned other_len;\n    char const* this_str;\n    char const* other_str;\n    decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);\n    decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str);\n    unsigned min_len = std::min<unsigned>(this_len, other_len);\n    JSON_ASSERT(this_str && other_str);\n    int comp = memcmp(this_str, other_str, min_len);\n    if (comp < 0) return true;\n    if (comp > 0) return false;\n    return (this_len < other_len);\n  }\n  case arrayValue:\n  case objectValue: {\n    int delta = int(value_.map_->size() - other.value_.map_->size());\n    if (delta)\n      return delta < 0;\n    return (*value_.map_) < (*other.value_.map_);\n  }\n  default:\n    JSON_ASSERT_UNREACHABLE;\n  }\n  return false; // unreachable\n}\n\nbool Value::operator<=(const Value& other) const { return !(other < *this); }\n\nbool Value::operator>=(const Value& other) const { return !(*this < other); }\n\nbool Value::operator>(const Value& other) const { return other < *this; }\n\nbool Value::operator==(const Value& other) const {\n  // if ( type_ != other.type_ )\n  // GCC 2.95.3 says:\n  // attempt to take address of bit-field structure member `Json::Value::type_'\n  // Beats me, but a temp solves the problem.\n  int temp = other.type_;\n  if (type_ != temp)\n    return false;\n  switch (type_) {\n  case nullValue:\n    return true;\n  case intValue:\n    return value_.int_ == other.value_.int_;\n  case uintValue:\n    return value_.uint_ == other.value_.uint_;\n  case realValue:\n    return value_.real_ == other.value_.real_;\n  case booleanValue:\n    return value_.bool_ == other.value_.bool_;\n  case stringValue:\n  {\n    if ((value_.string_ == 0) || (other.value_.string_ == 0)) {\n      return (value_.string_ == other.value_.string_);\n    }\n    unsigned this_len;\n    unsigned other_len;\n    char const* this_str;\n    char const* other_str;\n    decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);\n    decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str);\n    if (this_len != other_len) return false;\n    JSON_ASSERT(this_str && other_str);\n    int comp = memcmp(this_str, other_str, this_len);\n    return comp == 0;\n  }\n  case arrayValue:\n  case objectValue:\n    return value_.map_->size() == other.value_.map_->size() &&\n           (*value_.map_) == (*other.value_.map_);\n  default:\n    JSON_ASSERT_UNREACHABLE;\n  }\n  return false; // unreachable\n}\n\nbool Value::operator!=(const Value& other) const { return !(*this == other); }\n\nconst char* Value::asCString() const {\n  JSON_ASSERT_MESSAGE(type_ == stringValue,\n                      \"in Json::Value::asCString(): requires stringValue\");\n  if (value_.string_ == 0) return 0;\n  unsigned this_len;\n  char const* this_str;\n  decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);\n  return this_str;\n}\n\n#if JSONCPP_USING_SECURE_MEMORY\nunsigned Value::getCStringLength() const {\n  JSON_ASSERT_MESSAGE(type_ == stringValue,\n\t                  \"in Json::Value::asCString(): requires stringValue\");\n  if (value_.string_ == 0) return 0;\n  unsigned this_len;\n  char const* this_str;\n  decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);\n  return this_len;\n}\n#endif\n\nbool Value::getString(char const** str, char const** cend) const {\n  if (type_ != stringValue) return false;\n  if (value_.string_ == 0) return false;\n  unsigned length;\n  decodePrefixedString(this->allocated_, this->value_.string_, &length, str);\n  *cend = *str + length;\n  return true;\n}\n\nJSONCPP_STRING Value::asString() const {\n  switch (type_) {\n  case nullValue:\n    return \"\";\n  case stringValue:\n  {\n    if (value_.string_ == 0) return \"\";\n    unsigned this_len;\n    char const* this_str;\n    decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);\n    return JSONCPP_STRING(this_str, this_len);\n  }\n  case booleanValue:\n    return value_.bool_ ? \"true\" : \"false\";\n  case intValue:\n    return valueToString(value_.int_);\n  case uintValue:\n    return valueToString(value_.uint_);\n  case realValue:\n    return valueToString(value_.real_);\n  default:\n    JSON_FAIL_MESSAGE(\"Type is not convertible to string\");\n  }\n}\n\n#ifdef JSON_USE_CPPTL\nCppTL::ConstString Value::asConstString() const {\n  unsigned len;\n  char const* str;\n  decodePrefixedString(allocated_, value_.string_,\n      &len, &str);\n  return CppTL::ConstString(str, len);\n}\n#endif\n\nValue::Int Value::asInt() const {\n  switch (type_) {\n  case intValue:\n    JSON_ASSERT_MESSAGE(isInt(), \"LargestInt out of Int range\");\n    return Int(value_.int_);\n  case uintValue:\n    JSON_ASSERT_MESSAGE(isInt(), \"LargestUInt out of Int range\");\n    return Int(value_.uint_);\n  case realValue:\n    JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt, maxInt),\n                        \"double out of Int range\");\n    return Int(value_.real_);\n  case nullValue:\n    return 0;\n  case booleanValue:\n    return value_.bool_ ? 1 : 0;\n  default:\n    break;\n  }\n  JSON_FAIL_MESSAGE(\"Value is not convertible to Int.\");\n}\n\nValue::UInt Value::asUInt() const {\n  switch (type_) {\n  case intValue:\n    JSON_ASSERT_MESSAGE(isUInt(), \"LargestInt out of UInt range\");\n    return UInt(value_.int_);\n  case uintValue:\n    JSON_ASSERT_MESSAGE(isUInt(), \"LargestUInt out of UInt range\");\n    return UInt(value_.uint_);\n  case realValue:\n    JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt),\n                        \"double out of UInt range\");\n    return UInt(value_.real_);\n  case nullValue:\n    return 0;\n  case booleanValue:\n    return value_.bool_ ? 1 : 0;\n  default:\n    break;\n  }\n  JSON_FAIL_MESSAGE(\"Value is not convertible to UInt.\");\n}\n\n#if defined(JSON_HAS_INT64)\n\nValue::Int64 Value::asInt64() const {\n  switch (type_) {\n  case intValue:\n    return Int64(value_.int_);\n  case uintValue:\n    JSON_ASSERT_MESSAGE(isInt64(), \"LargestUInt out of Int64 range\");\n    return Int64(value_.uint_);\n  case realValue:\n    JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64),\n                        \"double out of Int64 range\");\n    return Int64(value_.real_);\n  case nullValue:\n    return 0;\n  case booleanValue:\n    return value_.bool_ ? 1 : 0;\n  default:\n    break;\n  }\n  JSON_FAIL_MESSAGE(\"Value is not convertible to Int64.\");\n}\n\nValue::UInt64 Value::asUInt64() const {\n  switch (type_) {\n  case intValue:\n    JSON_ASSERT_MESSAGE(isUInt64(), \"LargestInt out of UInt64 range\");\n    return UInt64(value_.int_);\n  case uintValue:\n    return UInt64(value_.uint_);\n  case realValue:\n    JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64),\n                        \"double out of UInt64 range\");\n    return UInt64(value_.real_);\n  case nullValue:\n    return 0;\n  case booleanValue:\n    return value_.bool_ ? 1 : 0;\n  default:\n    break;\n  }\n  JSON_FAIL_MESSAGE(\"Value is not convertible to UInt64.\");\n}\n#endif // if defined(JSON_HAS_INT64)\n\nLargestInt Value::asLargestInt() const {\n#if defined(JSON_NO_INT64)\n  return asInt();\n#else\n  return asInt64();\n#endif\n}\n\nLargestUInt Value::asLargestUInt() const {\n#if defined(JSON_NO_INT64)\n  return asUInt();\n#else\n  return asUInt64();\n#endif\n}\n\ndouble Value::asDouble() const {\n  switch (type_) {\n  case intValue:\n    return static_cast<double>(value_.int_);\n  case uintValue:\n#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)\n    return static_cast<double>(value_.uint_);\n#else  // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)\n    return integerToDouble(value_.uint_);\n#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)\n  case realValue:\n    return value_.real_;\n  case nullValue:\n    return 0.0;\n  case booleanValue:\n    return value_.bool_ ? 1.0 : 0.0;\n  default:\n    break;\n  }\n  JSON_FAIL_MESSAGE(\"Value is not convertible to double.\");\n}\n\nfloat Value::asFloat() const {\n  switch (type_) {\n  case intValue:\n    return static_cast<float>(value_.int_);\n  case uintValue:\n#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)\n    return static_cast<float>(value_.uint_);\n#else  // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)\n    // This can fail (silently?) if the value is bigger than MAX_FLOAT.\n    return static_cast<float>(integerToDouble(value_.uint_));\n#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)\n  case realValue:\n    return static_cast<float>(value_.real_);\n  case nullValue:\n    return 0.0;\n  case booleanValue:\n    return value_.bool_ ? 1.0f : 0.0f;\n  default:\n    break;\n  }\n  JSON_FAIL_MESSAGE(\"Value is not convertible to float.\");\n}\n\nbool Value::asBool() const {\n  switch (type_) {\n  case booleanValue:\n    return value_.bool_;\n  case nullValue:\n    return false;\n  case intValue:\n    return value_.int_ ? true : false;\n  case uintValue:\n    return value_.uint_ ? true : false;\n  case realValue:\n    // This is kind of strange. Not recommended.\n    return (value_.real_ != 0.0) ? true : false;\n  default:\n    break;\n  }\n  JSON_FAIL_MESSAGE(\"Value is not convertible to bool.\");\n}\n\nbool Value::isConvertibleTo(ValueType other) const {\n  switch (other) {\n  case nullValue:\n    return (isNumeric() && asDouble() == 0.0) ||\n           (type_ == booleanValue && value_.bool_ == false) ||\n           (type_ == stringValue && asString().empty()) ||\n           (type_ == arrayValue && value_.map_->size() == 0) ||\n           (type_ == objectValue && value_.map_->size() == 0) ||\n           type_ == nullValue;\n  case intValue:\n    return isInt() ||\n           (type_ == realValue && InRange(value_.real_, minInt, maxInt)) ||\n           type_ == booleanValue || type_ == nullValue;\n  case uintValue:\n    return isUInt() ||\n           (type_ == realValue && InRange(value_.real_, 0, maxUInt)) ||\n           type_ == booleanValue || type_ == nullValue;\n  case realValue:\n    return isNumeric() || type_ == booleanValue || type_ == nullValue;\n  case booleanValue:\n    return isNumeric() || type_ == booleanValue || type_ == nullValue;\n  case stringValue:\n    return isNumeric() || type_ == booleanValue || type_ == stringValue ||\n           type_ == nullValue;\n  case arrayValue:\n    return type_ == arrayValue || type_ == nullValue;\n  case objectValue:\n    return type_ == objectValue || type_ == nullValue;\n  }\n  JSON_ASSERT_UNREACHABLE;\n  return false;\n}\n\n/// Number of values in array or object\nArrayIndex Value::size() const {\n  switch (type_) {\n  case nullValue:\n  case intValue:\n  case uintValue:\n  case realValue:\n  case booleanValue:\n  case stringValue:\n    return 0;\n  case arrayValue: // size of the array is highest index + 1\n    if (!value_.map_->empty()) {\n      ObjectValues::const_iterator itLast = value_.map_->end();\n      --itLast;\n      return (*itLast).first.index() + 1;\n    }\n    return 0;\n  case objectValue:\n    return ArrayIndex(value_.map_->size());\n  }\n  JSON_ASSERT_UNREACHABLE;\n  return 0; // unreachable;\n}\n\nbool Value::empty() const {\n  if (isNull() || isArray() || isObject())\n    return size() == 0u;\n  else\n    return false;\n}\n\nValue::operator bool() const { return ! isNull(); }\n\nvoid Value::clear() {\n  JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue ||\n                          type_ == objectValue,\n                      \"in Json::Value::clear(): requires complex value\");\n  start_ = 0;\n  limit_ = 0;\n  switch (type_) {\n  case arrayValue:\n  case objectValue:\n    value_.map_->clear();\n    break;\n  default:\n    break;\n  }\n}\n\nvoid Value::resize(ArrayIndex newSize) {\n  JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue,\n                      \"in Json::Value::resize(): requires arrayValue\");\n  if (type_ == nullValue)\n    *this = Value(arrayValue);\n  ArrayIndex oldSize = size();\n  if (newSize == 0)\n    clear();\n  else if (newSize > oldSize)\n    (*this)[newSize - 1];\n  else {\n    for (ArrayIndex index = newSize; index < oldSize; ++index) {\n      value_.map_->erase(index);\n    }\n    JSON_ASSERT(size() == newSize);\n  }\n}\n\nValue& Value::operator[](ArrayIndex index) {\n  JSON_ASSERT_MESSAGE(\n      type_ == nullValue || type_ == arrayValue,\n      \"in Json::Value::operator[](ArrayIndex): requires arrayValue\");\n  if (type_ == nullValue)\n    *this = Value(arrayValue);\n  CZString key(index);\n  ObjectValues::iterator it = value_.map_->lower_bound(key);\n  if (it != value_.map_->end() && (*it).first == key)\n    return (*it).second;\n\n  ObjectValues::value_type defaultValue(key, nullSingleton());\n  it = value_.map_->insert(it, defaultValue);\n  return (*it).second;\n}\n\nValue& Value::operator[](int index) {\n  JSON_ASSERT_MESSAGE(\n      index >= 0,\n      \"in Json::Value::operator[](int index): index cannot be negative\");\n  return (*this)[ArrayIndex(index)];\n}\n\nconst Value& Value::operator[](ArrayIndex index) const {\n  JSON_ASSERT_MESSAGE(\n      type_ == nullValue || type_ == arrayValue,\n      \"in Json::Value::operator[](ArrayIndex)const: requires arrayValue\");\n  if (type_ == nullValue)\n    return nullSingleton();\n  CZString key(index);\n  ObjectValues::const_iterator it = value_.map_->find(key);\n  if (it == value_.map_->end())\n    return nullSingleton();\n  return (*it).second;\n}\n\nconst Value& Value::operator[](int index) const {\n  JSON_ASSERT_MESSAGE(\n      index >= 0,\n      \"in Json::Value::operator[](int index) const: index cannot be negative\");\n  return (*this)[ArrayIndex(index)];\n}\n\nvoid Value::initBasic(ValueType vtype, bool allocated) {\n  type_ = vtype;\n  allocated_ = allocated;\n  comments_ = 0;\n  start_ = 0;\n  limit_ = 0;\n}\n\n// Access an object value by name, create a null member if it does not exist.\n// @pre Type of '*this' is object or null.\n// @param key is null-terminated.\nValue& Value::resolveReference(const char* key) {\n  JSON_ASSERT_MESSAGE(\n      type_ == nullValue || type_ == objectValue,\n      \"in Json::Value::resolveReference(): requires objectValue\");\n  if (type_ == nullValue)\n    *this = Value(objectValue);\n  CZString actualKey(\n      key, static_cast<unsigned>(strlen(key)), CZString::noDuplication); // NOTE!\n  ObjectValues::iterator it = value_.map_->lower_bound(actualKey);\n  if (it != value_.map_->end() && (*it).first == actualKey)\n    return (*it).second;\n\n  ObjectValues::value_type defaultValue(actualKey, nullSingleton());\n  it = value_.map_->insert(it, defaultValue);\n  Value& value = (*it).second;\n  return value;\n}\n\n// @param key is not null-terminated.\nValue& Value::resolveReference(char const* key, char const* cend)\n{\n  JSON_ASSERT_MESSAGE(\n      type_ == nullValue || type_ == objectValue,\n      \"in Json::Value::resolveReference(key, end): requires objectValue\");\n  if (type_ == nullValue)\n    *this = Value(objectValue);\n  CZString actualKey(\n      key, static_cast<unsigned>(cend-key), CZString::duplicateOnCopy);\n  ObjectValues::iterator it = value_.map_->lower_bound(actualKey);\n  if (it != value_.map_->end() && (*it).first == actualKey)\n    return (*it).second;\n\n  ObjectValues::value_type defaultValue(actualKey, nullSingleton());\n  it = value_.map_->insert(it, defaultValue);\n  Value& value = (*it).second;\n  return value;\n}\n\nValue Value::get(ArrayIndex index, const Value& defaultValue) const {\n  const Value* value = &((*this)[index]);\n  return value == &nullSingleton() ? defaultValue : *value;\n}\n\nbool Value::isValidIndex(ArrayIndex index) const { return index < size(); }\n\nValue const* Value::find(char const* key, char const* cend) const\n{\n  JSON_ASSERT_MESSAGE(\n      type_ == nullValue || type_ == objectValue,\n      \"in Json::Value::find(key, end, found): requires objectValue or nullValue\");\n  if (type_ == nullValue) return NULL;\n  CZString actualKey(key, static_cast<unsigned>(cend-key), CZString::noDuplication);\n  ObjectValues::const_iterator it = value_.map_->find(actualKey);\n  if (it == value_.map_->end()) return NULL;\n  return &(*it).second;\n}\nconst Value& Value::operator[](const char* key) const\n{\n  Value const* found = find(key, key + strlen(key));\n  if (!found) return nullSingleton();\n  return *found;\n}\nValue const& Value::operator[](JSONCPP_STRING const& key) const\n{\n  Value const* found = find(key.data(), key.data() + key.length());\n  if (!found) return nullSingleton();\n  return *found;\n}\n\nValue& Value::operator[](const char* key) {\n  return resolveReference(key, key + strlen(key));\n}\n\nValue& Value::operator[](const JSONCPP_STRING& key) {\n  return resolveReference(key.data(), key.data() + key.length());\n}\n\nValue& Value::operator[](const StaticString& key) {\n  return resolveReference(key.c_str());\n}\n\n#ifdef JSON_USE_CPPTL\nValue& Value::operator[](const CppTL::ConstString& key) {\n  return resolveReference(key.c_str(), key.end_c_str());\n}\nValue const& Value::operator[](CppTL::ConstString const& key) const\n{\n  Value const* found = find(key.c_str(), key.end_c_str());\n  if (!found) return nullSingleton();\n  return *found;\n}\n#endif\n\nValue& Value::append(const Value& value) { return (*this)[size()] = value; }\n\n#if JSON_HAS_RVALUE_REFERENCES\n  Value& Value::append(Value&& value) { return (*this)[size()] = std::move(value); }\n#endif\n\nValue Value::get(char const* key, char const* cend, Value const& defaultValue) const\n{\n  Value const* found = find(key, cend);\n  return !found ? defaultValue : *found;\n}\nValue Value::get(char const* key, Value const& defaultValue) const\n{\n  return get(key, key + strlen(key), defaultValue);\n}\nValue Value::get(JSONCPP_STRING const& key, Value const& defaultValue) const\n{\n  return get(key.data(), key.data() + key.length(), defaultValue);\n}\n\n\nbool Value::removeMember(const char* key, const char* cend, Value* removed)\n{\n  if (type_ != objectValue) {\n    return false;\n  }\n  CZString actualKey(key, static_cast<unsigned>(cend-key), CZString::noDuplication);\n  ObjectValues::iterator it = value_.map_->find(actualKey);\n  if (it == value_.map_->end())\n    return false;\n  *removed = it->second;\n  value_.map_->erase(it);\n  return true;\n}\nbool Value::removeMember(const char* key, Value* removed)\n{\n  return removeMember(key, key + strlen(key), removed);\n}\nbool Value::removeMember(JSONCPP_STRING const& key, Value* removed)\n{\n  return removeMember(key.data(), key.data() + key.length(), removed);\n}\nvoid Value::removeMember(const char* key)\n{\n  JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue,\n                      \"in Json::Value::removeMember(): requires objectValue\");\n  if (type_ == nullValue)\n    return;\n\n  CZString actualKey(key, unsigned(strlen(key)), CZString::noDuplication);\n  value_.map_->erase(actualKey);\n}\nvoid Value::removeMember(const JSONCPP_STRING& key)\n{\n  removeMember(key.c_str());\n}\n\nbool Value::removeIndex(ArrayIndex index, Value* removed) {\n  if (type_ != arrayValue) {\n    return false;\n  }\n  CZString key(index);\n  ObjectValues::iterator it = value_.map_->find(key);\n  if (it == value_.map_->end()) {\n    return false;\n  }\n  *removed = it->second;\n  ArrayIndex oldSize = size();\n  // shift left all items left, into the place of the \"removed\"\n  for (ArrayIndex i = index; i < (oldSize - 1); ++i){\n    CZString keey(i);\n    (*value_.map_)[keey] = (*this)[i + 1];\n  }\n  // erase the last one (\"leftover\")\n  CZString keyLast(oldSize - 1);\n  ObjectValues::iterator itLast = value_.map_->find(keyLast);\n  value_.map_->erase(itLast);\n  return true;\n}\n\n#ifdef JSON_USE_CPPTL\nValue Value::get(const CppTL::ConstString& key,\n                 const Value& defaultValue) const {\n  return get(key.c_str(), key.end_c_str(), defaultValue);\n}\n#endif\n\nbool Value::isMember(char const* key, char const* cend) const\n{\n  Value const* value = find(key, cend);\n  return NULL != value;\n}\nbool Value::isMember(char const* key) const\n{\n  return isMember(key, key + strlen(key));\n}\nbool Value::isMember(JSONCPP_STRING const& key) const\n{\n  return isMember(key.data(), key.data() + key.length());\n}\n\n#ifdef JSON_USE_CPPTL\nbool Value::isMember(const CppTL::ConstString& key) const {\n  return isMember(key.c_str(), key.end_c_str());\n}\n#endif\n\nValue::Members Value::getMemberNames() const {\n  JSON_ASSERT_MESSAGE(\n      type_ == nullValue || type_ == objectValue,\n      \"in Json::Value::getMemberNames(), value must be objectValue\");\n  if (type_ == nullValue)\n    return Value::Members();\n  Members members;\n  members.reserve(value_.map_->size());\n  ObjectValues::const_iterator it = value_.map_->begin();\n  ObjectValues::const_iterator itEnd = value_.map_->end();\n  for (; it != itEnd; ++it) {\n    members.push_back(JSONCPP_STRING((*it).first.data(),\n                                  (*it).first.length()));\n  }\n  return members;\n}\n//\n//# ifdef JSON_USE_CPPTL\n// EnumMemberNames\n// Value::enumMemberNames() const\n//{\n//   if ( type_ == objectValue )\n//   {\n//      return CppTL::Enum::any(  CppTL::Enum::transform(\n//         CppTL::Enum::keys( *(value_.map_), CppTL::Type<const CZString &>() ),\n//         MemberNamesTransform() ) );\n//   }\n//   return EnumMemberNames();\n//}\n//\n//\n// EnumValues\n// Value::enumValues() const\n//{\n//   if ( type_ == objectValue  ||  type_ == arrayValue )\n//      return CppTL::Enum::anyValues( *(value_.map_),\n//                                     CppTL::Type<const Value &>() );\n//   return EnumValues();\n//}\n//\n//# endif\n\nstatic bool IsIntegral(double d) {\n  double integral_part;\n  return modf(d, &integral_part) == 0.0;\n}\n\nbool Value::isNull() const { return type_ == nullValue; }\n\nbool Value::isBool() const { return type_ == booleanValue; }\n\nbool Value::isInt() const {\n  switch (type_) {\n  case intValue:\n#if defined(JSON_HAS_INT64)\n    return value_.int_ >= minInt && value_.int_ <= maxInt;\n#else\n    return true;\n#endif\n  case uintValue:\n    return value_.uint_ <= UInt(maxInt);\n  case realValue:\n    return value_.real_ >= minInt && value_.real_ <= maxInt &&\n           IsIntegral(value_.real_);\n  default:\n    break;\n  }\n  return false;\n}\n\nbool Value::isUInt() const {\n  switch (type_) {\n  case intValue:\n#if defined(JSON_HAS_INT64)\n    return value_.int_ >= 0 && LargestUInt(value_.int_) <= LargestUInt(maxUInt);\n#else\n    return value_.int_ >= 0;\n#endif\n  case uintValue:\n#if defined(JSON_HAS_INT64)\n    return value_.uint_ <= maxUInt;\n#else\n    return true;\n#endif\n  case realValue:\n    return value_.real_ >= 0 && value_.real_ <= maxUInt &&\n           IsIntegral(value_.real_);\n  default:\n    break;\n  }\n  return false;\n}\n\nbool Value::isInt64() const {\n#if defined(JSON_HAS_INT64)\n  switch (type_) {\n  case intValue:\n    return true;\n  case uintValue:\n    return value_.uint_ <= UInt64(maxInt64);\n  case realValue:\n    // Note that maxInt64 (= 2^63 - 1) is not exactly representable as a\n    // double, so double(maxInt64) will be rounded up to 2^63. Therefore we\n    // require the value to be strictly less than the limit.\n    return value_.real_ >= double(minInt64) &&\n           value_.real_ < double(maxInt64) && IsIntegral(value_.real_);\n  default:\n    break;\n  }\n#endif // JSON_HAS_INT64\n  return false;\n}\n\nbool Value::isUInt64() const {\n#if defined(JSON_HAS_INT64)\n  switch (type_) {\n  case intValue:\n    return value_.int_ >= 0;\n  case uintValue:\n    return true;\n  case realValue:\n    // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a\n    // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we\n    // require the value to be strictly less than the limit.\n    return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble &&\n           IsIntegral(value_.real_);\n  default:\n    break;\n  }\n#endif // JSON_HAS_INT64\n  return false;\n}\n\nbool Value::isIntegral() const {\n  switch (type_) {\n    case intValue:\n    case uintValue:\n      return true;\n    case realValue:\n#if defined(JSON_HAS_INT64)\n      // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a\n      // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we\n      // require the value to be strictly less than the limit.\n      return value_.real_ >= double(minInt64) && value_.real_ < maxUInt64AsDouble && IsIntegral(value_.real_);\n#else\n      return value_.real_ >= minInt && value_.real_ <= maxUInt && IsIntegral(value_.real_);\n#endif // JSON_HAS_INT64\n    default:\n      break;\n  }\n  return false;\n}\n\nbool Value::isDouble() const { return type_ == intValue || type_ == uintValue || type_ == realValue; }\n\nbool Value::isNumeric() const { return isDouble(); }\n\nbool Value::isString() const { return type_ == stringValue; }\n\nbool Value::isArray() const { return type_ == arrayValue; }\n\nbool Value::isObject() const { return type_ == objectValue; }\n\nvoid Value::setComment(const char* comment, size_t len, CommentPlacement placement) {\n  if (!comments_)\n    comments_ = new CommentInfo[numberOfCommentPlacement];\n  if ((len > 0) && (comment[len-1] == '\\n')) {\n    // Always discard trailing newline, to aid indentation.\n    len -= 1;\n  }\n  comments_[placement].setComment(comment, len);\n}\n\nvoid Value::setComment(const char* comment, CommentPlacement placement) {\n  setComment(comment, strlen(comment), placement);\n}\n\nvoid Value::setComment(const JSONCPP_STRING& comment, CommentPlacement placement) {\n  setComment(comment.c_str(), comment.length(), placement);\n}\n\nbool Value::hasComment(CommentPlacement placement) const {\n  return comments_ != 0 && comments_[placement].comment_ != 0;\n}\n\nJSONCPP_STRING Value::getComment(CommentPlacement placement) const {\n  if (hasComment(placement))\n    return comments_[placement].comment_;\n  return \"\";\n}\n\nvoid Value::setOffsetStart(ptrdiff_t start) { start_ = start; }\n\nvoid Value::setOffsetLimit(ptrdiff_t limit) { limit_ = limit; }\n\nptrdiff_t Value::getOffsetStart() const { return start_; }\n\nptrdiff_t Value::getOffsetLimit() const { return limit_; }\n\nJSONCPP_STRING Value::toStyledString() const {\n  StreamWriterBuilder builder;\n\n  JSONCPP_STRING out = this->hasComment(commentBefore) ? \"\\n\" : \"\";\n  out += Json::writeString(builder, *this);\n  out += \"\\n\";\n\n  return out;\n}\n\nValue::const_iterator Value::begin() const {\n  switch (type_) {\n  case arrayValue:\n  case objectValue:\n    if (value_.map_)\n      return const_iterator(value_.map_->begin());\n    break;\n  default:\n    break;\n  }\n  return const_iterator();\n}\n\nValue::const_iterator Value::end() const {\n  switch (type_) {\n  case arrayValue:\n  case objectValue:\n    if (value_.map_)\n      return const_iterator(value_.map_->end());\n    break;\n  default:\n    break;\n  }\n  return const_iterator();\n}\n\nValue::iterator Value::begin() {\n  switch (type_) {\n  case arrayValue:\n  case objectValue:\n    if (value_.map_)\n      return iterator(value_.map_->begin());\n    break;\n  default:\n    break;\n  }\n  return iterator();\n}\n\nValue::iterator Value::end() {\n  switch (type_) {\n  case arrayValue:\n  case objectValue:\n    if (value_.map_)\n      return iterator(value_.map_->end());\n    break;\n  default:\n    break;\n  }\n  return iterator();\n}\n\n// class PathArgument\n// //////////////////////////////////////////////////////////////////\n\nPathArgument::PathArgument() : key_(), index_(), kind_(kindNone) {}\n\nPathArgument::PathArgument(ArrayIndex index)\n    : key_(), index_(index), kind_(kindIndex) {}\n\nPathArgument::PathArgument(const char* key)\n    : key_(key), index_(), kind_(kindKey) {}\n\nPathArgument::PathArgument(const JSONCPP_STRING& key)\n    : key_(key.c_str()), index_(), kind_(kindKey) {}\n\n// class Path\n// //////////////////////////////////////////////////////////////////\n\nPath::Path(const JSONCPP_STRING& path,\n           const PathArgument& a1,\n           const PathArgument& a2,\n           const PathArgument& a3,\n           const PathArgument& a4,\n           const PathArgument& a5) {\n  InArgs in;\n  in.reserve(5);\n  in.push_back(&a1);\n  in.push_back(&a2);\n  in.push_back(&a3);\n  in.push_back(&a4);\n  in.push_back(&a5);\n  makePath(path, in);\n}\n\nvoid Path::makePath(const JSONCPP_STRING& path, const InArgs& in) {\n  const char* current = path.c_str();\n  const char* end = current + path.length();\n  InArgs::const_iterator itInArg = in.begin();\n  while (current != end) {\n    if (*current == '[') {\n      ++current;\n      if (*current == '%')\n        addPathInArg(path, in, itInArg, PathArgument::kindIndex);\n      else {\n        ArrayIndex index = 0;\n        for (; current != end && *current >= '0' && *current <= '9'; ++current)\n          index = index * 10 + ArrayIndex(*current - '0');\n        args_.push_back(index);\n      }\n      if (current == end || *++current != ']')\n        invalidPath(path, int(current - path.c_str()));\n    } else if (*current == '%') {\n      addPathInArg(path, in, itInArg, PathArgument::kindKey);\n      ++current;\n    } else if (*current == '.' || *current == ']') {\n      ++current;\n    } else {\n      const char* beginName = current;\n      while (current != end && !strchr(\"[.\", *current))\n        ++current;\n      args_.push_back(JSONCPP_STRING(beginName, current));\n    }\n  }\n}\n\nvoid Path::addPathInArg(const JSONCPP_STRING& /*path*/,\n                        const InArgs& in,\n                        InArgs::const_iterator& itInArg,\n                        PathArgument::Kind kind) {\n  if (itInArg == in.end()) {\n    // Error: missing argument %d\n  } else if ((*itInArg)->kind_ != kind) {\n    // Error: bad argument type\n  } else {\n    args_.push_back(**itInArg++);\n  }\n}\n\nvoid Path::invalidPath(const JSONCPP_STRING& /*path*/, int /*location*/) {\n  // Error: invalid path.\n}\n\nconst Value& Path::resolve(const Value& root) const {\n  const Value* node = &root;\n  for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {\n    const PathArgument& arg = *it;\n    if (arg.kind_ == PathArgument::kindIndex) {\n      if (!node->isArray() || !node->isValidIndex(arg.index_)) {\n        // Error: unable to resolve path (array value expected at position...\n        return Value::null;\n      }\n      node = &((*node)[arg.index_]);\n    } else if (arg.kind_ == PathArgument::kindKey) {\n      if (!node->isObject()) {\n        // Error: unable to resolve path (object value expected at position...)\n        return Value::null;\n      }\n      node = &((*node)[arg.key_]);\n      if (node == &Value::nullSingleton()) {\n        // Error: unable to resolve path (object has no member named '' at\n        // position...)\n        return Value::null;\n      }\n    }\n  }\n  return *node;\n}\n\nValue Path::resolve(const Value& root, const Value& defaultValue) const {\n  const Value* node = &root;\n  for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {\n    const PathArgument& arg = *it;\n    if (arg.kind_ == PathArgument::kindIndex) {\n      if (!node->isArray() || !node->isValidIndex(arg.index_))\n        return defaultValue;\n      node = &((*node)[arg.index_]);\n    } else if (arg.kind_ == PathArgument::kindKey) {\n      if (!node->isObject())\n        return defaultValue;\n      node = &((*node)[arg.key_]);\n      if (node == &Value::nullSingleton())\n        return defaultValue;\n    }\n  }\n  return *node;\n}\n\nValue& Path::make(Value& root) const {\n  Value* node = &root;\n  for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {\n    const PathArgument& arg = *it;\n    if (arg.kind_ == PathArgument::kindIndex) {\n      if (!node->isArray()) {\n        // Error: node is not an array at position ...\n      }\n      node = &((*node)[arg.index_]);\n    } else if (arg.kind_ == PathArgument::kindKey) {\n      if (!node->isObject()) {\n        // Error: node is not an object at position...\n      }\n      node = &((*node)[arg.key_]);\n    }\n  }\n  return *node;\n}\n\n} // namespace Json\n}\n}\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: src/lib_json/json_value.cpp\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n// //////////////////////////////////////////////////////////////////////\n// Beginning of content of file: src/lib_json/json_writer.cpp\n// //////////////////////////////////////////////////////////////////////\n\n// Copyright 2011 Baptiste Lepilleur and The JsonCpp Authors\n// Distributed under MIT license, or public domain if desired and\n// recognized in your jurisdiction.\n// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE\n\n#if !defined(JSON_IS_AMALGAMATION)\n#include <json/writer.h>\n#include \"json_tool.h\"\n#endif // if !defined(JSON_IS_AMALGAMATION)\n#include <iomanip>\n#include <memory>\n#include <sstream>\n#include <utility>\n#include <set>\n#include <cassert>\n#include <cstring>\n#include <cstdio>\n\n#if defined(_MSC_VER) && _MSC_VER >= 1200 && _MSC_VER < 1800 // Between VC++ 6.0 and VC++ 11.0\n#include <float.h>\n#define isfinite _finite\n#elif defined(__sun) && defined(__SVR4) //Solaris\n#if !defined(isfinite)\n#include <ieeefp.h>\n#define isfinite finite\n#endif\n#elif defined(_AIX)\n#if !defined(isfinite)\n#include <math.h>\n#define isfinite finite\n#endif\n#elif defined(__hpux)\n#if !defined(isfinite)\n#if defined(__ia64) && !defined(finite)\n#define isfinite(x) ((sizeof(x) == sizeof(float) ? \\\n                     _Isfinitef(x) : _IsFinite(x)))\n#else\n#include <math.h>\n#define isfinite finite\n#endif\n#endif\n#else\n#include <cmath>\n#if !(defined(__QNXNTO__)) // QNX already defines isfinite\n#define isfinite std::isfinite\n#endif\n#endif\n\n#if defined(_MSC_VER)\n#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above\n#define snprintf sprintf_s\n#elif _MSC_VER >= 1900 // VC++ 14.0 and above\n#define snprintf std::snprintf\n#else\n#define snprintf _snprintf\n#endif\n#elif defined(__ANDROID__) || defined(__QNXNTO__)\n#define snprintf snprintf\n#elif __cplusplus >= 201103L\n#if !defined(__MINGW32__) && !defined(__CYGWIN__)\n#define snprintf std::snprintf\n#endif\n#endif\n\n#if defined(__BORLANDC__)  \n#include <float.h>\n#define isfinite _finite\n#define snprintf _snprintf\n#endif\n\n#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0\n// Disable warning about strdup being deprecated.\n#pragma warning(disable : 4996)\n#endif\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\nnamespace Json {\n\n#if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)\ntypedef std::unique_ptr<StreamWriter> StreamWriterPtr;\n#else\ntypedef std::auto_ptr<StreamWriter>   StreamWriterPtr;\n#endif\n\nJSONCPP_STRING valueToString(LargestInt value) {\n  UIntToStringBuffer buffer;\n  char* current = buffer + sizeof(buffer);\n  if (value == Value::minLargestInt) {\n    uintToString(LargestUInt(Value::maxLargestInt) + 1, current);\n    *--current = '-';\n  } else if (value < 0) {\n    uintToString(LargestUInt(-value), current);\n    *--current = '-';\n  } else {\n    uintToString(LargestUInt(value), current);\n  }\n  assert(current >= buffer);\n  return current;\n}\n\nJSONCPP_STRING valueToString(LargestUInt value) {\n  UIntToStringBuffer buffer;\n  char* current = buffer + sizeof(buffer);\n  uintToString(value, current);\n  assert(current >= buffer);\n  return current;\n}\n\n#if defined(JSON_HAS_INT64)\n\nJSONCPP_STRING valueToString(Int value) {\n  return valueToString(LargestInt(value));\n}\n\nJSONCPP_STRING valueToString(UInt value) {\n  return valueToString(LargestUInt(value));\n}\n\n#endif // # if defined(JSON_HAS_INT64)\n\nnamespace {\nJSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int precision) {\n  // Allocate a buffer that is more than large enough to store the 16 digits of\n  // precision requested below.\n  char buffer[36];\n  int len = -1;\n\n  char formatString[15];\n  snprintf(formatString, sizeof(formatString), \"%%.%ug\", precision);\n\n  // Print into the buffer. We need not request the alternative representation\n  // that always has a decimal point because JSON doesn't distinguish the\n  // concepts of reals and integers.\n  if (isfinite(value)) {\n    len = snprintf(buffer, sizeof(buffer), formatString, value);\n    fixNumericLocale(buffer, buffer + len);\n\n    // try to ensure we preserve the fact that this was given to us as a double on input\n    if (!strchr(buffer, '.') && !strchr(buffer, 'e')) {\n      strcat(buffer, \".0\");\n    }\n\n  } else {\n    // IEEE standard states that NaN values will not compare to themselves\n    if (value != value) {\n      len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? \"NaN\" : \"null\");\n    } else if (value < 0) {\n      len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? \"-Infinity\" : \"-1e+9999\");\n    } else {\n      len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? \"Infinity\" : \"1e+9999\");\n    }\n  }\n  assert(len >= 0);\n  return buffer;\n}\n}\n\nJSONCPP_STRING valueToString(double value) { return valueToString(value, false, 17); }\n\nJSONCPP_STRING valueToString(bool value) { return value ? \"true\" : \"false\"; }\n\nstatic bool isAnyCharRequiredQuoting(char const* s, size_t n) {\n  assert(s || !n);\n\n  char const* const end = s + n;\n  for (char const* cur = s; cur < end; ++cur) {\n    if (*cur == '\\\\' || *cur == '\\\"' || *cur < ' '\n      || static_cast<unsigned char>(*cur) < 0x80)\n      return true;\n  }\n  return false;\n}\n\nstatic unsigned int utf8ToCodepoint(const char*& s, const char* e) {\n  const unsigned int REPLACEMENT_CHARACTER = 0xFFFD;\n\n  unsigned int firstByte = static_cast<unsigned char>(*s);\n\n  if (firstByte < 0x80)\n    return firstByte;\n\n  if (firstByte < 0xE0) {\n    if (e - s < 2)\n      return REPLACEMENT_CHARACTER;\n\n    unsigned int calculated = ((firstByte & 0x1F) << 6)\n      | (static_cast<unsigned int>(s[1]) & 0x3F);\n    s += 1;\n    // oversized encoded characters are invalid\n    return calculated < 0x80 ? REPLACEMENT_CHARACTER : calculated;\n  }\n\n  if (firstByte < 0xF0) {\n    if (e - s < 3)\n      return REPLACEMENT_CHARACTER;\n\n    unsigned int calculated = ((firstByte & 0x0F) << 12)\n      | ((static_cast<unsigned int>(s[1]) & 0x3F) << 6)\n      |  (static_cast<unsigned int>(s[2]) & 0x3F);\n    s += 2;\n    // surrogates aren't valid codepoints itself\n    // shouldn't be UTF-8 encoded\n    if (calculated >= 0xD800 && calculated <= 0xDFFF)\n      return REPLACEMENT_CHARACTER;\n    // oversized encoded characters are invalid\n    return calculated < 0x800 ? REPLACEMENT_CHARACTER : calculated;\n  }\n\n  if (firstByte < 0xF8) {\n    if (e - s < 4)\n      return REPLACEMENT_CHARACTER;\n\n    unsigned int calculated = ((firstByte & 0x07) << 24)\n      | ((static_cast<unsigned int>(s[1]) & 0x3F) << 12)\n      | ((static_cast<unsigned int>(s[2]) & 0x3F) << 6)\n      |  (static_cast<unsigned int>(s[3]) & 0x3F);\n    s += 3;\n    // oversized encoded characters are invalid\n    return calculated < 0x10000 ? REPLACEMENT_CHARACTER : calculated;\n  }\n\n  return REPLACEMENT_CHARACTER;\n}\n\nstatic const char hex2[] =\n  \"000102030405060708090a0b0c0d0e0f\"\n  \"101112131415161718191a1b1c1d1e1f\"\n  \"202122232425262728292a2b2c2d2e2f\"\n  \"303132333435363738393a3b3c3d3e3f\"\n  \"404142434445464748494a4b4c4d4e4f\"\n  \"505152535455565758595a5b5c5d5e5f\"\n  \"606162636465666768696a6b6c6d6e6f\"\n  \"707172737475767778797a7b7c7d7e7f\"\n  \"808182838485868788898a8b8c8d8e8f\"\n  \"909192939495969798999a9b9c9d9e9f\"\n  \"a0a1a2a3a4a5a6a7a8a9aaabacadaeaf\"\n  \"b0b1b2b3b4b5b6b7b8b9babbbcbdbebf\"\n  \"c0c1c2c3c4c5c6c7c8c9cacbcccdcecf\"\n  \"d0d1d2d3d4d5d6d7d8d9dadbdcdddedf\"\n  \"e0e1e2e3e4e5e6e7e8e9eaebecedeeef\"\n  \"f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\";\n\nstatic JSONCPP_STRING toHex16Bit(unsigned int x) {\n  const unsigned int hi = (x >> 8) & 0xff;\n  const unsigned int lo = x & 0xff;\n  JSONCPP_STRING result(4, ' ');\n  result[0] = hex2[2 * hi];\n  result[1] = hex2[2 * hi + 1];\n  result[2] = hex2[2 * lo];\n  result[3] = hex2[2 * lo + 1];\n  return result;\n}\n\nstatic JSONCPP_STRING valueToQuotedStringN(const char* value, unsigned length) {\n  if (value == NULL)\n    return \"\";\n\n  if (!isAnyCharRequiredQuoting(value, length))\n    return JSONCPP_STRING(\"\\\"\") + value + \"\\\"\";\n  // We have to walk value and escape any special characters.\n  // Appending to JSONCPP_STRING is not efficient, but this should be rare.\n  // (Note: forward slashes are *not* rare, but I am not escaping them.)\n  JSONCPP_STRING::size_type maxsize =\n      length * 2 + 3; // allescaped+quotes+NULL\n  JSONCPP_STRING result;\n  result.reserve(maxsize); // to avoid lots of mallocs\n  result += \"\\\"\";\n  char const* end = value + length;\n  for (const char* c = value; c != end; ++c) {\n    switch (*c) {\n    case '\\\"':\n      result += \"\\\\\\\"\";\n      break;\n    case '\\\\':\n      result += \"\\\\\\\\\";\n      break;\n    case '\\b':\n      result += \"\\\\b\";\n      break;\n    case '\\f':\n      result += \"\\\\f\";\n      break;\n    case '\\n':\n      result += \"\\\\n\";\n      break;\n    case '\\r':\n      result += \"\\\\r\";\n      break;\n    case '\\t':\n      result += \"\\\\t\";\n      break;\n    // case '/':\n    // Even though \\/ is considered a legal escape in JSON, a bare\n    // slash is also legal, so I see no reason to escape it.\n    // (I hope I am not misunderstanding something.)\n    // blep notes: actually escaping \\/ may be useful in javascript to avoid </\n    // sequence.\n    // Should add a flag to allow this compatibility mode and prevent this\n    // sequence from occurring.\n    default: {\n        unsigned int cp = utf8ToCodepoint(c, end);\n        // don't escape non-control characters\n        // (short escape sequence are applied above)\n        if (cp < 0x80 && cp >= 0x20)\n          result += static_cast<char>(cp);\n        else if (cp < 0x10000) { // codepoint is in Basic Multilingual Plane\n          result += \"\\\\u\";\n          result += toHex16Bit(cp);\n        }\n        else { // codepoint is not in Basic Multilingual Plane\n               // convert to surrogate pair first\n          cp -= 0x10000;\n          result += \"\\\\u\";\n          result += toHex16Bit((cp >> 10) + 0xD800);\n          result += \"\\\\u\";\n          result += toHex16Bit((cp & 0x3FF) + 0xDC00);\n        }\n      }\n      break;\n    }\n  }\n  result += \"\\\"\";\n  return result;\n}\n\nJSONCPP_STRING valueToQuotedString(const char* value) {\n  return valueToQuotedStringN(value, static_cast<unsigned int>(strlen(value)));\n}\n\n// Class Writer\n// //////////////////////////////////////////////////////////////////\nWriter::~Writer() {}\n\n// Class FastWriter\n// //////////////////////////////////////////////////////////////////\n\nFastWriter::FastWriter()\n    : yamlCompatibilityEnabled_(false), dropNullPlaceholders_(false),\n      omitEndingLineFeed_(false) {}\n\nvoid FastWriter::enableYAMLCompatibility() { yamlCompatibilityEnabled_ = true; }\n\nvoid FastWriter::dropNullPlaceholders() { dropNullPlaceholders_ = true; }\n\nvoid FastWriter::omitEndingLineFeed() { omitEndingLineFeed_ = true; }\n\nJSONCPP_STRING FastWriter::write(const Value& root) {\n  document_.clear();\n  writeValue(root);\n  if (!omitEndingLineFeed_)\n    document_ += \"\\n\";\n  return document_;\n}\n\nvoid FastWriter::writeValue(const Value& value) {\n  switch (value.type()) {\n  case nullValue:\n    if (!dropNullPlaceholders_)\n      document_ += \"null\";\n    break;\n  case intValue:\n    document_ += valueToString(value.asLargestInt());\n    break;\n  case uintValue:\n    document_ += valueToString(value.asLargestUInt());\n    break;\n  case realValue:\n    document_ += valueToString(value.asDouble());\n    break;\n  case stringValue:\n  {\n    // Is NULL possible for value.string_? No.\n    char const* str;\n    char const* end;\n    bool ok = value.getString(&str, &end);\n    if (ok) document_ += valueToQuotedStringN(str, static_cast<unsigned>(end-str));\n    break;\n  }\n  case booleanValue:\n    document_ += valueToString(value.asBool());\n    break;\n  case arrayValue: {\n    document_ += '[';\n    ArrayIndex size = value.size();\n    for (ArrayIndex index = 0; index < size; ++index) {\n      if (index > 0)\n        document_ += ',';\n      writeValue(value[index]);\n    }\n    document_ += ']';\n  } break;\n  case objectValue: {\n    Value::Members members(value.getMemberNames());\n    document_ += '{';\n    for (Value::Members::iterator it = members.begin(); it != members.end();\n         ++it) {\n      const JSONCPP_STRING& name = *it;\n      if (it != members.begin())\n        document_ += ',';\n      document_ += valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length()));\n      document_ += yamlCompatibilityEnabled_ ? \": \" : \":\";\n      writeValue(value[name]);\n    }\n    document_ += '}';\n  } break;\n  }\n}\n\n// Class StyledWriter\n// //////////////////////////////////////////////////////////////////\n\nStyledWriter::StyledWriter()\n    : rightMargin_(74), indentSize_(3), addChildValues_() {}\n\nJSONCPP_STRING StyledWriter::write(const Value& root) {\n  document_.clear();\n  addChildValues_ = false;\n  indentString_.clear();\n  writeCommentBeforeValue(root);\n  writeValue(root);\n  writeCommentAfterValueOnSameLine(root);\n  document_ += \"\\n\";\n  return document_;\n}\n\nvoid StyledWriter::writeValue(const Value& value) {\n  switch (value.type()) {\n  case nullValue:\n    pushValue(\"null\");\n    break;\n  case intValue:\n    pushValue(valueToString(value.asLargestInt()));\n    break;\n  case uintValue:\n    pushValue(valueToString(value.asLargestUInt()));\n    break;\n  case realValue:\n    pushValue(valueToString(value.asDouble()));\n    break;\n  case stringValue:\n  {\n    // Is NULL possible for value.string_? No.\n    char const* str;\n    char const* end;\n    bool ok = value.getString(&str, &end);\n    if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));\n    else pushValue(\"\");\n    break;\n  }\n  case booleanValue:\n    pushValue(valueToString(value.asBool()));\n    break;\n  case arrayValue:\n    writeArrayValue(value);\n    break;\n  case objectValue: {\n    Value::Members members(value.getMemberNames());\n    if (members.empty())\n      pushValue(\"{}\");\n    else {\n      writeWithIndent(\"{\");\n      indent();\n      Value::Members::iterator it = members.begin();\n      for (;;) {\n        const JSONCPP_STRING& name = *it;\n        const Value& childValue = value[name];\n        writeCommentBeforeValue(childValue);\n        writeWithIndent(valueToQuotedString(name.c_str()));\n        document_ += \" : \";\n        writeValue(childValue);\n        if (++it == members.end()) {\n          writeCommentAfterValueOnSameLine(childValue);\n          break;\n        }\n        document_ += ',';\n        writeCommentAfterValueOnSameLine(childValue);\n      }\n      unindent();\n      writeWithIndent(\"}\");\n    }\n  } break;\n  }\n}\n\nvoid StyledWriter::writeArrayValue(const Value& value) {\n  unsigned size = value.size();\n  if (size == 0)\n    pushValue(\"[]\");\n  else {\n    bool isArrayMultiLine = isMultilineArray(value);\n    if (isArrayMultiLine) {\n      writeWithIndent(\"[\");\n      indent();\n      bool hasChildValue = !childValues_.empty();\n      unsigned index = 0;\n      for (;;) {\n        const Value& childValue = value[index];\n        writeCommentBeforeValue(childValue);\n        if (hasChildValue)\n          writeWithIndent(childValues_[index]);\n        else {\n          writeIndent();\n          writeValue(childValue);\n        }\n        if (++index == size) {\n          writeCommentAfterValueOnSameLine(childValue);\n          break;\n        }\n        document_ += ',';\n        writeCommentAfterValueOnSameLine(childValue);\n      }\n      unindent();\n      writeWithIndent(\"]\");\n    } else // output on a single line\n    {\n      assert(childValues_.size() == size);\n      document_ += \"[ \";\n      for (unsigned index = 0; index < size; ++index) {\n        if (index > 0)\n          document_ += \", \";\n        document_ += childValues_[index];\n      }\n      document_ += \" ]\";\n    }\n  }\n}\n\nbool StyledWriter::isMultilineArray(const Value& value) {\n  ArrayIndex const size = value.size();\n  bool isMultiLine = size * 3 >= rightMargin_;\n  childValues_.clear();\n  for (ArrayIndex index = 0; index < size && !isMultiLine; ++index) {\n    const Value& childValue = value[index];\n    isMultiLine = ((childValue.isArray() || childValue.isObject()) &&\n                        childValue.size() > 0);\n  }\n  if (!isMultiLine) // check if line length > max line length\n  {\n    childValues_.reserve(size);\n    addChildValues_ = true;\n    ArrayIndex lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'\n    for (ArrayIndex index = 0; index < size; ++index) {\n      if (hasCommentForValue(value[index])) {\n        isMultiLine = true;\n      }\n      writeValue(value[index]);\n      lineLength += static_cast<ArrayIndex>(childValues_[index].length());\n    }\n    addChildValues_ = false;\n    isMultiLine = isMultiLine || lineLength >= rightMargin_;\n  }\n  return isMultiLine;\n}\n\nvoid StyledWriter::pushValue(const JSONCPP_STRING& value) {\n  if (addChildValues_)\n    childValues_.push_back(value);\n  else\n    document_ += value;\n}\n\nvoid StyledWriter::writeIndent() {\n  if (!document_.empty()) {\n    char last = document_[document_.length() - 1];\n    if (last == ' ') // already indented\n      return;\n    if (last != '\\n') // Comments may add new-line\n      document_ += '\\n';\n  }\n  document_ += indentString_;\n}\n\nvoid StyledWriter::writeWithIndent(const JSONCPP_STRING& value) {\n  writeIndent();\n  document_ += value;\n}\n\nvoid StyledWriter::indent() { indentString_ += JSONCPP_STRING(indentSize_, ' '); }\n\nvoid StyledWriter::unindent() {\n  assert(indentString_.size() >= indentSize_);\n  indentString_.resize(indentString_.size() - indentSize_);\n}\n\nvoid StyledWriter::writeCommentBeforeValue(const Value& root) {\n  if (!root.hasComment(commentBefore))\n    return;\n\n  document_ += \"\\n\";\n  writeIndent();\n  const JSONCPP_STRING& comment = root.getComment(commentBefore);\n  JSONCPP_STRING::const_iterator iter = comment.begin();\n  while (iter != comment.end()) {\n    document_ += *iter;\n    if (*iter == '\\n' &&\n       ((iter+1) != comment.end() && *(iter + 1) == '/'))\n      writeIndent();\n    ++iter;\n  }\n\n  // Comments are stripped of trailing newlines, so add one here\n  document_ += \"\\n\";\n}\n\nvoid StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {\n  if (root.hasComment(commentAfterOnSameLine))\n    document_ += \" \" + root.getComment(commentAfterOnSameLine);\n\n  if (root.hasComment(commentAfter)) {\n    document_ += \"\\n\";\n    document_ += root.getComment(commentAfter);\n    document_ += \"\\n\";\n  }\n}\n\nbool StyledWriter::hasCommentForValue(const Value& value) {\n  return value.hasComment(commentBefore) ||\n         value.hasComment(commentAfterOnSameLine) ||\n         value.hasComment(commentAfter);\n}\n\n// Class StyledStreamWriter\n// //////////////////////////////////////////////////////////////////\n\nStyledStreamWriter::StyledStreamWriter(JSONCPP_STRING indentation)\n    : document_(NULL), rightMargin_(74), indentation_(indentation),\n      addChildValues_() {}\n\nvoid StyledStreamWriter::write(JSONCPP_OSTREAM& out, const Value& root) {\n  document_ = &out;\n  addChildValues_ = false;\n  indentString_.clear();\n  indented_ = true;\n  writeCommentBeforeValue(root);\n  if (!indented_) writeIndent();\n  indented_ = true;\n  writeValue(root);\n  writeCommentAfterValueOnSameLine(root);\n  *document_ << \"\\n\";\n  document_ = NULL; // Forget the stream, for safety.\n}\n\nvoid StyledStreamWriter::writeValue(const Value& value) {\n  switch (value.type()) {\n  case nullValue:\n    pushValue(\"null\");\n    break;\n  case intValue:\n    pushValue(valueToString(value.asLargestInt()));\n    break;\n  case uintValue:\n    pushValue(valueToString(value.asLargestUInt()));\n    break;\n  case realValue:\n    pushValue(valueToString(value.asDouble()));\n    break;\n  case stringValue:\n  {\n    // Is NULL possible for value.string_? No.\n    char const* str;\n    char const* end;\n    bool ok = value.getString(&str, &end);\n    if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));\n    else pushValue(\"\");\n    break;\n  }\n  case booleanValue:\n    pushValue(valueToString(value.asBool()));\n    break;\n  case arrayValue:\n    writeArrayValue(value);\n    break;\n  case objectValue: {\n    Value::Members members(value.getMemberNames());\n    if (members.empty())\n      pushValue(\"{}\");\n    else {\n      writeWithIndent(\"{\");\n      indent();\n      Value::Members::iterator it = members.begin();\n      for (;;) {\n        const JSONCPP_STRING& name = *it;\n        const Value& childValue = value[name];\n        writeCommentBeforeValue(childValue);\n        writeWithIndent(valueToQuotedString(name.c_str()));\n        *document_ << \" : \";\n        writeValue(childValue);\n        if (++it == members.end()) {\n          writeCommentAfterValueOnSameLine(childValue);\n          break;\n        }\n        *document_ << \",\";\n        writeCommentAfterValueOnSameLine(childValue);\n      }\n      unindent();\n      writeWithIndent(\"}\");\n    }\n  } break;\n  }\n}\n\nvoid StyledStreamWriter::writeArrayValue(const Value& value) {\n  unsigned size = value.size();\n  if (size == 0)\n    pushValue(\"[]\");\n  else {\n    bool isArrayMultiLine = isMultilineArray(value);\n    if (isArrayMultiLine) {\n      writeWithIndent(\"[\");\n      indent();\n      bool hasChildValue = !childValues_.empty();\n      unsigned index = 0;\n      for (;;) {\n        const Value& childValue = value[index];\n        writeCommentBeforeValue(childValue);\n        if (hasChildValue)\n          writeWithIndent(childValues_[index]);\n        else {\n          if (!indented_) writeIndent();\n          indented_ = true;\n          writeValue(childValue);\n          indented_ = false;\n        }\n        if (++index == size) {\n          writeCommentAfterValueOnSameLine(childValue);\n          break;\n        }\n        *document_ << \",\";\n        writeCommentAfterValueOnSameLine(childValue);\n      }\n      unindent();\n      writeWithIndent(\"]\");\n    } else // output on a single line\n    {\n      assert(childValues_.size() == size);\n      *document_ << \"[ \";\n      for (unsigned index = 0; index < size; ++index) {\n        if (index > 0)\n          *document_ << \", \";\n        *document_ << childValues_[index];\n      }\n      *document_ << \" ]\";\n    }\n  }\n}\n\nbool StyledStreamWriter::isMultilineArray(const Value& value) {\n  ArrayIndex const size = value.size();\n  bool isMultiLine = size * 3 >= rightMargin_;\n  childValues_.clear();\n  for (ArrayIndex index = 0; index < size && !isMultiLine; ++index) {\n    const Value& childValue = value[index];\n    isMultiLine = ((childValue.isArray() || childValue.isObject()) &&\n                        childValue.size() > 0);\n  }\n  if (!isMultiLine) // check if line length > max line length\n  {\n    childValues_.reserve(size);\n    addChildValues_ = true;\n    ArrayIndex lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'\n    for (ArrayIndex index = 0; index < size; ++index) {\n      if (hasCommentForValue(value[index])) {\n        isMultiLine = true;\n      }\n      writeValue(value[index]);\n      lineLength += static_cast<ArrayIndex>(childValues_[index].length());\n    }\n    addChildValues_ = false;\n    isMultiLine = isMultiLine || lineLength >= rightMargin_;\n  }\n  return isMultiLine;\n}\n\nvoid StyledStreamWriter::pushValue(const JSONCPP_STRING& value) {\n  if (addChildValues_)\n    childValues_.push_back(value);\n  else\n    *document_ << value;\n}\n\nvoid StyledStreamWriter::writeIndent() {\n  // blep intended this to look at the so-far-written string\n  // to determine whether we are already indented, but\n  // with a stream we cannot do that. So we rely on some saved state.\n  // The caller checks indented_.\n  *document_ << '\\n' << indentString_;\n}\n\nvoid StyledStreamWriter::writeWithIndent(const JSONCPP_STRING& value) {\n  if (!indented_) writeIndent();\n  *document_ << value;\n  indented_ = false;\n}\n\nvoid StyledStreamWriter::indent() { indentString_ += indentation_; }\n\nvoid StyledStreamWriter::unindent() {\n  assert(indentString_.size() >= indentation_.size());\n  indentString_.resize(indentString_.size() - indentation_.size());\n}\n\nvoid StyledStreamWriter::writeCommentBeforeValue(const Value& root) {\n  if (!root.hasComment(commentBefore))\n    return;\n\n  if (!indented_) writeIndent();\n  const JSONCPP_STRING& comment = root.getComment(commentBefore);\n  JSONCPP_STRING::const_iterator iter = comment.begin();\n  while (iter != comment.end()) {\n    *document_ << *iter;\n    if (*iter == '\\n' &&\n       ((iter+1) != comment.end() && *(iter + 1) == '/'))\n      // writeIndent();  // would include newline\n      *document_ << indentString_;\n    ++iter;\n  }\n  indented_ = false;\n}\n\nvoid StyledStreamWriter::writeCommentAfterValueOnSameLine(const Value& root) {\n  if (root.hasComment(commentAfterOnSameLine))\n    *document_ << ' ' << root.getComment(commentAfterOnSameLine);\n\n  if (root.hasComment(commentAfter)) {\n    writeIndent();\n    *document_ << root.getComment(commentAfter);\n  }\n  indented_ = false;\n}\n\nbool StyledStreamWriter::hasCommentForValue(const Value& value) {\n  return value.hasComment(commentBefore) ||\n         value.hasComment(commentAfterOnSameLine) ||\n         value.hasComment(commentAfter);\n}\n\n//////////////////////////\n// BuiltStyledStreamWriter\n\n/// Scoped enums are not available until C++11.\nstruct CommentStyle {\n  /// Decide whether to write comments.\n  enum Enum {\n    None,  ///< Drop all comments.\n    Most,  ///< Recover odd behavior of previous versions (not implemented yet).\n    All  ///< Keep all comments.\n  };\n};\n\nstruct BuiltStyledStreamWriter : public StreamWriter\n{\n  BuiltStyledStreamWriter(\n      JSONCPP_STRING const& indentation,\n      CommentStyle::Enum cs,\n      JSONCPP_STRING const& colonSymbol,\n      JSONCPP_STRING const& nullSymbol,\n      JSONCPP_STRING const& endingLineFeedSymbol,\n      bool useSpecialFloats,\n      unsigned int precision);\n  int write(Value const& root, JSONCPP_OSTREAM* sout) JSONCPP_OVERRIDE;\nprivate:\n  void writeValue(Value const& value);\n  void writeArrayValue(Value const& value);\n  bool isMultilineArray(Value const& value);\n  void pushValue(JSONCPP_STRING const& value);\n  void writeIndent();\n  void writeWithIndent(JSONCPP_STRING const& value);\n  void indent();\n  void unindent();\n  void writeCommentBeforeValue(Value const& root);\n  void writeCommentAfterValueOnSameLine(Value const& root);\n  static bool hasCommentForValue(const Value& value);\n\n  typedef std::vector<JSONCPP_STRING> ChildValues;\n\n  ChildValues childValues_;\n  JSONCPP_STRING indentString_;\n  unsigned int rightMargin_;\n  JSONCPP_STRING indentation_;\n  CommentStyle::Enum cs_;\n  JSONCPP_STRING colonSymbol_;\n  JSONCPP_STRING nullSymbol_;\n  JSONCPP_STRING endingLineFeedSymbol_;\n  bool addChildValues_ : 1;\n  bool indented_ : 1;\n  bool useSpecialFloats_ : 1;\n  unsigned int precision_;\n};\nBuiltStyledStreamWriter::BuiltStyledStreamWriter(\n      JSONCPP_STRING const& indentation,\n      CommentStyle::Enum cs,\n      JSONCPP_STRING const& colonSymbol,\n      JSONCPP_STRING const& nullSymbol,\n      JSONCPP_STRING const& endingLineFeedSymbol,\n      bool useSpecialFloats,\n      unsigned int precision)\n  : rightMargin_(74)\n  , indentation_(indentation)\n  , cs_(cs)\n  , colonSymbol_(colonSymbol)\n  , nullSymbol_(nullSymbol)\n  , endingLineFeedSymbol_(endingLineFeedSymbol)\n  , addChildValues_(false)\n  , indented_(false)\n  , useSpecialFloats_(useSpecialFloats)\n  , precision_(precision)\n{\n}\nint BuiltStyledStreamWriter::write(Value const& root, JSONCPP_OSTREAM* sout)\n{\n  sout_ = sout;\n  addChildValues_ = false;\n  indented_ = true;\n  indentString_.clear();\n  writeCommentBeforeValue(root);\n  if (!indented_) writeIndent();\n  indented_ = true;\n  writeValue(root);\n  writeCommentAfterValueOnSameLine(root);\n  *sout_ << endingLineFeedSymbol_;\n  sout_ = NULL;\n  return 0;\n}\nvoid BuiltStyledStreamWriter::writeValue(Value const& value) {\n  switch (value.type()) {\n  case nullValue:\n    pushValue(nullSymbol_);\n    break;\n  case intValue:\n    pushValue(valueToString(value.asLargestInt()));\n    break;\n  case uintValue:\n    pushValue(valueToString(value.asLargestUInt()));\n    break;\n  case realValue:\n    pushValue(valueToString(value.asDouble(), useSpecialFloats_, precision_));\n    break;\n  case stringValue:\n  {\n    // Is NULL is possible for value.string_? No.\n    char const* str;\n    char const* end;\n    bool ok = value.getString(&str, &end);\n    if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));\n    else pushValue(\"\");\n    break;\n  }\n  case booleanValue:\n    pushValue(valueToString(value.asBool()));\n    break;\n  case arrayValue:\n    writeArrayValue(value);\n    break;\n  case objectValue: {\n    Value::Members members(value.getMemberNames());\n    if (members.empty())\n      pushValue(\"{}\");\n    else {\n      writeWithIndent(\"{\");\n      indent();\n      Value::Members::iterator it = members.begin();\n      for (;;) {\n        JSONCPP_STRING const& name = *it;\n        Value const& childValue = value[name];\n        writeCommentBeforeValue(childValue);\n        writeWithIndent(valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length())));\n        *sout_ << colonSymbol_;\n        writeValue(childValue);\n        if (++it == members.end()) {\n          writeCommentAfterValueOnSameLine(childValue);\n          break;\n        }\n        *sout_ << \",\";\n        writeCommentAfterValueOnSameLine(childValue);\n      }\n      unindent();\n      writeWithIndent(\"}\");\n    }\n  } break;\n  }\n}\n\nvoid BuiltStyledStreamWriter::writeArrayValue(Value const& value) {\n  unsigned size = value.size();\n  if (size == 0)\n    pushValue(\"[]\");\n  else {\n    bool isMultiLine = (cs_ == CommentStyle::All) || isMultilineArray(value);\n    if (isMultiLine) {\n      writeWithIndent(\"[\");\n      indent();\n      bool hasChildValue = !childValues_.empty();\n      unsigned index = 0;\n      for (;;) {\n        Value const& childValue = value[index];\n        writeCommentBeforeValue(childValue);\n        if (hasChildValue)\n          writeWithIndent(childValues_[index]);\n        else {\n          if (!indented_) writeIndent();\n          indented_ = true;\n          writeValue(childValue);\n          indented_ = false;\n        }\n        if (++index == size) {\n          writeCommentAfterValueOnSameLine(childValue);\n          break;\n        }\n        *sout_ << \",\";\n        writeCommentAfterValueOnSameLine(childValue);\n      }\n      unindent();\n      writeWithIndent(\"]\");\n    } else // output on a single line\n    {\n      assert(childValues_.size() == size);\n      *sout_ << \"[\";\n      if (!indentation_.empty()) *sout_ << \" \";\n      for (unsigned index = 0; index < size; ++index) {\n        if (index > 0)\n          *sout_ << ((!indentation_.empty()) ? \", \" : \",\");\n        *sout_ << childValues_[index];\n      }\n      if (!indentation_.empty()) *sout_ << \" \";\n      *sout_ << \"]\";\n    }\n  }\n}\n\nbool BuiltStyledStreamWriter::isMultilineArray(Value const& value) {\n  ArrayIndex const size = value.size();\n  bool isMultiLine = size * 3 >= rightMargin_;\n  childValues_.clear();\n  for (ArrayIndex index = 0; index < size && !isMultiLine; ++index) {\n    Value const& childValue = value[index];\n    isMultiLine = ((childValue.isArray() || childValue.isObject()) &&\n                        childValue.size() > 0);\n  }\n  if (!isMultiLine) // check if line length > max line length\n  {\n    childValues_.reserve(size);\n    addChildValues_ = true;\n    ArrayIndex lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'\n    for (ArrayIndex index = 0; index < size; ++index) {\n      if (hasCommentForValue(value[index])) {\n        isMultiLine = true;\n      }\n      writeValue(value[index]);\n      lineLength += static_cast<ArrayIndex>(childValues_[index].length());\n    }\n    addChildValues_ = false;\n    isMultiLine = isMultiLine || lineLength >= rightMargin_;\n  }\n  return isMultiLine;\n}\n\nvoid BuiltStyledStreamWriter::pushValue(JSONCPP_STRING const& value) {\n  if (addChildValues_)\n    childValues_.push_back(value);\n  else\n    *sout_ << value;\n}\n\nvoid BuiltStyledStreamWriter::writeIndent() {\n  // blep intended this to look at the so-far-written string\n  // to determine whether we are already indented, but\n  // with a stream we cannot do that. So we rely on some saved state.\n  // The caller checks indented_.\n\n  if (!indentation_.empty()) {\n    // In this case, drop newlines too.\n    *sout_ << '\\n' << indentString_;\n  }\n}\n\nvoid BuiltStyledStreamWriter::writeWithIndent(JSONCPP_STRING const& value) {\n  if (!indented_) writeIndent();\n  *sout_ << value;\n  indented_ = false;\n}\n\nvoid BuiltStyledStreamWriter::indent() { indentString_ += indentation_; }\n\nvoid BuiltStyledStreamWriter::unindent() {\n  assert(indentString_.size() >= indentation_.size());\n  indentString_.resize(indentString_.size() - indentation_.size());\n}\n\nvoid BuiltStyledStreamWriter::writeCommentBeforeValue(Value const& root) {\n  if (cs_ == CommentStyle::None) return;\n  if (!root.hasComment(commentBefore))\n    return;\n\n  if (!indented_) writeIndent();\n  const JSONCPP_STRING& comment = root.getComment(commentBefore);\n  JSONCPP_STRING::const_iterator iter = comment.begin();\n  while (iter != comment.end()) {\n    *sout_ << *iter;\n    if (*iter == '\\n' &&\n       ((iter+1) != comment.end() && *(iter + 1) == '/'))\n      // writeIndent();  // would write extra newline\n      *sout_ << indentString_;\n    ++iter;\n  }\n  indented_ = false;\n}\n\nvoid BuiltStyledStreamWriter::writeCommentAfterValueOnSameLine(Value const& root) {\n  if (cs_ == CommentStyle::None) return;\n  if (root.hasComment(commentAfterOnSameLine))\n    *sout_ << \" \" + root.getComment(commentAfterOnSameLine);\n\n  if (root.hasComment(commentAfter)) {\n    writeIndent();\n    *sout_ << root.getComment(commentAfter);\n  }\n}\n\n// static\nbool BuiltStyledStreamWriter::hasCommentForValue(const Value& value) {\n  return value.hasComment(commentBefore) ||\n         value.hasComment(commentAfterOnSameLine) ||\n         value.hasComment(commentAfter);\n}\n\n///////////////\n// StreamWriter\n\nStreamWriter::StreamWriter()\n    : sout_(NULL)\n{\n}\nStreamWriter::~StreamWriter()\n{\n}\nStreamWriter::Factory::~Factory()\n{}\nStreamWriterBuilder::StreamWriterBuilder()\n{\n  setDefaults(&settings_);\n}\nStreamWriterBuilder::~StreamWriterBuilder()\n{}\nStreamWriter* StreamWriterBuilder::newStreamWriter() const\n{\n  JSONCPP_STRING indentation = settings_[\"indentation\"].asString();\n  JSONCPP_STRING cs_str = settings_[\"commentStyle\"].asString();\n  bool eyc = settings_[\"enableYAMLCompatibility\"].asBool();\n  bool dnp = settings_[\"dropNullPlaceholders\"].asBool();\n  bool usf = settings_[\"useSpecialFloats\"].asBool(); \n  unsigned int pre = settings_[\"precision\"].asUInt();\n  CommentStyle::Enum cs = CommentStyle::All;\n  if (cs_str == \"All\") {\n    cs = CommentStyle::All;\n  } else if (cs_str == \"None\") {\n    cs = CommentStyle::None;\n  } else {\n    throwRuntimeError(\"commentStyle must be 'All' or 'None'\");\n  }\n  JSONCPP_STRING colonSymbol = \" : \";\n  if (eyc) {\n    colonSymbol = \": \";\n  } else if (indentation.empty()) {\n    colonSymbol = \":\";\n  }\n  JSONCPP_STRING nullSymbol = \"null\";\n  if (dnp) {\n    nullSymbol.clear();\n  }\n  if (pre > 17) pre = 17;\n  JSONCPP_STRING endingLineFeedSymbol;\n  return new BuiltStyledStreamWriter(\n      indentation, cs,\n      colonSymbol, nullSymbol, endingLineFeedSymbol, usf, pre);\n}\nstatic void getValidWriterKeys(std::set<JSONCPP_STRING>* valid_keys)\n{\n  valid_keys->clear();\n  valid_keys->insert(\"indentation\");\n  valid_keys->insert(\"commentStyle\");\n  valid_keys->insert(\"enableYAMLCompatibility\");\n  valid_keys->insert(\"dropNullPlaceholders\");\n  valid_keys->insert(\"useSpecialFloats\");\n  valid_keys->insert(\"precision\");\n}\nbool StreamWriterBuilder::validate(Json::Value* invalid) const\n{\n  Json::Value my_invalid;\n  if (!invalid) invalid = &my_invalid;  // so we do not need to test for NULL\n  Json::Value& inv = *invalid;\n  std::set<JSONCPP_STRING> valid_keys;\n  getValidWriterKeys(&valid_keys);\n  Value::Members keys = settings_.getMemberNames();\n  size_t n = keys.size();\n  for (size_t i = 0; i < n; ++i) {\n    JSONCPP_STRING const& key = keys[i];\n    if (valid_keys.find(key) == valid_keys.end()) {\n      inv[key] = settings_[key];\n    }\n  }\n  return 0u == inv.size();\n}\nValue& StreamWriterBuilder::operator[](JSONCPP_STRING key)\n{\n  return settings_[key];\n}\n// static\nvoid StreamWriterBuilder::setDefaults(Json::Value* settings)\n{\n  //! [StreamWriterBuilderDefaults]\n  (*settings)[\"commentStyle\"] = \"All\";\n  (*settings)[\"indentation\"] = \"\\t\";\n  (*settings)[\"enableYAMLCompatibility\"] = false;\n  (*settings)[\"dropNullPlaceholders\"] = false;\n  (*settings)[\"useSpecialFloats\"] = false;\n  (*settings)[\"precision\"] = 17;\n  //! [StreamWriterBuilderDefaults]\n}\n\nJSONCPP_STRING writeString(StreamWriter::Factory const& builder, Value const& root) {\n  JSONCPP_OSTRINGSTREAM sout;\n  StreamWriterPtr const writer(builder.newStreamWriter());\n  writer->write(root, &sout);\n  return sout.str();\n}\n\nJSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM& sout, Value const& root) {\n  StreamWriterBuilder builder;\n  StreamWriterPtr const writer(builder.newStreamWriter());\n  writer->write(root, &sout);\n  return sout;\n}\n\n} // namespace Json\n}\n}\n// //////////////////////////////////////////////////////////////////////\n// End of content of file: src/lib_json/json_writer.cpp\n// //////////////////////////////////////////////////////////////////////\n\n\n\n\n\n"
  },
  {
    "path": "sdk/src/external/tinyxml2/tinyxml2.cpp",
    "content": "/*\nOriginal code by Lee Thomason (www.grinninglizard.com)\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any\ndamages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any\npurpose, including commercial applications, and to alter it and\nredistribute it freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must\nnot claim that you wrote the original software. If you use this\nsoftware in a product, an acknowledgment in the product documentation\nwould be appreciated but is not required.\n\n2. Altered source versions must be plainly marked as such, and\nmust not be misrepresented as being the original software.\n\n3. This notice may not be removed or altered from any source\ndistribution.\n*/\n\n#include <tinyxml2/tinyxml2.h>\n\n#include <new>\t\t// yes, this one new style header, is in the Android SDK.\n#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__)\n#   include <stddef.h>\n#   include <stdarg.h>\n#else\n#   include <cstddef>\n#   include <cstdarg>\n#endif\n\n#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE)\n\t// Microsoft Visual Studio, version 2005 and higher. Not WinCE.\n\t/*int _snprintf_s(\n\t   char *buffer,\n\t   size_t sizeOfBuffer,\n\t   size_t count,\n\t   const char *format [,\n\t\t  argument] ...\n\t);*/\n\tstatic inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )\n\t{\n\t\tva_list va;\n\t\tva_start( va, format );\n\t\tint result = vsnprintf_s( buffer, size, _TRUNCATE, format, va );\n\t\tva_end( va );\n\t\treturn result;\n\t}\n\n\tstatic inline int TIXML_VSNPRINTF( char* buffer, size_t size, const char* format, va_list va )\n\t{\n\t\tint result = vsnprintf_s( buffer, size, _TRUNCATE, format, va );\n\t\treturn result;\n\t}\n\n\t#define TIXML_VSCPRINTF\t_vscprintf\n\t#define TIXML_SSCANF\tsscanf_s\n#elif defined _MSC_VER\n\t// Microsoft Visual Studio 2003 and earlier or WinCE\n\t#define TIXML_SNPRINTF\t_snprintf\n\t#define TIXML_VSNPRINTF _vsnprintf\n\t#define TIXML_SSCANF\tsscanf\n\t#if (_MSC_VER < 1400 ) && (!defined WINCE)\n\t\t// Microsoft Visual Studio 2003 and not WinCE.\n\t\t#define TIXML_VSCPRINTF   _vscprintf // VS2003's C runtime has this, but VC6 C runtime or WinCE SDK doesn't have.\n\t#else\n\t\t// Microsoft Visual Studio 2003 and earlier or WinCE.\n\t\tstatic inline int TIXML_VSCPRINTF( const char* format, va_list va )\n\t\t{\n\t\t\tint len = 512;\n\t\t\tfor (;;) {\n\t\t\t\tlen = len*2;\n\t\t\t\tchar* str = new char[len]();\n\t\t\t\tconst int required = _vsnprintf(str, len, format, va);\n\t\t\t\tdelete[] str;\n\t\t\t\tif ( required != -1 ) {\n\t\t\t\t\tTIXMLASSERT( required >= 0 );\n\t\t\t\t\tlen = required;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tTIXMLASSERT( len >= 0 );\n\t\t\treturn len;\n\t\t}\n\t#endif\n#else\n\t// GCC version 3 and higher\n\t//#warning( \"Using sn* functions.\" )\n\t#define TIXML_SNPRINTF\tsnprintf\n\t#define TIXML_VSNPRINTF\tvsnprintf\n\tstatic inline int TIXML_VSCPRINTF( const char* format, va_list va )\n\t{\n\t\tint len = vsnprintf( 0, 0, format, va );\n\t\tTIXMLASSERT( len >= 0 );\n\t\treturn len;\n\t}\n\t#define TIXML_SSCANF   sscanf\n#endif\n\n\nstatic const char LINE_FEED\t\t\t\t= (char)0x0a;\t\t\t// all line endings are normalized to LF\nstatic const char LF = LINE_FEED;\nstatic const char CARRIAGE_RETURN\t\t= (char)0x0d;\t\t\t// CR gets filtered out\nstatic const char CR = CARRIAGE_RETURN;\nstatic const char SINGLE_QUOTE\t\t\t= '\\'';\nstatic const char DOUBLE_QUOTE\t\t\t= '\\\"';\n\n// Bunch of unicode info at:\n//\t\thttp://www.unicode.org/faq/utf_bom.html\n//\tef bb bf (Microsoft \"lead bytes\") - designates UTF-8\n\nstatic const unsigned char TIXML_UTF_LEAD_0 = 0xefU;\nstatic const unsigned char TIXML_UTF_LEAD_1 = 0xbbU;\nstatic const unsigned char TIXML_UTF_LEAD_2 = 0xbfU;\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\nnamespace tinyxml2\n{\n\nstruct Entity {\n    const char* pattern;\n    int length;\n    char value;\n};\n\nstatic const int NUM_ENTITIES = 5;\nstatic const Entity entities[NUM_ENTITIES] = {\n    { \"quot\", 4,\tDOUBLE_QUOTE },\n    { \"amp\", 3,\t\t'&'  },\n    { \"apos\", 4,\tSINGLE_QUOTE },\n    { \"lt\",\t2, \t\t'<'\t },\n    { \"gt\",\t2,\t\t'>'\t }\n};\n\n\nStrPair::~StrPair()\n{\n    Reset();\n}\n\n\nvoid StrPair::TransferTo( StrPair* other )\n{\n    if ( this == other ) {\n        return;\n    }\n    // This in effect implements the assignment operator by \"moving\"\n    // ownership (as in auto_ptr).\n\n    TIXMLASSERT( other != 0 );\n    TIXMLASSERT( other->_flags == 0 );\n    TIXMLASSERT( other->_start == 0 );\n    TIXMLASSERT( other->_end == 0 );\n\n    other->Reset();\n\n    other->_flags = _flags;\n    other->_start = _start;\n    other->_end = _end;\n\n    _flags = 0;\n    _start = 0;\n    _end = 0;\n}\n\n\nvoid StrPair::Reset()\n{\n    if ( _flags & NEEDS_DELETE ) {\n        delete [] _start;\n    }\n    _flags = 0;\n    _start = 0;\n    _end = 0;\n}\n\n\nvoid StrPair::SetStr( const char* str, int flags )\n{\n    TIXMLASSERT( str );\n    Reset();\n    size_t len = strlen( str );\n    TIXMLASSERT( _start == 0 );\n    _start = new char[ len+1 ];\n    memcpy( _start, str, len+1 );\n    _end = _start + len;\n    _flags = flags | NEEDS_DELETE;\n}\n\n\nchar* StrPair::ParseText( char* p, const char* endTag, int strFlags, int* curLineNumPtr )\n{\n    TIXMLASSERT( p );\n    TIXMLASSERT( endTag && *endTag );\n\tTIXMLASSERT(curLineNumPtr);\n\n    char* start = p;\n    char  endChar = *endTag;\n    size_t length = strlen( endTag );\n\n    // Inner loop of text parsing.\n    while ( *p ) {\n        if ( *p == endChar && strncmp( p, endTag, length ) == 0 ) {\n            Set( start, p, strFlags );\n            return p + length;\n        } else if (*p == '\\n') {\n            ++(*curLineNumPtr);\n        }\n        ++p;\n        TIXMLASSERT( p );\n    }\n    return 0;\n}\n\n\nchar* StrPair::ParseName( char* p )\n{\n    if ( !p || !(*p) ) {\n        return 0;\n    }\n    if ( !XMLUtil::IsNameStartChar( *p ) ) {\n        return 0;\n    }\n\n    char* const start = p;\n    ++p;\n    while ( *p && XMLUtil::IsNameChar( *p ) ) {\n        ++p;\n    }\n\n    Set( start, p, 0 );\n    return p;\n}\n\n\nvoid StrPair::CollapseWhitespace()\n{\n    // Adjusting _start would cause undefined behavior on delete[]\n    TIXMLASSERT( ( _flags & NEEDS_DELETE ) == 0 );\n    // Trim leading space.\n    _start = XMLUtil::SkipWhiteSpace( _start, 0 );\n\n    if ( *_start ) {\n        const char* p = _start;\t// the read pointer\n        char* q = _start;\t// the write pointer\n\n        while( *p ) {\n            if ( XMLUtil::IsWhiteSpace( *p )) {\n                p = XMLUtil::SkipWhiteSpace( p, 0 );\n                if ( *p == 0 ) {\n                    break;    // don't write to q; this trims the trailing space.\n                }\n                *q = ' ';\n                ++q;\n            }\n            *q = *p;\n            ++q;\n            ++p;\n        }\n        *q = 0;\n    }\n}\n\n\nconst char* StrPair::GetStr()\n{\n    TIXMLASSERT( _start );\n    TIXMLASSERT( _end );\n    if ( _flags & NEEDS_FLUSH ) {\n        *_end = 0;\n        _flags ^= NEEDS_FLUSH;\n\n        if ( _flags ) {\n            const char* p = _start;\t// the read pointer\n            char* q = _start;\t// the write pointer\n\n            while( p < _end ) {\n                if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == CR ) {\n                    // CR-LF pair becomes LF\n                    // CR alone becomes LF\n                    // LF-CR becomes LF\n                    if ( *(p+1) == LF ) {\n                        p += 2;\n                    }\n                    else {\n                        ++p;\n                    }\n                    *q = LF;\n                    ++q;\n                }\n                else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) {\n                    if ( *(p+1) == CR ) {\n                        p += 2;\n                    }\n                    else {\n                        ++p;\n                    }\n                    *q = LF;\n                    ++q;\n                }\n                else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) {\n                    // Entities handled by tinyXML2:\n                    // - special entities in the entity table [in/out]\n                    // - numeric character reference [in]\n                    //   &#20013; or &#x4e2d;\n\n                    if ( *(p+1) == '#' ) {\n                        const int buflen = 10;\n                        char buf[buflen] = { 0 };\n                        int len = 0;\n                        char* adjusted = const_cast<char*>( XMLUtil::GetCharacterRef( p, buf, &len ) );\n                        if ( adjusted == 0 ) {\n                            *q = *p;\n                            ++p;\n                            ++q;\n                        }\n                        else {\n                            TIXMLASSERT( 0 <= len && len <= buflen );\n                            TIXMLASSERT( q + len <= adjusted );\n                            p = adjusted;\n                            memcpy( q, buf, len );\n                            q += len;\n                        }\n                    }\n                    else {\n                        bool entityFound = false;\n                        for( int i = 0; i < NUM_ENTITIES; ++i ) {\n                            const Entity& entity = entities[i];\n                            if ( strncmp( p + 1, entity.pattern, entity.length ) == 0\n                                    && *( p + entity.length + 1 ) == ';' ) {\n                                // Found an entity - convert.\n                                *q = entity.value;\n                                ++q;\n                                p += entity.length + 2;\n                                entityFound = true;\n                                break;\n                            }\n                        }\n                        if ( !entityFound ) {\n                            // fixme: treat as error?\n                            ++p;\n                            ++q;\n                        }\n                    }\n                }\n                else {\n                    *q = *p;\n                    ++p;\n                    ++q;\n                }\n            }\n            *q = 0;\n        }\n        // The loop below has plenty going on, and this\n        // is a less useful mode. Break it out.\n        if ( _flags & NEEDS_WHITESPACE_COLLAPSING ) {\n            CollapseWhitespace();\n        }\n        _flags = (_flags & NEEDS_DELETE);\n    }\n    TIXMLASSERT( _start );\n    return _start;\n}\n\n\n\n\n// --------- XMLUtil ----------- //\n\nconst char* XMLUtil::writeBoolTrue  = \"true\";\nconst char* XMLUtil::writeBoolFalse = \"false\";\n\nvoid XMLUtil::SetBoolSerialization(const char* writeTrue, const char* writeFalse)\n{\n\tstatic const char* defTrue  = \"true\";\n\tstatic const char* defFalse = \"false\";\n\n\twriteBoolTrue = (writeTrue) ? writeTrue : defTrue;\n\twriteBoolFalse = (writeFalse) ? writeFalse : defFalse;\n}\n\n\nconst char* XMLUtil::ReadBOM( const char* p, bool* bom )\n{\n    TIXMLASSERT( p );\n    TIXMLASSERT( bom );\n    *bom = false;\n    const unsigned char* pu = reinterpret_cast<const unsigned char*>(p);\n    // Check for BOM:\n    if (    *(pu+0) == TIXML_UTF_LEAD_0\n            && *(pu+1) == TIXML_UTF_LEAD_1\n            && *(pu+2) == TIXML_UTF_LEAD_2 ) {\n        *bom = true;\n        p += 3;\n    }\n    TIXMLASSERT( p );\n    return p;\n}\n\n\nvoid XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length )\n{\n    const unsigned long BYTE_MASK = 0xBF;\n    const unsigned long BYTE_MARK = 0x80;\n    const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };\n\n    if (input < 0x80) {\n        *length = 1;\n    }\n    else if ( input < 0x800 ) {\n        *length = 2;\n    }\n    else if ( input < 0x10000 ) {\n        *length = 3;\n    }\n    else if ( input < 0x200000 ) {\n        *length = 4;\n    }\n    else {\n        *length = 0;    // This code won't convert this correctly anyway.\n        return;\n    }\n\n    output += *length;\n\n    // Scary scary fall throughs are annotated with carefully designed comments\n    // to suppress compiler warnings such as -Wimplicit-fallthrough in gcc\n    switch (*length) {\n        case 4:\n            --output;\n            *output = (char)((input | BYTE_MARK) & BYTE_MASK);\n            input >>= 6;\n            //fall through\n        case 3:\n            --output;\n            *output = (char)((input | BYTE_MARK) & BYTE_MASK);\n            input >>= 6;\n            //fall through\n        case 2:\n            --output;\n            *output = (char)((input | BYTE_MARK) & BYTE_MASK);\n            input >>= 6;\n            //fall through\n        case 1:\n            --output;\n            *output = (char)(input | FIRST_BYTE_MARK[*length]);\n            break;\n        default:\n            TIXMLASSERT( false );\n    }\n}\n\n\nconst char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length )\n{\n    // Presume an entity, and pull it out.\n    *length = 0;\n\n    if ( *(p+1) == '#' && *(p+2) ) {\n        unsigned long ucs = 0;\n        TIXMLASSERT( sizeof( ucs ) >= 4 );\n        ptrdiff_t delta = 0;\n        unsigned mult = 1;\n        static const char SEMICOLON = ';';\n\n        if ( *(p+2) == 'x' ) {\n            // Hexadecimal.\n            const char* q = p+3;\n            if ( !(*q) ) {\n                return 0;\n            }\n\n            q = strchr( q, SEMICOLON );\n\n            if ( !q ) {\n                return 0;\n            }\n            TIXMLASSERT( *q == SEMICOLON );\n\n            delta = q-p;\n            --q;\n\n            while ( *q != 'x' ) {\n                unsigned int digit = 0;\n\n                if ( *q >= '0' && *q <= '9' ) {\n                    digit = *q - '0';\n                }\n                else if ( *q >= 'a' && *q <= 'f' ) {\n                    digit = *q - 'a' + 10;\n                }\n                else if ( *q >= 'A' && *q <= 'F' ) {\n                    digit = *q - 'A' + 10;\n                }\n                else {\n                    return 0;\n                }\n                TIXMLASSERT( digit < 16 );\n                TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit );\n                const unsigned int digitScaled = mult * digit;\n                TIXMLASSERT( ucs <= ULONG_MAX - digitScaled );\n                ucs += digitScaled;\n                TIXMLASSERT( mult <= UINT_MAX / 16 );\n                mult *= 16;\n                --q;\n            }\n        }\n        else {\n            // Decimal.\n            const char* q = p+2;\n            if ( !(*q) ) {\n                return 0;\n            }\n\n            q = strchr( q, SEMICOLON );\n\n            if ( !q ) {\n                return 0;\n            }\n            TIXMLASSERT( *q == SEMICOLON );\n\n            delta = q-p;\n            --q;\n\n            while ( *q != '#' ) {\n                if ( *q >= '0' && *q <= '9' ) {\n                    const unsigned int digit = *q - '0';\n                    TIXMLASSERT( digit < 10 );\n                    TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit );\n                    const unsigned int digitScaled = mult * digit;\n                    TIXMLASSERT( ucs <= ULONG_MAX - digitScaled );\n                    ucs += digitScaled;\n                }\n                else {\n                    return 0;\n                }\n                TIXMLASSERT( mult <= UINT_MAX / 10 );\n                mult *= 10;\n                --q;\n            }\n        }\n        // convert the UCS to UTF-8\n        ConvertUTF32ToUTF8( ucs, value, length );\n        return p + delta + 1;\n    }\n    return p+1;\n}\n\n\nvoid XMLUtil::ToStr( int v, char* buffer, int bufferSize )\n{\n    TIXML_SNPRINTF( buffer, bufferSize, \"%d\", v );\n}\n\n\nvoid XMLUtil::ToStr( unsigned v, char* buffer, int bufferSize )\n{\n    TIXML_SNPRINTF( buffer, bufferSize, \"%u\", v );\n}\n\n\nvoid XMLUtil::ToStr( bool v, char* buffer, int bufferSize )\n{\n    TIXML_SNPRINTF( buffer, bufferSize, \"%s\", v ? writeBoolTrue : writeBoolFalse);\n}\n\n/*\n\tToStr() of a number is a very tricky topic.\n\thttps://github.com/leethomason/tinyxml2/issues/106\n*/\nvoid XMLUtil::ToStr( float v, char* buffer, int bufferSize )\n{\n    TIXML_SNPRINTF( buffer, bufferSize, \"%.8g\", v );\n}\n\n\nvoid XMLUtil::ToStr( double v, char* buffer, int bufferSize )\n{\n    TIXML_SNPRINTF( buffer, bufferSize, \"%.17g\", v );\n}\n\n\nvoid XMLUtil::ToStr(int64_t v, char* buffer, int bufferSize)\n{\n\t// horrible syntax trick to make the compiler happy about %lld\n\tTIXML_SNPRINTF(buffer, bufferSize, \"%lld\", (long long)v);\n}\n\n\nbool XMLUtil::ToInt( const char* str, int* value )\n{\n    if ( TIXML_SSCANF( str, \"%d\", value ) == 1 ) {\n        return true;\n    }\n    return false;\n}\n\nbool XMLUtil::ToUnsigned( const char* str, unsigned *value )\n{\n    if ( TIXML_SSCANF( str, \"%u\", value ) == 1 ) {\n        return true;\n    }\n    return false;\n}\n\nbool XMLUtil::ToBool( const char* str, bool* value )\n{\n    int ival = 0;\n    if ( ToInt( str, &ival )) {\n        *value = (ival==0) ? false : true;\n        return true;\n    }\n    if ( StringEqual( str, \"true\" ) ) {\n        *value = true;\n        return true;\n    }\n    else if ( StringEqual( str, \"false\" ) ) {\n        *value = false;\n        return true;\n    }\n    return false;\n}\n\n\nbool XMLUtil::ToFloat( const char* str, float* value )\n{\n    if ( TIXML_SSCANF( str, \"%f\", value ) == 1 ) {\n        return true;\n    }\n    return false;\n}\n\n\nbool XMLUtil::ToDouble( const char* str, double* value )\n{\n    if ( TIXML_SSCANF( str, \"%lf\", value ) == 1 ) {\n        return true;\n    }\n    return false;\n}\n\n\nbool XMLUtil::ToInt64(const char* str, int64_t* value)\n{\n\tlong long v = 0;\t// horrible syntax trick to make the compiler happy about %lld\n\tif (TIXML_SSCANF(str, \"%lld\", &v) == 1) {\n\t\t*value = (int64_t)v;\n\t\treturn true;\n\t}\n\treturn false;\n}\n\n\nchar* XMLDocument::Identify( char* p, XMLNode** node )\n{\n    TIXMLASSERT( node );\n    TIXMLASSERT( p );\n    char* const start = p;\n    int const startLine = _parseCurLineNum;\n    p = XMLUtil::SkipWhiteSpace( p, &_parseCurLineNum );\n    if( !*p ) {\n        *node = 0;\n        TIXMLASSERT( p );\n        return p;\n    }\n\n    // These strings define the matching patterns:\n    static const char* xmlHeader\t\t= { \"<?\" };\n    static const char* commentHeader\t= { \"<!--\" };\n    static const char* cdataHeader\t\t= { \"<![CDATA[\" };\n    static const char* dtdHeader\t\t= { \"<!\" };\n    static const char* elementHeader\t= { \"<\" };\t// and a header for everything else; check last.\n\n    static const int xmlHeaderLen\t\t= 2;\n    static const int commentHeaderLen\t= 4;\n    static const int cdataHeaderLen\t\t= 9;\n    static const int dtdHeaderLen\t\t= 2;\n    static const int elementHeaderLen\t= 1;\n\n    TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLUnknown ) );\t\t// use same memory pool\n    TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLDeclaration ) );\t// use same memory pool\n    XMLNode* returnNode = 0;\n    if ( XMLUtil::StringEqual( p, xmlHeader, xmlHeaderLen ) ) {\n        returnNode = CreateUnlinkedNode<XMLDeclaration>( _commentPool );\n        returnNode->_parseLineNum = _parseCurLineNum;\n        p += xmlHeaderLen;\n    }\n    else if ( XMLUtil::StringEqual( p, commentHeader, commentHeaderLen ) ) {\n        returnNode = CreateUnlinkedNode<XMLComment>( _commentPool );\n        returnNode->_parseLineNum = _parseCurLineNum;\n        p += commentHeaderLen;\n    }\n    else if ( XMLUtil::StringEqual( p, cdataHeader, cdataHeaderLen ) ) {\n        XMLText* text = CreateUnlinkedNode<XMLText>( _textPool );\n        returnNode = text;\n        returnNode->_parseLineNum = _parseCurLineNum;\n        p += cdataHeaderLen;\n        text->SetCData( true );\n    }\n    else if ( XMLUtil::StringEqual( p, dtdHeader, dtdHeaderLen ) ) {\n        returnNode = CreateUnlinkedNode<XMLUnknown>( _commentPool );\n        returnNode->_parseLineNum = _parseCurLineNum;\n        p += dtdHeaderLen;\n    }\n    else if ( XMLUtil::StringEqual( p, elementHeader, elementHeaderLen ) ) {\n        returnNode =  CreateUnlinkedNode<XMLElement>( _elementPool );\n        returnNode->_parseLineNum = _parseCurLineNum;\n        p += elementHeaderLen;\n    }\n    else {\n        returnNode = CreateUnlinkedNode<XMLText>( _textPool );\n        returnNode->_parseLineNum = _parseCurLineNum; // Report line of first non-whitespace character\n        p = start;\t// Back it up, all the text counts.\n        _parseCurLineNum = startLine;\n    }\n\n    TIXMLASSERT( returnNode );\n    TIXMLASSERT( p );\n    *node = returnNode;\n    return p;\n}\n\n\nbool XMLDocument::Accept( XMLVisitor* visitor ) const\n{\n    TIXMLASSERT( visitor );\n    if ( visitor->VisitEnter( *this ) ) {\n        for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) {\n            if ( !node->Accept( visitor ) ) {\n                break;\n            }\n        }\n    }\n    return visitor->VisitExit( *this );\n}\n\n\n// --------- XMLNode ----------- //\n\nXMLNode::XMLNode( XMLDocument* doc ) :\n    _document( doc ),\n    _parent( 0 ),\n    _value(),\n    _parseLineNum( 0 ),\n    _firstChild( 0 ), _lastChild( 0 ),\n    _prev( 0 ), _next( 0 ),\n\t_userData( 0 ),\n    _memPool( 0 )\n{\n}\n\n\nXMLNode::~XMLNode()\n{\n    DeleteChildren();\n    if ( _parent ) {\n        _parent->Unlink( this );\n    }\n}\n\nconst char* XMLNode::Value() const\n{\n    // Edge case: XMLDocuments don't have a Value. Return null.\n    if ( this->ToDocument() )\n        return 0;\n    return _value.GetStr();\n}\n\nvoid XMLNode::SetValue( const char* str, bool staticMem )\n{\n    if ( staticMem ) {\n        _value.SetInternedStr( str );\n    }\n    else {\n        _value.SetStr( str );\n    }\n}\n\nXMLNode* XMLNode::DeepClone(XMLDocument* target) const\n{\n\tXMLNode* clone = this->ShallowClone(target);\n\tif (!clone) return 0;\n\n\tfor (const XMLNode* child = this->FirstChild(); child; child = child->NextSibling()) {\n\t\tXMLNode* childClone = child->DeepClone(target);\n\t\tTIXMLASSERT(childClone);\n\t\tclone->InsertEndChild(childClone);\n\t}\n\treturn clone;\n}\n\nvoid XMLNode::DeleteChildren()\n{\n    while( _firstChild ) {\n        TIXMLASSERT( _lastChild );\n        DeleteChild( _firstChild );\n    }\n    _firstChild = _lastChild = 0;\n}\n\n\nvoid XMLNode::Unlink( XMLNode* child )\n{\n    TIXMLASSERT( child );\n    TIXMLASSERT( child->_document == _document );\n    TIXMLASSERT( child->_parent == this );\n    if ( child == _firstChild ) {\n        _firstChild = _firstChild->_next;\n    }\n    if ( child == _lastChild ) {\n        _lastChild = _lastChild->_prev;\n    }\n\n    if ( child->_prev ) {\n        child->_prev->_next = child->_next;\n    }\n    if ( child->_next ) {\n        child->_next->_prev = child->_prev;\n    }\n\tchild->_next = 0;\n\tchild->_prev = 0;\n\tchild->_parent = 0;\n}\n\n\nvoid XMLNode::DeleteChild( XMLNode* node )\n{\n    TIXMLASSERT( node );\n    TIXMLASSERT( node->_document == _document );\n    TIXMLASSERT( node->_parent == this );\n    Unlink( node );\n\tTIXMLASSERT(node->_prev == 0);\n\tTIXMLASSERT(node->_next == 0);\n\tTIXMLASSERT(node->_parent == 0);\n    DeleteNode( node );\n}\n\n\nXMLNode* XMLNode::InsertEndChild( XMLNode* addThis )\n{\n    TIXMLASSERT( addThis );\n    if ( addThis->_document != _document ) {\n        TIXMLASSERT( false );\n        return 0;\n    }\n    InsertChildPreamble( addThis );\n\n    if ( _lastChild ) {\n        TIXMLASSERT( _firstChild );\n        TIXMLASSERT( _lastChild->_next == 0 );\n        _lastChild->_next = addThis;\n        addThis->_prev = _lastChild;\n        _lastChild = addThis;\n\n        addThis->_next = 0;\n    }\n    else {\n        TIXMLASSERT( _firstChild == 0 );\n        _firstChild = _lastChild = addThis;\n\n        addThis->_prev = 0;\n        addThis->_next = 0;\n    }\n    addThis->_parent = this;\n    return addThis;\n}\n\n\nXMLNode* XMLNode::InsertFirstChild( XMLNode* addThis )\n{\n    TIXMLASSERT( addThis );\n    if ( addThis->_document != _document ) {\n        TIXMLASSERT( false );\n        return 0;\n    }\n    InsertChildPreamble( addThis );\n\n    if ( _firstChild ) {\n        TIXMLASSERT( _lastChild );\n        TIXMLASSERT( _firstChild->_prev == 0 );\n\n        _firstChild->_prev = addThis;\n        addThis->_next = _firstChild;\n        _firstChild = addThis;\n\n        addThis->_prev = 0;\n    }\n    else {\n        TIXMLASSERT( _lastChild == 0 );\n        _firstChild = _lastChild = addThis;\n\n        addThis->_prev = 0;\n        addThis->_next = 0;\n    }\n    addThis->_parent = this;\n    return addThis;\n}\n\n\nXMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis )\n{\n    TIXMLASSERT( addThis );\n    if ( addThis->_document != _document ) {\n        TIXMLASSERT( false );\n        return 0;\n    }\n\n    TIXMLASSERT( afterThis );\n\n    if ( afterThis->_parent != this ) {\n        TIXMLASSERT( false );\n        return 0;\n    }\n    if ( afterThis == addThis ) {\n        // Current state: BeforeThis -> AddThis -> OneAfterAddThis\n        // Now AddThis must disappear from it's location and then\n        // reappear between BeforeThis and OneAfterAddThis.\n        // So just leave it where it is.\n        return addThis;\n    }\n\n    if ( afterThis->_next == 0 ) {\n        // The last node or the only node.\n        return InsertEndChild( addThis );\n    }\n    InsertChildPreamble( addThis );\n    addThis->_prev = afterThis;\n    addThis->_next = afterThis->_next;\n    afterThis->_next->_prev = addThis;\n    afterThis->_next = addThis;\n    addThis->_parent = this;\n    return addThis;\n}\n\n\n\n\nconst XMLElement* XMLNode::FirstChildElement( const char* name ) const\n{\n    for( const XMLNode* node = _firstChild; node; node = node->_next ) {\n        const XMLElement* element = node->ToElementWithName( name );\n        if ( element ) {\n            return element;\n        }\n    }\n    return 0;\n}\n\n\nconst XMLElement* XMLNode::LastChildElement( const char* name ) const\n{\n    for( const XMLNode* node = _lastChild; node; node = node->_prev ) {\n        const XMLElement* element = node->ToElementWithName( name );\n        if ( element ) {\n            return element;\n        }\n    }\n    return 0;\n}\n\n\nconst XMLElement* XMLNode::NextSiblingElement( const char* name ) const\n{\n    for( const XMLNode* node = _next; node; node = node->_next ) {\n        const XMLElement* element = node->ToElementWithName( name );\n        if ( element ) {\n            return element;\n        }\n    }\n    return 0;\n}\n\n\nconst XMLElement* XMLNode::PreviousSiblingElement( const char* name ) const\n{\n    for( const XMLNode* node = _prev; node; node = node->_prev ) {\n        const XMLElement* element = node->ToElementWithName( name );\n        if ( element ) {\n            return element;\n        }\n    }\n    return 0;\n}\n\n\nchar* XMLNode::ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr )\n{\n    // This is a recursive method, but thinking about it \"at the current level\"\n    // it is a pretty simple flat list:\n    //\t\t<foo/>\n    //\t\t<!-- comment -->\n    //\n    // With a special case:\n    //\t\t<foo>\n    //\t\t</foo>\n    //\t\t<!-- comment -->\n    //\n    // Where the closing element (/foo) *must* be the next thing after the opening\n    // element, and the names must match. BUT the tricky bit is that the closing\n    // element will be read by the child.\n    //\n    // 'endTag' is the end tag for this node, it is returned by a call to a child.\n    // 'parentEnd' is the end tag for the parent, which is filled in and returned.\n\n\tXMLDocument::DepthTracker tracker(_document);\n\tif (_document->Error())\n\t\treturn 0;\n\n\twhile( p && *p ) {\n        XMLNode* node = 0;\n\n        p = _document->Identify( p, &node );\n        TIXMLASSERT( p );\n        if ( node == 0 ) {\n            break;\n        }\n\n        int initialLineNum = node->_parseLineNum;\n\n        StrPair endTag;\n        p = node->ParseDeep( p, &endTag, curLineNumPtr );\n        if ( !p ) {\n            DeleteNode( node );\n            if ( !_document->Error() ) {\n                _document->SetError( XML_ERROR_PARSING, initialLineNum, 0);\n            }\n            break;\n        }\n\n        XMLDeclaration* decl = node->ToDeclaration();\n        if ( decl ) {\n            // Declarations are only allowed at document level\n            bool wellLocated = ( ToDocument() != 0 );\n            if ( wellLocated ) {\n                // Multiple declarations are allowed but all declarations\n                // must occur before anything else\n                for ( const XMLNode* existingNode = _document->FirstChild(); existingNode; existingNode = existingNode->NextSibling() ) {\n                    if ( !existingNode->ToDeclaration() ) {\n                        wellLocated = false;\n                        break;\n                    }\n                }\n            }\n            if ( !wellLocated ) {\n                _document->SetError( XML_ERROR_PARSING_DECLARATION, initialLineNum, \"XMLDeclaration value=%s\", decl->Value());\n                DeleteNode( node );\n                break;\n            }\n        }\n\n        XMLElement* ele = node->ToElement();\n        if ( ele ) {\n            // We read the end tag. Return it to the parent.\n            if ( ele->ClosingType() == XMLElement::CLOSING ) {\n                if ( parentEndTag ) {\n                    ele->_value.TransferTo( parentEndTag );\n                }\n                node->_memPool->SetTracked();   // created and then immediately deleted.\n                DeleteNode( node );\n                return p;\n            }\n\n            // Handle an end tag returned to this level.\n            // And handle a bunch of annoying errors.\n            bool mismatch = false;\n            if ( endTag.Empty() ) {\n                if ( ele->ClosingType() == XMLElement::OPEN ) {\n                    mismatch = true;\n                }\n            }\n            else {\n                if ( ele->ClosingType() != XMLElement::OPEN ) {\n                    mismatch = true;\n                }\n                else if ( !XMLUtil::StringEqual( endTag.GetStr(), ele->Name() ) ) {\n                    mismatch = true;\n                }\n            }\n            if ( mismatch ) {\n                _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, initialLineNum, \"XMLElement name=%s\", ele->Name());\n                DeleteNode( node );\n                break;\n            }\n        }\n        InsertEndChild( node );\n    }\n    return 0;\n}\n\n/*static*/ void XMLNode::DeleteNode( XMLNode* node )\n{\n    if ( node == 0 ) {\n        return;\n    }\n\tTIXMLASSERT(node->_document);\n\tif (!node->ToDocument()) {\n\t\tnode->_document->MarkInUse(node);\n\t}\n\n    MemPool* pool = node->_memPool;\n    node->~XMLNode();\n    pool->Free( node );\n}\n\nvoid XMLNode::InsertChildPreamble( XMLNode* insertThis ) const\n{\n    TIXMLASSERT( insertThis );\n    TIXMLASSERT( insertThis->_document == _document );\n\n\tif (insertThis->_parent) {\n        insertThis->_parent->Unlink( insertThis );\n\t}\n\telse {\n\t\tinsertThis->_document->MarkInUse(insertThis);\n        insertThis->_memPool->SetTracked();\n\t}\n}\n\nconst XMLElement* XMLNode::ToElementWithName( const char* name ) const\n{\n    const XMLElement* element = this->ToElement();\n    if ( element == 0 ) {\n        return 0;\n    }\n    if ( name == 0 ) {\n        return element;\n    }\n    if ( XMLUtil::StringEqual( element->Name(), name ) ) {\n       return element;\n    }\n    return 0;\n}\n\n// --------- XMLText ---------- //\nchar* XMLText::ParseDeep( char* p, StrPair*, int* curLineNumPtr )\n{\n    if ( this->CData() ) {\n        p = _value.ParseText( p, \"]]>\", StrPair::NEEDS_NEWLINE_NORMALIZATION, curLineNumPtr );\n        if ( !p ) {\n            _document->SetError( XML_ERROR_PARSING_CDATA, _parseLineNum, 0 );\n        }\n        return p;\n    }\n    else {\n        int flags = _document->ProcessEntities() ? StrPair::TEXT_ELEMENT : StrPair::TEXT_ELEMENT_LEAVE_ENTITIES;\n        if ( _document->WhitespaceMode() == COLLAPSE_WHITESPACE ) {\n            flags |= StrPair::NEEDS_WHITESPACE_COLLAPSING;\n        }\n\n        p = _value.ParseText( p, \"<\", flags, curLineNumPtr );\n        if ( p && *p ) {\n            return p-1;\n        }\n        if ( !p ) {\n            _document->SetError( XML_ERROR_PARSING_TEXT, _parseLineNum, 0 );\n        }\n    }\n    return 0;\n}\n\n\nXMLNode* XMLText::ShallowClone( XMLDocument* doc ) const\n{\n    if ( !doc ) {\n        doc = _document;\n    }\n    XMLText* text = doc->NewText( Value() );\t// fixme: this will always allocate memory. Intern?\n    text->SetCData( this->CData() );\n    return text;\n}\n\n\nbool XMLText::ShallowEqual( const XMLNode* compare ) const\n{\n    TIXMLASSERT( compare );\n    const XMLText* text = compare->ToText();\n    return ( text && XMLUtil::StringEqual( text->Value(), Value() ) );\n}\n\n\nbool XMLText::Accept( XMLVisitor* visitor ) const\n{\n    TIXMLASSERT( visitor );\n    return visitor->Visit( *this );\n}\n\n\n// --------- XMLComment ---------- //\n\nXMLComment::XMLComment( XMLDocument* doc ) : XMLNode( doc )\n{\n}\n\n\nXMLComment::~XMLComment()\n{\n}\n\n\nchar* XMLComment::ParseDeep( char* p, StrPair*, int* curLineNumPtr )\n{\n    // Comment parses as text.\n    p = _value.ParseText( p, \"-->\", StrPair::COMMENT, curLineNumPtr );\n    if ( p == 0 ) {\n        _document->SetError( XML_ERROR_PARSING_COMMENT, _parseLineNum, 0 );\n    }\n    return p;\n}\n\n\nXMLNode* XMLComment::ShallowClone( XMLDocument* doc ) const\n{\n    if ( !doc ) {\n        doc = _document;\n    }\n    XMLComment* comment = doc->NewComment( Value() );\t// fixme: this will always allocate memory. Intern?\n    return comment;\n}\n\n\nbool XMLComment::ShallowEqual( const XMLNode* compare ) const\n{\n    TIXMLASSERT( compare );\n    const XMLComment* comment = compare->ToComment();\n    return ( comment && XMLUtil::StringEqual( comment->Value(), Value() ));\n}\n\n\nbool XMLComment::Accept( XMLVisitor* visitor ) const\n{\n    TIXMLASSERT( visitor );\n    return visitor->Visit( *this );\n}\n\n\n// --------- XMLDeclaration ---------- //\n\nXMLDeclaration::XMLDeclaration( XMLDocument* doc ) : XMLNode( doc )\n{\n}\n\n\nXMLDeclaration::~XMLDeclaration()\n{\n    //printf( \"~XMLDeclaration\\n\" );\n}\n\n\nchar* XMLDeclaration::ParseDeep( char* p, StrPair*, int* curLineNumPtr )\n{\n    // Declaration parses as text.\n    p = _value.ParseText( p, \"?>\", StrPair::NEEDS_NEWLINE_NORMALIZATION, curLineNumPtr );\n    if ( p == 0 ) {\n        _document->SetError( XML_ERROR_PARSING_DECLARATION, _parseLineNum, 0 );\n    }\n    return p;\n}\n\n\nXMLNode* XMLDeclaration::ShallowClone( XMLDocument* doc ) const\n{\n    if ( !doc ) {\n        doc = _document;\n    }\n    XMLDeclaration* dec = doc->NewDeclaration( Value() );\t// fixme: this will always allocate memory. Intern?\n    return dec;\n}\n\n\nbool XMLDeclaration::ShallowEqual( const XMLNode* compare ) const\n{\n    TIXMLASSERT( compare );\n    const XMLDeclaration* declaration = compare->ToDeclaration();\n    return ( declaration && XMLUtil::StringEqual( declaration->Value(), Value() ));\n}\n\n\n\nbool XMLDeclaration::Accept( XMLVisitor* visitor ) const\n{\n    TIXMLASSERT( visitor );\n    return visitor->Visit( *this );\n}\n\n// --------- XMLUnknown ---------- //\n\nXMLUnknown::XMLUnknown( XMLDocument* doc ) : XMLNode( doc )\n{\n}\n\n\nXMLUnknown::~XMLUnknown()\n{\n}\n\n\nchar* XMLUnknown::ParseDeep( char* p, StrPair*, int* curLineNumPtr )\n{\n    // Unknown parses as text.\n    p = _value.ParseText( p, \">\", StrPair::NEEDS_NEWLINE_NORMALIZATION, curLineNumPtr );\n    if ( !p ) {\n        _document->SetError( XML_ERROR_PARSING_UNKNOWN, _parseLineNum, 0 );\n    }\n    return p;\n}\n\n\nXMLNode* XMLUnknown::ShallowClone( XMLDocument* doc ) const\n{\n    if ( !doc ) {\n        doc = _document;\n    }\n    XMLUnknown* text = doc->NewUnknown( Value() );\t// fixme: this will always allocate memory. Intern?\n    return text;\n}\n\n\nbool XMLUnknown::ShallowEqual( const XMLNode* compare ) const\n{\n    TIXMLASSERT( compare );\n    const XMLUnknown* unknown = compare->ToUnknown();\n    return ( unknown && XMLUtil::StringEqual( unknown->Value(), Value() ));\n}\n\n\nbool XMLUnknown::Accept( XMLVisitor* visitor ) const\n{\n    TIXMLASSERT( visitor );\n    return visitor->Visit( *this );\n}\n\n// --------- XMLAttribute ---------- //\n\nconst char* XMLAttribute::Name() const\n{\n    return _name.GetStr();\n}\n\nconst char* XMLAttribute::Value() const\n{\n    return _value.GetStr();\n}\n\nchar* XMLAttribute::ParseDeep( char* p, bool processEntities, int* curLineNumPtr )\n{\n    // Parse using the name rules: bug fix, was using ParseText before\n    p = _name.ParseName( p );\n    if ( !p || !*p ) {\n        return 0;\n    }\n\n    // Skip white space before =\n    p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr );\n    if ( *p != '=' ) {\n        return 0;\n    }\n\n    ++p;\t// move up to opening quote\n    p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr );\n    if ( *p != '\\\"' && *p != '\\'' ) {\n        return 0;\n    }\n\n    char endTag[2] = { *p, 0 };\n    ++p;\t// move past opening quote\n\n    p = _value.ParseText( p, endTag, processEntities ? StrPair::ATTRIBUTE_VALUE : StrPair::ATTRIBUTE_VALUE_LEAVE_ENTITIES, curLineNumPtr );\n    return p;\n}\n\n\nvoid XMLAttribute::SetName( const char* n )\n{\n    _name.SetStr( n );\n}\n\n\nXMLError XMLAttribute::QueryIntValue( int* value ) const\n{\n    if ( XMLUtil::ToInt( Value(), value )) {\n        return XML_SUCCESS;\n    }\n    return XML_WRONG_ATTRIBUTE_TYPE;\n}\n\n\nXMLError XMLAttribute::QueryUnsignedValue( unsigned int* value ) const\n{\n    if ( XMLUtil::ToUnsigned( Value(), value )) {\n        return XML_SUCCESS;\n    }\n    return XML_WRONG_ATTRIBUTE_TYPE;\n}\n\n\nXMLError XMLAttribute::QueryInt64Value(int64_t* value) const\n{\n\tif (XMLUtil::ToInt64(Value(), value)) {\n\t\treturn XML_SUCCESS;\n\t}\n\treturn XML_WRONG_ATTRIBUTE_TYPE;\n}\n\n\nXMLError XMLAttribute::QueryBoolValue( bool* value ) const\n{\n    if ( XMLUtil::ToBool( Value(), value )) {\n        return XML_SUCCESS;\n    }\n    return XML_WRONG_ATTRIBUTE_TYPE;\n}\n\n\nXMLError XMLAttribute::QueryFloatValue( float* value ) const\n{\n    if ( XMLUtil::ToFloat( Value(), value )) {\n        return XML_SUCCESS;\n    }\n    return XML_WRONG_ATTRIBUTE_TYPE;\n}\n\n\nXMLError XMLAttribute::QueryDoubleValue( double* value ) const\n{\n    if ( XMLUtil::ToDouble( Value(), value )) {\n        return XML_SUCCESS;\n    }\n    return XML_WRONG_ATTRIBUTE_TYPE;\n}\n\n\nvoid XMLAttribute::SetAttribute( const char* v )\n{\n    _value.SetStr( v );\n}\n\n\nvoid XMLAttribute::SetAttribute( int v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    _value.SetStr( buf );\n}\n\n\nvoid XMLAttribute::SetAttribute( unsigned v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    _value.SetStr( buf );\n}\n\n\nvoid XMLAttribute::SetAttribute(int64_t v)\n{\n\tchar buf[BUF_SIZE];\n\tXMLUtil::ToStr(v, buf, BUF_SIZE);\n\t_value.SetStr(buf);\n}\n\n\n\nvoid XMLAttribute::SetAttribute( bool v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    _value.SetStr( buf );\n}\n\nvoid XMLAttribute::SetAttribute( double v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    _value.SetStr( buf );\n}\n\nvoid XMLAttribute::SetAttribute( float v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    _value.SetStr( buf );\n}\n\n\n// --------- XMLElement ---------- //\nXMLElement::XMLElement( XMLDocument* doc ) : XMLNode( doc ),\n    _closingType( OPEN ),\n    _rootAttribute( 0 )\n{\n}\n\n\nXMLElement::~XMLElement()\n{\n    while( _rootAttribute ) {\n        XMLAttribute* next = _rootAttribute->_next;\n        DeleteAttribute( _rootAttribute );\n        _rootAttribute = next;\n    }\n}\n\n\nconst XMLAttribute* XMLElement::FindAttribute( const char* name ) const\n{\n    for( XMLAttribute* a = _rootAttribute; a; a = a->_next ) {\n        if ( XMLUtil::StringEqual( a->Name(), name ) ) {\n            return a;\n        }\n    }\n    return 0;\n}\n\n\nconst char* XMLElement::Attribute( const char* name, const char* value ) const\n{\n    const XMLAttribute* a = FindAttribute( name );\n    if ( !a ) {\n        return 0;\n    }\n    if ( !value || XMLUtil::StringEqual( a->Value(), value )) {\n        return a->Value();\n    }\n    return 0;\n}\n\nint XMLElement::IntAttribute(const char* name, int defaultValue) const\n{\n\tint i = defaultValue;\n\tQueryIntAttribute(name, &i);\n\treturn i;\n}\n\nunsigned XMLElement::UnsignedAttribute(const char* name, unsigned defaultValue) const\n{\n\tunsigned i = defaultValue;\n\tQueryUnsignedAttribute(name, &i);\n\treturn i;\n}\n\nint64_t XMLElement::Int64Attribute(const char* name, int64_t defaultValue) const\n{\n\tint64_t i = defaultValue;\n\tQueryInt64Attribute(name, &i);\n\treturn i;\n}\n\nbool XMLElement::BoolAttribute(const char* name, bool defaultValue) const\n{\n\tbool b = defaultValue;\n\tQueryBoolAttribute(name, &b);\n\treturn b;\n}\n\ndouble XMLElement::DoubleAttribute(const char* name, double defaultValue) const\n{\n\tdouble d = defaultValue;\n\tQueryDoubleAttribute(name, &d);\n\treturn d;\n}\n\nfloat XMLElement::FloatAttribute(const char* name, float defaultValue) const\n{\n\tfloat f = defaultValue;\n\tQueryFloatAttribute(name, &f);\n\treturn f;\n}\n\nconst char* XMLElement::GetText() const\n{\n    if ( FirstChild() && FirstChild()->ToText() ) {\n        return FirstChild()->Value();\n    }\n    return 0;\n}\n\n\nvoid\tXMLElement::SetText( const char* inText )\n{\n\tif ( FirstChild() && FirstChild()->ToText() )\n\t\tFirstChild()->SetValue( inText );\n\telse {\n\t\tXMLText*\ttheText = GetDocument()->NewText( inText );\n\t\tInsertFirstChild( theText );\n\t}\n}\n\n\nvoid XMLElement::SetText( int v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    SetText( buf );\n}\n\n\nvoid XMLElement::SetText( unsigned v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    SetText( buf );\n}\n\n\nvoid XMLElement::SetText(int64_t v)\n{\n\tchar buf[BUF_SIZE];\n\tXMLUtil::ToStr(v, buf, BUF_SIZE);\n\tSetText(buf);\n}\n\n\nvoid XMLElement::SetText( bool v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    SetText( buf );\n}\n\n\nvoid XMLElement::SetText( float v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    SetText( buf );\n}\n\n\nvoid XMLElement::SetText( double v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    SetText( buf );\n}\n\n\nXMLError XMLElement::QueryIntText( int* ival ) const\n{\n    if ( FirstChild() && FirstChild()->ToText() ) {\n        const char* t = FirstChild()->Value();\n        if ( XMLUtil::ToInt( t, ival ) ) {\n            return XML_SUCCESS;\n        }\n        return XML_CAN_NOT_CONVERT_TEXT;\n    }\n    return XML_NO_TEXT_NODE;\n}\n\n\nXMLError XMLElement::QueryUnsignedText( unsigned* uval ) const\n{\n    if ( FirstChild() && FirstChild()->ToText() ) {\n        const char* t = FirstChild()->Value();\n        if ( XMLUtil::ToUnsigned( t, uval ) ) {\n            return XML_SUCCESS;\n        }\n        return XML_CAN_NOT_CONVERT_TEXT;\n    }\n    return XML_NO_TEXT_NODE;\n}\n\n\nXMLError XMLElement::QueryInt64Text(int64_t* ival) const\n{\n\tif (FirstChild() && FirstChild()->ToText()) {\n\t\tconst char* t = FirstChild()->Value();\n\t\tif (XMLUtil::ToInt64(t, ival)) {\n\t\t\treturn XML_SUCCESS;\n\t\t}\n\t\treturn XML_CAN_NOT_CONVERT_TEXT;\n\t}\n\treturn XML_NO_TEXT_NODE;\n}\n\n\nXMLError XMLElement::QueryBoolText( bool* bval ) const\n{\n    if ( FirstChild() && FirstChild()->ToText() ) {\n        const char* t = FirstChild()->Value();\n        if ( XMLUtil::ToBool( t, bval ) ) {\n            return XML_SUCCESS;\n        }\n        return XML_CAN_NOT_CONVERT_TEXT;\n    }\n    return XML_NO_TEXT_NODE;\n}\n\n\nXMLError XMLElement::QueryDoubleText( double* dval ) const\n{\n    if ( FirstChild() && FirstChild()->ToText() ) {\n        const char* t = FirstChild()->Value();\n        if ( XMLUtil::ToDouble( t, dval ) ) {\n            return XML_SUCCESS;\n        }\n        return XML_CAN_NOT_CONVERT_TEXT;\n    }\n    return XML_NO_TEXT_NODE;\n}\n\n\nXMLError XMLElement::QueryFloatText( float* fval ) const\n{\n    if ( FirstChild() && FirstChild()->ToText() ) {\n        const char* t = FirstChild()->Value();\n        if ( XMLUtil::ToFloat( t, fval ) ) {\n            return XML_SUCCESS;\n        }\n        return XML_CAN_NOT_CONVERT_TEXT;\n    }\n    return XML_NO_TEXT_NODE;\n}\n\nint XMLElement::IntText(int defaultValue) const\n{\n\tint i = defaultValue;\n\tQueryIntText(&i);\n\treturn i;\n}\n\nunsigned XMLElement::UnsignedText(unsigned defaultValue) const\n{\n\tunsigned i = defaultValue;\n\tQueryUnsignedText(&i);\n\treturn i;\n}\n\nint64_t XMLElement::Int64Text(int64_t defaultValue) const\n{\n\tint64_t i = defaultValue;\n\tQueryInt64Text(&i);\n\treturn i;\n}\n\nbool XMLElement::BoolText(bool defaultValue) const\n{\n\tbool b = defaultValue;\n\tQueryBoolText(&b);\n\treturn b;\n}\n\ndouble XMLElement::DoubleText(double defaultValue) const\n{\n\tdouble d = defaultValue;\n\tQueryDoubleText(&d);\n\treturn d;\n}\n\nfloat XMLElement::FloatText(float defaultValue) const\n{\n\tfloat f = defaultValue;\n\tQueryFloatText(&f);\n\treturn f;\n}\n\n\nXMLAttribute* XMLElement::FindOrCreateAttribute( const char* name )\n{\n    XMLAttribute* last = 0;\n    XMLAttribute* attrib = 0;\n    for( attrib = _rootAttribute;\n            attrib;\n            last = attrib, attrib = attrib->_next ) {\n        if ( XMLUtil::StringEqual( attrib->Name(), name ) ) {\n            break;\n        }\n    }\n    if ( !attrib ) {\n        attrib = CreateAttribute();\n        TIXMLASSERT( attrib );\n        if ( last ) {\n            TIXMLASSERT( last->_next == 0 );\n            last->_next = attrib;\n        }\n        else {\n            TIXMLASSERT( _rootAttribute == 0 );\n            _rootAttribute = attrib;\n        }\n        attrib->SetName( name );\n    }\n    return attrib;\n}\n\n\nvoid XMLElement::DeleteAttribute( const char* name )\n{\n    XMLAttribute* prev = 0;\n    for( XMLAttribute* a=_rootAttribute; a; a=a->_next ) {\n        if ( XMLUtil::StringEqual( name, a->Name() ) ) {\n            if ( prev ) {\n                prev->_next = a->_next;\n            }\n            else {\n                _rootAttribute = a->_next;\n            }\n            DeleteAttribute( a );\n            break;\n        }\n        prev = a;\n    }\n}\n\n\nchar* XMLElement::ParseAttributes( char* p, int* curLineNumPtr )\n{\n    XMLAttribute* prevAttribute = 0;\n\n    // Read the attributes.\n    while( p ) {\n        p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr );\n        if ( !(*p) ) {\n            _document->SetError( XML_ERROR_PARSING_ELEMENT, _parseLineNum, \"XMLElement name=%s\", Name() );\n            return 0;\n        }\n\n        // attribute.\n        if (XMLUtil::IsNameStartChar( *p ) ) {\n            XMLAttribute* attrib = CreateAttribute();\n            TIXMLASSERT( attrib );\n            attrib->_parseLineNum = _document->_parseCurLineNum;\n\n            int attrLineNum = attrib->_parseLineNum;\n\n            p = attrib->ParseDeep( p, _document->ProcessEntities(), curLineNumPtr );\n            if ( !p || Attribute( attrib->Name() ) ) {\n                DeleteAttribute( attrib );\n                _document->SetError( XML_ERROR_PARSING_ATTRIBUTE, attrLineNum, \"XMLElement name=%s\", Name() );\n                return 0;\n            }\n            // There is a minor bug here: if the attribute in the source xml\n            // document is duplicated, it will not be detected and the\n            // attribute will be doubly added. However, tracking the 'prevAttribute'\n            // avoids re-scanning the attribute list. Preferring performance for\n            // now, may reconsider in the future.\n            if ( prevAttribute ) {\n                TIXMLASSERT( prevAttribute->_next == 0 );\n                prevAttribute->_next = attrib;\n            }\n            else {\n                TIXMLASSERT( _rootAttribute == 0 );\n                _rootAttribute = attrib;\n            }\n            prevAttribute = attrib;\n        }\n        // end of the tag\n        else if ( *p == '>' ) {\n            ++p;\n            break;\n        }\n        // end of the tag\n        else if ( *p == '/' && *(p+1) == '>' ) {\n            _closingType = CLOSED;\n            return p+2;\t// done; sealed element.\n        }\n        else {\n            _document->SetError( XML_ERROR_PARSING_ELEMENT, _parseLineNum, 0 );\n            return 0;\n        }\n    }\n    return p;\n}\n\nvoid XMLElement::DeleteAttribute( XMLAttribute* attribute )\n{\n    if ( attribute == 0 ) {\n        return;\n    }\n    MemPool* pool = attribute->_memPool;\n    attribute->~XMLAttribute();\n    pool->Free( attribute );\n}\n\nXMLAttribute* XMLElement::CreateAttribute()\n{\n    TIXMLASSERT( sizeof( XMLAttribute ) == _document->_attributePool.ItemSize() );\n    XMLAttribute* attrib = new (_document->_attributePool.Alloc() ) XMLAttribute();\n    TIXMLASSERT( attrib );\n    attrib->_memPool = &_document->_attributePool;\n    attrib->_memPool->SetTracked();\n    return attrib;\n}\n\n//\n//\t<ele></ele>\n//\t<ele>foo<b>bar</b></ele>\n//\nchar* XMLElement::ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr )\n{\n    // Read the element name.\n    p = XMLUtil::SkipWhiteSpace( p, curLineNumPtr );\n\n    // The closing element is the </element> form. It is\n    // parsed just like a regular element then deleted from\n    // the DOM.\n    if ( *p == '/' ) {\n        _closingType = CLOSING;\n        ++p;\n    }\n\n    p = _value.ParseName( p );\n    if ( _value.Empty() ) {\n        return 0;\n    }\n\n    p = ParseAttributes( p, curLineNumPtr );\n    if ( !p || !*p || _closingType != OPEN ) {\n        return p;\n    }\n\n    p = XMLNode::ParseDeep( p, parentEndTag, curLineNumPtr );\n    return p;\n}\n\n\n\nXMLNode* XMLElement::ShallowClone( XMLDocument* doc ) const\n{\n    if ( !doc ) {\n        doc = _document;\n    }\n    XMLElement* element = doc->NewElement( Value() );\t\t\t\t\t// fixme: this will always allocate memory. Intern?\n    for( const XMLAttribute* a=FirstAttribute(); a; a=a->Next() ) {\n        element->SetAttribute( a->Name(), a->Value() );\t\t\t\t\t// fixme: this will always allocate memory. Intern?\n    }\n    return element;\n}\n\n\nbool XMLElement::ShallowEqual( const XMLNode* compare ) const\n{\n    TIXMLASSERT( compare );\n    const XMLElement* other = compare->ToElement();\n    if ( other && XMLUtil::StringEqual( other->Name(), Name() )) {\n\n        const XMLAttribute* a=FirstAttribute();\n        const XMLAttribute* b=other->FirstAttribute();\n\n        while ( a && b ) {\n            if ( !XMLUtil::StringEqual( a->Value(), b->Value() ) ) {\n                return false;\n            }\n            a = a->Next();\n            b = b->Next();\n        }\n        if ( a || b ) {\n            // different count\n            return false;\n        }\n        return true;\n    }\n    return false;\n}\n\n\nbool XMLElement::Accept( XMLVisitor* visitor ) const\n{\n    TIXMLASSERT( visitor );\n    if ( visitor->VisitEnter( *this, _rootAttribute ) ) {\n        for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) {\n            if ( !node->Accept( visitor ) ) {\n                break;\n            }\n        }\n    }\n    return visitor->VisitExit( *this );\n}\n\n\n// --------- XMLDocument ----------- //\n\n// Warning: List must match 'enum XMLError'\nconst char* XMLDocument::_errorNames[XML_ERROR_COUNT] = {\n    \"XML_SUCCESS\",\n    \"XML_NO_ATTRIBUTE\",\n    \"XML_WRONG_ATTRIBUTE_TYPE\",\n    \"XML_ERROR_FILE_NOT_FOUND\",\n    \"XML_ERROR_FILE_COULD_NOT_BE_OPENED\",\n    \"XML_ERROR_FILE_READ_ERROR\",\n    \"UNUSED_XML_ERROR_ELEMENT_MISMATCH\",\n    \"XML_ERROR_PARSING_ELEMENT\",\n    \"XML_ERROR_PARSING_ATTRIBUTE\",\n    \"UNUSED_XML_ERROR_IDENTIFYING_TAG\",\n    \"XML_ERROR_PARSING_TEXT\",\n    \"XML_ERROR_PARSING_CDATA\",\n    \"XML_ERROR_PARSING_COMMENT\",\n    \"XML_ERROR_PARSING_DECLARATION\",\n    \"XML_ERROR_PARSING_UNKNOWN\",\n    \"XML_ERROR_EMPTY_DOCUMENT\",\n    \"XML_ERROR_MISMATCHED_ELEMENT\",\n    \"XML_ERROR_PARSING\",\n    \"XML_CAN_NOT_CONVERT_TEXT\",\n    \"XML_NO_TEXT_NODE\",\n\t\"XML_ELEMENT_DEPTH_EXCEEDED\"\n};\n\n\nXMLDocument::XMLDocument( bool processEntities, Whitespace whitespaceMode ) :\n    XMLNode( 0 ),\n    _writeBOM( false ),\n    _processEntities( processEntities ),\n    _errorID(XML_SUCCESS),\n    _whitespaceMode( whitespaceMode ),\n    _errorStr(),\n    _errorLineNum( 0 ),\n    _charBuffer( 0 ),\n    _parseCurLineNum( 0 ),\n\t_parsingDepth(0),\n    _unlinked(),\n    _elementPool(),\n    _attributePool(),\n    _textPool(),\n    _commentPool()\n{\n    // avoid VC++ C4355 warning about 'this' in initializer list (C4355 is off by default in VS2012+)\n    _document = this;\n}\n\n\nXMLDocument::~XMLDocument()\n{\n    Clear();\n}\n\n\nvoid XMLDocument::MarkInUse(XMLNode* node)\n{\n\tTIXMLASSERT(node);\n\tTIXMLASSERT(node->_parent == 0);\n\n\tfor (int i = 0; i < _unlinked.Size(); ++i) {\n\t\tif (node == _unlinked[i]) {\n\t\t\t_unlinked.SwapRemove(i);\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\nvoid XMLDocument::Clear()\n{\n    DeleteChildren();\n\twhile( _unlinked.Size()) {\n\t\tDeleteNode(_unlinked[0]);\t// Will remove from _unlinked as part of delete.\n\t}\n\n#ifdef TINYXML2_DEBUG\n    const bool hadError = Error();\n#endif\n    ClearError();\n\n    delete [] _charBuffer;\n    _charBuffer = 0;\n\t_parsingDepth = 0;\n\n#if 0\n    _textPool.Trace( \"text\" );\n    _elementPool.Trace( \"element\" );\n    _commentPool.Trace( \"comment\" );\n    _attributePool.Trace( \"attribute\" );\n#endif\n\n#ifdef TINYXML2_DEBUG\n    if ( !hadError ) {\n        TIXMLASSERT( _elementPool.CurrentAllocs()   == _elementPool.Untracked() );\n        TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() );\n        TIXMLASSERT( _textPool.CurrentAllocs()      == _textPool.Untracked() );\n        TIXMLASSERT( _commentPool.CurrentAllocs()   == _commentPool.Untracked() );\n    }\n#endif\n}\n\n\nvoid XMLDocument::DeepCopy(XMLDocument* target) const\n{\n\tTIXMLASSERT(target);\n    if (target == this) {\n        return; // technically success - a no-op.\n    }\n\n\ttarget->Clear();\n\tfor (const XMLNode* node = this->FirstChild(); node; node = node->NextSibling()) {\n\t\ttarget->InsertEndChild(node->DeepClone(target));\n\t}\n}\n\nXMLElement* XMLDocument::NewElement( const char* name )\n{\n    XMLElement* ele = CreateUnlinkedNode<XMLElement>( _elementPool );\n    ele->SetName( name );\n    return ele;\n}\n\n\nXMLComment* XMLDocument::NewComment( const char* str )\n{\n    XMLComment* comment = CreateUnlinkedNode<XMLComment>( _commentPool );\n    comment->SetValue( str );\n    return comment;\n}\n\n\nXMLText* XMLDocument::NewText( const char* str )\n{\n    XMLText* text = CreateUnlinkedNode<XMLText>( _textPool );\n    text->SetValue( str );\n    return text;\n}\n\n\nXMLDeclaration* XMLDocument::NewDeclaration( const char* str )\n{\n    XMLDeclaration* dec = CreateUnlinkedNode<XMLDeclaration>( _commentPool );\n    dec->SetValue( str ? str : \"xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"\" );\n    return dec;\n}\n\n\nXMLUnknown* XMLDocument::NewUnknown( const char* str )\n{\n    XMLUnknown* unk = CreateUnlinkedNode<XMLUnknown>( _commentPool );\n    unk->SetValue( str );\n    return unk;\n}\n\nstatic FILE* callfopen( const char* filepath, const char* mode )\n{\n    TIXMLASSERT( filepath );\n    TIXMLASSERT( mode );\n#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE)\n    FILE* fp = 0;\n    errno_t err = fopen_s( &fp, filepath, mode );\n    if ( err ) {\n        return 0;\n    }\n#else\n    FILE* fp = fopen( filepath, mode );\n#endif\n    return fp;\n}\n\nvoid XMLDocument::DeleteNode( XMLNode* node )\t{\n    TIXMLASSERT( node );\n    TIXMLASSERT(node->_document == this );\n    if (node->_parent) {\n        node->_parent->DeleteChild( node );\n    }\n    else {\n        // Isn't in the tree.\n        // Use the parent delete.\n        // Also, we need to mark it tracked: we 'know'\n        // it was never used.\n        node->_memPool->SetTracked();\n        // Call the static XMLNode version:\n        XMLNode::DeleteNode(node);\n    }\n}\n\n\nXMLError XMLDocument::LoadFile( const char* filename )\n{\n    if ( !filename ) {\n        TIXMLASSERT( false );\n        SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, 0, \"filename=<null>\" );\n        return _errorID;\n    }\n\n    Clear();\n    FILE* fp = callfopen( filename, \"rb\" );\n    if ( !fp ) {\n        SetError( XML_ERROR_FILE_NOT_FOUND, 0, \"filename=%s\", filename );\n        return _errorID;\n    }\n    LoadFile( fp );\n    fclose( fp );\n    return _errorID;\n}\n\n// This is likely overengineered template art to have a check that unsigned long value incremented\n// by one still fits into size_t. If size_t type is larger than unsigned long type\n// (x86_64-w64-mingw32 target) then the check is redundant and gcc and clang emit\n// -Wtype-limits warning. This piece makes the compiler select code with a check when a check\n// is useful and code with no check when a check is redundant depending on how size_t and unsigned long\n// types sizes relate to each other.\ntemplate\n<bool = (sizeof(unsigned long) >= sizeof(size_t))>\nstruct LongFitsIntoSizeTMinusOne {\n    static bool Fits( unsigned long value )\n    {\n        return value < (size_t)-1;\n    }\n};\n\ntemplate <>\nstruct LongFitsIntoSizeTMinusOne<false> {\n    static bool Fits( unsigned long )\n    {\n        return true;\n    }\n};\n\nXMLError XMLDocument::LoadFile( FILE* fp )\n{\n    Clear();\n\n    fseek( fp, 0, SEEK_SET );\n    if ( fgetc( fp ) == EOF && ferror( fp ) != 0 ) {\n        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\n        return _errorID;\n    }\n\n    fseek( fp, 0, SEEK_END );\n    const long filelength = ftell( fp );\n    fseek( fp, 0, SEEK_SET );\n    if ( filelength == -1L ) {\n        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\n        return _errorID;\n    }\n    TIXMLASSERT( filelength >= 0 );\n\n    if ( !LongFitsIntoSizeTMinusOne<>::Fits( filelength ) ) {\n        // Cannot handle files which won't fit in buffer together with null terminator\n        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\n        return _errorID;\n    }\n\n    if ( filelength == 0 ) {\n        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\n        return _errorID;\n    }\n\n    const size_t size = filelength;\n    TIXMLASSERT( _charBuffer == 0 );\n    _charBuffer = new char[size+1];\n    size_t read = fread( _charBuffer, 1, size, fp );\n    if ( read != size ) {\n        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\n        return _errorID;\n    }\n\n    _charBuffer[size] = 0;\n\n    Parse();\n    return _errorID;\n}\n\n\nXMLError XMLDocument::SaveFile( const char* filename, bool compact )\n{\n    if ( !filename ) {\n        TIXMLASSERT( false );\n        SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, 0, \"filename=<null>\" );\n        return _errorID;\n    }\n\n    FILE* fp = callfopen( filename, \"w\" );\n    if ( !fp ) {\n        SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, 0, \"filename=%s\", filename );\n        return _errorID;\n    }\n    SaveFile(fp, compact);\n    fclose( fp );\n    return _errorID;\n}\n\n\nXMLError XMLDocument::SaveFile( FILE* fp, bool compact )\n{\n    // Clear any error from the last save, otherwise it will get reported\n    // for *this* call.\n    ClearError();\n    XMLPrinter stream( fp, compact );\n    Print( &stream );\n    return _errorID;\n}\n\n\nXMLError XMLDocument::Parse( const char* p, size_t len )\n{\n    Clear();\n\n    if ( len == 0 || !p || !*p ) {\n        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\n        return _errorID;\n    }\n    if ( len == (size_t)(-1) ) {\n        len = strlen( p );\n    }\n    TIXMLASSERT( _charBuffer == 0 );\n    _charBuffer = new char[ len+1 ];\n    memcpy( _charBuffer, p, len );\n    _charBuffer[len] = 0;\n\n    Parse();\n    if ( Error() ) {\n        // clean up now essentially dangling memory.\n        // and the parse fail can put objects in the\n        // pools that are dead and inaccessible.\n        DeleteChildren();\n        _elementPool.Clear();\n        _attributePool.Clear();\n        _textPool.Clear();\n        _commentPool.Clear();\n    }\n    return _errorID;\n}\n\n\nvoid XMLDocument::Print( XMLPrinter* streamer ) const\n{\n    if ( streamer ) {\n        Accept( streamer );\n    }\n    else {\n        XMLPrinter stdoutStreamer( stdout );\n        Accept( &stdoutStreamer );\n    }\n}\n\n\nvoid XMLDocument::SetError( XMLError error, int lineNum, const char* format, ... )\n{\n    TIXMLASSERT( error >= 0 && error < XML_ERROR_COUNT );\n    _errorID = error;\n    _errorLineNum = lineNum;\n\t_errorStr.Reset();\n\n    size_t BUFFER_SIZE = 1000;\n    char* buffer = new char[BUFFER_SIZE];\n\n    TIXML_SNPRINTF(buffer, BUFFER_SIZE, \"Error=%s ErrorID=%d (0x%x) Line number=%d\", ErrorIDToName(error), int(error), int(error), lineNum);\n\n\tif (format) {\n\t\tsize_t len = strlen(buffer);\n\t\tTIXML_SNPRINTF(buffer + len, BUFFER_SIZE - len, \": \");\n\t\tlen = strlen(buffer);\n\n\t\tva_list va;\n\t\tva_start(va, format);\n\t\tTIXML_VSNPRINTF(buffer + len, BUFFER_SIZE - len, format, va);\n\t\tva_end(va);\n\t}\n\t_errorStr.SetStr(buffer);\n\tdelete[] buffer;\n}\n\n\n/*static*/ const char* XMLDocument::ErrorIDToName(XMLError errorID)\n{\n\tTIXMLASSERT( errorID >= 0 && errorID < XML_ERROR_COUNT );\n    const char* errorName = _errorNames[errorID];\n    TIXMLASSERT( errorName && errorName[0] );\n    return errorName;\n}\n\nconst char* XMLDocument::ErrorStr() const\n{\n\treturn _errorStr.Empty() ? \"\" : _errorStr.GetStr();\n}\n\n\nvoid XMLDocument::PrintError() const\n{\n    printf(\"%s\\n\", ErrorStr());\n}\n\nconst char* XMLDocument::ErrorName() const\n{\n    return ErrorIDToName(_errorID);\n}\n\nvoid XMLDocument::Parse()\n{\n    TIXMLASSERT( NoChildren() ); // Clear() must have been called previously\n    TIXMLASSERT( _charBuffer );\n    _parseCurLineNum = 1;\n    _parseLineNum = 1;\n    char* p = _charBuffer;\n    p = XMLUtil::SkipWhiteSpace( p, &_parseCurLineNum );\n    p = const_cast<char*>( XMLUtil::ReadBOM( p, &_writeBOM ) );\n    if ( !*p ) {\n        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\n        return;\n    }\n    ParseDeep(p, 0, &_parseCurLineNum );\n}\n\nvoid XMLDocument::PushDepth()\n{\n\t_parsingDepth++;\n\tif (_parsingDepth == TINYXML2_MAX_ELEMENT_DEPTH) {\n\t\tSetError(XML_ELEMENT_DEPTH_EXCEEDED, _parseCurLineNum, \"Element nesting is too deep.\" );\n\t}\n}\n\nvoid XMLDocument::PopDepth()\n{\n\tTIXMLASSERT(_parsingDepth > 0);\n\t--_parsingDepth;\n}\n\nXMLPrinter::XMLPrinter( FILE* file, bool compact, int depth ) :\n    _elementJustOpened( false ),\n    _stack(),\n    _firstElement( true ),\n    _fp( file ),\n    _depth( depth ),\n    _textDepth( -1 ),\n    _processEntities( true ),\n    _compactMode( compact ),\n    _buffer()\n{\n    for( int i=0; i<ENTITY_RANGE; ++i ) {\n        _entityFlag[i] = false;\n        _restrictedEntityFlag[i] = false;\n    }\n    for( int i=0; i<NUM_ENTITIES; ++i ) {\n        const char entityValue = entities[i].value;\n        const unsigned char flagIndex = (unsigned char)entityValue;\n        TIXMLASSERT( flagIndex < ENTITY_RANGE );\n        _entityFlag[flagIndex] = true;\n    }\n    _restrictedEntityFlag[(unsigned char)'&'] = true;\n    _restrictedEntityFlag[(unsigned char)'<'] = true;\n    _restrictedEntityFlag[(unsigned char)'>'] = true;\t// not required, but consistency is nice\n    _buffer.Push( 0 );\n}\n\n\nvoid XMLPrinter::Print( const char* format, ... )\n{\n    va_list     va;\n    va_start( va, format );\n\n    if ( _fp ) {\n        vfprintf( _fp, format, va );\n    }\n    else {\n        const int len = TIXML_VSCPRINTF( format, va );\n        // Close out and re-start the va-args\n        va_end( va );\n        TIXMLASSERT( len >= 0 );\n        va_start( va, format );\n        TIXMLASSERT( _buffer.Size() > 0 && _buffer[_buffer.Size() - 1] == 0 );\n        char* p = _buffer.PushArr( len ) - 1;\t// back up over the null terminator.\n\t\tTIXML_VSNPRINTF( p, len+1, format, va );\n    }\n    va_end( va );\n}\n\n\nvoid XMLPrinter::Write( const char* data, size_t size )\n{\n    if ( _fp ) {\n        fwrite ( data , sizeof(char), size, _fp);\n    }\n    else {\n        char* p = _buffer.PushArr( static_cast<int>(size) ) - 1;   // back up over the null terminator.\n        memcpy( p, data, size );\n        p[size] = 0;\n    }\n}\n\n\nvoid XMLPrinter::Putc( char ch )\n{\n    if ( _fp ) {\n        fputc ( ch, _fp);\n    }\n    else {\n        char* p = _buffer.PushArr( sizeof(char) ) - 1;   // back up over the null terminator.\n        p[0] = ch;\n        p[1] = 0;\n    }\n}\n\n\nvoid XMLPrinter::PrintSpace( int depth )\n{\n    for( int i=0; i<depth; ++i ) {\n        Write( \"    \" );\n    }\n}\n\n\nvoid XMLPrinter::PrintString( const char* p, bool restricted )\n{\n    // Look for runs of bytes between entities to print.\n    const char* q = p;\n\n    if ( _processEntities ) {\n        const bool* flag = restricted ? _restrictedEntityFlag : _entityFlag;\n        while ( *q ) {\n            TIXMLASSERT( p <= q );\n            // Remember, char is sometimes signed. (How many times has that bitten me?)\n            if ( *q > 0 && *q < ENTITY_RANGE ) {\n                // Check for entities. If one is found, flush\n                // the stream up until the entity, write the\n                // entity, and keep looking.\n                if ( flag[(unsigned char)(*q)] ) {\n                    while ( p < q ) {\n                        const size_t delta = q - p;\n                        const int toPrint = ( INT_MAX < delta ) ? INT_MAX : (int)delta;\n                        Write( p, toPrint );\n                        p += toPrint;\n                    }\n                    bool entityPatternPrinted = false;\n                    for( int i=0; i<NUM_ENTITIES; ++i ) {\n                        if ( entities[i].value == *q ) {\n                            Putc( '&' );\n                            Write( entities[i].pattern, entities[i].length );\n                            Putc( ';' );\n                            entityPatternPrinted = true;\n                            break;\n                        }\n                    }\n                    if ( !entityPatternPrinted ) {\n                        // TIXMLASSERT( entityPatternPrinted ) causes gcc -Wunused-but-set-variable in release\n                        TIXMLASSERT( false );\n                    }\n                    ++p;\n                }\n            }\n            ++q;\n            TIXMLASSERT( p <= q );\n        }\n    }\n    // Flush the remaining string. This will be the entire\n    // string if an entity wasn't found.\n    TIXMLASSERT( p <= q );\n    if ( !_processEntities || ( p < q ) ) {\n        const size_t delta = q - p;\n        const int toPrint = ( INT_MAX < delta ) ? INT_MAX : (int)delta;\n        Write( p, toPrint );\n    }\n}\n\n\nvoid XMLPrinter::PushHeader( bool writeBOM, bool writeDec )\n{\n    if ( writeBOM ) {\n        static const unsigned char bom[] = { TIXML_UTF_LEAD_0, TIXML_UTF_LEAD_1, TIXML_UTF_LEAD_2, 0 };\n        Write( reinterpret_cast< const char* >( bom ) );\n    }\n    if ( writeDec ) {\n        PushDeclaration( \"xml version=\\\"1.0\\\"\" );\n    }\n}\n\n\nvoid XMLPrinter::OpenElement( const char* name, bool compactMode )\n{\n    SealElementIfJustOpened();\n    _stack.Push( name );\n\n    if ( _textDepth < 0 && !_firstElement && !compactMode ) {\n        Putc( '\\n' );\n    }\n    if ( !compactMode ) {\n        PrintSpace( _depth );\n    }\n\n    Write ( \"<\" );\n    Write ( name );\n\n    _elementJustOpened = true;\n    _firstElement = false;\n    ++_depth;\n}\n\n\nvoid XMLPrinter::PushAttribute( const char* name, const char* value )\n{\n    TIXMLASSERT( _elementJustOpened );\n    Putc ( ' ' );\n    Write( name );\n    Write( \"=\\\"\" );\n    PrintString( value, false );\n    Putc ( '\\\"' );\n}\n\n\nvoid XMLPrinter::PushAttribute( const char* name, int v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    PushAttribute( name, buf );\n}\n\n\nvoid XMLPrinter::PushAttribute( const char* name, unsigned v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    PushAttribute( name, buf );\n}\n\n\nvoid XMLPrinter::PushAttribute(const char* name, int64_t v)\n{\n\tchar buf[BUF_SIZE];\n\tXMLUtil::ToStr(v, buf, BUF_SIZE);\n\tPushAttribute(name, buf);\n}\n\n\nvoid XMLPrinter::PushAttribute( const char* name, bool v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    PushAttribute( name, buf );\n}\n\n\nvoid XMLPrinter::PushAttribute( const char* name, double v )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( v, buf, BUF_SIZE );\n    PushAttribute( name, buf );\n}\n\n\nvoid XMLPrinter::CloseElement( bool compactMode )\n{\n    --_depth;\n    const char* name = _stack.Pop();\n\n    if ( _elementJustOpened ) {\n        Write( \"/>\" );\n    }\n    else {\n        if ( _textDepth < 0 && !compactMode) {\n            Putc( '\\n' );\n            PrintSpace( _depth );\n        }\n        Write ( \"</\" );\n        Write ( name );\n        Write ( \">\" );\n    }\n\n    if ( _textDepth == _depth ) {\n        _textDepth = -1;\n    }\n    if ( _depth == 0 && !compactMode) {\n        Putc( '\\n' );\n    }\n    _elementJustOpened = false;\n}\n\n\nvoid XMLPrinter::SealElementIfJustOpened()\n{\n    if ( !_elementJustOpened ) {\n        return;\n    }\n    _elementJustOpened = false;\n    Putc( '>' );\n}\n\n\nvoid XMLPrinter::PushText( const char* text, bool cdata )\n{\n    _textDepth = _depth-1;\n\n    SealElementIfJustOpened();\n    if ( cdata ) {\n        Write( \"<![CDATA[\" );\n        Write( text );\n        Write( \"]]>\" );\n    }\n    else {\n        PrintString( text, true );\n    }\n}\n\nvoid XMLPrinter::PushText( int64_t value )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( value, buf, BUF_SIZE );\n    PushText( buf, false );\n}\n\nvoid XMLPrinter::PushText( int value )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( value, buf, BUF_SIZE );\n    PushText( buf, false );\n}\n\n\nvoid XMLPrinter::PushText( unsigned value )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( value, buf, BUF_SIZE );\n    PushText( buf, false );\n}\n\n\nvoid XMLPrinter::PushText( bool value )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( value, buf, BUF_SIZE );\n    PushText( buf, false );\n}\n\n\nvoid XMLPrinter::PushText( float value )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( value, buf, BUF_SIZE );\n    PushText( buf, false );\n}\n\n\nvoid XMLPrinter::PushText( double value )\n{\n    char buf[BUF_SIZE];\n    XMLUtil::ToStr( value, buf, BUF_SIZE );\n    PushText( buf, false );\n}\n\n\nvoid XMLPrinter::PushComment( const char* comment )\n{\n    SealElementIfJustOpened();\n    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\n        Putc( '\\n' );\n        PrintSpace( _depth );\n    }\n    _firstElement = false;\n\n    Write( \"<!--\" );\n    Write( comment );\n    Write( \"-->\" );\n}\n\n\nvoid XMLPrinter::PushDeclaration( const char* value )\n{\n    SealElementIfJustOpened();\n    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\n        Putc( '\\n' );\n        PrintSpace( _depth );\n    }\n    _firstElement = false;\n\n    Write( \"<?\" );\n    Write( value );\n    Write( \"?>\" );\n}\n\n\nvoid XMLPrinter::PushUnknown( const char* value )\n{\n    SealElementIfJustOpened();\n    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\n        Putc( '\\n' );\n        PrintSpace( _depth );\n    }\n    _firstElement = false;\n\n    Write( \"<!\" );\n    Write( value );\n    Putc( '>' );\n}\n\n\nbool XMLPrinter::VisitEnter( const XMLDocument& doc )\n{\n    _processEntities = doc.ProcessEntities();\n    if ( doc.HasBOM() ) {\n        PushHeader( true, false );\n    }\n    return true;\n}\n\n\nbool XMLPrinter::VisitEnter( const XMLElement& element, const XMLAttribute* attribute )\n{\n    const XMLElement* parentElem = 0;\n    if ( element.Parent() ) {\n        parentElem = element.Parent()->ToElement();\n    }\n    const bool compactMode = parentElem ? CompactMode( *parentElem ) : _compactMode;\n    OpenElement( element.Name(), compactMode );\n    while ( attribute ) {\n        PushAttribute( attribute->Name(), attribute->Value() );\n        attribute = attribute->Next();\n    }\n    return true;\n}\n\n\nbool XMLPrinter::VisitExit( const XMLElement& element )\n{\n    CloseElement( CompactMode(element) );\n    return true;\n}\n\n\nbool XMLPrinter::Visit( const XMLText& text )\n{\n    PushText( text.Value(), text.CData() );\n    return true;\n}\n\n\nbool XMLPrinter::Visit( const XMLComment& comment )\n{\n    PushComment( comment.Value() );\n    return true;\n}\n\nbool XMLPrinter::Visit( const XMLDeclaration& declaration )\n{\n    PushDeclaration( declaration.Value() );\n    return true;\n}\n\n\nbool XMLPrinter::Visit( const XMLUnknown& unknown )\n{\n    PushUnknown( unknown.Value() );\n    return true;\n}\n\n}   // namespace tinyxml2\n}\n}\n"
  },
  {
    "path": "sdk/src/external/tinyxml2/tinyxml2.h",
    "content": "/*\nOriginal code by Lee Thomason (www.grinninglizard.com)\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any\ndamages arising from the use of this software.\n\nPermission is granted to anyone to use this software for any\npurpose, including commercial applications, and to alter it and\nredistribute it freely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must\nnot claim that you wrote the original software. If you use this\nsoftware in a product, an acknowledgment in the product documentation\nwould be appreciated but is not required.\n\n2. Altered source versions must be plainly marked as such, and\nmust not be misrepresented as being the original software.\n\n3. This notice may not be removed or altered from any source\ndistribution.\n*/\n\n#ifndef TINYXML2_INCLUDED\n#define TINYXML2_INCLUDED\n\n#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__)\n#   include <ctype.h>\n#   include <limits.h>\n#   include <stdio.h>\n#   include <stdlib.h>\n#   include <string.h>\n#\tif defined(__PS3__)\n#\t\tinclude <stddef.h>\n#\tendif\n#else\n#   include <cctype>\n#   include <climits>\n#   include <cstdio>\n#   include <cstdlib>\n#   include <cstring>\n#endif\n#include <stdint.h>\n\n/*\n   TODO: intern strings instead of allocation.\n*/\n/*\n\tgcc:\n        g++ -Wall -DTINYXML2_DEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe\n\n    Formatting, Artistic Style:\n        AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h\n*/\n\n#if defined( _DEBUG ) || defined (__DEBUG__)\n#   ifndef TINYXML2_DEBUG\n#       define TINYXML2_DEBUG\n#   endif\n#endif\n\n#ifdef _MSC_VER\n#   pragma warning(push)\n#   pragma warning(disable: 4251)\n#endif\n\n#ifdef _WIN32\n#   ifdef TINYXML2_EXPORT\n#       define TINYXML2_LIB __declspec(dllexport)\n#   elif defined(TINYXML2_IMPORT)\n#       define TINYXML2_LIB __declspec(dllimport)\n#   else\n#       define TINYXML2_LIB\n#   endif\n#elif __GNUC__ >= 4\n#   define TINYXML2_LIB __attribute__((visibility(\"hidden\")))\n#else\n#   define TINYXML2_LIB\n#endif\n\n\n#if defined(TINYXML2_DEBUG)\n#   if defined(_MSC_VER)\n#       // \"(void)0,\" is for suppressing C4127 warning in \"assert(false)\", \"assert(true)\" and the like\n#       define TIXMLASSERT( x )           if ( !((void)0,(x))) { __debugbreak(); }\n#   elif defined (ANDROID_NDK)\n#       include <android/log.h>\n#       define TIXMLASSERT( x )           if ( !(x)) { __android_log_assert( \"assert\", \"grinliz\", \"ASSERT in '%s' at %d.\", __FILE__, __LINE__ ); }\n#   else\n#       include <assert.h>\n#       define TIXMLASSERT                assert\n#   endif\n#else\n#   define TIXMLASSERT( x )               {}\n#endif\n\n\n/* Versioning, past 1.0.14:\n\thttp://semver.org/\n*/\nstatic const int TIXML2_MAJOR_VERSION = 6;\nstatic const int TIXML2_MINOR_VERSION = 2;\nstatic const int TIXML2_PATCH_VERSION = 0;\n\n#define TINYXML2_MAJOR_VERSION 6\n#define TINYXML2_MINOR_VERSION 2\n#define TINYXML2_PATCH_VERSION 0\n\n// A fixed element depth limit is problematic. There needs to be a \n// limit to avoid a stack overflow. However, that limit varies per \n// system, and the capacity of the stack. On the other hand, it's a trivial \n// attack that can result from ill, malicious, or even correctly formed XML, \n// so there needs to be a limit in place.\nstatic const int TINYXML2_MAX_ELEMENT_DEPTH = 100;\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\nnamespace tinyxml2\n{\nclass XMLDocument;\nclass XMLElement;\nclass XMLAttribute;\nclass XMLComment;\nclass XMLText;\nclass XMLDeclaration;\nclass XMLUnknown;\nclass XMLPrinter;\n\n/*\n\tA class that wraps strings. Normally stores the start and end\n\tpointers into the XML file itself, and will apply normalization\n\tand entity translation if actually read. Can also store (and memory\n\tmanage) a traditional char[]\n*/\nclass StrPair\n{\npublic:\n    enum {\n        NEEDS_ENTITY_PROCESSING\t\t\t= 0x01,\n        NEEDS_NEWLINE_NORMALIZATION\t\t= 0x02,\n        NEEDS_WHITESPACE_COLLAPSING     = 0x04,\n\n        TEXT_ELEMENT\t\t            = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,\n        TEXT_ELEMENT_LEAVE_ENTITIES\t\t= NEEDS_NEWLINE_NORMALIZATION,\n        ATTRIBUTE_NAME\t\t            = 0,\n        ATTRIBUTE_VALUE\t\t            = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,\n        ATTRIBUTE_VALUE_LEAVE_ENTITIES  = NEEDS_NEWLINE_NORMALIZATION,\n        COMMENT\t\t\t\t\t\t\t= NEEDS_NEWLINE_NORMALIZATION\n    };\n\n    StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {}\n    ~StrPair();\n\n    void Set( char* start, char* end, int flags ) {\n        TIXMLASSERT( start );\n        TIXMLASSERT( end );\n        Reset();\n        _start  = start;\n        _end    = end;\n        _flags  = flags | NEEDS_FLUSH;\n    }\n\n    const char* GetStr();\n\n    bool Empty() const {\n        return _start == _end;\n    }\n\n    void SetInternedStr( const char* str ) {\n        Reset();\n        _start = const_cast<char*>(str);\n    }\n\n    void SetStr( const char* str, int flags=0 );\n\n    char* ParseText( char* in, const char* endTag, int strFlags, int* curLineNumPtr );\n    char* ParseName( char* in );\n\n    void TransferTo( StrPair* other );\n\tvoid Reset();\n\nprivate:\n    void CollapseWhitespace();\n\n    enum {\n        NEEDS_FLUSH = 0x100,\n        NEEDS_DELETE = 0x200\n    };\n\n    int     _flags;\n    char*   _start;\n    char*   _end;\n\n    StrPair( const StrPair& other );\t// not supported\n    void operator=( StrPair& other );\t// not supported, use TransferTo()\n};\n\n\n/*\n\tA dynamic array of Plain Old Data. Doesn't support constructors, etc.\n\tHas a small initial memory pool, so that low or no usage will not\n\tcause a call to new/delete\n*/\ntemplate <class T, int INITIAL_SIZE>\nclass DynArray\n{\npublic:\n    DynArray() :\n        _mem( _pool ),\n        _allocated( INITIAL_SIZE ),\n        _size( 0 )\n    {\n    }\n\n    ~DynArray() {\n        if ( _mem != _pool ) {\n            delete [] _mem;\n        }\n    }\n\n    void Clear() {\n        _size = 0;\n    }\n\n    void Push( T t ) {\n        TIXMLASSERT( _size < INT_MAX );\n        EnsureCapacity( _size+1 );\n        _mem[_size] = t;\n        ++_size;\n    }\n\n    T* PushArr( int count ) {\n        TIXMLASSERT( count >= 0 );\n        TIXMLASSERT( _size <= INT_MAX - count );\n        EnsureCapacity( _size+count );\n        T* ret = &_mem[_size];\n        _size += count;\n        return ret;\n    }\n\n    T Pop() {\n        TIXMLASSERT( _size > 0 );\n        --_size;\n        return _mem[_size];\n    }\n\n    void PopArr( int count ) {\n        TIXMLASSERT( _size >= count );\n        _size -= count;\n    }\n\n    bool Empty() const\t\t\t\t\t{\n        return _size == 0;\n    }\n\n    T& operator[](int i)\t\t\t\t{\n        TIXMLASSERT( i>= 0 && i < _size );\n        return _mem[i];\n    }\n\n    const T& operator[](int i) const\t{\n        TIXMLASSERT( i>= 0 && i < _size );\n        return _mem[i];\n    }\n\n    const T& PeekTop() const            {\n        TIXMLASSERT( _size > 0 );\n        return _mem[ _size - 1];\n    }\n\n    int Size() const\t\t\t\t\t{\n        TIXMLASSERT( _size >= 0 );\n        return _size;\n    }\n\n    int Capacity() const\t\t\t\t{\n        TIXMLASSERT( _allocated >= INITIAL_SIZE );\n        return _allocated;\n    }\n\n\tvoid SwapRemove(int i) {\n\t\tTIXMLASSERT(i >= 0 && i < _size);\n\t\tTIXMLASSERT(_size > 0);\n\t\t_mem[i] = _mem[_size - 1];\n\t\t--_size;\n\t}\n\n    const T* Mem() const\t\t\t\t{\n        TIXMLASSERT( _mem );\n        return _mem;\n    }\n\n    T* Mem()\t\t\t\t\t\t\t{\n        TIXMLASSERT( _mem );\n        return _mem;\n    }\n\nprivate:\n    DynArray( const DynArray& ); // not supported\n    void operator=( const DynArray& ); // not supported\n\n    void EnsureCapacity( int cap ) {\n        TIXMLASSERT( cap > 0 );\n        if ( cap > _allocated ) {\n            TIXMLASSERT( cap <= INT_MAX / 2 );\n            int newAllocated = cap * 2;\n            T* newMem = new T[newAllocated];\n            TIXMLASSERT( newAllocated >= _size );\n            memcpy( newMem, _mem, sizeof(T)*_size );\t// warning: not using constructors, only works for PODs\n            if ( _mem != _pool ) {\n                delete [] _mem;\n            }\n            _mem = newMem;\n            _allocated = newAllocated;\n        }\n    }\n\n    T*  _mem;\n    T   _pool[INITIAL_SIZE];\n    int _allocated;\t\t// objects allocated\n    int _size;\t\t\t// number objects in use\n};\n\n\n/*\n\tParent virtual class of a pool for fast allocation\n\tand deallocation of objects.\n*/\nclass MemPool\n{\npublic:\n    MemPool() {}\n    virtual ~MemPool() {}\n\n    virtual int ItemSize() const = 0;\n    virtual void* Alloc() = 0;\n    virtual void Free( void* ) = 0;\n    virtual void SetTracked() = 0;\n    virtual void Clear() = 0;\n};\n\n\n/*\n\tTemplate child class to create pools of the correct type.\n*/\ntemplate< int ITEM_SIZE >\nclass MemPoolT : public MemPool\n{\npublic:\n    MemPoolT() : _blockPtrs(), _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0)\t{}\n    ~MemPoolT() {\n        Clear();\n    }\n    \n    void Clear() {\n        // Delete the blocks.\n        while( !_blockPtrs.Empty()) {\n            Block* lastBlock = _blockPtrs.Pop();\n            delete lastBlock;\n        }\n        _root = 0;\n        _currentAllocs = 0;\n        _nAllocs = 0;\n        _maxAllocs = 0;\n        _nUntracked = 0;\n    }\n\n    virtual int ItemSize() const\t{\n        return ITEM_SIZE;\n    }\n    int CurrentAllocs() const\t\t{\n        return _currentAllocs;\n    }\n\n    virtual void* Alloc() {\n        if ( !_root ) {\n            // Need a new block.\n            Block* block = new Block();\n            _blockPtrs.Push( block );\n\n            Item* blockItems = block->items;\n            for( int i = 0; i < ITEMS_PER_BLOCK - 1; ++i ) {\n                blockItems[i].next = &(blockItems[i + 1]);\n            }\n            blockItems[ITEMS_PER_BLOCK - 1].next = 0;\n            _root = blockItems;\n        }\n        Item* const result = _root;\n        TIXMLASSERT( result != 0 );\n        _root = _root->next;\n\n        ++_currentAllocs;\n        if ( _currentAllocs > _maxAllocs ) {\n            _maxAllocs = _currentAllocs;\n        }\n        ++_nAllocs;\n        ++_nUntracked;\n        return result;\n    }\n    \n    virtual void Free( void* mem ) {\n        if ( !mem ) {\n            return;\n        }\n        --_currentAllocs;\n        Item* item = static_cast<Item*>( mem );\n#ifdef TINYXML2_DEBUG\n        memset( item, 0xfe, sizeof( *item ) );\n#endif\n        item->next = _root;\n        _root = item;\n    }\n    void Trace( const char* name ) {\n        printf( \"Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\\n\",\n                name, _maxAllocs, _maxAllocs * ITEM_SIZE / 1024, _currentAllocs,\n                ITEM_SIZE, _nAllocs, _blockPtrs.Size() );\n    }\n\n    void SetTracked() {\n        --_nUntracked;\n    }\n\n    int Untracked() const {\n        return _nUntracked;\n    }\n\n\t// This number is perf sensitive. 4k seems like a good tradeoff on my machine.\n\t// The test file is large, 170k.\n\t// Release:\t\tVS2010 gcc(no opt)\n\t//\t\t1k:\t\t4000\n\t//\t\t2k:\t\t4000\n\t//\t\t4k:\t\t3900\t21000\n\t//\t\t16k:\t5200\n\t//\t\t32k:\t4300\n\t//\t\t64k:\t4000\t21000\n    // Declared public because some compilers do not accept to use ITEMS_PER_BLOCK\n    // in private part if ITEMS_PER_BLOCK is private\n    enum { ITEMS_PER_BLOCK = (4 * 1024) / ITEM_SIZE };\n\nprivate:\n    MemPoolT( const MemPoolT& ); // not supported\n    void operator=( const MemPoolT& ); // not supported\n\n    union Item {\n        Item*   next;\n        char    itemData[ITEM_SIZE];\n    };\n    struct Block {\n        Item items[ITEMS_PER_BLOCK];\n    };\n    DynArray< Block*, 10 > _blockPtrs;\n    Item* _root;\n\n    int _currentAllocs;\n    int _nAllocs;\n    int _maxAllocs;\n    int _nUntracked;\n};\n\n\n\n/**\n\tImplements the interface to the \"Visitor pattern\" (see the Accept() method.)\n\tIf you call the Accept() method, it requires being passed a XMLVisitor\n\tclass to handle callbacks. For nodes that contain other nodes (Document, Element)\n\tyou will get called with a VisitEnter/VisitExit pair. Nodes that are always leafs\n\tare simply called with Visit().\n\n\tIf you return 'true' from a Visit method, recursive parsing will continue. If you return\n\tfalse, <b>no children of this node or its siblings</b> will be visited.\n\n\tAll flavors of Visit methods have a default implementation that returns 'true' (continue\n\tvisiting). You need to only override methods that are interesting to you.\n\n\tGenerally Accept() is called on the XMLDocument, although all nodes support visiting.\n\n\tYou should never change the document from a callback.\n\n\t@sa XMLNode::Accept()\n*/\nclass TINYXML2_LIB XMLVisitor\n{\npublic:\n    virtual ~XMLVisitor() {}\n\n    /// Visit a document.\n    virtual bool VisitEnter( const XMLDocument& /*doc*/ )\t\t\t{\n        return true;\n    }\n    /// Visit a document.\n    virtual bool VisitExit( const XMLDocument& /*doc*/ )\t\t\t{\n        return true;\n    }\n\n    /// Visit an element.\n    virtual bool VisitEnter( const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/ )\t{\n        return true;\n    }\n    /// Visit an element.\n    virtual bool VisitExit( const XMLElement& /*element*/ )\t\t\t{\n        return true;\n    }\n\n    /// Visit a declaration.\n    virtual bool Visit( const XMLDeclaration& /*declaration*/ )\t\t{\n        return true;\n    }\n    /// Visit a text node.\n    virtual bool Visit( const XMLText& /*text*/ )\t\t\t\t\t{\n        return true;\n    }\n    /// Visit a comment node.\n    virtual bool Visit( const XMLComment& /*comment*/ )\t\t\t\t{\n        return true;\n    }\n    /// Visit an unknown node.\n    virtual bool Visit( const XMLUnknown& /*unknown*/ )\t\t\t\t{\n        return true;\n    }\n};\n\n// WARNING: must match XMLDocument::_errorNames[]\nenum XMLError {\n    XML_SUCCESS = 0,\n    XML_NO_ATTRIBUTE,\n    XML_WRONG_ATTRIBUTE_TYPE,\n    XML_ERROR_FILE_NOT_FOUND,\n    XML_ERROR_FILE_COULD_NOT_BE_OPENED,\n    XML_ERROR_FILE_READ_ERROR,\n    UNUSED_XML_ERROR_ELEMENT_MISMATCH,\t// remove at next major version\n    XML_ERROR_PARSING_ELEMENT,\n    XML_ERROR_PARSING_ATTRIBUTE,\n    UNUSED_XML_ERROR_IDENTIFYING_TAG,\t// remove at next major version\n    XML_ERROR_PARSING_TEXT,\n    XML_ERROR_PARSING_CDATA,\n    XML_ERROR_PARSING_COMMENT,\n    XML_ERROR_PARSING_DECLARATION,\n    XML_ERROR_PARSING_UNKNOWN,\n    XML_ERROR_EMPTY_DOCUMENT,\n    XML_ERROR_MISMATCHED_ELEMENT,\n    XML_ERROR_PARSING,\n    XML_CAN_NOT_CONVERT_TEXT,\n    XML_NO_TEXT_NODE,\n\tXML_ELEMENT_DEPTH_EXCEEDED,\n\n\tXML_ERROR_COUNT\n};\n\n\n/*\n\tUtility functionality.\n*/\nclass TINYXML2_LIB XMLUtil\n{\npublic:\n    static const char* SkipWhiteSpace( const char* p, int* curLineNumPtr )\t{\n        TIXMLASSERT( p );\n\n        while( IsWhiteSpace(*p) ) {\n            if (curLineNumPtr && *p == '\\n') {\n                ++(*curLineNumPtr);\n            }\n            ++p;\n        }\n        TIXMLASSERT( p );\n        return p;\n    }\n    static char* SkipWhiteSpace( char* p, int* curLineNumPtr )\t\t\t\t{\n        return const_cast<char*>( SkipWhiteSpace( const_cast<const char*>(p), curLineNumPtr ) );\n    }\n\n    // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't\n    // correct, but simple, and usually works.\n    static bool IsWhiteSpace( char p )\t\t\t\t\t{\n        return !IsUTF8Continuation(p) && isspace( static_cast<unsigned char>(p) );\n    }\n    \n    inline static bool IsNameStartChar( unsigned char ch ) {\n        if ( ch >= 128 ) {\n            // This is a heuristic guess in attempt to not implement Unicode-aware isalpha()\n            return true;\n        }\n        if ( isalpha( ch ) ) {\n            return true;\n        }\n        return ch == ':' || ch == '_';\n    }\n    \n    inline static bool IsNameChar( unsigned char ch ) {\n        return IsNameStartChar( ch )\n               || isdigit( ch )\n               || ch == '.'\n               || ch == '-';\n    }\n\n    inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX )  {\n        if ( p == q ) {\n            return true;\n        }\n        TIXMLASSERT( p );\n        TIXMLASSERT( q );\n        TIXMLASSERT( nChar >= 0 );\n        return strncmp( p, q, nChar ) == 0;\n    }\n    \n    inline static bool IsUTF8Continuation( char p ) {\n        return ( p & 0x80 ) != 0;\n    }\n\n    static const char* ReadBOM( const char* p, bool* hasBOM );\n    // p is the starting location,\n    // the UTF-8 value of the entity will be placed in value, and length filled in.\n    static const char* GetCharacterRef( const char* p, char* value, int* length );\n    static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length );\n\n    // converts primitive types to strings\n    static void ToStr( int v, char* buffer, int bufferSize );\n    static void ToStr( unsigned v, char* buffer, int bufferSize );\n    static void ToStr( bool v, char* buffer, int bufferSize );\n    static void ToStr( float v, char* buffer, int bufferSize );\n    static void ToStr( double v, char* buffer, int bufferSize );\n\tstatic void ToStr(int64_t v, char* buffer, int bufferSize);\n\n    // converts strings to primitive types\n    static bool\tToInt( const char* str, int* value );\n    static bool ToUnsigned( const char* str, unsigned* value );\n    static bool\tToBool( const char* str, bool* value );\n    static bool\tToFloat( const char* str, float* value );\n    static bool ToDouble( const char* str, double* value );\n\tstatic bool ToInt64(const char* str, int64_t* value);\n\n\t// Changes what is serialized for a boolean value.\n\t// Default to \"true\" and \"false\". Shouldn't be changed\n\t// unless you have a special testing or compatibility need.\n\t// Be careful: static, global, & not thread safe.\n\t// Be sure to set static const memory as parameters.\n\tstatic void SetBoolSerialization(const char* writeTrue, const char* writeFalse);\n\nprivate:\n\tstatic const char* writeBoolTrue;\n\tstatic const char* writeBoolFalse;\n};\n\n\n/** XMLNode is a base class for every object that is in the\n\tXML Document Object Model (DOM), except XMLAttributes.\n\tNodes have siblings, a parent, and children which can\n\tbe navigated. A node is always in a XMLDocument.\n\tThe type of a XMLNode can be queried, and it can\n\tbe cast to its more defined type.\n\n\tA XMLDocument allocates memory for all its Nodes.\n\tWhen the XMLDocument gets deleted, all its Nodes\n\twill also be deleted.\n\n\t@verbatim\n\tA Document can contain:\tElement\t(container or leaf)\n\t\t\t\t\t\t\tComment (leaf)\n\t\t\t\t\t\t\tUnknown (leaf)\n\t\t\t\t\t\t\tDeclaration( leaf )\n\n\tAn Element can contain:\tElement (container or leaf)\n\t\t\t\t\t\t\tText\t(leaf)\n\t\t\t\t\t\t\tAttributes (not on tree)\n\t\t\t\t\t\t\tComment (leaf)\n\t\t\t\t\t\t\tUnknown (leaf)\n\n\t@endverbatim\n*/\nclass TINYXML2_LIB XMLNode\n{\n    friend class XMLDocument;\n    friend class XMLElement;\npublic:\n\n    /// Get the XMLDocument that owns this XMLNode.\n    const XMLDocument* GetDocument() const\t{\n        TIXMLASSERT( _document );\n        return _document;\n    }\n    /// Get the XMLDocument that owns this XMLNode.\n    XMLDocument* GetDocument()\t\t\t\t{\n        TIXMLASSERT( _document );\n        return _document;\n    }\n\n    /// Safely cast to an Element, or null.\n    virtual XMLElement*\t\tToElement()\t\t{\n        return 0;\n    }\n    /// Safely cast to Text, or null.\n    virtual XMLText*\t\tToText()\t\t{\n        return 0;\n    }\n    /// Safely cast to a Comment, or null.\n    virtual XMLComment*\t\tToComment()\t\t{\n        return 0;\n    }\n    /// Safely cast to a Document, or null.\n    virtual XMLDocument*\tToDocument()\t{\n        return 0;\n    }\n    /// Safely cast to a Declaration, or null.\n    virtual XMLDeclaration*\tToDeclaration()\t{\n        return 0;\n    }\n    /// Safely cast to an Unknown, or null.\n    virtual XMLUnknown*\t\tToUnknown()\t\t{\n        return 0;\n    }\n\n    virtual const XMLElement*\t\tToElement() const\t\t{\n        return 0;\n    }\n    virtual const XMLText*\t\t\tToText() const\t\t\t{\n        return 0;\n    }\n    virtual const XMLComment*\t\tToComment() const\t\t{\n        return 0;\n    }\n    virtual const XMLDocument*\t\tToDocument() const\t\t{\n        return 0;\n    }\n    virtual const XMLDeclaration*\tToDeclaration() const\t{\n        return 0;\n    }\n    virtual const XMLUnknown*\t\tToUnknown() const\t\t{\n        return 0;\n    }\n\n    /** The meaning of 'value' changes for the specific type.\n    \t@verbatim\n    \tDocument:\tempty (NULL is returned, not an empty string)\n    \tElement:\tname of the element\n    \tComment:\tthe comment text\n    \tUnknown:\tthe tag contents\n    \tText:\t\tthe text string\n    \t@endverbatim\n    */\n    const char* Value() const;\n\n    /** Set the Value of an XML node.\n    \t@sa Value()\n    */\n    void SetValue( const char* val, bool staticMem=false );\n\n    /// Gets the line number the node is in, if the document was parsed from a file.\n    int GetLineNum() const { return _parseLineNum; }\n\n    /// Get the parent of this node on the DOM.\n    const XMLNode*\tParent() const\t\t\t{\n        return _parent;\n    }\n\n    XMLNode* Parent()\t\t\t\t\t\t{\n        return _parent;\n    }\n\n    /// Returns true if this node has no children.\n    bool NoChildren() const\t\t\t\t\t{\n        return !_firstChild;\n    }\n\n    /// Get the first child node, or null if none exists.\n    const XMLNode*  FirstChild() const\t\t{\n        return _firstChild;\n    }\n\n    XMLNode*\t\tFirstChild()\t\t\t{\n        return _firstChild;\n    }\n\n    /** Get the first child element, or optionally the first child\n        element with the specified name.\n    */\n    const XMLElement* FirstChildElement( const char* name = 0 ) const;\n\n    XMLElement* FirstChildElement( const char* name = 0 )\t{\n        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->FirstChildElement( name ));\n    }\n\n    /// Get the last child node, or null if none exists.\n    const XMLNode*\tLastChild() const\t\t\t\t\t\t{\n        return _lastChild;\n    }\n\n    XMLNode*\t\tLastChild()\t\t\t\t\t\t\t\t{\n        return _lastChild;\n    }\n\n    /** Get the last child element or optionally the last child\n        element with the specified name.\n    */\n    const XMLElement* LastChildElement( const char* name = 0 ) const;\n\n    XMLElement* LastChildElement( const char* name = 0 )\t{\n        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->LastChildElement(name) );\n    }\n\n    /// Get the previous (left) sibling node of this node.\n    const XMLNode*\tPreviousSibling() const\t\t\t\t\t{\n        return _prev;\n    }\n\n    XMLNode*\tPreviousSibling()\t\t\t\t\t\t\t{\n        return _prev;\n    }\n\n    /// Get the previous (left) sibling element of this node, with an optionally supplied name.\n    const XMLElement*\tPreviousSiblingElement( const char* name = 0 ) const ;\n\n    XMLElement*\tPreviousSiblingElement( const char* name = 0 ) {\n        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->PreviousSiblingElement( name ) );\n    }\n\n    /// Get the next (right) sibling node of this node.\n    const XMLNode*\tNextSibling() const\t\t\t\t\t\t{\n        return _next;\n    }\n\n    XMLNode*\tNextSibling()\t\t\t\t\t\t\t\t{\n        return _next;\n    }\n\n    /// Get the next (right) sibling element of this node, with an optionally supplied name.\n    const XMLElement*\tNextSiblingElement( const char* name = 0 ) const;\n\n    XMLElement*\tNextSiblingElement( const char* name = 0 )\t{\n        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->NextSiblingElement( name ) );\n    }\n\n    /**\n    \tAdd a child node as the last (right) child.\n\t\tIf the child node is already part of the document,\n\t\tit is moved from its old location to the new location.\n\t\tReturns the addThis argument or 0 if the node does not\n\t\tbelong to the same document.\n    */\n    XMLNode* InsertEndChild( XMLNode* addThis );\n\n    XMLNode* LinkEndChild( XMLNode* addThis )\t{\n        return InsertEndChild( addThis );\n    }\n    /**\n    \tAdd a child node as the first (left) child.\n\t\tIf the child node is already part of the document,\n\t\tit is moved from its old location to the new location.\n\t\tReturns the addThis argument or 0 if the node does not\n\t\tbelong to the same document.\n    */\n    XMLNode* InsertFirstChild( XMLNode* addThis );\n    /**\n    \tAdd a node after the specified child node.\n\t\tIf the child node is already part of the document,\n\t\tit is moved from its old location to the new location.\n\t\tReturns the addThis argument or 0 if the afterThis node\n\t\tis not a child of this node, or if the node does not\n\t\tbelong to the same document.\n    */\n    XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis );\n\n    /**\n    \tDelete all the children of this node.\n    */\n    void DeleteChildren();\n\n    /**\n    \tDelete a child of this node.\n    */\n    void DeleteChild( XMLNode* node );\n\n    /**\n    \tMake a copy of this node, but not its children.\n    \tYou may pass in a Document pointer that will be\n    \tthe owner of the new Node. If the 'document' is\n    \tnull, then the node returned will be allocated\n    \tfrom the current Document. (this->GetDocument())\n\n    \tNote: if called on a XMLDocument, this will return null.\n    */\n    virtual XMLNode* ShallowClone( XMLDocument* document ) const = 0;\n\n\t/**\n\t\tMake a copy of this node and all its children.\n\n\t\tIf the 'target' is null, then the nodes will\n\t\tbe allocated in the current document. If 'target' \n        is specified, the memory will be allocated is the \n        specified XMLDocument.\n\n\t\tNOTE: This is probably not the correct tool to \n\t\tcopy a document, since XMLDocuments can have multiple\n\t\ttop level XMLNodes. You probably want to use\n        XMLDocument::DeepCopy()\n\t*/\n\tXMLNode* DeepClone( XMLDocument* target ) const;\n\n    /**\n    \tTest if 2 nodes are the same, but don't test children.\n    \tThe 2 nodes do not need to be in the same Document.\n\n    \tNote: if called on a XMLDocument, this will return false.\n    */\n    virtual bool ShallowEqual( const XMLNode* compare ) const = 0;\n\n    /** Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the\n    \tXML tree will be conditionally visited and the host will be called back\n    \tvia the XMLVisitor interface.\n\n    \tThis is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse\n    \tthe XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this\n    \tinterface versus any other.)\n\n    \tThe interface has been based on ideas from:\n\n    \t- http://www.saxproject.org/\n    \t- http://c2.com/cgi/wiki?HierarchicalVisitorPattern\n\n    \tWhich are both good references for \"visiting\".\n\n    \tAn example of using Accept():\n    \t@verbatim\n    \tXMLPrinter printer;\n    \ttinyxmlDoc.Accept( &printer );\n    \tconst char* xmlcstr = printer.CStr();\n    \t@endverbatim\n    */\n    virtual bool Accept( XMLVisitor* visitor ) const = 0;\n\n\t/** \n\t\tSet user data into the XMLNode. TinyXML-2 in \n\t\tno way processes or interprets user data.\n\t\tIt is initially 0.\n\t*/\n\tvoid SetUserData(void* userData)\t{ _userData = userData; }\n\n\t/**\n\t\tGet user data set into the XMLNode. TinyXML-2 in\n\t\tno way processes or interprets user data.\n\t\tIt is initially 0.\n\t*/\n\tvoid* GetUserData() const\t\t\t{ return _userData; }\n\nprotected:\n    XMLNode( XMLDocument* );\n    virtual ~XMLNode();\n\n    virtual char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr);\n\n    XMLDocument*\t_document;\n    XMLNode*\t\t_parent;\n    mutable StrPair\t_value;\n    int             _parseLineNum;\n\n    XMLNode*\t\t_firstChild;\n    XMLNode*\t\t_lastChild;\n\n    XMLNode*\t\t_prev;\n    XMLNode*\t\t_next;\n\n\tvoid*\t\t\t_userData;\n\nprivate:\n    MemPool*\t\t_memPool;\n    void Unlink( XMLNode* child );\n    static void DeleteNode( XMLNode* node );\n    void InsertChildPreamble( XMLNode* insertThis ) const;\n    const XMLElement* ToElementWithName( const char* name ) const;\n\n    XMLNode( const XMLNode& );\t// not supported\n    XMLNode& operator=( const XMLNode& );\t// not supported\n};\n\n\n/** XML text.\n\n\tNote that a text node can have child element nodes, for example:\n\t@verbatim\n\t<root>This is <b>bold</b></root>\n\t@endverbatim\n\n\tA text node can have 2 ways to output the next. \"normal\" output\n\tand CDATA. It will default to the mode it was parsed from the XML file and\n\tyou generally want to leave it alone, but you can change the output mode with\n\tSetCData() and query it with CData().\n*/\nclass TINYXML2_LIB XMLText : public XMLNode\n{\n    friend class XMLDocument;\npublic:\n    virtual bool Accept( XMLVisitor* visitor ) const;\n\n    virtual XMLText* ToText()\t\t\t{\n        return this;\n    }\n    virtual const XMLText* ToText() const\t{\n        return this;\n    }\n\n    /// Declare whether this should be CDATA or standard text.\n    void SetCData( bool isCData )\t\t\t{\n        _isCData = isCData;\n    }\n    /// Returns true if this is a CDATA text element.\n    bool CData() const\t\t\t\t\t\t{\n        return _isCData;\n    }\n\n    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\n    virtual bool ShallowEqual( const XMLNode* compare ) const;\n\nprotected:\n    XMLText( XMLDocument* doc )\t: XMLNode( doc ), _isCData( false )\t{}\n    virtual ~XMLText()\t\t\t\t\t\t\t\t\t\t\t\t{}\n\n    char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr );\n\nprivate:\n    bool _isCData;\n\n    XMLText( const XMLText& );\t// not supported\n    XMLText& operator=( const XMLText& );\t// not supported\n};\n\n\n/** An XML Comment. */\nclass TINYXML2_LIB XMLComment : public XMLNode\n{\n    friend class XMLDocument;\npublic:\n    virtual XMLComment*\tToComment()\t\t\t\t\t{\n        return this;\n    }\n    virtual const XMLComment* ToComment() const\t\t{\n        return this;\n    }\n\n    virtual bool Accept( XMLVisitor* visitor ) const;\n\n    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\n    virtual bool ShallowEqual( const XMLNode* compare ) const;\n\nprotected:\n    XMLComment( XMLDocument* doc );\n    virtual ~XMLComment();\n\n    char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr);\n\nprivate:\n    XMLComment( const XMLComment& );\t// not supported\n    XMLComment& operator=( const XMLComment& );\t// not supported\n};\n\n\n/** In correct XML the declaration is the first entry in the file.\n\t@verbatim\n\t\t<?xml version=\"1.0\" standalone=\"yes\"?>\n\t@endverbatim\n\n\tTinyXML-2 will happily read or write files without a declaration,\n\thowever.\n\n\tThe text of the declaration isn't interpreted. It is parsed\n\tand written as a string.\n*/\nclass TINYXML2_LIB XMLDeclaration : public XMLNode\n{\n    friend class XMLDocument;\npublic:\n    virtual XMLDeclaration*\tToDeclaration()\t\t\t\t\t{\n        return this;\n    }\n    virtual const XMLDeclaration* ToDeclaration() const\t\t{\n        return this;\n    }\n\n    virtual bool Accept( XMLVisitor* visitor ) const;\n\n    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\n    virtual bool ShallowEqual( const XMLNode* compare ) const;\n\nprotected:\n    XMLDeclaration( XMLDocument* doc );\n    virtual ~XMLDeclaration();\n\n    char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr );\n\nprivate:\n    XMLDeclaration( const XMLDeclaration& );\t// not supported\n    XMLDeclaration& operator=( const XMLDeclaration& );\t// not supported\n};\n\n\n/** Any tag that TinyXML-2 doesn't recognize is saved as an\n\tunknown. It is a tag of text, but should not be modified.\n\tIt will be written back to the XML, unchanged, when the file\n\tis saved.\n\n\tDTD tags get thrown into XMLUnknowns.\n*/\nclass TINYXML2_LIB XMLUnknown : public XMLNode\n{\n    friend class XMLDocument;\npublic:\n    virtual XMLUnknown*\tToUnknown()\t\t\t\t\t{\n        return this;\n    }\n    virtual const XMLUnknown* ToUnknown() const\t\t{\n        return this;\n    }\n\n    virtual bool Accept( XMLVisitor* visitor ) const;\n\n    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\n    virtual bool ShallowEqual( const XMLNode* compare ) const;\n\nprotected:\n    XMLUnknown( XMLDocument* doc );\n    virtual ~XMLUnknown();\n\n    char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr );\n\nprivate:\n    XMLUnknown( const XMLUnknown& );\t// not supported\n    XMLUnknown& operator=( const XMLUnknown& );\t// not supported\n};\n\n\n\n/** An attribute is a name-value pair. Elements have an arbitrary\n\tnumber of attributes, each with a unique name.\n\n\t@note The attributes are not XMLNodes. You may only query the\n\tNext() attribute in a list.\n*/\nclass TINYXML2_LIB XMLAttribute\n{\n    friend class XMLElement;\npublic:\n    /// The name of the attribute.\n    const char* Name() const;\n\n    /// The value of the attribute.\n    const char* Value() const;\n\n    /// Gets the line number the attribute is in, if the document was parsed from a file.\n    int GetLineNum() const { return _parseLineNum; }\n\n    /// The next attribute in the list.\n    const XMLAttribute* Next() const {\n        return _next;\n    }\n\n    /** IntValue interprets the attribute as an integer, and returns the value.\n        If the value isn't an integer, 0 will be returned. There is no error checking;\n    \tuse QueryIntValue() if you need error checking.\n    */\n\tint\tIntValue() const {\n\t\tint i = 0;\n\t\tQueryIntValue(&i);\n\t\treturn i;\n\t}\n\n\tint64_t Int64Value() const {\n\t\tint64_t i = 0;\n\t\tQueryInt64Value(&i);\n\t\treturn i;\n\t}\n\n    /// Query as an unsigned integer. See IntValue()\n    unsigned UnsignedValue() const\t\t\t{\n        unsigned i=0;\n        QueryUnsignedValue( &i );\n        return i;\n    }\n    /// Query as a boolean. See IntValue()\n    bool\t BoolValue() const\t\t\t\t{\n        bool b=false;\n        QueryBoolValue( &b );\n        return b;\n    }\n    /// Query as a double. See IntValue()\n    double \t DoubleValue() const\t\t\t{\n        double d=0;\n        QueryDoubleValue( &d );\n        return d;\n    }\n    /// Query as a float. See IntValue()\n    float\t FloatValue() const\t\t\t\t{\n        float f=0;\n        QueryFloatValue( &f );\n        return f;\n    }\n\n    /** QueryIntValue interprets the attribute as an integer, and returns the value\n    \tin the provided parameter. The function will return XML_SUCCESS on success,\n    \tand XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful.\n    */\n    XMLError QueryIntValue( int* value ) const;\n    /// See QueryIntValue\n    XMLError QueryUnsignedValue( unsigned int* value ) const;\n\t/// See QueryIntValue\n\tXMLError QueryInt64Value(int64_t* value) const;\n\t/// See QueryIntValue\n    XMLError QueryBoolValue( bool* value ) const;\n    /// See QueryIntValue\n    XMLError QueryDoubleValue( double* value ) const;\n    /// See QueryIntValue\n    XMLError QueryFloatValue( float* value ) const;\n\n    /// Set the attribute to a string value.\n    void SetAttribute( const char* value );\n    /// Set the attribute to value.\n    void SetAttribute( int value );\n    /// Set the attribute to value.\n    void SetAttribute( unsigned value );\n\t/// Set the attribute to value.\n\tvoid SetAttribute(int64_t value);\n\t/// Set the attribute to value.\n    void SetAttribute( bool value );\n    /// Set the attribute to value.\n    void SetAttribute( double value );\n    /// Set the attribute to value.\n    void SetAttribute( float value );\n\nprivate:\n    enum { BUF_SIZE = 200 };\n\n    XMLAttribute() : _name(), _value(),_parseLineNum( 0 ), _next( 0 ), _memPool( 0 ) {}\n    virtual ~XMLAttribute()\t{}\n\n    XMLAttribute( const XMLAttribute& );\t// not supported\n    void operator=( const XMLAttribute& );\t// not supported\n    void SetName( const char* name );\n\n    char* ParseDeep( char* p, bool processEntities, int* curLineNumPtr );\n\n    mutable StrPair _name;\n    mutable StrPair _value;\n    int             _parseLineNum;\n    XMLAttribute*   _next;\n    MemPool*        _memPool;\n};\n\n\n/** The element is a container class. It has a value, the element name,\n\tand can contain other elements, text, comments, and unknowns.\n\tElements also contain an arbitrary number of attributes.\n*/\nclass TINYXML2_LIB XMLElement : public XMLNode\n{\n    friend class XMLDocument;\npublic:\n    /// Get the name of an element (which is the Value() of the node.)\n    const char* Name() const\t\t{\n        return Value();\n    }\n    /// Set the name of the element.\n    void SetName( const char* str, bool staticMem=false )\t{\n        SetValue( str, staticMem );\n    }\n\n    virtual XMLElement* ToElement()\t\t\t\t{\n        return this;\n    }\n    virtual const XMLElement* ToElement() const {\n        return this;\n    }\n    virtual bool Accept( XMLVisitor* visitor ) const;\n\n    /** Given an attribute name, Attribute() returns the value\n    \tfor the attribute of that name, or null if none\n    \texists. For example:\n\n    \t@verbatim\n    \tconst char* value = ele->Attribute( \"foo\" );\n    \t@endverbatim\n\n    \tThe 'value' parameter is normally null. However, if specified,\n    \tthe attribute will only be returned if the 'name' and 'value'\n    \tmatch. This allow you to write code:\n\n    \t@verbatim\n    \tif ( ele->Attribute( \"foo\", \"bar\" ) ) callFooIsBar();\n    \t@endverbatim\n\n    \trather than:\n    \t@verbatim\n    \tif ( ele->Attribute( \"foo\" ) ) {\n    \t\tif ( strcmp( ele->Attribute( \"foo\" ), \"bar\" ) == 0 ) callFooIsBar();\n    \t}\n    \t@endverbatim\n    */\n    const char* Attribute( const char* name, const char* value=0 ) const;\n\n    /** Given an attribute name, IntAttribute() returns the value\n    \tof the attribute interpreted as an integer. The default\n        value will be returned if the attribute isn't present,\n        or if there is an error. (For a method with error\n    \tchecking, see QueryIntAttribute()).\n    */\n\tint IntAttribute(const char* name, int defaultValue = 0) const;\n    /// See IntAttribute()\n\tunsigned UnsignedAttribute(const char* name, unsigned defaultValue = 0) const;\n\t/// See IntAttribute()\n\tint64_t Int64Attribute(const char* name, int64_t defaultValue = 0) const;\n\t/// See IntAttribute()\n\tbool BoolAttribute(const char* name, bool defaultValue = false) const;\n    /// See IntAttribute()\n\tdouble DoubleAttribute(const char* name, double defaultValue = 0) const;\n    /// See IntAttribute()\n\tfloat FloatAttribute(const char* name, float defaultValue = 0) const;\n\n    /** Given an attribute name, QueryIntAttribute() returns\n    \tXML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion\n    \tcan't be performed, or XML_NO_ATTRIBUTE if the attribute\n    \tdoesn't exist. If successful, the result of the conversion\n    \twill be written to 'value'. If not successful, nothing will\n    \tbe written to 'value'. This allows you to provide default\n    \tvalue:\n\n    \t@verbatim\n    \tint value = 10;\n    \tQueryIntAttribute( \"foo\", &value );\t\t// if \"foo\" isn't found, value will still be 10\n    \t@endverbatim\n    */\n    XMLError QueryIntAttribute( const char* name, int* value ) const\t\t\t\t{\n        const XMLAttribute* a = FindAttribute( name );\n        if ( !a ) {\n            return XML_NO_ATTRIBUTE;\n        }\n        return a->QueryIntValue( value );\n    }\n\n\t/// See QueryIntAttribute()\n    XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const\t{\n        const XMLAttribute* a = FindAttribute( name );\n        if ( !a ) {\n            return XML_NO_ATTRIBUTE;\n        }\n        return a->QueryUnsignedValue( value );\n    }\n\n\t/// See QueryIntAttribute()\n\tXMLError QueryInt64Attribute(const char* name, int64_t* value) const {\n\t\tconst XMLAttribute* a = FindAttribute(name);\n\t\tif (!a) {\n\t\t\treturn XML_NO_ATTRIBUTE;\n\t\t}\n\t\treturn a->QueryInt64Value(value);\n\t}\n\n\t/// See QueryIntAttribute()\n    XMLError QueryBoolAttribute( const char* name, bool* value ) const\t\t\t\t{\n        const XMLAttribute* a = FindAttribute( name );\n        if ( !a ) {\n            return XML_NO_ATTRIBUTE;\n        }\n        return a->QueryBoolValue( value );\n    }\n    /// See QueryIntAttribute()\n    XMLError QueryDoubleAttribute( const char* name, double* value ) const\t\t\t{\n        const XMLAttribute* a = FindAttribute( name );\n        if ( !a ) {\n            return XML_NO_ATTRIBUTE;\n        }\n        return a->QueryDoubleValue( value );\n    }\n    /// See QueryIntAttribute()\n    XMLError QueryFloatAttribute( const char* name, float* value ) const\t\t\t{\n        const XMLAttribute* a = FindAttribute( name );\n        if ( !a ) {\n            return XML_NO_ATTRIBUTE;\n        }\n        return a->QueryFloatValue( value );\n    }\n\n\t/// See QueryIntAttribute()\n\tXMLError QueryStringAttribute(const char* name, const char** value) const {\n\t\tconst XMLAttribute* a = FindAttribute(name);\n\t\tif (!a) {\n\t\t\treturn XML_NO_ATTRIBUTE;\n\t\t}\n\t\t*value = a->Value();\n\t\treturn XML_SUCCESS;\n\t}\n\n\n\t\n    /** Given an attribute name, QueryAttribute() returns\n    \tXML_SUCCESS, XML_WRONG_ATTRIBUTE_TYPE if the conversion\n    \tcan't be performed, or XML_NO_ATTRIBUTE if the attribute\n    \tdoesn't exist. It is overloaded for the primitive types,\n\t\tand is a generally more convenient replacement of\n\t\tQueryIntAttribute() and related functions.\n\t\t\n\t\tIf successful, the result of the conversion\n    \twill be written to 'value'. If not successful, nothing will\n    \tbe written to 'value'. This allows you to provide default\n    \tvalue:\n\n    \t@verbatim\n    \tint value = 10;\n    \tQueryAttribute( \"foo\", &value );\t\t// if \"foo\" isn't found, value will still be 10\n    \t@endverbatim\n    */\n\tint QueryAttribute( const char* name, int* value ) const {\n\t\treturn QueryIntAttribute( name, value );\n\t}\n\n\tint QueryAttribute( const char* name, unsigned int* value ) const {\n\t\treturn QueryUnsignedAttribute( name, value );\n\t}\n\n\tint QueryAttribute(const char* name, int64_t* value) const {\n\t\treturn QueryInt64Attribute(name, value);\n\t}\n\n\tint QueryAttribute( const char* name, bool* value ) const {\n\t\treturn QueryBoolAttribute( name, value );\n\t}\n\n\tint QueryAttribute( const char* name, double* value ) const {\n\t\treturn QueryDoubleAttribute( name, value );\n\t}\n\n\tint QueryAttribute( const char* name, float* value ) const {\n\t\treturn QueryFloatAttribute( name, value );\n\t}\n\n\t/// Sets the named attribute to value.\n    void SetAttribute( const char* name, const char* value )\t{\n        XMLAttribute* a = FindOrCreateAttribute( name );\n        a->SetAttribute( value );\n    }\n    /// Sets the named attribute to value.\n    void SetAttribute( const char* name, int value )\t\t\t{\n        XMLAttribute* a = FindOrCreateAttribute( name );\n        a->SetAttribute( value );\n    }\n    /// Sets the named attribute to value.\n    void SetAttribute( const char* name, unsigned value )\t\t{\n        XMLAttribute* a = FindOrCreateAttribute( name );\n        a->SetAttribute( value );\n    }\n\n\t/// Sets the named attribute to value.\n\tvoid SetAttribute(const char* name, int64_t value) {\n\t\tXMLAttribute* a = FindOrCreateAttribute(name);\n\t\ta->SetAttribute(value);\n\t}\n\n\t/// Sets the named attribute to value.\n    void SetAttribute( const char* name, bool value )\t\t\t{\n        XMLAttribute* a = FindOrCreateAttribute( name );\n        a->SetAttribute( value );\n    }\n    /// Sets the named attribute to value.\n    void SetAttribute( const char* name, double value )\t\t{\n        XMLAttribute* a = FindOrCreateAttribute( name );\n        a->SetAttribute( value );\n    }\n    /// Sets the named attribute to value.\n    void SetAttribute( const char* name, float value )\t\t{\n        XMLAttribute* a = FindOrCreateAttribute( name );\n        a->SetAttribute( value );\n    }\n\n    /**\n    \tDelete an attribute.\n    */\n    void DeleteAttribute( const char* name );\n\n    /// Return the first attribute in the list.\n    const XMLAttribute* FirstAttribute() const {\n        return _rootAttribute;\n    }\n    /// Query a specific attribute in the list.\n    const XMLAttribute* FindAttribute( const char* name ) const;\n\n    /** Convenience function for easy access to the text inside an element. Although easy\n    \tand concise, GetText() is limited compared to getting the XMLText child\n    \tand accessing it directly.\n\n    \tIf the first child of 'this' is a XMLText, the GetText()\n    \treturns the character string of the Text node, else null is returned.\n\n    \tThis is a convenient method for getting the text of simple contained text:\n    \t@verbatim\n    \t<foo>This is text</foo>\n    \t\tconst char* str = fooElement->GetText();\n    \t@endverbatim\n\n    \t'str' will be a pointer to \"This is text\".\n\n    \tNote that this function can be misleading. If the element foo was created from\n    \tthis XML:\n    \t@verbatim\n    \t\t<foo><b>This is text</b></foo>\n    \t@endverbatim\n\n    \tthen the value of str would be null. The first child node isn't a text node, it is\n    \tanother element. From this XML:\n    \t@verbatim\n    \t\t<foo>This is <b>text</b></foo>\n    \t@endverbatim\n    \tGetText() will return \"This is \".\n    */\n    const char* GetText() const;\n\n    /** Convenience function for easy access to the text inside an element. Although easy\n    \tand concise, SetText() is limited compared to creating an XMLText child\n    \tand mutating it directly.\n\n    \tIf the first child of 'this' is a XMLText, SetText() sets its value to\n\t\tthe given string, otherwise it will create a first child that is an XMLText.\n\n    \tThis is a convenient method for setting the text of simple contained text:\n    \t@verbatim\n    \t<foo>This is text</foo>\n    \t\tfooElement->SetText( \"Hullaballoo!\" );\n     \t<foo>Hullaballoo!</foo>\n\t\t@endverbatim\n\n    \tNote that this function can be misleading. If the element foo was created from\n    \tthis XML:\n    \t@verbatim\n    \t\t<foo><b>This is text</b></foo>\n    \t@endverbatim\n\n    \tthen it will not change \"This is text\", but rather prefix it with a text element:\n    \t@verbatim\n    \t\t<foo>Hullaballoo!<b>This is text</b></foo>\n    \t@endverbatim\n\t\t\n\t\tFor this XML:\n    \t@verbatim\n    \t\t<foo />\n    \t@endverbatim\n    \tSetText() will generate\n    \t@verbatim\n    \t\t<foo>Hullaballoo!</foo>\n    \t@endverbatim\n    */\n\tvoid SetText( const char* inText );\n    /// Convenience method for setting text inside an element. See SetText() for important limitations.\n    void SetText( int value );\n    /// Convenience method for setting text inside an element. See SetText() for important limitations.\n    void SetText( unsigned value );  \n\t/// Convenience method for setting text inside an element. See SetText() for important limitations.\n\tvoid SetText(int64_t value);\n\t/// Convenience method for setting text inside an element. See SetText() for important limitations.\n    void SetText( bool value );  \n    /// Convenience method for setting text inside an element. See SetText() for important limitations.\n    void SetText( double value );  \n    /// Convenience method for setting text inside an element. See SetText() for important limitations.\n    void SetText( float value );  \n\n    /**\n    \tConvenience method to query the value of a child text node. This is probably best\n    \tshown by example. Given you have a document is this form:\n    \t@verbatim\n    \t\t<point>\n    \t\t\t<x>1</x>\n    \t\t\t<y>1.4</y>\n    \t\t</point>\n    \t@endverbatim\n\n    \tThe QueryIntText() and similar functions provide a safe and easier way to get to the\n    \t\"value\" of x and y.\n\n    \t@verbatim\n    \t\tint x = 0;\n    \t\tfloat y = 0;\t// types of x and y are contrived for example\n    \t\tconst XMLElement* xElement = pointElement->FirstChildElement( \"x\" );\n    \t\tconst XMLElement* yElement = pointElement->FirstChildElement( \"y\" );\n    \t\txElement->QueryIntText( &x );\n    \t\tyElement->QueryFloatText( &y );\n    \t@endverbatim\n\n    \t@returns XML_SUCCESS (0) on success, XML_CAN_NOT_CONVERT_TEXT if the text cannot be converted\n    \t\t\t to the requested type, and XML_NO_TEXT_NODE if there is no child text to query.\n\n    */\n    XMLError QueryIntText( int* ival ) const;\n    /// See QueryIntText()\n    XMLError QueryUnsignedText( unsigned* uval ) const;\n\t/// See QueryIntText()\n\tXMLError QueryInt64Text(int64_t* uval) const;\n\t/// See QueryIntText()\n    XMLError QueryBoolText( bool* bval ) const;\n    /// See QueryIntText()\n    XMLError QueryDoubleText( double* dval ) const;\n    /// See QueryIntText()\n    XMLError QueryFloatText( float* fval ) const;\n\n\tint IntText(int defaultValue = 0) const;\n\n\t/// See QueryIntText()\n\tunsigned UnsignedText(unsigned defaultValue = 0) const;\n\t/// See QueryIntText()\n\tint64_t Int64Text(int64_t defaultValue = 0) const;\n\t/// See QueryIntText()\n\tbool BoolText(bool defaultValue = false) const;\n\t/// See QueryIntText()\n\tdouble DoubleText(double defaultValue = 0) const;\n\t/// See QueryIntText()\n\tfloat FloatText(float defaultValue = 0) const;\n\n    // internal:\n    enum ElementClosingType {\n        OPEN,\t\t// <foo>\n        CLOSED,\t\t// <foo/>\n        CLOSING\t\t// </foo>\n    };\n    ElementClosingType ClosingType() const {\n        return _closingType;\n    }\n    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\n    virtual bool ShallowEqual( const XMLNode* compare ) const;\n\nprotected:\n    char* ParseDeep( char* p, StrPair* parentEndTag, int* curLineNumPtr );\n\nprivate:\n    XMLElement( XMLDocument* doc );\n    virtual ~XMLElement();\n    XMLElement( const XMLElement& );\t// not supported\n    void operator=( const XMLElement& );\t// not supported\n\n    XMLAttribute* FindAttribute( const char* name ) {\n        return const_cast<XMLAttribute*>(const_cast<const XMLElement*>(this)->FindAttribute( name ));\n    }\n    XMLAttribute* FindOrCreateAttribute( const char* name );\n    //void LinkAttribute( XMLAttribute* attrib );\n    char* ParseAttributes( char* p, int* curLineNumPtr );\n    static void DeleteAttribute( XMLAttribute* attribute );\n    XMLAttribute* CreateAttribute();\n\n    enum { BUF_SIZE = 200 };\n    ElementClosingType _closingType;\n    // The attribute list is ordered; there is no 'lastAttribute'\n    // because the list needs to be scanned for dupes before adding\n    // a new attribute.\n    XMLAttribute* _rootAttribute;\n};\n\n\nenum Whitespace {\n    PRESERVE_WHITESPACE,\n    COLLAPSE_WHITESPACE\n};\n\n\n/** A Document binds together all the functionality.\n\tIt can be saved, loaded, and printed to the screen.\n\tAll Nodes are connected and allocated to a Document.\n\tIf the Document is deleted, all its Nodes are also deleted.\n*/\nclass TINYXML2_LIB XMLDocument : public XMLNode\n{\n    friend class XMLElement;\n    // Gives access to SetError and Push/PopDepth, but over-access for everything else.\n    // Wishing C++ had \"internal\" scope.\n    friend class XMLNode;       \n    friend class XMLText;\n    friend class XMLComment;\n    friend class XMLDeclaration;\n    friend class XMLUnknown;\npublic:\n    /// constructor\n    XMLDocument( bool processEntities = true, Whitespace whitespaceMode = PRESERVE_WHITESPACE );\n    ~XMLDocument();\n\n    virtual XMLDocument* ToDocument()\t\t\t\t{\n        TIXMLASSERT( this == _document );\n        return this;\n    }\n    virtual const XMLDocument* ToDocument() const\t{\n        TIXMLASSERT( this == _document );\n        return this;\n    }\n\n    /**\n    \tParse an XML file from a character string.\n    \tReturns XML_SUCCESS (0) on success, or\n    \tan errorID.\n\n    \tYou may optionally pass in the 'nBytes', which is\n    \tthe number of bytes which will be parsed. If not\n    \tspecified, TinyXML-2 will assume 'xml' points to a\n    \tnull terminated string.\n    */\n    XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) );\n\n    /**\n    \tLoad an XML file from disk.\n    \tReturns XML_SUCCESS (0) on success, or\n    \tan errorID.\n    */\n    XMLError LoadFile( const char* filename );\n\n    /**\n    \tLoad an XML file from disk. You are responsible\n    \tfor providing and closing the FILE*. \n     \n        NOTE: The file should be opened as binary (\"rb\")\n        not text in order for TinyXML-2 to correctly\n        do newline normalization.\n\n    \tReturns XML_SUCCESS (0) on success, or\n    \tan errorID.\n    */\n    XMLError LoadFile( FILE* );\n\n    /**\n    \tSave the XML file to disk.\n    \tReturns XML_SUCCESS (0) on success, or\n    \tan errorID.\n    */\n    XMLError SaveFile( const char* filename, bool compact = false );\n\n    /**\n    \tSave the XML file to disk. You are responsible\n    \tfor providing and closing the FILE*.\n\n    \tReturns XML_SUCCESS (0) on success, or\n    \tan errorID.\n    */\n    XMLError SaveFile( FILE* fp, bool compact = false );\n\n    bool ProcessEntities() const\t\t{\n        return _processEntities;\n    }\n    Whitespace WhitespaceMode() const\t{\n        return _whitespaceMode;\n    }\n\n    /**\n    \tReturns true if this document has a leading Byte Order Mark of UTF8.\n    */\n    bool HasBOM() const {\n        return _writeBOM;\n    }\n    /** Sets whether to write the BOM when writing the file.\n    */\n    void SetBOM( bool useBOM ) {\n        _writeBOM = useBOM;\n    }\n\n    /** Return the root element of DOM. Equivalent to FirstChildElement().\n        To get the first node, use FirstChild().\n    */\n    XMLElement* RootElement()\t\t\t\t{\n        return FirstChildElement();\n    }\n    const XMLElement* RootElement() const\t{\n        return FirstChildElement();\n    }\n\n    /** Print the Document. If the Printer is not provided, it will\n        print to stdout. If you provide Printer, this can print to a file:\n    \t@verbatim\n    \tXMLPrinter printer( fp );\n    \tdoc.Print( &printer );\n    \t@endverbatim\n\n    \tOr you can use a printer to print to memory:\n    \t@verbatim\n    \tXMLPrinter printer;\n    \tdoc.Print( &printer );\n    \t// printer.CStr() has a const char* to the XML\n    \t@endverbatim\n    */\n    void Print( XMLPrinter* streamer=0 ) const;\n    virtual bool Accept( XMLVisitor* visitor ) const;\n\n    /**\n    \tCreate a new Element associated with\n    \tthis Document. The memory for the Element\n    \tis managed by the Document.\n    */\n    XMLElement* NewElement( const char* name );\n    /**\n    \tCreate a new Comment associated with\n    \tthis Document. The memory for the Comment\n    \tis managed by the Document.\n    */\n    XMLComment* NewComment( const char* comment );\n    /**\n    \tCreate a new Text associated with\n    \tthis Document. The memory for the Text\n    \tis managed by the Document.\n    */\n    XMLText* NewText( const char* text );\n    /**\n    \tCreate a new Declaration associated with\n    \tthis Document. The memory for the object\n    \tis managed by the Document.\n\n    \tIf the 'text' param is null, the standard\n    \tdeclaration is used.:\n    \t@verbatim\n    \t\t<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n    \t@endverbatim\n    */\n    XMLDeclaration* NewDeclaration( const char* text=0 );\n    /**\n    \tCreate a new Unknown associated with\n    \tthis Document. The memory for the object\n    \tis managed by the Document.\n    */\n    XMLUnknown* NewUnknown( const char* text );\n\n    /**\n    \tDelete a node associated with this document.\n    \tIt will be unlinked from the DOM.\n    */\n    void DeleteNode( XMLNode* node );\n\n    void ClearError() {\n        SetError(XML_SUCCESS, 0, 0);\n    }\n\n    /// Return true if there was an error parsing the document.\n    bool Error() const {\n        return _errorID != XML_SUCCESS;\n    }\n    /// Return the errorID.\n    XMLError  ErrorID() const {\n        return _errorID;\n    }\n\tconst char* ErrorName() const;\n    static const char* ErrorIDToName(XMLError errorID);\n\n    /** Returns a \"long form\" error description. A hopefully helpful \n        diagnostic with location, line number, and/or additional info.\n    */\n\tconst char* ErrorStr() const;\n\n    /// A (trivial) utility function that prints the ErrorStr() to stdout.\n    void PrintError() const;\n\n    /// Return the line where the error occured, or zero if unknown.\n    int ErrorLineNum() const\n    {\n        return _errorLineNum;\n    }\n    \n    /// Clear the document, resetting it to the initial state.\n    void Clear();\n\n\t/**\n\t\tCopies this document to a target document.\n\t\tThe target will be completely cleared before the copy.\n\t\tIf you want to copy a sub-tree, see XMLNode::DeepClone().\n\n\t\tNOTE: that the 'target' must be non-null.\n\t*/\n\tvoid DeepCopy(XMLDocument* target) const;\n\n\t// internal\n    char* Identify( char* p, XMLNode** node );\n\n\t// internal\n\tvoid MarkInUse(XMLNode*);\n\n    virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const\t{\n        return 0;\n    }\n    virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const\t{\n        return false;\n    }\n\nprivate:\n    XMLDocument( const XMLDocument& );\t// not supported\n    void operator=( const XMLDocument& );\t// not supported\n\n    bool\t\t\t_writeBOM;\n    bool\t\t\t_processEntities;\n    XMLError\t\t_errorID;\n    Whitespace\t\t_whitespaceMode;\n    mutable StrPair\t_errorStr;\n    int             _errorLineNum;\n    char*\t\t\t_charBuffer;\n    int\t\t\t\t_parseCurLineNum;\n\tint\t\t\t\t_parsingDepth;\n\t// Memory tracking does add some overhead.\n\t// However, the code assumes that you don't\n\t// have a bunch of unlinked nodes around.\n\t// Therefore it takes less memory to track\n\t// in the document vs. a linked list in the XMLNode,\n\t// and the performance is the same.\n\tDynArray<XMLNode*, 10> _unlinked;\n\n    MemPoolT< sizeof(XMLElement) >\t _elementPool;\n    MemPoolT< sizeof(XMLAttribute) > _attributePool;\n    MemPoolT< sizeof(XMLText) >\t\t _textPool;\n    MemPoolT< sizeof(XMLComment) >\t _commentPool;\n\n\tstatic const char* _errorNames[XML_ERROR_COUNT];\n\n    void Parse();\n\n    void SetError( XMLError error, int lineNum, const char* format, ... );\n\n\t// Something of an obvious security hole, once it was discovered.\n\t// Either an ill-formed XML or an excessively deep one can overflow\n\t// the stack. Track stack depth, and error out if needed.\n\tclass DepthTracker {\n\tpublic:\n\t\tDepthTracker(XMLDocument * document) { \n\t\t\tthis->_document = document; \n\t\t\tdocument->PushDepth();\n\t\t}\n\t\t~DepthTracker() {\n\t\t\t_document->PopDepth();\n\t\t}\n\tprivate:\n\t\tXMLDocument * _document;\n\t};\n\tvoid PushDepth();\n\tvoid PopDepth();\n\n    template<class NodeType, int PoolElementSize>\n    NodeType* CreateUnlinkedNode( MemPoolT<PoolElementSize>& pool );\n};\n\ntemplate<class NodeType, int PoolElementSize>\ninline NodeType* XMLDocument::CreateUnlinkedNode( MemPoolT<PoolElementSize>& pool )\n{\n    TIXMLASSERT( sizeof( NodeType ) == PoolElementSize );\n    TIXMLASSERT( sizeof( NodeType ) == pool.ItemSize() );\n    NodeType* returnNode = new (pool.Alloc()) NodeType( this );\n    TIXMLASSERT( returnNode );\n    returnNode->_memPool = &pool;\n\n\t_unlinked.Push(returnNode);\n    return returnNode;\n}\n\n/**\n\tA XMLHandle is a class that wraps a node pointer with null checks; this is\n\tan incredibly useful thing. Note that XMLHandle is not part of the TinyXML-2\n\tDOM structure. It is a separate utility class.\n\n\tTake an example:\n\t@verbatim\n\t<Document>\n\t\t<Element attributeA = \"valueA\">\n\t\t\t<Child attributeB = \"value1\" />\n\t\t\t<Child attributeB = \"value2\" />\n\t\t</Element>\n\t</Document>\n\t@endverbatim\n\n\tAssuming you want the value of \"attributeB\" in the 2nd \"Child\" element, it's very\n\teasy to write a *lot* of code that looks like:\n\n\t@verbatim\n\tXMLElement* root = document.FirstChildElement( \"Document\" );\n\tif ( root )\n\t{\n\t\tXMLElement* element = root->FirstChildElement( \"Element\" );\n\t\tif ( element )\n\t\t{\n\t\t\tXMLElement* child = element->FirstChildElement( \"Child\" );\n\t\t\tif ( child )\n\t\t\t{\n\t\t\t\tXMLElement* child2 = child->NextSiblingElement( \"Child\" );\n\t\t\t\tif ( child2 )\n\t\t\t\t{\n\t\t\t\t\t// Finally do something useful.\n\t@endverbatim\n\n\tAnd that doesn't even cover \"else\" cases. XMLHandle addresses the verbosity\n\tof such code. A XMLHandle checks for null pointers so it is perfectly safe\n\tand correct to use:\n\n\t@verbatim\n\tXMLHandle docHandle( &document );\n\tXMLElement* child2 = docHandle.FirstChildElement( \"Document\" ).FirstChildElement( \"Element\" ).FirstChildElement().NextSiblingElement();\n\tif ( child2 )\n\t{\n\t\t// do something useful\n\t@endverbatim\n\n\tWhich is MUCH more concise and useful.\n\n\tIt is also safe to copy handles - internally they are nothing more than node pointers.\n\t@verbatim\n\tXMLHandle handleCopy = handle;\n\t@endverbatim\n\n\tSee also XMLConstHandle, which is the same as XMLHandle, but operates on const objects.\n*/\nclass TINYXML2_LIB XMLHandle\n{\npublic:\n    /// Create a handle from any node (at any depth of the tree.) This can be a null pointer.\n    XMLHandle( XMLNode* node ) : _node( node ) {\n    }\n    /// Create a handle from a node.\n    XMLHandle( XMLNode& node ) : _node( &node ) {\n    }\n    /// Copy constructor\n    XMLHandle( const XMLHandle& ref ) : _node( ref._node ) {\n    }\n    /// Assignment\n    XMLHandle& operator=( const XMLHandle& ref )\t\t\t\t\t\t\t{\n        _node = ref._node;\n        return *this;\n    }\n\n    /// Get the first child of this handle.\n    XMLHandle FirstChild() \t\t\t\t\t\t\t\t\t\t\t\t\t{\n        return XMLHandle( _node ? _node->FirstChild() : 0 );\n    }\n    /// Get the first child element of this handle.\n    XMLHandle FirstChildElement( const char* name = 0 )\t\t\t\t\t\t{\n        return XMLHandle( _node ? _node->FirstChildElement( name ) : 0 );\n    }\n    /// Get the last child of this handle.\n    XMLHandle LastChild()\t\t\t\t\t\t\t\t\t\t\t\t\t{\n        return XMLHandle( _node ? _node->LastChild() : 0 );\n    }\n    /// Get the last child element of this handle.\n    XMLHandle LastChildElement( const char* name = 0 )\t\t\t\t\t\t{\n        return XMLHandle( _node ? _node->LastChildElement( name ) : 0 );\n    }\n    /// Get the previous sibling of this handle.\n    XMLHandle PreviousSibling()\t\t\t\t\t\t\t\t\t\t\t\t{\n        return XMLHandle( _node ? _node->PreviousSibling() : 0 );\n    }\n    /// Get the previous sibling element of this handle.\n    XMLHandle PreviousSiblingElement( const char* name = 0 )\t\t\t\t{\n        return XMLHandle( _node ? _node->PreviousSiblingElement( name ) : 0 );\n    }\n    /// Get the next sibling of this handle.\n    XMLHandle NextSibling()\t\t\t\t\t\t\t\t\t\t\t\t\t{\n        return XMLHandle( _node ? _node->NextSibling() : 0 );\n    }\n    /// Get the next sibling element of this handle.\n    XMLHandle NextSiblingElement( const char* name = 0 )\t\t\t\t\t{\n        return XMLHandle( _node ? _node->NextSiblingElement( name ) : 0 );\n    }\n\n    /// Safe cast to XMLNode. This can return null.\n    XMLNode* ToNode()\t\t\t\t\t\t\t{\n        return _node;\n    }\n    /// Safe cast to XMLElement. This can return null.\n    XMLElement* ToElement() \t\t\t\t\t{\n        return ( _node ? _node->ToElement() : 0 );\n    }\n    /// Safe cast to XMLText. This can return null.\n    XMLText* ToText() \t\t\t\t\t\t\t{\n        return ( _node ? _node->ToText() : 0 );\n    }\n    /// Safe cast to XMLUnknown. This can return null.\n    XMLUnknown* ToUnknown() \t\t\t\t\t{\n        return ( _node ? _node->ToUnknown() : 0 );\n    }\n    /// Safe cast to XMLDeclaration. This can return null.\n    XMLDeclaration* ToDeclaration() \t\t\t{\n        return ( _node ? _node->ToDeclaration() : 0 );\n    }\n\nprivate:\n    XMLNode* _node;\n};\n\n\n/**\n\tA variant of the XMLHandle class for working with const XMLNodes and Documents. It is the\n\tsame in all regards, except for the 'const' qualifiers. See XMLHandle for API.\n*/\nclass TINYXML2_LIB XMLConstHandle\n{\npublic:\n    XMLConstHandle( const XMLNode* node ) : _node( node ) {\n    }\n    XMLConstHandle( const XMLNode& node ) : _node( &node ) {\n    }\n    XMLConstHandle( const XMLConstHandle& ref ) : _node( ref._node ) {\n    }\n\n    XMLConstHandle& operator=( const XMLConstHandle& ref )\t\t\t\t\t\t\t{\n        _node = ref._node;\n        return *this;\n    }\n\n    const XMLConstHandle FirstChild() const\t\t\t\t\t\t\t\t\t\t\t{\n        return XMLConstHandle( _node ? _node->FirstChild() : 0 );\n    }\n    const XMLConstHandle FirstChildElement( const char* name = 0 ) const\t\t\t\t{\n        return XMLConstHandle( _node ? _node->FirstChildElement( name ) : 0 );\n    }\n    const XMLConstHandle LastChild()\tconst\t\t\t\t\t\t\t\t\t\t{\n        return XMLConstHandle( _node ? _node->LastChild() : 0 );\n    }\n    const XMLConstHandle LastChildElement( const char* name = 0 ) const\t\t\t\t{\n        return XMLConstHandle( _node ? _node->LastChildElement( name ) : 0 );\n    }\n    const XMLConstHandle PreviousSibling() const\t\t\t\t\t\t\t\t\t{\n        return XMLConstHandle( _node ? _node->PreviousSibling() : 0 );\n    }\n    const XMLConstHandle PreviousSiblingElement( const char* name = 0 ) const\t\t{\n        return XMLConstHandle( _node ? _node->PreviousSiblingElement( name ) : 0 );\n    }\n    const XMLConstHandle NextSibling() const\t\t\t\t\t\t\t\t\t\t{\n        return XMLConstHandle( _node ? _node->NextSibling() : 0 );\n    }\n    const XMLConstHandle NextSiblingElement( const char* name = 0 ) const\t\t\t{\n        return XMLConstHandle( _node ? _node->NextSiblingElement( name ) : 0 );\n    }\n\n\n    const XMLNode* ToNode() const\t\t\t\t{\n        return _node;\n    }\n    const XMLElement* ToElement() const\t\t\t{\n        return ( _node ? _node->ToElement() : 0 );\n    }\n    const XMLText* ToText() const\t\t\t\t{\n        return ( _node ? _node->ToText() : 0 );\n    }\n    const XMLUnknown* ToUnknown() const\t\t\t{\n        return ( _node ? _node->ToUnknown() : 0 );\n    }\n    const XMLDeclaration* ToDeclaration() const\t{\n        return ( _node ? _node->ToDeclaration() : 0 );\n    }\n\nprivate:\n    const XMLNode* _node;\n};\n\n\n/**\n\tPrinting functionality. The XMLPrinter gives you more\n\toptions than the XMLDocument::Print() method.\n\n\tIt can:\n\t-# Print to memory.\n\t-# Print to a file you provide.\n\t-# Print XML without a XMLDocument.\n\n\tPrint to Memory\n\n\t@verbatim\n\tXMLPrinter printer;\n\tdoc.Print( &printer );\n\tSomeFunction( printer.CStr() );\n\t@endverbatim\n\n\tPrint to a File\n\n\tYou provide the file pointer.\n\t@verbatim\n\tXMLPrinter printer( fp );\n\tdoc.Print( &printer );\n\t@endverbatim\n\n\tPrint without a XMLDocument\n\n\tWhen loading, an XML parser is very useful. However, sometimes\n\twhen saving, it just gets in the way. The code is often set up\n\tfor streaming, and constructing the DOM is just overhead.\n\n\tThe Printer supports the streaming case. The following code\n\tprints out a trivially simple XML file without ever creating\n\tan XML document.\n\n\t@verbatim\n\tXMLPrinter printer( fp );\n\tprinter.OpenElement( \"foo\" );\n\tprinter.PushAttribute( \"foo\", \"bar\" );\n\tprinter.CloseElement();\n\t@endverbatim\n*/\nclass TINYXML2_LIB XMLPrinter : public XMLVisitor\n{\npublic:\n    /** Construct the printer. If the FILE* is specified,\n    \tthis will print to the FILE. Else it will print\n    \tto memory, and the result is available in CStr().\n    \tIf 'compact' is set to true, then output is created\n    \twith only required whitespace and newlines.\n    */\n    XMLPrinter( FILE* file=0, bool compact = false, int depth = 0 );\n    virtual ~XMLPrinter()\t{}\n\n    /** If streaming, write the BOM and declaration. */\n    void PushHeader( bool writeBOM, bool writeDeclaration );\n    /** If streaming, start writing an element.\n        The element must be closed with CloseElement()\n    */\n    void OpenElement( const char* name, bool compactMode=false );\n    /// If streaming, add an attribute to an open element.\n    void PushAttribute( const char* name, const char* value );\n    void PushAttribute( const char* name, int value );\n    void PushAttribute( const char* name, unsigned value );\n\tvoid PushAttribute(const char* name, int64_t value);\n\tvoid PushAttribute( const char* name, bool value );\n    void PushAttribute( const char* name, double value );\n    /// If streaming, close the Element.\n    virtual void CloseElement( bool compactMode=false );\n\n    /// Add a text node.\n    void PushText( const char* text, bool cdata=false );\n    /// Add a text node from an integer.\n    void PushText( int value );\n    /// Add a text node from an unsigned.\n    void PushText( unsigned value );\n\t/// Add a text node from an unsigned.\n\tvoid PushText(int64_t value);\n\t/// Add a text node from a bool.\n    void PushText( bool value );\n    /// Add a text node from a float.\n    void PushText( float value );\n    /// Add a text node from a double.\n    void PushText( double value );\n\n    /// Add a comment\n    void PushComment( const char* comment );\n\n    void PushDeclaration( const char* value );\n    void PushUnknown( const char* value );\n\n    virtual bool VisitEnter( const XMLDocument& /*doc*/ );\n    virtual bool VisitExit( const XMLDocument& /*doc*/ )\t\t\t{\n        return true;\n    }\n\n    virtual bool VisitEnter( const XMLElement& element, const XMLAttribute* attribute );\n    virtual bool VisitExit( const XMLElement& element );\n\n    virtual bool Visit( const XMLText& text );\n    virtual bool Visit( const XMLComment& comment );\n    virtual bool Visit( const XMLDeclaration& declaration );\n    virtual bool Visit( const XMLUnknown& unknown );\n\n    /**\n    \tIf in print to memory mode, return a pointer to\n    \tthe XML file in memory.\n    */\n    const char* CStr() const {\n        return _buffer.Mem();\n    }\n    /**\n    \tIf in print to memory mode, return the size\n    \tof the XML file in memory. (Note the size returned\n    \tincludes the terminating null.)\n    */\n    int CStrSize() const {\n        return _buffer.Size();\n    }\n    /**\n    \tIf in print to memory mode, reset the buffer to the\n    \tbeginning.\n    */\n    void ClearBuffer() {\n        _buffer.Clear();\n        _buffer.Push(0);\n\t\t_firstElement = true;\n    }\n\nprotected:\n\tvirtual bool CompactMode( const XMLElement& )\t{ return _compactMode; }\n\n\t/** Prints out the space before an element. You may override to change\n\t    the space and tabs used. A PrintSpace() override should call Print().\n\t*/\n    virtual void PrintSpace( int depth );\n    void Print( const char* format, ... );\n    void Write( const char* data, size_t size );\n    inline void Write( const char* data )           { Write( data, strlen( data ) ); }\n    void Putc( char ch );\n\n    void SealElementIfJustOpened();\n    bool _elementJustOpened;\n    DynArray< const char*, 10 > _stack;\n\nprivate:\n    void PrintString( const char*, bool restrictedEntitySet );\t// prints out, after detecting entities.\n\n    bool _firstElement;\n    FILE* _fp;\n    int _depth;\n    int _textDepth;\n    bool _processEntities;\n\tbool _compactMode;\n\n    enum {\n        ENTITY_RANGE = 64,\n        BUF_SIZE = 200\n    };\n    bool _entityFlag[ENTITY_RANGE];\n    bool _restrictedEntityFlag[ENTITY_RANGE];\n\n    DynArray< char, 20 > _buffer;\n\n    // Prohibit cloning, intentionally not implemented\n    XMLPrinter( const XMLPrinter& );\n    XMLPrinter& operator=( const XMLPrinter& );\n};\n\n\n}\t// tinyxml2\n}\n}\n\n#if defined(_MSC_VER)\n#   pragma warning(pop)\n#endif\n\n#endif // TINYXML2_INCLUDED\n"
  },
  {
    "path": "sdk/src/http/CurlHttpClient.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"CurlHttpClient.h\"\n#include <curl/curl.h>\n#include <cassert>\n#include <sstream>\n#include <vector>\n#include <mutex>\n#include <condition_variable>\n#include <atomic>\n#include <algorithm>\n#include <../utils/Crc64.h>\n#include <alibabacloud/oss/client/Error.h>\n#include <alibabacloud/oss/client/RateLimiter.h>\n#include \"../utils/LogUtils.h\"\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    const char * TAG = \"CurlHttpClient\";\n    ////////////////////////////////////////////////////////////////////////////////////////////\n    template< typename RESOURCE_TYPE>\n    class ResourceManager_\n    {\n    public:\n        ResourceManager_() : m_shutdown(false) {}\n        RESOURCE_TYPE Acquire()\n        {\n            std::unique_lock<std::mutex> locker(m_queueLock);\n            while(!m_shutdown.load() && m_resources.size() == 0)\n            {\n                m_semaphore.wait(locker, [&](){ return m_shutdown.load() || m_resources.size() > 0; });                    \n            }\n    \n            assert(!m_shutdown.load());\n    \n            RESOURCE_TYPE resource = m_resources.back();\n            m_resources.pop_back();\n    \n            return resource;\n        }\n    \n        bool HasResourcesAvailable()\n        {\n            std::lock_guard<std::mutex> locker(m_queueLock);\n            return m_resources.size() > 0 && !m_shutdown.load();\n        }\n    \n        void Release(RESOURCE_TYPE resource)\n        {\n            std::unique_lock<std::mutex> locker(m_queueLock);\n            m_resources.push_back(resource);\n            locker.unlock();\n            m_semaphore.notify_one();\n        }\n    \n        void PutResource(RESOURCE_TYPE resource)\n        {\n            m_resources.push_back(resource);\n        }\n    \n        std::vector<RESOURCE_TYPE> ShutdownAndWait(size_t resourceCount)\n        {\n            std::vector<RESOURCE_TYPE> resources;\n            std::unique_lock<std::mutex> locker(m_queueLock);\n            m_shutdown = true;\n            while (m_resources.size() < resourceCount)\n            {\n                m_semaphore.wait(locker, [&]() { return m_resources.size() == resourceCount; });\n            }\n            resources = m_resources;\n            m_resources.clear();\n            return resources;\n        }\n    \n    private:\n        std::vector<RESOURCE_TYPE> m_resources;\n        std::mutex m_queueLock;\n        std::condition_variable m_semaphore;\n        std::atomic<bool> m_shutdown;\n    };\n    \n    \n    class CurlContainer\n    {\n    public:\n        CurlContainer(unsigned maxSize = 16, long requestTimeout = 10000, long connectTimeout = 5000):\n              maxPoolSize_(maxSize), \n              requestTimeout_(requestTimeout), \n              connectTimeout_(connectTimeout),\n              poolSize_(0)\n        {\n        }\n    \n        ~CurlContainer()\n        {\n            for (CURL* handle : handleContainer_.ShutdownAndWait(poolSize_)) {\n                curl_easy_cleanup(handle);\n            }\n        }\n    \n        CURL* Acquire()\n        {\n            if(!handleContainer_.HasResourcesAvailable()) {\n                growPool();\n            }\n            CURL* handle = handleContainer_.Acquire();\n            return handle;\n        }    \n    \n        void Release(CURL* handle, bool force)\n        {\n            if (handle) {\n                curl_easy_reset(handle);\n                if (force) {\n                    CURL* newhandle = curl_easy_init();\n                    if (newhandle) {\n                        curl_easy_cleanup(handle);\n                        handle = newhandle;\n                    }\n                }\n                setDefaultOptions(handle);\n                handleContainer_.Release(handle);\n            }\n        }\n    \n    private:\n        CurlContainer(const CurlContainer&) = delete;\n        const CurlContainer& operator = (const CurlContainer&) = delete;\n        CurlContainer(const CurlContainer&&) = delete;\n        const CurlContainer& operator = (const CurlContainer&&) = delete;\n    \n        bool growPool()\n        {\n            std::lock_guard<std::mutex> locker(containerLock_);\n            if (poolSize_ < maxPoolSize_) {\n                unsigned multiplier = poolSize_ > 0 ? poolSize_ : 1;\n                unsigned amountToAdd = (std::min)(multiplier * 2, maxPoolSize_ - poolSize_);\n        \n                unsigned actuallyAdded = 0;\n                for (unsigned i = 0; i < amountToAdd; ++i) {\n                    CURL* curlHandle = curl_easy_init();\n                    if (curlHandle) {\n                        setDefaultOptions(curlHandle);\n                        handleContainer_.Release(curlHandle);\n                        ++actuallyAdded;\n                    } else {\n                        break;\n                    }\n                }\n                poolSize_ += actuallyAdded;\n                return actuallyAdded > 0;\n            }\n            return false;\n        }\n    \n        void setDefaultOptions(CURL* handle)\n        {\n            curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1L);\n            curl_easy_setopt(handle, CURLOPT_TCP_NODELAY, 1);\n            curl_easy_setopt(handle, CURLOPT_NETRC, CURL_NETRC_IGNORED);\n\n            curl_easy_setopt(handle, CURLOPT_TIMEOUT_MS, 0L);\n            curl_easy_setopt(handle, CURLOPT_CONNECTTIMEOUT_MS, connectTimeout_);\n            curl_easy_setopt(handle, CURLOPT_LOW_SPEED_LIMIT, 1L);\n            curl_easy_setopt(handle, CURLOPT_LOW_SPEED_TIME, requestTimeout_ / 1000);\n\n            curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L);\n            curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 0L);\n        }\n    \n    private:\n        ResourceManager_<CURL*> handleContainer_;\n        unsigned maxPoolSize_;\n        unsigned long requestTimeout_;\n        unsigned long connectTimeout_;\n        unsigned poolSize_;\n        std::mutex containerLock_;\n    };\n    \n    /////////////////////////////////////////////////////////////////////////////////////////////\n    struct TransferState {\n        CurlHttpClient *owner;\n        CURL * curl;\n        HttpRequest  *request;\n        HttpResponse *response;\n        int64_t transferred;\n        int64_t total;\n        bool firstRecvData;\n        std::iostream::pos_type recvBodyPos;\n        TransferProgressHandler progress;\n        void *userData;\n        bool enableCrc64;\n        uint64_t sendCrc64Value;\n        uint64_t recvCrc64Value;\n        int sendSpeed;\n        int recvSpeed;\n    };\n\n    static size_t sendBody(char *ptr, size_t size, size_t nmemb, void *userdata)\n    {\n        TransferState *state = static_cast<TransferState*>(userdata);\n\n        if (state == nullptr || \n            state->request == nullptr) {\n            return 0;\n        }\n        \n        std::shared_ptr<std::iostream> &content = state->request->Body();\n        const size_t wanted = size * nmemb;\n        size_t got = 0;\n        if (content != nullptr && wanted > 0) {\n            size_t read = wanted;\n            if (state->total > 0) {\n                int64_t remains = state->total - state->transferred;\n                if (remains < static_cast<int64_t>(wanted)) {\n                    read = static_cast<size_t>(remains);\n                }\n            }\n            content->read(ptr, read);\n            got = static_cast<size_t>(content->gcount());\n        }\n\n        state->transferred += got;\n        if (state->progress) {\n            state->progress(got, state->transferred, state->total, state->userData);\n        }\n\n        if (state->enableCrc64) {\n            state->sendCrc64Value = CRC64::CalcCRC(state->sendCrc64Value, (void *)ptr, got);\n        }\n\n        return got;\n    }\n\n    static size_t recvBody(char *ptr, size_t size, size_t nmemb, void *userdata)\n    {\n        TransferState *state = static_cast<TransferState*>(userdata);\n        const size_t wanted = size * nmemb;\n\n        if (state == nullptr ||\n            state->response == nullptr || \n            wanted == 0) {\n            return -1;\n        }\n\n        if (state->firstRecvData) {\n            long response_code = 0;\n            curl_easy_getinfo(state->curl, CURLINFO_RESPONSE_CODE, &response_code);\n            if (response_code / 100 == 2) {\n                state->response->addBody(state->request->ResponseStreamFactory()());\n                if (state->response->Body() != nullptr) {\n                    state->recvBodyPos = state->response->Body()->tellp();\n                }\n                OSS_LOG(LogLevel::LogDebug, TAG, \"request(%p) setResponseBody, recvBodyPos:%lld\",\n                    state->request, state->recvBodyPos);\n            }\n            else {\n                state->response->addBody(std::make_shared<std::stringstream>());\n            }\n            state->firstRecvData = false;\n        }\n\n        std::shared_ptr<std::iostream> &content = state->response->Body();\n        if (content == nullptr || content->fail()) {\n            return -2;\n        }\n\n        content->write(ptr, static_cast<std::streamsize>(wanted));\n        if (content->bad()) {\n            return -3;\n        }\n\n        state->transferred += wanted;\n        if (state->progress) {\n            state->progress(wanted, state->transferred, state->total, state->userData);\n        }\n\n        if (state->enableCrc64) {\n            state->recvCrc64Value = CRC64::CalcCRC(state->recvCrc64Value, (void *)ptr, wanted);\n        }\n\n        return wanted;\n    }\n\n    static size_t recvHeaders(char *buffer, size_t size, size_t nitems, void *userdata)\n    {\n        TransferState *state = static_cast<TransferState*>(userdata);\n        const size_t length = nitems * size;\n\n        std::string line(buffer);\n        auto pos = line.find(':');\n        if (pos != line.npos)\n        {\n            size_t posEnd = line.rfind('\\r');\n            if (posEnd != line.npos) {\n                posEnd = posEnd - pos - 2;\n            }\n            std::string name  = line.substr(0, pos);\n            std::string value = line.substr(pos + 2, posEnd);\n            state->response->setHeader(name, value);\n        }\n\n        if (length == 2 && (buffer[0] == 0x0D) && (buffer[1] == 0x0A)) {\n            if (state->response->hasHeader(Http::CONTENT_LENGTH)) {\n                double dval;\n                curl_easy_getinfo(state->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &dval);\n                state->total = (int64_t)dval;\n            }\n        }\n        return length;\n    }\n\n    static int debugCallback(void *handle, curl_infotype type, char *data, size_t size, void *userp)\n    {\n        UNUSED_PARAM(userp);\n        switch (type) {\n        default: \n            break;\n        case CURLINFO_TEXT:\n            OSS_LOG(LogLevel::LogInfo, TAG, \"handle(%p)=> Info: %.*s\", handle, size, data);\n            break;\n        case CURLINFO_HEADER_OUT:\n            OSS_LOG(LogLevel::LogDebug, TAG, \"handle(%p)=> Send header: %.*s\", handle, size, data);\n            break;\n        case CURLINFO_HEADER_IN:\n            OSS_LOG(LogLevel::LogDebug, TAG, \"handle(%p)=> Recv header: %.*s\", handle, size, data);\n            break;\n        }\n        return 0;\n    }\n\n    static int progressCallback(void *userdata, double dltotal, double dlnow,  double ultotal, double ulnow)\n    {\n        UNUSED_PARAM(dltotal);\n        UNUSED_PARAM(dlnow);\n        UNUSED_PARAM(ultotal);\n        UNUSED_PARAM(ulnow);\n        TransferState *state = static_cast<TransferState*>(userdata);\n        if (state == nullptr || state->owner == nullptr) {\n            return 0;\n        }\n\n        CurlHttpClient *thiz = static_cast<CurlHttpClient *>(state->owner);\n\n        //stop by upper caller\n        if (!thiz->isEnable()) {\n            return 1;\n        }\n\n        //for speed update\n        if (thiz->sendRateLimiter_ != nullptr) {\n            auto rate = thiz->sendRateLimiter_->Rate();\n            if (rate != state->sendSpeed) {\n                state->sendSpeed = rate;\n                auto speed = static_cast<curl_off_t>(rate);\n                speed = speed * 1024;\n                curl_easy_setopt(state->curl, CURLOPT_MAX_SEND_SPEED_LARGE, speed);\n            }\n        }\n\n        if (thiz->recvRateLimiter_ != nullptr) {\n            auto rate = thiz->recvRateLimiter_->Rate();\n            if (rate != state->recvSpeed) {\n                state->recvSpeed = rate;\n                auto speed = static_cast<curl_off_t>(rate);\n                speed = speed * 1024;\n                curl_easy_setopt(state->curl, CURLOPT_MAX_RECV_SPEED_LARGE, speed);\n            }\n        }\n\n        return 0;\n    }\n\n    bool static ignoreHeader(const std::string& header, const std::string expect)\n    {\n        if ((expect.length() == header.length()) &&\n            std::equal(header.begin(), header.end(), expect.begin(),\n                [](char a, char b) {return ::tolower(a) == ::tolower(b); })) {\n            return true;\n        }\n        return false;\n    }\n}\n}\n\nvoid CurlHttpClient::initGlobalState()\n{\n    curl_global_init(CURL_GLOBAL_ALL);\n}\n\nvoid CurlHttpClient::cleanupGlobalState()\n{\n    curl_global_cleanup();\n}\n\nCurlHttpClient::CurlHttpClient(const ClientConfiguration &configuration) :\n    HttpClient(),\n    curlContainer_(new CurlContainer(configuration.maxConnections, \n                                                       configuration.requestTimeoutMs,\n                                                       configuration.connectTimeoutMs)),\n    userAgent_(configuration.userAgent),\n    proxyScheme_(configuration.proxyScheme),\n    proxyHost_(configuration.proxyHost),\n    proxyPort_(configuration.proxyPort),\n    proxyUserName_(configuration.proxyUserName),\n    proxyPassword_(configuration.proxyPassword),\n    verifySSL_(configuration.verifySSL),\n    caPath_(configuration.caPath),\n    caFile_(configuration.caFile),\n    networkInterface_(configuration.networkInterface),\n    sendRateLimiter_(configuration.sendRateLimiter),\n    recvRateLimiter_(configuration.recvRateLimiter),\n    httpInterceptor_(configuration.httpInterceptor)\n{\n}\n\nCurlHttpClient::~CurlHttpClient()\n{\n    if (curlContainer_) {\n        delete curlContainer_;\n    }\n}\n\nstd::shared_ptr<HttpResponse> CurlHttpClient::makeRequest(const std::shared_ptr<HttpRequest> &request)\n{\n    OSS_LOG(LogLevel::LogDebug, TAG, \"request(%p) enter makeRequest\", request.get());\n    curl_slist *list = nullptr;\n    auto& headers = request->Headers();\n    for (const auto &p : headers) {\n        if (p.second.empty())\n            continue;\n        std::string str = p.first;\n        // ignore content-length\n        if (request->chunkedEncoding() && ignoreHeader(str, \"Content-Length\")) {\n            continue;\n        }\n        str.append(\": \").append(p.second);\n        list = curl_slist_append(list, str.c_str());\n    }\n    // Disable Expect: 100-continue\n    list = curl_slist_append(list, \"Expect:\");\n\n    auto response = std::make_shared<HttpResponse>(request);\n    \n    std::iostream::pos_type requestBodyPos = -1;\n    if (request->Body() != nullptr) {\n        requestBodyPos = request->Body()->tellg();\n    }\n\n    CURL * curl = curlContainer_->Acquire();\n\n    OSS_LOG(LogLevel::LogDebug, TAG, \"request(%p) acquire curl handle:%p\", request.get(), curl);\n\n    uint64_t initCRC64 = 0;\n#ifdef ENABLE_OSS_TEST\n    if (headers.find(\"oss-test-crc64\") != headers.end()) {\n        initCRC64 = std::strtoull(headers.at(\"oss-test-crc64\").c_str(), nullptr, 10);\n    }\n#endif\n    TransferState transferState = {\n        this,\n        curl,\n        request.get(),\n        response.get(),\n        0, -1, \n        true, -1, \n        request->TransferProgress().Handler,\n        request->TransferProgress().UserData,\n        request->hasCheckCrc64(), initCRC64, initCRC64, \n        0, 0\n    };\n\n    int64_t contentlength = -1;\n    if (request->hasHeader(Http::CONTENT_LENGTH)) {\n        transferState.total = std::atoll(request->Header(Http::CONTENT_LENGTH).c_str());\n        contentlength = transferState.total;\n    }\n\n    std::string url = request->url().toString();\n    curl_easy_setopt(curl, CURLOPT_URL, url.c_str());\n    switch (request->method())\n    {\n    case Http::Method::Head:\n        curl_easy_setopt(curl, CURLOPT_NOBODY, 1);\n        break;\n    case Http::Method::Put:\n        curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);\n        if (contentlength < 0) {\n            // if nobody, set it to 0\n            if (request->Body() == nullptr) {\n                curl_off_t uploadsize = 0;\n                curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, uploadsize);\n            }\n        }\n        else {\n            if (!request->chunkedEncoding()) {\n                curl_off_t uploadsize = static_cast<curl_off_t>(contentlength);\n                curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, uploadsize);\n            }\n        }\n        break;\n    case Http::Method::Post:\n        curl_easy_setopt(curl, CURLOPT_POST, 1L);\n        if (contentlength < 0) {\n            // if nobody, set it to 0\n            if (request->Body() == nullptr) {\n                curl_off_t length_of_data = 0;\n                curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, length_of_data);\n            }\n        }\n        else {\n            if (!request->chunkedEncoding()) {\n                curl_off_t length_of_data  = static_cast<curl_off_t>(contentlength);\n                curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE_LARGE, length_of_data);\n            }\n        }\t\t\n        break;\n    case Http::Method::Delete:\n        curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n        break;\n    case Http::Method::Get:\n    default:\n        break;\n    }\n    \n    curl_easy_setopt(curl, CURLOPT_USERAGENT,userAgent_.c_str());\n\n    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, list);\n    curl_easy_setopt(curl, CURLOPT_HEADERDATA, &transferState);\n    curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, recvHeaders);\n\n    curl_easy_setopt(curl, CURLOPT_WRITEDATA, &transferState);\n    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, recvBody);\n\n    curl_easy_setopt(curl, CURLOPT_READDATA, &transferState);\n    curl_easy_setopt(curl, CURLOPT_READFUNCTION, sendBody);\n\n    if (verifySSL_) {\n        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);\n        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2L);\n    }\n    if(!caPath_.empty()) {\n        curl_easy_setopt(curl, CURLOPT_CAPATH, caPath_.c_str());\n    }\n    if(!caFile_.empty()){\n        curl_easy_setopt(curl, CURLOPT_CAINFO, caFile_.c_str());\n    }\n\n    if (!proxyHost_.empty()) {\n        std::stringstream ss;\n        ss << Http::SchemeToString(proxyScheme_) << \"://\" << proxyHost_;\n        curl_easy_setopt(curl, CURLOPT_PROXY, ss.str().c_str());\n        curl_easy_setopt(curl, CURLOPT_PROXYPORT, (long) proxyPort_);\n        curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, proxyUserName_.c_str());\n        curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, proxyPassword_.c_str());\n    }\n\n    if (!networkInterface_.empty()) {\n        curl_easy_setopt(curl, CURLOPT_INTERFACE, networkInterface_.c_str());\n    }\n\n    //debug\n    if (GetLogLevelInner() >= LogLevel::LogInfo) {\n        curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);\n        curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, debugCallback);\n    }\n\n    //Error Buffer\r\n    char errbuf[CURL_ERROR_SIZE];\r\n    curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);\r\n    errbuf[0] = 0;\r\n\n    //progress Callback\n    curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progressCallback);\n    curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, &transferState);\n    curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0L);\n\n    //Send bytes/sec \n    if (sendRateLimiter_ != nullptr) {\n        transferState.sendSpeed = sendRateLimiter_->Rate();\n        auto speed = static_cast<curl_off_t>(transferState.sendSpeed);\n        speed = speed * 1024;\n        curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, speed);\n    }\n\n    //Recv bytes/sec \n    if (recvRateLimiter_ != nullptr) {\n        transferState.recvSpeed = recvRateLimiter_->Rate();\n        auto speed = static_cast<curl_off_t>(transferState.recvSpeed);\n        speed = speed * 1024;\n        curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, speed);\n    }\n\n    if (httpInterceptor_ != nullptr) {\n        httpInterceptor_->preSendRequest(curl, request);\n    }\n\n    CURLcode res = curl_easy_perform(curl);\n    long response_code= 0;\n    curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);\n\n    if (res == CURLE_OK) {\n        response->setStatusCode(response_code);\n    } else {\n        response->setStatusCode(res + ERROR_CURL_BASE);\n        switch (res) {\n        case 23: //CURLE_WRITE_ERROR\n        {\n            std::string msg(curl_easy_strerror(res));\n            if (response->Body() == nullptr) {\n                msg.append(\". Caused by content is null.\");\n            }\n            else if (response->Body()->bad()) {\n                msg.append(\". Caused by content is in bad state(Read/writing error on i/o operation).\");\n            }\n            else if (response->Body()->fail()) {\n                msg.append(\". Caused by content is in fail state(Logical error on i/o operation).\");\n            }\n            response->setStatusMsg(msg);\n        }\n            break;\n        default:\n        {\n            std::string msg(curl_easy_strerror(res));\r\n            msg.append(\".\").append(errbuf);\n            response->setStatusMsg(msg);\n        }\n            break;\n        };\n    }\n   \n    switch (request->method())\n    {\n    case Http::Method::Put:\n    case Http::Method::Post:\n        request->setCrc64Result(transferState.sendCrc64Value);\n        break;\n    default:\n        request->setCrc64Result(transferState.recvCrc64Value);\n        break;\n    }\n    request->setTransferedBytes(transferState.transferred);\n\n    curlContainer_->Release(curl, (res != CURLE_OK));\n\n    curl_slist_free_all(list);\n\n    auto & body = response->Body();\n    if (body != nullptr) {\n        body->flush();\n        if (res != CURLE_OK && transferState.recvBodyPos != static_cast<std::streampos>(-1)) {\n            OSS_LOG(LogLevel::LogDebug, TAG, \"request(%p) setResponseBody, tellp:%lld, recvBodyPos:%lld\",\n                request.get(), body->tellp(), transferState.recvBodyPos);\n            body->clear();\n            body->seekp(transferState.recvBodyPos);\n        }\n    }\n    else {\n        response->addBody(std::make_shared<std::stringstream>());\n    }\n\n    if (requestBodyPos != static_cast<std::streampos>(-1)) {\n        request->Body()->clear();\n        request->Body()->seekg(requestBodyPos);\n    }\n\n    OSS_LOG(LogLevel::LogDebug, TAG, \"request(%p) leave makeRequest, CURLcode:%d, ResponseCode:%d\", \n        request.get(), res, response_code);\n\n    return response;\n}\n\n"
  },
  {
    "path": "sdk/src/http/CurlHttpClient.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n#include <alibabacloud/oss/client/ClientConfiguration.h>\r\n#include <alibabacloud/oss/http/HttpClient.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n\r\n    class CurlContainer;\r\n    class RateLimiter;\r\n\r\n    class CurlHttpClient : public HttpClient\r\n    {\r\n    public:\r\n        CurlHttpClient(const ClientConfiguration &configuration);\r\n        ~CurlHttpClient();\r\n\r\n        static void initGlobalState();\r\n        static void cleanupGlobalState();\r\n\r\n        virtual std::shared_ptr<HttpResponse> makeRequest(const std::shared_ptr<HttpRequest> &request) override;\r\n    private:\r\n        CurlContainer *curlContainer_;\r\n        std::string userAgent_;\r\n        Http::Scheme proxyScheme_;\r\n        std::string proxyHost_;\r\n        unsigned int proxyPort_;\r\n        std::string proxyUserName_;\r\n        std::string proxyPassword_;\r\n        bool verifySSL_;\r\n        std::string caPath_;\r\n        std::string caFile_;\r\n        std::string networkInterface_;\r\n    public:\r\n        std::shared_ptr<RateLimiter> sendRateLimiter_;\r\n        std::shared_ptr<RateLimiter> recvRateLimiter_;\r\n        std::shared_ptr<HttpInterceptor> httpInterceptor_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/src/http/HttpClient.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/http/HttpClient.h>\r\n\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nHttpClient::HttpClient():\r\n    disable_(false)\r\n{\r\n}\r\n\r\nHttpClient::~HttpClient()\r\n{\r\n}\r\n\r\nbool HttpClient::isEnable()\r\n{\r\n    return disable_.load() == false;\r\n}\r\n\r\nvoid HttpClient::disable()\r\n{\r\n    disable_ = true;\r\n    requestSignal_.notify_all();\r\n}\r\n\r\nvoid HttpClient::enable()\r\n{\r\n    disable_ = false;\r\n}\r\n\r\nvoid HttpClient::waitForRetry(long milliseconds)\r\n{\r\n    if (milliseconds == 0)\r\n        return;\r\n    std::unique_lock<std::mutex> lck(requestLock_);\r\n    requestSignal_.wait_for(lck, std::chrono::milliseconds(milliseconds), [this] ()-> bool { return disable_.load() == true; });\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/http/HttpMessage.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/http/HttpMessage.h>\r\n\nusing namespace AlibabaCloud::OSS;\n\nHttpMessage::HttpMessage() :\n    headers_(),\n    body_()\n{\n}\n\nHttpMessage::HttpMessage(const HttpMessage &other) :\n    headers_(other.headers_),\n    body_(other.body_)\n{\n}\n\nHttpMessage::HttpMessage(HttpMessage &&other)\n{\n    *this = std::move(other);\n}\n\nHttpMessage& HttpMessage::operator=(const HttpMessage &other)\n{\n    if (this != &other) {\n        body_ = other.body_;\n        headers_ = other.headers_;\n    }\n    return *this;\n}\n\nHttpMessage& HttpMessage::operator=(HttpMessage &&other)\n{\n    if (this != &other) {\n        body_ = std::move(other.body_);\n        headers_ = std::move(other.headers_);\n    }\n    return *this;\n}\n\nvoid HttpMessage::addHeader(const std::string & name, const std::string & value)\n{\n    setHeader(name, value);\n}\n\nvoid HttpMessage::setHeader(const std::string & name, const std::string & value)\n{\n    headers_[name] = value;\n}\n\nvoid HttpMessage::removeHeader(const std::string & name)\n{\n    headers_.erase(name);\n}\n\n\nbool HttpMessage::hasHeader(const std::string &name) const\n{\n    return  (headers_.find(name) != headers_.end()) ? true : false;\n}\n\nstd::string HttpMessage::Header(const std::string & name) const\n{\n    auto it = headers_.find(name);\n    if (it != headers_.end())\n        return it->second;\n    else    \n        return std::string();\n}\n\nconst HeaderCollection &HttpMessage::Headers() const\n{\n    return headers_;\n}\n\nHttpMessage::~HttpMessage()\n{\n\n}\n\n\n"
  },
  {
    "path": "sdk/src/http/HttpRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/http/HttpRequest.h>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nstd::string Http::MethodToString(Method method)\r\n{\r\n    static const char* name[] = {\"GET\", \"HEAD\", \"POST\", \"PUT\", \"DELETE\", \r\n        \"CONNECT\", \"OPTIONS\", \"PATCH\", \"TRACE\"};\r\n    return name[(method - Http::Method::Get)];\r\n}\r\n\r\nstd::string Http::SchemeToString(Scheme scheme)\r\n{\r\n    static const char* name[] = {\"http\", \"https\"};\r\n    return name[scheme - Http::Scheme::HTTP];\r\n}\r\n\r\nconst char* Http::ACCEPT = \"Accept\";\r\nconst char* Http::ACCEPT_CHARSET = \"Accept-Charset\";\r\nconst char* Http::ACCEPT_ENCODING = \"Accept-Encoding\";\r\nconst char* Http::ACCEPT_LANGUAGE = \"Accept-Language\";\r\nconst char* Http::AUTHORIZATION = \"Authorization\";\r\nconst char* Http::CACHE_CONTROL = \"Cache-Control\";\r\nconst char* Http::CONTENT_DISPOSITION = \"Content-Disposition\";\r\nconst char* Http::CONTENT_ENCODING = \"Content-Encoding\";\r\nconst char* Http::CONTENT_LENGTH = \"Content-Length\";\r\nconst char* Http::CONTENT_MD5 = \"Content-MD5\";\r\nconst char* Http::CONTENT_RANGE = \"Content-Range\";\r\nconst char* Http::CONTENT_TYPE = \"Content-Type\";\r\nconst char* Http::DATE = \"Date\";\r\nconst char* Http::EXPECT = \"Expect\";\r\nconst char* Http::EXPIRES = \"Expires\";\r\nconst char* Http::ETAG = \"ETag\";\r\nconst char* Http::LAST_MODIFIED = \"Last-Modified\";\r\nconst char* Http::RANGE = \"Range\";\r\nconst char* Http::USER_AGENT = \"User-Agent\";\r\n\r\n\r\nHttpRequest::HttpRequest(Http::Method method) :\r\n    HttpMessage(),\r\n    method_(method),\r\n    url_(),\r\n    responseStreamFactory_(nullptr),\r\n    hasCheckCrc64_(false),\r\n    crc64Result_(0),\r\n    transferedBytes_(0),\r\n    chunkedEncoding_(false)\r\n{\r\n}\r\n\r\nHttpRequest::~HttpRequest()\r\n{\r\n}\r\n\r\nHttp::Method HttpRequest::method() const\r\n{\r\n    return method_;\r\n}\r\n\r\n\r\nvoid HttpRequest::setMethod(Http::Method method)\r\n{\r\n    method_ = method;\r\n}\r\n\r\nvoid HttpRequest::setUrl(const Url &url)\r\n{\r\n    url_ = url;\r\n}\r\n\r\nUrl HttpRequest::url()const\r\n{\r\n    return url_;\r\n}\r\n"
  },
  {
    "path": "sdk/src/http/HttpResponse.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/http/HttpResponse.h>\r\n\r\nnamespace\r\n{\r\n    #define INVALID_STATUS_CODE -1\r\n}\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nHttpResponse::HttpResponse(const std::shared_ptr<HttpRequest> & request) :\r\n    HttpMessage(),\r\n    request_(request),\r\n    statusCode_(INVALID_STATUS_CODE)\r\n{\r\n}\r\n\r\nHttpResponse::~HttpResponse()\r\n{\r\n}\r\n\r\nconst HttpRequest & HttpResponse::request() const\r\n{\r\n    return *request_.get();\r\n}\r\n\r\nvoid HttpResponse::setStatusCode(int code)\r\n{\r\n    statusCode_ = code;\r\n}\r\n\r\nint HttpResponse::statusCode() const\r\n{\r\n    return statusCode_;\r\n}\r\n\r\nvoid HttpResponse::setStatusMsg(std::string &msg)\r\n{\r\n    statusMsg_ = msg;\r\n}\r\n\r\nvoid HttpResponse::setStatusMsg(const char *msg)\r\n{\r\n    statusMsg_ = msg;\r\n}\r\n\r\nstd::string HttpResponse::statusMsg() const\r\n{\r\n    return statusMsg_;\r\n}\r\n"
  },
  {
    "path": "sdk/src/http/Url.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <algorithm>\n#include <sstream>\n#include <alibabacloud/oss/http/Url.h>\r\n\nusing namespace AlibabaCloud::OSS;\n\nnamespace\n{\n#define INVALID_PORT -1\n}\n\nUrl::Url(const std::string & url) :\n    scheme_(),\n    userName_(),\n    password_(),\n    host_(),\n    path_(),\n    port_(INVALID_PORT),\n    query_(),\n    fragment_()\n{\n    if(!url.empty())\n        fromString(url);\n}\n\nUrl::~Url()\n{\n}\n\nbool Url::operator==(const Url &url) const\n{\n    return scheme_ == url.scheme_\n        && userName_ == url.userName_\n        && password_ == url.password_\n        && host_ == url.host_\n        && path_ == url.path_\n        && port_ == url.port_\n        && query_ == url.query_\n        && fragment_ == url.fragment_;\n}\n\nbool Url::operator!=(const Url &url) const\n{\n    return !(*this == url);\n}\n\nstd::string Url::authority() const\n{\n    if (!isValid())\n        return std::string();\n\n    std::ostringstream out;\n    std::string str = userInfo();\n    if (!str.empty())\n        out << str << \"@\";\n    out << host_;\n    if (port_ != INVALID_PORT)\n        out << \":\" << port_;\n    return out.str();\n}\n\nvoid Url::clear()\n{\n    scheme_.clear();\n    userName_.clear();\n    password_.clear();\n    host_.clear();\n    path_.clear();\n    port_ = INVALID_PORT;\n    query_.clear();\n    fragment_.clear();\n}\n\nstd::string Url::fragment() const\n{\n    return fragment_;\n}\n\nvoid Url::fromString(const std::string & url)\n{\n    clear();\n    if (url.empty())\n        return;\n\n    std::string str = url;\n    std::string::size_type pos = 0;\n    std::string authority, fragment, path, query, scheme;\n\n    pos = str.find(\"://\");\n    if (pos != str.npos) {\n        scheme = str.substr(0, pos);\n        str.erase(0, pos + 3);\n    }\n\n    pos = str.find('#');\n    if (pos != str.npos) {\n        fragment = str.substr(pos + 1);\n        str.erase(pos);\n    }\n\n    pos = str.find('?');\n    if (pos != str.npos) {\n        query = str.substr(pos + 1);\n        str.erase(pos);\n    }\n\n    pos = str.find('/');\n    if (pos != str.npos) {\n        path = str.substr(pos);\n        str.erase(pos);\n    }\n    else\n        path = \"/\";\n\n    authority = str;\n\n    setScheme(scheme);\n    setAuthority(authority);\n    setPath(path);\n    setQuery(query);\n    setFragment(fragment);\n}\n\nbool Url::hasFragment() const\n{\n    return !fragment_.empty();\n}\n\nbool Url::hasQuery() const\n{\n    return !query_.empty();\n}\n\nstd::string Url::host() const\n{\n    return host_;\n}\n\nbool Url::isEmpty() const\n{\n    return scheme_.empty()\n        && userName_.empty()\n        && password_.empty()\n        && host_.empty()\n        && path_.empty()\n        && (port_ == INVALID_PORT)\n        && query_.empty()\n        && fragment_.empty();\n}\n\nbool Url::isValid() const\n{\n    if (isEmpty())\n        return false;\n\n    if (host_.empty())\n        return false;\n\n    bool valid = true;\n    if (userName_.empty())\n        valid = password_.empty();\n    return valid;\n}\n\nint Url::port() const\n{\n    return port_;\n}\n\nstd::string Url::password() const\n{\n    return password_;\n}\n\nstd::string Url::path() const\n{\n    return path_;\n}\n\nstd::string Url::query() const\n{\n    return query_;\n}\n\nstd::string Url::scheme() const\n{\n    return scheme_;\n}\n\nvoid Url::setAuthority(const std::string & authority)\n{\n    if (authority.empty()) {\n        setUserInfo(\"\");\n        setHost(\"\");\n        setPort(INVALID_PORT);\n        return;\n    }\n\n    std::string userinfo, host, port;\n    std::string::size_type pos = 0, prevpos = 0;\n\n    pos = authority.find('@');\n    if (pos != authority.npos) {\n        userinfo = authority.substr(0, pos);\n        prevpos = pos + 1;\n    }\n    else {\n        pos = 0;\n    }\n\n    pos = authority.find(':', prevpos);\n    if (pos == authority.npos)\n        host = authority.substr(prevpos);\n    else {\n        host = authority.substr(prevpos, pos - prevpos);\n        port = authority.substr(pos + 1);\n    }\n\n    setUserInfo(userinfo);\n    setHost(host);\n    setPort(!port.empty() ? atoi(port.c_str()): INVALID_PORT);\n}\n\nvoid Url::setFragment(const std::string & fragment)\n{\n    fragment_ = fragment;\n}\n\nvoid Url::setHost(const std::string & host)\n{\n    if(host.empty()){\n        host_.clear();\n        return;\n    }\n    host_ = host;\n    std::transform(host_.begin(), host_.end(), host_.begin(), ::tolower);\n}\n\nvoid Url::setPassword(const std::string & password)\n{\n    password_ = password;\n}\n\nvoid Url::setPath(const std::string & path)\n{\n    path_ = path;\n}\n\nvoid Url::setPort(int port)\n{\n    port_ = port;\n}\n\nvoid Url::setQuery(const std::string & query)\n{\n    query_ = query;\n}\n\nvoid Url::setScheme(const std::string & scheme)\n{\n    if(scheme.empty()){\n        scheme_.clear();\n        return;\n    }\n    scheme_ = scheme;\n    std::transform(scheme_.begin(), scheme_.end(), scheme_.begin(), ::tolower);\n}\n\nvoid Url::setUserInfo(const std::string & userInfo)\n{\n    if (userInfo.empty()) {\n        userName_.clear();\n        password_.clear();\n        return;\n    }\n\n    auto pos = userInfo.find(':');\n    if (pos == userInfo.npos)\n        userName_ = userInfo;\n    else {\n        userName_ = userInfo.substr(0, pos);\n        password_ = userInfo.substr(pos + 1);\n    }\n}\n\nvoid Url::setUserName(const std::string & userName)\n{\n    userName_ = userName;\n}\n\nstd::string Url::toString() const\n{\n    if (!isValid())\n        return std::string();\n\n    std::ostringstream out;\n    if (!scheme_.empty())\n        out << scheme_ << \"://\";\n    std::string str = authority();\n    if (!str.empty())\n        out << authority();\n    if (path_.empty())\n        out << \"/\";\n    else\n        out << path_;\n    if (hasQuery())\n        out << \"?\" << query_;\n    if (hasFragment())\n        out << \"#\" << fragment_;\n    return out.str();\n}\n\nstd::string Url::userInfo() const\n{\n    if (!isValid())\n        return std::string();\n\n    std::ostringstream out;\n    out << userName_;\n    if (!password_.empty())\n        out << \":\" << password_;\n    return out.str();\n}\n\nstd::string Url::userName() const\n{\n    return userName_;\n}\n"
  },
  {
    "path": "sdk/src/model/AbortBucketWormRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/AbortBucketWormRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nAbortBucketWormRequest::AbortBucketWormRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection AbortBucketWormRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"worm\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/AbortMultipartUploadRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/AbortMultipartUploadRequest.h>\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nAbortMultipartUploadRequest::AbortMultipartUploadRequest(\n    const std::string &bucket, const std::string &key, const std::string &uploadId) :\n    OssObjectRequest(bucket, key),\n    uploadId_(uploadId)\n{\n}\n\nParameterCollection AbortMultipartUploadRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"uploadId\"] = uploadId_;\n    return parameters;\n}\n"
  },
  {
    "path": "sdk/src/model/AppendObjectRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/AppendObjectRequest.h>\n#include <alibabacloud/oss/http/HttpType.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\n\nAppendObjectRequest::AppendObjectRequest(const std::string &bucket, const std::string &key,\n        const std::shared_ptr<std::iostream>& content):\n    OssObjectRequest(bucket, key),\n    position_(0),\n    content_(content)\n{\n}\n\nAppendObjectRequest::AppendObjectRequest(const std::string &bucket, const std::string &key,\n        const std::shared_ptr<std::iostream>& content, const ObjectMetaData &metaData):\n    OssObjectRequest(bucket, key),\n    position_(0),\n    content_(content),\n    metaData_(metaData)\n{\n}\n\nvoid AppendObjectRequest::setPosition(uint64_t position)\n{\n    position_ = position;\n}\n\nvoid AppendObjectRequest::setCacheControl(const std::string& value)\n{\n    metaData_.addHeader(Http::CACHE_CONTROL, value);\n}\n\nvoid AppendObjectRequest::setContentDisposition(const std::string& value)\n{\n    metaData_.addHeader(Http::CONTENT_DISPOSITION, value);\n}\n\nvoid AppendObjectRequest::setContentEncoding(const std::string& value)\n{\n    metaData_.addHeader(Http::CONTENT_ENCODING, value);\n}\n\nvoid AppendObjectRequest::setContentMd5(const std::string& value)\n{\n    metaData_.addHeader(Http::CONTENT_MD5, value);\n}\n\nvoid AppendObjectRequest::setExpires(uint64_t expires)\n{\n\tmetaData_.addHeader(Http::EXPIRES, std::to_string(expires));\n}\n\nvoid AppendObjectRequest::setExpires(const std::string& value)\n{\n    metaData_.addHeader(Http::EXPIRES, value);\n}\n\nvoid AppendObjectRequest::setAcl(const CannedAccessControlList& acl)\n{\n\tmetaData_.addHeader(\"x-oss-object-acl\", ToAclName(acl));\n}\n\nvoid AppendObjectRequest::setTagging(const std::string& value)\n{\n    metaData_.addHeader(\"x-oss-tagging\", value);\n}\n\nvoid AppendObjectRequest::setTrafficLimit(uint64_t value)\n{\n    metaData_.addHeader(\"x-oss-traffic-limit\", std::to_string(value));\n}\n\nstd::shared_ptr<std::iostream> AppendObjectRequest::Body() const\n{\n    return content_;\n}\n\n\nHeaderCollection AppendObjectRequest::specialHeaders() const\n{\n    auto headers = metaData_.toHeaderCollection();\n\n    if (headers.find(Http::CONTENT_TYPE) == headers.end()) {\n        headers[Http::CONTENT_TYPE] = LookupMimeType(Key());\n    }\n\n    auto baseHeaders = OssObjectRequest::specialHeaders();\n    headers.insert(baseHeaders.begin(), baseHeaders.end());\n\n    return headers;\n}\n\nParameterCollection AppendObjectRequest::specialParameters() const\n{\n    ParameterCollection paramters;\n    paramters[\"append\"] = \"\";\n    paramters[\"position\"] = std::to_string(position_);\n\n    return paramters;\n}\n\n\n"
  },
  {
    "path": "sdk/src/model/AppendObjectResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/AppendObjectResult.h>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nAppendObjectResult::AppendObjectResult():\r\n    OssObjectResult(),\r\n    length_(0),\r\n    crc64_(0)\r\n{\r\n}\r\n\r\nAppendObjectResult::AppendObjectResult(const HeaderCollection& headers):\r\n    OssObjectResult(headers),\r\n    length_(0),\r\n    crc64_(0)\r\n{\r\n   if (headers.find(\"x-oss-next-append-position\") == headers.end()) {\r\n       parseDone_ = false;\r\n   } else {\r\n       length_ = std::strtoull(headers.at(\"x-oss-next-append-position\").c_str(), nullptr, 10);\r\n   }\r\n\r\n   if (headers.find(\"x-oss-hash-crc64ecma\") == headers.end()) {\r\n       parseDone_ = false;\r\n   } else {\r\n       crc64_  = std::strtoull(headers.at(\"x-oss-hash-crc64ecma\").c_str(), nullptr, 10);\r\n   }\r\n   parseDone_ = true;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/Bucket.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/Bucket.h>\n\nusing namespace AlibabaCloud::OSS;\n\nBucket::~Bucket()\n{\n}\n"
  },
  {
    "path": "sdk/src/model/CompleteBucketWormRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/CompleteBucketWormRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nCompleteBucketWormRequest::CompleteBucketWormRequest(const std::string &bucket, const std::string& wormId) :\n    OssBucketRequest(bucket),\n    wormId_(wormId)\n{\n}\n\nParameterCollection CompleteBucketWormRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"wormId\"] = wormId_;\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/CompleteMultipartUploadRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/CompleteMultipartUploadRequest.h>\r\n#include <sstream>\r\n#include \"../utils/Utils.h\"\r\n#include \"ModelError.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nCompleteMultipartUploadRequest::CompleteMultipartUploadRequest(\r\n    const std::string &bucket, const std::string &key) :\r\n    CompleteMultipartUploadRequest(bucket, key, PartList())\r\n{\r\n}\r\n\r\nCompleteMultipartUploadRequest::CompleteMultipartUploadRequest(\r\n    const std::string &bucket,\r\n    const std::string &key, const PartList &partList) :\r\n    CompleteMultipartUploadRequest(bucket, key, partList, \"\")\r\n{\r\n}\r\n\r\nCompleteMultipartUploadRequest::CompleteMultipartUploadRequest(\r\n    const std::string &bucket, const std::string &key, \r\n    const PartList &partList, const std::string &uploadId):\r\n    OssObjectRequest(bucket, key),\r\n    partList_(partList),\r\n    uploadId_(uploadId),\r\n    encodingTypeIsSet_(false)\r\n{\r\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\r\n}\r\n\r\nint CompleteMultipartUploadRequest::validate() const\r\n{\r\n    int ret = OssObjectRequest::validate();\r\n\r\n    if (ret != 0) {\r\n        return ret;\r\n    }\r\n\r\n    if(partList_.empty())\r\n        return ARG_ERROR_MULTIPARTUPLOAD_PARTLIST_EMPTY;\r\n    \r\n    return 0;\r\n}\r\n\r\nvoid CompleteMultipartUploadRequest::setPartList(const PartList &partList)\r\n{\r\n    partList_ = partList;\r\n}\r\n\r\nvoid CompleteMultipartUploadRequest::setEncodingType(const std::string &encodingType)\r\n{\r\n    encodingType_ = encodingType;\r\n    encodingTypeIsSet_ = true;\r\n}\r\n\r\nvoid CompleteMultipartUploadRequest::setUploadId(const std::string &uploadId)\r\n{\r\n    uploadId_ = uploadId;\r\n}\r\n\r\nvoid CompleteMultipartUploadRequest::setAcl(CannedAccessControlList acl)\r\n{\r\n    metaData_.addHeader(\"x-oss-object-acl\", ToAclName(acl));\r\n}\r\n\r\nvoid CompleteMultipartUploadRequest::setCallback(const std::string& callback, const std::string& callbackVar)\r\n{\r\n    metaData_.removeHeader(\"x-oss-callback\");\r\n    metaData_.removeHeader(\"x-oss-callback-var\");\r\n\r\n    if (!callback.empty()) {\r\n        metaData_.addHeader(\"x-oss-callback\", callback);\r\n    }\r\n\r\n    if (!callbackVar.empty()) {\r\n        metaData_.addHeader(\"x-oss-callback-var\", callbackVar);\r\n    }\r\n}\r\n\r\nObjectMetaData& CompleteMultipartUploadRequest::MetaData()\r\n{\r\n    return metaData_;\r\n}\r\nParameterCollection CompleteMultipartUploadRequest::specialParameters()const\r\n{\r\n    ParameterCollection parameters;\r\n    parameters[\"uploadId\"] = uploadId_;\r\n    if(encodingTypeIsSet_)\r\n    {\r\n        parameters[\"encoding-type\"] = encodingType_;\r\n    }\r\n    return parameters;\r\n}\r\n\r\nHeaderCollection CompleteMultipartUploadRequest::specialHeaders() const\r\n{\r\n    auto headers = metaData_.toHeaderCollection();\r\n    auto baseHeaders = OssObjectRequest::specialHeaders();\r\n    headers.insert(baseHeaders.begin(), baseHeaders.end());\r\n    return headers;\r\n}\r\n\r\nstd::string CompleteMultipartUploadRequest::payload() const\r\n{\r\n    std::stringstream ss;\r\n    ss << \"<CompleteMultipartUpload>\" << std::endl;\r\n    for (auto const &part : partList_) {\r\n        ss << \"<Part>\" << std::endl;\r\n        ss << \"  <PartNumber>\";\r\n        ss << std::to_string(part.PartNumber());\r\n        ss << \"</PartNumber>\" << std::endl;\r\n        ss << \"  <ETag>\";\r\n        ss << part.ETag();\r\n        ss << \"</ETag>\" << std::endl;\r\n        ss << \"</Part>\";\r\n    }\r\n    ss << \"</CompleteMultipartUpload>\";\r\n    return ss.str();\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/CompleteMultipartUploadResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/CompleteMultipartUploadResult.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include \"../utils/Utils.h\"\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\n\r\nCompleteMultipartUploadResult::CompleteMultipartUploadResult() :\r\n    OssObjectResult(),\r\n    crc64_(0),\r\n    content_(nullptr)\r\n{\r\n}\r\n\r\nCompleteMultipartUploadResult::CompleteMultipartUploadResult(const std::string& result) :\r\n    CompleteMultipartUploadResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nCompleteMultipartUploadResult::CompleteMultipartUploadResult(const std::shared_ptr<std::iostream>& result,\r\n    const HeaderCollection& headers) :\r\n    OssObjectResult(headers),\r\n    crc64_(0),\r\n    content_(nullptr)\r\n{\r\n    std::string contentType;\r\n    if (headers.find(Http::CONTENT_TYPE) != headers.end()) {\r\n        contentType = ToLower(headers.at(Http::CONTENT_TYPE).c_str());\r\n    }\r\n\r\n    if (contentType.compare(\"application/json\") != 0) {\r\n        std::istreambuf_iterator<char> isb(*result.get()), end;\r\n        std::string str(isb, end);\r\n        *this = str;\r\n    }\r\n    else {\r\n        content_ = result;\r\n        parseDone_ = true;\r\n    }\r\n\r\n    if (headers.find(\"x-oss-hash-crc64ecma\") != headers.end()) {\r\n        crc64_ =  std::strtoull(headers.at(\"x-oss-hash-crc64ecma\").c_str(), nullptr, 10);\r\n    }\r\n\r\n    if (eTag_.empty() && headers.find(Http::ETAG) != headers.end()) {\r\n        eTag_ = TrimQuotes(headers.at(Http::ETAG).c_str());\r\n    }\r\n}\r\n\r\nCompleteMultipartUploadResult& CompleteMultipartUploadResult::operator =(const std::string& result)\r\n{\r\n    if (result.empty()) {\r\n        parseDone_ = true;\r\n        return *this;\r\n    }\r\n\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root = doc.RootElement();\r\n        if (root && !std::strncmp(\"CompleteMultipartUploadResult\", root->Name(), 29)) {\r\n            XMLElement *node;\r\n            node = root->FirstChildElement(\"EncodingType\");\r\n            if (node && node->GetText())\r\n            {\r\n                encodingType_ = node->GetText();\r\n            }\r\n            bool bEncode = false;\r\n            bEncode = !ToLower(encodingType_.c_str()).compare(0, 3, \"url\", 3);\r\n\r\n            node = root->FirstChildElement(\"Bucket\");\r\n            if (node && node->GetText())\r\n            {\r\n                bucket_ = node->GetText();\r\n            }\r\n\r\n            node = root->FirstChildElement(\"Location\");\r\n            if(node && node->GetText())\r\n            {\r\n                if (bEncode)\r\n                {\r\n                    location_ = UrlDecode(node->GetText());\r\n                }\r\n                else {\r\n                    location_ = node->GetText();\r\n                }\r\n            }\r\n\r\n            node = root->FirstChildElement(\"Key\");\r\n            if(node && node->GetText())\r\n            {\r\n                if(bEncode)\r\n                {\r\n                    key_ = UrlDecode(node->GetText());\r\n                }else{\r\n                    key_ = node->GetText();\r\n                }\r\n            }\r\n\r\n            node = root->FirstChildElement(\"ETag\");\r\n            if(node && node->GetText())\r\n            {\r\n                eTag_ = node->GetText();\r\n            }\r\n            parseDone_ = true;\r\n        }\r\n    }\r\n    return *this;\r\n}\r\n\r\nconst std::string& CompleteMultipartUploadResult::Location() const\r\n{\r\n    return location_;\r\n}\r\n\r\nconst std::string& CompleteMultipartUploadResult::Key() const\r\n{\r\n    return key_;\r\n}\r\n\r\nconst std::string& CompleteMultipartUploadResult::Bucket() const\r\n{\r\n    return bucket_;\r\n}\r\n\r\nconst std::string& CompleteMultipartUploadResult::ETag() const\r\n{\r\n    return eTag_;\r\n}\r\n\r\nconst std::string& CompleteMultipartUploadResult::EncodingType() const\r\n{\r\n    return encodingType_;\r\n}\r\n\r\nuint64_t CompleteMultipartUploadResult::CRC64() const\r\n{\r\n    return crc64_;\r\n}\r\n\r\nconst std::shared_ptr<std::iostream>& CompleteMultipartUploadResult::Content() const\r\n{\r\n    return content_;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/CopyObjectRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/CopyObjectRequest.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n#include \"../utils/Utils.h\"\r\n#include <sstream>\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nCopyObjectRequest::CopyObjectRequest(const std::string &bucket, const std::string &key):\r\n    OssObjectRequest(bucket, key),\r\n    sourceBucket_(),\r\n    sourceKey_()\r\n{\r\n}\r\n\r\nCopyObjectRequest::CopyObjectRequest(const std::string &bucket, const std::string &key,\r\n    const ObjectMetaData &metaData):\r\n    OssObjectRequest(bucket, key),\r\n    sourceBucket_(),\r\n    sourceKey_(),\r\n    metaData_(metaData)\r\n{\r\n}\r\n\r\nvoid CopyObjectRequest::setCopySource(const std::string& srcBucket,const std::string& srcKey)\r\n{\r\n    sourceBucket_ = srcBucket;\r\n    sourceKey_ = srcKey;\r\n}\r\n\r\nvoid CopyObjectRequest::setSourceIfMatchETag(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-copy-source-if-match\", value);\r\n}\r\n\r\nvoid CopyObjectRequest::setSourceIfNotMatchETag(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-copy-source-if-none-match\", value);\r\n}\r\n\r\nvoid CopyObjectRequest::setSourceIfUnModifiedSince(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-copy-source-if-unmodified-since\", value);\r\n}\r\n\r\nvoid CopyObjectRequest::setSourceIfModifiedSince(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-copy-source-if-modified-since\", value);\r\n}\r\n\r\nvoid CopyObjectRequest::setMetadataDirective(const CopyActionList& action)\r\n{\r\n    metaData_.addHeader(\"x-oss-metadata-directive\", ToCopyActionName(action));\r\n}\r\n\r\nvoid CopyObjectRequest::setAcl(const CannedAccessControlList& acl)\r\n{\r\n    metaData_.addHeader(\"x-oss-object-acl\", ToAclName(acl));\r\n}\r\n\r\nvoid CopyObjectRequest::setTagging(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-tagging\", value);\r\n}\r\n\r\nvoid CopyObjectRequest::setTaggingDirective(const CopyActionList& action)\r\n{\r\n    metaData_.addHeader(\"x-oss-tagging-directive\", ToCopyActionName(action));\r\n}\r\n\r\nvoid CopyObjectRequest::setTrafficLimit(uint64_t value)\r\n{\r\n    metaData_.addHeader(\"x-oss-traffic-limit\", std::to_string(value));\r\n}\r\n\r\nHeaderCollection CopyObjectRequest::specialHeaders() const\r\n{\r\n    auto headers = metaData_.toHeaderCollection();\r\n\r\n    if (headers.find(Http::CONTENT_TYPE) == headers.end()) {\r\n        headers[Http::CONTENT_TYPE] = LookupMimeType(Key());\r\n    }\r\n\r\n    std::string source;\r\n    source.append(\"/\").append(sourceBucket_).append(\"/\").append(UrlEncode(sourceKey_));\r\n    if (!versionId_.empty()) {\r\n        source.append(\"?versionId=\").append(versionId_);\r\n    }\r\n    headers[\"x-oss-copy-source\"] = source;\n\r\n    auto baseHeaders = OssObjectRequest::specialHeaders();\r\n    headers.insert(baseHeaders.begin(), baseHeaders.end());\r\n\r\n    return headers;\r\n}\r\n\r\nParameterCollection CopyObjectRequest::specialParameters() const\r\n{\r\n    return ParameterCollection();\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/CopyObjectResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/CopyObjectResult.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include \"../utils/Utils.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\nCopyObjectResult::CopyObjectResult() :\r\n    OssObjectResult()\r\n{\r\n}\r\n\r\nCopyObjectResult::CopyObjectResult(const std::string& data):\r\n    CopyObjectResult()\r\n{\r\n    *this = data;\r\n}\r\n\r\nCopyObjectResult::CopyObjectResult(const std::shared_ptr<std::iostream>& data):\r\n    CopyObjectResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*data.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nCopyObjectResult::CopyObjectResult(const HeaderCollection& headers, const std::shared_ptr<std::iostream>& data):\r\n    OssObjectResult(headers)\r\n{\r\n    if (headers.find(\"x-oss-copy-source-version-id\") != headers.end()) {\r\n        sourceVersionId_ = headers.at(\"x-oss-copy-source-version-id\");\r\n    }\r\n\r\n    std::istreambuf_iterator<char> isb(*data.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nCopyObjectResult& CopyObjectResult::operator =(const std::string& data)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(data.c_str(), data.size())) == XML_SUCCESS) {\r\n        XMLElement* root = doc.RootElement();\r\n        if (root && !std::strncmp(\"CopyObjectResult\", root->Name(), strlen(\"CopyObjectResult\"))) {\r\n            XMLElement *node;\r\n            node = root->FirstChildElement(\"LastModified\");\r\n            if (node && node->GetText()) {\r\n                lastModified_ = node->GetText();\r\n            }\r\n\r\n            node = root->FirstChildElement(\"ETag\");\r\n            if (node && node->GetText()) {\r\n                etag_ = TrimQuotes(node->GetText());\r\n            }\r\n\r\n            //TODO check the result and the parse flag;\r\n            parseDone_ = true;\r\n        }\r\n    }\r\n    return *this;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/CreateBucketRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/CreateBucketRequest.h>\r\n#include <../utils/Utils.h>\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nCreateBucketRequest::CreateBucketRequest(const std::string &bucket, StorageClass storageClass):\r\n    CreateBucketRequest(bucket, storageClass, CannedAccessControlList::Default)\r\n{\r\n}\r\n\r\nCreateBucketRequest::CreateBucketRequest(const std::string &bucket, StorageClass storageClass, CannedAccessControlList acl):\r\n    OssBucketRequest(bucket),\r\n    storageClass_(storageClass),\r\n    acl_(acl),\r\n    dataRedundancyType_(DataRedundancyType::NotSet)\r\n{\r\n}\r\n\r\nstd::string CreateBucketRequest::payload() const\r\n{\r\n    std::string str;\r\n    str.append(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\");\r\n    str.append(\"<CreateBucketConfiguration>\\n\");\r\n    str.append(\"<StorageClass>\");\r\n    str.append(ToStorageClassName(storageClass_));\r\n    str.append(\"</StorageClass>\\n\");\r\n    if (dataRedundancyType_ != DataRedundancyType::NotSet) {\r\n        str.append(\"<DataRedundancyType>\");\r\n        str.append(ToDataRedundancyTypeName(dataRedundancyType_));\r\n        str.append(\"</DataRedundancyType>\\n\");\r\n    }\r\n    str.append(\"</CreateBucketConfiguration>\");\r\n    return str;\r\n}\r\n\r\nHeaderCollection CreateBucketRequest::specialHeaders() const\r\n{\r\n    if (acl_ < CannedAccessControlList::Default) {\r\n        HeaderCollection headers;\r\n        headers[\"x-oss-acl\"] = ToAclName(acl_);\r\n        return headers;\r\n    }\r\n    return OssRequest::specialHeaders();\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/CreateSelectObjectMetaRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/CreateSelectObjectMetaRequest.h>\n#include <sstream>\n#include \"ModelError.h\"\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nCreateSelectObjectMetaRequest::CreateSelectObjectMetaRequest(const std::string& bucket, const std::string& key) :\n    OssObjectRequest(bucket, key), \n    inputFormat_(nullptr), \n    overWriteIfExists_(false)\n{\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\n}\n\nvoid CreateSelectObjectMetaRequest::setOverWriteIfExists(bool overWriteIfExists)\n{\n    overWriteIfExists_ = overWriteIfExists;\n}\n\nvoid CreateSelectObjectMetaRequest::setInputFormat(InputFormat& inputFormat)\n{\n    inputFormat_ = &inputFormat;\n}\n\nstd::string CreateSelectObjectMetaRequest::payload() const\n{\n    std::stringstream ss;\n    if (inputFormat_->Type() == \"csv\") {\n        ss << \"<CsvMetaRequest>\" << std::endl;\n        ss << inputFormat_->toXML(0) << std::endl;\n        ss << \"<OverwriteIfExists>\" << (overWriteIfExists_ ? \"true\" : \"false\") << \"</OverwriteIfExists>\" << std::endl;\n        ss << \"</CsvMetaRequest>\" << std::endl;\n    }\n    else {\n        ss << \"<JsonMetaRequest>\" << std::endl;\n        ss << inputFormat_->toXML(0) << std::endl;\n        ss << \"<OverwriteIfExists>\" << (overWriteIfExists_ ? \"true\" : \"false\") << \"</OverwriteIfExists>\" << std::endl;\n        ss << \"</JsonMetaRequest>\" << std::endl;\n    }\n    return ss.str();\n}\n\nint CreateSelectObjectMetaRequest::validate() const\n{\n    int ret = OssObjectRequest::validate();\n    if (ret != 0) {\n        return ret;\n    }\n    if (inputFormat_ == nullptr) {\n        return ARG_ERROR_CREATE_SELECT_OBJECT_META_NULL_POINT;\n    }\n    return 0;\n}\n\nParameterCollection CreateSelectObjectMetaRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    if (inputFormat_) {\n        auto type = inputFormat_->Type();\n        type.append(\"/meta\");\n        parameters[\"x-oss-process\"] = type;\n    }\n    return parameters;\n}\n"
  },
  {
    "path": "sdk/src/model/CreateSelectObjectMetaResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/CreateSelectObjectMetaResult.h>\n#include <iostream>\n#include <sstream>\n#include \"../utils/Crc32.h\"\n\n#define FRAME_HEADER_LEN   (12+8)\n#define PARSE_FOUR_BYTES(a, b, c, d) (((uint32_t)(a) << 24)|((uint32_t)(b) << 16)|((uint32_t)(c) << 8)|(d))\n#define PARSE_EIGHT_BYTES(a, b, c, d, e, f, g, h) (((uint64_t)(a)<<56)|((uint64_t)(b)<<48)| ((uint64_t)(c)<<40)| ((uint64_t)(d)<<32)| ((uint64_t)(e)<<24)| ((uint64_t)(f)<<16)| ((uint64_t)(g)<<8)| (h))\n\nusing namespace AlibabaCloud::OSS;\n\nCreateSelectObjectMetaResult::CreateSelectObjectMetaResult()\n    :OssResult(),\n    offset_(0), \n    totalScanned_(0), \n    status_(0), \n    splitsCount_(0), \n    rowsCount_(0), \n    colsCount_(0)\n{\n}\n\nCreateSelectObjectMetaResult::CreateSelectObjectMetaResult( const std::string& bucket, const std::string& key,\n    const std::string& requestId, const std::shared_ptr<std::iostream>& data) : \n    CreateSelectObjectMetaResult()\n{\n    bucket_ = bucket;\n    key_ = key;\n    requestId_ = requestId;\n    *this = data;\n}\n\nCreateSelectObjectMetaResult& CreateSelectObjectMetaResult::operator=(const std::shared_ptr<std::iostream>& data)\n{\n    data->seekg(0, data->beg);\n    uint8_t buffer[36];\n    char messageBuffer[256];\n    parseDone_ = true;\n    while (data->good()) {\n        // header 12 bytes\n        data->read(reinterpret_cast<char*>(buffer), 12);\n        if (!data->good()) {\n            break;\n        }\n        // type 3 bytes\n        int type = 0;\n        type = (buffer[1] << 16) | (buffer[2] << 8) | buffer[3];\n        // payload length 4 bytes\n        uint32_t length = PARSE_FOUR_BYTES(buffer[4], buffer[5], buffer[6], buffer[7]);\n        // header checksum\n\n        // payload\n        switch (type)\n        {\n        case 0x800006:\n        case 0x800007:\n        {\n            uint32_t payloadCrc32 = 0;\n            uint32_t messageLength = length - 32;\n            data->read(reinterpret_cast<char*>(buffer), 32);\n            payloadCrc32 = CRC32::CalcCRC(payloadCrc32, buffer, 32);\n            // offset 8 bytes\n            offset_ = PARSE_EIGHT_BYTES(buffer[0],buffer[1],buffer[2],buffer[3],\n                    buffer[4],buffer[5],buffer[6],buffer[7]);\n            // total scaned 8bytes\n            totalScanned_ = PARSE_EIGHT_BYTES(buffer[8],buffer[9],buffer[10],buffer[11],\n                    buffer[12],buffer[13],buffer[14],buffer[15]);\n            // status 4 bytes\n            status_ = PARSE_FOUR_BYTES(buffer[16], buffer[17], buffer[18], buffer[19]);\n            // splitsCount 4 bytes\n            splitsCount_ = PARSE_FOUR_BYTES(buffer[20], buffer[21], buffer[22], buffer[23]);\n            // rowsCount 8 bytes\n            rowsCount_ = PARSE_EIGHT_BYTES(buffer[24],buffer[25],buffer[26],buffer[27],\n                    buffer[28],buffer[29],buffer[30],buffer[31]);\n\n            if (type == 0x800006) {\n                messageLength -= 4;\n                // colsCount\n                data->read(reinterpret_cast<char*>(buffer), 4);\n                payloadCrc32 = CRC32::CalcCRC(payloadCrc32, buffer, 4);\n                colsCount_ = PARSE_FOUR_BYTES(buffer[0],buffer[1],buffer[2],buffer[3]);\n            }\n            data->read(messageBuffer, messageLength);\n            payloadCrc32 = CRC32::CalcCRC(payloadCrc32, messageBuffer, messageLength);\n            errorMessage_ = std::string(messageBuffer);\n\n            if (!data->good()) {\n                parseDone_ = false;\n                break;\n            }\n\n            // payload crc32 checksum\n            uint32_t payloadChecksum = 0;\n            data->read(reinterpret_cast<char*>(buffer), 4);\n            payloadChecksum = PARSE_FOUR_BYTES(buffer[0],buffer[1],buffer[2],buffer[3]);\n            if (payloadChecksum != 0 && payloadChecksum != payloadCrc32) {\n                parseDone_ = false;\n                return *this;\n            }\n\n        }\n        break;\n        default:\n            data->seekg(length + 4, data->cur);\n            break;\n        }\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/CreateSymlinkRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/CreateSymlinkRequest.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n#include \"../utils/Utils.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nCreateSymlinkRequest::CreateSymlinkRequest(const std::string &bucket, const std::string &key):\r\n    OssObjectRequest(bucket, key)\r\n{\r\n}\r\n\r\nCreateSymlinkRequest::CreateSymlinkRequest(const std::string &bucket, const std::string &key,\r\n    const ObjectMetaData &metaData):\r\n    OssObjectRequest(bucket, key),\r\n    metaData_(metaData)     \r\n{\r\n}\r\n\r\nvoid CreateSymlinkRequest::SetSymlinkTarget(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-symlink-target\", value);\r\n}\r\n\r\nvoid CreateSymlinkRequest::setTagging(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-tagging\", value);\r\n}\r\n\r\nHeaderCollection CreateSymlinkRequest::specialHeaders() const\r\n{\r\n\tauto headers = metaData_.toHeaderCollection();\r\n    auto baseHeaders = OssObjectRequest::specialHeaders();\r\n    headers.insert(baseHeaders.begin(), baseHeaders.end());\r\n    return headers;\r\n}\r\n\r\n\r\nParameterCollection CreateSymlinkRequest::specialParameters() const\r\n{\r\n    ParameterCollection paramters;\r\n    paramters[\"symlink\"] = \"\";\r\n    return paramters;\r\n}\r\n\r\n\r\n"
  },
  {
    "path": "sdk/src/model/CreateSymlinkResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/CreateSymlinkResult.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n#include \"../utils/Utils.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nCreateSymlinkResult::CreateSymlinkResult():\r\n    OssObjectResult()\r\n{\r\n}\r\n\r\nCreateSymlinkResult::CreateSymlinkResult(const std::string& etag):\r\n    OssObjectResult(),\r\n    etag_(TrimQuotes(etag.c_str()))\r\n{\r\n}\r\n\r\nCreateSymlinkResult::CreateSymlinkResult(const HeaderCollection& headers):\r\n    OssObjectResult(headers)\r\n{\r\n    if (headers.find(Http::ETAG) != headers.end()) {\r\n        etag_ = TrimQuotes(headers.at(Http::ETAG).c_str());\r\n    }\r\n}\r\n\r\n\r\n"
  },
  {
    "path": "sdk/src/model/DeleteBucketCorsRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/DeleteBucketCorsRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nDeleteBucketCorsRequest::DeleteBucketCorsRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection DeleteBucketCorsRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"cors\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/DeleteBucketEncryptionRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/DeleteBucketEncryptionRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nDeleteBucketEncryptionRequest::DeleteBucketEncryptionRequest(const std::string& bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection DeleteBucketEncryptionRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"encryption\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/DeleteBucketInventoryConfigurationRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/DeleteBucketInventoryConfigurationRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nDeleteBucketInventoryConfigurationRequest::DeleteBucketInventoryConfigurationRequest(const std::string& bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nDeleteBucketInventoryConfigurationRequest::DeleteBucketInventoryConfigurationRequest(const std::string& bucket, const std::string& id) :\n    DeleteBucketInventoryConfigurationRequest(bucket)\n{\n    id_ = id;\n}\n\nParameterCollection DeleteBucketInventoryConfigurationRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"inventory\"] = \"\";\n    parameters[\"inventoryId\"] = id_;\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/DeleteBucketLifecycleRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/DeleteBucketLifecycleRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nDeleteBucketLifecycleRequest::DeleteBucketLifecycleRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection DeleteBucketLifecycleRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"lifecycle\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/DeleteBucketLoggingRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/DeleteBucketLoggingRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nDeleteBucketLoggingRequest::DeleteBucketLoggingRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection DeleteBucketLoggingRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"logging\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/DeleteBucketPolicyRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/DeleteBucketPolicyRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nDeleteBucketPolicyRequest::DeleteBucketPolicyRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection DeleteBucketPolicyRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"policy\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/DeleteBucketQosInfoRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/DeleteBucketQosInfoRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nDeleteBucketQosInfoRequest::DeleteBucketQosInfoRequest(const std::string& bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection DeleteBucketQosInfoRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"qosInfo\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/DeleteBucketTaggingRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/DeleteBucketTaggingRequest.h>\nusing namespace AlibabaCloud::OSS;\n\nDeleteBucketTaggingRequest::DeleteBucketTaggingRequest(const std::string& bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nvoid DeleteBucketTaggingRequest::setTagging(const Tagging& tagging)\n{\n    tagging_ = tagging;\n}\n\nParameterCollection DeleteBucketTaggingRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    std::string str;\n    for (const Tag& tag : tagging_.Tags())\n    {\n        if (!str.empty())\n            str += \",\";\n        str += tag.Key();\n    }\n    parameters[\"tagging\"] = str;\n    return parameters;\n}\n\n"
  },
  {
    "path": "sdk/src/model/DeleteBucketWebsiteRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/DeleteBucketWebsiteRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nDeleteBucketWebsiteRequest::DeleteBucketWebsiteRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection DeleteBucketWebsiteRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"website\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/DeleteLiveChannelRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/DeleteLiveChannelRequest.h>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nDeleteLiveChannelRequest::DeleteLiveChannelRequest(const std::string &bucket,\n    const std::string &channelName)\n    :LiveChannelRequest(bucket, channelName)\n{\n\n}\n\nParameterCollection DeleteLiveChannelRequest::specialParameters() const\n{\n    ParameterCollection collection;\n    collection[\"live\"] = \"\";\n    return collection;\n}\n\nint DeleteLiveChannelRequest::validate() const\n{\n    return LiveChannelRequest::validate();\n}\n"
  },
  {
    "path": "sdk/src/model/DeleteObjectResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/DeleteObjectResult.h>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nDeleteObjectResult::DeleteObjectResult():\r\n    OssObjectResult(),\r\n    deleteMarker_(false)\r\n{\r\n}\r\n\r\nDeleteObjectResult::DeleteObjectResult(const HeaderCollection& headers):\r\n    OssObjectResult(headers),\r\n    deleteMarker_(false)\r\n{\r\n    if (headers.find(\"x-oss-delete-marker\") != headers.end()) {\r\n        deleteMarker_ = true;\r\n    }\r\n}\r\n\r\nbool DeleteObjectResult::DeleteMarker() const \r\n{\r\n    return deleteMarker_; \r\n}\r\n"
  },
  {
    "path": "sdk/src/model/DeleteObjectTaggingRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/DeleteObjectTaggingRequest.h>\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nDeleteObjectTaggingRequest::DeleteObjectTaggingRequest(const std::string& bucket, const std::string& key):\r\n    OssObjectRequest(bucket, key)\r\n{\r\n}\r\n\r\nParameterCollection DeleteObjectTaggingRequest::specialParameters() const\r\n{\r\n    auto parameters = OssObjectRequest::specialParameters();\r\n    parameters[\"tagging\"] = \"\";\r\n    return parameters;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/DeleteObjectVersionsRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/DeleteObjectVersionsRequest.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nDeleteObjectVersionsRequest::DeleteObjectVersionsRequest(const std::string &bucket) :\n    OssBucketRequest(bucket),\n    quiet_(false),\n    encodingType_(),\n    requestPayer_(RequestPayer::NotSet)\n{\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\n}\n\nbool DeleteObjectVersionsRequest::Quiet() const\n{\n    return quiet_;\n}\n\nconst std::string &DeleteObjectVersionsRequest::EncodingType() const\n{\n    return encodingType_;\n}\n\nvoid DeleteObjectVersionsRequest::addObject(const ObjectIdentifier& object)\r\n{\r\n    objects_.push_back(object);\r\n}\r\n\r\nvoid DeleteObjectVersionsRequest::setObjects(const ObjectIdentifierList& objects)\r\n{\r\n    objects_ = objects;\r\n}\r\n\r\nconst ObjectIdentifierList& DeleteObjectVersionsRequest::Objects() const\r\n{\r\n    return objects_;\r\n}\r\n\r\nvoid DeleteObjectVersionsRequest::clearObjects()\r\n{\r\n    objects_.clear();\r\n}\r\n\nvoid DeleteObjectVersionsRequest::setQuiet(bool quiet)\n{\n    quiet_ = quiet;\n}\n\nvoid DeleteObjectVersionsRequest::setEncodingType(const std::string &value)\n{\n    encodingType_ = value;\n}\n\nvoid DeleteObjectVersionsRequest::setRequestPayer(RequestPayer value)\n{\n    requestPayer_ = value; \n}\n\nstd::string DeleteObjectVersionsRequest::payload() const\n{\n    std::stringstream ss;\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\n    ss << \"<Delete>\" << std::endl;\n    ss << \"  <Quiet>\" << (quiet_ ? \"true\":\"false\") << \"</Quiet>\" << std::endl;\n    for (auto const& object : objects_) {\n    ss << \"  <Object>\" << std::endl << \"\"; \n    ss << \"    <Key>\" << XmlEscape(object.Key()) << \"</Key>\" << std::endl;\n    if (!object.VersionId().empty()) {\r\n    ss << \"    <VersionId>\" << object.VersionId() << \"</VersionId>\" << std::endl;\r\n    }\r\n    ss << \"  </Object>\" << std::endl;\n    }\n    ss << \"</Delete>\" << std::endl;\n    return ss.str();\n}\n\nParameterCollection DeleteObjectVersionsRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"delete\"] = \"\";\n    if (!encodingType_.empty()) {\n        parameters[\"encoding-type\"] = encodingType_;\n    }\n    return parameters;\n}\n\nHeaderCollection DeleteObjectVersionsRequest::specialHeaders() const\n{\n    HeaderCollection headers;\n    if (requestPayer_ == RequestPayer::Requester) {\n        headers[\"x-oss-request-payer\"] = ToLower(ToRequestPayerName(RequestPayer::Requester));\n    }\n    return headers;\n}\n"
  },
  {
    "path": "sdk/src/model/DeleteObjectVersionsResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/DeleteObjectVersionsResult.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include \"../utils/Utils.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\n\r\nDeleteObjectVersionsResult::DeleteObjectVersionsResult() :\r\n    OssResult(),\r\n    quiet_(false),\r\n    deletedObjects_()\r\n{\r\n}\r\n\r\nDeleteObjectVersionsResult::DeleteObjectVersionsResult(const std::string& result) :\r\n    DeleteObjectVersionsResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nDeleteObjectVersionsResult::DeleteObjectVersionsResult(const std::shared_ptr<std::iostream>& result) :\r\n    DeleteObjectVersionsResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nDeleteObjectVersionsResult& DeleteObjectVersionsResult::operator =(const std::string& result)\r\n{\r\n    if (result.empty()) {\r\n        quiet_ = true;\r\n        parseDone_ = true;\r\n        return *this;\r\n    }\r\n\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root = doc.RootElement();\r\n        if (root && !std::strncmp(\"DeleteResult\", root->Name(), 12)) {\r\n            XMLElement *node;\r\n            std::string encodeType;\r\n            node = root->FirstChildElement(\"EncodingType\");\r\n            if (node && node->GetText()) encodeType = node->GetText();\r\n\r\n            bool useUrlDecode = !ToLower(encodeType.c_str()).compare(0, 3, \"url\", 3);\r\n\r\n            //Deleted\r\n            node = root->FirstChildElement(\"Deleted\");\r\n            for (; node; node = node->NextSiblingElement(\"Deleted\")) {\r\n                XMLElement *sub_node;\r\n                DeletedObject object;\r\n\r\n                sub_node = node->FirstChildElement(\"Key\");\r\n                if (sub_node && sub_node->GetText()) {\r\n                    object.setKey(useUrlDecode ? UrlDecode(sub_node->GetText()) : sub_node->GetText());\r\n                }\r\n\r\n                sub_node = node->FirstChildElement(\"VersionId\");\r\n                if (sub_node && sub_node->GetText()) {\r\n                    object.setVersionId(sub_node->GetText());\r\n                }\r\n\r\n                sub_node = node->FirstChildElement(\"DeleteMarker\");\r\n                if (sub_node && sub_node->GetText()) {\r\n                    object.setDeleteMarker(!std::strncmp(\"true\", sub_node->GetText(), 4));\r\n                }\r\n\r\n                sub_node = node->FirstChildElement(\"DeleteMarkerVersionId\");\r\n                if (sub_node && sub_node->GetText()) {\r\n                    object.setDeleteMarkerVersionId(sub_node->GetText());\r\n                }\r\n                deletedObjects_.push_back(object);\r\n            }\r\n        }\r\n        parseDone_ = true;\r\n    }\r\n    return *this;\r\n}\r\n\r\nbool DeleteObjectVersionsResult::Quiet() const\r\n{\r\n    return quiet_;\r\n}\r\n\r\nconst DeletedObjectList& DeleteObjectVersionsResult::DeletedObjects() const \r\n{\r\n    return deletedObjects_; \r\n}\r\n\r\n\r\n\r\n"
  },
  {
    "path": "sdk/src/model/DeleteObjectsRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/DeleteObjectsRequest.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nDeleteObjectsRequest::DeleteObjectsRequest(const std::string &bucket) :\n    OssBucketRequest(bucket),\n    quiet_(false),\n    encodingType_(),\n    requestPayer_(RequestPayer::NotSet)\n{\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\n}\n\nbool DeleteObjectsRequest::Quiet() const\n{\n    return quiet_;\n}\n\nconst std::string &DeleteObjectsRequest::EncodingType() const\n{\n    return encodingType_;\n}\n\nconst std::list<std::string> &DeleteObjectsRequest::KeyList() const\n{\n    return keyList_;\n}\n\nvoid DeleteObjectsRequest::setQuiet(bool quiet)\n{\n    quiet_ = quiet;\n}\n\nvoid DeleteObjectsRequest::setEncodingType(const std::string &value)\n{\n    encodingType_ = value;\n}\n\nvoid DeleteObjectsRequest::addKey(const std::string &key)\n{\n    keyList_.push_back(key);\n}\n\nvoid DeleteObjectsRequest::setKeyList(const DeletedKeyList &keyList)\n{\n    keyList_ = keyList;\n}\n\nvoid DeleteObjectsRequest::clearKeyList()\n{\n    keyList_.clear();\n}\n\nvoid DeleteObjectsRequest::setRequestPayer(RequestPayer value)\n{\n    requestPayer_ = value; \n}\n\nstd::string DeleteObjectsRequest::payload() const\n{\n    std::stringstream ss;\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\n    ss << \"<Delete>\" << std::endl;\n    ss << \"  <Quiet>\" << (quiet_ ? \"true\":\"false\") << \"</Quiet>\" << std::endl;\n    for (auto const &key : keyList_) {\n    ss << \"  <Object>\" << std::endl << \"\"; \n    ss << \"    <Key>\" << XmlEscape(key) << \"</Key>\" << std::endl;\n    ss << \"  </Object>\" << std::endl;\n    }\n    ss << \"</Delete>\" << std::endl;\n    return ss.str();\n}\n\nParameterCollection DeleteObjectsRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"delete\"] = \"\";\n    if (!encodingType_.empty()) {\n        parameters[\"encoding-type\"] = encodingType_;\n    }\n    return parameters;\n}\n\nHeaderCollection DeleteObjectsRequest::specialHeaders() const\n{\n    HeaderCollection headers;\n    if (requestPayer_ == RequestPayer::Requester) {\n        headers[\"x-oss-request-payer\"] = ToLower(ToRequestPayerName(RequestPayer::Requester));\n    }\n    return headers;\n}\n"
  },
  {
    "path": "sdk/src/model/DeleteObjectsResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/DeleteObjectsResult.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include \"../utils/Utils.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\n\r\nDeleteObjectsResult::DeleteObjectsResult() :\r\n    OssResult(),\r\n    quiet_(false),\r\n    keyList_()\r\n{\r\n}\r\n\r\nDeleteObjectsResult::DeleteObjectsResult(const std::string& result) :\r\n    DeleteObjectsResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nDeleteObjectsResult::DeleteObjectsResult(const std::shared_ptr<std::iostream>& result) :\r\n    DeleteObjectsResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nDeleteObjectsResult& DeleteObjectsResult::operator =(const std::string& result)\r\n{\r\n    if (result.empty()) {\r\n        quiet_ = true;\r\n        parseDone_ = true;\r\n        return *this;\r\n    }\r\n\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root = doc.RootElement();\r\n        if (root && !std::strncmp(\"DeleteResult\", root->Name(), 12)) {\r\n            XMLElement *node;\r\n            std::string encodeType;\r\n            node = root->FirstChildElement(\"EncodingType\");\r\n            if (node && node->GetText()) encodeType = node->GetText();\r\n\r\n            bool useUrlDecode = !ToLower(encodeType.c_str()).compare(0, 3, \"url\", 3);\r\n\r\n            //Deleted\r\n            node = root->FirstChildElement(\"Deleted\");\r\n            for (; node; node = node->NextSiblingElement(\"Deleted\")) {\r\n                XMLElement *sub_node;\r\n                sub_node = node->FirstChildElement(\"Key\");\r\n                if (sub_node && sub_node->GetText()) keyList_.push_back(useUrlDecode?UrlDecode(sub_node->GetText()):sub_node->GetText());\r\n            }\r\n        }\r\n        parseDone_ = true;\r\n    }\r\n    return *this;\r\n}\r\n\r\nbool DeleteObjectsResult::Quiet() const\r\n{\r\n    return quiet_;\r\n}\r\n\r\nconst std::list<std::string>& DeleteObjectsResult::keyList() const\r\n{\r\n    return keyList_;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/ExtendBucketWormRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/ExtendBucketWormRequest.h>\n#include <sstream>\n\nusing namespace AlibabaCloud::OSS;\n\nExtendBucketWormRequest::ExtendBucketWormRequest(const std::string &bucket,\n    const std::string &wormId, uint32_t day) :\n    OssBucketRequest(bucket),\n    wormId_(wormId),\n    day_(day)\n{\n}\n\nstd::string ExtendBucketWormRequest::payload() const\n{\n    std::stringstream ss;\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\n    ss << \"<ExtendWormConfiguration>\" << std::endl;\n    ss << \"  <RetentionPeriodInDays>\" << std::to_string(day_) << \"</RetentionPeriodInDays>\" << std::endl;\n    ss << \"</ExtendWormConfiguration>\" << std::endl;\n    return ss.str();\n}\n\nParameterCollection ExtendBucketWormRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"wormId\"] = wormId_;\n    parameters[\"wormExtend\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GeneratePresignedUrlRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GeneratePresignedUrlRequest.h>\n#include <alibabacloud/oss/http/HttpType.h>\n#include \"../utils/Utils.h\"\n#include <sstream>\n#include <chrono>\nusing namespace AlibabaCloud::OSS;\n\nGeneratePresignedUrlRequest::GeneratePresignedUrlRequest(const std::string &bucket, const std::string &key) :\n    GeneratePresignedUrlRequest(bucket, key, Http::Method::Get)\n{\n}\n\nGeneratePresignedUrlRequest::GeneratePresignedUrlRequest(const std::string &bucket, const std::string &key, Http::Method method):\n    bucket_(bucket),\n    key_(key),\n    method_(method),\n    unencodedSlash_(false)\n{\n    //defalt 15 min\n    expires_ = (int64_t)(std::time(nullptr) + 15*60);\n}\n\nvoid GeneratePresignedUrlRequest::setBucket(const std::string &bucket)\n{\n    bucket_ = bucket;\n}\n\nvoid GeneratePresignedUrlRequest::setKey(const std::string &key)\n{\n    key_ = key;\n}\n\nvoid GeneratePresignedUrlRequest::setContentType(const std::string &value)\n{\n    metaData_.HttpMetaData()[Http::CONTENT_TYPE] = value;\n}\n\nvoid GeneratePresignedUrlRequest::setContentMd5(const std::string &value)\n{\n    metaData_.HttpMetaData()[Http::CONTENT_MD5] = value;\n}\n\nvoid GeneratePresignedUrlRequest::setExpires(int64_t unixTime)\n{\n    expires_ = unixTime;\n}\n\nvoid GeneratePresignedUrlRequest::setProcess(const std::string &value)\n{\n    parameters_[\"x-oss-process\"] = value;\n}\n\nvoid GeneratePresignedUrlRequest::setTrafficLimit(uint64_t value)\n{\n    parameters_[\"x-oss-traffic-limit\"] = std::to_string(value);\n}\n\nvoid GeneratePresignedUrlRequest::setVersionId(const std::string& versionId)\n{\n    parameters_[\"versionId\"] = versionId;\n}\n\nvoid GeneratePresignedUrlRequest::setRequestPayer(RequestPayer value)\n{\n    if (value == RequestPayer::Requester) {\n        parameters_[\"x-oss-request-payer\"] = ToLower(ToRequestPayerName(value));\n    }\n}\n\nvoid GeneratePresignedUrlRequest::addResponseHeaders(RequestResponseHeader header, const std::string &value)\n{\n    static const char *ResponseHeader[] = {\n        \"response-content-type\", \"response-content-language\",\n        \"response-expires\", \"response-cache-control\",\n        \"response-content-disposition\", \"response-content-encoding\" };\n    parameters_[ResponseHeader[header - RequestResponseHeader::ContentType]] = value;\n}\n\nvoid GeneratePresignedUrlRequest::addParameter(const std::string&key, const std::string &value)\n{\n    parameters_[key] = value;\n}\n\nMetaData &GeneratePresignedUrlRequest::UserMetaData()\n{\n    return metaData_.UserMetaData();\n}\n\nMetaData &GeneratePresignedUrlRequest::HttpMetaData()\n{\n    return metaData_.HttpMetaData();\n}\n\n\nvoid GeneratePresignedUrlRequest::setUnencodedSlash(bool value)\n{\n    unencodedSlash_ = value;\n}\n\nvoid GeneratePresignedUrlRequest::addAdditionalSignHeader(const std::string&key)\n{\n    additionalSignHeaders_.emplace(key);\n}"
  },
  {
    "path": "sdk/src/model/GenerateRTMPSignedUrlRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GenerateRTMPSignedUrlRequest.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nGenerateRTMPSignedUrlRequest::GenerateRTMPSignedUrlRequest(\n    const std::string& bucket, \n    const std::string& channelName, const std::string& playlist,\n    uint64_t expires):\n    LiveChannelRequest(bucket, channelName),\n    playList_(playlist),\n    expires_(expires)\n{\n\n}\n\nParameterCollection GenerateRTMPSignedUrlRequest::Parameters() const\n{\n    ParameterCollection collection;\n    if(!playList_.empty())\n    {\n        collection[\"playlistName\"] = playList_;\n    }\n    return collection;\n}\n\nvoid GenerateRTMPSignedUrlRequest::setPlayList(const std::string &playList)\n{\n    playList_ = playList;\n}\n\nvoid GenerateRTMPSignedUrlRequest::setExpires(uint64_t expires)\n{\n    expires_ = expires;\n}\n\nconst std::string& GenerateRTMPSignedUrlRequest::PlayList() const\n{\n    return playList_;\n}\n\nuint64_t GenerateRTMPSignedUrlRequest::Expires() const\n{\n    return expires_;\n}\n\n"
  },
  {
    "path": "sdk/src/model/GetBucketAclRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketAclRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketAclRequest::GetBucketAclRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketAclRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"acl\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketAclResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketAclResult.h>\n#include <alibabacloud/oss/model/Owner.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nGetBucketAclResult::GetBucketAclResult() :\n    OssResult()\n{\n}\n\nGetBucketAclResult::GetBucketAclResult(const std::string& result):\n    GetBucketAclResult()\n{\n    *this = result;\n}\n\nGetBucketAclResult::GetBucketAclResult(const std::shared_ptr<std::iostream>& result):\n    GetBucketAclResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketAclResult& GetBucketAclResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root =doc.RootElement();\n        if (root && !std::strncmp(\"AccessControlPolicy\", root->Name(), 19)) {\n            XMLElement *node;\n\n            node = root->FirstChildElement(\"Owner\");\n            std::string owner_ID, owner_DisplayName;\n            if (node) {\n                XMLElement *sub_node;\n                sub_node = node->FirstChildElement(\"ID\");\n                if (sub_node && sub_node->GetText()) owner_ID = sub_node->GetText();\n\n                sub_node = node->FirstChildElement(\"DisplayName\");\n                if (sub_node && sub_node->GetText()) owner_DisplayName = sub_node->GetText();\n            }\n\n            node = root->FirstChildElement(\"AccessControlList\");\n            if (node) {\n                XMLElement *sub_node;\n                sub_node = node->FirstChildElement(\"Grant\");\n                if (sub_node && sub_node->GetText()) acl_ = ToAclType(sub_node->GetText());\n            }\n\n            owner_ = AlibabaCloud::OSS::Owner(owner_ID, owner_DisplayName);\n\n            //TODO check the result and the parse flag;\n            parseDone_ = true;\n        }\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetBucketCorsRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketCorsRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketCorsRequest::GetBucketCorsRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketCorsRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"cors\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketCorsResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketCorsResult.h>\n#include <alibabacloud/oss/model/Owner.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nGetBucketCorsResult::GetBucketCorsResult() :\n    OssResult()\n{\n}\n\nGetBucketCorsResult::GetBucketCorsResult(const std::string& result):\n    GetBucketCorsResult()\n{\n    *this = result;\n}\n\nGetBucketCorsResult::GetBucketCorsResult(const std::shared_ptr<std::iostream>& result):\n    GetBucketCorsResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketCorsResult& GetBucketCorsResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root =doc.RootElement();\n        if (root && !std::strncmp(\"CORSConfiguration\", root->Name(), 17)) {\n            XMLElement *rule_node = root->FirstChildElement(\"CORSRule\");\n            for (; rule_node; rule_node = rule_node->NextSiblingElement(\"CORSRule\")) {\n                XMLElement *node = rule_node->FirstChildElement();\n                CORSRule rule;\n                for (; node; node = node->NextSiblingElement()) {\n\n                    if (!strncmp(node->Name(), \"AllowedOrigin\", 13))\n                        if (node->GetText()) rule.addAllowedOrigin(node->GetText());\n\n                    if (!strncmp(node->Name(), \"AllowedMethod\", 13))\n                        if (node->GetText()) rule.addAllowedMethod(node->GetText());\n\n                    if (!strncmp(node->Name(), \"AllowedHeader\", 13))\n                        if (node->GetText()) rule.addAllowedHeader(node->GetText());\n\n                    if (!strncmp(node->Name(), \"ExposeHeader\", 12))\n                        if (node->GetText()) rule.addExposeHeader(node->GetText());\n\n                    if (!strncmp(node->Name(), \"MaxAgeSeconds\", 13))\n                        if (node->GetText()) rule.setMaxAgeSeconds(std::atoi(node->GetText()));\n                }\n                ruleList_.push_back(rule);\n            }\n            parseDone_ = true;\n        }\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetBucketEncryptionRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketEncryptionRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketEncryptionRequest::GetBucketEncryptionRequest(const std::string& bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketEncryptionRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"encryption\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketEncryptionResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketEncryptionResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\n\nGetBucketEncryptionResult::GetBucketEncryptionResult() :\n    OssResult()\n{\n}\n\nGetBucketEncryptionResult::GetBucketEncryptionResult(const std::string& result) :\n    GetBucketEncryptionResult()\n{\n    *this = result;\n}\n\nGetBucketEncryptionResult::GetBucketEncryptionResult(const std::shared_ptr<std::iostream>& result) :\n    GetBucketEncryptionResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketEncryptionResult& GetBucketEncryptionResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root = doc.RootElement();\n        if (root && !std::strncmp(\"ServerSideEncryptionRule\", root->Name(), 24)) {\n            XMLElement* node;\n\n            node = root->FirstChildElement(\"ApplyServerSideEncryptionByDefault\");\n            if (node) {\n                XMLElement* sub_node;\n                sub_node = node->FirstChildElement(\"SSEAlgorithm\");\n                if (sub_node && sub_node->GetText()) SSEAlgorithm_ = ToSSEAlgorithm(sub_node->GetText());\n\n                sub_node = node->FirstChildElement(\"KMSMasterKeyID\");\n                if (sub_node && sub_node->GetText()) KMSMasterKeyID_ = sub_node->GetText();\n            }\n            parseDone_ = true;\n        }\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetBucketInfoRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketInfoRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketInfoRequest::GetBucketInfoRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketInfoRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"bucketInfo\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketInfoResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/GetBucketInfoResult.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\n\r\nGetBucketInfoResult::GetBucketInfoResult() :\r\n    OssResult(),\r\n    dataRedundancyType_(AlibabaCloud::OSS::DataRedundancyType::NotSet),\r\n    sseAlgorithm_(AlibabaCloud::OSS::SSEAlgorithm::NotSet),\r\n    versioningStatus_(AlibabaCloud::OSS::VersioningStatus::NotSet)\r\n{\r\n}\r\n\r\nGetBucketInfoResult::GetBucketInfoResult(const std::string& result):\r\n    GetBucketInfoResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nGetBucketInfoResult::GetBucketInfoResult(const std::shared_ptr<std::iostream>& result):\r\n    GetBucketInfoResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nGetBucketInfoResult& GetBucketInfoResult::operator =(const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"BucketInfo\", root->Name(), 10)) {\r\n            XMLElement *node;\r\n            XMLElement *bucket_node;\r\n            bucket_node = root->FirstChildElement(\"Bucket\");\r\n            if (bucket_node) {\r\n                node = bucket_node->FirstChildElement(\"CreationDate\");\r\n                if (node && node->GetText()) creationDate_ = node->GetText();\r\n\r\n                node = bucket_node->FirstChildElement(\"ExtranetEndpoint\");\r\n                if (node && node->GetText()) extranetEndpoint_ = node->GetText();\r\n\r\n                node = bucket_node->FirstChildElement(\"IntranetEndpoint\");\r\n                if (node && node->GetText()) intranetEndpoint_ = node->GetText();\r\n\r\n                node = bucket_node->FirstChildElement(\"Location\");\r\n                if (node && node->GetText()) location_ = node->GetText();\r\n\r\n                node = bucket_node->FirstChildElement(\"Name\");\r\n                if (node && node->GetText()) name_ = node->GetText();\r\n\r\n                node = bucket_node->FirstChildElement(\"StorageClass\");\r\n                if (node && node->GetText()) storageClass_ = ToStorageClassType(node->GetText());\r\n\r\n                node = bucket_node->FirstChildElement(\"Owner\");\r\n                std::string owner_ID, owner_DisplayName;\r\n                if (node) {\r\n                    XMLElement *sub_node;\r\n                    sub_node = node->FirstChildElement(\"ID\");\r\n                    if (sub_node && sub_node->GetText()) owner_ID = sub_node->GetText();\r\n\r\n                    sub_node = node->FirstChildElement(\"DisplayName\");\r\n                    if (sub_node && sub_node->GetText()) owner_DisplayName = sub_node->GetText();\r\n                }\r\n                owner_ = AlibabaCloud::OSS::Owner(owner_ID, owner_DisplayName);\r\n\r\n                node = bucket_node->FirstChildElement(\"AccessControlList\");\r\n                if (node) {\r\n                    XMLElement *sub_node;\r\n                    sub_node = node->FirstChildElement(\"Grant\");\r\n                    if (sub_node && sub_node->GetText()) acl_ = ToAclType(sub_node->GetText());\r\n                }\r\n\r\n                node = bucket_node->FirstChildElement(\"DataRedundancyType\");\r\n                if (node && node->GetText()) dataRedundancyType_ = ToDataRedundancyType(node->GetText());\r\n\r\n                node = bucket_node->FirstChildElement(\"Comment\");\r\n                if (node && node->GetText()) comment_ = node->GetText();\r\n\r\n                node = bucket_node->FirstChildElement(\"ServerSideEncryptionRule\");\r\n                if (node) {\r\n                    XMLElement *sub_node;\r\n                    sub_node = node->FirstChildElement(\"SSEAlgorithm\");\r\n                    if (sub_node && sub_node->GetText()) sseAlgorithm_ = ToSSEAlgorithm(sub_node->GetText());\r\n\r\n                    sub_node = node->FirstChildElement(\"KMSMasterKeyID\");\r\n                    if (sub_node && sub_node->GetText()) kmsMasterKeyID_ = sub_node->GetText();\r\n                }\r\n\r\n                node = bucket_node->FirstChildElement(\"Versioning\");\r\n                if (node && node->GetText()) versioningStatus_ = ToVersioningStatusType(node->GetText());\r\n            }\r\n            //TODO check the result and the parse flag;\r\n            parseDone_ = true;\r\n        }\r\n    }\r\n    return *this;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/GetBucketInventoryConfigurationRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketInventoryConfigurationRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketInventoryConfigurationRequest::GetBucketInventoryConfigurationRequest(const std::string& bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nGetBucketInventoryConfigurationRequest::GetBucketInventoryConfigurationRequest(const std::string& bucket, const std::string& id) :\n    GetBucketInventoryConfigurationRequest(bucket)\n{\n    id_ = id;\n}\n\nParameterCollection GetBucketInventoryConfigurationRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"inventory\"] = \"\";\n    parameters[\"inventoryId\"] = id_;\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketInventoryConfigurationResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketInventoryConfigurationResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nGetBucketInventoryConfigurationResult::GetBucketInventoryConfigurationResult() :\n    OssResult()\n{\n}\n\nGetBucketInventoryConfigurationResult::GetBucketInventoryConfigurationResult(const std::string& result) :\n    GetBucketInventoryConfigurationResult()\n{\n    *this = result;\n}\n\nGetBucketInventoryConfigurationResult::GetBucketInventoryConfigurationResult(const std::shared_ptr<std::iostream>& result) :\n    GetBucketInventoryConfigurationResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketInventoryConfigurationResult& GetBucketInventoryConfigurationResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root = doc.RootElement();\n        if (root && !std::strncmp(\"InventoryConfiguration\", root->Name(), 22)) {\n            XMLElement* node;\n\n            node = root->FirstChildElement(\"Id\");\n            if (node && node->GetText()) inventoryConfiguration_.setId(node->GetText());\n\n            node = root->FirstChildElement(\"IsEnabled\");\n            if (node && node->GetText()) inventoryConfiguration_.setIsEnabled((std::strncmp(node->GetText(), \"true\", 4) ? false : true));\n\n            node = root->FirstChildElement(\"Filter\");\n            if (node) {\n                InventoryFilter filter;\n                XMLElement* prefix_node = node->FirstChildElement(\"Prefix\");\n                if (prefix_node && prefix_node->GetText()) filter.setPrefix(prefix_node->GetText());\n                inventoryConfiguration_.setFilter(filter);\n            }\n            node = root->FirstChildElement(\"Destination\");\n            if (node) {\n                XMLElement* next_node;\n                next_node = node->FirstChildElement(\"OSSBucketDestination\");\n                if (next_node) {\n                    XMLElement* sub_node;\n                    InventoryOSSBucketDestination dest;\n                    sub_node = next_node->FirstChildElement(\"Format\");\n                    if (sub_node && sub_node->GetText()) dest.setFormat(ToInventoryFormatType(sub_node->GetText()));\n                    sub_node = next_node->FirstChildElement(\"AccountId\");\n                    if (sub_node && sub_node->GetText()) dest.setAccountId(sub_node->GetText());\n                    sub_node = next_node->FirstChildElement(\"RoleArn\");\n                    if (sub_node && sub_node->GetText()) dest.setRoleArn(sub_node->GetText());\n                    sub_node = next_node->FirstChildElement(\"Bucket\");\n                    if (sub_node && sub_node->GetText()) dest.setBucket(ToInventoryBucketShortName(sub_node->GetText()));\n                    sub_node = next_node->FirstChildElement(\"Prefix\");\n                    if (sub_node && sub_node->GetText()) dest.setPrefix(sub_node->GetText());\n                    sub_node = next_node->FirstChildElement(\"Encryption\");\n                    if (sub_node) {\n                        InventoryEncryption encryption;\n                        XMLElement* sse_node;\n                        sse_node = sub_node->FirstChildElement(\"SSE-KMS\");\n                        if (sse_node) {\n                            InventorySSEKMS ssekms;\n                            XMLElement* key_node;\n                            key_node = sse_node->FirstChildElement(\"KeyId\");\n                            if (key_node && key_node->GetText()) ssekms.setKeyId(key_node->GetText());\n                            encryption.setSSEKMS(ssekms);\n                        }\n\n                        sse_node = sub_node->FirstChildElement(\"SSE-OSS\");\n                        if (sse_node) {\n                            encryption.setSSEOSS(InventorySSEOSS());\n                        }\n                        dest.setEncryption(encryption);\n                    }\n                    inventoryConfiguration_.setDestination(InventoryDestination(dest));\n                }\n            }\n\n            node = root->FirstChildElement(\"Schedule\");\n            if (node) {\n                XMLElement* freq_node = node->FirstChildElement(\"Frequency\");\n                if (freq_node && freq_node->GetText()) inventoryConfiguration_.setSchedule(ToInventoryFrequencyType(freq_node->GetText()));\n            }\n\n            node = root->FirstChildElement(\"IncludedObjectVersions\");\n            if (node && node->GetText()) inventoryConfiguration_.setIncludedObjectVersions(ToInventoryIncludedObjectVersionsType(node->GetText()));\n\n            node = root->FirstChildElement(\"OptionalFields\");\n            if (node) {\n                InventoryOptionalFields field;\n                XMLElement* field_node = node->FirstChildElement(\"Field\");\n                for (; field_node; field_node = field_node->NextSiblingElement()) {\n                    if (field_node->GetText())\n                        field.push_back(ToInventoryOptionalFieldType(field_node->GetText()));\n                }\n                inventoryConfiguration_.setOptionalFields(field);\n            }\n            parseDone_ = true;\n        }\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetBucketLifecycleRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketLifecycleRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketLifecycleRequest::GetBucketLifecycleRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketLifecycleRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"lifecycle\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketLifecycleResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/GetBucketLifecycleResult.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\n\r\nGetBucketLifecycleResult::GetBucketLifecycleResult() :\r\n    OssResult()\r\n{\r\n}\r\n\r\nGetBucketLifecycleResult::GetBucketLifecycleResult(const std::string& result):\r\n    GetBucketLifecycleResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nGetBucketLifecycleResult::GetBucketLifecycleResult(const std::shared_ptr<std::iostream>& result):\r\n    GetBucketLifecycleResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nGetBucketLifecycleResult& GetBucketLifecycleResult::operator =(const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"LifecycleConfiguration\", root->Name(), 22)) {\r\n            XMLElement *rule_node = root->FirstChildElement(\"Rule\");\r\n            for (; rule_node; rule_node = rule_node->NextSiblingElement(\"Rule\")) {\r\n                LifecycleRule rule;\r\n                XMLElement *node;\r\n                node = rule_node->FirstChildElement(\"ID\");\r\n                if (node && node->GetText()) rule.setID(node->GetText());\r\n\r\n                node = rule_node->FirstChildElement(\"Prefix\");\r\n                if (node && node->GetText()) rule.setPrefix(node->GetText());\r\n\r\n                node = rule_node->FirstChildElement(\"Status\");\r\n                if (node && node->GetText()) rule.setStatus(ToRuleStatusType(node->GetText()));\r\n\r\n                node = rule_node->FirstChildElement(\"Expiration\");\r\n                if (node) {\r\n                    XMLElement *subNode;\r\n                    //Days\r\n                    subNode = node->FirstChildElement(\"Days\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        rule.Expiration().setDays(std::stoi(subNode->GetText(), nullptr, 10));\r\n                    }\r\n                    //CreatedBeforeDate\r\n                    subNode = node->FirstChildElement(\"CreatedBeforeDate\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        rule.Expiration().setCreatedBeforeDate(subNode->GetText());\r\n                    }\r\n                    //ExpiredObjectDeleteMarker\r\n                    subNode = node->FirstChildElement(\"ExpiredObjectDeleteMarker\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        rule.setExpiredObjectDeleteMarker(!std::strncmp(\"true\", subNode->GetText(), 4));\r\n                    }\r\n                }\r\n\r\n                node = rule_node->FirstChildElement(\"Transition\");\r\n                for (; node; node = node->NextSiblingElement(\"Transition\")) {\r\n                    LifeCycleTransition transiton;\r\n                    XMLElement *subNode;\r\n                    //Days\r\n                    subNode = node->FirstChildElement(\"Days\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        transiton.Expiration().setDays(std::stoi(subNode->GetText(), nullptr, 10));\r\n                    }\r\n                    //CreatedBeforeDate\r\n                    subNode = node->FirstChildElement(\"CreatedBeforeDate\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        transiton.Expiration().setCreatedBeforeDate(subNode->GetText());\r\n                    }\r\n                    //StorageClass\r\n                    subNode = node->FirstChildElement(\"StorageClass\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        transiton.setStorageClass(ToStorageClassType(subNode->GetText()));\r\n                    }\r\n                    rule.addTransition(transiton);\r\n                }\r\n\r\n                node = rule_node->FirstChildElement(\"AbortMultipartUpload\");\r\n                if (node) {\r\n                    XMLElement *subNode;\r\n                    //Days\r\n                    subNode = node->FirstChildElement(\"Days\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        rule.AbortMultipartUpload().setDays(std::stoi(subNode->GetText(), nullptr, 10));\r\n                    }\r\n                    //CreatedBeforeDate\r\n                    subNode = node->FirstChildElement(\"CreatedBeforeDate\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        rule.AbortMultipartUpload().setCreatedBeforeDate(subNode->GetText());\r\n                    }\r\n                }\r\n\r\n                node = rule_node->FirstChildElement(\"Tag\");\r\n                for (; node; node = node->NextSiblingElement(\"Tag\")) {\r\n                    Tag tag;\r\n                    XMLElement *subNode;\r\n                    //Key\r\n                    subNode = node->FirstChildElement(\"Key\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        tag.setKey(subNode->GetText());\r\n                    }\r\n                    //Value\r\n                    subNode = node->FirstChildElement(\"Value\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        tag.setValue(subNode->GetText());\r\n                    }\r\n                    rule.addTag(tag);\r\n                }\r\n\r\n                node = rule_node->FirstChildElement(\"NoncurrentVersionExpiration\");\r\n                if (node) {\r\n                    XMLElement *subNode;\r\n                    //Days\r\n                    subNode = node->FirstChildElement(\"NoncurrentDays\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        rule.NoncurrentVersionExpiration().setDays(std::stoi(subNode->GetText(), nullptr, 10));\r\n                    }\r\n                }\r\n\r\n                node = rule_node->FirstChildElement(\"NoncurrentVersionTransition\");\r\n                for (; node; node = node->NextSiblingElement(\"NoncurrentVersionTransition\")) {\r\n                    LifeCycleTransition transiton;\r\n                    XMLElement *subNode;\r\n                    //Days\r\n                    subNode = node->FirstChildElement(\"NoncurrentDays\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        transiton.Expiration().setDays(std::stoi(subNode->GetText(), nullptr, 10));\r\n                    }\r\n                    //StorageClass\r\n                    subNode = node->FirstChildElement(\"StorageClass\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        transiton.setStorageClass(ToStorageClassType(subNode->GetText()));\r\n                    }\r\n                    rule.addNoncurrentVersionTransition(transiton);\r\n                }\r\n\r\n                lifecycleRuleList_.emplace_back(std::move(rule));\r\n            }\r\n\t\t    parseDone_ = true;\r\n\t\t}\r\n    }\r\n    return *this;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/GetBucketLocationRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketLocationRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketLocationRequest::GetBucketLocationRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketLocationRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"location\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketLocationResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketLocationResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\n\nGetBucketLocationResult::GetBucketLocationResult() :\n    OssResult()\n{\n}\n\nGetBucketLocationResult::GetBucketLocationResult(const std::string& result):\n    GetBucketLocationResult()\n{\n    *this = result;\n}\n\nGetBucketLocationResult::GetBucketLocationResult(const std::shared_ptr<std::iostream>& result):\n    GetBucketLocationResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketLocationResult& GetBucketLocationResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root =doc.RootElement();\n        if (root && !std::strncmp(\"LocationConstraint\", root->Name(), 18)) {\n            if (root->GetText()) \n                location_ = root->GetText();\n\n\t\t    parseDone_ = true;\n\t\t}\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetBucketLoggingRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketLoggingRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketLoggingRequest::GetBucketLoggingRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketLoggingRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"logging\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketLoggingResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketLoggingResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\n\nGetBucketLoggingResult::GetBucketLoggingResult() :\n    OssResult()\n{\n}\n\nGetBucketLoggingResult::GetBucketLoggingResult(const std::string& result):\n    GetBucketLoggingResult()\n{\n    *this = result;\n}\n\nGetBucketLoggingResult::GetBucketLoggingResult(const std::shared_ptr<std::iostream>& result):\n    GetBucketLoggingResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketLoggingResult& GetBucketLoggingResult::operator=(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root =doc.RootElement();\n        if (root && !std::strncmp(\"BucketLoggingStatus\", root->Name(), 19)) {\n            XMLElement *log_node;\n            log_node = root->FirstChildElement(\"LoggingEnabled\");\n            if (log_node) {\n                XMLElement *node;\n                node = log_node->FirstChildElement(\"TargetBucket\");\n                if (node && node->GetText()) targetBucket_ = node->GetText();\n\n                node = log_node->FirstChildElement(\"TargetPrefix\");\n                if (node && node->GetText()) targetPrefix_ = node->GetText();\n            }\n            parseDone_ = true;\n\t\t}\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetBucketPaymentRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketPaymentRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketRequestPaymentRequest::GetBucketRequestPaymentRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketRequestPaymentRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"requestPayment\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketPaymentResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketPaymentResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nGetBucketPaymentResult::GetBucketPaymentResult() :\n    OssResult()\n{\n}\n\nGetBucketPaymentResult::GetBucketPaymentResult(const std::string& result) :\n    GetBucketPaymentResult()\n{\n    *this = result;\n}\n\nGetBucketPaymentResult::GetBucketPaymentResult(const std::shared_ptr<std::iostream>& result) :\n    GetBucketPaymentResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketPaymentResult& GetBucketPaymentResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root = doc.RootElement();\n        if (root && !std::strncmp(\"RequestPaymentConfiguration\", root->Name(), 27)) {\n            XMLElement* node;\n            node = root->FirstChildElement(\"Payer\");\n            if (node && node->GetText()) payer_ = ToRequestPayer(node->GetText());\n            parseDone_ = true;\n        }\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetBucketPolicyRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketPolicyRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketPolicyRequest::GetBucketPolicyRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketPolicyRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"policy\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketPolicyResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketPolicyResult.h>\nusing namespace AlibabaCloud::OSS;\n\nGetBucketPolicyResult::GetBucketPolicyResult() :\n    OssResult()\n{\n}\n\nGetBucketPolicyResult::GetBucketPolicyResult(const std::string& result):\n    GetBucketPolicyResult()\n{\n    *this = result;\n}\n\nGetBucketPolicyResult::GetBucketPolicyResult(const std::shared_ptr<std::iostream>& result):\n    GetBucketPolicyResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketPolicyResult& GetBucketPolicyResult::operator =(const std::string& result)\n{\n    policy_ = result;\n    parseDone_ = true;\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetBucketQosInfoRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketQosInfoRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketQosInfoRequest::GetBucketQosInfoRequest(const std::string& bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketQosInfoRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"qosInfo\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketQosInfoResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketQosInfoResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nGetBucketQosInfoResult::GetBucketQosInfoResult() :\n    OssResult()\n{\n}\n\nGetBucketQosInfoResult::GetBucketQosInfoResult(const std::string& result) :\n    GetBucketQosInfoResult()\n{\n    *this = result;\n}\n\nGetBucketQosInfoResult::GetBucketQosInfoResult(const std::shared_ptr<std::iostream>& result) :\n    GetBucketQosInfoResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketQosInfoResult& GetBucketQosInfoResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root = doc.RootElement();\n        if (root && !std::strncmp(\"QoSConfiguration\", root->Name(), 16)) {\n            XMLElement* node;\n            node = root->FirstChildElement(\"TotalUploadBandwidth\");\n            if (node && node->GetText()) {\n                qosInfo_.setTotalUploadBandwidth(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"IntranetUploadBandwidth\");\n            if (node && node->GetText()) {\n                qosInfo_.setIntranetUploadBandwidth(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"ExtranetUploadBandwidth\");\n            if (node && node->GetText()) {\n                qosInfo_.setExtranetUploadBandwidth(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"TotalDownloadBandwidth\");\n            if (node && node->GetText()) {\n                qosInfo_.setTotalDownloadBandwidth(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"IntranetDownloadBandwidth\");\n            if (node && node->GetText()) {\n                qosInfo_.setIntranetDownloadBandwidth(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"ExtranetDownloadBandwidth\");\n            if (node && node->GetText()) {\n                qosInfo_.setExtranetDownloadBandwidth(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"TotalQps\");\n            if (node && node->GetText()) {\n                qosInfo_.setTotalQps(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"IntranetQps\");\n            if (node && node->GetText()) {\n                qosInfo_.setIntranetQps(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"ExtranetQps\");\n            if (node && node->GetText()) {\n                qosInfo_.setExtranetQps(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            parseDone_ = true;\n        }\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetBucketRefererRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketRefererRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketRefererRequest::GetBucketRefererRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketRefererRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"referer\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketRefererResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketRefererResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\n\nGetBucketRefererResult::GetBucketRefererResult() :\n    OssResult()\n{\n}\n\nGetBucketRefererResult::GetBucketRefererResult(const std::string& result):\n    GetBucketRefererResult()\n{\n    *this = result;\n}\n\nGetBucketRefererResult::GetBucketRefererResult(const std::shared_ptr<std::iostream>& result):\n    GetBucketRefererResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketRefererResult& GetBucketRefererResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root =doc.RootElement();\n        if (root && !std::strncmp(\"RefererConfiguration\", root->Name(), 20)) {\n            XMLElement *node;\n            node = root->FirstChildElement(\"AllowEmptyReferer\");\n            if (node && node->GetText()) allowEmptyReferer_ = (std::strncmp(node->GetText(), \"true\", 4)? false:true);\n\n            node = root->FirstChildElement(\"RefererList\");\n            if (node) {\n                XMLElement *referer_node = node->FirstChildElement(\"Referer\");\n                for (; referer_node; referer_node = referer_node->NextSiblingElement()) {\n                    if (referer_node->GetText())\n                        refererList_.push_back(referer_node->GetText());\n                }\n            }\n\t\t    parseDone_ = true;\n\t\t}\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetBucketStatRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketStatRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketStatRequest::GetBucketStatRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketStatRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"stat\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketStatResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketStatResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\n\nGetBucketStatResult::GetBucketStatResult() :\n    OssResult(),\n    storage_(0),\n    objectCount_(0),\n    multipartUploadCount_(0),\n    liveChannelCount_(0),\n    lastModifiedTime_(0),\n    standardStorage_(0),\n    standardObjectCount_(0),\n    infrequentAccessStorage_(0),\n    infrequentAccessObjectCount_(0),\n    archiveStorage_(0),\n    archiveObjectCount_(0),\n    coldArchiveStorage_(0),\n    coldArchiveObjectCount_(0)\n{\n}\n\nGetBucketStatResult::GetBucketStatResult(const std::string& result):\n    GetBucketStatResult()\n{\n    *this = result;\n}\n\nGetBucketStatResult::GetBucketStatResult(const std::shared_ptr<std::iostream>& result):\n    GetBucketStatResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketStatResult& GetBucketStatResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root =doc.RootElement();\n        if (root && !std::strncmp(\"BucketStat\", root->Name(), 10)) {\n            XMLElement *node;\n            node = root->FirstChildElement(\"Storage\");\n            if (node && node->GetText()) storage_ = atoll(node->GetText());\n\n            node = root->FirstChildElement(\"ObjectCount\");\n            if (node && node->GetText()) objectCount_ = atoll(node->GetText());\n\n            node = root->FirstChildElement(\"MultipartUploadCount\");\n            if (node && node->GetText()) multipartUploadCount_ = atoll(node->GetText());\n\n            node = root->FirstChildElement(\"LiveChannelCount\");\n            if (node && node->GetText()) liveChannelCount_ = atoll(node->GetText());\n\n            node = root->FirstChildElement(\"LastModifiedTime\");\n            if (node && node->GetText()) lastModifiedTime_ = atoll(node->GetText());\n\n            node = root->FirstChildElement(\"StandardStorage\");\n            if (node && node->GetText()) standardStorage_ = atoll(node->GetText());\n\n            node = root->FirstChildElement(\"StandardObjectCount\");\n            if (node && node->GetText()) standardObjectCount_ = atoll(node->GetText());\n\n            node = root->FirstChildElement(\"InfrequentAccessStorage\");\n            if (node && node->GetText()) infrequentAccessStorage_ = atoll(node->GetText());\n\n            node = root->FirstChildElement(\"InfrequentAccessObjectCount\");\n            if (node && node->GetText()) infrequentAccessObjectCount_ = atoll(node->GetText());\n\n            node = root->FirstChildElement(\"ArchiveStorage\");\n            if (node && node->GetText()) archiveStorage_ = atoll(node->GetText());\n\n            node = root->FirstChildElement(\"ArchiveObjectCount\");\n            if (node && node->GetText()) archiveObjectCount_ = atoll(node->GetText());\n\n            node = root->FirstChildElement(\"ColdArchiveStorage\");\n            if (node && node->GetText()) coldArchiveStorage_ = atoll(node->GetText());\n\n            node = root->FirstChildElement(\"ColdArchiveObjectCount\");\n            if (node && node->GetText()) coldArchiveObjectCount_ = atoll(node->GetText());\n\n            parseDone_ = true;\n\n\t\t}\n    }\n    return *this;\n}\n\n"
  },
  {
    "path": "sdk/src/model/GetBucketStorageCapacityRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketStorageCapacityRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketStorageCapacityRequest::GetBucketStorageCapacityRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketStorageCapacityRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"qos\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketStorageCapacityResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketStorageCapacityResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nGetBucketStorageCapacityResult::GetBucketStorageCapacityResult() :\n    OssResult(),\n    storageCapacity_(-1)\n{\n}\n\nGetBucketStorageCapacityResult::GetBucketStorageCapacityResult(const std::string& result):\n    GetBucketStorageCapacityResult()\n{\n    *this = result;\n}\n\nGetBucketStorageCapacityResult::GetBucketStorageCapacityResult(const std::shared_ptr<std::iostream>& result):\n    GetBucketStorageCapacityResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketStorageCapacityResult& GetBucketStorageCapacityResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root =doc.RootElement();\n        if (root && !std::strncmp(\"BucketUserQos\", root->Name(), 13)) {\n            XMLElement *node = root->FirstChildElement(\"StorageCapacity\");\n            if (node && node->GetText()) storageCapacity_ = std::atoll(node->GetText());\n\n            parseDone_ = true;\n        }\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetBucketTaggingRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketTaggingRequest.h>\nusing namespace AlibabaCloud::OSS;\n\nGetBucketTaggingRequest::GetBucketTaggingRequest(const std::string& bucket)\n    :OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketTaggingRequest::specialParameters() const\n{\n    ParameterCollection paramters;\n    paramters[\"tagging\"] = \"\";\n    return paramters;\n}\n\n"
  },
  {
    "path": "sdk/src/model/GetBucketTaggingResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketTaggingResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nGetBucketTaggingResult::GetBucketTaggingResult() :\n    OssResult()\n{\n}\n\nGetBucketTaggingResult::GetBucketTaggingResult(const std::string& result) :\n    GetBucketTaggingResult()\n{\n    *this = result;\n}\n\nGetBucketTaggingResult::GetBucketTaggingResult(const std::shared_ptr<std::iostream>& result) :\n    GetBucketTaggingResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketTaggingResult& GetBucketTaggingResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root = doc.RootElement();\n        if (root && !std::strncmp(\"Tagging\", root->Name(), 7)) {\n            XMLElement* tagSet_node = root->FirstChildElement(\"TagSet\");\n            if (tagSet_node) {\n                XMLElement* tag_node = tagSet_node->FirstChildElement(\"Tag\");\n                for (; tag_node; tag_node = tag_node->NextSiblingElement(\"Tag\")) {\n                    XMLElement* subNode;\n                    Tag tag;\n                    //Key\n                    subNode = tag_node->FirstChildElement(\"Key\");\n                    if (subNode && subNode->GetText()) {\n                        tag.setKey(subNode->GetText());\n                    }\n                    //Value\n                    subNode = tag_node->FirstChildElement(\"Value\");\n                    if (subNode && subNode->GetText()) {\n                        tag.setValue(subNode->GetText());\n                    }\n                    tagging_.addTag(tag);\n                }\n            }\n            //TODO check the result and the parse flag;\n            parseDone_ = true;\n        }\n    }\n    return *this;\n}\n\n"
  },
  {
    "path": "sdk/src/model/GetBucketVersioningRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/GetBucketVersioningRequest.h>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nGetBucketVersioningRequest::GetBucketVersioningRequest(const std::string &bucket) :\r\n    OssBucketRequest(bucket)\r\n{\r\n}\r\n\r\nParameterCollection GetBucketVersioningRequest::specialParameters() const\r\n{\r\n    ParameterCollection parameters;\r\n    parameters[\"versioning\"] = \"\";\r\n    return parameters;\r\n}"
  },
  {
    "path": "sdk/src/model/GetBucketVersioningResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/GetBucketVersioningResult.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\n\r\nGetBucketVersioningResult::GetBucketVersioningResult() :\r\n    OssResult(),\r\n    status_(VersioningStatus::NotSet)\r\n{\r\n}\r\n\r\nGetBucketVersioningResult::GetBucketVersioningResult(const std::string& result):\r\n    GetBucketVersioningResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nGetBucketVersioningResult::GetBucketVersioningResult(const std::shared_ptr<std::iostream>& result):\r\n    GetBucketVersioningResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nGetBucketVersioningResult& GetBucketVersioningResult::operator =(const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"VersioningConfiguration\", root->Name(), 23)) {\r\n            XMLElement *node;\r\n            node = root->FirstChildElement(\"Status\");\r\n            if (node && node->GetText()) {\r\n                status_ = ToVersioningStatusType(node->GetText());\r\n            }\r\n            parseDone_ = true;\r\n\t\t}\r\n    }\r\n    return *this;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/GetBucketWebsiteRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketWebsiteRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketWebsiteRequest::GetBucketWebsiteRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketWebsiteRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"website\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketWebsiteResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketWebsiteResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\n\nGetBucketWebsiteResult::GetBucketWebsiteResult() :\n    OssResult()\n{\n}\n\nGetBucketWebsiteResult::GetBucketWebsiteResult(const std::string& result):\n    GetBucketWebsiteResult()\n{\n    *this = result;\n}\n\nGetBucketWebsiteResult::GetBucketWebsiteResult(const std::shared_ptr<std::iostream>& result):\n    GetBucketWebsiteResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketWebsiteResult& GetBucketWebsiteResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root =doc.RootElement();\n        if (root && !std::strncmp(\"WebsiteConfiguration\", root->Name(), 20)) {\n            XMLElement *node;\n            node = root->FirstChildElement(\"IndexDocument\");\n            if (node) node = node->FirstChildElement(\"Suffix\");\n            if (node && node->GetText()) indexDocument_ = node->GetText();\n\n            node = root->FirstChildElement(\"ErrorDocument\");\n            if (node) node = node->FirstChildElement(\"Key\");\n            if (node && node->GetText()) errorDocument_ = node->GetText();\n\t\t    parseDone_ = true;\n\t\t}\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetBucketWormRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetBucketWormRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetBucketWormRequest::GetBucketWormRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection GetBucketWormRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"worm\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetBucketWormResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetBucketWormResult.h>\n#include <tinyxml2/tinyxml2.h>\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nGetBucketWormResult::GetBucketWormResult() :\n    OssResult(),\n    day_(0)\n{\n}\n\nGetBucketWormResult::GetBucketWormResult(const std::string& result):\n    GetBucketWormResult()\n{\n    *this = result;\n}\n\nGetBucketWormResult::GetBucketWormResult(const std::shared_ptr<std::iostream>& result):\n    GetBucketWormResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetBucketWormResult& GetBucketWormResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root =doc.RootElement();\n        if (root && !std::strncmp(\"WormConfiguration\", root->Name(), 17)) {\n            XMLElement *node;\n            node = root->FirstChildElement(\"WormId\");\n            if (node && node->GetText()) wormId_ = node->GetText();\n\n            node = root->FirstChildElement(\"CreationDate\");\n            if (node && node->GetText()) creationDate_ = node->GetText();\n\n            node = root->FirstChildElement(\"State\");\n            if (node && node->GetText()) state_ = node->GetText();\n\n            node = root->FirstChildElement(\"RetentionPeriodInDays\");\n            if (node && node->GetText()) day_ = (uint32_t)std::strtoul(node->GetText(), nullptr, 10);\n\n            parseDone_ = true;\n        }\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetLiveChannelHistoryRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetLiveChannelHistoryRequest.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n#include \"Const.h\"\n\n\nusing namespace AlibabaCloud::OSS;\n\nGetLiveChannelHistoryRequest::GetLiveChannelHistoryRequest(const std::string& bucket, \n    const std::string& channelName):\n    LiveChannelRequest(bucket, channelName)\n{\n\n}\n\nParameterCollection GetLiveChannelHistoryRequest::specialParameters() const\n{\n    ParameterCollection collection;\n    collection[\"live\"] = \"\";\n    collection[\"comp\"] = \"history\";\n    return collection;\n}\n\nint GetLiveChannelHistoryRequest::validate() const\n{\n    return LiveChannelRequest::validate();\n}\n\n"
  },
  {
    "path": "sdk/src/model/GetLiveChannelHistoryResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetLiveChannelHistoryResult.h>\n#include <alibabacloud/oss/model/Owner.h>\n#include <tinyxml2/tinyxml2.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nGetLiveChannelHistoryResult::GetLiveChannelHistoryResult() :\n    OssResult()\n{\n    \n}\n\nGetLiveChannelHistoryResult::GetLiveChannelHistoryResult(const std::string& result):\n    GetLiveChannelHistoryResult()\n{\n    *this = result;\n}\n\nGetLiveChannelHistoryResult::GetLiveChannelHistoryResult(const std::shared_ptr<std::iostream>& result):\n    GetLiveChannelHistoryResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetLiveChannelHistoryResult& GetLiveChannelHistoryResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root =doc.RootElement();\n        if (root && !std::strncmp(\"LiveChannelHistory\", root->Name(), 18)) {\n            XMLElement *node;\n            XMLElement *recordNode = root->FirstChildElement(\"LiveRecord\");\n            for(; recordNode; recordNode = recordNode->NextSiblingElement(\"LiveRecord\"))\n            {\n                LiveRecord rec;\n                node = recordNode->FirstChildElement(\"StartTime\");\n                if(node && node->GetText())\n                {\n                    rec.startTime = node->GetText();\n                }\n                node = recordNode->FirstChildElement(\"EndTime\");\n                if(node && node->GetText())\n                {\n                    rec.endTime = node->GetText();\n                }\n                node = recordNode->FirstChildElement(\"RemoteAddr\");\n                if(node && node->GetText())\n                {\n                    rec.remoteAddr = node->GetText();\n                }\n                recordList_.push_back(rec);\n            }\n            parseDone_ = true;\n        }\n    }\n    return *this;\n}\n\nconst LiveRecordVec& GetLiveChannelHistoryResult::LiveRecordList() const\n{\n    return recordList_;\n}\n"
  },
  {
    "path": "sdk/src/model/GetLiveChannelInfoRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetLiveChannelInfoRequest.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n#include \"Const.h\"\n\n\nusing namespace AlibabaCloud::OSS;\n\nGetLiveChannelInfoRequest::GetLiveChannelInfoRequest(const std::string& bucket, \n    const std::string& channelName):\n    LiveChannelRequest(bucket, channelName)\n{\n\n}\n\nParameterCollection GetLiveChannelInfoRequest::specialParameters() const\n{\n    ParameterCollection collection;\n    collection[\"live\"] = \"\";\n    return collection;\n}\n\nint GetLiveChannelInfoRequest::validate() const\n{\n    return LiveChannelRequest::validate();\n}\n\n"
  },
  {
    "path": "sdk/src/model/GetLiveChannelInfoResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/GetLiveChannelInfoResult.h>\r\n#include <alibabacloud/oss/model/Owner.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include <sstream>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\nGetLiveChannelInfoResult::GetLiveChannelInfoResult() :\r\n    OssResult(), \r\n    fragDuration_(0), \r\n    fragCount_(0)\r\n{\r\n    \r\n}\r\n\r\nGetLiveChannelInfoResult::GetLiveChannelInfoResult(const std::string& result):\r\n    GetLiveChannelInfoResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nGetLiveChannelInfoResult::GetLiveChannelInfoResult(const std::shared_ptr<std::iostream>& result):\r\n    GetLiveChannelInfoResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nGetLiveChannelInfoResult& GetLiveChannelInfoResult::operator =(const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"LiveChannelConfiguration\", root->Name(), 24)) {\r\n            XMLElement *node;\r\n\r\n            node  = root->FirstChildElement(\"Description\");\r\n            if(node && node->GetText())\r\n            {\r\n                description_ = node->GetText();\r\n            }\r\n\r\n            node  = root->FirstChildElement(\"Status\");\r\n            if(node && node->GetText())\r\n            {\r\n                status_ = ToLiveChannelStatusType(node->GetText());\r\n            }\r\n            \r\n            XMLElement *targetNode = root->FirstChildElement(\"Target\");\r\n            if(targetNode)\r\n            {\r\n                node  = targetNode->FirstChildElement(\"Type\");\r\n                if(node && node->GetText())\r\n                {\r\n                    channelType_ = node->GetText();\r\n                }\r\n\r\n                node  = targetNode->FirstChildElement(\"FragDuration\");\r\n                if(node && node->GetText())\r\n                {\r\n                    fragDuration_ = std::strtoull(node->GetText(), nullptr, 10);\r\n                }\r\n\r\n                node  = targetNode->FirstChildElement(\"FragCount\");\r\n                if(node && node->GetText())\r\n                {\r\n                    fragCount_ = std::strtoull(node->GetText(), nullptr, 10);\r\n                }\r\n\r\n                node  = targetNode->FirstChildElement(\"PlaylistName\");\r\n                if(node && node->GetText())\r\n                {\r\n                    playListName_ = node->GetText();\r\n                }\r\n            }\r\n            parseDone_ = true;\r\n        }\r\n    }\r\n    return *this;\r\n}\r\n\r\nconst std::string& GetLiveChannelInfoResult::Description() const\r\n{\r\n    return description_;\r\n}\r\n\r\nLiveChannelStatus GetLiveChannelInfoResult::Status() const\r\n{\r\n    return status_;\r\n}\r\n\r\nconst std::string& GetLiveChannelInfoResult::Type() const\r\n{\r\n    return channelType_;\r\n}\r\nuint64_t GetLiveChannelInfoResult::FragDuration() const\r\n{\r\n    return fragDuration_;\r\n}\r\n\r\nuint64_t GetLiveChannelInfoResult::FragCount() const\r\n{\r\n    return fragCount_;\r\n}\r\n\r\nconst std::string& GetLiveChannelInfoResult::PlaylistName() const\r\n{\r\n    return playListName_;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/GetLiveChannelStatRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetLiveChannelStatRequest.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n#include \"Const.h\"\n\n\nusing namespace AlibabaCloud::OSS;\n\nGetLiveChannelStatRequest::GetLiveChannelStatRequest(const std::string& bucket, \n    const std::string& channelName):\n    LiveChannelRequest(bucket, channelName)\n{\n\n}\n\nParameterCollection GetLiveChannelStatRequest::specialParameters() const\n{\n    ParameterCollection collection;\n    collection[\"live\"] = \"\";\n    collection[\"comp\"] = \"stat\";\n    return collection;\n}\n\nint GetLiveChannelStatRequest::validate() const\n{\n    return LiveChannelRequest::validate();\n}\n"
  },
  {
    "path": "sdk/src/model/GetLiveChannelStatResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/GetLiveChannelStatResult.h>\r\n#include <alibabacloud/oss/model/Owner.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include <sstream>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\nGetLiveChannelStatResult::GetLiveChannelStatResult() :\r\n    OssResult(), \r\n    width_(0), \r\n    height_(0), \r\n    frameRate_(0),\r\n    videoBandWidth_(0), \r\n    sampleRate_(0), \r\n    audioBandWidth_(0)\r\n{\r\n    \r\n}\r\n\r\nGetLiveChannelStatResult::GetLiveChannelStatResult(const std::string& result):\r\n    GetLiveChannelStatResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nGetLiveChannelStatResult::GetLiveChannelStatResult(const std::shared_ptr<std::iostream>& result):\r\n    GetLiveChannelStatResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nGetLiveChannelStatResult& GetLiveChannelStatResult::operator =(const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"LiveChannelStat\", root->Name(), 15)) {\r\n            XMLElement *node;\r\n\r\n            node  = root->FirstChildElement(\"Status\");\r\n            if(node && node->GetText())\r\n            {\r\n                status_ = ToLiveChannelStatusType(node->GetText());\r\n            }\r\n            \r\n            node = root->FirstChildElement(\"ConnectedTime\");\r\n            if(node && node->GetText())\r\n            {\r\n                connectedTime_ = node->GetText();\r\n            }\r\n\r\n            node = root->FirstChildElement(\"RemoteAddr\");\r\n            if(node && node->GetText())\r\n            {\r\n                remoteAddr_ = node->GetText();\r\n            }\r\n            XMLElement *videoRoot = root->FirstChildElement(\"Video\");\r\n            if(videoRoot)\r\n            {\r\n                node = videoRoot->FirstChildElement(\"Width\");\r\n                if(node && node->GetText())\r\n                {\r\n                    width_ = std::strtoul(node->GetText(), nullptr, 10);\r\n                }\r\n                node = videoRoot->FirstChildElement(\"Height\");\r\n                if(node && node->GetText())\r\n                {\r\n                    height_ = std::strtoul(node->GetText(), nullptr, 10);\r\n                }\r\n                node = videoRoot->FirstChildElement(\"FrameRate\");\r\n                if(node && node->GetText())\r\n                {\r\n                    frameRate_ = std::strtoull(node->GetText(), nullptr, 10);\r\n                }\r\n                node = videoRoot->FirstChildElement(\"Bandwidth\");\r\n                if(node && node->GetText())\r\n                {\r\n                    videoBandWidth_ = std::strtoull(node->GetText(), nullptr, 10);\r\n                }\r\n                node = videoRoot->FirstChildElement(\"Codec\");\r\n                if(node && node->GetText())\r\n                {\r\n                    videoCodec_ = node->GetText();\r\n                }\r\n            }\r\n            XMLElement *audioRoot = root->FirstChildElement(\"Audio\");\r\n            if(audioRoot)\r\n            {\r\n                node = audioRoot->FirstChildElement(\"Bandwidth\");\r\n                if(node && node->GetText())\r\n                {\r\n                    audioBandWidth_ = std::strtoull(node->GetText(), nullptr, 10);\r\n                }\r\n                node = audioRoot->FirstChildElement(\"SampleRate\");\r\n                if(node && node->GetText())\r\n                {\r\n                    sampleRate_ = std::strtoull(node->GetText(), nullptr, 10);\r\n                }\r\n                node = audioRoot->FirstChildElement(\"Codec\");\r\n                if(node && node->GetText())\r\n                {\r\n                    audioCodec_ = node->GetText();\r\n                }\r\n            }\r\n            parseDone_ = true;\r\n        }\r\n    }\r\n    return *this;\r\n}\r\n\r\nLiveChannelStatus GetLiveChannelStatResult::Status() const\r\n{\r\n    return status_;\r\n}\r\n\r\nconst std::string& GetLiveChannelStatResult::ConnectedTime() const\r\n{\r\n    return connectedTime_;\r\n}\r\n\r\nconst std::string& GetLiveChannelStatResult::RemoteAddr() const\r\n{\r\n    return remoteAddr_;\r\n}\r\n\r\nuint32_t GetLiveChannelStatResult::Width() const\r\n{\r\n    return width_;\r\n}\r\n\r\nuint32_t GetLiveChannelStatResult::Height() const\r\n{\r\n    return height_;\r\n}\r\n\r\nuint64_t GetLiveChannelStatResult::FrameRate() const\r\n{\r\n    return frameRate_;\r\n}\r\n\r\nuint64_t GetLiveChannelStatResult::VideoBandWidth() const\r\n{\r\n    return videoBandWidth_;\r\n}\r\n\r\nconst std::string& GetLiveChannelStatResult::VideoCodec() const\r\n{\r\n    return videoCodec_;\r\n}\r\n\r\nuint64_t GetLiveChannelStatResult::SampleRate() const\r\n{\r\n    return sampleRate_;\r\n}\r\n\r\nuint64_t GetLiveChannelStatResult::AudioBandWidth() const\r\n{\r\n    return audioBandWidth_;\r\n}\r\n\r\nconst std::string& GetLiveChannelStatResult::AudioCodec() const\r\n{\r\n    return audioCodec_;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/GetObjectAclRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetObjectAclRequest.h>\n#include <alibabacloud/oss/http/HttpType.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\n\nGetObjectAclRequest::GetObjectAclRequest(const std::string &bucket, const std::string &key)\n    :OssObjectRequest(bucket,key)\n{\n}\n    \nParameterCollection GetObjectAclRequest::specialParameters() const\n{\n    auto parameters = OssObjectRequest::specialParameters();\n    parameters[\"acl\"]=\"\";\n    return parameters;\n}\n\n"
  },
  {
    "path": "sdk/src/model/GetObjectAclResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/GetObjectAclResult.h>\r\n#include <alibabacloud/oss/model/Owner.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\nGetObjectAclResult::GetObjectAclResult() :\r\n    OssObjectResult()\r\n{\r\n}\r\n\r\nGetObjectAclResult::GetObjectAclResult(const std::string& result):\r\n    GetObjectAclResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nGetObjectAclResult::GetObjectAclResult(const std::shared_ptr<std::iostream>& result):\r\n    GetObjectAclResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nGetObjectAclResult::GetObjectAclResult(const HeaderCollection& headers, const std::shared_ptr<std::iostream>& result) :\r\n    OssObjectResult(headers)\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nGetObjectAclResult& GetObjectAclResult::operator =(const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"AccessControlPolicy\", root->Name(), 19)) {\r\n            XMLElement *node;\r\n\r\n            node = root->FirstChildElement(\"Owner\");\r\n            std::string owner_ID, owner_DisplayName;\r\n            if (node) {\r\n                XMLElement *sub_node;\r\n                sub_node = node->FirstChildElement(\"ID\");\r\n                if (sub_node && sub_node->GetText()) owner_ID = sub_node->GetText();\r\n\r\n                sub_node = node->FirstChildElement(\"DisplayName\");\r\n                if (sub_node && sub_node->GetText()) owner_DisplayName = sub_node->GetText();\r\n            }\r\n\r\n            node = root->FirstChildElement(\"AccessControlList\");\r\n            if (node) {\r\n                XMLElement *sub_node;\r\n                sub_node = node->FirstChildElement(\"Grant\");\r\n                if (sub_node && sub_node->GetText()) acl_ = ToAclType(sub_node->GetText());\r\n            }\r\n\r\n            owner_ = AlibabaCloud::OSS::Owner(owner_ID, owner_DisplayName);\r\n\r\n            //TODO check the result and the parse flag;\r\n            parseDone_ = true;\r\n        }\r\n    }\r\n    return *this;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/GetObjectByUrlRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetObjectByUrlRequest.h>\n#include <alibabacloud/oss/http/HttpType.h>\n#include <sstream>\nusing namespace AlibabaCloud::OSS;\n\n\nGetObjectByUrlRequest::GetObjectByUrlRequest(const std::string &url):\n    GetObjectByUrlRequest(url, ObjectMetaData())\n{\n}\n\nGetObjectByUrlRequest::GetObjectByUrlRequest(const std::string &url, const ObjectMetaData &metaData) :\n    ServiceRequest(),\n    metaData_(metaData)\n{\n    setPath(url);\n    setFlags(Flags()|REQUEST_FLAG_PARAM_IN_PATH|REQUEST_FLAG_CHECK_CRC64);\n}\n\nHeaderCollection GetObjectByUrlRequest::Headers() const\n{\n    auto headers = metaData_.toHeaderCollection();\n    if (!metaData_.hasHeader(Http::DATE)) {\n        headers[Http::DATE] = \"\";\n    }\n    return headers;\n}\n\nParameterCollection GetObjectByUrlRequest::Parameters() const\n{\n    return ParameterCollection();\n}\n\nstd::shared_ptr<std::iostream> GetObjectByUrlRequest::Body() const\n{\n    return nullptr;\n}\n"
  },
  {
    "path": "sdk/src/model/GetObjectMetaRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetObjectMetaRequest.h>\nusing namespace AlibabaCloud::OSS;\n\nParameterCollection GetObjectMetaRequest::specialParameters() const\n{\n    auto parameters = OssObjectRequest::specialParameters();\n    parameters[\"objectMeta\"] = \"\";\n    return parameters;\n}\n"
  },
  {
    "path": "sdk/src/model/GetObjectRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/GetObjectRequest.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n#include \"../utils/Utils.h\"\r\n#include \"ModelError.h\"\r\n#include <set>\r\n#include <sstream>\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nGetObjectRequest::GetObjectRequest(const std::string &bucket, const std::string &key):\r\n    GetObjectRequest(bucket, key, \"\")\r\n{\r\n}\r\n\r\nGetObjectRequest::GetObjectRequest(const std::string &bucket, const std::string &key, const std::string &process) :\r\n    OssObjectRequest(bucket, key),\r\n    rangeIsSet_(false),\r\n    process_(process),\r\n    trafficLimit_(0),\r\n    rangeIsStandardMode_(false),\r\n    userAgent_()\r\n\r\n{\r\n    setFlags(Flags() | REQUEST_FLAG_CHECK_CRC64);\r\n}\r\n\r\nGetObjectRequest::GetObjectRequest(const std::string& bucket, const std::string& key,\r\n    const std::string &modifiedSince, const std::string &unmodifiedSince,\r\n    const std::vector<std::string> &matchingETags, const std::vector<std::string> &nonmatchingETags,\r\n    const std::map<std::string, std::string> &responseHeaderParameters) : \r\n    OssObjectRequest(bucket, key),\r\n    rangeIsSet_(false), \r\n    modifiedSince_(modifiedSince), \r\n    unmodifiedSince_(unmodifiedSince), \r\n    matchingETags_(matchingETags),\r\n    nonmatchingETags_(nonmatchingETags), \r\n    process_(\"\"),\r\n    responseHeaderParameters_(responseHeaderParameters),\r\n    trafficLimit_(0),\r\n    rangeIsStandardMode_(false),\r\n    userAgent_()\r\n\r\n{\r\n}\r\n\r\nvoid GetObjectRequest::setRange(int64_t start, int64_t end)\r\n{\r\n    range_[0] = start;\r\n    range_[1] = end;\r\n    rangeIsSet_ = true;\r\n    rangeIsStandardMode_ = false;\r\n}\r\n\r\nvoid GetObjectRequest::setRange(int64_t start, int64_t end, bool standard)\r\n{\r\n    range_[0] = start;\r\n    range_[1] = end;\r\n    rangeIsSet_ = true;\r\n    rangeIsStandardMode_ = standard;\r\n}\r\n\r\nvoid GetObjectRequest::setModifiedSinceConstraint(const std::string &gmt)\r\n{\r\n    modifiedSince_ = gmt;\r\n}\r\n\r\nvoid GetObjectRequest::setUnmodifiedSinceConstraint(const std::string &gmt)\r\n{\r\n    unmodifiedSince_ = gmt;\r\n}\r\n\r\nvoid GetObjectRequest::setMatchingETagConstraints(const std::vector<std::string> &match)\r\n{\r\n    matchingETags_ = match;\r\n}\r\n\r\nvoid GetObjectRequest::addMatchingETagConstraint(const std::string &match)\r\n{\r\n    matchingETags_.push_back(match);\r\n}\r\n\r\nvoid GetObjectRequest::setNonmatchingETagConstraints(const std::vector<std::string> &match)\r\n{\r\n    nonmatchingETags_ = match;\r\n}\r\n\r\nvoid GetObjectRequest::addNonmatchingETagConstraint(const std::string &match)\r\n{\r\n    nonmatchingETags_.push_back(match);\r\n}\r\n\r\nvoid GetObjectRequest::setProcess(const std::string &process)\r\n{\r\n    process_ = process;\r\n}\r\n\r\nvoid GetObjectRequest::addResponseHeaders(RequestResponseHeader header, const std::string &value)\r\n{\r\n    static const char *ResponseHeader[] = {\r\n        \"response-content-type\", \"response-content-language\", \r\n        \"response-expires\", \"response-cache-control\", \r\n        \"response-content-disposition\", \"response-content-encoding\"};\r\n    responseHeaderParameters_[ResponseHeader[header - RequestResponseHeader::ContentType]] = value;\r\n}\r\n\r\nvoid GetObjectRequest::setTrafficLimit(uint64_t value)\r\n{\r\n    trafficLimit_ = value;\r\n}\r\n\r\nvoid GetObjectRequest::setUserAgent(const std::string& ua)\r\n{\r\n    userAgent_ = ua;\r\n}\r\n\r\nstd::pair<int64_t, int64_t> GetObjectRequest::Range() const\r\n{\r\n    int64_t begin = -1;\r\n    int64_t end = -1;\r\n    if (rangeIsSet_) {\r\n        begin = range_[0];\r\n        end = range_[1];\r\n    }\r\n\r\n    return std::pair<int64_t, int64_t>(begin, end);\r\n}\r\n\r\nint GetObjectRequest::validate() const\r\n{\r\n    int ret = OssObjectRequest::validate();\r\n    if (ret != 0)\r\n        return ret;\r\n\r\n    if (rangeIsSet_ && (range_[0] < 0 || range_[1] < -1 || (range_[1] > -1 && range_[1] < range_[0]) ))\r\n        return ARG_ERROR_OBJECT_RANGE_INVALID;\r\n\r\n    return 0;\r\n}\r\n\r\nHeaderCollection GetObjectRequest::specialHeaders() const\r\n{\r\n    auto headers = OssObjectRequest::specialHeaders();\r\n    if (rangeIsSet_) {\r\n        std::stringstream ss;\r\n        ss << \"bytes=\" << std::to_string(range_[0]) << \"-\";\r\n        if (range_[1] != -1) ss << std::to_string(range_[1]);\r\n        headers[Http::RANGE] = ss.str();\r\n\r\n        if (rangeIsStandardMode_) {\r\n            headers[\"x-oss-range-behavior\"] = \"standard\";\r\n        }\r\n    }\r\n\r\n    if (!modifiedSince_.empty())\r\n    {\r\n        headers[\"If-Modified-Since\"] = modifiedSince_;\r\n    }\r\n\r\n    if (!unmodifiedSince_.empty())\r\n    {\r\n        headers[\"If-Unmodified-Since\"] = unmodifiedSince_;\r\n    }\r\n\r\n    if (matchingETags_.size() > 0) {\r\n        std::stringstream ss;\r\n        bool first = true;\r\n        for (auto const& str : matchingETags_) {\r\n            if (!first) {\r\n                ss << \",\";\r\n            }\r\n            ss << str;\r\n            first = false;\r\n        }\r\n        headers[\"If-Match\"] = ss.str();\r\n    }\r\n\r\n    if (nonmatchingETags_.size() > 0) {\r\n        std::stringstream ss;\r\n        bool first = true;\r\n        for (auto const& str : nonmatchingETags_) {\r\n            if (!first) {\r\n                ss << \",\";\r\n            }\r\n            ss << str;\r\n            first = false;\r\n        }\r\n        headers[\"If-None-Match\"] = ss.str();\r\n    }\r\n\r\n    if (trafficLimit_ != 0) {\r\n        headers[\"x-oss-traffic-limit\"] = std::to_string(trafficLimit_);\r\n    }\r\n\r\n    if (!userAgent_.empty()) {\r\n        headers[Http::USER_AGENT] = userAgent_;\r\n    }\r\n    return headers;\r\n}\r\n\r\nParameterCollection GetObjectRequest::specialParameters() const\r\n{\r\n    auto parameters = OssObjectRequest::specialParameters();\r\n    for (auto const& param : responseHeaderParameters_) {\r\n        parameters[param.first] = param.second;\r\n    }\r\n\r\n    if (!process_.empty()) {\r\n        parameters[\"x-oss-process\"] = process_;\r\n    }\r\n\r\n    return parameters;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/GetObjectResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/GetObjectResult.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n#include \"../utils/Utils.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nGetObjectResult::GetObjectResult() :\r\n    OssObjectResult()\r\n{\r\n}\r\n\r\nGetObjectResult::GetObjectResult(\r\n    const std::string &bucket,\r\n    const std::string &key,\r\n    const std::shared_ptr<std::iostream> &content,\r\n    const HeaderCollection &headers):\r\n    OssObjectResult(headers),\r\n    bucket_(bucket),\r\n    key_(key),\r\n    content_(content)\r\n{\r\n    metaData_  = headers;\r\n    std::string etag = metaData_.HttpMetaData()[Http::ETAG];\r\n    metaData_.HttpMetaData()[Http::ETAG] = TrimQuotes(etag.c_str());\r\n}\r\n\r\nGetObjectResult::GetObjectResult(\r\n    const std::string& bucket, const std::string& key,\r\n    const ObjectMetaData& metaData) :\r\n    bucket_(bucket),\r\n    key_(key)\r\n{\r\n    metaData_ = metaData;\r\n    requestId_ = metaData_.HttpMetaData()[\"x-oss-request-id\"];\r\n    versionId_ = metaData_.HttpMetaData()[\"x-oss-version-id\"]; \r\n}"
  },
  {
    "path": "sdk/src/model/GetObjectTaggingRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/GetObjectTaggingRequest.h>\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nGetObjectTaggingRequest::GetObjectTaggingRequest(const std::string &bucket, const std::string &key)\r\n    :OssObjectRequest(bucket, key)\r\n{\r\n}\r\n\r\nParameterCollection GetObjectTaggingRequest::specialParameters() const\r\n{\r\n    auto parameters = OssObjectRequest::specialParameters();\r\n    parameters[\"tagging\"] = \"\";\r\n    return parameters;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/GetObjectTaggingResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/GetObjectTaggingResult.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\nGetObjectTaggingResult::GetObjectTaggingResult() :\r\n    OssObjectResult()\r\n{\r\n}\r\n\r\nGetObjectTaggingResult::GetObjectTaggingResult(const std::string& result):\r\n    GetObjectTaggingResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nGetObjectTaggingResult::GetObjectTaggingResult(const std::shared_ptr<std::iostream>& result):\r\n    GetObjectTaggingResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nGetObjectTaggingResult::GetObjectTaggingResult(const HeaderCollection& headers, \r\n    const std::shared_ptr<std::iostream>& result):\r\n    OssObjectResult(headers)\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nGetObjectTaggingResult& GetObjectTaggingResult::operator =(const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"Tagging\", root->Name(), 7)) {\r\n            XMLElement* tagSet_node = root->FirstChildElement(\"TagSet\");\r\n            if (tagSet_node) {\r\n                XMLElement *tag_node = tagSet_node->FirstChildElement(\"Tag\");\r\n                for (; tag_node; tag_node = tag_node->NextSiblingElement(\"Tag\")) {\r\n                    XMLElement *subNode;\r\n                    Tag tag;\r\n                    //Key\r\n                    subNode = tag_node->FirstChildElement(\"Key\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        tag.setKey(subNode->GetText());\r\n                    }\r\n                    //Value\r\n                    subNode = tag_node->FirstChildElement(\"Value\");\r\n                    if (subNode && subNode->GetText()) {\r\n                        tag.setValue(subNode->GetText());\r\n                    }\r\n                    tagging_.addTag(tag);\r\n                }\r\n            }\r\n            //TODO check the result and the parse flag;\r\n            parseDone_ = true;\r\n        }\r\n    }\r\n    return *this;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/GetSymlinkRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetSymlinkRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetSymlinkRequest::GetSymlinkRequest(const std::string &bucket, const std::string &key):\n    OssObjectRequest(bucket, key)\n{\n}\n\nParameterCollection GetSymlinkRequest::specialParameters() const\n{\n    auto parameters = OssObjectRequest::specialParameters();\n    parameters[\"symlink\"] = \"\";\n    return parameters;\n}\n\n\n"
  },
  {
    "path": "sdk/src/model/GetSymlinkResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/GetSymlinkResult.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n#include \"../utils/Utils.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nGetSymlinkResult::GetSymlinkResult():\r\n    OssObjectResult()\r\n{\r\n}\r\n\r\nGetSymlinkResult::GetSymlinkResult(const std::string& symlink,\r\n    const std::string& etag) :\r\n    OssObjectResult(),\r\n    symlink_(symlink),\r\n    etag_(etag)\r\n{\r\n}\r\n\r\nGetSymlinkResult::GetSymlinkResult(const HeaderCollection& headers):\r\n    OssObjectResult(headers)\r\n{\r\n    if (headers.find(\"x-oss-symlink-target\") != headers.end()) {\r\n        symlink_ = headers.at(\"x-oss-symlink-target\");\r\n    }\r\n\r\n    if (headers.find(Http::ETAG) != headers.end()) {\r\n        etag_ = TrimQuotes(headers.at(Http::ETAG).c_str());\r\n    }\r\n}\r\n\r\n\r\n"
  },
  {
    "path": "sdk/src/model/GetUserQosInfoRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/GetUserQosInfoRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nGetUserQosInfoRequest::GetUserQosInfoRequest() :\n    OssRequest()\n{\n}\n\nParameterCollection GetUserQosInfoRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"qosInfo\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/GetUserQosInfoResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetUserQosInfoResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include <sstream> \n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nGetUserQosInfoResult::GetUserQosInfoResult() :\n    OssResult()\n{\n}\n\nGetUserQosInfoResult::GetUserQosInfoResult(const std::string& result) :\n    GetUserQosInfoResult()\n{\n    *this = result;\n}\n\nGetUserQosInfoResult::GetUserQosInfoResult(const std::shared_ptr<std::iostream>& result) :\n    GetUserQosInfoResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetUserQosInfoResult& GetUserQosInfoResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root = doc.RootElement();\n        if (root && !std::strncmp(\"QoSConfiguration\", root->Name(), 16)) {\n            XMLElement* node;\n            node = root->FirstChildElement(\"Region\");\n            if (node && node->GetText()) {\n                region_ = node->GetText();\n            }\n            node = root->FirstChildElement(\"TotalUploadBandwidth\");\n            if (node && node->GetText()) {\n                qosInfo_.setTotalUploadBandwidth(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"IntranetUploadBandwidth\");\n            if (node && node->GetText()) {\n                qosInfo_.setIntranetUploadBandwidth(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"ExtranetUploadBandwidth\");\n            if (node && node->GetText()) {\n                qosInfo_.setExtranetUploadBandwidth(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"TotalDownloadBandwidth\");\n            if (node && node->GetText()) {\n                qosInfo_.setTotalDownloadBandwidth(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"IntranetDownloadBandwidth\");\n            if (node && node->GetText()) {\n                qosInfo_.setIntranetDownloadBandwidth(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"ExtranetDownloadBandwidth\");\n            if (node && node->GetText()) {\n                qosInfo_.setExtranetDownloadBandwidth(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"TotalQps\");\n            if (node && node->GetText()) {\n                qosInfo_.setTotalQps(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"IntranetQps\");\n            if (node && node->GetText()) {\n                qosInfo_.setIntranetQps(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            node = root->FirstChildElement(\"ExtranetQps\");\n            if (node && node->GetText()) {\n                qosInfo_.setExtranetQps(std::strtoll(node->GetText(), nullptr, 10));\n            }\n            parseDone_ = true;\n        }\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/GetVodPlaylistRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetVodPlaylistRequest.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n#include \"Const.h\"\n\n\nusing namespace AlibabaCloud::OSS;\n\nGetVodPlaylistRequest::GetVodPlaylistRequest(const std::string& bucket, \n    const std::string& channelName)\n    :GetVodPlaylistRequest(bucket, channelName, 0, 0)\n{\n}\n\nGetVodPlaylistRequest::GetVodPlaylistRequest(const std::string& bucket, \n    const std::string& channelName, uint64_t startTime, \n    uint64_t endTime)\n    :LiveChannelRequest(bucket, channelName), \n    startTime_(startTime),\n    endTime_(endTime)\n{\n}\n\nvoid GetVodPlaylistRequest::setStartTime(uint64_t startTime)\n{\n    startTime_ = startTime;\n}\n\nvoid GetVodPlaylistRequest::setEndTime(uint64_t endTime)\n{\n    endTime_ = endTime;\n}\n\nint GetVodPlaylistRequest::validate() const\n{\n    int ret = LiveChannelRequest::validate();\n\n    if(ret)\n    {\n        return ret;\n    }\n    \n    if(startTime_ == 0 || endTime_ == 0 || \n        endTime_ < startTime_ || \n        endTime_ > (startTime_ + SecondsOfDay))\n    {\n        return ARG_ERROR_LIVECHANNEL_BAD_TIME_PARAM;\n    }\n\n    return 0;\n}\n\nParameterCollection GetVodPlaylistRequest::specialParameters() const\n{\n    ParameterCollection collection;\n    collection[\"startTime\"] = std::to_string(startTime_);\n    collection[\"endTime\"] = std::to_string(endTime_);\n    collection[\"vod\"] = \"\";\n    return collection;\n}\n"
  },
  {
    "path": "sdk/src/model/GetVodPlaylistResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/GetVodPlaylistResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include <alibabacloud/oss/model/Bucket.h>\n#include <alibabacloud/oss/model/Owner.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\n\n\n\nGetVodPlaylistResult::GetVodPlaylistResult():\n    OssResult()\n{\n}\n\nGetVodPlaylistResult::GetVodPlaylistResult(const std::string& result):\n    GetVodPlaylistResult()\n{\n    *this = result;\n}\n\nGetVodPlaylistResult::GetVodPlaylistResult(const std::shared_ptr<std::iostream>& result):\n    GetVodPlaylistResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nGetVodPlaylistResult& GetVodPlaylistResult::operator =(const std::string& result)\n{\n    playListContent_ = result;\n    parseDone_ = true;\n    return *this;\n}\n\nconst std::string& GetVodPlaylistResult::PlaylistContent() const\n{\n    return playListContent_;\n}\n"
  },
  {
    "path": "sdk/src/model/InitiateBucketWormRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/InitiateBucketWormRequest.h>\n#include <sstream>\n\nusing namespace AlibabaCloud::OSS;\n\nInitiateBucketWormRequest::InitiateBucketWormRequest(const std::string &bucket, uint32_t day) :\n    OssBucketRequest(bucket),\n    day_(day)\n{\n}\n\nstd::string InitiateBucketWormRequest::payload() const\n{\n    std::stringstream ss;\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\n    ss << \"<InitiateWormConfiguration>\" << std::endl;\n    ss << \"  <RetentionPeriodInDays>\" << std::to_string(day_) << \"</RetentionPeriodInDays>\" << std::endl;\n    ss << \"</InitiateWormConfiguration>\" << std::endl;\n    return ss.str();\n}\n\nParameterCollection InitiateBucketWormRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"worm\"] = \"\";\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/InitiateBucketWormResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/InitiateBucketWormResult.h>\nusing namespace AlibabaCloud::OSS;\n\nInitiateBucketWormResult::InitiateBucketWormResult() :\n    OssResult()\n{\n}\n\nInitiateBucketWormResult::InitiateBucketWormResult(const HeaderCollection& header) :\r\n    OssResult(header)\r\n{\r\n    if (header.find(\"x-oss-worm-id\") != header.end()) {\r\n        wormId_ = header.at(\"x-oss-worm-id\");\r\n    }\r\n    parseDone_ = true;\n}\n\n"
  },
  {
    "path": "sdk/src/model/InitiateMultipartUploadRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/InitiateMultipartUploadRequest.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n#include \"../utils/Utils.h\"\r\n#include <sstream>\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nInitiateMultipartUploadRequest::InitiateMultipartUploadRequest(const std::string &bucket, const std::string &key) :\r\n    InitiateMultipartUploadRequest(bucket, key, ObjectMetaData())\r\n{\r\n}\r\n\r\nInitiateMultipartUploadRequest::InitiateMultipartUploadRequest(const std::string &bucket, const std::string &key, \r\n                                                               const ObjectMetaData &metaData) :\r\n    OssObjectRequest(bucket, key),\r\n    metaData_(metaData),\r\n    encodingTypeIsSet_(false),\r\n    sequential_(false)\r\n{\r\n}\r\n\r\nvoid InitiateMultipartUploadRequest::setEncodingType(const std::string &encodingType)\r\n{\r\n    encodingType_ = encodingType;\r\n    encodingTypeIsSet_ = true;\r\n}\r\n\r\nvoid InitiateMultipartUploadRequest::setCacheControl(const std::string &value)\r\n{\r\n    metaData_.addHeader(Http::CACHE_CONTROL, value);\r\n}\r\n\r\nvoid InitiateMultipartUploadRequest::setContentDisposition(const std::string &value)\r\n{\r\n    metaData_.addHeader(Http::CONTENT_DISPOSITION, value);\r\n}\r\n\r\nvoid InitiateMultipartUploadRequest::setContentEncoding(const std::string &value)\r\n{\r\n    metaData_.addHeader(Http::CONTENT_ENCODING, value);\r\n}\r\n\r\nvoid InitiateMultipartUploadRequest::setExpires(const std::string &value)\r\n{\r\n    metaData_.addHeader(Http::EXPIRES, value);\r\n}\r\n\r\nvoid InitiateMultipartUploadRequest::setTagging(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-tagging\", value);\r\n}\r\n\r\nvoid InitiateMultipartUploadRequest::setSequential(bool value)\r\n{\r\n    sequential_ = value;\r\n}\r\n\r\nObjectMetaData &InitiateMultipartUploadRequest::MetaData()\r\n{\r\n    return metaData_;\r\n}\r\n\r\nHeaderCollection InitiateMultipartUploadRequest::specialHeaders() const\r\n{\r\n    auto headers = metaData_.toHeaderCollection();\r\n    if (headers.find(Http::CONTENT_TYPE) == headers.end()) {\r\n        headers[Http::CONTENT_TYPE] = LookupMimeType(Key());\r\n    }\r\n\r\n    auto baseHeaders = OssObjectRequest::specialHeaders();\r\n    headers.insert(baseHeaders.begin(), baseHeaders.end());\r\n\r\n    return headers;\r\n}\r\n\r\nParameterCollection InitiateMultipartUploadRequest::specialParameters() const\r\n{\r\n    ParameterCollection parameters;\r\n    parameters[\"uploads\"] = \"\";\r\n    if (encodingTypeIsSet_) {\r\n        parameters[\"encoding-type\"] = encodingType_;\r\n    }\r\n\r\n    if (sequential_) {\r\n        parameters[\"sequential\"] = \"\";\r\n    }\r\n    return parameters;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/InitiateMultipartUploadResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/InitiateMultipartUploadResult.h>\n#include <alibabacloud/oss/model/Owner.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nInitiateMultipartUploadResult::InitiateMultipartUploadResult() :\n    OssResult()\n{\n}\n\nInitiateMultipartUploadResult::InitiateMultipartUploadResult(const std::string& result):\n    InitiateMultipartUploadResult()\n{\n    *this = result;\n}\n\nInitiateMultipartUploadResult::InitiateMultipartUploadResult(const std::shared_ptr<std::iostream>& result):\n    InitiateMultipartUploadResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nInitiateMultipartUploadResult& InitiateMultipartUploadResult::operator =(\n    const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root =doc.RootElement();\n        if (root && !std::strncmp(\"InitiateMultipartUploadResult\", root->Name(), 29)) {\n            XMLElement *node;\n\n            node = root->FirstChildElement(\"EncodingType\");\n            if (node && node->GetText()) encodingType_ = node->GetText();\n\n            //Detect encode type\n            bool useUrlDecode = !ToLower(encodingType_.c_str()).compare(0, 3, \"url\", 3);\n\n            node = root->FirstChildElement(\"Bucket\");\n            if (node && node->GetText()) bucket_ = node->GetText();\n\n            node = root->FirstChildElement(\"Key\");\n            if (node && node->GetText()) key_ = useUrlDecode ? UrlDecode(node->GetText()) : node->GetText();\n\n            node = root->FirstChildElement(\"UploadId\");\n            if (node && node->GetText()) uploadId_ = node->GetText();\n\n            parseDone_ = true;\n\t\t}\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/InputFormat.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/InputFormat.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nstatic inline std::string CSVHeader_Str(CSVHeader num)\n{\n    static const std::string strings[] = {\n        \"None\\0\", \"Ignore\\0\", \"Use\\0\"\n    };\n    return strings[num];\n}\n\nstatic inline std::string CompressionType_Str(CompressionType num)\n{\n    static const std::string strings[] = {\n        \"NONE\\0\",\n        \"GZIP\\0\"\n    };\n    return strings[num];\n}\n\nstatic inline std::string JsonType_Str(JsonType num)\n{\n    static const std::string strings[] = {\n        \"DOCUMENT\\0\",\n        \"LINES\\0\"\n    };\n    return strings[num];\n}\n\nstatic std::string Range_Str(const std::string rangePrefix,\n    bool isSet, const int64_t range[2])\n{\n    int64_t start = 0, end = 0;\n    start = range[0];\n    end = range[1];\n\n    if (!isSet ||\n        (start < 0 && end < 0) ||\n        (start > 0 && end > 0 && start > end)) {\n        return \"\";\n    }\n\n    std::ostringstream ostr;\n    if (start < 0) {\n        ostr << rangePrefix << \"-\" << end;\n    }\n    else if (end < 0) {\n        ostr << rangePrefix << start << \"-\";\n    }\n    else {\n        ostr << rangePrefix << start << \"-\" << end;\n    }\n    std::string str = ostr.str();\n    return str;\n}\n\n\nInputFormat::InputFormat() :\n\tcompressionType_(CompressionType::NONE),lineRangeIsSet_(false), splitRangeIsSet_(false)\n{\n}\n\nvoid InputFormat::setCompressionType(CompressionType compressionType)\n{\n\tcompressionType_ = compressionType;\n}\n\nconst std::string InputFormat::CompressionTypeInfo() const\n{\n\tstd::string str = CompressionType_Str(compressionType_);\n\treturn str;\n}\n\nvoid InputFormat::setLineRange(int64_t start, int64_t end)\n{\n    lineRange_[0] = start;\n    lineRange_[1] = end;\n    lineRangeIsSet_ = true;\n    splitRangeIsSet_ = false;\n}\n\nvoid InputFormat::setSplitRange(int64_t start, int64_t end) \n{\n    splitRange_[0] = start;\n    splitRange_[1] = end;\n    splitRangeIsSet_ = true;\n    lineRangeIsSet_ = false;\n}\n\nint InputFormat::validate() const\n{\n    if (lineRangeIsSet_ && splitRangeIsSet_) {\n        return ARG_ERROR_SELECT_OBJECT_RANGE_INVALID;\n    }\n\n    if (lineRangeIsSet_ &&\n        (lineRange_[0] < 0 || lineRange_[1] < -1 || (lineRange_[1] > -1 && lineRange_[1] < lineRange_[0]))) {\n        return ARG_ERROR_SELECT_OBJECT_LINE_RANGE_INVALID;\n    }\n    if (splitRangeIsSet_ &&\n        (splitRange_[0] < 0 || splitRange_[1] < -1 || (splitRange_[1] > -1 && splitRange_[1] < splitRange_[0]))) {\n        return ARG_ERROR_SELECT_OBJECT_SPLIT_RANGE_INVALID;\n    }\n\n    return 0;\n}\n\nstd::string InputFormat::RangeToString() const\n{\n    if (lineRangeIsSet_ && splitRangeIsSet_) {\n        return \"\";\n    }\n    if (lineRangeIsSet_) {\n        return Range_Str(\"line-range=\", lineRangeIsSet_, lineRange_);\n    }\n    if (splitRangeIsSet_) {\n        return Range_Str(\"split-range=\", splitRangeIsSet_, splitRange_);\n    }\n    return \"\";\n}\n\n/////////////////////////////////////////////////////////////////////////////////////////\n\nCSVInputFormat::CSVInputFormat()\n    : CSVInputFormat(CSVHeader::None, \"\\n\", \",\", \"\\\"\", \"#\")\n{}\n\nCSVInputFormat::CSVInputFormat(CSVHeader headerInfo,\n    const std::string& recordDelimiter,\n    const std::string& fieldDelimiter,\n    const std::string& quoteChar,\n    const std::string& commentChar):\n    InputFormat(),\n    headerInfo_(headerInfo),\n    recordDelimiter_(recordDelimiter),\n    fieldDelimiter_(fieldDelimiter),\n    quoteChar_(quoteChar),\n    commentChar_(commentChar)\n{}\n\nvoid CSVInputFormat::setHeaderInfo(CSVHeader headerInfo)\n{\n    headerInfo_ = headerInfo;\n}\n\nvoid CSVInputFormat::setCommentChar(const std::string& commentChar)\n{\n    commentChar_ = commentChar;\n}\n\nvoid CSVInputFormat::setQuoteChar(const std::string& quoteChar)\n{\n    quoteChar_ = quoteChar;\n}\n\nvoid CSVInputFormat::setFieldDelimiter(const std::string& fieldDelimiter)\n{\n    fieldDelimiter_ = fieldDelimiter;\n}\n\nvoid CSVInputFormat::setRecordDelimiter(const std::string& recordDelimiter)\n{\n    recordDelimiter_ = recordDelimiter;\n}\n\nCSVHeader CSVInputFormat::HeaderInfo() const\n{\n    return headerInfo_;\n}\n\nconst std::string& CSVInputFormat::RecordDelimiter() const\n{\n    return recordDelimiter_;\n}\n\nconst std::string& CSVInputFormat::FieldDelimiter() const\n{\n    return fieldDelimiter_;\n}\n\nconst std::string& CSVInputFormat::QuoteChar() const\n{\n    return quoteChar_;\n}\n\nconst std::string& CSVInputFormat::CommentChar() const\n{\n    return commentChar_;\n}\n\nstd::string CSVInputFormat::Type() const\n{\n    return \"csv\";\n}\n\nstd::string CSVInputFormat::toXML(int flag) const\n{\n    std::stringstream ss;\n    ss << \"<InputSerialization>\" << std::endl;\n    ss << \"<CompressionType>\" << InputFormat::CompressionTypeInfo() << \"</CompressionType>\" << std::endl;\n    ss << \"<CSV>\" << std::endl;\n    ss << \"<RecordDelimiter>\" << Base64Encode(recordDelimiter_) << \"</RecordDelimiter>\" << std::endl;\n    ss << \"<FieldDelimiter>\" << Base64Encode(fieldDelimiter_.empty() ? \"\" : std::string(1, fieldDelimiter_.front())) << \"</FieldDelimiter>\" << std::endl;\n    ss << \"<QuoteCharacter>\" << Base64Encode(quoteChar_.empty() ? \"\" : std::string(1, quoteChar_.front())) << \"</QuoteCharacter>\" << std::endl;\n    if (flag == 1) {\n        ss << \"<FileHeaderInfo>\" << CSVHeader_Str(headerInfo_) << \"</FileHeaderInfo>\" << std::endl;\n        ss << \"<CommentCharacter>\" << Base64Encode(commentChar_.empty() ? \"\" : std::string(1, commentChar_.front())) << \"</CommentCharacter>\" << std::endl;\n        ss << \"<Range>\" << InputFormat::RangeToString() << \"</Range>\" << std::endl;\n    }\n    ss << \"</CSV>\" << std::endl;\n    ss << \"</InputSerialization>\" << std::endl;\n    return ss.str();\n}\n\n////////////////////////////////////////////////////////////////////////////////////////\nJSONInputFormat::JSONInputFormat()\n    : InputFormat()\n{}\n\nJSONInputFormat::JSONInputFormat(JsonType jsonType)\n    : InputFormat(), jsonType_(jsonType)\n{}\n\nvoid JSONInputFormat::setJsonType(JsonType jsonType)\n{\n    jsonType_ = jsonType;\n}\n\nvoid JSONInputFormat::setParseJsonNumberAsString(bool parseJsonNumberAsString)\n{\n    parseJsonNumberAsString_ = parseJsonNumberAsString;\n}\n\nJsonType JSONInputFormat::JsonInfo() const\n{\n    return jsonType_;\n}\n\nbool JSONInputFormat::ParseJsonNumberAsString() const\n{\n    return parseJsonNumberAsString_;\n}\n\nstd::string JSONInputFormat::Type() const\n{\n    return \"json\";\n}\n\nstd::string JSONInputFormat::toXML(int flag) const\n{\n    std::stringstream ss;\n    ss << \"<InputSerialization>\" << std::endl;\n    ss << \"<CompressionType>\" << InputFormat::CompressionTypeInfo() << \"</CompressionType>\" << std::endl;\n    ss << \"<JSON>\" << std::endl;\n    if (flag == 1) {\n        ss << \"<Type>\" << JsonType_Str(jsonType_) << \"</Type>\" << std::endl;\n        ss << \"<ParseJsonNumberAsString>\" << (parseJsonNumberAsString_ ? \"true\" : \"false\") << \"</ParseJsonNumberAsString>\" << std::endl;\n        ss << \"<Range>\" << InputFormat::RangeToString() << \"</Range>\" << std::endl;\n    }\n    else {\n        ss << \"<Type>\" << \"LINES\" << \"</Type>\" << std::endl;\n    }\n    \n    ss << \"</JSON>\" << std::endl;\n    ss << \"</InputSerialization>\" << std::endl;\n    return ss.str();\n}"
  },
  {
    "path": "sdk/src/model/InventoryConfiguration.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/InventoryConfiguration.h>\r\n#include \"../utils/Utils.h\"\r\n#include <alibabacloud/oss/Types.h>\r\n#include <sstream>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nInventoryFilter::InventoryFilter()\n{\n}\n\nInventoryFilter::InventoryFilter(const std::string& prefix) :\r\n    prefix_(prefix)\r\n{\r\n}\r\n\r\nInventorySSEOSS::InventorySSEOSS()\r\n{\r\n}\r\n\r\nInventorySSEKMS::InventorySSEKMS()\r\n{\r\n}\r\n\r\nInventorySSEKMS::InventorySSEKMS(const std::string& key) :\r\n    keyId_(key)\r\n{\r\n}\r\n\r\nInventoryEncryption::InventoryEncryption() :\r\n    inventorySSEOSIsSet_(false),\r\n    inventorySSEKMSIsSet_(false)\r\n{\r\n}\r\n\r\nInventoryEncryption::InventoryEncryption(const InventorySSEOSS& value) :\r\n    inventorySSEOSS_(value),\r\n    inventorySSEOSIsSet_(true),\r\n    inventorySSEKMSIsSet_(false)\r\n{\r\n}\r\n\r\nInventoryEncryption::InventoryEncryption(const InventorySSEKMS& value) :\r\n    inventorySSEOSIsSet_(false),\r\n    inventorySSEKMS_(value),\r\n    inventorySSEKMSIsSet_(true)\r\n{\r\n}\r\n\r\nInventoryOSSBucketDestination::InventoryOSSBucketDestination():\r\n    format_(InventoryFormat::NotSet)\r\n{\r\n}\r\n\r\nInventoryConfiguration::InventoryConfiguration():\r\n    isEnabled_(false),\r\n    schedule_(InventoryFrequency::NotSet),\r\n    includedObjectVersions_(InventoryIncludedObjectVersions::NotSet)\r\n{\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/LifecycleRule.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/LifecycleRule.h>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nLifeCycleExpiration::LifeCycleExpiration() :\r\n    LifeCycleExpiration(0)\r\n{\r\n}\r\n\r\nLifeCycleExpiration::LifeCycleExpiration(uint32_t days) :\r\n    days_(days),\r\n    createdBeforeDate_()\r\n{\r\n}\r\n\r\nLifeCycleExpiration::LifeCycleExpiration(const std::string &createdBeforeDate) :\r\n    days_(0),\r\n    createdBeforeDate_(createdBeforeDate)\r\n{\r\n}\r\n\r\nvoid LifeCycleExpiration::setDays(uint32_t days) \r\n{\r\n    days_ = days; \r\n    createdBeforeDate_.clear();\r\n}\r\n\r\nvoid LifeCycleExpiration::setCreatedBeforeDate(const std::string &date) \r\n{\r\n    createdBeforeDate_ = date; \r\n    days_ = 0;\r\n}\r\n\r\nLifeCycleTransition::LifeCycleTransition(const LifeCycleExpiration& expiration, AlibabaCloud::OSS::StorageClass storageClass) :\r\n    expiration_(expiration),\r\n    storageClass_(storageClass)\r\n{\r\n}\r\n\r\nvoid LifeCycleTransition::setExpiration(const LifeCycleExpiration &expiration)\r\n{\r\n    expiration_ = expiration;\r\n}\r\n\r\nvoid LifeCycleTransition::setStorageClass(AlibabaCloud::OSS::StorageClass storageClass)\r\n{\r\n    storageClass_ = storageClass;\r\n}\r\n\r\nLifecycleRule::LifecycleRule() :\r\n    status_(RuleStatus::Enabled),\r\n    expiredObjectDeleteMarker_(false)\r\n{\r\n}\r\n\r\nbool LifecycleRule::hasExpiration() const\r\n{\r\n    return (expiration_.Days() > 0 || \r\n        !expiration_.CreatedBeforeDate().empty() ||\r\n        expiredObjectDeleteMarker_);\r\n}\r\n\r\nbool LifecycleRule::hasTransitionList() const\r\n{\r\n    return !transitionList_.empty();\r\n}\r\n\r\nbool LifecycleRule::hasAbortMultipartUpload() const\r\n{\r\n    return (abortMultipartUpload_.Days() > 0 || !abortMultipartUpload_.CreatedBeforeDate().empty());\r\n}\r\n\r\nbool LifecycleRule::hasNoncurrentVersionExpiration() const\r\n{\r\n    return (noncurrentVersionExpiration_.Days() > 0);\r\n}\r\n\r\nbool LifecycleRule::hasNoncurrentVersionTransitionList() const\r\n{\r\n    return !noncurrentVersionTransitionList_.empty();\r\n}\r\n\r\nbool LifecycleRule::operator==(const LifecycleRule& right) const\r\n{\r\n    if (id_ != right.id_ ||\r\n        prefix_ != right.prefix_ ||\r\n        status_ != right.status_) {\r\n        return false;\r\n    }\r\n\r\n    if (expiration_.Days() != right.expiration_.Days() ||\r\n        expiration_.CreatedBeforeDate() != right.expiration_.CreatedBeforeDate()) {\r\n        return false;\r\n    }\r\n\r\n    if (abortMultipartUpload_.Days() != right.abortMultipartUpload_.Days() ||\r\n        abortMultipartUpload_.CreatedBeforeDate() != right.abortMultipartUpload_.CreatedBeforeDate()) {\r\n        return false;\r\n    }\r\n\r\n    if (transitionList_.size() != right.transitionList_.size()) {\r\n        return false;\r\n    }\r\n\r\n    auto first = transitionList_.begin();\r\n    auto Rightfirst = right.transitionList_.begin();\r\n\r\n    for (; first != transitionList_.end(); ) {\r\n\r\n        if (first->Expiration().Days() != Rightfirst->Expiration().Days() ||\r\n            first->Expiration().CreatedBeforeDate() != Rightfirst->Expiration().CreatedBeforeDate() ||\r\n            first->StorageClass() != Rightfirst->StorageClass()) {\r\n            return false;\r\n        }\r\n        first++;\r\n        Rightfirst++;\r\n    }\r\n\r\n    if (tagSet_.size() != right.tagSet_.size()) {\r\n        return false;\r\n    }\r\n\r\n    auto firstTag = tagSet_.begin();\r\n    auto RightfirstTag = right.tagSet_.begin();\r\n\r\n    for (; firstTag != tagSet_.end(); ) {\r\n\r\n        if (firstTag->Key()  != RightfirstTag->Key() ||\r\n            firstTag->Value()!= RightfirstTag->Value()) {\r\n            return false;\r\n        }\r\n        firstTag++;\r\n        RightfirstTag++;\r\n    }\r\n\r\n    if (expiredObjectDeleteMarker_ != right.expiredObjectDeleteMarker_) {\r\n        return false;\r\n    }\r\n\r\n    if (noncurrentVersionExpiration_.Days() != right.noncurrentVersionExpiration_.Days() ||\r\n        noncurrentVersionExpiration_.CreatedBeforeDate() != right.noncurrentVersionExpiration_.CreatedBeforeDate()) {\r\n        return false;\r\n    }\r\n\r\n    if (noncurrentVersionTransitionList_.size() != right.noncurrentVersionTransitionList_.size()) {\r\n        return false;\r\n    }\r\n\r\n    first = noncurrentVersionTransitionList_.begin();\r\n    Rightfirst = right.noncurrentVersionTransitionList_.begin();\r\n\r\n    for (; first != noncurrentVersionTransitionList_.end(); ) {\r\n\r\n        if (first->Expiration().Days() != Rightfirst->Expiration().Days() ||\r\n            first->Expiration().CreatedBeforeDate() != Rightfirst->Expiration().CreatedBeforeDate() ||\r\n            first->StorageClass() != Rightfirst->StorageClass()) {\r\n            return false;\r\n        }\r\n        first++;\r\n        Rightfirst++;\r\n    }\r\n\r\n    return true;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/ListBucketInventoryConfigurationsRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/ListBucketInventoryConfigurationsRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nListBucketInventoryConfigurationsRequest::ListBucketInventoryConfigurationsRequest(const std::string& bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nParameterCollection ListBucketInventoryConfigurationsRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"inventory\"] = \"\";\n    if (!continuationToken_.empty()) {\n        parameters[\"continuation-token\"] = continuationToken_;\n    }\n    return parameters;\n}"
  },
  {
    "path": "sdk/src/model/ListBucketInventoryConfigurationsResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/ListBucketInventoryConfigurationsResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nListBucketInventoryConfigurationsResult::ListBucketInventoryConfigurationsResult() :\n    OssResult()\n{\n}\n\nListBucketInventoryConfigurationsResult::ListBucketInventoryConfigurationsResult(const std::string& result) :\n    ListBucketInventoryConfigurationsResult()\n{\n    *this = result;\n}\n\nListBucketInventoryConfigurationsResult::ListBucketInventoryConfigurationsResult(const std::shared_ptr<std::iostream>& result) :\n    ListBucketInventoryConfigurationsResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nListBucketInventoryConfigurationsResult& ListBucketInventoryConfigurationsResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root = doc.RootElement();\n        if (root && !std::strncmp(\"ListInventoryConfigurationsResult\", root->Name(), 33)) {\n            XMLElement* node;\n\n            node = root->FirstChildElement(\"InventoryConfiguration\");\n\n            for (; node; node = node->NextSiblingElement(\"InventoryConfiguration\")) {\n                XMLElement* conf_node;\n\n                InventoryConfiguration inventoryConfiguration;\n\n                conf_node = node->FirstChildElement(\"Id\");\n                if (conf_node && conf_node->GetText()) inventoryConfiguration.setId(conf_node->GetText());\n\n                conf_node = node->FirstChildElement(\"IsEnabled\");\n                if (conf_node && conf_node->GetText()) inventoryConfiguration.setIsEnabled((std::strncmp(conf_node->GetText(), \"true\", 4) ? false : true));\n\n                conf_node = node->FirstChildElement(\"Filter\");\n                if (conf_node) {\n                    InventoryFilter filter;\n                    XMLElement* prefix_node = conf_node->FirstChildElement(\"Prefix\");\n                    if (prefix_node && prefix_node->GetText()) filter.setPrefix(prefix_node->GetText());\n                    inventoryConfiguration.setFilter(filter);\n                }\n                conf_node = node->FirstChildElement(\"Destination\");\n                if (conf_node) {\n                    XMLElement* next_node;\n                    next_node = conf_node->FirstChildElement(\"OSSBucketDestination\");\n                    if (next_node) {\n                        XMLElement* sub_node;\n                        InventoryOSSBucketDestination dest;\n                        sub_node = next_node->FirstChildElement(\"Format\");\n                        if (sub_node && sub_node->GetText()) dest.setFormat(ToInventoryFormatType(sub_node->GetText()));\n                        sub_node = next_node->FirstChildElement(\"AccountId\");\n                        if (sub_node && sub_node->GetText()) dest.setAccountId(sub_node->GetText());\n                        sub_node = next_node->FirstChildElement(\"RoleArn\");\n                        if (sub_node && sub_node->GetText()) dest.setRoleArn(sub_node->GetText());\n                        sub_node = next_node->FirstChildElement(\"Bucket\");\n                        if (sub_node && sub_node->GetText()) dest.setBucket(ToInventoryBucketShortName(sub_node->GetText()));\n                        sub_node = next_node->FirstChildElement(\"Prefix\");\n                        if (sub_node && sub_node->GetText()) dest.setPrefix(sub_node->GetText());\n                        sub_node = next_node->FirstChildElement(\"Encryption\");\n                        if (sub_node) {\n                            InventoryEncryption encryption;\n                            XMLElement* sse_node;\n                            sse_node = sub_node->FirstChildElement(\"SSE-KMS\");\n                            if (sse_node) {\n                                InventorySSEKMS ssekms;\n                                XMLElement* key_node;\n                                key_node = sse_node->FirstChildElement(\"KeyId\");\n                                if (key_node && key_node->GetText()) ssekms.setKeyId(key_node->GetText());\n                                encryption.setSSEKMS(ssekms);\n                            }\n\n                            sse_node = sub_node->FirstChildElement(\"SSE-OSS\");\n                            if (sse_node) {\n                                encryption.setSSEOSS(InventorySSEOSS());\n                            }\n                            dest.setEncryption(encryption);\n                        }\n                        inventoryConfiguration.setDestination(InventoryDestination(dest));\n                    }\n                }\n\n                conf_node = node->FirstChildElement(\"Schedule\");\n                if (conf_node) {\n                    XMLElement* freq_node = conf_node->FirstChildElement(\"Frequency\");\n                    if (freq_node && freq_node->GetText()) inventoryConfiguration.setSchedule(ToInventoryFrequencyType(freq_node->GetText()));\n                }\n\n                conf_node = node->FirstChildElement(\"IncludedObjectVersions\");\n                if (conf_node && conf_node->GetText()) inventoryConfiguration.setIncludedObjectVersions(ToInventoryIncludedObjectVersionsType(conf_node->GetText()));\n\n                conf_node = node->FirstChildElement(\"OptionalFields\");\n                if (conf_node) {\n                    InventoryOptionalFields field;\n                    XMLElement* field_node = conf_node->FirstChildElement(\"Field\");\n                    for (; field_node; field_node = field_node->NextSiblingElement()) {\n                        if (field_node->GetText())\n                            field.push_back(ToInventoryOptionalFieldType(field_node->GetText()));\n                    }\n                    inventoryConfiguration.setOptionalFields(field);\n                }\n\n                inventoryConfigurationList_.push_back(inventoryConfiguration);\n            }\n\n            node = root->FirstChildElement(\"IsTruncated\");\n            if (node && node->GetText()) isTruncated_ = (std::strncmp(node->GetText(), \"true\", 4) ? false : true);\n\n            node = root->FirstChildElement(\"NextContinuationToken\");\n            if (node && node->GetText()) nextContinuationToken_ = node->GetText();\n\n            parseDone_ = true;\n        }\n    }\n    return *this;\n}\n"
  },
  {
    "path": "sdk/src/model/ListBucketsRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/ListBucketsRequest.h>\n\nusing namespace AlibabaCloud::OSS;\n\nListBucketsRequest::ListBucketsRequest() :\n    OssRequest(),\n    prefixIsSet_(false),\n    markerIsSet_(false),\n    maxKeysIsSet_(false),\n    tagIsSet(false),\n    regionList_(false)\n{\n}\nListBucketsRequest::ListBucketsRequest(const std::string& prefix, const std::string& marker, int maxKeys) :\n    OssRequest(),\n    prefix_(prefix), prefixIsSet_(true),\n    marker_(marker), markerIsSet_(true),\n    maxKeys_(maxKeys), maxKeysIsSet_(true),\n    tagIsSet(false),\n    regionList_(false)\n{\n}\n\nParameterCollection ListBucketsRequest::specialParameters() const\n{\n    ParameterCollection params;\n    if (prefixIsSet_) params[\"prefix\"] = prefix_;\n    if (markerIsSet_) params[\"marker\"] = marker_;\n    if (maxKeysIsSet_) params[\"max-keys\"] = std::to_string(maxKeys_);\n    if (tagIsSet) {\n        if (!tag_.Key().empty()) {\n            params[\"tag-key\"] = tag_.Key();\n\n            if (!tag_.Value().empty()) {\n                params[\"tag-value\"] = tag_.Value();\n            }\n        }\n    }\n    if (regionList_) params[\"regionList\"] = \"\";\n    return params;\n}"
  },
  {
    "path": "sdk/src/model/ListBucketsResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/ListBucketsResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include <alibabacloud/oss/model/Bucket.h>\n#include <alibabacloud/oss/model/Owner.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nListBucketsResult::ListBucketsResult():\n    OssResult(),\n    prefix_(),\n    marker_(),\n    nextMarker_(),\n    isTruncated_(false),\n    maxKeys_()\n{\n}\n\nListBucketsResult::ListBucketsResult(const std::string& result):\n    ListBucketsResult()\n{\n    *this = result;\n}\n\nListBucketsResult::ListBucketsResult(const std::shared_ptr<std::iostream>& result):\n    ListBucketsResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nListBucketsResult& ListBucketsResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root =doc.RootElement();\n        if (root && !std::strncmp(\"ListAllMyBucketsResult\", root->Name(), 22)) {\n            XMLElement *node;\n            node = root->FirstChildElement(\"Prefix\");\n            if (node && node->GetText()) prefix_ = node->GetText();\n\n            node = root->FirstChildElement(\"Marker\");\n            if (node && node->GetText()) marker_ = node->GetText();\n\n            node = root->FirstChildElement(\"MaxKeys\");\n            if (node && node->GetText()) maxKeys_ = atoi(node->GetText());\n\n            node = root->FirstChildElement(\"IsTruncated\");\n            if (node && node->GetText()) isTruncated_ = !std::strncmp(\"true\", node->GetText(), 4);\n\n            node = root->FirstChildElement(\"NextMarker\");\n            if (node && node->GetText()) nextMarker_ = node->GetText();\n\n            node = root->FirstChildElement(\"Owner\");\n            std::string owner_ID, owner_DisplayName;\n            if (node) {\n                XMLElement *sub_node;\n                sub_node = node->FirstChildElement(\"ID\");\n                if (sub_node && sub_node->GetText()) owner_ID = sub_node->GetText();\n\n                sub_node = node->FirstChildElement(\"DisplayName\");\n                if (sub_node && sub_node->GetText()) owner_DisplayName = sub_node->GetText();\n            }\n\n            Owner owner(owner_ID, owner_DisplayName);\n            //buckets\n            XMLElement *buckets_node = root->FirstChildElement(\"Buckets\");\n            if (buckets_node) {\n                XMLElement *bucket_node = buckets_node->FirstChildElement(\"Bucket\");\n                for (; bucket_node; bucket_node = bucket_node->NextSiblingElement()) {\n                    Bucket bucket;\n                    node = bucket_node->FirstChildElement(\"CreationDate\");\n                    if (node && node->GetText()) bucket.creationDate_ = node->GetText();\n\n                    node = bucket_node->FirstChildElement(\"ExtranetEndpoint\");\n                    if (node && node->GetText()) bucket.extranetEndpoint_ = node->GetText();\n\n                    node = bucket_node->FirstChildElement(\"IntranetEndpoint\");\n                    if (node && node->GetText()) bucket.intranetEndpoint_ = node->GetText();\n\n                    node = bucket_node->FirstChildElement(\"Location\");\n                    if (node && node->GetText()) bucket.location_ = node->GetText();\n\n                    node = bucket_node->FirstChildElement(\"Name\");\n                    if (node && node->GetText()) bucket.name_ = node->GetText();\n\n                    node = bucket_node->FirstChildElement(\"StorageClass\");\n                    if (node && node->GetText()) bucket.storageClass_ = ToStorageClassType(node->GetText());\n\n                    bucket.owner_ = owner;\n                    buckets_.push_back(bucket);\n                }\n            }\n        }\n\n        //TODO check the result and the parse flag;\n        parseDone_ = true;\n    }\n    return *this;\n}\n\n"
  },
  {
    "path": "sdk/src/model/ListLiveChannelRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/ListLiveChannelRequest.h>\n#include <sstream>\n#include \"ModelError.h\"\n#include \"Const.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nListLiveChannelRequest::ListLiveChannelRequest(const std::string &bucket):\n    OssBucketRequest(bucket), \n    maxKeys_(100)\n{\n    \n}\n\nParameterCollection ListLiveChannelRequest::specialParameters() const\n{\n    ParameterCollection colletion;\n    colletion[\"live\"] = \"\";\n    if(!marker_.empty())\n    {\n        colletion[\"marker\"] = marker_;\n    }\n    if(!prefix_.empty())\n    {\n        colletion[\"prefix\"] = prefix_;\n    }\n    if(0 != maxKeys_)\n    {\n        colletion[\"max-keys\"] = std::to_string(maxKeys_);\n    }\n    return colletion;\n}\n\nint ListLiveChannelRequest::validate() const\n{\n    if(0 == maxKeys_ || MaxListLiveChannelKeys < maxKeys_)\n    {\n        return ARG_ERROR_LIVECHANNEL_BAD_MAXKEY_PARAM;\n    }\n    return OssBucketRequest::validate();\n}\n\nvoid ListLiveChannelRequest::setMarker(const std::string &marker)\n{\n    marker_ = marker;\n}\n\nvoid ListLiveChannelRequest::setPrefix(const std::string &prefix)\n{\n    prefix_ = prefix;\n}\n\nvoid ListLiveChannelRequest::setMaxKeys(uint32_t maxKeys)\n{\n    maxKeys_ = maxKeys;\n}\n\n"
  },
  {
    "path": "sdk/src/model/ListLiveChannelResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/ListLiveChannelResult.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include <alibabacloud/oss/model/Bucket.h>\r\n#include <alibabacloud/oss/model/Owner.h>\r\n#include <sstream>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\nListLiveChannelResult::ListLiveChannelResult():\r\n    OssResult(),maxKeys_(0)\r\n{\r\n}\r\n\r\nListLiveChannelResult::ListLiveChannelResult(const std::string& result):\r\n    ListLiveChannelResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nListLiveChannelResult::ListLiveChannelResult(const std::shared_ptr<std::iostream>& result):\r\n    ListLiveChannelResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nListLiveChannelResult& ListLiveChannelResult::operator =(const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"ListLiveChannelResult\", root->Name(), 21)) {\r\n            XMLElement *node;\r\n            node = root->FirstChildElement(\"Prefix\");\r\n            if(node && node->GetText())\r\n            {\r\n                prefix_ = node->GetText();\r\n            }\r\n            \r\n            node = root->FirstChildElement(\"Marker\");\r\n            if(node && node->GetText())\r\n            {\r\n                marker_ = node->GetText();\r\n            }\r\n\r\n            node = root->FirstChildElement(\"MaxKeys\");\r\n            if(node && node->GetText())\r\n            {\r\n                maxKeys_ = std::strtoul(node->GetText(), nullptr, 10);\r\n            }\r\n\r\n            node = root->FirstChildElement(\"IsTruncated\");\r\n            if(node && node->GetText())\r\n            {\r\n                isTruncated_ = node->BoolText();\r\n            }\r\n\r\n            node = root->FirstChildElement(\"NextMarker\");\r\n            if(node && node->GetText())\r\n            {\r\n                nextMarker_ = node->GetText();\r\n            }\r\n\r\n            XMLNode *livechannelNode = root->FirstChildElement(\"LiveChannel\");\r\n            for(; livechannelNode; livechannelNode = livechannelNode->NextSiblingElement(\"LiveChannel\"))\r\n            {\r\n                LiveChannelInfo info;\r\n                node = livechannelNode->FirstChildElement(\"Name\");\r\n                if(node && node->GetText())\r\n                {\r\n                    info.name = node->GetText();\r\n                }\r\n\r\n                node = livechannelNode->FirstChildElement(\"Description\");\r\n                if(node && node->GetText())\r\n                {\r\n                    info.description = node->GetText();\r\n                }\r\n\r\n                node = livechannelNode->FirstChildElement(\"Status\");\r\n                if(node && node->GetText())\r\n                {\r\n                    info.status = node->GetText();\r\n                }\r\n\r\n                node = livechannelNode->FirstChildElement(\"LastModified\");\r\n                if(node && node->GetText())\r\n                {\r\n                    info.lastModified = node->GetText();\r\n                }\r\n\r\n                XMLNode *publishNode = livechannelNode->FirstChildElement(\"PublishUrls\");\r\n                if(publishNode)\r\n                {\r\n                    node = publishNode->FirstChildElement(\"Url\");\r\n                    if(node && node->GetText())\r\n                    {\r\n                        info.publishUrl = node->GetText();\r\n                    }\r\n                }\r\n\r\n                XMLNode *playNode = livechannelNode->FirstChildElement(\"PlayUrls\");\r\n                if(playNode)\r\n                {\r\n                    node = playNode->FirstChildElement(\"Url\");\r\n                    if(node && node->GetText())\r\n                    {\r\n                        info.playUrl = node->GetText();\r\n                    }\r\n                }\r\n                liveChannelList_.push_back(info);\r\n            }\r\n            parseDone_ = true;\r\n        }\r\n    }\r\n    return *this;\r\n}\r\n\r\nconst std::string& ListLiveChannelResult::Marker() const\r\n{\r\n    return marker_;\r\n}\r\n\r\nuint32_t ListLiveChannelResult::MaxKeys() const\r\n{\r\n    return maxKeys_;\r\n}\r\n\r\nconst std::string& ListLiveChannelResult::Prefix() const\r\n{\r\n    return prefix_;\r\n}\r\n\r\nconst std::string& ListLiveChannelResult::NextMarker() const\r\n{\r\n    return nextMarker_;\r\n}\r\n\r\nbool ListLiveChannelResult::IsTruncated() const\r\n{\r\n    return isTruncated_;\r\n}\r\n\r\nconst LiveChannelListInfo& ListLiveChannelResult::LiveChannelList() const\r\n{\r\n    return liveChannelList_;\r\n}\r\n\r\n\r\n\r\n"
  },
  {
    "path": "sdk/src/model/ListMultipartUploadsRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <sstream>\n#include <alibabacloud/oss/model/ListMultipartUploadsRequest.h>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n#include <alibabacloud/oss/Const.h>\n\nusing namespace AlibabaCloud::OSS;\nusing std::stringstream;\n\nListMultipartUploadsRequest::ListMultipartUploadsRequest(const std::string &bucket):\n    OssBucketRequest(bucket),\n    delimiterIsSet_(false),\n    keyMarkerIsSet_(false),\n    prefixIsSet_(false),\n    uploadIdMarkerIsSet_(false),\n    encodingTypeIsSet_(false),\n    maxUploadsIsSet_(false),\n    requestPayer_(RequestPayer::NotSet)\n{\n}\n\nvoid ListMultipartUploadsRequest::setDelimiter(const std::string &delimiter)\n{\n    delimiter_ = delimiter;\n    delimiterIsSet_ = true;\n}\n\nvoid ListMultipartUploadsRequest::setMaxUploads(uint32_t maxUploads)\n{\n    maxUploads_ = maxUploads > MaxUploads ? MaxUploads : maxUploads;\n    maxUploadsIsSet_ = true;\n}\n\nvoid ListMultipartUploadsRequest::setKeyMarker(const std::string &keyMarker)\n{\n    keyMarker_ = keyMarker;\n    keyMarkerIsSet_ = true;\n}\n\nvoid ListMultipartUploadsRequest::setPrefix(const std::string &prefix)\n{\n    prefix_ = prefix;\n    prefixIsSet_ = true;\n}\n\nvoid ListMultipartUploadsRequest::setUploadIdMarker(const std::string &uploadIdMarker)\n{\n    uploadIdMarker_ = uploadIdMarker;\n    uploadIdMarkerIsSet_ = true;\n}\n\nvoid ListMultipartUploadsRequest::setEncodingType(const std::string &encodingType)\n{\n    encodingType_ = encodingType;\n    encodingTypeIsSet_ = true;\n}\n\nvoid ListMultipartUploadsRequest::setRequestPayer(RequestPayer value)\n{\n    requestPayer_ = value;\n}\n\nParameterCollection ListMultipartUploadsRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"uploads\"] = \"\";\n    if(delimiterIsSet_){\n        parameters[\"delimiter\"] = delimiter_;\n    }\n\n    if (maxUploadsIsSet_) {\n        parameters[\"max-uploads\"] = std::to_string(maxUploads_);\n    }\n\n    if(keyMarkerIsSet_){\n        parameters[\"key-marker\"] = keyMarker_;\n        if (uploadIdMarkerIsSet_) {\n            parameters[\"upload-id-marker\"] = uploadIdMarker_;\n        }\n    }\n\n    if(prefixIsSet_){\n        parameters[\"prefix\"] = prefix_;\n    }\n\n    if(encodingTypeIsSet_){\n        parameters[\"encoding-type\"] = encodingType_;\n    }\n    return parameters;\n}\n\nHeaderCollection ListMultipartUploadsRequest::specialHeaders() const\n{\n    HeaderCollection headers;\n    if (requestPayer_ == RequestPayer::Requester) {\n        headers[\"x-oss-request-payer\"] = ToLower(ToRequestPayerName(RequestPayer::Requester));\n    }\n    return headers;\n}\n"
  },
  {
    "path": "sdk/src/model/ListMultipartUploadsResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <sstream>\r\n#include <alibabacloud/oss/model/ListMultipartUploadsResult.h>\r\n#include <alibabacloud/oss/model/Owner.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\nusing std::stringstream;\r\n\r\nListMultipartUploadsResult::ListMultipartUploadsResult() :\r\n    OssResult(),\r\n    maxUploads_(0),\r\n    isTruncated_(false)\r\n{\r\n}\r\n\r\nListMultipartUploadsResult::ListMultipartUploadsResult(\r\n    const std::string& result):\r\n    ListMultipartUploadsResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nListMultipartUploadsResult::ListMultipartUploadsResult(\r\n    const std::shared_ptr<std::iostream>& result):\r\n    ListMultipartUploadsResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nListMultipartUploadsResult& ListMultipartUploadsResult::operator =(\r\n    const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"ListMultipartUploadsResult\", root->Name(), 26)) {\r\n            XMLElement *node;\r\n\r\n            node = root->FirstChildElement(\"Bucket\");\r\n            if (node && node->GetText()) {\r\n                bucket_ = node->GetText();\r\n            }\r\n\r\n            node = root->FirstChildElement(\"EncodingType\");\r\n            bool isUrlEncode = false;\r\n            if (node && node->GetText()) {\r\n                encodingType_ = node->GetText();\r\n                isUrlEncode = !ToLower(encodingType_.c_str()).compare(0, 3, \"url\", 3);\r\n            }\r\n\r\n            node  = root->FirstChildElement(\"KeyMarker\");\r\n            if(node && node->GetText())\r\n            {\r\n                keyMarker_ = isUrlEncode ? UrlDecode(node->GetText()) : node->GetText();\r\n            }\r\n\r\n            node = root->FirstChildElement(\"UploadIdMarker\");\r\n            if(node && node->GetText())\r\n            {\r\n                uploadIdMarker_ = node->GetText();\r\n            }\r\n\r\n            node  = root->FirstChildElement(\"NextKeyMarker\");\r\n            if(node && node->GetText())\r\n            {\r\n                nextKeyMarker_ = isUrlEncode ? \r\n                    UrlDecode(node->GetText()) : node->GetText();\r\n            }\r\n\r\n            node = root->FirstChildElement(\"NextUploadIdMarker\");\r\n            if(node && node->GetText())\r\n            {\r\n                nextUploadIdMarker_ = node->GetText();\r\n            }\r\n\r\n            node = root->FirstChildElement(\"MaxUploads\");\r\n            if(node && node->GetText())\r\n            {\r\n                maxUploads_ = std::strtoul(node->GetText(), nullptr, 10);\r\n            }\r\n\r\n            //CommonPrefixes\r\n            node = root->FirstChildElement(\"CommonPrefixes\");\r\n            for (; node; node = node->NextSiblingElement(\"CommonPrefixes\")) {\r\n                XMLElement *prefix_node = node->FirstChildElement(\"Prefix\");\r\n                if (prefix_node && prefix_node->GetText()) commonPrefixes_.push_back(\r\n                    (isUrlEncode ? UrlDecode(prefix_node->GetText()) : prefix_node->GetText()));\r\n            }\r\n\r\n            node = root->FirstChildElement(\"IsTruncated\");\r\n            if (node && node->GetText()) {\r\n                isTruncated_ = node->BoolText();\r\n            }\r\n\r\n            XMLElement * uploadNode = root->FirstChildElement(\"Upload\");\r\n            for( ; uploadNode ; uploadNode = uploadNode->NextSiblingElement(\"Upload\"))\r\n            {\r\n                MultipartUpload rec;\r\n                node = uploadNode->FirstChildElement(\"Key\");\r\n                if(node && node->GetText())\r\n                {\r\n                    rec.Key = isUrlEncode ? UrlDecode(node->GetText()) : node->GetText();\r\n                }\r\n\r\n                node = uploadNode->FirstChildElement(\"UploadId\");\r\n                if(node && node->GetText())\r\n                {\r\n                    rec.UploadId = node->GetText();\r\n                }\r\n\r\n                node = uploadNode->FirstChildElement(\"Initiated\");\r\n                if(node && node->GetText())\r\n                {\r\n                    rec.Initiated = node->GetText();\r\n                }\r\n                multipartUploadList_.push_back(rec);\r\n            }\r\n            parseDone_ = true;\r\n\t\t}\r\n    }\r\n    return *this;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/ListObjectVersionsResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/ListObjectVersionsResult.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include <alibabacloud/oss/model/Owner.h>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\n\r\nListObjectVersionsResult::ListObjectVersionsResult() :\r\n    OssResult(),\r\n    name_(),\r\n    prefix_(),\r\n    keyMarker_(),\r\n    nextKeyMarker_(),\r\n    versionIdMarker_(),\r\n    nextVersionIdMarker_(),\r\n    delimiter_(),\r\n    encodingType_(),\r\n    isTruncated_(false),\r\n    maxKeys_(),\r\n    commonPrefixes_(),\r\n    objectVersionSummarys_(),\r\n    deleteMarkerSummarys_()\r\n{\r\n}\r\n\r\nListObjectVersionsResult::ListObjectVersionsResult(const std::string& result):\r\n    ListObjectVersionsResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nListObjectVersionsResult::ListObjectVersionsResult(const std::shared_ptr<std::iostream>& result):\r\n    ListObjectVersionsResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nListObjectVersionsResult& ListObjectVersionsResult::operator =(const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"ListVersionsResult\", root->Name(), 18)) {\r\n            XMLElement *node;\r\n            node = root->FirstChildElement(\"Name\");\r\n            if (node && node->GetText()) name_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"Prefix\");\r\n            if (node && node->GetText()) prefix_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"KeyMarker\");\r\n            if (node && node->GetText()) keyMarker_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"NextKeyMarker\");\r\n            if (node && node->GetText()) nextKeyMarker_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"VersionIdMarker\");\r\n            if (node && node->GetText()) versionIdMarker_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"NextVersionIdMarker\");\r\n            if (node && node->GetText()) nextVersionIdMarker_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"Delimiter\");\r\n            if (node && node->GetText()) delimiter_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"MaxKeys\");\r\n            if (node && node->GetText()) maxKeys_ = atoi(node->GetText());\r\n\r\n            node = root->FirstChildElement(\"IsTruncated\");\r\n            if (node && node->GetText()) isTruncated_ = !std::strncmp(\"true\", node->GetText(), 4);\r\n\r\n            node = root->FirstChildElement(\"EncodingType\");\r\n            if (node && node->GetText()) encodingType_ = node->GetText();\r\n\r\n            //Detect encode type\r\n            bool useUrlDecode = !ToLower(encodingType_.c_str()).compare(0, 3, \"url\", 3);\r\n\r\n            //CommonPrefixes\r\n            node = root->FirstChildElement(\"CommonPrefixes\");\r\n            for (; node; node = node->NextSiblingElement(\"CommonPrefixes\")) {\r\n                XMLElement *prefix_node = node->FirstChildElement(\"Prefix\");\r\n                if (prefix_node && prefix_node->GetText()) commonPrefixes_.push_back(\r\n                    (useUrlDecode ? UrlDecode(prefix_node->GetText()) : prefix_node->GetText()));\r\n            }\r\n\r\n            //Version\r\n            XMLElement *contents_node = root->FirstChildElement(\"Version\");\r\n            for (; contents_node; contents_node = contents_node->NextSiblingElement(\"Version\")) {\r\n                ObjectVersionSummary content;\r\n                node = contents_node->FirstChildElement(\"Key\");\r\n                if (node && node->GetText()) content.key_ = useUrlDecode ? UrlDecode(node->GetText()) : node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"VersionId\");\r\n                if (node && node->GetText()) content.versionid_ = node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"IsLatest\");\r\n                if (node && node->GetText()) content.isLatest_ = !std::strncmp(\"true\", node->GetText(), 4);\r\n\r\n                node = contents_node->FirstChildElement(\"LastModified\");\r\n                if (node && node->GetText()) content.lastModified_ = node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"ETag\");\r\n                if (node && node->GetText()) content.eTag_ = TrimQuotes(node->GetText());\r\n\r\n                node = contents_node->FirstChildElement(\"Size\");\r\n                if (node && node->GetText()) content.size_ = std::atoll(node->GetText());\r\n\r\n                node = contents_node->FirstChildElement(\"StorageClass\");\r\n                if (node && node->GetText()) content.storageClass_ = node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"Type\");\r\n                if (node && node->GetText()) content.type_ = node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"Owner\");\r\n                std::string owner_ID, owner_DisplayName;\r\n                if (node) {\r\n                    XMLElement *sub_node;\r\n                    sub_node = node->FirstChildElement(\"ID\");\r\n                    if (sub_node && sub_node->GetText()) owner_ID = sub_node->GetText();\r\n\r\n                    sub_node = node->FirstChildElement(\"DisplayName\");\r\n                    if (sub_node && sub_node->GetText()) owner_DisplayName = sub_node->GetText();\r\n                }\r\n\r\n                content.owner_ = Owner(owner_ID, owner_DisplayName);\r\n                objectVersionSummarys_.push_back(content);\r\n            }\r\n\r\n            //DeleteMarker\r\n            contents_node = root->FirstChildElement(\"DeleteMarker\");\r\n            for (; contents_node; contents_node = contents_node->NextSiblingElement(\"DeleteMarker\")) {\r\n                DeleteMarkerSummary content;\r\n                node = contents_node->FirstChildElement(\"Key\");\r\n                if (node && node->GetText()) content.key_ = useUrlDecode ? UrlDecode(node->GetText()) : node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"VersionId\");\r\n                if (node && node->GetText()) content.versionid_ = node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"IsLatest\");\r\n                if (node && node->GetText()) content.isLatest_ = !std::strncmp(\"true\", node->GetText(), 4);\r\n\r\n                node = contents_node->FirstChildElement(\"LastModified\");\r\n                if (node && node->GetText()) content.lastModified_ = node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"Owner\");\r\n                std::string owner_ID, owner_DisplayName;\r\n                if (node) {\r\n                    XMLElement *sub_node;\r\n                    sub_node = node->FirstChildElement(\"ID\");\r\n                    if (sub_node && sub_node->GetText()) owner_ID = sub_node->GetText();\r\n\r\n                    sub_node = node->FirstChildElement(\"DisplayName\");\r\n                    if (sub_node && sub_node->GetText()) owner_DisplayName = sub_node->GetText();\r\n                }\r\n\r\n                content.owner_ = Owner(owner_ID, owner_DisplayName);\r\n                deleteMarkerSummarys_.push_back(content);\r\n            }\r\n\r\n            //EncodingType\r\n            if (useUrlDecode) {\r\n                delimiter_     = UrlDecode(delimiter_);\r\n                keyMarker_     = UrlDecode(keyMarker_);\r\n                nextKeyMarker_ = UrlDecode(nextKeyMarker_);\r\n                prefix_        = UrlDecode(prefix_);\r\n            }\r\n        }\r\n\r\n        //TODO check the result and the parse flag;\r\n        parseDone_ = true;\r\n    }\r\n\r\n    return *this;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/ListObjectsRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/ListObjectsRequest.h>\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nParameterCollection ListObjectsRequest::specialParameters() const\n{\n    ParameterCollection params;\n    if (delimiterIsSet_) params[\"delimiter\"] = delimiter_;\n    if (markerIsSet_) params[\"marker\"] = marker_;\n    if (maxKeysIsSet_) params[\"max-keys\"] = std::to_string(maxKeys_);\n    if (prefixIsSet_) params[\"prefix\"] = prefix_;\n    if (encodingTypeIsSet_) params[\"encoding-type\"] = encodingType_;\n    return params;\n}\n\nHeaderCollection ListObjectsRequest::specialHeaders() const\n{\n    HeaderCollection headers;\n    if (requestPayer_ == RequestPayer::Requester) {\n        headers[\"x-oss-request-payer\"] = ToLower(ToRequestPayerName(RequestPayer::Requester));\n    }\n    return headers;\n}\n"
  },
  {
    "path": "sdk/src/model/ListObjectsResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/ListObjectsResult.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include <alibabacloud/oss/model/Owner.h>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\n\r\nListObjectsResult::ListObjectsResult() :\r\n    OssResult(),\r\n    name_(),\r\n    prefix_(),\r\n    marker_(),\r\n    delimiter_(),\r\n    nextMarker_(),\r\n    isTruncated_(false),\r\n    maxKeys_(),\r\n    commonPrefixes_(),\r\n    objectSummarys_()\r\n{\r\n}\r\n\r\nListObjectsResult::ListObjectsResult(const std::string& result):\r\n    ListObjectsResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nListObjectsResult::ListObjectsResult(const std::shared_ptr<std::iostream>& result):\r\n    ListObjectsResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nListObjectsResult& ListObjectsResult::operator =(const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"ListBucketResult\", root->Name(), 16)) {\r\n            XMLElement *node;\r\n            node = root->FirstChildElement(\"Name\");\r\n            if (node && node->GetText()) name_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"Prefix\");\r\n            if (node && node->GetText()) prefix_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"Marker\");\r\n            if (node && node->GetText()) marker_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"Delimiter\");\r\n            if (node && node->GetText()) delimiter_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"MaxKeys\");\r\n            if (node && node->GetText()) maxKeys_ = atoi(node->GetText());\r\n\r\n            node = root->FirstChildElement(\"IsTruncated\");\r\n            if (node && node->GetText()) isTruncated_ = !std::strncmp(\"true\", node->GetText(), 4);\r\n\r\n            node = root->FirstChildElement(\"NextMarker\");\r\n            if (node && node->GetText()) nextMarker_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"EncodingType\");\r\n            if (node && node->GetText()) encodingType_ = node->GetText();\r\n\r\n\r\n            //Detect encode type\r\n            bool useUrlDecode = !ToLower(encodingType_.c_str()).compare(0, 3, \"url\", 3);\r\n\r\n            //CommonPrefixes\r\n            node = root->FirstChildElement(\"CommonPrefixes\");\r\n            for (; node; node = node->NextSiblingElement(\"CommonPrefixes\")) {\r\n                XMLElement *prefix_node = node->FirstChildElement(\"Prefix\");\r\n                if (prefix_node && prefix_node->GetText()) commonPrefixes_.push_back(\r\n                    (useUrlDecode ? UrlDecode(prefix_node->GetText()) : prefix_node->GetText()));\r\n            }\r\n\r\n            //Contents\r\n            XMLElement *contents_node = root->FirstChildElement(\"Contents\");\r\n            for (; contents_node; contents_node = contents_node->NextSiblingElement(\"Contents\")) {\r\n                ObjectSummary content;\r\n                node = contents_node->FirstChildElement(\"Key\");\r\n                if (node && node->GetText()) content.key_ = useUrlDecode ? UrlDecode(node->GetText()) : node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"LastModified\");\r\n                if (node && node->GetText()) content.lastModified_ = node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"ETag\");\r\n                if (node && node->GetText()) content.eTag_ = TrimQuotes(node->GetText());\r\n\r\n                node = contents_node->FirstChildElement(\"Size\");\r\n                if (node && node->GetText()) content.size_ = std::atoll(node->GetText());\r\n\r\n                node = contents_node->FirstChildElement(\"StorageClass\");\r\n                if (node && node->GetText()) content.storageClass_ = node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"Type\");\r\n                if (node && node->GetText()) content.type_ = node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"Owner\");\r\n                std::string owner_ID, owner_DisplayName;\r\n                if (node) {\r\n                    XMLElement *sub_node;\r\n                    sub_node = node->FirstChildElement(\"ID\");\r\n                    if (sub_node && sub_node->GetText()) owner_ID = sub_node->GetText();\r\n\r\n                    sub_node = node->FirstChildElement(\"DisplayName\");\r\n                    if (sub_node && sub_node->GetText()) owner_DisplayName = sub_node->GetText();\r\n                }\r\n                content.owner_ = Owner(owner_ID, owner_DisplayName);\r\n\r\n                node = contents_node->FirstChildElement(\"RestoreInfo\");\r\n                if (node && node->GetText()) content.restoreInfo_ = node->GetText();\r\n\r\n                objectSummarys_.push_back(content);\r\n            }\r\n\r\n            //EncodingType\r\n            if (useUrlDecode) {\r\n                delimiter_  = UrlDecode(delimiter_);\r\n                marker_     = UrlDecode(marker_);\r\n                nextMarker_ = UrlDecode(nextMarker_);\r\n                prefix_     = UrlDecode(prefix_);\r\n            }\r\n        }\r\n\r\n        //TODO check the result and the parse flag;\r\n        parseDone_ = true;\r\n    }\r\n\r\n    return *this;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/ListObjectsV2Request.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/ListObjectsV2Request.h>\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nParameterCollection ListObjectsV2Request::specialParameters() const\n{\n    ParameterCollection params;\n    params[\"list-type\"] = \"2\";\n    if (delimiterIsSet_) params[\"delimiter\"] = delimiter_;\n    if (startAfterIsSet_) params[\"start-after\"] = startAfter_;\n    if (continuationTokenIsSet_) params[\"continuation-token\"] = continuationToken_;\n    if (maxKeysIsSet_) params[\"max-keys\"] = std::to_string(maxKeys_);\n    if (prefixIsSet_) params[\"prefix\"] = prefix_;\n    if (encodingTypeIsSet_) params[\"encoding-type\"] = encodingType_;\n    if (fetchOwnerIsSet_) params[\"fetch-owner\"] = fetchOwner_? \"true\":\"false\";\n    return params;\n}\n\nHeaderCollection ListObjectsV2Request::specialHeaders() const\n{\n    HeaderCollection headers;\n    if (requestPayer_ == RequestPayer::Requester) {\n        headers[\"x-oss-request-payer\"] = ToLower(ToRequestPayerName(RequestPayer::Requester));\n    }\n    return headers;\n}\n"
  },
  {
    "path": "sdk/src/model/ListObjectsV2Result.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/ListObjectsV2Result.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include <alibabacloud/oss/model/Owner.h>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\nListObjectsV2Result::ListObjectsV2Result() :\r\n    OssResult(),\r\n    name_(),\r\n    prefix_(),\r\n    startAfter_(),\r\n    continuationToken_(),\r\n    nextContinuationToken_(),\r\n    delimiter_(),\r\n    maxKeys_(),\r\n    keyCount_(),\r\n    isTruncated_(false),\r\n    commonPrefixes_(),\r\n    objectSummarys_()\r\n{\r\n}\r\n\r\nListObjectsV2Result::ListObjectsV2Result(const std::string& result):\r\n    ListObjectsV2Result()\r\n{\r\n    *this = result;\r\n}\r\n\r\nListObjectsV2Result::ListObjectsV2Result(const std::shared_ptr<std::iostream>& result):\r\n    ListObjectsV2Result()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nListObjectsV2Result& ListObjectsV2Result::operator =(const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"ListBucketResult\", root->Name(), 16)) {\r\n            XMLElement *node;\r\n            node = root->FirstChildElement(\"Name\");\r\n            if (node && node->GetText()) name_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"Prefix\");\r\n            if (node && node->GetText()) prefix_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"StartAfter\");\r\n            if (node && node->GetText()) startAfter_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"ContinuationToken\");\r\n            if (node && node->GetText()) continuationToken_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"NextContinuationToken\");\r\n            if (node && node->GetText()) nextContinuationToken_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"Delimiter\");\r\n            if (node && node->GetText()) delimiter_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"MaxKeys\");\r\n            if (node && node->GetText()) maxKeys_ = atoi(node->GetText());\r\n\r\n            node = root->FirstChildElement(\"KeyCount\");\r\n            if (node && node->GetText()) keyCount_ = atoi(node->GetText());\r\n\r\n            node = root->FirstChildElement(\"IsTruncated\");\r\n            if (node && node->GetText()) isTruncated_ = !std::strncmp(\"true\", node->GetText(), 4);\r\n\r\n            node = root->FirstChildElement(\"EncodingType\");\r\n            if (node && node->GetText()) encodingType_ = node->GetText();\r\n\r\n            //Detect encode type\r\n            bool useUrlDecode = !ToLower(encodingType_.c_str()).compare(0, 3, \"url\", 3);\r\n\r\n            //CommonPrefixes\r\n            node = root->FirstChildElement(\"CommonPrefixes\");\r\n            for (; node; node = node->NextSiblingElement(\"CommonPrefixes\")) {\r\n                XMLElement *prefix_node = node->FirstChildElement(\"Prefix\");\r\n                if (prefix_node && prefix_node->GetText()) commonPrefixes_.push_back(\r\n                    (useUrlDecode ? UrlDecode(prefix_node->GetText()) : prefix_node->GetText()));\r\n            }\r\n\r\n            //Contents\r\n            XMLElement *contents_node = root->FirstChildElement(\"Contents\");\r\n            for (; contents_node; contents_node = contents_node->NextSiblingElement(\"Contents\")) {\r\n                ObjectSummary content;\r\n                node = contents_node->FirstChildElement(\"Key\");\r\n                if (node && node->GetText()) content.key_ = useUrlDecode ? UrlDecode(node->GetText()) : node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"LastModified\");\r\n                if (node && node->GetText()) content.lastModified_ = node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"ETag\");\r\n                if (node && node->GetText()) content.eTag_ = TrimQuotes(node->GetText());\r\n\r\n                node = contents_node->FirstChildElement(\"Size\");\r\n                if (node && node->GetText()) content.size_ = std::atoll(node->GetText());\r\n\r\n                node = contents_node->FirstChildElement(\"StorageClass\");\r\n                if (node && node->GetText()) content.storageClass_ = node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"Type\");\r\n                if (node && node->GetText()) content.type_ = node->GetText();\r\n\r\n                node = contents_node->FirstChildElement(\"Owner\");\r\n                std::string owner_ID, owner_DisplayName;\r\n                if (node) {\r\n                    XMLElement *sub_node;\r\n                    sub_node = node->FirstChildElement(\"ID\");\r\n                    if (sub_node && sub_node->GetText()) owner_ID = sub_node->GetText();\r\n\r\n                    sub_node = node->FirstChildElement(\"DisplayName\");\r\n                    if (sub_node && sub_node->GetText()) owner_DisplayName = sub_node->GetText();\r\n                }\r\n                content.owner_ = Owner(owner_ID, owner_DisplayName);\r\n\r\n                node = contents_node->FirstChildElement(\"RestoreInfo\");\r\n                if (node && node->GetText()) content.restoreInfo_ = node->GetText();\r\n\r\n                objectSummarys_.push_back(content);\r\n            }\r\n\r\n            //EncodingType\r\n            if (useUrlDecode) {\r\n                delimiter_  = UrlDecode(delimiter_);\r\n                startAfter_ = UrlDecode(startAfter_);\r\n                prefix_     = UrlDecode(prefix_);\r\n            }\r\n        }\r\n\r\n        //TODO check the result and the parse flag;\r\n        parseDone_ = true;\r\n    }\r\n\r\n    return *this;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/ListPartsRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <set>\n#include <sstream>\n#include <alibabacloud/oss/model/ListPartsRequest.h>\n#include <alibabacloud/oss/http/HttpType.h>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n#include <alibabacloud/oss/Const.h>\n\n\nusing namespace AlibabaCloud::OSS;\nusing std::stringstream;\n\nListPartsRequest::ListPartsRequest(const std::string &bucket,\n     const std::string &key) :\n    ListPartsRequest(bucket, key, std::string())\n{\n}\n\nListPartsRequest::ListPartsRequest(const std::string &bucket,\n    const std::string &key, const std::string &uploadId) :\n    OssObjectRequest(bucket, key),\n    uploadId_(uploadId),\n    maxPartsIsSet_(false),\n    partNumberMarkerIsSet_(false),\n    encodingTypeIsSet_(false)\n{\n}\n\nvoid ListPartsRequest::setUploadId(const std::string &uploadId)\n{\n    uploadId_ = uploadId;\n}\n\nvoid ListPartsRequest::setEncodingType(const std::string &str)\n{\n    encodingType_ = str;\n    encodingTypeIsSet_ = true;\n}\n\nvoid ListPartsRequest::setMaxParts(uint32_t maxParts)\n{\n    maxParts_ = maxParts > MaxReturnedKeys ? MaxReturnedKeys: maxParts;\n    maxPartsIsSet_ = true;\n}\n\nvoid ListPartsRequest::setPartNumberMarker(uint32_t partNumberMarker)\n{\n    partNumberMarker_ = partNumberMarker;\n    partNumberMarkerIsSet_ = true;\n}\n\nParameterCollection ListPartsRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"uploadId\"] = uploadId_;\n\n    if (maxPartsIsSet_) {\n        parameters[\"max-parts\"] = std::to_string(maxParts_);\n    }\n\n    if (partNumberMarkerIsSet_) {\n        parameters[\"part-number-marker\"] = std::to_string(partNumberMarker_);\n    }\n\n    if (encodingTypeIsSet_) {\n        parameters[\"encoding-type\"] = encodingType_;\n    }\n\n    return parameters;\n}\n"
  },
  {
    "path": "sdk/src/model/ListPartsResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <sstream>\r\n#include <alibabacloud/oss/model/ListPartsResult.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include \"../utils/Utils.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\nusing std::stringstream;\r\n\r\nListPartsResult::ListPartsResult():\r\n    OssResult(),\r\n    maxParts_(0),\r\n    partNumberMarker_(0),\r\n    nextPartNumberMarker_(0),\r\n    isTruncated_(false)\r\n{\r\n}\r\n\r\nListPartsResult::ListPartsResult(const std::string& result):\r\n    ListPartsResult()\r\n{\r\n    *this = result;\r\n}\r\n\r\nListPartsResult::ListPartsResult(const std::shared_ptr<std::iostream>& result):\r\n    ListPartsResult()\r\n{\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nListPartsResult& ListPartsResult::operator =(const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"ListPartsResult\", root->Name(), 15)) {\r\n            XMLElement *node;\r\n            node = root->FirstChildElement(\"EncodingType\");\r\n            if (node && node->GetText()) encodingType_ = node->GetText();\r\n\r\n            //Detect encode type\r\n            bool useUrlDecode = !ToLower(encodingType_.c_str()).compare(0, 3, \"url\", 3);\r\n\r\n            node = root->FirstChildElement(\"Bucket\");\r\n            if (node && node->GetText()) bucket_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"Key\");\r\n            if (node && node->GetText()) key_ = useUrlDecode ? UrlDecode(node->GetText()) : node->GetText();\r\n\r\n            node = root->FirstChildElement(\"UploadId\");\r\n            if (node && node->GetText()) uploadId_ = node->GetText();\r\n\r\n            node = root->FirstChildElement(\"PartNumberMarker\");\r\n            if(node && node->GetText())\r\n            {\r\n                partNumberMarker_ = std::strtoul(node->GetText(), nullptr, 10);\r\n            }\r\n\r\n            node = root->FirstChildElement(\"NextPartNumberMarker\");\r\n            if(node && node->GetText())\r\n            {\r\n                nextPartNumberMarker_ = std::strtoul(node->GetText(), nullptr, 10);\r\n            }\r\n\r\n            node = root->FirstChildElement(\"MaxParts\");\r\n            if (node && node->GetText())\r\n            {\r\n                maxParts_ = std::strtoul(node->GetText(), nullptr, 10);\r\n            }\r\n\r\n            node = root->FirstChildElement(\"IsTruncated\");\r\n            if (node && node->GetText()) isTruncated_ = node->BoolText();\r\n\r\n            XMLElement * partNode = root->FirstChildElement(\"Part\");\r\n            for( ; partNode ; partNode = partNode->NextSiblingElement(\"Part\"))\r\n            {\r\n                Part part;\r\n                node = partNode->FirstChildElement(\"PartNumber\");\r\n                if(node && node->GetText())\r\n                {\r\n                    part.partNumber_ = std::atoi(node->GetText());\r\n                }\r\n\r\n                node = partNode->FirstChildElement(\"LastModified\");\r\n                if(node && node->GetText()) part.lastModified_ = node->GetText();\r\n\r\n                node = partNode->FirstChildElement(\"ETag\");\r\n                if (node && node->GetText()) part.eTag_ = TrimQuotes(node->GetText());\r\n\r\n                node = partNode->FirstChildElement(\"Size\");\r\n                if(node && node->GetText())\r\n                {\r\n                    part.size_ = std::strtoll(node->GetText(), nullptr, 10);\r\n                }\r\n\r\n                node = partNode->FirstChildElement(\"HashCrc64ecma\");\r\n                if(node && node->GetText())\r\n                {\r\n                    part.cRC64_ = std::strtoull(node->GetText(), nullptr, 10);\r\n                }\r\n                partList_.push_back(part);\r\n            }\r\n        }\r\n        //TODO check the result and the parse flag;\r\n        parseDone_ = true;\r\n    }\r\n    return *this;\r\n}\r\n\r\nconst std::string& ListPartsResult::UploadId() const\r\n{\r\n    return uploadId_;\r\n}\r\n\r\nconst std::string& ListPartsResult::Key() const\r\n{\r\n    return key_;\r\n}\r\nconst std::string& ListPartsResult::Bucket() const\r\n{\r\n    return bucket_;\r\n}\r\nconst std::string& ListPartsResult::EncodingType() const\r\n{\r\n    return encodingType_;\r\n}\r\n\r\nuint32_t ListPartsResult::MaxParts() const\r\n{\r\n    return maxParts_;\r\n}\r\n\r\nuint32_t ListPartsResult::PartNumberMarker() const\r\n{\r\n    return partNumberMarker_;\r\n}\r\n\r\nuint32_t ListPartsResult::NextPartNumberMarker() const\r\n{\r\n    return nextPartNumberMarker_;\r\n}\r\n\r\nconst PartList& ListPartsResult::PartList() const\r\n{\r\n    return partList_;\r\n}\r\n\r\nbool ListPartsResult::IsTruncated() const\r\n{\r\n    return isTruncated_;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/ModelError.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include \"ModelError.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nstatic const char * GetArgErrorMsg(const int code)\r\n{\r\n    static const char * msg[] =\r\n    {\r\n        \"Argument is invalid, please check.\",\r\n        /*Common 1-2*/\r\n        \"The bucket name is invalid. A bucket name must  be comprised of lower-case characters, numbers or dash(-) with 3-63 characters long.\",\r\n        \"The object key is invalid. An object name should be between 1-1023 bytes long and cannot begin with '/' or '\\\\'\",\r\n        /*CORS   3-10*/\r\n        \"One bucket not allow exceed ten item of CORSRules.\",\r\n        \"CORSRule.AllowedOrigins should not be empty.\",\r\n        \"CORSRule.AllowedOrigins allowes at most one asterisk wildcard.\",\r\n        \"CORSRule.AllowedMethods should not be empty.\",\r\n        \"CORSRule.AllowedMethods only supports GET/PUT/DELETE/POST/HEAD.\",\r\n        \"CORSRule.AllowedHeaders allowes at most one asterisk wildcard.\",\r\n        \"CORSRule.ExposedHeader dose not allowe asterisk wildcard.\",\r\n        \"CORSRule.MaxAgeSeconds should not be less than 0 or greater than 999999999.\",\r\n        /*Logging -11*/\r\n        \"Invalid logging prefix.\",\r\n        /*storageCapacity -12*/\r\n        \"Storage capacity must greater than -1.\",\r\n        /*WebSiet -13*/\r\n        \"Index document must not be empty.\",\r\n        \"Invalid index document, must be end with.html.\",\r\n        \"Invalid error document, must be end with .html.\",\r\n        /*iostream request body -16*/\r\n        \"Request body is null.\",\r\n        \"Request body is in fail state. Logical error on i/o operation.\",\r\n        \"Request body is in bad state. Read/writing error on i/o operation.\",\r\n        /*MultipartUpload -19*/\r\n        \"PartList is empty.\",\r\n        \"PartSize should not be less than 100*1024 or greater than 5*1024*1024*1024.\",\r\n        \"PartNumber should not be less than 1 or greater than 10000.\",\r\n        /*Lifecycle Rules -22*/\r\n        \"One bucket not allow exceed one thousand item of LifecycleRules.\",\r\n        \"LifecycleRule should not be null or empty.\",\r\n        \"Only one expiration property should be specified.\",\r\n        \"You have a rule for a prefix, and therefore you cannot create the rule for the whole bucket.\",\r\n        \"Configure at least one of file and fragment lifecycle.\",\r\n        /*ResumableUpload -27*/\r\n        \"The path of file to upload is empty.\",\r\n        \"Open upload file failed.\",\r\n        \"The part size is less than 100KB.\",\r\n        \"The thread num is less than 1.\",\r\n        \"Checkpoint directory is not exist.\",\r\n        \"Parse resumable upload record failed.\",\r\n        \"Upload file has been modified since last upload.\",\r\n        \"Upload record is invalid, it has been modified.\",\r\n        /*ResumableCopy -35*/\r\n        \"Parse resumable copy record failed.\",\r\n        \"Source object has been modified since last copy.\",\r\n        \"Copy record is invalid, it has been modified.\",\r\n        /*ResumableDownload -38*/\r\n        \"Invalid range of resumable download\",\r\n        \"The path of file download to is empty\",\r\n        \"Source object has been modified since last download.\",\r\n        \"Parse resumable download record failed.\",\r\n        \"invalid range values in download record record file.\",\r\n        \"Range values has been modified since last download.\",\r\n        \"Open temp file for download failed\",\r\n        /*GetObject -45*/\r\n        \"The range is invalid. The start should not be less than 0 or less then the end. The end could be -1 to get the rest of the data.\",\r\n        /*LiveChannel -46*/\r\n        \"The status param is invalid, it must be 'enabled' or 'disabled' \",\r\n        \"The channelName param is invalid, it shouldn't contain '/' and length < 1023\",\r\n        \"The dest bucket name is invalid\",\r\n        \"The live channel description is invalied, it should be shorter than 129\",\r\n        \"The channel type is invalid, it shoudld only be HLS\",\r\n        \"The live channel frag duration param is invalid, it should be [1,100]\",\r\n        \"The live channel frag count param is invalid, it should be [1,100]\",\r\n        \"The live channel play list param is invalid, it should end with '.m3u8' & length in [6,128]\",\r\n        \"The snapshot param is invalid, please check.\",\r\n        \"The time param is invalid, endTime should bigger than startTime and difference smaller than 24*60*60\",\r\n        \"The Max Key param is invalid, it's default valus is 100, and smaller than 1000\",\r\n        /*SelectObject -57*/\r\n        \"The range is invalid. It cannot set lien range and split range at the same time.\",\r\n        \"The line range is invalid. The start should not be less than 0 or less then the end. The end could be -1 to get the rest of the data.\",\r\n        \"The split range is invalid. The start should not be less than 0 or less then the end. The end could be -1 to get the rest of the data.\",\r\n        \"The select object expressiontype must is SQL.\",\r\n        \"The select object content checksum failed.\",\r\n        \"The request InputFormat/OutputFormat is invalid. It cannot set InputFormat or OutputFormat as nullptr.\",\r\n        \"The request InputFormat/OutputFormat is invalid. It cannot set InputFormat and OutputFormat in difficent type.\",\r\n        /*CreateSelectObject -64*/\r\n        \"The request InputFormat is invalid. It cannot set InputFormat as nullptr.\",\r\n        /*Tagging -65*/\r\n        \"Object tags cannot be greater than 10.\",\r\n        \"Object Tag key is invalid, it's length should be [1, 128].\",\r\n        \"Object Tag value is invalid, it's length should be less than 256.\",\r\n        /*Resumable for wstring path -68*/\r\n        \"Only support wstring path in windows os.\",\r\n        \"The type of filePath and checkpointDir should be the same, either string or wstring.\"\r\n    };\r\n\r\n    int index = code - ARG_ERROR_START;\r\n    int msg_size = sizeof(msg)/sizeof(msg[0]);\r\n    if (code < ARG_ERROR_START || index > msg_size) {\r\n        index = 0;\r\n    }\r\n\r\n    return msg[index];\r\n}\r\n\r\n\r\nconst char * AlibabaCloud::OSS::GetModelErrorMsg(const int code)\r\n{\r\n    if (code >= ARG_ERROR_START && code <= ARG_ERROR_END) {\r\n        return GetArgErrorMsg(code);\r\n    }\r\n\r\n    return \"Model error, but undefined.\";\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/ModelError.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <alibabacloud/oss/client/Error.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n\tconst char * GetModelErrorMsg(const int code);\r\n\r\n    /*Error For Argument Check*/\r\n    const int ARG_ERROR_BASE   = ERROR_CLIENT_BASE + 1000;\r\n    const int ARG_ERROR_START  = ARG_ERROR_BASE;\r\n    const int ARG_ERROR_END    = ARG_ERROR_START +  999;\r\n\r\n    /*Default*/\r\n    const int ARG_ERROR_DEFAULT     = ARG_ERROR_BASE + 0;\r\n    /*Common*/\r\n    const int ARG_ERROR_BUCKET_NAME = ARG_ERROR_BASE + 1;\r\n    const int ARG_ERROR_OBJECT_NAME = ARG_ERROR_BASE + 2;\r\n    /*CORS*/\r\n    const int ARG_ERROR_CORS_RULE_LIMIT                    = ARG_ERROR_BASE + 3;\r\n    const int ARG_ERROR_CORS_ALLOWEDORIGINS_EMPTY          = ARG_ERROR_BASE + 4;\r\n    const int ARG_ERROR_CORS_ALLOWEDORIGINS_ASTERISK_COUNT = ARG_ERROR_BASE + 5;\r\n    const int ARG_ERROR_CORS_ALLOWEDMETHODS_EMPTY          = ARG_ERROR_BASE + 6;\r\n    const int ARG_ERROR_CORS_ALLOWEDMETHODS_VALUE          = ARG_ERROR_BASE + 7;\r\n    const int ARG_ERROR_CORS_ALLOWEDHEADERS_ASTERISK_COUNT = ARG_ERROR_BASE + 8;\r\n    const int ARG_ERROR_CORS_EXPOSEHEADERS_ASTERISK_COUNT  = ARG_ERROR_BASE + 9;\r\n    const int ARG_ERROR_CORS_MAXAGESECONDS_RANGE           = ARG_ERROR_BASE + 10;\r\n    /*Logging*/\r\n    const int ARG_ERROR_LOGGING_TARGETPREFIX_INVALID  = ARG_ERROR_BASE + 11;\r\n    /*StorageCapacity*/\r\n    const int ARG_ERROR_STORAGECAPACITY_INVALID = ARG_ERROR_BASE + 12;\r\n    /*WebSiet*/\r\n    const int ARG_ERROR_WEBSITE_INDEX_DOCCUMENT_EMPTY        = ARG_ERROR_BASE + 13;\r\n    const int ARG_ERROR_WEBSITE_INDEX_DOCCUMENT_NAME_INVALID = ARG_ERROR_BASE + 14;\r\n    const int ARG_ERROR_WEBSITE_ERROR_DOCCUMENT_NAME_INVALID = ARG_ERROR_BASE + 15;\r\n    /*iostream request body*/\r\n    const int ARG_ERROR_REQUEST_BODY_NULLPTR    = ARG_ERROR_BASE + 16;\r\n    const int ARG_ERROR_REQUEST_BODY_FAIL_STATE = ARG_ERROR_BASE + 17;\r\n    const int ARG_ERROR_REQUEST_BODY_BAD_STATE  = ARG_ERROR_BASE + 18;\r\n    /*MultipartUpload*/\r\n    const int ARG_ERROR_MULTIPARTUPLOAD_PARTLIST_EMPTY   = ARG_ERROR_BASE + 19;\r\n    const int ARG_ERROR_MULTIPARTUPLOAD_PARTSIZE_RANGE   = ARG_ERROR_BASE + 20;\r\n    const int ARG_ERROR_MULTIPARTUPLOAD_PARTNUMBER_RANGE = ARG_ERROR_BASE + 21;\r\n    /*Lifecycle Rules*/\r\n    const int ARG_ERROR_LIFECYCLE_RULE_LIMIT       = ARG_ERROR_BASE + 22;\r\n    const int ARG_ERROR_LIFECYCLE_RULE_EMPTY       = ARG_ERROR_BASE + 23;\r\n    const int ARG_ERROR_LIFECYCLE_RULE_EXPIRATION  = ARG_ERROR_BASE + 24;\r\n    const int ARG_ERROR_LIFECYCLE_RULE_ONLY_ONE_FOR_BUCKET = ARG_ERROR_BASE + 25;\r\n    const int ARG_ERROR_LIFECYCLE_RULE_CONFIG_EMPTY = ARG_ERROR_BASE + 26;\r\n    \r\n    /*Resumable Upload*/\r\n    const int ARG_ERROR_UPLOAD_FILE_PATH_EMPTY = ARG_ERROR_BASE + 27;\r\n    const int ARG_ERROR_OPEN_UPLOAD_FILE = ARG_ERROR_BASE + 28;\r\n    const int ARG_ERROR_CHECK_PART_SIZE_LOWER = ARG_ERROR_BASE + 29;\r\n    const int ARG_ERROR_CHECK_THREAD_NUM_LOWER = ARG_ERROR_BASE + 30;\r\n    const int ARG_ERROR_CHECK_POINT_DIR_NONEXIST = ARG_ERROR_BASE + 31;\r\n    const int ARG_ERROR_PARSE_UPLOAD_RECORD_FILE = ARG_ERROR_BASE + 32;\r\n    const int ARG_ERROR_UPLOAD_FILE_MODIFIED = ARG_ERROR_BASE + 33;\r\n    const int ARG_ERROR_UPLOAD_RECORD_INVALID = ARG_ERROR_BASE + 34;\r\n    \r\n    /*Resumable Copy*/\r\n    const int ARG_ERROR_PARSE_COPY_RECORD_FILE = ARG_ERROR_BASE + 35;\r\n    const int ARG_ERROR_COPY_SRC_OBJECT_MODIFIED = ARG_ERROR_BASE + 36;\r\n    const int ARG_ERROR_COPY_RECORD_INVALID = ARG_ERROR_BASE + 37;\r\n    \r\n    /*Resumable Download*/\r\n    const int ARG_ERROR_INVALID_RANGE = ARG_ERROR_BASE + 38;\r\n    const int ARG_ERROR_DOWNLOAD_FILE_PATH_EMPTY = ARG_ERROR_BASE + 39;\r\n    const int ARG_ERROR_DOWNLOAD_OBJECT_MODIFIED = ARG_ERROR_BASE + 40;\r\n    const int ARG_ERROR_PARSE_DOWNLOAD_RECORD_FILE = ARG_ERROR_BASE + 41;\r\n    const int ARG_ERROR_INVALID_RANGE_IN_DWONLOAD_RECORD = ARG_ERROR_BASE + 42;\r\n    const int ARG_ERROR_RANGE_HAS_BEEN_RESET = ARG_ERROR_BASE + 43;\r\n    const int ARG_ERROR_OPEN_DOWNLOAD_TEMP_FILE = ARG_ERROR_BASE + 44;\r\n\r\n    /*GetObject*/\r\n    const int ARG_ERROR_OBJECT_RANGE_INVALID = ARG_ERROR_BASE + 45;\r\n    /*LiveChannel*/\r\n    const int ARG_ERROR_LIVECHANNEL_BAD_STATUS_PARAM = ARG_ERROR_BASE + 46;\r\n    const int ARG_ERROR_LIVECHANNEL_BAD_CHANNELNAME_PARAM = ARG_ERROR_BASE + 47;\r\n    const int ARG_ERROR_LIVECHANNEL_BAD_DEST_BUCKET_PARAM = ARG_ERROR_BASE + 48;\r\n    const int ARG_ERROR_LIVECHANNEL_BAD_DESCRIPTION_PARAM = ARG_ERROR_BASE + 49;\r\n    const int ARG_ERROR_LIVECHANNEL_BAD_CHANNEL_TYPE_PARAM = ARG_ERROR_BASE + 50;\r\n    const int ARG_ERROR_LIVECHANNEL_BAD_FRAGDURATION_PARAM = ARG_ERROR_BASE + 51;\r\n    const int ARG_ERROR_LIVECHANNEL_BAD_FRAGCOUNT_PARAM = ARG_ERROR_BASE + 52;\r\n    const int ARG_ERROR_LIVECHANNEL_BAD_PALYLIST_PARAM = ARG_ERROR_BASE + 53;\r\n    const int ARG_ERROR_LIVECHANNEL_BAD_SNAPSHOT_PARAM = ARG_ERROR_BASE + 54;\r\n    const int ARG_ERROR_LIVECHANNEL_BAD_TIME_PARAM = ARG_ERROR_BASE + 55;\r\n    const int ARG_ERROR_LIVECHANNEL_BAD_MAXKEY_PARAM = ARG_ERROR_BASE + 56;\r\n\r\n    /*SelectObject*/\r\n    const int ARG_ERROR_SELECT_OBJECT_RANGE_INVALID = ARG_ERROR_BASE + 57;\r\n    const int ARG_ERROR_SELECT_OBJECT_LINE_RANGE_INVALID = ARG_ERROR_BASE + 58;\r\n    const int ARG_ERROR_SELECT_OBJECT_SPLIT_RANGE_INVALID = ARG_ERROR_BASE + 59;\r\n    const int ARG_ERROR_SELECT_OBJECT_NOT_SQL_EXPRESSION = ARG_ERROR_BASE + 60;\r\n    const int ARG_ERROR_SELECT_OBJECT_CHECK_SUM_FAILED = ARG_ERROR_BASE + 61;\r\n    const int ARG_ERROR_SELECT_OBJECT_NULL_POINT = ARG_ERROR_BASE + 62;\r\n    const int ARG_ERROR_SELECT_OBJECT_PROCESS_NOT_SAME = ARG_ERROR_BASE + 63;\r\n\r\n    /*CreateSelectObjectMeta*/\r\n    const int ARG_ERROR_CREATE_SELECT_OBJECT_META_NULL_POINT = ARG_ERROR_BASE + 64;\r\n\r\n    /*Tagging*/\r\n    const int ARG_ERROR_TAGGING_TAGS_LIMIT = ARG_ERROR_BASE + 65;\r\n    const int ARG_ERROR_TAGGING_TAG_KEY_LIMIT = ARG_ERROR_BASE + 66;\r\n    const int ARG_ERROR_TAGGING_TAG_VALUE_LIMIT = ARG_ERROR_BASE + 67;\r\n\r\n    /*Resumable for wstring path*/\r\n    const int ARG_ERROR_PATH_NOT_SUPPORT_WSTRING_TYPE = ARG_ERROR_BASE + 68;\r\n    const int ARG_ERROR_PATH_NOT_SAME_TYPE = ARG_ERROR_BASE + 69;\r\n}\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/ObjectCallbackBuilder.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/ObjectCallbackBuilder.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nObjectCallbackBuilder::ObjectCallbackBuilder(const std::string &url, const std::string &body):\n    ObjectCallbackBuilder(url, body, \"\", Type::URL)\n{\n}\n\nObjectCallbackBuilder::ObjectCallbackBuilder(const std::string &url, const std::string &body,\n    const std::string &host, Type type):\n    callbackUrl_(url),\n    callbackHost_(host),\n    callbackBody_(body),\n    callbackBodyType_(type)\n{\n}\n\nstd::string ObjectCallbackBuilder::build()\n{\n    if (callbackUrl_.empty() || callbackBody_.empty())\n    {\n        return \"\";\n    }\n\n    std::stringstream ss;\n    ss << \"{\";\n    ss << \"\\\"callbackUrl\\\":\\\"\" << callbackUrl_ << \"\\\"\";\n    if (!callbackHost_.empty())\n    {\n        ss << \",\\\"callbackHost\\\":\\\"\" << callbackHost_ << \"\\\"\";\n    }\n    ss << \",\\\"callbackBody\\\":\\\"\" << callbackBody_ << \"\\\"\";\n\n    if (callbackBodyType_ == Type::JSON)\n    {\n        ss << \",\\\"callbackBodyType\\\":\\\"\" << \"application/json\" << \"\\\"\";\n    }\n\n    ss << \"}\";\n\n    return Base64Encode(ss.str());\n}\n\n\nbool ObjectCallbackVariableBuilder::addCallbackVariable(const std::string &key, const std::string &value)\n{\n    if (!!key.compare(0, 2 , \"x:\", 2))\n    {\n        return false;\n    }\n    callbackVariable_[key] = value;\n    return true;\n}\n\nstd::string ObjectCallbackVariableBuilder::build()\n{\n    if (callbackVariable_.size() == 0)\n    {\n        return \"\";\n    }\n\n    std::stringstream ss;\n    ss << \"{\";\n    int i = 0;\n    for (auto const& var : callbackVariable_) {\n        if (i > 0) {\n            ss << \",\";\n        }\n        ss << \"\\\"\" << var.first << \"\\\":\\\"\" << var.second << \"\\\"\";\n        i++;\n    }\n    ss << \"}\";\n    return Base64Encode(ss.str());\n}\n"
  },
  {
    "path": "sdk/src/model/ObjectMetaData.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/ObjectMetaData.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n#include \"../utils/Utils.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nstatic const std::string gEmpty = \"\";\r\n\r\nObjectMetaData::ObjectMetaData(const HeaderCollection& data)\r\n{\r\n    *this = data;\r\n}\r\n\r\nObjectMetaData& ObjectMetaData::operator=(const HeaderCollection& data)\r\n{\r\n    for (auto const &header : data) {\r\n        if (!header.first.compare(0, 11, \"x-oss-meta-\", 11))\r\n            userMetaData_[header.first.substr(11)] = header.second;\r\n        else\r\n            metaData_[header.first] = header.second;\r\n    }\r\n\r\n    if (metaData_.find(Http::ETAG) != metaData_.end()) {\r\n        metaData_[Http::ETAG] = TrimQuotes(metaData_.at(Http::ETAG).c_str());\r\n    }\r\n\r\n    return *this;\r\n}\r\n\r\nconst std::string &ObjectMetaData::LastModified() const\r\n{\r\n    if (metaData_.find(Http::LAST_MODIFIED) != metaData_.end()) {\r\n        return metaData_.at(Http::LAST_MODIFIED);\r\n    }\r\n    return gEmpty;\r\n}\r\n\r\nconst std::string &ObjectMetaData::ExpirationTime() const\r\n{\r\n    if (metaData_.find(Http::EXPIRES) != metaData_.end()) {\r\n        return metaData_.at(Http::EXPIRES);\r\n    }\r\n    return gEmpty;\r\n}\r\n\r\nint64_t ObjectMetaData::ContentLength() const\r\n{\r\n    if (metaData_.find(Http::CONTENT_LENGTH) != metaData_.end()) {\r\n        return atoll(metaData_.at(Http::CONTENT_LENGTH).c_str());\r\n    }\r\n    return -1;\r\n}\r\n\r\nconst std::string &ObjectMetaData::ContentType() const\r\n{\r\n    if (metaData_.find(Http::CONTENT_TYPE) != metaData_.end()) {\r\n        return metaData_.at(Http::CONTENT_TYPE);\r\n    }\r\n    return gEmpty;\r\n}\r\n\r\nconst std::string &ObjectMetaData::ContentEncoding() const\r\n{\r\n    if (metaData_.find(Http::CONTENT_ENCODING) != metaData_.end()) {\r\n        return metaData_.at(Http::CONTENT_ENCODING);\r\n    }\r\n    return gEmpty;\r\n}\r\n\r\nconst std::string &ObjectMetaData::CacheControl() const\r\n{\r\n    if (metaData_.find(Http::CACHE_CONTROL) != metaData_.end()) {\r\n        return metaData_.at(Http::CACHE_CONTROL);\r\n    }\r\n    return gEmpty;\r\n}\r\n\r\nconst std::string &ObjectMetaData::ContentDisposition() const\r\n{\r\n    if (metaData_.find(Http::CONTENT_DISPOSITION) != metaData_.end()) {\r\n        return metaData_.at(Http::CONTENT_DISPOSITION);\r\n    }\r\n    return gEmpty;\r\n}\r\n\r\nconst std::string &ObjectMetaData::ETag() const\r\n{\r\n    if (metaData_.find(Http::ETAG) != metaData_.end()) {\r\n        return metaData_.at(Http::ETAG);\r\n    }\r\n    return gEmpty;\r\n}\r\n\r\nconst std::string &ObjectMetaData::ContentMd5() const\r\n{\r\n    if (metaData_.find(Http::CONTENT_MD5) != metaData_.end()) {\r\n        return metaData_.at(Http::CONTENT_MD5);\r\n    }\r\n    return gEmpty;\r\n}\r\n\r\nuint64_t ObjectMetaData::CRC64() const\r\n{\r\n    if (metaData_.find(\"x-oss-hash-crc64ecma\") != metaData_.end()) {\r\n        return std::strtoull(metaData_.at(\"x-oss-hash-crc64ecma\").c_str(), nullptr, 10);\r\n    }\r\n    return 0ULL;\r\n}\r\n\r\nconst std::string &ObjectMetaData::ObjectType() const\r\n{\r\n    if (metaData_.find(\"x-oss-object-type\") != metaData_.end()) {\r\n        return metaData_.at(\"x-oss-object-type\");\r\n    }\r\n    return gEmpty;\r\n}\r\n\r\nconst std::string& ObjectMetaData::VersionId() const\r\n{\r\n    if (metaData_.find(\"x-oss-version-id\") != metaData_.end()) {\r\n        return metaData_.at(\"x-oss-version-id\");\r\n    }\r\n    return gEmpty;\r\n}\r\n\r\nvoid ObjectMetaData::setExpirationTime(const std::string &value)\r\n{\r\n    metaData_[Http::EXPIRES] = value;\r\n}\r\n\r\nvoid ObjectMetaData::setContentLength(int64_t value)\r\n{\r\n    metaData_[Http::CONTENT_LENGTH] = std::to_string(value);\r\n}\r\n\r\nvoid ObjectMetaData::setContentType(const std::string &value)\r\n{\r\n    metaData_[Http::CONTENT_TYPE] = value;\r\n}\r\n\r\nvoid ObjectMetaData::setContentEncoding(const std::string &value)\r\n{\r\n    metaData_[Http::CONTENT_ENCODING] = value;\r\n}\r\n\r\nvoid ObjectMetaData::setCacheControl(const std::string &value)\r\n{\r\n    metaData_[Http::CACHE_CONTROL] = value;\r\n}\r\n\r\nvoid ObjectMetaData::setContentDisposition(const std::string &value)\r\n{\r\n    metaData_[Http::CONTENT_DISPOSITION] = value;\r\n}\r\n\r\nvoid ObjectMetaData::setETag(const std::string &value)\r\n{\r\n    metaData_[Http::ETAG] = value;\r\n}\r\n\r\nvoid ObjectMetaData::setContentMd5(const std::string &value)\r\n{\r\n    metaData_[Http::CONTENT_MD5] = value;\r\n}\r\n\r\nvoid ObjectMetaData::setCrc64(uint64_t value)\r\n{\r\n    metaData_[\"x-oss-hash-crc64ecma\"] = std::to_string(value);\r\n}\r\n\r\nvoid ObjectMetaData::addHeader(const std::string &key, const std::string &value)\r\n{\r\n    metaData_[key] = value;\r\n}\r\n\r\nbool ObjectMetaData::hasHeader(const std::string& key) const\r\n{\r\n    return (metaData_.find(key) != metaData_.end());\r\n}\r\n\r\nvoid ObjectMetaData::removeHeader(const std::string& key)\r\n{\r\n    if (metaData_.find(key) != metaData_.end()) {\r\n        metaData_.erase(key);\r\n    }\r\n}\r\n\r\nMetaData &ObjectMetaData::HttpMetaData()\r\n{\r\n    return metaData_;\r\n}\r\n\r\nconst MetaData &ObjectMetaData::HttpMetaData() const\r\n{\r\n    return metaData_;\r\n}\r\n\r\nvoid ObjectMetaData::addUserHeader(const std::string &key, const std::string &value)\r\n{\r\n    userMetaData_[key] = value;\r\n}\r\n\r\nbool ObjectMetaData::hasUserHeader(const std::string& key) const\r\n{\r\n    return (userMetaData_.find(key) != userMetaData_.end());\r\n}\r\n\r\nvoid ObjectMetaData::removeUserHeader(const std::string& key)\r\n{\r\n    if (userMetaData_.find(key) != userMetaData_.end()) {\r\n        userMetaData_.erase(key);\r\n    }\r\n}\r\n\r\nMetaData &ObjectMetaData::UserMetaData()\r\n{\r\n    return userMetaData_;\r\n}\r\n\r\nconst MetaData &ObjectMetaData::UserMetaData() const\r\n{\r\n    return userMetaData_;\r\n}\r\n\r\nHeaderCollection ObjectMetaData::toHeaderCollection() const\r\n{\r\n    HeaderCollection headers;\r\n    for (auto const&header : metaData_) {\r\n        headers[header.first] = header.second;\r\n    }\r\n\r\n    for (auto const&header : userMetaData_) {\r\n        std::string key(\"x-oss-meta-\");\r\n        key.append(header.first);\r\n        headers[key] = header.second;\r\n    }\r\n    return headers;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/OutputFormat.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/OutputFormat.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nOutputFormat::OutputFormat():\n\tkeepAllColumns_(false), outputRawData_(false),\n\tenablePayloadCrc_(true), outputHeader_(false)\n{}\n\nvoid OutputFormat::setEnablePayloadCrc(bool enablePayloadCrc)\n{\n\tenablePayloadCrc_ = enablePayloadCrc;\n}\n\nvoid OutputFormat::setKeepAllColumns(bool keepAllColumns)\n{\n\tkeepAllColumns_ = keepAllColumns;\n}\n\nvoid OutputFormat::setOutputHeader(bool outputHeader)\n{\n\toutputHeader_ = outputHeader;\n}\n\nvoid OutputFormat::setOutputRawData(bool outputRawData)\n{\n\toutputRawData_ = outputRawData;\n}\n\nbool OutputFormat::OutputRawData() const\n{\n    return outputRawData_;\n}\n\nbool OutputFormat::KeepAllColumns() const\n{\n    return keepAllColumns_;\n}\n\nbool OutputFormat::EnablePayloadCrc() const\n{\n    return enablePayloadCrc_;\n}\n\nbool OutputFormat::OutputHeader() const\n{\n    return outputHeader_;\n}\n\nint OutputFormat::validate() const\n{\n    return 0;\n}\n\n////////////////////////////////////////////////////////////////////////////////////////\n\nCSVOutputFormat::CSVOutputFormat()\n    : CSVOutputFormat(\"\\n\", \",\")\n{}\n\nCSVOutputFormat::CSVOutputFormat(\n    const std::string& recordDelimiter, \n    const std::string& fieldDelimiter)\n    : OutputFormat(), recordDelimiter_(recordDelimiter), fieldDelimiter_(fieldDelimiter)\n{}\n\nvoid CSVOutputFormat::setRecordDelimiter(const std::string& recordDelimiter) \n{\n    recordDelimiter_ = recordDelimiter;\n}\n\nvoid CSVOutputFormat::setFieldDelimiter(const std::string& fieldDelimiter)\n{\n    fieldDelimiter_ = fieldDelimiter;\n}\n\nconst std::string& CSVOutputFormat::FieldDelimiter() const\n{\n    return fieldDelimiter_;\n}\n\nconst std::string& CSVOutputFormat::RecordDelimiter() const\n{\n    return recordDelimiter_;\n}\n\nstd::string CSVOutputFormat::Type() const\n{\n    return \"csv\";\n}\n\nstd::string CSVOutputFormat::toXML() const\n{\n    std::stringstream ss;\n    ss << \"<OutputSerialization>\" << std::endl;\n    ss << \"<CSV>\" << std::endl;\n    ss << \"<RecordDelimiter>\" << Base64Encode(recordDelimiter_) << \"</RecordDelimiter>\" << std::endl;\n    ss << \"<FieldDelimiter>\" << Base64Encode(fieldDelimiter_.empty() ? \"\" : std::string(1, fieldDelimiter_.front())) << \"</FieldDelimiter>\" << std::endl;\n    ss << \"</CSV>\" << std::endl;\n    ss << \"<KeepAllColumns>\" << (OutputFormat::KeepAllColumns() ? \"true\" : \"false\") << \"</KeepAllColumns>\" << std::endl;\n    ss << \"<OutputRawData>\" << (OutputFormat::OutputRawData() ? \"true\" : \"false\") << \"</OutputRawData>\" << std::endl;\n    ss << \"<OutputHeader>\" << (OutputFormat::OutputHeader() ? \"true\" : \"false\") << \"</OutputHeader>\" << std::endl;\n    ss << \"<EnablePayloadCrc>\" << (OutputFormat::EnablePayloadCrc() ? \"true\" : \"false\") << \"</EnablePayloadCrc>\" << std::endl;\n    ss << \"</OutputSerialization>\" << std::endl;\n    return ss.str();\n}\n\n////////////////////////////////////////////////////////////////////////////////////////\n\nJSONOutputFormat::JSONOutputFormat()\n    :JSONOutputFormat(\"\\n\")\n{}\n\nJSONOutputFormat::JSONOutputFormat(const std::string& recordDelimiter)\n    :OutputFormat(), recordDelimiter_(recordDelimiter)\n{}\n\nvoid JSONOutputFormat::setRecordDelimiter(const std::string& recordDelimiter)\n{\n    recordDelimiter_ = recordDelimiter;\n}\n\nconst std::string& JSONOutputFormat::RecordDelimiter() const\n{\n    return recordDelimiter_;\n}\n\nstd::string JSONOutputFormat::Type() const\n{\n    return \"json\";\n}\n\nstd::string JSONOutputFormat::toXML() const\n{\n    std::stringstream ss;\n    ss << \"<OutputSerialization>\" << std::endl;\n    ss << \"<JSON>\" << std::endl;\n    ss << \"<RecordDelimiter>\" << Base64Encode(recordDelimiter_) << \"</RecordDelimiter>\" << std::endl;\n    ss << \"</JSON>\" << std::endl;\n    ss << \"<KeepAllColumns>\" << (OutputFormat::KeepAllColumns() ? \"true\" : \"false\") << \"</KeepAllColumns>\" << std::endl;\n    ss << \"<OutputRawData>\" << (OutputFormat::OutputRawData() ? \"true\" : \"false\") << \"</OutputRawData>\" << std::endl;\n    ss << \"<OutputHeader>\" << (OutputFormat::OutputHeader() ? \"true\" : \"false\") << \"</OutputHeader>\" << std::endl;\n    ss << \"<EnablePayloadCrc>\" << (OutputFormat::EnablePayloadCrc() ? \"true\" : \"false\") << \"</EnablePayloadCrc>\" << std::endl;\n    ss << \"</OutputSerialization>\" << std::endl;\n    return ss.str();\n}\n"
  },
  {
    "path": "sdk/src/model/PostVodPlaylistRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/PostVodPlaylistRequest.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n#include \"Const.h\"\n\n\nusing namespace AlibabaCloud::OSS;\n\nPostVodPlaylistRequest::PostVodPlaylistRequest(const std::string& bucket, \n    const std::string& channelName, const std::string& playlist,\n    uint64_t startTime, uint64_t endTime)\n    :LiveChannelRequest(bucket, channelName), \n    playList_(playlist),\n    startTime_(startTime), \n    endTime_(endTime)\n{\n    key_.append(\"/\").append(playList_);\n}\n\nint PostVodPlaylistRequest::validate() const\n{\n    int ret = LiveChannelRequest::validate();\n\n    if(ret)\n    {\n        return ret;\n    }\n\n    if(!IsValidPlayListName(playList_))\n    {\n        return ARG_ERROR_LIVECHANNEL_BAD_PALYLIST_PARAM;\n    }\n    if(endTime_ <= startTime_ || endTime_ > (startTime_ + SecondsOfDay))\n    {\n        return ARG_ERROR_LIVECHANNEL_BAD_TIME_PARAM;\n    }\n    return 0;\n}\n\nParameterCollection PostVodPlaylistRequest::specialParameters() const\n{\n    ParameterCollection collection;\n    collection[\"vod\"] = \"\";\n    collection[\"endTime\"] = std::to_string(endTime_);\n    collection[\"startTime\"] = std::to_string(startTime_);\n    return collection;\n}\n\nvoid PostVodPlaylistRequest::setPlayList(const std::string &playList)\n{\n    playList_ = playList;\n}\n\nvoid PostVodPlaylistRequest::setStartTime(uint64_t startTime)\n{\n    startTime_ = startTime;\n}\n\nvoid PostVodPlaylistRequest::setEndTime(uint64_t endTime)\n{\n    endTime_ = endTime;\n}\n\n"
  },
  {
    "path": "sdk/src/model/ProcessObjectRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/ProcessObjectRequest.h>\n#include <sstream>\nusing namespace AlibabaCloud::OSS;\n\nProcessObjectRequest::ProcessObjectRequest(const std::string &bucket, const std::string &key):\n    ProcessObjectRequest(bucket, key, \"\")\n{\n}\n\nProcessObjectRequest::ProcessObjectRequest(const std::string &bucket, const std::string &key, const std::string &process) :\n    OssObjectRequest(bucket, key),\n    process_(process)\n{\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\n}\n\n\nvoid ProcessObjectRequest::setProcess(const std::string &process)\n{\n    process_ = process;\n}\n\nParameterCollection ProcessObjectRequest::specialParameters() const\n{\n    auto parameters = OssObjectRequest::specialParameters();\n    parameters[\"x-oss-process\"];\n    return parameters;\n}\n\nstd::string  ProcessObjectRequest::payload() const\n{\n    std::stringstream ss;\n    ss << \"x-oss-process=\" << process_;\n    return ss.str();\n}\n\n\n"
  },
  {
    "path": "sdk/src/model/PutLiveChannelRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/PutLiveChannelRequest.h>\r\n#include <sstream>\r\n#include \"../utils/Utils.h\"\r\n#include \"ModelError.h\"\r\n#include \"Const.h\"\r\n\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nPutLiveChannelRequest::PutLiveChannelRequest(const std::string& bucket, \r\n    const std::string& channelName, const std::string& type)\r\n    :LiveChannelRequest(bucket, channelName), \r\n    channelType_(type),\r\n    playListName_(\"playlist.m3u8\"),\r\n    status_(LiveChannelStatus::EnabledStatus),\r\n    fragDuration_(5),\r\n    fragCount_(3),\r\n    snapshot_(false)\r\n{\r\n}\r\n\r\nvoid PutLiveChannelRequest::setChannelType(const std::string& channelType)\r\n{\r\n    channelType_ = channelType;\r\n}\r\n\r\nvoid PutLiveChannelRequest::setDescripition(const std::string& description)\r\n{\r\n    description_ = description;\r\n}\r\n\r\nvoid PutLiveChannelRequest::setDestBucket(const std::string& destBucket)\r\n{\r\n    destBucket_ = destBucket;\r\n    snapshot_ = true;\r\n}\r\n\r\nvoid PutLiveChannelRequest::setFragCount(uint64_t fragCount)\r\n{\r\n    fragCount_ = fragCount;\r\n}\r\n\r\nvoid PutLiveChannelRequest::setFragDuration(uint64_t fragDuration)\r\n{\r\n    fragDuration_ = fragDuration;\r\n}\r\n\r\nvoid PutLiveChannelRequest::setStatus(LiveChannelStatus status)\r\n{\r\n    status_ = status;\r\n}\r\n\r\nvoid PutLiveChannelRequest::setInterval(uint64_t interval)\r\n{\r\n    interval_ = interval;\r\n    snapshot_ = true;\r\n}\r\n\r\nvoid PutLiveChannelRequest::setNotifyTopic(const std::string& notifyTopic)\r\n{\r\n    notifyTopic_ = notifyTopic;\r\n    snapshot_ = true;\r\n}\r\n\r\nvoid PutLiveChannelRequest::setRoleName(const std::string& roleName)\r\n{\r\n    roleName_ = roleName;\r\n    snapshot_ = true;\r\n}\r\n\r\nvoid PutLiveChannelRequest::setPlayListName(const std::string& playListName)\r\n{\r\n    playListName_ = playListName;\r\n    std::size_t pos = playListName_.find_last_of('.');\r\n    if(pos != std::string::npos)\r\n    {\r\n        std::string suffixStr = playListName_.substr(pos);\r\n        if(ToLower(suffixStr.c_str()) == \".m3u8\")\r\n        {\r\n            std::string prefixStr;\r\n            if(pos > 0)\r\n            {\r\n                prefixStr = playListName_.substr(0, pos);\r\n                playListName_ = prefixStr + \".m3u8\";\r\n            }\r\n        }\r\n    }\r\n}\r\n\r\nint PutLiveChannelRequest::validate() const\r\n{\r\n    int ret = LiveChannelRequest::validate();\r\n\r\n    if(ret)\r\n    {\r\n        return ret;\r\n    }\r\n\r\n    if(!description_.empty() && \r\n        description_.size() > MaxLiveChannelDescriptionLength)\r\n    {\r\n        return ARG_ERROR_LIVECHANNEL_BAD_DESCRIPTION_PARAM;\r\n    }\r\n\r\n    if(status_ != LiveChannelStatus::EnabledStatus && \r\n        status_ != LiveChannelStatus::DisabledStatus)\r\n    {\r\n        return ARG_ERROR_LIVECHANNEL_BAD_STATUS_PARAM;\r\n    }\r\n\r\n    if(channelType_ != \"HLS\")\r\n    {\r\n        return ARG_ERROR_LIVECHANNEL_BAD_CHANNEL_TYPE_PARAM;\r\n    }\r\n\r\n    if(fragDuration_ < MinLiveChannelFragDuration || \r\n        fragDuration_ > MaxLiveChannelFragDuration)\r\n    {\r\n        return ARG_ERROR_LIVECHANNEL_BAD_FRAGDURATION_PARAM;\r\n    }\r\n\r\n    if(fragCount_ < MinLiveChannelFragCount || \r\n        fragCount_ > MaxLiveChannelFragCount)\r\n    {\r\n        return ARG_ERROR_LIVECHANNEL_BAD_FRAGCOUNT_PARAM;\r\n    }\r\n\r\n    if(!IsValidPlayListName(playListName_))\r\n    {\r\n        return ARG_ERROR_LIVECHANNEL_BAD_PALYLIST_PARAM;\r\n    }\r\n\r\n    if(snapshot_)\r\n    {\r\n        if(roleName_.empty() || notifyTopic_.empty() || \r\n            destBucket_.empty() || !IsValidBucketName(bucket_) || \r\n            interval_ < MinLiveChannelInterval ||\r\n            interval_ > MaxLiveChannelInterval)\r\n        {\r\n            return ARG_ERROR_LIVECHANNEL_BAD_SNAPSHOT_PARAM;\r\n        }\r\n    }\r\n    return 0;\r\n}\r\n\r\nstd::string PutLiveChannelRequest::payload() const\r\n{\r\n    std::stringstream ss;\r\n    ss << \"<LiveChannelConfiguration>\" << std::endl;\r\n    ss << \"  <Description>\" << description_ << \"</Description>\" << std::endl;\r\n    ss << \"  <Status>\" << ToLiveChannelStatusName(status_) << \"</Status>\" << std::endl;\r\n    ss << \"  <Target>\" << std::endl;\r\n    ss << \"    <Type>\" << channelType_ << \"</Type>\" << std::endl;\r\n    ss << \"    <FragDuration>\" << std::to_string(fragDuration_) << \"</FragDuration>\" << std::endl;\r\n    ss << \"    <FragCount>\" << std::to_string(fragCount_) << \"</FragCount>\" << std::endl;\r\n    ss << \"    <PlaylistName>\" << playListName_ << \"</PlaylistName>\" << std::endl;\r\n    ss << \"  </Target>\" << std::endl;\r\n    if(snapshot_)\r\n    {\r\n        ss << \"  <Snapshot>\" << std::endl;\r\n        ss << \"    <RoleName>\" << roleName_ << \"</RoleName>\" << std::endl;\r\n        ss << \"    <DestBucket>\" << destBucket_ << \"</DestBucket>\" << std::endl;\r\n        ss << \"    <NotifyTopic>\" << notifyTopic_ << \"</NotifyTopic>\" << std::endl;\r\n        ss << \"    <Interval>\" << std::to_string(interval_) << \"</Interval>\" << std::endl;\r\n        ss << \"  </Snapshot>\" << std::endl;\r\n    }\r\n    ss << \"</LiveChannelConfiguration>\" << std::endl;\r\n    return ss.str();\r\n}\r\n\r\nParameterCollection PutLiveChannelRequest::specialParameters() const\r\n{\r\n    ParameterCollection collection;\r\n    collection[\"live\"] = \"\";\r\n    return collection;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/PutLiveChannelResult.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/PutLiveChannelResult.h>\n#include <tinyxml2/tinyxml2.h>\n#include <alibabacloud/oss/model/Bucket.h>\n#include <alibabacloud/oss/model/Owner.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\nusing namespace tinyxml2;\n\nPutLiveChannelResult::PutLiveChannelResult():\n    OssResult()\n{\n}\n\nPutLiveChannelResult::PutLiveChannelResult(const std::string& result):\n    PutLiveChannelResult()\n{\n    *this = result;\n}\n\nPutLiveChannelResult::PutLiveChannelResult(const std::shared_ptr<std::iostream>& result):\n    PutLiveChannelResult()\n{\n    std::istreambuf_iterator<char> isb(*result.get()), end;\n    std::string str(isb, end);\n    *this = str;\n}\n\nPutLiveChannelResult& PutLiveChannelResult::operator =(const std::string& result)\n{\n    XMLDocument doc;\n    XMLError xml_err;\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\n        XMLElement* root =doc.RootElement();\n        if (root && !std::strncmp(\"CreateLiveChannelResult\", root->Name(), 23)) {\n            XMLElement *node;\n            \n            XMLElement* publishNode = root->FirstChildElement(\"PublishUrls\");\n            if(publishNode && (node = publishNode->FirstChildElement(\"Url\"))){\n                publishUrl_ = node->GetText();\n            }\n\n            XMLElement* playNode = root->FirstChildElement(\"PlayUrls\");\n            if(playNode && (node = playNode->FirstChildElement(\"Url\"))){\n                playUrl_ = node->GetText();\n            }\n        }\n        parseDone_ = true;\n    }\n    return *this;\n}\n\nconst std::string& PutLiveChannelResult::PublishUrl() const\n{\n    return publishUrl_;\n}\n\nconst std::string& PutLiveChannelResult::PlayUrl() const\n{\n    return playUrl_;\n}\n\n"
  },
  {
    "path": "sdk/src/model/PutLiveChannelStatusRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/PutLiveChannelStatusRequest.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nPutLiveChannelStatusRequest::PutLiveChannelStatusRequest(const std::string& bucket, const std::string& channelName)\n    :LiveChannelRequest(bucket, channelName),\n    status_(LiveChannelStatus::EnabledStatus)\n{\n\n}\n\nPutLiveChannelStatusRequest::PutLiveChannelStatusRequest(const std::string& bucket, \n    const std::string& channelName, LiveChannelStatus status)\n    :LiveChannelRequest(bucket, channelName),\n    status_(status)\n{\n\n}\n\nParameterCollection PutLiveChannelStatusRequest::specialParameters() const\n{\n    ParameterCollection collection;\n    collection[\"live\"] = \"\";\n    collection[\"status\"] = ToLiveChannelStatusName(status_);\n    return collection;\n}\n\nvoid PutLiveChannelStatusRequest::setStatus(LiveChannelStatus status)\n{\n    status_ = status;\n}\n\nint PutLiveChannelStatusRequest::validate() const\n{\n    int ret = LiveChannelRequest::validate();\n    \n    if (ret)\n    {\n        return ret;\n    }\n\n    if(status_ != LiveChannelStatus::EnabledStatus &&\n        status_ != LiveChannelStatus::DisabledStatus)\n    {\n        return ARG_ERROR_LIVECHANNEL_BAD_STATUS_PARAM;\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "sdk/src/model/PutObjectByUrlRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/PutObjectByUrlRequest.h>\n#include <sstream>\n#include <iostream>\n\nusing namespace AlibabaCloud::OSS;\n\nPutObjectByUrlRequest::PutObjectByUrlRequest(\n    const std::string &url,\n    const std::shared_ptr<std::iostream> &content) :\n    PutObjectByUrlRequest(url, content, ObjectMetaData())\n{\n}\n\nPutObjectByUrlRequest::PutObjectByUrlRequest(\n    const std::string &url,\n    const std::shared_ptr<std::iostream> &content,\n    const ObjectMetaData &metaData) :\n    ServiceRequest(),\n    content_(content),\n    metaData_(metaData)\n{\n    setPath(url);\n    setFlags(Flags()|REQUEST_FLAG_PARAM_IN_PATH|REQUEST_FLAG_CHECK_CRC64);\n}\n\nHeaderCollection PutObjectByUrlRequest::Headers() const\n{\n    auto headers = metaData_.toHeaderCollection();\n    if (headers.find(Http::DATE) == headers.end()) {\n        headers[Http::DATE] = \"\";\n    }\n    return headers;\n}\n\nParameterCollection PutObjectByUrlRequest::Parameters() const\n{\n    return ParameterCollection();\n}\n\nstd::shared_ptr<std::iostream> PutObjectByUrlRequest::Body() const\n{\n    return content_;\n}\n"
  },
  {
    "path": "sdk/src/model/PutObjectRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/PutObjectRequest.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n#include \"../utils/Utils.h\"\r\n#include \"ModelError.h\"\r\n#include <sstream>\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nPutObjectRequest::PutObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::shared_ptr<std::iostream> &content) :\r\n    OssObjectRequest(bucket, key),\r\n    content_(content)\r\n{\r\n    setFlags(Flags() | REQUEST_FLAG_CHECK_CRC64 | REQUEST_FLAG_CHUNKED_ENCODING);\r\n}\r\n\r\nPutObjectRequest::PutObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::shared_ptr<std::iostream> &content, const ObjectMetaData &metaData) :\r\n    OssObjectRequest(bucket, key),\r\n    content_(content),\r\n    metaData_(metaData)\r\n{\r\n    setFlags(Flags() | REQUEST_FLAG_CHECK_CRC64 | REQUEST_FLAG_CHUNKED_ENCODING);\r\n}\r\n\r\nvoid PutObjectRequest::setCacheControl(const std::string &value)\r\n{\r\n    metaData_.addHeader(Http::CACHE_CONTROL, value);\r\n}\r\n\r\nvoid PutObjectRequest::setContentDisposition(const std::string &value)\r\n{\r\n    metaData_.addHeader(Http::CONTENT_DISPOSITION, value);\r\n}\r\n\r\nvoid PutObjectRequest::setContentEncoding(const std::string &value)\r\n{\r\n    metaData_.addHeader(Http::CONTENT_ENCODING, value);\r\n}\r\n\r\nvoid PutObjectRequest::setContentMd5(const std::string &value)\r\n{\r\n    metaData_.addHeader(Http::CONTENT_MD5, value);\r\n}\r\n\r\nvoid PutObjectRequest::setExpires(const std::string &value)\r\n{\r\n    metaData_.addHeader(Http::EXPIRES, value);\r\n}\r\n\r\nvoid PutObjectRequest::setCallback(const std::string& callback, const std::string& callbackVar)\r\n{\r\n    metaData_.removeHeader(\"x-oss-callback\");\r\n    metaData_.removeHeader(\"x-oss-callback-var\");\r\n\r\n    if (!callback.empty()) {\r\n        metaData_.addHeader(\"x-oss-callback\", callback);\r\n    }\r\n\r\n    if (!callbackVar.empty()) {\r\n        metaData_.addHeader(\"x-oss-callback-var\", callbackVar);\r\n    }\r\n}\r\n\r\nvoid PutObjectRequest::setTagging(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-tagging\", value);\r\n}\r\n\r\nvoid PutObjectRequest::setTrafficLimit(uint64_t value)\r\n{\r\n    metaData_.addHeader(\"x-oss-traffic-limit\", std::to_string(value));\r\n}\r\n\r\nObjectMetaData &PutObjectRequest::MetaData()\r\n{\r\n    return metaData_;\r\n}\r\n\r\nstd::shared_ptr<std::iostream> PutObjectRequest::Body() const\r\n{\r\n    return content_;\r\n}\r\n\r\nHeaderCollection PutObjectRequest::specialHeaders() const\r\n{\r\n    auto headers = metaData_.toHeaderCollection();\r\n\r\n    if (headers.find(Http::CONTENT_TYPE) == headers.end()) {\r\n        headers[Http::CONTENT_TYPE] = LookupMimeType(Key());\r\n    }\r\n\r\n    auto baseHeaders = OssObjectRequest::specialHeaders();\r\n    headers.insert(baseHeaders.begin(), baseHeaders.end());\r\n\r\n    return headers;\r\n}\r\n\r\nint PutObjectRequest::validate() const\r\n{\r\n    int ret = OssObjectRequest::validate();\r\n    if (ret != 0) {\r\n        return ret;\r\n    }\r\n\r\n    if (content_ == nullptr) {\r\n        return ARG_ERROR_REQUEST_BODY_NULLPTR;\r\n    }\r\n\r\n    if (content_->bad()) {\r\n        return ARG_ERROR_REQUEST_BODY_BAD_STATE;\r\n    }\r\n\r\n    if (content_->fail()) {\r\n        return ARG_ERROR_REQUEST_BODY_FAIL_STATE;\r\n    }\r\n\r\n    return 0;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/PutObjectResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/PutObjectResult.h>\r\n#include \"../utils/Utils.h\"\r\n#include <alibabacloud/oss/http/HttpType.h>\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nPutObjectResult::PutObjectResult():\r\n    OssObjectResult(),\r\n    content_(nullptr)\r\n{\r\n}\r\n\r\nPutObjectResult::PutObjectResult(const HeaderCollection& header, const std::shared_ptr<std::iostream>& content):\r\n    OssObjectResult(header)\r\n{\r\n    if (header.find(Http::ETAG) != header.end())\r\n    {\r\n        eTag_ = TrimQuotes(header.at(Http::ETAG).c_str());\r\n    }\r\n\r\n    if (header.find(\"x-oss-hash-crc64ecma\") != header.end()) {\r\n        crc64_ = std::strtoull(header.at(\"x-oss-hash-crc64ecma\").c_str(), nullptr, 10);\r\n    }\r\n\r\n    if (content != nullptr && content->peek() != EOF) {\r\n        content_ = content;\r\n    }\r\n}\r\n\r\nPutObjectResult::PutObjectResult(const HeaderCollection & header):\r\n    PutObjectResult(header, nullptr)\r\n{\r\n}\r\n\r\nconst std::string& PutObjectResult::ETag() const\r\n{\r\n    return eTag_;\r\n}\r\n\r\nuint64_t PutObjectResult::CRC64() \r\n{\r\n    return crc64_;\r\n}\r\n\r\nconst std::shared_ptr<std::iostream>& PutObjectResult::Content() const\r\n{\r\n    return content_;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/RestoreObjectRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/RestoreObjectRequest.h>\n#include <../utils/Utils.h>\r\n#include <sstream>\r\n\nusing namespace AlibabaCloud::OSS;\n\nRestoreObjectRequest::RestoreObjectRequest(const std::string &bucket, const std::string &key)\n    :OssObjectRequest(bucket,key),\n    days_(1U),\n    tierTypeIsSet_(false)\n{\n}\n\nvoid RestoreObjectRequest::setDays(uint32_t days)\n{\n    days_ = days;\n}\n\nvoid RestoreObjectRequest::setTierType(TierType type)\n{\n    tierType_ = type;\n    tierTypeIsSet_ = true;\n}\n\nstd::string RestoreObjectRequest::payload() const\n{\n    std::stringstream ss;\n    if (tierTypeIsSet_) {\n        ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\n        ss << \"<RestoreRequest>\" << std::endl;\n        ss << \"<Days>\" << std::to_string(days_) << \"</Days>\" << std::endl;\n        ss << \"<JobParameters><Tier>\" << ToTierTypeName(tierType_) << \"</Tier></JobParameters>\" << std::endl;\n        ss << \"</RestoreRequest>\" << std::endl;\n    }\n    return ss.str();\n}\n\nParameterCollection RestoreObjectRequest::specialParameters() const\n{\n    auto parameters = OssObjectRequest::specialParameters();\n    parameters[\"restore\"]=\"\";\n    return parameters;\n}\n\n"
  },
  {
    "path": "sdk/src/model/RestoreObjectResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/RestoreObjectResult.h>\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nRestoreObjectResult::RestoreObjectResult():\r\n    OssObjectResult()\r\n{\r\n}\r\n\r\nRestoreObjectResult::RestoreObjectResult(const HeaderCollection& header):\r\n    OssObjectResult(header)\r\n{\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/SelectObjectRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/SelectObjectRequest.h>\n#include <iostream>\n#include <sstream>\n#include <cstring>\n#include \"ModelError.h\"\n#include \"../utils/Utils.h\"\n#include \"../utils/LogUtils.h\"\n#include \"../utils/Crc32.h\"\n#include \"../utils/StreamBuf.h\"\n\n#define FRAME_HEADER_LEN   (12+8)\n\nusing namespace AlibabaCloud::OSS;\n\n\nstruct SelectObjectFrame {\n    int frame_type;\n    int init_crc32;\n    int32_t header_len;\n    int32_t tail_len;\n    int32_t payload_remains;\n    uint8_t tail[4];\n    uint8_t header[FRAME_HEADER_LEN];\n    uint8_t end_frame[256];\n    uint32_t end_frame_size;\n    uint32_t payload_crc32;\n};\n\n\nclass SelectObjectStreamBuf : public StreamBufProxy\n{\npublic:\n    SelectObjectStreamBuf(std::iostream& stream, int initCrc32) :\n        StreamBufProxy(stream), \n        lastStatus_(0)\n    {\n        // init frame\n        frame_.init_crc32 = initCrc32;\n        frame_.header_len = 0;\n        frame_.tail_len = 0;\n        frame_.payload_remains = 0;\n        frame_.end_frame_size = 0;\n    };\n\n    int LastStatus()\n    {\n        return lastStatus_;\n    }\n\nprotected:\n    int selectObjectDepackFrame(const char *ptr, int len, int *frame_type, int *payload_len, char **payload_buf, SelectObjectFrame *frame)\n    {\n        int remain = len;\n        //Version | Frame - Type | Payload Length | Header Checksum | Payload | Payload Checksum\n        //<1 byte> <--3 bytes-->   <-- 4 bytes --> <------4 bytes--> <variable><----4bytes------>\n        //Payload \n        //<offset | data>\n        //<8 types><variable>\n\n        // header\n        if (frame->header_len < FRAME_HEADER_LEN) {\n            int copy = FRAME_HEADER_LEN - frame->header_len;\n            copy = ((remain > copy) ? copy : remain);\n            memcpy(frame->header + frame->header_len, ptr, copy);\n            frame->header_len += copy;\n            ptr += copy;\n            remain -= copy;\n\n            // if deal with header done\n            if (frame->header_len == FRAME_HEADER_LEN) {\n                uint32_t payload_length;\n                // calculation payload length\n                payload_length = frame->header[4];\n                payload_length = (payload_length << 8) | frame->header[5];\n                payload_length = (payload_length << 8) | frame->header[6];\n                payload_length = (payload_length << 8) | frame->header[7];\n                frame->payload_remains = payload_length - 8;\n                frame->payload_crc32 = CRC32::CalcCRC(frame->init_crc32, frame->header + 12, 8);\n            }\n        }\n\n        // payload\n        if (frame->payload_remains > 0) {\n            int copy = (frame->payload_remains > remain) ? remain : frame->payload_remains;\n            uint32_t type;\n            type = frame->header[1];\n            type = (type << 8) | frame->header[2];\n            type = (type << 8) | frame->header[3];\n            *frame_type = type;\n            *payload_len = copy;\n            *payload_buf = (char *)ptr;\n            remain -= copy;\n            frame->payload_remains -= copy;\n            frame->payload_crc32 = CRC32::CalcCRC(frame->payload_crc32, ptr, copy);\n            return len - remain;\n        }\n\n        // tail\n        if (frame->tail_len < 4) {\n            int copy = 4 - frame->tail_len;\n            copy = (copy > remain ? remain : copy);\n            memcpy(frame->tail + frame->tail_len, ptr, copy);\n            frame->tail_len += copy;\n            remain -= copy;\n            *frame_type = 0;\n        }\n\n        return len - remain;\n    }\n\n    int selectObjectTransferContent(SelectObjectFrame *frame, const char *ptr, int wanted) {\n        int remain = wanted;\n        char *payload_buf;\n        // the actual length of the write\n        int result = 0;\n        // deal with the whole buffer\n        while (remain > 0) {\n            int  frame_type = 0, payload_len = 0;\n            int ret = selectObjectDepackFrame(ptr, remain, &frame_type, &payload_len, &payload_buf, frame);\n            switch (frame_type)\n            {\n            case 0x800001:\n                int temp;\n                temp = static_cast<int>(StreamBufProxy::xsputn(payload_buf, payload_len));\n                if (temp < 0) {\n                    return temp;\n                }\n                result += temp;\n                break;\n            case 0x800004: //Continuous Frame\n                break;\n            case 0x800005: //Select object End Frame\n            {\n                int32_t copy = sizeof(frame->end_frame) - frame->end_frame_size;\n                copy = (copy > payload_len) ? payload_len : copy;\n                if (copy > 0) {\n                    memcpy(frame->end_frame + frame->end_frame_size, ptr, copy);\n                    frame->end_frame_size += copy;\n                }\n            }\n            break;\n            default:\n                // get payload checksum\n                if (frame->tail_len == 4) {\n                    // compare check sum\n                    uint32_t payload_crc32;\n                    payload_crc32 = frame->tail[0];\n                    payload_crc32 = (payload_crc32 << 8) | frame->tail[1];\n                    payload_crc32 = (payload_crc32 << 8) | frame->tail[2];\n                    payload_crc32 = (payload_crc32 << 8) | frame->tail[3];\n                    if (payload_crc32 != 0 && payload_crc32 != frame->payload_crc32) {\n                        // CRC32 Checksum failed\n                        return -1;\n                    }\n\n                    // reset to get next frame\n                    frame->header_len = 0;\n                    frame->tail_len = 0;\n                    frame->payload_remains = 0;\n                    frame->end_frame_size = 0;\n                }\n                break;\n            }\n            ptr += ret;\n            remain -= ret;\n        }\n        return result;\n    }\n\n    std::streamsize xsputn(const char *ptr, std::streamsize count)\n    {\n        int result = selectObjectTransferContent(&frame_, ptr, static_cast<int>(count));\n        if (result < 0) {\n            if (result == -1) {\n                lastStatus_ = ARG_ERROR_SELECT_OBJECT_CHECK_SUM_FAILED;\n            }\n            return static_cast<std::streamsize>(result);\n        }\n        return count;\n    }\n\nprivate:\n    SelectObjectFrame frame_;\n    int lastStatus_;\n};\n\n/////////////////////////////////////////////////////////////\n\nSelectObjectRequest::SelectObjectRequest(const std::string& bucket, const std::string& key) :\n    GetObjectRequest(bucket, key),\n    expressionType_(ExpressionType::SQL),\n    skipPartialDataRecord_(false),\n    maxSkippedRecordsAllowed_(0),\n    inputFormat_(nullptr),\n    outputFormat_(nullptr),\n    streamBuffer_(nullptr),\n    upperContent_(nullptr)\n{\n    setResponseStreamFactory(ResponseStreamFactory());\n\n    // close CRC Checksum\n    int flag = Flags();\n    flag |= REQUEST_FLAG_CONTENTMD5;\n    flag &= ~REQUEST_FLAG_CHECK_CRC64;\n    setFlags(flag);\n}\n\nvoid SelectObjectRequest::setResponseStreamFactory(const IOStreamFactory& factory)\n{\n    upperResponseStreamFactory_ = factory;\n    ServiceRequest::setResponseStreamFactory([this]() {\n        streamBuffer_ = nullptr;\n        auto content = upperResponseStreamFactory_();\n        if (!outputFormat_->OutputRawData()) {\n            int initCrc32 = 0;\n#ifdef ENABLE_OSS_TEST\n            if (!!(Flags() & 0x20000000)) {\n                const char* TAG = \"SelectObjectClient\";\n                OSS_LOG(LogLevel::LogDebug, TAG, \"Payload checksum fail.\");\n                initCrc32 = 1;\n            }\n#endif // ENABLE_OSS_TEST\n            streamBuffer_ = std::make_shared<SelectObjectStreamBuf>(*content, initCrc32);\n        }\n        upperContent_ = content;\n        return content;\n    });\n}\n\nuint64_t SelectObjectRequest::MaxSkippedRecordsAllowed() const\n{\n    return maxSkippedRecordsAllowed_;\n}\n\nvoid SelectObjectRequest::setSkippedRecords(bool skipPartialDataRecord, uint64_t maxSkippedRecords)\n{\n    skipPartialDataRecord_ = skipPartialDataRecord;\n    maxSkippedRecordsAllowed_ = maxSkippedRecords;\n}\n\nvoid SelectObjectRequest::setExpression(const std::string& expression, ExpressionType type)\n{\n    expressionType_ = type;\n    expression_ = expression;\n}\n\nvoid SelectObjectRequest::setInputFormat(InputFormat& inputFormat)\n{\n    inputFormat_ = &inputFormat;\n}\n\nvoid SelectObjectRequest::setOutputFormat(OutputFormat& OutputFormat)\n{\n    outputFormat_ = &OutputFormat;\n}\n\nint SelectObjectRequest::validate() const\n{\n    int ret = GetObjectRequest::validate();\n    if (ret != 0) {\n        return ret;\n    }\n\n    if (expressionType_ != ExpressionType::SQL) {\n        return ARG_ERROR_SELECT_OBJECT_NOT_SQL_EXPRESSION;\n    }\n    if (inputFormat_ == nullptr || outputFormat_ == nullptr) {\n        return ARG_ERROR_SELECT_OBJECT_NULL_POINT;\n    }\n\n    ret = inputFormat_->validate();\n    if (ret != 0) {\n        return ret;\n    }\n    ret = outputFormat_->validate();\n    if (ret != 0) {\n        return ret;\n    }\n    // check type\n    if (inputFormat_->Type() != outputFormat_->Type()) {\n        return ARG_ERROR_SELECT_OBJECT_PROCESS_NOT_SAME;\n    }\n    return 0;\n}\n\nstd::string SelectObjectRequest::payload() const\n{\n    std::stringstream ss;\n    ss << \"<SelectRequest>\" << std::endl;\n    // Expression\n    ss << \"<Expression>\" << Base64Encode(expression_) << \"</Expression>\" << std::endl;\n    // input format\n    ss << inputFormat_->toXML(1) << std::endl;\n    // output format\n    ss << outputFormat_->toXML() << std::endl;\n    // options\n    ss << \"<Options>\" << std::endl;\n    ss << \"<SkipPartialDataRecord>\" << (skipPartialDataRecord_ ? \"true\" : \"false\") << \"</SkipPartialDataRecord>\" << std::endl;\n    ss << \"<MaxSkippedRecordsAllowed>\" << std::to_string(MaxSkippedRecordsAllowed()) << \"</MaxSkippedRecordsAllowed>\" << std::endl;\n    ss << \"</Options>\" << std::endl;\n    ss << \"</SelectRequest>\" << std::endl;\n    return ss.str();\n}\n\nint SelectObjectRequest::dispose() const\n{\n    int ret = 0;\n    if (streamBuffer_ != nullptr) {\n        auto buf = std::static_pointer_cast<SelectObjectStreamBuf>(streamBuffer_);\n        ret = buf->LastStatus();\n        streamBuffer_ = nullptr;\n    }\n    upperContent_ = nullptr;\n    return ret;\n}\n\nParameterCollection SelectObjectRequest::specialParameters() const\n{\n    auto parameters = GetObjectRequest::specialParameters();\n    if (inputFormat_) {\n        auto type = inputFormat_->Type();\n        type.append(\"/select\");\n        parameters[\"x-oss-process\"] = type;\n    }\n    return parameters;\n}\n"
  },
  {
    "path": "sdk/src/model/SetBucketAclRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/SetBucketAclRequest.h>\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\n\nSetBucketAclRequest::SetBucketAclRequest(const std::string &bucket, CannedAccessControlList acl) :\n    OssBucketRequest(bucket),\n    acl_(acl)\n{\n}\n\nvoid SetBucketAclRequest::setAcl(CannedAccessControlList acl)\n{\n    acl_ = acl;\n}\n\nHeaderCollection SetBucketAclRequest::specialHeaders() const\n{\n    HeaderCollection headers;\n    if (acl_ < CannedAccessControlList::Default) {\n        headers[\"x-oss-acl\"] = ToAclName(acl_);\n    }\n    return headers;\n}\n\nParameterCollection SetBucketAclRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"acl\"] = \"\";\n    return parameters;\n}\n\n"
  },
  {
    "path": "sdk/src/model/SetBucketCorsRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/SetBucketCorsRequest.h>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n#include <sstream>\n#include <set>\n#include <alibabacloud/oss/Const.h>\n\nusing namespace AlibabaCloud::OSS;\n\nSetBucketCorsRequest::SetBucketCorsRequest(const std::string &bucket) :\n    OssBucketRequest(bucket)\n{\n}\n\nvoid SetBucketCorsRequest::addCORSRule(const CORSRule &rule)\n{\n    ruleList_.push_back(rule);\n}\n\nvoid SetBucketCorsRequest::setCORSRules(const CORSRuleList &rules)\n{\n    ruleList_ = rules;\n}\n\nstd::string SetBucketCorsRequest::payload() const\n{\n    std::stringstream ss;\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\n    ss << \"<CORSConfiguration>\" << std::endl;\n    for (const auto &rule : ruleList_)\n    {\n        ss << \"  <CORSRule>\" << std::endl;\n        for (const auto &origin : rule.AllowedOrigins())\n            ss << \"    <AllowedOrigin>\" << origin << \"</AllowedOrigin>\" << std::endl;\n\n        for (const auto &method : rule.AllowedMethods())\n            ss << \"    <AllowedMethod>\" << method << \"</AllowedMethod>\" << std::endl;\n\n        for (const auto &header : rule.AllowedHeaders())\n            ss << \"    <AllowedHeader>\" << header << \"</AllowedHeader>\" << std::endl;\n\n        for (const auto &header : rule.ExposeHeaders())\n            ss << \"    <ExposeHeader>\" << header << \"</ExposeHeader>\" << std::endl;\n\n        if (rule.MaxAgeSeconds() > 0)\n            ss << \"    <MaxAgeSeconds>\" << std::to_string(rule.MaxAgeSeconds()) << \"</MaxAgeSeconds>\" << std::endl;\n        ss << \"  </CORSRule>\" << std::endl;\n    }\n    ss << \"</CORSConfiguration>\" << std::endl;\n    return ss.str();\n}\n\nParameterCollection SetBucketCorsRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"cors\"] = \"\";\n    return parameters;\n}\n\nstatic int CountOfAsterisk(const CORSAllowedList &items)\n{\n    int count = 0;\n    for (auto const&item : items) {\n        count += item.compare(\"*\") ? 0 : 1;\n    }\n    return count;\n}\n\nstatic bool InAllowedMethods(const CORSAllowedList &items)\n{\n    static std::set<std::string> allowedMethods =\n    {\n        \"GET\" , \"PUT\" , \"DELETE\", \"POST\", \"HEAD\"\n    };\n\n    //if (items.empty())\n    //    return false;\n\n    for (auto const&item : items) {\n        if (allowedMethods.find(Trim(item.c_str())) == allowedMethods.end()) {\n            return false;\n        }\n    }\n    return true;\n}\n\nint SetBucketCorsRequest::validate() const\n{\n    int ret = OssBucketRequest::validate();\n    if (ret) return ret;\n\n    if (ruleList_.size() > BucketCorsRuleLimit)\n        return ARG_ERROR_CORS_RULE_LIMIT;\n\n    for (auto const &rule : ruleList_) {\n\n        if (rule.AllowedOrigins().empty())\n            return ARG_ERROR_CORS_ALLOWEDORIGINS_EMPTY;\n\n        if (CountOfAsterisk(rule.AllowedOrigins()) > 1)\n            return ARG_ERROR_CORS_ALLOWEDORIGINS_ASTERISK_COUNT;\n\n        if (rule.AllowedMethods().empty())\n            return ARG_ERROR_CORS_ALLOWEDMETHODS_EMPTY;\n\n        if (!InAllowedMethods(rule.AllowedMethods()))\n            return ARG_ERROR_CORS_ALLOWEDMETHODS_VALUE;\n\n        if (CountOfAsterisk(rule.AllowedHeaders()) > 1)\n            return ARG_ERROR_CORS_ALLOWEDHEADERS_ASTERISK_COUNT;\n\n        if (CountOfAsterisk(rule.ExposeHeaders()) > 0)\n            return ARG_ERROR_CORS_EXPOSEHEADERS_ASTERISK_COUNT;\n\n        if ((rule.MaxAgeSeconds() != CORSRule::UNSET_AGE_SEC) &&\n            (rule.MaxAgeSeconds() < 0 || rule.MaxAgeSeconds() > 999999999)) {\n            return ARG_ERROR_CORS_MAXAGESECONDS_RANGE;\n        }\n    }\n\n    return 0;\n}\n\n"
  },
  {
    "path": "sdk/src/model/SetBucketEncryptionRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/SetBucketEncryptionRequest.h>\n#include \"../utils/Utils.h\"\n#include <sstream>\n\nusing namespace AlibabaCloud::OSS;\n\n\nSetBucketEncryptionRequest::SetBucketEncryptionRequest(const std::string& bucket, SSEAlgorithm sse, const std::string& key):\n    OssBucketRequest(bucket),\n    SSEAlgorithm_(sse),\n    KMSMasterKeyID_(key)\n{\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\n}\n\nvoid SetBucketEncryptionRequest::setSSEAlgorithm(SSEAlgorithm sse)\n{\n    SSEAlgorithm_ = sse;\n}\n\nvoid SetBucketEncryptionRequest::setKMSMasterKeyID(const std::string& key)\n{\n    KMSMasterKeyID_ = key;\n}\n\nParameterCollection SetBucketEncryptionRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"encryption\"] = \"\";\n    return parameters;\n}\n\nstd::string SetBucketEncryptionRequest::payload() const\n{\n    std::stringstream ss;\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\n    ss << \"<ServerSideEncryptionRule>\" << std::endl;\n    ss << \"  <ApplyServerSideEncryptionByDefault>\" << std::endl; \n    ss << \"<SSEAlgorithm>\" << ToSSEAlgorithmName(SSEAlgorithm_) << \"</SSEAlgorithm>\" << std::endl;\n    ss << \"<KMSMasterKeyID>\" << KMSMasterKeyID_ << \"</KMSMasterKeyID>\" << std::endl;\n    ss << \"</ApplyServerSideEncryptionByDefault>\" << std::endl;\n    ss << \"</ServerSideEncryptionRule>\" << std::endl;\n    return ss.str();\n}\n\n"
  },
  {
    "path": "sdk/src/model/SetBucketInventoryConfigurationRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/SetBucketInventoryConfigurationRequest.h>\n#include \"../utils/Utils.h\"\n#include <sstream>\n\nusing namespace AlibabaCloud::OSS;\n\nSetBucketInventoryConfigurationRequest::SetBucketInventoryConfigurationRequest(const std::string& bucket) :\n    SetBucketInventoryConfigurationRequest(bucket, InventoryConfiguration())\n{\n}\n\nSetBucketInventoryConfigurationRequest::SetBucketInventoryConfigurationRequest(const std::string& bucket, const InventoryConfiguration& conf) :\n    OssBucketRequest(bucket),\n    inventoryConfiguration_(conf)\n{\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\n}\n\nvoid SetBucketInventoryConfigurationRequest::setInventoryConfiguration(InventoryConfiguration conf)\n{\n    inventoryConfiguration_ = conf;\n}\n\nParameterCollection SetBucketInventoryConfigurationRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"inventory\"] = \"\";\n    parameters[\"inventoryId\"] = inventoryConfiguration_.Id();\n    return parameters;\n}\n\nstd::string SetBucketInventoryConfigurationRequest::payload() const\n{\n    std::stringstream ss;\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\n    ss << \"<InventoryConfiguration>\" << std::endl;\n    ss << \"  <Id>\" << inventoryConfiguration_.Id() << \"</Id>\" << std::endl;\n    ss << \"  <IsEnabled>\" << (inventoryConfiguration_.IsEnabled() ? \"true\" : \"false\") << \"</IsEnabled>\" << std::endl;\n\n    if (!inventoryConfiguration_.Filter().Prefix().empty()) {\n    ss << \"  <Filter>\" << std::endl;\n    ss << \"    <Prefix>\" << inventoryConfiguration_.Filter().Prefix() << \"</Prefix>\" << std::endl;\n    ss << \"  </Filter>\" << std::endl;\n    }\n\n    bool hasEncryption = inventoryConfiguration_.Destination().OSSBucketDestination().Encryption().hasSSEKMS() ||\n        inventoryConfiguration_.Destination().OSSBucketDestination().Encryption().hasSSEOSS();\n\n    ss << \"  <Destination>\" << std::endl;\n    ss << \"    <OSSBucketDestination>\" << std::endl;\n    ss << \"      <Format>\" << ToInventoryFormatName(inventoryConfiguration_.Destination().OSSBucketDestination().Format()) << \"</Format>\" << std::endl;\n    ss << \"      <AccountId>\" << inventoryConfiguration_.Destination().OSSBucketDestination().AccountId() << \"</AccountId>\" << std::endl;\n    ss << \"      <RoleArn>\" << inventoryConfiguration_.Destination().OSSBucketDestination().RoleArn() << \"</RoleArn>\" << std::endl;\n    ss << \"      <Bucket>\" << ToInventoryBucketFullName(inventoryConfiguration_.Destination().OSSBucketDestination().Bucket()) << \"</Bucket>\" << std::endl;\n    ss << \"      <Prefix>\" << inventoryConfiguration_.Destination().OSSBucketDestination().Prefix() << \"</Prefix>\" << std::endl;\n    if (hasEncryption) {\n    ss << \"      <Encryption>\" << std::endl;\n    if (inventoryConfiguration_.Destination().OSSBucketDestination().Encryption().hasSSEKMS()) {\n    ss << \"        <SSE-KMS>\" << std::endl;\n    ss << \"          <KeyId>\" << inventoryConfiguration_.Destination().OSSBucketDestination().Encryption().SSEKMS().KeyId() << \"</KeyId>\" << std::endl;\n    ss << \"        </SSE-KMS>\" << std::endl;\n    }\n    if (inventoryConfiguration_.Destination().OSSBucketDestination().Encryption().hasSSEOSS()) {\n        ss << \"        <SSE-OSS>\" << std::endl;\n        ss << \"        </SSE-OSS>\" << std::endl;\n    }\n    ss << \"      </Encryption>\" << std::endl;\n    }\n    ss << \"    </OSSBucketDestination>\" << std::endl;\n    ss << \"  </Destination>\" << std::endl;\n\n    ss << \"  <Schedule>\" << std::endl;\n    ss << \"    <Frequency>\" << ToInventoryFrequencyName(inventoryConfiguration_.Schedule()) << \"</Frequency>\" << std::endl;\n    ss << \"  </Schedule>\" << std::endl;\n    ss << \"  <IncludedObjectVersions>\" << ToInventoryIncludedObjectVersionsName(inventoryConfiguration_.IncludedObjectVersions()) << \"</IncludedObjectVersions>\" << std::endl;\n\n    if (!inventoryConfiguration_.OptionalFields().empty()) {\n    ss << \"  <OptionalFields>\" << std::endl;\n    for (const auto& field : inventoryConfiguration_.OptionalFields()) {\n    ss << \"    <Field>\" << ToInventoryOptionalFieldName(field) << \"</Field>\" << std::endl;\n    }\n    ss << \"  </OptionalFields>\" << std::endl;\n    }\n\n    ss << \"</InventoryConfiguration>\" << std::endl;\n    return ss.str();\n}"
  },
  {
    "path": "sdk/src/model/SetBucketLifecycleRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/SetBucketLifecycleRequest.h>\r\n#include <alibabacloud/oss/Const.h>\r\n#include <sstream>\r\n#include <../utils/Utils.h>\r\n#include \"ModelError.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nSetBucketLifecycleRequest::SetBucketLifecycleRequest(const std::string& bucket) :\r\n    OssBucketRequest(bucket)\r\n{\r\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\r\n}\r\n\r\nstd::string SetBucketLifecycleRequest::payload() const\r\n{\r\n    std::stringstream ss;\r\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\r\n    ss << \"<LifecycleConfiguration>\" << std::endl;\r\n    for (auto const &rule : lifecycleRules_) \r\n    {\r\n        ss << \"  <Rule>\" << std::endl;\r\n        ss << \"    <ID>\" << rule.ID() << \"</ID>\" << std::endl;\r\n        ss << \"    <Prefix>\" << rule.Prefix() << \"</Prefix>\" << std::endl;\r\n        for (const auto& tag : rule.Tags())\r\n        {\r\n            ss << \"    <Tag><Key>\" << tag.Key() << \"</Key><Value>\" << tag.Value() << \"</Value></Tag>\" << std::endl;\r\n        }\r\n        ss << \"    <Status>\" << ToRuleStatusName(rule.Status()) << \"</Status>\" << std::endl;\r\n        if (rule.hasExpiration())\r\n        {\r\n            ss << \"    <Expiration>\" << std::endl;\r\n            if (rule.Expiration().Days() > 0) {\r\n            ss << \"      <Days>\" << std::to_string(rule.Expiration().Days()) << \"</Days>\" << std::endl;\r\n            } \r\n            else if (!rule.Expiration().CreatedBeforeDate().empty()){\r\n            ss << \"      <CreatedBeforeDate>\" << rule.Expiration().CreatedBeforeDate() << \"</CreatedBeforeDate>\" << std::endl;\r\n            }\r\n            if (rule.ExpiredObjectDeleteMarker()) {\r\n            ss << \"      <ExpiredObjectDeleteMarker>true</ExpiredObjectDeleteMarker>\" << std::endl;\r\n            }\r\n            ss << \"    </Expiration>\" << std::endl;\r\n        }\r\n        for (auto const & transition: rule.TransitionList())\r\n        {\r\n            ss << \"    <Transition>\" << std::endl;\r\n            if (transition.Expiration().Days() > 0) {\r\n            ss << \"      <Days>\" << std::to_string(transition.Expiration().Days()) << \"</Days>\" << std::endl;\r\n            }\r\n            else {\r\n            ss << \"      <CreatedBeforeDate>\" << transition.Expiration().CreatedBeforeDate() << \"</CreatedBeforeDate>\" << std::endl;\r\n            }\r\n            ss << \"      <StorageClass>\" << ToStorageClassName(transition.StorageClass()) << \"</StorageClass>\" << std::endl;\r\n            ss << \"    </Transition>\" << std::endl;\r\n        }\r\n        if (rule.hasAbortMultipartUpload())\r\n        {\r\n            ss << \"    <AbortMultipartUpload>\" << std::endl;\r\n            if (rule.AbortMultipartUpload().Days() > 0) {\r\n            ss << \"      <Days>\" << std::to_string(rule.AbortMultipartUpload().Days()) << \"</Days>\" << std::endl;\r\n            }\r\n            else {\r\n            ss << \"      <CreatedBeforeDate>\" << rule.AbortMultipartUpload().CreatedBeforeDate() << \"</CreatedBeforeDate>\" << std::endl;\r\n            }\r\n            ss << \"    </AbortMultipartUpload>\" << std::endl;\r\n        }\r\n        if (rule.hasNoncurrentVersionExpiration())\r\n        {\r\n            ss << \"    <NoncurrentVersionExpiration>\" << std::endl;\r\n            ss << \"      <NoncurrentDays>\" << std::to_string(rule.NoncurrentVersionExpiration().Days()) << \"</NoncurrentDays>\" << std::endl;\r\n            ss << \"    </NoncurrentVersionExpiration>\" << std::endl;\r\n        }\r\n        for (auto const & transition : rule.NoncurrentVersionTransitionList())\r\n        {\r\n            ss << \"    <NoncurrentVersionTransition>\" << std::endl;\r\n            if (transition.Expiration().Days() > 0) {\r\n            ss << \"      <NoncurrentDays>\" << std::to_string(transition.Expiration().Days()) << \"</NoncurrentDays>\" << std::endl;\r\n            }\r\n            ss << \"      <StorageClass>\" << ToStorageClassName(transition.StorageClass()) << \"</StorageClass>\" << std::endl;\r\n            ss << \"    </NoncurrentVersionTransition>\" << std::endl;\r\n        }\r\n        ss << \"  </Rule>\" << std::endl;\r\n    }\r\n    ss << \"</LifecycleConfiguration>\" << std::endl;\r\n    return ss.str();\r\n}\r\n\r\nParameterCollection SetBucketLifecycleRequest::specialParameters() const\r\n{\r\n    ParameterCollection parameters;\r\n    parameters[\"lifecycle\"] = \"\";\r\n    return parameters;\r\n}\r\n\r\nint SetBucketLifecycleRequest::validate() const\r\n{\r\n    int ret;\r\n    if ((ret = OssBucketRequest::validate()) != 0) {\r\n        return ret;\r\n    }\r\n\r\n    if (lifecycleRules_.size() > LifecycleRuleLimit) {\r\n        return ARG_ERROR_LIFECYCLE_RULE_LIMIT;\r\n    }\r\n\r\n    if (lifecycleRules_.empty()) {\r\n        return ARG_ERROR_LIFECYCLE_RULE_EMPTY;\r\n    }\r\n\r\n    for (auto const &rule : lifecycleRules_) {\r\n        //no config rule \r\n        if (!rule.hasAbortMultipartUpload() &&\r\n            !rule.hasExpiration() &&\r\n            !rule.hasTransitionList() &&\r\n            !rule.hasNoncurrentVersionExpiration() &&\r\n            !rule.hasNoncurrentVersionTransitionList()) {\r\n            return ARG_ERROR_LIFECYCLE_RULE_CONFIG_EMPTY;\r\n        }\r\n\r\n        if (rule.Prefix().empty() && lifecycleRules_.size() > 1) {\r\n            return ARG_ERROR_LIFECYCLE_RULE_ONLY_ONE_FOR_BUCKET;\r\n        }\r\n    }\r\n\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/SetBucketLoggingRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/SetBucketLoggingRequest.h>\r\n#include <sstream>\r\n#include <../utils/Utils.h>\r\n#include \"ModelError.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nSetBucketLoggingRequest::SetBucketLoggingRequest(const std::string& bucket) :\r\n    SetBucketLoggingRequest(bucket, \"\", \"\")\r\n{\r\n}\r\n\r\nSetBucketLoggingRequest::SetBucketLoggingRequest(const std::string& bucket,\r\n    const std::string& targetBucket, const std::string& targetPrefix) :\r\n    OssBucketRequest(bucket),\r\n    targetBucket_(targetBucket),\r\n    targetPrefix_(targetPrefix)\r\n{\r\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\r\n}\r\n\r\nstd::string SetBucketLoggingRequest::payload() const\r\n{\r\n    std::stringstream ss;\r\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\r\n    ss << \"<BucketLoggingStatus>\" << std::endl;\r\n    ss << \"<LoggingEnabled>\" << std::endl;\r\n    ss << \"<TargetBucket>\" << targetBucket_ << \"</TargetBucket>\" << std::endl;\r\n    ss << \"<TargetPrefix>\" << targetPrefix_ << \"</TargetPrefix>\" << std::endl;\r\n    ss << \"</LoggingEnabled>\" << std::endl;\r\n    ss << \"</BucketLoggingStatus>\" << std::endl;\r\n    return ss.str();\r\n}\r\n\r\nParameterCollection SetBucketLoggingRequest::specialParameters() const\r\n{\r\n    ParameterCollection parameters;\r\n    parameters[\"logging\"] = \"\";\r\n    return parameters;\r\n}\r\n\r\nint SetBucketLoggingRequest::validate() const\r\n{\r\n    int ret;\r\n    if ((ret = OssBucketRequest::validate()) != 0 ) {\r\n        return ret;\r\n    }\r\n\r\n    if (!IsValidBucketName(targetBucket_)) {\r\n        return ARG_ERROR_BUCKET_NAME;\r\n    }\r\n\r\n    if (!IsValidLoggingPrefix(targetPrefix_)) {\r\n        return ARG_ERROR_LOGGING_TARGETPREFIX_INVALID;\r\n    }\r\n\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/SetBucketPaymentRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/SetBucketPaymentRequest.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n\n\nusing namespace AlibabaCloud::OSS;\n\nSetBucketRequestPaymentRequest::SetBucketRequestPaymentRequest(const std::string& bucket) :\n    SetBucketRequestPaymentRequest(bucket, RequestPayer::NotSet)\n{\n}\n\nSetBucketRequestPaymentRequest::SetBucketRequestPaymentRequest(const std::string& bucket,\n    RequestPayer payer) :\n    OssBucketRequest(bucket),\n    payer_(payer)\n{\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\n}\n\nstd::string SetBucketRequestPaymentRequest::payload() const\n{\n    std::stringstream ss;\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\n    ss << \"<RequestPaymentConfiguration>\" << std::endl;\n    ss << \"<Payer>\" << ToRequestPayerName(payer_) << \"</Payer>\" << std::endl;\n    ss << \"</RequestPaymentConfiguration>\" << std::endl;\n    return ss.str();\n}\n\nParameterCollection SetBucketRequestPaymentRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"requestPayment\"] = \"\";\n    return parameters;\n}\n\n"
  },
  {
    "path": "sdk/src/model/SetBucketPolicyRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/SetBucketPolicyRequest.h>\n#include <sstream>\n\n\nusing namespace AlibabaCloud::OSS;\n\nSetBucketPolicyRequest::SetBucketPolicyRequest(const std::string& bucket) :\n    SetBucketPolicyRequest(bucket, \"\")\n{\n}\n\nSetBucketPolicyRequest::SetBucketPolicyRequest(const std::string& bucket,\n    const std::string& policy) :\n    OssBucketRequest(bucket),\n    policy_(policy)\n{\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\n}\n\nstd::string SetBucketPolicyRequest::payload() const\n{\n    return policy_;\n}\n\nParameterCollection SetBucketPolicyRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"policy\"] = \"\";\n    return parameters;\n}\n"
  },
  {
    "path": "sdk/src/model/SetBucketQosInfoRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/SetBucketQosInfoRequest.h>\nusing namespace AlibabaCloud::OSS;\n\nSetBucketQosInfoRequest::SetBucketQosInfoRequest(const std::string& bucket) :\n    SetBucketQosInfoRequest(bucket, QosConfiguration())\n{\n}\n\nSetBucketQosInfoRequest::SetBucketQosInfoRequest(const std::string& bucket, const QosConfiguration& qos) :\n    OssBucketRequest(bucket),\n    qosInfo_(qos)\n{\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\n}\n\nstd::string SetBucketQosInfoRequest::payload() const\n{\n    std::string str;\n    str.append(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\");\n    str.append(\"<QoSConfiguration>\\n\");\n    str.append(\"<TotalUploadBandwidth>\");\n    str.append(std::to_string(qosInfo_.TotalUploadBandwidth()));\n    str.append(\"</TotalUploadBandwidth>\\n\");\n    str.append(\"<IntranetUploadBandwidth>\");\n    str.append(std::to_string(qosInfo_.IntranetUploadBandwidth()));\n    str.append(\"</IntranetUploadBandwidth>\\n\");\n    str.append(\"<ExtranetUploadBandwidth>\");\n    str.append(std::to_string(qosInfo_.ExtranetUploadBandwidth()));\n    str.append(\"</ExtranetUploadBandwidth>\\n\");\n    str.append(\"<TotalDownloadBandwidth>\");\n    str.append(std::to_string(qosInfo_.TotalDownloadBandwidth()));\n    str.append(\"</TotalDownloadBandwidth>\\n\");\n    str.append(\"<IntranetDownloadBandwidth>\");\n    str.append(std::to_string(qosInfo_.IntranetDownloadBandwidth()));\n    str.append(\"</IntranetDownloadBandwidth>\\n\");\n    str.append(\"<ExtranetDownloadBandwidth>\");\n    str.append(std::to_string(qosInfo_.ExtranetDownloadBandwidth()));\n    str.append(\"</ExtranetDownloadBandwidth>\\n\");\n    str.append(\"<TotalQps>\");\n    str.append(std::to_string(qosInfo_.TotalQps()));\n    str.append(\"</TotalQps>\\n\");\n    str.append(\"<IntranetQps>\");\n    str.append(std::to_string(qosInfo_.IntranetQps()));\n    str.append(\"</IntranetQps>\\n\");\n    str.append(\"<ExtranetQps>\");\n    str.append(std::to_string(qosInfo_.ExtranetQps()));\n    str.append(\"</ExtranetQps>\\n\");\n    str.append(\"</QoSConfiguration>\");\n    return str;\n}\n\nParameterCollection SetBucketQosInfoRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"qosInfo\"] = \"\";\n    return parameters;\n}\n\n"
  },
  {
    "path": "sdk/src/model/SetBucketRefererRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/SetBucketRefererRequest.h>\r\n#include <sstream>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nSetBucketRefererRequest::SetBucketRefererRequest(const std::string& bucket) :\r\n    OssBucketRequest(bucket),\r\n    allowEmptyReferer_(true)\r\n{\r\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\n}\r\n\r\nSetBucketRefererRequest::SetBucketRefererRequest(const std::string& bucket, const RefererList& refererList) :\r\n    SetBucketRefererRequest(bucket, refererList, true)\r\n{\r\n}\r\n\r\nSetBucketRefererRequest::SetBucketRefererRequest(const std::string& bucket, const RefererList& refererList,\r\n    bool allowEmptyReferer) :\r\n    OssBucketRequest(bucket),\r\n    allowEmptyReferer_(allowEmptyReferer),\r\n    refererList_(refererList)\r\n{\r\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\n}\r\n\r\nstd::string SetBucketRefererRequest::payload() const\r\n{\r\n    std::stringstream ss;\r\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\r\n    ss << \"<RefererConfiguration>\" << std::endl;\r\n    ss << \"  <AllowEmptyReferer>\" << (allowEmptyReferer_ ? \"true\" : \"false\") << \"</AllowEmptyReferer>\" << std::endl;\r\n    ss << \"  <RefererList>\" << std::endl;\r\n    for (const auto &referer : refererList_) {\r\n        ss << \"    <Referer>\" << referer << \"</Referer>\" << std::endl;\r\n    }\r\n    ss << \"  </RefererList>\" << std::endl;\r\n    ss << \"</RefererConfiguration>\" << std::endl;\r\n    return ss.str();\r\n}\r\nParameterCollection SetBucketRefererRequest::specialParameters() const\r\n{\r\n    ParameterCollection parameters;\r\n    parameters[\"referer\"] = \"\";\r\n    return parameters;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/SetBucketStorageCapacityRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/SetBucketStorageCapacityRequest.h>\r\n#include \"../utils/Utils.h\"\r\n#include \"ModelError.h\"\r\n#include <sstream>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nSetBucketStorageCapacityRequest::SetBucketStorageCapacityRequest(const std::string &bucket, int64_t storageCapacity) :\r\n    OssBucketRequest(bucket),\r\n    storageCapacity_(storageCapacity)\r\n{\r\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\r\n}\r\n\r\nParameterCollection SetBucketStorageCapacityRequest::specialParameters() const\r\n{\r\n    ParameterCollection parameters;\r\n    parameters[\"qos\"] = \"\";\r\n    return parameters;\r\n}\r\n\r\nstd::string SetBucketStorageCapacityRequest::payload() const\r\n{\r\n    std::stringstream ss;\r\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\r\n    ss << \"<BucketUserQos>\" << std::endl;\r\n    ss << \"  <StorageCapacity>\" << std::to_string(storageCapacity_) << \"</StorageCapacity>\" << std::endl;\r\n    ss << \"</BucketUserQos>\" << std::endl;\r\n    return ss.str();\r\n}\r\n\r\nint SetBucketStorageCapacityRequest::validate() const\r\n{\r\n    int ret;\r\n    if ((ret = OssBucketRequest::validate()) != 0) {\r\n        return ret;\r\n    }\r\n\r\n    if (storageCapacity_ < 0)\r\n        return ARG_ERROR_STORAGECAPACITY_INVALID;\r\n\r\n    return 0;\r\n}\r\n\r\n\r\n"
  },
  {
    "path": "sdk/src/model/SetBucketTaggingRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#include <alibabacloud/oss/model/SetBucketTaggingRequest.h>\n#include <alibabacloud/oss/Const.h>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n#include <sstream>\nusing namespace AlibabaCloud::OSS;\n\nSetBucketTaggingRequest::SetBucketTaggingRequest(const std::string& bucket) :\n    SetBucketTaggingRequest(bucket, Tagging())\n{\n}\n\nSetBucketTaggingRequest::SetBucketTaggingRequest(const std::string& bucket, const Tagging& tagging) :\n    OssBucketRequest(bucket),\n    tagging_(tagging)\n{\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\n}\n\nvoid SetBucketTaggingRequest::setTagging(const Tagging& tagging)\n{\n    tagging_ = tagging;\n}\n\n\nstd::string SetBucketTaggingRequest::payload() const\n{\n    std::stringstream ss;\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\n    ss << \"<Tagging>\" << std::endl;\n    ss << \"  <TagSet>\" << std::endl;\n    for (const auto& tag : tagging_.Tags()) {\n        ss << \"    <Tag><Key>\" << tag.Key() << \"</Key><Value>\" << tag.Value() << \"</Value></Tag>\" << std::endl;\n    }\n    ss << \"  </TagSet>\" << std::endl;\n    ss << \"</Tagging>\" << std::endl;\n    return ss.str();\n}\n\nParameterCollection SetBucketTaggingRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"tagging\"] = \"\";\n    return parameters;\n}\n\nint SetBucketTaggingRequest::validate() const\n{\n    int ret;\n    if ((ret = OssBucketRequest::validate()) != 0) {\n        return ret;\n    }\n\n    if (tagging_.Tags().empty() || tagging_.Tags().size() > MaxTagSize) {\n        return ARG_ERROR_TAGGING_TAGS_LIMIT;\n    }\n\n    for (const auto& tag : tagging_.Tags()) {\n\n        if (!IsValidTagKey(tag.Key()))\n            return ARG_ERROR_TAGGING_TAG_KEY_LIMIT;\n\n        if (!IsValidTagValue(tag.Value()))\n            return ARG_ERROR_TAGGING_TAG_VALUE_LIMIT;\n    }\n\n    return 0;\n}"
  },
  {
    "path": "sdk/src/model/SetBucketVersioningRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/SetBucketVersioningRequest.h>\r\n#include <sstream>\r\n#include <../utils/Utils.h>\r\n#include \"ModelError.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nSetBucketVersioningRequest::SetBucketVersioningRequest(const std::string& bucket, VersioningStatus status) :\r\n    OssBucketRequest(bucket),\r\n    status_(status)\r\n{\r\n}\r\n\r\nvoid SetBucketVersioningRequest::setStatus(VersioningStatus status)\r\n{\r\n    status_ = status;\r\n}\r\n\r\nstd::string SetBucketVersioningRequest::payload() const\r\n{\r\n    std::stringstream ss;\r\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\r\n    ss << \"<VersioningConfiguration>\"  << std::endl;\r\n    ss << \"<Status>\" << ToVersioningStatusName(status_) << \"</Status>\" << std::endl;\r\n    ss << \"</VersioningConfiguration>\" << std::endl;\r\n    return ss.str();\r\n}\r\n\r\nParameterCollection SetBucketVersioningRequest::specialParameters() const\r\n{\r\n    ParameterCollection parameters;\r\n    parameters[\"versioning\"] = \"\";\r\n    return parameters;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/SetBucketWebsiteRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/SetBucketWebsiteRequest.h>\r\n#include <sstream>\r\n#include <../utils/Utils.h>\r\n#include \"ModelError.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nSetBucketWebsiteRequest::SetBucketWebsiteRequest(const std::string& bucket) :\r\n    OssBucketRequest(bucket),\r\n    indexDocumentIsSet_(false),\r\n    errorDocumentIsSet_(false)\r\n{\r\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\r\n}\r\n\r\nstd::string SetBucketWebsiteRequest::payload() const\r\n{\r\n    std::stringstream ss;\r\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\r\n    ss << \"<WebsiteConfiguration>\" << std::endl;\r\n    ss << \"  <IndexDocument>\" << std::endl;\r\n    ss << \"    <Suffix>\" << indexDocument_ << \"</Suffix>\" << std::endl;\r\n    ss << \"  </IndexDocument>\" << std::endl;\r\n    if (errorDocumentIsSet_) {\r\n        ss << \"  <ErrorDocument>\" << std::endl;\r\n        ss << \"    <Key>\" << errorDocument_ << \"</Key>\" << std::endl;\r\n        ss << \"  </ErrorDocument>\" << std::endl;\r\n    }\r\n    ss << \"</WebsiteConfiguration>\" << std::endl;\r\n    return ss.str();\r\n}\r\n\r\nParameterCollection SetBucketWebsiteRequest::specialParameters() const\r\n{\r\n    ParameterCollection parameters;\r\n    parameters[\"website\"] = \"\";\r\n    return parameters;\r\n}\r\n\r\nstatic bool IsValidWebpage(const std::string &webpage)\r\n{\r\n    const std::string pageSuffix = \".html\";\r\n    return (webpage.size() > pageSuffix.size()) &&\r\n        (webpage.substr(webpage.size() - 5).compare(\".html\") == 0);\r\n}\r\n\r\nint SetBucketWebsiteRequest::validate() const\r\n{\r\n    int ret = OssBucketRequest::validate();\r\n    if (ret != 0) \r\n        return ret;\r\n\r\n    if (indexDocument_.empty())\r\n        return ARG_ERROR_WEBSITE_INDEX_DOCCUMENT_EMPTY;\r\n\r\n    if (!IsValidWebpage(indexDocument_))\r\n        return ARG_ERROR_WEBSITE_INDEX_DOCCUMENT_NAME_INVALID;\r\n\r\n    if (errorDocumentIsSet_ && !IsValidWebpage(errorDocument_))\r\n        return ARG_ERROR_WEBSITE_ERROR_DOCCUMENT_NAME_INVALID;\r\n\r\n    return 0;\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/SetObjectAclRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/SetObjectAclRequest.h>\n#include <alibabacloud/oss/http/HttpType.h>\n#include \"../utils/Utils.h\"\nusing namespace AlibabaCloud::OSS;\n\nSetObjectAclRequest::SetObjectAclRequest(const std::string &bucket, const std::string &key) :\n\tOssObjectRequest(bucket,key),\n    hasSetAcl_(false)\n{\n}\n\nSetObjectAclRequest::SetObjectAclRequest(const std::string &bucket\n        ,const std::string &key, CannedAccessControlList acl) :\n\tOssObjectRequest(bucket,key),\n    acl_(acl),\n    hasSetAcl_(true)\n{\n}\n\n\nvoid SetObjectAclRequest::setAcl(CannedAccessControlList acl)\n{\n    acl_ = acl;\n\thasSetAcl_ = true;\n}\n\nHeaderCollection SetObjectAclRequest::specialHeaders() const\n{\n    auto headers = OssObjectRequest::specialHeaders();\n    if (hasSetAcl_) {\n        headers[\"x-oss-object-acl\"] = ToAclName(acl_);\n    }\n    return headers;\n}\n\nParameterCollection SetObjectAclRequest::specialParameters() const\n{\n    auto parameters = OssObjectRequest::specialParameters();\n    parameters[\"acl\"] = \"\";\n    return parameters;\n}\n\n\n\n\n"
  },
  {
    "path": "sdk/src/model/SetObjectAclResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/SetObjectAclResult.h>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nSetObjectAclResult::SetObjectAclResult():\r\n    OssObjectResult()\r\n{\r\n}\r\n\r\nSetObjectAclResult::SetObjectAclResult(const HeaderCollection& header):\r\n    OssObjectResult(header)\r\n{\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/model/SetObjectTaggingRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/SetObjectTaggingRequest.h>\r\n#include <alibabacloud/oss/Const.h>\r\n#include \"../utils/Utils.h\"\r\n#include \"ModelError.h\"\r\n#include <sstream>\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nSetObjectTaggingRequest::SetObjectTaggingRequest(const std::string& bucket, const std::string& key):\r\n    OssObjectRequest(bucket, key)\r\n{\r\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\r\n}\r\n\r\nSetObjectTaggingRequest::SetObjectTaggingRequest(const std::string& bucket, const std::string& key,\r\n    const Tagging& tagging):\r\n    OssObjectRequest(bucket, key),\r\n    tagging_(tagging)\r\n{\r\n    setFlags(Flags() | REQUEST_FLAG_CONTENTMD5);\r\n}\r\n\r\nvoid SetObjectTaggingRequest::setTagging(const Tagging& tagging)\r\n{\r\n    tagging_ = tagging;\r\n}\r\n\r\n\r\nstd::string SetObjectTaggingRequest::payload() const\r\n{\r\n    std::stringstream ss;\r\n    ss << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" << std::endl;\r\n    ss << \"<Tagging>\"  << std::endl;\r\n    ss << \"  <TagSet>\" << std::endl;\r\n    for (const auto& tag : tagging_.Tags()) {\r\n        ss << \"    <Tag><Key>\"<< tag.Key() <<\"</Key><Value>\" << tag.Value() << \"</Value></Tag>\" << std::endl;\r\n    }\r\n    ss << \"  </TagSet>\" << std::endl;\r\n    ss << \"</Tagging>\"  << std::endl;\r\n    return ss.str();\r\n}\r\n\r\nParameterCollection SetObjectTaggingRequest::specialParameters() const\r\n{\r\n    auto parameters = OssObjectRequest::specialParameters();\r\n    parameters[\"tagging\"] = \"\";\r\n    return parameters;\r\n}\r\n\r\nint SetObjectTaggingRequest::validate() const\r\n{\r\n    int ret;\r\n    if ((ret = OssObjectRequest::validate()) != 0) {\r\n        return ret;\r\n    }\r\n\r\n    if (tagging_.Tags().empty() || tagging_.Tags().size() > MaxTagSize) {\r\n        return ARG_ERROR_TAGGING_TAGS_LIMIT;\r\n    }\r\n\r\n    for (const auto& tag : tagging_.Tags()) {\r\n\r\n        if (!IsValidTagKey(tag.Key()))\r\n            return ARG_ERROR_TAGGING_TAG_KEY_LIMIT;\r\n\r\n        if (!IsValidTagValue(tag.Value()))\r\n            return ARG_ERROR_TAGGING_TAG_VALUE_LIMIT;\r\n    }\r\n\r\n    return 0;\r\n}"
  },
  {
    "path": "sdk/src/model/Tagging.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/Tagging.h>\r\n#include \"../utils/Utils.h\"\r\n#include <sstream>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nstd::string Tagging::toQueryParameters()\r\n{\r\n    std::string sep;\r\n    std::stringstream ss;\r\n    for (const auto& tag : tagSet_)\r\n    {\r\n        if (tag.Key().empty())\r\n            continue;\r\n\r\n        if (tag.Value().empty())\r\n            ss << sep << UrlEncode(tag.Key());\r\n        else\r\n            ss << sep << UrlEncode(tag.Key()) << \"=\" << UrlEncode(tag.Value());\r\n\r\n        sep = \"&\";\r\n    }\r\n    return ss.str();\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/UploadPartCopyRequest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/UploadPartCopyRequest.h>\n#include <sstream>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n#include <alibabacloud/oss/Const.h>\n\nusing namespace AlibabaCloud::OSS;\nusing std::stringstream;\n\n\nUploadPartCopyRequest::UploadPartCopyRequest(const std::string &bucket, const std::string &key) :\n    UploadPartCopyRequest(bucket, key, std::string(), std::string(), std::string(), 0)\n{\n}\n\nUploadPartCopyRequest::UploadPartCopyRequest(const std::string &bucket, const std::string &key,\n    const std::string &srcBucket, const std::string &srcKey) :\n    UploadPartCopyRequest(bucket, key, srcBucket, srcKey, std::string(), 0)\n{\n}\n\nUploadPartCopyRequest::UploadPartCopyRequest(const std::string &bucket, const std::string &key,\n    const std::string &srcBucket, const std::string &srcKey,\n    const std::string &uploadId, int partNumber):\n    OssObjectRequest(bucket, key),\n    uploadId_(uploadId),\n    sourceBucket_(srcBucket),\n    sourceKey_(srcKey),\n    partNumber_(partNumber),\n    sourceRangeIsSet_(false),\n    sourceIfMatchETagIsSet_(false),\n    sourceIfNotMatchETagIsSet_(false),\n    sourceIfModifiedSinceIsSet_(false),\n    sourceIfUnModifiedSinceIsSet_(false),\n    trafficLimit_(0)\n{\n}\n\nUploadPartCopyRequest::UploadPartCopyRequest(const std::string& bucket, const std::string& key,\n    const std::string& srcBucket, const std::string& srcKey,\n    const std::string& uploadId, int partNumber,\n    const std::string& sourceIfMatchETag,\n    const std::string& sourceIfNotMatchETag,\n    const std::string& sourceIfModifiedSince,\n    const std::string& sourceIfUnModifiedSince) :\n    OssObjectRequest(bucket, key),\n    uploadId_(uploadId),\n    sourceBucket_(srcBucket),\n    sourceKey_(srcKey),\n    partNumber_(partNumber),\n    sourceRangeIsSet_(false),\n    trafficLimit_(0)\n{\n    if (!sourceIfMatchETag.empty()) {\n        sourceIfMatchETag_ = sourceIfMatchETag;\n        sourceIfMatchETagIsSet_ = true;\n    }\n    else {\n        sourceIfMatchETagIsSet_ = false;\n    }\n\n    if (!sourceIfNotMatchETag.empty()) {\n        sourceIfNotMatchETag_ = sourceIfNotMatchETag;\n        sourceIfNotMatchETagIsSet_ = true;\n    }\n    else {\n        sourceIfNotMatchETagIsSet_ = false;\n    }\n\n    if (!sourceIfModifiedSince.empty()) {\n        sourceIfModifiedSince_ = sourceIfModifiedSince;\n        sourceIfModifiedSinceIsSet_ = true;\n    }\n    else {\n        sourceIfModifiedSinceIsSet_ = false;\n    }\n\n    if (!sourceIfUnModifiedSince.empty()) {\n        sourceIfUnModifiedSince_ = sourceIfUnModifiedSince;\n        sourceIfUnModifiedSinceIsSet_ = true;\n    }\n    else {\n        sourceIfUnModifiedSinceIsSet_ = false;\n    }\n}\n\nvoid UploadPartCopyRequest::setPartNumber(uint32_t partNumber)\n{\n    partNumber_ = partNumber; \n}\n\nvoid UploadPartCopyRequest::setUploadId(const std::string &uploadId)\n{\n    uploadId_ = uploadId; \n}\n\nvoid UploadPartCopyRequest::SetCopySource(const std::string& srcBucket, const std::string& srcKey)\n{\n    sourceBucket_ = srcBucket;\n    sourceKey_ = srcKey;\n}\n\nvoid UploadPartCopyRequest::setCopySourceRange(uint64_t begin, uint64_t end)\n{\n    sourceRange_[0] = begin;\n    sourceRange_[1] = end;\n    sourceRangeIsSet_ = true;\n}\n\nvoid UploadPartCopyRequest::SetSourceIfMatchETag(const std::string& value)\n{\n    sourceIfMatchETag_ = value;\n    sourceIfMatchETagIsSet_ = true;\n}\n\nvoid UploadPartCopyRequest::SetSourceIfNotMatchETag(const std::string& value)\n{\n    sourceIfNotMatchETag_ = value;\n    sourceIfNotMatchETagIsSet_ = true;\n}\n\nvoid UploadPartCopyRequest::SetSourceIfModifiedSince(const std::string& value)\n{\n    sourceIfModifiedSince_ = value;\n    sourceIfModifiedSinceIsSet_ = true;\n}\n\nvoid UploadPartCopyRequest::SetSourceIfUnModifiedSince(const std::string& value)\n{\n    sourceIfUnModifiedSince_ = value;\n    sourceIfUnModifiedSinceIsSet_ = true;\n}\n\nvoid UploadPartCopyRequest::setTrafficLimit(uint64_t value)\n{\n    trafficLimit_ = value;\n}\n\nParameterCollection UploadPartCopyRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"partNumber\"] = std::to_string(partNumber_);\n    parameters[\"uploadId\"] = uploadId_;\n    return parameters;\n}\n\nHeaderCollection UploadPartCopyRequest::specialHeaders() const\n{\n    auto headers = OssObjectRequest::specialHeaders();\n    std::string source;\n    source.append(\"/\").append(sourceBucket_).append(\"/\").append(UrlEncode(sourceKey_));\n    if (!versionId_.empty()) {\n        source.append(\"?versionId=\").append(versionId_);\n    }\n    headers[\"x-oss-copy-source\"] = source;\n\n    if (sourceRangeIsSet_) {\n        std::string range(\"bytes=\");\n        range.append(std::to_string(sourceRange_[0])).append(\"-\");\n        if (sourceRange_[1] > 0){\n            range.append(std::to_string(sourceRange_[1]));\n        }\n        headers[\"x-oss-copy-source-range\"] = range;\n    }\n\n    if(sourceIfMatchETagIsSet_) {\n        headers[\"x-oss-copy-source-if-match\"] = sourceIfMatchETag_;\n    }\n\n    if(sourceIfNotMatchETagIsSet_) {\n        headers[\"x-oss-copy-source-if-none-match\"] = sourceIfNotMatchETag_;\n    }\n\n    if(sourceIfModifiedSinceIsSet_) {\n        headers[\"x-oss-copy-source-if-modified-since\"] = sourceIfModifiedSince_;\n    }\n\n    if (sourceIfUnModifiedSinceIsSet_) {\n        headers[\"x-oss-copy-source-if-unmodified-since\"] = sourceIfUnModifiedSince_;\n    }\n\n    if (trafficLimit_ != 0) {\n        headers[\"x-oss-traffic-limit\"] = std::to_string(trafficLimit_);\n    }\n\n    return headers;\n}\n\nint UploadPartCopyRequest::validate() const\n{\n    int ret = OssObjectRequest::validate();\n    if (ret != 0){\n        return ret;\n    }\n\n    if (!IsValidBucketName(sourceBucket_)) {\n        return ARG_ERROR_BUCKET_NAME;\n    }\n\n    if (!IsValidObjectKey(sourceKey_)) {\n        return ARG_ERROR_OBJECT_NAME;\n    }\n\n    if (sourceRangeIsSet_ && \n          ((sourceRange_[1] < sourceRange_[0]) || \n           ((sourceRange_[1] - sourceRange_[0] + 1) > MaxFileSize))) {\n        return ARG_ERROR_MULTIPARTUPLOAD_PARTSIZE_RANGE;\n    }\n\n    if(!(partNumber_ > 0 && partNumber_ < PartNumberUpperLimit)){\n        return ARG_ERROR_MULTIPARTUPLOAD_PARTNUMBER_RANGE;\n    }\n\n    return 0;\n}\n"
  },
  {
    "path": "sdk/src/model/UploadPartCopyResult.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/UploadPartCopyResult.h>\r\n#include <alibabacloud/oss/model/Owner.h>\r\n#include <tinyxml2/tinyxml2.h>\r\n#include \"../utils/Utils.h\"\r\nusing namespace AlibabaCloud::OSS;\r\nusing namespace tinyxml2;\r\n\r\nUploadPartCopyResult::UploadPartCopyResult() :\r\n    OssObjectResult()\r\n{\r\n}\r\n\r\nUploadPartCopyResult::UploadPartCopyResult(const std::string& result):\r\n    UploadPartCopyResult()\r\n{\r\n    *this = result;\r\n    \r\n}\r\n\r\nUploadPartCopyResult::UploadPartCopyResult(const std::shared_ptr<std::iostream>& result,\r\n    const HeaderCollection &headers):\r\n    OssObjectResult(headers)\r\n{\r\n    if (headers.find(\"x-oss-copy-source-version-id\") != headers.end()) {\r\n        sourceVersionId_ = headers.at(\"x-oss-copy-source-version-id\");\r\n    }\r\n\r\n    std::istreambuf_iterator<char> isb(*result.get()), end;\r\n    std::string str(isb, end);\r\n    *this = str;\r\n}\r\n\r\nUploadPartCopyResult& UploadPartCopyResult::operator =(\r\n    const std::string& result)\r\n{\r\n    XMLDocument doc;\r\n    XMLError xml_err;\r\n    if ((xml_err = doc.Parse(result.c_str(), result.size())) == XML_SUCCESS) {\r\n        XMLElement* root =doc.RootElement();\r\n        if (root && !std::strncmp(\"CopyPartResult\", root->Name(), 14)) {\r\n            XMLElement *node;\r\n\r\n            node = root->FirstChildElement(\"LastModified\");\r\n            if (node && node->GetText()) {\r\n                lastModified_ = node->GetText();\r\n            }\r\n\r\n            node = root->FirstChildElement(\"ETag\");\r\n            if (node && node->GetText()) {\r\n                eTag_ = TrimQuotes(node->GetText());\r\n            }\r\n            parseDone_ = true;\r\n\t\t}\r\n    }\r\n    return *this;\r\n}\r\n\r\nconst std::string& UploadPartCopyResult::LastModified() const\r\n{\r\n    return lastModified_;\r\n}\r\nconst std::string& UploadPartCopyResult::ETag() const\r\n{\r\n    return eTag_;\r\n}\r\n"
  },
  {
    "path": "sdk/src/model/UploadPartRequest.cc",
    "content": "/*\n * Copyright 2009-2018 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/model/UploadPartRequest.h>\n#include <alibabacloud/oss/http/HttpType.h>\n#include \"../utils/Utils.h\"\n#include \"ModelError.h\"\n#include <alibabacloud/oss/Const.h>\nusing namespace AlibabaCloud::OSS;\n\nUploadPartRequest::UploadPartRequest(const std::string &bucket, const std::string &key,\n    const std::shared_ptr<std::iostream> &content) :\n    UploadPartRequest(bucket, key, 0, \"\", content)\n{\n}\n\nUploadPartRequest::UploadPartRequest(const std::string &bucket, const std::string &key,\n    int partNumber, const std::string &uploadId,\n    const std::shared_ptr<std::iostream> &content) :\n    OssObjectRequest(bucket, key),\n    partNumber_(partNumber),\n    uploadId_(uploadId),\n    content_(content),\n    contentLengthIsSet_(false),\n    trafficLimit_(0),\n    userAgent_(),\n    contentMd5IsSet_(false)\n{\n    setFlags(Flags() | REQUEST_FLAG_CHECK_CRC64 | REQUEST_FLAG_CHUNKED_ENCODING);\n}\n\nvoid UploadPartRequest::setPartNumber(int partNumber)\n{\n    partNumber_ = partNumber;\n}\n\nvoid UploadPartRequest::setUploadId(const std::string &uploadId)\n{\n    uploadId_ = uploadId;\n}\n\nvoid UploadPartRequest::setContent(const std::shared_ptr<std::iostream> &content)\n{\n    content_ = content;\n}\n\nvoid UploadPartRequest::setConetent(const std::shared_ptr<std::iostream> &content)\n{\n    content_ = content;\n}\n\nvoid UploadPartRequest::setContentLength(uint64_t length)\n{\n    contentLength_ = length;\n    contentLengthIsSet_ = true;\n}\n\nvoid UploadPartRequest::setTrafficLimit(uint64_t value)\n{\n    trafficLimit_ = value;\n}\n\nvoid UploadPartRequest::setUserAgent(const std::string& ua)\n{\n    userAgent_ = ua;\n}\n\nvoid UploadPartRequest::setContentMd5(const std::string& value)\n{\n    contentMd5_ = value;\n    contentMd5IsSet_ = true;\n}\n\nint UploadPartRequest::PartNumber() const\n{\n    return partNumber_;\n}\n\nstd::shared_ptr<std::iostream> UploadPartRequest::Body() const\n{\n    return content_;\n}\n\nHeaderCollection UploadPartRequest::specialHeaders() const\n{\n    auto headers = OssObjectRequest::specialHeaders();\n    headers[Http::CONTENT_TYPE] = \"\";\n    if (contentLengthIsSet_) {\n        headers[Http::CONTENT_LENGTH] = std::to_string(contentLength_);\n    }\n    if (trafficLimit_ != 0) {\n        headers[\"x-oss-traffic-limit\"] = std::to_string(trafficLimit_);\n    }\n    if (!userAgent_.empty()) {\n        headers[Http::USER_AGENT] = userAgent_;\n    }\n    if (contentMd5IsSet_) {\n        headers[Http::CONTENT_MD5] = contentMd5_;\n    }\n    return headers;\n}\n\nParameterCollection UploadPartRequest::specialParameters() const\n{\n    ParameterCollection parameters;\n    parameters[\"partNumber\"] = std::to_string(partNumber_);\n    parameters[\"uploadId\"] = uploadId_;\n    return parameters;\n}\n\nint UploadPartRequest::validate() const\n{\n    int ret = OssObjectRequest::validate();\n    if (ret)\n    {\n        return ret;\n    }\n\n    if (content_ == nullptr) {\n        return ARG_ERROR_REQUEST_BODY_NULLPTR;\n    }\n\n    if (content_->bad()) {\n        return ARG_ERROR_REQUEST_BODY_BAD_STATE;\n    }\n\n    if (content_->fail()) {\n        return ARG_ERROR_REQUEST_BODY_FAIL_STATE;\n    }\n\n    if (!(partNumber_ > 0 && partNumber_ < PartNumberUpperLimit)) {\n        return ARG_ERROR_MULTIPARTUPLOAD_PARTNUMBER_RANGE;\n    }\n\n    uint64_t partSize;\n\n    if (contentLengthIsSet_) {\n        partSize = contentLength_;\n    }\n    else {\n        partSize = GetIOStreamLength(*content_);\n    }\n\n    if (partSize > MaxFileSize) {\n        return ARG_ERROR_MULTIPARTUPLOAD_PARTSIZE_RANGE;\n    }\n\n    return 0;\n}\n\n"
  },
  {
    "path": "sdk/src/resumable/DownloadObjectRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n\r\n#include <alibabacloud/oss/model/DownloadObjectRequest.h>\r\n#include <alibabacloud/oss/Const.h>\r\n#include <sstream>\r\n#include <fstream>\r\n#include \"../model/ModelError.h\"\r\n#include \"../utils/FileSystemUtils.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nDownloadObjectRequest::DownloadObjectRequest(const std::string &bucket, const std::string &key, \r\n    const std::string &filePath, const std::string &checkpointDir,\r\n    const uint64_t partSize, const uint32_t threadNum):\r\n    OssResumableBaseRequest(bucket, key, checkpointDir, partSize, threadNum), \r\n    rangeIsSet_(false),\r\n    filePath_(filePath)\r\n{\r\n    tempFilePath_ = filePath + \".temp\";\r\n}\r\n\r\nDownloadObjectRequest::DownloadObjectRequest(const std::string &bucket, const std::string &key, \r\n    const std::string &filePath, const std::string &checkpointDir) : \r\n    DownloadObjectRequest(bucket, key, filePath, checkpointDir, DefaultPartSize, DefaultResumableThreadNum)\r\n{}\r\n\r\nDownloadObjectRequest::DownloadObjectRequest(const std::string &bucket, const std::string &key, \r\n    const std::string &filePath) :\r\n    DownloadObjectRequest(bucket, key, filePath, \"\", DefaultPartSize, DefaultResumableThreadNum)\r\n{}\r\n\r\n//wstring\r\nDownloadObjectRequest::DownloadObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::wstring &filePath, const std::wstring &checkpointDir,\r\n    const uint64_t partSize, const uint32_t threadNum) :\r\n    OssResumableBaseRequest(bucket, key, checkpointDir, partSize, threadNum),\r\n    rangeIsSet_(false),\r\n    filePathW_(filePath)\r\n{\r\n    tempFilePathW_ = filePath + L\".temp\";\r\n}\r\n\r\nDownloadObjectRequest::DownloadObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::wstring &filePath, const std::wstring &checkpointDir) :\r\n    DownloadObjectRequest(bucket, key, filePath, checkpointDir, DefaultPartSize, DefaultResumableThreadNum)\r\n{}\r\n\r\nDownloadObjectRequest::DownloadObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::wstring &filePath) :\r\n    DownloadObjectRequest(bucket, key, filePath, L\"\", DefaultPartSize, DefaultResumableThreadNum)\r\n{}\r\n\r\n\r\nvoid DownloadObjectRequest::setRange(int64_t start, int64_t end)\r\n{\r\n    range_[0] = start;\r\n    range_[1] = end;\r\n    rangeIsSet_ = true;\r\n}\r\n\r\nvoid DownloadObjectRequest::setModifiedSinceConstraint(const std::string &value)\r\n{\r\n    modifiedSince_ = value;\r\n}\r\n\r\nvoid DownloadObjectRequest::setUnmodifiedSinceConstraint(const std::string &value)\r\n{\r\n    unmodifiedSince_ = value;\r\n}\r\n\r\nvoid DownloadObjectRequest::setMatchingETagConstraints(const std::vector<std::string> &values)\r\n{\r\n    matchingETags_ = values;\r\n}\r\n\r\nvoid DownloadObjectRequest::setNonmatchingETagConstraints(const std::vector<std::string> &values)\r\n{\r\n    nonmatchingETags_ = values;\r\n}\r\n\r\nvoid DownloadObjectRequest::addResponseHeaders(RequestResponseHeader header, const std::string &value)\r\n{\r\n    static const char *ResponseHeader[] = {\r\n        \"response-content-type\", \"response-content-language\",\r\n        \"response-expires\", \"response-cache-control\",\r\n        \"response-content-disposition\", \"response-content-encoding\" };\r\n    responseHeaderParameters_[ResponseHeader[header - RequestResponseHeader::ContentType]] = value;\r\n}\r\n\r\nint DownloadObjectRequest::validate() const\r\n{\r\n    auto ret = OssResumableBaseRequest::validate();\r\n    if (ret != 0) {\r\n        return ret;\r\n    }\r\n\r\n    if (rangeIsSet_ && (range_[0] < 0 || range_[1] < -1 || (range_[1] > -1 && range_[1] < range_[0]))) {\r\n        return ARG_ERROR_INVALID_RANGE;\r\n    }\r\n\r\n#if !defined(_WIN32)\r\n    if (!filePathW_.empty()) {\r\n        return ARG_ERROR_PATH_NOT_SUPPORT_WSTRING_TYPE;\r\n    }\r\n#endif\r\n\r\n    if (filePath_.empty() && filePathW_.empty()) {\r\n        return ARG_ERROR_DOWNLOAD_FILE_PATH_EMPTY;\r\n    }\r\n\r\n    //path and checkpoint must be same type.\r\n    if ((!filePath_.empty() && !checkpointDirW_.empty()) ||\r\n        (!filePathW_.empty() && !checkpointDir_.empty())) {\r\n        return ARG_ERROR_PATH_NOT_SAME_TYPE;\r\n    }\r\n\r\n    //check tmpfilePath is available\r\n    auto stream = GetFstreamByPath(tempFilePath_, tempFilePathW_, std::ios::out | std::ios::app);\r\n    if (!stream->is_open()) {\r\n        return ARG_ERROR_OPEN_DOWNLOAD_TEMP_FILE;\r\n    }\r\n    stream->close();\r\n\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "sdk/src/resumable/MultiCopyObjectRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/MultiCopyObjectRequest.h>\r\n#include <alibabacloud/oss/Const.h>\r\n#include <sstream>\r\n#include \"../utils/FileSystemUtils.h\"\r\n#include \"../utils/Utils.h\"\r\n#include \"../model/ModelError.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\nstatic const std::string strEmpty = \"\";\r\n\r\nMultiCopyObjectRequest::MultiCopyObjectRequest(const std::string &bucket, const std::string &key, \r\n    const std::string &srcBucket, const std::string &srcKey) :\r\n    MultiCopyObjectRequest(bucket, key, srcBucket, srcKey, \"\", DefaultPartSize, DefaultResumableThreadNum)\r\n{}\r\n\r\nMultiCopyObjectRequest::MultiCopyObjectRequest(const std::string &bucket, const std::string &key, \r\n    const std::string &srcBucket, const std::string &srcKey, \r\n    const std::string &checkpointDir) :\r\n    MultiCopyObjectRequest(bucket, key, srcBucket, srcKey, checkpointDir, DefaultPartSize, DefaultResumableThreadNum)\r\n{}\r\n\r\nMultiCopyObjectRequest::MultiCopyObjectRequest(const std::string &bucket, const std::string &key, \r\n    const std::string &srcBucket, const std::string &srcKey,\r\n    const std::string &checkpointDir, const ObjectMetaData& meta): \r\n    MultiCopyObjectRequest(bucket, key, srcBucket, srcKey, checkpointDir, DefaultPartSize, DefaultResumableThreadNum, meta)\r\n{}\r\n\r\nMultiCopyObjectRequest::MultiCopyObjectRequest(const std::string &bucket, const std::string &key, \r\n    const std::string &srcBucket, const std::string &srcKey,\r\n    const std::string &checkpointDir, uint64_t partSize, uint32_t threadNum, const ObjectMetaData& meta):\r\n    MultiCopyObjectRequest(bucket, key, srcBucket, srcKey, checkpointDir, partSize, threadNum)\r\n{\r\n    metaData_ = meta;\r\n}\r\n\r\nMultiCopyObjectRequest::MultiCopyObjectRequest(const std::string &bucket, const std::string &key, \r\n    const std::string &srcBucket, const std::string &srcKey,\r\n    const std::string &checkpointDir, uint64_t partSize, uint32_t threadNum) :\r\n    OssResumableBaseRequest(bucket, key, checkpointDir, partSize, threadNum), \r\n    srcBucket_(srcBucket), \r\n    srcKey_(srcKey) \r\n{\r\n    setCopySource(srcBucket, srcKey);\r\n}\r\n\r\n//wstring\r\nMultiCopyObjectRequest::MultiCopyObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::string &srcBucket, const std::string &srcKey, \r\n    const std::wstring &checkpointDir) :\r\n    MultiCopyObjectRequest(bucket, key, srcBucket, srcKey, checkpointDir, DefaultPartSize, DefaultResumableThreadNum)\r\n{}\r\n\r\nMultiCopyObjectRequest::MultiCopyObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::string &srcBucket, const std::string &srcKey,\r\n    const std::wstring &checkpointDir, const ObjectMetaData& meta) :\r\n    MultiCopyObjectRequest(bucket, key, srcBucket, srcKey, checkpointDir, DefaultPartSize, DefaultResumableThreadNum, meta)\r\n{}\r\n\r\nMultiCopyObjectRequest::MultiCopyObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::string &srcBucket, const std::string &srcKey,\r\n    const std::wstring &checkpointDir, uint64_t partSize, uint32_t threadNum, const ObjectMetaData& meta) :\r\n    MultiCopyObjectRequest(bucket, key, srcBucket, srcKey, checkpointDir, partSize, threadNum)\r\n{\r\n    metaData_ = meta;\r\n}\r\n\r\nMultiCopyObjectRequest::MultiCopyObjectRequest(const std::string &bucket, const std::string &key, \r\n    const std::string &srcBucket, const std::string &srcKey,\r\n    const std::wstring &checkpointDir, uint64_t partSize, uint32_t threadNum) :\r\n    OssResumableBaseRequest(bucket, key, checkpointDir, partSize, threadNum),\r\n    srcBucket_(srcBucket), \r\n    srcKey_(srcKey)\r\n{\r\n    setCopySource(srcBucket, srcKey);\r\n}\r\n\r\nvoid MultiCopyObjectRequest::setCopySource(const std::string& srcBucket, const std::string& srcObject)\r\n{\r\n    std::stringstream ssDesc;\r\n    ssDesc << \"/\" << srcBucket << \"/\" << srcObject;\r\n    std::string value = ssDesc.str();\r\n    metaData_.addHeader(\"x-oss-copy-source\", value);\r\n}\r\n\r\nvoid MultiCopyObjectRequest::setSourceIfMatchEtag(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-copy-source-if-match\", value);\r\n}\r\n\r\nconst std::string& MultiCopyObjectRequest::SourceIfMatchEtag() const\r\n{\r\n    if (metaData_.HttpMetaData().find(\"x-oss-copy-source-if-match\") != metaData_.HttpMetaData().end()) {\r\n        return metaData_.HttpMetaData().at(\"x-oss-copy-source-if-match\");\r\n    }\r\n    return strEmpty;\r\n}\r\n\r\nvoid MultiCopyObjectRequest::setSourceIfNotMatchEtag(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-copy-source-if-none-match\", value);\r\n}\r\n\r\nconst std::string& MultiCopyObjectRequest::SourceIfNotMatchEtag() const\r\n{\r\n    if (metaData_.HttpMetaData().find(\"x-oss-copy-source-if-none-match\") != metaData_.HttpMetaData().end()) {\r\n        return metaData_.HttpMetaData().at(\"x-oss-copy-source-if-none-match\");\r\n    }\r\n    return strEmpty;\r\n}\r\n\r\nvoid MultiCopyObjectRequest::setSourceIfUnModifiedSince(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-copy-source-if-unmodified-since\", value);\r\n}\r\n\r\nconst std::string& MultiCopyObjectRequest::SourceIfUnModifiedSince() const\r\n{\r\n    if (metaData_.HttpMetaData().find(\"x-oss-copy-source-if-unmodified-since\") != metaData_.HttpMetaData().end()) {\r\n        return metaData_.HttpMetaData().at(\"x-oss-copy-source-if-unmodified-since\");\r\n    }\r\n    return strEmpty;\r\n}\r\n\r\nvoid MultiCopyObjectRequest::setSourceIfModifiedSince(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-copy-source-if-modified-since\", value);\r\n}\r\n\r\nconst std::string& MultiCopyObjectRequest::SourceIfModifiedSince() const\r\n{\r\n    if (metaData_.HttpMetaData().find(\"x-oss-copy-source-if-modified-since\") != metaData_.HttpMetaData().end()) {\r\n        return metaData_.HttpMetaData().at(\"x-oss-copy-source-if-modified-since\");\r\n    }\r\n    return strEmpty;\r\n}\r\n\r\nvoid MultiCopyObjectRequest::setMetadataDirective(const CopyActionList& action)\r\n{\r\n    metaData_.addHeader(\"x-oss-metadata-directive\", ToCopyActionName(action));\r\n}\r\n\r\nvoid MultiCopyObjectRequest::setAcl(const CannedAccessControlList& acl)\r\n{\r\n    metaData_.addHeader(\"x-oss-object-acl\", ToAclName(acl));\r\n}\r\n\r\nint MultiCopyObjectRequest::validate() const \r\n{\r\n    auto ret = OssResumableBaseRequest::validate();\r\n    if (ret != 0) {\r\n        return ret;\r\n    }\r\n\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "sdk/src/resumable/ResumableBaseWorker.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <string>\n#include <algorithm>\n#ifdef _WIN32\n#include <codecvt>\n#endif\n#include <alibabacloud/oss/Const.h>\n#include \"ResumableBaseWorker.h\"\n#include \"../utils/FileSystemUtils.h\"\n#include \"../utils/Utils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\n\nResumableBaseWorker::ResumableBaseWorker(uint64_t objectSize, uint64_t partSize) :\n    hasRecord_(false),\n    objectSize_(objectSize),\n    consumedSize_(0),\n    partSize_(partSize)\n{\n}\n\nint ResumableBaseWorker::validate(OssError& err)\n{\n    genRecordPath();\n    \n    if (hasRecordPath()) {\n        if (0 != loadRecord()) {\n            removeRecordFile();\n        }\n    }\n\n    if (hasRecord_) {\n        if (0 != validateRecord()) {\n            removeRecordFile();\n            if (0 != prepare(err)) {\n                return -1;\n            }\n        }\n    }\n    else {\n        if (0 != prepare(err)) {\n            return -1;\n        }\n    }\n    return 0;\n}\n\nvoid ResumableBaseWorker::determinePartSize()\n{\n    uint64_t partSize = partSize_;\n    uint64_t objectSize = objectSize_;\n    uint64_t partCount = (objectSize - 1) / partSize + 1;\n    while (partCount > PartNumberUpperLimit) {\n        partSize = partSize * 2;\n        partCount = (objectSize - 1) / partSize + 1;\n    }\n\n    partSize_ = partSize;\n}\n\nbool ResumableBaseWorker::hasRecordPath()\n{\n    return !(recordPath_.empty() && recordPathW_.empty());\n}\n\nvoid ResumableBaseWorker::removeRecordFile()\n{\n    if (!recordPath_.empty()) {\n        RemoveFile(recordPath_);\n    }\n#ifdef _WIN32\n    if (!recordPathW_.empty()) {\n        RemoveFile(recordPathW_);\n    }\n#endif\n}\n\n#ifdef _WIN32\n\nstd::string ResumableBaseWorker::toString(const std::wstring& str)\n{\n    std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;\n    return conv.to_bytes(str);\n}\n\nstd::wstring ResumableBaseWorker::toWString(const std::string& str)\n{\n    std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;\n    return conv.from_bytes(str);\n}\n\n#else\n\nstd::string ResumableBaseWorker::toString(const std::wstring& str)\n{\n    UNUSED_PARAM(str);\n    return \"\";\n}\n\nstd::wstring ResumableBaseWorker::toWString(const std::string& str)\n{\n    UNUSED_PARAM(str);\n    return L\"\";\n}\n\n#endif\n\n"
  },
  {
    "path": "sdk/src/resumable/ResumableBaseWorker.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <fstream>\n#include <mutex>\n#include <alibabacloud/oss/OssError.h>\n#include <alibabacloud/oss/OssRequest.h>\n#include \"../OssClientImpl.h\"\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ResumableBaseWorker\n    {\n    public:\n        ResumableBaseWorker(uint64_t objectSize, uint64_t partSize);\n\n    protected:\n        virtual int validate(OssError& err);\n        virtual void determinePartSize();\n        virtual void genRecordPath() = 0;\n        virtual int loadRecord() = 0;\n        virtual int prepare(OssError& err) = 0;\n        virtual int validateRecord() = 0;\n\n        virtual bool hasRecordPath();\n        virtual void removeRecordFile();\n\n        std::string  toString(const std::wstring& str);\n        std::wstring toWString(const std::string& str);\n\n        bool hasRecord_;\n        std::string recordPath_;\n        std::wstring recordPathW_;\n        std::mutex lock_;\n        uint64_t objectSize_;\n        uint64_t consumedSize_;\n        uint64_t partSize_;\n    };\n}\n}"
  },
  {
    "path": "sdk/src/resumable/ResumableCopier.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <fstream>\n#include <algorithm>\n#include <set>\n#include <alibabacloud/oss/model/UploadPartCopyRequest.h>\n#include <alibabacloud/oss/model/InitiateMultipartUploadRequest.h>\n#include <alibabacloud/oss/model/CompleteMultipartUploadRequest.h>\n#include <alibabacloud/oss/Const.h>\n#include \"../utils/Utils.h\"\n#include \"../utils/LogUtils.h\"\n#include \"../utils/FileSystemUtils.h\"\n#include \"../external/json/json.h\"\n//#include \"OssClientImpl.h\"\n#include \"../model/ModelError.h\"\n#include \"ResumableCopier.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nCopyObjectOutcome ResumableCopier::Copy() \n{\n    OssError err;\n\n    if (0 != validate(err)) {\n        return CopyObjectOutcome(err);\n    }\n\n    PartList partsToUploadCopy;\n    PartList partsCopied;\n    if (getPartsToUploadCopy(err, partsCopied, partsToUploadCopy) != 0) {\n        return CopyObjectOutcome(err);\n    }\n\n    std::vector<UploadPartCopyOutcome> outcomes;\n    std::vector<std::thread> threadPool;\n\n    for (uint32_t i = 0; i < request_.ThreadNum(); i++) {\n        threadPool.emplace_back(std::thread([&]() {\n            Part part;\n            while (true) {\n                {\n                std::lock_guard<std::mutex> lck(lock_);\n                if (partsToUploadCopy.empty())\n                    break;\n                part = partsToUploadCopy.front();\n                partsToUploadCopy.erase(partsToUploadCopy.begin());\n                }\n\n                if (!client_->isEnableRequest())\n                    break;\n\n                uint64_t offset = partSize_ * (part.PartNumber() - 1);\n                uint64_t length = part.Size();\n\n                auto uploadPartCopyReq = UploadPartCopyRequest(request_.Bucket(), request_.Key(), request_.SrcBucket(), request_.SrcKey(),\n                    uploadID_, part.PartNumber(), \n                    request_.SourceIfMatchEtag(), request_.SourceIfNotMatchEtag(),\n                    request_.SourceIfModifiedSince(), request_.SourceIfUnModifiedSince());\n                uploadPartCopyReq.setCopySourceRange(offset, offset + length - 1);\n                if (request_.RequestPayer() == RequestPayer::Requester) {\n                    uploadPartCopyReq.setRequestPayer(request_.RequestPayer());\n                }\n                if (request_.TrafficLimit() != 0) {\n                    uploadPartCopyReq.setTrafficLimit(request_.TrafficLimit());\n                }\n                if (!request_.VersionId().empty()) {\r\n                    uploadPartCopyReq.setVersionId(request_.VersionId());\r\n                }\n                auto outcome = client_->UploadPartCopy(uploadPartCopyReq);\n#ifdef ENABLE_OSS_TEST\n                if (!!(request_.Flags() & 0x40000000) && (part.PartNumber() == 2 || part.PartNumber() == 4)) {\n                    const char* TAG = \"ResumableCopyObjectClient\";\n                    OSS_LOG(LogLevel::LogDebug, TAG, \"NO.%d part data copy failed!\", part.PartNumber());\n                    outcome = UploadPartCopyOutcome();\n                }\n#endif // ENABLE_OSS_TEST\n\n                //lock\n                {\n                    std::lock_guard<std::mutex> lck(lock_);\n                    if (outcome.isSuccess()) {\n                        part.eTag_ = outcome.result().ETag();\n                        partsCopied.push_back(part);\n                    }\n                    outcomes.push_back(outcome);\n                    if (outcome.isSuccess()) {\n                        auto process = request_.TransferProgress();\n\n                        if (process.Handler) {\n                            consumedSize_ += length;\n                            process.Handler((size_t)length, consumedSize_, objectSize_, process.UserData);\n                        }\n                    }\n                }\n\n            }\n        }));\n    }\n\n    for (auto& worker : threadPool) {\n        if (worker.joinable()) {\n            worker.join();\n        }\n    }\n\n    for (const auto& outcome : outcomes) {\n        if (!outcome.isSuccess()) {\n            return CopyObjectOutcome(outcome.error());\n        }\n    }\n\n    if (!client_->isEnableRequest()) {\n        return CopyObjectOutcome(OssError(\"ClientError:100002\", \"Disable all requests by upper.\"));\n    }\n\n    // sort partsCopied\n    std::sort(partsCopied.begin(), partsCopied.end(), [](const Part& a, const Part& b) \n    {\n        return a.PartNumber() < b.PartNumber();\n    });\n\n    CompleteMultipartUploadRequest completeMultipartUploadReq(request_.Bucket(), request_.Key(), partsCopied, uploadID_);\n    if (request_.MetaData().HttpMetaData().find(\"x-oss-object-acl\")\n        != request_.MetaData().HttpMetaData().end()) {\n        std::string aclName = request_.MetaData().HttpMetaData().at(\"x-oss-object-acl\");\n        completeMultipartUploadReq.setAcl(ToAclType(aclName.c_str()));\n    }\n    if (!request_.EncodingType().empty()) {\n        completeMultipartUploadReq.setEncodingType(request_.EncodingType());\n    }\n    if (request_.RequestPayer() == RequestPayer::Requester) {\n        completeMultipartUploadReq.setRequestPayer(request_.RequestPayer());\n    }\n\n    auto compOutcome = client_->CompleteMultipartUpload(completeMultipartUploadReq);\n    if (!compOutcome.isSuccess()) {\n        return CopyObjectOutcome(compOutcome.error());\n    }\n\n    removeRecordFile();\n\n    CopyObjectResult result;\n    HeadObjectRequest hRequest(request_.Bucket(), request_.Key());\n    if (request_.RequestPayer() == RequestPayer::Requester) {\n        hRequest.setRequestPayer(request_.RequestPayer());\n    }\n    if (!compOutcome.result().VersionId().empty()) {\r\n        hRequest.setVersionId(compOutcome.result().VersionId());\r\n    }\n    auto hOutcome = client_->HeadObject(HeadObjectRequest(hRequest));\n    if (hOutcome.isSuccess()) {\n        result.setLastModified(hOutcome.result().LastModified());\n    }\n    result.setEtag(compOutcome.result().ETag());\n    result.setRequestId(compOutcome.result().RequestId());\n    result.setVersionId(compOutcome.result().VersionId());\n    return CopyObjectOutcome(result);\n}\n\nint ResumableCopier::prepare(OssError& err) \n{\n    determinePartSize();\n    ObjectMetaData metaData(request_.MetaData());\n    if (metaData.HttpMetaData().find(\"x-oss-metadata-directive\") == metaData.HttpMetaData().end() ||\n        (metaData.HttpMetaData().find(\"x-oss-metadata-directive\") != metaData.HttpMetaData().end() && \n            metaData.HttpMetaData().at(\"x-oss-metadata-directive\") == \"COPY\")) {\n        HeadObjectRequest hRequest(request_.SrcBucket(), request_.SrcKey());\n        if (request_.RequestPayer() == RequestPayer::Requester) {\n            hRequest.setRequestPayer(request_.RequestPayer());\n        }\n        if (!request_.VersionId().empty()) {\r\n            hRequest.setVersionId(request_.VersionId());\r\n        }\n        auto headObjectOutcome = client_->HeadObject(hRequest);\n        if (!headObjectOutcome.isSuccess()) {\n            err = headObjectOutcome.error();\n            return -1;\n        }\n        auto& meta = metaData.UserMetaData();\n        meta = headObjectOutcome.result().UserMetaData();\n    }\n\n    auto initMultipartUploadReq = InitiateMultipartUploadRequest(request_.Bucket(), request_.Key(), metaData);\n    if (!request_.EncodingType().empty()) {\n        initMultipartUploadReq.setEncodingType(request_.EncodingType());\n    }\n    if (request_.RequestPayer() == RequestPayer::Requester) {\n        initMultipartUploadReq.setRequestPayer(request_.RequestPayer());\n    }\n    auto outcome = client_->InitiateMultipartUpload(initMultipartUploadReq);\n    if (!outcome.isSuccess()) {\n        err = outcome.error();\n        return -1;\n    }\n\n    //init record_\n    uploadID_ = outcome.result().UploadId();\n\n    if (hasRecordPath()) {\n        initRecord(uploadID_);\n\n        Json::Value root;\n        root[\"opType\"] = record_.opType;\n        root[\"uploadID\"] = record_.uploadID;\n        root[\"srcBucket\"] = record_.srcBucket;\n        root[\"srcKey\"] = record_.srcKey;\n        root[\"bucket\"] = record_.bucket;\n        root[\"key\"] = record_.key;\n        root[\"mtime\"] = record_.mtime;\n        root[\"size\"] = record_.size;\n        root[\"partSize\"] = record_.partSize;\n\n        std::stringstream ss;\n        ss << root;\n        std::string md5Sum = ComputeContentETag(ss);\n        root[\"md5Sum\"] = md5Sum;\n\n        auto recordStream = GetFstreamByPath(recordPath_, recordPathW_, std::ios::out);\n        if (recordStream->is_open()) {\n            *recordStream << root;\n            recordStream->close();\n        }\n    }\n    return 0;\n}\n\nbool ResumableCopier::doesNotExistUploadId() {\r\n    // The upload ID may be invalid, or the upload may have been aborted or completed.\r\n    auto listRequest = ListPartsRequest(request_.Bucket(), request_.Key(), record_.uploadID);\r\n    if (!request_.EncodingType().empty()) {\r\n        listRequest.setEncodingType(request_.EncodingType());\r\n    }\r\n    if (request_.RequestPayer() == RequestPayer::Requester) {\r\n        listRequest.setRequestPayer(request_.RequestPayer());\r\n    }\r\n    listRequest.setMaxParts(1);\r\n    auto listOutcome = this->client_->ListParts(listRequest);\r\n\r\n    if (!listOutcome.isSuccess() &&\r\n        listOutcome.error().Code() == \"NoSuchUpload\") {\r\n        return true;\r\n    }\r\n\r\n    return false;\r\n}\n\nint ResumableCopier::validateRecord() \n{\n    auto record = record_;\n\n    if (record.size != objectSize_ || record.mtime != request_.ObjectMtime()) {\n        return ARG_ERROR_COPY_SRC_OBJECT_MODIFIED;\n    }\n\n    Json::Value root;\n    root[\"opType\"] = record.opType;\n    root[\"uploadID\"] = record.uploadID;\n    root[\"srcBucket\"] = record.srcBucket;\n    root[\"srcKey\"] = record.srcKey;\n    root[\"bucket\"] = record.bucket;\n    root[\"key\"] = record.key;\n    root[\"mtime\"] = record.mtime;\n    root[\"size\"] = record.size;\n    root[\"partSize\"] = record.partSize;\n\n    std::stringstream recordStream;\n    recordStream << root;\n    \n    std::string md5Sum = ComputeContentETag(recordStream);\n    if (md5Sum != record.md5Sum) {\n        return ARG_ERROR_COPY_RECORD_INVALID;\n    }\n\n    if (doesNotExistUploadId()) {\r\n        return ARG_ERROR_COPY_RECORD_INVALID;\r\n    }\n\n    return 0;\n}\n\nint ResumableCopier::loadRecord() \n{\n    if (hasRecordPath()) {\n        auto recordStream = GetFstreamByPath(recordPath_, recordPathW_, std::ios::in);\n        if (recordStream->is_open()) {\n            Json::Value root;\n            Json::CharReaderBuilder rbuilder;\n            std::string errMsg;\n            if (!Json::parseFromStream(rbuilder, *recordStream, &root, &errMsg))\n            {\n                return ARG_ERROR_PARSE_COPY_RECORD_FILE;\n            }\n\n            record_.opType = root[\"opType\"].asString();\n            record_.uploadID = root[\"uploadID\"].asString();\n            record_.srcBucket = root[\"srcBucket\"].asString();\n            record_.srcKey = root[\"srcKey\"].asString();\n            record_.bucket = root[\"bucket\"].asString();\n            record_.key = root[\"key\"].asString();\n            record_.size = root[\"size\"].asUInt64();\n            record_.mtime = root[\"mtime\"].asString();\n            record_.partSize = root[\"partSize\"].asUInt64();\n            record_.md5Sum = root[\"md5Sum\"].asString();\n\n            partSize_ = record_.partSize;\n            uploadID_ = record_.uploadID;\n            hasRecord_ = true;\n\n            recordStream->close();\n        }\n    }\n\n    return 0;\n}\n\nvoid ResumableCopier::genRecordPath() \n{\n    recordPath_ = \"\";\n    recordPathW_ = L\"\";\n\n    if (!request_.hasCheckpointDir()) {\n        return;\n    }\n\n    std::stringstream ss;\n    ss << \"oss://\" << request_.SrcBucket() << \"/\" << request_.SrcKey();\n    if (!request_.VersionId().empty()) {\r\n        ss << \"?versionId=\" << request_.VersionId();\r\n    }\n    auto srcPath = ss.str();\n    ss.str(\"\");\n    ss << \"oss://\" << request_.Bucket() << \"/\" << request_.Key();\n    auto destPath = ss.str();\n\n    auto safeFileName = ComputeContentETag(srcPath) + \"--\" + ComputeContentETag(destPath);\n\n    if (!request_.CheckpointDirW().empty()) {\n        recordPathW_ = request_.CheckpointDirW() + WPATH_DELIMITER + toWString(safeFileName);\n    }\n    else {\n        recordPath_ = request_.CheckpointDir() + PATH_DELIMITER + safeFileName;\n    }\n}\n\nint ResumableCopier::getPartsToUploadCopy(OssError &err, PartList &partsCopied, PartList &partsToUploadCopy) \n{\n    std::set<uint64_t> partNumbersUploaded;\n\n    if (hasRecord_) {\n        uint32_t marker = 0;\n        auto listPartsRequest = ListPartsRequest(request_.Bucket(), request_.Key(), uploadID_);\n        if (!request_.EncodingType().empty()) {\n            listPartsRequest.setEncodingType(request_.EncodingType());\n        }\n        if (request_.RequestPayer() == RequestPayer::Requester) {\n            listPartsRequest.setRequestPayer(request_.RequestPayer());\n        }\n        while (true) {\n            listPartsRequest.setPartNumberMarker(marker);\n            auto outcome = client_->ListParts(listPartsRequest);\n            if (!outcome.isSuccess()) {\n                err = outcome.error();\n                return -1;\n            }\n\n            auto parts = outcome.result().PartList();\n            for (auto iter = parts.begin(); iter != parts.end(); iter++) {\n                partNumbersUploaded.insert(iter->PartNumber());\n                partsCopied.emplace_back(*iter);\n                consumedSize_ += iter->Size();\n            }\n\n            if (outcome.result().IsTruncated()) {\n                marker = outcome.result().NextPartNumberMarker();\n            }\n            else {\n                break;\n            }\n        }\n    }\n\n    int32_t partCount = (int32_t)((objectSize_ - 1) / partSize_ + 1);\n    for (int32_t i = 0; i < partCount; i++) {\n        Part part;\n        part.partNumber_ = i + 1;\n        if (i == partCount - 1) {\n            part.size_ = objectSize_ - partSize_ * (partCount - 1);\n        }\n        else {\n            part.size_ = partSize_;\n        }\n\n        auto iterNum = partNumbersUploaded.find(part.PartNumber());\n        if (iterNum == partNumbersUploaded.end()) {\n            partsToUploadCopy.push_back(part);\n        }\n    }\n\n    return 0;\n}\n\nvoid ResumableCopier::initRecord(const std::string &uploadID) \n{\n    record_.opType = \"ResumableCopy\";\n    record_.uploadID = uploadID;\n    record_.srcBucket = request_.SrcBucket();\n    record_.srcKey = request_.SrcKey();\n    record_.bucket = request_.Bucket();\n    record_.key = request_.Key();\n    record_.mtime = request_.ObjectMtime();\n    record_.size = objectSize_;\n    record_.partSize = partSize_;\n}\n"
  },
  {
    "path": "sdk/src/resumable/ResumableCopier.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include \"ResumableBaseWorker.h\"\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    struct MultiCopyRecord {\r\n        std::string opType;\r\n        std::string uploadID;\r\n        std::string srcBucket;\r\n        std::string srcKey;\r\n        std::string bucket;\r\n        std::string key;\r\n        std::string mtime;\r\n        uint64_t size;\r\n        uint64_t partSize;\r\n        std::string md5Sum;\r\n    };\r\n\r\n    class ResumableCopier : public ResumableBaseWorker\r\n    {\r\n    public:\r\n        ResumableCopier(const MultiCopyObjectRequest &request, const OssClientImpl *client, uint64_t objectSize) \r\n            :ResumableBaseWorker(objectSize, request.PartSize()), request_(request), client_(client)\r\n        {\r\n        }\r\n\t    CopyObjectOutcome Copy();\r\n\r\n    protected:\r\n        void genRecordPath();\r\n        int loadRecord();\r\n        int validateRecord();\r\n        int prepare(OssError& err);\r\n        void initRecord(const std::string &uploadID);\r\n        int getPartsToUploadCopy(OssError &err, PartList &partsCopied, PartList &partsToUpload);\r\n        bool doesNotExistUploadId();\r\n\r\n        const MultiCopyObjectRequest request_;\r\n        MultiCopyRecord record_;\r\n        const OssClientImpl *client_;\r\n        std::string uploadID_;\r\n    };\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/src/resumable/ResumableDownloader.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <fstream>\r\n#include <algorithm>\r\n#include <set>\r\n#include <alibabacloud/oss/Const.h>\r\n#include \"../utils/Utils.h\"\r\n#include \"../utils/Crc64.h\"\r\n#include \"../utils/LogUtils.h\"\r\n#include \"../utils/FileSystemUtils.h\"\r\n#include \"../external/json/json.h\"\r\n//#include \"OssClientImpl.h\"\r\n#include \"ResumableDownloader.h\"\r\n#include \"../model/ModelError.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nstruct DownloaderTransferState {\r\n    int64_t transfered;\r\n    void *userData;\r\n};\r\n\r\nGetObjectOutcome ResumableDownloader::Download() \r\n{\r\n    OssError err;\r\n\r\n    if (0 != validate(err)) {\r\n        return GetObjectOutcome(err);\r\n    }\r\n\r\n    PartRecordList partsToDownload;\r\n    if (getPartsToDownload(err, partsToDownload) != 0) {\r\n        return GetObjectOutcome(err);\r\n    }\r\n\r\n    //task queue\r\n    PartRecordList downloadedParts;\r\n    if (hasRecord_) {\r\n        downloadedParts = record_.parts;\r\n    }\r\n    std::vector<GetObjectOutcome> outcomes;\r\n    std::vector<std::thread> threadPool;\r\n\r\n    for (uint32_t i = 0; i < request_.ThreadNum(); i++) {\r\n        threadPool.emplace_back(std::thread([&]() {\r\n            PartRecord part;\r\n            while (true) {\r\n                {\r\n                std::lock_guard<std::mutex> lck(lock_);\r\n                if (partsToDownload.empty())\r\n                    break;\r\n                part = partsToDownload.front();\r\n                partsToDownload.erase(partsToDownload.begin());\r\n                }\r\n\r\n                if (!client_->isEnableRequest())\r\n                    break;\r\n\r\n                uint64_t pos = partSize_ * (part.partNumber - 1);\r\n                uint64_t start = part.offset;\r\n                uint64_t end = start + part.size - 1;\r\n                auto getObjectReq = GetObjectRequest(request_.Bucket(), request_.Key(), request_.ModifiedSinceConstraint(), request_.UnmodifiedSinceConstraint(),\r\n                    request_.MatchingETagsConstraint(), request_.NonmatchingETagsConstraint(), request_.ResponseHeaderParameters());\r\n                getObjectReq.setResponseStreamFactory([this, pos]() {\r\n                    auto tmpFstream = GetFstreamByPath(request_.TempFilePath(), request_.TempFilePathW(),\r\n                        std::ios_base::in | std::ios_base::out | std::ios_base::binary);\r\n                    tmpFstream->seekp(pos, tmpFstream->beg);\r\n                    return tmpFstream;\r\n                });\r\n                getObjectReq.setRange(start, end);\r\n                getObjectReq.setFlags(getObjectReq.Flags() | REQUEST_FLAG_CHECK_CRC64 | REQUEST_FLAG_SAVE_CLIENT_CRC64);\r\n\r\n                DownloaderTransferState transferState;\r\n                auto process = request_.TransferProgress();\r\n                if (process.Handler) {\r\n                    transferState.transfered = 0;\r\n                    transferState.userData = (void *)this;\r\n                    TransferProgress uploadPartProcess = { DownloadPartProcessCallback, (void *)&transferState };\r\n                    getObjectReq.setTransferProgress(uploadPartProcess);\r\n                }\r\n                if (request_.RequestPayer() == RequestPayer::Requester) {\r\n                    getObjectReq.setRequestPayer(request_.RequestPayer());\r\n                }\r\n                if (request_.TrafficLimit() != 0) {\r\n                    getObjectReq.setTrafficLimit(request_.TrafficLimit());\r\n                }\r\n                if (!request_.VersionId().empty()) {\r\n                    getObjectReq.setVersionId(request_.VersionId());\r\n                }\r\n                auto outcome = GetObjectWrap(getObjectReq);\r\n#ifdef ENABLE_OSS_TEST\r\n                if (!!(request_.Flags() & 0x40000000) && part.partNumber == 2) {\r\n                    const char* TAG = \"ResumableDownloadObjectClient\";\r\n                    OSS_LOG(LogLevel::LogDebug, TAG, \"NO.2 part data download failed.\");\r\n                    outcome = GetObjectOutcome();\r\n                }\r\n#endif // ENABLE_OSS_TEST\r\n\r\n                // lock\r\n                {\r\n                    std::lock_guard<std::mutex> lck(lock_);\r\n                    if (outcome.isSuccess()) {\r\n                        part.crc64 = std::strtoull(outcome.result().Metadata().HttpMetaData().at(\"x-oss-hash-crc64ecma-by-client\").c_str(), nullptr, 10);\r\n                        downloadedParts.push_back(part);\r\n                    }\r\n                    outcomes.push_back(outcome);\r\n\r\n                    //update record\r\n                    if (hasRecordPath() && outcome.isSuccess()) {\r\n                        auto &record = record_;\r\n                        record.parts = downloadedParts;\r\n\r\n                        Json::Value root;\r\n                        root[\"opType\"] = record.opType;\r\n                        root[\"bucket\"] = record.bucket;\r\n                        root[\"key\"] = record.key;\r\n                        root[\"filePath\"] = record.filePath;\r\n                        root[\"mtime\"] = record.mtime;\r\n                        root[\"size\"] = record.size;\r\n                        root[\"partSize\"] = record.partSize;\r\n\r\n                        int index = 0;\r\n                        for (PartRecord& partR : record.parts) {\r\n                            root[\"parts\"][index][\"partNumber\"] = partR.partNumber;\r\n                            root[\"parts\"][index][\"size\"] = partR.size;\r\n                            root[\"parts\"][index][\"crc64\"] = partR.crc64;\r\n                            index++;\r\n                        }\r\n\r\n                        std::stringstream ss;\r\n                        ss << root;\r\n                        std::string md5Sum = ComputeContentETag(ss);\r\n                        root[\"md5Sum\"] = md5Sum;\r\n\r\n                        if (request_.RangeIsSet()) {\r\n                            root[\"rangeStart\"] = record.rangeStart;\r\n                            root[\"rangeEnd\"] = record.rangeEnd;\r\n                        }\r\n\r\n                        auto recordStream = GetFstreamByPath(recordPath_, recordPathW_, std::ios::out);\r\n                        if (recordStream->is_open()) {\r\n                            *recordStream << root;\r\n                            recordStream->close();\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }));\r\n    }\r\n\r\n    for (auto& worker : threadPool) {\r\n        if (worker.joinable()) {\r\n            worker.join();\r\n        }\r\n    }\r\n\r\n    std::shared_ptr<std::iostream> content = nullptr;\r\n    for (auto& outcome : outcomes) {\r\n        if (!outcome.isSuccess()) {\r\n            return GetObjectOutcome(outcome.error());\r\n        }\r\n        outcome.result().setContent(content);\r\n    }\r\n\r\n    if (!client_->isEnableRequest()) {\r\n        return GetObjectOutcome(OssError(\"ClientError:100002\", \"Disable all requests by upper.\"));\r\n    }\r\n\r\n    // sort\r\n    std::sort(downloadedParts.begin(), downloadedParts.end(), [&](const PartRecord& a, const PartRecord& b)\r\n    {\r\n        return a.partNumber < b.partNumber;\r\n    });\r\n\r\n    ObjectMetaData meta;\r\n    if (outcomes.empty()) {\r\n        HeadObjectRequest hRequest(request_.Bucket(), request_.Key());\r\n        if (request_.RequestPayer() == RequestPayer::Requester) {\r\n            hRequest.setRequestPayer(request_.RequestPayer());\r\n        }\r\n        if (!request_.VersionId().empty()) {\r\n            hRequest.setVersionId(request_.VersionId());\r\n        }\r\n        auto hOutcome = client_->HeadObject(hRequest);\r\n        if (!hOutcome.isSuccess()) {\r\n            return GetObjectOutcome(hOutcome.error());\r\n        }\r\n        meta = hOutcome.result();\r\n    }\r\n    else {\r\n        meta = outcomes[0].result().Metadata();\r\n    }\r\n    meta.setContentLength(contentLength_);\r\n\r\n    //check crc and update metadata\r\n    if (!request_.RangeIsSet()) {\r\n        if (client_->configuration().enableCrc64) {\r\n            uint64_t localCRC64 = downloadedParts[0].crc64;\r\n            for (size_t i = 1; i < downloadedParts.size(); i++) {\r\n                localCRC64 = CRC64::CombineCRC(localCRC64, downloadedParts[i].crc64, downloadedParts[i].size);\r\n            }\r\n            if (localCRC64 != meta.CRC64()) {\r\n                return GetObjectOutcome(OssError(\"CrcCheckError\", \"ResumableDownload object CRC checksum fail.\"));\r\n            }\r\n        }\r\n        meta.HttpMetaData().erase(Http::CONTENT_RANGE);\r\n    }\r\n    else {\r\n        std::stringstream ss;\r\n        ss << \"bytes \" << std::to_string(request_.RangeStart()) << \"-\";\r\n        if (request_.RangeEnd() != -1) { \r\n            ss << std::to_string(request_.RangeEnd()) << \"/\" << std::to_string(objectSize_);\r\n        } \r\n        else {\r\n            ss << std::to_string(objectSize_ - 1) << \"/\" << std::to_string(objectSize_);\r\n        }\r\n        meta.HttpMetaData()[\"Content-Range\"] = ss.str();\r\n    }\r\n\r\n    if (meta.HttpMetaData().find(\"x-oss-hash-crc64ecma-by-client\") != meta.HttpMetaData().end()) {\r\n        meta.HttpMetaData().erase(\"x-oss-hash-crc64ecma-by-client\");\r\n   }\r\n\r\n    if (!renameTempFile()) {\r\n        std::stringstream ss;\r\n        ss << \"rename temp file failed\";\r\n        return GetObjectOutcome(OssError(\"RenameError\", ss.str()));\r\n    }\r\n\r\n    removeRecordFile();\r\n\r\n    GetObjectResult result(request_.Bucket(), request_.Key(), meta);\r\n    return GetObjectOutcome(result);\r\n}\r\n\r\nint ResumableDownloader::prepare(OssError& err) \r\n{\r\n    UNUSED_PARAM(err);\r\n\r\n    determinePartSize();\r\n    if (hasRecordPath()) {\r\n        initRecord();\r\n\r\n        Json::Value root;\r\n        root[\"opType\"] = record_.opType;\r\n        root[\"bucket\"] = record_.bucket;\r\n        root[\"key\"] = record_.key;\r\n        root[\"filePath\"] = record_.filePath;\r\n        root[\"mtime\"] = record_.mtime;\r\n        root[\"size\"] = record_.size;\r\n        root[\"partSize\"] = record_.partSize;\r\n        root[\"parts\"].resize(0);\r\n\r\n        std::stringstream ss;\r\n        ss << root;\r\n        std::string md5Sum = ComputeContentETag(ss);\r\n        root[\"md5Sum\"] = md5Sum;\r\n\r\n        if (request_.RangeIsSet()) {\r\n            root[\"rangeStart\"] = record_.rangeStart;\r\n            root[\"rangeEnd\"] = record_.rangeEnd;\r\n        }\r\n\r\n        auto recordStream = GetFstreamByPath(recordPath_, recordPathW_, std::ios::out);\r\n        if (recordStream->is_open()) {\r\n            *recordStream << root;\r\n            recordStream->close();\r\n        }\r\n    }\r\n    return 0;\r\n}\r\n\r\nint ResumableDownloader::validateRecord() \r\n{\r\n    auto record = record_;\r\n\r\n    if (record.size != objectSize_ || record.mtime != request_.ObjectMtime()) {\r\n        return ARG_ERROR_DOWNLOAD_OBJECT_MODIFIED;\r\n    }\r\n\r\n    if (request_.RangeIsSet()) {\r\n        if (record.rangeStart != request_.RangeStart() || record.rangeEnd != request_.RangeEnd()) {\r\n            return ARG_ERROR_RANGE_HAS_BEEN_RESET;\r\n        }\r\n    }\r\n\r\n    Json::Value root;\r\n    root[\"opType\"] = record.opType;\r\n    root[\"bucket\"] = record.bucket;\r\n    root[\"key\"] = record.key;\r\n    root[\"filePath\"] = record.filePath;\r\n    root[\"mtime\"] = record.mtime;\r\n    root[\"size\"] = record.size;\r\n    root[\"partSize\"] = record.partSize;\r\n    root[\"parts\"].resize(0);\r\n    int index = 0;\r\n    for (PartRecord& part : record.parts) {\r\n        root[\"parts\"][index][\"partNumber\"] = part.partNumber;\r\n        root[\"parts\"][index][\"size\"] = part.size;\r\n        root[\"parts\"][index][\"crc64\"] = part.crc64;\r\n        index++;\r\n    }\r\n\r\n    if (!(record.rangeStart == 0 && record.rangeEnd == -1)) {\r\n        root[\"rangeStart\"] = record.rangeStart;\r\n        root[\"rangeEnd\"] = record.rangeEnd;\r\n    }\r\n\t\r\n    std::stringstream recordStream;\r\n    recordStream << root;\r\n\r\n    std::string md5Sum = ComputeContentETag(recordStream);\r\n    if (md5Sum != record.md5Sum) {\r\n        return -1;\r\n    }\r\n    return 0;\r\n}\r\n\r\nint ResumableDownloader::loadRecord() \r\n{\r\n    auto recordStream = GetFstreamByPath(recordPath_, recordPathW_, std::ios::in);\r\n    if (recordStream->is_open()) {\r\n        Json::Value root;\r\n        Json::CharReaderBuilder rbuilder;\r\n        std::string errMsg;\r\n        if (!Json::parseFromStream(rbuilder, *recordStream, &root, &errMsg))\r\n        {\r\n            return ARG_ERROR_PARSE_DOWNLOAD_RECORD_FILE;\r\n        }\r\n\r\n        record_.opType = root[\"opType\"].asString();\r\n        record_.bucket = root[\"bucket\"].asString();\r\n        record_.key = root[\"key\"].asString();\r\n        record_.filePath = root[\"filePath\"].asString();\r\n        record_.mtime = root[\"mtime\"].asString();\r\n        record_.size = root[\"size\"].asUInt64();\r\n        record_.partSize = root[\"partSize\"].asUInt64();\r\n\t\t\r\n        PartRecord part;\r\n        for (uint32_t i = 0; i < root[\"parts\"].size(); i++) {\r\n            Json::Value partValue = root[\"parts\"][i];\r\n            part.partNumber = partValue[\"partNumber\"].asInt();\r\n            part.size = partValue[\"size\"].asInt64();\r\n            part.crc64 = partValue[\"crc64\"].asUInt64();\r\n            record_.parts.push_back(part);\r\n        }\r\n        record_.md5Sum = root[\"md5Sum\"].asString();\r\n\t\t\r\n        if (root[\"rangeStart\"] != Json::nullValue && root[\"rangeEnd\"] != Json::nullValue) {\r\n            record_.rangeStart = root[\"rangeStart\"].asInt64();\r\n            record_.rangeEnd = root[\"rangeEnd\"].asInt64();\r\n        }\r\n        else if(root[\"rangeStart\"] == Json::nullValue && root[\"rangeEnd\"] == Json::nullValue){\r\n            record_.rangeStart = 0;\r\n            record_.rangeEnd = -1;\r\n        }else {\r\n            return ARG_ERROR_INVALID_RANGE_IN_DWONLOAD_RECORD;\r\n        }\r\n\r\n        partSize_ = record_.partSize;\r\n        hasRecord_ = true;\r\n        recordStream->close();\r\n    }\r\n\r\n    return 0;\r\n}\r\n\r\nvoid ResumableDownloader::genRecordPath() \r\n{\r\n    recordPath_ = \"\";\r\n    recordPathW_ = L\"\";\r\n\r\n    if (!request_.hasCheckpointDir())\r\n        return;\r\n\r\n    std::stringstream ss;\r\n    ss << \"oss://\" << request_.Bucket() << \"/\" << request_.Key();\r\n    if (!request_.VersionId().empty()) {\r\n        ss << \"?versionId=\" << request_.VersionId();\r\n    }\r\n    auto srcPath = ss.str();\r\n    auto destPath = !request_.FilePathW().empty() ? toString(request_.FilePathW()) : request_.FilePath();\r\n    auto safeFileName = ComputeContentETag(srcPath) + \"--\" + ComputeContentETag(destPath);\r\n\r\n    if (!request_.CheckpointDirW().empty()) {\r\n        recordPathW_ = request_.CheckpointDirW() + WPATH_DELIMITER + toWString(safeFileName);;\r\n    }\r\n    else {\r\n        recordPath_ = request_.CheckpointDir() + PATH_DELIMITER + safeFileName;\r\n    }\r\n}\r\n\r\nint ResumableDownloader::getPartsToDownload(OssError &err, PartRecordList &partsToDownload) \r\n{\r\n    UNUSED_PARAM(err);\r\n\r\n    std::set<uint64_t> partNumbersDownloaded;\r\n    if (hasRecord_) {\r\n        for (PartRecord &part : record_.parts) {\r\n            partNumbersDownloaded.insert(part.partNumber);\r\n            consumedSize_ += part.size;\r\n        }\r\n    }\r\n\r\n    int64_t start = 0;\r\n    int64_t end = objectSize_ - 1;\r\n\r\n    if (request_.RangeIsSet()) {\r\n        start = request_.RangeStart();\r\n        end = request_.RangeEnd();\r\n        if (end == -1) {\r\n            end = objectSize_ - 1;\r\n        }\r\n        contentLength_ = end - start + 1;\r\n    }\r\n\r\n    int32_t index = 1;\r\n    for (int64_t offset = start; offset < end + 1; offset += partSize_, index++) {\r\n        PartRecord part;\r\n        part.partNumber = index;\r\n        part.offset = offset;\r\n        if (offset + (int64_t)partSize_ > end) {\r\n            part.size = end - offset + 1;\r\n        }\r\n        else {\r\n            part.size = partSize_;\r\n        }\r\n\r\n        auto iterNum = partNumbersDownloaded.find(part.partNumber);\r\n        if (iterNum == partNumbersDownloaded.end()) {\r\n            partsToDownload.push_back(part);\r\n        }\r\n    }\r\n    return 0;\r\n}\r\n\r\nvoid ResumableDownloader::initRecord()\r\n{\r\n    auto filePath = request_.FilePath();\r\n    if (!request_.FilePathW().empty()) {\r\n        filePath = toString(request_.FilePathW());\r\n    }\r\n\r\n    record_.opType = \"ResumableDownload\";\r\n    record_.bucket = request_.Bucket();\r\n    record_.key = request_.Key();\r\n    record_.filePath = filePath;\r\n    record_.mtime = request_.ObjectMtime();\r\n    record_.size = objectSize_;\r\n    record_.partSize = partSize_;\r\n\r\n    //in this place we shuold consider the condition that range is not set\r\n    if (request_.RangeIsSet()) {\r\n        record_.rangeStart = request_.RangeStart();\r\n        record_.rangeEnd = request_.RangeEnd();\r\n    }\r\n    else {\r\n        record_.rangeStart = 0;\r\n        record_.rangeEnd = -1;\r\n    }\r\n}\r\n\r\nvoid ResumableDownloader::DownloadPartProcessCallback(size_t increment, int64_t transfered, int64_t total, void *userData) \r\n{\r\n    UNUSED_PARAM(total);\r\n    auto transferState = (DownloaderTransferState *)userData;\r\n    auto downloader = (ResumableDownloader*)transferState->userData;\r\n    auto inc = transfered - transferState->transfered;\r\n    transferState->transfered = std::max(transfered, transferState->transfered);\r\n    inc = std::max(inc, static_cast<int64_t>(0));\r\n    increment = static_cast<size_t>(inc);\r\n\r\n    std::lock_guard<std::mutex> lck(downloader->lock_);\r\n    downloader->consumedSize_ += increment;\r\n\r\n    auto process = downloader->request_.TransferProgress();\r\n    if (process.Handler) {\r\n        process.Handler(increment, downloader->consumedSize_, downloader->contentLength_, process.UserData);\r\n    }\r\n}\r\n\r\nbool ResumableDownloader::renameTempFile()\r\n{\r\n#ifdef _WIN32\r\n    if (!request_.TempFilePathW().empty()) {\r\n        return RenameFile(request_.TempFilePathW(), request_.FilePathW());\r\n    }\r\n    else\r\n#endif\r\n    {\r\n        return RenameFile(request_.TempFilePath(), request_.FilePath());\r\n    }\r\n}\r\n\r\nGetObjectOutcome ResumableDownloader::GetObjectWrap(const GetObjectRequest &request) const\r\n{\r\n    return client_->GetObject(request);\r\n}\r\n\r\n"
  },
  {
    "path": "sdk/src/resumable/ResumableDownloader.h",
    "content": "#pragma once\n/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include \"ResumableBaseWorker.h\"\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    struct PartRecord {\n        int32_t partNumber;\n        int64_t offset;\n        int64_t size;\n        uint64_t crc64;\n    };\n    typedef std::vector<PartRecord> PartRecordList;\n    struct DownloadRecord {\n        std::string opType;\n        std::string bucket;\n        std::string key;\n        std::string filePath;\n        std::string mtime;\n        uint64_t size;\n        uint64_t partSize;\n        PartRecordList parts;\n        std::string md5Sum;\n        int64_t rangeStart;\n        int64_t rangeEnd;\n        //crc64\n    };\n\n\n    class ResumableDownloader : public ResumableBaseWorker\n    {\n    public:\n        ResumableDownloader(const DownloadObjectRequest& request, const OssClientImpl *client, uint64_t objectSize)\n            : ResumableBaseWorker(objectSize, request.PartSize()), request_(request),client_(client), contentLength_(objectSize)\n        {}\n\n        GetObjectOutcome Download();\n\n    protected:\n        void genRecordPath();\n        int loadRecord();\n        int validateRecord();\n        int prepare(OssError& err);\n        void initRecord();\n        int getPartsToDownload(OssError &err, PartRecordList &partsToDownload);\n        bool renameTempFile();\n        static void DownloadPartProcessCallback(size_t increment, int64_t transfered, int64_t total, void *userData);\n\n        virtual GetObjectOutcome GetObjectWrap(const GetObjectRequest &request) const;\n\n        const DownloadObjectRequest request_;\n        DownloadRecord record_;\n        const OssClientImpl *client_;\n        uint64_t contentLength_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/src/resumable/ResumableUploader.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/UploadObjectRequest.h>\r\n#include <alibabacloud/oss/model/InitiateMultipartUploadRequest.h>\r\n#include <alibabacloud/oss/model/CompleteMultipartUploadRequest.h>\r\n#include <alibabacloud/oss/OssFwd.h>\r\n#include <alibabacloud/oss/Const.h>\r\n#include <sstream>\r\n#include <fstream>\r\n#include <algorithm>\r\n#include <iostream>\r\n#include <set>\r\n#include \"../external/json/json.h\"\r\n#include \"../utils/FileSystemUtils.h\"\r\n#include \"../utils/Utils.h\"\r\n#include \"../utils/LogUtils.h\"\r\n#include \"../utils/Crc64.h\"\r\n#include \"../OssClientImpl.h\"\r\n#include \"../model/ModelError.h\"\r\n#include \"ResumableUploader.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nstruct UploaderTransferState {\r\n    int64_t transfered;\r\n    void *userData;\r\n};\r\n\r\nResumableUploader::ResumableUploader(const UploadObjectRequest& request, const OssClientImpl *client) :\r\n    ResumableBaseWorker(request.ObjectSize(), request.PartSize()),\r\n    request_(request),\r\n    client_(client)\r\n{\r\n    if (!request.FilePath().empty()) {\r\n        time_t lastMtime;\r\n        std::streamsize fileSize;\r\n        if (GetPathInfo(request.FilePath(), lastMtime, fileSize)) {\r\n            objectSize_ = static_cast<uint64_t>(fileSize);\r\n        }\r\n    }\r\n#ifdef _WIN32\r\n    else if (!request.FilePathW().empty()) {\r\n        time_t lastMtime;\r\n        std::streamsize fileSize;\r\n        if (GetPathInfo(request.FilePathW(), lastMtime, fileSize)) {\r\n            objectSize_ = static_cast<uint64_t>(fileSize);\r\n        }\r\n    }\r\n#endif\r\n}\r\n\r\nPutObjectOutcome ResumableUploader::Upload()\r\n{\r\n    OssError err;\r\n\r\n    if (0 != validate(err)) {\r\n        return PutObjectOutcome(err);\r\n    }\r\n\r\n    PartList partsToUpload;\r\n    PartList uploadedParts;\r\n    if (getPartsToUpload(err, uploadedParts, partsToUpload) != 0){\r\n        return PutObjectOutcome(err);\r\n    }\r\n\r\n    std::vector<PutObjectOutcome> outcomes;\r\n    std::vector<std::thread> threadPool;\r\n\r\n    for (uint32_t i = 0; i < request_.ThreadNum(); i++) {\r\n        threadPool.emplace_back(std::thread([&]() {\r\n            Part part;\r\n            while (true) {\r\n                {\r\n                std::lock_guard<std::mutex> lck(lock_);\r\n                if (partsToUpload.empty())\r\n                    break;\r\n                part = partsToUpload.front();\r\n                partsToUpload.erase(partsToUpload.begin());\r\n                }\r\n\r\n                if (!client_->isEnableRequest())\r\n                    break;\r\n\r\n                uint64_t offset = partSize_ * (part.PartNumber() - 1);\r\n                uint64_t length = part.Size();\r\n\r\n                auto content = GetFstreamByPath(request_.FilePath(), request_.FilePathW(),\r\n                    std::ios::in | std::ios::binary);\r\n                content->seekg(offset, content->beg);\r\n\r\n                UploadPartRequest uploadPartRequest(request_.Bucket(), request_.Key(), part.PartNumber(), uploadID_, content);\r\n                uploadPartRequest.setContentLength(length);\r\n\r\n                UploaderTransferState transferState;\r\n                auto process = request_.TransferProgress();\r\n                if (process.Handler) {\r\n                    transferState.transfered = 0;\r\n                    transferState.userData = (void *)this;\r\n                    TransferProgress uploadPartProcess = { UploadPartProcessCallback, (void *)&transferState };\r\n                    uploadPartRequest.setTransferProgress(uploadPartProcess);\r\n                }\r\n                if (request_.RequestPayer() == RequestPayer::Requester) {\r\n                    uploadPartRequest.setRequestPayer(request_.RequestPayer());\r\n                }\r\n                if (request_.TrafficLimit() != 0) {\r\n                    uploadPartRequest.setTrafficLimit(request_.TrafficLimit());\r\n                }\r\n                auto outcome = UploadPartWrap(uploadPartRequest);\r\n#ifdef ENABLE_OSS_TEST\r\n                if (!!(request_.Flags() & 0x40000000) && part.PartNumber() == 2) {\r\n                    const char* TAG = \"ResumableUploadObjectClient\";\r\n                    OSS_LOG(LogLevel::LogDebug, TAG, \"NO.2 part data upload failed.\");\r\n                    outcome = PutObjectOutcome();\r\n                }\r\n#endif // ENABLE_OSS_TEST\r\n\r\n                if (outcome.isSuccess()) {\r\n                    part.eTag_  = outcome.result().ETag();\r\n                    part.cRC64_ = outcome.result().CRC64();\r\n                }\r\n\r\n                //lock\r\n                {\r\n                std::lock_guard<std::mutex> lck(lock_);\r\n                uploadedParts.push_back(part);\r\n                outcomes.push_back(outcome);\r\n                }\r\n            }\r\n        }));\r\n    }\r\n\r\n    for (auto& worker:threadPool) {\r\n        if(worker.joinable()){\r\n            worker.join();\r\n        }\r\n    }\r\n\r\n    if (!client_->isEnableRequest()) {\r\n        return PutObjectOutcome(OssError(\"ClientError:100002\", \"Disable all requests by upper.\"));\r\n    }\r\n\r\n    for (const auto& outcome : outcomes) {\r\n        if (!outcome.isSuccess()) {\r\n            return PutObjectOutcome(outcome.error());\r\n        }\r\n    }\r\n\r\n    // sort uploadedParts\r\n    std::sort(uploadedParts.begin(), uploadedParts.end(), [&](const Part& a, const Part& b)\r\n    {\r\n        return a.PartNumber() < b.PartNumber();\r\n    });\r\n\r\n    CompleteMultipartUploadRequest completeMultipartUploadReq(request_.Bucket(), request_.Key(), uploadedParts, uploadID_);\r\n    if (request_.MetaData().hasHeader(\"x-oss-object-acl\")) {\r\n        completeMultipartUploadReq.MetaData().HttpMetaData()[\"x-oss-object-acl\"] =\r\n            request_.MetaData().HttpMetaData().at(\"x-oss-object-acl\");\r\n    }\r\n    if (!request_.EncodingType().empty()) {\r\n        completeMultipartUploadReq.setEncodingType(request_.EncodingType());\r\n    }\r\n    if (request_.MetaData().hasHeader(\"x-oss-callback\")) {\r\n        completeMultipartUploadReq.MetaData().HttpMetaData()[\"x-oss-callback\"] =\r\n            request_.MetaData().HttpMetaData().at(\"x-oss-callback\");\r\n        if (request_.MetaData().hasHeader(\"x-oss-callback-var\")) {\r\n            completeMultipartUploadReq.MetaData().HttpMetaData()[\"x-oss-callback-var\"] =\r\n                request_.MetaData().HttpMetaData().at(\"x-oss-callback-var\");\r\n        }\r\n        if (request_.MetaData().hasHeader(\"x-oss-pub-key-url\")) {\r\n            completeMultipartUploadReq.MetaData().HttpMetaData()[\"x-oss-pub-key-url\"] =\r\n                request_.MetaData().HttpMetaData().at(\"x-oss-pub-key-url\");\r\n        }\r\n    }\r\n    if (request_.RequestPayer() == RequestPayer::Requester) {\r\n        completeMultipartUploadReq.setRequestPayer(request_.RequestPayer());\r\n    }\r\n    auto outcome = CompleteMultipartUploadWrap(completeMultipartUploadReq);\r\n    if (!outcome.isSuccess()) {\r\n        return PutObjectOutcome(outcome.error());\r\n    }\r\n\r\n    // crc\r\n    uint64_t localCRC64 = uploadedParts[0].CRC64();\r\n    for (size_t i = 1; i < uploadedParts.size(); i++) {\r\n        localCRC64 = CRC64::CombineCRC(localCRC64, uploadedParts[i].CRC64(), uploadedParts[i].Size());\r\n    }\r\n\r\n    uint64_t ossCRC64 = outcome.result().CRC64();\r\n    if (ossCRC64 != 0 && localCRC64 != ossCRC64) {\r\n        return PutObjectOutcome(OssError(\"CrcCheckError\", \"ResumableUpload Object CRC Checksum fail.\"));\r\n    }\r\n\r\n    removeRecordFile();\r\n\r\n    HeaderCollection headers;\r\n    headers[Http::ETAG] = outcome.result().ETag();\r\n    headers[\"x-oss-hash-crc64ecma\"] = std::to_string(outcome.result().CRC64());\r\n    headers[\"x-oss-request-id\"] = outcome.result().RequestId();\r\n    if (!outcome.result().VersionId().empty()) {\r\n        headers[\"x-oss-version-id\"] = outcome.result().VersionId();\r\n    }\r\n    return PutObjectOutcome(PutObjectResult(headers, outcome.result().Content()));\r\n}\r\n\r\nint ResumableUploader::prepare(OssError& err)\r\n{\r\n    determinePartSize();\r\n    auto initMultipartUploadReq = InitiateMultipartUploadRequest(request_.Bucket(), request_.Key(), request_.MetaData());\r\n    if (!request_.EncodingType().empty()) {\r\n        initMultipartUploadReq.setEncodingType(request_.EncodingType());\r\n    }\r\n    if (request_.RequestPayer() == RequestPayer::Requester) {\r\n        initMultipartUploadReq.setRequestPayer(request_.RequestPayer());\r\n    }\r\n    auto outcome = InitiateMultipartUploadWrap(initMultipartUploadReq);\r\n    if(!outcome.isSuccess()){\r\n        err = outcome.error();\r\n        return -1;\r\n    }\r\n\r\n    //init record_\r\n    uploadID_ = outcome.result().UploadId();\r\n\r\n    if (hasRecordPath()) {\r\n        Json::Value root;\r\n\r\n        initRecordInfo();\r\n        dumpRecordInfo(root);\r\n\r\n        std::stringstream ss;\r\n        ss << root;\r\n        std::string md5Sum = ComputeContentETag(ss);\r\n        root[\"md5Sum\"] = md5Sum;\r\n\r\n        auto recordStream = GetFstreamByPath(recordPath_, recordPathW_, std::ios::out);\n        if (recordStream->is_open()) {\r\n            *recordStream << root;\r\n            recordStream->close();\r\n        }\r\n    }\r\n    return 0;\r\n}\r\n\r\nbool ResumableUploader::doesNotExistUploadId() {\r\n    // The upload ID may be invalid, or the upload may have been aborted or completed.\r\n    auto listRequest = ListPartsRequest(request_.Bucket(), request_.Key(), record_.uploadID);\r\n    if (!request_.EncodingType().empty()) {\r\n        listRequest.setEncodingType(request_.EncodingType());\r\n    }\r\n    if (request_.RequestPayer() == RequestPayer::Requester) {\r\n        listRequest.setRequestPayer(request_.RequestPayer());\r\n    }\r\n    listRequest.setMaxParts(1);\r\n    auto listOutcome = this->client_->ListParts(listRequest);\r\n\r\n    if (!listOutcome.isSuccess() && \r\n        listOutcome.error().Code() == \"NoSuchUpload\") {\r\n        return true;\r\n    }\r\n\r\n    return false;\r\n}\r\n\r\nint ResumableUploader::validateRecord()\r\n{\r\n    if (record_.size != objectSize_ || record_.mtime != request_.ObjectMtime()){\r\n        return ARG_ERROR_UPLOAD_FILE_MODIFIED;\r\n    }\r\n\r\n    Json::Value root;\r\n\r\n    dumpRecordInfo(root);\r\n\r\n    std::stringstream recordStream;\r\n    recordStream << root;\r\n\r\n    std::string md5Sum = ComputeContentETag(recordStream);\r\n    if (md5Sum != record_.md5Sum){\r\n        return ARG_ERROR_UPLOAD_RECORD_INVALID;\r\n    }\r\n\r\n    if (doesNotExistUploadId()) {\r\n        return ARG_ERROR_UPLOAD_RECORD_INVALID;\r\n    }\r\n\r\n    return 0;\r\n}\r\n\r\nint ResumableUploader::loadRecord()\r\n{\r\n    auto recordStream = GetFstreamByPath(recordPath_, recordPathW_, std::ios::in);\n    if (recordStream->is_open()){\r\n        Json::Value root;\r\n        Json::CharReaderBuilder rbuilder;\r\n        std::string errMsg;\r\n        if (!Json::parseFromStream(rbuilder, *recordStream, &root, &errMsg))\r\n        {\r\n            return ARG_ERROR_PARSE_UPLOAD_RECORD_FILE;\r\n        }\r\n\r\n        buildRecordInfo(root);\r\n\r\n        partSize_ = record_.partSize;\r\n        uploadID_ = record_.uploadID;\r\n        hasRecord_ = true;\r\n\r\n        recordStream->close();\r\n    }\r\n\r\n    return 0;\r\n}\r\n\r\nvoid ResumableUploader::genRecordPath()\r\n{\r\n    recordPath_  = \"\";\r\n    recordPathW_ = L\"\";\r\n\r\n    if (!request_.hasCheckpointDir())\r\n        return;\r\n\r\n    auto srcPath = !request_.FilePathW().empty()? toString(request_.FilePathW()): request_.FilePath();\r\n    std::stringstream ss;\r\n    ss << \"oss://\" << request_.Bucket() << \"/\" << request_.Key();\r\n    auto destPath = ss.str();\r\n\r\n    auto safeFileName = ComputeContentETag(srcPath) + \"--\" + ComputeContentETag(destPath);\r\n  \r\n    if (!request_.CheckpointDirW().empty()) {\r\n        recordPathW_ = request_.CheckpointDirW() + WPATH_DELIMITER + toWString(safeFileName);;\r\n    }\r\n    else {\r\n        recordPath_ = request_.CheckpointDir() + PATH_DELIMITER + safeFileName;\r\n    }\r\n}\r\n\r\nint ResumableUploader::getPartsToUpload(OssError &err, PartList &partsUploaded, PartList &partsToUpload)\r\n{\r\n    std::set<uint64_t> partNumbersUploaded;\r\n    \r\n    if(hasRecord_){ \r\n        uint32_t marker = 0;\r\n        auto listPartsRequest = ListPartsRequest(request_.Bucket(), request_.Key(), uploadID_);\r\n        if (!request_.EncodingType().empty()) {\r\n            listPartsRequest.setEncodingType(request_.EncodingType());\r\n        }\r\n        if (request_.RequestPayer() == RequestPayer::Requester) {\r\n            listPartsRequest.setRequestPayer(request_.RequestPayer());\r\n        }\r\n        while(true){\r\n            listPartsRequest.setPartNumberMarker(marker);\r\n            auto outcome = ListPartsWrap(listPartsRequest);\r\n            if(!outcome.isSuccess()){\r\n                err = outcome.error();\r\n                return -1;\r\n            }\r\n\r\n            auto parts = outcome.result().PartList();\r\n            for(auto iter = parts.begin(); iter != parts.end(); iter++){\r\n                if (iter->Size() != static_cast<int64_t>(partSize_)) {\r\n                    continue;\r\n                }\r\n                partNumbersUploaded.insert(iter->PartNumber());\r\n                partsUploaded.emplace_back(*iter);\r\n                consumedSize_ += iter->Size();\r\n            }\r\n\r\n            if(outcome.result().IsTruncated()){\r\n                marker = outcome.result().NextPartNumberMarker();\r\n            }else{\r\n                break;\r\n            }\r\n        }\r\n    }\r\n\r\n    int32_t partCount = (int32_t)((objectSize_ - 1)/ partSize_ + 1);\r\n    for(int32_t i = 0; i < partCount; i++){\r\n        Part part;\r\n        part.partNumber_ = i+1;\r\n        if (i == partCount -1 ){\r\n            part.size_ = objectSize_ - partSize_ * (partCount - 1);\r\n        }else{\r\n            part.size_ = partSize_;\r\n        }\r\n\r\n        auto iterNum = partNumbersUploaded.find(part.PartNumber());\r\n        if (iterNum == partNumbersUploaded.end()){\r\n            partsToUpload.push_back(part);\r\n        }\r\n    }\r\n\r\n    return 0;\r\n}\r\n\r\nvoid ResumableUploader::initRecordInfo()\r\n{\r\n    record_.opType = \"ResumableUpload\";\r\n    record_.uploadID = uploadID_;\r\n    record_.filePath = request_.FilePath();\r\n    record_.bucket = request_.Bucket();\r\n    record_.key = request_.Key();\r\n    record_.mtime = request_.ObjectMtime();\r\n    record_.size = objectSize_;\r\n    record_.partSize = partSize_;\r\n}\r\n\r\nvoid ResumableUploader::buildRecordInfo(const AlibabaCloud::OSS::Json::Value& root)\r\n{\r\n    record_.opType = root[\"opType\"].asString();\r\n    record_.uploadID = root[\"uploadID\"].asString();\r\n    record_.filePath = root[\"filePath\"].asString();\r\n    record_.bucket = root[\"bucket\"].asString();\r\n    record_.key = root[\"key\"].asString();\r\n    record_.size = root[\"size\"].asUInt64();\r\n    record_.mtime = root[\"mtime\"].asString();\r\n    record_.partSize = root[\"partSize\"].asUInt64();\r\n    record_.md5Sum = root[\"md5Sum\"].asString();\r\n}\r\n\r\nvoid ResumableUploader::dumpRecordInfo(AlibabaCloud::OSS::Json::Value& root)\r\n{\r\n    root[\"opType\"] = record_.opType;\r\n    root[\"uploadID\"] = record_.uploadID;\r\n    root[\"filePath\"] = record_.filePath;\r\n    root[\"bucket\"] = record_.bucket;\r\n    root[\"key\"] = record_.key;\r\n    root[\"mtime\"] = record_.mtime;\r\n    root[\"size\"] = record_.size;\r\n    root[\"partSize\"] = record_.partSize;\r\n}\r\n\r\nvoid ResumableUploader::UploadPartProcessCallback(size_t increment, int64_t transfered, int64_t total, void *userData) \r\n{\r\n    UNUSED_PARAM(total);\r\n    auto transferState = (UploaderTransferState *)userData;\r\n    auto uploader = (ResumableUploader*)transferState->userData;\r\n    auto inc = transfered - transferState->transfered;\r\n    transferState->transfered = std::max(transfered, transferState->transfered);\r\n    inc = std::max(inc, static_cast<int64_t>(0));\r\n    increment = static_cast<size_t>(inc);\r\n\r\n    std::lock_guard<std::mutex> lck(uploader->lock_);\r\n    uploader->consumedSize_ += increment;\r\n\r\n    auto process = uploader->request_.TransferProgress();\r\n    if (process.Handler) {\r\n        process.Handler(increment, uploader->consumedSize_, uploader->objectSize_, process.UserData);\r\n    }\r\n}\r\n\r\nInitiateMultipartUploadOutcome ResumableUploader::InitiateMultipartUploadWrap(const InitiateMultipartUploadRequest &request) const\r\n{\r\n    return client_->InitiateMultipartUpload(request);\r\n}\r\n\r\nPutObjectOutcome ResumableUploader::UploadPartWrap(const UploadPartRequest &request) const\r\n{\r\n    return client_->UploadPart(request);\r\n}\r\n\r\nListPartsOutcome ResumableUploader::ListPartsWrap(const ListPartsRequest &request) const\r\n{\r\n    return client_->ListParts(request);\r\n}\r\n\r\nCompleteMultipartUploadOutcome ResumableUploader::CompleteMultipartUploadWrap(const CompleteMultipartUploadRequest &request) const\r\n{\r\n    return client_->CompleteMultipartUpload(request);\r\n}\r\n\r\n\r\n"
  },
  {
    "path": "sdk/src/resumable/ResumableUploader.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include \"ResumableBaseWorker.h\"\n#include \"../external/json/json.h\"\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    struct UploadRecord{\n        std::string opType;\n        std::string uploadID;\n        std::string filePath;\n        std::string bucket;\n        std::string key;\n        std::string mtime;\n        uint64_t size;\n        uint64_t partSize;\n        std::string md5Sum;\n    };\n\n    class ResumableUploader : public ResumableBaseWorker\n    {\n    public:\n        ResumableUploader(const UploadObjectRequest& request, const OssClientImpl *client);\n\t\n        PutObjectOutcome Upload();\n\n    protected:\n        virtual InitiateMultipartUploadOutcome InitiateMultipartUploadWrap(const InitiateMultipartUploadRequest &request) const;\n        virtual PutObjectOutcome UploadPartWrap(const UploadPartRequest &request) const;\n        virtual ListPartsOutcome ListPartsWrap(const ListPartsRequest &request) const;\n        virtual CompleteMultipartUploadOutcome CompleteMultipartUploadWrap(const CompleteMultipartUploadRequest &request) const;\n\n        virtual void initRecordInfo();\n        virtual void buildRecordInfo(const AlibabaCloud::OSS::Json::Value& value);\n        virtual void dumpRecordInfo(AlibabaCloud::OSS::Json::Value& value);\n        virtual int validateRecord();\n\n    private:\n        int getPartsToUpload(OssError &err, PartList &partsUploaded, PartList &partsToUpload);\n        virtual void genRecordPath();\n        virtual int loadRecord();\n        virtual int prepare(OssError& err);\n        bool doesNotExistUploadId();\n\n        const UploadObjectRequest& request_;\n        UploadRecord record_;\n        const OssClientImpl *client_;\n        std::string uploadID_;\n        static void UploadPartProcessCallback(size_t increment, int64_t transfered, int64_t total, void *userData);\n    };\n} \n}\n"
  },
  {
    "path": "sdk/src/resumable/UploadObjectRequest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <alibabacloud/oss/model/UploadObjectRequest.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n#include <alibabacloud/oss/Const.h>\r\n#include <fstream>\r\n#include \"../utils/Utils.h\"\r\n#include \"../utils/FileSystemUtils.h\"\r\n#include \"../model/ModelError.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nUploadObjectRequest::UploadObjectRequest(const std::string &bucket, const std::string &key, \r\n    const std::string &filePath, const std::string &checkpointDir, \r\n    const uint64_t partSize, const uint32_t threadNum): \r\n    OssResumableBaseRequest(bucket, key, checkpointDir, partSize, threadNum), \r\n    filePath_(filePath)\r\n{\r\n    time_t lastMtime;\r\n    std::streamsize fileSize;\r\n    isFileExist_ = true;\r\n    if (!GetPathInfo(filePath_, lastMtime, fileSize)) {\r\n        //if fail, ignore the lastmodified time.\r\n        lastMtime = 0;\r\n        fileSize = 0;\r\n        isFileExist_ = false;\r\n    }\r\n    mtime_ = ToGmtTime(lastMtime);\r\n    objectSize_ = static_cast<uint64_t>(fileSize);\r\n}\r\n\r\nUploadObjectRequest::UploadObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::string &filePath, const std::string &checkpointDir,\r\n    const uint64_t partSize, const uint32_t threadNum, const ObjectMetaData& meta): \r\n    UploadObjectRequest(bucket, key, filePath, checkpointDir, partSize, threadNum)\r\n{\r\n    metaData_ = meta;\r\n}\r\n\r\nUploadObjectRequest::UploadObjectRequest(const std::string &bucket, const std::string &key, \r\n    const std::string &filePath, const std::string &checkpointDir, const ObjectMetaData& meta):\r\n    UploadObjectRequest(bucket, key, filePath, checkpointDir, DefaultPartSize, DefaultResumableThreadNum, meta)\r\n{}\r\n\r\nUploadObjectRequest::UploadObjectRequest(const std::string &bucket, const std::string &key, \r\n    const std::string &filePath, const std::string &checkpointDir) : \r\n    UploadObjectRequest(bucket, key, filePath, checkpointDir, DefaultPartSize, DefaultResumableThreadNum)\r\n{}\r\n\r\nUploadObjectRequest::UploadObjectRequest(const std::string &bucket, const std::string &key, \r\n    const std::string &filePath): \r\n    UploadObjectRequest(bucket, key, filePath, \"\", DefaultPartSize, DefaultResumableThreadNum)\r\n{}\r\n\r\n//wstring\r\nUploadObjectRequest::UploadObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::wstring &filePath, const std::wstring &checkpointDir,\r\n    const uint64_t partSize, const uint32_t threadNum) :\r\n    OssResumableBaseRequest(bucket, key, checkpointDir, partSize, threadNum),\r\n    filePathW_(filePath)\r\n{\r\n#ifdef _WIN32\r\n    time_t lastMtime;\r\n    std::streamsize fileSize;\r\n    isFileExist_ = true;\r\n    if (!GetPathInfo(filePathW_, lastMtime, fileSize)) {\r\n        //if fail, ignore the lastmodified time.\r\n        lastMtime = 0;\r\n        fileSize = 0;\r\n        isFileExist_ = false;\r\n    }\r\n    mtime_ = ToGmtTime(lastMtime);\r\n    objectSize_ = static_cast<uint64_t>(fileSize);\r\n#else\r\n    objectSize_ = 0;\r\n    time_t lastMtime = 0;\r\n    mtime_ = ToGmtTime(lastMtime);\r\n    isFileExist_ = false;\r\n#endif\r\n}\r\n\r\nUploadObjectRequest::UploadObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::wstring &filePath, const std::wstring &checkpointDir,\r\n    const uint64_t partSize, const uint32_t threadNum, const ObjectMetaData& meta) :\r\n    UploadObjectRequest(bucket, key, filePath, checkpointDir, partSize, threadNum)\r\n{\r\n    metaData_ = meta;\r\n}\r\n\r\nUploadObjectRequest::UploadObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::wstring &filePath, const std::wstring &checkpointDir, const ObjectMetaData& meta) :\r\n    UploadObjectRequest(bucket, key, filePath, checkpointDir, DefaultPartSize, DefaultResumableThreadNum, meta)\r\n{}\r\n\r\nUploadObjectRequest::UploadObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::wstring &filePath, const std::wstring &checkpointDir) :\r\n    UploadObjectRequest(bucket, key, filePath, checkpointDir, DefaultPartSize, DefaultResumableThreadNum)\r\n{}\r\n\r\nUploadObjectRequest::UploadObjectRequest(const std::string &bucket, const std::string &key,\r\n    const std::wstring &filePath) :\r\n    UploadObjectRequest(bucket, key, filePath, L\"\", DefaultPartSize, DefaultResumableThreadNum)\r\n{}\r\n\r\n\r\nvoid UploadObjectRequest::setAcl(CannedAccessControlList& acl)\r\n{\r\n    metaData_.addHeader(\"x-oss-object-acl\", ToAclName(acl));\r\n}\r\n\r\nvoid UploadObjectRequest::setCallback(const std::string& callback, const std::string& callbackVar)\r\n{\r\n    metaData_.removeHeader(\"x-oss-callback\");\r\n    metaData_.removeHeader(\"x-oss-callback-var\");\r\n\r\n    if (!callback.empty()) {\r\n        metaData_.addHeader(\"x-oss-callback\", callback);\r\n    }\r\n\r\n    if (!callbackVar.empty()) {\r\n        metaData_.addHeader(\"x-oss-callback-var\", callbackVar);\r\n    }\r\n}\r\n\r\nvoid UploadObjectRequest::setTagging(const std::string& value)\r\n{\r\n    metaData_.addHeader(\"x-oss-tagging\", value);\r\n}\r\n\r\nint UploadObjectRequest::validate() const \r\n{\r\n    auto ret = OssResumableBaseRequest::validate();\r\n    if (ret != 0) {\r\n        return ret;\r\n    }\r\n\r\n#if !defined(_WIN32)\r\n    if (!filePathW_.empty()) {\r\n        return ARG_ERROR_PATH_NOT_SUPPORT_WSTRING_TYPE;\r\n    }\r\n#endif\r\n\r\n    //path and checkpoint must be same type.\r\n    if ((!filePath_.empty() && !checkpointDirW_.empty()) ||\r\n        (!filePathW_.empty() && !checkpointDir_.empty())) {\r\n        return ARG_ERROR_PATH_NOT_SAME_TYPE;\r\n    }\r\n\r\n    if (!isFileExist_) {\r\n        return ARG_ERROR_OPEN_UPLOAD_FILE;\r\n    }\r\n\r\n    return 0;\r\n}\r\n"
  },
  {
    "path": "sdk/src/signer/HmacSha1Signer.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"HmacSha1Signer.h\"\n#if 0//def _WIN32\n#include <windows.h>\n#include <wincrypt.h>\n#else\n#include <openssl/hmac.h>\n#ifdef OPENSSL_IS_BORINGSSL \n#include <openssl/base64.h>\n#endif\n#endif\n\nusing namespace AlibabaCloud::OSS;\n\nHmacSha1Signer::HmacSha1Signer() \n{\n}\n\nHmacSha1Signer::~HmacSha1Signer()\n{\n}\n\nstd::string HmacSha1Signer::generate(const std::string & src, const std::string & secret)\n{\n    if (src.empty())\n        return std::string();\n\n#if 0//def _WIN32\n    typedef struct _my_blob {\n        BLOBHEADER hdr;\n        DWORD dwKeySize;\n        BYTE rgbKeyData[];\n    }my_blob;\n\n    DWORD kbLen = sizeof(my_blob) + secret.size();\n    my_blob * kb = (my_blob *)LocalAlloc(LPTR, kbLen);\n    kb->hdr.bType = PLAINTEXTKEYBLOB;\n    kb->hdr.bVersion = CUR_BLOB_VERSION;\n    kb->hdr.reserved = 0;\n    kb->hdr.aiKeyAlg = CALG_RC2;\n    kb->dwKeySize = secret.size();\n    memcpy(&kb->rgbKeyData, secret.c_str(), secret.size());\n\n    HCRYPTPROV hProv = 0;\n    HCRYPTKEY hKey = 0;\n    HCRYPTHASH hHmacHash = 0;\n    BYTE pbHash[32];\n    DWORD dwDataLen = 32;\n    HMAC_INFO HmacInfo;\n    ZeroMemory(&HmacInfo, sizeof(HmacInfo));\n    HmacInfo.HashAlgid = CALG_SHA1;\n\n    CryptAcquireContext(&hProv, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_NEWKEYSET);\n    CryptImportKey(hProv, (BYTE*)kb, kbLen, 0, CRYPT_IPSEC_HMAC_KEY, &hKey);\n    CryptCreateHash(hProv, CALG_HMAC, hKey, 0, &hHmacHash);\n    CryptSetHashParam(hHmacHash, HP_HMAC_INFO, (BYTE*)&HmacInfo, 0);\n    CryptHashData(hHmacHash, (BYTE*)(src.c_str()), src.size(), 0);\n    CryptGetHashParam(hHmacHash, HP_HASHVAL, pbHash, &dwDataLen, 0);\n\n    LocalFree(kb);\n    CryptDestroyHash(hHmacHash);\n    CryptDestroyKey(hKey);\n    CryptReleaseContext(hProv, 0);\n\n    DWORD dlen = 0;\n    CryptBinaryToString(pbHash, dwDataLen, CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, NULL, &dlen);\n    char* dest = new char[dlen];\n    CryptBinaryToString(pbHash, dwDataLen, CRYPT_STRING_BASE64 | CRYPT_STRING_NOCRLF, dest, &dlen);\n\n    std::string ret = std::string(dest, dlen);\n    delete[] dest;\n    return ret;\n#else\n    unsigned char md[32];\n    unsigned int mdLen = 32;\n\n    if (HMAC(EVP_sha1(), secret.c_str(), static_cast<int>(secret.size()),\n        reinterpret_cast<const unsigned char*>(src.c_str()), src.size(),\n        md, &mdLen) == nullptr)\n        return std::string();\n\n    char encodedData[100];\n    EVP_EncodeBlock(reinterpret_cast<unsigned char*>(encodedData), md, mdLen);\n    return encodedData;\n#endif\n}"
  },
  {
    "path": "sdk/src/signer/HmacSha1Signer.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n\n#include \"Signer.h\"\n\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n\n    class  HmacSha1Signer \n    {\n    public:\n        HmacSha1Signer();\n        ~HmacSha1Signer();\n        \n        static std::string generate(const std::string &src, const std::string &secret);\n    };\n}\n}\n"
  },
  {
    "path": "sdk/src/signer/Signer.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"Signer.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nSigner::Signer(Type type, const std::string & name, const std::string & version) :\n    type_(type),\n    name_(name),\n    version_(version)\n{\n}\n\nSigner::~Signer()\n{\n}\n\nstd::string Signer::name() const\n{\n    return name_;\n}\n\nSigner::Type Signer::type() const\n{\n    return type_;\n}\n\nstd::string Signer::version() const\n{\n    return version_;\n}\n\nstd::shared_ptr<Signer> Signer::createSigner(SignatureVersionType version)\n{\n    if (version == SignatureVersionType::V4) {\n        return std::make_shared<SignerV4>();\n    }\n    return std::make_shared<SignerV1>();\n}\n"
  },
  {
    "path": "sdk/src/signer/Signer.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n\n#include <string>\n#include <ctime>\n#include <alibabacloud/oss/Types.h>\n#include <alibabacloud/oss/auth/Credentials.h>\n#include <alibabacloud/oss/http/HttpRequest.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class SignerParam\n    {\n    public:\n        SignerParam(std::string&& region, std::string&& product, \n            std::string&& bucket, std::string&& key, \n            Credentials&& credentials, std::time_t requestTime):\n                region_(region),\n                product_(product),\n                bucket_(bucket),\n                key_(key),\n                credentials_(credentials),\n                requestTime_(requestTime)\n        {}\n\n    const std::string& Region() const { return region_; }\n    const std::string& Product() const { return product_; }\n    const std::string& Bucket() const { return bucket_; }\n    const std::string& Key() const { return key_; }\n    const Credentials& Cred() const { return credentials_; }\n    std::time_t RequestTime() const { return requestTime_; }\n    const HeaderSet& AdditionalHeaders() const { return additionalHeaders_; }\n    void setAdditionalHeaders(const HeaderSet& headers) { additionalHeaders_ = headers; }\n\n    int64_t Expires() const { return expires_; }\n    void setExpires(int64_t expires) { expires_ = expires; }\n\n    private:\n        SignerParam() = delete;\n\n    private:\n        std::string region_;\n        std::string product_;\n        std::string bucket_;\n        std::string key_;\n        Credentials credentials_;\n        std::time_t requestTime_;\n        HeaderSet additionalHeaders_;\n        std::time_t expires_;\n    };\n\n    class  Signer\n    {\n    public:\n\n        enum Type\n        {\n            HmacSha1,\n            HmacSha256,\n        };\n        virtual ~Signer();\n\n        virtual void sign(const std::shared_ptr<HttpRequest> &httpRequest, ParameterCollection &parameter, \n            SignerParam &signerParam)const = 0;\n        virtual void presign(const std::shared_ptr<HttpRequest> &httpRequest, ParameterCollection &parameter,\n            SignerParam &signerParam)const = 0;\n\n        virtual std::string generate(const std::string &src, const std::string &secret)const = 0;\n\n\n        virtual std::string name()const;\n        virtual Type type() const;\n        virtual std::string version()const;\n\n    public:\n         static std::shared_ptr<Signer> createSigner(SignatureVersionType version);\n    protected:\n        Signer(Type type, const std::string &name, const std::string &version = \"1.0\");\n    private:\n        Type type_;\n        std::string name_;\n        std::string version_;\n    };\n\n    class  SignerV1 : public Signer\n    {\n    public:\n        SignerV1();\n        ~SignerV1();\n        \n        virtual void sign(const std::shared_ptr<HttpRequest> &httpRequest, ParameterCollection &parameter,\n            SignerParam &signerParam)const override;\n        virtual void presign(const std::shared_ptr<HttpRequest> &httpRequest, ParameterCollection &parameter,\n            SignerParam &signerParam)const override;\n        virtual std::string generate(const std::string &src, const std::string &secret)const override;\n    };\n\n    class  SignerV4 : public Signer\n    {\n    public:\n        SignerV4();\n        ~SignerV4();\n        \n        virtual void sign(const std::shared_ptr<HttpRequest> &httpRequest, ParameterCollection &parameter,\n            SignerParam &signerParam)const override;\n        virtual void presign(const std::shared_ptr<HttpRequest> &httpRequest, ParameterCollection &parameter,\n            SignerParam &signerParam)const override;\n        virtual std::string generate(const std::string &src, const std::string &secret)const override;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/src/signer/SignerV1.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <sstream>\n#include \"Signer.h\"\n#include \"HmacSha1Signer.h\"\n#include \"../utils/SignUtils.h\"\n#include \"../utils/Utils.h\"\n#include \"../utils/LogUtils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nnamespace\n{\nconst char *TAG = \"SignerV1\";\n}\n\nSignerV1::SignerV1() :\n    Signer(HmacSha1, \"HMAC-SHA1\", \"1.0\")\n{\n}\n\nSignerV1::~SignerV1()\n{\n}\n\nstatic std::string buildResource(const std::string &bucket, const std::string &key) \n{\n    std::string resource;\n    resource.append(\"/\");\n    if (!bucket.empty()) {\n        resource.append(bucket);\n        resource.append(\"/\");\n    }\n    if (!key.empty()) {\n        resource.append(key);\n    }\n    return resource;\n}\n\nstd::string SignerV1::generate(const std::string & src, const std::string & secret) const\n{\n    return HmacSha1Signer::generate(src, secret);\n}\n\nvoid SignerV1::sign(const std::shared_ptr<HttpRequest> &httpRequest, ParameterCollection &parameters,\n    SignerParam &signerParam)const\n{\n    if (!signerParam.Cred().SessionToken().empty()) {\n        httpRequest->addHeader(\"x-oss-security-token\", signerParam.Cred().SessionToken());\n    }\n\n    if (httpRequest->hasHeader(\"x-oss-date\")) {\n        httpRequest->addHeader(Http::DATE, httpRequest->Header(\"x-oss-date\"));\n    } else {\n        auto requestTime = signerParam.RequestTime();\n        httpRequest->addHeader(Http::DATE, ToGmtTime(requestTime));\n    }\n\n    auto method = Http::MethodToString(httpRequest->method());\n    auto resource = buildResource(signerParam.Bucket(), signerParam.Key());\n    auto date = httpRequest->Header(Http::DATE);\n\n    SignUtils signUtils(\"\");\n    signUtils.build(method, resource, date, httpRequest->Headers(), parameters);\n    auto signature = generate(signUtils.CanonicalString(), signerParam.Cred().AccessKeySecret());\n\n    std::stringstream authValue;\n    authValue\n        << \"OSS \"\n        << signerParam.Cred().AccessKeyId()\n        << \":\"\n        << signature;\n\n    httpRequest->addHeader(Http::AUTHORIZATION, authValue.str());\n\n    OSS_LOG(LogLevel::LogDebug, TAG, \"request(%p) CanonicalString:%s\", httpRequest.get(), signUtils.CanonicalString().c_str());\n    OSS_LOG(LogLevel::LogDebug, TAG, \"request(%p) Authorization:%s\", httpRequest.get(), authValue.str().c_str());\n}\n\nvoid SignerV1::presign(const std::shared_ptr<HttpRequest> &httpRequest, ParameterCollection &parameters,\n    SignerParam &signerParam)const\n{\n    if (!signerParam.Cred().SessionToken().empty()) {\n        parameters[\"security-token\"] = signerParam.Cred().SessionToken();\n    }\n\n    auto method = Http::MethodToString(httpRequest->method());\n    auto resource = buildResource(signerParam.Bucket(), signerParam.Key());\n    auto date = std::to_string(signerParam.Expires());\n\n    SignUtils signUtils(\"\");\n    signUtils.build(method, resource, date, httpRequest->Headers(), parameters);\n    auto signature = generate(signUtils.CanonicalString(), signerParam.Cred().AccessKeySecret());\n\n    OSS_LOG(LogLevel::LogDebug, TAG, \"CanonicalString:%s\", signUtils.CanonicalString().c_str());\n    OSS_LOG(LogLevel::LogDebug, TAG, \"signature:%s\", signature.c_str());\n\n    parameters[\"Expires\"] = date;\n    parameters[\"OSSAccessKeyId\"] = signerParam.Cred().AccessKeyId();\n    parameters[\"Signature\"] = signature;\n}"
  },
  {
    "path": "sdk/src/signer/SignerV4.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <sstream>\n#include \"Signer.h\"\n#include \"../utils/SignUtils.h\"\n#include \"../utils/Utils.h\"\n#include \"../utils/LogUtils.h\"\n#include <openssl/hmac.h>\n#ifdef OPENSSL_IS_BORINGSSL \n#include <openssl/base64.h>\n#endif\n\n\nusing namespace AlibabaCloud::OSS;\nnamespace\n{\n    const char *TAG = \"SignerV4\";\n}\n\nclass Sha256Helper\n{\npublic:\n    Sha256Helper()\n    {\n        ctx_ = EVP_MD_CTX_create();\n    #if !defined(OPENSSL_IS_BORINGSSL)\n        EVP_MD_CTX_set_flags(ctx_, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);\n    #endif\n        EVP_DigestInit_ex(ctx_, EVP_sha256(), nullptr); \n    }\n\n    ~Sha256Helper()\n    {\n        EVP_MD_CTX_destroy(ctx_);\n        ctx_ = nullptr;\n    }\n\n    ByteBuffer Calculate(const ByteBuffer &data)\n    {\n        return Calculate((const char *)data.data(), data.size());\n    }\n\n    ByteBuffer Calculate(const char *data, size_t cnt)\n    {\n        ByteBuffer hash(EVP_MD_size(EVP_sha256()));\n        EVP_DigestInit_ex(ctx_, EVP_sha256(), nullptr);\n        EVP_DigestUpdate(ctx_, (const void *)data, cnt);\n        EVP_DigestFinal(ctx_, hash.data(), nullptr);\n        return hash;\n    }\n\n    ByteBuffer CalculateHMAC(const std::string& src, const ByteBuffer& secret)\n    {\n        ByteBuffer md(EVP_MAX_MD_SIZE);\n        unsigned int mdLen = EVP_MAX_MD_SIZE;\n\n        if (HMAC(EVP_sha256(), \n                secret.data(), \n                static_cast<int>(secret.size()),\n                reinterpret_cast<unsigned char const*>(src.data()), \n                static_cast<int>(src.size()),\n                md.data(), &mdLen) == nullptr) {\n            return ByteBuffer();\n        }\n\n        md.resize(mdLen);\n        return md;\n    }\nprivate:\n    EVP_MD_CTX *ctx_;     \n};\n\n\nSignerV4::SignerV4() :\n    Signer(HmacSha256, \"HMAC-SHA256\", \"4.0\")\n{\n}\n\nSignerV4::~SignerV4()\n{\n}\n\nstd::string SignerV4::generate(const std::string & src, const std::string & secret) const\n{\n    UNUSED_PARAM(src);\n    UNUSED_PARAM(secret);\n    return \"\";\n}\n\nstatic bool isDefaultSignedHeader(const std::string& lowerKey)\n{\n    if (lowerKey == \"content-type\" ||\n        lowerKey == \"content-md5\" ||\n        lowerKey.compare(0, 6, \"x-oss-\") == 0) {\n            return true;\n    }\n    return false;\n}\n\nstatic HeaderSet getCommonAdditionalHeaders(const HeaderCollection& headers, const HeaderSet &additionalHeaders)\n{\n    HeaderSet result;\n    for (auto const &key : additionalHeaders) {\n        std::string lowerKey = ToLower(key.c_str());\n        if (isDefaultSignedHeader(lowerKey)) {\n                //default signed header, skip\n                continue;\n        } else if (headers.find(lowerKey) != headers.end()) {\n            result.emplace(lowerKey);\n        }\n    }\n\n    return result;\n}\n\nstatic std::string toHeaderSetString(const HeaderSet &headers)\n{\n    std::stringstream ss;\n    bool isFirstParam = true;\n    for (auto const &key : headers) {\n        std::string lowerKey = ToLower(key.c_str());\n        if (isFirstParam) {\n            ss << lowerKey;\n        } else {\n            ss << \";\" << lowerKey;\n        }\n        isFirstParam = false;\n    }\n    return ss.str();\n}\n\nstatic std::string buildCanonicalReuqest(const std::shared_ptr<HttpRequest> &httpRequest, ParameterCollection &parameters,\n    SignerParam &signerParam, const HeaderSet &additionalHeaders) \n{\n    /*Version 4*/\n    // HTTP Verb + \"\\n\" +\n    // Canonical URI + \"\\n\" +\n    // Canonical Query String + \"\\n\" +\n    // Canonical Headers + \"\\n\" +\n    // Additional Headers + \"\\n\" +\n    // Hashed PayLoad\n\n    std::stringstream ss;\n    // \"GET\" | \"PUT\" | \"POST\" | ... + \"\\n\"\n    ss << Http::MethodToString(httpRequest->method()) << \"\\n\"; \n    \n    // UriEncode(<Resource>) + \"\\n\"\n    std::string resource;\n    resource.append(\"/\");\n    if (!signerParam.Bucket().empty()) {\n        resource.append(signerParam.Bucket());\n        resource.append(\"/\");\n    }\n    if (!signerParam.Key().empty()) {\n        resource.append(signerParam.Key());\n    }    \n    ss << UrlEncodePath(resource, true) << \"\\n\"; \n\n    // Canonical Query String + \"\\n\"\n    // UriEncode(<QueryParam1>) + \"=\" + UriEncode(<Value>) + \"&\" + UriEncode(<QueryParam2>) + \"\\n\"\n    ParameterCollection signedParameters;\n    for (auto const &param : parameters) {\n        signedParameters[UrlEncode(param.first)] = UrlEncode(param.second);\n    }\n    char separator = '&';\n    bool isFirstParam = true;\n    for (auto const &param : signedParameters) {\n        if (!isFirstParam) {\n            ss << separator;\n        } else {\n            isFirstParam = false;\n        }\n\n        ss << param.first;\n        if (!param.second.empty()) {\n            ss << \"=\" << param.second;\n        }\n    }\n    ss << \"\\n\";\n\n    // Lowercase(<HeaderName1>) + \":\" + Trim(<value>) + \"\\n\" + Lowercase(<HeaderName2>) + \":\" + Trim(<value>) + \"\\n\" + \"\\n\"\n    for (const auto &header : httpRequest->Headers()) {\n        std::string lowerKey = ToLower(header.first.c_str());\n        std::string value = Trim(header.second.c_str());\n        if (value.empty()) {\n            continue;\n        }\n        if (lowerKey == \"content-type\" ||\n            lowerKey == \"content-md5\" ||\n            lowerKey.compare(0, 6, \"x-oss-\") == 0) {\n            ss << lowerKey << \":\" << value << \"\\n\";\n        } else if (additionalHeaders.find(lowerKey) != additionalHeaders.end()) {\n            ss << lowerKey << \":\" << value << \"\\n\";\n        }\n    }\n    ss << \"\\n\";\n\n    // Lowercase(<AdditionalHeaderName1>) + \";\" + Lowercase(<AdditionalHeaderName2>) + \"\\n\" +\n    ss << toHeaderSetString(additionalHeaders);\n    ss << \"\\n\";\n   \n    // Hashed PayLoad\n    std::string hash = \"UNSIGNED-PAYLOAD\";\n    if (httpRequest->hasHeader(\"x-oss-content-sha256\")) {\n        hash = httpRequest->Header(\"x-oss-content-sha256\");\n    }\n    ss << hash;\n\n    return ss.str();\n}\n\nstatic std::string LowerHexToString(const unsigned char *data, size_t size)\n{ \n    static char hex[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };\n    std::stringstream ss;\n    for (size_t i = 0; i < size; i++)\n        ss << hex[(data[i] >> 4)] << hex[(data[i] & 0x0F)];\n    return ss.str();\n}\n\nstd::string buildStringToSign(const std::string &datetime, const std::string &scope, const std::string &canonical)\n{\n    // \"OSS4-HMAC-SHA256\" + \"\\n\" +\n    // TimeStamp + \"\\n\" +\n    // Scope + \"\\n\" +\n    // Hex(SHA256Hash(Canonical Reuqest))\n    Sha256Helper sha265;\n    auto hash = sha265.Calculate(canonical.data(), canonical.size());\n    auto hashedCalRequest = LowerHexToString(hash.data(), hash.size());\n\n    std::stringstream stringToSign;\n    stringToSign << \"OSS4-HMAC-SHA256\" << \"\\n\"\n                 << datetime << \"\\n\"\n                 << scope << \"\\n\"\n                 << hashedCalRequest;\n\n    return stringToSign.str();\n}\n\nstd::string buildSignature(const std::string &keySecrect, const std::string &date,\n     const std::string &region, const std::string &product, const std::string &stringToSign)\n{\n    // SigningKey\n    Sha256Helper sha265;\n\n    std::string key = \"aliyun_v4\" + keySecrect;\n    auto signingSecret = ByteBuffer{key.begin(), key.end()};\n    auto signingDate =  sha265.CalculateHMAC(date, signingSecret);\n    auto signingRegion =  sha265.CalculateHMAC(region, signingDate);\n    auto signingProduct =  sha265.CalculateHMAC(product, signingRegion);\n    auto signingKey =  sha265.CalculateHMAC(\"aliyun_v4_request\", signingProduct);\n\n    // Signature\n    auto signature =  sha265.CalculateHMAC(stringToSign, signingKey);\n\n    //std::cout << \"signingSecret:\" << LowerHexToString(signingSecret.data(), signingSecret.size()) << std::endl;\n    //std::cout << \"signingDate:\" << LowerHexToString(signingDate.data(), signingDate.size()) << std::endl;\n    //std::cout << \"signingRegion:\" << LowerHexToString(signingRegion.data(), signingRegion.size()) << std::endl;\n    //std::cout << \"signingProduct:\" << LowerHexToString(signingProduct.data(), signingProduct.size()) << std::endl;\n    //std::cout << \"signingKey:\" << LowerHexToString(signingKey.data(), signingKey.size()) << std::endl;\n    //std::cout << \"signature:\" << LowerHexToString(signature.data(), signature.size()) << std::endl;\n\n    return LowerHexToString(signature.data(), signature.size());\n}\n\nvoid SignerV4::sign(const std::shared_ptr<HttpRequest> &httpRequest, ParameterCollection &parameters,\n    SignerParam &signerParam)const\n{\n    if (!signerParam.Cred().SessionToken().empty()) {\n        httpRequest->addHeader(\"x-oss-security-token\", signerParam.Cred().SessionToken());\n    }\n\n    auto requestTime = signerParam.RequestTime();\n    auto datetime = FormatUnixTime(requestTime, \"%Y%m%dT%H%M%SZ\");\n    auto date = FormatUnixTime(requestTime, \"%Y%m%d\");\n\n    httpRequest->addHeader(Http::DATE, ToGmtTime(requestTime));\n    httpRequest->addHeader(\"x-oss-date\", datetime);\n\n    if (!httpRequest->hasHeader(\"x-oss-content-sha256\")) {\n        httpRequest->addHeader(\"x-oss-content-sha256\", \"UNSIGNED-PAYLOAD\");\n    }\n\n    auto additionalHeaders = getCommonAdditionalHeaders(httpRequest->Headers(), signerParam.AdditionalHeaders());\n\n    auto canonicalReuqest = buildCanonicalReuqest(httpRequest, parameters, signerParam, additionalHeaders);\n    auto scope = date + \"/\" + signerParam.Region() + \"/\" + signerParam.Product() + \"/aliyun_v4_request\";\n    auto stringToSign = buildStringToSign(datetime, scope, canonicalReuqest);\n    auto signature = buildSignature(signerParam.Cred().AccessKeySecret(), date, signerParam.Region(), signerParam.Product(), stringToSign);\n\n    std::stringstream authValue;\n    authValue\n        << \"OSS4-HMAC-SHA256\"\n        << \" Credential=\"\n        << signerParam.Cred().AccessKeyId() << \"/\"\n        << scope;\n    if (!additionalHeaders.empty()) {\n        authValue    \n            << \",AdditionalHeaders=\"\n            << toHeaderSetString(additionalHeaders);\n    }\n    authValue    \n        << \",Signature=\"\n        << signature;\n\n    //std::cout << \"canonicalReuqest:\" << canonicalReuqest << std::endl;\n    //std::cout << \"scope:\" << scope << std::endl;\n    //std::cout << \"stringToSign:\" << stringToSign << std::endl;\n    //std::cout << \"signature:\" << signature << std::endl;\n    //std::cout << \"AUTHORIZATION:\" << authValue.str() << std::endl;\n\n    httpRequest->addHeader(Http::AUTHORIZATION, authValue.str());\n\n    OSS_LOG(LogLevel::LogDebug, TAG, \"request(%p) CanonicalReuqest:%s\", httpRequest.get(), canonicalReuqest.c_str());\n    OSS_LOG(LogLevel::LogDebug, TAG, \"request(%p) StringToSign:%s\", httpRequest.get(), stringToSign.c_str());\n    OSS_LOG(LogLevel::LogDebug, TAG, \"request(%p) Authorization:%s\", httpRequest.get(), authValue.str().c_str());\n }\n\nvoid SignerV4::presign(const std::shared_ptr<HttpRequest> &httpRequest, ParameterCollection &parameters,\n    SignerParam &signerParam)const\n{\n    if (!signerParam.Cred().SessionToken().empty()) {\n        parameters[\"x-oss-security-token\"] = signerParam.Cred().SessionToken();\n    }\n\n    auto datetime = FormatUnixTime(signerParam.RequestTime(), \"%Y%m%dT%H%M%SZ\");\n    auto date = FormatUnixTime(signerParam.RequestTime(), \"%Y%m%d\");\n\n    // x-oss-signature-version\n    parameters[\"x-oss-signature-version\"] = \"OSS4-HMAC-SHA256\";\n\n    // x-oss-credential\n    auto credential = signerParam.Cred().AccessKeyId() + \"/\" + date + \"/\" + signerParam.Region() + \"/\" + signerParam.Product() + \"/aliyun_v4_request\";\n    parameters[\"x-oss-credential\"] = credential;\n\n    // x-oss-date\n    parameters[\"x-oss-date\"] = datetime;\n\n    // x-oss-expires\n    auto expires_duration = signerParam.Expires() - signerParam.RequestTime();\n    parameters[\"x-oss-expires\"] = std::to_string(expires_duration);\n\n    // x-oss-additional-headers\n    auto additionalHeaders = getCommonAdditionalHeaders(httpRequest->Headers(), signerParam.AdditionalHeaders());\n    if (!additionalHeaders.empty()) {\n        parameters[\"x-oss-additional-headers\"] = toHeaderSetString(additionalHeaders);\n    }\n\n    auto canonicalReuqest = buildCanonicalReuqest(httpRequest, parameters, signerParam, additionalHeaders);\n    auto scope = date + \"/\" + signerParam.Region() + \"/\" + signerParam.Product() + \"/aliyun_v4_request\";\n    auto stringToSign = buildStringToSign(datetime, scope, canonicalReuqest);\n    auto signature = buildSignature(signerParam.Cred().AccessKeySecret(), date, signerParam.Region(), signerParam.Product(), stringToSign);\n\n    // \"x-oss-signature\"\n    parameters[\"x-oss-signature\"] = signature;\n\n    OSS_LOG(LogLevel::LogDebug, TAG, \"request(%p) CanonicalReuqest:%s\", httpRequest.get(), canonicalReuqest.c_str());\n    OSS_LOG(LogLevel::LogDebug, TAG, \"request(%p) StringToSign:%s\", httpRequest.get(), stringToSign.c_str());\n    OSS_LOG(LogLevel::LogDebug, TAG, \"request(%p) Signature:%s\", httpRequest.get(), signature.c_str());\n}\n"
  },
  {
    "path": "sdk/src/utils/Crc32.cc",
    "content": "/* Crc64.cc -- compute CRC-64\n * Copyright (C) 2013 Mark Adler\n * Version 1.4  16 Dec 2013  Mark Adler\n */\n\n/*\n  This software is provided 'as-is', without any express or implied\n  warranty.  In no event will the author be held liable for any damages\n  arising from the use of this software.\n\n  Permission is granted to anyone to use this software for any purpose,\n  including commercial applications, and to alter it and redistribute it\n  freely, subject to the following restrictions:\n\n  1. The origin of this software must not be misrepresented; you must not\n     claim that you wrote the original software. If you use this software\n     in a product, an acknowledgment in the product documentation would be\n     appreciated but is not required.\n  2. Altered source versions must be plainly marked as such, and must not be\n     misrepresented as being the original software.\n  3. This notice may not be removed or altered from any source distribution.\n\n  Mark Adler\n  madler@alumni.caltech.edu\n */\n\n/* Compute CRC-64 in the manner of xz, using the ECMA-182 polynomial,\n   bit-reversed, with one's complement pre and post processing.  Provide a\n   means to combine separately computed CRC-64's. */\n\n/* Version history:\n   1.0  13 Dec 2013  First version\n   1.1  13 Dec 2013  Fix comments in test code\n   1.2  14 Dec 2013  Determine endianess at run time\n   1.3  15 Dec 2013  Add eight-byte processing for big endian as well\n                     Make use of the pthread library optional\n   1.4  16 Dec 2013  Make once variable volatile for limited thread protection\n */\n\n#include \"Crc32.h\"\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n/*CRC32*/\nstatic const uint32_t crc32Table[256] = {\n    0x00000000,0x77073096,0xEE0E612C,0x990951BA,0x076DC419,0x706AF48F,0xE963A535,\n    0x9E6495A3,0x0EDB8832,0x79DCB8A4,0xE0D5E91E,0x97D2D988,0x09B64C2B,0x7EB17CBD,\n    0xE7B82D07,0x90BF1D91,0x1DB71064,0x6AB020F2,0xF3B97148,0x84BE41DE,0x1ADAD47D,\n    0x6DDDE4EB,0xF4D4B551,0x83D385C7,0x136C9856,0x646BA8C0,0xFD62F97A,0x8A65C9EC,\n    0x14015C4F,0x63066CD9,0xFA0F3D63,0x8D080DF5,0x3B6E20C8,0x4C69105E,0xD56041E4,\n    0xA2677172,0x3C03E4D1,0x4B04D447,0xD20D85FD,0xA50AB56B,0x35B5A8FA,0x42B2986C,\n    0xDBBBC9D6,0xACBCF940,0x32D86CE3,0x45DF5C75,0xDCD60DCF,0xABD13D59,0x26D930AC,\n    0x51DE003A,0xC8D75180,0xBFD06116,0x21B4F4B5,0x56B3C423,0xCFBA9599,0xB8BDA50F,\n    0x2802B89E,0x5F058808,0xC60CD9B2,0xB10BE924,0x2F6F7C87,0x58684C11,0xC1611DAB,\n    0xB6662D3D,0x76DC4190,0x01DB7106,0x98D220BC,0xEFD5102A,0x71B18589,0x06B6B51F,\n    0x9FBFE4A5,0xE8B8D433,0x7807C9A2,0x0F00F934,0x9609A88E,0xE10E9818,0x7F6A0DBB,\n    0x086D3D2D,0x91646C97,0xE6635C01,0x6B6B51F4,0x1C6C6162,0x856530D8,0xF262004E,\n    0x6C0695ED,0x1B01A57B,0x8208F4C1,0xF50FC457,0x65B0D9C6,0x12B7E950,0x8BBEB8EA,\n    0xFCB9887C,0x62DD1DDF,0x15DA2D49,0x8CD37CF3,0xFBD44C65,0x4DB26158,0x3AB551CE,\n    0xA3BC0074,0xD4BB30E2,0x4ADFA541,0x3DD895D7,0xA4D1C46D,0xD3D6F4FB,0x4369E96A,\n    0x346ED9FC,0xAD678846,0xDA60B8D0,0x44042D73,0x33031DE5,0xAA0A4C5F,0xDD0D7CC9,\n    0x5005713C,0x270241AA,0xBE0B1010,0xC90C2086,0x5768B525,0x206F85B3,0xB966D409,\n    0xCE61E49F,0x5EDEF90E,0x29D9C998,0xB0D09822,0xC7D7A8B4,0x59B33D17,0x2EB40D81,\n    0xB7BD5C3B,0xC0BA6CAD,0xEDB88320,0x9ABFB3B6,0x03B6E20C,0x74B1D29A,0xEAD54739,\n    0x9DD277AF,0x04DB2615,0x73DC1683,0xE3630B12,0x94643B84,0x0D6D6A3E,0x7A6A5AA8,\n    0xE40ECF0B,0x9309FF9D,0x0A00AE27,0x7D079EB1,0xF00F9344,0x8708A3D2,0x1E01F268,\n    0x6906C2FE,0xF762575D,0x806567CB,0x196C3671,0x6E6B06E7,0xFED41B76,0x89D32BE0,\n    0x10DA7A5A,0x67DD4ACC,0xF9B9DF6F,0x8EBEEFF9,0x17B7BE43,0x60B08ED5,0xD6D6A3E8,\n    0xA1D1937E,0x38D8C2C4,0x4FDFF252,0xD1BB67F1,0xA6BC5767,0x3FB506DD,0x48B2364B,\n    0xD80D2BDA,0xAF0A1B4C,0x36034AF6,0x41047A60,0xDF60EFC3,0xA867DF55,0x316E8EEF,\n    0x4669BE79,0xCB61B38C,0xBC66831A,0x256FD2A0,0x5268E236,0xCC0C7795,0xBB0B4703,\n    0x220216B9,0x5505262F,0xC5BA3BBE,0xB2BD0B28,0x2BB45A92,0x5CB36A04,0xC2D7FFA7,\n    0xB5D0CF31,0x2CD99E8B,0x5BDEAE1D,0x9B64C2B0,0xEC63F226,0x756AA39C,0x026D930A,\n    0x9C0906A9,0xEB0E363F,0x72076785,0x05005713,0x95BF4A82,0xE2B87A14,0x7BB12BAE,\n    0x0CB61B38,0x92D28E9B,0xE5D5BE0D,0x7CDCEFB7,0x0BDBDF21,0x86D3D2D4,0xF1D4E242,\n    0x68DDB3F8,0x1FDA836E,0x81BE16CD,0xF6B9265B,0x6FB077E1,0x18B74777,0x88085AE6,\n    0xFF0F6A70,0x66063BCA,0x11010B5C,0x8F659EFF,0xF862AE69,0x616BFFD3,0x166CCF45,\n    0xA00AE278,0xD70DD2EE,0x4E048354,0x3903B3C2,0xA7672661,0xD06016F7,0x4969474D,\n    0x3E6E77DB,0xAED16A4A,0xD9D65ADC,0x40DF0B66,0x37D83BF0,0xA9BCAE53,0xDEBB9EC5,\n    0x47B2CF7F,0x30B5FFE9,0xBDBDF21C,0xCABAC28A,0x53B39330,0x24B4A3A6,0xBAD03605,\n    0xCDD70693,0x54DE5729,0x23D967BF,0xB3667A2E,0xC4614AB8,0x5D681B02,0x2A6F2B94,\n    0xB40BBE37,0xC30C8EA1,0x5A05DF1B,0x2D02EF8D\n};\n\nuint32_t CRC32::CalcCRC(uint32_t crc, const void *buf, size_t bufLen)\n{\n    uint32_t crc32;\n    unsigned char *byteBuf;\n    size_t i;\n\n    /** accumulate crc32 for buffer **/\n    crc32 = crc ^ 0xFFFFFFFF;\n    byteBuf = (unsigned char*)buf;\n    for (i = 0; i < bufLen; i++) {\n        crc32 = (crc32 >> 8) ^ crc32Table[(crc32 ^ byteBuf[i]) & 0xFF];\n    }\n    return crc32 ^ 0xFFFFFFFF;\n}\n}\n}\n\n\n"
  },
  {
    "path": "sdk/src/utils/Crc32.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <stdint.h>\n#include <cstddef>\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class CRC32\n    {\n    public:\n        static uint32_t CalcCRC(uint32_t crc, const void *buf, size_t bufLen);\n    };\n}\n}\n\n"
  },
  {
    "path": "sdk/src/utils/Crc64.cc",
    "content": "/* Crc64.cc -- compute CRC-64\n * Copyright (C) 2013 Mark Adler\n * Version 1.4  16 Dec 2013  Mark Adler\n */\n\n/*\n  This software is provided 'as-is', without any express or implied\n  warranty.  In no event will the author be held liable for any damages\n  arising from the use of this software.\n\n  Permission is granted to anyone to use this software for any purpose,\n  including commercial applications, and to alter it and redistribute it\n  freely, subject to the following restrictions:\n\n  1. The origin of this software must not be misrepresented; you must not\n     claim that you wrote the original software. If you use this software\n     in a product, an acknowledgment in the product documentation would be\n     appreciated but is not required.\n  2. Altered source versions must be plainly marked as such, and must not be\n     misrepresented as being the original software.\n  3. This notice may not be removed or altered from any source distribution.\n\n  Mark Adler\n  madler@alumni.caltech.edu\n */\n\n/* Compute CRC-64 in the manner of xz, using the ECMA-182 polynomial,\n   bit-reversed, with one's complement pre and post processing.  Provide a\n   means to combine separately computed CRC-64's. */\n\n/* Version history:\n   1.0  13 Dec 2013  First version\n   1.1  13 Dec 2013  Fix comments in test code\n   1.2  14 Dec 2013  Determine endianess at run time\n   1.3  15 Dec 2013  Add eight-byte processing for big endian as well\n                     Make use of the pthread library optional\n   1.4  16 Dec 2013  Make once variable volatile for limited thread protection\n */\n\n#include \"Crc64.h\"\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n/* 64-bit CRC polynomial with these coefficients, but reversed:\n    64, 62, 57, 55, 54, 53, 52, 47, 46, 45, 40, 39, 38, 37, 35, 33, 32,\n    31, 29, 27, 24, 23, 22, 21, 19, 17, 13, 12, 10, 9, 7, 4, 1, 0 */\n#define POLY UINT64_C(0xc96c5795d7870f42)\n\n/* Tables for CRC calculation -- filled in by initialization functions that are\n   called once.  These could be replaced by constant tables generated in the\n   same way.  There are two tables, one for each endianess.  Since these are\n   static, i.e. local, one should be compiled out of existence if the compiler\n   can evaluate the endianess check in crc64() at compile time. */\nstatic uint64_t crc64_table[8][256];\n\n/* Fill in the CRC-64 constants table. */\nstatic void crc64_init(uint64_t table[][256])\n{\n    unsigned n, k;\n    uint64_t crc;\n\n    /* generate CRC-64's for all single byte sequences */\n    for (n = 0; n < 256; n++) {\n        crc = n;\n        for (k = 0; k < 8; k++)\n            crc = crc & 1 ? POLY ^ (crc >> 1) : crc >> 1;\n        table[0][n] = crc;\n    }\n\n    /* generate CRC-64's for those followed by 1 to 7 zeros */\n    for (n = 0; n < 256; n++) {\n        crc = table[0][n];\n        for (k = 1; k < 8; k++) {\n            crc = table[0][crc & 0xff] ^ (crc >> 8);\n            table[k][n] = crc;\n        }\n    }\n}\n\n/* This function is called once to initialize the CRC-64 table for use on a\n   little-endian architecture. */\nstatic void crc64_little_init(void)\n{\n    crc64_init(crc64_table);\n}\n\n/* Reverse the bytes in a 64-bit word. */\nstatic uint64_t rev8(uint64_t a)\n{\n    uint64_t m;\n\n    m = UINT64_C(0xff00ff00ff00ff);\n    a = ((a >> 8) & m) | (a & m) << 8;\n    m = UINT64_C(0xffff0000ffff);\n    a = ((a >> 16) & m) | (a & m) << 16;\n    return a >> 32 | a << 32;\n}\n\n/* This function is called once to initialize the CRC-64 table for use on a\n   big-endian architecture. */\nstatic void crc64_big_init(void)\n{\n    unsigned k, n;\n\n    crc64_init(crc64_table);\n    for (k = 0; k < 8; k++)\n        for (n = 0; n < 256; n++)\n            crc64_table[k][n] = rev8(crc64_table[k][n]);\n}\n\n/* Calculate a CRC-64 eight bytes at a time on a little-endian architecture. */\nstatic uint64_t crc64_little(uint64_t crc, void *buf, size_t len)\n{\n    unsigned char *next = (unsigned char *)buf;\n\n    crc = ~crc;\n    while (len && ((uintptr_t)next & 7) != 0) {\n        crc = crc64_table[0][(crc ^ *next++) & 0xff] ^ (crc >> 8);\n        len--;\n    }\n    while (len >= 8) {\n        crc ^= *(uint64_t *)next;\n        crc = crc64_table[7][crc & 0xff] ^\n              crc64_table[6][(crc >> 8) & 0xff] ^\n              crc64_table[5][(crc >> 16) & 0xff] ^\n              crc64_table[4][(crc >> 24) & 0xff] ^\n              crc64_table[3][(crc >> 32) & 0xff] ^\n              crc64_table[2][(crc >> 40) & 0xff] ^\n              crc64_table[1][(crc >> 48) & 0xff] ^\n              crc64_table[0][crc >> 56];\n        next += 8;\n        len -= 8;\n    }\n    while (len) {\n        crc = crc64_table[0][(crc ^ *next++) & 0xff] ^ (crc >> 8);\n        len--;\n    }\n    return ~crc;\n}\n\n/* Calculate a CRC-64 eight bytes at a time on a big-endian architecture. */\nstatic uint64_t crc64_big(uint64_t crc, void *buf, size_t len)\n{\n    unsigned char *next = (unsigned char *)buf;\n\n    crc = ~rev8(crc);\n    while (len && ((uintptr_t)next & 7) != 0) {\n        crc = crc64_table[0][(crc >> 56) ^ *next++] ^ (crc << 8);\n        len--;\n    }\n    while (len >= 8) {\n        crc ^= *(uint64_t *)next;\n        crc = crc64_table[0][crc & 0xff] ^\n              crc64_table[1][(crc >> 8) & 0xff] ^\n              crc64_table[2][(crc >> 16) & 0xff] ^\n              crc64_table[3][(crc >> 24) & 0xff] ^\n              crc64_table[4][(crc >> 32) & 0xff] ^\n              crc64_table[5][(crc >> 40) & 0xff] ^\n              crc64_table[6][(crc >> 48) & 0xff] ^\n              crc64_table[7][crc >> 56];\n        next += 8;\n        len -= 8;\n    }\n    while (len) {\n        crc = crc64_table[0][(crc >> 56) ^ *next++] ^ (crc << 8);\n        len--;\n    }\n    return ~rev8(crc);\n}\n\n/* Return the CRC-64 of buf[0..len-1] with initial crc, processing eight bytes\n   at a time.  This selects one of two routines depending on the endianess of\n   the architecture.  A good optimizing compiler will determine the endianess\n   at compile time if it can, and get rid of the unused code and table.  If the\n   endianess can be changed at run time, then this code will handle that as\n   well, initializing and using two tables, if called upon to do so. */\n\n\n#define GF2_DIM 64      /* dimension of GF(2) vectors (length of CRC) */\n\nstatic uint64_t gf2_matrix_times(uint64_t *mat, uint64_t vec)\n{\n    uint64_t sum;\n\n    sum = 0;\n    while (vec) {\n        if (vec & 1)\n            sum ^= *mat;\n        vec >>= 1;\n        mat++;\n    }\n    return sum;\n}\n\nstatic void gf2_matrix_square(uint64_t *square, uint64_t *mat)\n{\n    unsigned n;\n\n    for (n = 0; n < GF2_DIM; n++)\n        square[n] = gf2_matrix_times(mat, mat[n]);\n}\n\n/* Return the CRC-64 of two sequential blocks, where crc1 is the CRC-64 of the\n   first block, crc2 is the CRC-64 of the second block, and len2 is the length\n   of the second block. */\nstatic uint64_t crc64_combine(uint64_t crc1, uint64_t crc2, uintmax_t len2)\n{\n    unsigned n;\n    uint64_t row;\n    uint64_t even[GF2_DIM];     /* even-power-of-two zeros operator */\n    uint64_t odd[GF2_DIM];      /* odd-power-of-two zeros operator */\n\n    /* degenerate case */\n    if (len2 == 0)\n        return crc1;\n\n    /* put operator for one zero bit in odd */\n    odd[0] = POLY;              /* CRC-64 polynomial */\n    row = 1;\n    for (n = 1; n < GF2_DIM; n++) {\n        odd[n] = row;\n        row <<= 1;\n    }\n\n    /* put operator for two zero bits in even */\n    gf2_matrix_square(even, odd);\n\n    /* put operator for four zero bits in odd */\n    gf2_matrix_square(odd, even);\n\n    /* apply len2 zeros to crc1 (first square will put the operator for one\n       zero byte, eight zero bits, in even) */\n    do {\n        /* apply zeros operator for this bit of len2 */\n        gf2_matrix_square(even, odd);\n        if (len2 & 1)\n            crc1 = gf2_matrix_times(even, crc1);\n        len2 >>= 1;\n\n        /* if no more bits set, then done */\n        if (len2 == 0)\n            break;\n\n        /* another iteration of the loop with odd and even swapped */\n        gf2_matrix_square(odd, even);\n        if (len2 & 1)\n            crc1 = gf2_matrix_times(odd, crc1);\n        len2 >>= 1;\n\n        /* if no more bits set, then done */\n    } while (len2 != 0);\n\n    /* return combined crc */\n    crc1 ^= crc2;\n    return crc1;\n}\n\nclass CRC64_GUARD\n{\npublic:\n    CRC64_GUARD()\n    {\n        uint64_t n = 1;\n        if (*(char *)&n) {\n            crc64_little_init();\n        }\n        else {\n            crc64_big_init();\n        }\n    }\n    ~CRC64_GUARD() = default;\n};\n\nstatic CRC64_GUARD crc64Guard;\n\nuint64_t CRC64::CalcCRC(uint64_t crc, void *buf, size_t len)\n{\n    uint64_t n = 1;\n    return *(char *)&n ? crc64_little(crc, buf, len) : crc64_big(crc, buf, len);\n}\n\nuint64_t CRC64::CalcCRC(uint64_t crc, void *buf, size_t len, bool little)\n{\n    return little ? crc64_little(crc, buf, len) : crc64_big(crc, buf, len);\n}\n\nuint64_t CRC64::CombineCRC(uint64_t crc1, uint64_t crc2, uintmax_t len2)\n{\n    return crc64_combine(crc1, crc2, len2);\n}\n\n\n}\n}\n\n\n"
  },
  {
    "path": "sdk/src/utils/Crc64.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#pragma once\n#include <stdint.h>\n#include <cstddef>\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class CRC64\n    {\n    public:\n        static uint64_t CalcCRC(uint64_t crc, void *buf, size_t len);\n        static uint64_t CombineCRC(uint64_t crc1, uint64_t crc2, uintmax_t len2);\n        static uint64_t CalcCRC(uint64_t crc, void *buf, size_t len, bool little);\n    };\n}\n}\n\n"
  },
  {
    "path": "sdk/src/utils/Executor.cc",
    "content": "/*\r\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n*\r\n* Licensed under the Apache License, Version 2.0 (the \"License\");\r\n* you may not use this file except in compliance with the License.\r\n* You may obtain a copy of the License at\r\n*\r\n*      http://www.apache.org/licenses/LICENSE-2.0\r\n*\r\n* Unless required by applicable law or agreed to in writing, software\r\n* distributed under the License is distributed on an \"AS IS\" BASIS,\r\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n* See the License for the specific language governing permissions and\r\n* limitations under the License.\r\n*/\r\n\r\n#include <alibabacloud/oss/utils/Executor.h>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nExecutor::Executor()\r\n{\r\n}\r\n\r\nExecutor::~Executor()\r\n{\r\n}\r\n"
  },
  {
    "path": "sdk/src/utils/FileSystemUtils.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <string>\r\n#include <map>\r\n#include <ctime>\r\n#include <fstream>\r\n#include <memory>\r\n#include <alibabacloud/oss/Types.h>\r\n#include \"FileSystemUtils.h\"\r\n#include <alibabacloud/oss/Const.h>\r\n\r\n#ifdef _WIN32\r\n#include <direct.h>\r\n#include <io.h>\r\n#include <sys/stat.h>\r\n#define  oss_access(a)  ::_access((a), 0)\r\n#define  oss_mkdir(a)   ::_mkdir(a)\r\n#define  oss_rmdir(a)   ::_rmdir(a)\r\n#define  oss_stat       ::_stat64\r\n#define  oss_waccess(a)  ::_waccess((a), 0)\r\n#define  oss_wmkdir(a)   ::_wmkdir(a)\r\n#define  oss_wrmdir(a)   ::_wrmdir(a)\r\n#define  oss_wstat       ::_wstat64\r\n#define  oss_wremove     ::_wremove\r\n#define  oss_wrename     ::_wrename\r\n#else\r\n#include <unistd.h>\r\n#include <fcntl.h>\r\n#include <sys/stat.h>\r\n#define  oss_access(a)  ::access(a, 0)\r\n#define  oss_mkdir(a)   ::mkdir((a), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH)\r\n#define  oss_rmdir(a)   ::rmdir(a)\r\n#define  oss_stat       stat\r\n#endif\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nbool AlibabaCloud::OSS::CreateDirectory(const std::string &folder)\r\n{\r\n    std::string folder_builder;\r\n    std::string sub;\r\n    sub.reserve(folder.size());\r\n    for (auto it = folder.begin(); it != folder.end(); ++it) {\r\n        const char c = *it;\r\n        sub.push_back(c);\r\n        if (c == PATH_DELIMITER || it == folder.end() - 1) {\r\n            folder_builder.append(sub);\r\n            if (oss_access(folder_builder.c_str()) != 0) {\r\n                if (oss_mkdir(folder_builder.c_str()) != 0) {\r\n                    return false;\r\n                }\r\n            }\r\n            sub.clear();\r\n        }\r\n    }\r\n    return true;\r\n}\r\n\r\nbool AlibabaCloud::OSS::IsDirectoryExist(std::string folder) {\r\n    if (folder[folder.length() - 1] != PATH_DELIMITER && folder[folder.length() - 1] != '/') {\r\n        folder += PATH_DELIMITER;\r\n    }\r\n    return !oss_access(folder.c_str());\r\n}\r\n\r\nbool AlibabaCloud::OSS::RemoveDirectory(const std::string &folder)\r\n{\r\n    return !oss_rmdir(folder.c_str());\r\n}\r\n\r\nbool AlibabaCloud::OSS::RemoveFile(const std::string &filepath)\r\n{\r\n    int ret = ::remove(filepath.c_str());\r\n    return !ret;\r\n}\r\n\r\nbool AlibabaCloud::OSS::RenameFile(const std::string &from, const std::string &to)\r\n{\r\n    return !::rename(from.c_str(), to.c_str());\r\n}\r\n\r\nbool AlibabaCloud::OSS::GetPathLastModifyTime(const std::string& path, time_t& t)\r\n{\r\n    std::streamsize size;\r\n    return GetPathInfo(path, t, size);\r\n}\r\n\r\nbool AlibabaCloud::OSS::GetPathInfo(const std::string& path, time_t& t, std::streamsize& size)\r\n{\r\n    struct oss_stat buf;\r\n    auto filename = path.c_str();\r\n#if defined(_WIN32) && _MSC_VER < 1900\r\n    std::string tmp;\r\n    if (!path.empty() && (path.rbegin()[0] == PATH_DELIMITER)) {\r\n        tmp = path.substr(0, path.size() - 1);\r\n        filename = tmp.c_str();\r\n    }\r\n#endif\r\n    if (oss_stat(filename, &buf) != 0)\r\n        return false;\r\n\r\n    t = buf.st_mtime;\r\n    size = static_cast<std::streamsize>(buf.st_size);\r\n    return true;\r\n}\r\n\r\nbool AlibabaCloud::OSS::IsFileExist(const std::string& file)\r\n{\r\n    std::streamsize size;\r\n    time_t t;\r\n    return GetPathInfo(file, t, size);\r\n}\r\n\r\n\r\n//wchar path\r\n#ifdef _WIN32\r\n\r\nbool AlibabaCloud::OSS::CreateDirectory(const std::wstring &folder)\r\n{\r\n    std::wstring folder_builder;\r\n    std::wstring sub;\r\n    sub.reserve(folder.size());\r\n    for (auto it = folder.begin(); it != folder.end(); ++it) {\r\n        auto c = *it;\r\n        sub.push_back(c);\r\n        if (c == WPATH_DELIMITER || it == folder.end() - 1) {\r\n            folder_builder.append(sub);\r\n            if (oss_waccess(folder_builder.c_str()) != 0) {\r\n                if (oss_wmkdir(folder_builder.c_str()) != 0) {\r\n                    return false;\r\n                }\r\n            }\r\n            sub.clear();\r\n        }\r\n    }\r\n    return true;\r\n}\r\n\r\nbool AlibabaCloud::OSS::IsDirectoryExist(std::wstring folder) {\r\n    if (folder[folder.length() - 1] != WPATH_DELIMITER && folder[folder.length() - 1] != '/') {\r\n        folder += WPATH_DELIMITER;\r\n    }\r\n    return !oss_waccess(folder.c_str());\r\n}\r\n\r\nbool AlibabaCloud::OSS::RemoveDirectory(const std::wstring& folder)\r\n{\r\n    return !oss_wrmdir(folder.c_str());\r\n}\r\n\r\nbool AlibabaCloud::OSS::RemoveFile(const std::wstring& filepath)\r\n{\r\n    int ret = oss_wremove(filepath.c_str());\r\n    return !ret;\r\n}\r\n\r\nbool AlibabaCloud::OSS::RenameFile(const std::wstring& from, const std::wstring& to)\r\n{\r\n    return !oss_wrename(from.c_str(), to.c_str());\r\n}\r\n\r\nbool AlibabaCloud::OSS::GetPathLastModifyTime(const std::wstring& path, time_t& t)\r\n{\r\n    std::streamsize size;\r\n    return GetPathInfo(path, t, size);\r\n}\r\n\r\nbool AlibabaCloud::OSS::GetPathInfo(const std::wstring& path, time_t& t, std::streamsize& size)\r\n{\r\n    struct oss_stat buf;\r\n    auto filename = path.c_str();\r\n#if defined(_WIN32) && _MSC_VER < 1900\r\n    std::wstring tmp;\r\n    if (!path.empty() && (path.rbegin()[0] == WPATH_DELIMITER)) {\r\n        tmp = path.substr(0, path.size() - 1);\r\n        filename = tmp.c_str();\r\n    }\r\n#endif\r\n    if (oss_wstat(filename, &buf) != 0)\r\n        return false;\r\n\r\n    t = buf.st_mtime;\r\n    size = static_cast<std::streamsize>(buf.st_size);\r\n    return true;\r\n}\r\n\r\nbool AlibabaCloud::OSS::IsFileExist(const std::wstring& file)\r\n{\r\n    std::streamsize size;\r\n    time_t t;\r\n    return GetPathInfo(file, t, size);\r\n}\r\n#endif\r\n\r\nstd::shared_ptr<std::fstream> AlibabaCloud::OSS::GetFstreamByPath(\n    const std::string& path, const std::wstring& pathw,\n    std::ios_base::openmode mode)\n{\r\n#ifdef _WIN32\r\n    if (!pathw.empty()) {\r\n        return std::make_shared<std::fstream>(pathw, mode);\r\n    }\r\n#else\r\n    ((void)(pathw));\r\n#endif\r\n    return std::make_shared<std::fstream>(path, mode);\r\n}\r\n"
  },
  {
    "path": "sdk/src/utils/FileSystemUtils.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <string>\n#include <fstream>\n#include <memory>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    bool CreateDirectory(const std::string &folder);\n    bool RemoveDirectory(const std::string &folder);\n    bool RemoveFile(const std::string &filepath);\n    bool RenameFile(const std::string &from, const std::string &to);\n    bool GetPathLastModifyTime(const std::string &path, time_t &t);\n    bool IsDirectoryExist(std::string folder);\n    bool GetPathInfo(const std::string &path, time_t &t, std::streamsize& size);\n    bool IsFileExist(const std::string& file);\n\n    //wchar path\n#ifdef _WIN32\n    bool CreateDirectory(const std::wstring& folder);\n    bool RemoveDirectory(const std::wstring& folder);\n    bool RemoveFile(const std::wstring& filepath);\n    bool RenameFile(const std::wstring& from, const std::wstring& to);\n    bool GetPathLastModifyTime(const std::wstring& path, time_t& t);\n    bool IsDirectoryExist(std::wstring folder);\n    bool GetPathInfo(const std::wstring &path, time_t &t, std::streamsize& size);\n    bool IsFileExist(const std::wstring& file);\n#endif\n\n    std::shared_ptr<std::fstream> GetFstreamByPath(\n        const std::string& path, \n        const std::wstring& pathw, \n        std::ios_base::openmode mode);\n}\n}\n"
  },
  {
    "path": "sdk/src/utils/LogUtils.cc",
    "content": "/*\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n*      http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n#include \"Utils.h\"\n#include \"LogUtils.h\"\n#include <iostream>\n#include <memory>\n#include <cstdarg>\n#include <sstream>\n#include <chrono>\n#include <iomanip>\n#include <ctime>\n#include <thread>\n#include <cstdarg>\nusing namespace AlibabaCloud::OSS;\n\nstatic LogLevel    gOssLogLevel = LogLevel::LogOff;\nstatic LogCallback gLogCallback = nullptr;\nconst static char *EnvLogLevels[] =\n{\n    \"off\", \"fatal\", \"error\", \"warn\",\n    \"info\", \"debug\", \"trace\", \"all\"\n};\n\nstatic std::string LogPrefix(LogLevel logLevel, const char* tag)\n{\n    static const char *LogStr[] = {\"[OFF]\", \"[FATAL]\", \"[ERROR]\", \"[WARN]\", \"[INFO]\" , \"[DEBUG]\", \"[TRACE]\", \"[ALL]\"};\n    int index = logLevel - LogLevel::LogOff;\n    std::stringstream ss;\n    auto tp = std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::system_clock::now());\n    auto ms = tp.time_since_epoch().count() % 1000;\n    auto t = std::chrono::system_clock::to_time_t(tp);\n    struct tm tm;\n#ifdef WIN32\n    ::localtime_s(&tm, &t);\n#else\n    ::localtime_r(&t, &tm);\n#endif\n#if defined(__GNUG__) && __GNUC__ < 5\n    char tmbuff[64];\n    strftime(tmbuff, 64, \"%Y-%m-%d %H:%M:%S.\", &tm);\n    ss << \"[\" << tmbuff << std::setw(3) << std::setfill('0') << ms << \"]\";\n#else\n    ss << \"[\" << std::put_time(&tm, \"%Y-%m-%d %H:%M:%S.\") << std::setw(3) << std::setfill('0') << ms << \"]\";\n#endif\n    ss << LogStr[index];\n    ss << \"[\" << tag << \"]\";\n    ss << \"[\" << std::this_thread::get_id() << \"]\";\n    return ss.str();\n}\n\nvoid AlibabaCloud::OSS::FormattedLog(LogLevel logLevel, const char* tag, const char* fmt, ...)\n{\n    std::stringstream ss;\n    ss << LogPrefix(logLevel, tag);\n    char buffer[2050];\n    int i = 0;\n    va_list args;\n    va_start(args, fmt);\n#ifdef WIN32\n    i = vsnprintf_s(buffer, sizeof(buffer) - 1, _TRUNCATE, fmt, args);\n#else\n    i = vsnprintf(buffer, sizeof(buffer) - 1, fmt, args);\n#endif\n    va_end(args);\n\n    while (i > 0 && buffer[i - 1] == '\\n') {\n        i--;\n        buffer[i] = '\\0';\n    }\n\n    ss << buffer << std::endl;\n    if (gLogCallback) {\n        gLogCallback(logLevel, ss.str());\n    }\n}\n\nstatic void DefaultLogCallbackFunc(LogLevel level, const std::string &stream)\n{\n    UNUSED_PARAM(level);\n    std::cerr << stream;\n}\n\nLogLevel AlibabaCloud::OSS::GetLogLevelInner()\n{\n    return gOssLogLevel;\n}\n\nLogCallback AlibabaCloud::OSS::GetLogCallbackInner()\n{\n    return gLogCallback;\n}\n\nvoid AlibabaCloud::OSS::SetLogLevelInner(LogLevel level)\n{\n    gOssLogLevel = level;\n}\n\nvoid AlibabaCloud::OSS::SetLogCallbackInner(LogCallback callback)\n{\n    gLogCallback = callback;\n}\n\nvoid AlibabaCloud::OSS::InitLogInner()\n{\n    gOssLogLevel = LogLevel::LogOff;\n    gLogCallback = nullptr;\n    auto value = std::getenv(\"OSS_SDK_LOG_LEVEL\");\n    if (value) {\n        auto level = ToLower(Trim(value).c_str());\n        const auto size = sizeof(EnvLogLevels)/sizeof(EnvLogLevels[0]);\n        for (auto i = 0U; i < size; i++) {\n            if (level.compare(EnvLogLevels[i]) == 0) {\n                gOssLogLevel = static_cast<decltype(LogLevel::LogOff)>(static_cast<decltype(i)>(LogLevel::LogOff) + i);\n                gLogCallback = DefaultLogCallbackFunc;\n                break;\n            }\n        }\n    }\n}\n\nvoid AlibabaCloud::OSS::DeinitLogInner()\n{\n    gOssLogLevel = LogLevel::LogOff;\n    gLogCallback = nullptr;\n}\n"
  },
  {
    "path": "sdk/src/utils/LogUtils.h",
    "content": "/*\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n*      http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n#pragma once\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    void InitLogInner();\n    void DeinitLogInner();\n\n    LogLevel    GetLogLevelInner();\n    LogCallback GetLogCallbackInner();\n    void SetLogLevelInner(LogLevel level);\n    void SetLogCallbackInner(LogCallback callback);\n\n    void FormattedLog(LogLevel logLevel, const char* tag, const char* formatStr, ...);\n\n#ifdef DISABLE_OSS_LOGGING\n\n    #define OSS_LOG(level, tag, ...) \n\n#else\n\n    #define OSS_LOG(level, tag, ...) \\\n    { \\\n        if ( AlibabaCloud::OSS::GetLogCallbackInner() && AlibabaCloud::OSS::GetLogLevelInner() >= level ) \\\n        { \\\n            FormattedLog(level, tag, __VA_ARGS__); \\\n        } \\\n    }\n\n#endif // DISABLE_OSS_LOGGING\n}\n}\n\n"
  },
  {
    "path": "sdk/src/utils/Runnable.cc",
    "content": "/*\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n*      http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n#include <alibabacloud/oss/utils/Runnable.h>\n\nusing namespace AlibabaCloud::OSS;\n\nRunnable::Runnable(const std::function<void()> f) :\n    f_(f)\n{\n}\n\nvoid Runnable::run() const\n{\n    f_(); \n}"
  },
  {
    "path": "sdk/src/utils/SignUtils.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include \"SignUtils.h\"\r\n#include \"Utils.h\"\r\n#include <sstream>\r\n#include <map>\r\n#include <set>\r\n#include <alibabacloud/oss/Const.h>\r\n#include <alibabacloud/oss/Types.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\nconst static std::set<std::string> ParamtersToSign =\r\n{\r\n    \"acl\", \"location\", \"bucketInfo\", \"stat\", \"referer\", \"cors\", \"website\", \"restore\",\r\n    \"logging\", \"symlink\", \"qos\", \"uploadId\", \"uploads\", \"partNumber\",\r\n    \"response-content-type\", \"response-content-language\", \"response-expires\",\r\n    \"response-cache-control\", \"response-content-disposition\", \"response-content-encoding\",\r\n    \"append\", \"position\", \"lifecycle\", \"delete\", \"live\", \"status\", \"comp\", \"vod\",\r\n    \"startTime\", \"endTime\", \"x-oss-process\", \"security-token\", \"objectMeta\",\r\n    \"callback\", \"callback-var\", \"tagging\", \"policy\", \"requestPayment\", \"x-oss-traffic-limit\",\r\n    \"encryption\", \"qosInfo\", \"versioning\", \"versionId\", \"versions\",\r\n    \"x-oss-request-payer\", \"sequential\", \"inventory\", \"inventoryId\", \"continuation-token\",\r\n    \"worm\", \"wormId\", \"wormExtend\", \"regionList\"\r\n};\r\n\r\nSignUtils::SignUtils(const std::string &version):\r\n    signVersion_(version),\r\n    canonicalString_()\r\n{\r\n}\r\n\r\nSignUtils::~SignUtils()\r\n{\r\n}\r\n\r\nconst std::string &SignUtils::CanonicalString() const\r\n{\r\n    return canonicalString_;\r\n}\r\n\r\nvoid SignUtils::build(const std::string &method, \r\n                      const std::string &resource, \r\n                      const std::string &date,\r\n                      const HeaderCollection &headers,\r\n                      const ParameterCollection &parameters)\r\n{\r\n    std::stringstream ss;\r\n\r\n    /*Version 1*/\r\n    // VERB + \"\\n\" +\r\n    // Content-MD5 + \"\\n\"  +\r\n    // Content-Type + \"\\n\" \r\n    // Date + \"\\n\"  +\r\n    // CanonicalizedOSSHeaders +\r\n    // CanonicalizedResource) +\r\n\r\n    //common headers\r\n    ss << method << \"\\n\";\r\n    if (headers.find(Http::CONTENT_MD5) != headers.end()) {\r\n        ss << headers.at(Http::CONTENT_MD5);\r\n    }\r\n    ss << \"\\n\";\r\n    if (headers.find(Http::CONTENT_TYPE) != headers.end()) {\r\n        ss << headers.at(Http::CONTENT_TYPE);\r\n    }\r\n    ss << \"\\n\";\r\n    //Date or EXPIRES\r\n    ss << date << \"\\n\";\r\n\r\n    //CanonicalizedOSSHeaders, start with x-oss-\r\n    for (const auto &header : headers) {\r\n        std::string lower = Trim(ToLower(header.first.c_str()).c_str());\r\n        if (lower.compare(0, 6, \"x-oss-\", 6) == 0) {\r\n            std::string value = Trim(header.second.c_str());\r\n            ss << lower << \":\" << value << \"\\n\";\r\n        }\r\n    }\r\n\r\n    //CanonicalizedResource, the sub resouce in\r\n    ss << resource;\r\n    char separator = '?';\r\n    for (auto const& param : parameters) {\r\n        if (ParamtersToSign.find(param.first) == ParamtersToSign.end()) {\r\n            continue;\r\n        }\r\n\r\n        ss << separator;\r\n        ss << param.first;\r\n        if (!param.second.empty()) {\r\n            ss << \"=\" << param.second;\r\n        }\r\n        separator = '&';\r\n    }\r\n\r\n    canonicalString_ = ss.str();\r\n}\r\n\r\nvoid SignUtils::build(const std::string &expires,\r\n    const std::string &resource,\r\n    const ParameterCollection &parameters)\r\n{\r\n    std::stringstream ss;\r\n    ss << expires << '\\n';\r\n    for(auto const& param : parameters)\r\n    {\r\n        ss << param.first << \":\" << param.second << '\\n';\r\n    }\r\n    ss << resource;\r\n    canonicalString_ = ss.str();\r\n}\r\n"
  },
  {
    "path": "sdk/src/utils/SignUtils.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n *      http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#pragma once\n\n#include <string>\n#include <map>\n#include <ctime>\n#include <iostream>\n#include <alibabacloud/oss/Types.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class SignUtils\n    {\n    public: \n        SignUtils(const std::string &version);\n        ~SignUtils();\n        void build(const std::string &method,\n                   const std::string &resource,\n                   const std::string &date,\n                   const HeaderCollection &headers,\n                   const ParameterCollection &parameters);\n        void build(const std::string &expires,\n                    const std::string &resource,\n                    const ParameterCollection &parameters);\n        const std::string &CanonicalString() const;\n    private:\n        std::string signVersion_;\n        std::string canonicalString_;\n    };\n}\n}\n\n"
  },
  {
    "path": "sdk/src/utils/StreamBuf.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n#include <iostream>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n\r\ntemplate<class _Elem, class _Traits>\r\nclass basic_streambuf_proxy : public std::basic_streambuf <_Elem, _Traits> \r\n{\r\npublic:\r\n    virtual ~basic_streambuf_proxy() {\r\n        std::ios_base::iostate state = _Stream->rdstate();\r\n        _Stream->rdbuf(_Sbuf);\r\n        _Stream->setstate(state);\r\n    }\r\n    using int_type = typename _Traits::int_type;\r\n    using pos_type = typename _Traits::pos_type;\r\n    using off_type = typename _Traits::off_type;\r\n\r\nprotected:\r\n    basic_streambuf_proxy(std::basic_iostream<_Elem, _Traits>& stream)\r\n        : _Stream(&stream)\r\n        , _Sbuf(_Stream->rdbuf(this)) {\r\n    }\r\n\r\n    int_type overflow(int_type _Meta = _Traits::eof())\r\n    {   // put a character to stream\r\n        return _Sbuf->sputc(_Meta);\r\n    }\r\n\r\n    int_type pbackfail(int_type _Meta = _Traits::eof())\r\n    {   // put a character back to stream\r\n        return _Sbuf->sputbackc(_Meta);\r\n    }\r\n\r\n    std::streamsize showmanyc()\r\n    {   // return count of input characters\r\n        return _Sbuf->in_avail();;\r\n    }\r\n\r\n    int_type underflow()\r\n    {   // get a character from stream, but don't point past it\r\n        return _Sbuf->sgetc();\r\n    }\r\n\r\n    int_type uflow()\r\n    {   // get a character from stream, point past it\r\n        return _Sbuf->sbumpc();\r\n    }\r\n\r\n    std::streamsize xsgetn(_Elem * _Ptr, std::streamsize _Count)\r\n    {   // get _Count characters from stream\r\n        return _Sbuf->sgetn(_Ptr, _Count);\r\n    }\r\n\r\n    std::streamsize xsputn(const _Elem *_Ptr, std::streamsize _Count)\r\n    {   // put _Count characters to stream\r\n        return _Sbuf->sputn(_Ptr, _Count);\r\n    }\r\n\r\n    pos_type seekoff(off_type _Off, std::ios_base::seekdir _Way, std::ios_base::openmode _Mode = std::ios_base::in | std::ios_base::out)\r\n    {   // change position by offset, according to way and mode\r\n        return _Sbuf->pubseekoff(_Off, _Way, _Mode);\r\n    }\r\n\r\n    pos_type seekpos(pos_type _Pos, std::ios_base::openmode _Mode = std::ios_base::in | std::ios_base::out)\r\n    {   // change to specified position, according to mode\r\n        return _Sbuf->pubseekpos(_Pos, _Mode);\r\n    }\r\n\r\n    std::basic_streambuf<_Elem, _Traits>* setbuf(_Elem *_Buffer, std::streamsize _Count)\r\n    {   // offer buffer to external agent\r\n        return _Sbuf->pubsetbuf(_Buffer, _Count);\r\n    }\r\n\r\n    int sync()\r\n    {   // synchronize with external agent\r\n        return _Sbuf->pubsync();\r\n    }\r\n\r\n    void imbue(const std::locale& _Newlocale)\r\n    {   // set locale to argument\r\n        _Sbuf->pubimbue(_Newlocale);\r\n    }\r\nprivate:\r\n    std::basic_iostream<_Elem, _Traits>*  _Stream;\r\n    std::basic_streambuf<_Elem, _Traits>* _Sbuf;\r\n};\r\n\r\nusing StreamBufProxy = basic_streambuf_proxy<char, std::char_traits<char>>;\r\n\r\n}\r\n}\r\n"
  },
  {
    "path": "sdk/src/utils/ThreadExecutor.cc",
    "content": "/*\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n*      http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n#include \"ThreadExecutor.h\"\n#include <assert.h>\n#include \"../utils/LogUtils.h\"\n\nusing namespace AlibabaCloud::OSS;\n\nstatic const char *TAG = \"ThreadExecutor\";\n\nThreadExecutor::ThreadExecutor():\n    state_(State::Free)\n{\n}\n\nThreadExecutor::~ThreadExecutor()\n{\n    auto expected = State::Free;\n    while (!state_.compare_exchange_strong(expected, State::Shutdown))\n    {\n        assert(expected == State::Locked);\n        expected = State::Free;\n    }\n\n    auto it = threads_.begin();\n    while (!threads_.empty())\n    {\n        it->second.join();\n        it = threads_.erase(it);\n    }\n}\n\nvoid ThreadExecutor::execute(Runnable* task)\n{\n    auto main = [task, this] {\n        OSS_LOG(LogLevel::LogDebug, TAG, \"task(%p) enter execute main thread\", task);\n        task->run();\n        delete task;\n        detach(std::this_thread::get_id());\n        OSS_LOG(LogLevel::LogDebug, TAG, \"task(%p) leave execute main thread\", task);\n    };\n\n    State expected;\n    do\n    {\n        expected = State::Free;\n        if (state_.compare_exchange_strong(expected, State::Locked))\n        {\n            std::thread t(main);\n            const auto id = t.get_id(); \n            threads_.emplace(id, std::move(t));\n            state_ = State::Free;\n            return;\n        }\n    } while (expected != State::Shutdown);\n    return;\n}\n\nvoid ThreadExecutor::detach(std::thread::id id)\n{\n    State expected;\n    do\n    {\n        expected = State::Free;\n        if (state_.compare_exchange_strong(expected, State::Locked))\n        {\n            auto it = threads_.find(id);\n            assert(it != threads_.end());\n            it->second.detach();\n            threads_.erase(it);\n            state_ = State::Free;\n            return;\n        }\n    } while (expected != State::Shutdown);\n}"
  },
  {
    "path": "sdk/src/utils/ThreadExecutor.h",
    "content": "/*\n* Copyright 2009-2017 Alibaba Cloud All rights reserved.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n*      http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n#pragma once\n\n#include <alibabacloud/oss/utils/Executor.h>\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\n    class ThreadExecutor: public Executor\n    {\n    public:\n        ThreadExecutor();\n        virtual ~ThreadExecutor();\n        void execute(Runnable* task);\n    private:\n        enum class State\n        {\n            Free, Locked, Shutdown\n        };\n        void detach(std::thread::id id);\n        std::atomic<State> state_;\n        std::unordered_map<std::thread::id, std::thread> threads_;\n    };\n}\n}\n"
  },
  {
    "path": "sdk/src/utils/Utils.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include \"Utils.h\"\r\n#include <openssl/evp.h>\r\n#include <openssl/hmac.h>\r\n#include <openssl/md5.h>\r\n#ifdef OPENSSL_IS_BORINGSSL \r\n#include <openssl/base64.h>\r\n#endif\r\n#include <algorithm>\r\n#include <cstring>\r\n#include <iostream> \r\n#include <sstream>\r\n#include <map>\r\n#include <regex>\r\n#include <iomanip>\r\n#include <locale>\r\n#include <alibabacloud/oss/Const.h>\r\n#include <alibabacloud/oss/http/HttpType.h>\r\n#include <alibabacloud/oss/http/Url.h>\r\n#include \"../external/json/json.h\"\r\n\r\nusing namespace AlibabaCloud::OSS;\r\n\r\n#if defined(__GNUG__) && __GNUC__ < 5\r\n\r\n#else\r\nstatic const std::regex ipPattern(\"((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\");\r\nstatic const std::regex bucketNamePattern(\"^[a-z0-9][a-z0-9\\\\-]{1,61}[a-z0-9]$\");\r\nstatic const std::regex loggingPrefixPattern(\"^[a-zA-Z][a-zA-Z0-9\\\\-]{0,31}$\");\r\n#endif\r\n\r\nstd::string AlibabaCloud::OSS::GenerateUuid()\r\n{\r\n    return \"\";\r\n}\r\n\r\nstd::string urlEncode(const std::string & src, bool ignoreSlash)\r\n{\r\n    std::stringstream dest;\r\n    static const char *hex = \"0123456789ABCDEF\";\r\n    unsigned char c;\r\n\r\n    for (size_t i = 0; i < src.size(); i++) {\r\n        c = src[i];\r\n        if (isalnum(c) || (c == '-') || (c == '_') || (c == '.') || (c == '~')) {\r\n            dest << c;\r\n        } else if (c == ' ') {\r\n            dest << \"%20\";\r\n        } else if (ignoreSlash && c == '/') {\r\n            dest << c;\r\n        } else {\r\n            dest << '%' << hex[c >> 4] << hex[c & 15];\r\n        }\r\n    }\r\n\r\n    return dest.str();\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::UrlEncodePath(const std::string & src, bool ignoreSlash)\r\n{\r\n    return urlEncode(src, ignoreSlash);\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::UrlEncode(const std::string & src)\r\n{\r\n    return urlEncode(src, false);\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::UrlDecode(const std::string & src)\r\n{\r\n    std::stringstream unescaped;\r\n    unescaped.fill('0');\r\n    unescaped << std::hex;\r\n\r\n    size_t safeLength = src.size();\r\n    const char *safe = src.c_str();\r\n    for (auto i = safe, n = safe + safeLength; i != n; ++i)\r\n    {\r\n        char c = *i;\r\n        if(c == '%')\r\n        {\r\n            char hex[3];\r\n            hex[0] = *(i + 1);\r\n            hex[1] = *(i + 2);\r\n            hex[2] = 0;\r\n            i += 2;\r\n            auto hexAsInteger = strtol(hex, nullptr, 16);\r\n            unescaped << (char)hexAsInteger;\r\n        }\r\n        else\r\n        {\r\n            unescaped << *i;\r\n        }\r\n    }\r\n\r\n    return unescaped.str();\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::Base64Encode(const std::string &src)\r\n{\r\n    return AlibabaCloud::OSS::Base64Encode(src.c_str(), static_cast<int>(src.size()));\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::Base64Encode(const ByteBuffer& buffer)\r\n{\r\n    return AlibabaCloud::OSS::Base64Encode(reinterpret_cast<const char*>(buffer.data()), static_cast<int>(buffer.size()));\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::Base64Encode(const char *src, int len)\r\n{\r\n    if (!src || len == 0) {\r\n        return \"\";\r\n    }\r\n\r\n    static const char *ENC = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\r\n    auto in = reinterpret_cast<const unsigned char *>(src);\r\n    auto inLen = len;\r\n    std::stringstream ss;\r\n    while (inLen) {\r\n        // first 6 bits of char 1\r\n        ss << ENC[*in >> 2];\r\n        if (!--inLen) {\r\n            // last 2 bits of char 1, 4 bits of 0\r\n            ss << ENC[(*in & 0x3) << 4];\r\n            ss << '=';\r\n            ss << '=';\r\n            break;\r\n        }\r\n        // last 2 bits of char 1, first 4 bits of char 2\r\n        ss << ENC[((*in & 0x3) << 4) | (*(in + 1) >> 4)];\r\n        in++;\r\n        if (!--inLen) {\r\n            // last 4 bits of char 2, 2 bits of 0\r\n            ss << ENC[(*in & 0xF) << 2];\r\n            ss << '=';\r\n            break;\r\n        }\r\n        // last 4 bits of char 2, first 2 bits of char 3\r\n        ss << ENC[((*in & 0xF) << 2) | (*(in + 1) >> 6)];\r\n        in++;\r\n        // last 6 bits of char 3\r\n        ss << ENC[*in & 0x3F];\r\n        in++, inLen--;\r\n    }\r\n    return ss.str();\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::Base64EncodeUrlSafe(const std::string &src)\r\n{\r\n    return AlibabaCloud::OSS::Base64EncodeUrlSafe(src.c_str(), static_cast<int>(src.size()));\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::Base64EncodeUrlSafe(const char *src, int len)\r\n{\r\n    std::string out = AlibabaCloud::OSS::Base64Encode(src, len);\r\n\r\n    while (out.size() > 0 && *out.rbegin() == '=')\r\n        out.pop_back();\r\n\r\n    std::transform(out.begin(), out.end(), out.begin(), [](unsigned char c) { \r\n        if (c == '+') return '-';\r\n        if (c == '/') return '_';\r\n        return (char)c;\r\n    });\r\n    return out;\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::XmlEscape(const std::string& value)\r\n{\r\n    struct Entity {\r\n        const char* pattern;\r\n        char value;\r\n    };\r\n\r\n    static const Entity entities[] = {\r\n        { \"&quot;\", '\\\"' },\r\n        { \"&amp;\",  '&'  },\r\n        { \"&apos;\", '\\'' },\r\n        { \"&lt;\",\t'<'  },\r\n        { \"&gt;\",\t'>'  },\r\n        { \"&#13;\",\t'\\r' }\r\n    };\r\n\r\n    if (value.empty()) {\r\n        return value;\r\n    }\r\n\r\n    std::stringstream ss;\r\n    for (size_t i = 0; i < value.size(); i++) {\r\n        bool flag = false;\r\n        for (size_t j = 0; j < (sizeof(entities)/sizeof(entities[0])); j++) {\r\n            if (value[i] == entities[j].value) {\r\n                flag = true;\r\n                ss << entities[j].pattern;\r\n                break;\r\n            }\r\n        }\r\n\r\n        if (!flag) {\r\n            ss << value[i];\r\n        }\r\n    }\r\n\r\n    return ss.str();\r\n}\r\nByteBuffer AlibabaCloud::OSS::Base64Decode(const char *data, int len)\r\n{\r\n    int in_len = len;\r\n    int i = 0;\r\n    int in_ = 0;\r\n    unsigned char part4[4];\r\n\r\n    const int max_len = (len * 3 / 4);\r\n    ByteBuffer ret(max_len);\r\n    int idx = 0;\r\n\r\n    while (in_len-- && (data[in_] != '=')) {\r\n        unsigned char ch = data[in_++];\r\n        if ('A' <= ch && ch <= 'Z')  ch = ch - 'A';           // A - Z\r\n        else if ('a' <= ch && ch <= 'z') ch = ch - 'a' + 26;  // a - z\r\n        else if ('0' <= ch && ch <= '9') ch = ch - '0' + 52;  // 0 - 9\r\n        else if ('+' == ch) ch = 62;                          // +\r\n        else if ('/' == ch) ch = 63;                          // /\r\n        else if ('=' == ch) ch = 64;                          // =\r\n        else ch = 0xff;                                       // something wrong\r\n        part4[i++] = ch;\r\n        if (i == 4) {\r\n            ret[idx++] = (part4[0] << 2) + ((part4[1] & 0x30) >> 4);\r\n            ret[idx++] = ((part4[1] & 0xf) << 4) + ((part4[2] & 0x3c) >> 2);\r\n            ret[idx++] = ((part4[2] & 0x3) << 6) + part4[3];\r\n            i = 0;\r\n        }\r\n    }\r\n\r\n    if (i) {\r\n        for (int j = i; j < 4; j++)\r\n            part4[j] = 0xFF;\r\n        ret[idx++] = (part4[0] << 2) + ((part4[1] & 0x30) >> 4);\r\n        if (part4[2] != 0xFF) {\r\n            ret[idx++] = ((part4[1] & 0xf) << 4) + ((part4[2] & 0x3c) >> 2);\r\n            if (part4[3] != 0xFF) {\r\n                ret[idx++] = ((part4[2] & 0x3) << 6) + part4[3];\r\n            }\r\n        }\r\n    }\r\n\r\n    ret.resize(idx);\r\n    return ret;\r\n}\r\n\r\nByteBuffer AlibabaCloud::OSS::Base64Decode(const std::string &src)\r\n{\r\n    return Base64Decode(src.c_str(), static_cast<int>(src.size()));\r\n}\r\n\r\n\r\nstd::string AlibabaCloud::OSS::ComputeContentMD5(const std::string& data) \r\n{\r\n    return ComputeContentMD5(data.c_str(), data.size());\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::ComputeContentMD5(const char * data, size_t size)\r\n{\r\n    if (!data) {\r\n        return \"\";\r\n    }\r\n\r\n    auto ctx = EVP_MD_CTX_create();\r\n    unsigned char md_value[EVP_MAX_MD_SIZE];\r\n    unsigned int md_len = 0;\r\n\r\n    EVP_MD_CTX_init(ctx);\r\n#ifndef OPENSSL_IS_BORINGSSL \r\n    EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);\r\n#endif\r\n    EVP_DigestInit_ex(ctx, EVP_md5(), nullptr);\r\n\r\n    EVP_DigestUpdate(ctx, static_cast<const void*>(data), size);\r\n    EVP_DigestFinal_ex(ctx, md_value, &md_len);\r\n    EVP_MD_CTX_destroy(ctx);\r\n\r\n    char encodedData[100];\r\n    EVP_EncodeBlock(reinterpret_cast<unsigned char*>(encodedData), md_value, md_len);\r\n    return encodedData;\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::ComputeContentMD5(std::istream& stream) \r\n{\r\n    auto ctx = EVP_MD_CTX_create();\r\n\r\n    unsigned char md_value[EVP_MAX_MD_SIZE];\r\n    unsigned int md_len = 0;\r\n\r\n    EVP_MD_CTX_init(ctx);\r\n#ifndef OPENSSL_IS_BORINGSSL \r\n    EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);\r\n#endif\r\n    EVP_DigestInit_ex(ctx, EVP_md5(), nullptr);\r\n\r\n    auto currentPos = stream.tellg();\r\n    if (currentPos == static_cast<std::streampos>(-1)) {\r\n        currentPos = 0;\r\n        stream.clear();\r\n    }\r\n    stream.seekg(0, stream.beg);\r\n\r\n    char streamBuffer[2048];\r\n    while (stream.good())\r\n    {\r\n        stream.read(streamBuffer, 2048);\r\n        auto bytesRead = stream.gcount();\r\n\r\n        if (bytesRead > 0)\r\n        {\r\n            EVP_DigestUpdate(ctx, streamBuffer, static_cast<size_t>(bytesRead));\r\n        }\r\n    }\r\n\r\n    EVP_DigestFinal_ex(ctx, md_value, &md_len);\r\n    EVP_MD_CTX_destroy(ctx);\r\n    stream.clear();\r\n    stream.seekg(currentPos, stream.beg);\r\n\r\n    //Based64\r\n    char encodedData[100];\r\n    EVP_EncodeBlock(reinterpret_cast<unsigned char*>(encodedData), md_value, md_len);\r\n    return encodedData;\r\n}\r\nstatic std::string HexToString(const unsigned char *data, size_t size)\r\n{ \r\n    static char hex[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };\r\n    std::stringstream ss;\r\n    for (size_t i = 0; i < size; i++)\r\n        ss << hex[(data[i] >> 4)] << hex[(data[i] & 0x0F)];\r\n    return ss.str();\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::ComputeContentETag(const std::string& data)\r\n{\r\n    return ComputeContentETag(data.c_str(), data.size());\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::ComputeContentETag(const char * data, size_t size)\r\n{\r\n    if (!data) {\r\n        return \"\";\r\n    }\r\n\r\n    auto ctx = EVP_MD_CTX_create();\r\n    unsigned char md_value[EVP_MAX_MD_SIZE];\r\n    unsigned int md_len = 0;\r\n\r\n    EVP_MD_CTX_init(ctx);\r\n#ifndef OPENSSL_IS_BORINGSSL \r\n    EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);\r\n#endif\r\n    EVP_DigestInit_ex(ctx, EVP_md5(), nullptr);\r\n\r\n    EVP_DigestUpdate(ctx, static_cast<const void*>(data), size);\r\n    EVP_DigestFinal_ex(ctx, md_value, &md_len);\r\n    EVP_MD_CTX_destroy(ctx);\r\n\r\n    return HexToString(md_value, md_len);\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::ComputeContentETag(std::istream& stream)\r\n{\r\n    auto ctx = EVP_MD_CTX_create();\r\n\r\n    unsigned char md_value[EVP_MAX_MD_SIZE];\r\n    unsigned int md_len = 0;\r\n\r\n    EVP_MD_CTX_init(ctx);\r\n#ifndef OPENSSL_IS_BORINGSSL \r\n    EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);\r\n#endif\r\n\r\n    EVP_DigestInit_ex(ctx, EVP_md5(), nullptr);\r\n\r\n    auto currentPos = stream.tellg();\r\n    if (currentPos == static_cast<std::streampos>(-1)) {\r\n        currentPos = 0;\r\n        stream.clear();\r\n    }\r\n    stream.seekg(0, stream.beg);\r\n\r\n    char streamBuffer[2048];\r\n    while (stream.good())\r\n    {\r\n        stream.read(streamBuffer, 2048);\r\n        auto bytesRead = stream.gcount();\r\n\r\n        if (bytesRead > 0)\r\n        {\r\n            EVP_DigestUpdate(ctx, streamBuffer, static_cast<size_t>(bytesRead));\r\n        }\r\n    }\r\n\r\n    EVP_DigestFinal_ex(ctx, md_value, &md_len);\r\n    EVP_MD_CTX_destroy(ctx);\r\n    stream.clear();\r\n    stream.seekg(currentPos, stream.beg);\r\n\r\n    return HexToString(md_value, md_len);\r\n}\r\n\r\n\r\nvoid AlibabaCloud::OSS::StringReplace(std::string & src, const std::string & s1, const std::string & s2)\r\n{\r\n    std::string::size_type pos =0;\r\n    while ((pos = src.find(s1, pos)) != std::string::npos) \r\n    {\r\n        src.replace(pos, s1.length(), s2);\r\n        pos += s2.length(); \r\n    }\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::LeftTrim(const char* source)\r\n{\r\n    std::string copy(source);\r\n    copy.erase(copy.begin(), std::find_if(copy.begin(), copy.end(), [](unsigned char ch) { return !::isspace(ch); }));\r\n    return copy;\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::RightTrim(const char* source)\r\n{\r\n    std::string copy(source);\r\n    copy.erase(std::find_if(copy.rbegin(), copy.rend(), [](unsigned char ch) { return !::isspace(ch); }).base(), copy.end());\r\n    return copy;\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::Trim(const char* source)\r\n{\r\n    return LeftTrim(RightTrim(source).c_str());\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::LeftTrimQuotes(const char* source)\r\n{\r\n    std::string copy(source);\r\n    copy.erase(copy.begin(), std::find_if(copy.begin(), copy.end(), [](int ch) { return !(ch == '\"'); }));\r\n    return copy;\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::RightTrimQuotes(const char* source)\r\n{\r\n    std::string copy(source);\r\n    copy.erase(std::find_if(copy.rbegin(), copy.rend(), [](int ch) { return !(ch == '\"'); }).base(), copy.end());\r\n    return copy;\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::TrimQuotes(const char* source)\r\n{\r\n    return LeftTrimQuotes(RightTrimQuotes(source).c_str());\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::ToLower(const char* source)\r\n{\r\n    std::string copy;\r\n    if (source) {\r\n        size_t srcLength = strlen(source);\r\n        copy.resize(srcLength);\r\n        std::transform(source, source + srcLength, copy.begin(), [](unsigned char c) { return (char)::tolower(c); });\r\n    }\r\n    return copy;\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::ToUpper(const char* source)\r\n{\r\n    std::string copy;\r\n    if (source) {\r\n        size_t srcLength = strlen(source);\r\n        copy.resize(srcLength);\r\n        std::transform(source, source + srcLength, copy.begin(), [](unsigned char c) { return (char)::toupper(c); });\r\n    }\r\n    return copy;\r\n}\r\n\r\nbool AlibabaCloud::OSS::IsIp(const std::string &host)\r\n{\r\n#if defined(__GNUG__) && __GNUC__ < 5\r\n    int n[4];\r\n    char c[4];\r\n    const char *p = host.c_str();\r\n    if (sscanf(p, \"%d%c%d%c%d%c%d%c\", &n[0], &c[0], &n[1], &c[1], &n[2], &c[2], &n[3], &c[3]) == 7)\r\n    {\r\n        int i;\r\n        for (i = 0; i < 3; ++i)\r\n            if (c[i] != '.')\r\n                return false;\r\n        for (i = 0; i < 4; ++i)\r\n            if (n[i] > 255 || n[i] < 0)\r\n                return false;\r\n        return true;\r\n    }\r\n    return false;\r\n#else\r\n    return std::regex_match(host, ipPattern);\r\n#endif\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::ToGmtTime(std::time_t &t)\r\n{\r\n    std::stringstream date;\r\n    std::tm tm;\r\n#ifdef _WIN32\r\n    ::gmtime_s(&tm, &t);\r\n#else\r\n    ::gmtime_r(&t, &tm);\r\n#endif\r\n\r\n#if defined(__GNUG__) && __GNUC__ < 5\r\n    static const char wday_name[][4] = {\r\n      \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"\r\n    };\r\n    static const char mon_name[][4] = {\r\n      \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"\r\n    };\r\n    char tmbuff[26];\r\n    snprintf(tmbuff, sizeof(tmbuff), \"%.3s, %.2d %.3s %d %.2d:%.2d:%.2d\",\r\n        wday_name[tm.tm_wday], tm.tm_mday, mon_name[tm.tm_mon],\r\n        1900 + tm.tm_year,\r\n        tm.tm_hour, tm.tm_min, tm.tm_sec);\r\n    date << tmbuff << \" GMT\";\r\n#else\r\n    date.imbue(std::locale::classic());\r\n    date << std::put_time(&tm, \"%a, %d %b %Y %H:%M:%S GMT\");\r\n#endif\r\n    return date.str();    \r\n}\r\n\r\nstd::string AlibabaCloud::OSS::ToUtcTime(std::time_t &t)\r\n{\r\n    std::stringstream date;\r\n    std::tm tm;\r\n#ifdef _WIN32\r\n    ::gmtime_s(&tm, &t);\r\n#else\r\n    ::gmtime_r(&t, &tm);\r\n#endif\r\n#if defined(__GNUG__) && __GNUC__ < 5\r\n    char tmbuff[26];\r\n    strftime(tmbuff, 26, \"%Y-%m-%dT%H:%M:%S.000Z\", &tm);\r\n    date << tmbuff;\r\n#else\r\n    date.imbue(std::locale::classic());\r\n    date << std::put_time(&tm, \"%Y-%m-%dT%X.000Z\");\r\n#endif\r\n    return date.str();\r\n}\r\n\r\nstd::time_t AlibabaCloud::OSS::UtcToUnixTime(const std::string &t)\r\n{\r\n    const char* date = t.c_str();\r\n    std::tm tm;\r\n    std::time_t tt = -1;\r\n    int ms;\r\n    auto result = sscanf(date, \"%4d-%2d-%2dT%2d:%2d:%2d.%dZ\",\r\n        &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec, &ms);\r\n\r\n    if (result == 7) {\r\n        tm.tm_year = tm.tm_year - 1900;\r\n        tm.tm_mon = tm.tm_mon - 1;\r\n#ifdef _WIN32\r\n        tt = _mkgmtime64(&tm);\r\n#else\r\n        tt = timegm(&tm);\r\n#endif // _WIN32\r\n    }\r\n    return tt < 0 ? -1 : tt;\r\n}\r\n\r\nstd::time_t AlibabaCloud::OSS::ToUnixTime(const std::string &str, const std::string &fmt)\r\n{\r\n    std::tm tm;\r\n    std::time_t tt = -1;\r\n    memset(&tm, 0, sizeof(tm));\r\n#if defined(__GNUG__) && __GNUC__ < 5\r\n    strptime(str.c_str(), fmt.c_str(), &tm);\r\n#else\r\n    std::istringstream input(str);\r\n    input.imbue(std::locale(setlocale(LC_ALL, nullptr)));\r\n    input >> std::get_time(&tm, fmt.c_str());\r\n    if (input.fail()) {\r\n        return -1;\r\n    }\r\n#endif\r\n\r\n#ifdef _WIN32\r\n    tt = _mkgmtime64(&tm);\r\n#else\r\n    tt = timegm(&tm);\r\n#endif // _WIN32\r\n    return tt < 0 ? -1 : tt;\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::FormatUnixTime(const std::time_t &t, const std::string &fmt)\r\n{\r\n    std::stringstream date;\r\n    std::tm tm;\r\n#ifdef _WIN32\r\n    ::gmtime_s(&tm, &t);\r\n#else\r\n    ::gmtime_r(&t, &tm);\r\n#endif\r\n#if defined(__GNUG__) && __GNUC__ < 5\r\n    char tmbuff[64];\r\n    strftime(tmbuff, 64, fmt.c_str(), &tm);\r\n    date << tmbuff;\r\n#else\r\n    date.imbue(std::locale::classic());\r\n    date << std::put_time(&tm, fmt.c_str());\r\n#endif\r\n    return date.str();\r\n}\r\n\r\nbool AlibabaCloud::OSS::IsValidBucketName(const std::string &bucketName)\r\n{\r\n#if defined(__GNUG__) && __GNUC__ < 5\r\n    if (bucketName.size() < 3 || bucketName.size() > 63)\r\n        return false;\r\n    for (auto it = bucketName.begin(); it != bucketName.end(); it++) {\r\n        if (!((*it >= 'a' && *it <= 'z') || (*it >= '0' && *it <= '9') || *it == '-'))\r\n            return false;\r\n    }\r\n    if (*bucketName.begin() == '-' || *bucketName.rbegin() == '-')\r\n        return false;\r\n    return true;\r\n#else\r\n    if (bucketName.empty())\r\n        return false;\r\n    return std::regex_match(bucketName, bucketNamePattern);\r\n#endif\r\n}\r\n\r\n bool AlibabaCloud::OSS::IsValidObjectKey(const std::string & key)\r\n{\r\n    if (key.empty() || !key.compare(0, 1, \"\\\\\", 1))\r\n         return false;\r\n\r\n    return key.size() <= ObjectNameLengthLimit;\r\n}\r\n\r\n bool AlibabaCloud::OSS::IsValidObjectKey(const std::string& key, bool strict)\r\n {\r\n     if (key.empty() || !key.compare(0, 1, \"\\\\\", 1))\r\n         return false;\r\n\r\n     if (strict && !key.compare(0, 1, \"?\", 1))\r\n         return false;\r\n\r\n     return key.size() <= ObjectNameLengthLimit;\r\n }\r\n\r\n bool AlibabaCloud::OSS::IsValidLoggingPrefix(const std::string &prefix)\r\n {\r\n     if (prefix.empty())\r\n         return true;\r\n#if defined(__GNUG__) && __GNUC__ < 5\r\n     if (prefix.size() > 32)\r\n         return false;\r\n\r\n     auto ch = static_cast<int>(*prefix.begin());\r\n     if (isalpha(ch) == 0)\r\n         return false;\r\n\r\n     for (auto it = prefix.begin(); it != prefix.end(); it++) {\r\n         ch = static_cast<int>(*it);\r\n         if (!(::isalpha(ch) || ::isdigit(ch) || *it == '-'))\r\n             return false;\r\n     }\r\n     return true;\r\n#else\r\n     return std::regex_match(prefix, loggingPrefixPattern);\r\n#endif\r\n }\r\n\r\n bool AlibabaCloud::OSS::IsValidChannelName(const std::string &channelName)\r\n {\r\n     if(channelName.empty() ||\r\n        std::string::npos != channelName.find('/') || \r\n        channelName.size() > MaxLiveChannelNameLength)\r\n        return false;\r\n    \r\n    return true;\r\n }\r\n\r\n bool AlibabaCloud::OSS::IsValidPlayListName(const std::string &playlistName)\r\n {\r\n     if(playlistName.empty())\r\n    {\r\n        return false;\r\n    }else{\r\n        if(!IsValidObjectKey(playlistName))\r\n        {\r\n            return false;\r\n        }\r\n        if(playlistName.size() < MinLiveChannelPlayListLength || \r\n            playlistName.size() > MaxLiveChannelPlayListLength)\r\n        {\r\n            return false;\r\n        }\r\n        std::size_t lastPos = playlistName.find_last_of('.');\r\n        std::size_t slashPos = playlistName.find('/');\r\n        if(lastPos == std::string::npos || \r\n            slashPos != std::string::npos ||\r\n            0 == lastPos || '.' == playlistName[lastPos-1])\r\n        {\r\n            return false;\r\n        }else{\r\n            std::string suffix = playlistName.substr(lastPos);\r\n            if(suffix.size() < 5)\r\n            {\r\n                return false;\r\n            }\r\n            if(ToLower(suffix.c_str()) != \".m3u8\")\r\n            {\r\n                return false;\r\n            }\r\n            return true;\r\n        }\r\n    }\r\n }\r\n\r\n bool AlibabaCloud::OSS::IsValidTagKey(const std::string &key)\r\n {\r\n     if (key.empty() || key.size() > TagKeyLengthLimit)\r\n         return false;\r\n\r\n     return true;\r\n }\r\n\r\n bool AlibabaCloud::OSS::IsValidTagValue(const std::string &value)\r\n {\r\n     return value.size() <= TagValueLengthLimit;\r\n }\r\n\r\n bool AlibabaCloud::OSS::IsValidEndpoint(const std::string &value)\r\n {\r\n     auto host = Url(value).host();\r\n\r\n     if (host.empty())\r\n         return false;\r\n\r\n     for (const auto c : host) {\r\n         if (!((c >= 'a' && c <= 'z') ||\r\n             (c >= '0' && c <= '9') ||\r\n             (c >= 'A' && c <= 'Z') ||\r\n             (c == '_') ||\r\n             (c == '-') ||\r\n             (c == '.'))) {\r\n             return false;\r\n        }\r\n     }\r\n\r\n     return true;\r\n }\r\n \r\nconst std::string& AlibabaCloud::OSS::LookupMimeType(const std::string &name)\r\n{\r\n    const static std::map<std::string, std::string> mimeType = {\r\n        {\"html\", \"text/html\"},\r\n        {\"htm\", \"text/html\"},\r\n        {\"shtml\", \"text/html\"},\r\n        {\"css\", \"text/css\"},\r\n        {\"xml\", \"text/xml\"},\r\n        {\"gif\", \"image/gif\"},\r\n        {\"jpeg\", \"image/jpeg\"},\r\n        {\"jpg\", \"image/jpeg\"},\r\n        {\"js\", \"application/x-javascript\"},\r\n        {\"atom\", \"application/atom+xml\"},\r\n        {\"rss\", \"application/rss+xml\"},\r\n        {\"mml\", \"text/mathml\"},\r\n        {\"txt\", \"text/plain\"},\r\n        {\"jad\", \"text/vnd.sun.j2me.app-descriptor\"},\r\n        {\"wml\", \"text/vnd.wap.wml\"},\r\n        {\"htc\", \"text/x-component\"},\r\n        {\"png\", \"image/png\"},\r\n        {\"tif\", \"image/tiff\"},\r\n        {\"tiff\", \"image/tiff\"},\r\n        {\"wbmp\", \"image/vnd.wap.wbmp\"},\r\n        {\"ico\", \"image/x-icon\"},\r\n        {\"jng\", \"image/x-jng\"},\r\n        {\"bmp\", \"image/x-ms-bmp\"},\r\n        {\"svg\", \"image/svg+xml\"},\r\n        {\"svgz\", \"image/svg+xml\"},\r\n        {\"webp\", \"image/webp\"},\r\n        {\"jar\", \"application/java-archive\"},\r\n        {\"war\", \"application/java-archive\"},\r\n        {\"ear\", \"application/java-archive\"},\r\n        {\"hqx\", \"application/mac-binhex40\"},\r\n        {\"doc \", \"application/msword\"},\r\n        {\"pdf\", \"application/pdf\"},\r\n        {\"ps\", \"application/postscript\"},\r\n        {\"eps\", \"application/postscript\"},\r\n        {\"ai\", \"application/postscript\"},\r\n        {\"rtf\", \"application/rtf\"},\r\n        {\"xls\", \"application/vnd.ms-excel\"},\r\n        {\"ppt\", \"application/vnd.ms-powerpoint\"},\r\n        {\"wmlc\", \"application/vnd.wap.wmlc\"},\r\n        {\"kml\", \"application/vnd.google-earth.kml+xml\"},\r\n        {\"kmz\", \"application/vnd.google-earth.kmz\"},\r\n        {\"7z\", \"application/x-7z-compressed\"},\r\n        {\"cco\", \"application/x-cocoa\"},\r\n        {\"jardiff\", \"application/x-java-archive-diff\"},\r\n        {\"jnlp\", \"application/x-java-jnlp-file\"},\r\n        {\"run\", \"application/x-makeself\"},\r\n        {\"pl\", \"application/x-perl\"},\r\n        {\"pm\", \"application/x-perl\"},\r\n        {\"prc\", \"application/x-pilot\"},\r\n        {\"pdb\", \"application/x-pilot\"},\r\n        {\"rar\", \"application/x-rar-compressed\"},\r\n        {\"rpm\", \"application/x-redhat-package-manager\"},\r\n        {\"sea\", \"application/x-sea\"},\r\n        {\"swf\", \"application/x-shockwave-flash\"},\r\n        {\"sit\", \"application/x-stuffit\"},\r\n        {\"tcl\", \"application/x-tcl\"},\r\n        {\"tk\", \"application/x-tcl\"},\r\n        {\"der\", \"application/x-x509-ca-cert\"},\r\n        {\"pem\", \"application/x-x509-ca-cert\"},\r\n        {\"crt\", \"application/x-x509-ca-cert\"},\r\n        {\"xpi\", \"application/x-xpinstall\"},\r\n        {\"xhtml\", \"application/xhtml+xml\"},\r\n        {\"zip\", \"application/zip\"},\r\n        {\"wgz\", \"application/x-nokia-widget\"},\r\n        {\"bin\", \"application/octet-stream\"},\r\n        {\"exe\", \"application/octet-stream\"},\r\n        {\"dll\", \"application/octet-stream\"},\r\n        {\"deb\", \"application/octet-stream\"},\r\n        {\"dmg\", \"application/octet-stream\"},\r\n        {\"eot\", \"application/octet-stream\"},\r\n        {\"iso\", \"application/octet-stream\"},\r\n        {\"img\", \"application/octet-stream\"},\r\n        {\"msi\", \"application/octet-stream\"},\r\n        {\"msp\", \"application/octet-stream\"},\r\n        {\"msm\", \"application/octet-stream\"},\r\n        {\"mid\", \"audio/midi\"},\r\n        {\"midi\", \"audio/midi\"},\r\n        {\"kar\", \"audio/midi\"},\r\n        {\"mp3\", \"audio/mpeg\"},\r\n        {\"ogg\", \"audio/ogg\"},\r\n        {\"m4a\", \"audio/x-m4a\"},\r\n        {\"ra\", \"audio/x-realaudio\"},\r\n        {\"3gpp\", \"video/3gpp\"},\r\n        {\"3gp\", \"video/3gpp\"},\r\n        {\"mp4\", \"video/mp4\"},\r\n        {\"mpeg\", \"video/mpeg\"},\r\n        {\"mpg\", \"video/mpeg\"},\r\n        {\"mov\", \"video/quicktime\"},\r\n        {\"webm\", \"video/webm\"},\r\n        {\"flv\", \"video/x-flv\"},\r\n        {\"m4v\", \"video/x-m4v\"},\r\n        {\"mng\", \"video/x-mng\"},\r\n        {\"asx\", \"video/x-ms-asf\"},\r\n        {\"asf\", \"video/x-ms-asf\"},\r\n        {\"wmv\", \"video/x-ms-wmv\"},\r\n        {\"avi\", \"video/x-msvideo\"},\r\n        {\"ts\", \"video/MP2T\"},\r\n        {\"m3u8\", \"application/x-mpegURL\"},\r\n        {\"apk\", \"application/vnd.android.package-archive\"}\r\n        };\r\n\r\n    const static std::string defaultType(\"application/octet-stream\");\r\n    std::string::size_type last_pos  = name.find_last_of('.');\r\n    std::string::size_type first_pos = name.find_first_of('.');\r\n    std::string prefix, ext, ext2;\r\n\r\n    if (last_pos == std::string::npos) {\r\n        return defaultType;\r\n    }\r\n\r\n    // extract the last extension\r\n    if (last_pos != std::string::npos) {\r\n        ext = name.substr(1 + last_pos, std::string::npos);\r\n    }\r\n    if (last_pos != std::string::npos) {\r\n        if (first_pos != std::string::npos && first_pos < last_pos) {\r\n            prefix = name.substr(0, last_pos);\r\n            // Now get the second to last file extension\r\n            std::string::size_type next_pos = prefix.find_last_of('.');\r\n            if (next_pos != std::string::npos) {\r\n                ext2 = prefix.substr(1 + next_pos, std::string::npos);\r\n            }\r\n        }\r\n    }\r\n\r\n    ext = ToLower(ext.c_str());\r\n    auto iter = mimeType.find(ext);\r\n    if (iter != mimeType.end()) {\r\n        return (*iter).second; \r\n    }\r\n\r\n    if (first_pos == last_pos) {\r\n        return defaultType;\r\n    }\r\n\r\n    ext2 = ToLower(ext2.c_str());\r\n    iter = mimeType.find(ext2);\r\n    if (iter != mimeType.end()) {\r\n        return (*iter).second;\r\n    }\r\n\r\n    return defaultType;\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::CombineHostString(\r\n    const std::string &endpoint, \r\n    const std::string &bucket, \r\n    bool isCname,\r\n    bool isPathStyle)\r\n{\r\n    Url url(endpoint);\r\n    if (url.scheme().empty()) {\r\n        url.setScheme(Http::SchemeToString(Http::HTTP));\r\n    }\r\n\r\n    if (!bucket.empty() && !isCname && !IsIp(url.host()) && !isPathStyle) {\r\n        std::string host(bucket);\r\n        host.append(\".\").append(url.host());\r\n        url.setHost(host);\r\n    }\r\n\r\n    std::ostringstream out;\r\n    out << url.scheme() << \"://\" << url.authority();\r\n    return out.str();\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::CombinePathString(\r\n    const std::string &endpoint,\r\n    const std::string &bucket,\r\n    const std::string &key,\r\n    bool isPathStyle,\r\n    bool ignoreSlash)\r\n{\r\n    Url url(endpoint);\r\n    std::string path;\r\n    path = \"/\";\r\n    if (IsIp(url.host()) || isPathStyle) {\r\n        path.append(bucket).append(\"/\");\r\n    }\r\n    path.append(UrlEncodePath(key, ignoreSlash));\r\n    return path;\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::CombineRTMPString(\r\n    const std::string &endpoint, \r\n    const std::string &bucket,\r\n    bool isCname,\r\n    bool isPathStyle)\r\n{\r\n    Url url(endpoint);\r\n    if (!bucket.empty() && !isCname && !IsIp(url.host()) && !isPathStyle) {\r\n        std::string host(bucket);\r\n        host.append(\".\").append(url.host());\r\n        url.setHost(host);\r\n    }\r\n\r\n    std::ostringstream out;\r\n    out << \"rtmp://\" << url.authority();\r\n    return out.str();\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::CombineQueryString(const ParameterCollection &parameters)\r\n{\r\n    std::stringstream ss;\r\n    if (!parameters.empty()) {\r\n        for (const auto &p : parameters)\r\n        {\r\n            if (p.second.empty())\r\n                ss << \"&\" << UrlEncode(p.first);\r\n            else\r\n                ss << \"&\" << UrlEncode(p.first) << \"=\" << UrlEncode(p.second);\r\n        }\r\n    }\r\n    return ss.str().substr(1);\r\n}\r\n\r\nstd::streampos AlibabaCloud::OSS::GetIOStreamLength(std::iostream &stream)\r\n{\r\n    auto currentPos = stream.tellg();\r\n    if (currentPos == static_cast<std::streampos>(-1)) {\r\n        currentPos = 0;\r\n        stream.clear();\r\n    }\r\n    stream.seekg(0, stream.end);\r\n    auto streamSize = stream.tellg();\r\n    stream.seekg(currentPos, stream.beg);\r\n    return streamSize;\r\n}\r\n\r\nconst char *AlibabaCloud::OSS::ToStorageClassName(StorageClass storageClass)\r\n{\r\n    static const char *StorageClassName[] = { \"Standard\", \"IA\", \"Archive\", \"ColdArchive\" };\r\n    return StorageClassName[storageClass - StorageClass::Standard];\r\n}\r\n\r\nStorageClass AlibabaCloud::OSS::ToStorageClassType(const char *name)\r\n{\r\n    std::string storageName = ToLower(name);\r\n    if(!storageName.compare(\"ia\")) return StorageClass::IA;\r\n    else if (!storageName.compare(\"archive\")) return StorageClass::Archive;\r\n    else if (!storageName.compare(\"coldarchive\")) return StorageClass::ColdArchive;\r\n    else return StorageClass::Standard;\r\n}\r\n\r\nconst char *AlibabaCloud::OSS::ToAclName(CannedAccessControlList acl)\r\n{\r\n    static const char *AclName[] = { \"private\", \"public-read\", \"public-read-write\", \"default\"};\r\n    return AclName[acl - CannedAccessControlList::Private];\r\n}\r\n\r\nCannedAccessControlList AlibabaCloud::OSS::ToAclType(const char *name)\r\n{\r\n    std::string aclName = ToLower(name);\r\n    if (!aclName.compare(\"private\")) return CannedAccessControlList::Private;\r\n    else if (!aclName.compare(\"public-read\")) return CannedAccessControlList::PublicRead;\r\n    else if (!aclName.compare(\"public-read-write\")) return CannedAccessControlList::PublicReadWrite;\r\n    else return CannedAccessControlList::Default;\r\n}\r\n\r\nconst char *AlibabaCloud::OSS::ToCopyActionName(CopyActionList action)\r\n{\r\n    static const char *ActionName[] = { \"COPY\", \"REPLACE\"};\r\n    return ActionName[action - CopyActionList::Copy];\r\n}\r\n\r\nconst char *AlibabaCloud::OSS::ToRuleStatusName(RuleStatus status)\r\n{\r\n    static const char *StatusName[] = { \"Enabled\", \"Disabled\" };\r\n    return StatusName[status - RuleStatus::Enabled];\r\n}\r\n\r\nRuleStatus AlibabaCloud::OSS::ToRuleStatusType(const char *name)\r\n{\r\n    std::string statusName = ToLower(name);\r\n    if (!statusName.compare(\"enabled\")) return RuleStatus::Enabled;\r\n    else return RuleStatus::Disabled;\r\n}\r\n\r\nconst char *AlibabaCloud::OSS::ToLiveChannelStatusName(LiveChannelStatus status)\r\n{\r\n    if(status > LiveChannelStatus::LiveStatus)\r\n        return \"\";\r\n\r\n    static const char *StatusName[] = { \"enabled\", \"disabled\", \"idle\", \"live\" };\r\n    return StatusName[status - LiveChannelStatus::EnabledStatus];\r\n}\r\n\r\nLiveChannelStatus AlibabaCloud::OSS::ToLiveChannelStatusType(const char *name)\r\n{\r\n    std::string statusName = ToLower(name);\r\n    if (!statusName.compare(\"enabled\")) return LiveChannelStatus::EnabledStatus;\r\n    else if (!statusName.compare(\"disabled\")) return LiveChannelStatus::DisabledStatus;\r\n    else if (!statusName.compare(\"idle\")) return LiveChannelStatus::IdleStatus;\r\n    else if (!statusName.compare(\"live\")) return LiveChannelStatus::LiveStatus;\r\n    else return LiveChannelStatus::UnknownStatus;\r\n}\r\n\r\nconst char* AlibabaCloud::OSS::ToRequestPayerName(RequestPayer payer)\r\n{\r\n    static const char* PayerName[] = { \"NotSet\", \"BucketOwner\", \"Requester\"};\r\n    return PayerName[static_cast<int>(payer) - static_cast<int>(RequestPayer::NotSet)];\r\n}\r\n\r\nRequestPayer AlibabaCloud::OSS::ToRequestPayer(const char* name)\r\n{\r\n    std::string statusName = ToLower(name);\r\n    if (!statusName.compare(\"bucketowner\")) return RequestPayer::BucketOwner;\r\n    else if (!statusName.compare(\"requester\")) return RequestPayer::Requester;\r\n    else return RequestPayer::NotSet;\r\n}\r\n\r\nconst char* AlibabaCloud::OSS::ToSSEAlgorithmName(SSEAlgorithm sse)\r\n{\r\n    static const char* StatusName[] = { \"NotSet\", \"KMS\", \"AES256\" };\r\n    return StatusName[static_cast<int>(sse) - static_cast<int>(SSEAlgorithm::NotSet)];\r\n}\r\n\r\nSSEAlgorithm AlibabaCloud::OSS::ToSSEAlgorithm(const char* name)\r\n{\r\n    std::string statusName = ToLower(name);\r\n    if (!statusName.compare(\"kms\")) return SSEAlgorithm::KMS;\r\n    else if (!statusName.compare(\"aes256\")) return SSEAlgorithm::AES256;\r\n    else return SSEAlgorithm::NotSet;\r\n}\r\n\r\nDataRedundancyType AlibabaCloud::OSS::ToDataRedundancyType(const char* name)\r\n{\r\n    std::string storageName = ToLower(name);\r\n    if (!storageName.compare(\"lrs\")) return DataRedundancyType::LRS;\r\n    else if (!storageName.compare(\"zrs\")) return DataRedundancyType::ZRS;\r\n    else return DataRedundancyType::NotSet;\r\n}\r\n\r\nconst char* AlibabaCloud::OSS::ToDataRedundancyTypeName(DataRedundancyType type)\r\n{\r\n    static const char* typeName[] = { \"NotSet\", \"LRS\", \"ZRS\" };\r\n    return typeName[static_cast<int>(type) - static_cast<int>(DataRedundancyType::NotSet)];\r\n}\r\n\r\nconst char * AlibabaCloud::OSS::ToVersioningStatusName(VersioningStatus status)\r\n{\r\n    static const char *StatusName[] = { \"NotSet\", \"Enabled\", \"Suspended\" };\r\n    return StatusName[static_cast<int>(status) - static_cast<int>(VersioningStatus::NotSet)];\r\n}\r\n\r\nVersioningStatus AlibabaCloud::OSS::ToVersioningStatusType(const char *name)\r\n{\r\n    std::string statusName = ToLower(name);\r\n    if (!statusName.compare(\"enabled\")) return VersioningStatus::Enabled;\r\n    else if (!statusName.compare(\"suspended\")) return VersioningStatus::Suspended;\r\n    else return VersioningStatus::NotSet;\r\n}\r\n\r\nconst char* AlibabaCloud::OSS::ToInventoryFormatName(InventoryFormat status)\r\n{\r\n    static const char* StatusName[] = { \"NotSet\", \"CSV\"};\r\n    return StatusName[static_cast<int>(status) - static_cast<int>(InventoryFormat::NotSet)];\r\n}\r\n\r\nInventoryFormat AlibabaCloud::OSS::ToInventoryFormatType(const char* name)\r\n{\r\n    std::string statusName = ToLower(name);\r\n    if (!statusName.compare(\"csv\")) return InventoryFormat::CSV;\r\n    else return InventoryFormat::NotSet;\r\n}\r\n\r\nconst char* AlibabaCloud::OSS::ToInventoryFrequencyName(InventoryFrequency status)\r\n{\r\n    static const char* StatusName[] = { \"NotSet\", \"Daily\", \"Weekly\" };\r\n    return StatusName[static_cast<int>(status) - static_cast<int>(InventoryFrequency::NotSet)];\r\n}\r\n\r\nInventoryFrequency AlibabaCloud::OSS::ToInventoryFrequencyType(const char* name)\r\n{\r\n    std::string statusName = ToLower(name);\r\n    if (!statusName.compare(\"daily\")) return InventoryFrequency::Daily;\r\n    else if (!statusName.compare(\"weekly\")) return InventoryFrequency::Weekly;\r\n    else return InventoryFrequency::NotSet;\r\n}\r\n\r\nconst char* AlibabaCloud::OSS::ToInventoryOptionalFieldName(InventoryOptionalField status)\r\n{\r\n    static const char* StatusName[] = { \"NotSet\", \"Size\", \"LastModifiedDate\", \"ETag\", \"StorageClass\", \"IsMultipartUploaded\", \"EncryptionStatus\" };\r\n    return StatusName[static_cast<int>(status) - static_cast<int>(InventoryOptionalField::NotSet)];\r\n}\r\n\r\nInventoryOptionalField AlibabaCloud::OSS::ToInventoryOptionalFieldType(const char* name)\r\n{\r\n    std::string statusName = ToLower(name);\r\n    if (!statusName.compare(\"size\")) return InventoryOptionalField::Size;\r\n    else if (!statusName.compare(\"lastmodifieddate\")) return InventoryOptionalField::LastModifiedDate;\r\n    else if (!statusName.compare(\"etag\")) return InventoryOptionalField::ETag;\r\n    else if (!statusName.compare(\"storageclass\")) return InventoryOptionalField::StorageClass;\r\n    else if (!statusName.compare(\"ismultipartuploaded\")) return InventoryOptionalField::IsMultipartUploaded;\r\n    else if (!statusName.compare(\"encryptionstatus\")) return InventoryOptionalField::EncryptionStatus;\r\n    else return InventoryOptionalField::NotSet;\r\n}\r\n\r\nconst char* AlibabaCloud::OSS::ToInventoryIncludedObjectVersionsName(InventoryIncludedObjectVersions status)\r\n{\r\n    static const char* StatusName[] = { \"NotSet\", \"All\", \"Current\" };\r\n    return StatusName[static_cast<int>(status) - static_cast<int>(InventoryIncludedObjectVersions::NotSet)];\r\n}\r\n\r\nInventoryIncludedObjectVersions AlibabaCloud::OSS::ToInventoryIncludedObjectVersionsType(const char* name)\r\n{\r\n    std::string statusName = ToLower(name);\r\n    if (!statusName.compare(\"all\")) return InventoryIncludedObjectVersions::All;\r\n    else if (!statusName.compare(\"current\")) return InventoryIncludedObjectVersions::Current;\r\n    else return InventoryIncludedObjectVersions::NotSet;\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::ToInventoryBucketFullName(const std::string& name)\r\n{\r\n    std::string fullName = \"acs:oss:::\";\r\n    return fullName.append(name);\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::ToInventoryBucketShortName(const char* name)\r\n{\r\n    std::string name_ = ToLower(name);\r\n    std::string shortName;\r\n\r\n    if (!name_.compare(0, 10, \"acs:oss:::\")) {\r\n        shortName.append(name + 10);\r\n    }\r\n    return shortName;\r\n}\r\n\r\nconst char * AlibabaCloud::OSS::ToTierTypeName(TierType status)\r\n{\r\n    static const char *StatusName[] = { \"Expedited\", \"Standard\", \"Bulk\" };\r\n    return StatusName[static_cast<int>(status) - static_cast<int>(TierType::Expedited)];\r\n}\r\n\r\nTierType AlibabaCloud::OSS::ToTierType(const char *name)\r\n{\r\n    std::string statusName = ToLower(name);\r\n    if (!statusName.compare(\"expedited\")) return TierType::Expedited;\r\n    else if (!statusName.compare(\"bulk\")) return TierType::Bulk;\r\n    else return TierType::Standard;\r\n}\r\n\r\n#if !defined(OSS_DISABLE_RESUAMABLE) || !defined(OSS_DISABLE_ENCRYPTION)\r\nstd::map<std::string, std::string> AlibabaCloud::OSS::JsonStringToMap(const std::string& jsonStr)\r\n{\r\n    std::map<std::string, std::string> valueMap;\r\n    Json::Value root;\r\n    Json::CharReaderBuilder rbuilder;\r\n    std::stringstream input(jsonStr);\r\n    std::string errMsg;\r\n\r\n    if (Json::parseFromStream(rbuilder, input, &root, &errMsg)) {\r\n\r\n        for (auto it = root.begin(); it != root.end(); ++it)\r\n        {\r\n            valueMap[it.key().asString()] = (*it).asString();\r\n        }\r\n    }\r\n\r\n    return valueMap;\r\n}\r\n\r\nstd::string AlibabaCloud::OSS::MapToJsonString(const std::map<std::string, std::string>& map)\r\n{\r\n    if (map.empty()) {\r\n        return \"\";\r\n    }\r\n    Json::Value root;\r\n    for (const auto& it : map) {\r\n        root[it.first] = it.second;\r\n    }\r\n\r\n    Json::StreamWriterBuilder builder;\r\n    builder[\"indentation\"] = \"\";\r\n    return Json::writeString(builder, root);\r\n}\r\n#endif\r\n"
  },
  {
    "path": "sdk/src/utils/Utils.h",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#pragma once\r\n\r\n#include <string>\r\n#include <ctime>\r\n#include <iostream>\r\n#include <alibabacloud/oss/Types.h>\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS\r\n{\r\n    #define UNUSED_PARAM(x) ((void)(x))\r\n\r\n    std::string ComputeContentMD5(const std::string& data);\r\n    std::string ComputeContentMD5(const char *data, size_t size);\r\n    std::string ComputeContentMD5(std::istream & stream); \r\n\r\n    std::string ComputeContentETag(const std::string& data);\r\n    std::string ComputeContentETag(const char *data, size_t size);\r\n    std::string ComputeContentETag(std::istream & stream);\r\n\r\n    std::string GenerateUuid();\r\n    std::string UrlEncode(const std::string &src);\r\n    std::string UrlDecode(const std::string &src);\r\n    std::string UrlEncodePath(const std::string & src, bool ignoreSlash);\r\n\r\n    std::string Base64Encode(const std::string &src);\r\n    std::string Base64Encode(const ByteBuffer& buffer);\r\n    std::string Base64Encode(const char *src, int len);\r\n    std::string Base64EncodeUrlSafe(const std::string &src);\r\n    std::string Base64EncodeUrlSafe(const char *src, int len);\r\n\r\n    std::string XmlEscape(const std::string& value);\r\n\r\n    ByteBuffer Base64Decode(const char *src, int len);\r\n    ByteBuffer Base64Decode(const std::string &src);\r\n\r\n    void StringReplace(std::string &src, const std::string &s1, const std::string &s2);\r\n    std::string LeftTrim(const char* source);\r\n    std::string RightTrim(const char* source);\r\n    std::string Trim(const char* source);\r\n    std::string LeftTrimQuotes(const char* source);\r\n    std::string RightTrimQuotes(const char* source);\r\n    std::string TrimQuotes(const char* source);\r\n    std::string ToLower(const char* source);\r\n    std::string ToUpper(const char* source);\r\n    std::string ToGmtTime(std::time_t &t);\r\n    std::string ToUtcTime(std::time_t &t);\r\n    std::time_t UtcToUnixTime(const std::string &t);\r\n    std::time_t ToUnixTime(const std::string &str, const std::string &fmt);\r\n    std::string FormatUnixTime(const std::time_t &t, const std::string &fmt);\r\n\r\n    bool IsIp(const std::string &host);\r\n    bool IsValidBucketName(const std::string &bucketName);\r\n    bool IsValidObjectKey(const std::string &key);\r\n    bool IsValidObjectKey(const std::string& key, bool strict);\r\n    bool IsValidLoggingPrefix(const std::string &prefix);\r\n    bool IsValidChannelName(const std::string &channelName);\r\n    bool IsValidPlayListName(const std::string &playListName);\r\n    bool IsValidTagKey(const std::string &key);\r\n    bool IsValidTagValue(const std::string &value);\r\n    bool IsValidEndpoint(const std::string &value);\r\n\r\n    const std::string &LookupMimeType(const std::string& name);\r\n    std::string CombineHostString(const std::string &endpoint, const std::string &bucket, bool isCname, bool isPathStyle);\r\n    std::string CombinePathString(const std::string &endpoint, const std::string &bucket, const std::string &key, bool isPathStyle, bool ignoreSlash = true);\r\n    std::string CombineQueryString(const ParameterCollection &parameters);\r\n    std::string CombineRTMPString(const std::string &endpoint, const std::string &bucket, bool isCname, bool isPathStyle);\r\n\r\n\r\n    std::streampos GetIOStreamLength(std::iostream &stream);\r\n\r\n    const char *ToStorageClassName(StorageClass storageClass);\r\n    StorageClass ToStorageClassType(const char *name);\r\n\r\n    const char *ToAclName(CannedAccessControlList acl);\r\n    CannedAccessControlList ToAclType(const char *name);\r\n\r\n    const char * ToCopyActionName(CopyActionList action);\r\n\r\n    const char * ToRuleStatusName(RuleStatus status);\r\n    RuleStatus ToRuleStatusType(const char *name);\r\n\r\n    const char * ToLiveChannelStatusName(LiveChannelStatus status);\r\n    LiveChannelStatus ToLiveChannelStatusType(const char *name);\r\n\r\n    const char* ToRequestPayerName(RequestPayer payer);\r\n    RequestPayer ToRequestPayer(const char* name);\r\n    const char* ToSSEAlgorithmName(SSEAlgorithm sse);\r\n    SSEAlgorithm ToSSEAlgorithm(const char* name);\r\n\r\n    DataRedundancyType ToDataRedundancyType(const char* name);\r\n    const char* ToDataRedundancyTypeName(DataRedundancyType type);\r\n\r\n    const char * ToVersioningStatusName(VersioningStatus status);\r\n    VersioningStatus ToVersioningStatusType(const char *name);\r\n\r\n    const char* ToInventoryFormatName(InventoryFormat status);\r\n    InventoryFormat ToInventoryFormatType(const char* name);\r\n\r\n    const char* ToInventoryFrequencyName(InventoryFrequency status);\r\n    InventoryFrequency ToInventoryFrequencyType(const char* name);\r\n\r\n    const char* ToInventoryOptionalFieldName(InventoryOptionalField status);\r\n    InventoryOptionalField ToInventoryOptionalFieldType(const char* name);\r\n\r\n    const char* ToInventoryIncludedObjectVersionsName(InventoryIncludedObjectVersions status);\r\n    InventoryIncludedObjectVersions ToInventoryIncludedObjectVersionsType(const char* name);\r\n\r\n    std::string ToInventoryBucketFullName(const std::string& name);\r\n    std::string ToInventoryBucketShortName(const char* name);\r\n\r\n    const char * ToTierTypeName(TierType status);\r\n    TierType ToTierType(const char *name);\r\n\r\n#if !defined(OSS_DISABLE_RESUAMABLE) || !defined(OSS_DISABLE_ENCRYPTION)\r\n    std::map<std::string, std::string> JsonStringToMap(const std::string& jsonStr);\r\n    std::string MapToJsonString(const std::map<std::string, std::string>& map);\r\n#endif\r\n}\r\n}\r\n"
  },
  {
    "path": "test/CMakeLists.txt",
    "content": "#\n# Copyright 2009-2017 Alibaba Cloud All rights reserved.\n# \n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# \n#      http://www.apache.org/licenses/LICENSE-2.0\n# \n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\nproject(cpp-sdk-test VERSION ${version})\n\t\nfile(GLOB test_gtest_src \"external/gtest/*\")\nfile(GLOB test_main_src \"src/*\")\nfile(GLOB test_accesskey_src \"src/AccessKey/*\")\nfile(GLOB test_service_src \"src/Service/*\")\nfile(GLOB test_bucket_src \"src/Bucket/*\")\nfile(GLOB test_object_src \"src/Object/*\")\nfile(GLOB test_presignedurl_src \"src/PresignedUrl/*\")\nfile(GLOB test_multipartupload_src \"src/MultipartUpload/*\")\nfile(GLOB test_resumable_src \"src/Resumable/*\")\nfile(GLOB test_other_src \"src/Other/*\")\nfile(GLOB test_livechannel_src \"src/LiveChannel/*\")\nfile(GLOB test_encryption_src \"src/Encryption/*\")\n\t\nadd_executable(${PROJECT_NAME} \n\t${test_main_src}\n\t${test_gtest_src} \n\t${test_accesskey_src}\n\t${test_service_src}\n\t${test_bucket_src}\n\t${test_object_src}\n\t${test_presignedurl_src}\n\t${test_multipartupload_src}\n\t${test_resumable_src}\n\t${test_other_src}\n\t${test_livechannel_src}\n\t${test_encryption_src})\n\ntarget_include_directories(${PROJECT_NAME}\n\tPRIVATE ${CMAKE_SOURCE_DIR}/sdk/include\n\tPRIVATE ${CMAKE_SOURCE_DIR}/sdk/\n\tPRIVATE ${CMAKE_SOURCE_DIR}/test/external)\n\nif (${TARGET_OS} STREQUAL \"WINDOWS\")\ntarget_include_directories(${PROJECT_NAME}\n\tPRIVATE ${CMAKE_SOURCE_DIR}/third_party/include)\nendif()\t\n\t\ntarget_link_libraries(${PROJECT_NAME} cpp-sdk${STATIC_LIB_SUFFIX})\t\ntarget_link_libraries(${PROJECT_NAME} ${CRYPTO_LIBS})\ntarget_link_libraries(${PROJECT_NAME} ${CLIENT_LIBS})\nif (${TARGET_OS} STREQUAL \"LINUX\")\ntarget_link_libraries(${PROJECT_NAME} pthread)\t\nendif()\n\ntarget_compile_options(${PROJECT_NAME} \n\tPRIVATE \"${SDK_COMPILER_FLAGS}\")\n\nif (CMAKE_CXX_COMPILER_ID MATCHES \"Clang\")\ntarget_compile_options(${PROJECT_NAME} \n\tPRIVATE \"-Wno-invalid-source-encoding\")\nendif()"
  },
  {
    "path": "test/data/ca-certificates.crt",
    "content": "-----BEGIN CERTIFICATE-----\nMIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UE\nAwwNQUNFRElDT00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00x\nCzAJBgNVBAYTAkVTMB4XDTA4MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEW\nMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZF\nRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKC\nAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHkWLn7\n09gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7\nXBZXehuDYAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5P\nGrjm6gSSrj0RuVFCPYewMYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAK\nt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYbm8+5eaA9oiM/Qj9r+hwDezCNzmzAv+Yb\nX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbkHQl/Sog4P75n/TSW9R28\nMHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTTxKJxqvQU\nfecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI\n2Sf23EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyH\nK9caUPgn6C9D4zq92Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEae\nZAwUswdbxcJzbPEHXEUkFDWug/FqTYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAP\nBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz4SsrSbbXc6GqlPUB53NlTKxQ\nMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU9QHnc2VMrFAw\nRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv\nbS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWIm\nfQwng4/F9tqgaHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3\ngvoFNTPhNahXwOf9jU8/kzJPeGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKe\nI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1PwkzQSulgUV1qzOMPPKC8W64iLgpq0i\n5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1ThCojz2GuHURwCRi\nipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oIKiMn\nMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZ\no5NjEFIqnxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6\nzqylfDJKZ0DcMDQj3dcEI2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacN\nGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOpMCwXEGCSn1WHElkQwg9naRHMTh5+Spqt\nr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3otkYNbn5XOmeUwssfnHdK\nZ05phkOTOPu220+DkdRgfks+KzgHVZhepA==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsx\nCzAJBgNVBAYTAkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRp\nZmljYWNpw7NuIERpZ2l0YWwgLSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwa\nQUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4wHhcNMDYxMTI3MjA0NjI5WhcNMzAw\nNDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+U29jaWVkYWQgQ2Ft\nZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJhIFMu\nQS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkq\nhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeG\nqentLhM0R7LQcNzJPNCNyu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzL\nfDe3fezTf3MZsGqy2IiKLUV0qPezuMDU2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQ\nY5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU34ojC2I+GdV75LaeHM/J4\nNy+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP2yYe68yQ\n54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+b\nMMCm8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQyth9VXAnow6IYm+48j\nilSH5L887uvDdUhfHjlvgWJsxS3EF1QZtzeNnDeRyPYL1epjb4OsOMLzP96a++Ej\nYfDIJss2yKHzMI+ko6Kh3VOz3vCaMh+DkXkwwakfU5tTohVTP92dsxA7SH2JD/zt\nA/X7JWR1DhcZDY8AFmd5ekD8LVkH2ZD6mq093ICK5lw1omdMEWux+IBkAC1vImHF\nrEsm5VoQgpukg3s0956JkSCXjrdCx2bD0Omk1vUgjcTDlaxECp1bczwmPS9KvqfJ\npxAe+59QafMCAwEAAaOB5jCB4zAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE\nAwIBBjAdBgNVHQ4EFgQU0QnQ6dfOeXRU+Tows/RtLAMDG2gwgaAGA1UdIASBmDCB\nlTCBkgYEVR0gADCBiTArBggrBgEFBQcCARYfaHR0cDovL3d3dy5jZXJ0aWNhbWFy\nYS5jb20vZHBjLzBaBggrBgEFBQcCAjBOGkxMaW1pdGFjaW9uZXMgZGUgZ2FyYW50\n7WFzIGRlIGVzdGUgY2VydGlmaWNhZG8gc2UgcHVlZGVuIGVuY29udHJhciBlbiBs\nYSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEfAygPU3zmpFmps4p6\nxbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuXEpBc\nunvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/\nJre7Ir5v/zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dp\nezy4ydV/NgIlqmjCMRW3MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42\ngzmRkBDI8ck1fj+404HGIGQatlDCIaR43NAvO2STdPCWkPHv+wlaNECW8DYSwaN0\njJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wkeZBWN7PGKX6jD/EpOe9+\nXCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f/RWmnkJD\nW2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/\nRL5hRqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35r\nMDOhYil/SrnhLecUIw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxk\nBYn8eNZcLCZDqQ==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UE\nBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8w\nMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290\nIENBMB4XDTExMDkyMjExMjIwMloXDTMwMDkyMjExMjIwMlowazELMAkGA1UEBhMC\nSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1\nODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENB\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNv\nUTufClrJwkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX\n4ay8IMKx4INRimlNAJZaby/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9\nKK3giq0itFZljoZUj5NDKd45RnijMCO6zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/\ngCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1fYVEiVRvjRuPjPdA1Yprb\nrxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2oxgkg4YQ\n51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2F\nbe8lEfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxe\nKF+w6D9Fz8+vm2/7hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4F\nv6MGn8i1zeQf1xcGDXqVdFUNaBr8EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbn\nfpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5jF66CyCU3nuDuP/jVo23Eek7\njPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLYiDrIn3hm7Ynz\nezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt\nifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAL\ne3KHwGCmSUyIWOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70\njsNjLiNmsGe+b7bAEzlgqqI0JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDz\nWochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKxK3JCaKygvU5a2hi/a5iB0P2avl4V\nSM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+Xlff1ANATIGk0k9j\npwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC4yyX\nX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+Ok\nfcvHlXHo2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7R\nK4X9p2jIugErsWx0Hbhzlefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btU\nZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXemOR/qnuOf0GZvBeyqdn6/axag67XH/JJU\nLysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9vwGYT7JZVEc+NHt4bVaT\nLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU\nMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs\nIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290\nMB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux\nFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h\nbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v\ndDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt\nH7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9\nuMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX\nmk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX\na0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN\nE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0\nWicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD\nVR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0\nJvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU\ncnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx\nIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN\nAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH\nYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5\n6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC\nNr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX\nc4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a\nmnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEU\nMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3\nb3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMw\nMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML\nQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYD\nVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUA\nA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ul\nCDtbKRY654eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6n\ntGO0/7Gcrjyvd7ZWxbWroulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyl\ndI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1Zmne3yzxbrww2ywkEtvrNTVokMsAsJch\nPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJuiGMx1I4S+6+JNM3GOGvDC\n+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8wHQYDVR0O\nBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8E\nBTADAQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBl\nMQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFk\nZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENB\nIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxtZBsfzQ3duQH6lmM0MkhHma6X\n7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0PhiVYrqW9yTkkz\n43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY\neDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJl\npz/+0WatC7xrmYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOA\nWiFeIc9TVPC6b4nbqKqVz4vjccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEU\nMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3\nb3JrMSAwHgYDVQQDExdBZGRUcnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAx\nMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtB\nZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIDAeBgNV\nBAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOC\nAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV\n6tsfSlbunyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nX\nGCwwfQ56HmIexkvA/X1id9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnP\ndzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSGAa2Il+tmzV7R/9x98oTaunet3IAIx6eH\n1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAwHM+A+WD+eeSI8t0A65RF\n62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0GA1UdDgQW\nBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUw\nAwEB/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDEL\nMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRU\ncnVzdCBUVFAgTmV0d29yazEgMB4GA1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJv\nb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4JNojVhaTdt02KLmuG7jD8WS6\nIBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL+YPoRNWyQSW/\niHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao\nGEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh\n4SINhwBk/ox9Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQm\nXiLsks3/QppEIW1cxeMiHV9HEufOX1362KqxMy3ZdvJOOjMMK7MtkAY=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEU\nMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3\nb3JrMSMwIQYDVQQDExpBZGRUcnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1\nMzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcxCzAJBgNVBAYTAlNFMRQwEgYDVQQK\nEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIzAh\nBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG9w0B\nAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwq\nxBb/4Oxx64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G\n87B4pfYOQnrjfxvM0PC3KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i\n2O+tCBGaKZnhqkRFmhJePp1tUvznoD1oL/BLcHwTOK28FSXx1s6rosAx1i+f4P8U\nWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GRwVY18BTcZTYJbqukB8c1\n0cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HUMIHRMB0G\nA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0T\nAQH/BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6Fr\npGkwZzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQL\nExRBZGRUcnVzdCBUVFAgTmV0d29yazEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlm\naWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBABmrder4i2VhlRO6aQTv\nhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxGGuoYQ992zPlm\nhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X\ndgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3\nP6CxB9bpT9zeRXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9Y\niQBCYz95OdBEsIJuQRno3eDBiFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5no\nxqE=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE\nBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz\ndCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL\nMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp\ncm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP\nHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr\nba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL\nMeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1\nyHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr\nVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/\nnx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ\nKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG\nXUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj\nvbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt\nZ8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g\nN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC\nnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UE\nBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz\ndCBOZXR3b3JraW5nMB4XDTEwMDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDEL\nMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp\ncm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SEHi3y\nYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbua\nkCNrmreIdIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRL\nQESxG9fhwoXA3hA/Pe24/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp\n6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gbh+0t+nvujArjqWaJGctB+d1ENmHP4ndG\nyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNVHQ4EFgQUBx/S55zawm6i\nQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ\nKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfO\ntDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu\nQY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ\nLgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u\nolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48\nx3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE\nBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz\ndCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG\nA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U\ncnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf\nqV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtnBKAQ\nJG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ\n+jjeRFcV5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrS\ns8PhaJyJ+HoAVt70VZVs+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5\nHMQxK9VfvFMSF5yZVylmd2EhMQcuJUmdGPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d7\n70O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5Rp9EixAqnOEhss/n/fauG\nV+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NIS+LI+H+S\nqHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S\n5u046uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4Ia\nC1nEWTJ3s7xgaVY5/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TX\nOwF0lkLgAOIua+rF7nKsu7/+6qqo+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYE\nFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/\nBAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByvMiPIs0laUZx2\nKI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg\nNt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B\n8OWycvpEgjNC6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQ\nMKSOyARiqcTtNd56l+0OOF6SL5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc\n0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ\nu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF\nu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH\nYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8\nGKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO\nRtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e\nKeC2uAloGRwYQw==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC\nVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ\ncmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ\nBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt\nVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D\n0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9\nss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G\nA1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G\nA1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs\naobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I\nflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc\nMBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP\nbmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2\nMDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft\nZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg\nQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP\nADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lk\nhsmj76CGv2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym\n1BW32J/X3HGrfpq/m44zDyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsW\nOqMFf6Dch9Wc/HKpoH145LcxVR5lu9RhsCFg7RAycsWSJR74kEoYeEfffjA3PlAb\n2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP8c9GsEsPPt2IYriMqQko\nO3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0TAQH/BAUw\nAwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAU\nAK3Zo/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB\nBQUAA4IBAQB8itEfGDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkF\nZu90821fnZmv9ov761KyBZiibyrFVL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAb\nLjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft3OJvx8Fi8eNy1gTIdGcL+oir\noQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43gKd8hdIaC2y+C\nMMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds\nsPmuujz9dLQR6FgNgLzTqIA6me11zEZ7\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc\nMBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP\nbmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2\nMDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft\nZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg\nQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIP\nADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC\n206B89enfHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFci\nKtZHgVdEglZTvYYUAQv8f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2\nJxhP7JsowtS013wMPgwr38oE18aO6lhOqKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9\nBoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JNRvCAOVIyD+OEsnpD8l7e\nXz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0gBe4lL8B\nPeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67\nXnfn6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEq\nZ8A9W6Wa6897GqidFEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZ\no2C7HK2JNDJiuEMhBnIMoVxtRsX6Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3\n+L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnjB453cMor9H124HhnAgMBAAGj\nYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3OpaaEg5+31IqEj\nFNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE\nAwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmn\nxPBUlgtk87FYT15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2\nLHo1YGwRgJfMqZJS5ivmae2p+DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzccc\nobGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXgJXUjhx5c3LqdsKyzadsXg8n33gy8\nCNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//ZoyzH1kUQ7rVyZ2OuMe\nIjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgOZtMA\nDjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2F\nAjgQ5ANh1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUX\nOm/9riW99XJZZLF0KjhfGEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPb\nAZO1XB4Y3WRayhgoPmMEEf0cjQAPuDffZ4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQl\nZvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuPcX/9XhmgD0uRuMRUvAaw\nRY8mkaKO/qk=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEc\nMBoGA1UEChMTSmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRp\nb25DQTAeFw0wNzEyMTIxNTAwMDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYT\nAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zlcm5tZW50MRYwFAYDVQQLEw1BcHBs\naWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp23gdE6H\nj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4fl+K\nf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55\nIrmTwcrNwVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cw\nFO5cjFW6WY2H/CPek9AEjP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDiht\nQWEjdnjDuGWk81quzMKq2edY3rZ+nYVunyoKb58DKTCXKB28t89UKU5RMfkntigm\n/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRUWssmP3HMlEYNllPqa0jQ\nk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNVBAYTAkpQ\nMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOC\nseODvOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD\nggEBADlqRHZ3ODrso2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJ\nhyzjVOGjprIIC8CFqMjSnHH2HZ9g/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+\neKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYDio+nEhEMy/0/ecGc/WLuo89U\nDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmWdupwX3kSa+Sj\nB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL\nrosot4LKGAfmt1t06SAZf7IbiVQ=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJB\nVDFIMEYGA1UECgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBp\nbSBlbGVrdHIuIERhdGVudmVya2VociBHbWJIMRkwFwYDVQQLDBBBLVRydXN0LW5R\ndWFsLTAzMRkwFwYDVQQDDBBBLVRydXN0LW5RdWFsLTAzMB4XDTA1MDgxNzIyMDAw\nMFoXDTE1MDgxNzIyMDAwMFowgY0xCzAJBgNVBAYTAkFUMUgwRgYDVQQKDD9BLVRy\ndXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGltIGVsZWt0ci4gRGF0ZW52\nZXJrZWhyIEdtYkgxGTAXBgNVBAsMEEEtVHJ1c3QtblF1YWwtMDMxGTAXBgNVBAMM\nEEEtVHJ1c3QtblF1YWwtMDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\nAQCtPWFuA/OQO8BBC4SAzewqo51ru27CQoT3URThoKgtUaNR8t4j8DRE/5TrzAUj\nlUC5B3ilJfYKvUWG6Nm9wASOhURh73+nyfrBJcyFLGM/BWBzSQXgYHiVEEvc+RFZ\nznF/QJuKqiTfC0Li21a8StKlDJu3Qz7dg9MmEALP6iPESU7l0+m0iKsMrmKS1GWH\n2WrX9IWf5DMiJaXlyDO6w8dB3F/GaswADm0yqLaHNgBid5seHzTLkDx4iHQF63n1\nk3Flyp3HaxgtPVxO59X4PzF9j4fsCiIvI+n+u33J4PTs63zEsMMtYrWacdaxaujs\n2e3Vcuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYD\nVR0OBAoECERqlWdVeRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC\nAQEAVdRU0VlIXLOThaq/Yy/kgM40ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fG\nKOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmrsQd7TZjTXLDR8KdCoLXEjq/+\n8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZdJXDRZslo+S4R\nFGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS\nmYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmE\nDNuxUCAKGkq6ahq97BvIxYSazQ==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UE\nBhMCRVMxQjBABgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1h\ncHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEy\nMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIwQAYDVQQDDDlBdXRvcmlkYWQgZGUg\nQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBBNjI2MzQwNjgwggIi\nMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDDUtd9\nthDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQM\ncas9UX4PB99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefG\nL9ItWY16Ck6WaVICqjaY7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15i\nNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqHECNZXyAFGUftaI6SEspd/NYrspI8IM/h\nX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyIplD9amML9ZMWGxmPsu2b\nm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctXMbScyJCy\nZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirja\nEbsXLZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/T\nKI8xWVvTyQKmtFLKbpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF\n6NkBiDkal4ZkQdU7hwxu+g/GvUgUvzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVh\nOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYD\nVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNHDhpkLzCBpgYD\nVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp\ncm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBv\nACAAZABlACAAbABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBl\nAGwAbwBuAGEAIAAwADgAMAAxADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF\n661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx51tkljYyGOylMnfX40S2wBEqgLk9\nam58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qkR71kMrv2JYSiJ0L1\nILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaPT481\nPyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS\n3a/DTg4fJl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5k\nSeTy36LssUzAKh3ntLFlosS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF\n3dvd6qJ2gHN99ZwExEWN57kci57q13XRcrHedUTnQn3iV2t93Jm8PYMo6oCTjcVM\nZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoRsaS8I8nkvof/uZS2+F0g\nStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTDKCOM/icz\nQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQB\njLMi6Et8Vcad+qMUu2WFbm5PEn4KPJ2V\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ\nRTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD\nVQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX\nDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y\nZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy\nVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr\nmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr\nIZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK\nmpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu\nXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy\ndc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye\njl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1\nBE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3\nDQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92\n9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx\njkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0\nEpn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz\nksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS\nR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEd\nMBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3Mg\nQ2xhc3MgMiBDQSAxMB4XDTA2MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzEL\nMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MR0wGwYD\nVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP\nADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7McXA0\nojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLX\nl18xoS830r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVB\nHfCuuCkslFJgNJQ72uA40Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B\n5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/RuFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3\nWNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNCMEAwDwYDVR0TAQH/BAUw\nAwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0PAQH/BAQD\nAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLP\ngcIV1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+\nDKhQ7SLHrQVMdvvt7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKu\nBctN518fV4bVIJwo+28TOPX2EZL2fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHs\nh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5wwDX3OaJdZtB7WZ+oRxKaJyOk\nLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd\nMBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg\nQ2xhc3MgMiBSb290IENBMB4XDTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1ow\nTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw\nHgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB\nBQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1g1Lr\n6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPV\nL4O2fuPn9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC91\n1K2GScuVr1QGbNgGE41b/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHx\nMlAQTn/0hpPshNOOvEu/XAFOBz3cFIqUCqTqc/sLUegTBxj6DvEr0VQVfTzh97QZ\nQmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeffawrbD02TTqigzXsu8lkB\narcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgIzRFo1clr\nUs3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLi\nFRhnBkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRS\nP/TizPJhk9H9Z2vXUq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN\n9SG9dKpN6nIDSdvHXx1iY8f93ZHsM+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxP\nAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMmAd+BikoL1Rpzz\nuvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAU18h\n9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s\nA20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3t\nOluwlN5E40EIosHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo\n+fsicdl9sz1Gv7SEr5AcD48Saq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7\nKcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYdDnkM/crqJIByw5c/8nerQyIKx+u2\nDISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWDLfJ6v9r9jv6ly0Us\nH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0oyLQ\nI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK7\n5t98biGCwWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h\n3PFaTWwyI0PurKju7koSCTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPz\nY11aWOIv4x3kqdbQCtCev9eBCfHJxyYNrJgWVqA=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEd\nMBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3Mg\nQ2xhc3MgMyBDQSAxMB4XDTA1MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzEL\nMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MR0wGwYD\nVQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP\nADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKxifZg\nisRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//z\nNIqeKNc0n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI\n+MkcVyzwPX6UvCWThOiaAJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2R\nhzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+\nmbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNCMEAwDwYDVR0TAQH/BAUw\nAwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0PAQH/BAQD\nAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFP\nBdy7pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27s\nEzNxZy5p+qksP2bAEllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2\nmSlf56oBzKwzqBwKu5HEA6BvtjT5htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yC\ne/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQjel/wroQk5PMr+4okoyeYZdow\ndXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd\nMBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg\nQ2xhc3MgMyBSb290IENBMB4XDTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFow\nTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw\nHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB\nBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRHsJ8Y\nZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3E\nN3coTRiR5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9\ntznDDgFHmV0ST9tD+leh7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX\n0DJq1l1sDPGzbjniazEuOQAnFN44wOwZZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c\n/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH2xc519woe2v1n/MuwU8X\nKhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV/afmiSTY\nzIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvS\nO1UQRwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D\n34xFMFbG02SrZvPAXpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgP\nK9Dx2hzLabjKSWJtyNBjYt1gD1iqj6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3\nAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFEe4zf/lb+74suwv\nTg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAACAj\nQTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV\ncSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXS\nIGrs/CIBKM+GuIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2\nHJLw5QY33KbmkJs4j1xrG0aGQ0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsa\nO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8ZORK15FTAaggiG6cX0S5y2CBNOxv\n033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2KSb12tjE8nVhz36u\ndmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz6MkE\nkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg41\n3OEMXbugUZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvD\nu79leNKGef9JOxqDDPDeeOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq\n4/g7u9xN12TyUb7mqqta6THuBrxzvxNiCp/HuZc=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzET\nMBEGA1UEBxMKQnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UE\nAxMIQ0EgRGlzaWcwHhcNMDYwMzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQsw\nCQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcg\nYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\nggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgmGErE\nNx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnX\nmjxUizkDPw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYD\nXcDtab86wYqg6I7ZuUUohwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhW\nS8+2rT+MitcE5eN4TPWGqvWP+j1scaMtymfraHtuM6kMgiioTGohQBUgDCZbg8Kp\nFhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8wgfwwDwYDVR0TAQH/BAUw\nAwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0PAQH/BAQD\nAgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cu\nZGlzaWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5z\nay9jYS9jcmwvY2FfZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2sv\nY2EvY3JsL2NhX2Rpc2lnLmNybDAaBgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEw\nDQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59tWDYcPQuBDRIrRhCA/ec8J9B6\nyKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3mkkp7M5+cTxq\nEEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/\nCBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeB\nEicTXxChds6KezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFN\nPGO+I++MzVpQuGhU+QqZMxEA4Z7CRneC9VkGjCFMhwnN5ag=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFaTCCA1GgAwIBAgIJAMMDmu5QkG4oMA0GCSqGSIb3DQEBBQUAMFIxCzAJBgNV\nBAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu\nMRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIxMB4XDTEyMDcxOTA5MDY1NloXDTQy\nMDcxOTA5MDY1NlowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx\nEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjEw\nggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCqw3j33Jijp1pedxiy3QRk\nD2P9m5YJgNXoqqXinCaUOuiZc4yd39ffg/N4T0Dhf9Kn0uXKE5Pn7cZ3Xza1lK/o\nOI7bm+V8u8yN63Vz4STN5qctGS7Y1oprFOsIYgrY3LMATcMjfF9DCCMyEtztDK3A\nfQ+lekLZWnDZv6fXARz2m6uOt0qGeKAeVjGu74IKgEH3G8muqzIm1Cxr7X1r5OJe\nIgpFy4QxTaz+29FHuvlglzmxZcfe+5nkCiKxLU3lSCZpq+Kq8/v8kiky6bM+TR8n\noc2OuRf7JT7JbvN32g0S9l3HuzYQ1VTW8+DiR0jm3hTaYVKvJrT1cU/J19IG32PK\n/yHoWQbgCNWEFVP3Q+V8xaCJmGtzxmjOZd69fwX3se72V6FglcXM6pM6vpmumwKj\nrckWtc7dXpl4fho5frLABaTAgqWjR56M6ly2vGfb5ipN0gTco65F97yLnByn1tUD\n3AjLLhbKXEAz6GfDLuemROoRRRw1ZS0eRWEkG4IupZ0zXWX4Qfkuy5Q/H6MMMSRE\n7cderVC6xkGbrPAXZcD4XW9boAo0PO7X6oifmPmvTiT6l7Jkdtqr9O3jw2Dv1fkC\nyC2fg69naQanMVXVz0tv/wQFx1isXxYb5dKj6zHbHzMVTdDypVP1y+E9Tmgt2BLd\nqvLmTZtJ5cUoobqwWsagtQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud\nDwEB/wQEAwIBBjAdBgNVHQ4EFgQUiQq0OJMa5qvum5EY+fU8PjXQ04IwDQYJKoZI\nhvcNAQEFBQADggIBADKL9p1Kyb4U5YysOMo6CdQbzoaz3evUuii+Eq5FLAR0rBNR\nxVgYZk2C2tXck8An4b58n1KeElb21Zyp9HWc+jcSjxyT7Ff+Bw+r1RL3D65hXlaA\nSfX8MPWbTx9BLxyE04nH4toCdu0Jz2zBuByDHBb6lM19oMgY0sidbvW9adRtPTXo\nHqJPYNcHKfyyo6SdbhWSVhlMCrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpB\nemOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5GfbVSUZP/3oNn6z4eGBrxEWi1CXYBmC\nAMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85YmLLW1AL14FABZyb\n7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKSds+x\nDzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvk\nF7mGnjixlAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqF\na3qdnom2piiZk4hA9z7NUaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsT\nQ6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJa7+h89n07eLw4+1knj0vllJPgFOL\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV\nBAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu\nMRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQy\nMDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx\nEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjIw\nggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbCw3Oe\nNcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNH\nPWSb6WiaxswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3I\nx2ymrdMxp7zo5eFm1tL7A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbe\nQTg06ov80egEFGEtQX6sx3dOy1FU+16SGBsEWmjGycT6txOgmLcRK7fWV8x8nhfR\nyyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqVg8NTEQxzHQuyRpDRQjrO\nQG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa5Beny912\nH9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJ\nQfYEkoopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUD\ni/ZnWejBBhG93c+AAk9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORs\nnLMOPReisjQS1n6yqEm70XooQL6iFh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1\nrqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud\nDwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5uQu0wDQYJKoZI\nhvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM\ntCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqf\nGopTpti72TVVsRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkb\nlvdhuDvEK7Z4bLQjb/D907JedR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka\n+elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W81k/BfDxujRNt+3vrMNDcTa/F1bal\nTFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjxmHHEt38OFdAlab0i\nnSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01utI3\ngzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18Dr\nG5gPcFw0sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3Os\nzMOl6W8KjptlwlCFtaOgUxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8x\nL4ysEr3vQCj8KWefshNPZiTEUxnpHikV7+ZtsH8tZ/3zbBt1RqPlShfppNcL\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEn\nMCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL\nExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMg\nb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAxNjEzNDNaFw0zNzA5MzAxNjEzNDRa\nMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZpcm1hIFNBIENJRiBB\nODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3JnMSIw\nIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0B\nAQEFAAOCAQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtb\nunXF/KGIJPov7coISjlUxFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0d\nBmpAPrMMhe5cG3nCYsS4No41XQEMIwRHNaqbYE6gZj3LJgqcQKH0XZi/caulAGgq\n7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jWDA+wWFjbw2Y3npuRVDM3\n0pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFVd9oKDMyX\nroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIG\nA1UdEwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5j\naGFtYmVyc2lnbi5vcmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p\n26EpW1eLTXYGduHRooowDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIA\nBzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hhbWJlcnNpZ24ub3JnMCcGA1Ud\nEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYDVR0gBFEwTzBN\nBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz\naWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEB\nAAxBl8IahsAifJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZd\np0AJPaxJRUXcLo0waLIJuvvDL8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi\n1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wNUPf6s+xCX6ndbcj0dc97wXImsQEc\nXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/nADydb47kMgkdTXg0\neDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1erfu\ntGWaIZDgqtCYvDi1czyL+Nw=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEn\nMCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL\nExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENo\nYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYxNDE4WhcNMzcwOTMwMTYxNDE4WjB9\nMQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgy\nNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEgMB4G\nA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUA\nA4IBDQAwggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0\nMi+ITaFgCPS3CU6gSS9J1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/s\nQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8Oby4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpV\neAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl6DJWk0aJqCWKZQbua795\nB9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c8lCrEqWh\nz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0T\nAQH/BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1i\nZXJzaWduLm9yZy9jaGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4w\nTcbOX60Qq+UDpfqpFDAOBgNVHQ8BAf8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAH\nMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBjaGFtYmVyc2lnbi5vcmcwKgYD\nVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9yZzBbBgNVHSAE\nVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh\nbWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0B\nAQUFAAOCAQEAPDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUM\nbKGKfKX0j//U2K0X1S0E0T9YgOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXi\nryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJPJ7oKXqJ1/6v/2j1pReQvayZzKWG\nVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4IBHNfTIzSJRUTN3c\necQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREest2d/\nAYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNV\nBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4X\nDTA3MDYyOTE1MTMwNVoXDTI3MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQ\nBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwIQ2VydGlnbmEwggEiMA0GCSqGSIb3\nDQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7qXOEm7RFHYeGifBZ4\nQCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyHGxny\ngQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbw\nzBfsV1/pogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q\n130yGLMLLGq/jj8UEYkgDncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2\nJsglrgVKtOdjLPOMFlN+XPsRGgjBRmKfIrjxwo1p3Po6WAbfAgMBAAGjgbwwgbkw\nDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQtCRZvgHyUtVF9lo53BEw\nZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJBgNVBAYT\nAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzj\nAQ/JSP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG\n9w0BAQUFAAOCAQEAhQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8h\nbV6lUmPOEvjvKtpv6zf+EwLHyzs+ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFnc\nfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1kluPBS1xp81HlDQwY9qcEQCYsuu\nHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY1gkIl2PlwS6w\nt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw\nWyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjET\nMBEGA1UEChMKQ2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAk\nBgNVBAMMHUNlcnRpbm9taXMgLSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4\nMjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkGA1UEBhMCRlIxEzARBgNVBAoTCkNl\ncnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYwJAYDVQQDDB1DZXJ0\naW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQADggIP\nADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jY\nF1AMnmHawE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N\n8y4oH3DfVS9O7cdxbwlyLu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWe\nrP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K\n/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92NjMD2AR5vpTESOH2VwnHu\n7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9qc1pkIuVC\n28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6\nlSTClrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1E\nnn1So2+WLhl+HPNbxxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB\n0iSVL1N6aaLwD4ZFjliCK0wi1F6g530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql09\n5gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna4NH4+ej9Uji29YnfAgMBAAGj\nWzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBQN\njLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ\nKoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9s\nov3/4gbIOZ/xWqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZM\nOH8oMDX/nyNTt7buFHAAQCvaR6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q\n619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40nJ+U8/aGH88bc62UeYdocMMzpXDn\n2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1BCxMjidPJC+iKunqj\no3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjvJL1v\nnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG\n5ERQL1TEqkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWq\npdEdnV1j6CTmNhTih60bWfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZb\ndsLLO7XSAPCjDuGtbkD326C00EauFddEwk01+dIL8hf2rGbVJLJP0RyZwG71fet0\nBLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/vgt2Fl43N+bYdJeimUV5\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAw\nPTELMAkGA1UEBhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFz\ncyAyIFByaW1hcnkgQ0EwHhcNOTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9\nMQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2VydHBsdXMxGzAZBgNVBAMTEkNsYXNz\nIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANxQ\nltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR5aiR\nVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyL\nkcAbmXuZVg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCd\nEgETjdyAYveVqUSISnFOYFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yas\nH7WLO7dDWWuwJKZtkIvEcupdM5i3y95ee++U8Rs+yskhwcWYAqqi9lt3m/V+llU0\nHGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRMECDAGAQH/AgEKMAsGA1Ud\nDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJYIZIAYb4\nQgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMu\nY29tL0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/\nAN9WM2K191EBkOvDP9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8\nyfFC82x/xXp8HVGIutIKPidd3i1RTtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMR\nFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+7UCmnYR0ObncHoUW2ikbhiMA\nybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW//1IMwrh3KWB\nkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7\nl7+ijrRU\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYT\nAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBD\nQTAeFw0wNjA3MDQxNzIwMDRaFw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJP\nMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTCC\nASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7IJUqOtdu0KBuqV5Do\n0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHHrfAQ\nUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5d\nRdY4zTW2ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQ\nOA7+j0xbm0bqQfWwCHTD0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwv\nJoIQ4uNllAoEwF73XVv4EOLQunpL+943AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08C\nAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAcYwHQYDVR0O\nBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IBAQA+0hyJ\nLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecY\nMnQ8SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ\n44gx+FkagQnIl6Z0x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6I\nJd1hJyMctTEHBDa0GpC9oHRxUIltvBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNw\ni/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7NzTogVZ96edhBiIL5VaZVDADlN\n9u6wWk5JRFRYX0KD\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBM\nMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD\nQTAeFw0wMjA2MTExMDQ2MzlaFw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBM\nMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD\nQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6xwS7TT3zNJc4YPk/E\njG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdLkKWo\nePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GI\nULdtlkIJ89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapu\nOb7kky/ZR6By6/qmW6/KUz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUg\nAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7PNSzVttpd90gzFFS269lvzs2I1qsb2pY7\nHVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEA\nuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+GXYkHAQa\nTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTg\nxSvgGrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1q\nCjqTE5s7FCMTY5w/0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5x\nO/fIR/RpbxXyEV6DHpx8Uq79AtoSqFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs\n6GAqm4VKQPNriiTsBhYscw==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBM\nMSIwIAYDVQQKExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5D\nZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBU\ncnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIyMTIwNzM3WhcNMjkxMjMxMTIwNzM3\nWjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMg\nUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSIw\nIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0B\nAQEFAAOCAQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rH\nUV+rpDKmYYe2bg+G0jACl/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LM\nTXPb865Px1bVWqeWifrzq2jUI4ZZJ88JJ7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVU\nBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4fOQtf/WsX+sWn7Et0brM\nkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0cvW0QM8x\nAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNV\nHRMBAf8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNV\nHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15y\nsHhE49wcrwn9I0j6vSrEuVUEtRCjjSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfL\nI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1mS1FhIrlQgnXdAIv94nYmem8\nJ9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5ajZt3hrvJBW8qY\nVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI\n03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYD\nVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0\nIHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3\nMRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xKTAnBgNVBAMTIENoYW1iZXJz\nIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEyMjk1MFoXDTM4MDcz\nMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBj\ndXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIw\nEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEp\nMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0G\nCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW9\n28sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKAXuFixrYp4YFs8r/lfTJq\nVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorjh40G072Q\nDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR\n5gN/ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfL\nZEFHcpOrUMPrCXZkNNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05a\nSd+pZgvMPMZ4fKecHePOjlO+Bd5gD2vlGts/4+EhySnB8esHnFIbAURRPHsl18Tl\nUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331lubKgdaX8ZSD6e2wsWsSaR6s\n+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ0wlf2eOKNcx5\nWk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj\nya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAx\nhduub+84Mxh2EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNV\nHQ4EFgQU+SSsD7K1+HnA+mCIG8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1\n+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpN\nYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29t\nL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVy\nZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAt\nIDIwMDiCCQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRV\nHSAAMCowKAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20w\nDQYJKoZIhvcNAQEFBQADggIBAJASryI1wqM58C7e6bXpeHxIvj99RZJe6dqxGfwW\nPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH3qLPaYRgM+gQDROpI9CF\n5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbURWpGqOt1\nglanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaH\nFoI6M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2\npSB7+R5KBWIBpih1YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MD\nxvbxrN8y8NmBGuScvfaAFPDRLLmF9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QG\ntjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcKzBIKinmwPQN/aUv0NCB9szTq\njktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvGnrDQWzilm1De\nfhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg\nOGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZ\nd0jQ\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIID9zCCAt+gAwIBAgIESJ8AATANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMC\nQ04xMjAwBgNVBAoMKUNoaW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24g\nQ2VudGVyMUcwRQYDVQQDDD5DaGluYSBJbnRlcm5ldCBOZXR3b3JrIEluZm9ybWF0\naW9uIENlbnRlciBFViBDZXJ0aWZpY2F0ZXMgUm9vdDAeFw0xMDA4MzEwNzExMjVa\nFw0zMDA4MzEwNzExMjVaMIGKMQswCQYDVQQGEwJDTjEyMDAGA1UECgwpQ2hpbmEg\nSW50ZXJuZXQgTmV0d29yayBJbmZvcm1hdGlvbiBDZW50ZXIxRzBFBgNVBAMMPkNo\naW5hIEludGVybmV0IE5ldHdvcmsgSW5mb3JtYXRpb24gQ2VudGVyIEVWIENlcnRp\nZmljYXRlcyBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAm35z\n7r07eKpkQ0H1UN+U8i6yjUqORlTSIRLIOTJCBumD1Z9S7eVnAztUwYyZmczpwA//\nDdmEEbK40ctb3B75aDFk4Zv6dOtouSCV98YPjUesWgbdYavi7NifFy2cyjw1l1Vx\nzUOFsUcW9SxTgHbP0wBkvUCZ3czY28Sf1hNfQYOL+Q2HklY0bBoQCxfVWhyXWIQ8\nhBouXJE0bhlffxdpxWXvayHG1VA6v2G5BY3vbzQ6sm8UY78WO5upKv23KzhmBsUs\n4qpnHkWnjQRmQvaPK++IIGmPMowUc9orhpFjIpryp9vOiYurXccUwVswah+xt54u\ngQEC7c+WXmPbqOY4twIDAQABo2MwYTAfBgNVHSMEGDAWgBR8cks5x8DbYqVPm6oY\nNJKiyoOCWTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4E\nFgQUfHJLOcfA22KlT5uqGDSSosqDglkwDQYJKoZIhvcNAQEFBQADggEBACrDx0M3\nj92tpLIM7twUbY8opJhJywyA6vPtI2Z1fcXTIWd50XPFtQO3WKwMVC/GVhMPMdoG\n52U7HW8228gd+f2ABsqjPWYWqJ1MFn3AlUa1UeTiH9fqBk1jjZaM7+czV0I664zB\nechNdn3e9rG3geCg+aF4RhcaVpjwTj2rHO3sOdwHSPdj/gauwqRcalsyiMXHM4Ws\nZkJHwlgkmeHlPuV1LI5D1l08eB6olYIpUNHRFrrvwb562bTYzB5MRuF3sTGrvSrI\nzo9uoV1/A3U05K2JRVRevq4opbs/eHnrc7MKDf2+yfdWrPa37S+bISnHOLaVxATy\nwy39FCqQmbkHzJ8=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJD\nTjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2\nMDcwOTE0WhcNMjcwNDE2MDcwOTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMF\nQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwggEiMA0GCSqGSIb3DQEBAQUAA4IB\nDwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzDo+/hn7E7SIX1mlwh\nIhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tizVHa6\ndLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZO\nV/kbZKKTVrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrC\nGHn2emU1z5DrvTOTn1OrczvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gN\nv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrKy5nLAgMBAAGjczBxMBEGCWCGSAGG+EIB\nAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscCwQ7vptU7ETAPBgNVHRMB\nAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991SlgrHAsEO\n76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnK\nOOK5Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvH\nugDnuL8BV8F3RTIMO/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7Hgvi\nyJA/qIYM/PmLXoXLT1tLYhFHxUV8BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fL\nbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2G8kS1sHNzYDzAgE8yGnLRUhj\n2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5mmxE=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb\nMBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow\nGAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj\nYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL\nMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE\nBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM\nGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP\nADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua\nBtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe\n3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4\nYgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR\nrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm\nez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU\noBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF\nMAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v\nQUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t\nb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF\nAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q\nGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz\nRt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2\nG9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi\nl2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3\nsmPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCB\ngTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G\nA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV\nBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw\nMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3Jl\nYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01P\nRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0\naG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3\nUcEbVASY06m/weaKXTuH+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI\n2GqGd0S7WWaXUF601CxwRM/aN5VCaTwwxHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8\nQ5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV4EajcNxo2f8ESIl33rXp\n+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA1KGzqSX+\nDT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5O\nnKVIrLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW\n/zAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6g\nPKA6hjhodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9u\nQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOCAQEAPpiem/Yb6dc5t3iuHXIY\nSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CPOGEIqB6BCsAv\nIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/\nRxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4\nzJVSk/BwJVmcIGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5dd\nBA6+C4OmF4O5MBKgxTMVBbkN+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IB\nZQ==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTEL\nMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE\nBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT\nIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwMzA2MDAw\nMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdy\nZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09N\nT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlv\nbiBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSR\nFtSrYpn1PlILBs5BAH+X4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0J\ncfRK9ChQtP6IHG4/bC8vCVlbpVsLM5niwz2J+Wos77LTBumjQjBAMB0GA1UdDgQW\nBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/\nBAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VGFAkK+qDm\nfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv\nGDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEb\nMBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow\nGAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRp\nZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVow\nfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G\nA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAiBgNV\nBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEB\nBQADggEPADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPM\ncm3ye5drswfxdySRXyWP9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3S\nHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstcrbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996\nCF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rCoznl2yY4rYsK7hljxxwk\n3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3Vp6ea5EQz\n6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNV\nHQ4EFgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1Ud\nEwEB/wQFMAMBAf8wgYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2Rv\nY2EuY29tL1NlY3VyZUNlcnRpZmljYXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRw\nOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmww\nDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm4J4oqF7Tt/Q0\n5qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj\nZ55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtI\ngKvcnDe4IRRLDXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJ\naD61JlfutuC23bkpgHl9j6PwpCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDl\nizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1HRR3B7Hzs/Sk=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEb\nMBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow\nGAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0\naWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEwMDAwMDBaFw0yODEyMzEyMzU5NTla\nMH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO\nBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUwIwYD\nVQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0B\nAQEFAAOCAQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWW\nfnJSoBVC21ndZHoa0Lh73TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMt\nTGo87IvDktJTdyR0nAducPy9C1t2ul/y/9c3S0pgePfw+spwtOpZqqPOSC+pw7IL\nfhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6juljatEPmsbS9Is6FARW\n1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsSivnkBbA7\nkUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0G\nA1UdDgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYD\nVR0TAQH/BAUwAwEB/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21v\nZG9jYS5jb20vVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRo\ndHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMu\nY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8NtwuleGFTQQuS9/\nHrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32\npSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxIS\njBc/lDb+XbDABHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+\nxqFx7D+gIIxmOom0jtTYsU0lR+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/Atyjcn\ndBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O9y5Xt5hwXsjEeLBi\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDkzCCAnugAwIBAgIQFBOWgxRVjOp7Y+X8NId3RDANBgkqhkiG9w0BAQUFADA0\nMRMwEQYDVQQDEwpDb21TaWduIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQG\nEwJJTDAeFw0wNDAzMjQxMTMyMThaFw0yOTAzMTkxNTAyMThaMDQxEzARBgNVBAMT\nCkNvbVNpZ24gQ0ExEDAOBgNVBAoTB0NvbVNpZ24xCzAJBgNVBAYTAklMMIIBIjAN\nBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8ORUaSvTx49qROR+WCf4C9DklBKK\n8Rs4OC8fMZwG1Cyn3gsqrhqg455qv588x26i+YtkbDqthVVRVKU4VbirgwTyP2Q2\n98CNQ0NqZtH3FyrV7zb6MBBC11PN+fozc0yz6YQgitZBJzXkOPqUm7h65HkfM/sb\n2CEJKHxNGGleZIp6GZPKfuzzcuc3B1hZKKxC+cX/zT/npfo4sdAMx9lSGlPWgcxC\nejVb7Us6eva1jsz/D3zkYDaHL63woSV9/9JLEYhwVKZBqGdTUkJe5DSe5L6j7Kpi\nXd3DTKaCQeQzC6zJMw9kglcq/QytNuEMrkvF7zuZ2SOzW120V+x0cAwqTwIDAQAB\no4GgMIGdMAwGA1UdEwQFMAMBAf8wPQYDVR0fBDYwNDAyoDCgLoYsaHR0cDovL2Zl\nZGlyLmNvbXNpZ24uY28uaWwvY3JsL0NvbVNpZ25DQS5jcmwwDgYDVR0PAQH/BAQD\nAgGGMB8GA1UdIwQYMBaAFEsBmz5WGmU2dst7l6qSBe4y5ygxMB0GA1UdDgQWBBRL\nAZs+VhplNnbLe5eqkgXuMucoMTANBgkqhkiG9w0BAQUFAAOCAQEA0Nmlfv4pYEWd\nfoPPbrxHbvUanlR2QnG0PFg/LUAlQvaBnPGJEMgOqnhPOAlXsDzACPw1jvFIUY0M\ncXS6hMTXcpuEfDhOZAYnKuGntewImbQKDdSFc8gS4TXt8QUxHXOZDOuWyt3T5oWq\n8Ir7dcHyCTxlZWTzTNity4hp8+SDtwy9F1qWF8pb/627HOkthIDYIb6FUtnUdLlp\nhbpN7Sgy6/lhSuTENh4Z3G+EER+V9YMoGKgzkkMn3V0TBEVPh9VGzT2ouvDzuFYk\nRes3x+F2T3I5GN9+dHLHcy056mDmrRGiVod7w2ia/viMcKjfZTL0pECMocJEAw6U\nAGegcQCCSA==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAw\nPDEbMBkGA1UEAxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWdu\nMQswCQYDVQQGEwJJTDAeFw0wNDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwx\nGzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBDQTEQMA4GA1UEChMHQ29tU2lnbjEL\nMAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGtWhf\nHZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs49oh\ngHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sW\nv+bznkqH7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ue\nMv5WJDmyVIRD9YTC2LxBkMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr\n9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d19guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt\n6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUwAwEB/zBEBgNVHR8EPTA7\nMDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29tU2lnblNl\nY3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58\nADsAj8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkq\nhkiG9w0BAQUFAAOCAQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7p\niL1DRYHjZiM/EoZNGeQFsOY3wo3aBijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtC\ndsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtpFhpFfTMDZflScZAmlaxMDPWL\nkz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP51qJThRv4zdL\nhfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz\nOjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYG\nA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2Jh\nbCBSb290MB4XDTA2MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UE\nChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBS\nb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Mi8vRRQZhP/8NN5\n7CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW0ozS\nJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2y\nHLtgwEZLAfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iP\nt3sMpTjr3kfb1V05/Iin89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNz\nFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAY\nXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/\nMB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2MDSgMqAw\nhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3Js\nMB8GA1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUA\nA4IBAQBW7wojoFROlZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMj\nWqd8BfP9IjsO0QbE2zZMcwSO5bAi5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUx\nXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2hO0j9n0Hq0V+09+zv+mKts2o\nomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+TX3EJIrduPuoc\nA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW\nWL1WMRJOEcgh4LMRkWXbtKaIOM5V\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc\nMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj\nIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB\nIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE\nRTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl\nU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290\nIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEU\nha88EOQ5bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhC\nQN/Po7qCWWqSG6wcmtoIKyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1Mjwr\nrFDa1sPeg5TKqAyZMg4ISFZbavva4VhYAUlfckE8FQYBjl2tqriTtM2e66foai1S\nNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aKSe5TBY8ZTNXeWHmb0moc\nQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTVjlsB9WoH\ntxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAP\nBgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC\nAQEAlGRZrTlk5ynrE/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756Abrsp\ntJh6sTtU6zkXR34ajgv8HzFZMQSyzhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpa\nIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juwzTkZmDLl\n6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+\nxbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU\nCm26OWMohpLzGITY+9HPBVZkVw==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\nd3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv\nb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG\nEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl\ncnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi\nMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c\nJpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYP\nmDI2dsze3Tyoou9q+yHyUmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+\nwRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4\nVYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpyoeb6pNnVFzF1roV9Iq4/\nAUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whfGHdPAgMB\nAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW\nBBRF66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun\npyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRC\ndWKuh+vy1dneVrOfzM4UKLkNl2BcEkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTf\nfwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38FnSbNd67IJKusm7Xi+fT8r87cm\nNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i8b5QZ7dsvfPx\nH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe\n+o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\nd3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\nQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\nMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\nb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\nCSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\nnh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\n43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\nT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\ngdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\nBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\nTLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\nDQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\nhMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\n06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\nPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\nYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\nCAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\nd3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j\nZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL\nMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3\nLmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug\nRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm\n+9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW\nPNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM\nxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB\nIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3\nhzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg\nEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF\nMAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA\nFLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec\nnzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z\neM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF\nhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2\nYzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe\nvEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep\n+OkuE6N36B9K\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJV\nUzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQL\nEwhEU1RDQSBFMTAeFw05ODEyMTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJ\nBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4x\nETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQCg\nbIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJENySZ\nj9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlV\nSn5JTe2io74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCG\nSAGG+EIBAQQEAwIABzBoBgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMx\nJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UECxMI\nRFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMTAxODEw\nMjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFGp5\nfpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i\n+DAMBgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqG\nSIb3DQEBBQUAA4GBACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lN\nQseSJqBcNJo4cvj9axY+IO6CizEqkzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+\ngG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4RbyhkwS7hp86W0N6w4pl\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDKTCCApKgAwIBAgIENm7TzjANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJV\nUzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQL\nEwhEU1RDQSBFMjAeFw05ODEyMDkxOTE3MjZaFw0xODEyMDkxOTQ3MjZaMEYxCzAJ\nBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4x\nETAPBgNVBAsTCERTVENBIEUyMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQC/\nk48Xku8zExjrEH9OFr//Bo8qhbxe+SSmJIi2A7fBw18DW9Fvrn5C6mYjuGODVvso\nLeE4i7TuqAHhzhy2iCoiRoX7n6dwqUcUP87eZfCocfdPJmyMvMa1795JJ/9IKn3o\nTQPMx7JSxhcxEzu1TdvIxPbDDyQq2gyd55FbgM2UnQIBA6OCASQwggEgMBEGCWCG\nSAGG+EIBAQQEAwIABzBoBgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMx\nJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0dXJlIFRydXN0IENvLjERMA8GA1UECxMI\nRFNUQ0EgRTIxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQwIoAPMTk5ODEyMDkxOTE3\nMjZagQ8yMDE4MTIwOTE5MTcyNlowCwYDVR0PBAQDAgEGMB8GA1UdIwQYMBaAFB6C\nTShlgDzJQW6sNS5ay97u+DlbMB0GA1UdDgQWBBQegk0oZYA8yUFurDUuWsve7vg5\nWzAMBgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqG\nSIb3DQEBBQUAA4GBAEeNg61i8tuwnkUiBbmi1gMOOHLnnvx75pO2mqWilMg0HZHR\nxdf0CiUPPXiBng+xZ8SQTGPdXqfiup/1902lMXucKS1M/mQ+7LZT/uqb7YLbdHVL\nB3luHtgZg3Pe9T7Qtd7nS2h9Qy4qIOF+oHhEngj1mPnHfxsb1gYgAlihw6ID\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBb\nMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3Qx\nETAPBgNVBAsTCERTVCBBQ0VTMRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0w\nMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NThaMFsxCzAJBgNVBAYTAlVTMSAwHgYD\nVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UECxMIRFNUIEFDRVMx\nFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\nMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPu\nktKe1jzIDZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7\ngLFViYsx+tC3dr5BPTCapCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZH\nfAjIgrrep4c9oW24MFbCswKBXy314powGCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4a\nahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPyMjwmR/onJALJfh1biEIT\najV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1UdEwEB/wQF\nMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rk\nc3QuY29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjto\ndHRwOi8vd3d3LnRydXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMt\naW5kZXguaHRtbDAdBgNVHQ4EFgQUCXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZI\nhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V25FYrnJmQ6AgwbN99Pe7lv7Uk\nQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6tFr8hlxCBPeP/\nh40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq\nnExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpR\nrscL9yuwNwXsvFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf2\n9w4LTJxoeHtxMcfrHuBnQfO3oKfN5XozNmr6mis=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/\nMSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\nDkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow\nPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD\nEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\nAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O\nrz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq\nOLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b\nxiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw\n7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD\naeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV\nHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG\nSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69\nikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr\nAvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz\nR8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5\nJDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo\nOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRF\nMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBD\nbGFzcyAzIENBIDIgMjAwOTAeFw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NTha\nME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMM\nHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIwDQYJKoZIhvcNAQEB\nBQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOADER03\nUAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42\ntSHKXzlABF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9R\nySPocq60vFYJfxLLHLGvKZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsM\nlFqVlNpQmvH/pStmMaTJOKDfHR+4CS7zp+hnUquVH+BGPtikw8paxTGA6Eian5Rp\n/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUCAwEAAaOCARowggEWMA8G\nA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ4PGEMA4G\nA1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVj\ndG9yeS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUy\nMENBJTIwMiUyMDIwMDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRl\ncmV2b2NhdGlvbmxpc3QwQ6BBoD+GPWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3Js\nL2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAwOS5jcmwwDQYJKoZIhvcNAQEL\nBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm2H6NMLVwMeni\nacfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0\no3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4K\nzCUqNQT4YJEVdT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8\nPIWmawomDeCTmGCufsYkl4phX5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3Y\nJohw1+qRzT65ysCQblrGXnRl11z+o+I=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRF\nMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBD\nbGFzcyAzIENBIDIgRVYgMjAwOTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUw\nNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNV\nBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAwOTCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfSegpn\nljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM0\n3TP1YtHhzRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6Z\nqQTMFexgaDbtCHu39b+T7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lR\np75mpoo6Kr3HGrHhFPC+Oh25z1uxav60sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8\nHgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure3511H3a6UCAwEAAaOCASQw\nggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyvcop9Ntea\nHNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFw\nOi8vZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xh\nc3MlMjAzJTIwQ0ElMjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1E\nRT9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0MEagRKBChkBodHRwOi8vd3d3LmQt\ndHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xhc3NfM19jYV8yX2V2XzIwMDku\nY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+PPoeUSbrh/Yp\n3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05\nnsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNF\nCSuGdXzfX2lXANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7na\nxpeG0ILD5EJt/rDiZE4OJudANCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqX\nKVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVvw9y4AyHqnxbxLFS1\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNV\nBAMML0VCRyBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx\nc8SxMTcwNQYDVQQKDC5FQkcgQmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXpt\nZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAeFw0wNjA4MTcwMDIxMDlaFw0xNjA4\nMTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25payBTZXJ0aWZpa2Eg\nSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2ltIFRl\na25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIi\nMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h\n4fuXd7hxlugTlkaDT7byX3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAk\ntiHq6yOU/im/+4mRDGSaBUorzAzu8T2bgmmkTPiab+ci2hC6X5L8GCcKqKpE+i4s\ntPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfreYteIAbTdgtsApWjluTL\ndlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZTqNGFav4\nc0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8Um\nTDGyY5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z\n+kI2sSXFCjEmN1ZnuqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0O\nLna9XvNRiYuoP1Vzv9s6xiQFlpJIqkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMW\nOeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vmExH8nYQKE3vwO9D8owrXieqW\nfo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0Nokb+Clsi7n2\nl9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB\n/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgw\nFoAU587GT/wWZ5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+\n8ygjdsZs93/mQJ7ANtyVDR2tFcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI\n6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgmzJNSroIBk5DKd8pNSe/iWtkqvTDO\nTLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64kXPBfrAowzIpAoHME\nwfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqTbCmY\nIai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJn\nxk1Gj7sURT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4Q\nDgZxGhBM/nV+/x5XOULK1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9q\nKd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11t\nhie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQY9iJSrSq3RZj9W6+YKH4\n7ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9AahH3eU7\nQPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB\n8zELMAkGA1UEBhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2Vy\ndGlmaWNhY2lvIChOSUYgUS0wODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1\nYmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYDVQQLEyxWZWdldSBodHRwczovL3d3\ndy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UECxMsSmVyYXJxdWlh\nIEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMTBkVD\nLUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQG\nEwJFUzE7MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8g\nKE5JRiBRLTA4MDExNzYtSSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBD\nZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZlZ2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQu\nbmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJhcnF1aWEgRW50aXRhdHMg\nZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUNDMIIBIjAN\nBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R\n85iKw5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm\n4CgPukLjbo73FCeTae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaV\nHMf5NLWUhdWZXqBIoH7nF2W4onW4HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNd\nQlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0aE9jD2z3Il3rucO2n5nzbcc8t\nlGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw0JDnJwIDAQAB\no4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E\nBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4\nopvpXY0wfwYDVR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBo\ndHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidW\nZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAwDQYJKoZIhvcN\nAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJlF7W2u++AVtd0x7Y\n/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNaAl6k\nSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhy\nRp/7SNVel+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOS\nAgu+TGbrIP65y7WZf+a2E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xl\nnJ2lYJU6Un/10asIbvPuW/mIPX64b24D5EI=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1\nMQswCQYDVQQGEwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1\nczEoMCYGA1UEAwwfRUUgQ2VydGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYG\nCSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIwMTAxMDMwMTAxMDMwWhgPMjAzMDEy\nMTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlBUyBTZXJ0aWZpdHNl\nZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRyZSBS\nb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEB\nAQUAA4IBDwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUy\neuuOF0+W2Ap7kaJjbMeMTC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvO\nbntl8jixwKIy72KyaOBhU8E2lf/slLo2rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIw\nWFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw93X2PaRka9ZP585ArQ/d\nMtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtNP2MbRMNE\n1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYD\nVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/\nzQas8fElyalL1BSZMEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYB\nBQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEF\nBQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+RjxY6hUFaTlrg4wCQiZrxTFGGV\nv9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqMlIpPnTX/dqQG\nE5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u\nuSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIW\niAYLtqZLICjU3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/v\nGVCJYMzpJJUPwssd8m92kMfMdcGWxZ0=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDtjCCAp6gAwIBAgIQRJmNPMADJ72cdpW56tustTANBgkqhkiG9w0BAQUFADB1\nMQswCQYDVQQGEwJUUjEoMCYGA1UEChMfRWxla3Ryb25payBCaWxnaSBHdXZlbmxp\nZ2kgQS5TLjE8MDoGA1UEAxMzZS1HdXZlbiBLb2sgRWxla3Ryb25payBTZXJ0aWZp\na2EgSGl6bWV0IFNhZ2xheWljaXNpMB4XDTA3MDEwNDExMzI0OFoXDTE3MDEwNDEx\nMzI0OFowdTELMAkGA1UEBhMCVFIxKDAmBgNVBAoTH0VsZWt0cm9uaWsgQmlsZ2kg\nR3V2ZW5saWdpIEEuUy4xPDA6BgNVBAMTM2UtR3V2ZW4gS29rIEVsZWt0cm9uaWsg\nU2VydGlmaWthIEhpem1ldCBTYWdsYXlpY2lzaTCCASIwDQYJKoZIhvcNAQEBBQAD\nggEPADCCAQoCggEBAMMSIJ6wXgBljU5Gu4Bc6SwGl9XzcslwuedLZYDBS75+PNdU\nMZTe1RK6UxYC6lhj71vY8+0qGqpxSKPcEC1fX+tcS5yWCEIlKBHMilpiAVDV6wlT\nL/jDj/6z/P2douNffb7tC+Bg62nsM+3YjfsSSYMAyYuXjDtzKjKzEve5TfL0TW3H\n5tYmNwjy2f1rXKPlSFxYvEK+A1qBuhw1DADT9SN+cTAIJjjcJRFHLfO6IxClv7wC\n90Nex/6wN1CZew+TzuZDLMN+DfIcQ2Zgy2ExR4ejT669VmxMvLz4Bcpk9Ok0oSy1\nc+HCPujIyTQlCFzz7abHlJ+tiEMl1+E5YP6sOVkCAwEAAaNCMEAwDgYDVR0PAQH/\nBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ/uRLOU1fqRTy7ZVZoE\nVtstxNulMA0GCSqGSIb3DQEBBQUAA4IBAQB/X7lTW2M9dTLn+sR0GstG30ZpHFLP\nqk/CaOv/gKlR6D1id4k9CnU58W5dF4dvaAXBlGzZXd/aslnLpRCKysw5zZ/rTt5S\n/wzw9JKp8mxTq5vSR6AfdPebmvEvFZ96ZDAYBzwqD2fK/A+JYZ1lpTzlvBNbCNvj\n/+27BrtqBrF6T2XGgv0enIu1De5Iu7i9qgi0+6N8y5/NkHZchpZ4Vwpm+Vganf2X\nKWDeEaaQHBkc7gGWIjQ0LpH5t8Qn0Xvmv/uARFoW5evg1Ao4vOSR49XrXMGs3xtq\nfJ7lddK2l4fbzIcrQzqECK+rPNv3PGYxhrCdU3nt+CPeQuMtgvEP5fqX\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML\nRW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp\nbmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5\nIEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp\nZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0yOTA3\nMjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3\nLmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp\nYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG\nA1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq\nK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe\nsYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX\nMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT\nXTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/\nHoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH\n4QIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV\nHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJKoZIhvcNAQEFBQADggEBADub\nj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPyT/4xmf3IDExo\nU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf\nzX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5b\nu/8j72gZyxKTJ1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+\nbYQLCIt+jerXmCHG8+c8eS9enNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/Er\nfF6adulZkMV8gzURZVE=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC\nVVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u\nZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc\nKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u\nZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1\nMjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE\nChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j\nb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF\nbnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg\nU2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA\nA4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/\nI0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3\nwkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC\nAdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb\noIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5\nBgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p\ndHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk\nMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp\nb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu\ndHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0\nMFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi\nE1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa\nMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI\nhvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN\n95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd\n2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMC\nVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0\nLm5ldC9DUFMgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW\nKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENl\ncnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0MloXDTI2MTEyNzIw\nNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMTkw\nNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSBy\nZWZlcmVuY2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNV\nBAMTJEVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJ\nKoZIhvcNAQEBBQADggEPADCCAQoCggEBALaVtkNC+sZtKm9I35RMOVcF7sN5EUFo\nNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYszA9u3g3s+IIRe7bJWKKf4\n4LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOwwCj0Yzfv9\nKlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGI\nrb68j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi\n94DkZfs0Nw4pgHBNrziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOB\nsDCBrTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAi\ngA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1MzQyWjAfBgNVHSMEGDAWgBRo\nkORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DHhmak8fdLQ/uE\nvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA\nA4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9t\nO1KzKtvn1ISMY/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6Zua\nAGAT/3B+XxFNSRuzFVJ7yVTav52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP\n9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTSW3iDVuycNsMm4hH2Z0kdkquM++v/\neu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0tHuu2guQOHXvgR1m\n0vdXcDazv/wor3ElhVsT/h5/WrQ8\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBe\nMQswCQYDVQQGEwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0\nZC4xKjAoBgNVBAsMIWVQS0kgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe\nFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMxMjdaMF4xCzAJBgNVBAYTAlRXMSMw\nIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEqMCgGA1UECwwhZVBL\nSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEF\nAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAH\nSyZbCUNsIZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAh\nijHyl3SJCRImHJ7K2RKilTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3X\nDZoTM1PRYfl61dd4s5oz9wCGzh1NlDivqOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1\nTBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX12ruOzjjK9SXDrkb5wdJ\nfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0OWQqraffA\nsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uU\nWH1+ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLS\nnT0IFaUQAS2zMnaolQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pH\ndmX2Os+PYhcZewoozRrSgx4hxyy/vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJip\nNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXiZo1jDiVN1Rmy5nk3pyKdVDEC\nAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/QkqiMAwGA1UdEwQF\nMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH\nClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGB\nuvl2ICO1J2B01GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6Yl\nPwZpVnPDimZI+ymBV3QGypzqKOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkP\nJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdVxrsStZf0X4OFunHB2WyBEXYKCrC/\ngpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEPNXubrjlpC2JgQCA2\nj6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+rGNm6\n5ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUB\no2M3IUxExJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS\n/jQ6fbjpKdx2qcgw+BRxgMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2z\nGp1iro2C6pSe3VkQw63d4k3jMdXH7OjysP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTE\nW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmODBCEIZ43ygknQW/2xzQ+D\nhNQ+IIX3Sj0rnP0qCglN6oH4EZw=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV\nUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy\ndGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1\nMVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx\ndWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B\nAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f\nBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A\ncJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC\nAwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ\nMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm\naWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw\nODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj\nIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF\nMAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA\nA4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y\n7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh\n1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEc\nMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBT\nZWN1cmUgZUJ1c2luZXNzIENBLTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQw\nMDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5j\nLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENBLTEwgZ8wDQYJ\nKoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ1MRo\nRvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBu\nWqDZQu4aIZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKw\nEnv+j6YDAgMBAAGjZjBkMBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTAD\nAQH/MB8GA1UdIwQYMBaAFEp4MlIR21kWNl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRK\neDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQFAAOBgQB1W6ibAxHm6VZM\nzfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5lSE/9dR+\nWB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN\n/Bf+KpYrtWKmpj29f5JZzVoqgrI3eQ==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEc\nMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBT\nZWN1cmUgR2xvYmFsIGVCdXNpbmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIw\nMDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0VxdWlmYXggU2Vj\ndXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEdsb2JhbCBlQnVzaW5l\nc3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRVPEnC\nUdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc\n58O/gGzNqfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/\no5brhTMhHD4ePmBudpxnhcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAH\nMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUvqigdHJQa0S3ySPY+6j/s1dr\naGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hsMA0GCSqGSIb3DQEBBAUA\nA4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA\nZ70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv\n8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEVzCCAz+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCRVMx\nIjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1\ndG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2\nMjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20w\nHhcNMDExMDI0MjIwMDAwWhcNMTMxMDI0MjIwMDAwWjCBnTELMAkGA1UEBhMCRVMx\nIjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1\ndG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2\nMjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20w\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDnIwNvbyOlXnjOlSztlB5u\nCp4Bx+ow0Syd3Tfom5h5VtP8c9/Qit5Vj1H5WuretXDE7aTt/6MNbg9kUDGvASdY\nrv5sp0ovFy3Tc9UTHI9ZpTQsHVQERc1ouKDAA6XPhUJHlShbz++AbOCQl4oBPB3z\nhxAwJkh91/zpnZFx/0GaqUC1N5wpIE8fUuOgfRNtVLcK3ulqTgesrBlf3H5idPay\nBQC6haD9HThuy1q7hryUZzM1gywfI834yJFxzJeL764P3CkDG8A563DtwW4O2GcL\niam8NeTvtjS0pbbELaW+0MOUJEjb35bTALVmGotmBQ/dPz/LP6pemkr4tErvlTcb\nAgMBAAGjgZ8wgZwwKgYDVR0RBCMwIYYfaHR0cDovL3d3dy5maXJtYXByb2Zlc2lv\nbmFsLmNvbTASBgNVHRMBAf8ECDAGAQH/AgEBMCsGA1UdEAQkMCKADzIwMDExMDI0\nMjIwMDAwWoEPMjAxMzEwMjQyMjAwMDBaMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4E\nFgQUMwugZtHq2s7eYpMEKFK1FH84aLcwDQYJKoZIhvcNAQEFBQADggEBAEdz/o0n\nVPD11HecJ3lXV7cVVuzH2Fi3AQL0M+2TUIiefEaxvT8Ub/GzR0iLjJcG1+p+o1wq\nu00vR+L4OQbJnC4xGgN49Lw4xiKLMzHwFgQEffl25EvXwOaD7FnMP97/T2u3Z36m\nhoEyIwOdyPdfwUpgpZKpsaSgYMN4h7Mi8yrrW6ntBas3D7Hi05V2Y1Z0jFhyGzfl\nZKG+TQyTmAyX9odtsz/ny4Cm7YjHX1BiAuiZdBbQ5rQ58SfLyEDW44YQqSMSkuBp\nQWOnryULwMWSyx6Yo1q6xTMPoJcB3X/ge9YGVM+h4k0460tQtcsm9MracEpqoeJ5\nquGnM/b9Sh/22WA=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEW\nMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFs\nIENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQG\nEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3Qg\nR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDvPE1A\nPRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/NTL8\nY2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hL\nTytCOb1kLUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL\n5mkWRxHCJ1kDs6ZgwiFAVvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7\nS4wMcoKK+xfNAGw6EzywhIdLFnopsk/bHdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe\n2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE\nFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNHK266ZUap\nEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6td\nEPx7srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv\n/NgdRN3ggX+d6YvhZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywN\nA0ZF66D0f0hExghAzN4bcLUprbqLOzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0\nabby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkCx1YAzUm5s2x7UwQa4qjJqhIF\nI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqFH4z1Ir+rzoPz\n4iIprn2DQKi6bA==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT\nMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i\nYWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG\nEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg\nR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9\n9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq\nfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv\niS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU\n1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+\nbw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW\nMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA\nephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l\nuMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn\nZ57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS\ntQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF\nPseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un\nhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV\n5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY\nMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo\nR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEx\nMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgxCzAJBgNVBAYTAlVTMRYwFAYDVQQK\nEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQcmltYXJ5IENlcnRp\nZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9\nAWbK7hWNb6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjA\nZIVcFU2Ix7e64HXprQU9nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE0\n7e9GceBrAqg1cmuXm2bgyxx5X9gaBGgeRwLmnWDiNpcB3841kt++Z8dtd1k7j53W\nkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGttm/81w7a4DSwDRp35+MI\nmO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4G\nA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJ\nKoZIhvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ1\n6CePbJC/kRYkRj5KTs4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl\n4b7UVXGYNTq+k+qurUKykG/g/CFNNWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6K\noKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHaFloxt/m0cYASSJlyc1pZU8Fj\nUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG1riR/aYNKxoU\nAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL\nMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj\nKSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2\nMDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0\neSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV\nBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw\nNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV\nBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH\nMjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL\nSo17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal\ntJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO\nBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG\nCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT\nqQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz\nrD6ogRLQy7rQkgu2npaqBA+K\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCB\nmDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsT\nMChjKSAyMDA4IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s\neTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhv\ncml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIzNTk1OVowgZgxCzAJ\nBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg\nMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0\nBgNVBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg\nLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz\n+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5jK/BGvESyiaHAKAxJcCGVn2TAppMSAmUm\nhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdEc5IiaacDiGydY8hS2pgn\n5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3CIShwiP/W\nJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exAL\nDmKudlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZC\nhuOl1UcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw\nHQYDVR0OBBYEFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IB\nAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9cr5HqQ6XErhK8WTTOd8lNNTB\nzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbEAp7aDHdlDkQN\nkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD\nAWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUH\nSJsMC8tJP33st/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2G\nspki4cErx5z481+oghLrGREt\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEW\nMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVy\nc2FsIENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYD\nVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1\nc3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC\nAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0DE81\nWzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUG\nFF+3Qs17j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdq\nXbboW0W63MOhBW9Wjo8QJqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxL\nse4YuU6W3Nx2/zu+z18DwPw76L5GG//aQMJS9/7jOvdqdzXQ2o3rXhhqMcceujwb\nKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2WP0+GfPtDCapkzj4T8Fd\nIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP20gaXT73\ny/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRt\nhAAnZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgoc\nQIgfksILAAX/8sgCSqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4\nLt1ZrtmhN79UNdxzMk+MBB4zsslG8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNV\nHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAfBgNV\nHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8EBAMCAYYwDQYJ\nKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z\ndXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQ\nL1EuxBRa3ugZ4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgr\nFg5fNuH8KrUwJM/gYwx7WBr+mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSo\nag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpqA1Ihn0CoZ1Dy81of398j9tx4TuaY\nT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpgY+RdM4kX2TGq2tbz\nGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiPpm8m\n1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJV\nOCiNUW7dFGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH\n6aLcr34YEoP9VhdBLtUpgn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwX\nQMAJKOSLakhT2+zNVVXxxvjpoixMptEmX36vWkzaH6byHCx+rgIW0lbQL1dTR+iS\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEW\nMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVy\nc2FsIENBMB4XDTA0MDMwNDA1MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UE\nBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xHjAcBgNVBAMTFUdlb1RydXN0\nIFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKYV\nVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9tJPi8\ncQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTT\nQjOgNB0eRXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFh\nF7em6fgemdtzbvQKoiFs7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2v\nc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d8Lsrlh/eezJS/R27tQahsiFepdaVaH/w\nmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7VqnJNk22CDtucvc+081xd\nVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3CgaRr0BHdCX\nteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZ\nf9hBZ3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfRe\nBi9Fi1jUIxaS5BZuKGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+\nnhutxx9z3SxPGWX9f5NAEC7S8O08ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB\n/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0XG0D08DYj3rWMB8GA1UdIwQY\nMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG\n9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc\naanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fX\nIwjhmF7DWgh2qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzyn\nANXH/KttgCJwpQzgXQQpAvvLoJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0z\nuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsKxr2EoyNB3tZ3b4XUhRxQ4K5RirqN\nPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxFKyDuSN/n3QmOGKja\nQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2DFKW\nkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9\nER/frslKxfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQt\nDF4JbAiXfKM9fJP/P6EUp8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/Sfuvm\nbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vIP/rmMuGNG2+k5o7Y+SlIis5z/iw=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYD\nVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0\nIHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3\nMRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD\naGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMxNDBaFw0zODA3MzEx\nMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3Vy\ncmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAG\nA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAl\nBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZI\nhvcNAQEBBQADggIPADCCAgoCggIBAMDfVtPkOpt2RbQT2//BthmLN0EYlVJH6xed\nKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXfXjaOcNFccUMd2drvXNL7\nG706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0ZJJ0YPP2\nzxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4\nddPB/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyG\nHoiMvvKRhI9lNNgATH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2\nId3UwD2ln58fQ1DJu7xsepeY7s2MH/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3V\nyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfeOx2YItaswTXbo6Al/3K1dh3e\nbeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSFHTynyQbehP9r\n6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh\nwZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsog\nzCtLkykPAgMBAAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQW\nBBS5CcqcHtvTbDprru1U8VuTBjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDpr\nru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UEBhMCRVUxQzBBBgNVBAcTOk1hZHJp\nZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJmaXJtYS5jb20vYWRk\ncmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJmaXJt\nYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiC\nCQDJzdPp1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCow\nKAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZI\nhvcNAQEFBQADggIBAICIf3DekijZBZRG/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZ\nUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6ReAJ3spED8IXDneRRXoz\nX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/sdZ7LoR/x\nfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVz\na2Mg9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yyd\nYhz2rXzdpjEetrHHfoUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMd\nSqlapskD7+3056huirRXhOukP9DuqqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9O\nAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETrP3iZ8ntxPjzxmKfFGBI/5rso\nM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVqc5iJWzouE4ge\nv8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z\n09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG\nA1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv\nb3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw\nMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i\nYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT\naWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ\njc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp\nxy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp\n1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG\nsnUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ\nU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8\n9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E\nBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B\nAQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz\nyj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE\n38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP\nAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad\nDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME\nHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G\nA1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp\nZ24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1\nMDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG\nA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL\nv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8\neoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq\ntTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd\nC9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa\nzq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB\nmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH\nV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n\nbG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG\n3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs\nJ0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO\n291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS\not+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd\nAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7\nTBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G\nA1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp\nZ24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4\nMTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG\nA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8\nRgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT\ngHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm\nKPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd\nQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ\nXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw\nDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o\nLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU\nRUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp\njjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK\n6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX\nmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs\nMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH\nWD9f\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh\nMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE\nYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3\nMDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo\nZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg\nMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN\nADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA\nPVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w\nwdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi\nEqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY\navx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+\nYihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE\nsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h\n/t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5\nIEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj\nYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD\nggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy\nOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P\nTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ\nHmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER\ndEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf\nReYNnyicsbkqWletNw+vHX/bvZ8=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx\nEDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT\nEUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp\nZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz\nNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH\nEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE\nAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw\nDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD\nE6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH\n/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7Rnwy\nDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVh\nGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGR\ntDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEA\nAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE\nFDqahQcQZyi27/a9BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmX\nWWcDYfF+OwYxdS2hII5PZYe096acvNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu\n9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95kTXWXwTr\ngIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo\n2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO\nLPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI\n4uJEvlz36hz1\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD\nVQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv\nbHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv\nb3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV\nUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU\ncnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds\nb2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH\niM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS\nr41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4\n04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r\nGwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9\n3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P\nlZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1Ix\nRDBCBgNVBAoTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1\ndGlvbnMgQ2VydC4gQXV0aG9yaXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1p\nYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIFJvb3RDQSAyMDExMB4XDTExMTIw\nNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYTAkdSMUQwQgYDVQQK\nEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIENl\ncnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl\nc2VhcmNoIEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEB\nBQADggEPADCCAQoCggEBAKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPz\ndYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJ\nfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa71HFK9+WXesyHgLacEns\nbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u8yBRQlqD\n75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSP\nFEDH3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNV\nHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp\n5dgTBCPuQSUwRwYDVR0eBEAwPqA8MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQu\nb3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQub3JnMA0GCSqGSIb3DQEBBQUA\nA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVtXdMiKahsog2p\n6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8\nTqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7\ndIsXRSZMFpGD/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8Acys\nNnq/onN694/BtZqhFLKPM58N7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXI\nl7WdmplNsDz4SgCbZN2fOUvRJ9e4\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsx\nFjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3Qg\nUm9vdCBDQSAxMB4XDTAzMDUxNTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkG\nA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdr\nb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1ApzQ\njVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEn\nPzlTCeqrauh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjh\nZY4bXSNmO7ilMlHIhqqhqZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9\nnnV0ttgCXjqQesBCNnLsak3c78QA3xMYV18meMjWCnl3v/evt3a5pQuEF10Q6m/h\nq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNVHRMBAf8ECDAGAQH/AgED\nMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7ih9legYsC\nmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI3\n7piol7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clB\noiMBdDhViw+5LmeiIAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJs\nEhTkYY2sEJCehFC78JZvRZ+K88psT/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpO\nfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilTc4afU9hDDl3WY4JxHYB0yvbi\nAmvZWg==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYT\nAkZSMQ8wDQYDVQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQ\nTS9TR0ROMQ4wDAYDVQQLEwVEQ1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG\n9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMB4XDTAyMTIxMzE0MjkyM1oXDTIw\nMTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQIEwZGcmFuY2UxDjAM\nBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NTSTEO\nMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2\nLmZyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaI\ns9z4iPf930Pfeo2aSVz2TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2\nxtgv2pGqaMVy/hcKshd+ebUyiHDKcMCWSo7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4\nu0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYyHF2fYPepraX/z9E0+X1b\nF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNdfrGoRpAx\nVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGd\nPDPQtQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNV\nHSAEDjAMMAoGCCqBegF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAx\nNjAfBgNVHSMEGDAWgBSjBS8YYFDCiQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUF\nAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RKq89toB9RlPhJy3Q2FLwV3duJ\nL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3QMZsyK10XZZOY\nYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg\nCrpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2a\nNjSaTFR+FwNIlQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R\n0982gaEbeC9xs/FZTEYYKKuF0mBWWg==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4\nMQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6\nZW5wZS5jb20wHhcNMDcxMjEzMTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYD\nVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5j\nb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ03rKDx6sp4boFmVq\nscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAKClaO\nxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6H\nLmYRY2xU+zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFX\nuaOKmMPsOzTFlUFpfnXCPCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQD\nyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxTOTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+\nJrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbKF7jJeodWLBoBHmy+E60Q\nrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK0GqfvEyN\nBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8L\nhij+0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIB\nQFqNeb+Lz0vPqhbBleStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+\nHMh3/1uaD7euBUbl8agW7EekFwIDAQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2lu\nZm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+SVpFTlBFIFMuQS4gLSBDSUYg\nQTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBGNjIgUzgxQzBB\nBgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx\nMCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\nAQYwHQYDVR0OBBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUA\nA4ICAQB4pgwWSp9MiDrAyw6lFn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWb\nlaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbgakEyrkgPH7UIBzg/YsfqikuFgba56\nawmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8qhT/AQKM6WfxZSzwo\nJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Csg1lw\nLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCT\nVyvehQP5aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGk\nLhObNA5me0mrZJfQRsN5nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJb\nUjWumDqtujWTI6cfSN01RpiyEGjkpTHCClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/\nQnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZoQ0iy2+tzJOeRf1SktoA+\nnaM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1ZWrOZyGls\nQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcN\nAQkBFglwa2lAc2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZp\ndHNlZXJpbWlza2Vza3VzMRAwDgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMw\nMVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMQsw\nCQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEQ\nMA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\nAIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOB\nSvZiF3tfTQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkz\nABpTpyHhOEvWgxutr2TC+Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvH\nLCu3GFH+4Hv2qEivbDtPL+/40UceJlfwUR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMP\nPbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDaTpxt4brNj3pssAki14sL\n2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQFMAMBAf8w\nggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwIC\nMIHDHoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDk\nAGwAagBhAHMAdABhAHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0\nAHMAZQBlAHIAaQBtAGkAcwBrAGUAcwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABz\nAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABrAGkAbgBuAGkAdABhAG0AaQBz\nAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nwcy8wKwYDVR0f\nBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE\nFASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcY\nP2/v6X2+MA4GA1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOi\nCfP+JmeaUOTDBS8rNXiRTHyoERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+g\nkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyLabVAyJRld/JXIWY7zoVAtjNjGr95\nHvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678IIbsSt4beDI3poHS\nna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkhMp6q\nqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0Z\nTbvGRNs2yyqcjg==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYD\nVQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0\nZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0G\nCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTAeFw0wOTA2MTYxMTMwMThaFw0y\nOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3Qx\nFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3pp\nZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o\ndTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvP\nkd6mJviZpWNwrZuuyjNAfW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tc\ncbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG0IMZfcChEhyVbUr02MelTTMuhTlAdX4U\nfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKApxn1ntxVUwOXewdI/5n7\nN4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm1HxdrtbC\nxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1\n+rUCAwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G\nA1UdDgQWBBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPM\nPcu1SCOhGnqmKrs0aDAbBgNVHREEFDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqG\nSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0olZMEyL/azXm4Q5DwpL7v8u8h\nmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfXI/OMn74dseGk\nddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775\ntyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c\n2Pm2G2JwCz02yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5t\nHMN1Rq41Bab2XD0h7lbwyYIiLXpUq3DDfSJlgnCW\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAw\ncjELMAkGA1UEBhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNy\nb3NlYyBMdGQuMRQwEgYDVQQLEwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9z\nZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0MDYxMjI4NDRaFw0xNzA0MDYxMjI4\nNDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEWMBQGA1UEChMN\nTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMTGU1p\nY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw\nggEKAoIBAQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2u\nuO/TEdyB5s87lozWbxXGd36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+\nLMsvfUh6PXX5qqAnu3jCBspRwn5mS6/NoqdNAoI/gqyFxuEPkEeZlApxcpMqyabA\nvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjcQR/Ji3HWVBTji1R4P770\nYjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJPqW+jqpx\n62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcB\nAQRbMFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3Aw\nLQYIKwYBBQUHMAKGIWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAP\nBgNVHRMBAf8EBTADAQH/MIIBcwYDVR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIB\nAQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3LmUtc3ppZ25vLmh1L1NaU1ov\nMIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0AdAB2AOEAbgB5\nACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn\nAGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABT\nAHoAbwBsAGcA4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABh\nACAAcwB6AGUAcgBpAG4AdAAgAGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABo\nAHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMAegBpAGcAbgBvAC4AaAB1AC8AUwBa\nAFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6Ly93d3cuZS1zemln\nbm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NOPU1p\nY3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxP\nPU1pY3Jvc2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZv\nY2F0aW9uTGlzdDtiaW5hcnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuB\nEGluZm9AZS1zemlnbm8uaHWkdzB1MSMwIQYDVQQDDBpNaWNyb3NlYyBlLVN6aWdu\nw7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhTWjEWMBQGA1UEChMNTWlj\ncm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhVMIGsBgNV\nHSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJI\nVTERMA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDAS\nBgNVBAsTC2UtU3ppZ25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBS\nb290IENBghEAzLjnv04pGv2i3GalHCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS\n8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMTnGZjWS7KXHAM/IO8VbH0jgds\nZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FEaGAHQzAxQmHl\n7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a\n86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfR\nhUZLphK3dehKyVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/\nMPMMNz7UwiiAc7EBt51alhQBS6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQG\nEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3\nMDUGA1UECwwuVGFuw7pzw610dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNl\ncnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBBcmFueSAoQ2xhc3MgR29sZCkgRsWR\ndGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgxMjA2MTUwODIxWjCB\npzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxOZXRM\nb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlm\naWNhdGlvbiBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNz\nIEdvbGQpIEbFkXRhbsO6c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\nMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrT\nlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw/HpYzY6b7cNGbIRwXdrz\nAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAkH3B5r9s5\nVA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRG\nILdwfzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2\nBJtr+UBdADTHLpl1neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAG\nAQH/AgEEMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2M\nU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwWqZw8UQCgwBEIBaeZ5m8BiFRh\nbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTtaYtOUZcTh5m2C\n+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC\nbLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2F\nuLjbvrW5KfnaNwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2\nXjG4Kvte9nHfRCaexOYNkbQudZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUx\nETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0\nb25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQD\nEylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikgVGFudXNpdHZhbnlraWFkbzAeFw05\nOTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYDVQQGEwJIVTERMA8G\nA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNh\nZ2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5l\ndExvY2sgVXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqG\nSIb3DQEBAQUAA4GNADCBiQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xK\ngZjupNTKihe5In+DCnVMm8Bp2GQ5o+2So/1bXHQawEfKOml2mrriRBf8TKPV/riX\niK+IA4kfpPIEPsgHC+b5sy96YhQJRhTKZPWLgLViqNhr1nGTLbO/CVRY7QbrqHvc\nQ7GhaQIDAQABo4ICnzCCApswEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNVHQ8BAf8E\nBAMCAAYwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1G\nSUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFu\nb3MgU3pvbGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBh\nbGFwamFuIGtlc3p1bHQuIEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExv\nY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2VnLWJpenRvc2l0YXNhIHZlZGkuIEEgZGln\naXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUgYXogZWxvaXJ0\nIGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJh\nc2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGph\nbiBhIGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJo\nZXRvIGF6IGVsbGVub3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBP\nUlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmlj\nYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2YWlsYWJsZSBhdCBo\ndHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBjcHNA\nbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06\nsPgzTEdM43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXa\nn3BukxowOR0w2y7jfLKRstE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKS\nNitjrFgBazMpUIaD8QFI\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUx\nETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0\nb25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQD\nEytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBDKSBUYW51c2l0dmFueWtpYWRvMB4X\nDTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJBgNVBAYTAkhVMREw\nDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9u\nc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMr\nTmV0TG9jayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzAN\nBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNA\nOoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3ZW3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC\n2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63euyucYT2BDMIJTLrdKwW\nRMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQwDgYDVR0P\nAQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEW\nggJNRklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0\nYWxhbm9zIFN6b2xnYWx0YXRhc2kgRmVsdGV0ZWxlaWJlbiBsZWlydCBlbGphcmFz\nb2sgYWxhcGphbiBrZXN6dWx0LiBBIGhpdGVsZXNpdGVzIGZvbHlhbWF0YXQgYSBO\nZXRMb2NrIEtmdC4gdGVybWVrZmVsZWxvc3NlZy1iaXp0b3NpdGFzYSB2ZWRpLiBB\nIGRpZ2l0YWxpcyBhbGFpcmFzIGVsZm9nYWRhc2FuYWsgZmVsdGV0ZWxlIGF6IGVs\nb2lydCBlbGxlbm9yemVzaSBlbGphcmFzIG1lZ3RldGVsZS4gQXogZWxqYXJhcyBs\nZWlyYXNhIG1lZ3RhbGFsaGF0byBhIE5ldExvY2sgS2Z0LiBJbnRlcm5ldCBob25s\nYXBqYW4gYSBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIGNpbWVuIHZhZ3kg\na2VyaGV0byBheiBlbGxlbm9yemVzQG5ldGxvY2submV0IGUtbWFpbCBjaW1lbi4g\nSU1QT1JUQU5UISBUaGUgaXNzdWFuY2UgYW5kIHRoZSB1c2Ugb2YgdGhpcyBjZXJ0\naWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQUyBhdmFpbGFibGUg\nYXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwgYXQg\nY3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmY\nta3UzbM2xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2g\npO0u9f38vf5NNwgMvOOWgyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4\nFp1hBWeAyNDYpQcCNJgEjTME1A==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhV\nMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMe\nTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0\ndmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFzcyBB\nKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oXDTE5MDIxOTIzMTQ0\nN1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQHEwhC\ndWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQu\nMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBL\nb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSMD7tM9DceqQWC2ObhbHDqeLVu0ThEDaiD\nzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZz+qMkjvN9wfcZnSX9EUi\n3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC/tmwqcm8\nWgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LY\nOph7tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2Esi\nNCubMvJIH5+hCoR64sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCC\nApswDgYDVR0PAQH/BAQDAgAGMBIGA1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4\nQgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1GSUdZRUxFTSEgRXplbiB0\nYW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pvbGdhbHRhdGFz\naSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu\nIEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtm\nZWxlbG9zc2VnLWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMg\nZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVs\namFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJhc2EgbWVndGFsYWxoYXRv\nIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBzOi8vd3d3\nLm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6\nZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1\nYW5jZSBhbmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3Qg\ndG8gdGhlIE5ldExvY2sgQ1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRs\nb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBjcHNAbmV0bG9jay5uZXQuMA0G\nCSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5ayZrU3/b39/zcT0mwBQO\nxmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjPytoUMaFP\n0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQ\nQeJBCWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxk\nf1qbFFgBJ34TUMdrKuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK\n8CtmdWOMovsEPoMOmzbwGOQmIMOM8CgHrTwXZoi1/baI\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIG0TCCBbmgAwIBAgIBezANBgkqhkiG9w0BAQUFADCByTELMAkGA1UEBhMCSFUx\nETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0\nb25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMUIwQAYDVQQD\nEzlOZXRMb2NrIE1pbm9zaXRldHQgS296amVneXpvaSAoQ2xhc3MgUUEpIFRhbnVz\naXR2YW55a2lhZG8xHjAcBgkqhkiG9w0BCQEWD2luZm9AbmV0bG9jay5odTAeFw0w\nMzAzMzAwMTQ3MTFaFw0yMjEyMTUwMTQ3MTFaMIHJMQswCQYDVQQGEwJIVTERMA8G\nA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNh\nZ2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxQjBABgNVBAMTOU5l\ndExvY2sgTWlub3NpdGV0dCBLb3pqZWd5em9pIChDbGFzcyBRQSkgVGFudXNpdHZh\nbnlraWFkbzEeMBwGCSqGSIb3DQEJARYPaW5mb0BuZXRsb2NrLmh1MIIBIjANBgkq\nhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx1Ilstg91IRVCacbvWy5FPSKAtt2/Goq\neKvld/Bu4IwjZ9ulZJm53QE+b+8tmjwi8F3JV6BVQX/yQ15YglMxZc4e8ia6AFQe\nr7C8HORSjKAyr7c3sVNnaHRnUPYtLmTeriZ539+Zhqurf4XsoPuAzPS4DB6TRWO5\n3Lhbm+1bOdRfYrCnjnxmOCyqsQhjF2d9zL2z8cM/z1A57dEZgxXbhxInlrfa6uWd\nvLrqOU+L73Sa58XQ0uqGURzk/mQIKAR5BevKxXEOC++r6uwSEaEYBTJp0QwsGj0l\nmT+1fMptsK6ZmfoIYOcZwvK9UdPM0wKswREMgM6r3JSda6M5UzrWhQIDAMV9o4IC\nwDCCArwwEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNVHQ8BAf8EBAMCAQYwggJ1Bglg\nhkgBhvhCAQ0EggJmFoICYkZJR1lFTEVNISBFemVuIHRhbnVzaXR2YW55IGEgTmV0\nTG9jayBLZnQuIE1pbm9zaXRldHQgU3pvbGdhbHRhdGFzaSBTemFiYWx5emF0YWJh\nbiBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBBIG1pbm9zaXRldHQg\nZWxla3Ryb25pa3VzIGFsYWlyYXMgam9naGF0YXMgZXJ2ZW55ZXN1bGVzZW5laywg\ndmFsYW1pbnQgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUgYSBNaW5vc2l0ZXR0IFN6\nb2xnYWx0YXRhc2kgU3phYmFseXphdGJhbiwgYXogQWx0YWxhbm9zIFN6ZXJ6b2Rl\nc2kgRmVsdGV0ZWxla2JlbiBlbG9pcnQgZWxsZW5vcnplc2kgZWxqYXJhcyBtZWd0\nZXRlbGUuIEEgZG9rdW1lbnR1bW9rIG1lZ3RhbGFsaGF0b2sgYSBodHRwczovL3d3\ndy5uZXRsb2NrLmh1L2RvY3MvIGNpbWVuIHZhZ3kga2VyaGV0b2sgYXogaW5mb0Bu\nZXRsb2NrLm5ldCBlLW1haWwgY2ltZW4uIFdBUk5JTkchIFRoZSBpc3N1YW5jZSBh\nbmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGFyZSBzdWJqZWN0IHRvIHRo\nZSBOZXRMb2NrIFF1YWxpZmllZCBDUFMgYXZhaWxhYmxlIGF0IGh0dHBzOi8vd3d3\nLm5ldGxvY2suaHUvZG9jcy8gb3IgYnkgZS1tYWlsIGF0IGluZm9AbmV0bG9jay5u\nZXQwHQYDVR0OBBYEFAlqYhaSsFq7VQ7LdTI6MuWyIckoMA0GCSqGSIb3DQEBBQUA\nA4IBAQCRalCc23iBmz+LQuM7/KbD7kPgz/PigDVJRXYC4uMvBcXxKufAQTPGtpvQ\nMznNwNuhrWw3AkxYQTvyl5LGSKjN5Yo5iWH5Upfpvfb5lHTocQ68d4bDBsxafEp+\nNFAwLvt/MpqNPfMgW/hqyobzMUwsWYACff44yTB1HLdV47yfuqhthCgFdbOLDcCR\nVCHnpgu0mfVRQdzNo0ci2ccBgcTcR08m6h/t280NmPSjnLRzMkqWmf68f8glWPhY\n83ZmiVSkpj7EUFy6iRiCdUgh0k8T6GB+B3bbELVR5qq5aKrN9p2QdRLqOBrKROi3\nmacqaJVmlaut74nLYKkGEsaUR+ko\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBi\nMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu\nMTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3Jp\ndHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMxMjM1OTU5WjBiMQswCQYDVQQGEwJV\nUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydO\nZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG\nSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwz\nc7MEL7xxjOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPP\nOCwGJgl6cvf6UDL4wpPTaaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rl\nmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXTcrA/vGp97Eh/jcOrqnErU2lBUzS1sLnF\nBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc/Qzpf14Dl847ABSHJ3A4\nqY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMBAAGjgZcw\ngZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIB\nBjAPBgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwu\nbmV0c29sc3NsLmNvbS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3Jp\ndHkuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc8\n6fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q4LqILPxFzBiwmZVRDuwduIj/\nh1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/GGUsyfJj4akH\n/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv\nwKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHN\npGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCB\nijELMAkGA1UEBhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHly\naWdodCAoYykgMjAwNTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl\nZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQSBDQTAeFw0w\nNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYDVQQGEwJDSDEQMA4G\nA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIwIAYD\nVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBX\nSVNlS2V5IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\nMIIBCgKCAQEAy0+zAJs9Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxR\nVVuuk+g3/ytr6dTqvirdqFEr12bDYVxgAsj1znJ7O7jyTmUIms2kahnBAbtzptf2\nw93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbDd50kc3vkDIzh2TbhmYsF\nmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ/yxViJGg\n4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t9\n4B3RLoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYw\nDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQw\nEAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOx\nSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vImMMkQyh2I+3QZH4VFvbBsUfk2\nftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4+vg1YFkCExh8\nvPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa\nhNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZi\nFj4A4xylNoEYokxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ\n/L7fCg0=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIJhjCCB26gAwIBAgIBCzANBgkqhkiG9w0BAQsFADCCAR4xPjA8BgNVBAMTNUF1\ndG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIFJhaXogZGVsIEVzdGFkbyBWZW5lem9s\nYW5vMQswCQYDVQQGEwJWRTEQMA4GA1UEBxMHQ2FyYWNhczEZMBcGA1UECBMQRGlz\ndHJpdG8gQ2FwaXRhbDE2MDQGA1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0\naWZpY2FjaW9uIEVsZWN0cm9uaWNhMUMwQQYDVQQLEzpTdXBlcmludGVuZGVuY2lh\nIGRlIFNlcnZpY2lvcyBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMSUwIwYJ\nKoZIhvcNAQkBFhZhY3JhaXpAc3VzY2VydGUuZ29iLnZlMB4XDTEwMTIyODE2NTEw\nMFoXDTIwMTIyNTIzNTk1OVowgdExJjAkBgkqhkiG9w0BCQEWF2NvbnRhY3RvQHBy\nb2NlcnQubmV0LnZlMQ8wDQYDVQQHEwZDaGFjYW8xEDAOBgNVBAgTB01pcmFuZGEx\nKjAoBgNVBAsTIVByb3ZlZWRvciBkZSBDZXJ0aWZpY2Fkb3MgUFJPQ0VSVDE2MDQG\nA1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9u\naWNhMQswCQYDVQQGEwJWRTETMBEGA1UEAxMKUFNDUHJvY2VydDCCAiIwDQYJKoZI\nhvcNAQEBBQADggIPADCCAgoCggIBANW39KOUM6FGqVVhSQ2oh3NekS1wwQYalNo9\n7BVCwfWMrmoX8Yqt/ICV6oNEolt6Vc5Pp6XVurgfoCfAUFM+jbnADrgV3NZs+J74\nBCXfgI8Qhd19L3uA3VcAZCP4bsm+lU/hdezgfl6VzbHvvnpC2Mks0+saGiKLt38G\nieU89RLAu9MLmV+QfI4tL3czkkohRqipCKzx9hEC2ZUWno0vluYC3XXCFCpa1sl9\nJcLB/KpnheLsvtF8PPqv1W7/U0HU9TI4seJfxPmOEO8GqQKJ/+MMbpfg353bIdD0\nPghpbNjU5Db4g7ayNo+c7zo3Fn2/omnXO1ty0K+qP1xmk6wKImG20qCZyFSTXai2\n0b1dCl53lKItwIKOvMoDKjSuc/HUtQy9vmebVOvh+qBa7Dh+PsHMosdEMXXqP+UH\n0quhJZb25uSgXTcYOWEAM11G1ADEtMo88aKjPvM6/2kwLkDd9p+cJsmWN63nOaK/\n6mnbVSKVUyqUtd+tFjiBdWbjxywbk5yqjKPK2Ww8F22c3HxT4CAnQzb5EuE8XL1m\nv6JpIzi4mWCZDlZTOpx+FIywBm/xhnaQr/2v/pDGj59/i5IjnOcVdo/Vi5QTcmn7\nK2FjiO/mpF7moxdqWEfLcU8UC17IAggmosvpr2uKGcfLFFb14dq12fy/czja+eev\nbqQ34gcnAgMBAAGjggMXMIIDEzASBgNVHRMBAf8ECDAGAQH/AgEBMDcGA1UdEgQw\nMC6CD3N1c2NlcnRlLmdvYi52ZaAbBgVghl4CAqASDBBSSUYtRy0yMDAwNDAzNi0w\nMB0GA1UdDgQWBBRBDxk4qpl/Qguk1yeYVKIXTC1RVDCCAVAGA1UdIwSCAUcwggFD\ngBStuyIdxuDSAaj9dlBSk+2YwU2u06GCASakggEiMIIBHjE+MDwGA1UEAxM1QXV0\nb3JpZGFkIGRlIENlcnRpZmljYWNpb24gUmFpeiBkZWwgRXN0YWRvIFZlbmV6b2xh\nbm8xCzAJBgNVBAYTAlZFMRAwDgYDVQQHEwdDYXJhY2FzMRkwFwYDVQQIExBEaXN0\ncml0byBDYXBpdGFsMTYwNAYDVQQKEy1TaXN0ZW1hIE5hY2lvbmFsIGRlIENlcnRp\nZmljYWNpb24gRWxlY3Ryb25pY2ExQzBBBgNVBAsTOlN1cGVyaW50ZW5kZW5jaWEg\nZGUgU2VydmljaW9zIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExJTAjBgkq\nhkiG9w0BCQEWFmFjcmFpekBzdXNjZXJ0ZS5nb2IudmWCAQowDgYDVR0PAQH/BAQD\nAgEGME0GA1UdEQRGMESCDnByb2NlcnQubmV0LnZloBUGBWCGXgIBoAwMClBTQy0w\nMDAwMDKgGwYFYIZeAgKgEgwQUklGLUotMzE2MzUzNzMtNzB2BgNVHR8EbzBtMEag\nRKBChkBodHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9sY3IvQ0VSVElGSUNBRE8t\nUkFJWi1TSEEzODRDUkxERVIuY3JsMCOgIaAfhh1sZGFwOi8vYWNyYWl6LnN1c2Nl\ncnRlLmdvYi52ZTA3BggrBgEFBQcBAQQrMCkwJwYIKwYBBQUHMAGGG2h0dHA6Ly9v\nY3NwLnN1c2NlcnRlLmdvYi52ZTBBBgNVHSAEOjA4MDYGBmCGXgMBAjAsMCoGCCsG\nAQUFBwIBFh5odHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9kcGMwDQYJKoZIhvcN\nAQELBQADggIBACtZ6yKZu4SqT96QxtGGcSOeSwORR3C7wJJg7ODU523G0+1ng3dS\n1fLld6c2suNUvtm7CpsR72H0xpkzmfWvADmNg7+mvTV+LFwxNG9s2/NkAZiqlCxB\n3RWGymspThbASfzXg0gTB1GEMVKIu4YXx2sviiCtxQuPcD4quxtxj7mkoP3Yldmv\nWb8lK5jpY5MvYB7Eqvh39YtsL+1+LrVPQA3uvFd359m21D+VJzog1eWuq2w1n8Gh\nHVnchIHuTQfiSLaeS5UtQbHh6N5+LwUeaO6/u5BlOsju6rEYNxxik6SgMexxbJHm\npHmJWhSnFFAFTKQAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXz\nsOfIt+FTvZLm8wyWuevo5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bE\nqCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq3TNWOByyrYDT13K9mmyZY+gAu0F2Bbdb\nmRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5poLWccret9W6aAjtmcz9\nopLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3YeMLEYC/H\nYvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x\nGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv\nb3QgQ0EgMjAeFw0wNjExMjQxODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNV\nBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W\nYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCa\nGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6XJxg\nFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55J\nWpzmM+Yklvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bB\nrrcCaoF6qUWD4gXmuVbBlDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp\n+ARz8un+XJiM9XOva7R+zdRcAitMOeGylZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1\nksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt66/3FsvbzSUr5R/7mp/i\nUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1JdxnwQ5hYIiz\nPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og\n/zOhD7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UH\noycR7hYQe7xFSkyyBNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuI\nyV77zGHcizN300QyNQliBJIWENieJ0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1Ud\nEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBQahGK8SEwzJQTU7tD2\nA8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGUa6FJpEcwRTEL\nMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT\nElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2f\nBluornFdLwUvZ+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzn\ng/iN/Ae42l9NLmeyhP3ZRPx3UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2Bl\nfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodmVjB3pjd4M1IQWK4/YY7yarHvGH5K\nWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK+JDSV6IZUaUtl0Ha\nB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrWIozc\nhLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPR\nTUIZ3Ph1WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWD\nmbA4CD/pXvk1B+TJYm5Xf6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0Z\nohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y\n4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8VCLAAVBpQ570su9t+Oza\n8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x\nGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv\nb3QgQ0EgMzAeFw0wNjExMjQxOTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNV\nBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W\nYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDM\nV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNggDhoB\n4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUr\nH556VOijKTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd\n8lyyBTNvijbO0BNO/79KDDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9Cabwv\nvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbvBNDInIjbC3uBr7E9KsRlOni27tyAsdLT\nmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwpp5ijJUMv7/FfJuGITfhe\nbtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8nT8KKdjc\nT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDt\nWAEXMJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZ\nc6tsgLjoC2SToJyMGf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A\n4iLItLRkT9a6fUg+qGkM17uGcclzuD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYD\nVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHTBgkrBgEEAb5YAAMwgcUwgZMG\nCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmljYXRlIGNvbnN0\naXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0\naWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVu\ndC4wLQYIKwYBBQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2Nw\nczALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4G\nA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4ywLQoUmkRzBFMQswCQYDVQQGEwJC\nTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UEAxMSUXVvVmFkaXMg\nUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZVqyM0\n7ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSem\nd1o417+shvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd\n+LJ2w/w4E6oM3kJpK27zPOuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B\n4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadN\nt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp8kokUvd0/bpO5qgdAm6x\nDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBCbjPsMZ57\nk8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6s\nzHXug/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0j\nWy10QJLZYxkNc91pvGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeT\nmJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK\n4SVhM7JZG+Ju1zdXtg2pEto=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJC\nTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0\naWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0\naWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAzMTkxODMzMzNaFw0yMTAzMTcxODMz\nMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUw\nIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVR\ndW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG\n9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Yp\nli4kVEAkOPcahdxYTMukJ0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2D\nrOpm2RgbaIr1VxqYuvXtdj182d6UajtLF8HVj71lODqV0D1VNk7feVcxKh7YWWVJ\nWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeLYzcS19Dsw3sgQUSj7cug\nF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWenAScOospU\nxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCC\nAk4wPQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVv\ndmFkaXNvZmZzaG9yZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREw\nggENMIIBCQYJKwYBBAG+WAABMIH7MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNl\nIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBh\nc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFy\nZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh\nY3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYI\nKwYBBQUHAgEWFmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3T\nKbkGGew5Oanwl4Rqy+/fMIGuBgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rq\ny+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1p\ndGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYD\nVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6tlCL\nMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSk\nfnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8\n7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1R\ncHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0y\nmQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQW\nxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK\nSnQ2+Q==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJF\nUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJ\nR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcN\nMDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3WjBoMQswCQYDVQQGEwJFUzEfMB0G\nA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScw\nJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0GCSqG\nSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1JAJke+\nWmmmO3I2F0zo37i7L3bhQEZ0ZQKQUgi0/6iMweDHiVYQOTPvaLRfX9ptI6GJXiKj\nSgbwJ/BXufjpTjJ3Cj9BZPPrZe52/lSqfR0grvPXdMIKX/UIKFIIzFVd0g/bmoGl\nu6GzwZTNVOAydTGRGmKy3nXiz0+J2ZGQD0EbtFpKd71ng+CT516nDOeB0/RSrFOy\nA8dEJvt55cs0YFAQexvba9dHq198aMpunUEDEO5rmXteJajCq+TA81yc477OMUxk\nHl6AovWDfgzWyoxVjr7gvkkHD6MkQXpYHYTqWBLI4bft75PelAgxAgMBAAGjggM7\nMIIDNzAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9vY3NwLnBr\naS5ndmEuZXMwEgYDVR0TAQH/BAgwBgEB/wIBAjCCAjQGA1UdIASCAiswggInMIIC\nIwYKKwYBBAG/VQIBADCCAhMwggHoBggrBgEFBQcCAjCCAdoeggHWAEEAdQB0AG8A\ncgBpAGQAYQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAFIA\nYQDtAHoAIABkAGUAIABsAGEAIABHAGUAbgBlAHIAYQBsAGkAdABhAHQAIABWAGEA\nbABlAG4AYwBpAGEAbgBhAC4ADQAKAEwAYQAgAEQAZQBjAGwAYQByAGEAYwBpAPMA\nbgAgAGQAZQAgAFAAcgDhAGMAdABpAGMAYQBzACAAZABlACAAQwBlAHIAdABpAGYA\naQBjAGEAYwBpAPMAbgAgAHEAdQBlACAAcgBpAGcAZQAgAGUAbAAgAGYAdQBuAGMA\naQBvAG4AYQBtAGkAZQBuAHQAbwAgAGQAZQAgAGwAYQAgAHAAcgBlAHMAZQBuAHQA\nZQAgAEEAdQB0AG8AcgBpAGQAYQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEA\nYwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBuAHQAcgBhACAAZQBuACAAbABhACAA\nZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAAOgAvAC8AdwB3AHcA\nLgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0dHA6\nLy93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+y\neAT8MIGVBgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQsw\nCQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0G\nA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVu\nY2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRhTvW1yEICKrNcda3Fbcrn\nlD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdzCkj+IHLt\nb8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg\n9J63NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XF\nducTZnV+ZfsBn5OHiJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmC\nIoaZM3Fa6hlXPZHNqcCjbgcTpsnt+GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0\nIFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz\nBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y\naXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG\n9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMjIzM1oXDTE5MDYy\nNjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y\nazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs\nYXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw\nOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl\ncnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjmFGWHOjVsQaBalfD\ncnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td3zZxFJmP3MKS8edgkpfs\n2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89HBFx1cQqY\nJJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliE\nZwgs3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJ\nn0WuPIqpsHEzXcjFV9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/A\nPhmcGcwTTYJBtYze4D1gCCAPRX5ron+jjBXu\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6\nMRkwFwYDVQQKExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJp\ndHkgMjA0OCBWMzAeFw0wMTAyMjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAX\nBgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAbBgNVBAsTFFJTQSBTZWN1cml0eSAy\nMDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt49VcdKA3Xtp\neafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7Jylg\n/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGl\nwSMiuLgbWhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnh\nAMFRD0xS+ARaqn1y07iHKrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2\nPcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP+Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpu\nAWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB\nBjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4EFgQUB8NR\nMKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYc\nHnmYv/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/\nZb5gEydxiKRz44Rj0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+\nf00/FGj1EVDVwfSQpQgdMWD/YIwjVAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVO\nrSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395nzIlQnQFgCi/vcEkllgVsRch\n6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kApKnXwiJPZ9d3\n7CAFYd4=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBK\nMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x\nGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkx\nMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3Qg\nQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwggEiMA0GCSqG\nSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jxYDiJ\niQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa\n/FHtaMbQbqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJ\njnIFHovdRIWCQtBJwB1g8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnI\nHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYVHDGA76oYa8J719rO+TMg1fW9ajMtgQT7\nsFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi0XPnj3pDAgMBAAGjgZ0w\ngZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQF\nMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCsw\nKaAnoCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsG\nAQQBgjcVAQQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0L\nURYD7xh8yOOvaliTFGCRsoTciE6+OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXO\nH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cnCDpOGR86p1hcF895P4vkp9Mm\nI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/53CYNv6ZHdAbY\niNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc\nf8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDEr\nMCkGA1UEChMiSmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoG\nA1UEAxMTU2VjdXJlU2lnbiBSb290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0\nMDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSswKQYDVQQKEyJKYXBhbiBDZXJ0aWZp\nY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1cmVTaWduIFJvb3RD\nQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvLTJsz\ni1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8\nh9uuywGOwvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOV\nMdrAG/LuYpmGYz+/3ZMqg6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9\nUK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rPO7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni\n8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitAbpSACW22s293bzUIUPsC\nh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZXt94wDgYD\nVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB\nAKChOBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xm\nKbabfSVSSUOrTC4rbnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQ\nX5Ucv+2rIrVls4W6ng+4reV6G4pQOh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWr\nQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01y8hSyn+B/tlr0/cR7SXf+Of5\npPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061lgeLKBObjBmN\nQSdJQO7e5iNEOdyhIta6A/I=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBI\nMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x\nFzAVBgNVBAMTDlNlY3VyZVRydXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIz\nMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAeBgNVBAoTF1NlY3VyZVRydXN0IENv\ncnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCCASIwDQYJKoZIhvcN\nAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQXOZEz\nZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO\n0gMdA+9tDWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIao\nwW8xQmxSPmjL8xk037uHGFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj\n7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b01k/unK8RCSc43Oz969XL0Imnal0ugBS\n8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmHursCAwEAAaOBnTCBmjAT\nBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB\n/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCeg\nJYYjaHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGC\nNxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt3\n6Z3q059c4EVlew3KW+JwULKUBRSuSceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/\n3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHfmbx8IVQr5Fiiu1cprp6poxkm\nD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZnMUFdAvnZyPS\nCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR\n3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDEl\nMCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMh\nU2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIz\nMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09N\nIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNlY3VyaXR5IENvbW11\nbmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\nggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSE\nRMqm4miO/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gO\nzXppFodEtZDkBp2uoQSXWHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5\nbmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4zZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDF\nMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4bepJz11sS6/vmsJWXMY1\nVkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK9U2vP9eC\nOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0G\nCSqGSIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HW\ntWS3irO4G8za+6xmiEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZ\nq51ihPZRwSzJIxXYKLerJRO1RuGGAv8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDb\nEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnWmHyojf6GPgcWkuF75x3sM3Z+\nQi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEWT1MKZPlO9L9O\nVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDEl\nMCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMe\nU2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoX\nDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRy\ndXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3VyaXR5IENvbW11bmlj\nYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANAV\nOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGr\nzbl+dp+++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVM\nVAX3NuRFg3sUZdbcDE3R3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQ\nhNBqyjoGADdH5H5XTz+L62e4iKrFvlNVspHEfbmwhRkGeC7bYRr6hfVKkaHnFtWO\nojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1KEOtOghY6rCcMU/Gt1SSw\nawNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8QIH4D5cs\nOPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3\nDQEBCwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpF\ncoJxDjrSzG+ntKEju/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXc\nokgfGT+Ok+vx+hfuzU7jBBJV1uXk3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8\nt/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6qtnRGEmyR7jTV7JqR50S+kDFy\n1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29mvVXIwAHIRc/\nSjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEY\nMBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21t\ndW5pY2F0aW9uIFJvb3RDQTEwHhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5\nWjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYD\nVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEwggEiMA0GCSqGSIb3\nDQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw8yl8\n9f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJ\nDKaVv0uMDPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9\nMs+k2Y7CI9eNqPPYJayX5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/N\nQV3Is00qVUarH9oe4kA92819uZKAnDfdDJZkndwi92SL32HeFZRSFaB9UslLqCHJ\nxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2JChzAgMBAAGjPzA9MB0G\nA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYwDwYDVR0T\nAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vG\nkl3g0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfr\nUj94nK9NrvjVT8+amCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5\nBw+SUEmK3TGXX8npN6o7WWWXlDLJs58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJU\nJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ6rBK+1YWc26sTfcioU+tHXot\nRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAiFL39vmwLAw==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDIDCCAgigAwIBAgIBJDANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP\nMA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MxIENBMB4XDTAx\nMDQwNjEwNDkxM1oXDTIxMDQwNjEwNDkxM1owOTELMAkGA1UEBhMCRkkxDzANBgNV\nBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMSBDQTCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALWJHytPZwp5/8Ue+H887dF+2rDNbS82rDTG\n29lkFwhjMDMiikzujrsPDUJVyZ0upe/3p4zDq7mXy47vPxVnqIJyY1MPQYx9EJUk\noVqlBvqSV536pQHydekfvFYmUk54GWVYVQNYwBSujHxVX3BbdyMGNpfzJLWaRpXk\n3w0LBUXl0fIdgrvGE+D+qnr9aTCU89JFhfzyMlsy3uhsXR/LpCJ0sICOXZT3BgBL\nqdReLjVQCfOAl/QMF6452F/NM8EcyonCIvdFEu1eEpOdY6uCLrnrQkFEy0oaAIIN\nnvmLVz5MxxftLItyM19yejhW1ebZrgUaHXVFsculJRwSVzb9IjcCAwEAAaMzMDEw\nDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQIR+IMi/ZTiFIwCwYDVR0PBAQDAgEG\nMA0GCSqGSIb3DQEBBQUAA4IBAQCLGrLJXWG04bkruVPRsoWdd44W7hE928Jj2VuX\nZfsSZ9gqXLar5V7DtxYvyOirHYr9qxp81V9jz9yw3Xe5qObSIjiHBxTZ/75Wtf0H\nDjxVyhbMp6Z3N/vbXB9OWQaHowND9Rart4S9Tu+fMTfwRvFAttEMpWT4Y14h21VO\nTzF2nBBhjrZTOqMRvq9tfB69ri3iDGnHhVNoomG6xT60eVR4ngrHAr5i0RGCS2Uv\nkVrCqIexVmiUefkl98HVrhq4uz2PqYo4Ffdz0Fpg0YCw8NzVUM1O7pJIae2yIx4w\nzMiUyLb1O4Z/P6Yun/Y+LLWSlj7fLJOK/4GMDw9ZIRlXvVWa\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP\nMA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAx\nMDQwNjA3Mjk0MFoXDTIxMDQwNjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNV\nBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMiBDQTCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3/Ei9vX+ALTU74W+o\nZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybTdXnt\n5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s\n3TmVToMGf+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2Ej\nvOr7nQKV0ba5cTppCD8PtOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu\n8nYybieDwnPz3BjotJPqdURrBGAgcVeHnfO+oJAjPYok4doh28MCAwEAAaMzMDEw\nDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITTXjwwCwYDVR0PBAQDAgEG\nMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt0jSv9zil\nzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/\n3DEIcbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvD\nFNr450kkkdAdavphOe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6\nTk6ezAyNlNzZRZxe7EJQY670XcSxEtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2\nZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLHllpwrN9M\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJO\nTDEeMBwGA1UEChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFh\ndCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEy\nMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVk\nZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxhbmRlbiBSb290IENB\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFtvszn\nExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw71\n9tV2U02PjLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MO\nhXeiD+EwR+4A5zN9RGcaC1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+U\ntFE5A3+y3qcym7RHjm+0Sq7lr7HcsBthvJly3uSJt3omXdozSVtSnA71iq3DuD3o\nBmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn622r+I/q85Ej0ZytqERAh\nSQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRVHSAAMDww\nOgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMv\ncm9vdC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA\n7Jbg0zTBLL9s+DANBgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k\n/rvuFbQvBgwp8qiSpGEN/KtcCFtREytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzm\neafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbwMVcoEoJz6TMvplW0C5GUR5z6\nu3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3ynGQI0DvDKcWy\n7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR\niJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJO\nTDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFh\ndCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oX\nDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMCTkwxHjAcBgNVBAoMFVN0YWF0IGRl\nciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5lZGVybGFuZGVuIFJv\nb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ5291\nqj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8Sp\nuOUfiUtnvWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPU\nZ5uW6M7XxgpT0GtJlvOjCwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvE\npMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiile7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp\n5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCROME4HYYEhLoaJXhena/M\nUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpICT0ugpTN\nGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy\n5V6548r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv\n6q012iDTiIJh8BIitrzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEK\neN5KzlW/HdXZt1bv8Hb/C3m1r737qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6\nB6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMBAAGjgZcwgZQwDwYDVR0TAQH/\nBAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcCARYxaHR0cDov\nL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV\nHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqG\nSIb3DQEBCwUAA4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLyS\nCZa59sCrI2AGeYwRTlHSeYAz+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen\n5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwjf/ST7ZwaUb7dRUG/kSS0H4zpX897\nIZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaNkqbG9AclVMwWVxJK\ngnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfkCpYL\n+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxL\nvJxxcypFURmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkm\nbEgeqmiSBeGCc1qb3AdbCG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvk\nN1trSt8sV4pAWja63XVECDdCcAz+3F4hoKOKwJCcaNpQ5kUQR3i2TtJlycM33+FC\nY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoVIPVVYpbtbZNQvOSqeK3Z\nywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm66+KAQ==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl\nMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp\nU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw\nNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE\nChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp\nZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3\nDQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf\n8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN\n+lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0\nX9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa\nK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA\n1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G\nA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR\nzt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0\nYXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD\nbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w\nDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3\nL7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D\neruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl\nxy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp\nVSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY\nWQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx\nEDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT\nHFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVs\nZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAw\nMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6\nb25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVj\naG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZp\nY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\nggEBAL3twQP89o/8ArFvW59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMg\nnLRJdzIpVv257IzdIvpy3Cdhl+72WoTsbhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1\nHOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNkN3mSwOxGXn/hbVNMYq/N\nHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7NfZTD4p7dN\ndloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0\nHZbUJtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO\nBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0G\nCSqGSIb3DQEBCwUAA4IBAQARWfolTwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjU\nsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox9g61DLu3\n4jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg\n8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K\npL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1\nmMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx\nEDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT\nHFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs\nZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5\nMDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYD\nVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFy\nZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2Vy\ndmljZXMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20p\nOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm2\n8xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4PahHQUw2eeBGg6345AWh1K\nTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLPLJGmpufe\nhRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk\n6mFBrMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAw\nDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+q\nAdcwKziIorhtSpzyEZGDMA0GCSqGSIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMI\nbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynVv/heyNXB\nve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z\nqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd\niEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn\n0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN\nsSi6\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEW\nMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg\nQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh\ndGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM3WhcNMzYwOTE3MTk0NjM2WjB9\nMQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi\nU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh\ncnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA\nA4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk\npMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf\nOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C\nJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT\nKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi\nHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM\nAv+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w\n+2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+\nGkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3\nZzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B\n26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID\nAQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD\nVR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFul\nF2mHMMo0aEPQQa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCC\nATgwLgYIKwYBBQUHAgEWImh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5w\nZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL2ludGVybWVk\naWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENvbW1lcmNpYWwgKFN0\nYXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0aGUg\nc2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0\naWZpY2F0aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93\nd3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgG\nCWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1\ndGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5fPGFf59Jb2vKXfuM/gTF\nwWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWmN3PH/UvS\nTa0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst\n0OcNOrg+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNc\npRJvkrKTlMeIFw6Ttn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKl\nCcWw0bdT82AUuoVpaiF8H3VhFyAXe2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVF\nP0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA2MFrLH9ZXF2RsXAiV+uKa0hK\n1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBsHvUwyKMQ5bLm\nKhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE\nJnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ\n8dCAWZvLMdibD4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnm\nfyWl8kgAwKQB2j8=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEW\nMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg\nQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh\ndGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM2WhcNMzYwOTE3MTk0NjM2WjB9\nMQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi\nU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh\ncnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA\nA4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk\npMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf\nOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C\nJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT\nKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi\nHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM\nAv+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w\n+2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+\nGkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3\nZzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B\n26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID\nAQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE\nFE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9j\nZXJ0LnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3Js\nLnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFM\nBgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUHAgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0\nY29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRwOi8vY2VydC5zdGFy\ndGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYgU3Rh\ncnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlh\nYmlsaXR5LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2Yg\ndGhlIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFp\nbGFibGUgYXQgaHR0cDovL2NlcnQuc3RhcnRjb20ub3JnL3BvbGljeS5wZGYwEQYJ\nYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNT\nTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOCAgEAFmyZ\n9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8\njhvh3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUW\nFjgKXlf2Ysd6AgXmvB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJz\newT4F+irsfMuXGRuczE6Eri8sxHkfY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1\nny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3fsNrarnDy0RLrHiQi+fHLB5L\nEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZEoalHmdkrQYu\nL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq\nyvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuC\nO3NJo2pXh5Tl1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6V\num0ABj6y6koQOdjQK/W/7HW/lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkySh\nNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38corog14=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEW\nMBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlm\naWNhdGlvbiBBdXRob3JpdHkgRzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1\nOTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoG\nA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRzIwggIiMA0G\nCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8Oo1XJ\nJZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsD\nvfOpL9HG4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnoo\nD/Uefyf3lLE3PbfHkffiAez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/\nQ0kGi4xDuFby2X8hQxfqp0iVAXV16iulQ5XqFYSdCI0mblWbq9zSOdIxHWDirMxW\nRST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbsO+wmETRIjfaAKxojAuuK\nHDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8HvKTlXcxN\nnw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM\n0D4LnMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/i\nUUjXuG+v+E5+M5iSFGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9\nHa90OrInwMEePnWjFqmveiJdnxMaz6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHg\nTuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE\nAwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJKoZIhvcNAQEL\nBQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K\n2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfX\nUfEpY9Z1zRbkJ4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl\n6/2o1PXWT6RbdejF0mCy2wl+JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK\n9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG/+gyRr61M3Z3qAFdlsHB1b6uJcDJ\nHgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTcnIhT76IxW1hPkWLI\nwpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/XldblhY\nXzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5l\nIxKVCCIcl85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoo\nhdVddLHRDiBYmxOlsGOm7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulr\nso8uBtjRkcfGEvRM/TAXw8HaOFvjqermobp573PYtlNXLfbQ4ddI\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEezCCA2OgAwIBAgIQNxkY5lNUfBq1uMtZWts1tzANBgkqhkiG9w0BAQUFADCB\nrjELMAkGA1UEBhMCREUxIDAeBgNVBAgTF0JhZGVuLVd1ZXJ0dGVtYmVyZyAoQlcp\nMRIwEAYDVQQHEwlTdHV0dGdhcnQxKTAnBgNVBAoTIERldXRzY2hlciBTcGFya2Fz\nc2VuIFZlcmxhZyBHbWJIMT4wPAYDVQQDEzVTLVRSVVNUIEF1dGhlbnRpY2F0aW9u\nIGFuZCBFbmNyeXB0aW9uIFJvb3QgQ0EgMjAwNTpQTjAeFw0wNTA2MjIwMDAwMDBa\nFw0zMDA2MjEyMzU5NTlaMIGuMQswCQYDVQQGEwJERTEgMB4GA1UECBMXQmFkZW4t\nV3VlcnR0ZW1iZXJnIChCVykxEjAQBgNVBAcTCVN0dXR0Z2FydDEpMCcGA1UEChMg\nRGV1dHNjaGVyIFNwYXJrYXNzZW4gVmVybGFnIEdtYkgxPjA8BgNVBAMTNVMtVFJV\nU1QgQXV0aGVudGljYXRpb24gYW5kIEVuY3J5cHRpb24gUm9vdCBDQSAyMDA1OlBO\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2bVKwdMz6tNGs9HiTNL1\ntoPQb9UY6ZOvJ44TzbUlNlA0EmQpoVXhOmCTnijJ4/Ob4QSwI7+Vio5bG0F/WsPo\nTUzVJBY+h0jUJ67m91MduwwA7z5hca2/OnpYH5Q9XIHV1W/fuJvS9eXLg3KSwlOy\nggLrra1fFi2SU3bxibYs9cEv4KdKb6AwajLrmnQDaHgTncovmwsdvs91DSaXm8f1\nXgqfeN+zvOyauu9VjxuapgdjKRdZYgkqeQd3peDRF2npW932kKvimAoA0SVtnteF\nhy+S8dF2g08LOlk3KC8zpxdQ1iALCvQm+Z845y2kuJuJja2tyWp9iRe79n+Ag3rm\n7QIDAQABo4GSMIGPMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEG\nMCkGA1UdEQQiMCCkHjAcMRowGAYDVQQDExFTVFJvbmxpbmUxLTIwNDgtNTAdBgNV\nHQ4EFgQUD8oeXHngovMpttKFswtKtWXsa1IwHwYDVR0jBBgwFoAUD8oeXHngovMp\nttKFswtKtWXsa1IwDQYJKoZIhvcNAQEFBQADggEBAK8B8O0ZPCjoTVy7pWMciDMD\npwCHpB8gq9Yc4wYfl35UvbfRssnV2oDsF9eK9XvCAPbpEW+EoFolMeKJ+aQAPzFo\nLtU96G7m1R08P7K9n3frndOMusDXtk3sU5wPBG7qNWdX4wple5A64U8+wwCSersF\niXOMy6ZNwPv2AtawB6MDwidAnwzkhYItr5pCHdDHjfhA7p0GVxzZotiAFP7hYy0y\nh9WUUpY6RsZxlj33mA6ykaqP2vROJAA5VeitF7nTNCtKqUDMFypVZUF0Qn71wK/I\nk63yGFs9iQzbRzkk+OBM8h+wPQrKBU6JIRrjKpms/H+h8Q8bHz2eBIPdltkdOpQ=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBk\nMQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0\nYWwgQ2VydGlmaWNhdGUgU2VydmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3Qg\nQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4MTgyMjA2MjBaMGQxCzAJBgNVBAYT\nAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGlnaXRhbCBDZXJ0aWZp\nY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIICIjAN\nBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9\nm2BtRsiMMW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdih\nFvkcxC7mlSpnzNApbjyFNDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/\nTilftKaNXXsLmREDA/7n29uj/x2lzZAeAR81sH8A25Bvxn570e56eqeqDFdvpG3F\nEzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkCb6dJtDZd0KTeByy2dbco\nkdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn7uHbHaBu\nHYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNF\nvJbNcA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo\n19AOeCMgkckkKmUpWyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjC\nL3UcPX7ape8eYIVpQtPM+GP+HkM5haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJW\nbjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNYMUJDLXT5xp6mig/p/r+D5kNX\nJLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0hBBYw\nFDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j\nBBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzc\nK6FptWfUjNP9MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzf\nky9NfEBWMXrrpA9gzXrzvsMnjgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7Ik\nVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQMbFamIp1TpBcahQq4FJHgmDmHtqB\nsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4HVtA4oJVwIHaM190e\n3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtlvrsR\nls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ip\nmXeascClOS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HH\nb6D0jqTsNFFbjCYDcKF31QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksf\nrK/7DZBaZmBwXarNeNQk7shBoJMBkpxqnvy5JMWzFYJ+vq6VK+uxwNrjAWALXmms\nhFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCyx/yP2FS1k2Kdzs9Z+z0Y\nzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMWNY6E0F/6\nMBr1mmz0DlP5OlvRHA==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIF2TCCA8GgAwIBAgIQHp4o6Ejy5e/DfEoeWhhntjANBgkqhkiG9w0BAQsFADBk\nMQswCQYDVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0\nYWwgQ2VydGlmaWNhdGUgU2VydmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3Qg\nQ0EgMjAeFw0xMTA2MjQwODM4MTRaFw0zMTA2MjUwNzM4MTRaMGQxCzAJBgNVBAYT\nAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGlnaXRhbCBDZXJ0aWZp\nY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAyMIICIjAN\nBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAlUJOhJ1R5tMJ6HJaI2nbeHCOFvEr\njw0DzpPMLgAIe6szjPTpQOYXTKueuEcUMncy3SgM3hhLX3af+Dk7/E6J2HzFZ++r\n0rk0X2s682Q2zsKwzxNoysjL67XiPS4h3+os1OD5cJZM/2pYmLcX5BtS5X4HAB1f\n2uY+lQS3aYg5oUFgJWFLlTloYhyxCwWJwDaCFCE/rtuh/bxvHGCGtlOUSbkrRsVP\nACu/obvLP+DHVxxX6NZp+MEkUp2IVd3Chy50I9AU/SpHWrumnf2U5NGKpV+GY3aF\ny6//SSj8gO1MedK75MDvAe5QQQg1I3ArqRa0jG6F6bYRzzHdUyYb3y1aSgJA/MTA\ntukxGggo5WDDH8SQjhBiYEQN7Aq+VRhxLKX0srwVYv8c474d2h5Xszx+zYIdkeNL\n6yxSNLCK/RJOlrDrcH+eOfdmQrGrrFLadkBXeyq96G4DsguAhYidDMfCd7Camlf0\nuPoTXGiTOmekl9AbmbeGMktg2M7v0Ax/lZ9vh0+Hio5fCHyqW/xavqGRn1V9TrAL\nacywlKinh/LTSlDcX3KwFnUey7QYYpqwpzmqm59m2I2mbJYV4+by+PGDYmy7Velh\nk6M99bFXi08jsJvllGov34zflVEpYKELKeRcVVi3qPyZ7iVNTA6z00yPhOgpD/0Q\nVAKFyPnlw4vP5w8CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0hBBYw\nFDASBgdghXQBUwIBBgdghXQBUwIBMBIGA1UdEwEB/wQIMAYBAf8CAQcwHQYDVR0O\nBBYEFE0mICKJS9PVpAqhb97iEoHF8TwuMB8GA1UdIwQYMBaAFE0mICKJS9PVpAqh\nb97iEoHF8TwuMA0GCSqGSIb3DQEBCwUAA4ICAQAyCrKkG8t9voJXiblqf/P0wS4R\nfbgZPnm3qKhyN2abGu2sEzsOv2LwnN+ee6FTSA5BesogpxcbtnjsQJHzQq0Qw1zv\n/2BZf82Fo4s9SBwlAjxnffUy6S8w5X2lejjQ82YqZh6NM4OKb3xuqFp1mrjX2lhI\nREeoTPpMSQpKwhI3qEAMw8jh0FcNlzKVxzqfl9NX+Ave5XLzo9v/tdhZsnPdTSpx\nsrpJ9csc1fV5yJmz/MFMdOO0vSk3FQQoHt5FRnDsr7p4DooqzgB53MBfGWcsa0vv\naGgLQ+OswWIJ76bdZWGgr4RVSJFSHMYlkSrQwSIjYVmvRRGFHQEkNI/Ps/8XciAT\nwoCqISxxOQ7Qj1zB09GOInJGTB2Wrk9xseEFKZZZ9LuedT3PDTcNYtsmjGOpI99n\nBjx8Oto0QuFmtEYE3saWmA9LSHokMnWRn6z3aOkquVVlzl1h0ydw2Df+n7mvoC5W\nt6NlUe07qxS/TFED6F+KBZvuim6c779o+sjaC+NCydAXFJy3SuCvkychVSa1ZC+N\n8f+mQAWFBVzKBxlcCxMoTFh/wqXvRdpg065lYZ1Tg3TCrvJcwhbtkj6EPnNgiLx2\n9CzP0H1907he0ZESEOnN3col49XtmS++dYFLJPlFRpTJKSFTnCZFqhMX5OfNeOI5\nwSsSnqaeG8XmDtkx2Q==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIF4DCCA8igAwIBAgIRAPL6ZOJ0Y9ON/RAdBB92ylgwDQYJKoZIhvcNAQELBQAw\nZzELMAkGA1UEBhMCY2gxETAPBgNVBAoTCFN3aXNzY29tMSUwIwYDVQQLExxEaWdp\ndGFsIENlcnRpZmljYXRlIFNlcnZpY2VzMR4wHAYDVQQDExVTd2lzc2NvbSBSb290\nIEVWIENBIDIwHhcNMTEwNjI0MDk0NTA4WhcNMzEwNjI1MDg0NTA4WjBnMQswCQYD\nVQQGEwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2Vy\ndGlmaWNhdGUgU2VydmljZXMxHjAcBgNVBAMTFVN3aXNzY29tIFJvb3QgRVYgQ0Eg\nMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMT3HS9X6lds93BdY7Bx\nUglgRCgzo3pOCvrY6myLURYaVa5UJsTMRQdBTxB5f3HSek4/OE6zAMaVylvNwSqD\n1ycfMQ4jFrclyxy0uYAyXhqdk/HoPGAsp15XGVhRXrwsVgu42O+LgrQ8uMIkqBPH\noCE2G3pXKSinLr9xJZDzRINpUKTk4RtiGZQJo/PDvO/0vezbE53PnUgJUmfANykR\nHvvSEaeFGHR55E+FFOtSN+KxRdjMDUN/rhPSays/p8LiqG12W0OfvrSdsyaGOx9/\n5fLoZigWJdBLlzin5M8J0TbDC77aO0RYjb7xnglrPvMyxyuHxuxenPaHZa0zKcQv\nidm5y8kDnftslFGXEBuGCxobP/YCfnvUxVFkKJ3106yDgYjTdLRZncHrYTNaRdHL\nOdAGalNgHa/2+2m8atwBz735j9m9W8E6X47aD0upm50qKGsaCnw8qyIL5XctcfaC\nNYGu+HuB5ur+rPQam3Rc6I8k9l2dRsQs0h4rIWqDJ2dVSqTjyDKXZpBy2uPUZC5f\n46Fq9mDU5zXNysRojddxyNMkM3OxbPlq4SjbX8Y96L5V5jcb7STZDxmPX2MYWFCB\nUWVv8p9+agTnNCRxunZLWB4ZvRVgRaoMEkABnRDixzgHcgplwLa7JSnaFp6LNYth\n7eVxV4O1PHGf40+/fh6Bn0GXAgMBAAGjgYYwgYMwDgYDVR0PAQH/BAQDAgGGMB0G\nA1UdIQQWMBQwEgYHYIV0AVMCAgYHYIV0AVMCAjASBgNVHRMBAf8ECDAGAQH/AgED\nMB0GA1UdDgQWBBRF2aWBbj2ITY1x0kbBbkUe88SAnTAfBgNVHSMEGDAWgBRF2aWB\nbj2ITY1x0kbBbkUe88SAnTANBgkqhkiG9w0BAQsFAAOCAgEAlDpzBp9SSzBc1P6x\nXCX5145v9Ydkn+0UjrgEjihLj6p7jjm02Vj2e6E1CqGdivdj5eu9OYLU43otb98T\nPLr+flaYC/NUn81ETm484T4VvwYmneTwkLbUwp4wLh/vx3rEUMfqe9pQy3omywC0\nWqu1kx+AiYQElY2NfwmTv9SoqORjbdlk5LgpWgi/UOGED1V7XwgiG/W9mR4U9s70\nWBCCswo9GcG/W6uqmdjyMb3lOGbcWAXH7WMaLgqXfIeTK7KK4/HsGOV1timH59yL\nGn602MnTihdsfSlEvoqq9X46Lmgxk7lq2prg2+kupYTNHAq4Sgj5nPFhJpiTt3tm\n7JFe3VE/23MPrQRYCd0EApUKPtN236YQHoA96M2kZNEzx5LH4k5E4wnJTsJdhw4S\nnr8PyQUQ3nqjsTzyP6WqJ3mtMX0f/fwZacXduT98zca0wjAefm6S139hdlqP65VN\nvBFuIXxZN5nQBrz5Bm0yFqXZaajh3DyAHmBR3NdUIR7KYndP+tiPsys6DXhyyWhB\nWkdKwqPrGtcKqzwyVcgKEZzfdNbwQBUdyLmPtTbFr/giuMod89a2GQ+fYWVq6nTI\nfI/DT11lgh/ZDYnadXL77/FHZxOzyNEZiCcmmpl5fx7kLD977vHeTYuWl8PVP3wb\nI+2ksx0WckNLIOFZfsLorSa/ovc=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\nBAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2ln\nbiBHb2xkIENBIC0gRzIwHhcNMDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBF\nMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMR8wHQYDVQQDExZT\nd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC\nCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUqt2/8\n76LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+\nbbqBHH5CjCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c\n6bM8K8vzARO/Ws/BtQpgvd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqE\nemA8atufK+ze3gE/bk3lUIbLtK/tREDFylqM2tIrfKjuvqblCqoOpd8FUrdVxyJd\nMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvRAiTysybUa9oEVeXBCsdt\nMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuendjIj3o02y\nMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69y\nFGkOpeUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPi\naG59je883WX0XaxR7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxM\ngI93e2CaHt+28kgeDrpOVG2Y4OGiGqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCB\nqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUWyV7\nlqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64OfPAeGZe6Drn\n8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov\nL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe6\n45R88a7A3hfm5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczO\nUYrHUDFu4Up+GC9pWbY9ZIEr44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5\nO1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOfMke6UiI0HTJ6CVanfCU2qT1L2sCC\nbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6mGu6uLftIdxf+u+yv\nGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxpmo/a\n77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCC\nhdiDyyJkvC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid3\n92qgQmwLOM7XdVAyksLfKzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEpp\nLd6leNcG2mqeSz53OiATIgHQv2ieY2BrNU0LbbqhPcCT4H8js1WtciVORvnSFu+w\nZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6LqjviOvrv1vA+ACOzB2+htt\nQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFwTCCA6mgAwIBAgIITrIAZwwDXU8wDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UE\nBhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEjMCEGA1UEAxMaU3dpc3NTaWdu\nIFBsYXRpbnVtIENBIC0gRzIwHhcNMDYxMDI1MDgzNjAwWhcNMzYxMDI1MDgzNjAw\nWjBJMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMSMwIQYDVQQD\nExpTd2lzc1NpZ24gUGxhdGludW0gQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQAD\nggIPADCCAgoCggIBAMrfogLi2vj8Bxax3mCq3pZcZB/HL37PZ/pEQtZ2Y5Wu669y\nIIpFR4ZieIbWIDkm9K6j/SPnpZy1IiEZtzeTIsBQnIJ71NUERFzLtMKfkr4k2Htn\nIuJpX+UFeNSH2XFwMyVTtIc7KZAoNppVRDBopIOXfw0enHb/FZ1glwCNioUD7IC+\n6ixuEFGSzH7VozPY1kneWCqv9hbrS3uQMpe5up1Y8fhXSQQeol0GcN1x2/ndi5ob\njM89o03Oy3z2u5yg+gnOI2Ky6Q0f4nIoj5+saCB9bzuohTEJfwvH6GXp43gOCWcw\nizSC+13gzJ2BbWLuCB4ELE6b7P6pT1/9aXjvCR+htL/68++QHkwFix7qepF6w9fl\n+zC8bBsQWJj3Gl/QKTIDE0ZNYWqFTFJ0LwYfexHihJfGmfNtf9dng34TaNhxKFrY\nzt3oEBSa/m0jh26OWnA81Y0JAKeqvLAxN23IhBQeW71FYyBrS3SMvds6DsHPWhaP\npZjydomyExI7C3d3rLvlPClKknLKYRorXkzig3R3+jVIeoVNjZpTxN94ypeRSCtF\nKwH3HBqi7Ri6Cr2D+m+8jVeTO9TUps4e8aCxzqv9KyiaTxvXw3LbpMS/XUz13XuW\nae5ogObnmLo2t/5u7Su9IPhlGdpVCX4l3P5hYnL5fhgC72O00Puv5TtjjGePAgMB\nAAGjgawwgakwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O\nBBYEFFCvzAeHFUdvOMW0ZdHelarp35zMMB8GA1UdIwQYMBaAFFCvzAeHFUdvOMW0\nZdHelarp35zMMEYGA1UdIAQ/MD0wOwYJYIV0AVkBAQEBMC4wLAYIKwYBBQUHAgEW\nIGh0dHA6Ly9yZXBvc2l0b3J5LnN3aXNzc2lnbi5jb20vMA0GCSqGSIb3DQEBBQUA\nA4ICAQAIhab1Fgz8RBrBY+D5VUYI/HAcQiiWjrfFwUF1TglxeeVtlspLpYhg0DB0\nuMoI3LQwnkAHFmtllXcBrqS3NQuB2nEVqXQXOHtYyvkv+8Bldo1bAbl93oI9ZLi+\nFHSjClTTLJUYFzX1UWs/j6KWYTl4a0vlpqD4U99REJNi54Av4tHgvI42Rncz7Lj7\njposiU0xEQ8mngS7twSNC/K5/FqdOxa3L8iYq/6KUFkuozv8KV2LwUvJ4ooTHbG/\nu0IdUt1O2BReEMYxB+9xJ/cbOQncguqLs5WGXv312l0xpuAxtpTmREl0xRbl9x8D\nYSjFyMsSoEJL+WuICI20MhjzdZ/EfwBPBZWcoxcCw7NTm6ogOSkrZvqdr16zktK1\npuEa+S1BaYEUtLS17Yk9zvupnTVCRLEcFHOBzyoBNZox1S2PbYTfgE1X4z/FhHXa\nicYwu+uPyyIIoK6q8QNsOktNCaUOcsZWayFCTiMlFGiudgp8DAdwZPmaL/YFOSbG\nDI8Zf0NebvRbFS/bYV3mZy8/CJT5YLSYMdp08YSTcU1f+2BY0fvEwW2JorsgH51x\nkcsymxM9Pn2SUjWskpSi0xjCfMfqr3YFFt1nJ8J+HAciIfNAChs0B0QTwoRqjt8Z\nWr9/6x3iGjjRXK9HkmuAtTClyY3YqzGBH9/CZjfTk6mFhnll0g==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UE\nBhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWdu\nIFNpbHZlciBDQSAtIEcyMB4XDTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0Nlow\nRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMY\nU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A\nMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644N0Mv\nFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7br\nYT7QbNHm+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieF\nnbAVlDLaYQ1HTWBCrpJH6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH\n6ATK72oxh9TAtvmUcXtnZLi2kUpCe2UuMGoM9ZDulebyzYLs2aFK7PayS+VFheZt\neJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5hqAaEuSh6XzjZG6k4sIN/\nc8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5FZGkECwJ\nMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRH\nHTBsROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTf\njNFusB3hB48IHpmccelM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb6\n5i/4z3GcRm25xBWNOHkDRUjvxF3XCO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOB\nrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU\nF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRBtjpbO8tFnb0c\nwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0\ncDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIB\nAHPGgeAn0i0P4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShp\nWJHckRE1qTodvBqlYJ7YH39FkWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9\nxCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L3XWgwF15kIwb4FDm3jH+mHtwX6WQ\n2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx/uNncqCxv1yL5PqZ\nIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFaDGi8\naRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2X\nem1ZqSqPe97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQR\ndAtq/gsD/KNVV4n+SsuuWxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/\nOMpXEA29MC/HpeZBoNquBYeaoKRlbEwJDIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+\nhAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ubDgEj8Z+7fNzcbBGXJbLy\ntGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/\nMQswCQYDVQQGEwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmlj\nYXRpb24gQXV0aG9yaXR5MB4XDTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1ow\nPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dvdmVybm1lbnQgUm9vdCBDZXJ0aWZp\nY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB\nAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qNw8XR\nIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1q\ngQdW8or5BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKy\nyhwOeYHWtXBiCAEuTk8O1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAts\nF/tnyMKtsc2AtJfcdgEWFelq16TheEfOhtX7MfP6Mb40qij7cEwdScevLJ1tZqa2\njWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wovJ5pGfaENda1UhhXcSTvx\nls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7Q3hub/FC\nVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHK\nYS1tB6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoH\nEgKXTiCQ8P8NHuJBO9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThN\nXo+EHWbNxWCWtFJaBYmOlXqYwZE8lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1Ud\nDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNVHRMEBTADAQH/MDkGBGcqBwAE\nMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg209yewDL7MTqK\nUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ\nTulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyf\nqzvS/3WXy6TjZwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaK\nZEk9GhiHkASfQlK3T8v+R0F2Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFE\nJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlUD7gsL0u8qV1bYH+Mh6XgUmMqvtg7\nhUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6QzDxARvBMB1uUO07+1\nEqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+HbkZ6Mm\nnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WX\nudpVBrkk7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44Vbnz\nssQwmSNOXfJIoRIM3BKQCZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDe\nLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy+fwC00fmcc4QAu4njIT/rEUNE1yDMuAl\npYYsfPQS\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjEL\nMAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV\nBAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0\nQ2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYwMTEyMTQzODQzWhcNMjUxMjMxMjI1\nOTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i\nSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UEAxMc\nVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD\nggEPADCCAQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jf\ntMjWQ+nEdVl//OEd+DFwIxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKg\nuNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2J\nXjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQXa7pIXSSTYtZgo+U4+lK\n8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7uSNQZu+99\n5OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1Ud\nEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3\nkUrL84J6E1wIqzCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy\ndXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6\nLy93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz\nJTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290\nY2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u\nTGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iS\nGNn3Bzn1LL4GdXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprt\nZjluS5TmVfwLG4t3wVMTZonZKNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8\nau0WOB9/WIFaGusyiC2y8zl3gK9etmF1KdsjTYjKUCjLhdLTEKJZbtOTVAB6okaV\nhgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kPJOzHdiEoZa5X6AeI\ndUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfkvQ==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjEL\nMAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV\nBAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0\nQ2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYwMTEyMTQ0MTU3WhcNMjUxMjMxMjI1\nOTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i\nSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UEAxMc\nVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD\nggEPADCCAQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJW\nHt4bNwcwIi9v8Qbxq63WyKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+Q\nVl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo6SI7dYnWRBpl8huXJh0obazovVkdKyT2\n1oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZuV3bOx4a+9P/FRQI2Alq\nukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk2ZyqBwi1\nRb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1Ud\nEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NX\nXAek0CSnwPIA1DCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy\ndXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6\nLy93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz\nJTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290\nY2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u\nTGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlN\nirTzwppVMXzEO2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8\nTtXqluJucsG7Kv5sbviRmEb8yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6\ng0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9IJqDnxrcOfHFcqMRA/07QlIp2+gB\n95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal092Y+tTmBvTwtiBj\nS+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc5A==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTEL\nMAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNV\nBAsTG1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1\nc3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcNMDYwMzIyMTU1NDI4WhcNMjUxMjMx\nMjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIg\nR21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYwJAYD\nVQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcN\nAQEBBQADggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSR\nJJZ4Hgmgm5qVSkr1YnwCqMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3T\nfCZdzHd55yx4Oagmcw6iXSVphU9VDprvxrlE4Vc93x9UIuVvZaozhDrzznq+VZeu\njRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtwag+1m7Z3W0hZneTvWq3z\nwZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9OgdwZu5GQ\nfezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYD\nVR0jBBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAO\nBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0G\nCSqGSIb3DQEBBQUAA4IBAQAo0uCG1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X1\n7caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/CyvwbZ71q+s2IhtNerNXxTPqYn\n8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3ghUJGooWMNjs\nydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT\nujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/\n2TYcuiUaUj0a7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJE\nSzEVMBMGA1UEChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQg\nUm9vdCBDQTAeFw0wMTA0MDUxNjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNV\nBAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJuZXQxHTAbBgNVBAsTFFREQyBJbnRl\ncm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxLhA\nvJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20jxsNu\nZp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a\n0vnRrEvLznWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc1\n4izbSysseLlJ28TQx5yc5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGN\neGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcD\nR0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZIAYb4QgEBBAQDAgAHMGUG\nA1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMMVERDIElu\ndGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxME\nQ1JMMTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3\nWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAw\nHQYDVR0OBBYEFGxkAcf9hW2syNqeUAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJ\nKoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4IBAQBO\nQ8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540mgwV5dOy0uaOX\nwTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+\n2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm89\n9qNLPg7kbWzbO0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0\njUNAE4z9mQNUecYu6oah9jrUCbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38\naQNiuJkFBT1reBK9sG9l\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFGTCCBAGgAwIBAgIEPki9xDANBgkqhkiG9w0BAQUFADAxMQswCQYDVQQGEwJE\nSzEMMAoGA1UEChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTAeFw0wMzAyMTEw\nODM5MzBaFw0zNzAyMTEwOTA5MzBaMDExCzAJBgNVBAYTAkRLMQwwCgYDVQQKEwNU\nREMxFDASBgNVBAMTC1REQyBPQ0VTIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\nMIIBCgKCAQEArGL2YSCyz8DGhdfjeebM7fI5kqSXLmSjhFuHnEz9pPPEXyG9VhDr\n2y5h7JNp46PMvZnDBfwGuMo2HP6QjklMxFaaL1a8z3sM8W9Hpg1DTeLpHTk0zY0s\n2RKY+ePhwUp8hjjEqcRhiNJerxomTdXkoCJHhNlktxmW/OwZ5LKXJk5KTMuPJItU\nGBxIYXvViGjaXbXqzRowwYCDdlCqT9HU3Tjw7xb04QxQBr/q+3pJoSgrHPb8FTKj\ndGqPqcNiKXEx5TukYBdedObaE+3pHx8b0bJoc8YQNHVGEBDjkAB2QMuLt0MJIf+r\nTpPGWOmlgtt3xDqZsXKVSQTwtyv6e1mO3QIDAQABo4ICNzCCAjMwDwYDVR0TAQH/\nBAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwgewGA1UdIASB5DCB4TCB3gYIKoFQgSkB\nAQEwgdEwLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuY2VydGlmaWthdC5kay9yZXBv\nc2l0b3J5MIGdBggrBgEFBQcCAjCBkDAKFgNUREMwAwIBARqBgUNlcnRpZmlrYXRl\nciBmcmEgZGVubmUgQ0EgdWRzdGVkZXMgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEu\nMS4xLiBDZXJ0aWZpY2F0ZXMgZnJvbSB0aGlzIENBIGFyZSBpc3N1ZWQgdW5kZXIg\nT0lEIDEuMi4yMDguMTY5LjEuMS4xLjARBglghkgBhvhCAQEEBAMCAAcwgYEGA1Ud\nHwR6MHgwSKBGoESkQjBAMQswCQYDVQQGEwJESzEMMAoGA1UEChMDVERDMRQwEgYD\nVQQDEwtUREMgT0NFUyBDQTENMAsGA1UEAxMEQ1JMMTAsoCqgKIYmaHR0cDovL2Ny\nbC5vY2VzLmNlcnRpZmlrYXQuZGsvb2Nlcy5jcmwwKwYDVR0QBCQwIoAPMjAwMzAy\nMTEwODM5MzBagQ8yMDM3MDIxMTA5MDkzMFowHwYDVR0jBBgwFoAUYLWF7FZkfhIZ\nJ2cdUBVLc647+RIwHQYDVR0OBBYEFGC1hexWZH4SGSdnHVAVS3OuO/kSMB0GCSqG\nSIb2fQdBAAQQMA4bCFY2LjA6NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEACrom\nJkbTc6gJ82sLMJn9iuFXehHTuJTXCRBuo7E4A9G28kNBKWKnctj7fAXmMXAnVBhO\ninxO5dHKjHiIzxvTkIvmI/gLDjNDfZziChmPyQE+dF10yYscA+UYyAFMP8uXBV2Y\ncaaYb7Z8vTd/vuGTJW1v8AqtFxjhA7wHKcitJuj4YfD9IQl+mo6paH1IYnK9AOoB\nmbgGglGBTvH1tJFUuSN6AJqfXY3gPGS5GhKSKseCRHI53OI8xthV9RVOyAUO28bQ\nYqbsFbS1AoLbrIyigfCbmTH1ICCoiGEKB5+U/NDXG8wuF/MEJ3Zn61SD/aSQfgY9\nBKNDLdr8C2LqL19iUw==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx\nFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD\nVQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv\nbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy\ndmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t\nMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB\nMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG\nA1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp\nb24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl\ncnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv\nbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE\nVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ\nug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR\nuHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG\n9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI\nhfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM\npAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB\nqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf\nQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw\nMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNV\nBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3MDAwMDAwWhcNMzYw\nNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5j\nLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYG\nA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl\nIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqG\nSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsoPD7gFnUnMekz52hWXMJEEUMDSxuaPFs\nW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ1CRfBsDMRJSUjQJib+ta\n3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGcq/gcfomk\n6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6\nSk/KaAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94J\nNqR32HuHUETVPm4pafs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBA\nMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XP\nr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUFAAOCAQEAeRHAS7ORtvzw6WfU\nDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz\nYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX\nxPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2\n/qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/\nLHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7\njVaMaA==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDEL\nMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp\nIDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi\nBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAw\nMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh\nd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBGb3Ig\nYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9v\ndCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/\nBebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6\npapu+7qzcMBniKI11KOasf2twu8x+qi58/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8E\nBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmtgAMADna3+FGO6Lts6K\nDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUNG4k8VIZ3\nKMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41ox\nXZ3Krr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCB\nrjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf\nQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw\nMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV\nBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0wODA0MDIwMDAwMDBa\nFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3Rl\nLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9u\nMTgwNgYDVQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXpl\nZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEcz\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr8nLPvb2FvdeHsbnndm\ngcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2AtP0LMqmsywCPLLEHd5N/8\nYZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC+BsUa0Lf\nb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS9\n9irY7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2S\nzhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUk\nOQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV\nHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQADggEBABpA\n2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW\noCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu\nt8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7c\nKUGRIjxpp7sC8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fM\nm7v/OeZWYdMKp8RcTGB7BXcmer/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZu\nMdRAGmI0Nj81Aa6sY6A=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkEx\nFTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD\nVQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv\nbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEm\nMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wHhcNOTYwODAx\nMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT\nDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3\ndGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNl\ncyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3\nDQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD\ngY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl/Kj0R1HahbUgdJSGHg91\nyekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg71CcEJRCX\nL+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGj\nEzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG\n7oWDTSEwjsrZqG9JGubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6e\nQNuozDJ0uW8NxuOzRAvZim+aKZuZGCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZ\nqdq5snUb9kLy78fyGPmJvKP/iiMucEc=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBF\nMQswCQYDVQQGEwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQL\nExNUcnVzdGlzIEZQUyBSb290IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTEx\nMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNVBAoTD1RydXN0aXMgTGltaXRlZDEc\nMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQAD\nggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQRUN+\nAOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihH\niTHcDnlkH5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjj\nvSkCqPoc4Vu5g6hBSLwacY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA\n0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zto3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlB\nOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEAAaNTMFEwDwYDVR0TAQH/\nBAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAdBgNVHQ4E\nFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01\nGX2cGE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmW\nzaD+vkAMXBJV+JOCyinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP4\n1BIy+Q7DsdwyhEQsb8tGD+pmQQ9P8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZE\nf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHVl/9D7S3B2l0pKoU/rGXuhg8F\njZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYliB6XzCGcKQEN\nZetX2fNXlrtIzYE=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx\nKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd\nBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl\nYyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgxMDAxMTAyOTU2WhcNMzMxMDAxMjM1\nOTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy\naXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50\nZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0G\nCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN\n8ELg63iIVl6bmlQdTQyK9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/\nRLyTPWGrTs0NvvAgJ1gORH8EGoel15YUNpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4\nhqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZFiP0Zf3WHHx+xGwpzJFu5\nZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W0eDrXltM\nEnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGj\nQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1\nA/d2O2GCahKqGFPrAyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOy\nWL6ukK2YJ5f+AbGwUgC4TeQbIXQbfsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ\n1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzTucpH9sry9uetuUg/vBa3wW30\n6gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7hP0HHRwA11fXT\n91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml\ne9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4p\nTpPDpFQUWw==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRS\nMRgwFgYDVQQHDA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJp\nbGltc2VsIHZlIFRla25vbG9qaWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSw\nVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ryb25payB2ZSBLcmlwdG9sb2ppIEFy\nYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNVBAsMGkthbXUgU2Vy\ndGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUgS8O2\nayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAe\nFw0wNzA4MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIx\nGDAWBgNVBAcMD0dlYnplIC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmls\naW1zZWwgdmUgVGVrbm9sb2ppayBBcmHFn3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBU\nQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZlIEtyaXB0b2xvamkgQXJh\nxZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2FtdSBTZXJ0\naWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7Zr\nIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIB\nIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4h\ngb46ezzb8R1Sf1n68yJMlaCQvEhOEav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yK\nO7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1xnnRFDDtG1hba+818qEhTsXO\nfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR6Oqeyjh1jmKw\nlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL\nhmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQID\nAQABo0IwQDAdBgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/\nBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmP\nNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4N5EY3ATIZJkrGG2AA1nJrvhY0D7t\nwyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLTy9LQQfMmNkqblWwM\n7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYhLBOh\ngLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5n\noN+J1q2MdqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUs\nyZyQ2uypQjyttgI=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOc\nUktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx\nc8SxMQswCQYDVQQGDAJUUjEPMA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykg\nMjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8\ndmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMxMDI3MTdaFw0xNTAz\nMjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsgU2Vy\ndGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYD\nVQQHDAZBTktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kg\nxLBsZXRpxZ9pbSB2ZSBCaWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEu\nxZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7\nXfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GXyGl8hMW0kWxsE2qkVa2k\nheiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8iSi9BB35J\nYbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5C\nurKZ8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1\nJuTm5Rh8i27fbMx4W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51\nb0dewQIDAQABoxAwDjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV\n9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46sWrv7/hg0Uw2ZkUd82YCdAR7\nkjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxEq8Sn5RTOPEFh\nfEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy\nB0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdA\naLX/7KfS0zgYnNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKS\nRGQDJereW26fyfJOrN3H\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOc\nUktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx\nc8SxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xS\nS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kg\nSGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4XDTA3MTIyNTE4Mzcx\nOVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxla3Ry\nb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMC\nVFIxDzANBgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDE\nsGxldGnFn2ltIHZlIEJpbGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7F\nni4gKGMpIEFyYWzEsWsgMjAwNzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\nggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9NYvDdE3ePYakqtdTyuTFY\nKTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQvKUmi8wUG\n+7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveG\nHtyaKhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6P\nIzdezKKqdfcYbwnTrqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M\n733WB2+Y8a+xwXrXgTW4qhe04MsCAwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHk\nYb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0G\nCSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/sPx+EnWVUXKgW\nAkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I\naE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5\nmxRZNTZPz/OOXl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsa\nXRik7r4EW5nVcV9VZWRi1aKbBFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZ\nqxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAKpoRq0Tl9\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOc\nUktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx\nc8SxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xS\nS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kg\nSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcNMDUxMTA3MTAwNzU3\nWhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVrdHJv\nbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJU\nUjEPMA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSw\nbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWe\nLiAoYykgS2FzxLFtIDIwMDUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\nAQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqeLCDe2JAOCtFp0if7qnef\nJ1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKIx+XlZEdh\nR3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJ\nQv2gQrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGX\nJHpsmxcPbe9TmJEr5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1p\nzpwACPI2/z7woQ8arBT9pmAPAgMBAAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58S\nFq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8GA1UdEwEB/wQFMAMBAf8wDQYJ\nKoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/nttRbj2hWyfIvwq\nECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4\nJl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFz\ngw2lGh1uEpJ+hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotH\nuFEJjOp9zYhys2AzsfAKRO8P9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LS\ny3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5UrbnBEI=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzES\nMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFU\nV0NBIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMz\nWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJVEFJV0FO\nLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlm\naWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\nAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFE\nAcK0HMMxQhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HH\nK3XLfJ+utdGdIzdjp9xCoi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeX\nRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/z\nrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1ry+UPizgN7gr8/g+YnzAx\n3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV\nHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkq\nhkiG9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeC\nMErJk/9q56YAf4lCmtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdls\nXebQ79NqZp4VKIV66IIArB6nCWlWQtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62D\nlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVYT0bf+215WfKEIlKuD8z7fDvn\naspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocnyYh0igzyXxfkZ\nYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCB\nkzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug\nQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho\ndHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZBgNVBAMTElVUTiAtIERBVEFDb3Jw\nIFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBaMIGTMQswCQYDVQQG\nEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYD\nVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cu\ndXNlcnRydXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjAN\nBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6\nE5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ysraP6LnD43m77VkIVni5c7yPeIbkFdicZ\nD0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlowHDyUwDAXlCCpVZvNvlK\n4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA9P4yPykq\nlXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulW\nbfXv33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQAB\no4GrMIGoMAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRT\nMtGzz3/64PGgXYVOktKeRR20TzA9BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3Js\nLnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dDLmNybDAqBgNVHSUEIzAhBggr\nBgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3DQEBBQUAA4IB\nAQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft\nGzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyj\nj98C5OBxOvG0I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVH\nKWss5nbZqSl9Mt3JNjy9rjXxEZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv\n2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwPDPafepE39peC4N1xaf92P2BNPM/3\nmfnGV/TJVTl4uix5yaaIK/QI\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEojCCA4qgAwIBAgIQRL4Mi1AAJLQR0zYlJWfJiTANBgkqhkiG9w0BAQUFADCB\nrjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug\nQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho\ndHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xNjA0BgNVBAMTLVVUTi1VU0VSRmlyc3Qt\nQ2xpZW50IEF1dGhlbnRpY2F0aW9uIGFuZCBFbWFpbDAeFw05OTA3MDkxNzI4NTBa\nFw0xOTA3MDkxNzM2NThaMIGuMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAV\nBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5l\ndHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRydXN0LmNvbTE2MDQGA1UE\nAxMtVVROLVVTRVJGaXJzdC1DbGllbnQgQXV0aGVudGljYXRpb24gYW5kIEVtYWls\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsjmFpPJ9q0E7YkY3rs3B\nYHW8OWX5ShpHornMSMxqmNVNNRm5pELlzkniii8efNIxB8dOtINknS4p1aJkxIW9\nhVE1eaROaJB7HHqkkqgX8pgV8pPMyaQylbsMTzC9mKALi+VuG6JG+ni8om+rWV6l\nL8/K2m2qL+usobNqqrcuZzWLeeEeaYji5kbNoKXqvgvOdjp6Dpvq/NonWz1zHyLm\nSGHGTPNpsaguG7bUMSAsvIKKjqQOpdeJQ/wWWq8dcdcRWdq6hw2v+vPhwvCkxWeM\n1tZUOt4KpLoDd7NlyP0e03RiqhjKaJMeoYV+9Udly/hNVyh00jT/MLbu9mIwFIws\n6wIDAQABo4G5MIG2MAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud\nDgQWBBSJgmd9xJ0mcABLtFBIfN49rgRufTBYBgNVHR8EUTBPME2gS6BJhkdodHRw\nOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLVVTRVJGaXJzdC1DbGllbnRBdXRoZW50\naWNhdGlvbmFuZEVtYWlsLmNybDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUH\nAwQwDQYJKoZIhvcNAQEFBQADggEBALFtYV2mGn98q0rkMPxTbyUkxsrt4jFcKw7u\n7mFVbwQ+zznexRtJlOTrIEy05p5QLnLZjfWqo7NK2lYcYJeA3IKirUq9iiv/Cwm0\nxtcgBEXkzYABurorbs6q15L+5K/r9CYdFip/bDCVNy8zEqx/3cfREYxRmLLQo5HQ\nrfafnoOTHh1CuEava2bwm3/q4wMC5QJRwarVNZ1yQAOJujEdxRBoUp7fooXFXAim\neOZTT7Hot9MUnpOmw2TjrH5xzbyf6QMbzPvprDHBr3wVdAKZw7JHpsIyYdfHb0gk\nUSeh1YdV8nuPmD0Wnu51tvjQjvLzxq4oW6fw8zYX/MMF08oDSlQ=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCB\nlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug\nQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho\ndHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt\nSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgxOTIyWjCBlzELMAkG\nA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEe\nMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8v\nd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdh\ncmUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn\n0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlIwrthdBKWHTxqctU8EGc6Oe0rE81m65UJ\nM6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFdtqdt++BxF2uiiPsA3/4a\nMXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8i4fDidNd\noI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqI\nDsjfPe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9Ksy\noUhbAgMBAAGjgbkwgbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYD\nVR0OBBYEFKFyXyYbKJhDlV0HN9WFlp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0\ndHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LUhhcmR3YXJlLmNy\nbDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEF\nBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM\n//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28Gpgoiskli\nCE7/yMgUsogWXecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gE\nCJChicsZUN/KHAG8HQQZexB2lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t\n3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kniCrVWFCVH/A7HFe7fRQ5YiuayZSS\nKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67nfhmqA==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0\nIFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz\nBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y\naXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG\n9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIyMjM0OFoXDTE5MDYy\nNTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y\nazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs\nYXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw\nOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl\ncnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9Y\nLqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIiGQj4/xEjm84H9b9pGib+\nTunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCmDuJWBQ8Y\nTfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0\nLBwGlN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLW\nI8sogTLDAHkY7FkXicnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPw\nnXS3qT6gpf+2SQMT2iLM7XGCK5nPOrf1LXLI\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0\nIFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz\nBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y\naXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG\n9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMTk1NFoXDTE5MDYy\nNjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y\nazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs\nYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw\nOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl\ncnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5avIWZJV16vY\ndA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zfN1SLUzm1NZ9\nWlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7RfZHM047QS\nv4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9v\nUJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTu\nIYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwC\nW/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIICPDCCAaUCED9pHoGc8JpK83P/uUii5N0wDQYJKoZIhvcNAQEFBQAwXzELMAkG\nA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz\ncyAxIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2\nMDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV\nBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmlt\nYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN\nADCBiQKBgQDlGb9to1ZhLZlIcfZn3rmN67eehoAKkQ76OCWvRoiC5XOooJskXQ0f\nzGVuDLDQVoQYh5oGmxChc9+0WDlrbsH2FdWoqD+qEgaNMax/sDTXjzRniAnNFBHi\nTkVWaR94AoDa3EeRKbs2yWNcxeDXLYd7obcysHswuiovMaruo2fa2wIDAQABMA0G\nCSqGSIb3DQEBBQUAA4GBAFgVKTk8d6PaXCUDfGD67gmZPCcQcMgMCeazh88K4hiW\nNWLMv5sneYlfycQJ9M61Hd8qveXbhpxoJeUwfLaJFf5n0a3hUKw8fGJLj7qE1xIV\nGx/KXQ/BUpQqEZnae88MNhPVNdwQGVnqlMEAv3WP2fr9dgTbYruQagPZRjXZ+Hxb\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDAjCCAmsCEEzH6qqYPnHTkxD4PTqJkZIwDQYJKoZIhvcNAQEFBQAwgcExCzAJ\nBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh\nc3MgMSBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy\nMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp\nemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X\nDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw\nFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMg\nUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo\nYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5\nMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB\nAQUAA4GNADCBiQKBgQCq0Lq+Fi24g9TK0g+8djHKlNgdk4xWArzZbxpvUjZudVYK\nVdPfQ4chEWWKfo+9Id5rMj8bhDSVBZ1BNeuS65bdqlk/AVNtmU/t5eIqWpDBucSm\nFc/IReumXY6cPvBkJHalzasab7bYe1FhbqZ/h8jit+U03EGI6glAvnOSPWvndQID\nAQABMA0GCSqGSIb3DQEBBQUAA4GBAKlPww3HZ74sy9mozS11534Vnjty637rXC0J\nh9ZrbWB85a7FkCMMXErQr7Fd88e2CtvgFZMN3QO8x3aKtd1Pw5sTdbgBwObJW2ul\nuIncrKTdcu1OofdPvAbT6shkdHvClUGcZXNY8ZCaPGqxmMnEh7zPRW1F4m4iP/68\nDzFc6PLZ\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEGjCCAwICEQCLW3VWhFSFCwDPrzhIzrGkMA0GCSqGSIb3DQEBBQUAMIHKMQsw\nCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl\ncmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu\nLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT\naWduIENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\ndHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD\nVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT\naWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ\nbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu\nIENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg\nLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN2E1Lm0+afY8wR4\nnN493GwTFtl63SRRZsDHJlkNrAYIwpTRMx/wgzUfbhvI3qpuFU5UJ+/EbRrsC+MO\n8ESlV8dAWB6jRx9x7GD2bZTIGDnt/kIYVt/kTEkQeE4BdjVjEjbdZrwBBDajVWjV\nojYJrKshJlQGrT/KFOCsyq0GHZXi+J3x4GD/wn91K0zM2v6HmSHquv4+VNfSWXjb\nPG7PoBMAGrgnoeS+Z5bKoMWznN3JdZ7rMJpfo83ZrngZPyPpXNspva1VyBtUjGP2\n6KbqxzcSXKMpHgLZ2x87tNcPVkeBFQRKr4Mn0cVYiMHd9qqnoxjaaKptEVHhv2Vr\nn5Z20T0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAq2aN17O6x5q25lXQBfGfMY1a\nqtmqRiYPce2lrVNWYgFHKkTp/j90CxObufRNG7LRX7K20ohcs5/Ny9Sn2WCVhDr4\nwTcdYcrnsMXlkdpUpqwxga6X3s0IrLjAl4B/bnKk52kTlWUfxJM8/XmPBNQ+T+r3\nns7NZ3xPZQL/kYVUc8f/NveGLezQXk//EZ9yBta4GvFMDSZl4kSAHsef493oCtrs\npSCAaWihT37ha88HQfqDjrw43bAuEbFrskLMmrz5SCJ5ShkPshw+IHTZasO+8ih4\nE1Z5T21Q6huwtVexN2ZYI/PcD98Kh8TvhgXVOBRgmaNL3gaWcSzy27YfpO8/7g==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDAzCCAmwCEQC5L2DMiJ+hekYJuFtwbIqvMA0GCSqGSIb3DQEBBQUAMIHBMQsw\nCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0Ns\nYXNzIDIgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH\nMjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9y\naXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazAe\nFw05ODA1MTgwMDAwMDBaFw0yODA4MDEyMzU5NTlaMIHBMQswCQYDVQQGEwJVUzEX\nMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGlj\nIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMx\nKGMpIDE5OTggVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s\neTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazCBnzANBgkqhkiG9w0B\nAQEFAAOBjQAwgYkCgYEAp4gBIXQs5xoD8JjhlzwPIQjxnNuX6Zr8wgQGE75fUsjM\nHiwSViy4AWkszJkfrbCWrnkE8hM5wXuYuggs6MKEEyyqaekJ9MepAqRCwiNPStjw\nDqL7MWzJ5m+ZJwf15vRMeJ5t60aG+rmGyVTyssSv1EYcWskVMP8NbPUtDm3Of3cC\nAwEAATANBgkqhkiG9w0BAQUFAAOBgQByLvl/0fFx+8Se9sVeUYpAmLho+Jscg9ji\nnb3/7aHmZuovCfTK1+qlK5X2JGCGTUQug6XELaDTrnhpb3LabK4I8GOSN+a7xDAX\nrXfMSTWqz9iP0b63GJZHc2pUIjRkLbYWm1lbtFFZOrMLFPQS32eg9K0yZF6xRnIn\njBJ7xUS0rg==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEGTCCAwECEGFwy0mMX5hFKeewptlQW3owDQYJKoZIhvcNAQEFBQAwgcoxCzAJ\nBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVy\naVNpZ24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24s\nIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNp\nZ24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0\neSAtIEczMB4XDTk5MTAwMTAwMDAwMFoXDTM2MDcxNjIzNTk1OVowgcoxCzAJBgNV\nBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNp\nZ24gVHJ1c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIElu\nYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNpZ24g\nQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt\nIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArwoNwtUs22e5LeWU\nJ92lvuCwTY+zYVY81nzD9M0+hsuiiOLh2KRpxbXiv8GmR1BeRjmL1Za6tW8UvxDO\nJxOeBUebMXoT2B/Z0wI3i60sR/COgQanDTAM6/c8DyAd3HJG7qUCyFvDyVZpTMUY\nwZF7C9UTAJu878NIPkZgIIUq1ZC2zYugzDLdt/1AVbJQHFauzI13TccgTacxdu9o\nkoqQHgiBVrKtaaNS0MscxCM9H5n+TOgWY47GCI72MfbS+uV23bUckqNJzc0BzWjN\nqWm6o+sdDZykIKbBoMXRRkwXbdKsZj+WjOCE1Db/IlnF+RFgqF8EffIa9iVCYQ/E\nSrg+iQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQA0JhU8wI1NQ0kdvekhktdmnLfe\nxbjQ5F1fdiLAJvmEOjr5jLX77GDx6M4EsMjdpwOPMPOY36TmpDHf0xwLRtxyID+u\n7gU8pDM/CzmscHhzS5kr3zDCVLCoO1Wh/hYozUK9dG6A2ydEp85EXdQbkJgNHkKU\nsQAsBNB0owIFImNjzYO1+8FtYmtpdf1dcEG59b98377BMnMiIYtYgXsVkXq642RI\nsH/7NiXaldDxJBQX3RiAa0YjOVT1jmIJBB2UkKab5iXiQkWquJCtvgiPqQtCGJTP\ncjnhsUPgKM+351psE2tJs//jGHyJizNdrDPXp/naOlXJWBD5qu9ats9LS98q\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkG\nA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz\ncyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2\nMDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV\nBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt\nYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN\nADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE\nBarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is\nI19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G\nCSqGSIb3DQEBBQUAA4GBABByUqkFFBkyCEHwxWsKzH4PIRnN5GfcX6kb5sroc50i\n2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWXbj9T/UWZYB2oK0z5XqcJ\n2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/D/xwzoiQ\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG\nA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz\ncyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2\nMDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV\nBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt\nYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN\nADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE\nBarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is\nI19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G\nCSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do\nlbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc\nAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJ\nBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh\nc3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy\nMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp\nemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X\nDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw\nFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMg\nUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo\nYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5\nMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB\nAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCOFoUgRm1HP9SFIIThbbP4\npO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0\n13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID\nAQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk\nU01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i\nF6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY\noJ2daZH9\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw\nCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl\ncmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu\nLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT\naWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\ndHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD\nVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT\naWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ\nbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu\nIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg\nLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMu6nFL8eB8aHm8b\nN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1EUGO+i2t\nKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGu\nkxUccLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBm\nCC+Vk7+qRy+oRpfwEuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJ\nXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWu\nimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te\n2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe\nDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC\n/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p\nF4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt\nTxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjEL\nMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW\nZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2ln\nbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp\nU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y\naXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjELMAkG\nA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJp\nU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwg\nSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2ln\nbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5\nIC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8Utpkmw4tXNherJI9/gHm\nGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGzrl0Bp3ve\nfLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUw\nAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJ\naW1hZ2UvZ2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYj\naHR0cDovL2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMW\nkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2gAMGUCMGYhDBgmYFo4e1ZC\n4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIxAJw9SDkjOVga\nFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB\nyjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL\nExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp\nU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW\nZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0\naG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL\nMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW\nZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln\nbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp\nU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y\naXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1\nnmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex\nt0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz\nSdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG\nBO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+\nrCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/\nNIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E\nBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH\nBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy\naXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv\nMzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE\np6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y\n5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK\nWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ\n4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N\nhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQsw\nCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl\ncmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu\nLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT\naWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\ndHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD\nVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT\naWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ\nbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu\nIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg\nLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK3LpRFpxlmr8Y+1\nGQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaStBO3IFsJ\n+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0Gbd\nU6LM8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLm\nNxdLMEYH5IBtptiWLugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XY\nufTsgsbSPZUd5cBPhMnZo0QoBmrXRazwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/\nky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAj/ola09b5KROJ1WrIhVZPMq1\nCtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXttmhwwjIDLk5Mq\ng6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm\nfjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c\n2NU8Qh0XwRJdRTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/\nbLvSHgCwIe34QWKCudiyxLtGUPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCB\nvTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL\nExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp\nU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W\nZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe\nFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJVUzEX\nMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0\nIE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9y\nIGF1dGhvcml6ZWQgdXNlIG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNh\nbCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF\nAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj1mCOkdeQmIN65lgZOIzF\n9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGPMiJhgsWH\nH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+H\nLL729fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN\n/BMReYTtXlT2NJ8IAfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPT\nrJ9VAMf2CGqUuV/c4DPxhGD5WycRtPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1Ud\nEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0GCCsGAQUFBwEMBGEwX6FdoFsw\nWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2Oa8PPgGrUSBgs\nexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud\nDgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4\nsAPmLGd75JR3Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+\nseQxIcaBlVZaDrHC1LGmWazxY8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz\n4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTxP/jgdFcrGJ2BtMQo2pSXpXDrrB2+\nBxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+PwGZsY6rp2aQW9IHR\nlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3\n7M2CYfE45k+XmCpajQ==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBr\nMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRl\ncm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv\nbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2WhcNMjIwNjI0MDAxNjEyWjBrMQsw\nCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5h\ndGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1l\ncmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h\n2mCxlCfLF9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4E\nlpF7sDPwsRROEW+1QK8bRaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdV\nZqW1LS7YgFmypw23RuwhY/81q6UCzyr0TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq\n299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI/k4+oKsGGelT84ATB+0t\nvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzsGHxBvfaL\ndXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD\nAgEGMB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUF\nAAOCAQEAX/FBfXxcCLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcR\nzCSs00Rsca4BIGsDoo8Ytyk6feUWYFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3\nLBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pzzkWKsKZJ/0x9nXGIxHYdkFsd\n7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBuYQa7FkKMcPcw\n++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt\n398znM/jra6O1I7mT1GvFpLgXPYHDw==\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIID5TCCAs2gAwIBAgIEOeSXnjANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UEBhMC\nVVMxFDASBgNVBAoTC1dlbGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBD\nZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEvMC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9v\ndCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDAxMDExMTY0MTI4WhcNMjEwMTE0\nMTY0MTI4WjCBgjELMAkGA1UEBhMCVVMxFDASBgNVBAoTC1dlbGxzIEZhcmdvMSww\nKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEvMC0G\nA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEi\nMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVqDM7Jvk0/82bfuUER84A4n13\n5zHCLielTWi5MbqNQ1mXx3Oqfz1cQJ4F5aHiidlMuD+b+Qy0yGIZLEWukR5zcUHE\nSxP9cMIlrCL1dQu3U+SlK93OvRw6esP3E48mVJwWa2uv+9iWsWCaSOAlIiR5NM4O\nJgALTqv9i86C1y8IcGjBqAr5dE8Hq6T54oN+J3N0Prj5OEL8pahbSCOz6+MlsoCu\nltQKnMJ4msZoGK43YjdeUXWoWGPAUe5AeH6orxqg4bB4nVCMe+ez/I4jsNtlAHCE\nAQgAFG5Uhpq6zPk3EPbg3oQtnaSFN9OH4xXQwReQfhkhahKpdv0SAulPIV4XAgMB\nAAGjYTBfMA8GA1UdEwEB/wQFMAMBAf8wTAYDVR0gBEUwQzBBBgtghkgBhvt7hwcB\nCzAyMDAGCCsGAQUFBwIBFiRodHRwOi8vd3d3LndlbGxzZmFyZ28uY29tL2NlcnRw\nb2xpY3kwDQYJKoZIhvcNAQEFBQADggEBANIn3ZwKdyu7IvICtUpKkfnRLb7kuxpo\n7w6kAOnu5+/u9vnldKTC2FJYxHT7zmu1Oyl5GFrvm+0fazbuSCUlFLZWohDo7qd/\n0D+j0MNdJu4HzMPBJCGHHt8qElNvQRbn7a6U+oxy+hNH8Dx+rn0ROhPs7fpvcmR7\nnX1/Jv16+yWt6j4pf0zjAFcysLPp7VMX2YuyFA4w6OXVE8Zkr8QA1dhYJPz1j+zx\nx32l2w8n0cbyQIjmH/ZhqPRCyLk306m+LFZ4wnKbWV01QIroTmMatukgalHizqSQ\n33ZwmVxwQ023tqcZZE6St8WRPH9IFmV7Fv3L/PvZ1dZPIWU7Sn9Ho/s=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMx\nIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxs\ncyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9v\ndCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDcxMjEzMTcwNzU0WhcNMjIxMjE0\nMDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdl\nbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQD\nDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkw\nggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+r\nWxxTkqxtnt3CxC5FlAM1iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjU\nDk/41itMpBb570OYj7OeUt9tkTmPOL13i0Nj67eT/DBMHAGTthP796EfvyXhdDcs\nHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8bJVhHlfXBIEyg1J55oNj\nz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiBK0HmOFaf\nSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/Slwxl\nAgMBAAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqG\nKGh0dHA6Ly9jcmwucGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0P\nAQH/BAQDAgHGMB0GA1UdDgQWBBQmlRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0j\nBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGBi6SBiDCBhTELMAkGA1UEBhMC\nVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNX\nZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg\nUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEB\nALkVsUSRzCPIK0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd\n/ZDJPHV3V3p9+N701NX3leZ0bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pB\nA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSljqHyita04pO2t/caaH/+Xc/77szWn\nk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+esE2fDbbFwRnzVlhE9\niW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJtylv\n2G0xffX8oRAHh84vWdw+WNs=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB\ngjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk\nMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY\nUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx\nNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3\ndy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2Vy\ndmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB\ndXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS6\n38eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP\nKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMxfoArtYzAQDsRhtDLooY2YKTVMIJt2W7Q\nDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FEzG+gSqmUsE3a56k0enI4\nqEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqsAxcZZPRa\nJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi\nPvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P\nBAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs\njVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0\neS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD\nggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR\nvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt\nqZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa\nIR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy\ni6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ\nO+7ETPTsJ3xCwnR8gooJybQDJbw=\n-----END CERTIFICATE-----\n-----BEGIN CERTIFICATE-----\nMIIIDjCCBfagAwIBAgIJAOiOtsn4KhQoMA0GCSqGSIb3DQEBBQUAMIG8MQswCQYD\nVQQGEwJVUzEQMA4GA1UECBMHSW5kaWFuYTEVMBMGA1UEBxMMSW5kaWFuYXBvbGlz\nMSgwJgYDVQQKEx9Tb2Z0d2FyZSBpbiB0aGUgUHVibGljIEludGVyZXN0MRMwEQYD\nVQQLEwpob3N0bWFzdGVyMR4wHAYDVQQDExVDZXJ0aWZpY2F0ZSBBdXRob3JpdHkx\nJTAjBgkqhkiG9w0BCQEWFmhvc3RtYXN0ZXJAc3BpLWluYy5vcmcwHhcNMDgwNTEz\nMDgwNzU2WhcNMTgwNTExMDgwNzU2WjCBvDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT\nB0luZGlhbmExFTATBgNVBAcTDEluZGlhbmFwb2xpczEoMCYGA1UEChMfU29mdHdh\ncmUgaW4gdGhlIFB1YmxpYyBJbnRlcmVzdDETMBEGA1UECxMKaG9zdG1hc3RlcjEe\nMBwGA1UEAxMVQ2VydGlmaWNhdGUgQXV0aG9yaXR5MSUwIwYJKoZIhvcNAQkBFhZo\nb3N0bWFzdGVyQHNwaS1pbmMub3JnMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC\nCgKCAgEA3DbmR0LCxFF1KYdAw9iOIQbSGE7r7yC9kDyFEBOMKVuUY/b0LfEGQpG5\nGcRCaQi/izZF6igFM0lIoCdDkzWKQdh4s/Dvs24t3dHLfer0dSbTPpA67tfnLAS1\nfOH1fMVO73e9XKKTM5LOfYFIz2u1IiwIg/3T1c87Lf21SZBb9q1NE8re06adU1Fx\nY0b4ShZcmO4tbZoWoXaQ4mBDmdaJ1mwuepiyCwMs43pPx93jzONKao15Uvr0wa8u\njyoIyxspgpJyQ7zOiKmqp4pRQ1WFmjcDeJPI8L20QcgHQprLNZd6ioFl3h1UCAHx\nZFy3FxpRvB7DWYd2GBaY7r/2Z4GLBjXFS21ZGcfSxki+bhQog0oQnBv1b7ypjvVp\n/rLBVcznFMn5WxRTUQfqzj3kTygfPGEJ1zPSbqdu1McTCW9rXRTunYkbpWry9vjQ\nco7qch8vNGopCsUK7BxAhRL3pqXTT63AhYxMfHMgzFMY8bJYTAH1v+pk1Vw5xc5s\nzFNaVrpBDyXfa1C2x4qgvQLCxTtVpbJkIoRRKFauMe5e+wsWTUYFkYBE7axt8Feo\n+uthSKDLG7Mfjs3FIXcDhB78rKNDCGOM7fkn77SwXWfWT+3Qiz5dW8mRvZYChD3F\nTbxCP3T9PF2sXEg2XocxLxhsxGjuoYvJWdAY4wCAs1QnLpnwFVMCAwEAAaOCAg8w\nggILMB0GA1UdDgQWBBQ0cdE41xU2g0dr1zdkQjuOjVKdqzCB8QYDVR0jBIHpMIHm\ngBQ0cdE41xU2g0dr1zdkQjuOjVKdq6GBwqSBvzCBvDELMAkGA1UEBhMCVVMxEDAO\nBgNVBAgTB0luZGlhbmExFTATBgNVBAcTDEluZGlhbmFwb2xpczEoMCYGA1UEChMf\nU29mdHdhcmUgaW4gdGhlIFB1YmxpYyBJbnRlcmVzdDETMBEGA1UECxMKaG9zdG1h\nc3RlcjEeMBwGA1UEAxMVQ2VydGlmaWNhdGUgQXV0aG9yaXR5MSUwIwYJKoZIhvcN\nAQkBFhZob3N0bWFzdGVyQHNwaS1pbmMub3JnggkA6I62yfgqFCgwDwYDVR0TAQH/\nBAUwAwEB/zARBglghkgBhvhCAQEEBAMCAAcwCQYDVR0SBAIwADAuBglghkgBhvhC\nAQ0EIRYfU29mdHdhcmUgaW4gdGhlIFB1YmxpYyBJbnRlcmVzdDAwBglghkgBhvhC\nAQQEIxYhaHR0cHM6Ly9jYS5zcGktaW5jLm9yZy9jYS1jcmwucGVtMDIGCWCGSAGG\n+EIBAwQlFiNodHRwczovL2NhLnNwaS1pbmMub3JnL2NlcnQtY3JsLnBlbTAhBgNV\nHREEGjAYgRZob3N0bWFzdGVyQHNwaS1pbmMub3JnMA4GA1UdDwEB/wQEAwIBBjAN\nBgkqhkiG9w0BAQUFAAOCAgEAtM294LnqsgMrfjLp3nI/yUuCXp3ir1UJogxU6M8Y\nPCggHam7AwIvUjki+RfPrWeQswN/2BXja367m1YBrzXU2rnHZxeb1NUON7MgQS4M\nAcRb+WU+wmHo0vBqlXDDxm/VNaSsWXLhid+hoJ0kvSl56WEq2dMeyUakCHhBknIP\nqxR17QnwovBc78MKYiC3wihmrkwvLo9FYyaW8O4x5otVm6o6+YI5HYg84gd1GuEP\nsTC8cTLSOv76oYnzQyzWcsR5pxVIBcDYLXIC48s9Fmq6ybgREOJJhcyWR2AFJS7v\ndVkz9UcZFu/abF8HyKZQth3LZjQl/GaD68W2MEH4RkRiqMEMVObqTFoo5q7Gt/5/\nO5aoLu7HaD7dAD0prypjq1/uSSotxdz70cbT0ZdWUoa2lOvUYFG3/B6bzAKb1B+P\n+UqPti4oOxfMxaYF49LTtcYDyeFIQpvLP+QX4P4NAZUJurgNceQJcHdC2E3hQqlg\ng9cXiUPS1N2nGLar1CQlh7XU4vwuImm9rWgs/3K1mKoGnOcqarihk3bOsPN/nOHg\nT7jYhkalMwIsJWE3KpLIrIF0aGOHM3a9BX9e1dUCbb2v/ypaqknsmHlHU5H2DjRa\nyaXG67Ljxay2oHA1u8hRadDytaIybrw/oDc5fHE2pgXfDBLkFqfF1stjo5VwP+YE\no2A=\n-----END CERTIFICATE-----\n"
  },
  {
    "path": "test/data/sample_data.csv",
    "content": "Year,StateAbbr,StateDesc,CityName,GeographicLevel,DataSource,Category,UniqueID,Measure,Data_Value_Unit,DataValueTypeID,Data_Value_Type,Data_Value,Low_Confidence_Limit,High_Confidence_Limit,Data_Value_Footnote_Symbol,Data_Value_Footnote,PopulationCount,GeoLocation,CategoryID,MeasureId,CityFIPS,TractFIPS,Short_Question_Text\n2015,US,United States,,US,BRFSS,Prevention,59,Current lack of health insurance among adults aged 18–64 Years,%,AgeAdjPrv,Age-adjusted prevalence,15.4,15.1,15.7,,,308745538,,PREVENT,ACCESS2,,,Health Insurance\n2015,US,United States,,US,BRFSS,Prevention,59,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,14.8,14.5,15.0,,,308745538,,PREVENT,ACCESS2,,,Health Insurance\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Arthritis among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,22.5,22.3,22.7,,,308745538,,HLTHOUT,ARTHRITIS,,,Arthritis\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,24.7,24.5,24.9,,,308745538,,HLTHOUT,ARTHRITIS,,,Arthritis\n2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Binge drinking among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,17.2,16.9,17.4,,,308745538,,UNHBEH,BINGE,,,Binge Drinking\n2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,16.3,16.1,16.5,,,308745538,,UNHBEH,BINGE,,,Binge Drinking\n2015,US,United States,,US,BRFSS,Health Outcomes,59,High blood pressure among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,29.4,29.2,29.7,,,308745538,,HLTHOUT,BPHIGH,,,High Blood Pressure\n2015,US,United States,,US,BRFSS,Health Outcomes,59,High blood pressure among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.9,31.6,32.2,,,308745538,,HLTHOUT,BPHIGH,,,High Blood Pressure\n2015,US,United States,,US,BRFSS,Prevention,59,Taking medicine for high blood pressure control among adults aged >=18 Years with high blood pressure,%,AgeAdjPrv,Age-adjusted prevalence,57.7,57.1,58.4,,,308745538,,PREVENT,BPMED,,,Taking BP Medication\n2015,US,United States,,US,BRFSS,Prevention,59,Taking medicine for high blood pressure control among adults aged >=18 Years with high blood pressure,%,CrdPrv,Crude prevalence,77.2,76.8,77.7,,,308745538,,PREVENT,BPMED,,,Taking BP Medication\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Cancer (excluding skin cancer) among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,6.0,5.9,6.1,,,308745538,,HLTHOUT,CANCER,,,Cancer (except skin)\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Cancer (excluding skin cancer) among adults aged >=18 Years,%,CrdPrv,Crude prevalence,6.6,6.5,6.8,,,308745538,,HLTHOUT,CANCER,,,Cancer (except skin)\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Current asthma among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,8.7,8.6,8.9,,,308745538,,HLTHOUT,CASTHMA,,,Current Asthma\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Current asthma among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.8,8.6,9.0,,,308745538,,HLTHOUT,CASTHMA,,,Current Asthma\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Coronary heart disease among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,5.6,5.5,5.8,,,308745538,,HLTHOUT,CHD,,,Coronary Heart Disease\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Coronary heart disease among adults aged >=18 Years,%,CrdPrv,Crude prevalence,6.3,6.2,6.5,,,308745538,,HLTHOUT,CHD,,,Coronary Heart Disease\n2015,US,United States,,US,BRFSS,Prevention,59,Visits to doctor for routine checkup within the past Year among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,68.6,68.3,68.9,,,308745538,,PREVENT,CHECKUP,,,Annual Checkup\n2015,US,United States,,US,BRFSS,Prevention,59,Visits to doctor for routine checkup within the past Year among adults aged >=18 Years,%,CrdPrv,Crude prevalence,70.0,69.7,70.3,,,308745538,,PREVENT,CHECKUP,,,Annual Checkup\n2015,US,United States,,US,BRFSS,Prevention,59,Cholesterol screening among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,75.2,74.9,75.5,,,308745538,,PREVENT,CHOLSCREEN,,,Cholesterol Screening\n2015,US,United States,,US,BRFSS,Prevention,59,Cholesterol screening among adults aged >=18 Years,%,CrdPrv,Crude prevalence,77.0,76.7,77.3,,,308745538,,PREVENT,CHOLSCREEN,,,Cholesterol Screening\n2014,US,United States,,US,BRFSS,Prevention,59,\"Fecal occult blood test, sigmoidoscopy, or colonoscopy among adults aged 50–75 Years\",%,AgeAdjPrv,Age-adjusted prevalence,64.0,63.5,64.5,,,308745538,,PREVENT,COLON_SCREEN,,,Colorectal Cancer Screening\n2014,US,United States,,US,BRFSS,Prevention,59,\"Fecal occult blood test, sigmoidoscopy, or colonoscopy among adults aged 50–75 Years\",%,CrdPrv,Crude prevalence,63.7,63.3,64.1,,,308745538,,PREVENT,COLON_SCREEN,,,Colorectal Cancer Screening\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Chronic obstructive pulmonary disease among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,5.7,5.6,5.9,,,308745538,,HLTHOUT,COPD,,,COPD\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Chronic obstructive pulmonary disease among adults aged >=18 Years,%,CrdPrv,Crude prevalence,6.3,6.2,6.4,,,308745538,,HLTHOUT,COPD,,,COPD\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Physical health not good for >=14 days among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,11.5,11.3,11.7,,,308745538,,HLTHOUT,PHLTH,,,Physical Health\n2014,US,United States,,US,BRFSS,Prevention,59,\"Older adult men aged >=65 Years who are up to date on a core set of clinical preventive services: Flu shot past Year, PPV shot ever, Colorectal cancer screening\",%,AgeAdjPrv,Age-adjusted prevalence,32.9,32.1,33.6,,,308745538,,PREVENT,COREM,,,Core preventive services for older men\n2014,US,United States,,US,BRFSS,Prevention,59,\"Older adult men aged >=65 Years who are up to date on a core set of clinical preventive services: Flu shot past Year, PPV shot ever, Colorectal cancer screening\",%,CrdPrv,Crude prevalence,32.3,31.5,33.0,,,308745538,,PREVENT,COREM,,,Core preventive services for older men\n2014,US,United States,,US,BRFSS,Prevention,59,\"Older adult women aged >=65 Years who are up to date on a core set of clinical preventive services: Flu shot past Year, PPV shot ever, Colorectal cancer screening, and Mammogram past 2 Years\",%,AgeAdjPrv,Age-adjusted prevalence,30.7,30.2,31.4,,,308745538,,PREVENT,COREW,,,Core preventive services for older women\n2014,US,United States,,US,BRFSS,Prevention,59,\"Older adult women aged >=65 Years who are up to date on a core set of clinical preventive services: Flu shot past Year, PPV shot ever, Colorectal cancer screening, and Mammogram past 2 Years\",%,CrdPrv,Crude prevalence,30.7,30.1,31.3,,,308745538,,PREVENT,COREW,,,Core preventive services for older women\n2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Current smoking among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,17.1,16.8,17.3,,,308745538,,UNHBEH,CSMOKING,,,Current Smoking\n2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Current smoking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,16.8,16.6,17.0,,,308745538,,UNHBEH,CSMOKING,,,Current Smoking\n2014,US,United States,,US,BRFSS,Prevention,59,Visits to dentist or dental clinic among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,64.1,63.8,64.4,,,308745538,,PREVENT,DENTAL,,,Dental Visit\n2014,US,United States,,US,BRFSS,Prevention,59,Visits to dentist or dental clinic among adults aged >=18 Years,%,CrdPrv,Crude prevalence,64.4,64.1,64.7,,,308745538,,PREVENT,DENTAL,,,Dental Visit\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Diagnosed diabetes among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,9.3,9.2,9.5,,,308745538,,HLTHOUT,DIABETES,,,Diabetes\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Diagnosed diabetes among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.4,10.3,10.6,,,308745538,,HLTHOUT,DIABETES,,,Diabetes\n2015,US,United States,,US,BRFSS,Health Outcomes,59,High cholesterol among adults aged >=18 Years who have been screened in the past 5 Years,%,AgeAdjPrv,Age-adjusted prevalence,31.1,30.8,31.4,,,308745538,,HLTHOUT,HIGHCHOL,,,High Cholesterol\n2015,US,United States,,US,BRFSS,Health Outcomes,59,High cholesterol among adults aged >=18 Years who have been screened in the past 5 Years,%,CrdPrv,Crude prevalence,37.1,36.8,37.4,,,308745538,,HLTHOUT,HIGHCHOL,,,High Cholesterol\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Chronic kidney disease among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,2.5,2.4,2.6,,,308745538,,HLTHOUT,KIDNEY,,,Chronic Kidney Disease\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Chronic kidney disease among adults aged >=18 Years,%,CrdPrv,Crude prevalence,2.7,2.6,2.8,,,308745538,,HLTHOUT,KIDNEY,,,Chronic Kidney Disease\n2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,No leisure-time physical activity among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,25.5,25.2,25.8,,,308745538,,UNHBEH,LPA,,,Physical Inactivity\n2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,No leisure-time physical activity among adults aged >=18 Years,%,CrdPrv,Crude prevalence,25.9,25.6,26.1,,,308745538,,UNHBEH,LPA,,,Physical Inactivity\n2014,US,United States,,US,BRFSS,Prevention,59,Mammography use among women aged 50–74 Years,%,AgeAdjPrv,Age-adjusted prevalence,75.5,75.1,75.9,,,308745538,,PREVENT,MAMMOUSE,,,Mammography\n2014,US,United States,,US,BRFSS,Prevention,59,Mammography use among women aged 50–74 Years,%,CrdPrv,Crude prevalence,75.8,75.4,76.2,,,308745538,,PREVENT,MAMMOUSE,,,Mammography\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Mental health not good for >=14 days among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,11.6,11.4,11.8,,,308745538,,HLTHOUT,MHLTH,,,Mental Health\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Mental health not good for >=14 days among adults aged >=18 Years,%,CrdPrv,Crude prevalence,11.4,11.3,11.6,,,308745538,,HLTHOUT,MHLTH,,,Mental Health\n2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Obesity among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,28.7,28.4,29.0,,,308745538,,UNHBEH,OBESITY,,,Obesity\n2015,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Obesity among adults aged >=18 Years,%,CrdPrv,Crude prevalence,28.8,28.6,29.1,,,308745538,,UNHBEH,OBESITY,,,Obesity\n2014,US,United States,,US,BRFSS,Prevention,59,Papanicolaou smear use among adult women aged 21–65 Years,%,AgeAdjPrv,Age-adjusted prevalence,81.1,80.6,81.6,,,308745538,,PREVENT,PAPTEST,,,Pap Smear Test\n2014,US,United States,,US,BRFSS,Prevention,59,Papanicolaou smear use among adult women aged 21–65 Years,%,CrdPrv,Crude prevalence,81.8,81.3,82.2,,,308745538,,PREVENT,PAPTEST,,,Pap Smear Test\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Physical health not good for >=14 days among adults aged >=18 Years,%,CrdPrv,Crude prevalence,12.0,11.8,12.2,,,308745538,,HLTHOUT,PHLTH,,,Physical Health\n2014,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Sleeping less than 7 hours among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,35.1,34.8,35.5,,,308745538,,UNHBEH,SLEEP,,,Sleep < 7 hours\n2014,US,United States,,US,BRFSS,Unhealthy Behaviors,59,Sleeping less than 7 hours among adults aged >=18 Years,%,CrdPrv,Crude prevalence,34.8,34.5,35.1,,,308745538,,UNHBEH,SLEEP,,,Sleep < 7 hours\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Stroke among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,2.8,2.7,2.8,,,308745538,,HLTHOUT,STROKE,,,Stroke\n2015,US,United States,,US,BRFSS,Health Outcomes,59,Stroke among adults aged >=18 Years,%,CrdPrv,Crude prevalence,3.0,3.0,3.1,,,308745538,,HLTHOUT,STROKE,,,Stroke\n2014,US,United States,,US,BRFSS,Health Outcomes,59,All teeth lost among adults aged >=65 Years,%,AgeAdjPrv,Age-adjusted prevalence,15.4,15.0,15.8,,,308745538,,HLTHOUT,TEETHLOST,,,Teeth Loss\n2014,US,United States,,US,BRFSS,Health Outcomes,59,All teeth lost among adults aged >=65 Years,%,CrdPrv,Crude prevalence,14.9,14.6,15.3,,,308745538,,HLTHOUT,TEETHLOST,,,Teeth Loss\n2015,AL,Alabama,Birmingham,City,BRFSS,Prevention,0107000,Current lack of health insurance among adults aged 18–64 Years,%,AgeAdjPrv,Age-adjusted prevalence,19.8,19.5,20.2,,,212237,\"(33.5275663773, -86.7988174678)\",PREVENT,ACCESS2,0107000,,Health Insurance\n2015,AL,Alabama,Birmingham,City,BRFSS,Prevention,0107000,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,19.6,19.2,20.0,,,212237,\"(33.5275663773, -86.7988174678)\",PREVENT,ACCESS2,0107000,,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073000100,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,23.9,21.2,27.2,,,3042,\"(33.5794328326, -86.7228323926)\",PREVENT,ACCESS2,0107000,01073000100,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073000300,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,28.8,25.4,32.4,,,2735,\"(33.5428208686, -86.752433978)\",PREVENT,ACCESS2,0107000,01073000300,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073000400,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.1,22.6,29.9,,,3338,\"(33.5632449633, -86.7640474064)\",PREVENT,ACCESS2,0107000,01073000400,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073000500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,28.1,24.6,32.0,,,2864,\"(33.5442404594, -86.7749130719)\",PREVENT,ACCESS2,0107000,01073000500,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073000700,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,31.8,27.0,36.7,,,2577,\"(33.5525406139, -86.8016893706)\",PREVENT,ACCESS2,0107000,01073000700,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073000800,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,22.4,19.1,26.1,,,3859,\"(33.549697789, -86.8330944744)\",PREVENT,ACCESS2,0107000,01073000800,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073001100,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,16.8,13.7,20.5,,,5354,\"(33.5429143325, -86.8756782852)\",PREVENT,ACCESS2,0107000,01073001100,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073001200,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,24.6,22.2,27.2,,,2876,\"(33.5278767706, -86.8604161686)\",PREVENT,ACCESS2,0107000,01073001200,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073001400,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,22.0,18.4,25.7,,,2181,\"(33.5261497258, -86.835146606)\",PREVENT,ACCESS2,0107000,01073001400,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073001500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.3,23.1,29.4,,,3189,\"(33.5298727342, -86.8197191685)\",PREVENT,ACCESS2,0107000,01073001500,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073001600,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.8,22.9,30.8,,,3390,\"(33.5372993423, -86.8036590482)\",PREVENT,ACCESS2,0107000,01073001600,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073001902,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.9,24.1,29.8,,,1894,\"(33.5532050997, -86.7429801603)\",PREVENT,ACCESS2,0107000,01073001902,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002000,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,24.4,20.8,28.2,,,3885,\"(33.5541574106, -86.7167229915)\",PREVENT,ACCESS2,0107000,01073002000,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002100,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.5,18.1,25.0,,,3186,\"(33.5650015942, -86.7101024766)\",PREVENT,ACCESS2,0107000,01073002100,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002200,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.7,18.7,25.0,,,2630,\"(33.5521301205, -86.7276759508)\",PREVENT,ACCESS2,0107000,01073002200,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002303,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,27.0,23.7,30.7,,,2936,\"(33.5383153207, -86.7270445428)\",PREVENT,ACCESS2,0107000,01073002303,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002305,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,9.9,8.2,12.1,,,2952,\"(33.5333415976, -86.7479566084)\",PREVENT,ACCESS2,0107000,01073002305,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002306,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,9.5,8.1,11.2,,,3257,\"(33.5213873564, -86.7490031289)\",PREVENT,ACCESS2,0107000,01073002306,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002400,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,25.1,22.4,27.8,,,3629,\"(33.5260748309, -86.7830315488)\",PREVENT,ACCESS2,0107000,01073002400,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002700,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,20.7,16.8,24.9,,,3992,\"(33.5176008419, -86.8106887452)\",PREVENT,ACCESS2,0107000,01073002700,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073002900,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,25.7,21.5,29.9,,,2064,\"(33.5132498864, -86.83004749)\",PREVENT,ACCESS2,0107000,01073002900,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003001,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,18.4,15.3,22.4,,,3779,\"(33.5125158094, -86.8577164946)\",PREVENT,ACCESS2,0107000,01073003001,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003002,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.3,21.7,31.3,,,2203,\"(33.512258109, -86.8441439907)\",PREVENT,ACCESS2,0107000,01073003002,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003100,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,23.2,20.2,26.7,,,3637,\"(33.5059655756, -86.8745506086)\",PREVENT,ACCESS2,0107000,01073003100,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003200,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,28.7,25.0,32.8,,,931,\"(33.5094018502, -86.8859081961)\",PREVENT,ACCESS2,0107000,01073003200,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003300,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,22.2,19.1,25.7,,,947,\"(33.5171261108, -86.8913819749)\",PREVENT,ACCESS2,0107000,01073003300,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003400,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.8,23.0,30.9,,,2477,\"(33.5052229234, -86.9014844656)\",PREVENT,ACCESS2,0107000,01073003400,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,22.3,19.1,25.7,,,2780,\"(33.5065714011, -86.9195910063)\",PREVENT,ACCESS2,0107000,01073003500,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003600,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,17.0,14.5,19.6,,,4683,\"(33.48476397, -86.8981392947)\",PREVENT,ACCESS2,0107000,01073003600,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003700,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.6,19.2,23.9,,,5063,\"(33.4969018589, -86.8907729426)\",PREVENT,ACCESS2,0107000,01073003700,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003802,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,19.0,16.7,21.6,,,5409,\"(33.4785707794, -86.890000907)\",PREVENT,ACCESS2,0107000,01073003802,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003803,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,20.9,17.7,24.2,,,4199,\"(33.485945214, -86.869692186)\",PREVENT,ACCESS2,0107000,01073003803,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073003900,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,29.9,26.9,33.0,,,1783,\"(33.4989959327, -86.8647600038)\",PREVENT,ACCESS2,0107000,01073003900,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004000,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,25.8,21.4,30.3,,,3772,\"(33.4953246015, -86.8516232073)\",PREVENT,ACCESS2,0107000,01073004000,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004200,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,23.4,20.8,26.1,,,2341,\"(33.5007439361, -86.8270720379)\",PREVENT,ACCESS2,0107000,01073004200,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,22.7,19.3,27.4,,,5003,\"(33.5041857556, -86.8033798346)\",PREVENT,ACCESS2,0107000,01073004500,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004701,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,10.6,8.6,13.4,,,3480,\"(33.5075242148, -86.7836675838)\",PREVENT,ACCESS2,0107000,01073004701,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004702,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,7.1,6.1,8.7,,,2944,\"(33.5119902661, -86.7694550989)\",PREVENT,ACCESS2,0107000,01073004702,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004800,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,8.7,7.3,10.3,,,1861,\"(33.4989064008, -86.78269914)\",PREVENT,ACCESS2,0107000,01073004800,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004901,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,11.0,9.1,13.2,,,1167,\"(33.4971595645, -86.7917440668)\",PREVENT,ACCESS2,0107000,01073004901,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073004902,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,15.2,12.5,18.5,,,3146,\"(33.4935824043, -86.8009294603)\",PREVENT,ACCESS2,0107000,01073004902,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005000,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,17.9,15.4,20.7,,,3482,\"(33.4866689795, -86.8173262831)\",PREVENT,ACCESS2,0107000,01073005000,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005101,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,30.5,26.5,34.4,,,1507,\"(33.4945909008, -86.834763936)\",PREVENT,ACCESS2,0107000,01073005101,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005103,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,17.5,14.4,20.7,,,2587,\"(33.485714885, -86.8327817467)\",PREVENT,ACCESS2,0107000,01073005103,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005104,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,24.9,21.3,28.9,,,2881,\"(33.4749941816, -86.8335421747)\",PREVENT,ACCESS2,0107000,01073005104,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005200,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,20.2,16.4,24.2,,,3740,\"(33.4806708775, -86.8508671514)\",PREVENT,ACCESS2,0107000,01073005200,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005302,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,12.8,10.9,15.1,,,3463,\"(33.5766456449, -86.6965590316)\",PREVENT,ACCESS2,0107000,01073005302,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,26.5,22.9,30.7,,,1824,\"(33.5670293898, -86.8005567213)\",PREVENT,ACCESS2,0107000,01073005500,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005600,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,12.3,10.0,15.0,,,4367,\"(33.5200981234, -86.7272063198)\",PREVENT,ACCESS2,0107000,01073005600,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005701,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,18.9,15.7,22.3,,,2372,\"(33.4629543329, -86.8898406628)\",PREVENT,ACCESS2,0107000,01073005701,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005702,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,19.8,16.4,23.3,,,3413,\"(33.4698691385, -86.874290602)\",PREVENT,ACCESS2,0107000,01073005702,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005800,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,19.3,16.4,22.3,,,4216,\"(33.479062325, -86.8128063089)\",PREVENT,ACCESS2,0107000,01073005800,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005903,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,15.9,13.9,18.0,,,4933,\"(33.597162309, -86.6766736351)\",PREVENT,ACCESS2,0107000,01073005903,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005905,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.4,18.2,24.7,,,5039,\"(33.603988456, -86.7008123418)\",PREVENT,ACCESS2,0107000,01073005905,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005907,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,12.5,10.3,14.9,,,1975,\"(33.6142861501, -86.6691996417)\",PREVENT,ACCESS2,0107000,01073005907,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005908,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,20.9,18.1,23.7,,,1621,\"(33.6182924432, -86.6801483084)\",PREVENT,ACCESS2,0107000,01073005908,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005909,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,14.4,11.8,17.5,,,2524,\"(33.611811773, -86.7214221514)\",PREVENT,ACCESS2,0107000,01073005909,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073005910,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,14.7,12.6,17.1,,,4612,\"(33.6299017499, -86.7194311229)\",PREVENT,ACCESS2,0107000,01073005910,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.8,18.2,25.9,,,114,\"(33.4363786806, -86.9128923072)\",PREVENT,ACCESS2,0107000,01073010500,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010701,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,18.5,14.4,23.6,,,74,\"(33.473886155, -86.8146487762)\",PREVENT,ACCESS2,0107000,01073010701,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010706,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,13.5,11.0,16.3,,,1528,\"(33.4443709442, -86.8405352645)\",PREVENT,ACCESS2,0107000,01073010706,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010801,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,5.2,4.4,6.3,,,168,\"(33.514097853, -86.7466971362)\",PREVENT,ACCESS2,0107000,01073010801,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010802,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,5.0,3.9,6.5,,,172,\"(33.4885493477, -86.780843024)\",PREVENT,ACCESS2,0107000,01073010802,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010803,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,11.3,9.0,14.0,,,514,\"(33.5229093892, -86.7102618642)\",PREVENT,ACCESS2,0107000,01073010803,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073010805,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,7.3,5.5,9.9,,,86,\"(33.4952792472, -86.6987184974)\",PREVENT,ACCESS2,0107000,01073010805,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011104,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,13.6,11.4,16.1,,,1688,\"(33.6159436433, -86.6557892507)\",PREVENT,ACCESS2,0107000,01073011104,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011107,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,42,\"(33.5804845249, -86.6301110961)\",PREVENT,ACCESS2,0107000,01073011107,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011108,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,9,\"(33.6050742596, -86.6316729386)\",PREVENT,ACCESS2,0107000,01073011108,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011207,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,17.7,15.1,20.6,,,815,\"(33.6718848706, -86.6772510465)\",PREVENT,ACCESS2,0107000,01073011207,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011209,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,20.2,17.2,24.2,,,1062,\"(33.6557189992, -86.7050698349)\",PREVENT,ACCESS2,0107000,01073011209,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011210,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.5,17.0,26.7,,,1385,\"(33.6641893755, -86.6956170686)\",PREVENT,ACCESS2,0107000,01073011210,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011803,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,18.1,15.4,21.3,,,928,\"(33.6252575173, -86.6998610409)\",PREVENT,ACCESS2,0107000,01073011803,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011804,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,18.3,15.2,21.9,,,1157,\"(33.6474916175, -86.7042974424)\",PREVENT,ACCESS2,0107000,01073011804,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011901,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,6,\"(33.6355414646, -86.736946691)\",PREVENT,ACCESS2,0107000,01073011901,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073011904,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,14.4,12.1,16.8,,,1915,\"(33.593140185, -86.7357930541)\",PREVENT,ACCESS2,0107000,01073011904,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012001,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,14.5,12.5,16.7,,,304,\"(33.5919486112, -86.864384068)\",PREVENT,ACCESS2,0107000,01073012001,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012002,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,44,\"(33.5859234197, -86.8357007188)\",PREVENT,ACCESS2,0107000,01073012002,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012200,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,23,\"(33.5967441904, -87.0879396857)\",PREVENT,ACCESS2,0107000,01073012200,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012302,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,12.7,10.6,15.2,,,144,\"(33.5542816352, -87.0544691416)\",PREVENT,ACCESS2,0107000,01073012302,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012305,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,12.5,10.2,15.1,,,403,\"(33.4695358064, -86.96831739)\",PREVENT,ACCESS2,0107000,01073012305,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012401,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,11.4,8.9,14.2,,,1066,\"(33.5571951048, -86.8777935049)\",PREVENT,ACCESS2,0107000,01073012401,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012402,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,16.7,14.6,19.0,,,418,\"(33.549984172, -86.8994543327)\",PREVENT,ACCESS2,0107000,01073012402,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012500,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.0,17.6,24.4,,,410,\"(33.529160486, -86.9346476445)\",PREVENT,ACCESS2,0107000,01073012500,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012602,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,17.5,15.7,19.6,,,371,\"(33.570164674, -86.666430582)\",PREVENT,ACCESS2,0107000,01073012602,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012701,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,44,\"(33.5484078071, -86.6323773455)\",PREVENT,ACCESS2,0107000,01073012701,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012703,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,11.3,8.6,14.9,,,498,\"(33.4681180943, -86.6671888213)\",PREVENT,ACCESS2,0107000,01073012703,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012704,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,8.9,6.8,11.5,,,113,\"(33.5034195908, -86.6180983403)\",PREVENT,ACCESS2,0107000,01073012704,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012803,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,8.6,6.7,11.2,,,1261,\"(33.4439425865, -86.7212936938)\",PREVENT,ACCESS2,0107000,01073012803,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073012910,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,9,\"(33.4345805042, -86.7263292059)\",PREVENT,ACCESS2,0107000,01073012910,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073013002,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.3,17.1,25.6,,,1514,\"(33.46604181, -86.8567287797)\",PREVENT,ACCESS2,0107000,01073013002,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073013100,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,21.8,18.8,24.9,,,4424,\"(33.44880214, -86.8878401579)\",PREVENT,ACCESS2,0107000,01073013100,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073013300,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,23.5,19.5,27.5,,,1782,\"(33.4396443569, -86.9248768665)\",PREVENT,ACCESS2,0107000,01073013300,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073013901,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,18.0,14.8,21.7,,,952,\"(33.4729384906, -86.9547337648)\",PREVENT,ACCESS2,0107000,01073013901,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073014302,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,10.0,8.3,12.1,,,2778,\"(33.4244658829, -86.8841474217)\",PREVENT,ACCESS2,0107000,01073014302,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01073014413,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,7.6,5.9,9.8,,,397,\"(33.4226593117, -86.8508620751)\",PREVENT,ACCESS2,0107000,01073014413,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01117030213,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,9.3,7.7,11.4,,,644,\"(33.4395975193, -86.6735959359)\",PREVENT,ACCESS2,0107000,01117030213,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01117030217,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,16,\"(33.4556995763, -86.6520208639)\",PREVENT,ACCESS2,0107000,01117030217,Health Insurance\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Prevention,0107000-01117030303,Current lack of health insurance among adults aged 18–64 Years,%,CrdPrv,Crude prevalence,9.9,8.1,12.0,,,968,\"(33.4258661239, -86.713819356)\",PREVENT,ACCESS2,0107000,01117030303,Health Insurance\n2015,AL,Alabama,Birmingham,City,BRFSS,Health Outcomes,0107000,Arthritis among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,31.0,30.8,31.1,,,212237,\"(33.5275663773, -86.7988174678)\",HLTHOUT,ARTHRITIS,0107000,,Arthritis\n2015,AL,Alabama,Birmingham,City,BRFSS,Health Outcomes,0107000,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,30.9,30.8,31.1,,,212237,\"(33.5275663773, -86.7988174678)\",HLTHOUT,ARTHRITIS,0107000,,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073000100,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.5,31.5,33.6,,,3042,\"(33.5794328326, -86.7228323926)\",HLTHOUT,ARTHRITIS,0107000,01073000100,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073000300,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.3,30.0,32.4,,,2735,\"(33.5428208686, -86.752433978)\",HLTHOUT,ARTHRITIS,0107000,01073000300,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073000400,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,34.6,33.2,35.9,,,3338,\"(33.5632449633, -86.7640474064)\",HLTHOUT,ARTHRITIS,0107000,01073000400,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073000500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,37.8,36.3,39.2,,,2864,\"(33.5442404594, -86.7749130719)\",HLTHOUT,ARTHRITIS,0107000,01073000500,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073000700,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,38.5,37.1,39.9,,,2577,\"(33.5525406139, -86.8016893706)\",HLTHOUT,ARTHRITIS,0107000,01073000700,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073000800,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,38.0,36.5,39.3,,,3859,\"(33.549697789, -86.8330944744)\",HLTHOUT,ARTHRITIS,0107000,01073000800,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073001100,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,34.0,32.4,35.5,,,5354,\"(33.5429143325, -86.8756782852)\",HLTHOUT,ARTHRITIS,0107000,01073001100,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073001200,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.5,35.4,37.6,,,2876,\"(33.5278767706, -86.8604161686)\",HLTHOUT,ARTHRITIS,0107000,01073001200,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073001400,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,37.1,35.6,38.6,,,2181,\"(33.5261497258, -86.835146606)\",HLTHOUT,ARTHRITIS,0107000,01073001400,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073001500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,35.2,34.0,36.4,,,3189,\"(33.5298727342, -86.8197191685)\",HLTHOUT,ARTHRITIS,0107000,01073001500,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073001600,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,39.9,38.4,41.3,,,3390,\"(33.5372993423, -86.8036590482)\",HLTHOUT,ARTHRITIS,0107000,01073001600,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073001902,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,35.1,34.0,36.1,,,1894,\"(33.5532050997, -86.7429801603)\",HLTHOUT,ARTHRITIS,0107000,01073001902,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002000,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.3,34.9,37.7,,,3885,\"(33.5541574106, -86.7167229915)\",HLTHOUT,ARTHRITIS,0107000,01073002000,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002100,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,33.1,31.8,34.3,,,3186,\"(33.5650015942, -86.7101024766)\",HLTHOUT,ARTHRITIS,0107000,01073002100,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002200,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.4,31.2,33.6,,,2630,\"(33.5521301205, -86.7276759508)\",HLTHOUT,ARTHRITIS,0107000,01073002200,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002303,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,33.4,32.2,34.6,,,2936,\"(33.5383153207, -86.7270445428)\",HLTHOUT,ARTHRITIS,0107000,01073002303,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002305,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,22.3,21.3,23.3,,,2952,\"(33.5333415976, -86.7479566084)\",HLTHOUT,ARTHRITIS,0107000,01073002305,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002306,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,26.9,25.9,27.9,,,3257,\"(33.5213873564, -86.7490031289)\",HLTHOUT,ARTHRITIS,0107000,01073002306,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002400,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.0,30.0,31.9,,,3629,\"(33.5260748309, -86.7830315488)\",HLTHOUT,ARTHRITIS,0107000,01073002400,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002700,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,27.2,25.9,28.5,,,3992,\"(33.5176008419, -86.8106887452)\",HLTHOUT,ARTHRITIS,0107000,01073002700,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073002900,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,38.7,37.0,40.3,,,2064,\"(33.5132498864, -86.83004749)\",HLTHOUT,ARTHRITIS,0107000,01073002900,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003001,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,24.3,23.6,25.0,,,3779,\"(33.5125158094, -86.8577164946)\",HLTHOUT,ARTHRITIS,0107000,01073003001,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003002,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,40.9,39.1,42.7,,,2203,\"(33.512258109, -86.8441439907)\",HLTHOUT,ARTHRITIS,0107000,01073003002,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003100,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,34.1,32.7,35.4,,,3637,\"(33.5059655756, -86.8745506086)\",HLTHOUT,ARTHRITIS,0107000,01073003100,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003200,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,39.0,37.6,40.3,,,931,\"(33.5094018502, -86.8859081961)\",HLTHOUT,ARTHRITIS,0107000,01073003200,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003300,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,38.6,37.3,39.9,,,947,\"(33.5171261108, -86.8913819749)\",HLTHOUT,ARTHRITIS,0107000,01073003300,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003400,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.3,34.9,37.7,,,2477,\"(33.5052229234, -86.9014844656)\",HLTHOUT,ARTHRITIS,0107000,01073003400,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.8,31.5,34.0,,,2780,\"(33.5065714011, -86.9195910063)\",HLTHOUT,ARTHRITIS,0107000,01073003500,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003600,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,33.4,32.1,34.7,,,4683,\"(33.48476397, -86.8981392947)\",HLTHOUT,ARTHRITIS,0107000,01073003600,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003700,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.2,30.1,32.1,,,5063,\"(33.4969018589, -86.8907729426)\",HLTHOUT,ARTHRITIS,0107000,01073003700,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003802,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.1,31.0,33.2,,,5409,\"(33.4785707794, -86.890000907)\",HLTHOUT,ARTHRITIS,0107000,01073003802,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003803,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.0,34.5,37.3,,,4199,\"(33.485945214, -86.869692186)\",HLTHOUT,ARTHRITIS,0107000,01073003803,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073003900,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.9,31.8,33.9,,,1783,\"(33.4989959327, -86.8647600038)\",HLTHOUT,ARTHRITIS,0107000,01073003900,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004000,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,37.8,36.4,39.3,,,3772,\"(33.4953246015, -86.8516232073)\",HLTHOUT,ARTHRITIS,0107000,01073004000,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004200,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.6,35.5,37.7,,,2341,\"(33.5007439361, -86.8270720379)\",HLTHOUT,ARTHRITIS,0107000,01073004200,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,15.1,14.4,15.8,,,5003,\"(33.5041857556, -86.8033798346)\",HLTHOUT,ARTHRITIS,0107000,01073004500,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004701,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,23.7,22.5,24.9,,,3480,\"(33.5075242148, -86.7836675838)\",HLTHOUT,ARTHRITIS,0107000,01073004701,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004702,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,27.0,25.9,28.1,,,2944,\"(33.5119902661, -86.7694550989)\",HLTHOUT,ARTHRITIS,0107000,01073004702,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004800,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,30.1,29.0,31.2,,,1861,\"(33.4989064008, -86.78269914)\",HLTHOUT,ARTHRITIS,0107000,01073004800,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004901,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,22.1,21.2,23.0,,,1167,\"(33.4971595645, -86.7917440668)\",HLTHOUT,ARTHRITIS,0107000,01073004901,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073004902,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,18.4,17.5,19.4,,,3146,\"(33.4935824043, -86.8009294603)\",HLTHOUT,ARTHRITIS,0107000,01073004902,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005000,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,19.6,18.7,20.4,,,3482,\"(33.4866689795, -86.8173262831)\",HLTHOUT,ARTHRITIS,0107000,01073005000,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005101,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.6,35.3,37.8,,,1507,\"(33.4945909008, -86.834763936)\",HLTHOUT,ARTHRITIS,0107000,01073005101,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005103,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,40.1,38.6,41.7,,,2587,\"(33.485714885, -86.8327817467)\",HLTHOUT,ARTHRITIS,0107000,01073005103,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005104,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,18.9,18.0,19.8,,,2881,\"(33.4749941816, -86.8335421747)\",HLTHOUT,ARTHRITIS,0107000,01073005104,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005200,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,37.9,36.1,39.7,,,3740,\"(33.4806708775, -86.8508671514)\",HLTHOUT,ARTHRITIS,0107000,01073005200,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005302,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,33.2,31.8,34.5,,,3463,\"(33.5766456449, -86.6965590316)\",HLTHOUT,ARTHRITIS,0107000,01073005302,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,36.7,35.4,37.9,,,1824,\"(33.5670293898, -86.8005567213)\",HLTHOUT,ARTHRITIS,0107000,01073005500,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005600,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.8,30.3,33.2,,,4367,\"(33.5200981234, -86.7272063198)\",HLTHOUT,ARTHRITIS,0107000,01073005600,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005701,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,35.8,34.1,37.3,,,2372,\"(33.4629543329, -86.8898406628)\",HLTHOUT,ARTHRITIS,0107000,01073005701,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005702,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,37.8,36.0,39.3,,,3413,\"(33.4698691385, -86.874290602)\",HLTHOUT,ARTHRITIS,0107000,01073005702,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005800,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,18.4,17.7,19.1,,,4216,\"(33.479062325, -86.8128063089)\",HLTHOUT,ARTHRITIS,0107000,01073005800,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005903,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.2,31.1,33.3,,,4933,\"(33.597162309, -86.6766736351)\",HLTHOUT,ARTHRITIS,0107000,01073005903,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005905,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,34.2,32.9,35.4,,,5039,\"(33.603988456, -86.7008123418)\",HLTHOUT,ARTHRITIS,0107000,01073005905,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005907,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,30.1,28.9,31.3,,,1975,\"(33.6142861501, -86.6691996417)\",HLTHOUT,ARTHRITIS,0107000,01073005907,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005908,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.5,31.5,33.5,,,1621,\"(33.6182924432, -86.6801483084)\",HLTHOUT,ARTHRITIS,0107000,01073005908,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005909,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,28.0,26.5,29.4,,,2524,\"(33.611811773, -86.7214221514)\",HLTHOUT,ARTHRITIS,0107000,01073005909,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073005910,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,28.0,26.8,29.1,,,4612,\"(33.6299017499, -86.7194311229)\",HLTHOUT,ARTHRITIS,0107000,01073005910,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,41.3,39.4,43.1,,,114,\"(33.4363786806, -86.9128923072)\",HLTHOUT,ARTHRITIS,0107000,01073010500,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010701,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,15.1,14.0,16.3,,,74,\"(33.473886155, -86.8146487762)\",HLTHOUT,ARTHRITIS,0107000,01073010701,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010706,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,15.3,14.6,16.0,,,1528,\"(33.4443709442, -86.8405352645)\",HLTHOUT,ARTHRITIS,0107000,01073010706,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010801,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,24.9,23.9,26.2,,,168,\"(33.514097853, -86.7466971362)\",HLTHOUT,ARTHRITIS,0107000,01073010801,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010802,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,33.2,31.7,35.0,,,172,\"(33.4885493477, -86.780843024)\",HLTHOUT,ARTHRITIS,0107000,01073010802,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010803,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,23.8,22.6,25.0,,,514,\"(33.5229093892, -86.7102618642)\",HLTHOUT,ARTHRITIS,0107000,01073010803,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073010805,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,32.0,30.1,34.0,,,86,\"(33.4952792472, -86.6987184974)\",HLTHOUT,ARTHRITIS,0107000,01073010805,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011104,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,29.8,28.5,31.1,,,1688,\"(33.6159436433, -86.6557892507)\",HLTHOUT,ARTHRITIS,0107000,01073011104,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011107,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,42,\"(33.5804845249, -86.6301110961)\",HLTHOUT,ARTHRITIS,0107000,01073011107,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011108,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,9,\"(33.6050742596, -86.6316729386)\",HLTHOUT,ARTHRITIS,0107000,01073011108,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011207,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,25.3,24.3,26.2,,,815,\"(33.6718848706, -86.6772510465)\",HLTHOUT,ARTHRITIS,0107000,01073011207,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011209,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,27.2,26.1,28.3,,,1062,\"(33.6557189992, -86.7050698349)\",HLTHOUT,ARTHRITIS,0107000,01073011209,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011210,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,23.8,22.3,25.3,,,1385,\"(33.6641893755, -86.6956170686)\",HLTHOUT,ARTHRITIS,0107000,01073011210,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011803,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,28.2,27.0,29.4,,,928,\"(33.6252575173, -86.6998610409)\",HLTHOUT,ARTHRITIS,0107000,01073011803,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011804,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,25.8,24.6,27.0,,,1157,\"(33.6474916175, -86.7042974424)\",HLTHOUT,ARTHRITIS,0107000,01073011804,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011901,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,6,\"(33.6355414646, -86.736946691)\",HLTHOUT,ARTHRITIS,0107000,01073011901,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073011904,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,34.8,33.3,36.3,,,1915,\"(33.593140185, -86.7357930541)\",HLTHOUT,ARTHRITIS,0107000,01073011904,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012001,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,44.8,42.9,46.6,,,304,\"(33.5919486112, -86.864384068)\",HLTHOUT,ARTHRITIS,0107000,01073012001,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012002,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,44,\"(33.5859234197, -86.8357007188)\",HLTHOUT,ARTHRITIS,0107000,01073012002,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012200,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,23,\"(33.5967441904, -87.0879396857)\",HLTHOUT,ARTHRITIS,0107000,01073012200,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012302,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,26.3,25.2,27.5,,,144,\"(33.5542816352, -87.0544691416)\",HLTHOUT,ARTHRITIS,0107000,01073012302,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012305,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,30.5,28.6,32.2,,,403,\"(33.4695358064, -86.96831739)\",HLTHOUT,ARTHRITIS,0107000,01073012305,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012401,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,27.4,25.6,29.4,,,1066,\"(33.5571951048, -86.8777935049)\",HLTHOUT,ARTHRITIS,0107000,01073012401,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012402,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.9,30.8,33.0,,,418,\"(33.549984172, -86.8994543327)\",HLTHOUT,ARTHRITIS,0107000,01073012402,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012500,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,37.9,36.5,39.4,,,410,\"(33.529160486, -86.9346476445)\",HLTHOUT,ARTHRITIS,0107000,01073012500,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012602,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,35.4,34.5,36.3,,,371,\"(33.570164674, -86.666430582)\",HLTHOUT,ARTHRITIS,0107000,01073012602,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012701,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,44,\"(33.5484078071, -86.6323773455)\",HLTHOUT,ARTHRITIS,0107000,01073012701,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012703,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,14.8,13.8,15.9,,,498,\"(33.4681180943, -86.6671888213)\",HLTHOUT,ARTHRITIS,0107000,01073012703,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012704,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,27.0,25.2,29.0,,,113,\"(33.5034195908, -86.6180983403)\",HLTHOUT,ARTHRITIS,0107000,01073012704,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012803,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,11.9,11.1,12.7,,,1261,\"(33.4439425865, -86.7212936938)\",HLTHOUT,ARTHRITIS,0107000,01073012803,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073012910,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,9,\"(33.4345805042, -86.7263292059)\",HLTHOUT,ARTHRITIS,0107000,01073012910,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073013002,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,41.0,39.1,42.9,,,1514,\"(33.46604181, -86.8567287797)\",HLTHOUT,ARTHRITIS,0107000,01073013002,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073013100,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,38.7,37.5,39.9,,,4424,\"(33.44880214, -86.8878401579)\",HLTHOUT,ARTHRITIS,0107000,01073013100,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073013300,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,39.2,37.6,40.7,,,1782,\"(33.4396443569, -86.9248768665)\",HLTHOUT,ARTHRITIS,0107000,01073013300,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073013901,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,35.0,33.4,36.6,,,952,\"(33.4729384906, -86.9547337648)\",HLTHOUT,ARTHRITIS,0107000,01073013901,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073014302,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,19.0,18.1,19.8,,,2778,\"(33.4244658829, -86.8841474217)\",HLTHOUT,ARTHRITIS,0107000,01073014302,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01073014413,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,17.7,16.9,18.6,,,397,\"(33.4226593117, -86.8508620751)\",HLTHOUT,ARTHRITIS,0107000,01073014413,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01117030213,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,20.3,19.1,21.5,,,644,\"(33.4395975193, -86.6735959359)\",HLTHOUT,ARTHRITIS,0107000,01117030213,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01117030217,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,,,,*,Estimates suppressed for population less than 50,16,\"(33.4556995763, -86.6520208639)\",HLTHOUT,ARTHRITIS,0107000,01117030217,Arthritis\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Health Outcomes,0107000-01117030303,Arthritis among adults aged >=18 Years,%,CrdPrv,Crude prevalence,12.8,12.1,13.6,,,968,\"(33.4258661239, -86.713819356)\",HLTHOUT,ARTHRITIS,0107000,01117030303,Arthritis\n2015,AL,Alabama,Birmingham,City,BRFSS,Unhealthy Behaviors,0107000,Binge drinking among adults aged >=18 Years,%,AgeAdjPrv,Age-adjusted prevalence,11.2,11.1,11.3,,,212237,\"(33.5275663773, -86.7988174678)\",UNHBEH,BINGE,0107000,,Binge Drinking\n2015,AL,Alabama,Birmingham,City,BRFSS,Unhealthy Behaviors,0107000,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,11.3,11.3,11.4,,,212237,\"(33.5275663773, -86.7988174678)\",UNHBEH,BINGE,0107000,,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073000100,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.1,9.7,10.5,,,3042,\"(33.5794328326, -86.7228323926)\",UNHBEH,BINGE,0107000,01073000100,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073000300,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.8,10.3,11.2,,,2735,\"(33.5428208686, -86.752433978)\",UNHBEH,BINGE,0107000,01073000300,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073000400,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.5,9.0,10.0,,,3338,\"(33.5632449633, -86.7640474064)\",UNHBEH,BINGE,0107000,01073000400,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073000500,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.6,8.1,9.0,,,2864,\"(33.5442404594, -86.7749130719)\",UNHBEH,BINGE,0107000,01073000500,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073000700,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,7.4,6.9,7.9,,,2577,\"(33.5525406139, -86.8016893706)\",UNHBEH,BINGE,0107000,01073000700,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073000800,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.9,8.5,9.3,,,3859,\"(33.549697789, -86.8330944744)\",UNHBEH,BINGE,0107000,01073000800,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073001100,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.6,9.2,10.1,,,5354,\"(33.5429143325, -86.8756782852)\",UNHBEH,BINGE,0107000,01073001100,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073001200,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.4,9.1,9.7,,,2876,\"(33.5278767706, -86.8604161686)\",UNHBEH,BINGE,0107000,01073001200,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073001400,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.9,8.5,9.3,,,2181,\"(33.5261497258, -86.835146606)\",UNHBEH,BINGE,0107000,01073001400,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073001500,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.4,9.1,9.8,,,3189,\"(33.5298727342, -86.8197191685)\",UNHBEH,BINGE,0107000,01073001500,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073001600,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.2,7.7,8.6,,,3390,\"(33.5372993423, -86.8036590482)\",UNHBEH,BINGE,0107000,01073001600,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073001902,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.3,8.9,9.8,,,1894,\"(33.5532050997, -86.7429801603)\",UNHBEH,BINGE,0107000,01073001902,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002000,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.1,8.7,9.6,,,3885,\"(33.5541574106, -86.7167229915)\",UNHBEH,BINGE,0107000,01073002000,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002100,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.0,9.6,10.6,,,3186,\"(33.5650015942, -86.7101024766)\",UNHBEH,BINGE,0107000,01073002100,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002200,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.1,9.7,10.6,,,2630,\"(33.5521301205, -86.7276759508)\",UNHBEH,BINGE,0107000,01073002200,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002303,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.9,8.5,9.4,,,2936,\"(33.5383153207, -86.7270445428)\",UNHBEH,BINGE,0107000,01073002303,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002305,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,16.3,15.8,16.7,,,2952,\"(33.5333415976, -86.7479566084)\",UNHBEH,BINGE,0107000,01073002305,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002306,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,15.6,15.2,16.1,,,3257,\"(33.5213873564, -86.7490031289)\",UNHBEH,BINGE,0107000,01073002306,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002400,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,11.1,10.8,11.5,,,3629,\"(33.5260748309, -86.7830315488)\",UNHBEH,BINGE,0107000,01073002400,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002700,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,13.6,13.0,14.2,,,3992,\"(33.5176008419, -86.8106887452)\",UNHBEH,BINGE,0107000,01073002700,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002900,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.3,7.8,8.8,,,2064,\"(33.5132498864, -86.83004749)\",UNHBEH,BINGE,0107000,01073002900,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003001,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,14.3,13.3,15.3,,,3779,\"(33.5125158094, -86.8577164946)\",UNHBEH,BINGE,0107000,01073003001,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003002,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,7.4,7.0,7.8,,,2203,\"(33.512258109, -86.8441439907)\",UNHBEH,BINGE,0107000,01073003002,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003100,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.5,9.1,10.0,,,3637,\"(33.5059655756, -86.8745506086)\",UNHBEH,BINGE,0107000,01073003100,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003200,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,7.6,7.3,8.0,,,931,\"(33.5094018502, -86.8859081961)\",UNHBEH,BINGE,0107000,01073003200,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003300,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.4,8.0,8.9,,,947,\"(33.5171261108, -86.8913819749)\",UNHBEH,BINGE,0107000,01073003300,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073002305,Obesity among adults aged >=18 Years,%,CrdPrv,Crude prevalence,31.7,30.4,33.0,,,2952,\"(33.5333415976, -86.7479566084)\",UNHBEH,OBESITY,0107000,01073002305,Obesity\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003400,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.8,8.3,9.3,,,2477,\"(33.5052229234, -86.9014844656)\",UNHBEH,BINGE,0107000,01073003400,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003500,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.0,9.5,10.5,,,2780,\"(33.5065714011, -86.9195910063)\",UNHBEH,BINGE,0107000,01073003500,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003600,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.9,9.4,10.3,,,4683,\"(33.48476397, -86.8981392947)\",UNHBEH,BINGE,0107000,01073003600,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003700,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.3,9.9,10.7,,,5063,\"(33.4969018589, -86.8907729426)\",UNHBEH,BINGE,0107000,01073003700,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003802,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,10.3,9.9,10.7,,,5409,\"(33.4785707794, -86.890000907)\",UNHBEH,BINGE,0107000,01073003802,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003803,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.2,8.7,9.7,,,4199,\"(33.485945214, -86.869692186)\",UNHBEH,BINGE,0107000,01073003803,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073003900,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.5,9.1,9.8,,,1783,\"(33.4989959327, -86.8647600038)\",UNHBEH,BINGE,0107000,01073003900,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004000,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,8.5,8.0,9.0,,,3772,\"(33.4953246015, -86.8516232073)\",UNHBEH,BINGE,0107000,01073004000,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004200,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,9.1,8.8,9.4,,,2341,\"(33.5007439361, -86.8270720379)\",UNHBEH,BINGE,0107000,01073004200,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004500,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,13.8,12.9,14.8,,,5003,\"(33.5041857556, -86.8033798346)\",UNHBEH,BINGE,0107000,01073004500,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004701,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,16.4,15.7,17.2,,,3480,\"(33.5075242148, -86.7836675838)\",UNHBEH,BINGE,0107000,01073004701,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004702,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,15.3,14.9,15.7,,,2944,\"(33.5119902661, -86.7694550989)\",UNHBEH,BINGE,0107000,01073004702,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004800,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,14.1,13.7,14.5,,,1861,\"(33.4989064008, -86.78269914)\",UNHBEH,BINGE,0107000,01073004800,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004901,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,17.0,16.4,17.7,,,1167,\"(33.4971595645, -86.7917440668)\",UNHBEH,BINGE,0107000,01073004901,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073004902,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,16.3,15.6,17.1,,,3146,\"(33.4935824043, -86.8009294603)\",UNHBEH,BINGE,0107000,01073004902,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073005000,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,16.1,15.6,16.7,,,3482,\"(33.4866689795, -86.8173262831)\",UNHBEH,BINGE,0107000,01073005000,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073005101,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,7.9,7.5,8.3,,,1507,\"(33.4945909008, -86.834763936)\",UNHBEH,BINGE,0107000,01073005101,Binge Drinking\n2015,AL,Alabama,Birmingham,Census Tract,BRFSS,Unhealthy Behaviors,0107000-01073005103,Binge drinking among adults aged >=18 Years,%,CrdPrv,Crude prevalence,7.7,7.4,8.0,,,2587,\"(33.485714885, -86.8327817467)\",UNHBEH,BINGE,0107000,01073005103,Binge Drinking\n"
  },
  {
    "path": "test/external/gtest/gtest-all.cc",
    "content": "// Copyright 2008, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n//\n// Google C++ Testing and Mocking Framework (Google Test)\n//\n// Sometimes it's desirable to build Google Test by compiling a single file.\n// This file serves this purpose.\n\n// This line ensures that gtest.h can be compiled on its own, even\n// when it's fused.\n#include \"gtest/gtest.h\"\n\n// The following lines pull in the real gtest *.cc files.\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n//\n// The Google C++ Testing and Mocking Framework (Google Test)\n\n// Copyright 2007, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n//\n// Utilities for testing Google Test itself and code that uses Google Test\n// (e.g. frameworks built on top of Google Test).\n\n// GOOGLETEST_CM0004 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_\n#define GTEST_INCLUDE_GTEST_GTEST_SPI_H_\n\n\nGTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \\\n/* class A needs to have dll-interface to be used by clients of class B */)\n\nnamespace testing {\n\n// This helper class can be used to mock out Google Test failure reporting\n// so that we can test Google Test or code that builds on Google Test.\n//\n// An object of this class appends a TestPartResult object to the\n// TestPartResultArray object given in the constructor whenever a Google Test\n// failure is reported. It can either intercept only failures that are\n// generated in the same thread that created this object or it can intercept\n// all generated failures. The scope of this mock object can be controlled with\n// the second argument to the two arguments constructor.\nclass GTEST_API_ ScopedFakeTestPartResultReporter\n    : public TestPartResultReporterInterface {\n public:\n  // The two possible mocking modes of this object.\n  enum InterceptMode {\n    INTERCEPT_ONLY_CURRENT_THREAD,  // Intercepts only thread local failures.\n    INTERCEPT_ALL_THREADS           // Intercepts all failures.\n  };\n\n  // The c'tor sets this object as the test part result reporter used\n  // by Google Test.  The 'result' parameter specifies where to report the\n  // results. This reporter will only catch failures generated in the current\n  // thread. DEPRECATED\n  explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result);\n\n  // Same as above, but you can choose the interception scope of this object.\n  ScopedFakeTestPartResultReporter(InterceptMode intercept_mode,\n                                   TestPartResultArray* result);\n\n  // The d'tor restores the previous test part result reporter.\n  virtual ~ScopedFakeTestPartResultReporter();\n\n  // Appends the TestPartResult object to the TestPartResultArray\n  // received in the constructor.\n  //\n  // This method is from the TestPartResultReporterInterface\n  // interface.\n  virtual void ReportTestPartResult(const TestPartResult& result);\n private:\n  void Init();\n\n  const InterceptMode intercept_mode_;\n  TestPartResultReporterInterface* old_reporter_;\n  TestPartResultArray* const result_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter);\n};\n\nnamespace internal {\n\n// A helper class for implementing EXPECT_FATAL_FAILURE() and\n// EXPECT_NONFATAL_FAILURE().  Its destructor verifies that the given\n// TestPartResultArray contains exactly one failure that has the given\n// type and contains the given substring.  If that's not the case, a\n// non-fatal failure will be generated.\nclass GTEST_API_ SingleFailureChecker {\n public:\n  // The constructor remembers the arguments.\n  SingleFailureChecker(const TestPartResultArray* results,\n                       TestPartResult::Type type, const std::string& substr);\n  ~SingleFailureChecker();\n private:\n  const TestPartResultArray* const results_;\n  const TestPartResult::Type type_;\n  const std::string substr_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker);\n};\n\n}  // namespace internal\n\n}  // namespace testing\n\nGTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251\n\n// A set of macros for testing Google Test assertions or code that's expected\n// to generate Google Test fatal failures.  It verifies that the given\n// statement will cause exactly one fatal Google Test failure with 'substr'\n// being part of the failure message.\n//\n// There are two different versions of this macro. EXPECT_FATAL_FAILURE only\n// affects and considers failures generated in the current thread and\n// EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.\n//\n// The verification of the assertion is done correctly even when the statement\n// throws an exception or aborts the current function.\n//\n// Known restrictions:\n//   - 'statement' cannot reference local non-static variables or\n//     non-static members of the current object.\n//   - 'statement' cannot return a value.\n//   - You cannot stream a failure message to this macro.\n//\n// Note that even though the implementations of the following two\n// macros are much alike, we cannot refactor them to use a common\n// helper macro, due to some peculiarity in how the preprocessor\n// works.  The AcceptsMacroThatExpandsToUnprotectedComma test in\n// gtest_unittest.cc will fail to compile if we do that.\n#define EXPECT_FATAL_FAILURE(statement, substr) \\\n  do { \\\n    class GTestExpectFatalFailureHelper {\\\n     public:\\\n      static void Execute() { statement; }\\\n    };\\\n    ::testing::TestPartResultArray gtest_failures;\\\n    ::testing::internal::SingleFailureChecker gtest_checker(\\\n        &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\\\n    {\\\n      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\\\n          ::testing::ScopedFakeTestPartResultReporter:: \\\n          INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\\\n      GTestExpectFatalFailureHelper::Execute();\\\n    }\\\n  } while (::testing::internal::AlwaysFalse())\n\n#define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \\\n  do { \\\n    class GTestExpectFatalFailureHelper {\\\n     public:\\\n      static void Execute() { statement; }\\\n    };\\\n    ::testing::TestPartResultArray gtest_failures;\\\n    ::testing::internal::SingleFailureChecker gtest_checker(\\\n        &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\\\n    {\\\n      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\\\n          ::testing::ScopedFakeTestPartResultReporter:: \\\n          INTERCEPT_ALL_THREADS, &gtest_failures);\\\n      GTestExpectFatalFailureHelper::Execute();\\\n    }\\\n  } while (::testing::internal::AlwaysFalse())\n\n// A macro for testing Google Test assertions or code that's expected to\n// generate Google Test non-fatal failures.  It asserts that the given\n// statement will cause exactly one non-fatal Google Test failure with 'substr'\n// being part of the failure message.\n//\n// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only\n// affects and considers failures generated in the current thread and\n// EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.\n//\n// 'statement' is allowed to reference local variables and members of\n// the current object.\n//\n// The verification of the assertion is done correctly even when the statement\n// throws an exception or aborts the current function.\n//\n// Known restrictions:\n//   - You cannot stream a failure message to this macro.\n//\n// Note that even though the implementations of the following two\n// macros are much alike, we cannot refactor them to use a common\n// helper macro, due to some peculiarity in how the preprocessor\n// works.  If we do that, the code won't compile when the user gives\n// EXPECT_NONFATAL_FAILURE() a statement that contains a macro that\n// expands to code containing an unprotected comma.  The\n// AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc\n// catches that.\n//\n// For the same reason, we have to write\n//   if (::testing::internal::AlwaysTrue()) { statement; }\n// instead of\n//   GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)\n// to avoid an MSVC warning on unreachable code.\n#define EXPECT_NONFATAL_FAILURE(statement, substr) \\\n  do {\\\n    ::testing::TestPartResultArray gtest_failures;\\\n    ::testing::internal::SingleFailureChecker gtest_checker(\\\n        &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \\\n        (substr));\\\n    {\\\n      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\\\n          ::testing::ScopedFakeTestPartResultReporter:: \\\n          INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\\\n      if (::testing::internal::AlwaysTrue()) { statement; }\\\n    }\\\n  } while (::testing::internal::AlwaysFalse())\n\n#define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \\\n  do {\\\n    ::testing::TestPartResultArray gtest_failures;\\\n    ::testing::internal::SingleFailureChecker gtest_checker(\\\n        &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \\\n        (substr));\\\n    {\\\n      ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\\\n          ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, \\\n          &gtest_failures);\\\n      if (::testing::internal::AlwaysTrue()) { statement; }\\\n    }\\\n  } while (::testing::internal::AlwaysFalse())\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_SPI_H_\n\n#include <ctype.h>\n#include <math.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n#include <wchar.h>\n#include <wctype.h>\n\n#include <algorithm>\n#include <iomanip>\n#include <limits>\n#include <list>\n#include <map>\n#include <ostream>  // NOLINT\n#include <sstream>\n#include <vector>\n\n#if GTEST_OS_LINUX\n\n// FIXME: Use autoconf to detect availability of\n// gettimeofday().\n# define GTEST_HAS_GETTIMEOFDAY_ 1\n\n# include <fcntl.h>  // NOLINT\n# include <limits.h>  // NOLINT\n# include <sched.h>  // NOLINT\n// Declares vsnprintf().  This header is not available on Windows.\n# include <strings.h>  // NOLINT\n# include <sys/mman.h>  // NOLINT\n# include <sys/time.h>  // NOLINT\n# include <unistd.h>  // NOLINT\n# include <string>\n\n#elif GTEST_OS_SYMBIAN\n# define GTEST_HAS_GETTIMEOFDAY_ 1\n# include <sys/time.h>  // NOLINT\n\n#elif GTEST_OS_ZOS\n# define GTEST_HAS_GETTIMEOFDAY_ 1\n# include <sys/time.h>  // NOLINT\n\n// On z/OS we additionally need strings.h for strcasecmp.\n# include <strings.h>  // NOLINT\n\n#elif GTEST_OS_WINDOWS_MOBILE  // We are on Windows CE.\n\n# include <windows.h>  // NOLINT\n# undef min\n\n#elif GTEST_OS_WINDOWS  // We are on Windows proper.\n\n# include <io.h>  // NOLINT\n# include <sys/timeb.h>  // NOLINT\n# include <sys/types.h>  // NOLINT\n# include <sys/stat.h>  // NOLINT\n\n# if GTEST_OS_WINDOWS_MINGW\n// MinGW has gettimeofday() but not _ftime64().\n// FIXME: Use autoconf to detect availability of\n//   gettimeofday().\n// FIXME: There are other ways to get the time on\n//   Windows, like GetTickCount() or GetSystemTimeAsFileTime().  MinGW\n//   supports these.  consider using them instead.\n#  define GTEST_HAS_GETTIMEOFDAY_ 1\n#  include <sys/time.h>  // NOLINT\n# endif  // GTEST_OS_WINDOWS_MINGW\n\n// cpplint thinks that the header is already included, so we want to\n// silence it.\n# include <windows.h>  // NOLINT\n# undef min\n\n#else\n\n// Assume other platforms have gettimeofday().\n// FIXME: Use autoconf to detect availability of\n//   gettimeofday().\n# define GTEST_HAS_GETTIMEOFDAY_ 1\n\n// cpplint thinks that the header is already included, so we want to\n// silence it.\n# include <sys/time.h>  // NOLINT\n# include <unistd.h>  // NOLINT\n\n#endif  // GTEST_OS_LINUX\n\n#if GTEST_HAS_EXCEPTIONS\n# include <stdexcept>\n#endif\n\n#if GTEST_CAN_STREAM_RESULTS_\n# include <arpa/inet.h>  // NOLINT\n# include <netdb.h>  // NOLINT\n# include <sys/socket.h>  // NOLINT\n# include <sys/types.h>  // NOLINT\n#endif\n\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Utility functions and classes used by the Google C++ testing framework.//\n// This file contains purely Google Test's internal implementation.  Please\n// DO NOT #INCLUDE IT IN A USER PROGRAM.\n\n#ifndef GTEST_SRC_GTEST_INTERNAL_INL_H_\n#define GTEST_SRC_GTEST_INTERNAL_INL_H_\n\n#ifndef _WIN32_WCE\n# include <errno.h>\n#endif  // !_WIN32_WCE\n#include <stddef.h>\n#include <stdlib.h>  // For strtoll/_strtoul64/malloc/free.\n#include <string.h>  // For memmove.\n\n#include <algorithm>\n#include <string>\n#include <vector>\n\n\n#if GTEST_CAN_STREAM_RESULTS_\n# include <arpa/inet.h>  // NOLINT\n# include <netdb.h>  // NOLINT\n#endif\n\n#if GTEST_OS_WINDOWS\n# include <windows.h>  // NOLINT\n#endif  // GTEST_OS_WINDOWS\n\n\nGTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \\\n/* class A needs to have dll-interface to be used by clients of class B */)\n\nnamespace testing {\n\n// Declares the flags.\n//\n// We don't want the users to modify this flag in the code, but want\n// Google Test's own unit tests to be able to access it. Therefore we\n// declare it here as opposed to in gtest.h.\nGTEST_DECLARE_bool_(death_test_use_fork);\n\nnamespace internal {\n\n// The value of GetTestTypeId() as seen from within the Google Test\n// library.  This is solely for testing GetTestTypeId().\nGTEST_API_ extern const TypeId kTestTypeIdInGoogleTest;\n\n// Names of the flags (needed for parsing Google Test flags).\nconst char kAlsoRunDisabledTestsFlag[] = \"also_run_disabled_tests\";\nconst char kBreakOnFailureFlag[] = \"break_on_failure\";\nconst char kCatchExceptionsFlag[] = \"catch_exceptions\";\nconst char kColorFlag[] = \"color\";\nconst char kFilterFlag[] = \"filter\";\nconst char kListTestsFlag[] = \"list_tests\";\nconst char kOutputFlag[] = \"output\";\nconst char kPrintTimeFlag[] = \"print_time\";\nconst char kPrintUTF8Flag[] = \"print_utf8\";\nconst char kRandomSeedFlag[] = \"random_seed\";\nconst char kRepeatFlag[] = \"repeat\";\nconst char kShuffleFlag[] = \"shuffle\";\nconst char kStackTraceDepthFlag[] = \"stack_trace_depth\";\nconst char kStreamResultToFlag[] = \"stream_result_to\";\nconst char kThrowOnFailureFlag[] = \"throw_on_failure\";\nconst char kFlagfileFlag[] = \"flagfile\";\n\n// A valid random seed must be in [1, kMaxRandomSeed].\nconst int kMaxRandomSeed = 99999;\n\n// g_help_flag is true iff the --help flag or an equivalent form is\n// specified on the command line.\nGTEST_API_ extern bool g_help_flag;\n\n// Returns the current time in milliseconds.\nGTEST_API_ TimeInMillis GetTimeInMillis();\n\n// Returns true iff Google Test should use colors in the output.\nGTEST_API_ bool ShouldUseColor(bool stdout_is_tty);\n\n// Formats the given time in milliseconds as seconds.\nGTEST_API_ std::string FormatTimeInMillisAsSeconds(TimeInMillis ms);\n\n// Converts the given time in milliseconds to a date string in the ISO 8601\n// format, without the timezone information.  N.B.: due to the use the\n// non-reentrant localtime() function, this function is not thread safe.  Do\n// not use it in any code that can be called from multiple threads.\nGTEST_API_ std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms);\n\n// Parses a string for an Int32 flag, in the form of \"--flag=value\".\n//\n// On success, stores the value of the flag in *value, and returns\n// true.  On failure, returns false without changing *value.\nGTEST_API_ bool ParseInt32Flag(\n    const char* str, const char* flag, Int32* value);\n\n// Returns a random seed in range [1, kMaxRandomSeed] based on the\n// given --gtest_random_seed flag value.\ninline int GetRandomSeedFromFlag(Int32 random_seed_flag) {\n  const unsigned int raw_seed = (random_seed_flag == 0) ?\n      static_cast<unsigned int>(GetTimeInMillis()) :\n      static_cast<unsigned int>(random_seed_flag);\n\n  // Normalizes the actual seed to range [1, kMaxRandomSeed] such that\n  // it's easy to type.\n  const int normalized_seed =\n      static_cast<int>((raw_seed - 1U) %\n                       static_cast<unsigned int>(kMaxRandomSeed)) + 1;\n  return normalized_seed;\n}\n\n// Returns the first valid random seed after 'seed'.  The behavior is\n// undefined if 'seed' is invalid.  The seed after kMaxRandomSeed is\n// considered to be 1.\ninline int GetNextRandomSeed(int seed) {\n  GTEST_CHECK_(1 <= seed && seed <= kMaxRandomSeed)\n      << \"Invalid random seed \" << seed << \" - must be in [1, \"\n      << kMaxRandomSeed << \"].\";\n  const int next_seed = seed + 1;\n  return (next_seed > kMaxRandomSeed) ? 1 : next_seed;\n}\n\n// This class saves the values of all Google Test flags in its c'tor, and\n// restores them in its d'tor.\nclass GTestFlagSaver {\n public:\n  // The c'tor.\n  GTestFlagSaver() {\n    also_run_disabled_tests_ = GTEST_FLAG(also_run_disabled_tests);\n    break_on_failure_ = GTEST_FLAG(break_on_failure);\n    catch_exceptions_ = GTEST_FLAG(catch_exceptions);\n    color_ = GTEST_FLAG(color);\n    death_test_style_ = GTEST_FLAG(death_test_style);\n    death_test_use_fork_ = GTEST_FLAG(death_test_use_fork);\n    filter_ = GTEST_FLAG(filter);\n    internal_run_death_test_ = GTEST_FLAG(internal_run_death_test);\n    list_tests_ = GTEST_FLAG(list_tests);\n    output_ = GTEST_FLAG(output);\n    print_time_ = GTEST_FLAG(print_time);\n    print_utf8_ = GTEST_FLAG(print_utf8);\n    random_seed_ = GTEST_FLAG(random_seed);\n    repeat_ = GTEST_FLAG(repeat);\n    shuffle_ = GTEST_FLAG(shuffle);\n    stack_trace_depth_ = GTEST_FLAG(stack_trace_depth);\n    stream_result_to_ = GTEST_FLAG(stream_result_to);\n    throw_on_failure_ = GTEST_FLAG(throw_on_failure);\n  }\n\n  // The d'tor is not virtual.  DO NOT INHERIT FROM THIS CLASS.\n  ~GTestFlagSaver() {\n    GTEST_FLAG(also_run_disabled_tests) = also_run_disabled_tests_;\n    GTEST_FLAG(break_on_failure) = break_on_failure_;\n    GTEST_FLAG(catch_exceptions) = catch_exceptions_;\n    GTEST_FLAG(color) = color_;\n    GTEST_FLAG(death_test_style) = death_test_style_;\n    GTEST_FLAG(death_test_use_fork) = death_test_use_fork_;\n    GTEST_FLAG(filter) = filter_;\n    GTEST_FLAG(internal_run_death_test) = internal_run_death_test_;\n    GTEST_FLAG(list_tests) = list_tests_;\n    GTEST_FLAG(output) = output_;\n    GTEST_FLAG(print_time) = print_time_;\n    GTEST_FLAG(print_utf8) = print_utf8_;\n    GTEST_FLAG(random_seed) = random_seed_;\n    GTEST_FLAG(repeat) = repeat_;\n    GTEST_FLAG(shuffle) = shuffle_;\n    GTEST_FLAG(stack_trace_depth) = stack_trace_depth_;\n    GTEST_FLAG(stream_result_to) = stream_result_to_;\n    GTEST_FLAG(throw_on_failure) = throw_on_failure_;\n  }\n\n private:\n  // Fields for saving the original values of flags.\n  bool also_run_disabled_tests_;\n  bool break_on_failure_;\n  bool catch_exceptions_;\n  std::string color_;\n  std::string death_test_style_;\n  bool death_test_use_fork_;\n  std::string filter_;\n  std::string internal_run_death_test_;\n  bool list_tests_;\n  std::string output_;\n  bool print_time_;\n  bool print_utf8_;\n  internal::Int32 random_seed_;\n  internal::Int32 repeat_;\n  bool shuffle_;\n  internal::Int32 stack_trace_depth_;\n  std::string stream_result_to_;\n  bool throw_on_failure_;\n} GTEST_ATTRIBUTE_UNUSED_;\n\n// Converts a Unicode code point to a narrow string in UTF-8 encoding.\n// code_point parameter is of type UInt32 because wchar_t may not be\n// wide enough to contain a code point.\n// If the code_point is not a valid Unicode code point\n// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted\n// to \"(Invalid Unicode 0xXXXXXXXX)\".\nGTEST_API_ std::string CodePointToUtf8(UInt32 code_point);\n\n// Converts a wide string to a narrow string in UTF-8 encoding.\n// The wide string is assumed to have the following encoding:\n//   UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)\n//   UTF-32 if sizeof(wchar_t) == 4 (on Linux)\n// Parameter str points to a null-terminated wide string.\n// Parameter num_chars may additionally limit the number\n// of wchar_t characters processed. -1 is used when the entire string\n// should be processed.\n// If the string contains code points that are not valid Unicode code points\n// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output\n// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding\n// and contains invalid UTF-16 surrogate pairs, values in those pairs\n// will be encoded as individual Unicode characters from Basic Normal Plane.\nGTEST_API_ std::string WideStringToUtf8(const wchar_t* str, int num_chars);\n\n// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file\n// if the variable is present. If a file already exists at this location, this\n// function will write over it. If the variable is present, but the file cannot\n// be created, prints an error and exits.\nvoid WriteToShardStatusFileIfNeeded();\n\n// Checks whether sharding is enabled by examining the relevant\n// environment variable values. If the variables are present,\n// but inconsistent (e.g., shard_index >= total_shards), prints\n// an error and exits. If in_subprocess_for_death_test, sharding is\n// disabled because it must only be applied to the original test\n// process. Otherwise, we could filter out death tests we intended to execute.\nGTEST_API_ bool ShouldShard(const char* total_shards_str,\n                            const char* shard_index_str,\n                            bool in_subprocess_for_death_test);\n\n// Parses the environment variable var as an Int32. If it is unset,\n// returns default_val. If it is not an Int32, prints an error and\n// and aborts.\nGTEST_API_ Int32 Int32FromEnvOrDie(const char* env_var, Int32 default_val);\n\n// Given the total number of shards, the shard index, and the test id,\n// returns true iff the test should be run on this shard. The test id is\n// some arbitrary but unique non-negative integer assigned to each test\n// method. Assumes that 0 <= shard_index < total_shards.\nGTEST_API_ bool ShouldRunTestOnShard(\n    int total_shards, int shard_index, int test_id);\n\n// STL container utilities.\n\n// Returns the number of elements in the given container that satisfy\n// the given predicate.\ntemplate <class Container, typename Predicate>\ninline int CountIf(const Container& c, Predicate predicate) {\n  // Implemented as an explicit loop since std::count_if() in libCstd on\n  // Solaris has a non-standard signature.\n  int count = 0;\n  for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {\n    if (predicate(*it))\n      ++count;\n  }\n  return count;\n}\n\n// Applies a function/functor to each element in the container.\ntemplate <class Container, typename Functor>\nvoid ForEach(const Container& c, Functor functor) {\n  std::for_each(c.begin(), c.end(), functor);\n}\n\n// Returns the i-th element of the vector, or default_value if i is not\n// in range [0, v.size()).\ntemplate <typename E>\ninline E GetElementOr(const std::vector<E>& v, int i, E default_value) {\n  return (i < 0 || i >= static_cast<int>(v.size())) ? default_value : v[i];\n}\n\n// Performs an in-place shuffle of a range of the vector's elements.\n// 'begin' and 'end' are element indices as an STL-style range;\n// i.e. [begin, end) are shuffled, where 'end' == size() means to\n// shuffle to the end of the vector.\ntemplate <typename E>\nvoid ShuffleRange(internal::Random* random, int begin, int end,\n                  std::vector<E>* v) {\n  const int size = static_cast<int>(v->size());\n  GTEST_CHECK_(0 <= begin && begin <= size)\n      << \"Invalid shuffle range start \" << begin << \": must be in range [0, \"\n      << size << \"].\";\n  GTEST_CHECK_(begin <= end && end <= size)\n      << \"Invalid shuffle range finish \" << end << \": must be in range [\"\n      << begin << \", \" << size << \"].\";\n\n  // Fisher-Yates shuffle, from\n  // http://en.wikipedia.org/wiki/Fisher-Yates_shuffle\n  for (int range_width = end - begin; range_width >= 2; range_width--) {\n    const int last_in_range = begin + range_width - 1;\n    const int selected = begin + random->Generate(range_width);\n    std::swap((*v)[selected], (*v)[last_in_range]);\n  }\n}\n\n// Performs an in-place shuffle of the vector's elements.\ntemplate <typename E>\ninline void Shuffle(internal::Random* random, std::vector<E>* v) {\n  ShuffleRange(random, 0, static_cast<int>(v->size()), v);\n}\n\n// A function for deleting an object.  Handy for being used as a\n// functor.\ntemplate <typename T>\nstatic void Delete(T* x) {\n  delete x;\n}\n\n// A predicate that checks the key of a TestProperty against a known key.\n//\n// TestPropertyKeyIs is copyable.\nclass TestPropertyKeyIs {\n public:\n  // Constructor.\n  //\n  // TestPropertyKeyIs has NO default constructor.\n  explicit TestPropertyKeyIs(const std::string& key) : key_(key) {}\n\n  // Returns true iff the test name of test property matches on key_.\n  bool operator()(const TestProperty& test_property) const {\n    return test_property.key() == key_;\n  }\n\n private:\n  std::string key_;\n};\n\n// Class UnitTestOptions.\n//\n// This class contains functions for processing options the user\n// specifies when running the tests.  It has only static members.\n//\n// In most cases, the user can specify an option using either an\n// environment variable or a command line flag.  E.g. you can set the\n// test filter using either GTEST_FILTER or --gtest_filter.  If both\n// the variable and the flag are present, the latter overrides the\n// former.\nclass GTEST_API_ UnitTestOptions {\n public:\n  // Functions for processing the gtest_output flag.\n\n  // Returns the output format, or \"\" for normal printed output.\n  static std::string GetOutputFormat();\n\n  // Returns the absolute path of the requested output file, or the\n  // default (test_detail.xml in the original working directory) if\n  // none was explicitly specified.\n  static std::string GetAbsolutePathToOutputFile();\n\n  // Functions for processing the gtest_filter flag.\n\n  // Returns true iff the wildcard pattern matches the string.  The\n  // first ':' or '\\0' character in pattern marks the end of it.\n  //\n  // This recursive algorithm isn't very efficient, but is clear and\n  // works well enough for matching test names, which are short.\n  static bool PatternMatchesString(const char *pattern, const char *str);\n\n  // Returns true iff the user-specified filter matches the test case\n  // name and the test name.\n  static bool FilterMatchesTest(const std::string &test_case_name,\n                                const std::string &test_name);\n\n#if GTEST_OS_WINDOWS\n  // Function for supporting the gtest_catch_exception flag.\n\n  // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the\n  // given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.\n  // This function is useful as an __except condition.\n  static int GTestShouldProcessSEH(DWORD exception_code);\n#endif  // GTEST_OS_WINDOWS\n\n  // Returns true if \"name\" matches the ':' separated list of glob-style\n  // filters in \"filter\".\n  static bool MatchesFilter(const std::string& name, const char* filter);\n};\n\n// Returns the current application's name, removing directory path if that\n// is present.  Used by UnitTestOptions::GetOutputFile.\nGTEST_API_ FilePath GetCurrentExecutableName();\n\n// The role interface for getting the OS stack trace as a string.\nclass OsStackTraceGetterInterface {\n public:\n  OsStackTraceGetterInterface() {}\n  virtual ~OsStackTraceGetterInterface() {}\n\n  // Returns the current OS stack trace as an std::string.  Parameters:\n  //\n  //   max_depth  - the maximum number of stack frames to be included\n  //                in the trace.\n  //   skip_count - the number of top frames to be skipped; doesn't count\n  //                against max_depth.\n  virtual std::string CurrentStackTrace(int max_depth, int skip_count) = 0;\n\n  // UponLeavingGTest() should be called immediately before Google Test calls\n  // user code. It saves some information about the current stack that\n  // CurrentStackTrace() will use to find and hide Google Test stack frames.\n  virtual void UponLeavingGTest() = 0;\n\n  // This string is inserted in place of stack frames that are part of\n  // Google Test's implementation.\n  static const char* const kElidedFramesMarker;\n\n private:\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface);\n};\n\n// A working implementation of the OsStackTraceGetterInterface interface.\nclass OsStackTraceGetter : public OsStackTraceGetterInterface {\n public:\n  OsStackTraceGetter() {}\n\n  virtual std::string CurrentStackTrace(int max_depth, int skip_count);\n  virtual void UponLeavingGTest();\n\n private:\n#if GTEST_HAS_ABSL\n  Mutex mutex_;  // Protects all internal state.\n\n  // We save the stack frame below the frame that calls user code.\n  // We do this because the address of the frame immediately below\n  // the user code changes between the call to UponLeavingGTest()\n  // and any calls to the stack trace code from within the user code.\n  void* caller_frame_ = nullptr;\n#endif  // GTEST_HAS_ABSL\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetter);\n};\n\n// Information about a Google Test trace point.\nstruct TraceInfo {\n  const char* file;\n  int line;\n  std::string message;\n};\n\n// This is the default global test part result reporter used in UnitTestImpl.\n// This class should only be used by UnitTestImpl.\nclass DefaultGlobalTestPartResultReporter\n  : public TestPartResultReporterInterface {\n public:\n  explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);\n  // Implements the TestPartResultReporterInterface. Reports the test part\n  // result in the current test.\n  virtual void ReportTestPartResult(const TestPartResult& result);\n\n private:\n  UnitTestImpl* const unit_test_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultGlobalTestPartResultReporter);\n};\n\n// This is the default per thread test part result reporter used in\n// UnitTestImpl. This class should only be used by UnitTestImpl.\nclass DefaultPerThreadTestPartResultReporter\n    : public TestPartResultReporterInterface {\n public:\n  explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);\n  // Implements the TestPartResultReporterInterface. The implementation just\n  // delegates to the current global test part result reporter of *unit_test_.\n  virtual void ReportTestPartResult(const TestPartResult& result);\n\n private:\n  UnitTestImpl* const unit_test_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultPerThreadTestPartResultReporter);\n};\n\n// The private implementation of the UnitTest class.  We don't protect\n// the methods under a mutex, as this class is not accessible by a\n// user and the UnitTest class that delegates work to this class does\n// proper locking.\nclass GTEST_API_ UnitTestImpl {\n public:\n  explicit UnitTestImpl(UnitTest* parent);\n  virtual ~UnitTestImpl();\n\n  // There are two different ways to register your own TestPartResultReporter.\n  // You can register your own repoter to listen either only for test results\n  // from the current thread or for results from all threads.\n  // By default, each per-thread test result repoter just passes a new\n  // TestPartResult to the global test result reporter, which registers the\n  // test part result for the currently running test.\n\n  // Returns the global test part result reporter.\n  TestPartResultReporterInterface* GetGlobalTestPartResultReporter();\n\n  // Sets the global test part result reporter.\n  void SetGlobalTestPartResultReporter(\n      TestPartResultReporterInterface* reporter);\n\n  // Returns the test part result reporter for the current thread.\n  TestPartResultReporterInterface* GetTestPartResultReporterForCurrentThread();\n\n  // Sets the test part result reporter for the current thread.\n  void SetTestPartResultReporterForCurrentThread(\n      TestPartResultReporterInterface* reporter);\n\n  // Gets the number of successful test cases.\n  int successful_test_case_count() const;\n\n  // Gets the number of failed test cases.\n  int failed_test_case_count() const;\n\n  // Gets the number of all test cases.\n  int total_test_case_count() const;\n\n  // Gets the number of all test cases that contain at least one test\n  // that should run.\n  int test_case_to_run_count() const;\n\n  // Gets the number of successful tests.\n  int successful_test_count() const;\n\n  // Gets the number of failed tests.\n  int failed_test_count() const;\n\n  // Gets the number of disabled tests that will be reported in the XML report.\n  int reportable_disabled_test_count() const;\n\n  // Gets the number of disabled tests.\n  int disabled_test_count() const;\n\n  // Gets the number of tests to be printed in the XML report.\n  int reportable_test_count() const;\n\n  // Gets the number of all tests.\n  int total_test_count() const;\n\n  // Gets the number of tests that should run.\n  int test_to_run_count() const;\n\n  // Gets the time of the test program start, in ms from the start of the\n  // UNIX epoch.\n  TimeInMillis start_timestamp() const { return start_timestamp_; }\n\n  // Gets the elapsed time, in milliseconds.\n  TimeInMillis elapsed_time() const { return elapsed_time_; }\n\n  // Returns true iff the unit test passed (i.e. all test cases passed).\n  bool Passed() const { return !Failed(); }\n\n  // Returns true iff the unit test failed (i.e. some test case failed\n  // or something outside of all tests failed).\n  bool Failed() const {\n    return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed();\n  }\n\n  // Gets the i-th test case among all the test cases. i can range from 0 to\n  // total_test_case_count() - 1. If i is not in that range, returns NULL.\n  const TestCase* GetTestCase(int i) const {\n    const int index = GetElementOr(test_case_indices_, i, -1);\n    return index < 0 ? NULL : test_cases_[i];\n  }\n\n  // Gets the i-th test case among all the test cases. i can range from 0 to\n  // total_test_case_count() - 1. If i is not in that range, returns NULL.\n  TestCase* GetMutableTestCase(int i) {\n    const int index = GetElementOr(test_case_indices_, i, -1);\n    return index < 0 ? NULL : test_cases_[index];\n  }\n\n  // Provides access to the event listener list.\n  TestEventListeners* listeners() { return &listeners_; }\n\n  // Returns the TestResult for the test that's currently running, or\n  // the TestResult for the ad hoc test if no test is running.\n  TestResult* current_test_result();\n\n  // Returns the TestResult for the ad hoc test.\n  const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; }\n\n  // Sets the OS stack trace getter.\n  //\n  // Does nothing if the input and the current OS stack trace getter\n  // are the same; otherwise, deletes the old getter and makes the\n  // input the current getter.\n  void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter);\n\n  // Returns the current OS stack trace getter if it is not NULL;\n  // otherwise, creates an OsStackTraceGetter, makes it the current\n  // getter, and returns it.\n  OsStackTraceGetterInterface* os_stack_trace_getter();\n\n  // Returns the current OS stack trace as an std::string.\n  //\n  // The maximum number of stack frames to be included is specified by\n  // the gtest_stack_trace_depth flag.  The skip_count parameter\n  // specifies the number of top frames to be skipped, which doesn't\n  // count against the number of frames to be included.\n  //\n  // For example, if Foo() calls Bar(), which in turn calls\n  // CurrentOsStackTraceExceptTop(1), Foo() will be included in the\n  // trace but Bar() and CurrentOsStackTraceExceptTop() won't.\n  std::string CurrentOsStackTraceExceptTop(int skip_count) GTEST_NO_INLINE_;\n\n  // Finds and returns a TestCase with the given name.  If one doesn't\n  // exist, creates one and returns it.\n  //\n  // Arguments:\n  //\n  //   test_case_name: name of the test case\n  //   type_param:     the name of the test's type parameter, or NULL if\n  //                   this is not a typed or a type-parameterized test.\n  //   set_up_tc:      pointer to the function that sets up the test case\n  //   tear_down_tc:   pointer to the function that tears down the test case\n  TestCase* GetTestCase(const char* test_case_name,\n                        const char* type_param,\n                        Test::SetUpTestCaseFunc set_up_tc,\n                        Test::TearDownTestCaseFunc tear_down_tc);\n\n  // Adds a TestInfo to the unit test.\n  //\n  // Arguments:\n  //\n  //   set_up_tc:    pointer to the function that sets up the test case\n  //   tear_down_tc: pointer to the function that tears down the test case\n  //   test_info:    the TestInfo object\n  void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,\n                   Test::TearDownTestCaseFunc tear_down_tc,\n                   TestInfo* test_info) {\n    // In order to support thread-safe death tests, we need to\n    // remember the original working directory when the test program\n    // was first invoked.  We cannot do this in RUN_ALL_TESTS(), as\n    // the user may have changed the current directory before calling\n    // RUN_ALL_TESTS().  Therefore we capture the current directory in\n    // AddTestInfo(), which is called to register a TEST or TEST_F\n    // before main() is reached.\n    if (original_working_dir_.IsEmpty()) {\n      original_working_dir_.Set(FilePath::GetCurrentDir());\n      GTEST_CHECK_(!original_working_dir_.IsEmpty())\n          << \"Failed to get the current working directory.\";\n    }\n\n    GetTestCase(test_info->test_case_name(),\n                test_info->type_param(),\n                set_up_tc,\n                tear_down_tc)->AddTestInfo(test_info);\n  }\n\n  // Returns ParameterizedTestCaseRegistry object used to keep track of\n  // value-parameterized tests and instantiate and register them.\n  internal::ParameterizedTestCaseRegistry& parameterized_test_registry() {\n    return parameterized_test_registry_;\n  }\n\n  // Sets the TestCase object for the test that's currently running.\n  void set_current_test_case(TestCase* a_current_test_case) {\n    current_test_case_ = a_current_test_case;\n  }\n\n  // Sets the TestInfo object for the test that's currently running.  If\n  // current_test_info is NULL, the assertion results will be stored in\n  // ad_hoc_test_result_.\n  void set_current_test_info(TestInfo* a_current_test_info) {\n    current_test_info_ = a_current_test_info;\n  }\n\n  // Registers all parameterized tests defined using TEST_P and\n  // INSTANTIATE_TEST_CASE_P, creating regular tests for each test/parameter\n  // combination. This method can be called more then once; it has guards\n  // protecting from registering the tests more then once.  If\n  // value-parameterized tests are disabled, RegisterParameterizedTests is\n  // present but does nothing.\n  void RegisterParameterizedTests();\n\n  // Runs all tests in this UnitTest object, prints the result, and\n  // returns true if all tests are successful.  If any exception is\n  // thrown during a test, this test is considered to be failed, but\n  // the rest of the tests will still be run.\n  bool RunAllTests();\n\n  // Clears the results of all tests, except the ad hoc tests.\n  void ClearNonAdHocTestResult() {\n    ForEach(test_cases_, TestCase::ClearTestCaseResult);\n  }\n\n  // Clears the results of ad-hoc test assertions.\n  void ClearAdHocTestResult() {\n    ad_hoc_test_result_.Clear();\n  }\n\n  // Adds a TestProperty to the current TestResult object when invoked in a\n  // context of a test or a test case, or to the global property set. If the\n  // result already contains a property with the same key, the value will be\n  // updated.\n  void RecordProperty(const TestProperty& test_property);\n\n  enum ReactionToSharding {\n    HONOR_SHARDING_PROTOCOL,\n    IGNORE_SHARDING_PROTOCOL\n  };\n\n  // Matches the full name of each test against the user-specified\n  // filter to decide whether the test should run, then records the\n  // result in each TestCase and TestInfo object.\n  // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests\n  // based on sharding variables in the environment.\n  // Returns the number of tests that should run.\n  int FilterTests(ReactionToSharding shard_tests);\n\n  // Prints the names of the tests matching the user-specified filter flag.\n  void ListTestsMatchingFilter();\n\n  const TestCase* current_test_case() const { return current_test_case_; }\n  TestInfo* current_test_info() { return current_test_info_; }\n  const TestInfo* current_test_info() const { return current_test_info_; }\n\n  // Returns the vector of environments that need to be set-up/torn-down\n  // before/after the tests are run.\n  std::vector<Environment*>& environments() { return environments_; }\n\n  // Getters for the per-thread Google Test trace stack.\n  std::vector<TraceInfo>& gtest_trace_stack() {\n    return *(gtest_trace_stack_.pointer());\n  }\n  const std::vector<TraceInfo>& gtest_trace_stack() const {\n    return gtest_trace_stack_.get();\n  }\n\n#if GTEST_HAS_DEATH_TEST\n  void InitDeathTestSubprocessControlInfo() {\n    internal_run_death_test_flag_.reset(ParseInternalRunDeathTestFlag());\n  }\n  // Returns a pointer to the parsed --gtest_internal_run_death_test\n  // flag, or NULL if that flag was not specified.\n  // This information is useful only in a death test child process.\n  // Must not be called before a call to InitGoogleTest.\n  const InternalRunDeathTestFlag* internal_run_death_test_flag() const {\n    return internal_run_death_test_flag_.get();\n  }\n\n  // Returns a pointer to the current death test factory.\n  internal::DeathTestFactory* death_test_factory() {\n    return death_test_factory_.get();\n  }\n\n  void SuppressTestEventsIfInSubprocess();\n\n  friend class ReplaceDeathTestFactory;\n#endif  // GTEST_HAS_DEATH_TEST\n\n  // Initializes the event listener performing XML output as specified by\n  // UnitTestOptions. Must not be called before InitGoogleTest.\n  void ConfigureXmlOutput();\n\n#if GTEST_CAN_STREAM_RESULTS_\n  // Initializes the event listener for streaming test results to a socket.\n  // Must not be called before InitGoogleTest.\n  void ConfigureStreamingOutput();\n#endif\n\n  // Performs initialization dependent upon flag values obtained in\n  // ParseGoogleTestFlagsOnly.  Is called from InitGoogleTest after the call to\n  // ParseGoogleTestFlagsOnly.  In case a user neglects to call InitGoogleTest\n  // this function is also called from RunAllTests.  Since this function can be\n  // called more than once, it has to be idempotent.\n  void PostFlagParsingInit();\n\n  // Gets the random seed used at the start of the current test iteration.\n  int random_seed() const { return random_seed_; }\n\n  // Gets the random number generator.\n  internal::Random* random() { return &random_; }\n\n  // Shuffles all test cases, and the tests within each test case,\n  // making sure that death tests are still run first.\n  void ShuffleTests();\n\n  // Restores the test cases and tests to their order before the first shuffle.\n  void UnshuffleTests();\n\n  // Returns the value of GTEST_FLAG(catch_exceptions) at the moment\n  // UnitTest::Run() starts.\n  bool catch_exceptions() const { return catch_exceptions_; }\n\n private:\n  friend class ::testing::UnitTest;\n\n  // Used by UnitTest::Run() to capture the state of\n  // GTEST_FLAG(catch_exceptions) at the moment it starts.\n  void set_catch_exceptions(bool value) { catch_exceptions_ = value; }\n\n  // The UnitTest object that owns this implementation object.\n  UnitTest* const parent_;\n\n  // The working directory when the first TEST() or TEST_F() was\n  // executed.\n  internal::FilePath original_working_dir_;\n\n  // The default test part result reporters.\n  DefaultGlobalTestPartResultReporter default_global_test_part_result_reporter_;\n  DefaultPerThreadTestPartResultReporter\n      default_per_thread_test_part_result_reporter_;\n\n  // Points to (but doesn't own) the global test part result reporter.\n  TestPartResultReporterInterface* global_test_part_result_repoter_;\n\n  // Protects read and write access to global_test_part_result_reporter_.\n  internal::Mutex global_test_part_result_reporter_mutex_;\n\n  // Points to (but doesn't own) the per-thread test part result reporter.\n  internal::ThreadLocal<TestPartResultReporterInterface*>\n      per_thread_test_part_result_reporter_;\n\n  // The vector of environments that need to be set-up/torn-down\n  // before/after the tests are run.\n  std::vector<Environment*> environments_;\n\n  // The vector of TestCases in their original order.  It owns the\n  // elements in the vector.\n  std::vector<TestCase*> test_cases_;\n\n  // Provides a level of indirection for the test case list to allow\n  // easy shuffling and restoring the test case order.  The i-th\n  // element of this vector is the index of the i-th test case in the\n  // shuffled order.\n  std::vector<int> test_case_indices_;\n\n  // ParameterizedTestRegistry object used to register value-parameterized\n  // tests.\n  internal::ParameterizedTestCaseRegistry parameterized_test_registry_;\n\n  // Indicates whether RegisterParameterizedTests() has been called already.\n  bool parameterized_tests_registered_;\n\n  // Index of the last death test case registered.  Initially -1.\n  int last_death_test_case_;\n\n  // This points to the TestCase for the currently running test.  It\n  // changes as Google Test goes through one test case after another.\n  // When no test is running, this is set to NULL and Google Test\n  // stores assertion results in ad_hoc_test_result_.  Initially NULL.\n  TestCase* current_test_case_;\n\n  // This points to the TestInfo for the currently running test.  It\n  // changes as Google Test goes through one test after another.  When\n  // no test is running, this is set to NULL and Google Test stores\n  // assertion results in ad_hoc_test_result_.  Initially NULL.\n  TestInfo* current_test_info_;\n\n  // Normally, a user only writes assertions inside a TEST or TEST_F,\n  // or inside a function called by a TEST or TEST_F.  Since Google\n  // Test keeps track of which test is current running, it can\n  // associate such an assertion with the test it belongs to.\n  //\n  // If an assertion is encountered when no TEST or TEST_F is running,\n  // Google Test attributes the assertion result to an imaginary \"ad hoc\"\n  // test, and records the result in ad_hoc_test_result_.\n  TestResult ad_hoc_test_result_;\n\n  // The list of event listeners that can be used to track events inside\n  // Google Test.\n  TestEventListeners listeners_;\n\n  // The OS stack trace getter.  Will be deleted when the UnitTest\n  // object is destructed.  By default, an OsStackTraceGetter is used,\n  // but the user can set this field to use a custom getter if that is\n  // desired.\n  OsStackTraceGetterInterface* os_stack_trace_getter_;\n\n  // True iff PostFlagParsingInit() has been called.\n  bool post_flag_parse_init_performed_;\n\n  // The random number seed used at the beginning of the test run.\n  int random_seed_;\n\n  // Our random number generator.\n  internal::Random random_;\n\n  // The time of the test program start, in ms from the start of the\n  // UNIX epoch.\n  TimeInMillis start_timestamp_;\n\n  // How long the test took to run, in milliseconds.\n  TimeInMillis elapsed_time_;\n\n#if GTEST_HAS_DEATH_TEST\n  // The decomposed components of the gtest_internal_run_death_test flag,\n  // parsed when RUN_ALL_TESTS is called.\n  internal::scoped_ptr<InternalRunDeathTestFlag> internal_run_death_test_flag_;\n  internal::scoped_ptr<internal::DeathTestFactory> death_test_factory_;\n#endif  // GTEST_HAS_DEATH_TEST\n\n  // A per-thread stack of traces created by the SCOPED_TRACE() macro.\n  internal::ThreadLocal<std::vector<TraceInfo> > gtest_trace_stack_;\n\n  // The value of GTEST_FLAG(catch_exceptions) at the moment RunAllTests()\n  // starts.\n  bool catch_exceptions_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTestImpl);\n};  // class UnitTestImpl\n\n// Convenience function for accessing the global UnitTest\n// implementation object.\ninline UnitTestImpl* GetUnitTestImpl() {\n  return UnitTest::GetInstance()->impl();\n}\n\n#if GTEST_USES_SIMPLE_RE\n\n// Internal helper functions for implementing the simple regular\n// expression matcher.\nGTEST_API_ bool IsInSet(char ch, const char* str);\nGTEST_API_ bool IsAsciiDigit(char ch);\nGTEST_API_ bool IsAsciiPunct(char ch);\nGTEST_API_ bool IsRepeat(char ch);\nGTEST_API_ bool IsAsciiWhiteSpace(char ch);\nGTEST_API_ bool IsAsciiWordChar(char ch);\nGTEST_API_ bool IsValidEscape(char ch);\nGTEST_API_ bool AtomMatchesChar(bool escaped, char pattern, char ch);\nGTEST_API_ bool ValidateRegex(const char* regex);\nGTEST_API_ bool MatchRegexAtHead(const char* regex, const char* str);\nGTEST_API_ bool MatchRepetitionAndRegexAtHead(\n    bool escaped, char ch, char repeat, const char* regex, const char* str);\nGTEST_API_ bool MatchRegexAnywhere(const char* regex, const char* str);\n\n#endif  // GTEST_USES_SIMPLE_RE\n\n// Parses the command line for Google Test flags, without initializing\n// other parts of Google Test.\nGTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, char** argv);\nGTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv);\n\n#if GTEST_HAS_DEATH_TEST\n\n// Returns the message describing the last system error, regardless of the\n// platform.\nGTEST_API_ std::string GetLastErrnoDescription();\n\n// Attempts to parse a string into a positive integer pointed to by the\n// number parameter.  Returns true if that is possible.\n// GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we can use\n// it here.\ntemplate <typename Integer>\nbool ParseNaturalNumber(const ::std::string& str, Integer* number) {\n  // Fail fast if the given string does not begin with a digit;\n  // this bypasses strtoXXX's \"optional leading whitespace and plus\n  // or minus sign\" semantics, which are undesirable here.\n  if (str.empty() || !IsDigit(str[0])) {\n    return false;\n  }\n  errno = 0;\n\n  char* end;\n  // BiggestConvertible is the largest integer type that system-provided\n  // string-to-number conversion routines can return.\n\n# if GTEST_OS_WINDOWS && !defined(__GNUC__)\n\n  // MSVC and C++ Builder define __int64 instead of the standard long long.\n  typedef unsigned __int64 BiggestConvertible;\n  const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10);\n\n# else\n\n  typedef unsigned long long BiggestConvertible;  // NOLINT\n  const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10);\n\n# endif  // GTEST_OS_WINDOWS && !defined(__GNUC__)\n\n  const bool parse_success = *end == '\\0' && errno == 0;\n\n  // FIXME: Convert this to compile time assertion when it is\n  // available.\n  GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed));\n\n  const Integer result = static_cast<Integer>(parsed);\n  if (parse_success && static_cast<BiggestConvertible>(result) == parsed) {\n    *number = result;\n    return true;\n  }\n  return false;\n}\n#endif  // GTEST_HAS_DEATH_TEST\n\n// TestResult contains some private methods that should be hidden from\n// Google Test user but are required for testing. This class allow our tests\n// to access them.\n//\n// This class is supplied only for the purpose of testing Google Test's own\n// constructs. Do not use it in user tests, either directly or indirectly.\nclass TestResultAccessor {\n public:\n  static void RecordProperty(TestResult* test_result,\n                             const std::string& xml_element,\n                             const TestProperty& property) {\n    test_result->RecordProperty(xml_element, property);\n  }\n\n  static void ClearTestPartResults(TestResult* test_result) {\n    test_result->ClearTestPartResults();\n  }\n\n  static const std::vector<testing::TestPartResult>& test_part_results(\n      const TestResult& test_result) {\n    return test_result.test_part_results();\n  }\n};\n\n#if GTEST_CAN_STREAM_RESULTS_\n\n// Streams test results to the given port on the given host machine.\nclass StreamingListener : public EmptyTestEventListener {\n public:\n  // Abstract base class for writing strings to a socket.\n  class AbstractSocketWriter {\n   public:\n    virtual ~AbstractSocketWriter() {}\n\n    // Sends a string to the socket.\n    virtual void Send(const std::string& message) = 0;\n\n    // Closes the socket.\n    virtual void CloseConnection() {}\n\n    // Sends a string and a newline to the socket.\n    void SendLn(const std::string& message) { Send(message + \"\\n\"); }\n  };\n\n  // Concrete class for actually writing strings to a socket.\n  class SocketWriter : public AbstractSocketWriter {\n   public:\n    SocketWriter(const std::string& host, const std::string& port)\n        : sockfd_(-1), host_name_(host), port_num_(port) {\n      MakeConnection();\n    }\n\n    virtual ~SocketWriter() {\n      if (sockfd_ != -1)\n        CloseConnection();\n    }\n\n    // Sends a string to the socket.\n    virtual void Send(const std::string& message) {\n      GTEST_CHECK_(sockfd_ != -1)\n          << \"Send() can be called only when there is a connection.\";\n\n      const int len = static_cast<int>(message.length());\n      if (write(sockfd_, message.c_str(), len) != len) {\n        GTEST_LOG_(WARNING)\n            << \"stream_result_to: failed to stream to \"\n            << host_name_ << \":\" << port_num_;\n      }\n    }\n\n   private:\n    // Creates a client socket and connects to the server.\n    void MakeConnection();\n\n    // Closes the socket.\n    void CloseConnection() {\n      GTEST_CHECK_(sockfd_ != -1)\n          << \"CloseConnection() can be called only when there is a connection.\";\n\n      close(sockfd_);\n      sockfd_ = -1;\n    }\n\n    int sockfd_;  // socket file descriptor\n    const std::string host_name_;\n    const std::string port_num_;\n\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(SocketWriter);\n  };  // class SocketWriter\n\n  // Escapes '=', '&', '%', and '\\n' characters in str as \"%xx\".\n  static std::string UrlEncode(const char* str);\n\n  StreamingListener(const std::string& host, const std::string& port)\n      : socket_writer_(new SocketWriter(host, port)) {\n    Start();\n  }\n\n  explicit StreamingListener(AbstractSocketWriter* socket_writer)\n      : socket_writer_(socket_writer) { Start(); }\n\n  void OnTestProgramStart(const UnitTest& /* unit_test */) {\n    SendLn(\"event=TestProgramStart\");\n  }\n\n  void OnTestProgramEnd(const UnitTest& unit_test) {\n    // Note that Google Test current only report elapsed time for each\n    // test iteration, not for the entire test program.\n    SendLn(\"event=TestProgramEnd&passed=\" + FormatBool(unit_test.Passed()));\n\n    // Notify the streaming server to stop.\n    socket_writer_->CloseConnection();\n  }\n\n  void OnTestIterationStart(const UnitTest& /* unit_test */, int iteration) {\n    SendLn(\"event=TestIterationStart&iteration=\" +\n           StreamableToString(iteration));\n  }\n\n  void OnTestIterationEnd(const UnitTest& unit_test, int /* iteration */) {\n    SendLn(\"event=TestIterationEnd&passed=\" +\n           FormatBool(unit_test.Passed()) + \"&elapsed_time=\" +\n           StreamableToString(unit_test.elapsed_time()) + \"ms\");\n  }\n\n  void OnTestCaseStart(const TestCase& test_case) {\n    SendLn(std::string(\"event=TestCaseStart&name=\") + test_case.name());\n  }\n\n  void OnTestCaseEnd(const TestCase& test_case) {\n    SendLn(\"event=TestCaseEnd&passed=\" + FormatBool(test_case.Passed())\n           + \"&elapsed_time=\" + StreamableToString(test_case.elapsed_time())\n           + \"ms\");\n  }\n\n  void OnTestStart(const TestInfo& test_info) {\n    SendLn(std::string(\"event=TestStart&name=\") + test_info.name());\n  }\n\n  void OnTestEnd(const TestInfo& test_info) {\n    SendLn(\"event=TestEnd&passed=\" +\n           FormatBool((test_info.result())->Passed()) +\n           \"&elapsed_time=\" +\n           StreamableToString((test_info.result())->elapsed_time()) + \"ms\");\n  }\n\n  void OnTestPartResult(const TestPartResult& test_part_result) {\n    const char* file_name = test_part_result.file_name();\n    if (file_name == NULL)\n      file_name = \"\";\n    SendLn(\"event=TestPartResult&file=\" + UrlEncode(file_name) +\n           \"&line=\" + StreamableToString(test_part_result.line_number()) +\n           \"&message=\" + UrlEncode(test_part_result.message()));\n  }\n\n private:\n  // Sends the given message and a newline to the socket.\n  void SendLn(const std::string& message) { socket_writer_->SendLn(message); }\n\n  // Called at the start of streaming to notify the receiver what\n  // protocol we are using.\n  void Start() { SendLn(\"gtest_streaming_protocol_version=1.0\"); }\n\n  std::string FormatBool(bool value) { return value ? \"1\" : \"0\"; }\n\n  const scoped_ptr<AbstractSocketWriter> socket_writer_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamingListener);\n};  // class StreamingListener\n\n#endif  // GTEST_CAN_STREAM_RESULTS_\n\n}  // namespace internal\n}  // namespace testing\n\nGTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251\n\n#endif  // GTEST_SRC_GTEST_INTERNAL_INL_H_\n\n#if GTEST_OS_WINDOWS\n# define vsnprintf _vsnprintf\n#endif  // GTEST_OS_WINDOWS\n\n#if GTEST_OS_MAC\n#ifndef GTEST_OS_IOS\n#include <crt_externs.h>\n#endif\n#endif\n\n#if GTEST_HAS_ABSL\n#include \"absl/debugging/failure_signal_handler.h\"\n#include \"absl/debugging/stacktrace.h\"\n#include \"absl/debugging/symbolize.h\"\n#include \"absl/strings/str_cat.h\"\n#endif  // GTEST_HAS_ABSL\n\nnamespace testing {\n\nusing internal::CountIf;\nusing internal::ForEach;\nusing internal::GetElementOr;\nusing internal::Shuffle;\n\n// Constants.\n\n// A test whose test case name or test name matches this filter is\n// disabled and not run.\nstatic const char kDisableTestFilter[] = \"DISABLED_*:*/DISABLED_*\";\n\n// A test case whose name matches this filter is considered a death\n// test case and will be run before test cases whose name doesn't\n// match this filter.\nstatic const char kDeathTestCaseFilter[] = \"*DeathTest:*DeathTest/*\";\n\n// A test filter that matches everything.\nstatic const char kUniversalFilter[] = \"*\";\n\n// The default output format.\nstatic const char kDefaultOutputFormat[] = \"xml\";\n// The default output file.\nstatic const char kDefaultOutputFile[] = \"test_detail\";\n\n// The environment variable name for the test shard index.\nstatic const char kTestShardIndex[] = \"GTEST_SHARD_INDEX\";\n// The environment variable name for the total number of test shards.\nstatic const char kTestTotalShards[] = \"GTEST_TOTAL_SHARDS\";\n// The environment variable name for the test shard status file.\nstatic const char kTestShardStatusFile[] = \"GTEST_SHARD_STATUS_FILE\";\n\nnamespace internal {\n\n// The text used in failure messages to indicate the start of the\n// stack trace.\nconst char kStackTraceMarker[] = \"\\nStack trace:\\n\";\n\n// g_help_flag is true iff the --help flag or an equivalent form is\n// specified on the command line.\nbool g_help_flag = false;\n\n// Utilty function to Open File for Writing\nstatic FILE* OpenFileForWriting(const std::string& output_file) {\n  FILE* fileout = NULL;\n  FilePath output_file_path(output_file);\n  FilePath output_dir(output_file_path.RemoveFileName());\n\n  if (output_dir.CreateDirectoriesRecursively()) {\n    fileout = posix::FOpen(output_file.c_str(), \"w\");\n  }\n  if (fileout == NULL) {\n    GTEST_LOG_(FATAL) << \"Unable to open file \\\"\" << output_file << \"\\\"\";\n  }\n  return fileout;\n}\n\n}  // namespace internal\n\n// Bazel passes in the argument to '--test_filter' via the TESTBRIDGE_TEST_ONLY\n// environment variable.\nstatic const char* GetDefaultFilter() {\n  const char* const testbridge_test_only =\n      internal::posix::GetEnv(\"TESTBRIDGE_TEST_ONLY\");\n  if (testbridge_test_only != NULL) {\n    return testbridge_test_only;\n  }\n  return kUniversalFilter;\n}\n\nGTEST_DEFINE_bool_(\n    also_run_disabled_tests,\n    internal::BoolFromGTestEnv(\"also_run_disabled_tests\", false),\n    \"Run disabled tests too, in addition to the tests normally being run.\");\n\nGTEST_DEFINE_bool_(\n    break_on_failure,\n    internal::BoolFromGTestEnv(\"break_on_failure\", false),\n    \"True iff a failed assertion should be a debugger break-point.\");\n\nGTEST_DEFINE_bool_(\n    catch_exceptions,\n    internal::BoolFromGTestEnv(\"catch_exceptions\", true),\n    \"True iff \" GTEST_NAME_\n    \" should catch exceptions and treat them as test failures.\");\n\nGTEST_DEFINE_string_(\n    color,\n    internal::StringFromGTestEnv(\"color\", \"auto\"),\n    \"Whether to use colors in the output.  Valid values: yes, no, \"\n    \"and auto.  'auto' means to use colors if the output is \"\n    \"being sent to a terminal and the TERM environment variable \"\n    \"is set to a terminal type that supports colors.\");\n\nGTEST_DEFINE_string_(\n    filter,\n    internal::StringFromGTestEnv(\"filter\", GetDefaultFilter()),\n    \"A colon-separated list of glob (not regex) patterns \"\n    \"for filtering the tests to run, optionally followed by a \"\n    \"'-' and a : separated list of negative patterns (tests to \"\n    \"exclude).  A test is run if it matches one of the positive \"\n    \"patterns and does not match any of the negative patterns.\");\n\nGTEST_DEFINE_bool_(\n    install_failure_signal_handler,\n    internal::BoolFromGTestEnv(\"install_failure_signal_handler\", false),\n    \"If true and supported on the current platform, \" GTEST_NAME_ \" should \"\n    \"install a signal handler that dumps debugging information when fatal \"\n    \"signals are raised.\");\n\nGTEST_DEFINE_bool_(list_tests, false,\n                   \"List all tests without running them.\");\n\n// The net priority order after flag processing is thus:\n//   --gtest_output command line flag\n//   GTEST_OUTPUT environment variable\n//   XML_OUTPUT_FILE environment variable\n//   ''\nGTEST_DEFINE_string_(\n    output,\n    internal::StringFromGTestEnv(\"output\",\n      internal::OutputFlagAlsoCheckEnvVar().c_str()),\n    \"A format (defaults to \\\"xml\\\" but can be specified to be \\\"json\\\"), \"\n    \"optionally followed by a colon and an output file name or directory. \"\n    \"A directory is indicated by a trailing pathname separator. \"\n    \"Examples: \\\"xml:filename.xml\\\", \\\"xml::directoryname/\\\". \"\n    \"If a directory is specified, output files will be created \"\n    \"within that directory, with file-names based on the test \"\n    \"executable's name and, if necessary, made unique by adding \"\n    \"digits.\");\n\nGTEST_DEFINE_bool_(\n    print_time,\n    internal::BoolFromGTestEnv(\"print_time\", true),\n    \"True iff \" GTEST_NAME_\n    \" should display elapsed time in text output.\");\n\nGTEST_DEFINE_bool_(\n    print_utf8,\n    internal::BoolFromGTestEnv(\"print_utf8\", true),\n    \"True iff \" GTEST_NAME_\n    \" prints UTF8 characters as text.\");\n\nGTEST_DEFINE_int32_(\n    random_seed,\n    internal::Int32FromGTestEnv(\"random_seed\", 0),\n    \"Random number seed to use when shuffling test orders.  Must be in range \"\n    \"[1, 99999], or 0 to use a seed based on the current time.\");\n\nGTEST_DEFINE_int32_(\n    repeat,\n    internal::Int32FromGTestEnv(\"repeat\", 1),\n    \"How many times to repeat each test.  Specify a negative number \"\n    \"for repeating forever.  Useful for shaking out flaky tests.\");\n\nGTEST_DEFINE_bool_(\n    show_internal_stack_frames, false,\n    \"True iff \" GTEST_NAME_ \" should include internal stack frames when \"\n    \"printing test failure stack traces.\");\n\nGTEST_DEFINE_bool_(\n    shuffle,\n    internal::BoolFromGTestEnv(\"shuffle\", false),\n    \"True iff \" GTEST_NAME_\n    \" should randomize tests' order on every run.\");\n\nGTEST_DEFINE_int32_(\n    stack_trace_depth,\n    internal::Int32FromGTestEnv(\"stack_trace_depth\", kMaxStackTraceDepth),\n    \"The maximum number of stack frames to print when an \"\n    \"assertion fails.  The valid range is 0 through 100, inclusive.\");\n\nGTEST_DEFINE_string_(\n    stream_result_to,\n    internal::StringFromGTestEnv(\"stream_result_to\", \"\"),\n    \"This flag specifies the host name and the port number on which to stream \"\n    \"test results. Example: \\\"localhost:555\\\". The flag is effective only on \"\n    \"Linux.\");\n\nGTEST_DEFINE_bool_(\n    throw_on_failure,\n    internal::BoolFromGTestEnv(\"throw_on_failure\", false),\n    \"When this flag is specified, a failed assertion will throw an exception \"\n    \"if exceptions are enabled or exit the program with a non-zero code \"\n    \"otherwise. For use with an external test framework.\");\n\n#if GTEST_USE_OWN_FLAGFILE_FLAG_\nGTEST_DEFINE_string_(\n    flagfile,\n    internal::StringFromGTestEnv(\"flagfile\", \"\"),\n    \"This flag specifies the flagfile to read command-line flags from.\");\n#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_\n\nnamespace internal {\n\n// Generates a random number from [0, range), using a Linear\n// Congruential Generator (LCG).  Crashes if 'range' is 0 or greater\n// than kMaxRange.\nUInt32 Random::Generate(UInt32 range) {\n  // These constants are the same as are used in glibc's rand(3).\n  // Use wider types than necessary to prevent unsigned overflow diagnostics.\n  state_ = static_cast<UInt32>(1103515245ULL*state_ + 12345U) % kMaxRange;\n\n  GTEST_CHECK_(range > 0)\n      << \"Cannot generate a number in the range [0, 0).\";\n  GTEST_CHECK_(range <= kMaxRange)\n      << \"Generation of a number in [0, \" << range << \") was requested, \"\n      << \"but this can only generate numbers in [0, \" << kMaxRange << \").\";\n\n  // Converting via modulus introduces a bit of downward bias, but\n  // it's simple, and a linear congruential generator isn't too good\n  // to begin with.\n  return state_ % range;\n}\n\n// GTestIsInitialized() returns true iff the user has initialized\n// Google Test.  Useful for catching the user mistake of not initializing\n// Google Test before calling RUN_ALL_TESTS().\nstatic bool GTestIsInitialized() { return GetArgvs().size() > 0; }\n\n// Iterates over a vector of TestCases, keeping a running sum of the\n// results of calling a given int-returning method on each.\n// Returns the sum.\nstatic int SumOverTestCaseList(const std::vector<TestCase*>& case_list,\n                               int (TestCase::*method)() const) {\n  int sum = 0;\n  for (size_t i = 0; i < case_list.size(); i++) {\n    sum += (case_list[i]->*method)();\n  }\n  return sum;\n}\n\n// Returns true iff the test case passed.\nstatic bool TestCasePassed(const TestCase* test_case) {\n  return test_case->should_run() && test_case->Passed();\n}\n\n// Returns true iff the test case failed.\nstatic bool TestCaseFailed(const TestCase* test_case) {\n  return test_case->should_run() && test_case->Failed();\n}\n\n// Returns true iff test_case contains at least one test that should\n// run.\nstatic bool ShouldRunTestCase(const TestCase* test_case) {\n  return test_case->should_run();\n}\n\n// AssertHelper constructor.\nAssertHelper::AssertHelper(TestPartResult::Type type,\n                           const char* file,\n                           int line,\n                           const char* message)\n    : data_(new AssertHelperData(type, file, line, message)) {\n}\n\nAssertHelper::~AssertHelper() {\n  delete data_;\n}\n\n// Message assignment, for assertion streaming support.\nvoid AssertHelper::operator=(const Message& message) const {\n  UnitTest::GetInstance()->\n    AddTestPartResult(data_->type, data_->file, data_->line,\n                      AppendUserMessage(data_->message, message),\n                      UnitTest::GetInstance()->impl()\n                      ->CurrentOsStackTraceExceptTop(1)\n                      // Skips the stack frame for this function itself.\n                      );  // NOLINT\n}\n\n// Mutex for linked pointers.\nGTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_linked_ptr_mutex);\n\n// A copy of all command line arguments.  Set by InitGoogleTest().\nstatic ::std::vector<std::string> g_argvs;\n\n::std::vector<std::string> GetArgvs() {\n#if defined(GTEST_CUSTOM_GET_ARGVS_)\n  // GTEST_CUSTOM_GET_ARGVS_() may return a container of std::string or\n  // ::string. This code converts it to the appropriate type.\n  const auto& custom = GTEST_CUSTOM_GET_ARGVS_();\n  return ::std::vector<std::string>(custom.begin(), custom.end());\n#else   // defined(GTEST_CUSTOM_GET_ARGVS_)\n  return g_argvs;\n#endif  // defined(GTEST_CUSTOM_GET_ARGVS_)\n}\n\n// Returns the current application's name, removing directory path if that\n// is present.\nFilePath GetCurrentExecutableName() {\n  FilePath result;\n\n#if GTEST_OS_WINDOWS\n  result.Set(FilePath(GetArgvs()[0]).RemoveExtension(\"exe\"));\n#else\n  result.Set(FilePath(GetArgvs()[0]));\n#endif  // GTEST_OS_WINDOWS\n\n  return result.RemoveDirectoryName();\n}\n\n// Functions for processing the gtest_output flag.\n\n// Returns the output format, or \"\" for normal printed output.\nstd::string UnitTestOptions::GetOutputFormat() {\n  const char* const gtest_output_flag = GTEST_FLAG(output).c_str();\n  const char* const colon = strchr(gtest_output_flag, ':');\n  return (colon == NULL) ?\n      std::string(gtest_output_flag) :\n      std::string(gtest_output_flag, colon - gtest_output_flag);\n}\n\n// Returns the name of the requested output file, or the default if none\n// was explicitly specified.\nstd::string UnitTestOptions::GetAbsolutePathToOutputFile() {\n  const char* const gtest_output_flag = GTEST_FLAG(output).c_str();\n\n  std::string format = GetOutputFormat();\n  if (format.empty())\n    format = std::string(kDefaultOutputFormat);\n\n  const char* const colon = strchr(gtest_output_flag, ':');\n  if (colon == NULL)\n    return internal::FilePath::MakeFileName(\n        internal::FilePath(\n            UnitTest::GetInstance()->original_working_dir()),\n        internal::FilePath(kDefaultOutputFile), 0,\n        format.c_str()).string();\n\n  internal::FilePath output_name(colon + 1);\n  if (!output_name.IsAbsolutePath())\n    // FIXME: on Windows \\some\\path is not an absolute\n    // path (as its meaning depends on the current drive), yet the\n    // following logic for turning it into an absolute path is wrong.\n    // Fix it.\n    output_name = internal::FilePath::ConcatPaths(\n        internal::FilePath(UnitTest::GetInstance()->original_working_dir()),\n        internal::FilePath(colon + 1));\n\n  if (!output_name.IsDirectory())\n    return output_name.string();\n\n  internal::FilePath result(internal::FilePath::GenerateUniqueFileName(\n      output_name, internal::GetCurrentExecutableName(),\n      GetOutputFormat().c_str()));\n  return result.string();\n}\n\n// Returns true iff the wildcard pattern matches the string.  The\n// first ':' or '\\0' character in pattern marks the end of it.\n//\n// This recursive algorithm isn't very efficient, but is clear and\n// works well enough for matching test names, which are short.\nbool UnitTestOptions::PatternMatchesString(const char *pattern,\n                                           const char *str) {\n  switch (*pattern) {\n    case '\\0':\n    case ':':  // Either ':' or '\\0' marks the end of the pattern.\n      return *str == '\\0';\n    case '?':  // Matches any single character.\n      return *str != '\\0' && PatternMatchesString(pattern + 1, str + 1);\n    case '*':  // Matches any string (possibly empty) of characters.\n      return (*str != '\\0' && PatternMatchesString(pattern, str + 1)) ||\n          PatternMatchesString(pattern + 1, str);\n    default:  // Non-special character.  Matches itself.\n      return *pattern == *str &&\n          PatternMatchesString(pattern + 1, str + 1);\n  }\n}\n\nbool UnitTestOptions::MatchesFilter(\n    const std::string& name, const char* filter) {\n  const char *cur_pattern = filter;\n  for (;;) {\n    if (PatternMatchesString(cur_pattern, name.c_str())) {\n      return true;\n    }\n\n    // Finds the next pattern in the filter.\n    cur_pattern = strchr(cur_pattern, ':');\n\n    // Returns if no more pattern can be found.\n    if (cur_pattern == NULL) {\n      return false;\n    }\n\n    // Skips the pattern separater (the ':' character).\n    cur_pattern++;\n  }\n}\n\n// Returns true iff the user-specified filter matches the test case\n// name and the test name.\nbool UnitTestOptions::FilterMatchesTest(const std::string &test_case_name,\n                                        const std::string &test_name) {\n  const std::string& full_name = test_case_name + \".\" + test_name.c_str();\n\n  // Split --gtest_filter at '-', if there is one, to separate into\n  // positive filter and negative filter portions\n  const char* const p = GTEST_FLAG(filter).c_str();\n  const char* const dash = strchr(p, '-');\n  std::string positive;\n  std::string negative;\n  if (dash == NULL) {\n    positive = GTEST_FLAG(filter).c_str();  // Whole string is a positive filter\n    negative = \"\";\n  } else {\n    positive = std::string(p, dash);   // Everything up to the dash\n    negative = std::string(dash + 1);  // Everything after the dash\n    if (positive.empty()) {\n      // Treat '-test1' as the same as '*-test1'\n      positive = kUniversalFilter;\n    }\n  }\n\n  // A filter is a colon-separated list of patterns.  It matches a\n  // test if any pattern in it matches the test.\n  return (MatchesFilter(full_name, positive.c_str()) &&\n          !MatchesFilter(full_name, negative.c_str()));\n}\n\n#if GTEST_HAS_SEH\n// Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the\n// given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.\n// This function is useful as an __except condition.\nint UnitTestOptions::GTestShouldProcessSEH(DWORD exception_code) {\n  // Google Test should handle a SEH exception if:\n  //   1. the user wants it to, AND\n  //   2. this is not a breakpoint exception, AND\n  //   3. this is not a C++ exception (VC++ implements them via SEH,\n  //      apparently).\n  //\n  // SEH exception code for C++ exceptions.\n  // (see http://support.microsoft.com/kb/185294 for more information).\n  const DWORD kCxxExceptionCode = 0xe06d7363;\n\n  bool should_handle = true;\n\n  if (!GTEST_FLAG(catch_exceptions))\n    should_handle = false;\n  else if (exception_code == EXCEPTION_BREAKPOINT)\n    should_handle = false;\n  else if (exception_code == kCxxExceptionCode)\n    should_handle = false;\n\n  return should_handle ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH;\n}\n#endif  // GTEST_HAS_SEH\n\n}  // namespace internal\n\n// The c'tor sets this object as the test part result reporter used by\n// Google Test.  The 'result' parameter specifies where to report the\n// results. Intercepts only failures from the current thread.\nScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(\n    TestPartResultArray* result)\n    : intercept_mode_(INTERCEPT_ONLY_CURRENT_THREAD),\n      result_(result) {\n  Init();\n}\n\n// The c'tor sets this object as the test part result reporter used by\n// Google Test.  The 'result' parameter specifies where to report the\n// results.\nScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(\n    InterceptMode intercept_mode, TestPartResultArray* result)\n    : intercept_mode_(intercept_mode),\n      result_(result) {\n  Init();\n}\n\nvoid ScopedFakeTestPartResultReporter::Init() {\n  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();\n  if (intercept_mode_ == INTERCEPT_ALL_THREADS) {\n    old_reporter_ = impl->GetGlobalTestPartResultReporter();\n    impl->SetGlobalTestPartResultReporter(this);\n  } else {\n    old_reporter_ = impl->GetTestPartResultReporterForCurrentThread();\n    impl->SetTestPartResultReporterForCurrentThread(this);\n  }\n}\n\n// The d'tor restores the test part result reporter used by Google Test\n// before.\nScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter() {\n  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();\n  if (intercept_mode_ == INTERCEPT_ALL_THREADS) {\n    impl->SetGlobalTestPartResultReporter(old_reporter_);\n  } else {\n    impl->SetTestPartResultReporterForCurrentThread(old_reporter_);\n  }\n}\n\n// Increments the test part result count and remembers the result.\n// This method is from the TestPartResultReporterInterface interface.\nvoid ScopedFakeTestPartResultReporter::ReportTestPartResult(\n    const TestPartResult& result) {\n  result_->Append(result);\n}\n\nnamespace internal {\n\n// Returns the type ID of ::testing::Test.  We should always call this\n// instead of GetTypeId< ::testing::Test>() to get the type ID of\n// testing::Test.  This is to work around a suspected linker bug when\n// using Google Test as a framework on Mac OS X.  The bug causes\n// GetTypeId< ::testing::Test>() to return different values depending\n// on whether the call is from the Google Test framework itself or\n// from user test code.  GetTestTypeId() is guaranteed to always\n// return the same value, as it always calls GetTypeId<>() from the\n// gtest.cc, which is within the Google Test framework.\nTypeId GetTestTypeId() {\n  return GetTypeId<Test>();\n}\n\n// The value of GetTestTypeId() as seen from within the Google Test\n// library.  This is solely for testing GetTestTypeId().\nextern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId();\n\n// This predicate-formatter checks that 'results' contains a test part\n// failure of the given type and that the failure message contains the\n// given substring.\nstatic AssertionResult HasOneFailure(const char* /* results_expr */,\n                                     const char* /* type_expr */,\n                                     const char* /* substr_expr */,\n                                     const TestPartResultArray& results,\n                                     TestPartResult::Type type,\n                                     const std::string& substr) {\n  const std::string expected(type == TestPartResult::kFatalFailure ?\n                        \"1 fatal failure\" :\n                        \"1 non-fatal failure\");\n  Message msg;\n  if (results.size() != 1) {\n    msg << \"Expected: \" << expected << \"\\n\"\n        << \"  Actual: \" << results.size() << \" failures\";\n    for (int i = 0; i < results.size(); i++) {\n      msg << \"\\n\" << results.GetTestPartResult(i);\n    }\n    return AssertionFailure() << msg;\n  }\n\n  const TestPartResult& r = results.GetTestPartResult(0);\n  if (r.type() != type) {\n    return AssertionFailure() << \"Expected: \" << expected << \"\\n\"\n                              << \"  Actual:\\n\"\n                              << r;\n  }\n\n  if (strstr(r.message(), substr.c_str()) == NULL) {\n    return AssertionFailure() << \"Expected: \" << expected << \" containing \\\"\"\n                              << substr << \"\\\"\\n\"\n                              << \"  Actual:\\n\"\n                              << r;\n  }\n\n  return AssertionSuccess();\n}\n\n// The constructor of SingleFailureChecker remembers where to look up\n// test part results, what type of failure we expect, and what\n// substring the failure message should contain.\nSingleFailureChecker::SingleFailureChecker(const TestPartResultArray* results,\n                                           TestPartResult::Type type,\n                                           const std::string& substr)\n    : results_(results), type_(type), substr_(substr) {}\n\n// The destructor of SingleFailureChecker verifies that the given\n// TestPartResultArray contains exactly one failure that has the given\n// type and contains the given substring.  If that's not the case, a\n// non-fatal failure will be generated.\nSingleFailureChecker::~SingleFailureChecker() {\n  EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_);\n}\n\nDefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(\n    UnitTestImpl* unit_test) : unit_test_(unit_test) {}\n\nvoid DefaultGlobalTestPartResultReporter::ReportTestPartResult(\n    const TestPartResult& result) {\n  unit_test_->current_test_result()->AddTestPartResult(result);\n  unit_test_->listeners()->repeater()->OnTestPartResult(result);\n}\n\nDefaultPerThreadTestPartResultReporter::DefaultPerThreadTestPartResultReporter(\n    UnitTestImpl* unit_test) : unit_test_(unit_test) {}\n\nvoid DefaultPerThreadTestPartResultReporter::ReportTestPartResult(\n    const TestPartResult& result) {\n  unit_test_->GetGlobalTestPartResultReporter()->ReportTestPartResult(result);\n}\n\n// Returns the global test part result reporter.\nTestPartResultReporterInterface*\nUnitTestImpl::GetGlobalTestPartResultReporter() {\n  internal::MutexLock lock(&global_test_part_result_reporter_mutex_);\n  return global_test_part_result_repoter_;\n}\n\n// Sets the global test part result reporter.\nvoid UnitTestImpl::SetGlobalTestPartResultReporter(\n    TestPartResultReporterInterface* reporter) {\n  internal::MutexLock lock(&global_test_part_result_reporter_mutex_);\n  global_test_part_result_repoter_ = reporter;\n}\n\n// Returns the test part result reporter for the current thread.\nTestPartResultReporterInterface*\nUnitTestImpl::GetTestPartResultReporterForCurrentThread() {\n  return per_thread_test_part_result_reporter_.get();\n}\n\n// Sets the test part result reporter for the current thread.\nvoid UnitTestImpl::SetTestPartResultReporterForCurrentThread(\n    TestPartResultReporterInterface* reporter) {\n  per_thread_test_part_result_reporter_.set(reporter);\n}\n\n// Gets the number of successful test cases.\nint UnitTestImpl::successful_test_case_count() const {\n  return CountIf(test_cases_, TestCasePassed);\n}\n\n// Gets the number of failed test cases.\nint UnitTestImpl::failed_test_case_count() const {\n  return CountIf(test_cases_, TestCaseFailed);\n}\n\n// Gets the number of all test cases.\nint UnitTestImpl::total_test_case_count() const {\n  return static_cast<int>(test_cases_.size());\n}\n\n// Gets the number of all test cases that contain at least one test\n// that should run.\nint UnitTestImpl::test_case_to_run_count() const {\n  return CountIf(test_cases_, ShouldRunTestCase);\n}\n\n// Gets the number of successful tests.\nint UnitTestImpl::successful_test_count() const {\n  return SumOverTestCaseList(test_cases_, &TestCase::successful_test_count);\n}\n\n// Gets the number of failed tests.\nint UnitTestImpl::failed_test_count() const {\n  return SumOverTestCaseList(test_cases_, &TestCase::failed_test_count);\n}\n\n// Gets the number of disabled tests that will be reported in the XML report.\nint UnitTestImpl::reportable_disabled_test_count() const {\n  return SumOverTestCaseList(test_cases_,\n                             &TestCase::reportable_disabled_test_count);\n}\n\n// Gets the number of disabled tests.\nint UnitTestImpl::disabled_test_count() const {\n  return SumOverTestCaseList(test_cases_, &TestCase::disabled_test_count);\n}\n\n// Gets the number of tests to be printed in the XML report.\nint UnitTestImpl::reportable_test_count() const {\n  return SumOverTestCaseList(test_cases_, &TestCase::reportable_test_count);\n}\n\n// Gets the number of all tests.\nint UnitTestImpl::total_test_count() const {\n  return SumOverTestCaseList(test_cases_, &TestCase::total_test_count);\n}\n\n// Gets the number of tests that should run.\nint UnitTestImpl::test_to_run_count() const {\n  return SumOverTestCaseList(test_cases_, &TestCase::test_to_run_count);\n}\n\n// Returns the current OS stack trace as an std::string.\n//\n// The maximum number of stack frames to be included is specified by\n// the gtest_stack_trace_depth flag.  The skip_count parameter\n// specifies the number of top frames to be skipped, which doesn't\n// count against the number of frames to be included.\n//\n// For example, if Foo() calls Bar(), which in turn calls\n// CurrentOsStackTraceExceptTop(1), Foo() will be included in the\n// trace but Bar() and CurrentOsStackTraceExceptTop() won't.\nstd::string UnitTestImpl::CurrentOsStackTraceExceptTop(int skip_count) {\n  return os_stack_trace_getter()->CurrentStackTrace(\n      static_cast<int>(GTEST_FLAG(stack_trace_depth)),\n      skip_count + 1\n      // Skips the user-specified number of frames plus this function\n      // itself.\n      );  // NOLINT\n}\n\n// Returns the current time in milliseconds.\nTimeInMillis GetTimeInMillis() {\n#if GTEST_OS_WINDOWS_MOBILE || defined(__BORLANDC__)\n  // Difference between 1970-01-01 and 1601-01-01 in milliseconds.\n  // http://analogous.blogspot.com/2005/04/epoch.html\n  const TimeInMillis kJavaEpochToWinFileTimeDelta =\n    static_cast<TimeInMillis>(116444736UL) * 100000UL;\n  const DWORD kTenthMicrosInMilliSecond = 10000;\n\n  SYSTEMTIME now_systime;\n  FILETIME now_filetime;\n  ULARGE_INTEGER now_int64;\n  // FIXME: Shouldn't this just use\n  //   GetSystemTimeAsFileTime()?\n  GetSystemTime(&now_systime);\n  if (SystemTimeToFileTime(&now_systime, &now_filetime)) {\n    now_int64.LowPart = now_filetime.dwLowDateTime;\n    now_int64.HighPart = now_filetime.dwHighDateTime;\n    now_int64.QuadPart = (now_int64.QuadPart / kTenthMicrosInMilliSecond) -\n      kJavaEpochToWinFileTimeDelta;\n    return now_int64.QuadPart;\n  }\n  return 0;\n#elif GTEST_OS_WINDOWS && !GTEST_HAS_GETTIMEOFDAY_\n  __timeb64 now;\n\n  // MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996\n  // (deprecated function) there.\n  // FIXME: Use GetTickCount()?  Or use\n  //   SystemTimeToFileTime()\n  GTEST_DISABLE_MSC_DEPRECATED_PUSH_()\n  _ftime64(&now);\n  GTEST_DISABLE_MSC_DEPRECATED_POP_()\n\n  return static_cast<TimeInMillis>(now.time) * 1000 + now.millitm;\n#elif GTEST_HAS_GETTIMEOFDAY_\n  struct timeval now;\n  gettimeofday(&now, NULL);\n  return static_cast<TimeInMillis>(now.tv_sec) * 1000 + now.tv_usec / 1000;\n#else\n# error \"Don't know how to get the current time on your system.\"\n#endif\n}\n\n// Utilities\n\n// class String.\n\n#if GTEST_OS_WINDOWS_MOBILE\n// Creates a UTF-16 wide string from the given ANSI string, allocating\n// memory using new. The caller is responsible for deleting the return\n// value using delete[]. Returns the wide string, or NULL if the\n// input is NULL.\nLPCWSTR String::AnsiToUtf16(const char* ansi) {\n  if (!ansi) return NULL;\n  const int length = strlen(ansi);\n  const int unicode_length =\n      MultiByteToWideChar(CP_ACP, 0, ansi, length,\n                          NULL, 0);\n  WCHAR* unicode = new WCHAR[unicode_length + 1];\n  MultiByteToWideChar(CP_ACP, 0, ansi, length,\n                      unicode, unicode_length);\n  unicode[unicode_length] = 0;\n  return unicode;\n}\n\n// Creates an ANSI string from the given wide string, allocating\n// memory using new. The caller is responsible for deleting the return\n// value using delete[]. Returns the ANSI string, or NULL if the\n// input is NULL.\nconst char* String::Utf16ToAnsi(LPCWSTR utf16_str)  {\n  if (!utf16_str) return NULL;\n  const int ansi_length =\n      WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,\n                          NULL, 0, NULL, NULL);\n  char* ansi = new char[ansi_length + 1];\n  WideCharToMultiByte(CP_ACP, 0, utf16_str, -1,\n                      ansi, ansi_length, NULL, NULL);\n  ansi[ansi_length] = 0;\n  return ansi;\n}\n\n#endif  // GTEST_OS_WINDOWS_MOBILE\n\n// Compares two C strings.  Returns true iff they have the same content.\n//\n// Unlike strcmp(), this function can handle NULL argument(s).  A NULL\n// C string is considered different to any non-NULL C string,\n// including the empty string.\nbool String::CStringEquals(const char * lhs, const char * rhs) {\n  if ( lhs == NULL ) return rhs == NULL;\n\n  if ( rhs == NULL ) return false;\n\n  return strcmp(lhs, rhs) == 0;\n}\n\n#if GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING\n\n// Converts an array of wide chars to a narrow string using the UTF-8\n// encoding, and streams the result to the given Message object.\nstatic void StreamWideCharsToMessage(const wchar_t* wstr, size_t length,\n                                     Message* msg) {\n  for (size_t i = 0; i != length; ) {  // NOLINT\n    if (wstr[i] != L'\\0') {\n      *msg << WideStringToUtf8(wstr + i, static_cast<int>(length - i));\n      while (i != length && wstr[i] != L'\\0')\n        i++;\n    } else {\n      *msg << '\\0';\n      i++;\n    }\n  }\n}\n\n#endif  // GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING\n\nvoid SplitString(const ::std::string& str, char delimiter,\n                 ::std::vector< ::std::string>* dest) {\n  ::std::vector< ::std::string> parsed;\n  ::std::string::size_type pos = 0;\n  while (::testing::internal::AlwaysTrue()) {\n    const ::std::string::size_type colon = str.find(delimiter, pos);\n    if (colon == ::std::string::npos) {\n      parsed.push_back(str.substr(pos));\n      break;\n    } else {\n      parsed.push_back(str.substr(pos, colon - pos));\n      pos = colon + 1;\n    }\n  }\n  dest->swap(parsed);\n}\n\n}  // namespace internal\n\n// Constructs an empty Message.\n// We allocate the stringstream separately because otherwise each use of\n// ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's\n// stack frame leading to huge stack frames in some cases; gcc does not reuse\n// the stack space.\nMessage::Message() : ss_(new ::std::stringstream) {\n  // By default, we want there to be enough precision when printing\n  // a double to a Message.\n  *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);\n}\n\n// These two overloads allow streaming a wide C string to a Message\n// using the UTF-8 encoding.\nMessage& Message::operator <<(const wchar_t* wide_c_str) {\n  return *this << internal::String::ShowWideCString(wide_c_str);\n}\nMessage& Message::operator <<(wchar_t* wide_c_str) {\n  return *this << internal::String::ShowWideCString(wide_c_str);\n}\n\n#if GTEST_HAS_STD_WSTRING\n// Converts the given wide string to a narrow string using the UTF-8\n// encoding, and streams the result to this Message object.\nMessage& Message::operator <<(const ::std::wstring& wstr) {\n  internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);\n  return *this;\n}\n#endif  // GTEST_HAS_STD_WSTRING\n\n#if GTEST_HAS_GLOBAL_WSTRING\n// Converts the given wide string to a narrow string using the UTF-8\n// encoding, and streams the result to this Message object.\nMessage& Message::operator <<(const ::wstring& wstr) {\n  internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);\n  return *this;\n}\n#endif  // GTEST_HAS_GLOBAL_WSTRING\n\n// Gets the text streamed to this object so far as an std::string.\n// Each '\\0' character in the buffer is replaced with \"\\\\0\".\nstd::string Message::GetString() const {\n  return internal::StringStreamToString(ss_.get());\n}\n\n// AssertionResult constructors.\n// Used in EXPECT_TRUE/FALSE(assertion_result).\nAssertionResult::AssertionResult(const AssertionResult& other)\n    : success_(other.success_),\n      message_(other.message_.get() != NULL ?\n               new ::std::string(*other.message_) :\n               static_cast< ::std::string*>(NULL)) {\n}\n\n// Swaps two AssertionResults.\nvoid AssertionResult::swap(AssertionResult& other) {\n  using std::swap;\n  swap(success_, other.success_);\n  swap(message_, other.message_);\n}\n\n// Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.\nAssertionResult AssertionResult::operator!() const {\n  AssertionResult negation(!success_);\n  if (message_.get() != NULL)\n    negation << *message_;\n  return negation;\n}\n\n// Makes a successful assertion result.\nAssertionResult AssertionSuccess() {\n  return AssertionResult(true);\n}\n\n// Makes a failed assertion result.\nAssertionResult AssertionFailure() {\n  return AssertionResult(false);\n}\n\n// Makes a failed assertion result with the given failure message.\n// Deprecated; use AssertionFailure() << message.\nAssertionResult AssertionFailure(const Message& message) {\n  return AssertionFailure() << message;\n}\n\nnamespace internal {\n\nnamespace edit_distance {\nstd::vector<EditType> CalculateOptimalEdits(const std::vector<size_t>& left,\n                                            const std::vector<size_t>& right) {\n  std::vector<std::vector<double> > costs(\n      left.size() + 1, std::vector<double>(right.size() + 1));\n  std::vector<std::vector<EditType> > best_move(\n      left.size() + 1, std::vector<EditType>(right.size() + 1));\n\n  // Populate for empty right.\n  for (size_t l_i = 0; l_i < costs.size(); ++l_i) {\n    costs[l_i][0] = static_cast<double>(l_i);\n    best_move[l_i][0] = kRemove;\n  }\n  // Populate for empty left.\n  for (size_t r_i = 1; r_i < costs[0].size(); ++r_i) {\n    costs[0][r_i] = static_cast<double>(r_i);\n    best_move[0][r_i] = kAdd;\n  }\n\n  for (size_t l_i = 0; l_i < left.size(); ++l_i) {\n    for (size_t r_i = 0; r_i < right.size(); ++r_i) {\n      if (left[l_i] == right[r_i]) {\n        // Found a match. Consume it.\n        costs[l_i + 1][r_i + 1] = costs[l_i][r_i];\n        best_move[l_i + 1][r_i + 1] = kMatch;\n        continue;\n      }\n\n      const double add = costs[l_i + 1][r_i];\n      const double remove = costs[l_i][r_i + 1];\n      const double replace = costs[l_i][r_i];\n      if (add < remove && add < replace) {\n        costs[l_i + 1][r_i + 1] = add + 1;\n        best_move[l_i + 1][r_i + 1] = kAdd;\n      } else if (remove < add && remove < replace) {\n        costs[l_i + 1][r_i + 1] = remove + 1;\n        best_move[l_i + 1][r_i + 1] = kRemove;\n      } else {\n        // We make replace a little more expensive than add/remove to lower\n        // their priority.\n        costs[l_i + 1][r_i + 1] = replace + 1.00001;\n        best_move[l_i + 1][r_i + 1] = kReplace;\n      }\n    }\n  }\n\n  // Reconstruct the best path. We do it in reverse order.\n  std::vector<EditType> best_path;\n  for (size_t l_i = left.size(), r_i = right.size(); l_i > 0 || r_i > 0;) {\n    EditType move = best_move[l_i][r_i];\n    best_path.push_back(move);\n    l_i -= move != kAdd;\n    r_i -= move != kRemove;\n  }\n  std::reverse(best_path.begin(), best_path.end());\n  return best_path;\n}\n\nnamespace {\n\n// Helper class to convert string into ids with deduplication.\nclass InternalStrings {\n public:\n  size_t GetId(const std::string& str) {\n    IdMap::iterator it = ids_.find(str);\n    if (it != ids_.end()) return it->second;\n    size_t id = ids_.size();\n    return ids_[str] = id;\n  }\n\n private:\n  typedef std::map<std::string, size_t> IdMap;\n  IdMap ids_;\n};\n\n}  // namespace\n\nstd::vector<EditType> CalculateOptimalEdits(\n    const std::vector<std::string>& left,\n    const std::vector<std::string>& right) {\n  std::vector<size_t> left_ids, right_ids;\n  {\n    InternalStrings intern_table;\n    for (size_t i = 0; i < left.size(); ++i) {\n      left_ids.push_back(intern_table.GetId(left[i]));\n    }\n    for (size_t i = 0; i < right.size(); ++i) {\n      right_ids.push_back(intern_table.GetId(right[i]));\n    }\n  }\n  return CalculateOptimalEdits(left_ids, right_ids);\n}\n\nnamespace {\n\n// Helper class that holds the state for one hunk and prints it out to the\n// stream.\n// It reorders adds/removes when possible to group all removes before all\n// adds. It also adds the hunk header before printint into the stream.\nclass Hunk {\n public:\n  Hunk(size_t left_start, size_t right_start)\n      : left_start_(left_start),\n        right_start_(right_start),\n        adds_(),\n        removes_(),\n        common_() {}\n\n  void PushLine(char edit, const char* line) {\n    switch (edit) {\n      case ' ':\n        ++common_;\n        FlushEdits();\n        hunk_.push_back(std::make_pair(' ', line));\n        break;\n      case '-':\n        ++removes_;\n        hunk_removes_.push_back(std::make_pair('-', line));\n        break;\n      case '+':\n        ++adds_;\n        hunk_adds_.push_back(std::make_pair('+', line));\n        break;\n    }\n  }\n\n  void PrintTo(std::ostream* os) {\n    PrintHeader(os);\n    FlushEdits();\n    for (std::list<std::pair<char, const char*> >::const_iterator it =\n             hunk_.begin();\n         it != hunk_.end(); ++it) {\n      *os << it->first << it->second << \"\\n\";\n    }\n  }\n\n  bool has_edits() const { return adds_ || removes_; }\n\n private:\n  void FlushEdits() {\n    hunk_.splice(hunk_.end(), hunk_removes_);\n    hunk_.splice(hunk_.end(), hunk_adds_);\n  }\n\n  // Print a unified diff header for one hunk.\n  // The format is\n  //   \"@@ -<left_start>,<left_length> +<right_start>,<right_length> @@\"\n  // where the left/right parts are omitted if unnecessary.\n  void PrintHeader(std::ostream* ss) const {\n    *ss << \"@@ \";\n    if (removes_) {\n      *ss << \"-\" << left_start_ << \",\" << (removes_ + common_);\n    }\n    if (removes_ && adds_) {\n      *ss << \" \";\n    }\n    if (adds_) {\n      *ss << \"+\" << right_start_ << \",\" << (adds_ + common_);\n    }\n    *ss << \" @@\\n\";\n  }\n\n  size_t left_start_, right_start_;\n  size_t adds_, removes_, common_;\n  std::list<std::pair<char, const char*> > hunk_, hunk_adds_, hunk_removes_;\n};\n\n}  // namespace\n\n// Create a list of diff hunks in Unified diff format.\n// Each hunk has a header generated by PrintHeader above plus a body with\n// lines prefixed with ' ' for no change, '-' for deletion and '+' for\n// addition.\n// 'context' represents the desired unchanged prefix/suffix around the diff.\n// If two hunks are close enough that their contexts overlap, then they are\n// joined into one hunk.\nstd::string CreateUnifiedDiff(const std::vector<std::string>& left,\n                              const std::vector<std::string>& right,\n                              size_t context) {\n  const std::vector<EditType> edits = CalculateOptimalEdits(left, right);\n\n  size_t l_i = 0, r_i = 0, edit_i = 0;\n  std::stringstream ss;\n  while (edit_i < edits.size()) {\n    // Find first edit.\n    while (edit_i < edits.size() && edits[edit_i] == kMatch) {\n      ++l_i;\n      ++r_i;\n      ++edit_i;\n    }\n\n    // Find the first line to include in the hunk.\n    const size_t prefix_context = std::min(l_i, context);\n    Hunk hunk(l_i - prefix_context + 1, r_i - prefix_context + 1);\n    for (size_t i = prefix_context; i > 0; --i) {\n      hunk.PushLine(' ', left[l_i - i].c_str());\n    }\n\n    // Iterate the edits until we found enough suffix for the hunk or the input\n    // is over.\n    size_t n_suffix = 0;\n    for (; edit_i < edits.size(); ++edit_i) {\n      if (n_suffix >= context) {\n        // Continue only if the next hunk is very close.\n        std::vector<EditType>::const_iterator it = edits.begin() + edit_i;\n        while (it != edits.end() && *it == kMatch) ++it;\n        if (it == edits.end() || (it - edits.begin()) - edit_i >= context) {\n          // There is no next edit or it is too far away.\n          break;\n        }\n      }\n\n      EditType edit = edits[edit_i];\n      // Reset count when a non match is found.\n      n_suffix = edit == kMatch ? n_suffix + 1 : 0;\n\n      if (edit == kMatch || edit == kRemove || edit == kReplace) {\n        hunk.PushLine(edit == kMatch ? ' ' : '-', left[l_i].c_str());\n      }\n      if (edit == kAdd || edit == kReplace) {\n        hunk.PushLine('+', right[r_i].c_str());\n      }\n\n      // Advance indices, depending on edit type.\n      l_i += edit != kAdd;\n      r_i += edit != kRemove;\n    }\n\n    if (!hunk.has_edits()) {\n      // We are done. We don't want this hunk.\n      break;\n    }\n\n    hunk.PrintTo(&ss);\n  }\n  return ss.str();\n}\n\n}  // namespace edit_distance\n\nnamespace {\n\n// The string representation of the values received in EqFailure() are already\n// escaped. Split them on escaped '\\n' boundaries. Leave all other escaped\n// characters the same.\nstd::vector<std::string> SplitEscapedString(const std::string& str) {\n  std::vector<std::string> lines;\n  size_t start = 0, end = str.size();\n  if (end > 2 && str[0] == '\"' && str[end - 1] == '\"') {\n    ++start;\n    --end;\n  }\n  bool escaped = false;\n  for (size_t i = start; i + 1 < end; ++i) {\n    if (escaped) {\n      escaped = false;\n      if (str[i] == 'n') {\n        lines.push_back(str.substr(start, i - start - 1));\n        start = i + 1;\n      }\n    } else {\n      escaped = str[i] == '\\\\';\n    }\n  }\n  lines.push_back(str.substr(start, end - start));\n  return lines;\n}\n\n}  // namespace\n\n// Constructs and returns the message for an equality assertion\n// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.\n//\n// The first four parameters are the expressions used in the assertion\n// and their values, as strings.  For example, for ASSERT_EQ(foo, bar)\n// where foo is 5 and bar is 6, we have:\n//\n//   lhs_expression: \"foo\"\n//   rhs_expression: \"bar\"\n//   lhs_value:      \"5\"\n//   rhs_value:      \"6\"\n//\n// The ignoring_case parameter is true iff the assertion is a\n// *_STRCASEEQ*.  When it's true, the string \"Ignoring case\" will\n// be inserted into the message.\nAssertionResult EqFailure(const char* lhs_expression,\n                          const char* rhs_expression,\n                          const std::string& lhs_value,\n                          const std::string& rhs_value,\n                          bool ignoring_case) {\n  Message msg;\n  msg << \"Expected equality of these values:\";\n  msg << \"\\n  \" << lhs_expression;\n  if (lhs_value != lhs_expression) {\n    msg << \"\\n    Which is: \" << lhs_value;\n  }\n  msg << \"\\n  \" << rhs_expression;\n  if (rhs_value != rhs_expression) {\n    msg << \"\\n    Which is: \" << rhs_value;\n  }\n\n  if (ignoring_case) {\n    msg << \"\\nIgnoring case\";\n  }\n\n  if (!lhs_value.empty() && !rhs_value.empty()) {\n    const std::vector<std::string> lhs_lines =\n        SplitEscapedString(lhs_value);\n    const std::vector<std::string> rhs_lines =\n        SplitEscapedString(rhs_value);\n    if (lhs_lines.size() > 1 || rhs_lines.size() > 1) {\n      msg << \"\\nWith diff:\\n\"\n          << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines);\n    }\n  }\n\n  return AssertionFailure() << msg;\n}\n\n// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.\nstd::string GetBoolAssertionFailureMessage(\n    const AssertionResult& assertion_result,\n    const char* expression_text,\n    const char* actual_predicate_value,\n    const char* expected_predicate_value) {\n  const char* actual_message = assertion_result.message();\n  Message msg;\n  msg << \"Value of: \" << expression_text\n      << \"\\n  Actual: \" << actual_predicate_value;\n  if (actual_message[0] != '\\0')\n    msg << \" (\" << actual_message << \")\";\n  msg << \"\\nExpected: \" << expected_predicate_value;\n  return msg.GetString();\n}\n\n// Helper function for implementing ASSERT_NEAR.\nAssertionResult DoubleNearPredFormat(const char* expr1,\n                                     const char* expr2,\n                                     const char* abs_error_expr,\n                                     double val1,\n                                     double val2,\n                                     double abs_error) {\n  const double diff = fabs(val1 - val2);\n  if (diff <= abs_error) return AssertionSuccess();\n\n  // FIXME: do not print the value of an expression if it's\n  // already a literal.\n  return AssertionFailure()\n      << \"The difference between \" << expr1 << \" and \" << expr2\n      << \" is \" << diff << \", which exceeds \" << abs_error_expr << \", where\\n\"\n      << expr1 << \" evaluates to \" << val1 << \",\\n\"\n      << expr2 << \" evaluates to \" << val2 << \", and\\n\"\n      << abs_error_expr << \" evaluates to \" << abs_error << \".\";\n}\n\n\n// Helper template for implementing FloatLE() and DoubleLE().\ntemplate <typename RawType>\nAssertionResult FloatingPointLE(const char* expr1,\n                                const char* expr2,\n                                RawType val1,\n                                RawType val2) {\n  // Returns success if val1 is less than val2,\n  if (val1 < val2) {\n    return AssertionSuccess();\n  }\n\n  // or if val1 is almost equal to val2.\n  const FloatingPoint<RawType> lhs(val1), rhs(val2);\n  if (lhs.AlmostEquals(rhs)) {\n    return AssertionSuccess();\n  }\n\n  // Note that the above two checks will both fail if either val1 or\n  // val2 is NaN, as the IEEE floating-point standard requires that\n  // any predicate involving a NaN must return false.\n\n  ::std::stringstream val1_ss;\n  val1_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)\n          << val1;\n\n  ::std::stringstream val2_ss;\n  val2_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)\n          << val2;\n\n  return AssertionFailure()\n      << \"Expected: (\" << expr1 << \") <= (\" << expr2 << \")\\n\"\n      << \"  Actual: \" << StringStreamToString(&val1_ss) << \" vs \"\n      << StringStreamToString(&val2_ss);\n}\n\n}  // namespace internal\n\n// Asserts that val1 is less than, or almost equal to, val2.  Fails\n// otherwise.  In particular, it fails if either val1 or val2 is NaN.\nAssertionResult FloatLE(const char* expr1, const char* expr2,\n                        float val1, float val2) {\n  return internal::FloatingPointLE<float>(expr1, expr2, val1, val2);\n}\n\n// Asserts that val1 is less than, or almost equal to, val2.  Fails\n// otherwise.  In particular, it fails if either val1 or val2 is NaN.\nAssertionResult DoubleLE(const char* expr1, const char* expr2,\n                         double val1, double val2) {\n  return internal::FloatingPointLE<double>(expr1, expr2, val1, val2);\n}\n\nnamespace internal {\n\n// The helper function for {ASSERT|EXPECT}_EQ with int or enum\n// arguments.\nAssertionResult CmpHelperEQ(const char* lhs_expression,\n                            const char* rhs_expression,\n                            BiggestInt lhs,\n                            BiggestInt rhs) {\n  if (lhs == rhs) {\n    return AssertionSuccess();\n  }\n\n  return EqFailure(lhs_expression,\n                   rhs_expression,\n                   FormatForComparisonFailureMessage(lhs, rhs),\n                   FormatForComparisonFailureMessage(rhs, lhs),\n                   false);\n}\n\n// A macro for implementing the helper functions needed to implement\n// ASSERT_?? and EXPECT_?? with integer or enum arguments.  It is here\n// just to avoid copy-and-paste of similar code.\n#define GTEST_IMPL_CMP_HELPER_(op_name, op)\\\nAssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \\\n                                   BiggestInt val1, BiggestInt val2) {\\\n  if (val1 op val2) {\\\n    return AssertionSuccess();\\\n  } else {\\\n    return AssertionFailure() \\\n        << \"Expected: (\" << expr1 << \") \" #op \" (\" << expr2\\\n        << \"), actual: \" << FormatForComparisonFailureMessage(val1, val2)\\\n        << \" vs \" << FormatForComparisonFailureMessage(val2, val1);\\\n  }\\\n}\n\n// Implements the helper function for {ASSERT|EXPECT}_NE with int or\n// enum arguments.\nGTEST_IMPL_CMP_HELPER_(NE, !=)\n// Implements the helper function for {ASSERT|EXPECT}_LE with int or\n// enum arguments.\nGTEST_IMPL_CMP_HELPER_(LE, <=)\n// Implements the helper function for {ASSERT|EXPECT}_LT with int or\n// enum arguments.\nGTEST_IMPL_CMP_HELPER_(LT, < )\n// Implements the helper function for {ASSERT|EXPECT}_GE with int or\n// enum arguments.\nGTEST_IMPL_CMP_HELPER_(GE, >=)\n// Implements the helper function for {ASSERT|EXPECT}_GT with int or\n// enum arguments.\nGTEST_IMPL_CMP_HELPER_(GT, > )\n\n#undef GTEST_IMPL_CMP_HELPER_\n\n// The helper function for {ASSERT|EXPECT}_STREQ.\nAssertionResult CmpHelperSTREQ(const char* lhs_expression,\n                               const char* rhs_expression,\n                               const char* lhs,\n                               const char* rhs) {\n  if (String::CStringEquals(lhs, rhs)) {\n    return AssertionSuccess();\n  }\n\n  return EqFailure(lhs_expression,\n                   rhs_expression,\n                   PrintToString(lhs),\n                   PrintToString(rhs),\n                   false);\n}\n\n// The helper function for {ASSERT|EXPECT}_STRCASEEQ.\nAssertionResult CmpHelperSTRCASEEQ(const char* lhs_expression,\n                                   const char* rhs_expression,\n                                   const char* lhs,\n                                   const char* rhs) {\n  if (String::CaseInsensitiveCStringEquals(lhs, rhs)) {\n    return AssertionSuccess();\n  }\n\n  return EqFailure(lhs_expression,\n                   rhs_expression,\n                   PrintToString(lhs),\n                   PrintToString(rhs),\n                   true);\n}\n\n// The helper function for {ASSERT|EXPECT}_STRNE.\nAssertionResult CmpHelperSTRNE(const char* s1_expression,\n                               const char* s2_expression,\n                               const char* s1,\n                               const char* s2) {\n  if (!String::CStringEquals(s1, s2)) {\n    return AssertionSuccess();\n  } else {\n    return AssertionFailure() << \"Expected: (\" << s1_expression << \") != (\"\n                              << s2_expression << \"), actual: \\\"\"\n                              << s1 << \"\\\" vs \\\"\" << s2 << \"\\\"\";\n  }\n}\n\n// The helper function for {ASSERT|EXPECT}_STRCASENE.\nAssertionResult CmpHelperSTRCASENE(const char* s1_expression,\n                                   const char* s2_expression,\n                                   const char* s1,\n                                   const char* s2) {\n  if (!String::CaseInsensitiveCStringEquals(s1, s2)) {\n    return AssertionSuccess();\n  } else {\n    return AssertionFailure()\n        << \"Expected: (\" << s1_expression << \") != (\"\n        << s2_expression << \") (ignoring case), actual: \\\"\"\n        << s1 << \"\\\" vs \\\"\" << s2 << \"\\\"\";\n  }\n}\n\n}  // namespace internal\n\nnamespace {\n\n// Helper functions for implementing IsSubString() and IsNotSubstring().\n\n// This group of overloaded functions return true iff needle is a\n// substring of haystack.  NULL is considered a substring of itself\n// only.\n\nbool IsSubstringPred(const char* needle, const char* haystack) {\n  if (needle == NULL || haystack == NULL)\n    return needle == haystack;\n\n  return strstr(haystack, needle) != NULL;\n}\n\nbool IsSubstringPred(const wchar_t* needle, const wchar_t* haystack) {\n  if (needle == NULL || haystack == NULL)\n    return needle == haystack;\n\n  return wcsstr(haystack, needle) != NULL;\n}\n\n// StringType here can be either ::std::string or ::std::wstring.\ntemplate <typename StringType>\nbool IsSubstringPred(const StringType& needle,\n                     const StringType& haystack) {\n  return haystack.find(needle) != StringType::npos;\n}\n\n// This function implements either IsSubstring() or IsNotSubstring(),\n// depending on the value of the expected_to_be_substring parameter.\n// StringType here can be const char*, const wchar_t*, ::std::string,\n// or ::std::wstring.\ntemplate <typename StringType>\nAssertionResult IsSubstringImpl(\n    bool expected_to_be_substring,\n    const char* needle_expr, const char* haystack_expr,\n    const StringType& needle, const StringType& haystack) {\n  if (IsSubstringPred(needle, haystack) == expected_to_be_substring)\n    return AssertionSuccess();\n\n  const bool is_wide_string = sizeof(needle[0]) > 1;\n  const char* const begin_string_quote = is_wide_string ? \"L\\\"\" : \"\\\"\";\n  return AssertionFailure()\n      << \"Value of: \" << needle_expr << \"\\n\"\n      << \"  Actual: \" << begin_string_quote << needle << \"\\\"\\n\"\n      << \"Expected: \" << (expected_to_be_substring ? \"\" : \"not \")\n      << \"a substring of \" << haystack_expr << \"\\n\"\n      << \"Which is: \" << begin_string_quote << haystack << \"\\\"\";\n}\n\n}  // namespace\n\n// IsSubstring() and IsNotSubstring() check whether needle is a\n// substring of haystack (NULL is considered a substring of itself\n// only), and return an appropriate error message when they fail.\n\nAssertionResult IsSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const char* needle, const char* haystack) {\n  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);\n}\n\nAssertionResult IsSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const wchar_t* needle, const wchar_t* haystack) {\n  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);\n}\n\nAssertionResult IsNotSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const char* needle, const char* haystack) {\n  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);\n}\n\nAssertionResult IsNotSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const wchar_t* needle, const wchar_t* haystack) {\n  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);\n}\n\nAssertionResult IsSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const ::std::string& needle, const ::std::string& haystack) {\n  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);\n}\n\nAssertionResult IsNotSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const ::std::string& needle, const ::std::string& haystack) {\n  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);\n}\n\n#if GTEST_HAS_STD_WSTRING\nAssertionResult IsSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const ::std::wstring& needle, const ::std::wstring& haystack) {\n  return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);\n}\n\nAssertionResult IsNotSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const ::std::wstring& needle, const ::std::wstring& haystack) {\n  return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);\n}\n#endif  // GTEST_HAS_STD_WSTRING\n\nnamespace internal {\n\n#if GTEST_OS_WINDOWS\n\nnamespace {\n\n// Helper function for IsHRESULT{SuccessFailure} predicates\nAssertionResult HRESULTFailureHelper(const char* expr,\n                                     const char* expected,\n                                     long hr) {  // NOLINT\n# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_TV_TITLE\n\n  // Windows CE doesn't support FormatMessage.\n  const char error_text[] = \"\";\n\n# else\n\n  // Looks up the human-readable system message for the HRESULT code\n  // and since we're not passing any params to FormatMessage, we don't\n  // want inserts expanded.\n  const DWORD kFlags = FORMAT_MESSAGE_FROM_SYSTEM |\n                       FORMAT_MESSAGE_IGNORE_INSERTS;\n  const DWORD kBufSize = 4096;\n  // Gets the system's human readable message string for this HRESULT.\n  char error_text[kBufSize] = { '\\0' };\n  DWORD message_length = ::FormatMessageA(kFlags,\n                                          0,  // no source, we're asking system\n                                          hr,  // the error\n                                          0,  // no line width restrictions\n                                          error_text,  // output buffer\n                                          kBufSize,  // buf size\n                                          NULL);  // no arguments for inserts\n  // Trims tailing white space (FormatMessage leaves a trailing CR-LF)\n  for (; message_length && IsSpace(error_text[message_length - 1]);\n          --message_length) {\n    error_text[message_length - 1] = '\\0';\n  }\n\n# endif  // GTEST_OS_WINDOWS_MOBILE\n\n  const std::string error_hex(\"0x\" + String::FormatHexInt(hr));\n  return ::testing::AssertionFailure()\n      << \"Expected: \" << expr << \" \" << expected << \".\\n\"\n      << \"  Actual: \" << error_hex << \" \" << error_text << \"\\n\";\n}\n\n}  // namespace\n\nAssertionResult IsHRESULTSuccess(const char* expr, long hr) {  // NOLINT\n  if (SUCCEEDED(hr)) {\n    return AssertionSuccess();\n  }\n  return HRESULTFailureHelper(expr, \"succeeds\", hr);\n}\n\nAssertionResult IsHRESULTFailure(const char* expr, long hr) {  // NOLINT\n  if (FAILED(hr)) {\n    return AssertionSuccess();\n  }\n  return HRESULTFailureHelper(expr, \"fails\", hr);\n}\n\n#endif  // GTEST_OS_WINDOWS\n\n// Utility functions for encoding Unicode text (wide strings) in\n// UTF-8.\n\n// A Unicode code-point can have up to 21 bits, and is encoded in UTF-8\n// like this:\n//\n// Code-point length   Encoding\n//   0 -  7 bits       0xxxxxxx\n//   8 - 11 bits       110xxxxx 10xxxxxx\n//  12 - 16 bits       1110xxxx 10xxxxxx 10xxxxxx\n//  17 - 21 bits       11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n\n// The maximum code-point a one-byte UTF-8 sequence can represent.\nconst UInt32 kMaxCodePoint1 = (static_cast<UInt32>(1) <<  7) - 1;\n\n// The maximum code-point a two-byte UTF-8 sequence can represent.\nconst UInt32 kMaxCodePoint2 = (static_cast<UInt32>(1) << (5 + 6)) - 1;\n\n// The maximum code-point a three-byte UTF-8 sequence can represent.\nconst UInt32 kMaxCodePoint3 = (static_cast<UInt32>(1) << (4 + 2*6)) - 1;\n\n// The maximum code-point a four-byte UTF-8 sequence can represent.\nconst UInt32 kMaxCodePoint4 = (static_cast<UInt32>(1) << (3 + 3*6)) - 1;\n\n// Chops off the n lowest bits from a bit pattern.  Returns the n\n// lowest bits.  As a side effect, the original bit pattern will be\n// shifted to the right by n bits.\ninline UInt32 ChopLowBits(UInt32* bits, int n) {\n  const UInt32 low_bits = *bits & ((static_cast<UInt32>(1) << n) - 1);\n  *bits >>= n;\n  return low_bits;\n}\n\n// Converts a Unicode code point to a narrow string in UTF-8 encoding.\n// code_point parameter is of type UInt32 because wchar_t may not be\n// wide enough to contain a code point.\n// If the code_point is not a valid Unicode code point\n// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted\n// to \"(Invalid Unicode 0xXXXXXXXX)\".\nstd::string CodePointToUtf8(UInt32 code_point) {\n  if (code_point > kMaxCodePoint4) {\n    return \"(Invalid Unicode 0x\" + String::FormatHexInt(code_point) + \")\";\n  }\n\n  char str[5];  // Big enough for the largest valid code point.\n  if (code_point <= kMaxCodePoint1) {\n    str[1] = '\\0';\n    str[0] = static_cast<char>(code_point);                          // 0xxxxxxx\n  } else if (code_point <= kMaxCodePoint2) {\n    str[2] = '\\0';\n    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx\n    str[0] = static_cast<char>(0xC0 | code_point);                   // 110xxxxx\n  } else if (code_point <= kMaxCodePoint3) {\n    str[3] = '\\0';\n    str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx\n    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx\n    str[0] = static_cast<char>(0xE0 | code_point);                   // 1110xxxx\n  } else {  // code_point <= kMaxCodePoint4\n    str[4] = '\\0';\n    str[3] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx\n    str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx\n    str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6));  // 10xxxxxx\n    str[0] = static_cast<char>(0xF0 | code_point);                   // 11110xxx\n  }\n  return str;\n}\n\n// The following two functions only make sense if the system\n// uses UTF-16 for wide string encoding. All supported systems\n// with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16.\n\n// Determines if the arguments constitute UTF-16 surrogate pair\n// and thus should be combined into a single Unicode code point\n// using CreateCodePointFromUtf16SurrogatePair.\ninline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {\n  return sizeof(wchar_t) == 2 &&\n      (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00;\n}\n\n// Creates a Unicode code point from UTF16 surrogate pair.\ninline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first,\n                                                    wchar_t second) {\n  const UInt32 mask = (1 << 10) - 1;\n  return (sizeof(wchar_t) == 2) ?\n      (((first & mask) << 10) | (second & mask)) + 0x10000 :\n      // This function should not be called when the condition is\n      // false, but we provide a sensible default in case it is.\n      static_cast<UInt32>(first);\n}\n\n// Converts a wide string to a narrow string in UTF-8 encoding.\n// The wide string is assumed to have the following encoding:\n//   UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)\n//   UTF-32 if sizeof(wchar_t) == 4 (on Linux)\n// Parameter str points to a null-terminated wide string.\n// Parameter num_chars may additionally limit the number\n// of wchar_t characters processed. -1 is used when the entire string\n// should be processed.\n// If the string contains code points that are not valid Unicode code points\n// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output\n// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding\n// and contains invalid UTF-16 surrogate pairs, values in those pairs\n// will be encoded as individual Unicode characters from Basic Normal Plane.\nstd::string WideStringToUtf8(const wchar_t* str, int num_chars) {\n  if (num_chars == -1)\n    num_chars = static_cast<int>(wcslen(str));\n\n  ::std::stringstream stream;\n  for (int i = 0; i < num_chars; ++i) {\n    UInt32 unicode_code_point;\n\n    if (str[i] == L'\\0') {\n      break;\n    } else if (i + 1 < num_chars && IsUtf16SurrogatePair(str[i], str[i + 1])) {\n      unicode_code_point = CreateCodePointFromUtf16SurrogatePair(str[i],\n                                                                 str[i + 1]);\n      i++;\n    } else {\n      unicode_code_point = static_cast<UInt32>(str[i]);\n    }\n\n    stream << CodePointToUtf8(unicode_code_point);\n  }\n  return StringStreamToString(&stream);\n}\n\n// Converts a wide C string to an std::string using the UTF-8 encoding.\n// NULL will be converted to \"(null)\".\nstd::string String::ShowWideCString(const wchar_t * wide_c_str) {\n  if (wide_c_str == NULL)  return \"(null)\";\n\n  return internal::WideStringToUtf8(wide_c_str, -1);\n}\n\n// Compares two wide C strings.  Returns true iff they have the same\n// content.\n//\n// Unlike wcscmp(), this function can handle NULL argument(s).  A NULL\n// C string is considered different to any non-NULL C string,\n// including the empty string.\nbool String::WideCStringEquals(const wchar_t * lhs, const wchar_t * rhs) {\n  if (lhs == NULL) return rhs == NULL;\n\n  if (rhs == NULL) return false;\n\n  return wcscmp(lhs, rhs) == 0;\n}\n\n// Helper function for *_STREQ on wide strings.\nAssertionResult CmpHelperSTREQ(const char* lhs_expression,\n                               const char* rhs_expression,\n                               const wchar_t* lhs,\n                               const wchar_t* rhs) {\n  if (String::WideCStringEquals(lhs, rhs)) {\n    return AssertionSuccess();\n  }\n\n  return EqFailure(lhs_expression,\n                   rhs_expression,\n                   PrintToString(lhs),\n                   PrintToString(rhs),\n                   false);\n}\n\n// Helper function for *_STRNE on wide strings.\nAssertionResult CmpHelperSTRNE(const char* s1_expression,\n                               const char* s2_expression,\n                               const wchar_t* s1,\n                               const wchar_t* s2) {\n  if (!String::WideCStringEquals(s1, s2)) {\n    return AssertionSuccess();\n  }\n\n  return AssertionFailure() << \"Expected: (\" << s1_expression << \") != (\"\n                            << s2_expression << \"), actual: \"\n                            << PrintToString(s1)\n                            << \" vs \" << PrintToString(s2);\n}\n\n// Compares two C strings, ignoring case.  Returns true iff they have\n// the same content.\n//\n// Unlike strcasecmp(), this function can handle NULL argument(s).  A\n// NULL C string is considered different to any non-NULL C string,\n// including the empty string.\nbool String::CaseInsensitiveCStringEquals(const char * lhs, const char * rhs) {\n  if (lhs == NULL)\n    return rhs == NULL;\n  if (rhs == NULL)\n    return false;\n  return posix::StrCaseCmp(lhs, rhs) == 0;\n}\n\n  // Compares two wide C strings, ignoring case.  Returns true iff they\n  // have the same content.\n  //\n  // Unlike wcscasecmp(), this function can handle NULL argument(s).\n  // A NULL C string is considered different to any non-NULL wide C string,\n  // including the empty string.\n  // NB: The implementations on different platforms slightly differ.\n  // On windows, this method uses _wcsicmp which compares according to LC_CTYPE\n  // environment variable. On GNU platform this method uses wcscasecmp\n  // which compares according to LC_CTYPE category of the current locale.\n  // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the\n  // current locale.\nbool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,\n                                              const wchar_t* rhs) {\n  if (lhs == NULL) return rhs == NULL;\n\n  if (rhs == NULL) return false;\n\n#if GTEST_OS_WINDOWS\n  return _wcsicmp(lhs, rhs) == 0;\n#elif GTEST_OS_LINUX && !GTEST_OS_LINUX_ANDROID\n  return wcscasecmp(lhs, rhs) == 0;\n#else\n  // Android, Mac OS X and Cygwin don't define wcscasecmp.\n  // Other unknown OSes may not define it either.\n  wint_t left, right;\n  do {\n    left = towlower(*lhs++);\n    right = towlower(*rhs++);\n  } while (left && left == right);\n  return left == right;\n#endif  // OS selector\n}\n\n// Returns true iff str ends with the given suffix, ignoring case.\n// Any string is considered to end with an empty suffix.\nbool String::EndsWithCaseInsensitive(\n    const std::string& str, const std::string& suffix) {\n  const size_t str_len = str.length();\n  const size_t suffix_len = suffix.length();\n  return (str_len >= suffix_len) &&\n         CaseInsensitiveCStringEquals(str.c_str() + str_len - suffix_len,\n                                      suffix.c_str());\n}\n\n// Formats an int value as \"%02d\".\nstd::string String::FormatIntWidth2(int value) {\n  std::stringstream ss;\n  ss << std::setfill('0') << std::setw(2) << value;\n  return ss.str();\n}\n\n// Formats an int value as \"%X\".\nstd::string String::FormatHexInt(int value) {\n  std::stringstream ss;\n  ss << std::hex << std::uppercase << value;\n  return ss.str();\n}\n\n// Formats a byte as \"%02X\".\nstd::string String::FormatByte(unsigned char value) {\n  std::stringstream ss;\n  ss << std::setfill('0') << std::setw(2) << std::hex << std::uppercase\n     << static_cast<unsigned int>(value);\n  return ss.str();\n}\n\n// Converts the buffer in a stringstream to an std::string, converting NUL\n// bytes to \"\\\\0\" along the way.\nstd::string StringStreamToString(::std::stringstream* ss) {\n  const ::std::string& str = ss->str();\n  const char* const start = str.c_str();\n  const char* const end = start + str.length();\n\n  std::string result;\n  result.reserve(2 * (end - start));\n  for (const char* ch = start; ch != end; ++ch) {\n    if (*ch == '\\0') {\n      result += \"\\\\0\";  // Replaces NUL with \"\\\\0\";\n    } else {\n      result += *ch;\n    }\n  }\n\n  return result;\n}\n\n// Appends the user-supplied message to the Google-Test-generated message.\nstd::string AppendUserMessage(const std::string& gtest_msg,\n                              const Message& user_msg) {\n  // Appends the user message if it's non-empty.\n  const std::string user_msg_string = user_msg.GetString();\n  if (user_msg_string.empty()) {\n    return gtest_msg;\n  }\n\n  return gtest_msg + \"\\n\" + user_msg_string;\n}\n\n}  // namespace internal\n\n// class TestResult\n\n// Creates an empty TestResult.\nTestResult::TestResult()\n    : death_test_count_(0),\n      elapsed_time_(0) {\n}\n\n// D'tor.\nTestResult::~TestResult() {\n}\n\n// Returns the i-th test part result among all the results. i can\n// range from 0 to total_part_count() - 1. If i is not in that range,\n// aborts the program.\nconst TestPartResult& TestResult::GetTestPartResult(int i) const {\n  if (i < 0 || i >= total_part_count())\n    internal::posix::Abort();\n  return test_part_results_.at(i);\n}\n\n// Returns the i-th test property. i can range from 0 to\n// test_property_count() - 1. If i is not in that range, aborts the\n// program.\nconst TestProperty& TestResult::GetTestProperty(int i) const {\n  if (i < 0 || i >= test_property_count())\n    internal::posix::Abort();\n  return test_properties_.at(i);\n}\n\n// Clears the test part results.\nvoid TestResult::ClearTestPartResults() {\n  test_part_results_.clear();\n}\n\n// Adds a test part result to the list.\nvoid TestResult::AddTestPartResult(const TestPartResult& test_part_result) {\n  test_part_results_.push_back(test_part_result);\n}\n\n// Adds a test property to the list. If a property with the same key as the\n// supplied property is already represented, the value of this test_property\n// replaces the old value for that key.\nvoid TestResult::RecordProperty(const std::string& xml_element,\n                                const TestProperty& test_property) {\n  if (!ValidateTestProperty(xml_element, test_property)) {\n    return;\n  }\n  internal::MutexLock lock(&test_properites_mutex_);\n  const std::vector<TestProperty>::iterator property_with_matching_key =\n      std::find_if(test_properties_.begin(), test_properties_.end(),\n                   internal::TestPropertyKeyIs(test_property.key()));\n  if (property_with_matching_key == test_properties_.end()) {\n    test_properties_.push_back(test_property);\n    return;\n  }\n  property_with_matching_key->SetValue(test_property.value());\n}\n\n// The list of reserved attributes used in the <testsuites> element of XML\n// output.\nstatic const char* const kReservedTestSuitesAttributes[] = {\n  \"disabled\",\n  \"errors\",\n  \"failures\",\n  \"name\",\n  \"random_seed\",\n  \"tests\",\n  \"time\",\n  \"timestamp\"\n};\n\n// The list of reserved attributes used in the <testsuite> element of XML\n// output.\nstatic const char* const kReservedTestSuiteAttributes[] = {\n  \"disabled\",\n  \"errors\",\n  \"failures\",\n  \"name\",\n  \"tests\",\n  \"time\"\n};\n\n// The list of reserved attributes used in the <testcase> element of XML output.\nstatic const char* const kReservedTestCaseAttributes[] = {\n    \"classname\",  \"name\",        \"status\", \"time\",\n    \"type_param\", \"value_param\", \"file\",   \"line\"};\n\ntemplate <int kSize>\nstd::vector<std::string> ArrayAsVector(const char* const (&array)[kSize]) {\n  return std::vector<std::string>(array, array + kSize);\n}\n\nstatic std::vector<std::string> GetReservedAttributesForElement(\n    const std::string& xml_element) {\n  if (xml_element == \"testsuites\") {\n    return ArrayAsVector(kReservedTestSuitesAttributes);\n  } else if (xml_element == \"testsuite\") {\n    return ArrayAsVector(kReservedTestSuiteAttributes);\n  } else if (xml_element == \"testcase\") {\n    return ArrayAsVector(kReservedTestCaseAttributes);\n  } else {\n    GTEST_CHECK_(false) << \"Unrecognized xml_element provided: \" << xml_element;\n  }\n  // This code is unreachable but some compilers may not realizes that.\n  return std::vector<std::string>();\n}\n\nstatic std::string FormatWordList(const std::vector<std::string>& words) {\n  Message word_list;\n  for (size_t i = 0; i < words.size(); ++i) {\n    if (i > 0 && words.size() > 2) {\n      word_list << \", \";\n    }\n    if (i == words.size() - 1) {\n      word_list << \"and \";\n    }\n    word_list << \"'\" << words[i] << \"'\";\n  }\n  return word_list.GetString();\n}\n\nstatic bool ValidateTestPropertyName(\n    const std::string& property_name,\n    const std::vector<std::string>& reserved_names) {\n  if (std::find(reserved_names.begin(), reserved_names.end(), property_name) !=\n          reserved_names.end()) {\n    ADD_FAILURE() << \"Reserved key used in RecordProperty(): \" << property_name\n                  << \" (\" << FormatWordList(reserved_names)\n                  << \" are reserved by \" << GTEST_NAME_ << \")\";\n    return false;\n  }\n  return true;\n}\n\n// Adds a failure if the key is a reserved attribute of the element named\n// xml_element.  Returns true if the property is valid.\nbool TestResult::ValidateTestProperty(const std::string& xml_element,\n                                      const TestProperty& test_property) {\n  return ValidateTestPropertyName(test_property.key(),\n                                  GetReservedAttributesForElement(xml_element));\n}\n\n// Clears the object.\nvoid TestResult::Clear() {\n  test_part_results_.clear();\n  test_properties_.clear();\n  death_test_count_ = 0;\n  elapsed_time_ = 0;\n}\n\n// Returns true iff the test failed.\nbool TestResult::Failed() const {\n  for (int i = 0; i < total_part_count(); ++i) {\n    if (GetTestPartResult(i).failed())\n      return true;\n  }\n  return false;\n}\n\n// Returns true iff the test part fatally failed.\nstatic bool TestPartFatallyFailed(const TestPartResult& result) {\n  return result.fatally_failed();\n}\n\n// Returns true iff the test fatally failed.\nbool TestResult::HasFatalFailure() const {\n  return CountIf(test_part_results_, TestPartFatallyFailed) > 0;\n}\n\n// Returns true iff the test part non-fatally failed.\nstatic bool TestPartNonfatallyFailed(const TestPartResult& result) {\n  return result.nonfatally_failed();\n}\n\n// Returns true iff the test has a non-fatal failure.\nbool TestResult::HasNonfatalFailure() const {\n  return CountIf(test_part_results_, TestPartNonfatallyFailed) > 0;\n}\n\n// Gets the number of all test parts.  This is the sum of the number\n// of successful test parts and the number of failed test parts.\nint TestResult::total_part_count() const {\n  return static_cast<int>(test_part_results_.size());\n}\n\n// Returns the number of the test properties.\nint TestResult::test_property_count() const {\n  return static_cast<int>(test_properties_.size());\n}\n\n// class Test\n\n// Creates a Test object.\n\n// The c'tor saves the states of all flags.\nTest::Test()\n    : gtest_flag_saver_(new GTEST_FLAG_SAVER_) {\n}\n\n// The d'tor restores the states of all flags.  The actual work is\n// done by the d'tor of the gtest_flag_saver_ field, and thus not\n// visible here.\nTest::~Test() {\n}\n\n// Sets up the test fixture.\n//\n// A sub-class may override this.\nvoid Test::SetUp() {\n}\n\n// Tears down the test fixture.\n//\n// A sub-class may override this.\nvoid Test::TearDown() {\n}\n\n// Allows user supplied key value pairs to be recorded for later output.\nvoid Test::RecordProperty(const std::string& key, const std::string& value) {\n  UnitTest::GetInstance()->RecordProperty(key, value);\n}\n\n// Allows user supplied key value pairs to be recorded for later output.\nvoid Test::RecordProperty(const std::string& key, int value) {\n  Message value_message;\n  value_message << value;\n  RecordProperty(key, value_message.GetString().c_str());\n}\n\nnamespace internal {\n\nvoid ReportFailureInUnknownLocation(TestPartResult::Type result_type,\n                                    const std::string& message) {\n  // This function is a friend of UnitTest and as such has access to\n  // AddTestPartResult.\n  UnitTest::GetInstance()->AddTestPartResult(\n      result_type,\n      NULL,  // No info about the source file where the exception occurred.\n      -1,    // We have no info on which line caused the exception.\n      message,\n      \"\");   // No stack trace, either.\n}\n\n}  // namespace internal\n\n// Google Test requires all tests in the same test case to use the same test\n// fixture class.  This function checks if the current test has the\n// same fixture class as the first test in the current test case.  If\n// yes, it returns true; otherwise it generates a Google Test failure and\n// returns false.\nbool Test::HasSameFixtureClass() {\n  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();\n  const TestCase* const test_case = impl->current_test_case();\n\n  // Info about the first test in the current test case.\n  const TestInfo* const first_test_info = test_case->test_info_list()[0];\n  const internal::TypeId first_fixture_id = first_test_info->fixture_class_id_;\n  const char* const first_test_name = first_test_info->name();\n\n  // Info about the current test.\n  const TestInfo* const this_test_info = impl->current_test_info();\n  const internal::TypeId this_fixture_id = this_test_info->fixture_class_id_;\n  const char* const this_test_name = this_test_info->name();\n\n  if (this_fixture_id != first_fixture_id) {\n    // Is the first test defined using TEST?\n    const bool first_is_TEST = first_fixture_id == internal::GetTestTypeId();\n    // Is this test defined using TEST?\n    const bool this_is_TEST = this_fixture_id == internal::GetTestTypeId();\n\n    if (first_is_TEST || this_is_TEST) {\n      // Both TEST and TEST_F appear in same test case, which is incorrect.\n      // Tell the user how to fix this.\n\n      // Gets the name of the TEST and the name of the TEST_F.  Note\n      // that first_is_TEST and this_is_TEST cannot both be true, as\n      // the fixture IDs are different for the two tests.\n      const char* const TEST_name =\n          first_is_TEST ? first_test_name : this_test_name;\n      const char* const TEST_F_name =\n          first_is_TEST ? this_test_name : first_test_name;\n\n      ADD_FAILURE()\n          << \"All tests in the same test case must use the same test fixture\\n\"\n          << \"class, so mixing TEST_F and TEST in the same test case is\\n\"\n          << \"illegal.  In test case \" << this_test_info->test_case_name()\n          << \",\\n\"\n          << \"test \" << TEST_F_name << \" is defined using TEST_F but\\n\"\n          << \"test \" << TEST_name << \" is defined using TEST.  You probably\\n\"\n          << \"want to change the TEST to TEST_F or move it to another test\\n\"\n          << \"case.\";\n    } else {\n      // Two fixture classes with the same name appear in two different\n      // namespaces, which is not allowed. Tell the user how to fix this.\n      ADD_FAILURE()\n          << \"All tests in the same test case must use the same test fixture\\n\"\n          << \"class.  However, in test case \"\n          << this_test_info->test_case_name() << \",\\n\"\n          << \"you defined test \" << first_test_name\n          << \" and test \" << this_test_name << \"\\n\"\n          << \"using two different test fixture classes.  This can happen if\\n\"\n          << \"the two classes are from different namespaces or translation\\n\"\n          << \"units and have the same name.  You should probably rename one\\n\"\n          << \"of the classes to put the tests into different test cases.\";\n    }\n    return false;\n  }\n\n  return true;\n}\n\n#if GTEST_HAS_SEH\n\n// Adds an \"exception thrown\" fatal failure to the current test.  This\n// function returns its result via an output parameter pointer because VC++\n// prohibits creation of objects with destructors on stack in functions\n// using __try (see error C2712).\nstatic std::string* FormatSehExceptionMessage(DWORD exception_code,\n                                              const char* location) {\n  Message message;\n  message << \"SEH exception with code 0x\" << std::setbase(16) <<\n    exception_code << std::setbase(10) << \" thrown in \" << location << \".\";\n\n  return new std::string(message.GetString());\n}\n\n#endif  // GTEST_HAS_SEH\n\nnamespace internal {\n\n#if GTEST_HAS_EXCEPTIONS\n\n// Adds an \"exception thrown\" fatal failure to the current test.\nstatic std::string FormatCxxExceptionMessage(const char* description,\n                                             const char* location) {\n  Message message;\n  if (description != NULL) {\n    message << \"C++ exception with description \\\"\" << description << \"\\\"\";\n  } else {\n    message << \"Unknown C++ exception\";\n  }\n  message << \" thrown in \" << location << \".\";\n\n  return message.GetString();\n}\n\nstatic std::string PrintTestPartResultToString(\n    const TestPartResult& test_part_result);\n\nGoogleTestFailureException::GoogleTestFailureException(\n    const TestPartResult& failure)\n    : ::std::runtime_error(PrintTestPartResultToString(failure).c_str()) {}\n\n#endif  // GTEST_HAS_EXCEPTIONS\n\n// We put these helper functions in the internal namespace as IBM's xlC\n// compiler rejects the code if they were declared static.\n\n// Runs the given method and handles SEH exceptions it throws, when\n// SEH is supported; returns the 0-value for type Result in case of an\n// SEH exception.  (Microsoft compilers cannot handle SEH and C++\n// exceptions in the same function.  Therefore, we provide a separate\n// wrapper function for handling SEH exceptions.)\ntemplate <class T, typename Result>\nResult HandleSehExceptionsInMethodIfSupported(\n    T* object, Result (T::*method)(), const char* location) {\n#if GTEST_HAS_SEH\n  __try {\n    return (object->*method)();\n  } __except (internal::UnitTestOptions::GTestShouldProcessSEH(  // NOLINT\n      GetExceptionCode())) {\n    // We create the exception message on the heap because VC++ prohibits\n    // creation of objects with destructors on stack in functions using __try\n    // (see error C2712).\n    std::string* exception_message = FormatSehExceptionMessage(\n        GetExceptionCode(), location);\n    internal::ReportFailureInUnknownLocation(TestPartResult::kFatalFailure,\n                                             *exception_message);\n    delete exception_message;\n    return static_cast<Result>(0);\n  }\n#else\n  (void)location;\n  return (object->*method)();\n#endif  // GTEST_HAS_SEH\n}\n\n// Runs the given method and catches and reports C++ and/or SEH-style\n// exceptions, if they are supported; returns the 0-value for type\n// Result in case of an SEH exception.\ntemplate <class T, typename Result>\nResult HandleExceptionsInMethodIfSupported(\n    T* object, Result (T::*method)(), const char* location) {\n  // NOTE: The user code can affect the way in which Google Test handles\n  // exceptions by setting GTEST_FLAG(catch_exceptions), but only before\n  // RUN_ALL_TESTS() starts. It is technically possible to check the flag\n  // after the exception is caught and either report or re-throw the\n  // exception based on the flag's value:\n  //\n  // try {\n  //   // Perform the test method.\n  // } catch (...) {\n  //   if (GTEST_FLAG(catch_exceptions))\n  //     // Report the exception as failure.\n  //   else\n  //     throw;  // Re-throws the original exception.\n  // }\n  //\n  // However, the purpose of this flag is to allow the program to drop into\n  // the debugger when the exception is thrown. On most platforms, once the\n  // control enters the catch block, the exception origin information is\n  // lost and the debugger will stop the program at the point of the\n  // re-throw in this function -- instead of at the point of the original\n  // throw statement in the code under test.  For this reason, we perform\n  // the check early, sacrificing the ability to affect Google Test's\n  // exception handling in the method where the exception is thrown.\n  if (internal::GetUnitTestImpl()->catch_exceptions()) {\n#if GTEST_HAS_EXCEPTIONS\n    try {\n      return HandleSehExceptionsInMethodIfSupported(object, method, location);\n    } catch (const AssertionException&) {  // NOLINT\n      // This failure was reported already.\n    } catch (const internal::GoogleTestFailureException&) {  // NOLINT\n      // This exception type can only be thrown by a failed Google\n      // Test assertion with the intention of letting another testing\n      // framework catch it.  Therefore we just re-throw it.\n      throw;\n    } catch (const std::exception& e) {  // NOLINT\n      internal::ReportFailureInUnknownLocation(\n          TestPartResult::kFatalFailure,\n          FormatCxxExceptionMessage(e.what(), location));\n    } catch (...) {  // NOLINT\n      internal::ReportFailureInUnknownLocation(\n          TestPartResult::kFatalFailure,\n          FormatCxxExceptionMessage(NULL, location));\n    }\n    return static_cast<Result>(0);\n#else\n    return HandleSehExceptionsInMethodIfSupported(object, method, location);\n#endif  // GTEST_HAS_EXCEPTIONS\n  } else {\n    return (object->*method)();\n  }\n}\n\n}  // namespace internal\n\n// Runs the test and updates the test result.\nvoid Test::Run() {\n  if (!HasSameFixtureClass()) return;\n\n  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();\n  impl->os_stack_trace_getter()->UponLeavingGTest();\n  internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, \"SetUp()\");\n  // We will run the test only if SetUp() was successful.\n  if (!HasFatalFailure()) {\n    impl->os_stack_trace_getter()->UponLeavingGTest();\n    internal::HandleExceptionsInMethodIfSupported(\n        this, &Test::TestBody, \"the test body\");\n  }\n\n  // However, we want to clean up as much as possible.  Hence we will\n  // always call TearDown(), even if SetUp() or the test body has\n  // failed.\n  impl->os_stack_trace_getter()->UponLeavingGTest();\n  internal::HandleExceptionsInMethodIfSupported(\n      this, &Test::TearDown, \"TearDown()\");\n}\n\n// Returns true iff the current test has a fatal failure.\nbool Test::HasFatalFailure() {\n  return internal::GetUnitTestImpl()->current_test_result()->HasFatalFailure();\n}\n\n// Returns true iff the current test has a non-fatal failure.\nbool Test::HasNonfatalFailure() {\n  return internal::GetUnitTestImpl()->current_test_result()->\n      HasNonfatalFailure();\n}\n\n// class TestInfo\n\n// Constructs a TestInfo object. It assumes ownership of the test factory\n// object.\nTestInfo::TestInfo(const std::string& a_test_case_name,\n                   const std::string& a_name,\n                   const char* a_type_param,\n                   const char* a_value_param,\n                   internal::CodeLocation a_code_location,\n                   internal::TypeId fixture_class_id,\n                   internal::TestFactoryBase* factory)\n    : test_case_name_(a_test_case_name),\n      name_(a_name),\n      type_param_(a_type_param ? new std::string(a_type_param) : NULL),\n      value_param_(a_value_param ? new std::string(a_value_param) : NULL),\n      location_(a_code_location),\n      fixture_class_id_(fixture_class_id),\n      should_run_(false),\n      is_disabled_(false),\n      matches_filter_(false),\n      factory_(factory),\n      result_() {}\n\n// Destructs a TestInfo object.\nTestInfo::~TestInfo() { delete factory_; }\n\nnamespace internal {\n\n// Creates a new TestInfo object and registers it with Google Test;\n// returns the created object.\n//\n// Arguments:\n//\n//   test_case_name:   name of the test case\n//   name:             name of the test\n//   type_param:       the name of the test's type parameter, or NULL if\n//                     this is not a typed or a type-parameterized test.\n//   value_param:      text representation of the test's value parameter,\n//                     or NULL if this is not a value-parameterized test.\n//   code_location:    code location where the test is defined\n//   fixture_class_id: ID of the test fixture class\n//   set_up_tc:        pointer to the function that sets up the test case\n//   tear_down_tc:     pointer to the function that tears down the test case\n//   factory:          pointer to the factory that creates a test object.\n//                     The newly created TestInfo instance will assume\n//                     ownership of the factory object.\nTestInfo* MakeAndRegisterTestInfo(\n    const char* test_case_name,\n    const char* name,\n    const char* type_param,\n    const char* value_param,\n    CodeLocation code_location,\n    TypeId fixture_class_id,\n    SetUpTestCaseFunc set_up_tc,\n    TearDownTestCaseFunc tear_down_tc,\n    TestFactoryBase* factory) {\n  TestInfo* const test_info =\n      new TestInfo(test_case_name, name, type_param, value_param,\n                   code_location, fixture_class_id, factory);\n  GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);\n  return test_info;\n}\n\nvoid ReportInvalidTestCaseType(const char* test_case_name,\n                               CodeLocation code_location) {\n  Message errors;\n  errors\n      << \"Attempted redefinition of test case \" << test_case_name << \".\\n\"\n      << \"All tests in the same test case must use the same test fixture\\n\"\n      << \"class.  However, in test case \" << test_case_name << \", you tried\\n\"\n      << \"to define a test using a fixture class different from the one\\n\"\n      << \"used earlier. This can happen if the two fixture classes are\\n\"\n      << \"from different namespaces and have the same name. You should\\n\"\n      << \"probably rename one of the classes to put the tests into different\\n\"\n      << \"test cases.\";\n\n  GTEST_LOG_(ERROR) << FormatFileLocation(code_location.file.c_str(),\n                                          code_location.line)\n                    << \" \" << errors.GetString();\n}\n}  // namespace internal\n\nnamespace {\n\n// A predicate that checks the test name of a TestInfo against a known\n// value.\n//\n// This is used for implementation of the TestCase class only.  We put\n// it in the anonymous namespace to prevent polluting the outer\n// namespace.\n//\n// TestNameIs is copyable.\nclass TestNameIs {\n public:\n  // Constructor.\n  //\n  // TestNameIs has NO default constructor.\n  explicit TestNameIs(const char* name)\n      : name_(name) {}\n\n  // Returns true iff the test name of test_info matches name_.\n  bool operator()(const TestInfo * test_info) const {\n    return test_info && test_info->name() == name_;\n  }\n\n private:\n  std::string name_;\n};\n\n}  // namespace\n\nnamespace internal {\n\n// This method expands all parameterized tests registered with macros TEST_P\n// and INSTANTIATE_TEST_CASE_P into regular tests and registers those.\n// This will be done just once during the program runtime.\nvoid UnitTestImpl::RegisterParameterizedTests() {\n  if (!parameterized_tests_registered_) {\n    parameterized_test_registry_.RegisterTests();\n    parameterized_tests_registered_ = true;\n  }\n}\n\n}  // namespace internal\n\n// Creates the test object, runs it, records its result, and then\n// deletes it.\nvoid TestInfo::Run() {\n  if (!should_run_) return;\n\n  // Tells UnitTest where to store test result.\n  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();\n  impl->set_current_test_info(this);\n\n  TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();\n\n  // Notifies the unit test event listeners that a test is about to start.\n  repeater->OnTestStart(*this);\n\n  const TimeInMillis start = internal::GetTimeInMillis();\n\n  impl->os_stack_trace_getter()->UponLeavingGTest();\n\n  // Creates the test object.\n  Test* const test = internal::HandleExceptionsInMethodIfSupported(\n      factory_, &internal::TestFactoryBase::CreateTest,\n      \"the test fixture's constructor\");\n\n  // Runs the test if the constructor didn't generate a fatal failure.\n  // Note that the object will not be null\n  if (!Test::HasFatalFailure()) {\n    // This doesn't throw as all user code that can throw are wrapped into\n    // exception handling code.\n    test->Run();\n  }\n\n    // Deletes the test object.\n    impl->os_stack_trace_getter()->UponLeavingGTest();\n    internal::HandleExceptionsInMethodIfSupported(\n        test, &Test::DeleteSelf_, \"the test fixture's destructor\");\n\n  result_.set_elapsed_time(internal::GetTimeInMillis() - start);\n\n  // Notifies the unit test event listener that a test has just finished.\n  repeater->OnTestEnd(*this);\n\n  // Tells UnitTest to stop associating assertion results to this\n  // test.\n  impl->set_current_test_info(NULL);\n}\n\n// class TestCase\n\n// Gets the number of successful tests in this test case.\nint TestCase::successful_test_count() const {\n  return CountIf(test_info_list_, TestPassed);\n}\n\n// Gets the number of failed tests in this test case.\nint TestCase::failed_test_count() const {\n  return CountIf(test_info_list_, TestFailed);\n}\n\n// Gets the number of disabled tests that will be reported in the XML report.\nint TestCase::reportable_disabled_test_count() const {\n  return CountIf(test_info_list_, TestReportableDisabled);\n}\n\n// Gets the number of disabled tests in this test case.\nint TestCase::disabled_test_count() const {\n  return CountIf(test_info_list_, TestDisabled);\n}\n\n// Gets the number of tests to be printed in the XML report.\nint TestCase::reportable_test_count() const {\n  return CountIf(test_info_list_, TestReportable);\n}\n\n// Get the number of tests in this test case that should run.\nint TestCase::test_to_run_count() const {\n  return CountIf(test_info_list_, ShouldRunTest);\n}\n\n// Gets the number of all tests.\nint TestCase::total_test_count() const {\n  return static_cast<int>(test_info_list_.size());\n}\n\n// Creates a TestCase with the given name.\n//\n// Arguments:\n//\n//   name:         name of the test case\n//   a_type_param: the name of the test case's type parameter, or NULL if\n//                 this is not a typed or a type-parameterized test case.\n//   set_up_tc:    pointer to the function that sets up the test case\n//   tear_down_tc: pointer to the function that tears down the test case\nTestCase::TestCase(const char* a_name, const char* a_type_param,\n                   Test::SetUpTestCaseFunc set_up_tc,\n                   Test::TearDownTestCaseFunc tear_down_tc)\n    : name_(a_name),\n      type_param_(a_type_param ? new std::string(a_type_param) : NULL),\n      set_up_tc_(set_up_tc),\n      tear_down_tc_(tear_down_tc),\n      should_run_(false),\n      elapsed_time_(0) {\n}\n\n// Destructor of TestCase.\nTestCase::~TestCase() {\n  // Deletes every Test in the collection.\n  ForEach(test_info_list_, internal::Delete<TestInfo>);\n}\n\n// Returns the i-th test among all the tests. i can range from 0 to\n// total_test_count() - 1. If i is not in that range, returns NULL.\nconst TestInfo* TestCase::GetTestInfo(int i) const {\n  const int index = GetElementOr(test_indices_, i, -1);\n  return index < 0 ? NULL : test_info_list_[index];\n}\n\n// Returns the i-th test among all the tests. i can range from 0 to\n// total_test_count() - 1. If i is not in that range, returns NULL.\nTestInfo* TestCase::GetMutableTestInfo(int i) {\n  const int index = GetElementOr(test_indices_, i, -1);\n  return index < 0 ? NULL : test_info_list_[index];\n}\n\n// Adds a test to this test case.  Will delete the test upon\n// destruction of the TestCase object.\nvoid TestCase::AddTestInfo(TestInfo * test_info) {\n  test_info_list_.push_back(test_info);\n  test_indices_.push_back(static_cast<int>(test_indices_.size()));\n}\n\n// Runs every test in this TestCase.\nvoid TestCase::Run() {\n  if (!should_run_) return;\n\n  internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();\n  impl->set_current_test_case(this);\n\n  TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();\n\n  repeater->OnTestCaseStart(*this);\n  impl->os_stack_trace_getter()->UponLeavingGTest();\n  internal::HandleExceptionsInMethodIfSupported(\n      this, &TestCase::RunSetUpTestCase, \"SetUpTestCase()\");\n\n  const internal::TimeInMillis start = internal::GetTimeInMillis();\n  for (int i = 0; i < total_test_count(); i++) {\n    GetMutableTestInfo(i)->Run();\n  }\n  elapsed_time_ = internal::GetTimeInMillis() - start;\n\n  impl->os_stack_trace_getter()->UponLeavingGTest();\n  internal::HandleExceptionsInMethodIfSupported(\n      this, &TestCase::RunTearDownTestCase, \"TearDownTestCase()\");\n\n  repeater->OnTestCaseEnd(*this);\n  impl->set_current_test_case(NULL);\n}\n\n// Clears the results of all tests in this test case.\nvoid TestCase::ClearResult() {\n  ad_hoc_test_result_.Clear();\n  ForEach(test_info_list_, TestInfo::ClearTestResult);\n}\n\n// Shuffles the tests in this test case.\nvoid TestCase::ShuffleTests(internal::Random* random) {\n  Shuffle(random, &test_indices_);\n}\n\n// Restores the test order to before the first shuffle.\nvoid TestCase::UnshuffleTests() {\n  for (size_t i = 0; i < test_indices_.size(); i++) {\n    test_indices_[i] = static_cast<int>(i);\n  }\n}\n\n// Formats a countable noun.  Depending on its quantity, either the\n// singular form or the plural form is used. e.g.\n//\n// FormatCountableNoun(1, \"formula\", \"formuli\") returns \"1 formula\".\n// FormatCountableNoun(5, \"book\", \"books\") returns \"5 books\".\nstatic std::string FormatCountableNoun(int count,\n                                       const char * singular_form,\n                                       const char * plural_form) {\n  return internal::StreamableToString(count) + \" \" +\n      (count == 1 ? singular_form : plural_form);\n}\n\n// Formats the count of tests.\nstatic std::string FormatTestCount(int test_count) {\n  return FormatCountableNoun(test_count, \"test\", \"tests\");\n}\n\n// Formats the count of test cases.\nstatic std::string FormatTestCaseCount(int test_case_count) {\n  return FormatCountableNoun(test_case_count, \"test case\", \"test cases\");\n}\n\n// Converts a TestPartResult::Type enum to human-friendly string\n// representation.  Both kNonFatalFailure and kFatalFailure are translated\n// to \"Failure\", as the user usually doesn't care about the difference\n// between the two when viewing the test result.\nstatic const char * TestPartResultTypeToString(TestPartResult::Type type) {\n  switch (type) {\n    case TestPartResult::kSuccess:\n      return \"Success\";\n\n    case TestPartResult::kNonFatalFailure:\n    case TestPartResult::kFatalFailure:\n#ifdef _MSC_VER\n      return \"error: \";\n#else\n      return \"Failure\\n\";\n#endif\n    default:\n      return \"Unknown result type\";\n  }\n}\n\nnamespace internal {\n\n// Prints a TestPartResult to an std::string.\nstatic std::string PrintTestPartResultToString(\n    const TestPartResult& test_part_result) {\n  return (Message()\n          << internal::FormatFileLocation(test_part_result.file_name(),\n                                          test_part_result.line_number())\n          << \" \" << TestPartResultTypeToString(test_part_result.type())\n          << test_part_result.message()).GetString();\n}\n\n// Prints a TestPartResult.\nstatic void PrintTestPartResult(const TestPartResult& test_part_result) {\n  const std::string& result =\n      PrintTestPartResultToString(test_part_result);\n  printf(\"%s\\n\", result.c_str());\n  fflush(stdout);\n  // If the test program runs in Visual Studio or a debugger, the\n  // following statements add the test part result message to the Output\n  // window such that the user can double-click on it to jump to the\n  // corresponding source code location; otherwise they do nothing.\n#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE\n  // We don't call OutputDebugString*() on Windows Mobile, as printing\n  // to stdout is done by OutputDebugString() there already - we don't\n  // want the same message printed twice.\n  ::OutputDebugStringA(result.c_str());\n  ::OutputDebugStringA(\"\\n\");\n#endif\n}\n\n// class PrettyUnitTestResultPrinter\n\nenum GTestColor {\n  COLOR_DEFAULT,\n  COLOR_RED,\n  COLOR_GREEN,\n  COLOR_YELLOW\n};\n\n#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \\\n    !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT && !GTEST_OS_WINDOWS_MINGW\n\n// Returns the character attribute for the given color.\nstatic WORD GetColorAttribute(GTestColor color) {\n  switch (color) {\n    case COLOR_RED:    return FOREGROUND_RED;\n    case COLOR_GREEN:  return FOREGROUND_GREEN;\n    case COLOR_YELLOW: return FOREGROUND_RED | FOREGROUND_GREEN;\n    default:           return 0;\n  }\n}\n\nstatic int GetBitOffset(WORD color_mask) {\n  if (color_mask == 0) return 0;\n\n  int bitOffset = 0;\n  while ((color_mask & 1) == 0) {\n    color_mask >>= 1;\n    ++bitOffset;\n  }\n  return bitOffset;\n}\n\nstatic WORD GetNewColor(GTestColor color, WORD old_color_attrs) {\n  // Let's reuse the BG\n  static const WORD background_mask = BACKGROUND_BLUE | BACKGROUND_GREEN |\n                                      BACKGROUND_RED | BACKGROUND_INTENSITY;\n  static const WORD foreground_mask = FOREGROUND_BLUE | FOREGROUND_GREEN |\n                                      FOREGROUND_RED | FOREGROUND_INTENSITY;\n  const WORD existing_bg = old_color_attrs & background_mask;\n\n  WORD new_color =\n      GetColorAttribute(color) | existing_bg | FOREGROUND_INTENSITY;\n  static const int bg_bitOffset = GetBitOffset(background_mask);\n  static const int fg_bitOffset = GetBitOffset(foreground_mask);\n\n  if (((new_color & background_mask) >> bg_bitOffset) ==\n      ((new_color & foreground_mask) >> fg_bitOffset)) {\n    new_color ^= FOREGROUND_INTENSITY;  // invert intensity\n  }\n  return new_color;\n}\n\n#else\n\n// Returns the ANSI color code for the given color.  COLOR_DEFAULT is\n// an invalid input.\nstatic const char* GetAnsiColorCode(GTestColor color) {\n  switch (color) {\n    case COLOR_RED:     return \"1\";\n    case COLOR_GREEN:   return \"2\";\n    case COLOR_YELLOW:  return \"3\";\n    default:            return NULL;\n  };\n}\n\n#endif  // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE\n\n// Returns true iff Google Test should use colors in the output.\nbool ShouldUseColor(bool stdout_is_tty) {\n  const char* const gtest_color = GTEST_FLAG(color).c_str();\n\n  if (String::CaseInsensitiveCStringEquals(gtest_color, \"auto\")) {\n#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MINGW\n    // On Windows the TERM variable is usually not set, but the\n    // console there does support colors.\n    return stdout_is_tty;\n#else\n    // On non-Windows platforms, we rely on the TERM variable.\n    const char* const term = posix::GetEnv(\"TERM\");\n    const bool term_supports_color =\n        String::CStringEquals(term, \"xterm\") ||\n        String::CStringEquals(term, \"xterm-color\") ||\n        String::CStringEquals(term, \"xterm-256color\") ||\n        String::CStringEquals(term, \"screen\") ||\n        String::CStringEquals(term, \"screen-256color\") ||\n        String::CStringEquals(term, \"tmux\") ||\n        String::CStringEquals(term, \"tmux-256color\") ||\n        String::CStringEquals(term, \"rxvt-unicode\") ||\n        String::CStringEquals(term, \"rxvt-unicode-256color\") ||\n        String::CStringEquals(term, \"linux\") ||\n        String::CStringEquals(term, \"cygwin\");\n    return stdout_is_tty && term_supports_color;\n#endif  // GTEST_OS_WINDOWS\n  }\n\n  return String::CaseInsensitiveCStringEquals(gtest_color, \"yes\") ||\n      String::CaseInsensitiveCStringEquals(gtest_color, \"true\") ||\n      String::CaseInsensitiveCStringEquals(gtest_color, \"t\") ||\n      String::CStringEquals(gtest_color, \"1\");\n  // We take \"yes\", \"true\", \"t\", and \"1\" as meaning \"yes\".  If the\n  // value is neither one of these nor \"auto\", we treat it as \"no\" to\n  // be conservative.\n}\n\n// Helpers for printing colored strings to stdout. Note that on Windows, we\n// cannot simply emit special characters and have the terminal change colors.\n// This routine must actually emit the characters rather than return a string\n// that would be colored when printed, as can be done on Linux.\nstatic void ColoredPrintf(GTestColor color, const char* fmt, ...) {\n  va_list args;\n  va_start(args, fmt);\n\n#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || \\\n    GTEST_OS_IOS || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT\n  const bool use_color = AlwaysFalse();\n#else\n  static const bool in_color_mode =\n      ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);\n  const bool use_color = in_color_mode && (color != COLOR_DEFAULT);\n#endif  // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS\n  // The '!= 0' comparison is necessary to satisfy MSVC 7.1.\n\n  if (!use_color) {\n    vprintf(fmt, args);\n    va_end(args);\n    return;\n  }\n\n#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \\\n    !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT && !GTEST_OS_WINDOWS_MINGW\n  const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);\n\n  // Gets the current text color.\n  CONSOLE_SCREEN_BUFFER_INFO buffer_info;\n  GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);\n  const WORD old_color_attrs = buffer_info.wAttributes;\n  const WORD new_color = GetNewColor(color, old_color_attrs);\n\n  // We need to flush the stream buffers into the console before each\n  // SetConsoleTextAttribute call lest it affect the text that is already\n  // printed but has not yet reached the console.\n  fflush(stdout);\n  SetConsoleTextAttribute(stdout_handle, new_color);\n\n  vprintf(fmt, args);\n\n  fflush(stdout);\n  // Restores the text color.\n  SetConsoleTextAttribute(stdout_handle, old_color_attrs);\n#else\n  printf(\"\\033[0;3%sm\", GetAnsiColorCode(color));\n  vprintf(fmt, args);\n  printf(\"\\033[m\");  // Resets the terminal to default.\n#endif  // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE\n  va_end(args);\n}\n\n// Text printed in Google Test's text output and --gtest_list_tests\n// output to label the type parameter and value parameter for a test.\nstatic const char kTypeParamLabel[] = \"TypeParam\";\nstatic const char kValueParamLabel[] = \"GetParam()\";\n\nstatic void PrintFullTestCommentIfPresent(const TestInfo& test_info) {\n  const char* const type_param = test_info.type_param();\n  const char* const value_param = test_info.value_param();\n\n  if (type_param != NULL || value_param != NULL) {\n    printf(\", where \");\n    if (type_param != NULL) {\n      printf(\"%s = %s\", kTypeParamLabel, type_param);\n      if (value_param != NULL)\n        printf(\" and \");\n    }\n    if (value_param != NULL) {\n      printf(\"%s = %s\", kValueParamLabel, value_param);\n    }\n  }\n}\n\n// This class implements the TestEventListener interface.\n//\n// Class PrettyUnitTestResultPrinter is copyable.\nclass PrettyUnitTestResultPrinter : public TestEventListener {\n public:\n  PrettyUnitTestResultPrinter() {}\n  static void PrintTestName(const char * test_case, const char * test) {\n    printf(\"%s.%s\", test_case, test);\n  }\n\n  // The following methods override what's in the TestEventListener class.\n  virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}\n  virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);\n  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);\n  virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}\n  virtual void OnTestCaseStart(const TestCase& test_case);\n  virtual void OnTestStart(const TestInfo& test_info);\n  virtual void OnTestPartResult(const TestPartResult& result);\n  virtual void OnTestEnd(const TestInfo& test_info);\n  virtual void OnTestCaseEnd(const TestCase& test_case);\n  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);\n  virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}\n  virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);\n  virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}\n\n private:\n  static void PrintFailedTests(const UnitTest& unit_test);\n};\n\n  // Fired before each iteration of tests starts.\nvoid PrettyUnitTestResultPrinter::OnTestIterationStart(\n    const UnitTest& unit_test, int iteration) {\n  if (GTEST_FLAG(repeat) != 1)\n    printf(\"\\nRepeating all tests (iteration %d) . . .\\n\\n\", iteration + 1);\n\n  const char* const filter = GTEST_FLAG(filter).c_str();\n\n  // Prints the filter if it's not *.  This reminds the user that some\n  // tests may be skipped.\n  if (!String::CStringEquals(filter, kUniversalFilter)) {\n    ColoredPrintf(COLOR_YELLOW,\n                  \"Note: %s filter = %s\\n\", GTEST_NAME_, filter);\n  }\n\n  if (internal::ShouldShard(kTestTotalShards, kTestShardIndex, false)) {\n    const Int32 shard_index = Int32FromEnvOrDie(kTestShardIndex, -1);\n    ColoredPrintf(COLOR_YELLOW,\n                  \"Note: This is test shard %d of %s.\\n\",\n                  static_cast<int>(shard_index) + 1,\n                  internal::posix::GetEnv(kTestTotalShards));\n  }\n\n  if (GTEST_FLAG(shuffle)) {\n    ColoredPrintf(COLOR_YELLOW,\n                  \"Note: Randomizing tests' orders with a seed of %d .\\n\",\n                  unit_test.random_seed());\n  }\n\n  ColoredPrintf(COLOR_GREEN,  \"[==========] \");\n  printf(\"Running %s from %s.\\n\",\n         FormatTestCount(unit_test.test_to_run_count()).c_str(),\n         FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());\n  fflush(stdout);\n}\n\nvoid PrettyUnitTestResultPrinter::OnEnvironmentsSetUpStart(\n    const UnitTest& /*unit_test*/) {\n  ColoredPrintf(COLOR_GREEN,  \"[----------] \");\n  printf(\"Global test environment set-up.\\n\");\n  fflush(stdout);\n}\n\nvoid PrettyUnitTestResultPrinter::OnTestCaseStart(const TestCase& test_case) {\n  const std::string counts =\n      FormatCountableNoun(test_case.test_to_run_count(), \"test\", \"tests\");\n  ColoredPrintf(COLOR_GREEN, \"[----------] \");\n  printf(\"%s from %s\", counts.c_str(), test_case.name());\n  if (test_case.type_param() == NULL) {\n    printf(\"\\n\");\n  } else {\n    printf(\", where %s = %s\\n\", kTypeParamLabel, test_case.type_param());\n  }\n  fflush(stdout);\n}\n\nvoid PrettyUnitTestResultPrinter::OnTestStart(const TestInfo& test_info) {\n  ColoredPrintf(COLOR_GREEN,  \"[ RUN      ] \");\n  PrintTestName(test_info.test_case_name(), test_info.name());\n  printf(\"\\n\");\n  fflush(stdout);\n}\n\n// Called after an assertion failure.\nvoid PrettyUnitTestResultPrinter::OnTestPartResult(\n    const TestPartResult& result) {\n  // If the test part succeeded, we don't need to do anything.\n  if (result.type() == TestPartResult::kSuccess)\n    return;\n\n  // Print failure message from the assertion (e.g. expected this and got that).\n  PrintTestPartResult(result);\n  fflush(stdout);\n}\n\nvoid PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) {\n  if (test_info.result()->Passed()) {\n    ColoredPrintf(COLOR_GREEN, \"[       OK ] \");\n  } else {\n    ColoredPrintf(COLOR_RED, \"[  FAILED  ] \");\n  }\n  PrintTestName(test_info.test_case_name(), test_info.name());\n  if (test_info.result()->Failed())\n    PrintFullTestCommentIfPresent(test_info);\n\n  if (GTEST_FLAG(print_time)) {\n    printf(\" (%s ms)\\n\", internal::StreamableToString(\n           test_info.result()->elapsed_time()).c_str());\n  } else {\n    printf(\"\\n\");\n  }\n  fflush(stdout);\n}\n\nvoid PrettyUnitTestResultPrinter::OnTestCaseEnd(const TestCase& test_case) {\n  if (!GTEST_FLAG(print_time)) return;\n\n  const std::string counts =\n      FormatCountableNoun(test_case.test_to_run_count(), \"test\", \"tests\");\n  ColoredPrintf(COLOR_GREEN, \"[----------] \");\n  printf(\"%s from %s (%s ms total)\\n\\n\",\n         counts.c_str(), test_case.name(),\n         internal::StreamableToString(test_case.elapsed_time()).c_str());\n  fflush(stdout);\n}\n\nvoid PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart(\n    const UnitTest& /*unit_test*/) {\n  ColoredPrintf(COLOR_GREEN,  \"[----------] \");\n  printf(\"Global test environment tear-down\\n\");\n  fflush(stdout);\n}\n\n// Internal helper for printing the list of failed tests.\nvoid PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) {\n  const int failed_test_count = unit_test.failed_test_count();\n  if (failed_test_count == 0) {\n    return;\n  }\n\n  for (int i = 0; i < unit_test.total_test_case_count(); ++i) {\n    const TestCase& test_case = *unit_test.GetTestCase(i);\n    if (!test_case.should_run() || (test_case.failed_test_count() == 0)) {\n      continue;\n    }\n    for (int j = 0; j < test_case.total_test_count(); ++j) {\n      const TestInfo& test_info = *test_case.GetTestInfo(j);\n      if (!test_info.should_run() || test_info.result()->Passed()) {\n        continue;\n      }\n      ColoredPrintf(COLOR_RED, \"[  FAILED  ] \");\n      printf(\"%s.%s\", test_case.name(), test_info.name());\n      PrintFullTestCommentIfPresent(test_info);\n      printf(\"\\n\");\n    }\n  }\n}\n\nvoid PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,\n                                                     int /*iteration*/) {\n  ColoredPrintf(COLOR_GREEN,  \"[==========] \");\n  printf(\"%s from %s ran.\",\n         FormatTestCount(unit_test.test_to_run_count()).c_str(),\n         FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str());\n  if (GTEST_FLAG(print_time)) {\n    printf(\" (%s ms total)\",\n           internal::StreamableToString(unit_test.elapsed_time()).c_str());\n  }\n  printf(\"\\n\");\n  ColoredPrintf(COLOR_GREEN,  \"[  PASSED  ] \");\n  printf(\"%s.\\n\", FormatTestCount(unit_test.successful_test_count()).c_str());\n\n  int num_failures = unit_test.failed_test_count();\n  if (!unit_test.Passed()) {\n    const int failed_test_count = unit_test.failed_test_count();\n    ColoredPrintf(COLOR_RED,  \"[  FAILED  ] \");\n    printf(\"%s, listed below:\\n\", FormatTestCount(failed_test_count).c_str());\n    PrintFailedTests(unit_test);\n    printf(\"\\n%2d FAILED %s\\n\", num_failures,\n                        num_failures == 1 ? \"TEST\" : \"TESTS\");\n  }\n\n  int num_disabled = unit_test.reportable_disabled_test_count();\n  if (num_disabled && !GTEST_FLAG(also_run_disabled_tests)) {\n    if (!num_failures) {\n      printf(\"\\n\");  // Add a spacer if no FAILURE banner is displayed.\n    }\n    ColoredPrintf(COLOR_YELLOW,\n                  \"  YOU HAVE %d DISABLED %s\\n\\n\",\n                  num_disabled,\n                  num_disabled == 1 ? \"TEST\" : \"TESTS\");\n  }\n  // Ensure that Google Test output is printed before, e.g., heapchecker output.\n  fflush(stdout);\n}\n\n// End PrettyUnitTestResultPrinter\n\n// class TestEventRepeater\n//\n// This class forwards events to other event listeners.\nclass TestEventRepeater : public TestEventListener {\n public:\n  TestEventRepeater() : forwarding_enabled_(true) {}\n  virtual ~TestEventRepeater();\n  void Append(TestEventListener *listener);\n  TestEventListener* Release(TestEventListener* listener);\n\n  // Controls whether events will be forwarded to listeners_. Set to false\n  // in death test child processes.\n  bool forwarding_enabled() const { return forwarding_enabled_; }\n  void set_forwarding_enabled(bool enable) { forwarding_enabled_ = enable; }\n\n  virtual void OnTestProgramStart(const UnitTest& unit_test);\n  virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration);\n  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test);\n  virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test);\n  virtual void OnTestCaseStart(const TestCase& test_case);\n  virtual void OnTestStart(const TestInfo& test_info);\n  virtual void OnTestPartResult(const TestPartResult& result);\n  virtual void OnTestEnd(const TestInfo& test_info);\n  virtual void OnTestCaseEnd(const TestCase& test_case);\n  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test);\n  virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test);\n  virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);\n  virtual void OnTestProgramEnd(const UnitTest& unit_test);\n\n private:\n  // Controls whether events will be forwarded to listeners_. Set to false\n  // in death test child processes.\n  bool forwarding_enabled_;\n  // The list of listeners that receive events.\n  std::vector<TestEventListener*> listeners_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventRepeater);\n};\n\nTestEventRepeater::~TestEventRepeater() {\n  ForEach(listeners_, Delete<TestEventListener>);\n}\n\nvoid TestEventRepeater::Append(TestEventListener *listener) {\n  listeners_.push_back(listener);\n}\n\n// FIXME: Factor the search functionality into Vector::Find.\nTestEventListener* TestEventRepeater::Release(TestEventListener *listener) {\n  for (size_t i = 0; i < listeners_.size(); ++i) {\n    if (listeners_[i] == listener) {\n      listeners_.erase(listeners_.begin() + i);\n      return listener;\n    }\n  }\n\n  return NULL;\n}\n\n// Since most methods are very similar, use macros to reduce boilerplate.\n// This defines a member that forwards the call to all listeners.\n#define GTEST_REPEATER_METHOD_(Name, Type) \\\nvoid TestEventRepeater::Name(const Type& parameter) { \\\n  if (forwarding_enabled_) { \\\n    for (size_t i = 0; i < listeners_.size(); i++) { \\\n      listeners_[i]->Name(parameter); \\\n    } \\\n  } \\\n}\n// This defines a member that forwards the call to all listeners in reverse\n// order.\n#define GTEST_REVERSE_REPEATER_METHOD_(Name, Type) \\\nvoid TestEventRepeater::Name(const Type& parameter) { \\\n  if (forwarding_enabled_) { \\\n    for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) { \\\n      listeners_[i]->Name(parameter); \\\n    } \\\n  } \\\n}\n\nGTEST_REPEATER_METHOD_(OnTestProgramStart, UnitTest)\nGTEST_REPEATER_METHOD_(OnEnvironmentsSetUpStart, UnitTest)\nGTEST_REPEATER_METHOD_(OnTestCaseStart, TestCase)\nGTEST_REPEATER_METHOD_(OnTestStart, TestInfo)\nGTEST_REPEATER_METHOD_(OnTestPartResult, TestPartResult)\nGTEST_REPEATER_METHOD_(OnEnvironmentsTearDownStart, UnitTest)\nGTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsSetUpEnd, UnitTest)\nGTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsTearDownEnd, UnitTest)\nGTEST_REVERSE_REPEATER_METHOD_(OnTestEnd, TestInfo)\nGTEST_REVERSE_REPEATER_METHOD_(OnTestCaseEnd, TestCase)\nGTEST_REVERSE_REPEATER_METHOD_(OnTestProgramEnd, UnitTest)\n\n#undef GTEST_REPEATER_METHOD_\n#undef GTEST_REVERSE_REPEATER_METHOD_\n\nvoid TestEventRepeater::OnTestIterationStart(const UnitTest& unit_test,\n                                             int iteration) {\n  if (forwarding_enabled_) {\n    for (size_t i = 0; i < listeners_.size(); i++) {\n      listeners_[i]->OnTestIterationStart(unit_test, iteration);\n    }\n  }\n}\n\nvoid TestEventRepeater::OnTestIterationEnd(const UnitTest& unit_test,\n                                           int iteration) {\n  if (forwarding_enabled_) {\n    for (int i = static_cast<int>(listeners_.size()) - 1; i >= 0; i--) {\n      listeners_[i]->OnTestIterationEnd(unit_test, iteration);\n    }\n  }\n}\n\n// End TestEventRepeater\n\n// This class generates an XML output file.\nclass XmlUnitTestResultPrinter : public EmptyTestEventListener {\n public:\n  explicit XmlUnitTestResultPrinter(const char* output_file);\n\n  virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);\n  void ListTestsMatchingFilter(const std::vector<TestCase*>& test_cases);\n\n  // Prints an XML summary of all unit tests.\n  static void PrintXmlTestsList(std::ostream* stream,\n                                const std::vector<TestCase*>& test_cases);\n\n private:\n  // Is c a whitespace character that is normalized to a space character\n  // when it appears in an XML attribute value?\n  static bool IsNormalizableWhitespace(char c) {\n    return c == 0x9 || c == 0xA || c == 0xD;\n  }\n\n  // May c appear in a well-formed XML document?\n  static bool IsValidXmlCharacter(char c) {\n    return IsNormalizableWhitespace(c) || c >= 0x20;\n  }\n\n  // Returns an XML-escaped copy of the input string str.  If\n  // is_attribute is true, the text is meant to appear as an attribute\n  // value, and normalizable whitespace is preserved by replacing it\n  // with character references.\n  static std::string EscapeXml(const std::string& str, bool is_attribute);\n\n  // Returns the given string with all characters invalid in XML removed.\n  static std::string RemoveInvalidXmlCharacters(const std::string& str);\n\n  // Convenience wrapper around EscapeXml when str is an attribute value.\n  static std::string EscapeXmlAttribute(const std::string& str) {\n    return EscapeXml(str, true);\n  }\n\n  // Convenience wrapper around EscapeXml when str is not an attribute value.\n  static std::string EscapeXmlText(const char* str) {\n    return EscapeXml(str, false);\n  }\n\n  // Verifies that the given attribute belongs to the given element and\n  // streams the attribute as XML.\n  static void OutputXmlAttribute(std::ostream* stream,\n                                 const std::string& element_name,\n                                 const std::string& name,\n                                 const std::string& value);\n\n  // Streams an XML CDATA section, escaping invalid CDATA sequences as needed.\n  static void OutputXmlCDataSection(::std::ostream* stream, const char* data);\n\n  // Streams an XML representation of a TestInfo object.\n  static void OutputXmlTestInfo(::std::ostream* stream,\n                                const char* test_case_name,\n                                const TestInfo& test_info);\n\n  // Prints an XML representation of a TestCase object\n  static void PrintXmlTestCase(::std::ostream* stream,\n                               const TestCase& test_case);\n\n  // Prints an XML summary of unit_test to output stream out.\n  static void PrintXmlUnitTest(::std::ostream* stream,\n                               const UnitTest& unit_test);\n\n  // Produces a string representing the test properties in a result as space\n  // delimited XML attributes based on the property key=\"value\" pairs.\n  // When the std::string is not empty, it includes a space at the beginning,\n  // to delimit this attribute from prior attributes.\n  static std::string TestPropertiesAsXmlAttributes(const TestResult& result);\n\n  // Streams an XML representation of the test properties of a TestResult\n  // object.\n  static void OutputXmlTestProperties(std::ostream* stream,\n                                      const TestResult& result);\n\n  // The output file.\n  const std::string output_file_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(XmlUnitTestResultPrinter);\n};\n\n// Creates a new XmlUnitTestResultPrinter.\nXmlUnitTestResultPrinter::XmlUnitTestResultPrinter(const char* output_file)\n    : output_file_(output_file) {\n  if (output_file_.empty()) {\n    GTEST_LOG_(FATAL) << \"XML output file may not be null\";\n  }\n}\n\n// Called after the unit test ends.\nvoid XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,\n                                                  int /*iteration*/) {\n  FILE* xmlout = OpenFileForWriting(output_file_);\n  std::stringstream stream;\n  PrintXmlUnitTest(&stream, unit_test);\n  fprintf(xmlout, \"%s\", StringStreamToString(&stream).c_str());\n  fclose(xmlout);\n}\n\nvoid XmlUnitTestResultPrinter::ListTestsMatchingFilter(\n    const std::vector<TestCase*>& test_cases) {\n  FILE* xmlout = OpenFileForWriting(output_file_);\n  std::stringstream stream;\n  PrintXmlTestsList(&stream, test_cases);\n  fprintf(xmlout, \"%s\", StringStreamToString(&stream).c_str());\n  fclose(xmlout);\n}\n\n// Returns an XML-escaped copy of the input string str.  If is_attribute\n// is true, the text is meant to appear as an attribute value, and\n// normalizable whitespace is preserved by replacing it with character\n// references.\n//\n// Invalid XML characters in str, if any, are stripped from the output.\n// It is expected that most, if not all, of the text processed by this\n// module will consist of ordinary English text.\n// If this module is ever modified to produce version 1.1 XML output,\n// most invalid characters can be retained using character references.\n// FIXME: It might be nice to have a minimally invasive, human-readable\n// escaping scheme for invalid characters, rather than dropping them.\nstd::string XmlUnitTestResultPrinter::EscapeXml(\n    const std::string& str, bool is_attribute) {\n  Message m;\n\n  for (size_t i = 0; i < str.size(); ++i) {\n    const char ch = str[i];\n    switch (ch) {\n      case '<':\n        m << \"&lt;\";\n        break;\n      case '>':\n        m << \"&gt;\";\n        break;\n      case '&':\n        m << \"&amp;\";\n        break;\n      case '\\'':\n        if (is_attribute)\n          m << \"&apos;\";\n        else\n          m << '\\'';\n        break;\n      case '\"':\n        if (is_attribute)\n          m << \"&quot;\";\n        else\n          m << '\"';\n        break;\n      default:\n        if (IsValidXmlCharacter(ch)) {\n          if (is_attribute && IsNormalizableWhitespace(ch))\n            m << \"&#x\" << String::FormatByte(static_cast<unsigned char>(ch))\n              << \";\";\n          else\n            m << ch;\n        }\n        break;\n    }\n  }\n\n  return m.GetString();\n}\n\n// Returns the given string with all characters invalid in XML removed.\n// Currently invalid characters are dropped from the string. An\n// alternative is to replace them with certain characters such as . or ?.\nstd::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(\n    const std::string& str) {\n  std::string output;\n  output.reserve(str.size());\n  for (std::string::const_iterator it = str.begin(); it != str.end(); ++it)\n    if (IsValidXmlCharacter(*it))\n      output.push_back(*it);\n\n  return output;\n}\n\n// The following routines generate an XML representation of a UnitTest\n// object.\n// GOOGLETEST_CM0009 DO NOT DELETE\n//\n// This is how Google Test concepts map to the DTD:\n//\n// <testsuites name=\"AllTests\">        <-- corresponds to a UnitTest object\n//   <testsuite name=\"testcase-name\">  <-- corresponds to a TestCase object\n//     <testcase name=\"test-name\">     <-- corresponds to a TestInfo object\n//       <failure message=\"...\">...</failure>\n//       <failure message=\"...\">...</failure>\n//       <failure message=\"...\">...</failure>\n//                                     <-- individual assertion failures\n//     </testcase>\n//   </testsuite>\n// </testsuites>\n\n// Formats the given time in milliseconds as seconds.\nstd::string FormatTimeInMillisAsSeconds(TimeInMillis ms) {\n  ::std::stringstream ss;\n  ss << (static_cast<double>(ms) * 1e-3);\n  return ss.str();\n}\n\nstatic bool PortableLocaltime(time_t seconds, struct tm* out) {\n#if defined(_MSC_VER)\n  return localtime_s(out, &seconds) == 0;\n#elif defined(__MINGW32__) || defined(__MINGW64__)\n  // MINGW <time.h> provides neither localtime_r nor localtime_s, but uses\n  // Windows' localtime(), which has a thread-local tm buffer.\n  struct tm* tm_ptr = localtime(&seconds);  // NOLINT\n  if (tm_ptr == NULL)\n    return false;\n  *out = *tm_ptr;\n  return true;\n#else\n  return localtime_r(&seconds, out) != NULL;\n#endif\n}\n\n// Converts the given epoch time in milliseconds to a date string in the ISO\n// 8601 format, without the timezone information.\nstd::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms) {\n  struct tm time_struct;\n  if (!PortableLocaltime(static_cast<time_t>(ms / 1000), &time_struct))\n    return \"\";\n  // YYYY-MM-DDThh:mm:ss\n  return StreamableToString(time_struct.tm_year + 1900) + \"-\" +\n      String::FormatIntWidth2(time_struct.tm_mon + 1) + \"-\" +\n      String::FormatIntWidth2(time_struct.tm_mday) + \"T\" +\n      String::FormatIntWidth2(time_struct.tm_hour) + \":\" +\n      String::FormatIntWidth2(time_struct.tm_min) + \":\" +\n      String::FormatIntWidth2(time_struct.tm_sec);\n}\n\n// Streams an XML CDATA section, escaping invalid CDATA sequences as needed.\nvoid XmlUnitTestResultPrinter::OutputXmlCDataSection(::std::ostream* stream,\n                                                     const char* data) {\n  const char* segment = data;\n  *stream << \"<![CDATA[\";\n  for (;;) {\n    const char* const next_segment = strstr(segment, \"]]>\");\n    if (next_segment != NULL) {\n      stream->write(\n          segment, static_cast<std::streamsize>(next_segment - segment));\n      *stream << \"]]>]]&gt;<![CDATA[\";\n      segment = next_segment + strlen(\"]]>\");\n    } else {\n      *stream << segment;\n      break;\n    }\n  }\n  *stream << \"]]>\";\n}\n\nvoid XmlUnitTestResultPrinter::OutputXmlAttribute(\n    std::ostream* stream,\n    const std::string& element_name,\n    const std::string& name,\n    const std::string& value) {\n  const std::vector<std::string>& allowed_names =\n      GetReservedAttributesForElement(element_name);\n\n  GTEST_CHECK_(std::find(allowed_names.begin(), allowed_names.end(), name) !=\n                   allowed_names.end())\n      << \"Attribute \" << name << \" is not allowed for element <\" << element_name\n      << \">.\";\n\n  *stream << \" \" << name << \"=\\\"\" << EscapeXmlAttribute(value) << \"\\\"\";\n}\n\n// Prints an XML representation of a TestInfo object.\n// FIXME: There is also value in printing properties with the plain printer.\nvoid XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,\n                                                 const char* test_case_name,\n                                                 const TestInfo& test_info) {\n  const TestResult& result = *test_info.result();\n  const std::string kTestcase = \"testcase\";\n\n  if (test_info.is_in_another_shard()) {\n    return;\n  }\n\n  *stream << \"    <testcase\";\n  OutputXmlAttribute(stream, kTestcase, \"name\", test_info.name());\n\n  if (test_info.value_param() != NULL) {\n    OutputXmlAttribute(stream, kTestcase, \"value_param\",\n                       test_info.value_param());\n  }\n  if (test_info.type_param() != NULL) {\n    OutputXmlAttribute(stream, kTestcase, \"type_param\", test_info.type_param());\n  }\n  if (GTEST_FLAG(list_tests)) {\n    OutputXmlAttribute(stream, kTestcase, \"file\", test_info.file());\n    OutputXmlAttribute(stream, kTestcase, \"line\",\n                       StreamableToString(test_info.line()));\n    *stream << \" />\\n\";\n    return;\n  }\n\n  OutputXmlAttribute(stream, kTestcase, \"status\",\n                     test_info.should_run() ? \"run\" : \"notrun\");\n  OutputXmlAttribute(stream, kTestcase, \"time\",\n                     FormatTimeInMillisAsSeconds(result.elapsed_time()));\n  OutputXmlAttribute(stream, kTestcase, \"classname\", test_case_name);\n\n  int failures = 0;\n  for (int i = 0; i < result.total_part_count(); ++i) {\n    const TestPartResult& part = result.GetTestPartResult(i);\n    if (part.failed()) {\n      if (++failures == 1) {\n        *stream << \">\\n\";\n      }\n      const std::string location =\n          internal::FormatCompilerIndependentFileLocation(part.file_name(),\n                                                          part.line_number());\n      const std::string summary = location + \"\\n\" + part.summary();\n      *stream << \"      <failure message=\\\"\"\n              << EscapeXmlAttribute(summary.c_str())\n              << \"\\\" type=\\\"\\\">\";\n      const std::string detail = location + \"\\n\" + part.message();\n      OutputXmlCDataSection(stream, RemoveInvalidXmlCharacters(detail).c_str());\n      *stream << \"</failure>\\n\";\n    }\n  }\n\n  if (failures == 0 && result.test_property_count() == 0) {\n    *stream << \" />\\n\";\n  } else {\n    if (failures == 0) {\n      *stream << \">\\n\";\n    }\n    OutputXmlTestProperties(stream, result);\n    *stream << \"    </testcase>\\n\";\n  }\n}\n\n// Prints an XML representation of a TestCase object\nvoid XmlUnitTestResultPrinter::PrintXmlTestCase(std::ostream* stream,\n                                                const TestCase& test_case) {\n  const std::string kTestsuite = \"testsuite\";\n  *stream << \"  <\" << kTestsuite;\n  OutputXmlAttribute(stream, kTestsuite, \"name\", test_case.name());\n  OutputXmlAttribute(stream, kTestsuite, \"tests\",\n                     StreamableToString(test_case.reportable_test_count()));\n  if (!GTEST_FLAG(list_tests)) {\n    OutputXmlAttribute(stream, kTestsuite, \"failures\",\n                       StreamableToString(test_case.failed_test_count()));\n    OutputXmlAttribute(\n        stream, kTestsuite, \"disabled\",\n        StreamableToString(test_case.reportable_disabled_test_count()));\n    OutputXmlAttribute(stream, kTestsuite, \"errors\", \"0\");\n    OutputXmlAttribute(stream, kTestsuite, \"time\",\n                       FormatTimeInMillisAsSeconds(test_case.elapsed_time()));\n    *stream << TestPropertiesAsXmlAttributes(test_case.ad_hoc_test_result());\n  }\n  *stream << \">\\n\";\n  for (int i = 0; i < test_case.total_test_count(); ++i) {\n    if (test_case.GetTestInfo(i)->is_reportable())\n      OutputXmlTestInfo(stream, test_case.name(), *test_case.GetTestInfo(i));\n  }\n  *stream << \"  </\" << kTestsuite << \">\\n\";\n}\n\n// Prints an XML summary of unit_test to output stream out.\nvoid XmlUnitTestResultPrinter::PrintXmlUnitTest(std::ostream* stream,\n                                                const UnitTest& unit_test) {\n  const std::string kTestsuites = \"testsuites\";\n\n  *stream << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\n  *stream << \"<\" << kTestsuites;\n\n  OutputXmlAttribute(stream, kTestsuites, \"tests\",\n                     StreamableToString(unit_test.reportable_test_count()));\n  OutputXmlAttribute(stream, kTestsuites, \"failures\",\n                     StreamableToString(unit_test.failed_test_count()));\n  OutputXmlAttribute(\n      stream, kTestsuites, \"disabled\",\n      StreamableToString(unit_test.reportable_disabled_test_count()));\n  OutputXmlAttribute(stream, kTestsuites, \"errors\", \"0\");\n  OutputXmlAttribute(\n      stream, kTestsuites, \"timestamp\",\n      FormatEpochTimeInMillisAsIso8601(unit_test.start_timestamp()));\n  OutputXmlAttribute(stream, kTestsuites, \"time\",\n                     FormatTimeInMillisAsSeconds(unit_test.elapsed_time()));\n\n  if (GTEST_FLAG(shuffle)) {\n    OutputXmlAttribute(stream, kTestsuites, \"random_seed\",\n                       StreamableToString(unit_test.random_seed()));\n  }\n  *stream << TestPropertiesAsXmlAttributes(unit_test.ad_hoc_test_result());\n\n  OutputXmlAttribute(stream, kTestsuites, \"name\", \"AllTests\");\n  *stream << \">\\n\";\n\n  for (int i = 0; i < unit_test.total_test_case_count(); ++i) {\n    if (unit_test.GetTestCase(i)->reportable_test_count() > 0)\n      PrintXmlTestCase(stream, *unit_test.GetTestCase(i));\n  }\n  *stream << \"</\" << kTestsuites << \">\\n\";\n}\n\nvoid XmlUnitTestResultPrinter::PrintXmlTestsList(\n    std::ostream* stream, const std::vector<TestCase*>& test_cases) {\n  const std::string kTestsuites = \"testsuites\";\n\n  *stream << \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\n  *stream << \"<\" << kTestsuites;\n\n  int total_tests = 0;\n  for (size_t i = 0; i < test_cases.size(); ++i) {\n    total_tests += test_cases[i]->total_test_count();\n  }\n  OutputXmlAttribute(stream, kTestsuites, \"tests\",\n                     StreamableToString(total_tests));\n  OutputXmlAttribute(stream, kTestsuites, \"name\", \"AllTests\");\n  *stream << \">\\n\";\n\n  for (size_t i = 0; i < test_cases.size(); ++i) {\n    PrintXmlTestCase(stream, *test_cases[i]);\n  }\n  *stream << \"</\" << kTestsuites << \">\\n\";\n}\n\n// Produces a string representing the test properties in a result as space\n// delimited XML attributes based on the property key=\"value\" pairs.\nstd::string XmlUnitTestResultPrinter::TestPropertiesAsXmlAttributes(\n    const TestResult& result) {\n  Message attributes;\n  for (int i = 0; i < result.test_property_count(); ++i) {\n    const TestProperty& property = result.GetTestProperty(i);\n    attributes << \" \" << property.key() << \"=\"\n        << \"\\\"\" << EscapeXmlAttribute(property.value()) << \"\\\"\";\n  }\n  return attributes.GetString();\n}\n\nvoid XmlUnitTestResultPrinter::OutputXmlTestProperties(\n    std::ostream* stream, const TestResult& result) {\n  const std::string kProperties = \"properties\";\n  const std::string kProperty = \"property\";\n\n  if (result.test_property_count() <= 0) {\n    return;\n  }\n\n  *stream << \"<\" << kProperties << \">\\n\";\n  for (int i = 0; i < result.test_property_count(); ++i) {\n    const TestProperty& property = result.GetTestProperty(i);\n    *stream << \"<\" << kProperty;\n    *stream << \" name=\\\"\" << EscapeXmlAttribute(property.key()) << \"\\\"\";\n    *stream << \" value=\\\"\" << EscapeXmlAttribute(property.value()) << \"\\\"\";\n    *stream << \"/>\\n\";\n  }\n  *stream << \"</\" << kProperties << \">\\n\";\n}\n\n// End XmlUnitTestResultPrinter\n\n// This class generates an JSON output file.\nclass JsonUnitTestResultPrinter : public EmptyTestEventListener {\n public:\n  explicit JsonUnitTestResultPrinter(const char* output_file);\n\n  virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration);\n\n  // Prints an JSON summary of all unit tests.\n  static void PrintJsonTestList(::std::ostream* stream,\n                                const std::vector<TestCase*>& test_cases);\n\n private:\n  // Returns an JSON-escaped copy of the input string str.\n  static std::string EscapeJson(const std::string& str);\n\n  //// Verifies that the given attribute belongs to the given element and\n  //// streams the attribute as JSON.\n  static void OutputJsonKey(std::ostream* stream,\n                            const std::string& element_name,\n                            const std::string& name,\n                            const std::string& value,\n                            const std::string& indent,\n                            bool comma = true);\n  static void OutputJsonKey(std::ostream* stream,\n                            const std::string& element_name,\n                            const std::string& name,\n                            int value,\n                            const std::string& indent,\n                            bool comma = true);\n\n  // Streams a JSON representation of a TestInfo object.\n  static void OutputJsonTestInfo(::std::ostream* stream,\n                                 const char* test_case_name,\n                                 const TestInfo& test_info);\n\n  // Prints a JSON representation of a TestCase object\n  static void PrintJsonTestCase(::std::ostream* stream,\n                                const TestCase& test_case);\n\n  // Prints a JSON summary of unit_test to output stream out.\n  static void PrintJsonUnitTest(::std::ostream* stream,\n                                const UnitTest& unit_test);\n\n  // Produces a string representing the test properties in a result as\n  // a JSON dictionary.\n  static std::string TestPropertiesAsJson(const TestResult& result,\n                                          const std::string& indent);\n\n  // The output file.\n  const std::string output_file_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(JsonUnitTestResultPrinter);\n};\n\n// Creates a new JsonUnitTestResultPrinter.\nJsonUnitTestResultPrinter::JsonUnitTestResultPrinter(const char* output_file)\n    : output_file_(output_file) {\n  if (output_file_.empty()) {\n    GTEST_LOG_(FATAL) << \"JSON output file may not be null\";\n  }\n}\n\nvoid JsonUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,\n                                                  int /*iteration*/) {\n  FILE* jsonout = OpenFileForWriting(output_file_);\n  std::stringstream stream;\n  PrintJsonUnitTest(&stream, unit_test);\n  fprintf(jsonout, \"%s\", StringStreamToString(&stream).c_str());\n  fclose(jsonout);\n}\n\n// Returns an JSON-escaped copy of the input string str.\nstd::string JsonUnitTestResultPrinter::EscapeJson(const std::string& str) {\n  Message m;\n\n  for (size_t i = 0; i < str.size(); ++i) {\n    const char ch = str[i];\n    switch (ch) {\n      case '\\\\':\n      case '\"':\n      case '/':\n        m << '\\\\' << ch;\n        break;\n      case '\\b':\n        m << \"\\\\b\";\n        break;\n      case '\\t':\n        m << \"\\\\t\";\n        break;\n      case '\\n':\n        m << \"\\\\n\";\n        break;\n      case '\\f':\n        m << \"\\\\f\";\n        break;\n      case '\\r':\n        m << \"\\\\r\";\n        break;\n      default:\n        if (ch < ' ') {\n          m << \"\\\\u00\" << String::FormatByte(static_cast<unsigned char>(ch));\n        } else {\n          m << ch;\n        }\n        break;\n    }\n  }\n\n  return m.GetString();\n}\n\n// The following routines generate an JSON representation of a UnitTest\n// object.\n\n// Formats the given time in milliseconds as seconds.\nstatic std::string FormatTimeInMillisAsDuration(TimeInMillis ms) {\n  ::std::stringstream ss;\n  ss << (static_cast<double>(ms) * 1e-3) << \"s\";\n  return ss.str();\n}\n\n// Converts the given epoch time in milliseconds to a date string in the\n// RFC3339 format, without the timezone information.\nstatic std::string FormatEpochTimeInMillisAsRFC3339(TimeInMillis ms) {\n  struct tm time_struct;\n  if (!PortableLocaltime(static_cast<time_t>(ms / 1000), &time_struct))\n    return \"\";\n  // YYYY-MM-DDThh:mm:ss\n  return StreamableToString(time_struct.tm_year + 1900) + \"-\" +\n      String::FormatIntWidth2(time_struct.tm_mon + 1) + \"-\" +\n      String::FormatIntWidth2(time_struct.tm_mday) + \"T\" +\n      String::FormatIntWidth2(time_struct.tm_hour) + \":\" +\n      String::FormatIntWidth2(time_struct.tm_min) + \":\" +\n      String::FormatIntWidth2(time_struct.tm_sec) + \"Z\";\n}\n\nstatic inline std::string Indent(int width) {\n  return std::string(width, ' ');\n}\n\nvoid JsonUnitTestResultPrinter::OutputJsonKey(\n    std::ostream* stream,\n    const std::string& element_name,\n    const std::string& name,\n    const std::string& value,\n    const std::string& indent,\n    bool comma) {\n  const std::vector<std::string>& allowed_names =\n      GetReservedAttributesForElement(element_name);\n\n  GTEST_CHECK_(std::find(allowed_names.begin(), allowed_names.end(), name) !=\n                   allowed_names.end())\n      << \"Key \\\"\" << name << \"\\\" is not allowed for value \\\"\" << element_name\n      << \"\\\".\";\n\n  *stream << indent << \"\\\"\" << name << \"\\\": \\\"\" << EscapeJson(value) << \"\\\"\";\n  if (comma)\n    *stream << \",\\n\";\n}\n\nvoid JsonUnitTestResultPrinter::OutputJsonKey(\n    std::ostream* stream,\n    const std::string& element_name,\n    const std::string& name,\n    int value,\n    const std::string& indent,\n    bool comma) {\n  const std::vector<std::string>& allowed_names =\n      GetReservedAttributesForElement(element_name);\n\n  GTEST_CHECK_(std::find(allowed_names.begin(), allowed_names.end(), name) !=\n                   allowed_names.end())\n      << \"Key \\\"\" << name << \"\\\" is not allowed for value \\\"\" << element_name\n      << \"\\\".\";\n\n  *stream << indent << \"\\\"\" << name << \"\\\": \" << StreamableToString(value);\n  if (comma)\n    *stream << \",\\n\";\n}\n\n// Prints a JSON representation of a TestInfo object.\nvoid JsonUnitTestResultPrinter::OutputJsonTestInfo(::std::ostream* stream,\n                                                   const char* test_case_name,\n                                                   const TestInfo& test_info) {\n  const TestResult& result = *test_info.result();\n  const std::string kTestcase = \"testcase\";\n  const std::string kIndent = Indent(10);\n\n  *stream << Indent(8) << \"{\\n\";\n  OutputJsonKey(stream, kTestcase, \"name\", test_info.name(), kIndent);\n\n  if (test_info.value_param() != NULL) {\n    OutputJsonKey(stream, kTestcase, \"value_param\",\n                  test_info.value_param(), kIndent);\n  }\n  if (test_info.type_param() != NULL) {\n    OutputJsonKey(stream, kTestcase, \"type_param\", test_info.type_param(),\n                  kIndent);\n  }\n  if (GTEST_FLAG(list_tests)) {\n    OutputJsonKey(stream, kTestcase, \"file\", test_info.file(), kIndent);\n    OutputJsonKey(stream, kTestcase, \"line\", test_info.line(), kIndent, false);\n    *stream << \"\\n\" << Indent(8) << \"}\";\n    return;\n  }\n\n  OutputJsonKey(stream, kTestcase, \"status\",\n                test_info.should_run() ? \"RUN\" : \"NOTRUN\", kIndent);\n  OutputJsonKey(stream, kTestcase, \"time\",\n                FormatTimeInMillisAsDuration(result.elapsed_time()), kIndent);\n  OutputJsonKey(stream, kTestcase, \"classname\", test_case_name, kIndent, false);\n  *stream << TestPropertiesAsJson(result, kIndent);\n\n  int failures = 0;\n  for (int i = 0; i < result.total_part_count(); ++i) {\n    const TestPartResult& part = result.GetTestPartResult(i);\n    if (part.failed()) {\n      *stream << \",\\n\";\n      if (++failures == 1) {\n        *stream << kIndent << \"\\\"\" << \"failures\" << \"\\\": [\\n\";\n      }\n      const std::string location =\n          internal::FormatCompilerIndependentFileLocation(part.file_name(),\n                                                          part.line_number());\n      const std::string message = EscapeJson(location + \"\\n\" + part.message());\n      *stream << kIndent << \"  {\\n\"\n              << kIndent << \"    \\\"failure\\\": \\\"\" << message << \"\\\",\\n\"\n              << kIndent << \"    \\\"type\\\": \\\"\\\"\\n\"\n              << kIndent << \"  }\";\n    }\n  }\n\n  if (failures > 0)\n    *stream << \"\\n\" << kIndent << \"]\";\n  *stream << \"\\n\" << Indent(8) << \"}\";\n}\n\n// Prints an JSON representation of a TestCase object\nvoid JsonUnitTestResultPrinter::PrintJsonTestCase(std::ostream* stream,\n                                                  const TestCase& test_case) {\n  const std::string kTestsuite = \"testsuite\";\n  const std::string kIndent = Indent(6);\n\n  *stream << Indent(4) << \"{\\n\";\n  OutputJsonKey(stream, kTestsuite, \"name\", test_case.name(), kIndent);\n  OutputJsonKey(stream, kTestsuite, \"tests\", test_case.reportable_test_count(),\n                kIndent);\n  if (!GTEST_FLAG(list_tests)) {\n    OutputJsonKey(stream, kTestsuite, \"failures\", test_case.failed_test_count(),\n                  kIndent);\n    OutputJsonKey(stream, kTestsuite, \"disabled\",\n                  test_case.reportable_disabled_test_count(), kIndent);\n    OutputJsonKey(stream, kTestsuite, \"errors\", 0, kIndent);\n    OutputJsonKey(stream, kTestsuite, \"time\",\n                  FormatTimeInMillisAsDuration(test_case.elapsed_time()),\n                  kIndent, false);\n    *stream << TestPropertiesAsJson(test_case.ad_hoc_test_result(), kIndent)\n            << \",\\n\";\n  }\n\n  *stream << kIndent << \"\\\"\" << kTestsuite << \"\\\": [\\n\";\n\n  bool comma = false;\n  for (int i = 0; i < test_case.total_test_count(); ++i) {\n    if (test_case.GetTestInfo(i)->is_reportable()) {\n      if (comma) {\n        *stream << \",\\n\";\n      } else {\n        comma = true;\n      }\n      OutputJsonTestInfo(stream, test_case.name(), *test_case.GetTestInfo(i));\n    }\n  }\n  *stream << \"\\n\" << kIndent << \"]\\n\" << Indent(4) << \"}\";\n}\n\n// Prints a JSON summary of unit_test to output stream out.\nvoid JsonUnitTestResultPrinter::PrintJsonUnitTest(std::ostream* stream,\n                                                  const UnitTest& unit_test) {\n  const std::string kTestsuites = \"testsuites\";\n  const std::string kIndent = Indent(2);\n  *stream << \"{\\n\";\n\n  OutputJsonKey(stream, kTestsuites, \"tests\", unit_test.reportable_test_count(),\n                kIndent);\n  OutputJsonKey(stream, kTestsuites, \"failures\", unit_test.failed_test_count(),\n                kIndent);\n  OutputJsonKey(stream, kTestsuites, \"disabled\",\n                unit_test.reportable_disabled_test_count(), kIndent);\n  OutputJsonKey(stream, kTestsuites, \"errors\", 0, kIndent);\n  if (GTEST_FLAG(shuffle)) {\n    OutputJsonKey(stream, kTestsuites, \"random_seed\", unit_test.random_seed(),\n                  kIndent);\n  }\n  OutputJsonKey(stream, kTestsuites, \"timestamp\",\n                FormatEpochTimeInMillisAsRFC3339(unit_test.start_timestamp()),\n                kIndent);\n  OutputJsonKey(stream, kTestsuites, \"time\",\n                FormatTimeInMillisAsDuration(unit_test.elapsed_time()), kIndent,\n                false);\n\n  *stream << TestPropertiesAsJson(unit_test.ad_hoc_test_result(), kIndent)\n          << \",\\n\";\n\n  OutputJsonKey(stream, kTestsuites, \"name\", \"AllTests\", kIndent);\n  *stream << kIndent << \"\\\"\" << kTestsuites << \"\\\": [\\n\";\n\n  bool comma = false;\n  for (int i = 0; i < unit_test.total_test_case_count(); ++i) {\n    if (unit_test.GetTestCase(i)->reportable_test_count() > 0) {\n      if (comma) {\n        *stream << \",\\n\";\n      } else {\n        comma = true;\n      }\n      PrintJsonTestCase(stream, *unit_test.GetTestCase(i));\n    }\n  }\n\n  *stream << \"\\n\" << kIndent << \"]\\n\" << \"}\\n\";\n}\n\nvoid JsonUnitTestResultPrinter::PrintJsonTestList(\n    std::ostream* stream, const std::vector<TestCase*>& test_cases) {\n  const std::string kTestsuites = \"testsuites\";\n  const std::string kIndent = Indent(2);\n  *stream << \"{\\n\";\n  int total_tests = 0;\n  for (size_t i = 0; i < test_cases.size(); ++i) {\n    total_tests += test_cases[i]->total_test_count();\n  }\n  OutputJsonKey(stream, kTestsuites, \"tests\", total_tests, kIndent);\n\n  OutputJsonKey(stream, kTestsuites, \"name\", \"AllTests\", kIndent);\n  *stream << kIndent << \"\\\"\" << kTestsuites << \"\\\": [\\n\";\n\n  for (size_t i = 0; i < test_cases.size(); ++i) {\n    if (i != 0) {\n      *stream << \",\\n\";\n    }\n    PrintJsonTestCase(stream, *test_cases[i]);\n  }\n\n  *stream << \"\\n\"\n          << kIndent << \"]\\n\"\n          << \"}\\n\";\n}\n// Produces a string representing the test properties in a result as\n// a JSON dictionary.\nstd::string JsonUnitTestResultPrinter::TestPropertiesAsJson(\n    const TestResult& result, const std::string& indent) {\n  Message attributes;\n  for (int i = 0; i < result.test_property_count(); ++i) {\n    const TestProperty& property = result.GetTestProperty(i);\n    attributes << \",\\n\" << indent << \"\\\"\" << property.key() << \"\\\": \"\n               << \"\\\"\" << EscapeJson(property.value()) << \"\\\"\";\n  }\n  return attributes.GetString();\n}\n\n// End JsonUnitTestResultPrinter\n\n#if GTEST_CAN_STREAM_RESULTS_\n\n// Checks if str contains '=', '&', '%' or '\\n' characters. If yes,\n// replaces them by \"%xx\" where xx is their hexadecimal value. For\n// example, replaces \"=\" with \"%3D\".  This algorithm is O(strlen(str))\n// in both time and space -- important as the input str may contain an\n// arbitrarily long test failure message and stack trace.\nstd::string StreamingListener::UrlEncode(const char* str) {\n  std::string result;\n  result.reserve(strlen(str) + 1);\n  for (char ch = *str; ch != '\\0'; ch = *++str) {\n    switch (ch) {\n      case '%':\n      case '=':\n      case '&':\n      case '\\n':\n        result.append(\"%\" + String::FormatByte(static_cast<unsigned char>(ch)));\n        break;\n      default:\n        result.push_back(ch);\n        break;\n    }\n  }\n  return result;\n}\n\nvoid StreamingListener::SocketWriter::MakeConnection() {\n  GTEST_CHECK_(sockfd_ == -1)\n      << \"MakeConnection() can't be called when there is already a connection.\";\n\n  addrinfo hints;\n  memset(&hints, 0, sizeof(hints));\n  hints.ai_family = AF_UNSPEC;    // To allow both IPv4 and IPv6 addresses.\n  hints.ai_socktype = SOCK_STREAM;\n  addrinfo* servinfo = NULL;\n\n  // Use the getaddrinfo() to get a linked list of IP addresses for\n  // the given host name.\n  const int error_num = getaddrinfo(\n      host_name_.c_str(), port_num_.c_str(), &hints, &servinfo);\n  if (error_num != 0) {\n    GTEST_LOG_(WARNING) << \"stream_result_to: getaddrinfo() failed: \"\n                        << gai_strerror(error_num);\n  }\n\n  // Loop through all the results and connect to the first we can.\n  for (addrinfo* cur_addr = servinfo; sockfd_ == -1 && cur_addr != NULL;\n       cur_addr = cur_addr->ai_next) {\n    sockfd_ = socket(\n        cur_addr->ai_family, cur_addr->ai_socktype, cur_addr->ai_protocol);\n    if (sockfd_ != -1) {\n      // Connect the client socket to the server socket.\n      if (connect(sockfd_, cur_addr->ai_addr, cur_addr->ai_addrlen) == -1) {\n        close(sockfd_);\n        sockfd_ = -1;\n      }\n    }\n  }\n\n  freeaddrinfo(servinfo);  // all done with this structure\n\n  if (sockfd_ == -1) {\n    GTEST_LOG_(WARNING) << \"stream_result_to: failed to connect to \"\n                        << host_name_ << \":\" << port_num_;\n  }\n}\n\n// End of class Streaming Listener\n#endif  // GTEST_CAN_STREAM_RESULTS__\n\n// class OsStackTraceGetter\n\nconst char* const OsStackTraceGetterInterface::kElidedFramesMarker =\n    \"... \" GTEST_NAME_ \" internal frames ...\";\n\nstd::string OsStackTraceGetter::CurrentStackTrace(int max_depth, int skip_count)\n    GTEST_LOCK_EXCLUDED_(mutex_) {\n#if GTEST_HAS_ABSL\n  std::string result;\n\n  if (max_depth <= 0) {\n    return result;\n  }\n\n  max_depth = std::min(max_depth, kMaxStackTraceDepth);\n\n  std::vector<void*> raw_stack(max_depth);\n  // Skips the frames requested by the caller, plus this function.\n  const int raw_stack_size =\n      absl::GetStackTrace(&raw_stack[0], max_depth, skip_count + 1);\n\n  void* caller_frame = nullptr;\n  {\n    MutexLock lock(&mutex_);\n    caller_frame = caller_frame_;\n  }\n\n  for (int i = 0; i < raw_stack_size; ++i) {\n    if (raw_stack[i] == caller_frame &&\n        !GTEST_FLAG(show_internal_stack_frames)) {\n      // Add a marker to the trace and stop adding frames.\n      absl::StrAppend(&result, kElidedFramesMarker, \"\\n\");\n      break;\n    }\n\n    char tmp[1024];\n    const char* symbol = \"(unknown)\";\n    if (absl::Symbolize(raw_stack[i], tmp, sizeof(tmp))) {\n      symbol = tmp;\n    }\n\n    char line[1024];\n    snprintf(line, sizeof(line), \"  %p: %s\\n\", raw_stack[i], symbol);\n    result += line;\n  }\n\n  return result;\n\n#else  // !GTEST_HAS_ABSL\n  static_cast<void>(max_depth);\n  static_cast<void>(skip_count);\n  return \"\";\n#endif  // GTEST_HAS_ABSL\n}\n\nvoid OsStackTraceGetter::UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_) {\n#if GTEST_HAS_ABSL\n  void* caller_frame = nullptr;\n  if (absl::GetStackTrace(&caller_frame, 1, 3) <= 0) {\n    caller_frame = nullptr;\n  }\n\n  MutexLock lock(&mutex_);\n  caller_frame_ = caller_frame;\n#endif  // GTEST_HAS_ABSL\n}\n\n// A helper class that creates the premature-exit file in its\n// constructor and deletes the file in its destructor.\nclass ScopedPrematureExitFile {\n public:\n  explicit ScopedPrematureExitFile(const char* premature_exit_filepath)\n      : premature_exit_filepath_(premature_exit_filepath ?\n                                 premature_exit_filepath : \"\") {\n    // If a path to the premature-exit file is specified...\n    if (!premature_exit_filepath_.empty()) {\n      // create the file with a single \"0\" character in it.  I/O\n      // errors are ignored as there's nothing better we can do and we\n      // don't want to fail the test because of this.\n      FILE* pfile = posix::FOpen(premature_exit_filepath, \"w\");\n      fwrite(\"0\", 1, 1, pfile);\n      fclose(pfile);\n    }\n  }\n\n  ~ScopedPrematureExitFile() {\n    if (!premature_exit_filepath_.empty()) {\n      int retval = remove(premature_exit_filepath_.c_str());\n      if (retval) {\n        GTEST_LOG_(ERROR) << \"Failed to remove premature exit filepath \\\"\"\n                          << premature_exit_filepath_ << \"\\\" with error \"\n                          << retval;\n      }\n    }\n  }\n\n private:\n  const std::string premature_exit_filepath_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedPrematureExitFile);\n};\n\n}  // namespace internal\n\n// class TestEventListeners\n\nTestEventListeners::TestEventListeners()\n    : repeater_(new internal::TestEventRepeater()),\n      default_result_printer_(NULL),\n      default_xml_generator_(NULL) {\n}\n\nTestEventListeners::~TestEventListeners() { delete repeater_; }\n\n// Returns the standard listener responsible for the default console\n// output.  Can be removed from the listeners list to shut down default\n// console output.  Note that removing this object from the listener list\n// with Release transfers its ownership to the user.\nvoid TestEventListeners::Append(TestEventListener* listener) {\n  repeater_->Append(listener);\n}\n\n// Removes the given event listener from the list and returns it.  It then\n// becomes the caller's responsibility to delete the listener. Returns\n// NULL if the listener is not found in the list.\nTestEventListener* TestEventListeners::Release(TestEventListener* listener) {\n  if (listener == default_result_printer_)\n    default_result_printer_ = NULL;\n  else if (listener == default_xml_generator_)\n    default_xml_generator_ = NULL;\n  return repeater_->Release(listener);\n}\n\n// Returns repeater that broadcasts the TestEventListener events to all\n// subscribers.\nTestEventListener* TestEventListeners::repeater() { return repeater_; }\n\n// Sets the default_result_printer attribute to the provided listener.\n// The listener is also added to the listener list and previous\n// default_result_printer is removed from it and deleted. The listener can\n// also be NULL in which case it will not be added to the list. Does\n// nothing if the previous and the current listener objects are the same.\nvoid TestEventListeners::SetDefaultResultPrinter(TestEventListener* listener) {\n  if (default_result_printer_ != listener) {\n    // It is an error to pass this method a listener that is already in the\n    // list.\n    delete Release(default_result_printer_);\n    default_result_printer_ = listener;\n    if (listener != NULL)\n      Append(listener);\n  }\n}\n\n// Sets the default_xml_generator attribute to the provided listener.  The\n// listener is also added to the listener list and previous\n// default_xml_generator is removed from it and deleted. The listener can\n// also be NULL in which case it will not be added to the list. Does\n// nothing if the previous and the current listener objects are the same.\nvoid TestEventListeners::SetDefaultXmlGenerator(TestEventListener* listener) {\n  if (default_xml_generator_ != listener) {\n    // It is an error to pass this method a listener that is already in the\n    // list.\n    delete Release(default_xml_generator_);\n    default_xml_generator_ = listener;\n    if (listener != NULL)\n      Append(listener);\n  }\n}\n\n// Controls whether events will be forwarded by the repeater to the\n// listeners in the list.\nbool TestEventListeners::EventForwardingEnabled() const {\n  return repeater_->forwarding_enabled();\n}\n\nvoid TestEventListeners::SuppressEventForwarding() {\n  repeater_->set_forwarding_enabled(false);\n}\n\n// class UnitTest\n\n// Gets the singleton UnitTest object.  The first time this method is\n// called, a UnitTest object is constructed and returned.  Consecutive\n// calls will return the same object.\n//\n// We don't protect this under mutex_ as a user is not supposed to\n// call this before main() starts, from which point on the return\n// value will never change.\nUnitTest* UnitTest::GetInstance() {\n  // When compiled with MSVC 7.1 in optimized mode, destroying the\n  // UnitTest object upon exiting the program messes up the exit code,\n  // causing successful tests to appear failed.  We have to use a\n  // different implementation in this case to bypass the compiler bug.\n  // This implementation makes the compiler happy, at the cost of\n  // leaking the UnitTest object.\n\n  // CodeGear C++Builder insists on a public destructor for the\n  // default implementation.  Use this implementation to keep good OO\n  // design with private destructor.\n\n#if (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)\n  static UnitTest* const instance = new UnitTest;\n  return instance;\n#else\n  static UnitTest instance;\n  return &instance;\n#endif  // (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__)\n}\n\n// Gets the number of successful test cases.\nint UnitTest::successful_test_case_count() const {\n  return impl()->successful_test_case_count();\n}\n\n// Gets the number of failed test cases.\nint UnitTest::failed_test_case_count() const {\n  return impl()->failed_test_case_count();\n}\n\n// Gets the number of all test cases.\nint UnitTest::total_test_case_count() const {\n  return impl()->total_test_case_count();\n}\n\n// Gets the number of all test cases that contain at least one test\n// that should run.\nint UnitTest::test_case_to_run_count() const {\n  return impl()->test_case_to_run_count();\n}\n\n// Gets the number of successful tests.\nint UnitTest::successful_test_count() const {\n  return impl()->successful_test_count();\n}\n\n// Gets the number of failed tests.\nint UnitTest::failed_test_count() const { return impl()->failed_test_count(); }\n\n// Gets the number of disabled tests that will be reported in the XML report.\nint UnitTest::reportable_disabled_test_count() const {\n  return impl()->reportable_disabled_test_count();\n}\n\n// Gets the number of disabled tests.\nint UnitTest::disabled_test_count() const {\n  return impl()->disabled_test_count();\n}\n\n// Gets the number of tests to be printed in the XML report.\nint UnitTest::reportable_test_count() const {\n  return impl()->reportable_test_count();\n}\n\n// Gets the number of all tests.\nint UnitTest::total_test_count() const { return impl()->total_test_count(); }\n\n// Gets the number of tests that should run.\nint UnitTest::test_to_run_count() const { return impl()->test_to_run_count(); }\n\n// Gets the time of the test program start, in ms from the start of the\n// UNIX epoch.\ninternal::TimeInMillis UnitTest::start_timestamp() const {\n    return impl()->start_timestamp();\n}\n\n// Gets the elapsed time, in milliseconds.\ninternal::TimeInMillis UnitTest::elapsed_time() const {\n  return impl()->elapsed_time();\n}\n\n// Returns true iff the unit test passed (i.e. all test cases passed).\nbool UnitTest::Passed() const { return impl()->Passed(); }\n\n// Returns true iff the unit test failed (i.e. some test case failed\n// or something outside of all tests failed).\nbool UnitTest::Failed() const { return impl()->Failed(); }\n\n// Gets the i-th test case among all the test cases. i can range from 0 to\n// total_test_case_count() - 1. If i is not in that range, returns NULL.\nconst TestCase* UnitTest::GetTestCase(int i) const {\n  return impl()->GetTestCase(i);\n}\n\n// Returns the TestResult containing information on test failures and\n// properties logged outside of individual test cases.\nconst TestResult& UnitTest::ad_hoc_test_result() const {\n  return *impl()->ad_hoc_test_result();\n}\n\n// Gets the i-th test case among all the test cases. i can range from 0 to\n// total_test_case_count() - 1. If i is not in that range, returns NULL.\nTestCase* UnitTest::GetMutableTestCase(int i) {\n  return impl()->GetMutableTestCase(i);\n}\n\n// Returns the list of event listeners that can be used to track events\n// inside Google Test.\nTestEventListeners& UnitTest::listeners() {\n  return *impl()->listeners();\n}\n\n// Registers and returns a global test environment.  When a test\n// program is run, all global test environments will be set-up in the\n// order they were registered.  After all tests in the program have\n// finished, all global test environments will be torn-down in the\n// *reverse* order they were registered.\n//\n// The UnitTest object takes ownership of the given environment.\n//\n// We don't protect this under mutex_, as we only support calling it\n// from the main thread.\nEnvironment* UnitTest::AddEnvironment(Environment* env) {\n  if (env == NULL) {\n    return NULL;\n  }\n\n  impl_->environments().push_back(env);\n  return env;\n}\n\n// Adds a TestPartResult to the current TestResult object.  All Google Test\n// assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call\n// this to report their results.  The user code should use the\n// assertion macros instead of calling this directly.\nvoid UnitTest::AddTestPartResult(\n    TestPartResult::Type result_type,\n    const char* file_name,\n    int line_number,\n    const std::string& message,\n    const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {\n  Message msg;\n  msg << message;\n\n  internal::MutexLock lock(&mutex_);\n  if (impl_->gtest_trace_stack().size() > 0) {\n    msg << \"\\n\" << GTEST_NAME_ << \" trace:\";\n\n    for (int i = static_cast<int>(impl_->gtest_trace_stack().size());\n         i > 0; --i) {\n      const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];\n      msg << \"\\n\" << internal::FormatFileLocation(trace.file, trace.line)\n          << \" \" << trace.message;\n    }\n  }\n\n  if (os_stack_trace.c_str() != NULL && !os_stack_trace.empty()) {\n    msg << internal::kStackTraceMarker << os_stack_trace;\n  }\n\n  const TestPartResult result =\n    TestPartResult(result_type, file_name, line_number,\n                   msg.GetString().c_str());\n  impl_->GetTestPartResultReporterForCurrentThread()->\n      ReportTestPartResult(result);\n\n  if (result_type != TestPartResult::kSuccess) {\n    // gtest_break_on_failure takes precedence over\n    // gtest_throw_on_failure.  This allows a user to set the latter\n    // in the code (perhaps in order to use Google Test assertions\n    // with another testing framework) and specify the former on the\n    // command line for debugging.\n    if (GTEST_FLAG(break_on_failure)) {\n#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT\n      // Using DebugBreak on Windows allows gtest to still break into a debugger\n      // when a failure happens and both the --gtest_break_on_failure and\n      // the --gtest_catch_exceptions flags are specified.\n      DebugBreak();\n#elif (!defined(__native_client__)) &&            \\\n    ((defined(__clang__) || defined(__GNUC__)) && \\\n     (defined(__x86_64__) || defined(__i386__)))\n      // with clang/gcc we can achieve the same effect on x86 by invoking int3\n      asm(\"int3\");\n#else\n      // Dereference NULL through a volatile pointer to prevent the compiler\n      // from removing. We use this rather than abort() or __builtin_trap() for\n      // portability: Symbian doesn't implement abort() well, and some debuggers\n      // don't correctly trap abort().\n      *static_cast<volatile int*>(NULL) = 1;\n#endif  // GTEST_OS_WINDOWS\n    } else if (GTEST_FLAG(throw_on_failure)) {\n#if GTEST_HAS_EXCEPTIONS\n      throw internal::GoogleTestFailureException(result);\n#else\n      // We cannot call abort() as it generates a pop-up in debug mode\n      // that cannot be suppressed in VC 7.1 or below.\n      exit(1);\n#endif\n    }\n  }\n}\n\n// Adds a TestProperty to the current TestResult object when invoked from\n// inside a test, to current TestCase's ad_hoc_test_result_ when invoked\n// from SetUpTestCase or TearDownTestCase, or to the global property set\n// when invoked elsewhere.  If the result already contains a property with\n// the same key, the value will be updated.\nvoid UnitTest::RecordProperty(const std::string& key,\n                              const std::string& value) {\n  impl_->RecordProperty(TestProperty(key, value));\n}\n\n// Runs all tests in this UnitTest object and prints the result.\n// Returns 0 if successful, or 1 otherwise.\n//\n// We don't protect this under mutex_, as we only support calling it\n// from the main thread.\nint UnitTest::Run() {\n  const bool in_death_test_child_process =\n      internal::GTEST_FLAG(internal_run_death_test).length() > 0;\n\n  // Google Test implements this protocol for catching that a test\n  // program exits before returning control to Google Test:\n  //\n  //   1. Upon start, Google Test creates a file whose absolute path\n  //      is specified by the environment variable\n  //      TEST_PREMATURE_EXIT_FILE.\n  //   2. When Google Test has finished its work, it deletes the file.\n  //\n  // This allows a test runner to set TEST_PREMATURE_EXIT_FILE before\n  // running a Google-Test-based test program and check the existence\n  // of the file at the end of the test execution to see if it has\n  // exited prematurely.\n\n  // If we are in the child process of a death test, don't\n  // create/delete the premature exit file, as doing so is unnecessary\n  // and will confuse the parent process.  Otherwise, create/delete\n  // the file upon entering/leaving this function.  If the program\n  // somehow exits before this function has a chance to return, the\n  // premature-exit file will be left undeleted, causing a test runner\n  // that understands the premature-exit-file protocol to report the\n  // test as having failed.\n  const internal::ScopedPrematureExitFile premature_exit_file(\n      in_death_test_child_process ?\n      NULL : internal::posix::GetEnv(\"TEST_PREMATURE_EXIT_FILE\"));\n\n  // Captures the value of GTEST_FLAG(catch_exceptions).  This value will be\n  // used for the duration of the program.\n  impl()->set_catch_exceptions(GTEST_FLAG(catch_exceptions));\n\n#if GTEST_OS_WINDOWS\n  // Either the user wants Google Test to catch exceptions thrown by the\n  // tests or this is executing in the context of death test child\n  // process. In either case the user does not want to see pop-up dialogs\n  // about crashes - they are expected.\n  if (impl()->catch_exceptions() || in_death_test_child_process) {\n# if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT\n    // SetErrorMode doesn't exist on CE.\n    SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT |\n                 SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);\n# endif  // !GTEST_OS_WINDOWS_MOBILE\n\n# if (defined(_MSC_VER) || GTEST_OS_WINDOWS_MINGW) && !GTEST_OS_WINDOWS_MOBILE\n    // Death test children can be terminated with _abort().  On Windows,\n    // _abort() can show a dialog with a warning message.  This forces the\n    // abort message to go to stderr instead.\n    _set_error_mode(_OUT_TO_STDERR);\n# endif\n\n# if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE\n    // In the debug version, Visual Studio pops up a separate dialog\n    // offering a choice to debug the aborted program. We need to suppress\n    // this dialog or it will pop up for every EXPECT/ASSERT_DEATH statement\n    // executed. Google Test will notify the user of any unexpected\n    // failure via stderr.\n    //\n    // VC++ doesn't define _set_abort_behavior() prior to the version 8.0.\n    // Users of prior VC versions shall suffer the agony and pain of\n    // clicking through the countless debug dialogs.\n    // FIXME: find a way to suppress the abort dialog() in the\n    // debug mode when compiled with VC 7.1 or lower.\n    if (!GTEST_FLAG(break_on_failure))\n      _set_abort_behavior(\n          0x0,                                    // Clear the following flags:\n          _WRITE_ABORT_MSG | _CALL_REPORTFAULT);  // pop-up window, core dump.\n# endif\n  }\n#endif  // GTEST_OS_WINDOWS\n\n  return internal::HandleExceptionsInMethodIfSupported(\n      impl(),\n      &internal::UnitTestImpl::RunAllTests,\n      \"auxiliary test code (environments or event listeners)\") ? 0 : 1;\n}\n\n// Returns the working directory when the first TEST() or TEST_F() was\n// executed.\nconst char* UnitTest::original_working_dir() const {\n  return impl_->original_working_dir_.c_str();\n}\n\n// Returns the TestCase object for the test that's currently running,\n// or NULL if no test is running.\nconst TestCase* UnitTest::current_test_case() const\n    GTEST_LOCK_EXCLUDED_(mutex_) {\n  internal::MutexLock lock(&mutex_);\n  return impl_->current_test_case();\n}\n\n// Returns the TestInfo object for the test that's currently running,\n// or NULL if no test is running.\nconst TestInfo* UnitTest::current_test_info() const\n    GTEST_LOCK_EXCLUDED_(mutex_) {\n  internal::MutexLock lock(&mutex_);\n  return impl_->current_test_info();\n}\n\n// Returns the random seed used at the start of the current test run.\nint UnitTest::random_seed() const { return impl_->random_seed(); }\n\n// Returns ParameterizedTestCaseRegistry object used to keep track of\n// value-parameterized tests and instantiate and register them.\ninternal::ParameterizedTestCaseRegistry&\n    UnitTest::parameterized_test_registry()\n        GTEST_LOCK_EXCLUDED_(mutex_) {\n  return impl_->parameterized_test_registry();\n}\n\n// Creates an empty UnitTest.\nUnitTest::UnitTest() {\n  impl_ = new internal::UnitTestImpl(this);\n}\n\n// Destructor of UnitTest.\nUnitTest::~UnitTest() {\n  delete impl_;\n}\n\n// Pushes a trace defined by SCOPED_TRACE() on to the per-thread\n// Google Test trace stack.\nvoid UnitTest::PushGTestTrace(const internal::TraceInfo& trace)\n    GTEST_LOCK_EXCLUDED_(mutex_) {\n  internal::MutexLock lock(&mutex_);\n  impl_->gtest_trace_stack().push_back(trace);\n}\n\n// Pops a trace from the per-thread Google Test trace stack.\nvoid UnitTest::PopGTestTrace()\n    GTEST_LOCK_EXCLUDED_(mutex_) {\n  internal::MutexLock lock(&mutex_);\n  impl_->gtest_trace_stack().pop_back();\n}\n\nnamespace internal {\n\nUnitTestImpl::UnitTestImpl(UnitTest* parent)\n    : parent_(parent),\n      GTEST_DISABLE_MSC_WARNINGS_PUSH_(4355 /* using this in initializer */)\n      default_global_test_part_result_reporter_(this),\n      default_per_thread_test_part_result_reporter_(this),\n      GTEST_DISABLE_MSC_WARNINGS_POP_()\n      global_test_part_result_repoter_(\n          &default_global_test_part_result_reporter_),\n      per_thread_test_part_result_reporter_(\n          &default_per_thread_test_part_result_reporter_),\n      parameterized_test_registry_(),\n      parameterized_tests_registered_(false),\n      last_death_test_case_(-1),\n      current_test_case_(NULL),\n      current_test_info_(NULL),\n      ad_hoc_test_result_(),\n      os_stack_trace_getter_(NULL),\n      post_flag_parse_init_performed_(false),\n      random_seed_(0),  // Will be overridden by the flag before first use.\n      random_(0),  // Will be reseeded before first use.\n      start_timestamp_(0),\n      elapsed_time_(0),\n#if GTEST_HAS_DEATH_TEST\n      death_test_factory_(new DefaultDeathTestFactory),\n#endif\n      // Will be overridden by the flag before first use.\n      catch_exceptions_(false) {\n  listeners()->SetDefaultResultPrinter(new PrettyUnitTestResultPrinter);\n}\n\nUnitTestImpl::~UnitTestImpl() {\n  // Deletes every TestCase.\n  ForEach(test_cases_, internal::Delete<TestCase>);\n\n  // Deletes every Environment.\n  ForEach(environments_, internal::Delete<Environment>);\n\n  delete os_stack_trace_getter_;\n}\n\n// Adds a TestProperty to the current TestResult object when invoked in a\n// context of a test, to current test case's ad_hoc_test_result when invoke\n// from SetUpTestCase/TearDownTestCase, or to the global property set\n// otherwise.  If the result already contains a property with the same key,\n// the value will be updated.\nvoid UnitTestImpl::RecordProperty(const TestProperty& test_property) {\n  std::string xml_element;\n  TestResult* test_result;  // TestResult appropriate for property recording.\n\n  if (current_test_info_ != NULL) {\n    xml_element = \"testcase\";\n    test_result = &(current_test_info_->result_);\n  } else if (current_test_case_ != NULL) {\n    xml_element = \"testsuite\";\n    test_result = &(current_test_case_->ad_hoc_test_result_);\n  } else {\n    xml_element = \"testsuites\";\n    test_result = &ad_hoc_test_result_;\n  }\n  test_result->RecordProperty(xml_element, test_property);\n}\n\n#if GTEST_HAS_DEATH_TEST\n// Disables event forwarding if the control is currently in a death test\n// subprocess. Must not be called before InitGoogleTest.\nvoid UnitTestImpl::SuppressTestEventsIfInSubprocess() {\n  if (internal_run_death_test_flag_.get() != NULL)\n    listeners()->SuppressEventForwarding();\n}\n#endif  // GTEST_HAS_DEATH_TEST\n\n// Initializes event listeners performing XML output as specified by\n// UnitTestOptions. Must not be called before InitGoogleTest.\nvoid UnitTestImpl::ConfigureXmlOutput() {\n  const std::string& output_format = UnitTestOptions::GetOutputFormat();\n  if (output_format == \"xml\") {\n    listeners()->SetDefaultXmlGenerator(new XmlUnitTestResultPrinter(\n        UnitTestOptions::GetAbsolutePathToOutputFile().c_str()));\n  } else if (output_format == \"json\") {\n    listeners()->SetDefaultXmlGenerator(new JsonUnitTestResultPrinter(\n        UnitTestOptions::GetAbsolutePathToOutputFile().c_str()));\n  } else if (output_format != \"\") {\n    GTEST_LOG_(WARNING) << \"WARNING: unrecognized output format \\\"\"\n                        << output_format << \"\\\" ignored.\";\n  }\n}\n\n#if GTEST_CAN_STREAM_RESULTS_\n// Initializes event listeners for streaming test results in string form.\n// Must not be called before InitGoogleTest.\nvoid UnitTestImpl::ConfigureStreamingOutput() {\n  const std::string& target = GTEST_FLAG(stream_result_to);\n  if (!target.empty()) {\n    const size_t pos = target.find(':');\n    if (pos != std::string::npos) {\n      listeners()->Append(new StreamingListener(target.substr(0, pos),\n                                                target.substr(pos+1)));\n    } else {\n      GTEST_LOG_(WARNING) << \"unrecognized streaming target \\\"\" << target\n                          << \"\\\" ignored.\";\n    }\n  }\n}\n#endif  // GTEST_CAN_STREAM_RESULTS_\n\n// Performs initialization dependent upon flag values obtained in\n// ParseGoogleTestFlagsOnly.  Is called from InitGoogleTest after the call to\n// ParseGoogleTestFlagsOnly.  In case a user neglects to call InitGoogleTest\n// this function is also called from RunAllTests.  Since this function can be\n// called more than once, it has to be idempotent.\nvoid UnitTestImpl::PostFlagParsingInit() {\n  // Ensures that this function does not execute more than once.\n  if (!post_flag_parse_init_performed_) {\n    post_flag_parse_init_performed_ = true;\n\n#if defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)\n    // Register to send notifications about key process state changes.\n    listeners()->Append(new GTEST_CUSTOM_TEST_EVENT_LISTENER_());\n#endif  // defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)\n\n#if GTEST_HAS_DEATH_TEST\n    InitDeathTestSubprocessControlInfo();\n    SuppressTestEventsIfInSubprocess();\n#endif  // GTEST_HAS_DEATH_TEST\n\n    // Registers parameterized tests. This makes parameterized tests\n    // available to the UnitTest reflection API without running\n    // RUN_ALL_TESTS.\n    RegisterParameterizedTests();\n\n    // Configures listeners for XML output. This makes it possible for users\n    // to shut down the default XML output before invoking RUN_ALL_TESTS.\n    ConfigureXmlOutput();\n\n#if GTEST_CAN_STREAM_RESULTS_\n    // Configures listeners for streaming test results to the specified server.\n    ConfigureStreamingOutput();\n#endif  // GTEST_CAN_STREAM_RESULTS_\n\n#if GTEST_HAS_ABSL\n    if (GTEST_FLAG(install_failure_signal_handler)) {\n      absl::FailureSignalHandlerOptions options;\n      absl::InstallFailureSignalHandler(options);\n    }\n#endif  // GTEST_HAS_ABSL\n  }\n}\n\n// A predicate that checks the name of a TestCase against a known\n// value.\n//\n// This is used for implementation of the UnitTest class only.  We put\n// it in the anonymous namespace to prevent polluting the outer\n// namespace.\n//\n// TestCaseNameIs is copyable.\nclass TestCaseNameIs {\n public:\n  // Constructor.\n  explicit TestCaseNameIs(const std::string& name)\n      : name_(name) {}\n\n  // Returns true iff the name of test_case matches name_.\n  bool operator()(const TestCase* test_case) const {\n    return test_case != NULL && strcmp(test_case->name(), name_.c_str()) == 0;\n  }\n\n private:\n  std::string name_;\n};\n\n// Finds and returns a TestCase with the given name.  If one doesn't\n// exist, creates one and returns it.  It's the CALLER'S\n// RESPONSIBILITY to ensure that this function is only called WHEN THE\n// TESTS ARE NOT SHUFFLED.\n//\n// Arguments:\n//\n//   test_case_name: name of the test case\n//   type_param:     the name of the test case's type parameter, or NULL if\n//                   this is not a typed or a type-parameterized test case.\n//   set_up_tc:      pointer to the function that sets up the test case\n//   tear_down_tc:   pointer to the function that tears down the test case\nTestCase* UnitTestImpl::GetTestCase(const char* test_case_name,\n                                    const char* type_param,\n                                    Test::SetUpTestCaseFunc set_up_tc,\n                                    Test::TearDownTestCaseFunc tear_down_tc) {\n  // Can we find a TestCase with the given name?\n  const std::vector<TestCase*>::const_reverse_iterator test_case =\n      std::find_if(test_cases_.rbegin(), test_cases_.rend(),\n                   TestCaseNameIs(test_case_name));\n\n  if (test_case != test_cases_.rend())\n    return *test_case;\n\n  // No.  Let's create one.\n  TestCase* const new_test_case =\n      new TestCase(test_case_name, type_param, set_up_tc, tear_down_tc);\n\n  // Is this a death test case?\n  if (internal::UnitTestOptions::MatchesFilter(test_case_name,\n                                               kDeathTestCaseFilter)) {\n    // Yes.  Inserts the test case after the last death test case\n    // defined so far.  This only works when the test cases haven't\n    // been shuffled.  Otherwise we may end up running a death test\n    // after a non-death test.\n    ++last_death_test_case_;\n    test_cases_.insert(test_cases_.begin() + last_death_test_case_,\n                       new_test_case);\n  } else {\n    // No.  Appends to the end of the list.\n    test_cases_.push_back(new_test_case);\n  }\n\n  test_case_indices_.push_back(static_cast<int>(test_case_indices_.size()));\n  return new_test_case;\n}\n\n// Helpers for setting up / tearing down the given environment.  They\n// are for use in the ForEach() function.\nstatic void SetUpEnvironment(Environment* env) { env->SetUp(); }\nstatic void TearDownEnvironment(Environment* env) { env->TearDown(); }\n\n// Runs all tests in this UnitTest object, prints the result, and\n// returns true if all tests are successful.  If any exception is\n// thrown during a test, the test is considered to be failed, but the\n// rest of the tests will still be run.\n//\n// When parameterized tests are enabled, it expands and registers\n// parameterized tests first in RegisterParameterizedTests().\n// All other functions called from RunAllTests() may safely assume that\n// parameterized tests are ready to be counted and run.\nbool UnitTestImpl::RunAllTests() {\n  // True iff Google Test is initialized before RUN_ALL_TESTS() is called.\n  const bool gtest_is_initialized_before_run_all_tests = GTestIsInitialized();\n\n  // Do not run any test if the --help flag was specified.\n  if (g_help_flag)\n    return true;\n\n  // Repeats the call to the post-flag parsing initialization in case the\n  // user didn't call InitGoogleTest.\n  PostFlagParsingInit();\n\n  // Even if sharding is not on, test runners may want to use the\n  // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding\n  // protocol.\n  internal::WriteToShardStatusFileIfNeeded();\n\n  // True iff we are in a subprocess for running a thread-safe-style\n  // death test.\n  bool in_subprocess_for_death_test = false;\n\n#if GTEST_HAS_DEATH_TEST\n  in_subprocess_for_death_test = (internal_run_death_test_flag_.get() != NULL);\n# if defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)\n  if (in_subprocess_for_death_test) {\n    GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_();\n  }\n# endif  // defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)\n#endif  // GTEST_HAS_DEATH_TEST\n\n  const bool should_shard = ShouldShard(kTestTotalShards, kTestShardIndex,\n                                        in_subprocess_for_death_test);\n\n  // Compares the full test names with the filter to decide which\n  // tests to run.\n  const bool has_tests_to_run = FilterTests(should_shard\n                                              ? HONOR_SHARDING_PROTOCOL\n                                              : IGNORE_SHARDING_PROTOCOL) > 0;\n\n  // Lists the tests and exits if the --gtest_list_tests flag was specified.\n  if (GTEST_FLAG(list_tests)) {\n    // This must be called *after* FilterTests() has been called.\n    ListTestsMatchingFilter();\n    return true;\n  }\n\n  random_seed_ = GTEST_FLAG(shuffle) ?\n      GetRandomSeedFromFlag(GTEST_FLAG(random_seed)) : 0;\n\n  // True iff at least one test has failed.\n  bool failed = false;\n\n  TestEventListener* repeater = listeners()->repeater();\n\n  start_timestamp_ = GetTimeInMillis();\n  repeater->OnTestProgramStart(*parent_);\n\n  // How many times to repeat the tests?  We don't want to repeat them\n  // when we are inside the subprocess of a death test.\n  const int repeat = in_subprocess_for_death_test ? 1 : GTEST_FLAG(repeat);\n  // Repeats forever if the repeat count is negative.\n  const bool forever = repeat < 0;\n  for (int i = 0; forever || i != repeat; i++) {\n    // We want to preserve failures generated by ad-hoc test\n    // assertions executed before RUN_ALL_TESTS().\n    ClearNonAdHocTestResult();\n\n    const TimeInMillis start = GetTimeInMillis();\n\n    // Shuffles test cases and tests if requested.\n    if (has_tests_to_run && GTEST_FLAG(shuffle)) {\n      random()->Reseed(random_seed_);\n      // This should be done before calling OnTestIterationStart(),\n      // such that a test event listener can see the actual test order\n      // in the event.\n      ShuffleTests();\n    }\n\n    // Tells the unit test event listeners that the tests are about to start.\n    repeater->OnTestIterationStart(*parent_, i);\n\n    // Runs each test case if there is at least one test to run.\n    if (has_tests_to_run) {\n      // Sets up all environments beforehand.\n      repeater->OnEnvironmentsSetUpStart(*parent_);\n      ForEach(environments_, SetUpEnvironment);\n      repeater->OnEnvironmentsSetUpEnd(*parent_);\n\n      // Runs the tests only if there was no fatal failure during global\n      // set-up.\n      if (!Test::HasFatalFailure()) {\n        for (int test_index = 0; test_index < total_test_case_count();\n             test_index++) {\n          GetMutableTestCase(test_index)->Run();\n        }\n      }\n\n      // Tears down all environments in reverse order afterwards.\n      repeater->OnEnvironmentsTearDownStart(*parent_);\n      std::for_each(environments_.rbegin(), environments_.rend(),\n                    TearDownEnvironment);\n      repeater->OnEnvironmentsTearDownEnd(*parent_);\n    }\n\n    elapsed_time_ = GetTimeInMillis() - start;\n\n    // Tells the unit test event listener that the tests have just finished.\n    repeater->OnTestIterationEnd(*parent_, i);\n\n    // Gets the result and clears it.\n    if (!Passed()) {\n      failed = true;\n    }\n\n    // Restores the original test order after the iteration.  This\n    // allows the user to quickly repro a failure that happens in the\n    // N-th iteration without repeating the first (N - 1) iterations.\n    // This is not enclosed in \"if (GTEST_FLAG(shuffle)) { ... }\", in\n    // case the user somehow changes the value of the flag somewhere\n    // (it's always safe to unshuffle the tests).\n    UnshuffleTests();\n\n    if (GTEST_FLAG(shuffle)) {\n      // Picks a new random seed for each iteration.\n      random_seed_ = GetNextRandomSeed(random_seed_);\n    }\n  }\n\n  repeater->OnTestProgramEnd(*parent_);\n\n  if (!gtest_is_initialized_before_run_all_tests) {\n    ColoredPrintf(\n        COLOR_RED,\n        \"\\nIMPORTANT NOTICE - DO NOT IGNORE:\\n\"\n        \"This test program did NOT call \" GTEST_INIT_GOOGLE_TEST_NAME_\n        \"() before calling RUN_ALL_TESTS(). This is INVALID. Soon \" GTEST_NAME_\n        \" will start to enforce the valid usage. \"\n        \"Please fix it ASAP, or IT WILL START TO FAIL.\\n\");  // NOLINT\n#if GTEST_FOR_GOOGLE_\n    ColoredPrintf(COLOR_RED,\n                  \"For more details, see http://wiki/Main/ValidGUnitMain.\\n\");\n#endif  // GTEST_FOR_GOOGLE_\n  }\n\n  return !failed;\n}\n\n// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file\n// if the variable is present. If a file already exists at this location, this\n// function will write over it. If the variable is present, but the file cannot\n// be created, prints an error and exits.\nvoid WriteToShardStatusFileIfNeeded() {\n  const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile);\n  if (test_shard_file != NULL) {\n    FILE* const file = posix::FOpen(test_shard_file, \"w\");\n    if (file == NULL) {\n      ColoredPrintf(COLOR_RED,\n                    \"Could not write to the test shard status file \\\"%s\\\" \"\n                    \"specified by the %s environment variable.\\n\",\n                    test_shard_file, kTestShardStatusFile);\n      fflush(stdout);\n      exit(EXIT_FAILURE);\n    }\n    fclose(file);\n  }\n}\n\n// Checks whether sharding is enabled by examining the relevant\n// environment variable values. If the variables are present,\n// but inconsistent (i.e., shard_index >= total_shards), prints\n// an error and exits. If in_subprocess_for_death_test, sharding is\n// disabled because it must only be applied to the original test\n// process. Otherwise, we could filter out death tests we intended to execute.\nbool ShouldShard(const char* total_shards_env,\n                 const char* shard_index_env,\n                 bool in_subprocess_for_death_test) {\n  if (in_subprocess_for_death_test) {\n    return false;\n  }\n\n  const Int32 total_shards = Int32FromEnvOrDie(total_shards_env, -1);\n  const Int32 shard_index = Int32FromEnvOrDie(shard_index_env, -1);\n\n  if (total_shards == -1 && shard_index == -1) {\n    return false;\n  } else if (total_shards == -1 && shard_index != -1) {\n    const Message msg = Message()\n      << \"Invalid environment variables: you have \"\n      << kTestShardIndex << \" = \" << shard_index\n      << \", but have left \" << kTestTotalShards << \" unset.\\n\";\n    ColoredPrintf(COLOR_RED, msg.GetString().c_str());\n    fflush(stdout);\n    exit(EXIT_FAILURE);\n  } else if (total_shards != -1 && shard_index == -1) {\n    const Message msg = Message()\n      << \"Invalid environment variables: you have \"\n      << kTestTotalShards << \" = \" << total_shards\n      << \", but have left \" << kTestShardIndex << \" unset.\\n\";\n    ColoredPrintf(COLOR_RED, msg.GetString().c_str());\n    fflush(stdout);\n    exit(EXIT_FAILURE);\n  } else if (shard_index < 0 || shard_index >= total_shards) {\n    const Message msg = Message()\n      << \"Invalid environment variables: we require 0 <= \"\n      << kTestShardIndex << \" < \" << kTestTotalShards\n      << \", but you have \" << kTestShardIndex << \"=\" << shard_index\n      << \", \" << kTestTotalShards << \"=\" << total_shards << \".\\n\";\n    ColoredPrintf(COLOR_RED, msg.GetString().c_str());\n    fflush(stdout);\n    exit(EXIT_FAILURE);\n  }\n\n  return total_shards > 1;\n}\n\n// Parses the environment variable var as an Int32. If it is unset,\n// returns default_val. If it is not an Int32, prints an error\n// and aborts.\nInt32 Int32FromEnvOrDie(const char* var, Int32 default_val) {\n  const char* str_val = posix::GetEnv(var);\n  if (str_val == NULL) {\n    return default_val;\n  }\n\n  Int32 result;\n  if (!ParseInt32(Message() << \"The value of environment variable \" << var,\n                  str_val, &result)) {\n    exit(EXIT_FAILURE);\n  }\n  return result;\n}\n\n// Given the total number of shards, the shard index, and the test id,\n// returns true iff the test should be run on this shard. The test id is\n// some arbitrary but unique non-negative integer assigned to each test\n// method. Assumes that 0 <= shard_index < total_shards.\nbool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) {\n  return (test_id % total_shards) == shard_index;\n}\n\n// Compares the name of each test with the user-specified filter to\n// decide whether the test should be run, then records the result in\n// each TestCase and TestInfo object.\n// If shard_tests == true, further filters tests based on sharding\n// variables in the environment - see\n// https://github.com/google/googletest/blob/master/googletest/docs/advanced.md\n// . Returns the number of tests that should run.\nint UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {\n  const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ?\n      Int32FromEnvOrDie(kTestTotalShards, -1) : -1;\n  const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ?\n      Int32FromEnvOrDie(kTestShardIndex, -1) : -1;\n\n  // num_runnable_tests are the number of tests that will\n  // run across all shards (i.e., match filter and are not disabled).\n  // num_selected_tests are the number of tests to be run on\n  // this shard.\n  int num_runnable_tests = 0;\n  int num_selected_tests = 0;\n  for (size_t i = 0; i < test_cases_.size(); i++) {\n    TestCase* const test_case = test_cases_[i];\n    const std::string &test_case_name = test_case->name();\n    test_case->set_should_run(false);\n\n    for (size_t j = 0; j < test_case->test_info_list().size(); j++) {\n      TestInfo* const test_info = test_case->test_info_list()[j];\n      const std::string test_name(test_info->name());\n      // A test is disabled if test case name or test name matches\n      // kDisableTestFilter.\n      const bool is_disabled =\n          internal::UnitTestOptions::MatchesFilter(test_case_name,\n                                                   kDisableTestFilter) ||\n          internal::UnitTestOptions::MatchesFilter(test_name,\n                                                   kDisableTestFilter);\n      test_info->is_disabled_ = is_disabled;\n\n      const bool matches_filter =\n          internal::UnitTestOptions::FilterMatchesTest(test_case_name,\n                                                       test_name);\n      test_info->matches_filter_ = matches_filter;\n\n      const bool is_runnable =\n          (GTEST_FLAG(also_run_disabled_tests) || !is_disabled) &&\n          matches_filter;\n\n      const bool is_in_another_shard =\n          shard_tests != IGNORE_SHARDING_PROTOCOL &&\n          !ShouldRunTestOnShard(total_shards, shard_index, num_runnable_tests);\n      test_info->is_in_another_shard_ = is_in_another_shard;\n      const bool is_selected = is_runnable && !is_in_another_shard;\n\n      num_runnable_tests += is_runnable;\n      num_selected_tests += is_selected;\n\n      test_info->should_run_ = is_selected;\n      test_case->set_should_run(test_case->should_run() || is_selected);\n    }\n  }\n  return num_selected_tests;\n}\n\n// Prints the given C-string on a single line by replacing all '\\n'\n// characters with string \"\\\\n\".  If the output takes more than\n// max_length characters, only prints the first max_length characters\n// and \"...\".\nstatic void PrintOnOneLine(const char* str, int max_length) {\n  if (str != NULL) {\n    for (int i = 0; *str != '\\0'; ++str) {\n      if (i >= max_length) {\n        printf(\"...\");\n        break;\n      }\n      if (*str == '\\n') {\n        printf(\"\\\\n\");\n        i += 2;\n      } else {\n        printf(\"%c\", *str);\n        ++i;\n      }\n    }\n  }\n}\n\n// Prints the names of the tests matching the user-specified filter flag.\nvoid UnitTestImpl::ListTestsMatchingFilter() {\n  // Print at most this many characters for each type/value parameter.\n  const int kMaxParamLength = 250;\n\n  for (size_t i = 0; i < test_cases_.size(); i++) {\n    const TestCase* const test_case = test_cases_[i];\n    bool printed_test_case_name = false;\n\n    for (size_t j = 0; j < test_case->test_info_list().size(); j++) {\n      const TestInfo* const test_info =\n          test_case->test_info_list()[j];\n      if (test_info->matches_filter_) {\n        if (!printed_test_case_name) {\n          printed_test_case_name = true;\n          printf(\"%s.\", test_case->name());\n          if (test_case->type_param() != NULL) {\n            printf(\"  # %s = \", kTypeParamLabel);\n            // We print the type parameter on a single line to make\n            // the output easy to parse by a program.\n            PrintOnOneLine(test_case->type_param(), kMaxParamLength);\n          }\n          printf(\"\\n\");\n        }\n        printf(\"  %s\", test_info->name());\n        if (test_info->value_param() != NULL) {\n          printf(\"  # %s = \", kValueParamLabel);\n          // We print the value parameter on a single line to make the\n          // output easy to parse by a program.\n          PrintOnOneLine(test_info->value_param(), kMaxParamLength);\n        }\n        printf(\"\\n\");\n      }\n    }\n  }\n  fflush(stdout);\n  const std::string& output_format = UnitTestOptions::GetOutputFormat();\n  if (output_format == \"xml\" || output_format == \"json\") {\n    FILE* fileout = OpenFileForWriting(\n        UnitTestOptions::GetAbsolutePathToOutputFile().c_str());\n    std::stringstream stream;\n    if (output_format == \"xml\") {\n      XmlUnitTestResultPrinter(\n          UnitTestOptions::GetAbsolutePathToOutputFile().c_str())\n          .PrintXmlTestsList(&stream, test_cases_);\n    } else if (output_format == \"json\") {\n      JsonUnitTestResultPrinter(\n          UnitTestOptions::GetAbsolutePathToOutputFile().c_str())\n          .PrintJsonTestList(&stream, test_cases_);\n    }\n    fprintf(fileout, \"%s\", StringStreamToString(&stream).c_str());\n    fclose(fileout);\n  }\n}\n\n// Sets the OS stack trace getter.\n//\n// Does nothing if the input and the current OS stack trace getter are\n// the same; otherwise, deletes the old getter and makes the input the\n// current getter.\nvoid UnitTestImpl::set_os_stack_trace_getter(\n    OsStackTraceGetterInterface* getter) {\n  if (os_stack_trace_getter_ != getter) {\n    delete os_stack_trace_getter_;\n    os_stack_trace_getter_ = getter;\n  }\n}\n\n// Returns the current OS stack trace getter if it is not NULL;\n// otherwise, creates an OsStackTraceGetter, makes it the current\n// getter, and returns it.\nOsStackTraceGetterInterface* UnitTestImpl::os_stack_trace_getter() {\n  if (os_stack_trace_getter_ == NULL) {\n#ifdef GTEST_OS_STACK_TRACE_GETTER_\n    os_stack_trace_getter_ = new GTEST_OS_STACK_TRACE_GETTER_;\n#else\n    os_stack_trace_getter_ = new OsStackTraceGetter;\n#endif  // GTEST_OS_STACK_TRACE_GETTER_\n  }\n\n  return os_stack_trace_getter_;\n}\n\n// Returns the most specific TestResult currently running.\nTestResult* UnitTestImpl::current_test_result() {\n  if (current_test_info_ != NULL) {\n    return &current_test_info_->result_;\n  }\n  if (current_test_case_ != NULL) {\n    return &current_test_case_->ad_hoc_test_result_;\n  }\n  return &ad_hoc_test_result_;\n}\n\n// Shuffles all test cases, and the tests within each test case,\n// making sure that death tests are still run first.\nvoid UnitTestImpl::ShuffleTests() {\n  // Shuffles the death test cases.\n  ShuffleRange(random(), 0, last_death_test_case_ + 1, &test_case_indices_);\n\n  // Shuffles the non-death test cases.\n  ShuffleRange(random(), last_death_test_case_ + 1,\n               static_cast<int>(test_cases_.size()), &test_case_indices_);\n\n  // Shuffles the tests inside each test case.\n  for (size_t i = 0; i < test_cases_.size(); i++) {\n    test_cases_[i]->ShuffleTests(random());\n  }\n}\n\n// Restores the test cases and tests to their order before the first shuffle.\nvoid UnitTestImpl::UnshuffleTests() {\n  for (size_t i = 0; i < test_cases_.size(); i++) {\n    // Unshuffles the tests in each test case.\n    test_cases_[i]->UnshuffleTests();\n    // Resets the index of each test case.\n    test_case_indices_[i] = static_cast<int>(i);\n  }\n}\n\n// Returns the current OS stack trace as an std::string.\n//\n// The maximum number of stack frames to be included is specified by\n// the gtest_stack_trace_depth flag.  The skip_count parameter\n// specifies the number of top frames to be skipped, which doesn't\n// count against the number of frames to be included.\n//\n// For example, if Foo() calls Bar(), which in turn calls\n// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in\n// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.\nstd::string GetCurrentOsStackTraceExceptTop(UnitTest* /*unit_test*/,\n                                            int skip_count) {\n  // We pass skip_count + 1 to skip this wrapper function in addition\n  // to what the user really wants to skip.\n  return GetUnitTestImpl()->CurrentOsStackTraceExceptTop(skip_count + 1);\n}\n\n// Used by the GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ macro to\n// suppress unreachable code warnings.\nnamespace {\nclass ClassUniqueToAlwaysTrue {};\n}\n\nbool IsTrue(bool condition) { return condition; }\n\nbool AlwaysTrue() {\n#if GTEST_HAS_EXCEPTIONS\n  // This condition is always false so AlwaysTrue() never actually throws,\n  // but it makes the compiler think that it may throw.\n  if (IsTrue(false))\n    throw ClassUniqueToAlwaysTrue();\n#endif  // GTEST_HAS_EXCEPTIONS\n  return true;\n}\n\n// If *pstr starts with the given prefix, modifies *pstr to be right\n// past the prefix and returns true; otherwise leaves *pstr unchanged\n// and returns false.  None of pstr, *pstr, and prefix can be NULL.\nbool SkipPrefix(const char* prefix, const char** pstr) {\n  const size_t prefix_len = strlen(prefix);\n  if (strncmp(*pstr, prefix, prefix_len) == 0) {\n    *pstr += prefix_len;\n    return true;\n  }\n  return false;\n}\n\n// Parses a string as a command line flag.  The string should have\n// the format \"--flag=value\".  When def_optional is true, the \"=value\"\n// part can be omitted.\n//\n// Returns the value of the flag, or NULL if the parsing failed.\nstatic const char* ParseFlagValue(const char* str, const char* flag,\n                                  bool def_optional) {\n  // str and flag must not be NULL.\n  if (str == NULL || flag == NULL) return NULL;\n\n  // The flag must start with \"--\" followed by GTEST_FLAG_PREFIX_.\n  const std::string flag_str = std::string(\"--\") + GTEST_FLAG_PREFIX_ + flag;\n  const size_t flag_len = flag_str.length();\n  if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL;\n\n  // Skips the flag name.\n  const char* flag_end = str + flag_len;\n\n  // When def_optional is true, it's OK to not have a \"=value\" part.\n  if (def_optional && (flag_end[0] == '\\0')) {\n    return flag_end;\n  }\n\n  // If def_optional is true and there are more characters after the\n  // flag name, or if def_optional is false, there must be a '=' after\n  // the flag name.\n  if (flag_end[0] != '=') return NULL;\n\n  // Returns the string after \"=\".\n  return flag_end + 1;\n}\n\n// Parses a string for a bool flag, in the form of either\n// \"--flag=value\" or \"--flag\".\n//\n// In the former case, the value is taken as true as long as it does\n// not start with '0', 'f', or 'F'.\n//\n// In the latter case, the value is taken as true.\n//\n// On success, stores the value of the flag in *value, and returns\n// true.  On failure, returns false without changing *value.\nstatic bool ParseBoolFlag(const char* str, const char* flag, bool* value) {\n  // Gets the value of the flag as a string.\n  const char* const value_str = ParseFlagValue(str, flag, true);\n\n  // Aborts if the parsing failed.\n  if (value_str == NULL) return false;\n\n  // Converts the string value to a bool.\n  *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');\n  return true;\n}\n\n// Parses a string for an Int32 flag, in the form of\n// \"--flag=value\".\n//\n// On success, stores the value of the flag in *value, and returns\n// true.  On failure, returns false without changing *value.\nbool ParseInt32Flag(const char* str, const char* flag, Int32* value) {\n  // Gets the value of the flag as a string.\n  const char* const value_str = ParseFlagValue(str, flag, false);\n\n  // Aborts if the parsing failed.\n  if (value_str == NULL) return false;\n\n  // Sets *value to the value of the flag.\n  return ParseInt32(Message() << \"The value of flag --\" << flag,\n                    value_str, value);\n}\n\n// Parses a string for a string flag, in the form of\n// \"--flag=value\".\n//\n// On success, stores the value of the flag in *value, and returns\n// true.  On failure, returns false without changing *value.\ntemplate <typename String>\nstatic bool ParseStringFlag(const char* str, const char* flag, String* value) {\n  // Gets the value of the flag as a string.\n  const char* const value_str = ParseFlagValue(str, flag, false);\n\n  // Aborts if the parsing failed.\n  if (value_str == NULL) return false;\n\n  // Sets *value to the value of the flag.\n  *value = value_str;\n  return true;\n}\n\n// Determines whether a string has a prefix that Google Test uses for its\n// flags, i.e., starts with GTEST_FLAG_PREFIX_ or GTEST_FLAG_PREFIX_DASH_.\n// If Google Test detects that a command line flag has its prefix but is not\n// recognized, it will print its help message. Flags starting with\n// GTEST_INTERNAL_PREFIX_ followed by \"internal_\" are considered Google Test\n// internal flags and do not trigger the help message.\nstatic bool HasGoogleTestFlagPrefix(const char* str) {\n  return (SkipPrefix(\"--\", &str) ||\n          SkipPrefix(\"-\", &str) ||\n          SkipPrefix(\"/\", &str)) &&\n         !SkipPrefix(GTEST_FLAG_PREFIX_ \"internal_\", &str) &&\n         (SkipPrefix(GTEST_FLAG_PREFIX_, &str) ||\n          SkipPrefix(GTEST_FLAG_PREFIX_DASH_, &str));\n}\n\n// Prints a string containing code-encoded text.  The following escape\n// sequences can be used in the string to control the text color:\n//\n//   @@    prints a single '@' character.\n//   @R    changes the color to red.\n//   @G    changes the color to green.\n//   @Y    changes the color to yellow.\n//   @D    changes to the default terminal text color.\n//\n// FIXME: Write tests for this once we add stdout\n// capturing to Google Test.\nstatic void PrintColorEncoded(const char* str) {\n  GTestColor color = COLOR_DEFAULT;  // The current color.\n\n  // Conceptually, we split the string into segments divided by escape\n  // sequences.  Then we print one segment at a time.  At the end of\n  // each iteration, the str pointer advances to the beginning of the\n  // next segment.\n  for (;;) {\n    const char* p = strchr(str, '@');\n    if (p == NULL) {\n      ColoredPrintf(color, \"%s\", str);\n      return;\n    }\n\n    ColoredPrintf(color, \"%s\", std::string(str, p).c_str());\n\n    const char ch = p[1];\n    str = p + 2;\n    if (ch == '@') {\n      ColoredPrintf(color, \"@\");\n    } else if (ch == 'D') {\n      color = COLOR_DEFAULT;\n    } else if (ch == 'R') {\n      color = COLOR_RED;\n    } else if (ch == 'G') {\n      color = COLOR_GREEN;\n    } else if (ch == 'Y') {\n      color = COLOR_YELLOW;\n    } else {\n      --str;\n    }\n  }\n}\n\nstatic const char kColorEncodedHelpMessage[] =\n\"This program contains tests written using \" GTEST_NAME_ \". You can use the\\n\"\n\"following command line flags to control its behavior:\\n\"\n\"\\n\"\n\"Test Selection:\\n\"\n\"  @G--\" GTEST_FLAG_PREFIX_ \"list_tests@D\\n\"\n\"      List the names of all tests instead of running them. The name of\\n\"\n\"      TEST(Foo, Bar) is \\\"Foo.Bar\\\".\\n\"\n\"  @G--\" GTEST_FLAG_PREFIX_ \"filter=@YPOSTIVE_PATTERNS\"\n    \"[@G-@YNEGATIVE_PATTERNS]@D\\n\"\n\"      Run only the tests whose name matches one of the positive patterns but\\n\"\n\"      none of the negative patterns. '?' matches any single character; '*'\\n\"\n\"      matches any substring; ':' separates two patterns.\\n\"\n\"  @G--\" GTEST_FLAG_PREFIX_ \"also_run_disabled_tests@D\\n\"\n\"      Run all disabled tests too.\\n\"\n\"\\n\"\n\"Test Execution:\\n\"\n\"  @G--\" GTEST_FLAG_PREFIX_ \"repeat=@Y[COUNT]@D\\n\"\n\"      Run the tests repeatedly; use a negative count to repeat forever.\\n\"\n\"  @G--\" GTEST_FLAG_PREFIX_ \"shuffle@D\\n\"\n\"      Randomize tests' orders on every iteration.\\n\"\n\"  @G--\" GTEST_FLAG_PREFIX_ \"random_seed=@Y[NUMBER]@D\\n\"\n\"      Random number seed to use for shuffling test orders (between 1 and\\n\"\n\"      99999, or 0 to use a seed based on the current time).\\n\"\n\"\\n\"\n\"Test Output:\\n\"\n\"  @G--\" GTEST_FLAG_PREFIX_ \"color=@Y(@Gyes@Y|@Gno@Y|@Gauto@Y)@D\\n\"\n\"      Enable/disable colored output. The default is @Gauto@D.\\n\"\n\"  -@G-\" GTEST_FLAG_PREFIX_ \"print_time=0@D\\n\"\n\"      Don't print the elapsed time of each test.\\n\"\n\"  @G--\" GTEST_FLAG_PREFIX_ \"output=@Y(@Gjson@Y|@Gxml@Y)[@G:@YDIRECTORY_PATH@G\"\n    GTEST_PATH_SEP_ \"@Y|@G:@YFILE_PATH]@D\\n\"\n\"      Generate a JSON or XML report in the given directory or with the given\\n\"\n\"      file name. @YFILE_PATH@D defaults to @Gtest_details.xml@D.\\n\"\n# if GTEST_CAN_STREAM_RESULTS_\n\"  @G--\" GTEST_FLAG_PREFIX_ \"stream_result_to=@YHOST@G:@YPORT@D\\n\"\n\"      Stream test results to the given server.\\n\"\n# endif  // GTEST_CAN_STREAM_RESULTS_\n\"\\n\"\n\"Assertion Behavior:\\n\"\n# if GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS\n\"  @G--\" GTEST_FLAG_PREFIX_ \"death_test_style=@Y(@Gfast@Y|@Gthreadsafe@Y)@D\\n\"\n\"      Set the default death test style.\\n\"\n# endif  // GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS\n\"  @G--\" GTEST_FLAG_PREFIX_ \"break_on_failure@D\\n\"\n\"      Turn assertion failures into debugger break-points.\\n\"\n\"  @G--\" GTEST_FLAG_PREFIX_ \"throw_on_failure@D\\n\"\n\"      Turn assertion failures into C++ exceptions for use by an external\\n\"\n\"      test framework.\\n\"\n\"  @G--\" GTEST_FLAG_PREFIX_ \"catch_exceptions=0@D\\n\"\n\"      Do not report exceptions as test failures. Instead, allow them\\n\"\n\"      to crash the program or throw a pop-up (on Windows).\\n\"\n\"\\n\"\n\"Except for @G--\" GTEST_FLAG_PREFIX_ \"list_tests@D, you can alternatively set \"\n    \"the corresponding\\n\"\n\"environment variable of a flag (all letters in upper-case). For example, to\\n\"\n\"disable colored text output, you can either specify @G--\" GTEST_FLAG_PREFIX_\n    \"color=no@D or set\\n\"\n\"the @G\" GTEST_FLAG_PREFIX_UPPER_ \"COLOR@D environment variable to @Gno@D.\\n\"\n\"\\n\"\n\"For more information, please read the \" GTEST_NAME_ \" documentation at\\n\"\n\"@G\" GTEST_PROJECT_URL_ \"@D. If you find a bug in \" GTEST_NAME_ \"\\n\"\n\"(not one in your own code or tests), please report it to\\n\"\n\"@G<\" GTEST_DEV_EMAIL_ \">@D.\\n\";\n\nstatic bool ParseGoogleTestFlag(const char* const arg) {\n  return ParseBoolFlag(arg, kAlsoRunDisabledTestsFlag,\n                       &GTEST_FLAG(also_run_disabled_tests)) ||\n      ParseBoolFlag(arg, kBreakOnFailureFlag,\n                    &GTEST_FLAG(break_on_failure)) ||\n      ParseBoolFlag(arg, kCatchExceptionsFlag,\n                    &GTEST_FLAG(catch_exceptions)) ||\n      ParseStringFlag(arg, kColorFlag, &GTEST_FLAG(color)) ||\n      ParseStringFlag(arg, kDeathTestStyleFlag,\n                      &GTEST_FLAG(death_test_style)) ||\n      ParseBoolFlag(arg, kDeathTestUseFork,\n                    &GTEST_FLAG(death_test_use_fork)) ||\n      ParseStringFlag(arg, kFilterFlag, &GTEST_FLAG(filter)) ||\n      ParseStringFlag(arg, kInternalRunDeathTestFlag,\n                      &GTEST_FLAG(internal_run_death_test)) ||\n      ParseBoolFlag(arg, kListTestsFlag, &GTEST_FLAG(list_tests)) ||\n      ParseStringFlag(arg, kOutputFlag, &GTEST_FLAG(output)) ||\n      ParseBoolFlag(arg, kPrintTimeFlag, &GTEST_FLAG(print_time)) ||\n      ParseBoolFlag(arg, kPrintUTF8Flag, &GTEST_FLAG(print_utf8)) ||\n      ParseInt32Flag(arg, kRandomSeedFlag, &GTEST_FLAG(random_seed)) ||\n      ParseInt32Flag(arg, kRepeatFlag, &GTEST_FLAG(repeat)) ||\n      ParseBoolFlag(arg, kShuffleFlag, &GTEST_FLAG(shuffle)) ||\n      ParseInt32Flag(arg, kStackTraceDepthFlag,\n                     &GTEST_FLAG(stack_trace_depth)) ||\n      ParseStringFlag(arg, kStreamResultToFlag,\n                      &GTEST_FLAG(stream_result_to)) ||\n      ParseBoolFlag(arg, kThrowOnFailureFlag,\n                    &GTEST_FLAG(throw_on_failure));\n}\n\n#if GTEST_USE_OWN_FLAGFILE_FLAG_\nstatic void LoadFlagsFromFile(const std::string& path) {\n  FILE* flagfile = posix::FOpen(path.c_str(), \"r\");\n  if (!flagfile) {\n    GTEST_LOG_(FATAL) << \"Unable to open file \\\"\" << GTEST_FLAG(flagfile)\n                      << \"\\\"\";\n  }\n  std::string contents(ReadEntireFile(flagfile));\n  posix::FClose(flagfile);\n  std::vector<std::string> lines;\n  SplitString(contents, '\\n', &lines);\n  for (size_t i = 0; i < lines.size(); ++i) {\n    if (lines[i].empty())\n      continue;\n    if (!ParseGoogleTestFlag(lines[i].c_str()))\n      g_help_flag = true;\n  }\n}\n#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_\n\n// Parses the command line for Google Test flags, without initializing\n// other parts of Google Test.  The type parameter CharType can be\n// instantiated to either char or wchar_t.\ntemplate <typename CharType>\nvoid ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {\n  for (int i = 1; i < *argc; i++) {\n    const std::string arg_string = StreamableToString(argv[i]);\n    const char* const arg = arg_string.c_str();\n\n    using internal::ParseBoolFlag;\n    using internal::ParseInt32Flag;\n    using internal::ParseStringFlag;\n\n    bool remove_flag = false;\n    if (ParseGoogleTestFlag(arg)) {\n      remove_flag = true;\n#if GTEST_USE_OWN_FLAGFILE_FLAG_\n    } else if (ParseStringFlag(arg, kFlagfileFlag, &GTEST_FLAG(flagfile))) {\n      LoadFlagsFromFile(GTEST_FLAG(flagfile));\n      remove_flag = true;\n#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_\n    } else if (arg_string == \"--help\" || arg_string == \"-h\" ||\n               arg_string == \"-?\" || arg_string == \"/?\" ||\n               HasGoogleTestFlagPrefix(arg)) {\n      // Both help flag and unrecognized Google Test flags (excluding\n      // internal ones) trigger help display.\n      g_help_flag = true;\n    }\n\n    if (remove_flag) {\n      // Shift the remainder of the argv list left by one.  Note\n      // that argv has (*argc + 1) elements, the last one always being\n      // NULL.  The following loop moves the trailing NULL element as\n      // well.\n      for (int j = i; j != *argc; j++) {\n        argv[j] = argv[j + 1];\n      }\n\n      // Decrements the argument count.\n      (*argc)--;\n\n      // We also need to decrement the iterator as we just removed\n      // an element.\n      i--;\n    }\n  }\n\n  if (g_help_flag) {\n    // We print the help here instead of in RUN_ALL_TESTS(), as the\n    // latter may not be called at all if the user is using Google\n    // Test with another testing framework.\n    PrintColorEncoded(kColorEncodedHelpMessage);\n  }\n}\n\n// Parses the command line for Google Test flags, without initializing\n// other parts of Google Test.\nvoid ParseGoogleTestFlagsOnly(int* argc, char** argv) {\n  ParseGoogleTestFlagsOnlyImpl(argc, argv);\n\n  // Fix the value of *_NSGetArgc() on macOS, but iff\n  // *_NSGetArgv() == argv\n  // Only applicable to char** version of argv\n#if GTEST_OS_MAC\n#ifndef GTEST_OS_IOS\n  if (*_NSGetArgv() == argv) {\n    *_NSGetArgc() = *argc;\n  }\n#endif\n#endif\n}\nvoid ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv) {\n  ParseGoogleTestFlagsOnlyImpl(argc, argv);\n}\n\n// The internal implementation of InitGoogleTest().\n//\n// The type parameter CharType can be instantiated to either char or\n// wchar_t.\ntemplate <typename CharType>\nvoid InitGoogleTestImpl(int* argc, CharType** argv) {\n  // We don't want to run the initialization code twice.\n  if (GTestIsInitialized()) return;\n\n  if (*argc <= 0) return;\n\n  g_argvs.clear();\n  for (int i = 0; i != *argc; i++) {\n    g_argvs.push_back(StreamableToString(argv[i]));\n  }\n\n#if GTEST_HAS_ABSL\n  absl::InitializeSymbolizer(g_argvs[0].c_str());\n#endif  // GTEST_HAS_ABSL\n\n  ParseGoogleTestFlagsOnly(argc, argv);\n  GetUnitTestImpl()->PostFlagParsingInit();\n}\n\n}  // namespace internal\n\n// Initializes Google Test.  This must be called before calling\n// RUN_ALL_TESTS().  In particular, it parses a command line for the\n// flags that Google Test recognizes.  Whenever a Google Test flag is\n// seen, it is removed from argv, and *argc is decremented.\n//\n// No value is returned.  Instead, the Google Test flag variables are\n// updated.\n//\n// Calling the function for the second time has no user-visible effect.\nvoid InitGoogleTest(int* argc, char** argv) {\n#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)\n  GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv);\n#else  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)\n  internal::InitGoogleTestImpl(argc, argv);\n#endif  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)\n}\n\n// This overloaded version can be used in Windows programs compiled in\n// UNICODE mode.\nvoid InitGoogleTest(int* argc, wchar_t** argv) {\n#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)\n  GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv);\n#else  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)\n  internal::InitGoogleTestImpl(argc, argv);\n#endif  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)\n}\n\nstd::string TempDir() {\n#if defined(GTEST_CUSTOM_TEMPDIR_FUNCTION_)\n  return GTEST_CUSTOM_TEMPDIR_FUNCTION_();\n#endif\n\n#if GTEST_OS_WINDOWS_MOBILE\n  return \"\\\\temp\\\\\";\n#elif GTEST_OS_WINDOWS\n  const char* temp_dir = internal::posix::GetEnv(\"TEMP\");\n  if (temp_dir == NULL || temp_dir[0] == '\\0')\n    return \"\\\\temp\\\\\";\n  else if (temp_dir[strlen(temp_dir) - 1] == '\\\\')\n    return temp_dir;\n  else\n    return std::string(temp_dir) + \"\\\\\";\n#elif GTEST_OS_LINUX_ANDROID\n  return \"/sdcard/\";\n#else\n  return \"/tmp/\";\n#endif  // GTEST_OS_WINDOWS_MOBILE\n}\n\n// Class ScopedTrace\n\n// Pushes the given source file location and message onto a per-thread\n// trace stack maintained by Google Test.\nvoid ScopedTrace::PushTrace(const char* file, int line, std::string message) {\n  internal::TraceInfo trace;\n  trace.file = file;\n  trace.line = line;\n  trace.message.swap(message);\n\n  UnitTest::GetInstance()->PushGTestTrace(trace);\n}\n\n// Pops the info pushed by the c'tor.\nScopedTrace::~ScopedTrace()\n    GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) {\n  UnitTest::GetInstance()->PopGTestTrace();\n}\n\n}  // namespace testing\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n//\n// This file implements death tests.\n\n\n#if GTEST_HAS_DEATH_TEST\n\n# if GTEST_OS_MAC\n#  include <crt_externs.h>\n# endif  // GTEST_OS_MAC\n\n# include <errno.h>\n# include <fcntl.h>\n# include <limits.h>\n\n# if GTEST_OS_LINUX\n#  include <signal.h>\n# endif  // GTEST_OS_LINUX\n\n# include <stdarg.h>\n\n# if GTEST_OS_WINDOWS\n#  include <windows.h>\n# else\n#  include <sys/mman.h>\n#  include <sys/wait.h>\n# endif  // GTEST_OS_WINDOWS\n\n# if GTEST_OS_QNX\n#  include <spawn.h>\n# endif  // GTEST_OS_QNX\n\n# if GTEST_OS_FUCHSIA\n#  include <lib/fdio/io.h>\n#  include <lib/fdio/spawn.h>\n#  include <zircon/processargs.h>\n#  include <zircon/syscalls.h>\n#  include <zircon/syscalls/port.h>\n# endif  // GTEST_OS_FUCHSIA\n\n#endif  // GTEST_HAS_DEATH_TEST\n\n\nnamespace testing {\n\n// Constants.\n\n// The default death test style.\n//\n// This is defined in internal/gtest-port.h as \"fast\", but can be overridden by\n// a definition in internal/custom/gtest-port.h. The recommended value, which is\n// used internally at Google, is \"threadsafe\".\nstatic const char kDefaultDeathTestStyle[] = GTEST_DEFAULT_DEATH_TEST_STYLE;\n\nGTEST_DEFINE_string_(\n    death_test_style,\n    internal::StringFromGTestEnv(\"death_test_style\", kDefaultDeathTestStyle),\n    \"Indicates how to run a death test in a forked child process: \"\n    \"\\\"threadsafe\\\" (child process re-executes the test binary \"\n    \"from the beginning, running only the specific death test) or \"\n    \"\\\"fast\\\" (child process runs the death test immediately \"\n    \"after forking).\");\n\nGTEST_DEFINE_bool_(\n    death_test_use_fork,\n    internal::BoolFromGTestEnv(\"death_test_use_fork\", false),\n    \"Instructs to use fork()/_exit() instead of clone() in death tests. \"\n    \"Ignored and always uses fork() on POSIX systems where clone() is not \"\n    \"implemented. Useful when running under valgrind or similar tools if \"\n    \"those do not support clone(). Valgrind 3.3.1 will just fail if \"\n    \"it sees an unsupported combination of clone() flags. \"\n    \"It is not recommended to use this flag w/o valgrind though it will \"\n    \"work in 99% of the cases. Once valgrind is fixed, this flag will \"\n    \"most likely be removed.\");\n\nnamespace internal {\nGTEST_DEFINE_string_(\n    internal_run_death_test, \"\",\n    \"Indicates the file, line number, temporal index of \"\n    \"the single death test to run, and a file descriptor to \"\n    \"which a success code may be sent, all separated by \"\n    \"the '|' characters.  This flag is specified if and only if the current \"\n    \"process is a sub-process launched for running a thread-safe \"\n    \"death test.  FOR INTERNAL USE ONLY.\");\n}  // namespace internal\n\n#if GTEST_HAS_DEATH_TEST\n\nnamespace internal {\n\n// Valid only for fast death tests. Indicates the code is running in the\n// child process of a fast style death test.\n# if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA\nstatic bool g_in_fast_death_test_child = false;\n# endif\n\n// Returns a Boolean value indicating whether the caller is currently\n// executing in the context of the death test child process.  Tools such as\n// Valgrind heap checkers may need this to modify their behavior in death\n// tests.  IMPORTANT: This is an internal utility.  Using it may break the\n// implementation of death tests.  User code MUST NOT use it.\nbool InDeathTestChild() {\n# if GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA\n\n  // On Windows and Fuchsia, death tests are thread-safe regardless of the value\n  // of the death_test_style flag.\n  return !GTEST_FLAG(internal_run_death_test).empty();\n\n# else\n\n  if (GTEST_FLAG(death_test_style) == \"threadsafe\")\n    return !GTEST_FLAG(internal_run_death_test).empty();\n  else\n    return g_in_fast_death_test_child;\n#endif\n}\n\n}  // namespace internal\n\n// ExitedWithCode constructor.\nExitedWithCode::ExitedWithCode(int exit_code) : exit_code_(exit_code) {\n}\n\n// ExitedWithCode function-call operator.\nbool ExitedWithCode::operator()(int exit_status) const {\n# if GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA\n\n  return exit_status == exit_code_;\n\n# else\n\n  return WIFEXITED(exit_status) && WEXITSTATUS(exit_status) == exit_code_;\n\n# endif  // GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA\n}\n\n# if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA\n// KilledBySignal constructor.\nKilledBySignal::KilledBySignal(int signum) : signum_(signum) {\n}\n\n// KilledBySignal function-call operator.\nbool KilledBySignal::operator()(int exit_status) const {\n#  if defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)\n  {\n    bool result;\n    if (GTEST_KILLED_BY_SIGNAL_OVERRIDE_(signum_, exit_status, &result)) {\n      return result;\n    }\n  }\n#  endif  // defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)\n  return WIFSIGNALED(exit_status) && WTERMSIG(exit_status) == signum_;\n}\n# endif  // !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA\n\nnamespace internal {\n\n// Utilities needed for death tests.\n\n// Generates a textual description of a given exit code, in the format\n// specified by wait(2).\nstatic std::string ExitSummary(int exit_code) {\n  Message m;\n\n# if GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA\n\n  m << \"Exited with exit status \" << exit_code;\n\n# else\n\n  if (WIFEXITED(exit_code)) {\n    m << \"Exited with exit status \" << WEXITSTATUS(exit_code);\n  } else if (WIFSIGNALED(exit_code)) {\n    m << \"Terminated by signal \" << WTERMSIG(exit_code);\n  }\n#  ifdef WCOREDUMP\n  if (WCOREDUMP(exit_code)) {\n    m << \" (core dumped)\";\n  }\n#  endif\n# endif  // GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA\n\n  return m.GetString();\n}\n\n// Returns true if exit_status describes a process that was terminated\n// by a signal, or exited normally with a nonzero exit code.\nbool ExitedUnsuccessfully(int exit_status) {\n  return !ExitedWithCode(0)(exit_status);\n}\n\n# if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA\n// Generates a textual failure message when a death test finds more than\n// one thread running, or cannot determine the number of threads, prior\n// to executing the given statement.  It is the responsibility of the\n// caller not to pass a thread_count of 1.\nstatic std::string DeathTestThreadWarning(size_t thread_count) {\n  Message msg;\n  msg << \"Death tests use fork(), which is unsafe particularly\"\n      << \" in a threaded context. For this test, \" << GTEST_NAME_ << \" \";\n  if (thread_count == 0) {\n    msg << \"couldn't detect the number of threads.\";\n  } else {\n    msg << \"detected \" << thread_count << \" threads.\";\n  }\n  msg << \" See \"\n         \"https://github.com/google/googletest/blob/master/googletest/docs/\"\n         \"advanced.md#death-tests-and-threads\"\n      << \" for more explanation and suggested solutions, especially if\"\n      << \" this is the last message you see before your test times out.\";\n  return msg.GetString();\n}\n# endif  // !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA\n\n// Flag characters for reporting a death test that did not die.\nstatic const char kDeathTestLived = 'L';\nstatic const char kDeathTestReturned = 'R';\nstatic const char kDeathTestThrew = 'T';\nstatic const char kDeathTestInternalError = 'I';\n\n#if GTEST_OS_FUCHSIA\n\n// File descriptor used for the pipe in the child process.\nstatic const int kFuchsiaReadPipeFd = 3;\n\n#endif\n\n// An enumeration describing all of the possible ways that a death test can\n// conclude.  DIED means that the process died while executing the test\n// code; LIVED means that process lived beyond the end of the test code;\n// RETURNED means that the test statement attempted to execute a return\n// statement, which is not allowed; THREW means that the test statement\n// returned control by throwing an exception.  IN_PROGRESS means the test\n// has not yet concluded.\n// FIXME: Unify names and possibly values for\n// AbortReason, DeathTestOutcome, and flag characters above.\nenum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };\n\n// Routine for aborting the program which is safe to call from an\n// exec-style death test child process, in which case the error\n// message is propagated back to the parent process.  Otherwise, the\n// message is simply printed to stderr.  In either case, the program\n// then exits with status 1.\nstatic void DeathTestAbort(const std::string& message) {\n  // On a POSIX system, this function may be called from a threadsafe-style\n  // death test child process, which operates on a very small stack.  Use\n  // the heap for any additional non-minuscule memory requirements.\n  const InternalRunDeathTestFlag* const flag =\n      GetUnitTestImpl()->internal_run_death_test_flag();\n  if (flag != NULL) {\n    FILE* parent = posix::FDOpen(flag->write_fd(), \"w\");\n    fputc(kDeathTestInternalError, parent);\n    fprintf(parent, \"%s\", message.c_str());\n    fflush(parent);\n    _exit(1);\n  } else {\n    fprintf(stderr, \"%s\", message.c_str());\n    fflush(stderr);\n    posix::Abort();\n  }\n}\n\n// A replacement for CHECK that calls DeathTestAbort if the assertion\n// fails.\n# define GTEST_DEATH_TEST_CHECK_(expression) \\\n  do { \\\n    if (!::testing::internal::IsTrue(expression)) { \\\n      DeathTestAbort( \\\n          ::std::string(\"CHECK failed: File \") + __FILE__ +  \", line \" \\\n          + ::testing::internal::StreamableToString(__LINE__) + \": \" \\\n          + #expression); \\\n    } \\\n  } while (::testing::internal::AlwaysFalse())\n\n// This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for\n// evaluating any system call that fulfills two conditions: it must return\n// -1 on failure, and set errno to EINTR when it is interrupted and\n// should be tried again.  The macro expands to a loop that repeatedly\n// evaluates the expression as long as it evaluates to -1 and sets\n// errno to EINTR.  If the expression evaluates to -1 but errno is\n// something other than EINTR, DeathTestAbort is called.\n# define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \\\n  do { \\\n    int gtest_retval; \\\n    do { \\\n      gtest_retval = (expression); \\\n    } while (gtest_retval == -1 && errno == EINTR); \\\n    if (gtest_retval == -1) { \\\n      DeathTestAbort( \\\n          ::std::string(\"CHECK failed: File \") + __FILE__ + \", line \" \\\n          + ::testing::internal::StreamableToString(__LINE__) + \": \" \\\n          + #expression + \" != -1\"); \\\n    } \\\n  } while (::testing::internal::AlwaysFalse())\n\n// Returns the message describing the last system error in errno.\nstd::string GetLastErrnoDescription() {\n    return errno == 0 ? \"\" : posix::StrError(errno);\n}\n\n// This is called from a death test parent process to read a failure\n// message from the death test child process and log it with the FATAL\n// severity. On Windows, the message is read from a pipe handle. On other\n// platforms, it is read from a file descriptor.\nstatic void FailFromInternalError(int fd) {\n  Message error;\n  char buffer[256];\n  int num_read;\n\n  do {\n    while ((num_read = posix::Read(fd, buffer, 255)) > 0) {\n      buffer[num_read] = '\\0';\n      error << buffer;\n    }\n  } while (num_read == -1 && errno == EINTR);\n\n  if (num_read == 0) {\n    GTEST_LOG_(FATAL) << error.GetString();\n  } else {\n    const int last_error = errno;\n    GTEST_LOG_(FATAL) << \"Error while reading death test internal: \"\n                      << GetLastErrnoDescription() << \" [\" << last_error << \"]\";\n  }\n}\n\n// Death test constructor.  Increments the running death test count\n// for the current test.\nDeathTest::DeathTest() {\n  TestInfo* const info = GetUnitTestImpl()->current_test_info();\n  if (info == NULL) {\n    DeathTestAbort(\"Cannot run a death test outside of a TEST or \"\n                   \"TEST_F construct\");\n  }\n}\n\n// Creates and returns a death test by dispatching to the current\n// death test factory.\nbool DeathTest::Create(const char* statement, const RE* regex,\n                       const char* file, int line, DeathTest** test) {\n  return GetUnitTestImpl()->death_test_factory()->Create(\n      statement, regex, file, line, test);\n}\n\nconst char* DeathTest::LastMessage() {\n  return last_death_test_message_.c_str();\n}\n\nvoid DeathTest::set_last_death_test_message(const std::string& message) {\n  last_death_test_message_ = message;\n}\n\nstd::string DeathTest::last_death_test_message_;\n\n// Provides cross platform implementation for some death functionality.\nclass DeathTestImpl : public DeathTest {\n protected:\n  DeathTestImpl(const char* a_statement, const RE* a_regex)\n      : statement_(a_statement),\n        regex_(a_regex),\n        spawned_(false),\n        status_(-1),\n        outcome_(IN_PROGRESS),\n        read_fd_(-1),\n        write_fd_(-1) {}\n\n  // read_fd_ is expected to be closed and cleared by a derived class.\n  ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }\n\n  void Abort(AbortReason reason);\n  virtual bool Passed(bool status_ok);\n\n  const char* statement() const { return statement_; }\n  const RE* regex() const { return regex_; }\n  bool spawned() const { return spawned_; }\n  void set_spawned(bool is_spawned) { spawned_ = is_spawned; }\n  int status() const { return status_; }\n  void set_status(int a_status) { status_ = a_status; }\n  DeathTestOutcome outcome() const { return outcome_; }\n  void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; }\n  int read_fd() const { return read_fd_; }\n  void set_read_fd(int fd) { read_fd_ = fd; }\n  int write_fd() const { return write_fd_; }\n  void set_write_fd(int fd) { write_fd_ = fd; }\n\n  // Called in the parent process only. Reads the result code of the death\n  // test child process via a pipe, interprets it to set the outcome_\n  // member, and closes read_fd_.  Outputs diagnostics and terminates in\n  // case of unexpected codes.\n  void ReadAndInterpretStatusByte();\n\n private:\n  // The textual content of the code this object is testing.  This class\n  // doesn't own this string and should not attempt to delete it.\n  const char* const statement_;\n  // The regular expression which test output must match.  DeathTestImpl\n  // doesn't own this object and should not attempt to delete it.\n  const RE* const regex_;\n  // True if the death test child process has been successfully spawned.\n  bool spawned_;\n  // The exit status of the child process.\n  int status_;\n  // How the death test concluded.\n  DeathTestOutcome outcome_;\n  // Descriptor to the read end of the pipe to the child process.  It is\n  // always -1 in the child process.  The child keeps its write end of the\n  // pipe in write_fd_.\n  int read_fd_;\n  // Descriptor to the child's write end of the pipe to the parent process.\n  // It is always -1 in the parent process.  The parent keeps its end of the\n  // pipe in read_fd_.\n  int write_fd_;\n};\n\n// Called in the parent process only. Reads the result code of the death\n// test child process via a pipe, interprets it to set the outcome_\n// member, and closes read_fd_.  Outputs diagnostics and terminates in\n// case of unexpected codes.\nvoid DeathTestImpl::ReadAndInterpretStatusByte() {\n  char flag;\n  int bytes_read;\n\n  // The read() here blocks until data is available (signifying the\n  // failure of the death test) or until the pipe is closed (signifying\n  // its success), so it's okay to call this in the parent before\n  // the child process has exited.\n  do {\n    bytes_read = posix::Read(read_fd(), &flag, 1);\n  } while (bytes_read == -1 && errno == EINTR);\n\n  if (bytes_read == 0) {\n    set_outcome(DIED);\n  } else if (bytes_read == 1) {\n    switch (flag) {\n      case kDeathTestReturned:\n        set_outcome(RETURNED);\n        break;\n      case kDeathTestThrew:\n        set_outcome(THREW);\n        break;\n      case kDeathTestLived:\n        set_outcome(LIVED);\n        break;\n      case kDeathTestInternalError:\n        FailFromInternalError(read_fd());  // Does not return.\n        break;\n      default:\n        GTEST_LOG_(FATAL) << \"Death test child process reported \"\n                          << \"unexpected status byte (\"\n                          << static_cast<unsigned int>(flag) << \")\";\n    }\n  } else {\n    GTEST_LOG_(FATAL) << \"Read from death test child process failed: \"\n                      << GetLastErrnoDescription();\n  }\n  GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Close(read_fd()));\n  set_read_fd(-1);\n}\n\n// Signals that the death test code which should have exited, didn't.\n// Should be called only in a death test child process.\n// Writes a status byte to the child's status file descriptor, then\n// calls _exit(1).\nvoid DeathTestImpl::Abort(AbortReason reason) {\n  // The parent process considers the death test to be a failure if\n  // it finds any data in our pipe.  So, here we write a single flag byte\n  // to the pipe, then exit.\n  const char status_ch =\n      reason == TEST_DID_NOT_DIE ? kDeathTestLived :\n      reason == TEST_THREW_EXCEPTION ? kDeathTestThrew : kDeathTestReturned;\n\n  GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Write(write_fd(), &status_ch, 1));\n  // We are leaking the descriptor here because on some platforms (i.e.,\n  // when built as Windows DLL), destructors of global objects will still\n  // run after calling _exit(). On such systems, write_fd_ will be\n  // indirectly closed from the destructor of UnitTestImpl, causing double\n  // close if it is also closed here. On debug configurations, double close\n  // may assert. As there are no in-process buffers to flush here, we are\n  // relying on the OS to close the descriptor after the process terminates\n  // when the destructors are not run.\n  _exit(1);  // Exits w/o any normal exit hooks (we were supposed to crash)\n}\n\n// Returns an indented copy of stderr output for a death test.\n// This makes distinguishing death test output lines from regular log lines\n// much easier.\nstatic ::std::string FormatDeathTestOutput(const ::std::string& output) {\n  ::std::string ret;\n  for (size_t at = 0; ; ) {\n    const size_t line_end = output.find('\\n', at);\n    ret += \"[  DEATH   ] \";\n    if (line_end == ::std::string::npos) {\n      ret += output.substr(at);\n      break;\n    }\n    ret += output.substr(at, line_end + 1 - at);\n    at = line_end + 1;\n  }\n  return ret;\n}\n\n// Assesses the success or failure of a death test, using both private\n// members which have previously been set, and one argument:\n//\n// Private data members:\n//   outcome:  An enumeration describing how the death test\n//             concluded: DIED, LIVED, THREW, or RETURNED.  The death test\n//             fails in the latter three cases.\n//   status:   The exit status of the child process. On *nix, it is in the\n//             in the format specified by wait(2). On Windows, this is the\n//             value supplied to the ExitProcess() API or a numeric code\n//             of the exception that terminated the program.\n//   regex:    A regular expression object to be applied to\n//             the test's captured standard error output; the death test\n//             fails if it does not match.\n//\n// Argument:\n//   status_ok: true if exit_status is acceptable in the context of\n//              this particular death test, which fails if it is false\n//\n// Returns true iff all of the above conditions are met.  Otherwise, the\n// first failing condition, in the order given above, is the one that is\n// reported. Also sets the last death test message string.\nbool DeathTestImpl::Passed(bool status_ok) {\n  if (!spawned())\n    return false;\n\n  const std::string error_message = GetCapturedStderr();\n\n  bool success = false;\n  Message buffer;\n\n  buffer << \"Death test: \" << statement() << \"\\n\";\n  switch (outcome()) {\n    case LIVED:\n      buffer << \"    Result: failed to die.\\n\"\n             << \" Error msg:\\n\" << FormatDeathTestOutput(error_message);\n      break;\n    case THREW:\n      buffer << \"    Result: threw an exception.\\n\"\n             << \" Error msg:\\n\" << FormatDeathTestOutput(error_message);\n      break;\n    case RETURNED:\n      buffer << \"    Result: illegal return in test statement.\\n\"\n             << \" Error msg:\\n\" << FormatDeathTestOutput(error_message);\n      break;\n    case DIED:\n      if (status_ok) {\n# if GTEST_USES_PCRE\n        // PCRE regexes support embedded NULs.\n        const bool matched = RE::PartialMatch(error_message, *regex());\n# else\n        const bool matched = RE::PartialMatch(error_message.c_str(), *regex());\n# endif  // GTEST_USES_PCRE\n        if (matched) {\n          success = true;\n        } else {\n          buffer << \"    Result: died but not with expected error.\\n\"\n                 << \"  Expected: \" << regex()->pattern() << \"\\n\"\n                 << \"Actual msg:\\n\" << FormatDeathTestOutput(error_message);\n        }\n      } else {\n        buffer << \"    Result: died but not with expected exit code:\\n\"\n               << \"            \" << ExitSummary(status()) << \"\\n\"\n               << \"Actual msg:\\n\" << FormatDeathTestOutput(error_message);\n      }\n      break;\n    case IN_PROGRESS:\n    default:\n      GTEST_LOG_(FATAL)\n          << \"DeathTest::Passed somehow called before conclusion of test\";\n  }\n\n  DeathTest::set_last_death_test_message(buffer.GetString());\n  return success;\n}\n\n# if GTEST_OS_WINDOWS\n// WindowsDeathTest implements death tests on Windows. Due to the\n// specifics of starting new processes on Windows, death tests there are\n// always threadsafe, and Google Test considers the\n// --gtest_death_test_style=fast setting to be equivalent to\n// --gtest_death_test_style=threadsafe there.\n//\n// A few implementation notes:  Like the Linux version, the Windows\n// implementation uses pipes for child-to-parent communication. But due to\n// the specifics of pipes on Windows, some extra steps are required:\n//\n// 1. The parent creates a communication pipe and stores handles to both\n//    ends of it.\n// 2. The parent starts the child and provides it with the information\n//    necessary to acquire the handle to the write end of the pipe.\n// 3. The child acquires the write end of the pipe and signals the parent\n//    using a Windows event.\n// 4. Now the parent can release the write end of the pipe on its side. If\n//    this is done before step 3, the object's reference count goes down to\n//    0 and it is destroyed, preventing the child from acquiring it. The\n//    parent now has to release it, or read operations on the read end of\n//    the pipe will not return when the child terminates.\n// 5. The parent reads child's output through the pipe (outcome code and\n//    any possible error messages) from the pipe, and its stderr and then\n//    determines whether to fail the test.\n//\n// Note: to distinguish Win32 API calls from the local method and function\n// calls, the former are explicitly resolved in the global namespace.\n//\nclass WindowsDeathTest : public DeathTestImpl {\n public:\n  WindowsDeathTest(const char* a_statement,\n                   const RE* a_regex,\n                   const char* file,\n                   int line)\n      : DeathTestImpl(a_statement, a_regex), file_(file), line_(line) {}\n\n  // All of these virtual functions are inherited from DeathTest.\n  virtual int Wait();\n  virtual TestRole AssumeRole();\n\n private:\n  // The name of the file in which the death test is located.\n  const char* const file_;\n  // The line number on which the death test is located.\n  const int line_;\n  // Handle to the write end of the pipe to the child process.\n  AutoHandle write_handle_;\n  // Child process handle.\n  AutoHandle child_handle_;\n  // Event the child process uses to signal the parent that it has\n  // acquired the handle to the write end of the pipe. After seeing this\n  // event the parent can release its own handles to make sure its\n  // ReadFile() calls return when the child terminates.\n  AutoHandle event_handle_;\n};\n\n// Waits for the child in a death test to exit, returning its exit\n// status, or 0 if no child process exists.  As a side effect, sets the\n// outcome data member.\nint WindowsDeathTest::Wait() {\n  if (!spawned())\n    return 0;\n\n  // Wait until the child either signals that it has acquired the write end\n  // of the pipe or it dies.\n  const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };\n  switch (::WaitForMultipleObjects(2,\n                                   wait_handles,\n                                   FALSE,  // Waits for any of the handles.\n                                   INFINITE)) {\n    case WAIT_OBJECT_0:\n    case WAIT_OBJECT_0 + 1:\n      break;\n    default:\n      GTEST_DEATH_TEST_CHECK_(false);  // Should not get here.\n  }\n\n  // The child has acquired the write end of the pipe or exited.\n  // We release the handle on our side and continue.\n  write_handle_.Reset();\n  event_handle_.Reset();\n\n  ReadAndInterpretStatusByte();\n\n  // Waits for the child process to exit if it haven't already. This\n  // returns immediately if the child has already exited, regardless of\n  // whether previous calls to WaitForMultipleObjects synchronized on this\n  // handle or not.\n  GTEST_DEATH_TEST_CHECK_(\n      WAIT_OBJECT_0 == ::WaitForSingleObject(child_handle_.Get(),\n                                             INFINITE));\n  DWORD status_code;\n  GTEST_DEATH_TEST_CHECK_(\n      ::GetExitCodeProcess(child_handle_.Get(), &status_code) != FALSE);\n  child_handle_.Reset();\n  set_status(static_cast<int>(status_code));\n  return status();\n}\n\n// The AssumeRole process for a Windows death test.  It creates a child\n// process with the same executable as the current process to run the\n// death test.  The child process is given the --gtest_filter and\n// --gtest_internal_run_death_test flags such that it knows to run the\n// current death test only.\nDeathTest::TestRole WindowsDeathTest::AssumeRole() {\n  const UnitTestImpl* const impl = GetUnitTestImpl();\n  const InternalRunDeathTestFlag* const flag =\n      impl->internal_run_death_test_flag();\n  const TestInfo* const info = impl->current_test_info();\n  const int death_test_index = info->result()->death_test_count();\n\n  if (flag != NULL) {\n    // ParseInternalRunDeathTestFlag() has performed all the necessary\n    // processing.\n    set_write_fd(flag->write_fd());\n    return EXECUTE_TEST;\n  }\n\n  // WindowsDeathTest uses an anonymous pipe to communicate results of\n  // a death test.\n  SECURITY_ATTRIBUTES handles_are_inheritable = {\n    sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };\n  HANDLE read_handle, write_handle;\n  GTEST_DEATH_TEST_CHECK_(\n      ::CreatePipe(&read_handle, &write_handle, &handles_are_inheritable,\n                   0)  // Default buffer size.\n      != FALSE);\n  set_read_fd(::_open_osfhandle(reinterpret_cast<intptr_t>(read_handle),\n                                O_RDONLY));\n  write_handle_.Reset(write_handle);\n  event_handle_.Reset(::CreateEvent(\n      &handles_are_inheritable,\n      TRUE,    // The event will automatically reset to non-signaled state.\n      FALSE,   // The initial state is non-signalled.\n      NULL));  // The even is unnamed.\n  GTEST_DEATH_TEST_CHECK_(event_handle_.Get() != NULL);\n  const std::string filter_flag =\n      std::string(\"--\") + GTEST_FLAG_PREFIX_ + kFilterFlag + \"=\" +\n      info->test_case_name() + \".\" + info->name();\n  const std::string internal_flag =\n      std::string(\"--\") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag +\n      \"=\" + file_ + \"|\" + StreamableToString(line_) + \"|\" +\n      StreamableToString(death_test_index) + \"|\" +\n      StreamableToString(static_cast<unsigned int>(::GetCurrentProcessId())) +\n      // size_t has the same width as pointers on both 32-bit and 64-bit\n      // Windows platforms.\n      // See http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx.\n      \"|\" + StreamableToString(reinterpret_cast<size_t>(write_handle)) +\n      \"|\" + StreamableToString(reinterpret_cast<size_t>(event_handle_.Get()));\n\n  char executable_path[_MAX_PATH + 1];  // NOLINT\n  GTEST_DEATH_TEST_CHECK_(\n      _MAX_PATH + 1 != ::GetModuleFileNameA(NULL,\n                                            executable_path,\n                                            _MAX_PATH));\n\n  std::string command_line =\n      std::string(::GetCommandLineA()) + \" \" + filter_flag + \" \\\"\" +\n      internal_flag + \"\\\"\";\n\n  DeathTest::set_last_death_test_message(\"\");\n\n  CaptureStderr();\n  // Flush the log buffers since the log streams are shared with the child.\n  FlushInfoLog();\n\n  // The child process will share the standard handles with the parent.\n  STARTUPINFOA startup_info;\n  memset(&startup_info, 0, sizeof(STARTUPINFO));\n  startup_info.dwFlags = STARTF_USESTDHANDLES;\n  startup_info.hStdInput = ::GetStdHandle(STD_INPUT_HANDLE);\n  startup_info.hStdOutput = ::GetStdHandle(STD_OUTPUT_HANDLE);\n  startup_info.hStdError = ::GetStdHandle(STD_ERROR_HANDLE);\n\n  PROCESS_INFORMATION process_info;\n  GTEST_DEATH_TEST_CHECK_(::CreateProcessA(\n      executable_path,\n      const_cast<char*>(command_line.c_str()),\n      NULL,   // Retuned process handle is not inheritable.\n      NULL,   // Retuned thread handle is not inheritable.\n      TRUE,   // Child inherits all inheritable handles (for write_handle_).\n      0x0,    // Default creation flags.\n      NULL,   // Inherit the parent's environment.\n      UnitTest::GetInstance()->original_working_dir(),\n      &startup_info,\n      &process_info) != FALSE);\n  child_handle_.Reset(process_info.hProcess);\n  ::CloseHandle(process_info.hThread);\n  set_spawned(true);\n  return OVERSEE_TEST;\n}\n\n# elif GTEST_OS_FUCHSIA\n\nclass FuchsiaDeathTest : public DeathTestImpl {\n public:\n  FuchsiaDeathTest(const char* a_statement,\n                   const RE* a_regex,\n                   const char* file,\n                   int line)\n      : DeathTestImpl(a_statement, a_regex), file_(file), line_(line) {}\n  virtual ~FuchsiaDeathTest() {\n    zx_status_t status = zx_handle_close(child_process_);\n    GTEST_DEATH_TEST_CHECK_(status == ZX_OK);\n    status = zx_handle_close(port_);\n    GTEST_DEATH_TEST_CHECK_(status == ZX_OK);\n  }\n\n  // All of these virtual functions are inherited from DeathTest.\n  virtual int Wait();\n  virtual TestRole AssumeRole();\n\n private:\n  // The name of the file in which the death test is located.\n  const char* const file_;\n  // The line number on which the death test is located.\n  const int line_;\n\n  zx_handle_t child_process_ = ZX_HANDLE_INVALID;\n  zx_handle_t port_ = ZX_HANDLE_INVALID;\n};\n\n// Utility class for accumulating command-line arguments.\nclass Arguments {\n public:\n  Arguments() {\n    args_.push_back(NULL);\n  }\n\n  ~Arguments() {\n    for (std::vector<char*>::iterator i = args_.begin(); i != args_.end();\n         ++i) {\n      free(*i);\n    }\n  }\n  void AddArgument(const char* argument) {\n    args_.insert(args_.end() - 1, posix::StrDup(argument));\n  }\n\n  template <typename Str>\n  void AddArguments(const ::std::vector<Str>& arguments) {\n    for (typename ::std::vector<Str>::const_iterator i = arguments.begin();\n         i != arguments.end();\n         ++i) {\n      args_.insert(args_.end() - 1, posix::StrDup(i->c_str()));\n    }\n  }\n  char* const* Argv() {\n    return &args_[0];\n  }\n\n  int size() {\n    return args_.size() - 1;\n  }\n\n private:\n  std::vector<char*> args_;\n};\n\n// Waits for the child in a death test to exit, returning its exit\n// status, or 0 if no child process exists.  As a side effect, sets the\n// outcome data member.\nint FuchsiaDeathTest::Wait() {\n  if (!spawned())\n    return 0;\n\n  // Register to wait for the child process to terminate.\n  zx_status_t status_zx;\n  status_zx = zx_object_wait_async(child_process_,\n                                   port_,\n                                   0 /* key */,\n                                   ZX_PROCESS_TERMINATED,\n                                   ZX_WAIT_ASYNC_ONCE);\n  GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);\n\n  // Wait for it to terminate, or an exception to be received.\n  zx_port_packet_t packet;\n  status_zx = zx_port_wait(port_, ZX_TIME_INFINITE, &packet);\n  GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);\n\n  if (ZX_PKT_IS_EXCEPTION(packet.type)) {\n    // Process encountered an exception. Kill it directly rather than letting\n    // other handlers process the event.\n    status_zx = zx_task_kill(child_process_);\n    GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);\n\n    // Now wait for |child_process_| to terminate.\n    zx_signals_t signals = 0;\n    status_zx = zx_object_wait_one(\n        child_process_, ZX_PROCESS_TERMINATED, ZX_TIME_INFINITE, &signals);\n    GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);\n    GTEST_DEATH_TEST_CHECK_(signals & ZX_PROCESS_TERMINATED);\n  } else {\n    // Process terminated.\n    GTEST_DEATH_TEST_CHECK_(ZX_PKT_IS_SIGNAL_ONE(packet.type));\n    GTEST_DEATH_TEST_CHECK_(packet.signal.observed & ZX_PROCESS_TERMINATED);\n  }\n\n  ReadAndInterpretStatusByte();\n\n  zx_info_process_t buffer;\n  status_zx = zx_object_get_info(\n      child_process_,\n      ZX_INFO_PROCESS,\n      &buffer,\n      sizeof(buffer),\n      nullptr,\n      nullptr);\n  GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);\n\n  GTEST_DEATH_TEST_CHECK_(buffer.exited);\n  set_status(buffer.return_code);\n  return status();\n}\n\n// The AssumeRole process for a Fuchsia death test.  It creates a child\n// process with the same executable as the current process to run the\n// death test.  The child process is given the --gtest_filter and\n// --gtest_internal_run_death_test flags such that it knows to run the\n// current death test only.\nDeathTest::TestRole FuchsiaDeathTest::AssumeRole() {\n  const UnitTestImpl* const impl = GetUnitTestImpl();\n  const InternalRunDeathTestFlag* const flag =\n      impl->internal_run_death_test_flag();\n  const TestInfo* const info = impl->current_test_info();\n  const int death_test_index = info->result()->death_test_count();\n\n  if (flag != NULL) {\n    // ParseInternalRunDeathTestFlag() has performed all the necessary\n    // processing.\n    set_write_fd(kFuchsiaReadPipeFd);\n    return EXECUTE_TEST;\n  }\n\n  CaptureStderr();\n  // Flush the log buffers since the log streams are shared with the child.\n  FlushInfoLog();\n\n  // Build the child process command line.\n  const std::string filter_flag =\n      std::string(\"--\") + GTEST_FLAG_PREFIX_ + kFilterFlag + \"=\"\n      + info->test_case_name() + \".\" + info->name();\n  const std::string internal_flag =\n      std::string(\"--\") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + \"=\"\n      + file_ + \"|\"\n      + StreamableToString(line_) + \"|\"\n      + StreamableToString(death_test_index);\n  Arguments args;\n  args.AddArguments(GetInjectableArgvs());\n  args.AddArgument(filter_flag.c_str());\n  args.AddArgument(internal_flag.c_str());\n\n  // Build the pipe for communication with the child.\n  zx_status_t status;\n  zx_handle_t child_pipe_handle;\n  uint32_t type;\n  status = fdio_pipe_half(&child_pipe_handle, &type);\n  GTEST_DEATH_TEST_CHECK_(status >= 0);\n  set_read_fd(status);\n\n  // Set the pipe handle for the child.\n  fdio_spawn_action_t add_handle_action = {};\n  add_handle_action.action = FDIO_SPAWN_ACTION_ADD_HANDLE;\n  add_handle_action.h.id = PA_HND(type, kFuchsiaReadPipeFd);\n  add_handle_action.h.handle = child_pipe_handle;\n\n  // Spawn the child process.\n  status = fdio_spawn_etc(ZX_HANDLE_INVALID, FDIO_SPAWN_CLONE_ALL,\n                          args.Argv()[0], args.Argv(), nullptr, 1,\n                          &add_handle_action, &child_process_, nullptr);\n  GTEST_DEATH_TEST_CHECK_(status == ZX_OK);\n\n  // Create an exception port and attach it to the |child_process_|, to allow\n  // us to suppress the system default exception handler from firing.\n  status = zx_port_create(0, &port_);\n  GTEST_DEATH_TEST_CHECK_(status == ZX_OK);\n  status = zx_task_bind_exception_port(\n      child_process_, port_, 0 /* key */, 0 /*options */);\n  GTEST_DEATH_TEST_CHECK_(status == ZX_OK);\n\n  set_spawned(true);\n  return OVERSEE_TEST;\n}\n\n#else  // We are neither on Windows, nor on Fuchsia.\n\n// ForkingDeathTest provides implementations for most of the abstract\n// methods of the DeathTest interface.  Only the AssumeRole method is\n// left undefined.\nclass ForkingDeathTest : public DeathTestImpl {\n public:\n  ForkingDeathTest(const char* statement, const RE* regex);\n\n  // All of these virtual functions are inherited from DeathTest.\n  virtual int Wait();\n\n protected:\n  void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }\n\n private:\n  // PID of child process during death test; 0 in the child process itself.\n  pid_t child_pid_;\n};\n\n// Constructs a ForkingDeathTest.\nForkingDeathTest::ForkingDeathTest(const char* a_statement, const RE* a_regex)\n    : DeathTestImpl(a_statement, a_regex),\n      child_pid_(-1) {}\n\n// Waits for the child in a death test to exit, returning its exit\n// status, or 0 if no child process exists.  As a side effect, sets the\n// outcome data member.\nint ForkingDeathTest::Wait() {\n  if (!spawned())\n    return 0;\n\n  ReadAndInterpretStatusByte();\n\n  int status_value;\n  GTEST_DEATH_TEST_CHECK_SYSCALL_(waitpid(child_pid_, &status_value, 0));\n  set_status(status_value);\n  return status_value;\n}\n\n// A concrete death test class that forks, then immediately runs the test\n// in the child process.\nclass NoExecDeathTest : public ForkingDeathTest {\n public:\n  NoExecDeathTest(const char* a_statement, const RE* a_regex) :\n      ForkingDeathTest(a_statement, a_regex) { }\n  virtual TestRole AssumeRole();\n};\n\n// The AssumeRole process for a fork-and-run death test.  It implements a\n// straightforward fork, with a simple pipe to transmit the status byte.\nDeathTest::TestRole NoExecDeathTest::AssumeRole() {\n  const size_t thread_count = GetThreadCount();\n  if (thread_count != 1) {\n    GTEST_LOG_(WARNING) << DeathTestThreadWarning(thread_count);\n  }\n\n  int pipe_fd[2];\n  GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);\n\n  DeathTest::set_last_death_test_message(\"\");\n  CaptureStderr();\n  // When we fork the process below, the log file buffers are copied, but the\n  // file descriptors are shared.  We flush all log files here so that closing\n  // the file descriptors in the child process doesn't throw off the\n  // synchronization between descriptors and buffers in the parent process.\n  // This is as close to the fork as possible to avoid a race condition in case\n  // there are multiple threads running before the death test, and another\n  // thread writes to the log file.\n  FlushInfoLog();\n\n  const pid_t child_pid = fork();\n  GTEST_DEATH_TEST_CHECK_(child_pid != -1);\n  set_child_pid(child_pid);\n  if (child_pid == 0) {\n    GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[0]));\n    set_write_fd(pipe_fd[1]);\n    // Redirects all logging to stderr in the child process to prevent\n    // concurrent writes to the log files.  We capture stderr in the parent\n    // process and append the child process' output to a log.\n    LogToStderr();\n    // Event forwarding to the listeners of event listener API mush be shut\n    // down in death test subprocesses.\n    GetUnitTestImpl()->listeners()->SuppressEventForwarding();\n    g_in_fast_death_test_child = true;\n    return EXECUTE_TEST;\n  } else {\n    GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));\n    set_read_fd(pipe_fd[0]);\n    set_spawned(true);\n    return OVERSEE_TEST;\n  }\n}\n\n// A concrete death test class that forks and re-executes the main\n// program from the beginning, with command-line flags set that cause\n// only this specific death test to be run.\nclass ExecDeathTest : public ForkingDeathTest {\n public:\n  ExecDeathTest(const char* a_statement, const RE* a_regex,\n                const char* file, int line) :\n      ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }\n  virtual TestRole AssumeRole();\n private:\n  static ::std::vector<std::string> GetArgvsForDeathTestChildProcess() {\n    ::std::vector<std::string> args = GetInjectableArgvs();\n#  if defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)\n    ::std::vector<std::string> extra_args =\n        GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_();\n    args.insert(args.end(), extra_args.begin(), extra_args.end());\n#  endif  // defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)\n    return args;\n  }\n  // The name of the file in which the death test is located.\n  const char* const file_;\n  // The line number on which the death test is located.\n  const int line_;\n};\n\n// Utility class for accumulating command-line arguments.\nclass Arguments {\n public:\n  Arguments() {\n    args_.push_back(NULL);\n  }\n\n  ~Arguments() {\n    for (std::vector<char*>::iterator i = args_.begin(); i != args_.end();\n         ++i) {\n      free(*i);\n    }\n  }\n  void AddArgument(const char* argument) {\n    args_.insert(args_.end() - 1, posix::StrDup(argument));\n  }\n\n  template <typename Str>\n  void AddArguments(const ::std::vector<Str>& arguments) {\n    for (typename ::std::vector<Str>::const_iterator i = arguments.begin();\n         i != arguments.end();\n         ++i) {\n      args_.insert(args_.end() - 1, posix::StrDup(i->c_str()));\n    }\n  }\n  char* const* Argv() {\n    return &args_[0];\n  }\n\n private:\n  std::vector<char*> args_;\n};\n\n// A struct that encompasses the arguments to the child process of a\n// threadsafe-style death test process.\nstruct ExecDeathTestArgs {\n  char* const* argv;  // Command-line arguments for the child's call to exec\n  int close_fd;       // File descriptor to close; the read end of a pipe\n};\n\n#  if GTEST_OS_MAC\ninline char** GetEnviron() {\n  // When Google Test is built as a framework on MacOS X, the environ variable\n  // is unavailable. Apple's documentation (man environ) recommends using\n  // _NSGetEnviron() instead.\n  return *_NSGetEnviron();\n}\n#  else\n// Some POSIX platforms expect you to declare environ. extern \"C\" makes\n// it reside in the global namespace.\nextern \"C\" char** environ;\ninline char** GetEnviron() { return environ; }\n#  endif  // GTEST_OS_MAC\n\n#  if !GTEST_OS_QNX\n// The main function for a threadsafe-style death test child process.\n// This function is called in a clone()-ed process and thus must avoid\n// any potentially unsafe operations like malloc or libc functions.\nstatic int ExecDeathTestChildMain(void* child_arg) {\n  ExecDeathTestArgs* const args = static_cast<ExecDeathTestArgs*>(child_arg);\n  GTEST_DEATH_TEST_CHECK_SYSCALL_(close(args->close_fd));\n\n  // We need to execute the test program in the same environment where\n  // it was originally invoked.  Therefore we change to the original\n  // working directory first.\n  const char* const original_dir =\n      UnitTest::GetInstance()->original_working_dir();\n  // We can safely call chdir() as it's a direct system call.\n  if (chdir(original_dir) != 0) {\n    DeathTestAbort(std::string(\"chdir(\\\"\") + original_dir + \"\\\") failed: \" +\n                   GetLastErrnoDescription());\n    return EXIT_FAILURE;\n  }\n\n  // We can safely call execve() as it's a direct system call.  We\n  // cannot use execvp() as it's a libc function and thus potentially\n  // unsafe.  Since execve() doesn't search the PATH, the user must\n  // invoke the test program via a valid path that contains at least\n  // one path separator.\n  execve(args->argv[0], args->argv, GetEnviron());\n  DeathTestAbort(std::string(\"execve(\") + args->argv[0] + \", ...) in \" +\n                 original_dir + \" failed: \" +\n                 GetLastErrnoDescription());\n  return EXIT_FAILURE;\n}\n#  endif  // !GTEST_OS_QNX\n\n#  if GTEST_HAS_CLONE\n// Two utility routines that together determine the direction the stack\n// grows.\n// This could be accomplished more elegantly by a single recursive\n// function, but we want to guard against the unlikely possibility of\n// a smart compiler optimizing the recursion away.\n//\n// GTEST_NO_INLINE_ is required to prevent GCC 4.6 from inlining\n// StackLowerThanAddress into StackGrowsDown, which then doesn't give\n// correct answer.\nstatic void StackLowerThanAddress(const void* ptr,\n                                  bool* result) GTEST_NO_INLINE_;\nstatic void StackLowerThanAddress(const void* ptr, bool* result) {\n  int dummy = 0;\n  *result = (&dummy < ptr);\n}\n\n// Make sure AddressSanitizer does not tamper with the stack here.\nGTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_\nstatic bool StackGrowsDown() {\n  int dummy = 0;\n  bool result;\n  StackLowerThanAddress(&dummy, &result);\n  return result;\n}\n#  endif  // GTEST_HAS_CLONE\n\n// Spawns a child process with the same executable as the current process in\n// a thread-safe manner and instructs it to run the death test.  The\n// implementation uses fork(2) + exec.  On systems where clone(2) is\n// available, it is used instead, being slightly more thread-safe.  On QNX,\n// fork supports only single-threaded environments, so this function uses\n// spawn(2) there instead.  The function dies with an error message if\n// anything goes wrong.\nstatic pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) {\n  ExecDeathTestArgs args = { argv, close_fd };\n  pid_t child_pid = -1;\n\n#  if GTEST_OS_QNX\n  // Obtains the current directory and sets it to be closed in the child\n  // process.\n  const int cwd_fd = open(\".\", O_RDONLY);\n  GTEST_DEATH_TEST_CHECK_(cwd_fd != -1);\n  GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(cwd_fd, F_SETFD, FD_CLOEXEC));\n  // We need to execute the test program in the same environment where\n  // it was originally invoked.  Therefore we change to the original\n  // working directory first.\n  const char* const original_dir =\n      UnitTest::GetInstance()->original_working_dir();\n  // We can safely call chdir() as it's a direct system call.\n  if (chdir(original_dir) != 0) {\n    DeathTestAbort(std::string(\"chdir(\\\"\") + original_dir + \"\\\") failed: \" +\n                   GetLastErrnoDescription());\n    return EXIT_FAILURE;\n  }\n\n  int fd_flags;\n  // Set close_fd to be closed after spawn.\n  GTEST_DEATH_TEST_CHECK_SYSCALL_(fd_flags = fcntl(close_fd, F_GETFD));\n  GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(close_fd, F_SETFD,\n                                        fd_flags | FD_CLOEXEC));\n  struct inheritance inherit = {0};\n  // spawn is a system call.\n  child_pid = spawn(args.argv[0], 0, NULL, &inherit, args.argv, GetEnviron());\n  // Restores the current working directory.\n  GTEST_DEATH_TEST_CHECK_(fchdir(cwd_fd) != -1);\n  GTEST_DEATH_TEST_CHECK_SYSCALL_(close(cwd_fd));\n\n#  else   // GTEST_OS_QNX\n#   if GTEST_OS_LINUX\n  // When a SIGPROF signal is received while fork() or clone() are executing,\n  // the process may hang. To avoid this, we ignore SIGPROF here and re-enable\n  // it after the call to fork()/clone() is complete.\n  struct sigaction saved_sigprof_action;\n  struct sigaction ignore_sigprof_action;\n  memset(&ignore_sigprof_action, 0, sizeof(ignore_sigprof_action));\n  sigemptyset(&ignore_sigprof_action.sa_mask);\n  ignore_sigprof_action.sa_handler = SIG_IGN;\n  GTEST_DEATH_TEST_CHECK_SYSCALL_(sigaction(\n      SIGPROF, &ignore_sigprof_action, &saved_sigprof_action));\n#   endif  // GTEST_OS_LINUX\n\n#   if GTEST_HAS_CLONE\n  const bool use_fork = GTEST_FLAG(death_test_use_fork);\n\n  if (!use_fork) {\n    static const bool stack_grows_down = StackGrowsDown();\n    const size_t stack_size = getpagesize();\n    // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.\n    void* const stack = mmap(NULL, stack_size, PROT_READ | PROT_WRITE,\n                             MAP_ANON | MAP_PRIVATE, -1, 0);\n    GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED);\n\n    // Maximum stack alignment in bytes:  For a downward-growing stack, this\n    // amount is subtracted from size of the stack space to get an address\n    // that is within the stack space and is aligned on all systems we care\n    // about.  As far as I know there is no ABI with stack alignment greater\n    // than 64.  We assume stack and stack_size already have alignment of\n    // kMaxStackAlignment.\n    const size_t kMaxStackAlignment = 64;\n    void* const stack_top =\n        static_cast<char*>(stack) +\n            (stack_grows_down ? stack_size - kMaxStackAlignment : 0);\n    GTEST_DEATH_TEST_CHECK_(stack_size > kMaxStackAlignment &&\n        reinterpret_cast<intptr_t>(stack_top) % kMaxStackAlignment == 0);\n\n    child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args);\n\n    GTEST_DEATH_TEST_CHECK_(munmap(stack, stack_size) != -1);\n  }\n#   else\n  const bool use_fork = true;\n#   endif  // GTEST_HAS_CLONE\n\n  if (use_fork && (child_pid = fork()) == 0) {\n      ExecDeathTestChildMain(&args);\n      _exit(0);\n  }\n#  endif  // GTEST_OS_QNX\n#  if GTEST_OS_LINUX\n  GTEST_DEATH_TEST_CHECK_SYSCALL_(\n      sigaction(SIGPROF, &saved_sigprof_action, NULL));\n#  endif  // GTEST_OS_LINUX\n\n  GTEST_DEATH_TEST_CHECK_(child_pid != -1);\n  return child_pid;\n}\n\n// The AssumeRole process for a fork-and-exec death test.  It re-executes the\n// main program from the beginning, setting the --gtest_filter\n// and --gtest_internal_run_death_test flags to cause only the current\n// death test to be re-run.\nDeathTest::TestRole ExecDeathTest::AssumeRole() {\n  const UnitTestImpl* const impl = GetUnitTestImpl();\n  const InternalRunDeathTestFlag* const flag =\n      impl->internal_run_death_test_flag();\n  const TestInfo* const info = impl->current_test_info();\n  const int death_test_index = info->result()->death_test_count();\n\n  if (flag != NULL) {\n    set_write_fd(flag->write_fd());\n    return EXECUTE_TEST;\n  }\n\n  int pipe_fd[2];\n  GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);\n  // Clear the close-on-exec flag on the write end of the pipe, lest\n  // it be closed when the child process does an exec:\n  GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);\n\n  const std::string filter_flag =\n      std::string(\"--\") + GTEST_FLAG_PREFIX_ + kFilterFlag + \"=\"\n      + info->test_case_name() + \".\" + info->name();\n  const std::string internal_flag =\n      std::string(\"--\") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + \"=\"\n      + file_ + \"|\" + StreamableToString(line_) + \"|\"\n      + StreamableToString(death_test_index) + \"|\"\n      + StreamableToString(pipe_fd[1]);\n  Arguments args;\n  args.AddArguments(GetArgvsForDeathTestChildProcess());\n  args.AddArgument(filter_flag.c_str());\n  args.AddArgument(internal_flag.c_str());\n\n  DeathTest::set_last_death_test_message(\"\");\n\n  CaptureStderr();\n  // See the comment in NoExecDeathTest::AssumeRole for why the next line\n  // is necessary.\n  FlushInfoLog();\n\n  const pid_t child_pid = ExecDeathTestSpawnChild(args.Argv(), pipe_fd[0]);\n  GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));\n  set_child_pid(child_pid);\n  set_read_fd(pipe_fd[0]);\n  set_spawned(true);\n  return OVERSEE_TEST;\n}\n\n# endif  // !GTEST_OS_WINDOWS\n\n// Creates a concrete DeathTest-derived class that depends on the\n// --gtest_death_test_style flag, and sets the pointer pointed to\n// by the \"test\" argument to its address.  If the test should be\n// skipped, sets that pointer to NULL.  Returns true, unless the\n// flag is set to an invalid value.\nbool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,\n                                     const char* file, int line,\n                                     DeathTest** test) {\n  UnitTestImpl* const impl = GetUnitTestImpl();\n  const InternalRunDeathTestFlag* const flag =\n      impl->internal_run_death_test_flag();\n  const int death_test_index = impl->current_test_info()\n      ->increment_death_test_count();\n\n  if (flag != NULL) {\n    if (death_test_index > flag->index()) {\n      DeathTest::set_last_death_test_message(\n          \"Death test count (\" + StreamableToString(death_test_index)\n          + \") somehow exceeded expected maximum (\"\n          + StreamableToString(flag->index()) + \")\");\n      return false;\n    }\n\n    if (!(flag->file() == file && flag->line() == line &&\n          flag->index() == death_test_index)) {\n      *test = NULL;\n      return true;\n    }\n  }\n\n# if GTEST_OS_WINDOWS\n\n  if (GTEST_FLAG(death_test_style) == \"threadsafe\" ||\n      GTEST_FLAG(death_test_style) == \"fast\") {\n    *test = new WindowsDeathTest(statement, regex, file, line);\n  }\n\n# elif GTEST_OS_FUCHSIA\n\n  if (GTEST_FLAG(death_test_style) == \"threadsafe\" ||\n      GTEST_FLAG(death_test_style) == \"fast\") {\n    *test = new FuchsiaDeathTest(statement, regex, file, line);\n  }\n\n# else\n\n  if (GTEST_FLAG(death_test_style) == \"threadsafe\") {\n    *test = new ExecDeathTest(statement, regex, file, line);\n  } else if (GTEST_FLAG(death_test_style) == \"fast\") {\n    *test = new NoExecDeathTest(statement, regex);\n  }\n\n# endif  // GTEST_OS_WINDOWS\n\n  else {  // NOLINT - this is more readable than unbalanced brackets inside #if.\n    DeathTest::set_last_death_test_message(\n        \"Unknown death test style \\\"\" + GTEST_FLAG(death_test_style)\n        + \"\\\" encountered\");\n    return false;\n  }\n\n  return true;\n}\n\n# if GTEST_OS_WINDOWS\n// Recreates the pipe and event handles from the provided parameters,\n// signals the event, and returns a file descriptor wrapped around the pipe\n// handle. This function is called in the child process only.\nstatic int GetStatusFileDescriptor(unsigned int parent_process_id,\n                            size_t write_handle_as_size_t,\n                            size_t event_handle_as_size_t) {\n  AutoHandle parent_process_handle(::OpenProcess(PROCESS_DUP_HANDLE,\n                                                   FALSE,  // Non-inheritable.\n                                                   parent_process_id));\n  if (parent_process_handle.Get() == INVALID_HANDLE_VALUE) {\n    DeathTestAbort(\"Unable to open parent process \" +\n                   StreamableToString(parent_process_id));\n  }\n\n  // FIXME: Replace the following check with a\n  // compile-time assertion when available.\n  GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));\n\n  const HANDLE write_handle =\n      reinterpret_cast<HANDLE>(write_handle_as_size_t);\n  HANDLE dup_write_handle;\n\n  // The newly initialized handle is accessible only in the parent\n  // process. To obtain one accessible within the child, we need to use\n  // DuplicateHandle.\n  if (!::DuplicateHandle(parent_process_handle.Get(), write_handle,\n                         ::GetCurrentProcess(), &dup_write_handle,\n                         0x0,    // Requested privileges ignored since\n                                 // DUPLICATE_SAME_ACCESS is used.\n                         FALSE,  // Request non-inheritable handler.\n                         DUPLICATE_SAME_ACCESS)) {\n    DeathTestAbort(\"Unable to duplicate the pipe handle \" +\n                   StreamableToString(write_handle_as_size_t) +\n                   \" from the parent process \" +\n                   StreamableToString(parent_process_id));\n  }\n\n  const HANDLE event_handle = reinterpret_cast<HANDLE>(event_handle_as_size_t);\n  HANDLE dup_event_handle;\n\n  if (!::DuplicateHandle(parent_process_handle.Get(), event_handle,\n                         ::GetCurrentProcess(), &dup_event_handle,\n                         0x0,\n                         FALSE,\n                         DUPLICATE_SAME_ACCESS)) {\n    DeathTestAbort(\"Unable to duplicate the event handle \" +\n                   StreamableToString(event_handle_as_size_t) +\n                   \" from the parent process \" +\n                   StreamableToString(parent_process_id));\n  }\n\n  const int write_fd =\n      ::_open_osfhandle(reinterpret_cast<intptr_t>(dup_write_handle), O_APPEND);\n  if (write_fd == -1) {\n    DeathTestAbort(\"Unable to convert pipe handle \" +\n                   StreamableToString(write_handle_as_size_t) +\n                   \" to a file descriptor\");\n  }\n\n  // Signals the parent that the write end of the pipe has been acquired\n  // so the parent can release its own write end.\n  ::SetEvent(dup_event_handle);\n\n  return write_fd;\n}\n# endif  // GTEST_OS_WINDOWS\n\n// Returns a newly created InternalRunDeathTestFlag object with fields\n// initialized from the GTEST_FLAG(internal_run_death_test) flag if\n// the flag is specified; otherwise returns NULL.\nInternalRunDeathTestFlag* ParseInternalRunDeathTestFlag() {\n  if (GTEST_FLAG(internal_run_death_test) == \"\") return NULL;\n\n  // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we\n  // can use it here.\n  int line = -1;\n  int index = -1;\n  ::std::vector< ::std::string> fields;\n  SplitString(GTEST_FLAG(internal_run_death_test).c_str(), '|', &fields);\n  int write_fd = -1;\n\n# if GTEST_OS_WINDOWS\n\n  unsigned int parent_process_id = 0;\n  size_t write_handle_as_size_t = 0;\n  size_t event_handle_as_size_t = 0;\n\n  if (fields.size() != 6\n      || !ParseNaturalNumber(fields[1], &line)\n      || !ParseNaturalNumber(fields[2], &index)\n      || !ParseNaturalNumber(fields[3], &parent_process_id)\n      || !ParseNaturalNumber(fields[4], &write_handle_as_size_t)\n      || !ParseNaturalNumber(fields[5], &event_handle_as_size_t)) {\n    DeathTestAbort(\"Bad --gtest_internal_run_death_test flag: \" +\n                   GTEST_FLAG(internal_run_death_test));\n  }\n  write_fd = GetStatusFileDescriptor(parent_process_id,\n                                     write_handle_as_size_t,\n                                     event_handle_as_size_t);\n\n# elif GTEST_OS_FUCHSIA\n\n  if (fields.size() != 3\n      || !ParseNaturalNumber(fields[1], &line)\n      || !ParseNaturalNumber(fields[2], &index)) {\n    DeathTestAbort(\"Bad --gtest_internal_run_death_test flag: \"\n        + GTEST_FLAG(internal_run_death_test));\n  }\n\n# else\n\n  if (fields.size() != 4\n      || !ParseNaturalNumber(fields[1], &line)\n      || !ParseNaturalNumber(fields[2], &index)\n      || !ParseNaturalNumber(fields[3], &write_fd)) {\n    DeathTestAbort(\"Bad --gtest_internal_run_death_test flag: \"\n        + GTEST_FLAG(internal_run_death_test));\n  }\n\n# endif  // GTEST_OS_WINDOWS\n\n  return new InternalRunDeathTestFlag(fields[0], line, index, write_fd);\n}\n\n}  // namespace internal\n\n#endif  // GTEST_HAS_DEATH_TEST\n\n}  // namespace testing\n// Copyright 2008, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n#include <stdlib.h>\n\n#if GTEST_OS_WINDOWS_MOBILE\n# include <windows.h>\n#elif GTEST_OS_WINDOWS\n# include <direct.h>\n# include <io.h>\n#elif GTEST_OS_SYMBIAN\n// Symbian OpenC has PATH_MAX in sys/syslimits.h\n# include <sys/syslimits.h>\n#else\n# include <limits.h>\n# include <climits>  // Some Linux distributions define PATH_MAX here.\n#endif  // GTEST_OS_WINDOWS_MOBILE\n\n\n#if GTEST_OS_WINDOWS\n# define GTEST_PATH_MAX_ _MAX_PATH\n#elif defined(PATH_MAX)\n# define GTEST_PATH_MAX_ PATH_MAX\n#elif defined(_XOPEN_PATH_MAX)\n# define GTEST_PATH_MAX_ _XOPEN_PATH_MAX\n#else\n# define GTEST_PATH_MAX_ _POSIX_PATH_MAX\n#endif  // GTEST_OS_WINDOWS\n\nnamespace testing {\nnamespace internal {\n\n#if GTEST_OS_WINDOWS\n// On Windows, '\\\\' is the standard path separator, but many tools and the\n// Windows API also accept '/' as an alternate path separator. Unless otherwise\n// noted, a file path can contain either kind of path separators, or a mixture\n// of them.\nconst char kPathSeparator = '\\\\';\nconst char kAlternatePathSeparator = '/';\nconst char kAlternatePathSeparatorString[] = \"/\";\n# if GTEST_OS_WINDOWS_MOBILE\n// Windows CE doesn't have a current directory. You should not use\n// the current directory in tests on Windows CE, but this at least\n// provides a reasonable fallback.\nconst char kCurrentDirectoryString[] = \"\\\\\";\n// Windows CE doesn't define INVALID_FILE_ATTRIBUTES\nconst DWORD kInvalidFileAttributes = 0xffffffff;\n# else\nconst char kCurrentDirectoryString[] = \".\\\\\";\n# endif  // GTEST_OS_WINDOWS_MOBILE\n#else\nconst char kPathSeparator = '/';\nconst char kCurrentDirectoryString[] = \"./\";\n#endif  // GTEST_OS_WINDOWS\n\n// Returns whether the given character is a valid path separator.\nstatic bool IsPathSeparator(char c) {\n#if GTEST_HAS_ALT_PATH_SEP_\n  return (c == kPathSeparator) || (c == kAlternatePathSeparator);\n#else\n  return c == kPathSeparator;\n#endif\n}\n\n// Returns the current working directory, or \"\" if unsuccessful.\nFilePath FilePath::GetCurrentDir() {\n#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT\n  // Windows CE doesn't have a current directory, so we just return\n  // something reasonable.\n  return FilePath(kCurrentDirectoryString);\n#elif GTEST_OS_WINDOWS\n  char cwd[GTEST_PATH_MAX_ + 1] = { '\\0' };\n  return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? \"\" : cwd);\n#else\n  char cwd[GTEST_PATH_MAX_ + 1] = { '\\0' };\n  char* result = getcwd(cwd, sizeof(cwd));\n# if GTEST_OS_NACL\n  // getcwd will likely fail in NaCl due to the sandbox, so return something\n  // reasonable. The user may have provided a shim implementation for getcwd,\n  // however, so fallback only when failure is detected.\n  return FilePath(result == NULL ? kCurrentDirectoryString : cwd);\n# endif  // GTEST_OS_NACL\n  return FilePath(result == NULL ? \"\" : cwd);\n#endif  // GTEST_OS_WINDOWS_MOBILE\n}\n\n// Returns a copy of the FilePath with the case-insensitive extension removed.\n// Example: FilePath(\"dir/file.exe\").RemoveExtension(\"EXE\") returns\n// FilePath(\"dir/file\"). If a case-insensitive extension is not\n// found, returns a copy of the original FilePath.\nFilePath FilePath::RemoveExtension(const char* extension) const {\n  const std::string dot_extension = std::string(\".\") + extension;\n  if (String::EndsWithCaseInsensitive(pathname_, dot_extension)) {\n    return FilePath(pathname_.substr(\n        0, pathname_.length() - dot_extension.length()));\n  }\n  return *this;\n}\n\n// Returns a pointer to the last occurrence of a valid path separator in\n// the FilePath. On Windows, for example, both '/' and '\\' are valid path\n// separators. Returns NULL if no path separator was found.\nconst char* FilePath::FindLastPathSeparator() const {\n  const char* const last_sep = strrchr(c_str(), kPathSeparator);\n#if GTEST_HAS_ALT_PATH_SEP_\n  const char* const last_alt_sep = strrchr(c_str(), kAlternatePathSeparator);\n  // Comparing two pointers of which only one is NULL is undefined.\n  if (last_alt_sep != NULL &&\n      (last_sep == NULL || last_alt_sep > last_sep)) {\n    return last_alt_sep;\n  }\n#endif\n  return last_sep;\n}\n\n// Returns a copy of the FilePath with the directory part removed.\n// Example: FilePath(\"path/to/file\").RemoveDirectoryName() returns\n// FilePath(\"file\"). If there is no directory part (\"just_a_file\"), it returns\n// the FilePath unmodified. If there is no file part (\"just_a_dir/\") it\n// returns an empty FilePath (\"\").\n// On Windows platform, '\\' is the path separator, otherwise it is '/'.\nFilePath FilePath::RemoveDirectoryName() const {\n  const char* const last_sep = FindLastPathSeparator();\n  return last_sep ? FilePath(last_sep + 1) : *this;\n}\n\n// RemoveFileName returns the directory path with the filename removed.\n// Example: FilePath(\"path/to/file\").RemoveFileName() returns \"path/to/\".\n// If the FilePath is \"a_file\" or \"/a_file\", RemoveFileName returns\n// FilePath(\"./\") or, on Windows, FilePath(\".\\\\\"). If the filepath does\n// not have a file, like \"just/a/dir/\", it returns the FilePath unmodified.\n// On Windows platform, '\\' is the path separator, otherwise it is '/'.\nFilePath FilePath::RemoveFileName() const {\n  const char* const last_sep = FindLastPathSeparator();\n  std::string dir;\n  if (last_sep) {\n    dir = std::string(c_str(), last_sep + 1 - c_str());\n  } else {\n    dir = kCurrentDirectoryString;\n  }\n  return FilePath(dir);\n}\n\n// Helper functions for naming files in a directory for xml output.\n\n// Given directory = \"dir\", base_name = \"test\", number = 0,\n// extension = \"xml\", returns \"dir/test.xml\". If number is greater\n// than zero (e.g., 12), returns \"dir/test_12.xml\".\n// On Windows platform, uses \\ as the separator rather than /.\nFilePath FilePath::MakeFileName(const FilePath& directory,\n                                const FilePath& base_name,\n                                int number,\n                                const char* extension) {\n  std::string file;\n  if (number == 0) {\n    file = base_name.string() + \".\" + extension;\n  } else {\n    file = base_name.string() + \"_\" + StreamableToString(number)\n        + \".\" + extension;\n  }\n  return ConcatPaths(directory, FilePath(file));\n}\n\n// Given directory = \"dir\", relative_path = \"test.xml\", returns \"dir/test.xml\".\n// On Windows, uses \\ as the separator rather than /.\nFilePath FilePath::ConcatPaths(const FilePath& directory,\n                               const FilePath& relative_path) {\n  if (directory.IsEmpty())\n    return relative_path;\n  const FilePath dir(directory.RemoveTrailingPathSeparator());\n  return FilePath(dir.string() + kPathSeparator + relative_path.string());\n}\n\n// Returns true if pathname describes something findable in the file-system,\n// either a file, directory, or whatever.\nbool FilePath::FileOrDirectoryExists() const {\n#if GTEST_OS_WINDOWS_MOBILE\n  LPCWSTR unicode = String::AnsiToUtf16(pathname_.c_str());\n  const DWORD attributes = GetFileAttributes(unicode);\n  delete [] unicode;\n  return attributes != kInvalidFileAttributes;\n#else\n  posix::StatStruct file_stat;\n  return posix::Stat(pathname_.c_str(), &file_stat) == 0;\n#endif  // GTEST_OS_WINDOWS_MOBILE\n}\n\n// Returns true if pathname describes a directory in the file-system\n// that exists.\nbool FilePath::DirectoryExists() const {\n  bool result = false;\n#if GTEST_OS_WINDOWS\n  // Don't strip off trailing separator if path is a root directory on\n  // Windows (like \"C:\\\\\").\n  const FilePath& path(IsRootDirectory() ? *this :\n                                           RemoveTrailingPathSeparator());\n#else\n  const FilePath& path(*this);\n#endif\n\n#if GTEST_OS_WINDOWS_MOBILE\n  LPCWSTR unicode = String::AnsiToUtf16(path.c_str());\n  const DWORD attributes = GetFileAttributes(unicode);\n  delete [] unicode;\n  if ((attributes != kInvalidFileAttributes) &&\n      (attributes & FILE_ATTRIBUTE_DIRECTORY)) {\n    result = true;\n  }\n#else\n  posix::StatStruct file_stat;\n  result = posix::Stat(path.c_str(), &file_stat) == 0 &&\n      posix::IsDir(file_stat);\n#endif  // GTEST_OS_WINDOWS_MOBILE\n\n  return result;\n}\n\n// Returns true if pathname describes a root directory. (Windows has one\n// root directory per disk drive.)\nbool FilePath::IsRootDirectory() const {\n#if GTEST_OS_WINDOWS\n  // FIXME: on Windows a network share like\n  // \\\\server\\share can be a root directory, although it cannot be the\n  // current directory.  Handle this properly.\n  return pathname_.length() == 3 && IsAbsolutePath();\n#else\n  return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]);\n#endif\n}\n\n// Returns true if pathname describes an absolute path.\nbool FilePath::IsAbsolutePath() const {\n  const char* const name = pathname_.c_str();\n#if GTEST_OS_WINDOWS\n  return pathname_.length() >= 3 &&\n     ((name[0] >= 'a' && name[0] <= 'z') ||\n      (name[0] >= 'A' && name[0] <= 'Z')) &&\n     name[1] == ':' &&\n     IsPathSeparator(name[2]);\n#else\n  return IsPathSeparator(name[0]);\n#endif\n}\n\n// Returns a pathname for a file that does not currently exist. The pathname\n// will be directory/base_name.extension or\n// directory/base_name_<number>.extension if directory/base_name.extension\n// already exists. The number will be incremented until a pathname is found\n// that does not already exist.\n// Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.\n// There could be a race condition if two or more processes are calling this\n// function at the same time -- they could both pick the same filename.\nFilePath FilePath::GenerateUniqueFileName(const FilePath& directory,\n                                          const FilePath& base_name,\n                                          const char* extension) {\n  FilePath full_pathname;\n  int number = 0;\n  do {\n    full_pathname.Set(MakeFileName(directory, base_name, number++, extension));\n  } while (full_pathname.FileOrDirectoryExists());\n  return full_pathname;\n}\n\n// Returns true if FilePath ends with a path separator, which indicates that\n// it is intended to represent a directory. Returns false otherwise.\n// This does NOT check that a directory (or file) actually exists.\nbool FilePath::IsDirectory() const {\n  return !pathname_.empty() &&\n         IsPathSeparator(pathname_.c_str()[pathname_.length() - 1]);\n}\n\n// Create directories so that path exists. Returns true if successful or if\n// the directories already exist; returns false if unable to create directories\n// for any reason.\nbool FilePath::CreateDirectoriesRecursively() const {\n  if (!this->IsDirectory()) {\n    return false;\n  }\n\n  if (pathname_.length() == 0 || this->DirectoryExists()) {\n    return true;\n  }\n\n  const FilePath parent(this->RemoveTrailingPathSeparator().RemoveFileName());\n  return parent.CreateDirectoriesRecursively() && this->CreateFolder();\n}\n\n// Create the directory so that path exists. Returns true if successful or\n// if the directory already exists; returns false if unable to create the\n// directory for any reason, including if the parent directory does not\n// exist. Not named \"CreateDirectory\" because that's a macro on Windows.\nbool FilePath::CreateFolder() const {\n#if GTEST_OS_WINDOWS_MOBILE\n  FilePath removed_sep(this->RemoveTrailingPathSeparator());\n  LPCWSTR unicode = String::AnsiToUtf16(removed_sep.c_str());\n  int result = CreateDirectory(unicode, NULL) ? 0 : -1;\n  delete [] unicode;\n#elif GTEST_OS_WINDOWS\n  int result = _mkdir(pathname_.c_str());\n#else\n  int result = mkdir(pathname_.c_str(), 0777);\n#endif  // GTEST_OS_WINDOWS_MOBILE\n\n  if (result == -1) {\n    return this->DirectoryExists();  // An error is OK if the directory exists.\n  }\n  return true;  // No error.\n}\n\n// If input name has a trailing separator character, remove it and return the\n// name, otherwise return the name string unmodified.\n// On Windows platform, uses \\ as the separator, other platforms use /.\nFilePath FilePath::RemoveTrailingPathSeparator() const {\n  return IsDirectory()\n      ? FilePath(pathname_.substr(0, pathname_.length() - 1))\n      : *this;\n}\n\n// Removes any redundant separators that might be in the pathname.\n// For example, \"bar///foo\" becomes \"bar/foo\". Does not eliminate other\n// redundancies that might be in a pathname involving \".\" or \"..\".\n// FIXME: handle Windows network shares (e.g. \\\\server\\share).\nvoid FilePath::Normalize() {\n  if (pathname_.c_str() == NULL) {\n    pathname_ = \"\";\n    return;\n  }\n  const char* src = pathname_.c_str();\n  char* const dest = new char[pathname_.length() + 1];\n  char* dest_ptr = dest;\n  memset(dest_ptr, 0, pathname_.length() + 1);\n\n  while (*src != '\\0') {\n    *dest_ptr = *src;\n    if (!IsPathSeparator(*src)) {\n      src++;\n    } else {\n#if GTEST_HAS_ALT_PATH_SEP_\n      if (*dest_ptr == kAlternatePathSeparator) {\n        *dest_ptr = kPathSeparator;\n      }\n#endif\n      while (IsPathSeparator(*src))\n        src++;\n    }\n    dest_ptr++;\n  }\n  *dest_ptr = '\\0';\n  pathname_ = dest;\n  delete[] dest;\n}\n\n}  // namespace internal\n}  // namespace testing\n// Copyright 2008, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n\n#include <limits.h>\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#include <fstream>\n\n#if GTEST_OS_WINDOWS\n# include <windows.h>\n# include <io.h>\n# include <sys/stat.h>\n# include <map>  // Used in ThreadLocal.\n#else\n# include <unistd.h>\n#endif  // GTEST_OS_WINDOWS\n\n#if GTEST_OS_MAC\n# include <mach/mach_init.h>\n# include <mach/task.h>\n# include <mach/vm_map.h>\n#endif  // GTEST_OS_MAC\n\n#if GTEST_OS_QNX\n# include <devctl.h>\n# include <fcntl.h>\n# include <sys/procfs.h>\n#endif  // GTEST_OS_QNX\n\n#if GTEST_OS_AIX\n# include <procinfo.h>\n# include <sys/types.h>\n#endif  // GTEST_OS_AIX\n\n#if GTEST_OS_FUCHSIA\n# include <zircon/process.h>\n# include <zircon/syscalls.h>\n#endif  // GTEST_OS_FUCHSIA\n\n\nnamespace testing {\nnamespace internal {\n\n#if defined(_MSC_VER) || defined(__BORLANDC__)\n// MSVC and C++Builder do not provide a definition of STDERR_FILENO.\nconst int kStdOutFileno = 1;\nconst int kStdErrFileno = 2;\n#else\nconst int kStdOutFileno = STDOUT_FILENO;\nconst int kStdErrFileno = STDERR_FILENO;\n#endif  // _MSC_VER\n\n#if GTEST_OS_LINUX\n\nnamespace {\ntemplate <typename T>\nT ReadProcFileField(const std::string& filename, int field) {\n  std::string dummy;\n  std::ifstream file(filename.c_str());\n  while (field-- > 0) {\n    file >> dummy;\n  }\n  T output = 0;\n  file >> output;\n  return output;\n}\n}  // namespace\n\n// Returns the number of active threads, or 0 when there is an error.\nsize_t GetThreadCount() {\n  const std::string filename =\n      (Message() << \"/proc/\" << getpid() << \"/stat\").GetString();\n  return ReadProcFileField<int>(filename, 19);\n}\n\n#elif GTEST_OS_MAC\n\nsize_t GetThreadCount() {\n  const task_t task = mach_task_self();\n  mach_msg_type_number_t thread_count;\n  thread_act_array_t thread_list;\n  const kern_return_t status = task_threads(task, &thread_list, &thread_count);\n  if (status == KERN_SUCCESS) {\n    // task_threads allocates resources in thread_list and we need to free them\n    // to avoid leaks.\n    vm_deallocate(task,\n                  reinterpret_cast<vm_address_t>(thread_list),\n                  sizeof(thread_t) * thread_count);\n    return static_cast<size_t>(thread_count);\n  } else {\n    return 0;\n  }\n}\n\n#elif GTEST_OS_QNX\n\n// Returns the number of threads running in the process, or 0 to indicate that\n// we cannot detect it.\nsize_t GetThreadCount() {\n  const int fd = open(\"/proc/self/as\", O_RDONLY);\n  if (fd < 0) {\n    return 0;\n  }\n  procfs_info process_info;\n  const int status =\n      devctl(fd, DCMD_PROC_INFO, &process_info, sizeof(process_info), NULL);\n  close(fd);\n  if (status == EOK) {\n    return static_cast<size_t>(process_info.num_threads);\n  } else {\n    return 0;\n  }\n}\n\n#elif GTEST_OS_AIX\n\nsize_t GetThreadCount() {\n  struct procentry64 entry;\n  pid_t pid = getpid();\n  int status = getprocs64(&entry, sizeof(entry), NULL, 0, &pid, 1);\n  if (status == 1) {\n    return entry.pi_thcount;\n  } else {\n    return 0;\n  }\n}\n\n#elif GTEST_OS_FUCHSIA\n\nsize_t GetThreadCount() {\n  int dummy_buffer;\n  size_t avail;\n  zx_status_t status = zx_object_get_info(\n      zx_process_self(),\n      ZX_INFO_PROCESS_THREADS,\n      &dummy_buffer,\n      0,\n      nullptr,\n      &avail);\n  if (status == ZX_OK) {\n    return avail;\n  } else {\n    return 0;\n  }\n}\n\n#else\n\nsize_t GetThreadCount() {\n  // There's no portable way to detect the number of threads, so we just\n  // return 0 to indicate that we cannot detect it.\n  return 0;\n}\n\n#endif  // GTEST_OS_LINUX\n\n#if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS\n\nvoid SleepMilliseconds(int n) {\n  ::Sleep(n);\n}\n\nAutoHandle::AutoHandle()\n    : handle_(INVALID_HANDLE_VALUE) {}\n\nAutoHandle::AutoHandle(Handle handle)\n    : handle_(handle) {}\n\nAutoHandle::~AutoHandle() {\n  Reset();\n}\n\nAutoHandle::Handle AutoHandle::Get() const {\n  return handle_;\n}\n\nvoid AutoHandle::Reset() {\n  Reset(INVALID_HANDLE_VALUE);\n}\n\nvoid AutoHandle::Reset(HANDLE handle) {\n  // Resetting with the same handle we already own is invalid.\n  if (handle_ != handle) {\n    if (IsCloseable()) {\n      ::CloseHandle(handle_);\n    }\n    handle_ = handle;\n  } else {\n    GTEST_CHECK_(!IsCloseable())\n        << \"Resetting a valid handle to itself is likely a programmer error \"\n            \"and thus not allowed.\";\n  }\n}\n\nbool AutoHandle::IsCloseable() const {\n  // Different Windows APIs may use either of these values to represent an\n  // invalid handle.\n  return handle_ != NULL && handle_ != INVALID_HANDLE_VALUE;\n}\n\nNotification::Notification()\n    : event_(::CreateEvent(NULL,   // Default security attributes.\n                           TRUE,   // Do not reset automatically.\n                           FALSE,  // Initially unset.\n                           NULL)) {  // Anonymous event.\n  GTEST_CHECK_(event_.Get() != NULL);\n}\n\nvoid Notification::Notify() {\n  GTEST_CHECK_(::SetEvent(event_.Get()) != FALSE);\n}\n\nvoid Notification::WaitForNotification() {\n  GTEST_CHECK_(\n      ::WaitForSingleObject(event_.Get(), INFINITE) == WAIT_OBJECT_0);\n}\n\nMutex::Mutex()\n    : owner_thread_id_(0),\n      type_(kDynamic),\n      critical_section_init_phase_(0),\n      critical_section_(new CRITICAL_SECTION) {\n  ::InitializeCriticalSection(critical_section_);\n}\n\nMutex::~Mutex() {\n  // Static mutexes are leaked intentionally. It is not thread-safe to try\n  // to clean them up.\n  // FIXME: Switch to Slim Reader/Writer (SRW) Locks, which requires\n  // nothing to clean it up but is available only on Vista and later.\n  // https://docs.microsoft.com/en-us/windows/desktop/Sync/slim-reader-writer--srw--locks\n  if (type_ == kDynamic) {\n    ::DeleteCriticalSection(critical_section_);\n    delete critical_section_;\n    critical_section_ = NULL;\n  }\n}\n\nvoid Mutex::Lock() {\n  ThreadSafeLazyInit();\n  ::EnterCriticalSection(critical_section_);\n  owner_thread_id_ = ::GetCurrentThreadId();\n}\n\nvoid Mutex::Unlock() {\n  ThreadSafeLazyInit();\n  // We don't protect writing to owner_thread_id_ here, as it's the\n  // caller's responsibility to ensure that the current thread holds the\n  // mutex when this is called.\n  owner_thread_id_ = 0;\n  ::LeaveCriticalSection(critical_section_);\n}\n\n// Does nothing if the current thread holds the mutex. Otherwise, crashes\n// with high probability.\nvoid Mutex::AssertHeld() {\n  ThreadSafeLazyInit();\n  GTEST_CHECK_(owner_thread_id_ == ::GetCurrentThreadId())\n      << \"The current thread is not holding the mutex @\" << this;\n}\n\nnamespace {\n\n// Use the RAII idiom to flag mem allocs that are intentionally never\n// deallocated. The motivation is to silence the false positive mem leaks\n// that are reported by the debug version of MS's CRT which can only detect\n// if an alloc is missing a matching deallocation.\n// Example:\n//    MemoryIsNotDeallocated memory_is_not_deallocated;\n//    critical_section_ = new CRITICAL_SECTION;\n//\nclass MemoryIsNotDeallocated\n{\n public:\n  MemoryIsNotDeallocated() : old_crtdbg_flag_(0) {\n#ifdef _MSC_VER\n    old_crtdbg_flag_ = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);\n    // Set heap allocation block type to _IGNORE_BLOCK so that MS debug CRT\n    // doesn't report mem leak if there's no matching deallocation.\n    _CrtSetDbgFlag(old_crtdbg_flag_ & ~_CRTDBG_ALLOC_MEM_DF);\n#endif  //  _MSC_VER\n  }\n\n  ~MemoryIsNotDeallocated() {\n#ifdef _MSC_VER\n    // Restore the original _CRTDBG_ALLOC_MEM_DF flag\n    _CrtSetDbgFlag(old_crtdbg_flag_);\n#endif  //  _MSC_VER\n  }\n\n private:\n  int old_crtdbg_flag_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(MemoryIsNotDeallocated);\n};\n\n}  // namespace\n\n// Initializes owner_thread_id_ and critical_section_ in static mutexes.\nvoid Mutex::ThreadSafeLazyInit() {\n  // Dynamic mutexes are initialized in the constructor.\n  if (type_ == kStatic) {\n    switch (\n        ::InterlockedCompareExchange(&critical_section_init_phase_, 1L, 0L)) {\n      case 0:\n        // If critical_section_init_phase_ was 0 before the exchange, we\n        // are the first to test it and need to perform the initialization.\n        owner_thread_id_ = 0;\n        {\n          // Use RAII to flag that following mem alloc is never deallocated.\n          MemoryIsNotDeallocated memory_is_not_deallocated;\n          critical_section_ = new CRITICAL_SECTION;\n        }\n        ::InitializeCriticalSection(critical_section_);\n        // Updates the critical_section_init_phase_ to 2 to signal\n        // initialization complete.\n        GTEST_CHECK_(::InterlockedCompareExchange(\n                          &critical_section_init_phase_, 2L, 1L) ==\n                      1L);\n        break;\n      case 1:\n        // Somebody else is already initializing the mutex; spin until they\n        // are done.\n        while (::InterlockedCompareExchange(&critical_section_init_phase_,\n                                            2L,\n                                            2L) != 2L) {\n          // Possibly yields the rest of the thread's time slice to other\n          // threads.\n          ::Sleep(0);\n        }\n        break;\n\n      case 2:\n        break;  // The mutex is already initialized and ready for use.\n\n      default:\n        GTEST_CHECK_(false)\n            << \"Unexpected value of critical_section_init_phase_ \"\n            << \"while initializing a static mutex.\";\n    }\n  }\n}\n\nnamespace {\n\nclass ThreadWithParamSupport : public ThreadWithParamBase {\n public:\n  static HANDLE CreateThread(Runnable* runnable,\n                             Notification* thread_can_start) {\n    ThreadMainParam* param = new ThreadMainParam(runnable, thread_can_start);\n    DWORD thread_id;\n    // FIXME: Consider to use _beginthreadex instead.\n    HANDLE thread_handle = ::CreateThread(\n        NULL,    // Default security.\n        0,       // Default stack size.\n        &ThreadWithParamSupport::ThreadMain,\n        param,   // Parameter to ThreadMainStatic\n        0x0,     // Default creation flags.\n        &thread_id);  // Need a valid pointer for the call to work under Win98.\n    GTEST_CHECK_(thread_handle != NULL) << \"CreateThread failed with error \"\n                                        << ::GetLastError() << \".\";\n    if (thread_handle == NULL) {\n      delete param;\n    }\n    return thread_handle;\n  }\n\n private:\n  struct ThreadMainParam {\n    ThreadMainParam(Runnable* runnable, Notification* thread_can_start)\n        : runnable_(runnable),\n          thread_can_start_(thread_can_start) {\n    }\n    scoped_ptr<Runnable> runnable_;\n    // Does not own.\n    Notification* thread_can_start_;\n  };\n\n  static DWORD WINAPI ThreadMain(void* ptr) {\n    // Transfers ownership.\n    scoped_ptr<ThreadMainParam> param(static_cast<ThreadMainParam*>(ptr));\n    if (param->thread_can_start_ != NULL)\n      param->thread_can_start_->WaitForNotification();\n    param->runnable_->Run();\n    return 0;\n  }\n\n  // Prohibit instantiation.\n  ThreadWithParamSupport();\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport);\n};\n\n}  // namespace\n\nThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,\n                                         Notification* thread_can_start)\n      : thread_(ThreadWithParamSupport::CreateThread(runnable,\n                                                     thread_can_start)) {\n}\n\nThreadWithParamBase::~ThreadWithParamBase() {\n  Join();\n}\n\nvoid ThreadWithParamBase::Join() {\n  GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0)\n      << \"Failed to join the thread with error \" << ::GetLastError() << \".\";\n}\n\n// Maps a thread to a set of ThreadIdToThreadLocals that have values\n// instantiated on that thread and notifies them when the thread exits.  A\n// ThreadLocal instance is expected to persist until all threads it has\n// values on have terminated.\nclass ThreadLocalRegistryImpl {\n public:\n  // Registers thread_local_instance as having value on the current thread.\n  // Returns a value that can be used to identify the thread from other threads.\n  static ThreadLocalValueHolderBase* GetValueOnCurrentThread(\n      const ThreadLocalBase* thread_local_instance) {\n    DWORD current_thread = ::GetCurrentThreadId();\n    MutexLock lock(&mutex_);\n    ThreadIdToThreadLocals* const thread_to_thread_locals =\n        GetThreadLocalsMapLocked();\n    ThreadIdToThreadLocals::iterator thread_local_pos =\n        thread_to_thread_locals->find(current_thread);\n    if (thread_local_pos == thread_to_thread_locals->end()) {\n      thread_local_pos = thread_to_thread_locals->insert(\n          std::make_pair(current_thread, ThreadLocalValues())).first;\n      StartWatcherThreadFor(current_thread);\n    }\n    ThreadLocalValues& thread_local_values = thread_local_pos->second;\n    ThreadLocalValues::iterator value_pos =\n        thread_local_values.find(thread_local_instance);\n    if (value_pos == thread_local_values.end()) {\n      value_pos =\n          thread_local_values\n              .insert(std::make_pair(\n                  thread_local_instance,\n                  linked_ptr<ThreadLocalValueHolderBase>(\n                      thread_local_instance->NewValueForCurrentThread())))\n              .first;\n    }\n    return value_pos->second.get();\n  }\n\n  static void OnThreadLocalDestroyed(\n      const ThreadLocalBase* thread_local_instance) {\n    std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;\n    // Clean up the ThreadLocalValues data structure while holding the lock, but\n    // defer the destruction of the ThreadLocalValueHolderBases.\n    {\n      MutexLock lock(&mutex_);\n      ThreadIdToThreadLocals* const thread_to_thread_locals =\n          GetThreadLocalsMapLocked();\n      for (ThreadIdToThreadLocals::iterator it =\n          thread_to_thread_locals->begin();\n          it != thread_to_thread_locals->end();\n          ++it) {\n        ThreadLocalValues& thread_local_values = it->second;\n        ThreadLocalValues::iterator value_pos =\n            thread_local_values.find(thread_local_instance);\n        if (value_pos != thread_local_values.end()) {\n          value_holders.push_back(value_pos->second);\n          thread_local_values.erase(value_pos);\n          // This 'if' can only be successful at most once, so theoretically we\n          // could break out of the loop here, but we don't bother doing so.\n        }\n      }\n    }\n    // Outside the lock, let the destructor for 'value_holders' deallocate the\n    // ThreadLocalValueHolderBases.\n  }\n\n  static void OnThreadExit(DWORD thread_id) {\n    GTEST_CHECK_(thread_id != 0) << ::GetLastError();\n    std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;\n    // Clean up the ThreadIdToThreadLocals data structure while holding the\n    // lock, but defer the destruction of the ThreadLocalValueHolderBases.\n    {\n      MutexLock lock(&mutex_);\n      ThreadIdToThreadLocals* const thread_to_thread_locals =\n          GetThreadLocalsMapLocked();\n      ThreadIdToThreadLocals::iterator thread_local_pos =\n          thread_to_thread_locals->find(thread_id);\n      if (thread_local_pos != thread_to_thread_locals->end()) {\n        ThreadLocalValues& thread_local_values = thread_local_pos->second;\n        for (ThreadLocalValues::iterator value_pos =\n            thread_local_values.begin();\n            value_pos != thread_local_values.end();\n            ++value_pos) {\n          value_holders.push_back(value_pos->second);\n        }\n        thread_to_thread_locals->erase(thread_local_pos);\n      }\n    }\n    // Outside the lock, let the destructor for 'value_holders' deallocate the\n    // ThreadLocalValueHolderBases.\n  }\n\n private:\n  // In a particular thread, maps a ThreadLocal object to its value.\n  typedef std::map<const ThreadLocalBase*,\n                   linked_ptr<ThreadLocalValueHolderBase> > ThreadLocalValues;\n  // Stores all ThreadIdToThreadLocals having values in a thread, indexed by\n  // thread's ID.\n  typedef std::map<DWORD, ThreadLocalValues> ThreadIdToThreadLocals;\n\n  // Holds the thread id and thread handle that we pass from\n  // StartWatcherThreadFor to WatcherThreadFunc.\n  typedef std::pair<DWORD, HANDLE> ThreadIdAndHandle;\n\n  static void StartWatcherThreadFor(DWORD thread_id) {\n    // The returned handle will be kept in thread_map and closed by\n    // watcher_thread in WatcherThreadFunc.\n    HANDLE thread = ::OpenThread(SYNCHRONIZE | THREAD_QUERY_INFORMATION,\n                                 FALSE,\n                                 thread_id);\n    GTEST_CHECK_(thread != NULL);\n    // We need to pass a valid thread ID pointer into CreateThread for it\n    // to work correctly under Win98.\n    DWORD watcher_thread_id;\n    HANDLE watcher_thread = ::CreateThread(\n        NULL,   // Default security.\n        0,      // Default stack size\n        &ThreadLocalRegistryImpl::WatcherThreadFunc,\n        reinterpret_cast<LPVOID>(new ThreadIdAndHandle(thread_id, thread)),\n        CREATE_SUSPENDED,\n        &watcher_thread_id);\n    GTEST_CHECK_(watcher_thread != NULL);\n    // Give the watcher thread the same priority as ours to avoid being\n    // blocked by it.\n    ::SetThreadPriority(watcher_thread,\n                        ::GetThreadPriority(::GetCurrentThread()));\n    ::ResumeThread(watcher_thread);\n    ::CloseHandle(watcher_thread);\n  }\n\n  // Monitors exit from a given thread and notifies those\n  // ThreadIdToThreadLocals about thread termination.\n  static DWORD WINAPI WatcherThreadFunc(LPVOID param) {\n    const ThreadIdAndHandle* tah =\n        reinterpret_cast<const ThreadIdAndHandle*>(param);\n    GTEST_CHECK_(\n        ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);\n    OnThreadExit(tah->first);\n    ::CloseHandle(tah->second);\n    delete tah;\n    return 0;\n  }\n\n  // Returns map of thread local instances.\n  static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() {\n    mutex_.AssertHeld();\n    MemoryIsNotDeallocated memory_is_not_deallocated;\n    static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals();\n    return map;\n  }\n\n  // Protects access to GetThreadLocalsMapLocked() and its return value.\n  static Mutex mutex_;\n  // Protects access to GetThreadMapLocked() and its return value.\n  static Mutex thread_map_mutex_;\n};\n\nMutex ThreadLocalRegistryImpl::mutex_(Mutex::kStaticMutex);\nMutex ThreadLocalRegistryImpl::thread_map_mutex_(Mutex::kStaticMutex);\n\nThreadLocalValueHolderBase* ThreadLocalRegistry::GetValueOnCurrentThread(\n      const ThreadLocalBase* thread_local_instance) {\n  return ThreadLocalRegistryImpl::GetValueOnCurrentThread(\n      thread_local_instance);\n}\n\nvoid ThreadLocalRegistry::OnThreadLocalDestroyed(\n      const ThreadLocalBase* thread_local_instance) {\n  ThreadLocalRegistryImpl::OnThreadLocalDestroyed(thread_local_instance);\n}\n\n#endif  // GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS\n\n#if GTEST_USES_POSIX_RE\n\n// Implements RE.  Currently only needed for death tests.\n\nRE::~RE() {\n  if (is_valid_) {\n    // regfree'ing an invalid regex might crash because the content\n    // of the regex is undefined. Since the regex's are essentially\n    // the same, one cannot be valid (or invalid) without the other\n    // being so too.\n    regfree(&partial_regex_);\n    regfree(&full_regex_);\n  }\n  free(const_cast<char*>(pattern_));\n}\n\n// Returns true iff regular expression re matches the entire str.\nbool RE::FullMatch(const char* str, const RE& re) {\n  if (!re.is_valid_) return false;\n\n  regmatch_t match;\n  return regexec(&re.full_regex_, str, 1, &match, 0) == 0;\n}\n\n// Returns true iff regular expression re matches a substring of str\n// (including str itself).\nbool RE::PartialMatch(const char* str, const RE& re) {\n  if (!re.is_valid_) return false;\n\n  regmatch_t match;\n  return regexec(&re.partial_regex_, str, 1, &match, 0) == 0;\n}\n\n// Initializes an RE from its string representation.\nvoid RE::Init(const char* regex) {\n  pattern_ = posix::StrDup(regex);\n\n  // Reserves enough bytes to hold the regular expression used for a\n  // full match.\n  const size_t full_regex_len = strlen(regex) + 10;\n  char* const full_pattern = new char[full_regex_len];\n\n  snprintf(full_pattern, full_regex_len, \"^(%s)$\", regex);\n  is_valid_ = regcomp(&full_regex_, full_pattern, REG_EXTENDED) == 0;\n  // We want to call regcomp(&partial_regex_, ...) even if the\n  // previous expression returns false.  Otherwise partial_regex_ may\n  // not be properly initialized can may cause trouble when it's\n  // freed.\n  //\n  // Some implementation of POSIX regex (e.g. on at least some\n  // versions of Cygwin) doesn't accept the empty string as a valid\n  // regex.  We change it to an equivalent form \"()\" to be safe.\n  if (is_valid_) {\n    const char* const partial_regex = (*regex == '\\0') ? \"()\" : regex;\n    is_valid_ = regcomp(&partial_regex_, partial_regex, REG_EXTENDED) == 0;\n  }\n  EXPECT_TRUE(is_valid_)\n      << \"Regular expression \\\"\" << regex\n      << \"\\\" is not a valid POSIX Extended regular expression.\";\n\n  delete[] full_pattern;\n}\n\n#elif GTEST_USES_SIMPLE_RE\n\n// Returns true iff ch appears anywhere in str (excluding the\n// terminating '\\0' character).\nbool IsInSet(char ch, const char* str) {\n  return ch != '\\0' && strchr(str, ch) != NULL;\n}\n\n// Returns true iff ch belongs to the given classification.  Unlike\n// similar functions in <ctype.h>, these aren't affected by the\n// current locale.\nbool IsAsciiDigit(char ch) { return '0' <= ch && ch <= '9'; }\nbool IsAsciiPunct(char ch) {\n  return IsInSet(ch, \"^-!\\\"#$%&'()*+,./:;<=>?@[\\\\]_`{|}~\");\n}\nbool IsRepeat(char ch) { return IsInSet(ch, \"?*+\"); }\nbool IsAsciiWhiteSpace(char ch) { return IsInSet(ch, \" \\f\\n\\r\\t\\v\"); }\nbool IsAsciiWordChar(char ch) {\n  return ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z') ||\n      ('0' <= ch && ch <= '9') || ch == '_';\n}\n\n// Returns true iff \"\\\\c\" is a supported escape sequence.\nbool IsValidEscape(char c) {\n  return (IsAsciiPunct(c) || IsInSet(c, \"dDfnrsStvwW\"));\n}\n\n// Returns true iff the given atom (specified by escaped and pattern)\n// matches ch.  The result is undefined if the atom is invalid.\nbool AtomMatchesChar(bool escaped, char pattern_char, char ch) {\n  if (escaped) {  // \"\\\\p\" where p is pattern_char.\n    switch (pattern_char) {\n      case 'd': return IsAsciiDigit(ch);\n      case 'D': return !IsAsciiDigit(ch);\n      case 'f': return ch == '\\f';\n      case 'n': return ch == '\\n';\n      case 'r': return ch == '\\r';\n      case 's': return IsAsciiWhiteSpace(ch);\n      case 'S': return !IsAsciiWhiteSpace(ch);\n      case 't': return ch == '\\t';\n      case 'v': return ch == '\\v';\n      case 'w': return IsAsciiWordChar(ch);\n      case 'W': return !IsAsciiWordChar(ch);\n    }\n    return IsAsciiPunct(pattern_char) && pattern_char == ch;\n  }\n\n  return (pattern_char == '.' && ch != '\\n') || pattern_char == ch;\n}\n\n// Helper function used by ValidateRegex() to format error messages.\nstatic std::string FormatRegexSyntaxError(const char* regex, int index) {\n  return (Message() << \"Syntax error at index \" << index\n          << \" in simple regular expression \\\"\" << regex << \"\\\": \").GetString();\n}\n\n// Generates non-fatal failures and returns false if regex is invalid;\n// otherwise returns true.\nbool ValidateRegex(const char* regex) {\n  if (regex == NULL) {\n    // FIXME: fix the source file location in the\n    // assertion failures to match where the regex is used in user\n    // code.\n    ADD_FAILURE() << \"NULL is not a valid simple regular expression.\";\n    return false;\n  }\n\n  bool is_valid = true;\n\n  // True iff ?, *, or + can follow the previous atom.\n  bool prev_repeatable = false;\n  for (int i = 0; regex[i]; i++) {\n    if (regex[i] == '\\\\') {  // An escape sequence\n      i++;\n      if (regex[i] == '\\0') {\n        ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)\n                      << \"'\\\\' cannot appear at the end.\";\n        return false;\n      }\n\n      if (!IsValidEscape(regex[i])) {\n        ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)\n                      << \"invalid escape sequence \\\"\\\\\" << regex[i] << \"\\\".\";\n        is_valid = false;\n      }\n      prev_repeatable = true;\n    } else {  // Not an escape sequence.\n      const char ch = regex[i];\n\n      if (ch == '^' && i > 0) {\n        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)\n                      << \"'^' can only appear at the beginning.\";\n        is_valid = false;\n      } else if (ch == '$' && regex[i + 1] != '\\0') {\n        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)\n                      << \"'$' can only appear at the end.\";\n        is_valid = false;\n      } else if (IsInSet(ch, \"()[]{}|\")) {\n        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)\n                      << \"'\" << ch << \"' is unsupported.\";\n        is_valid = false;\n      } else if (IsRepeat(ch) && !prev_repeatable) {\n        ADD_FAILURE() << FormatRegexSyntaxError(regex, i)\n                      << \"'\" << ch << \"' can only follow a repeatable token.\";\n        is_valid = false;\n      }\n\n      prev_repeatable = !IsInSet(ch, \"^$?*+\");\n    }\n  }\n\n  return is_valid;\n}\n\n// Matches a repeated regex atom followed by a valid simple regular\n// expression.  The regex atom is defined as c if escaped is false,\n// or \\c otherwise.  repeat is the repetition meta character (?, *,\n// or +).  The behavior is undefined if str contains too many\n// characters to be indexable by size_t, in which case the test will\n// probably time out anyway.  We are fine with this limitation as\n// std::string has it too.\nbool MatchRepetitionAndRegexAtHead(\n    bool escaped, char c, char repeat, const char* regex,\n    const char* str) {\n  const size_t min_count = (repeat == '+') ? 1 : 0;\n  const size_t max_count = (repeat == '?') ? 1 :\n      static_cast<size_t>(-1) - 1;\n  // We cannot call numeric_limits::max() as it conflicts with the\n  // max() macro on Windows.\n\n  for (size_t i = 0; i <= max_count; ++i) {\n    // We know that the atom matches each of the first i characters in str.\n    if (i >= min_count && MatchRegexAtHead(regex, str + i)) {\n      // We have enough matches at the head, and the tail matches too.\n      // Since we only care about *whether* the pattern matches str\n      // (as opposed to *how* it matches), there is no need to find a\n      // greedy match.\n      return true;\n    }\n    if (str[i] == '\\0' || !AtomMatchesChar(escaped, c, str[i]))\n      return false;\n  }\n  return false;\n}\n\n// Returns true iff regex matches a prefix of str.  regex must be a\n// valid simple regular expression and not start with \"^\", or the\n// result is undefined.\nbool MatchRegexAtHead(const char* regex, const char* str) {\n  if (*regex == '\\0')  // An empty regex matches a prefix of anything.\n    return true;\n\n  // \"$\" only matches the end of a string.  Note that regex being\n  // valid guarantees that there's nothing after \"$\" in it.\n  if (*regex == '$')\n    return *str == '\\0';\n\n  // Is the first thing in regex an escape sequence?\n  const bool escaped = *regex == '\\\\';\n  if (escaped)\n    ++regex;\n  if (IsRepeat(regex[1])) {\n    // MatchRepetitionAndRegexAtHead() calls MatchRegexAtHead(), so\n    // here's an indirect recursion.  It terminates as the regex gets\n    // shorter in each recursion.\n    return MatchRepetitionAndRegexAtHead(\n        escaped, regex[0], regex[1], regex + 2, str);\n  } else {\n    // regex isn't empty, isn't \"$\", and doesn't start with a\n    // repetition.  We match the first atom of regex with the first\n    // character of str and recurse.\n    return (*str != '\\0') && AtomMatchesChar(escaped, *regex, *str) &&\n        MatchRegexAtHead(regex + 1, str + 1);\n  }\n}\n\n// Returns true iff regex matches any substring of str.  regex must be\n// a valid simple regular expression, or the result is undefined.\n//\n// The algorithm is recursive, but the recursion depth doesn't exceed\n// the regex length, so we won't need to worry about running out of\n// stack space normally.  In rare cases the time complexity can be\n// exponential with respect to the regex length + the string length,\n// but usually it's must faster (often close to linear).\nbool MatchRegexAnywhere(const char* regex, const char* str) {\n  if (regex == NULL || str == NULL)\n    return false;\n\n  if (*regex == '^')\n    return MatchRegexAtHead(regex + 1, str);\n\n  // A successful match can be anywhere in str.\n  do {\n    if (MatchRegexAtHead(regex, str))\n      return true;\n  } while (*str++ != '\\0');\n  return false;\n}\n\n// Implements the RE class.\n\nRE::~RE() {\n  free(const_cast<char*>(pattern_));\n  free(const_cast<char*>(full_pattern_));\n}\n\n// Returns true iff regular expression re matches the entire str.\nbool RE::FullMatch(const char* str, const RE& re) {\n  return re.is_valid_ && MatchRegexAnywhere(re.full_pattern_, str);\n}\n\n// Returns true iff regular expression re matches a substring of str\n// (including str itself).\nbool RE::PartialMatch(const char* str, const RE& re) {\n  return re.is_valid_ && MatchRegexAnywhere(re.pattern_, str);\n}\n\n// Initializes an RE from its string representation.\nvoid RE::Init(const char* regex) {\n  pattern_ = full_pattern_ = NULL;\n  if (regex != NULL) {\n    pattern_ = posix::StrDup(regex);\n  }\n\n  is_valid_ = ValidateRegex(regex);\n  if (!is_valid_) {\n    // No need to calculate the full pattern when the regex is invalid.\n    return;\n  }\n\n  const size_t len = strlen(regex);\n  // Reserves enough bytes to hold the regular expression used for a\n  // full match: we need space to prepend a '^', append a '$', and\n  // terminate the string with '\\0'.\n  char* buffer = static_cast<char*>(malloc(len + 3));\n  full_pattern_ = buffer;\n\n  if (*regex != '^')\n    *buffer++ = '^';  // Makes sure full_pattern_ starts with '^'.\n\n  // We don't use snprintf or strncpy, as they trigger a warning when\n  // compiled with VC++ 8.0.\n  memcpy(buffer, regex, len);\n  buffer += len;\n\n  if (len == 0 || regex[len - 1] != '$')\n    *buffer++ = '$';  // Makes sure full_pattern_ ends with '$'.\n\n  *buffer = '\\0';\n}\n\n#endif  // GTEST_USES_POSIX_RE\n\nconst char kUnknownFile[] = \"unknown file\";\n\n// Formats a source file path and a line number as they would appear\n// in an error message from the compiler used to compile this code.\nGTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {\n  const std::string file_name(file == NULL ? kUnknownFile : file);\n\n  if (line < 0) {\n    return file_name + \":\";\n  }\n#ifdef _MSC_VER\n  return file_name + \"(\" + StreamableToString(line) + \"):\";\n#else\n  return file_name + \":\" + StreamableToString(line) + \":\";\n#endif  // _MSC_VER\n}\n\n// Formats a file location for compiler-independent XML output.\n// Although this function is not platform dependent, we put it next to\n// FormatFileLocation in order to contrast the two functions.\n// Note that FormatCompilerIndependentFileLocation() does NOT append colon\n// to the file location it produces, unlike FormatFileLocation().\nGTEST_API_ ::std::string FormatCompilerIndependentFileLocation(\n    const char* file, int line) {\n  const std::string file_name(file == NULL ? kUnknownFile : file);\n\n  if (line < 0)\n    return file_name;\n  else\n    return file_name + \":\" + StreamableToString(line);\n}\n\nGTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line)\n    : severity_(severity) {\n  const char* const marker =\n      severity == GTEST_INFO ?    \"[  INFO ]\" :\n      severity == GTEST_WARNING ? \"[WARNING]\" :\n      severity == GTEST_ERROR ?   \"[ ERROR ]\" : \"[ FATAL ]\";\n  GetStream() << ::std::endl << marker << \" \"\n              << FormatFileLocation(file, line).c_str() << \": \";\n}\n\n// Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.\nGTestLog::~GTestLog() {\n  GetStream() << ::std::endl;\n  if (severity_ == GTEST_FATAL) {\n    fflush(stderr);\n    posix::Abort();\n  }\n}\n\n// Disable Microsoft deprecation warnings for POSIX functions called from\n// this class (creat, dup, dup2, and close)\nGTEST_DISABLE_MSC_DEPRECATED_PUSH_()\n\n#if GTEST_HAS_STREAM_REDIRECTION\n\n// Object that captures an output stream (stdout/stderr).\nclass CapturedStream {\n public:\n  // The ctor redirects the stream to a temporary file.\n  explicit CapturedStream(int fd) : fd_(fd), uncaptured_fd_(dup(fd)) {\n# if GTEST_OS_WINDOWS\n    char temp_dir_path[MAX_PATH + 1] = { '\\0' };  // NOLINT\n    char temp_file_path[MAX_PATH + 1] = { '\\0' };  // NOLINT\n\n    ::GetTempPathA(sizeof(temp_dir_path), temp_dir_path);\n    const UINT success = ::GetTempFileNameA(temp_dir_path,\n                                            \"gtest_redir\",\n                                            0,  // Generate unique file name.\n                                            temp_file_path);\n    GTEST_CHECK_(success != 0)\n        << \"Unable to create a temporary file in \" << temp_dir_path;\n    const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE);\n    GTEST_CHECK_(captured_fd != -1) << \"Unable to open temporary file \"\n                                    << temp_file_path;\n    filename_ = temp_file_path;\n# else\n    // There's no guarantee that a test has write access to the current\n    // directory, so we create the temporary file in the /tmp directory\n    // instead. We use /tmp on most systems, and /sdcard on Android.\n    // That's because Android doesn't have /tmp.\n#  if GTEST_OS_LINUX_ANDROID\n    // Note: Android applications are expected to call the framework's\n    // Context.getExternalStorageDirectory() method through JNI to get\n    // the location of the world-writable SD Card directory. However,\n    // this requires a Context handle, which cannot be retrieved\n    // globally from native code. Doing so also precludes running the\n    // code as part of a regular standalone executable, which doesn't\n    // run in a Dalvik process (e.g. when running it through 'adb shell').\n    //\n    // The location /sdcard is directly accessible from native code\n    // and is the only location (unofficially) supported by the Android\n    // team. It's generally a symlink to the real SD Card mount point\n    // which can be /mnt/sdcard, /mnt/sdcard0, /system/media/sdcard, or\n    // other OEM-customized locations. Never rely on these, and always\n    // use /sdcard.\n    char name_template[] = \"/sdcard/gtest_captured_stream.XXXXXX\";\n#  else\n    char name_template[] = \"/tmp/captured_stream.XXXXXX\";\n#  endif  // GTEST_OS_LINUX_ANDROID\n    const int captured_fd = mkstemp(name_template);\n    filename_ = name_template;\n# endif  // GTEST_OS_WINDOWS\n    fflush(NULL);\n    dup2(captured_fd, fd_);\n    close(captured_fd);\n  }\n\n  ~CapturedStream() {\n    remove(filename_.c_str());\n  }\n\n  std::string GetCapturedString() {\n    if (uncaptured_fd_ != -1) {\n      // Restores the original stream.\n      fflush(NULL);\n      dup2(uncaptured_fd_, fd_);\n      close(uncaptured_fd_);\n      uncaptured_fd_ = -1;\n    }\n\n    FILE* const file = posix::FOpen(filename_.c_str(), \"r\");\n    const std::string content = ReadEntireFile(file);\n    posix::FClose(file);\n    return content;\n  }\n\n private:\n  const int fd_;  // A stream to capture.\n  int uncaptured_fd_;\n  // Name of the temporary file holding the stderr output.\n  ::std::string filename_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream);\n};\n\nGTEST_DISABLE_MSC_DEPRECATED_POP_()\n\nstatic CapturedStream* g_captured_stderr = NULL;\nstatic CapturedStream* g_captured_stdout = NULL;\n\n// Starts capturing an output stream (stdout/stderr).\nstatic void CaptureStream(int fd, const char* stream_name,\n                          CapturedStream** stream) {\n  if (*stream != NULL) {\n    GTEST_LOG_(FATAL) << \"Only one \" << stream_name\n                      << \" capturer can exist at a time.\";\n  }\n  *stream = new CapturedStream(fd);\n}\n\n// Stops capturing the output stream and returns the captured string.\nstatic std::string GetCapturedStream(CapturedStream** captured_stream) {\n  const std::string content = (*captured_stream)->GetCapturedString();\n\n  delete *captured_stream;\n  *captured_stream = NULL;\n\n  return content;\n}\n\n// Starts capturing stdout.\nvoid CaptureStdout() {\n  CaptureStream(kStdOutFileno, \"stdout\", &g_captured_stdout);\n}\n\n// Starts capturing stderr.\nvoid CaptureStderr() {\n  CaptureStream(kStdErrFileno, \"stderr\", &g_captured_stderr);\n}\n\n// Stops capturing stdout and returns the captured string.\nstd::string GetCapturedStdout() {\n  return GetCapturedStream(&g_captured_stdout);\n}\n\n// Stops capturing stderr and returns the captured string.\nstd::string GetCapturedStderr() {\n  return GetCapturedStream(&g_captured_stderr);\n}\n\n#endif  // GTEST_HAS_STREAM_REDIRECTION\n\n\n\n\n\nsize_t GetFileSize(FILE* file) {\n  fseek(file, 0, SEEK_END);\n  return static_cast<size_t>(ftell(file));\n}\n\nstd::string ReadEntireFile(FILE* file) {\n  const size_t file_size = GetFileSize(file);\n  char* const buffer = new char[file_size];\n\n  size_t bytes_last_read = 0;  // # of bytes read in the last fread()\n  size_t bytes_read = 0;       // # of bytes read so far\n\n  fseek(file, 0, SEEK_SET);\n\n  // Keeps reading the file until we cannot read further or the\n  // pre-determined file size is reached.\n  do {\n    bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);\n    bytes_read += bytes_last_read;\n  } while (bytes_last_read > 0 && bytes_read < file_size);\n\n  const std::string content(buffer, bytes_read);\n  delete[] buffer;\n\n  return content;\n}\n\n#if GTEST_HAS_DEATH_TEST\nstatic const std::vector<std::string>* g_injected_test_argvs = NULL;  // Owned.\n\nstd::vector<std::string> GetInjectableArgvs() {\n  if (g_injected_test_argvs != NULL) {\n    return *g_injected_test_argvs;\n  }\n  return GetArgvs();\n}\n\nvoid SetInjectableArgvs(const std::vector<std::string>* new_argvs) {\n  if (g_injected_test_argvs != new_argvs) delete g_injected_test_argvs;\n  g_injected_test_argvs = new_argvs;\n}\n\nvoid SetInjectableArgvs(const std::vector<std::string>& new_argvs) {\n  SetInjectableArgvs(\n      new std::vector<std::string>(new_argvs.begin(), new_argvs.end()));\n}\n\n#if GTEST_HAS_GLOBAL_STRING\nvoid SetInjectableArgvs(const std::vector< ::string>& new_argvs) {\n  SetInjectableArgvs(\n      new std::vector<std::string>(new_argvs.begin(), new_argvs.end()));\n}\n#endif  // GTEST_HAS_GLOBAL_STRING\n\nvoid ClearInjectableArgvs() {\n  delete g_injected_test_argvs;\n  g_injected_test_argvs = NULL;\n}\n#endif  // GTEST_HAS_DEATH_TEST\n\n#if GTEST_OS_WINDOWS_MOBILE\nnamespace posix {\nvoid Abort() {\n  DebugBreak();\n  TerminateProcess(GetCurrentProcess(), 1);\n}\n}  // namespace posix\n#endif  // GTEST_OS_WINDOWS_MOBILE\n\n// Returns the name of the environment variable corresponding to the\n// given flag.  For example, FlagToEnvVar(\"foo\") will return\n// \"GTEST_FOO\" in the open-source version.\nstatic std::string FlagToEnvVar(const char* flag) {\n  const std::string full_flag =\n      (Message() << GTEST_FLAG_PREFIX_ << flag).GetString();\n\n  Message env_var;\n  for (size_t i = 0; i != full_flag.length(); i++) {\n    env_var << ToUpper(full_flag.c_str()[i]);\n  }\n\n  return env_var.GetString();\n}\n\n// Parses 'str' for a 32-bit signed integer.  If successful, writes\n// the result to *value and returns true; otherwise leaves *value\n// unchanged and returns false.\nbool ParseInt32(const Message& src_text, const char* str, Int32* value) {\n  // Parses the environment variable as a decimal integer.\n  char* end = NULL;\n  const long long_value = strtol(str, &end, 10);  // NOLINT\n\n  // Has strtol() consumed all characters in the string?\n  if (*end != '\\0') {\n    // No - an invalid character was encountered.\n    Message msg;\n    msg << \"WARNING: \" << src_text\n        << \" is expected to be a 32-bit integer, but actually\"\n        << \" has value \\\"\" << str << \"\\\".\\n\";\n    printf(\"%s\", msg.GetString().c_str());\n    fflush(stdout);\n    return false;\n  }\n\n  // Is the parsed value in the range of an Int32?\n  const Int32 result = static_cast<Int32>(long_value);\n  if (long_value == LONG_MAX || long_value == LONG_MIN ||\n      // The parsed value overflows as a long.  (strtol() returns\n      // LONG_MAX or LONG_MIN when the input overflows.)\n      result != long_value\n      // The parsed value overflows as an Int32.\n      ) {\n    Message msg;\n    msg << \"WARNING: \" << src_text\n        << \" is expected to be a 32-bit integer, but actually\"\n        << \" has value \" << str << \", which overflows.\\n\";\n    printf(\"%s\", msg.GetString().c_str());\n    fflush(stdout);\n    return false;\n  }\n\n  *value = result;\n  return true;\n}\n\n// Reads and returns the Boolean environment variable corresponding to\n// the given flag; if it's not set, returns default_value.\n//\n// The value is considered true iff it's not \"0\".\nbool BoolFromGTestEnv(const char* flag, bool default_value) {\n#if defined(GTEST_GET_BOOL_FROM_ENV_)\n  return GTEST_GET_BOOL_FROM_ENV_(flag, default_value);\n#else\n  const std::string env_var = FlagToEnvVar(flag);\n  const char* const string_value = posix::GetEnv(env_var.c_str());\n  return string_value == NULL ?\n      default_value : strcmp(string_value, \"0\") != 0;\n#endif  // defined(GTEST_GET_BOOL_FROM_ENV_)\n}\n\n// Reads and returns a 32-bit integer stored in the environment\n// variable corresponding to the given flag; if it isn't set or\n// doesn't represent a valid 32-bit integer, returns default_value.\nInt32 Int32FromGTestEnv(const char* flag, Int32 default_value) {\n#if defined(GTEST_GET_INT32_FROM_ENV_)\n  return GTEST_GET_INT32_FROM_ENV_(flag, default_value);\n#else\n  const std::string env_var = FlagToEnvVar(flag);\n  const char* const string_value = posix::GetEnv(env_var.c_str());\n  if (string_value == NULL) {\n    // The environment variable is not set.\n    return default_value;\n  }\n\n  Int32 result = default_value;\n  if (!ParseInt32(Message() << \"Environment variable \" << env_var,\n                  string_value, &result)) {\n    printf(\"The default value %s is used.\\n\",\n           (Message() << default_value).GetString().c_str());\n    fflush(stdout);\n    return default_value;\n  }\n\n  return result;\n#endif  // defined(GTEST_GET_INT32_FROM_ENV_)\n}\n\n// As a special case for the 'output' flag, if GTEST_OUTPUT is not\n// set, we look for XML_OUTPUT_FILE, which is set by the Bazel build\n// system.  The value of XML_OUTPUT_FILE is a filename without the\n// \"xml:\" prefix of GTEST_OUTPUT.\n// Note that this is meant to be called at the call site so it does\n// not check that the flag is 'output'\n// In essence this checks an env variable called XML_OUTPUT_FILE\n// and if it is set we prepend \"xml:\" to its value, if it not set we return \"\"\nstd::string OutputFlagAlsoCheckEnvVar(){\n  std::string default_value_for_output_flag = \"\";\n  const char* xml_output_file_env = posix::GetEnv(\"XML_OUTPUT_FILE\");\n  if (NULL != xml_output_file_env) {\n    default_value_for_output_flag = std::string(\"xml:\") + xml_output_file_env;\n  }\n  return default_value_for_output_flag;\n}\n\n// Reads and returns the string environment variable corresponding to\n// the given flag; if it's not set, returns default_value.\nconst char* StringFromGTestEnv(const char* flag, const char* default_value) {\n#if defined(GTEST_GET_STRING_FROM_ENV_)\n  return GTEST_GET_STRING_FROM_ENV_(flag, default_value);\n#else\n  const std::string env_var = FlagToEnvVar(flag);\n  const char* const value = posix::GetEnv(env_var.c_str());\n  return value == NULL ? default_value : value;\n#endif  // defined(GTEST_GET_STRING_FROM_ENV_)\n}\n\n}  // namespace internal\n}  // namespace testing\n// Copyright 2007, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n// Google Test - The Google C++ Testing and Mocking Framework\n//\n// This file implements a universal value printer that can print a\n// value of any type T:\n//\n//   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);\n//\n// It uses the << operator when possible, and prints the bytes in the\n// object otherwise.  A user can override its behavior for a class\n// type Foo by defining either operator<<(::std::ostream&, const Foo&)\n// or void PrintTo(const Foo&, ::std::ostream*) in the namespace that\n// defines Foo.\n\n#include <stdio.h>\n#include <cctype>\n#include <cwchar>\n#include <ostream>  // NOLINT\n#include <string>\n\nnamespace testing {\n\nnamespace {\n\nusing ::std::ostream;\n\n// Prints a segment of bytes in the given object.\nGTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_\nGTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_\nGTEST_ATTRIBUTE_NO_SANITIZE_THREAD_\nvoid PrintByteSegmentInObjectTo(const unsigned char* obj_bytes, size_t start,\n                                size_t count, ostream* os) {\n  char text[5] = \"\";\n  for (size_t i = 0; i != count; i++) {\n    const size_t j = start + i;\n    if (i != 0) {\n      // Organizes the bytes into groups of 2 for easy parsing by\n      // human.\n      if ((j % 2) == 0)\n        *os << ' ';\n      else\n        *os << '-';\n    }\n    GTEST_SNPRINTF_(text, sizeof(text), \"%02X\", obj_bytes[j]);\n    *os << text;\n  }\n}\n\n// Prints the bytes in the given value to the given ostream.\nvoid PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count,\n                              ostream* os) {\n  // Tells the user how big the object is.\n  *os << count << \"-byte object <\";\n\n  const size_t kThreshold = 132;\n  const size_t kChunkSize = 64;\n  // If the object size is bigger than kThreshold, we'll have to omit\n  // some details by printing only the first and the last kChunkSize\n  // bytes.\n  // FIXME: let the user control the threshold using a flag.\n  if (count < kThreshold) {\n    PrintByteSegmentInObjectTo(obj_bytes, 0, count, os);\n  } else {\n    PrintByteSegmentInObjectTo(obj_bytes, 0, kChunkSize, os);\n    *os << \" ... \";\n    // Rounds up to 2-byte boundary.\n    const size_t resume_pos = (count - kChunkSize + 1)/2*2;\n    PrintByteSegmentInObjectTo(obj_bytes, resume_pos, count - resume_pos, os);\n  }\n  *os << \">\";\n}\n\n}  // namespace\n\nnamespace internal2 {\n\n// Delegates to PrintBytesInObjectToImpl() to print the bytes in the\n// given object.  The delegation simplifies the implementation, which\n// uses the << operator and thus is easier done outside of the\n// ::testing::internal namespace, which contains a << operator that\n// sometimes conflicts with the one in STL.\nvoid PrintBytesInObjectTo(const unsigned char* obj_bytes, size_t count,\n                          ostream* os) {\n  PrintBytesInObjectToImpl(obj_bytes, count, os);\n}\n\n}  // namespace internal2\n\nnamespace internal {\n\n// Depending on the value of a char (or wchar_t), we print it in one\n// of three formats:\n//   - as is if it's a printable ASCII (e.g. 'a', '2', ' '),\n//   - as a hexadecimal escape sequence (e.g. '\\x7F'), or\n//   - as a special escape sequence (e.g. '\\r', '\\n').\nenum CharFormat {\n  kAsIs,\n  kHexEscape,\n  kSpecialEscape\n};\n\n// Returns true if c is a printable ASCII character.  We test the\n// value of c directly instead of calling isprint(), which is buggy on\n// Windows Mobile.\ninline bool IsPrintableAscii(wchar_t c) {\n  return 0x20 <= c && c <= 0x7E;\n}\n\n// Prints a wide or narrow char c as a character literal without the\n// quotes, escaping it when necessary; returns how c was formatted.\n// The template argument UnsignedChar is the unsigned version of Char,\n// which is the type of c.\ntemplate <typename UnsignedChar, typename Char>\nstatic CharFormat PrintAsCharLiteralTo(Char c, ostream* os) {\n  switch (static_cast<wchar_t>(c)) {\n    case L'\\0':\n      *os << \"\\\\0\";\n      break;\n    case L'\\'':\n      *os << \"\\\\'\";\n      break;\n    case L'\\\\':\n      *os << \"\\\\\\\\\";\n      break;\n    case L'\\a':\n      *os << \"\\\\a\";\n      break;\n    case L'\\b':\n      *os << \"\\\\b\";\n      break;\n    case L'\\f':\n      *os << \"\\\\f\";\n      break;\n    case L'\\n':\n      *os << \"\\\\n\";\n      break;\n    case L'\\r':\n      *os << \"\\\\r\";\n      break;\n    case L'\\t':\n      *os << \"\\\\t\";\n      break;\n    case L'\\v':\n      *os << \"\\\\v\";\n      break;\n    default:\n      if (IsPrintableAscii(c)) {\n        *os << static_cast<char>(c);\n        return kAsIs;\n      } else {\n        ostream::fmtflags flags = os->flags();\n        *os << \"\\\\x\" << std::hex << std::uppercase\n            << static_cast<int>(static_cast<UnsignedChar>(c));\n        os->flags(flags);\n        return kHexEscape;\n      }\n  }\n  return kSpecialEscape;\n}\n\n// Prints a wchar_t c as if it's part of a string literal, escaping it when\n// necessary; returns how c was formatted.\nstatic CharFormat PrintAsStringLiteralTo(wchar_t c, ostream* os) {\n  switch (c) {\n    case L'\\'':\n      *os << \"'\";\n      return kAsIs;\n    case L'\"':\n      *os << \"\\\\\\\"\";\n      return kSpecialEscape;\n    default:\n      return PrintAsCharLiteralTo<wchar_t>(c, os);\n  }\n}\n\n// Prints a char c as if it's part of a string literal, escaping it when\n// necessary; returns how c was formatted.\nstatic CharFormat PrintAsStringLiteralTo(char c, ostream* os) {\n  return PrintAsStringLiteralTo(\n      static_cast<wchar_t>(static_cast<unsigned char>(c)), os);\n}\n\n// Prints a wide or narrow character c and its code.  '\\0' is printed\n// as \"'\\\\0'\", other unprintable characters are also properly escaped\n// using the standard C++ escape sequence.  The template argument\n// UnsignedChar is the unsigned version of Char, which is the type of c.\ntemplate <typename UnsignedChar, typename Char>\nvoid PrintCharAndCodeTo(Char c, ostream* os) {\n  // First, print c as a literal in the most readable form we can find.\n  *os << ((sizeof(c) > 1) ? \"L'\" : \"'\");\n  const CharFormat format = PrintAsCharLiteralTo<UnsignedChar>(c, os);\n  *os << \"'\";\n\n  // To aid user debugging, we also print c's code in decimal, unless\n  // it's 0 (in which case c was printed as '\\\\0', making the code\n  // obvious).\n  if (c == 0)\n    return;\n  *os << \" (\" << static_cast<int>(c);\n\n  // For more convenience, we print c's code again in hexadecimal,\n  // unless c was already printed in the form '\\x##' or the code is in\n  // [1, 9].\n  if (format == kHexEscape || (1 <= c && c <= 9)) {\n    // Do nothing.\n  } else {\n    *os << \", 0x\" << String::FormatHexInt(static_cast<UnsignedChar>(c));\n  }\n  *os << \")\";\n}\n\nvoid PrintTo(unsigned char c, ::std::ostream* os) {\n  PrintCharAndCodeTo<unsigned char>(c, os);\n}\nvoid PrintTo(signed char c, ::std::ostream* os) {\n  PrintCharAndCodeTo<unsigned char>(c, os);\n}\n\n// Prints a wchar_t as a symbol if it is printable or as its internal\n// code otherwise and also as its code.  L'\\0' is printed as \"L'\\\\0'\".\nvoid PrintTo(wchar_t wc, ostream* os) {\n  PrintCharAndCodeTo<wchar_t>(wc, os);\n}\n\n// Prints the given array of characters to the ostream.  CharType must be either\n// char or wchar_t.\n// The array starts at begin, the length is len, it may include '\\0' characters\n// and may not be NUL-terminated.\ntemplate <typename CharType>\nGTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_\nGTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_\nGTEST_ATTRIBUTE_NO_SANITIZE_THREAD_\nstatic CharFormat PrintCharsAsStringTo(\n    const CharType* begin, size_t len, ostream* os) {\n  const char* const kQuoteBegin = sizeof(CharType) == 1 ? \"\\\"\" : \"L\\\"\";\n  *os << kQuoteBegin;\n  bool is_previous_hex = false;\n  CharFormat print_format = kAsIs;\n  for (size_t index = 0; index < len; ++index) {\n    const CharType cur = begin[index];\n    if (is_previous_hex && IsXDigit(cur)) {\n      // Previous character is of '\\x..' form and this character can be\n      // interpreted as another hexadecimal digit in its number. Break string to\n      // disambiguate.\n      *os << \"\\\" \" << kQuoteBegin;\n    }\n    is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape;\n    // Remember if any characters required hex escaping.\n    if (is_previous_hex) {\n      print_format = kHexEscape;\n    }\n  }\n  *os << \"\\\"\";\n  return print_format;\n}\n\n// Prints a (const) char/wchar_t array of 'len' elements, starting at address\n// 'begin'.  CharType must be either char or wchar_t.\ntemplate <typename CharType>\nGTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_\nGTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_\nGTEST_ATTRIBUTE_NO_SANITIZE_THREAD_\nstatic void UniversalPrintCharArray(\n    const CharType* begin, size_t len, ostream* os) {\n  // The code\n  //   const char kFoo[] = \"foo\";\n  // generates an array of 4, not 3, elements, with the last one being '\\0'.\n  //\n  // Therefore when printing a char array, we don't print the last element if\n  // it's '\\0', such that the output matches the string literal as it's\n  // written in the source code.\n  if (len > 0 && begin[len - 1] == '\\0') {\n    PrintCharsAsStringTo(begin, len - 1, os);\n    return;\n  }\n\n  // If, however, the last element in the array is not '\\0', e.g.\n  //    const char kFoo[] = { 'f', 'o', 'o' };\n  // we must print the entire array.  We also print a message to indicate\n  // that the array is not NUL-terminated.\n  PrintCharsAsStringTo(begin, len, os);\n  *os << \" (no terminating NUL)\";\n}\n\n// Prints a (const) char array of 'len' elements, starting at address 'begin'.\nvoid UniversalPrintArray(const char* begin, size_t len, ostream* os) {\n  UniversalPrintCharArray(begin, len, os);\n}\n\n// Prints a (const) wchar_t array of 'len' elements, starting at address\n// 'begin'.\nvoid UniversalPrintArray(const wchar_t* begin, size_t len, ostream* os) {\n  UniversalPrintCharArray(begin, len, os);\n}\n\n// Prints the given C string to the ostream.\nvoid PrintTo(const char* s, ostream* os) {\n  if (s == NULL) {\n    *os << \"NULL\";\n  } else {\n    *os << ImplicitCast_<const void*>(s) << \" pointing to \";\n    PrintCharsAsStringTo(s, strlen(s), os);\n  }\n}\n\n// MSVC compiler can be configured to define whar_t as a typedef\n// of unsigned short. Defining an overload for const wchar_t* in that case\n// would cause pointers to unsigned shorts be printed as wide strings,\n// possibly accessing more memory than intended and causing invalid\n// memory accesses. MSVC defines _NATIVE_WCHAR_T_DEFINED symbol when\n// wchar_t is implemented as a native type.\n#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)\n// Prints the given wide C string to the ostream.\nvoid PrintTo(const wchar_t* s, ostream* os) {\n  if (s == NULL) {\n    *os << \"NULL\";\n  } else {\n    *os << ImplicitCast_<const void*>(s) << \" pointing to \";\n    PrintCharsAsStringTo(s, std::wcslen(s), os);\n  }\n}\n#endif  // wchar_t is native\n\nnamespace {\n\nbool ContainsUnprintableControlCodes(const char* str, size_t length) {\n  const unsigned char *s = reinterpret_cast<const unsigned char *>(str);\n\n  for (size_t i = 0; i < length; i++) {\n    unsigned char ch = *s++;\n    if (std::iscntrl(ch)) {\n        switch (ch) {\n        case '\\t':\n        case '\\n':\n        case '\\r':\n          break;\n        default:\n          return true;\n        }\n      }\n  }\n  return false;\n}\n\nbool IsUTF8TrailByte(unsigned char t) { return 0x80 <= t && t<= 0xbf; }\n\nbool IsValidUTF8(const char* str, size_t length) {\n  const unsigned char *s = reinterpret_cast<const unsigned char *>(str);\n\n  for (size_t i = 0; i < length;) {\n    unsigned char lead = s[i++];\n\n    if (lead <= 0x7f) {\n      continue;  // single-byte character (ASCII) 0..7F\n    }\n    if (lead < 0xc2) {\n      return false;  // trail byte or non-shortest form\n    } else if (lead <= 0xdf && (i + 1) <= length && IsUTF8TrailByte(s[i])) {\n      ++i;  // 2-byte character\n    } else if (0xe0 <= lead && lead <= 0xef && (i + 2) <= length &&\n               IsUTF8TrailByte(s[i]) &&\n               IsUTF8TrailByte(s[i + 1]) &&\n               // check for non-shortest form and surrogate\n               (lead != 0xe0 || s[i] >= 0xa0) &&\n               (lead != 0xed || s[i] < 0xa0)) {\n      i += 2;  // 3-byte character\n    } else if (0xf0 <= lead && lead <= 0xf4 && (i + 3) <= length &&\n               IsUTF8TrailByte(s[i]) &&\n               IsUTF8TrailByte(s[i + 1]) &&\n               IsUTF8TrailByte(s[i + 2]) &&\n               // check for non-shortest form\n               (lead != 0xf0 || s[i] >= 0x90) &&\n               (lead != 0xf4 || s[i] < 0x90)) {\n      i += 3;  // 4-byte character\n    } else {\n      return false;\n    }\n  }\n  return true;\n}\n\nvoid ConditionalPrintAsText(const char* str, size_t length, ostream* os) {\n  if (!ContainsUnprintableControlCodes(str, length) &&\n      IsValidUTF8(str, length)) {\n    *os << \"\\n    As Text: \\\"\" << str << \"\\\"\";\n  }\n}\n\n}  // anonymous namespace\n\n// Prints a ::string object.\n#if GTEST_HAS_GLOBAL_STRING\nvoid PrintStringTo(const ::string& s, ostream* os) {\n  if (PrintCharsAsStringTo(s.data(), s.size(), os) == kHexEscape) {\n    if (GTEST_FLAG(print_utf8)) {\n      ConditionalPrintAsText(s.data(), s.size(), os);\n    }\n  }\n}\n#endif  // GTEST_HAS_GLOBAL_STRING\n\nvoid PrintStringTo(const ::std::string& s, ostream* os) {\n  if (PrintCharsAsStringTo(s.data(), s.size(), os) == kHexEscape) {\n    if (GTEST_FLAG(print_utf8)) {\n      ConditionalPrintAsText(s.data(), s.size(), os);\n    }\n  }\n}\n\n// Prints a ::wstring object.\n#if GTEST_HAS_GLOBAL_WSTRING\nvoid PrintWideStringTo(const ::wstring& s, ostream* os) {\n  PrintCharsAsStringTo(s.data(), s.size(), os);\n}\n#endif  // GTEST_HAS_GLOBAL_WSTRING\n\n#if GTEST_HAS_STD_WSTRING\nvoid PrintWideStringTo(const ::std::wstring& s, ostream* os) {\n  PrintCharsAsStringTo(s.data(), s.size(), os);\n}\n#endif  // GTEST_HAS_STD_WSTRING\n\n}  // namespace internal\n\n}  // namespace testing\n// Copyright 2008, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n//\n// The Google C++ Testing and Mocking Framework (Google Test)\n\n\nnamespace testing {\n\nusing internal::GetUnitTestImpl;\n\n// Gets the summary of the failure message by omitting the stack trace\n// in it.\nstd::string TestPartResult::ExtractSummary(const char* message) {\n  const char* const stack_trace = strstr(message, internal::kStackTraceMarker);\n  return stack_trace == NULL ? message :\n      std::string(message, stack_trace);\n}\n\n// Prints a TestPartResult object.\nstd::ostream& operator<<(std::ostream& os, const TestPartResult& result) {\n  return os\n      << result.file_name() << \":\" << result.line_number() << \": \"\n      << (result.type() == TestPartResult::kSuccess ? \"Success\" :\n          result.type() == TestPartResult::kFatalFailure ? \"Fatal failure\" :\n          \"Non-fatal failure\") << \":\\n\"\n      << result.message() << std::endl;\n}\n\n// Appends a TestPartResult to the array.\nvoid TestPartResultArray::Append(const TestPartResult& result) {\n  array_.push_back(result);\n}\n\n// Returns the TestPartResult at the given index (0-based).\nconst TestPartResult& TestPartResultArray::GetTestPartResult(int index) const {\n  if (index < 0 || index >= size()) {\n    printf(\"\\nInvalid index (%d) into TestPartResultArray.\\n\", index);\n    internal::posix::Abort();\n  }\n\n  return array_[index];\n}\n\n// Returns the number of TestPartResult objects in the array.\nint TestPartResultArray::size() const {\n  return static_cast<int>(array_.size());\n}\n\nnamespace internal {\n\nHasNewFatalFailureHelper::HasNewFatalFailureHelper()\n    : has_new_fatal_failure_(false),\n      original_reporter_(GetUnitTestImpl()->\n                         GetTestPartResultReporterForCurrentThread()) {\n  GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(this);\n}\n\nHasNewFatalFailureHelper::~HasNewFatalFailureHelper() {\n  GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(\n      original_reporter_);\n}\n\nvoid HasNewFatalFailureHelper::ReportTestPartResult(\n    const TestPartResult& result) {\n  if (result.fatally_failed())\n    has_new_fatal_failure_ = true;\n  original_reporter_->ReportTestPartResult(result);\n}\n\n}  // namespace internal\n\n}  // namespace testing\n// Copyright 2008 Google Inc.\n// All Rights Reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n\n\nnamespace testing {\nnamespace internal {\n\n#if GTEST_HAS_TYPED_TEST_P\n\n// Skips to the first non-space char in str. Returns an empty string if str\n// contains only whitespace characters.\nstatic const char* SkipSpaces(const char* str) {\n  while (IsSpace(*str))\n    str++;\n  return str;\n}\n\nstatic std::vector<std::string> SplitIntoTestNames(const char* src) {\n  std::vector<std::string> name_vec;\n  src = SkipSpaces(src);\n  for (; src != NULL; src = SkipComma(src)) {\n    name_vec.push_back(StripTrailingSpaces(GetPrefixUntilComma(src)));\n  }\n  return name_vec;\n}\n\n// Verifies that registered_tests match the test names in\n// registered_tests_; returns registered_tests if successful, or\n// aborts the program otherwise.\nconst char* TypedTestCasePState::VerifyRegisteredTestNames(\n    const char* file, int line, const char* registered_tests) {\n  typedef RegisteredTestsMap::const_iterator RegisteredTestIter;\n  registered_ = true;\n\n  std::vector<std::string> name_vec = SplitIntoTestNames(registered_tests);\n\n  Message errors;\n\n  std::set<std::string> tests;\n  for (std::vector<std::string>::const_iterator name_it = name_vec.begin();\n       name_it != name_vec.end(); ++name_it) {\n    const std::string& name = *name_it;\n    if (tests.count(name) != 0) {\n      errors << \"Test \" << name << \" is listed more than once.\\n\";\n      continue;\n    }\n\n    bool found = false;\n    for (RegisteredTestIter it = registered_tests_.begin();\n         it != registered_tests_.end();\n         ++it) {\n      if (name == it->first) {\n        found = true;\n        break;\n      }\n    }\n\n    if (found) {\n      tests.insert(name);\n    } else {\n      errors << \"No test named \" << name\n             << \" can be found in this test case.\\n\";\n    }\n  }\n\n  for (RegisteredTestIter it = registered_tests_.begin();\n       it != registered_tests_.end();\n       ++it) {\n    if (tests.count(it->first) == 0) {\n      errors << \"You forgot to list test \" << it->first << \".\\n\";\n    }\n  }\n\n  const std::string& errors_str = errors.GetString();\n  if (errors_str != \"\") {\n    fprintf(stderr, \"%s %s\", FormatFileLocation(file, line).c_str(),\n            errors_str.c_str());\n    fflush(stderr);\n    posix::Abort();\n  }\n\n  return registered_tests;\n}\n\n#endif  // GTEST_HAS_TYPED_TEST_P\n\n}  // namespace internal\n}  // namespace testing\n"
  },
  {
    "path": "test/external/gtest/gtest.h",
    "content": "// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n//\n// The Google C++ Testing and Mocking Framework (Google Test)\n//\n// This header file defines the public API for Google Test.  It should be\n// included by any test program that uses Google Test.\n//\n// IMPORTANT NOTE: Due to limitation of the C++ language, we have to\n// leave some internal implementation details in this header file.\n// They are clearly marked by comments like this:\n//\n//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n//\n// Such code is NOT meant to be used by a user directly, and is subject\n// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user\n// program!\n//\n// Acknowledgment: Google Test borrowed the idea of automatic test\n// registration from Barthelemy Dagenais' (barthelemy@prologique.com)\n// easyUnit framework.\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_H_\n#define GTEST_INCLUDE_GTEST_GTEST_H_\n\n#include <limits>\n#include <ostream>\n#include <vector>\n\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// The Google C++ Testing and Mocking Framework (Google Test)\n//\n// This header file declares functions and macros used internally by\n// Google Test.  They are subject to change without notice.\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_\n\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Low-level types and utilities for porting Google Test to various\n// platforms.  All macros ending with _ and symbols defined in an\n// internal namespace are subject to change without notice.  Code\n// outside Google Test MUST NOT USE THEM DIRECTLY.  Macros that don't\n// end with _ are part of Google Test's public API and can be used by\n// code outside Google Test.\n//\n// This file is fundamental to Google Test.  All other Google Test source\n// files are expected to #include this.  Therefore, it cannot #include\n// any other Google Test header.\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_\n\n// Environment-describing macros\n// -----------------------------\n//\n// Google Test can be used in many different environments.  Macros in\n// this section tell Google Test what kind of environment it is being\n// used in, such that Google Test can provide environment-specific\n// features and implementations.\n//\n// Google Test tries to automatically detect the properties of its\n// environment, so users usually don't need to worry about these\n// macros.  However, the automatic detection is not perfect.\n// Sometimes it's necessary for a user to define some of the following\n// macros in the build script to override Google Test's decisions.\n//\n// If the user doesn't define a macro in the list, Google Test will\n// provide a default definition.  After this header is #included, all\n// macros in this list will be defined to either 1 or 0.\n//\n// Notes to maintainers:\n//   - Each macro here is a user-tweakable knob; do not grow the list\n//     lightly.\n//   - Use #if to key off these macros.  Don't use #ifdef or \"#if\n//     defined(...)\", which will not work as these macros are ALWAYS\n//     defined.\n//\n//   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)\n//                              is/isn't available.\n//   GTEST_HAS_EXCEPTIONS     - Define it to 1/0 to indicate that exceptions\n//                              are enabled.\n//   GTEST_HAS_GLOBAL_STRING  - Define it to 1/0 to indicate that ::string\n//                              is/isn't available\n//   GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::wstring\n//                              is/isn't available\n//   GTEST_HAS_POSIX_RE       - Define it to 1/0 to indicate that POSIX regular\n//                              expressions are/aren't available.\n//   GTEST_HAS_PTHREAD        - Define it to 1/0 to indicate that <pthread.h>\n//                              is/isn't available.\n//   GTEST_HAS_RTTI           - Define it to 1/0 to indicate that RTTI is/isn't\n//                              enabled.\n//   GTEST_HAS_STD_WSTRING    - Define it to 1/0 to indicate that\n//                              std::wstring does/doesn't work (Google Test can\n//                              be used where std::wstring is unavailable).\n//   GTEST_HAS_TR1_TUPLE      - Define it to 1/0 to indicate tr1::tuple\n//                              is/isn't available.\n//   GTEST_HAS_SEH            - Define it to 1/0 to indicate whether the\n//                              compiler supports Microsoft's \"Structured\n//                              Exception Handling\".\n//   GTEST_HAS_STREAM_REDIRECTION\n//                            - Define it to 1/0 to indicate whether the\n//                              platform supports I/O stream redirection using\n//                              dup() and dup2().\n//   GTEST_USE_OWN_TR1_TUPLE  - Define it to 1/0 to indicate whether Google\n//                              Test's own tr1 tuple implementation should be\n//                              used.  Unused when the user sets\n//                              GTEST_HAS_TR1_TUPLE to 0.\n//   GTEST_LANG_CXX11         - Define it to 1/0 to indicate that Google Test\n//                              is building in C++11/C++98 mode.\n//   GTEST_LINKED_AS_SHARED_LIBRARY\n//                            - Define to 1 when compiling tests that use\n//                              Google Test as a shared library (known as\n//                              DLL on Windows).\n//   GTEST_CREATE_SHARED_LIBRARY\n//                            - Define to 1 when compiling Google Test itself\n//                              as a shared library.\n//   GTEST_DEFAULT_DEATH_TEST_STYLE\n//                            - The default value of --gtest_death_test_style.\n//                              The legacy default has been \"fast\" in the open\n//                              source version since 2008. The recommended value\n//                              is \"threadsafe\", and can be set in\n//                              custom/gtest-port.h.\n\n// Platform-indicating macros\n// --------------------------\n//\n// Macros indicating the platform on which Google Test is being used\n// (a macro is defined to 1 if compiled on the given platform;\n// otherwise UNDEFINED -- it's never defined to 0.).  Google Test\n// defines these macros automatically.  Code outside Google Test MUST\n// NOT define them.\n//\n//   GTEST_OS_AIX      - IBM AIX\n//   GTEST_OS_CYGWIN   - Cygwin\n//   GTEST_OS_FREEBSD  - FreeBSD\n//   GTEST_OS_FUCHSIA  - Fuchsia\n//   GTEST_OS_HPUX     - HP-UX\n//   GTEST_OS_LINUX    - Linux\n//     GTEST_OS_LINUX_ANDROID - Google Android\n//   GTEST_OS_MAC      - Mac OS X\n//     GTEST_OS_IOS    - iOS\n//   GTEST_OS_NACL     - Google Native Client (NaCl)\n//   GTEST_OS_NETBSD   - NetBSD\n//   GTEST_OS_OPENBSD  - OpenBSD\n//   GTEST_OS_QNX      - QNX\n//   GTEST_OS_SOLARIS  - Sun Solaris\n//   GTEST_OS_SYMBIAN  - Symbian\n//   GTEST_OS_WINDOWS  - Windows (Desktop, MinGW, or Mobile)\n//     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop\n//     GTEST_OS_WINDOWS_MINGW    - MinGW\n//     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile\n//     GTEST_OS_WINDOWS_PHONE    - Windows Phone\n//     GTEST_OS_WINDOWS_RT       - Windows Store App/WinRT\n//   GTEST_OS_ZOS      - z/OS\n//\n// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the\n// most stable support.  Since core members of the Google Test project\n// don't have access to other platforms, support for them may be less\n// stable.  If you notice any problems on your platform, please notify\n// googletestframework@googlegroups.com (patches for fixing them are\n// even more welcome!).\n//\n// It is possible that none of the GTEST_OS_* macros are defined.\n\n// Feature-indicating macros\n// -------------------------\n//\n// Macros indicating which Google Test features are available (a macro\n// is defined to 1 if the corresponding feature is supported;\n// otherwise UNDEFINED -- it's never defined to 0.).  Google Test\n// defines these macros automatically.  Code outside Google Test MUST\n// NOT define them.\n//\n// These macros are public so that portable tests can be written.\n// Such tests typically surround code using a feature with an #if\n// which controls that code.  For example:\n//\n// #if GTEST_HAS_DEATH_TEST\n//   EXPECT_DEATH(DoSomethingDeadly());\n// #endif\n//\n//   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized\n//                            tests)\n//   GTEST_HAS_DEATH_TEST   - death tests\n//   GTEST_HAS_TYPED_TEST   - typed tests\n//   GTEST_HAS_TYPED_TEST_P - type-parameterized tests\n//   GTEST_IS_THREADSAFE    - Google Test is thread-safe.\n//   GOOGLETEST_CM0007 DO NOT DELETE\n//   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used. Do not confuse with\n//                            GTEST_HAS_POSIX_RE (see above) which users can\n//                            define themselves.\n//   GTEST_USES_SIMPLE_RE   - our own simple regex is used;\n//                            the above RE\\b(s) are mutually exclusive.\n//   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().\n\n// Misc public macros\n// ------------------\n//\n//   GTEST_FLAG(flag_name)  - references the variable corresponding to\n//                            the given Google Test flag.\n\n// Internal utilities\n// ------------------\n//\n// The following macros and utilities are for Google Test's INTERNAL\n// use only.  Code outside Google Test MUST NOT USE THEM DIRECTLY.\n//\n// Macros for basic C++ coding:\n//   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.\n//   GTEST_ATTRIBUTE_UNUSED_  - declares that a class' instances or a\n//                              variable don't have to be used.\n//   GTEST_DISALLOW_ASSIGN_   - disables operator=.\n//   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.\n//   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.\n//   GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is\n//                                        suppressed (constant conditional).\n//   GTEST_INTENTIONAL_CONST_COND_POP_  - finish code section where MSVC C4127\n//                                        is suppressed.\n//\n// C++11 feature wrappers:\n//\n//   testing::internal::forward - portability wrapper for std::forward.\n//   testing::internal::move  - portability wrapper for std::move.\n//\n// Synchronization:\n//   Mutex, MutexLock, ThreadLocal, GetThreadCount()\n//                            - synchronization primitives.\n//\n// Template meta programming:\n//   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.\n//   IteratorTraits - partial implementation of std::iterator_traits, which\n//                    is not available in libCstd when compiled with Sun C++.\n//\n// Smart pointers:\n//   scoped_ptr     - as in TR2.\n//\n// Regular expressions:\n//   RE             - a simple regular expression class using the POSIX\n//                    Extended Regular Expression syntax on UNIX-like platforms\n//                    GOOGLETEST_CM0008 DO NOT DELETE\n//                    or a reduced regular exception syntax on other\n//                    platforms, including Windows.\n// Logging:\n//   GTEST_LOG_()   - logs messages at the specified severity level.\n//   LogToStderr()  - directs all log messages to stderr.\n//   FlushInfoLog() - flushes informational log messages.\n//\n// Stdout and stderr capturing:\n//   CaptureStdout()     - starts capturing stdout.\n//   GetCapturedStdout() - stops capturing stdout and returns the captured\n//                         string.\n//   CaptureStderr()     - starts capturing stderr.\n//   GetCapturedStderr() - stops capturing stderr and returns the captured\n//                         string.\n//\n// Integer types:\n//   TypeWithSize   - maps an integer to a int type.\n//   Int32, UInt32, Int64, UInt64, TimeInMillis\n//                  - integers of known sizes.\n//   BiggestInt     - the biggest signed integer type.\n//\n// Command-line utilities:\n//   GTEST_DECLARE_*()  - declares a flag.\n//   GTEST_DEFINE_*()   - defines a flag.\n//   GetInjectableArgvs() - returns the command line as a vector of strings.\n//\n// Environment variable utilities:\n//   GetEnv()             - gets the value of an environment variable.\n//   BoolFromGTestEnv()   - parses a bool environment variable.\n//   Int32FromGTestEnv()  - parses an Int32 environment variable.\n//   StringFromGTestEnv() - parses a string environment variable.\n\n#include <ctype.h>   // for isspace, etc\n#include <stddef.h>  // for ptrdiff_t\n#include <stdlib.h>\n#include <stdio.h>\n#include <string.h>\n#ifndef _WIN32_WCE\n# include <sys/types.h>\n# include <sys/stat.h>\n#endif  // !_WIN32_WCE\n\n#if defined __APPLE__\n# include <AvailabilityMacros.h>\n# include <TargetConditionals.h>\n#endif\n\n// Brings in the definition of HAS_GLOBAL_STRING.  This must be done\n// BEFORE we test HAS_GLOBAL_STRING.\n#include <string>  // NOLINT\n#include <algorithm>  // NOLINT\n#include <iostream>  // NOLINT\n#include <sstream>  // NOLINT\n#include <utility>\n#include <vector>  // NOLINT\n\n// Copyright 2015, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// The Google C++ Testing and Mocking Framework (Google Test)\n//\n// This header file defines the GTEST_OS_* macro.\n// It is separate from gtest-port.h so that custom/gtest-port.h can include it.\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_\n\n// Determines the platform on which Google Test is compiled.\n#ifdef __CYGWIN__\n# define GTEST_OS_CYGWIN 1\n#elif defined __SYMBIAN32__\n# define GTEST_OS_SYMBIAN 1\n#elif defined _WIN32\n# define GTEST_OS_WINDOWS 1\n# ifdef _WIN32_WCE\n#  define GTEST_OS_WINDOWS_MOBILE 1\n# elif defined(__MINGW__) || defined(__MINGW32__)\n#  define GTEST_OS_WINDOWS_MINGW 1\n# elif defined(WINAPI_FAMILY)\n#  include <winapifamily.h>\n#  if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)\n#   define GTEST_OS_WINDOWS_DESKTOP 1\n#  elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)\n#   define GTEST_OS_WINDOWS_PHONE 1\n#  elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)\n#   define GTEST_OS_WINDOWS_RT 1\n#  elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE)\n#   define GTEST_OS_WINDOWS_PHONE 1\n#   define GTEST_OS_WINDOWS_TV_TITLE 1\n#  else\n    // WINAPI_FAMILY defined but no known partition matched.\n    // Default to desktop.\n#   define GTEST_OS_WINDOWS_DESKTOP 1\n#  endif\n# else\n#  define GTEST_OS_WINDOWS_DESKTOP 1\n# endif  // _WIN32_WCE\n#elif defined __APPLE__\n# define GTEST_OS_MAC 1\n# if TARGET_OS_IPHONE\n#  define GTEST_OS_IOS 1\n# endif\n#elif defined __FreeBSD__\n# define GTEST_OS_FREEBSD 1\n#elif defined __Fuchsia__\n# define GTEST_OS_FUCHSIA 1\n#elif defined __linux__\n# define GTEST_OS_LINUX 1\n# if defined __ANDROID__\n#  define GTEST_OS_LINUX_ANDROID 1\n# endif\n#elif defined __MVS__\n# define GTEST_OS_ZOS 1\n#elif defined(__sun) && defined(__SVR4)\n# define GTEST_OS_SOLARIS 1\n#elif defined(_AIX)\n# define GTEST_OS_AIX 1\n#elif defined(__hpux)\n# define GTEST_OS_HPUX 1\n#elif defined __native_client__\n# define GTEST_OS_NACL 1\n#elif defined __NetBSD__\n# define GTEST_OS_NETBSD 1\n#elif defined __OpenBSD__\n# define GTEST_OS_OPENBSD 1\n#elif defined __QNX__\n# define GTEST_OS_QNX 1\n#endif  // __CYGWIN__\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_\n// Copyright 2015, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Injection point for custom user configurations. See README for details\n//\n// ** Custom implementation starts here **\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_\n\n#if !defined(GTEST_DEV_EMAIL_)\n# define GTEST_DEV_EMAIL_ \"googletestframework@@googlegroups.com\"\n# define GTEST_FLAG_PREFIX_ \"gtest_\"\n# define GTEST_FLAG_PREFIX_DASH_ \"gtest-\"\n# define GTEST_FLAG_PREFIX_UPPER_ \"GTEST_\"\n# define GTEST_NAME_ \"Google Test\"\n# define GTEST_PROJECT_URL_ \"https://github.com/google/googletest/\"\n#endif  // !defined(GTEST_DEV_EMAIL_)\n\n#if !defined(GTEST_INIT_GOOGLE_TEST_NAME_)\n# define GTEST_INIT_GOOGLE_TEST_NAME_ \"testing::InitGoogleTest\"\n#endif  // !defined(GTEST_INIT_GOOGLE_TEST_NAME_)\n\n// Determines the version of gcc that is used to compile this.\n#ifdef __GNUC__\n// 40302 means version 4.3.2.\n# define GTEST_GCC_VER_ \\\n    (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)\n#endif  // __GNUC__\n\n// Macros for disabling Microsoft Visual C++ warnings.\n//\n//   GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385)\n//   /* code that triggers warnings C4800 and C4385 */\n//   GTEST_DISABLE_MSC_WARNINGS_POP_()\n#if _MSC_VER >= 1400\n# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \\\n    __pragma(warning(push))                        \\\n    __pragma(warning(disable: warnings))\n# define GTEST_DISABLE_MSC_WARNINGS_POP_()          \\\n    __pragma(warning(pop))\n#else\n// Older versions of MSVC don't have __pragma.\n# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)\n# define GTEST_DISABLE_MSC_WARNINGS_POP_()\n#endif\n\n// Clang on Windows does not understand MSVC's pragma warning.\n// We need clang-specific way to disable function deprecation warning.\n#ifdef __clang__\n# define GTEST_DISABLE_MSC_DEPRECATED_PUSH_()                         \\\n    _Pragma(\"clang diagnostic push\")                                  \\\n    _Pragma(\"clang diagnostic ignored \\\"-Wdeprecated-declarations\\\"\") \\\n    _Pragma(\"clang diagnostic ignored \\\"-Wdeprecated-implementations\\\"\")\n#define GTEST_DISABLE_MSC_DEPRECATED_POP_() \\\n    _Pragma(\"clang diagnostic pop\")\n#else\n# define GTEST_DISABLE_MSC_DEPRECATED_PUSH_() \\\n    GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)\n# define GTEST_DISABLE_MSC_DEPRECATED_POP_() \\\n    GTEST_DISABLE_MSC_WARNINGS_POP_()\n#endif\n\n#ifndef GTEST_LANG_CXX11\n// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when\n// -std={c,gnu}++{0x,11} is passed.  The C++11 standard specifies a\n// value for __cplusplus, and recent versions of clang, gcc, and\n// probably other compilers set that too in C++11 mode.\n# if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L || _MSC_VER >= 1900\n// Compiling in at least C++11 mode.\n#  define GTEST_LANG_CXX11 1\n# else\n#  define GTEST_LANG_CXX11 0\n# endif\n#endif\n\n// Distinct from C++11 language support, some environments don't provide\n// proper C++11 library support. Notably, it's possible to build in\n// C++11 mode when targeting Mac OS X 10.6, which has an old libstdc++\n// with no C++11 support.\n//\n// libstdc++ has sufficient C++11 support as of GCC 4.6.0, __GLIBCXX__\n// 20110325, but maintenance releases in the 4.4 and 4.5 series followed\n// this date, so check for those versions by their date stamps.\n// https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning\n#if GTEST_LANG_CXX11 && \\\n    (!defined(__GLIBCXX__) || ( \\\n        __GLIBCXX__ >= 20110325ul &&  /* GCC >= 4.6.0 */ \\\n        /* Blacklist of patch releases of older branches: */ \\\n        __GLIBCXX__ != 20110416ul &&  /* GCC 4.4.6 */ \\\n        __GLIBCXX__ != 20120313ul &&  /* GCC 4.4.7 */ \\\n        __GLIBCXX__ != 20110428ul &&  /* GCC 4.5.3 */ \\\n        __GLIBCXX__ != 20120702ul))   /* GCC 4.5.4 */\n# define GTEST_STDLIB_CXX11 1\n#endif\n\n// Only use C++11 library features if the library provides them.\n#if GTEST_STDLIB_CXX11\n# define GTEST_HAS_STD_BEGIN_AND_END_ 1\n# define GTEST_HAS_STD_FORWARD_LIST_ 1\n# if !defined(_MSC_VER) || (_MSC_FULL_VER >= 190023824)\n// works only with VS2015U2 and better\n#   define GTEST_HAS_STD_FUNCTION_ 1\n# endif\n# define GTEST_HAS_STD_INITIALIZER_LIST_ 1\n# define GTEST_HAS_STD_MOVE_ 1\n# define GTEST_HAS_STD_UNIQUE_PTR_ 1\n# define GTEST_HAS_STD_SHARED_PTR_ 1\n# define GTEST_HAS_UNORDERED_MAP_ 1\n# define GTEST_HAS_UNORDERED_SET_ 1\n#endif\n\n// C++11 specifies that <tuple> provides std::tuple.\n// Some platforms still might not have it, however.\n#if GTEST_LANG_CXX11\n# define GTEST_HAS_STD_TUPLE_ 1\n# if defined(__clang__)\n// Inspired by\n// https://clang.llvm.org/docs/LanguageExtensions.html#include-file-checking-macros\n#  if defined(__has_include) && !__has_include(<tuple>)\n#   undef GTEST_HAS_STD_TUPLE_\n#  endif\n# elif defined(_MSC_VER)\n// Inspired by boost/config/stdlib/dinkumware.hpp\n#  if defined(_CPPLIB_VER) && _CPPLIB_VER < 520\n#   undef GTEST_HAS_STD_TUPLE_\n#  endif\n# elif defined(__GLIBCXX__)\n// Inspired by boost/config/stdlib/libstdcpp3.hpp,\n// http://gcc.gnu.org/gcc-4.2/changes.html and\n// https://web.archive.org/web/20140227044429/gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x\n#  if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)\n#   undef GTEST_HAS_STD_TUPLE_\n#  endif\n# endif\n#endif\n\n// Brings in definitions for functions used in the testing::internal::posix\n// namespace (read, write, close, chdir, isatty, stat). We do not currently\n// use them on Windows Mobile.\n#if GTEST_OS_WINDOWS\n# if !GTEST_OS_WINDOWS_MOBILE\n#  include <direct.h>\n#  include <io.h>\n# endif\n// In order to avoid having to include <windows.h>, use forward declaration\n#if GTEST_OS_WINDOWS_MINGW && !defined(__MINGW64_VERSION_MAJOR)\n// MinGW defined _CRITICAL_SECTION and _RTL_CRITICAL_SECTION as two\n// separate (equivalent) structs, instead of using typedef\ntypedef struct _CRITICAL_SECTION GTEST_CRITICAL_SECTION;\n#else\n// Assume CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.\n// This assumption is verified by\n// WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.\ntypedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;\n#endif\n#else\n// This assumes that non-Windows OSes provide unistd.h. For OSes where this\n// is not the case, we need to include headers that provide the functions\n// mentioned above.\n# include <unistd.h>\n# include <strings.h>\n#endif  // GTEST_OS_WINDOWS\n\n#if GTEST_OS_LINUX_ANDROID\n// Used to define __ANDROID_API__ matching the target NDK API level.\n#  include <android/api-level.h>  // NOLINT\n#endif\n\n// Defines this to true iff Google Test can use POSIX regular expressions.\n#ifndef GTEST_HAS_POSIX_RE\n# if GTEST_OS_LINUX_ANDROID\n// On Android, <regex.h> is only available starting with Gingerbread.\n#  define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)\n# else\n#  define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS)\n# endif\n#endif\n\n#if GTEST_USES_PCRE\n// The appropriate headers have already been included.\n\n#elif GTEST_HAS_POSIX_RE\n\n// On some platforms, <regex.h> needs someone to define size_t, and\n// won't compile otherwise.  We can #include it here as we already\n// included <stdlib.h>, which is guaranteed to define size_t through\n// <stddef.h>.\n# include <regex.h>  // NOLINT\n\n# define GTEST_USES_POSIX_RE 1\n\n#elif GTEST_OS_WINDOWS\n\n// <regex.h> is not available on Windows.  Use our own simple regex\n// implementation instead.\n# define GTEST_USES_SIMPLE_RE 1\n\n#else\n\n// <regex.h> may not be available on this platform.  Use our own\n// simple regex implementation instead.\n# define GTEST_USES_SIMPLE_RE 1\n\n#endif  // GTEST_USES_PCRE\n\n#ifndef GTEST_HAS_EXCEPTIONS\n// The user didn't tell us whether exceptions are enabled, so we need\n// to figure it out.\n# if defined(_MSC_VER) && defined(_CPPUNWIND)\n// MSVC defines _CPPUNWIND to 1 iff exceptions are enabled.\n#  define GTEST_HAS_EXCEPTIONS 1\n# elif defined(__BORLANDC__)\n// C++Builder's implementation of the STL uses the _HAS_EXCEPTIONS\n// macro to enable exceptions, so we'll do the same.\n// Assumes that exceptions are enabled by default.\n#  ifndef _HAS_EXCEPTIONS\n#   define _HAS_EXCEPTIONS 1\n#  endif  // _HAS_EXCEPTIONS\n#  define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS\n# elif defined(__clang__)\n// clang defines __EXCEPTIONS iff exceptions are enabled before clang 220714,\n// but iff cleanups are enabled after that. In Obj-C++ files, there can be\n// cleanups for ObjC exceptions which also need cleanups, even if C++ exceptions\n// are disabled. clang has __has_feature(cxx_exceptions) which checks for C++\n// exceptions starting at clang r206352, but which checked for cleanups prior to\n// that. To reliably check for C++ exception availability with clang, check for\n// __EXCEPTIONS && __has_feature(cxx_exceptions).\n#  define GTEST_HAS_EXCEPTIONS (__EXCEPTIONS && __has_feature(cxx_exceptions))\n# elif defined(__GNUC__) && __EXCEPTIONS\n// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.\n#  define GTEST_HAS_EXCEPTIONS 1\n# elif defined(__SUNPRO_CC)\n// Sun Pro CC supports exceptions.  However, there is no compile-time way of\n// detecting whether they are enabled or not.  Therefore, we assume that\n// they are enabled unless the user tells us otherwise.\n#  define GTEST_HAS_EXCEPTIONS 1\n# elif defined(__IBMCPP__) && __EXCEPTIONS\n// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled.\n#  define GTEST_HAS_EXCEPTIONS 1\n# elif defined(__HP_aCC)\n// Exception handling is in effect by default in HP aCC compiler. It has to\n// be turned of by +noeh compiler option if desired.\n#  define GTEST_HAS_EXCEPTIONS 1\n# else\n// For other compilers, we assume exceptions are disabled to be\n// conservative.\n#  define GTEST_HAS_EXCEPTIONS 0\n# endif  // defined(_MSC_VER) || defined(__BORLANDC__)\n#endif  // GTEST_HAS_EXCEPTIONS\n\n#if !defined(GTEST_HAS_STD_STRING)\n// Even though we don't use this macro any longer, we keep it in case\n// some clients still depend on it.\n# define GTEST_HAS_STD_STRING 1\n#elif !GTEST_HAS_STD_STRING\n// The user told us that ::std::string isn't available.\n# error \"::std::string isn't available.\"\n#endif  // !defined(GTEST_HAS_STD_STRING)\n\n#ifndef GTEST_HAS_GLOBAL_STRING\n# define GTEST_HAS_GLOBAL_STRING 0\n#endif  // GTEST_HAS_GLOBAL_STRING\n\n#ifndef GTEST_HAS_STD_WSTRING\n// The user didn't tell us whether ::std::wstring is available, so we need\n// to figure it out.\n// FIXME: uses autoconf to detect whether ::std::wstring\n//   is available.\n\n// Cygwin 1.7 and below doesn't support ::std::wstring.\n// Solaris' libc++ doesn't support it either.  Android has\n// no support for it at least as recent as Froyo (2.2).\n# define GTEST_HAS_STD_WSTRING \\\n    (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS))\n\n#endif  // GTEST_HAS_STD_WSTRING\n\n#ifndef GTEST_HAS_GLOBAL_WSTRING\n// The user didn't tell us whether ::wstring is available, so we need\n// to figure it out.\n# define GTEST_HAS_GLOBAL_WSTRING \\\n    (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING)\n#endif  // GTEST_HAS_GLOBAL_WSTRING\n\n// Determines whether RTTI is available.\n#ifndef GTEST_HAS_RTTI\n// The user didn't tell us whether RTTI is enabled, so we need to\n// figure it out.\n\n# ifdef _MSC_VER\n\n#  ifdef _CPPRTTI  // MSVC defines this macro iff RTTI is enabled.\n#   define GTEST_HAS_RTTI 1\n#  else\n#   define GTEST_HAS_RTTI 0\n#  endif\n\n// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled.\n# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302)\n\n#  ifdef __GXX_RTTI\n// When building against STLport with the Android NDK and with\n// -frtti -fno-exceptions, the build fails at link time with undefined\n// references to __cxa_bad_typeid. Note sure if STL or toolchain bug,\n// so disable RTTI when detected.\n#   if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \\\n       !defined(__EXCEPTIONS)\n#    define GTEST_HAS_RTTI 0\n#   else\n#    define GTEST_HAS_RTTI 1\n#   endif  // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS\n#  else\n#   define GTEST_HAS_RTTI 0\n#  endif  // __GXX_RTTI\n\n// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends\n// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the\n// first version with C++ support.\n# elif defined(__clang__)\n\n#  define GTEST_HAS_RTTI __has_feature(cxx_rtti)\n\n// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if\n// both the typeid and dynamic_cast features are present.\n# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)\n\n#  ifdef __RTTI_ALL__\n#   define GTEST_HAS_RTTI 1\n#  else\n#   define GTEST_HAS_RTTI 0\n#  endif\n\n# else\n\n// For all other compilers, we assume RTTI is enabled.\n#  define GTEST_HAS_RTTI 1\n\n# endif  // _MSC_VER\n\n#endif  // GTEST_HAS_RTTI\n\n// It's this header's responsibility to #include <typeinfo> when RTTI\n// is enabled.\n#if GTEST_HAS_RTTI\n# include <typeinfo>\n#endif\n\n// Determines whether Google Test can use the pthreads library.\n#ifndef GTEST_HAS_PTHREAD\n// The user didn't tell us explicitly, so we make reasonable assumptions about\n// which platforms have pthreads support.\n//\n// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0\n// to your compiler flags.\n#define GTEST_HAS_PTHREAD                                             \\\n  (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX || GTEST_OS_QNX || \\\n   GTEST_OS_FREEBSD || GTEST_OS_NACL || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA)\n#endif  // GTEST_HAS_PTHREAD\n\n#if GTEST_HAS_PTHREAD\n// gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is\n// true.\n# include <pthread.h>  // NOLINT\n\n// For timespec and nanosleep, used below.\n# include <time.h>  // NOLINT\n#endif\n\n// Determines if hash_map/hash_set are available.\n// Only used for testing against those containers.\n#if !defined(GTEST_HAS_HASH_MAP_)\n# if defined(_MSC_VER) && (_MSC_VER < 1900)\n#  define GTEST_HAS_HASH_MAP_ 1  // Indicates that hash_map is available.\n#  define GTEST_HAS_HASH_SET_ 1  // Indicates that hash_set is available.\n# endif  // _MSC_VER\n#endif  // !defined(GTEST_HAS_HASH_MAP_)\n\n// Determines whether Google Test can use tr1/tuple.  You can define\n// this macro to 0 to prevent Google Test from using tuple (any\n// feature depending on tuple with be disabled in this mode).\n#ifndef GTEST_HAS_TR1_TUPLE\n# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR)\n// STLport, provided with the Android NDK, has neither <tr1/tuple> or <tuple>.\n#  define GTEST_HAS_TR1_TUPLE 0\n# elif defined(_MSC_VER) && (_MSC_VER >= 1910)\n// Prevent `warning C4996: 'std::tr1': warning STL4002:\n// The non-Standard std::tr1 namespace and TR1-only machinery\n// are deprecated and will be REMOVED.`\n#  define GTEST_HAS_TR1_TUPLE 0\n# elif GTEST_LANG_CXX11 && defined(_LIBCPP_VERSION)\n// libc++ doesn't support TR1.\n#  define GTEST_HAS_TR1_TUPLE 0\n# else\n// The user didn't tell us not to do it, so we assume it's OK.\n#  define GTEST_HAS_TR1_TUPLE 1\n# endif\n#endif  // GTEST_HAS_TR1_TUPLE\n\n// Determines whether Google Test's own tr1 tuple implementation\n// should be used.\n#ifndef GTEST_USE_OWN_TR1_TUPLE\n// We use our own tuple implementation on Symbian.\n# if GTEST_OS_SYMBIAN\n#  define GTEST_USE_OWN_TR1_TUPLE 1\n# else\n// The user didn't tell us, so we need to figure it out.\n\n// We use our own TR1 tuple if we aren't sure the user has an\n// implementation of it already.  At this time, libstdc++ 4.0.0+ and\n// MSVC 2010 are the only mainstream standard libraries that come\n// with a TR1 tuple implementation.  NVIDIA's CUDA NVCC compiler\n// pretends to be GCC by defining __GNUC__ and friends, but cannot\n// compile GCC's tuple implementation.  MSVC 2008 (9.0) provides TR1\n// tuple in a 323 MB Feature Pack download, which we cannot assume the\n// user has.  QNX's QCC compiler is a modified GCC but it doesn't\n// support TR1 tuple.  libc++ only provides std::tuple, in C++11 mode,\n// and it can be used with some compilers that define __GNUC__.\n# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \\\n      && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) \\\n      || (_MSC_VER >= 1600 && _MSC_VER < 1900)\n#  define GTEST_ENV_HAS_TR1_TUPLE_ 1\n# endif\n\n// C++11 specifies that <tuple> provides std::tuple. Use that if gtest is used\n// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6\n// can build with clang but need to use gcc4.2's libstdc++).\n# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325)\n#  define GTEST_ENV_HAS_STD_TUPLE_ 1\n# endif\n\n# if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_\n#  define GTEST_USE_OWN_TR1_TUPLE 0\n# else\n#  define GTEST_USE_OWN_TR1_TUPLE 1\n# endif\n# endif  // GTEST_OS_SYMBIAN\n#endif  // GTEST_USE_OWN_TR1_TUPLE\n\n// To avoid conditional compilation we make it gtest-port.h's responsibility\n// to #include the header implementing tuple.\n#if GTEST_HAS_STD_TUPLE_\n# include <tuple>  // IWYU pragma: export\n# define GTEST_TUPLE_NAMESPACE_ ::std\n#endif  // GTEST_HAS_STD_TUPLE_\n\n// We include tr1::tuple even if std::tuple is available to define printers for\n// them.\n#if GTEST_HAS_TR1_TUPLE\n# ifndef GTEST_TUPLE_NAMESPACE_\n#  define GTEST_TUPLE_NAMESPACE_ ::std::tr1\n# endif  // GTEST_TUPLE_NAMESPACE_\n\n# if GTEST_USE_OWN_TR1_TUPLE\n// This file was GENERATED by command:\n//     pump.py gtest-tuple.h.pump\n// DO NOT EDIT BY HAND!!!\n\n// Copyright 2009 Google Inc.\n// All Rights Reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n// Implements a subset of TR1 tuple needed by Google Test and Google Mock.\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_\n\n#include <utility>  // For ::std::pair.\n\n// The compiler used in Symbian has a bug that prevents us from declaring the\n// tuple template as a friend (it complains that tuple is redefined).  This\n// bypasses the bug by declaring the members that should otherwise be\n// private as public.\n// Sun Studio versions < 12 also have the above bug.\n#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590)\n# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public:\n#else\n# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \\\n    template <GTEST_10_TYPENAMES_(U)> friend class tuple; \\\n   private:\n#endif\n\n// Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict\n// with our own definitions. Therefore using our own tuple does not work on\n// those compilers.\n#if defined(_MSC_VER) && _MSC_VER >= 1600  /* 1600 is Visual Studio 2010 */\n# error \"gtest's tuple doesn't compile on Visual Studio 2010 or later. \\\nGTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers.\"\n#endif\n\n// GTEST_n_TUPLE_(T) is the type of an n-tuple.\n#define GTEST_0_TUPLE_(T) tuple<>\n#define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \\\n    void, void, void>\n#define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \\\n    void, void, void>\n#define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \\\n    void, void, void>\n#define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \\\n    void, void, void>\n#define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \\\n    void, void, void>\n#define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \\\n    void, void, void>\n#define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \\\n    void, void, void>\n#define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \\\n    T##7, void, void>\n#define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \\\n    T##7, T##8, void>\n#define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \\\n    T##7, T##8, T##9>\n\n// GTEST_n_TYPENAMES_(T) declares a list of n typenames.\n#define GTEST_0_TYPENAMES_(T)\n#define GTEST_1_TYPENAMES_(T) typename T##0\n#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1\n#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2\n#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3\n#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3, typename T##4\n#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3, typename T##4, typename T##5\n#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3, typename T##4, typename T##5, typename T##6\n#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3, typename T##4, typename T##5, typename T##6, typename T##7\n#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3, typename T##4, typename T##5, typename T##6, \\\n    typename T##7, typename T##8\n#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \\\n    typename T##3, typename T##4, typename T##5, typename T##6, \\\n    typename T##7, typename T##8, typename T##9\n\n// In theory, defining stuff in the ::std namespace is undefined\n// behavior.  We can do this as we are playing the role of a standard\n// library vendor.\nnamespace std {\nnamespace tr1 {\n\ntemplate <typename T0 = void, typename T1 = void, typename T2 = void,\n    typename T3 = void, typename T4 = void, typename T5 = void,\n    typename T6 = void, typename T7 = void, typename T8 = void,\n    typename T9 = void>\nclass tuple;\n\n// Anything in namespace gtest_internal is Google Test's INTERNAL\n// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code.\nnamespace gtest_internal {\n\n// ByRef<T>::type is T if T is a reference; otherwise it's const T&.\ntemplate <typename T>\nstruct ByRef { typedef const T& type; };  // NOLINT\ntemplate <typename T>\nstruct ByRef<T&> { typedef T& type; };  // NOLINT\n\n// A handy wrapper for ByRef.\n#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type\n\n// AddRef<T>::type is T if T is a reference; otherwise it's T&.  This\n// is the same as tr1::add_reference<T>::type.\ntemplate <typename T>\nstruct AddRef { typedef T& type; };  // NOLINT\ntemplate <typename T>\nstruct AddRef<T&> { typedef T& type; };  // NOLINT\n\n// A handy wrapper for AddRef.\n#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type\n\n// A helper for implementing get<k>().\ntemplate <int k> class Get;\n\n// A helper for implementing tuple_element<k, T>.  kIndexValid is true\n// iff k < the number of fields in tuple type T.\ntemplate <bool kIndexValid, int kIndex, class Tuple>\nstruct TupleElement;\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {\n  typedef T0 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {\n  typedef T1 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {\n  typedef T2 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {\n  typedef T3 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {\n  typedef T4 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {\n  typedef T5 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {\n  typedef T6 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {\n  typedef T7 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {\n  typedef T8 type;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {\n  typedef T9 type;\n};\n\n}  // namespace gtest_internal\n\ntemplate <>\nclass tuple<> {\n public:\n  tuple() {}\n  tuple(const tuple& /* t */)  {}\n  tuple& operator=(const tuple& /* t */) { return *this; }\n};\n\ntemplate <GTEST_1_TYPENAMES_(T)>\nclass GTEST_1_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {}\n\n  tuple(const tuple& t) : f0_(t.f0_) {}\n\n  template <GTEST_1_TYPENAMES_(U)>\n  tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_1_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_1_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_1_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    return *this;\n  }\n\n  T0 f0_;\n};\n\ntemplate <GTEST_2_TYPENAMES_(T)>\nclass GTEST_2_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0),\n      f1_(f1) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}\n\n  template <GTEST_2_TYPENAMES_(U)>\n  tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}\n  template <typename U0, typename U1>\n  tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_2_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_2_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n  template <typename U0, typename U1>\n  tuple& operator=(const ::std::pair<U0, U1>& p) {\n    f0_ = p.first;\n    f1_ = p.second;\n    return *this;\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_2_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n};\n\ntemplate <GTEST_3_TYPENAMES_(T)>\nclass GTEST_3_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}\n\n  template <GTEST_3_TYPENAMES_(U)>\n  tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_3_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_3_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_3_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n};\n\ntemplate <GTEST_4_TYPENAMES_(T)>\nclass GTEST_4_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2),\n      f3_(f3) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}\n\n  template <GTEST_4_TYPENAMES_(U)>\n  tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_4_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_4_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_4_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n};\n\ntemplate <GTEST_5_TYPENAMES_(T)>\nclass GTEST_5_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3,\n      GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),\n      f4_(t.f4_) {}\n\n  template <GTEST_5_TYPENAMES_(U)>\n  tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_), f4_(t.f4_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_5_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_5_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_5_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    f4_ = t.f4_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n  T4 f4_;\n};\n\ntemplate <GTEST_6_TYPENAMES_(T)>\nclass GTEST_6_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,\n      GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),\n      f5_(f5) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),\n      f4_(t.f4_), f5_(t.f5_) {}\n\n  template <GTEST_6_TYPENAMES_(U)>\n  tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_6_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_6_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_6_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    f4_ = t.f4_;\n    f5_ = t.f5_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n  T4 f4_;\n  T5 f5_;\n};\n\ntemplate <GTEST_7_TYPENAMES_(T)>\nclass GTEST_7_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,\n      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2),\n      f3_(f3), f4_(f4), f5_(f5), f6_(f6) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),\n      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}\n\n  template <GTEST_7_TYPENAMES_(U)>\n  tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_7_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_7_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_7_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    f4_ = t.f4_;\n    f5_ = t.f5_;\n    f6_ = t.f6_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n  T4 f4_;\n  T5 f5_;\n  T6 f6_;\n};\n\ntemplate <GTEST_8_TYPENAMES_(T)>\nclass GTEST_8_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,\n      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6,\n      GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),\n      f5_(f5), f6_(f6), f7_(f7) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),\n      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}\n\n  template <GTEST_8_TYPENAMES_(U)>\n  tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_8_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_8_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_8_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    f4_ = t.f4_;\n    f5_ = t.f5_;\n    f6_ = t.f6_;\n    f7_ = t.f7_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n  T4 f4_;\n  T5 f5_;\n  T6 f6_;\n  T7 f7_;\n};\n\ntemplate <GTEST_9_TYPENAMES_(T)>\nclass GTEST_9_TUPLE_(T) {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,\n      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,\n      GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4),\n      f5_(f5), f6_(f6), f7_(f7), f8_(f8) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),\n      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}\n\n  template <GTEST_9_TYPENAMES_(U)>\n  tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_9_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_9_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_9_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    f4_ = t.f4_;\n    f5_ = t.f5_;\n    f6_ = t.f6_;\n    f7_ = t.f7_;\n    f8_ = t.f8_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n  T4 f4_;\n  T5 f5_;\n  T6 f6_;\n  T7 f7_;\n  T8 f8_;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nclass tuple {\n public:\n  template <int k> friend class gtest_internal::Get;\n\n  tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(),\n      f9_() {}\n\n  explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1,\n      GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4,\n      GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7,\n      GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2),\n      f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {}\n\n  tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),\n      f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}\n\n  template <GTEST_10_TYPENAMES_(U)>\n  tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),\n      f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),\n      f9_(t.f9_) {}\n\n  tuple& operator=(const tuple& t) { return CopyFrom(t); }\n\n  template <GTEST_10_TYPENAMES_(U)>\n  tuple& operator=(const GTEST_10_TUPLE_(U)& t) {\n    return CopyFrom(t);\n  }\n\n  GTEST_DECLARE_TUPLE_AS_FRIEND_\n\n  template <GTEST_10_TYPENAMES_(U)>\n  tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {\n    f0_ = t.f0_;\n    f1_ = t.f1_;\n    f2_ = t.f2_;\n    f3_ = t.f3_;\n    f4_ = t.f4_;\n    f5_ = t.f5_;\n    f6_ = t.f6_;\n    f7_ = t.f7_;\n    f8_ = t.f8_;\n    f9_ = t.f9_;\n    return *this;\n  }\n\n  T0 f0_;\n  T1 f1_;\n  T2 f2_;\n  T3 f3_;\n  T4 f4_;\n  T5 f5_;\n  T6 f6_;\n  T7 f7_;\n  T8 f8_;\n  T9 f9_;\n};\n\n// 6.1.3.2 Tuple creation functions.\n\n// Known limitations: we don't support passing an\n// std::tr1::reference_wrapper<T> to make_tuple().  And we don't\n// implement tie().\n\ninline tuple<> make_tuple() { return tuple<>(); }\n\ntemplate <GTEST_1_TYPENAMES_(T)>\ninline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {\n  return GTEST_1_TUPLE_(T)(f0);\n}\n\ntemplate <GTEST_2_TYPENAMES_(T)>\ninline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {\n  return GTEST_2_TUPLE_(T)(f0, f1);\n}\n\ntemplate <GTEST_3_TYPENAMES_(T)>\ninline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {\n  return GTEST_3_TUPLE_(T)(f0, f1, f2);\n}\n\ntemplate <GTEST_4_TYPENAMES_(T)>\ninline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3) {\n  return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);\n}\n\ntemplate <GTEST_5_TYPENAMES_(T)>\ninline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3, const T4& f4) {\n  return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);\n}\n\ntemplate <GTEST_6_TYPENAMES_(T)>\ninline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3, const T4& f4, const T5& f5) {\n  return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);\n}\n\ntemplate <GTEST_7_TYPENAMES_(T)>\ninline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3, const T4& f4, const T5& f5, const T6& f6) {\n  return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);\n}\n\ntemplate <GTEST_8_TYPENAMES_(T)>\ninline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) {\n  return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);\n}\n\ntemplate <GTEST_9_TYPENAMES_(T)>\ninline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,\n    const T8& f8) {\n  return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);\n}\n\ntemplate <GTEST_10_TYPENAMES_(T)>\ninline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,\n    const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7,\n    const T8& f8, const T9& f9) {\n  return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);\n}\n\n// 6.1.3.3 Tuple helper classes.\n\ntemplate <typename Tuple> struct tuple_size;\n\ntemplate <GTEST_0_TYPENAMES_(T)>\nstruct tuple_size<GTEST_0_TUPLE_(T) > {\n  static const int value = 0;\n};\n\ntemplate <GTEST_1_TYPENAMES_(T)>\nstruct tuple_size<GTEST_1_TUPLE_(T) > {\n  static const int value = 1;\n};\n\ntemplate <GTEST_2_TYPENAMES_(T)>\nstruct tuple_size<GTEST_2_TUPLE_(T) > {\n  static const int value = 2;\n};\n\ntemplate <GTEST_3_TYPENAMES_(T)>\nstruct tuple_size<GTEST_3_TUPLE_(T) > {\n  static const int value = 3;\n};\n\ntemplate <GTEST_4_TYPENAMES_(T)>\nstruct tuple_size<GTEST_4_TUPLE_(T) > {\n  static const int value = 4;\n};\n\ntemplate <GTEST_5_TYPENAMES_(T)>\nstruct tuple_size<GTEST_5_TUPLE_(T) > {\n  static const int value = 5;\n};\n\ntemplate <GTEST_6_TYPENAMES_(T)>\nstruct tuple_size<GTEST_6_TUPLE_(T) > {\n  static const int value = 6;\n};\n\ntemplate <GTEST_7_TYPENAMES_(T)>\nstruct tuple_size<GTEST_7_TUPLE_(T) > {\n  static const int value = 7;\n};\n\ntemplate <GTEST_8_TYPENAMES_(T)>\nstruct tuple_size<GTEST_8_TUPLE_(T) > {\n  static const int value = 8;\n};\n\ntemplate <GTEST_9_TYPENAMES_(T)>\nstruct tuple_size<GTEST_9_TUPLE_(T) > {\n  static const int value = 9;\n};\n\ntemplate <GTEST_10_TYPENAMES_(T)>\nstruct tuple_size<GTEST_10_TUPLE_(T) > {\n  static const int value = 10;\n};\n\ntemplate <int k, class Tuple>\nstruct tuple_element {\n  typedef typename gtest_internal::TupleElement<\n      k < (tuple_size<Tuple>::value), k, Tuple>::type type;\n};\n\n#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type\n\n// 6.1.3.4 Element access.\n\nnamespace gtest_internal {\n\ntemplate <>\nclass Get<0> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))\n  Field(Tuple& t) { return t.f0_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple))\n  ConstField(const Tuple& t) { return t.f0_; }\n};\n\ntemplate <>\nclass Get<1> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))\n  Field(Tuple& t) { return t.f1_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple))\n  ConstField(const Tuple& t) { return t.f1_; }\n};\n\ntemplate <>\nclass Get<2> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))\n  Field(Tuple& t) { return t.f2_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple))\n  ConstField(const Tuple& t) { return t.f2_; }\n};\n\ntemplate <>\nclass Get<3> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))\n  Field(Tuple& t) { return t.f3_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple))\n  ConstField(const Tuple& t) { return t.f3_; }\n};\n\ntemplate <>\nclass Get<4> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))\n  Field(Tuple& t) { return t.f4_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple))\n  ConstField(const Tuple& t) { return t.f4_; }\n};\n\ntemplate <>\nclass Get<5> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))\n  Field(Tuple& t) { return t.f5_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple))\n  ConstField(const Tuple& t) { return t.f5_; }\n};\n\ntemplate <>\nclass Get<6> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))\n  Field(Tuple& t) { return t.f6_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple))\n  ConstField(const Tuple& t) { return t.f6_; }\n};\n\ntemplate <>\nclass Get<7> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))\n  Field(Tuple& t) { return t.f7_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple))\n  ConstField(const Tuple& t) { return t.f7_; }\n};\n\ntemplate <>\nclass Get<8> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))\n  Field(Tuple& t) { return t.f8_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple))\n  ConstField(const Tuple& t) { return t.f8_; }\n};\n\ntemplate <>\nclass Get<9> {\n public:\n  template <class Tuple>\n  static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))\n  Field(Tuple& t) { return t.f9_; }  // NOLINT\n\n  template <class Tuple>\n  static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple))\n  ConstField(const Tuple& t) { return t.f9_; }\n};\n\n}  // namespace gtest_internal\n\ntemplate <int k, GTEST_10_TYPENAMES_(T)>\nGTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))\nget(GTEST_10_TUPLE_(T)& t) {\n  return gtest_internal::Get<k>::Field(t);\n}\n\ntemplate <int k, GTEST_10_TYPENAMES_(T)>\nGTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k,  GTEST_10_TUPLE_(T)))\nget(const GTEST_10_TUPLE_(T)& t) {\n  return gtest_internal::Get<k>::ConstField(t);\n}\n\n// 6.1.3.5 Relational operators\n\n// We only implement == and !=, as we don't have a need for the rest yet.\n\nnamespace gtest_internal {\n\n// SameSizeTuplePrefixComparator<k, k>::Eq(t1, t2) returns true if the\n// first k fields of t1 equals the first k fields of t2.\n// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if\n// k1 != k2.\ntemplate <int kSize1, int kSize2>\nstruct SameSizeTuplePrefixComparator;\n\ntemplate <>\nstruct SameSizeTuplePrefixComparator<0, 0> {\n  template <class Tuple1, class Tuple2>\n  static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) {\n    return true;\n  }\n};\n\ntemplate <int k>\nstruct SameSizeTuplePrefixComparator<k, k> {\n  template <class Tuple1, class Tuple2>\n  static bool Eq(const Tuple1& t1, const Tuple2& t2) {\n    return SameSizeTuplePrefixComparator<k - 1, k - 1>::Eq(t1, t2) &&\n        ::std::tr1::get<k - 1>(t1) == ::std::tr1::get<k - 1>(t2);\n  }\n};\n\n}  // namespace gtest_internal\n\ntemplate <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>\ninline bool operator==(const GTEST_10_TUPLE_(T)& t,\n                       const GTEST_10_TUPLE_(U)& u) {\n  return gtest_internal::SameSizeTuplePrefixComparator<\n      tuple_size<GTEST_10_TUPLE_(T) >::value,\n      tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);\n}\n\ntemplate <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>\ninline bool operator!=(const GTEST_10_TUPLE_(T)& t,\n                       const GTEST_10_TUPLE_(U)& u) { return !(t == u); }\n\n// 6.1.4 Pairs.\n// Unimplemented.\n\n}  // namespace tr1\n}  // namespace std\n\n#undef GTEST_0_TUPLE_\n#undef GTEST_1_TUPLE_\n#undef GTEST_2_TUPLE_\n#undef GTEST_3_TUPLE_\n#undef GTEST_4_TUPLE_\n#undef GTEST_5_TUPLE_\n#undef GTEST_6_TUPLE_\n#undef GTEST_7_TUPLE_\n#undef GTEST_8_TUPLE_\n#undef GTEST_9_TUPLE_\n#undef GTEST_10_TUPLE_\n\n#undef GTEST_0_TYPENAMES_\n#undef GTEST_1_TYPENAMES_\n#undef GTEST_2_TYPENAMES_\n#undef GTEST_3_TYPENAMES_\n#undef GTEST_4_TYPENAMES_\n#undef GTEST_5_TYPENAMES_\n#undef GTEST_6_TYPENAMES_\n#undef GTEST_7_TYPENAMES_\n#undef GTEST_8_TYPENAMES_\n#undef GTEST_9_TYPENAMES_\n#undef GTEST_10_TYPENAMES_\n\n#undef GTEST_DECLARE_TUPLE_AS_FRIEND_\n#undef GTEST_BY_REF_\n#undef GTEST_ADD_REF_\n#undef GTEST_TUPLE_ELEMENT_\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_\n# elif GTEST_OS_SYMBIAN\n\n// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to\n// use STLport's tuple implementation, which unfortunately doesn't\n// work as the copy of STLport distributed with Symbian is incomplete.\n// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to\n// use its own tuple implementation.\n#  ifdef BOOST_HAS_TR1_TUPLE\n#   undef BOOST_HAS_TR1_TUPLE\n#  endif  // BOOST_HAS_TR1_TUPLE\n\n// This prevents <boost/tr1/detail/config.hpp>, which defines\n// BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.\n#  define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED\n#  include <tuple>  // IWYU pragma: export  // NOLINT\n\n# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)\n// GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does\n// not conform to the TR1 spec, which requires the header to be <tuple>.\n\n#  if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302\n// Until version 4.3.2, gcc has a bug that causes <tr1/functional>,\n// which is #included by <tr1/tuple>, to not compile when RTTI is\n// disabled.  _TR1_FUNCTIONAL is the header guard for\n// <tr1/functional>.  Hence the following #define is used to prevent\n// <tr1/functional> from being included.\n#   define _TR1_FUNCTIONAL 1\n#   include <tr1/tuple>\n#   undef _TR1_FUNCTIONAL  // Allows the user to #include\n                        // <tr1/functional> if they choose to.\n#  else\n#   include <tr1/tuple>  // NOLINT\n#  endif  // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302\n\n// VS 2010 now has tr1 support.\n# elif _MSC_VER >= 1600\n#  include <tuple>  // IWYU pragma: export  // NOLINT\n\n# else  // GTEST_USE_OWN_TR1_TUPLE\n#  include <tr1/tuple>  // IWYU pragma: export  // NOLINT\n# endif  // GTEST_USE_OWN_TR1_TUPLE\n\n#endif  // GTEST_HAS_TR1_TUPLE\n\n// Determines whether clone(2) is supported.\n// Usually it will only be available on Linux, excluding\n// Linux on the Itanium architecture.\n// Also see http://linux.die.net/man/2/clone.\n#ifndef GTEST_HAS_CLONE\n// The user didn't tell us, so we need to figure it out.\n\n# if GTEST_OS_LINUX && !defined(__ia64__)\n#  if GTEST_OS_LINUX_ANDROID\n// On Android, clone() became available at different API levels for each 32-bit\n// architecture.\n#    if defined(__LP64__) || \\\n        (defined(__arm__) && __ANDROID_API__ >= 9) || \\\n        (defined(__mips__) && __ANDROID_API__ >= 12) || \\\n        (defined(__i386__) && __ANDROID_API__ >= 17)\n#     define GTEST_HAS_CLONE 1\n#    else\n#     define GTEST_HAS_CLONE 0\n#    endif\n#  else\n#   define GTEST_HAS_CLONE 1\n#  endif\n# else\n#  define GTEST_HAS_CLONE 0\n# endif  // GTEST_OS_LINUX && !defined(__ia64__)\n\n#endif  // GTEST_HAS_CLONE\n\n// Determines whether to support stream redirection. This is used to test\n// output correctness and to implement death tests.\n#ifndef GTEST_HAS_STREAM_REDIRECTION\n// By default, we assume that stream redirection is supported on all\n// platforms except known mobile ones.\n# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \\\n    GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT\n#  define GTEST_HAS_STREAM_REDIRECTION 0\n# else\n#  define GTEST_HAS_STREAM_REDIRECTION 1\n# endif  // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN\n#endif  // GTEST_HAS_STREAM_REDIRECTION\n\n// Determines whether to support death tests.\n// Google Test does not support death tests for VC 7.1 and earlier as\n// abort() in a VC 7.1 application compiled as GUI in debug config\n// pops up a dialog window that cannot be suppressed programmatically.\n#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS ||   \\\n     (GTEST_OS_MAC && !GTEST_OS_IOS) ||                         \\\n     (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) ||          \\\n     GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \\\n     GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD || \\\n     GTEST_OS_NETBSD || GTEST_OS_FUCHSIA)\n# define GTEST_HAS_DEATH_TEST 1\n#endif\n\n// Determines whether to support type-driven tests.\n\n// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,\n// Sun Pro CC, IBM Visual Age, and HP aCC support.\n#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \\\n    defined(__IBMCPP__) || defined(__HP_aCC)\n# define GTEST_HAS_TYPED_TEST 1\n# define GTEST_HAS_TYPED_TEST_P 1\n#endif\n\n// Determines whether to support Combine(). This only makes sense when\n// value-parameterized tests are enabled.  The implementation doesn't\n// work on Sun Studio since it doesn't understand templated conversion\n// operators.\n#if (GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_) && !defined(__SUNPRO_CC)\n# define GTEST_HAS_COMBINE 1\n#endif\n\n// Determines whether the system compiler uses UTF-16 for encoding wide strings.\n#define GTEST_WIDE_STRING_USES_UTF16_ \\\n    (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)\n\n// Determines whether test results can be streamed to a socket.\n#if GTEST_OS_LINUX\n# define GTEST_CAN_STREAM_RESULTS_ 1\n#endif\n\n// Defines some utility macros.\n\n// The GNU compiler emits a warning if nested \"if\" statements are followed by\n// an \"else\" statement and braces are not used to explicitly disambiguate the\n// \"else\" binding.  This leads to problems with code like:\n//\n//   if (gate)\n//     ASSERT_*(condition) << \"Some message\";\n//\n// The \"switch (0) case 0:\" idiom is used to suppress this.\n#ifdef __INTEL_COMPILER\n# define GTEST_AMBIGUOUS_ELSE_BLOCKER_\n#else\n# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default:  // NOLINT\n#endif\n\n// Use this annotation at the end of a struct/class definition to\n// prevent the compiler from optimizing away instances that are never\n// used.  This is useful when all interesting logic happens inside the\n// c'tor and / or d'tor.  Example:\n//\n//   struct Foo {\n//     Foo() { ... }\n//   } GTEST_ATTRIBUTE_UNUSED_;\n//\n// Also use it after a variable or parameter declaration to tell the\n// compiler the variable/parameter does not have to be used.\n#if defined(__GNUC__) && !defined(COMPILER_ICC)\n# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))\n#elif defined(__clang__)\n# if __has_attribute(unused)\n#  define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))\n# endif\n#endif\n#ifndef GTEST_ATTRIBUTE_UNUSED_\n# define GTEST_ATTRIBUTE_UNUSED_\n#endif\n\n#if GTEST_LANG_CXX11\n# define GTEST_CXX11_EQUALS_DELETE_ = delete\n#else  // GTEST_LANG_CXX11\n# define GTEST_CXX11_EQUALS_DELETE_\n#endif  // GTEST_LANG_CXX11\n\n// Use this annotation before a function that takes a printf format string.\n#if (defined(__GNUC__) || defined(__clang__)) && !defined(COMPILER_ICC)\n# if defined(__MINGW_PRINTF_FORMAT)\n// MinGW has two different printf implementations. Ensure the format macro\n// matches the selected implementation. See\n// https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/.\n#  define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check) \\\n       __attribute__((__format__(__MINGW_PRINTF_FORMAT, string_index, \\\n                                 first_to_check)))\n# else\n#  define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check) \\\n       __attribute__((__format__(__printf__, string_index, first_to_check)))\n# endif\n#else\n# define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check)\n#endif\n\n\n// A macro to disallow operator=\n// This should be used in the private: declarations for a class.\n#define GTEST_DISALLOW_ASSIGN_(type) \\\n  void operator=(type const &) GTEST_CXX11_EQUALS_DELETE_\n\n// A macro to disallow copy constructor and operator=\n// This should be used in the private: declarations for a class.\n#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type) \\\n  type(type const &) GTEST_CXX11_EQUALS_DELETE_; \\\n  GTEST_DISALLOW_ASSIGN_(type)\n\n// Tell the compiler to warn about unused return values for functions declared\n// with this macro.  The macro should be used on function declarations\n// following the argument list:\n//\n//   Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;\n#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC)\n# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))\n#else\n# define GTEST_MUST_USE_RESULT_\n#endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC\n\n// MS C++ compiler emits warning when a conditional expression is compile time\n// constant. In some contexts this warning is false positive and needs to be\n// suppressed. Use the following two macros in such cases:\n//\n// GTEST_INTENTIONAL_CONST_COND_PUSH_()\n// while (true) {\n// GTEST_INTENTIONAL_CONST_COND_POP_()\n// }\n# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \\\n    GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)\n# define GTEST_INTENTIONAL_CONST_COND_POP_() \\\n    GTEST_DISABLE_MSC_WARNINGS_POP_()\n\n// Determine whether the compiler supports Microsoft's Structured Exception\n// Handling.  This is supported by several Windows compilers but generally\n// does not exist on any other system.\n#ifndef GTEST_HAS_SEH\n// The user didn't tell us, so we need to figure it out.\n\n# if defined(_MSC_VER) || defined(__BORLANDC__)\n// These two compilers are known to support SEH.\n#  define GTEST_HAS_SEH 1\n# else\n// Assume no SEH.\n#  define GTEST_HAS_SEH 0\n# endif\n\n#define GTEST_IS_THREADSAFE \\\n    (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ \\\n     || (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) \\\n     || GTEST_HAS_PTHREAD)\n\n#endif  // GTEST_HAS_SEH\n\n// GTEST_API_ qualifies all symbols that must be exported. The definitions below\n// are guarded by #ifndef to give embedders a chance to define GTEST_API_ in\n// gtest/internal/custom/gtest-port.h\n#ifndef GTEST_API_\n\n#ifdef _MSC_VER\n# if GTEST_LINKED_AS_SHARED_LIBRARY\n#  define GTEST_API_ __declspec(dllimport)\n# elif GTEST_CREATE_SHARED_LIBRARY\n#  define GTEST_API_ __declspec(dllexport)\n# endif\n#elif __GNUC__ >= 4 || defined(__clang__)\n# define GTEST_API_ __attribute__((visibility (\"default\")))\n#endif  // _MSC_VER\n\n#endif  // GTEST_API_\n\n#ifndef GTEST_API_\n# define GTEST_API_\n#endif  // GTEST_API_\n\n#ifndef GTEST_DEFAULT_DEATH_TEST_STYLE\n# define GTEST_DEFAULT_DEATH_TEST_STYLE  \"fast\"\n#endif  // GTEST_DEFAULT_DEATH_TEST_STYLE\n\n#ifdef __GNUC__\n// Ask the compiler to never inline a given function.\n# define GTEST_NO_INLINE_ __attribute__((noinline))\n#else\n# define GTEST_NO_INLINE_\n#endif\n\n// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.\n#if !defined(GTEST_HAS_CXXABI_H_)\n# if defined(__GLIBCXX__) || (defined(_LIBCPP_VERSION) && !defined(_MSC_VER))\n#  define GTEST_HAS_CXXABI_H_ 1\n# else\n#  define GTEST_HAS_CXXABI_H_ 0\n# endif\n#endif\n\n// A function level attribute to disable checking for use of uninitialized\n// memory when built with MemorySanitizer.\n#if defined(__clang__)\n# if __has_feature(memory_sanitizer)\n#  define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ \\\n       __attribute__((no_sanitize_memory))\n# else\n#  define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_\n# endif  // __has_feature(memory_sanitizer)\n#else\n# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_\n#endif  // __clang__\n\n// A function level attribute to disable AddressSanitizer instrumentation.\n#if defined(__clang__)\n# if __has_feature(address_sanitizer)\n#  define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ \\\n       __attribute__((no_sanitize_address))\n# else\n#  define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_\n# endif  // __has_feature(address_sanitizer)\n#else\n# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_\n#endif  // __clang__\n\n// A function level attribute to disable ThreadSanitizer instrumentation.\n#if defined(__clang__)\n# if __has_feature(thread_sanitizer)\n#  define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \\\n       __attribute__((no_sanitize_thread))\n# else\n#  define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_\n# endif  // __has_feature(thread_sanitizer)\n#else\n# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_\n#endif  // __clang__\n\nnamespace testing {\n\nclass Message;\n\n#if defined(GTEST_TUPLE_NAMESPACE_)\n// Import tuple and friends into the ::testing namespace.\n// It is part of our interface, having them in ::testing allows us to change\n// their types as needed.\nusing GTEST_TUPLE_NAMESPACE_::get;\nusing GTEST_TUPLE_NAMESPACE_::make_tuple;\nusing GTEST_TUPLE_NAMESPACE_::tuple;\nusing GTEST_TUPLE_NAMESPACE_::tuple_size;\nusing GTEST_TUPLE_NAMESPACE_::tuple_element;\n#endif  // defined(GTEST_TUPLE_NAMESPACE_)\n\nnamespace internal {\n\n// A secret type that Google Test users don't know about.  It has no\n// definition on purpose.  Therefore it's impossible to create a\n// Secret object, which is what we want.\nclass Secret;\n\n// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time\n// expression is true. For example, you could use it to verify the\n// size of a static array:\n//\n//   GTEST_COMPILE_ASSERT_(GTEST_ARRAY_SIZE_(names) == NUM_NAMES,\n//                         names_incorrect_size);\n//\n// or to make sure a struct is smaller than a certain size:\n//\n//   GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large);\n//\n// The second argument to the macro is the name of the variable. If\n// the expression is false, most compilers will issue a warning/error\n// containing the name of the variable.\n\n#if GTEST_LANG_CXX11\n# define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg)\n#else  // !GTEST_LANG_CXX11\ntemplate <bool>\n  struct CompileAssert {\n};\n\n# define GTEST_COMPILE_ASSERT_(expr, msg) \\\n  typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \\\n      msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_\n#endif  // !GTEST_LANG_CXX11\n\n// Implementation details of GTEST_COMPILE_ASSERT_:\n//\n// (In C++11, we simply use static_assert instead of the following)\n//\n// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1\n//   elements (and thus is invalid) when the expression is false.\n//\n// - The simpler definition\n//\n//    #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1]\n//\n//   does not work, as gcc supports variable-length arrays whose sizes\n//   are determined at run-time (this is gcc's extension and not part\n//   of the C++ standard).  As a result, gcc fails to reject the\n//   following code with the simple definition:\n//\n//     int foo;\n//     GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is\n//                                      // not a compile-time constant.\n//\n// - By using the type CompileAssert<(bool(expr))>, we ensures that\n//   expr is a compile-time constant.  (Template arguments must be\n//   determined at compile-time.)\n//\n// - The outter parentheses in CompileAssert<(bool(expr))> are necessary\n//   to work around a bug in gcc 3.4.4 and 4.0.1.  If we had written\n//\n//     CompileAssert<bool(expr)>\n//\n//   instead, these compilers will refuse to compile\n//\n//     GTEST_COMPILE_ASSERT_(5 > 0, some_message);\n//\n//   (They seem to think the \">\" in \"5 > 0\" marks the end of the\n//   template argument list.)\n//\n// - The array size is (bool(expr) ? 1 : -1), instead of simply\n//\n//     ((expr) ? 1 : -1).\n//\n//   This is to avoid running into a bug in MS VC 7.1, which\n//   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.\n\n// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h.\n//\n// This template is declared, but intentionally undefined.\ntemplate <typename T1, typename T2>\nstruct StaticAssertTypeEqHelper;\n\ntemplate <typename T>\nstruct StaticAssertTypeEqHelper<T, T> {\n  enum { value = true };\n};\n\n// Same as std::is_same<>.\ntemplate <typename T, typename U>\nstruct IsSame {\n  enum { value = false };\n};\ntemplate <typename T>\nstruct IsSame<T, T> {\n  enum { value = true };\n};\n\n// Evaluates to the number of elements in 'array'.\n#define GTEST_ARRAY_SIZE_(array) (sizeof(array) / sizeof(array[0]))\n\n#if GTEST_HAS_GLOBAL_STRING\ntypedef ::string string;\n#else\ntypedef ::std::string string;\n#endif  // GTEST_HAS_GLOBAL_STRING\n\n#if GTEST_HAS_GLOBAL_WSTRING\ntypedef ::wstring wstring;\n#elif GTEST_HAS_STD_WSTRING\ntypedef ::std::wstring wstring;\n#endif  // GTEST_HAS_GLOBAL_WSTRING\n\n// A helper for suppressing warnings on constant condition.  It just\n// returns 'condition'.\nGTEST_API_ bool IsTrue(bool condition);\n\n// Defines scoped_ptr.\n\n// This implementation of scoped_ptr is PARTIAL - it only contains\n// enough stuff to satisfy Google Test's need.\ntemplate <typename T>\nclass scoped_ptr {\n public:\n  typedef T element_type;\n\n  explicit scoped_ptr(T* p = NULL) : ptr_(p) {}\n  ~scoped_ptr() { reset(); }\n\n  T& operator*() const { return *ptr_; }\n  T* operator->() const { return ptr_; }\n  T* get() const { return ptr_; }\n\n  T* release() {\n    T* const ptr = ptr_;\n    ptr_ = NULL;\n    return ptr;\n  }\n\n  void reset(T* p = NULL) {\n    if (p != ptr_) {\n      if (IsTrue(sizeof(T) > 0)) {  // Makes sure T is a complete type.\n        delete ptr_;\n      }\n      ptr_ = p;\n    }\n  }\n\n  friend void swap(scoped_ptr& a, scoped_ptr& b) {\n    using std::swap;\n    swap(a.ptr_, b.ptr_);\n  }\n\n private:\n  T* ptr_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr);\n};\n\n// Defines RE.\n\n#if GTEST_USES_PCRE\n// if used, PCRE is injected by custom/gtest-port.h\n#elif GTEST_USES_POSIX_RE || GTEST_USES_SIMPLE_RE\n\n// A simple C++ wrapper for <regex.h>.  It uses the POSIX Extended\n// Regular Expression syntax.\nclass GTEST_API_ RE {\n public:\n  // A copy constructor is required by the Standard to initialize object\n  // references from r-values.\n  RE(const RE& other) { Init(other.pattern()); }\n\n  // Constructs an RE from a string.\n  RE(const ::std::string& regex) { Init(regex.c_str()); }  // NOLINT\n\n# if GTEST_HAS_GLOBAL_STRING\n\n  RE(const ::string& regex) { Init(regex.c_str()); }  // NOLINT\n\n# endif  // GTEST_HAS_GLOBAL_STRING\n\n  RE(const char* regex) { Init(regex); }  // NOLINT\n  ~RE();\n\n  // Returns the string representation of the regex.\n  const char* pattern() const { return pattern_; }\n\n  // FullMatch(str, re) returns true iff regular expression re matches\n  // the entire str.\n  // PartialMatch(str, re) returns true iff regular expression re\n  // matches a substring of str (including str itself).\n  //\n  // FIXME: make FullMatch() and PartialMatch() work\n  // when str contains NUL characters.\n  static bool FullMatch(const ::std::string& str, const RE& re) {\n    return FullMatch(str.c_str(), re);\n  }\n  static bool PartialMatch(const ::std::string& str, const RE& re) {\n    return PartialMatch(str.c_str(), re);\n  }\n\n# if GTEST_HAS_GLOBAL_STRING\n\n  static bool FullMatch(const ::string& str, const RE& re) {\n    return FullMatch(str.c_str(), re);\n  }\n  static bool PartialMatch(const ::string& str, const RE& re) {\n    return PartialMatch(str.c_str(), re);\n  }\n\n# endif  // GTEST_HAS_GLOBAL_STRING\n\n  static bool FullMatch(const char* str, const RE& re);\n  static bool PartialMatch(const char* str, const RE& re);\n\n private:\n  void Init(const char* regex);\n\n  // We use a const char* instead of an std::string, as Google Test used to be\n  // used where std::string is not available.  FIXME: change to\n  // std::string.\n  const char* pattern_;\n  bool is_valid_;\n\n# if GTEST_USES_POSIX_RE\n\n  regex_t full_regex_;     // For FullMatch().\n  regex_t partial_regex_;  // For PartialMatch().\n\n# else  // GTEST_USES_SIMPLE_RE\n\n  const char* full_pattern_;  // For FullMatch();\n\n# endif\n\n  GTEST_DISALLOW_ASSIGN_(RE);\n};\n\n#endif  // GTEST_USES_PCRE\n\n// Formats a source file path and a line number as they would appear\n// in an error message from the compiler used to compile this code.\nGTEST_API_ ::std::string FormatFileLocation(const char* file, int line);\n\n// Formats a file location for compiler-independent XML output.\n// Although this function is not platform dependent, we put it next to\n// FormatFileLocation in order to contrast the two functions.\nGTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,\n                                                               int line);\n\n// Defines logging utilities:\n//   GTEST_LOG_(severity) - logs messages at the specified severity level. The\n//                          message itself is streamed into the macro.\n//   LogToStderr()  - directs all log messages to stderr.\n//   FlushInfoLog() - flushes informational log messages.\n\nenum GTestLogSeverity {\n  GTEST_INFO,\n  GTEST_WARNING,\n  GTEST_ERROR,\n  GTEST_FATAL\n};\n\n// Formats log entry severity, provides a stream object for streaming the\n// log message, and terminates the message with a newline when going out of\n// scope.\nclass GTEST_API_ GTestLog {\n public:\n  GTestLog(GTestLogSeverity severity, const char* file, int line);\n\n  // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.\n  ~GTestLog();\n\n  ::std::ostream& GetStream() { return ::std::cerr; }\n\n private:\n  const GTestLogSeverity severity_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);\n};\n\n#if !defined(GTEST_LOG_)\n\n# define GTEST_LOG_(severity) \\\n    ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \\\n                                  __FILE__, __LINE__).GetStream()\n\ninline void LogToStderr() {}\ninline void FlushInfoLog() { fflush(NULL); }\n\n#endif  // !defined(GTEST_LOG_)\n\n#if !defined(GTEST_CHECK_)\n// INTERNAL IMPLEMENTATION - DO NOT USE.\n//\n// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition\n// is not satisfied.\n//  Synopsys:\n//    GTEST_CHECK_(boolean_condition);\n//     or\n//    GTEST_CHECK_(boolean_condition) << \"Additional message\";\n//\n//    This checks the condition and if the condition is not satisfied\n//    it prints message about the condition violation, including the\n//    condition itself, plus additional message streamed into it, if any,\n//    and then it aborts the program. It aborts the program irrespective of\n//    whether it is built in the debug mode or not.\n# define GTEST_CHECK_(condition) \\\n    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n    if (::testing::internal::IsTrue(condition)) \\\n      ; \\\n    else \\\n      GTEST_LOG_(FATAL) << \"Condition \" #condition \" failed. \"\n#endif  // !defined(GTEST_CHECK_)\n\n// An all-mode assert to verify that the given POSIX-style function\n// call returns 0 (indicating success).  Known limitation: this\n// doesn't expand to a balanced 'if' statement, so enclose the macro\n// in {} if you need to use it as the only statement in an 'if'\n// branch.\n#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \\\n  if (const int gtest_error = (posix_call)) \\\n    GTEST_LOG_(FATAL) << #posix_call << \"failed with error \" \\\n                      << gtest_error\n\n// Adds reference to a type if it is not a reference type,\n// otherwise leaves it unchanged.  This is the same as\n// tr1::add_reference, which is not widely available yet.\ntemplate <typename T>\nstruct AddReference { typedef T& type; };  // NOLINT\ntemplate <typename T>\nstruct AddReference<T&> { typedef T& type; };  // NOLINT\n\n// A handy wrapper around AddReference that works when the argument T\n// depends on template parameters.\n#define GTEST_ADD_REFERENCE_(T) \\\n    typename ::testing::internal::AddReference<T>::type\n\n// Transforms \"T\" into \"const T&\" according to standard reference collapsing\n// rules (this is only needed as a backport for C++98 compilers that do not\n// support reference collapsing). Specifically, it transforms:\n//\n//   char         ==> const char&\n//   const char   ==> const char&\n//   char&        ==> char&\n//   const char&  ==> const char&\n//\n// Note that the non-const reference will not have \"const\" added. This is\n// standard, and necessary so that \"T\" can always bind to \"const T&\".\ntemplate <typename T>\nstruct ConstRef { typedef const T& type; };\ntemplate <typename T>\nstruct ConstRef<T&> { typedef T& type; };\n\n// The argument T must depend on some template parameters.\n#define GTEST_REFERENCE_TO_CONST_(T) \\\n  typename ::testing::internal::ConstRef<T>::type\n\n#if GTEST_HAS_STD_MOVE_\nusing std::forward;\nusing std::move;\n\ntemplate <typename T>\nstruct RvalueRef {\n  typedef T&& type;\n};\n#else  // GTEST_HAS_STD_MOVE_\ntemplate <typename T>\nconst T& move(const T& t) {\n  return t;\n}\ntemplate <typename T>\nGTEST_ADD_REFERENCE_(T) forward(GTEST_ADD_REFERENCE_(T) t) { return t; }\n\ntemplate <typename T>\nstruct RvalueRef {\n  typedef const T& type;\n};\n#endif  // GTEST_HAS_STD_MOVE_\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Use ImplicitCast_ as a safe version of static_cast for upcasting in\n// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a\n// const Foo*).  When you use ImplicitCast_, the compiler checks that\n// the cast is safe.  Such explicit ImplicitCast_s are necessary in\n// surprisingly many situations where C++ demands an exact type match\n// instead of an argument type convertable to a target type.\n//\n// The syntax for using ImplicitCast_ is the same as for static_cast:\n//\n//   ImplicitCast_<ToType>(expr)\n//\n// ImplicitCast_ would have been part of the C++ standard library,\n// but the proposal was submitted too late.  It will probably make\n// its way into the language in the future.\n//\n// This relatively ugly name is intentional. It prevents clashes with\n// similar functions users may have (e.g., implicit_cast). The internal\n// namespace alone is not enough because the function can be found by ADL.\ntemplate<typename To>\ninline To ImplicitCast_(To x) { return x; }\n\n// When you upcast (that is, cast a pointer from type Foo to type\n// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts\n// always succeed.  When you downcast (that is, cast a pointer from\n// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because\n// how do you know the pointer is really of type SubclassOfFoo?  It\n// could be a bare Foo, or of type DifferentSubclassOfFoo.  Thus,\n// when you downcast, you should use this macro.  In debug mode, we\n// use dynamic_cast<> to double-check the downcast is legal (we die\n// if it's not).  In normal mode, we do the efficient static_cast<>\n// instead.  Thus, it's important to test in debug mode to make sure\n// the cast is legal!\n//    This is the only place in the code we should use dynamic_cast<>.\n// In particular, you SHOULDN'T be using dynamic_cast<> in order to\n// do RTTI (eg code like this:\n//    if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);\n//    if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);\n// You should design the code some other way not to need this.\n//\n// This relatively ugly name is intentional. It prevents clashes with\n// similar functions users may have (e.g., down_cast). The internal\n// namespace alone is not enough because the function can be found by ADL.\ntemplate<typename To, typename From>  // use like this: DownCast_<T*>(foo);\ninline To DownCast_(From* f) {  // so we only accept pointers\n  // Ensures that To is a sub-type of From *.  This test is here only\n  // for compile-time type checking, and has no overhead in an\n  // optimized build at run-time, as it will be optimized away\n  // completely.\n  GTEST_INTENTIONAL_CONST_COND_PUSH_()\n  if (false) {\n  GTEST_INTENTIONAL_CONST_COND_POP_()\n    const To to = NULL;\n    ::testing::internal::ImplicitCast_<From*>(to);\n  }\n\n#if GTEST_HAS_RTTI\n  // RTTI: debug mode only!\n  GTEST_CHECK_(f == NULL || dynamic_cast<To>(f) != NULL);\n#endif\n  return static_cast<To>(f);\n}\n\n// Downcasts the pointer of type Base to Derived.\n// Derived must be a subclass of Base. The parameter MUST\n// point to a class of type Derived, not any subclass of it.\n// When RTTI is available, the function performs a runtime\n// check to enforce this.\ntemplate <class Derived, class Base>\nDerived* CheckedDowncastToActualType(Base* base) {\n#if GTEST_HAS_RTTI\n  GTEST_CHECK_(typeid(*base) == typeid(Derived));\n#endif\n\n#if GTEST_HAS_DOWNCAST_\n  return ::down_cast<Derived*>(base);\n#elif GTEST_HAS_RTTI\n  return dynamic_cast<Derived*>(base);  // NOLINT\n#else\n  return static_cast<Derived*>(base);  // Poor man's downcast.\n#endif\n}\n\n#if GTEST_HAS_STREAM_REDIRECTION\n\n// Defines the stderr capturer:\n//   CaptureStdout     - starts capturing stdout.\n//   GetCapturedStdout - stops capturing stdout and returns the captured string.\n//   CaptureStderr     - starts capturing stderr.\n//   GetCapturedStderr - stops capturing stderr and returns the captured string.\n//\nGTEST_API_ void CaptureStdout();\nGTEST_API_ std::string GetCapturedStdout();\nGTEST_API_ void CaptureStderr();\nGTEST_API_ std::string GetCapturedStderr();\n\n#endif  // GTEST_HAS_STREAM_REDIRECTION\n// Returns the size (in bytes) of a file.\nGTEST_API_ size_t GetFileSize(FILE* file);\n\n// Reads the entire content of a file as a string.\nGTEST_API_ std::string ReadEntireFile(FILE* file);\n\n// All command line arguments.\nGTEST_API_ std::vector<std::string> GetArgvs();\n\n#if GTEST_HAS_DEATH_TEST\n\nstd::vector<std::string> GetInjectableArgvs();\n// Deprecated: pass the args vector by value instead.\nvoid SetInjectableArgvs(const std::vector<std::string>* new_argvs);\nvoid SetInjectableArgvs(const std::vector<std::string>& new_argvs);\n#if GTEST_HAS_GLOBAL_STRING\nvoid SetInjectableArgvs(const std::vector< ::string>& new_argvs);\n#endif  // GTEST_HAS_GLOBAL_STRING\nvoid ClearInjectableArgvs();\n\n#endif  // GTEST_HAS_DEATH_TEST\n\n// Defines synchronization primitives.\n#if GTEST_IS_THREADSAFE\n# if GTEST_HAS_PTHREAD\n// Sleeps for (roughly) n milliseconds.  This function is only for testing\n// Google Test's own constructs.  Don't use it in user tests, either\n// directly or indirectly.\ninline void SleepMilliseconds(int n) {\n  const timespec time = {\n    0,                  // 0 seconds.\n    n * 1000L * 1000L,  // And n ms.\n  };\n  nanosleep(&time, NULL);\n}\n# endif  // GTEST_HAS_PTHREAD\n\n# if GTEST_HAS_NOTIFICATION_\n// Notification has already been imported into the namespace.\n// Nothing to do here.\n\n# elif GTEST_HAS_PTHREAD\n// Allows a controller thread to pause execution of newly created\n// threads until notified.  Instances of this class must be created\n// and destroyed in the controller thread.\n//\n// This class is only for testing Google Test's own constructs. Do not\n// use it in user tests, either directly or indirectly.\nclass Notification {\n public:\n  Notification() : notified_(false) {\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));\n  }\n  ~Notification() {\n    pthread_mutex_destroy(&mutex_);\n  }\n\n  // Notifies all threads created with this notification to start. Must\n  // be called from the controller thread.\n  void Notify() {\n    pthread_mutex_lock(&mutex_);\n    notified_ = true;\n    pthread_mutex_unlock(&mutex_);\n  }\n\n  // Blocks until the controller thread notifies. Must be called from a test\n  // thread.\n  void WaitForNotification() {\n    for (;;) {\n      pthread_mutex_lock(&mutex_);\n      const bool notified = notified_;\n      pthread_mutex_unlock(&mutex_);\n      if (notified)\n        break;\n      SleepMilliseconds(10);\n    }\n  }\n\n private:\n  pthread_mutex_t mutex_;\n  bool notified_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);\n};\n\n# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT\n\nGTEST_API_ void SleepMilliseconds(int n);\n\n// Provides leak-safe Windows kernel handle ownership.\n// Used in death tests and in threading support.\nclass GTEST_API_ AutoHandle {\n public:\n  // Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to\n  // avoid including <windows.h> in this header file. Including <windows.h> is\n  // undesirable because it defines a lot of symbols and macros that tend to\n  // conflict with client code. This assumption is verified by\n  // WindowsTypesTest.HANDLEIsVoidStar.\n  typedef void* Handle;\n  AutoHandle();\n  explicit AutoHandle(Handle handle);\n\n  ~AutoHandle();\n\n  Handle Get() const;\n  void Reset();\n  void Reset(Handle handle);\n\n private:\n  // Returns true iff the handle is a valid handle object that can be closed.\n  bool IsCloseable() const;\n\n  Handle handle_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);\n};\n\n// Allows a controller thread to pause execution of newly created\n// threads until notified.  Instances of this class must be created\n// and destroyed in the controller thread.\n//\n// This class is only for testing Google Test's own constructs. Do not\n// use it in user tests, either directly or indirectly.\nclass GTEST_API_ Notification {\n public:\n  Notification();\n  void Notify();\n  void WaitForNotification();\n\n private:\n  AutoHandle event_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);\n};\n# endif  // GTEST_HAS_NOTIFICATION_\n\n// On MinGW, we can have both GTEST_OS_WINDOWS and GTEST_HAS_PTHREAD\n// defined, but we don't want to use MinGW's pthreads implementation, which\n// has conformance problems with some versions of the POSIX standard.\n# if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW\n\n// As a C-function, ThreadFuncWithCLinkage cannot be templated itself.\n// Consequently, it cannot select a correct instantiation of ThreadWithParam\n// in order to call its Run(). Introducing ThreadWithParamBase as a\n// non-templated base class for ThreadWithParam allows us to bypass this\n// problem.\nclass ThreadWithParamBase {\n public:\n  virtual ~ThreadWithParamBase() {}\n  virtual void Run() = 0;\n};\n\n// pthread_create() accepts a pointer to a function type with the C linkage.\n// According to the Standard (7.5/1), function types with different linkages\n// are different even if they are otherwise identical.  Some compilers (for\n// example, SunStudio) treat them as different types.  Since class methods\n// cannot be defined with C-linkage we need to define a free C-function to\n// pass into pthread_create().\nextern \"C\" inline void* ThreadFuncWithCLinkage(void* thread) {\n  static_cast<ThreadWithParamBase*>(thread)->Run();\n  return NULL;\n}\n\n// Helper class for testing Google Test's multi-threading constructs.\n// To use it, write:\n//\n//   void ThreadFunc(int param) { /* Do things with param */ }\n//   Notification thread_can_start;\n//   ...\n//   // The thread_can_start parameter is optional; you can supply NULL.\n//   ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);\n//   thread_can_start.Notify();\n//\n// These classes are only for testing Google Test's own constructs. Do\n// not use them in user tests, either directly or indirectly.\ntemplate <typename T>\nclass ThreadWithParam : public ThreadWithParamBase {\n public:\n  typedef void UserThreadFunc(T);\n\n  ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)\n      : func_(func),\n        param_(param),\n        thread_can_start_(thread_can_start),\n        finished_(false) {\n    ThreadWithParamBase* const base = this;\n    // The thread can be created only after all fields except thread_\n    // have been initialized.\n    GTEST_CHECK_POSIX_SUCCESS_(\n        pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base));\n  }\n  ~ThreadWithParam() { Join(); }\n\n  void Join() {\n    if (!finished_) {\n      GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0));\n      finished_ = true;\n    }\n  }\n\n  virtual void Run() {\n    if (thread_can_start_ != NULL)\n      thread_can_start_->WaitForNotification();\n    func_(param_);\n  }\n\n private:\n  UserThreadFunc* const func_;  // User-supplied thread function.\n  const T param_;  // User-supplied parameter to the thread function.\n  // When non-NULL, used to block execution until the controller thread\n  // notifies.\n  Notification* const thread_can_start_;\n  bool finished_;  // true iff we know that the thread function has finished.\n  pthread_t thread_;  // The native thread object.\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);\n};\n# endif  // !GTEST_OS_WINDOWS && GTEST_HAS_PTHREAD ||\n         // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_\n\n# if GTEST_HAS_MUTEX_AND_THREAD_LOCAL_\n// Mutex and ThreadLocal have already been imported into the namespace.\n// Nothing to do here.\n\n# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT\n\n// Mutex implements mutex on Windows platforms.  It is used in conjunction\n// with class MutexLock:\n//\n//   Mutex mutex;\n//   ...\n//   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the\n//                            // end of the current scope.\n//\n// A static Mutex *must* be defined or declared using one of the following\n// macros:\n//   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);\n//   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);\n//\n// (A non-static Mutex is defined/declared in the usual way).\nclass GTEST_API_ Mutex {\n public:\n  enum MutexType { kStatic = 0, kDynamic = 1 };\n  // We rely on kStaticMutex being 0 as it is to what the linker initializes\n  // type_ in static mutexes.  critical_section_ will be initialized lazily\n  // in ThreadSafeLazyInit().\n  enum StaticConstructorSelector { kStaticMutex = 0 };\n\n  // This constructor intentionally does nothing.  It relies on type_ being\n  // statically initialized to 0 (effectively setting it to kStatic) and on\n  // ThreadSafeLazyInit() to lazily initialize the rest of the members.\n  explicit Mutex(StaticConstructorSelector /*dummy*/) {}\n\n  Mutex();\n  ~Mutex();\n\n  void Lock();\n\n  void Unlock();\n\n  // Does nothing if the current thread holds the mutex. Otherwise, crashes\n  // with high probability.\n  void AssertHeld();\n\n private:\n  // Initializes owner_thread_id_ and critical_section_ in static mutexes.\n  void ThreadSafeLazyInit();\n\n  // Per https://blogs.msdn.microsoft.com/oldnewthing/20040223-00/?p=40503,\n  // we assume that 0 is an invalid value for thread IDs.\n  unsigned int owner_thread_id_;\n\n  // For static mutexes, we rely on these members being initialized to zeros\n  // by the linker.\n  MutexType type_;\n  long critical_section_init_phase_;  // NOLINT\n  GTEST_CRITICAL_SECTION* critical_section_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);\n};\n\n# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \\\n    extern ::testing::internal::Mutex mutex\n\n# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \\\n    ::testing::internal::Mutex mutex(::testing::internal::Mutex::kStaticMutex)\n\n// We cannot name this class MutexLock because the ctor declaration would\n// conflict with a macro named MutexLock, which is defined on some\n// platforms. That macro is used as a defensive measure to prevent against\n// inadvertent misuses of MutexLock like \"MutexLock(&mu)\" rather than\n// \"MutexLock l(&mu)\".  Hence the typedef trick below.\nclass GTestMutexLock {\n public:\n  explicit GTestMutexLock(Mutex* mutex)\n      : mutex_(mutex) { mutex_->Lock(); }\n\n  ~GTestMutexLock() { mutex_->Unlock(); }\n\n private:\n  Mutex* const mutex_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);\n};\n\ntypedef GTestMutexLock MutexLock;\n\n// Base class for ValueHolder<T>.  Allows a caller to hold and delete a value\n// without knowing its type.\nclass ThreadLocalValueHolderBase {\n public:\n  virtual ~ThreadLocalValueHolderBase() {}\n};\n\n// Provides a way for a thread to send notifications to a ThreadLocal\n// regardless of its parameter type.\nclass ThreadLocalBase {\n public:\n  // Creates a new ValueHolder<T> object holding a default value passed to\n  // this ThreadLocal<T>'s constructor and returns it.  It is the caller's\n  // responsibility not to call this when the ThreadLocal<T> instance already\n  // has a value on the current thread.\n  virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const = 0;\n\n protected:\n  ThreadLocalBase() {}\n  virtual ~ThreadLocalBase() {}\n\n private:\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocalBase);\n};\n\n// Maps a thread to a set of ThreadLocals that have values instantiated on that\n// thread and notifies them when the thread exits.  A ThreadLocal instance is\n// expected to persist until all threads it has values on have terminated.\nclass GTEST_API_ ThreadLocalRegistry {\n public:\n  // Registers thread_local_instance as having value on the current thread.\n  // Returns a value that can be used to identify the thread from other threads.\n  static ThreadLocalValueHolderBase* GetValueOnCurrentThread(\n      const ThreadLocalBase* thread_local_instance);\n\n  // Invoked when a ThreadLocal instance is destroyed.\n  static void OnThreadLocalDestroyed(\n      const ThreadLocalBase* thread_local_instance);\n};\n\nclass GTEST_API_ ThreadWithParamBase {\n public:\n  void Join();\n\n protected:\n  class Runnable {\n   public:\n    virtual ~Runnable() {}\n    virtual void Run() = 0;\n  };\n\n  ThreadWithParamBase(Runnable *runnable, Notification* thread_can_start);\n  virtual ~ThreadWithParamBase();\n\n private:\n  AutoHandle thread_;\n};\n\n// Helper class for testing Google Test's multi-threading constructs.\ntemplate <typename T>\nclass ThreadWithParam : public ThreadWithParamBase {\n public:\n  typedef void UserThreadFunc(T);\n\n  ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)\n      : ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {\n  }\n  virtual ~ThreadWithParam() {}\n\n private:\n  class RunnableImpl : public Runnable {\n   public:\n    RunnableImpl(UserThreadFunc* func, T param)\n        : func_(func),\n          param_(param) {\n    }\n    virtual ~RunnableImpl() {}\n    virtual void Run() {\n      func_(param_);\n    }\n\n   private:\n    UserThreadFunc* const func_;\n    const T param_;\n\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(RunnableImpl);\n  };\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);\n};\n\n// Implements thread-local storage on Windows systems.\n//\n//   // Thread 1\n//   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.\n//\n//   // Thread 2\n//   tl.set(150);  // Changes the value for thread 2 only.\n//   EXPECT_EQ(150, tl.get());\n//\n//   // Thread 1\n//   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.\n//   tl.set(200);\n//   EXPECT_EQ(200, tl.get());\n//\n// The template type argument T must have a public copy constructor.\n// In addition, the default ThreadLocal constructor requires T to have\n// a public default constructor.\n//\n// The users of a TheadLocal instance have to make sure that all but one\n// threads (including the main one) using that instance have exited before\n// destroying it. Otherwise, the per-thread objects managed for them by the\n// ThreadLocal instance are not guaranteed to be destroyed on all platforms.\n//\n// Google Test only uses global ThreadLocal objects.  That means they\n// will die after main() has returned.  Therefore, no per-thread\n// object managed by Google Test will be leaked as long as all threads\n// using Google Test have exited when main() returns.\ntemplate <typename T>\nclass ThreadLocal : public ThreadLocalBase {\n public:\n  ThreadLocal() : default_factory_(new DefaultValueHolderFactory()) {}\n  explicit ThreadLocal(const T& value)\n      : default_factory_(new InstanceValueHolderFactory(value)) {}\n\n  ~ThreadLocal() { ThreadLocalRegistry::OnThreadLocalDestroyed(this); }\n\n  T* pointer() { return GetOrCreateValue(); }\n  const T* pointer() const { return GetOrCreateValue(); }\n  const T& get() const { return *pointer(); }\n  void set(const T& value) { *pointer() = value; }\n\n private:\n  // Holds a value of T.  Can be deleted via its base class without the caller\n  // knowing the type of T.\n  class ValueHolder : public ThreadLocalValueHolderBase {\n   public:\n    ValueHolder() : value_() {}\n    explicit ValueHolder(const T& value) : value_(value) {}\n\n    T* pointer() { return &value_; }\n\n   private:\n    T value_;\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);\n  };\n\n\n  T* GetOrCreateValue() const {\n    return static_cast<ValueHolder*>(\n        ThreadLocalRegistry::GetValueOnCurrentThread(this))->pointer();\n  }\n\n  virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const {\n    return default_factory_->MakeNewHolder();\n  }\n\n  class ValueHolderFactory {\n   public:\n    ValueHolderFactory() {}\n    virtual ~ValueHolderFactory() {}\n    virtual ValueHolder* MakeNewHolder() const = 0;\n\n   private:\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);\n  };\n\n  class DefaultValueHolderFactory : public ValueHolderFactory {\n   public:\n    DefaultValueHolderFactory() {}\n    virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }\n\n   private:\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);\n  };\n\n  class InstanceValueHolderFactory : public ValueHolderFactory {\n   public:\n    explicit InstanceValueHolderFactory(const T& value) : value_(value) {}\n    virtual ValueHolder* MakeNewHolder() const {\n      return new ValueHolder(value_);\n    }\n\n   private:\n    const T value_;  // The value for each thread.\n\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);\n  };\n\n  scoped_ptr<ValueHolderFactory> default_factory_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);\n};\n\n# elif GTEST_HAS_PTHREAD\n\n// MutexBase and Mutex implement mutex on pthreads-based platforms.\nclass MutexBase {\n public:\n  // Acquires this mutex.\n  void Lock() {\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));\n    owner_ = pthread_self();\n    has_owner_ = true;\n  }\n\n  // Releases this mutex.\n  void Unlock() {\n    // Since the lock is being released the owner_ field should no longer be\n    // considered valid. We don't protect writing to has_owner_ here, as it's\n    // the caller's responsibility to ensure that the current thread holds the\n    // mutex when this is called.\n    has_owner_ = false;\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));\n  }\n\n  // Does nothing if the current thread holds the mutex. Otherwise, crashes\n  // with high probability.\n  void AssertHeld() const {\n    GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))\n        << \"The current thread is not holding the mutex @\" << this;\n  }\n\n  // A static mutex may be used before main() is entered.  It may even\n  // be used before the dynamic initialization stage.  Therefore we\n  // must be able to initialize a static mutex object at link time.\n  // This means MutexBase has to be a POD and its member variables\n  // have to be public.\n public:\n  pthread_mutex_t mutex_;  // The underlying pthread mutex.\n  // has_owner_ indicates whether the owner_ field below contains a valid thread\n  // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All\n  // accesses to the owner_ field should be protected by a check of this field.\n  // An alternative might be to memset() owner_ to all zeros, but there's no\n  // guarantee that a zero'd pthread_t is necessarily invalid or even different\n  // from pthread_self().\n  bool has_owner_;\n  pthread_t owner_;  // The thread holding the mutex.\n};\n\n// Forward-declares a static mutex.\n#  define GTEST_DECLARE_STATIC_MUTEX_(mutex) \\\n     extern ::testing::internal::MutexBase mutex\n\n// Defines and statically (i.e. at link time) initializes a static mutex.\n// The initialization list here does not explicitly initialize each field,\n// instead relying on default initialization for the unspecified fields. In\n// particular, the owner_ field (a pthread_t) is not explicitly initialized.\n// This allows initialization to work whether pthread_t is a scalar or struct.\n// The flag -Wmissing-field-initializers must not be specified for this to work.\n#define GTEST_DEFINE_STATIC_MUTEX_(mutex) \\\n  ::testing::internal::MutexBase mutex = {PTHREAD_MUTEX_INITIALIZER, false, 0}\n\n// The Mutex class can only be used for mutexes created at runtime. It\n// shares its API with MutexBase otherwise.\nclass Mutex : public MutexBase {\n public:\n  Mutex() {\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL));\n    has_owner_ = false;\n  }\n  ~Mutex() {\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));\n  }\n\n private:\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);\n};\n\n// We cannot name this class MutexLock because the ctor declaration would\n// conflict with a macro named MutexLock, which is defined on some\n// platforms. That macro is used as a defensive measure to prevent against\n// inadvertent misuses of MutexLock like \"MutexLock(&mu)\" rather than\n// \"MutexLock l(&mu)\".  Hence the typedef trick below.\nclass GTestMutexLock {\n public:\n  explicit GTestMutexLock(MutexBase* mutex)\n      : mutex_(mutex) { mutex_->Lock(); }\n\n  ~GTestMutexLock() { mutex_->Unlock(); }\n\n private:\n  MutexBase* const mutex_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);\n};\n\ntypedef GTestMutexLock MutexLock;\n\n// Helpers for ThreadLocal.\n\n// pthread_key_create() requires DeleteThreadLocalValue() to have\n// C-linkage.  Therefore it cannot be templatized to access\n// ThreadLocal<T>.  Hence the need for class\n// ThreadLocalValueHolderBase.\nclass ThreadLocalValueHolderBase {\n public:\n  virtual ~ThreadLocalValueHolderBase() {}\n};\n\n// Called by pthread to delete thread-local data stored by\n// pthread_setspecific().\nextern \"C\" inline void DeleteThreadLocalValue(void* value_holder) {\n  delete static_cast<ThreadLocalValueHolderBase*>(value_holder);\n}\n\n// Implements thread-local storage on pthreads-based systems.\ntemplate <typename T>\nclass GTEST_API_ ThreadLocal {\n public:\n  ThreadLocal()\n      : key_(CreateKey()), default_factory_(new DefaultValueHolderFactory()) {}\n  explicit ThreadLocal(const T& value)\n      : key_(CreateKey()),\n        default_factory_(new InstanceValueHolderFactory(value)) {}\n\n  ~ThreadLocal() {\n    // Destroys the managed object for the current thread, if any.\n    DeleteThreadLocalValue(pthread_getspecific(key_));\n\n    // Releases resources associated with the key.  This will *not*\n    // delete managed objects for other threads.\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));\n  }\n\n  T* pointer() { return GetOrCreateValue(); }\n  const T* pointer() const { return GetOrCreateValue(); }\n  const T& get() const { return *pointer(); }\n  void set(const T& value) { *pointer() = value; }\n\n private:\n  // Holds a value of type T.\n  class ValueHolder : public ThreadLocalValueHolderBase {\n   public:\n    ValueHolder() : value_() {}\n    explicit ValueHolder(const T& value) : value_(value) {}\n\n    T* pointer() { return &value_; }\n\n   private:\n    T value_;\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);\n  };\n\n  static pthread_key_t CreateKey() {\n    pthread_key_t key;\n    // When a thread exits, DeleteThreadLocalValue() will be called on\n    // the object managed for that thread.\n    GTEST_CHECK_POSIX_SUCCESS_(\n        pthread_key_create(&key, &DeleteThreadLocalValue));\n    return key;\n  }\n\n  T* GetOrCreateValue() const {\n    ThreadLocalValueHolderBase* const holder =\n        static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));\n    if (holder != NULL) {\n      return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();\n    }\n\n    ValueHolder* const new_holder = default_factory_->MakeNewHolder();\n    ThreadLocalValueHolderBase* const holder_base = new_holder;\n    GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));\n    return new_holder->pointer();\n  }\n\n  class ValueHolderFactory {\n   public:\n    ValueHolderFactory() {}\n    virtual ~ValueHolderFactory() {}\n    virtual ValueHolder* MakeNewHolder() const = 0;\n\n   private:\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);\n  };\n\n  class DefaultValueHolderFactory : public ValueHolderFactory {\n   public:\n    DefaultValueHolderFactory() {}\n    virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }\n\n   private:\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);\n  };\n\n  class InstanceValueHolderFactory : public ValueHolderFactory {\n   public:\n    explicit InstanceValueHolderFactory(const T& value) : value_(value) {}\n    virtual ValueHolder* MakeNewHolder() const {\n      return new ValueHolder(value_);\n    }\n\n   private:\n    const T value_;  // The value for each thread.\n\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);\n  };\n\n  // A key pthreads uses for looking up per-thread values.\n  const pthread_key_t key_;\n  scoped_ptr<ValueHolderFactory> default_factory_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);\n};\n\n# endif  // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_\n\n#else  // GTEST_IS_THREADSAFE\n\n// A dummy implementation of synchronization primitives (mutex, lock,\n// and thread-local variable).  Necessary for compiling Google Test where\n// mutex is not supported - using Google Test in multiple threads is not\n// supported on such platforms.\n\nclass Mutex {\n public:\n  Mutex() {}\n  void Lock() {}\n  void Unlock() {}\n  void AssertHeld() const {}\n};\n\n# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \\\n  extern ::testing::internal::Mutex mutex\n\n# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex\n\n// We cannot name this class MutexLock because the ctor declaration would\n// conflict with a macro named MutexLock, which is defined on some\n// platforms. That macro is used as a defensive measure to prevent against\n// inadvertent misuses of MutexLock like \"MutexLock(&mu)\" rather than\n// \"MutexLock l(&mu)\".  Hence the typedef trick below.\nclass GTestMutexLock {\n public:\n  explicit GTestMutexLock(Mutex*) {}  // NOLINT\n};\n\ntypedef GTestMutexLock MutexLock;\n\ntemplate <typename T>\nclass GTEST_API_ ThreadLocal {\n public:\n  ThreadLocal() : value_() {}\n  explicit ThreadLocal(const T& value) : value_(value) {}\n  T* pointer() { return &value_; }\n  const T* pointer() const { return &value_; }\n  const T& get() const { return value_; }\n  void set(const T& value) { value_ = value; }\n private:\n  T value_;\n};\n\n#endif  // GTEST_IS_THREADSAFE\n\n// Returns the number of threads running in the process, or 0 to indicate that\n// we cannot detect it.\nGTEST_API_ size_t GetThreadCount();\n\n// Passing non-POD classes through ellipsis (...) crashes the ARM\n// compiler and generates a warning in Sun Studio before 12u4. The Nokia Symbian\n// and the IBM XL C/C++ compiler try to instantiate a copy constructor\n// for objects passed through ellipsis (...), failing for uncopyable\n// objects.  We define this to ensure that only POD is passed through\n// ellipsis on these systems.\n#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || \\\n     (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x5130)\n// We lose support for NULL detection where the compiler doesn't like\n// passing non-POD classes through ellipsis (...).\n# define GTEST_ELLIPSIS_NEEDS_POD_ 1\n#else\n# define GTEST_CAN_COMPARE_NULL 1\n#endif\n\n// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between\n// const T& and const T* in a function template.  These compilers\n// _can_ decide between class template specializations for T and T*,\n// so a tr1::type_traits-like is_pointer works.\n#if defined(__SYMBIAN32__) || defined(__IBMCPP__)\n# define GTEST_NEEDS_IS_POINTER_ 1\n#endif\n\ntemplate <bool bool_value>\nstruct bool_constant {\n  typedef bool_constant<bool_value> type;\n  static const bool value = bool_value;\n};\ntemplate <bool bool_value> const bool bool_constant<bool_value>::value;\n\ntypedef bool_constant<false> false_type;\ntypedef bool_constant<true> true_type;\n\ntemplate <typename T, typename U>\nstruct is_same : public false_type {};\n\ntemplate <typename T>\nstruct is_same<T, T> : public true_type {};\n\n\ntemplate <typename T>\nstruct is_pointer : public false_type {};\n\ntemplate <typename T>\nstruct is_pointer<T*> : public true_type {};\n\ntemplate <typename Iterator>\nstruct IteratorTraits {\n  typedef typename Iterator::value_type value_type;\n};\n\n\ntemplate <typename T>\nstruct IteratorTraits<T*> {\n  typedef T value_type;\n};\n\ntemplate <typename T>\nstruct IteratorTraits<const T*> {\n  typedef T value_type;\n};\n\n#if GTEST_OS_WINDOWS\n# define GTEST_PATH_SEP_ \"\\\\\"\n# define GTEST_HAS_ALT_PATH_SEP_ 1\n// The biggest signed integer type the compiler supports.\ntypedef __int64 BiggestInt;\n#else\n# define GTEST_PATH_SEP_ \"/\"\n# define GTEST_HAS_ALT_PATH_SEP_ 0\ntypedef long long BiggestInt;  // NOLINT\n#endif  // GTEST_OS_WINDOWS\n\n// Utilities for char.\n\n// isspace(int ch) and friends accept an unsigned char or EOF.  char\n// may be signed, depending on the compiler (or compiler flags).\n// Therefore we need to cast a char to unsigned char before calling\n// isspace(), etc.\n\ninline bool IsAlpha(char ch) {\n  return isalpha(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsAlNum(char ch) {\n  return isalnum(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsDigit(char ch) {\n  return isdigit(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsLower(char ch) {\n  return islower(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsSpace(char ch) {\n  return isspace(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsUpper(char ch) {\n  return isupper(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsXDigit(char ch) {\n  return isxdigit(static_cast<unsigned char>(ch)) != 0;\n}\ninline bool IsXDigit(wchar_t ch) {\n  const unsigned char low_byte = static_cast<unsigned char>(ch);\n  return ch == low_byte && isxdigit(low_byte) != 0;\n}\n\ninline char ToLower(char ch) {\n  return static_cast<char>(tolower(static_cast<unsigned char>(ch)));\n}\ninline char ToUpper(char ch) {\n  return static_cast<char>(toupper(static_cast<unsigned char>(ch)));\n}\n\ninline std::string StripTrailingSpaces(std::string str) {\n  std::string::iterator it = str.end();\n  while (it != str.begin() && IsSpace(*--it))\n    it = str.erase(it);\n  return str;\n}\n\n// The testing::internal::posix namespace holds wrappers for common\n// POSIX functions.  These wrappers hide the differences between\n// Windows/MSVC and POSIX systems.  Since some compilers define these\n// standard functions as macros, the wrapper cannot have the same name\n// as the wrapped function.\n\nnamespace posix {\n\n// Functions with a different name on Windows.\n\n#if GTEST_OS_WINDOWS\n\ntypedef struct _stat StatStruct;\n\n# ifdef __BORLANDC__\ninline int IsATTY(int fd) { return isatty(fd); }\ninline int StrCaseCmp(const char* s1, const char* s2) {\n  return stricmp(s1, s2);\n}\ninline char* StrDup(const char* src) { return strdup(src); }\n# else  // !__BORLANDC__\n#  if GTEST_OS_WINDOWS_MOBILE\ninline int IsATTY(int /* fd */) { return 0; }\n#  else\ninline int IsATTY(int fd) { return _isatty(fd); }\n#  endif  // GTEST_OS_WINDOWS_MOBILE\ninline int StrCaseCmp(const char* s1, const char* s2) {\n  return _stricmp(s1, s2);\n}\ninline char* StrDup(const char* src) { return _strdup(src); }\n# endif  // __BORLANDC__\n\n# if GTEST_OS_WINDOWS_MOBILE\ninline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }\n// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this\n// time and thus not defined there.\n# else\ninline int FileNo(FILE* file) { return _fileno(file); }\ninline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }\ninline int RmDir(const char* dir) { return _rmdir(dir); }\ninline bool IsDir(const StatStruct& st) {\n  return (_S_IFDIR & st.st_mode) != 0;\n}\n# endif  // GTEST_OS_WINDOWS_MOBILE\n\n#else\n\ntypedef struct stat StatStruct;\n\ninline int FileNo(FILE* file) { return fileno(file); }\ninline int IsATTY(int fd) { return isatty(fd); }\ninline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }\ninline int StrCaseCmp(const char* s1, const char* s2) {\n  return strcasecmp(s1, s2);\n}\ninline char* StrDup(const char* src) { return strdup(src); }\ninline int RmDir(const char* dir) { return rmdir(dir); }\ninline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }\n\n#endif  // GTEST_OS_WINDOWS\n\n// Functions deprecated by MSVC 8.0.\n\nGTEST_DISABLE_MSC_DEPRECATED_PUSH_()\n\ninline const char* StrNCpy(char* dest, const char* src, size_t n) {\n  return strncpy(dest, src, n);\n}\n\n// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and\n// StrError() aren't needed on Windows CE at this time and thus not\n// defined there.\n\n#if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT\ninline int ChDir(const char* dir) { return chdir(dir); }\n#endif\ninline FILE* FOpen(const char* path, const char* mode) {\n  return fopen(path, mode);\n}\n#if !GTEST_OS_WINDOWS_MOBILE\ninline FILE *FReopen(const char* path, const char* mode, FILE* stream) {\n  return freopen(path, mode, stream);\n}\ninline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }\n#endif\ninline int FClose(FILE* fp) { return fclose(fp); }\n#if !GTEST_OS_WINDOWS_MOBILE\ninline int Read(int fd, void* buf, unsigned int count) {\n  return static_cast<int>(read(fd, buf, count));\n}\ninline int Write(int fd, const void* buf, unsigned int count) {\n  return static_cast<int>(write(fd, buf, count));\n}\ninline int Close(int fd) { return close(fd); }\ninline const char* StrError(int errnum) { return strerror(errnum); }\n#endif\ninline const char* GetEnv(const char* name) {\n#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT\n  // We are on Windows CE, which has no environment variables.\n  static_cast<void>(name);  // To prevent 'unused argument' warning.\n  return NULL;\n#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)\n  // Environment variables which we programmatically clear will be set to the\n  // empty string rather than unset (NULL).  Handle that case.\n  const char* const env = getenv(name);\n  return (env != NULL && env[0] != '\\0') ? env : NULL;\n#else\n  return getenv(name);\n#endif\n}\n\nGTEST_DISABLE_MSC_DEPRECATED_POP_()\n\n#if GTEST_OS_WINDOWS_MOBILE\n// Windows CE has no C library. The abort() function is used in\n// several places in Google Test. This implementation provides a reasonable\n// imitation of standard behaviour.\nvoid Abort();\n#else\ninline void Abort() { abort(); }\n#endif  // GTEST_OS_WINDOWS_MOBILE\n\n}  // namespace posix\n\n// MSVC \"deprecates\" snprintf and issues warnings wherever it is used.  In\n// order to avoid these warnings, we need to use _snprintf or _snprintf_s on\n// MSVC-based platforms.  We map the GTEST_SNPRINTF_ macro to the appropriate\n// function in order to achieve that.  We use macro definition here because\n// snprintf is a variadic function.\n#if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE\n// MSVC 2005 and above support variadic macros.\n# define GTEST_SNPRINTF_(buffer, size, format, ...) \\\n     _snprintf_s(buffer, size, size, format, __VA_ARGS__)\n#elif defined(_MSC_VER)\n// Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't\n// complain about _snprintf.\n# define GTEST_SNPRINTF_ _snprintf\n#else\n# define GTEST_SNPRINTF_ snprintf\n#endif\n\n// The maximum number a BiggestInt can represent.  This definition\n// works no matter BiggestInt is represented in one's complement or\n// two's complement.\n//\n// We cannot rely on numeric_limits in STL, as __int64 and long long\n// are not part of standard C++ and numeric_limits doesn't need to be\n// defined for them.\nconst BiggestInt kMaxBiggestInt =\n    ~(static_cast<BiggestInt>(1) << (8*sizeof(BiggestInt) - 1));\n\n// This template class serves as a compile-time function from size to\n// type.  It maps a size in bytes to a primitive type with that\n// size. e.g.\n//\n//   TypeWithSize<4>::UInt\n//\n// is typedef-ed to be unsigned int (unsigned integer made up of 4\n// bytes).\n//\n// Such functionality should belong to STL, but I cannot find it\n// there.\n//\n// Google Test uses this class in the implementation of floating-point\n// comparison.\n//\n// For now it only handles UInt (unsigned int) as that's all Google Test\n// needs.  Other types can be easily added in the future if need\n// arises.\ntemplate <size_t size>\nclass TypeWithSize {\n public:\n  // This prevents the user from using TypeWithSize<N> with incorrect\n  // values of N.\n  typedef void UInt;\n};\n\n// The specialization for size 4.\ntemplate <>\nclass TypeWithSize<4> {\n public:\n  // unsigned int has size 4 in both gcc and MSVC.\n  //\n  // As base/basictypes.h doesn't compile on Windows, we cannot use\n  // uint32, uint64, and etc here.\n  typedef int Int;\n  typedef unsigned int UInt;\n};\n\n// The specialization for size 8.\ntemplate <>\nclass TypeWithSize<8> {\n public:\n#if GTEST_OS_WINDOWS\n  typedef __int64 Int;\n  typedef unsigned __int64 UInt;\n#else\n  typedef long long Int;  // NOLINT\n  typedef unsigned long long UInt;  // NOLINT\n#endif  // GTEST_OS_WINDOWS\n};\n\n// Integer types of known sizes.\ntypedef TypeWithSize<4>::Int Int32;\ntypedef TypeWithSize<4>::UInt UInt32;\ntypedef TypeWithSize<8>::Int Int64;\ntypedef TypeWithSize<8>::UInt UInt64;\ntypedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.\n\n// Utilities for command line flags and environment variables.\n\n// Macro for referencing flags.\n#if !defined(GTEST_FLAG)\n# define GTEST_FLAG(name) FLAGS_gtest_##name\n#endif  // !defined(GTEST_FLAG)\n\n#if !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)\n# define GTEST_USE_OWN_FLAGFILE_FLAG_ 1\n#endif  // !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)\n\n#if !defined(GTEST_DECLARE_bool_)\n# define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver\n\n// Macros for declaring flags.\n# define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)\n# define GTEST_DECLARE_int32_(name) \\\n    GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)\n# define GTEST_DECLARE_string_(name) \\\n    GTEST_API_ extern ::std::string GTEST_FLAG(name)\n\n// Macros for defining flags.\n# define GTEST_DEFINE_bool_(name, default_val, doc) \\\n    GTEST_API_ bool GTEST_FLAG(name) = (default_val)\n# define GTEST_DEFINE_int32_(name, default_val, doc) \\\n    GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val)\n# define GTEST_DEFINE_string_(name, default_val, doc) \\\n    GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)\n\n#endif  // !defined(GTEST_DECLARE_bool_)\n\n// Thread annotations\n#if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)\n# define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)\n# define GTEST_LOCK_EXCLUDED_(locks)\n#endif  // !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)\n\n// Parses 'str' for a 32-bit signed integer.  If successful, writes the result\n// to *value and returns true; otherwise leaves *value unchanged and returns\n// false.\n// FIXME: Find a better way to refactor flag and environment parsing\n// out of both gtest-port.cc and gtest.cc to avoid exporting this utility\n// function.\nbool ParseInt32(const Message& src_text, const char* str, Int32* value);\n\n// Parses a bool/Int32/string from the environment variable\n// corresponding to the given Google Test flag.\nbool BoolFromGTestEnv(const char* flag, bool default_val);\nGTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);\nstd::string OutputFlagAlsoCheckEnvVar();\nconst char* StringFromGTestEnv(const char* flag, const char* default_val);\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_\n\n#if GTEST_OS_LINUX\n# include <stdlib.h>\n# include <sys/types.h>\n# include <sys/wait.h>\n# include <unistd.h>\n#endif  // GTEST_OS_LINUX\n\n#if GTEST_HAS_EXCEPTIONS\n# include <stdexcept>\n#endif\n\n#include <ctype.h>\n#include <float.h>\n#include <string.h>\n#include <iomanip>\n#include <limits>\n#include <map>\n#include <set>\n#include <string>\n#include <vector>\n\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n//\n// The Google C++ Testing and Mocking Framework (Google Test)\n//\n// This header file defines the Message class.\n//\n// IMPORTANT NOTE: Due to limitation of the C++ language, we have to\n// leave some internal implementation details in this header file.\n// They are clearly marked by comments like this:\n//\n//   // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n//\n// Such code is NOT meant to be used by a user directly, and is subject\n// to CHANGE WITHOUT NOTICE.  Therefore DO NOT DEPEND ON IT in a user\n// program!\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_\n#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_\n\n#include <limits>\n\n\nGTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \\\n/* class A needs to have dll-interface to be used by clients of class B */)\n\n// Ensures that there is at least one operator<< in the global namespace.\n// See Message& operator<<(...) below for why.\nvoid operator<<(const testing::internal::Secret&, int);\n\nnamespace testing {\n\n// The Message class works like an ostream repeater.\n//\n// Typical usage:\n//\n//   1. You stream a bunch of values to a Message object.\n//      It will remember the text in a stringstream.\n//   2. Then you stream the Message object to an ostream.\n//      This causes the text in the Message to be streamed\n//      to the ostream.\n//\n// For example;\n//\n//   testing::Message foo;\n//   foo << 1 << \" != \" << 2;\n//   std::cout << foo;\n//\n// will print \"1 != 2\".\n//\n// Message is not intended to be inherited from.  In particular, its\n// destructor is not virtual.\n//\n// Note that stringstream behaves differently in gcc and in MSVC.  You\n// can stream a NULL char pointer to it in the former, but not in the\n// latter (it causes an access violation if you do).  The Message\n// class hides this difference by treating a NULL char pointer as\n// \"(null)\".\nclass GTEST_API_ Message {\n private:\n  // The type of basic IO manipulators (endl, ends, and flush) for\n  // narrow streams.\n  typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);\n\n public:\n  // Constructs an empty Message.\n  Message();\n\n  // Copy constructor.\n  Message(const Message& msg) : ss_(new ::std::stringstream) {  // NOLINT\n    *ss_ << msg.GetString();\n  }\n\n  // Constructs a Message from a C-string.\n  explicit Message(const char* str) : ss_(new ::std::stringstream) {\n    *ss_ << str;\n  }\n\n#if GTEST_OS_SYMBIAN\n  // Streams a value (either a pointer or not) to this object.\n  template <typename T>\n  inline Message& operator <<(const T& value) {\n    StreamHelper(typename internal::is_pointer<T>::type(), value);\n    return *this;\n  }\n#else\n  // Streams a non-pointer value to this object.\n  template <typename T>\n  inline Message& operator <<(const T& val) {\n    // Some libraries overload << for STL containers.  These\n    // overloads are defined in the global namespace instead of ::std.\n    //\n    // C++'s symbol lookup rule (i.e. Koenig lookup) says that these\n    // overloads are visible in either the std namespace or the global\n    // namespace, but not other namespaces, including the testing\n    // namespace which Google Test's Message class is in.\n    //\n    // To allow STL containers (and other types that has a << operator\n    // defined in the global namespace) to be used in Google Test\n    // assertions, testing::Message must access the custom << operator\n    // from the global namespace.  With this using declaration,\n    // overloads of << defined in the global namespace and those\n    // visible via Koenig lookup are both exposed in this function.\n    using ::operator <<;\n    *ss_ << val;\n    return *this;\n  }\n\n  // Streams a pointer value to this object.\n  //\n  // This function is an overload of the previous one.  When you\n  // stream a pointer to a Message, this definition will be used as it\n  // is more specialized.  (The C++ Standard, section\n  // [temp.func.order].)  If you stream a non-pointer, then the\n  // previous definition will be used.\n  //\n  // The reason for this overload is that streaming a NULL pointer to\n  // ostream is undefined behavior.  Depending on the compiler, you\n  // may get \"0\", \"(nil)\", \"(null)\", or an access violation.  To\n  // ensure consistent result across compilers, we always treat NULL\n  // as \"(null)\".\n  template <typename T>\n  inline Message& operator <<(T* const& pointer) {  // NOLINT\n    if (pointer == NULL) {\n      *ss_ << \"(null)\";\n    } else {\n      *ss_ << pointer;\n    }\n    return *this;\n  }\n#endif  // GTEST_OS_SYMBIAN\n\n  // Since the basic IO manipulators are overloaded for both narrow\n  // and wide streams, we have to provide this specialized definition\n  // of operator <<, even though its body is the same as the\n  // templatized version above.  Without this definition, streaming\n  // endl or other basic IO manipulators to Message will confuse the\n  // compiler.\n  Message& operator <<(BasicNarrowIoManip val) {\n    *ss_ << val;\n    return *this;\n  }\n\n  // Instead of 1/0, we want to see true/false for bool values.\n  Message& operator <<(bool b) {\n    return *this << (b ? \"true\" : \"false\");\n  }\n\n  // These two overloads allow streaming a wide C string to a Message\n  // using the UTF-8 encoding.\n  Message& operator <<(const wchar_t* wide_c_str);\n  Message& operator <<(wchar_t* wide_c_str);\n\n#if GTEST_HAS_STD_WSTRING\n  // Converts the given wide string to a narrow string using the UTF-8\n  // encoding, and streams the result to this Message object.\n  Message& operator <<(const ::std::wstring& wstr);\n#endif  // GTEST_HAS_STD_WSTRING\n\n#if GTEST_HAS_GLOBAL_WSTRING\n  // Converts the given wide string to a narrow string using the UTF-8\n  // encoding, and streams the result to this Message object.\n  Message& operator <<(const ::wstring& wstr);\n#endif  // GTEST_HAS_GLOBAL_WSTRING\n\n  // Gets the text streamed to this object so far as an std::string.\n  // Each '\\0' character in the buffer is replaced with \"\\\\0\".\n  //\n  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n  std::string GetString() const;\n\n private:\n#if GTEST_OS_SYMBIAN\n  // These are needed as the Nokia Symbian Compiler cannot decide between\n  // const T& and const T* in a function template. The Nokia compiler _can_\n  // decide between class template specializations for T and T*, so a\n  // tr1::type_traits-like is_pointer works, and we can overload on that.\n  template <typename T>\n  inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) {\n    if (pointer == NULL) {\n      *ss_ << \"(null)\";\n    } else {\n      *ss_ << pointer;\n    }\n  }\n  template <typename T>\n  inline void StreamHelper(internal::false_type /*is_pointer*/,\n                           const T& value) {\n    // See the comments in Message& operator <<(const T&) above for why\n    // we need this using statement.\n    using ::operator <<;\n    *ss_ << value;\n  }\n#endif  // GTEST_OS_SYMBIAN\n\n  // We'll hold the text streamed to this object here.\n  const internal::scoped_ptr< ::std::stringstream> ss_;\n\n  // We declare (but don't implement) this to prevent the compiler\n  // from implementing the assignment operator.\n  void operator=(const Message&);\n};\n\n// Streams a Message to an ostream.\ninline std::ostream& operator <<(std::ostream& os, const Message& sb) {\n  return os << sb.GetString();\n}\n\nnamespace internal {\n\n// Converts a streamable value to an std::string.  A NULL pointer is\n// converted to \"(null)\".  When the input value is a ::string,\n// ::std::string, ::wstring, or ::std::wstring object, each NUL\n// character in it is replaced with \"\\\\0\".\ntemplate <typename T>\nstd::string StreamableToString(const T& streamable) {\n  return (Message() << streamable).GetString();\n}\n\n}  // namespace internal\n}  // namespace testing\n\nGTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_\n// Copyright 2008, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Google Test filepath utilities\n//\n// This header file declares classes and functions used internally by\n// Google Test.  They are subject to change without notice.\n//\n// This file is #included in gtest/internal/gtest-internal.h.\n// Do not include this header file separately!\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_\n\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// The Google C++ Testing and Mocking Framework (Google Test)\n//\n// This header file declares the String class and functions used internally by\n// Google Test.  They are subject to change without notice. They should not used\n// by code external to Google Test.\n//\n// This header file is #included by gtest-internal.h.\n// It should not be #included by other files.\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_\n\n#ifdef __BORLANDC__\n// string.h is not guaranteed to provide strcpy on C++ Builder.\n# include <mem.h>\n#endif\n\n#include <string.h>\n#include <string>\n\n\nnamespace testing {\nnamespace internal {\n\n// String - an abstract class holding static string utilities.\nclass GTEST_API_ String {\n public:\n  // Static utility methods\n\n  // Clones a 0-terminated C string, allocating memory using new.  The\n  // caller is responsible for deleting the return value using\n  // delete[].  Returns the cloned string, or NULL if the input is\n  // NULL.\n  //\n  // This is different from strdup() in string.h, which allocates\n  // memory using malloc().\n  static const char* CloneCString(const char* c_str);\n\n#if GTEST_OS_WINDOWS_MOBILE\n  // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be\n  // able to pass strings to Win32 APIs on CE we need to convert them\n  // to 'Unicode', UTF-16.\n\n  // Creates a UTF-16 wide string from the given ANSI string, allocating\n  // memory using new. The caller is responsible for deleting the return\n  // value using delete[]. Returns the wide string, or NULL if the\n  // input is NULL.\n  //\n  // The wide string is created using the ANSI codepage (CP_ACP) to\n  // match the behaviour of the ANSI versions of Win32 calls and the\n  // C runtime.\n  static LPCWSTR AnsiToUtf16(const char* c_str);\n\n  // Creates an ANSI string from the given wide string, allocating\n  // memory using new. The caller is responsible for deleting the return\n  // value using delete[]. Returns the ANSI string, or NULL if the\n  // input is NULL.\n  //\n  // The returned string is created using the ANSI codepage (CP_ACP) to\n  // match the behaviour of the ANSI versions of Win32 calls and the\n  // C runtime.\n  static const char* Utf16ToAnsi(LPCWSTR utf16_str);\n#endif\n\n  // Compares two C strings.  Returns true iff they have the same content.\n  //\n  // Unlike strcmp(), this function can handle NULL argument(s).  A\n  // NULL C string is considered different to any non-NULL C string,\n  // including the empty string.\n  static bool CStringEquals(const char* lhs, const char* rhs);\n\n  // Converts a wide C string to a String using the UTF-8 encoding.\n  // NULL will be converted to \"(null)\".  If an error occurred during\n  // the conversion, \"(failed to convert from wide string)\" is\n  // returned.\n  static std::string ShowWideCString(const wchar_t* wide_c_str);\n\n  // Compares two wide C strings.  Returns true iff they have the same\n  // content.\n  //\n  // Unlike wcscmp(), this function can handle NULL argument(s).  A\n  // NULL C string is considered different to any non-NULL C string,\n  // including the empty string.\n  static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);\n\n  // Compares two C strings, ignoring case.  Returns true iff they\n  // have the same content.\n  //\n  // Unlike strcasecmp(), this function can handle NULL argument(s).\n  // A NULL C string is considered different to any non-NULL C string,\n  // including the empty string.\n  static bool CaseInsensitiveCStringEquals(const char* lhs,\n                                           const char* rhs);\n\n  // Compares two wide C strings, ignoring case.  Returns true iff they\n  // have the same content.\n  //\n  // Unlike wcscasecmp(), this function can handle NULL argument(s).\n  // A NULL C string is considered different to any non-NULL wide C string,\n  // including the empty string.\n  // NB: The implementations on different platforms slightly differ.\n  // On windows, this method uses _wcsicmp which compares according to LC_CTYPE\n  // environment variable. On GNU platform this method uses wcscasecmp\n  // which compares according to LC_CTYPE category of the current locale.\n  // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the\n  // current locale.\n  static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,\n                                               const wchar_t* rhs);\n\n  // Returns true iff the given string ends with the given suffix, ignoring\n  // case. Any string is considered to end with an empty suffix.\n  static bool EndsWithCaseInsensitive(\n      const std::string& str, const std::string& suffix);\n\n  // Formats an int value as \"%02d\".\n  static std::string FormatIntWidth2(int value);  // \"%02d\" for width == 2\n\n  // Formats an int value as \"%X\".\n  static std::string FormatHexInt(int value);\n\n  // Formats a byte as \"%02X\".\n  static std::string FormatByte(unsigned char value);\n\n private:\n  String();  // Not meant to be instantiated.\n};  // class String\n\n// Gets the content of the stringstream's buffer as an std::string.  Each '\\0'\n// character in the buffer is replaced with \"\\\\0\".\nGTEST_API_ std::string StringStreamToString(::std::stringstream* stream);\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_\n\nGTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \\\n/* class A needs to have dll-interface to be used by clients of class B */)\n\nnamespace testing {\nnamespace internal {\n\n// FilePath - a class for file and directory pathname manipulation which\n// handles platform-specific conventions (like the pathname separator).\n// Used for helper functions for naming files in a directory for xml output.\n// Except for Set methods, all methods are const or static, which provides an\n// \"immutable value object\" -- useful for peace of mind.\n// A FilePath with a value ending in a path separator (\"like/this/\") represents\n// a directory, otherwise it is assumed to represent a file. In either case,\n// it may or may not represent an actual file or directory in the file system.\n// Names are NOT checked for syntax correctness -- no checking for illegal\n// characters, malformed paths, etc.\n\nclass GTEST_API_ FilePath {\n public:\n  FilePath() : pathname_(\"\") { }\n  FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }\n\n  explicit FilePath(const std::string& pathname) : pathname_(pathname) {\n    Normalize();\n  }\n\n  FilePath& operator=(const FilePath& rhs) {\n    Set(rhs);\n    return *this;\n  }\n\n  void Set(const FilePath& rhs) {\n    pathname_ = rhs.pathname_;\n  }\n\n  const std::string& string() const { return pathname_; }\n  const char* c_str() const { return pathname_.c_str(); }\n\n  // Returns the current working directory, or \"\" if unsuccessful.\n  static FilePath GetCurrentDir();\n\n  // Given directory = \"dir\", base_name = \"test\", number = 0,\n  // extension = \"xml\", returns \"dir/test.xml\". If number is greater\n  // than zero (e.g., 12), returns \"dir/test_12.xml\".\n  // On Windows platform, uses \\ as the separator rather than /.\n  static FilePath MakeFileName(const FilePath& directory,\n                               const FilePath& base_name,\n                               int number,\n                               const char* extension);\n\n  // Given directory = \"dir\", relative_path = \"test.xml\",\n  // returns \"dir/test.xml\".\n  // On Windows, uses \\ as the separator rather than /.\n  static FilePath ConcatPaths(const FilePath& directory,\n                              const FilePath& relative_path);\n\n  // Returns a pathname for a file that does not currently exist. The pathname\n  // will be directory/base_name.extension or\n  // directory/base_name_<number>.extension if directory/base_name.extension\n  // already exists. The number will be incremented until a pathname is found\n  // that does not already exist.\n  // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.\n  // There could be a race condition if two or more processes are calling this\n  // function at the same time -- they could both pick the same filename.\n  static FilePath GenerateUniqueFileName(const FilePath& directory,\n                                         const FilePath& base_name,\n                                         const char* extension);\n\n  // Returns true iff the path is \"\".\n  bool IsEmpty() const { return pathname_.empty(); }\n\n  // If input name has a trailing separator character, removes it and returns\n  // the name, otherwise return the name string unmodified.\n  // On Windows platform, uses \\ as the separator, other platforms use /.\n  FilePath RemoveTrailingPathSeparator() const;\n\n  // Returns a copy of the FilePath with the directory part removed.\n  // Example: FilePath(\"path/to/file\").RemoveDirectoryName() returns\n  // FilePath(\"file\"). If there is no directory part (\"just_a_file\"), it returns\n  // the FilePath unmodified. If there is no file part (\"just_a_dir/\") it\n  // returns an empty FilePath (\"\").\n  // On Windows platform, '\\' is the path separator, otherwise it is '/'.\n  FilePath RemoveDirectoryName() const;\n\n  // RemoveFileName returns the directory path with the filename removed.\n  // Example: FilePath(\"path/to/file\").RemoveFileName() returns \"path/to/\".\n  // If the FilePath is \"a_file\" or \"/a_file\", RemoveFileName returns\n  // FilePath(\"./\") or, on Windows, FilePath(\".\\\\\"). If the filepath does\n  // not have a file, like \"just/a/dir/\", it returns the FilePath unmodified.\n  // On Windows platform, '\\' is the path separator, otherwise it is '/'.\n  FilePath RemoveFileName() const;\n\n  // Returns a copy of the FilePath with the case-insensitive extension removed.\n  // Example: FilePath(\"dir/file.exe\").RemoveExtension(\"EXE\") returns\n  // FilePath(\"dir/file\"). If a case-insensitive extension is not\n  // found, returns a copy of the original FilePath.\n  FilePath RemoveExtension(const char* extension) const;\n\n  // Creates directories so that path exists. Returns true if successful or if\n  // the directories already exist; returns false if unable to create\n  // directories for any reason. Will also return false if the FilePath does\n  // not represent a directory (that is, it doesn't end with a path separator).\n  bool CreateDirectoriesRecursively() const;\n\n  // Create the directory so that path exists. Returns true if successful or\n  // if the directory already exists; returns false if unable to create the\n  // directory for any reason, including if the parent directory does not\n  // exist. Not named \"CreateDirectory\" because that's a macro on Windows.\n  bool CreateFolder() const;\n\n  // Returns true if FilePath describes something in the file-system,\n  // either a file, directory, or whatever, and that something exists.\n  bool FileOrDirectoryExists() const;\n\n  // Returns true if pathname describes a directory in the file-system\n  // that exists.\n  bool DirectoryExists() const;\n\n  // Returns true if FilePath ends with a path separator, which indicates that\n  // it is intended to represent a directory. Returns false otherwise.\n  // This does NOT check that a directory (or file) actually exists.\n  bool IsDirectory() const;\n\n  // Returns true if pathname describes a root directory. (Windows has one\n  // root directory per disk drive.)\n  bool IsRootDirectory() const;\n\n  // Returns true if pathname describes an absolute path.\n  bool IsAbsolutePath() const;\n\n private:\n  // Replaces multiple consecutive separators with a single separator.\n  // For example, \"bar///foo\" becomes \"bar/foo\". Does not eliminate other\n  // redundancies that might be in a pathname involving \".\" or \"..\".\n  //\n  // A pathname with multiple consecutive separators may occur either through\n  // user error or as a result of some scripts or APIs that generate a pathname\n  // with a trailing separator. On other platforms the same API or script\n  // may NOT generate a pathname with a trailing \"/\". Then elsewhere that\n  // pathname may have another \"/\" and pathname components added to it,\n  // without checking for the separator already being there.\n  // The script language and operating system may allow paths like \"foo//bar\"\n  // but some of the functions in FilePath will not handle that correctly. In\n  // particular, RemoveTrailingPathSeparator() only removes one separator, and\n  // it is called in CreateDirectoriesRecursively() assuming that it will change\n  // a pathname from directory syntax (trailing separator) to filename syntax.\n  //\n  // On Windows this method also replaces the alternate path separator '/' with\n  // the primary path separator '\\\\', so that for example \"bar\\\\/\\\\foo\" becomes\n  // \"bar\\\\foo\".\n\n  void Normalize();\n\n  // Returns a pointer to the last occurence of a valid path separator in\n  // the FilePath. On Windows, for example, both '/' and '\\' are valid path\n  // separators. Returns NULL if no path separator was found.\n  const char* FindLastPathSeparator() const;\n\n  std::string pathname_;\n};  // class FilePath\n\n}  // namespace internal\n}  // namespace testing\n\nGTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_\n// This file was GENERATED by command:\n//     pump.py gtest-type-util.h.pump\n// DO NOT EDIT BY HAND!!!\n\n// Copyright 2008 Google Inc.\n// All Rights Reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n// Type utilities needed for implementing typed and type-parameterized\n// tests.  This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!\n//\n// Currently we support at most 50 types in a list, and at most 50\n// type-parameterized tests in one type-parameterized test case.\n// Please contact googletestframework@googlegroups.com if you need\n// more.\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_\n\n\n// #ifdef __GNUC__ is too general here.  It is possible to use gcc without using\n// libstdc++ (which is where cxxabi.h comes from).\n# if GTEST_HAS_CXXABI_H_\n#  include <cxxabi.h>\n# elif defined(__HP_aCC)\n#  include <acxx_demangle.h>\n# endif  // GTEST_HASH_CXXABI_H_\n\nnamespace testing {\nnamespace internal {\n\n// Canonicalizes a given name with respect to the Standard C++ Library.\n// This handles removing the inline namespace within `std` that is\n// used by various standard libraries (e.g., `std::__1`).  Names outside\n// of namespace std are returned unmodified.\ninline std::string CanonicalizeForStdLibVersioning(std::string s) {\n  static const char prefix[] = \"std::__\";\n  if (s.compare(0, strlen(prefix), prefix) == 0) {\n    std::string::size_type end = s.find(\"::\", strlen(prefix));\n    if (end != s.npos) {\n      // Erase everything between the initial `std` and the second `::`.\n      s.erase(strlen(\"std\"), end - strlen(\"std\"));\n    }\n  }\n  return s;\n}\n\n// GetTypeName<T>() returns a human-readable name of type T.\n// NB: This function is also used in Google Mock, so don't move it inside of\n// the typed-test-only section below.\ntemplate <typename T>\nstd::string GetTypeName() {\n# if GTEST_HAS_RTTI\n\n  const char* const name = typeid(T).name();\n#  if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)\n  int status = 0;\n  // gcc's implementation of typeid(T).name() mangles the type name,\n  // so we have to demangle it.\n#   if GTEST_HAS_CXXABI_H_\n  using abi::__cxa_demangle;\n#   endif  // GTEST_HAS_CXXABI_H_\n  char* const readable_name = __cxa_demangle(name, 0, 0, &status);\n  const std::string name_str(status == 0 ? readable_name : name);\n  free(readable_name);\n  return CanonicalizeForStdLibVersioning(name_str);\n#  else\n  return name;\n#  endif  // GTEST_HAS_CXXABI_H_ || __HP_aCC\n\n# else\n\n  return \"<type>\";\n\n# endif  // GTEST_HAS_RTTI\n}\n\n#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P\n\n// AssertyTypeEq<T1, T2>::type is defined iff T1 and T2 are the same\n// type.  This can be used as a compile-time assertion to ensure that\n// two types are equal.\n\ntemplate <typename T1, typename T2>\nstruct AssertTypeEq;\n\ntemplate <typename T>\nstruct AssertTypeEq<T, T> {\n  typedef bool type;\n};\n\n// A unique type used as the default value for the arguments of class\n// template Types.  This allows us to simulate variadic templates\n// (e.g. Types<int>, Type<int, double>, and etc), which C++ doesn't\n// support directly.\nstruct None {};\n\n// The following family of struct and struct templates are used to\n// represent type lists.  In particular, TypesN<T1, T2, ..., TN>\n// represents a type list with N types (T1, T2, ..., and TN) in it.\n// Except for Types0, every struct in the family has two member types:\n// Head for the first type in the list, and Tail for the rest of the\n// list.\n\n// The empty type list.\nstruct Types0 {};\n\n// Type lists of length 1, 2, 3, and so on.\n\ntemplate <typename T1>\nstruct Types1 {\n  typedef T1 Head;\n  typedef Types0 Tail;\n};\ntemplate <typename T1, typename T2>\nstruct Types2 {\n  typedef T1 Head;\n  typedef Types1<T2> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3>\nstruct Types3 {\n  typedef T1 Head;\n  typedef Types2<T2, T3> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4>\nstruct Types4 {\n  typedef T1 Head;\n  typedef Types3<T2, T3, T4> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5>\nstruct Types5 {\n  typedef T1 Head;\n  typedef Types4<T2, T3, T4, T5> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6>\nstruct Types6 {\n  typedef T1 Head;\n  typedef Types5<T2, T3, T4, T5, T6> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7>\nstruct Types7 {\n  typedef T1 Head;\n  typedef Types6<T2, T3, T4, T5, T6, T7> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8>\nstruct Types8 {\n  typedef T1 Head;\n  typedef Types7<T2, T3, T4, T5, T6, T7, T8> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9>\nstruct Types9 {\n  typedef T1 Head;\n  typedef Types8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10>\nstruct Types10 {\n  typedef T1 Head;\n  typedef Types9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11>\nstruct Types11 {\n  typedef T1 Head;\n  typedef Types10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12>\nstruct Types12 {\n  typedef T1 Head;\n  typedef Types11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13>\nstruct Types13 {\n  typedef T1 Head;\n  typedef Types12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14>\nstruct Types14 {\n  typedef T1 Head;\n  typedef Types13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15>\nstruct Types15 {\n  typedef T1 Head;\n  typedef Types14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16>\nstruct Types16 {\n  typedef T1 Head;\n  typedef Types15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17>\nstruct Types17 {\n  typedef T1 Head;\n  typedef Types16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18>\nstruct Types18 {\n  typedef T1 Head;\n  typedef Types17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19>\nstruct Types19 {\n  typedef T1 Head;\n  typedef Types18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20>\nstruct Types20 {\n  typedef T1 Head;\n  typedef Types19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21>\nstruct Types21 {\n  typedef T1 Head;\n  typedef Types20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22>\nstruct Types22 {\n  typedef T1 Head;\n  typedef Types21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23>\nstruct Types23 {\n  typedef T1 Head;\n  typedef Types22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24>\nstruct Types24 {\n  typedef T1 Head;\n  typedef Types23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25>\nstruct Types25 {\n  typedef T1 Head;\n  typedef Types24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26>\nstruct Types26 {\n  typedef T1 Head;\n  typedef Types25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27>\nstruct Types27 {\n  typedef T1 Head;\n  typedef Types26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28>\nstruct Types28 {\n  typedef T1 Head;\n  typedef Types27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29>\nstruct Types29 {\n  typedef T1 Head;\n  typedef Types28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30>\nstruct Types30 {\n  typedef T1 Head;\n  typedef Types29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31>\nstruct Types31 {\n  typedef T1 Head;\n  typedef Types30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32>\nstruct Types32 {\n  typedef T1 Head;\n  typedef Types31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33>\nstruct Types33 {\n  typedef T1 Head;\n  typedef Types32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34>\nstruct Types34 {\n  typedef T1 Head;\n  typedef Types33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35>\nstruct Types35 {\n  typedef T1 Head;\n  typedef Types34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36>\nstruct Types36 {\n  typedef T1 Head;\n  typedef Types35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37>\nstruct Types37 {\n  typedef T1 Head;\n  typedef Types36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38>\nstruct Types38 {\n  typedef T1 Head;\n  typedef Types37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39>\nstruct Types39 {\n  typedef T1 Head;\n  typedef Types38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40>\nstruct Types40 {\n  typedef T1 Head;\n  typedef Types39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41>\nstruct Types41 {\n  typedef T1 Head;\n  typedef Types40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42>\nstruct Types42 {\n  typedef T1 Head;\n  typedef Types41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43>\nstruct Types43 {\n  typedef T1 Head;\n  typedef Types42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44>\nstruct Types44 {\n  typedef T1 Head;\n  typedef Types43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45>\nstruct Types45 {\n  typedef T1 Head;\n  typedef Types44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44, T45> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46>\nstruct Types46 {\n  typedef T1 Head;\n  typedef Types45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44, T45, T46> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47>\nstruct Types47 {\n  typedef T1 Head;\n  typedef Types46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44, T45, T46, T47> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48>\nstruct Types48 {\n  typedef T1 Head;\n  typedef Types47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44, T45, T46, T47, T48> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49>\nstruct Types49 {\n  typedef T1 Head;\n  typedef Types48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44, T45, T46, T47, T48, T49> Tail;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49, typename T50>\nstruct Types50 {\n  typedef T1 Head;\n  typedef Types49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n      T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n      T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n      T44, T45, T46, T47, T48, T49, T50> Tail;\n};\n\n\n}  // namespace internal\n\n// We don't want to require the users to write TypesN<...> directly,\n// as that would require them to count the length.  Types<...> is much\n// easier to write, but generates horrible messages when there is a\n// compiler error, as gcc insists on printing out each template\n// argument, even if it has the default value (this means Types<int>\n// will appear as Types<int, None, None, ..., None> in the compiler\n// errors).\n//\n// Our solution is to combine the best part of the two approaches: a\n// user would write Types<T1, ..., TN>, and Google Test will translate\n// that to TypesN<T1, ..., TN> internally to make error messages\n// readable.  The translation is done by the 'type' member of the\n// Types template.\ntemplate <typename T1 = internal::None, typename T2 = internal::None,\n    typename T3 = internal::None, typename T4 = internal::None,\n    typename T5 = internal::None, typename T6 = internal::None,\n    typename T7 = internal::None, typename T8 = internal::None,\n    typename T9 = internal::None, typename T10 = internal::None,\n    typename T11 = internal::None, typename T12 = internal::None,\n    typename T13 = internal::None, typename T14 = internal::None,\n    typename T15 = internal::None, typename T16 = internal::None,\n    typename T17 = internal::None, typename T18 = internal::None,\n    typename T19 = internal::None, typename T20 = internal::None,\n    typename T21 = internal::None, typename T22 = internal::None,\n    typename T23 = internal::None, typename T24 = internal::None,\n    typename T25 = internal::None, typename T26 = internal::None,\n    typename T27 = internal::None, typename T28 = internal::None,\n    typename T29 = internal::None, typename T30 = internal::None,\n    typename T31 = internal::None, typename T32 = internal::None,\n    typename T33 = internal::None, typename T34 = internal::None,\n    typename T35 = internal::None, typename T36 = internal::None,\n    typename T37 = internal::None, typename T38 = internal::None,\n    typename T39 = internal::None, typename T40 = internal::None,\n    typename T41 = internal::None, typename T42 = internal::None,\n    typename T43 = internal::None, typename T44 = internal::None,\n    typename T45 = internal::None, typename T46 = internal::None,\n    typename T47 = internal::None, typename T48 = internal::None,\n    typename T49 = internal::None, typename T50 = internal::None>\nstruct Types {\n  typedef internal::Types50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50> type;\n};\n\ntemplate <>\nstruct Types<internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types0 type;\n};\ntemplate <typename T1>\nstruct Types<T1, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types1<T1> type;\n};\ntemplate <typename T1, typename T2>\nstruct Types<T1, T2, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types2<T1, T2> type;\n};\ntemplate <typename T1, typename T2, typename T3>\nstruct Types<T1, T2, T3, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types3<T1, T2, T3> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4>\nstruct Types<T1, T2, T3, T4, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types4<T1, T2, T3, T4> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5>\nstruct Types<T1, T2, T3, T4, T5, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types5<T1, T2, T3, T4, T5> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6>\nstruct Types<T1, T2, T3, T4, T5, T6, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types6<T1, T2, T3, T4, T5, T6> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types7<T1, T2, T3, T4, T5, T6, T7> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types8<T1, T2, T3, T4, T5, T6, T7, T8> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, internal::None,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None, internal::None> {\n  typedef internal::Types43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None, internal::None> {\n  typedef internal::Types44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,\n    internal::None, internal::None, internal::None, internal::None,\n    internal::None> {\n  typedef internal::Types45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,\n    T46, internal::None, internal::None, internal::None, internal::None> {\n  typedef internal::Types46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45, T46> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,\n    T46, T47, internal::None, internal::None, internal::None> {\n  typedef internal::Types47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45, T46, T47> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,\n    T46, T47, T48, internal::None, internal::None> {\n  typedef internal::Types48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45, T46, T47, T48> type;\n};\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49>\nstruct Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,\n    T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30,\n    T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44, T45,\n    T46, T47, T48, T49, internal::None> {\n  typedef internal::Types49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45, T46, T47, T48, T49> type;\n};\n\nnamespace internal {\n\n# define GTEST_TEMPLATE_ template <typename T> class\n\n// The template \"selector\" struct TemplateSel<Tmpl> is used to\n// represent Tmpl, which must be a class template with one type\n// parameter, as a type.  TemplateSel<Tmpl>::Bind<T>::type is defined\n// as the type Tmpl<T>.  This allows us to actually instantiate the\n// template \"selected\" by TemplateSel<Tmpl>.\n//\n// This trick is necessary for simulating typedef for class templates,\n// which C++ doesn't support directly.\ntemplate <GTEST_TEMPLATE_ Tmpl>\nstruct TemplateSel {\n  template <typename T>\n  struct Bind {\n    typedef Tmpl<T> type;\n  };\n};\n\n# define GTEST_BIND_(TmplSel, T) \\\n  TmplSel::template Bind<T>::type\n\n// A unique struct template used as the default value for the\n// arguments of class template Templates.  This allows us to simulate\n// variadic templates (e.g. Templates<int>, Templates<int, double>,\n// and etc), which C++ doesn't support directly.\ntemplate <typename T>\nstruct NoneT {};\n\n// The following family of struct and struct templates are used to\n// represent template lists.  In particular, TemplatesN<T1, T2, ...,\n// TN> represents a list of N templates (T1, T2, ..., and TN).  Except\n// for Templates0, every struct in the family has two member types:\n// Head for the selector of the first template in the list, and Tail\n// for the rest of the list.\n\n// The empty template list.\nstruct Templates0 {};\n\n// Template lists of length 1, 2, 3, and so on.\n\ntemplate <GTEST_TEMPLATE_ T1>\nstruct Templates1 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates0 Tail;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>\nstruct Templates2 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates1<T2> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>\nstruct Templates3 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates2<T2, T3> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4>\nstruct Templates4 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates3<T2, T3, T4> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>\nstruct Templates5 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates4<T2, T3, T4, T5> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>\nstruct Templates6 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates5<T2, T3, T4, T5, T6> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7>\nstruct Templates7 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates6<T2, T3, T4, T5, T6, T7> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>\nstruct Templates8 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates7<T2, T3, T4, T5, T6, T7, T8> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>\nstruct Templates9 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates8<T2, T3, T4, T5, T6, T7, T8, T9> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10>\nstruct Templates10 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates9<T2, T3, T4, T5, T6, T7, T8, T9, T10> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>\nstruct Templates11 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates10<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>\nstruct Templates12 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates11<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13>\nstruct Templates13 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates12<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>\nstruct Templates14 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates13<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>\nstruct Templates15 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates14<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16>\nstruct Templates16 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates15<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>\nstruct Templates17 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates16<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>\nstruct Templates18 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates17<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19>\nstruct Templates19 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates18<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>\nstruct Templates20 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates19<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>\nstruct Templates21 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates20<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22>\nstruct Templates22 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates21<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>\nstruct Templates23 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates22<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>\nstruct Templates24 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates23<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25>\nstruct Templates25 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates24<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>\nstruct Templates26 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates25<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>\nstruct Templates27 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates26<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28>\nstruct Templates28 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates27<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>\nstruct Templates29 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates28<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>\nstruct Templates30 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates29<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31>\nstruct Templates31 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates30<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>\nstruct Templates32 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates31<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>\nstruct Templates33 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates32<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34>\nstruct Templates34 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates33<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>\nstruct Templates35 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates34<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>\nstruct Templates36 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates35<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37>\nstruct Templates37 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates36<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>\nstruct Templates38 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates37<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>\nstruct Templates39 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates38<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40>\nstruct Templates40 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates39<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>\nstruct Templates41 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates40<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>\nstruct Templates42 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates41<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43>\nstruct Templates43 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates42<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>\nstruct Templates44 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates43<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>\nstruct Templates45 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates44<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44, T45> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46>\nstruct Templates46 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates45<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44, T45, T46> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>\nstruct Templates47 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates46<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44, T45, T46, T47> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>\nstruct Templates48 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates47<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44, T45, T46, T47, T48> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,\n    GTEST_TEMPLATE_ T49>\nstruct Templates49 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates48<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44, T45, T46, T47, T48, T49> Tail;\n};\n\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,\n    GTEST_TEMPLATE_ T49, GTEST_TEMPLATE_ T50>\nstruct Templates50 {\n  typedef TemplateSel<T1> Head;\n  typedef Templates49<T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n      T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n      T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n      T43, T44, T45, T46, T47, T48, T49, T50> Tail;\n};\n\n\n// We don't want to require the users to write TemplatesN<...> directly,\n// as that would require them to count the length.  Templates<...> is much\n// easier to write, but generates horrible messages when there is a\n// compiler error, as gcc insists on printing out each template\n// argument, even if it has the default value (this means Templates<list>\n// will appear as Templates<list, NoneT, NoneT, ..., NoneT> in the compiler\n// errors).\n//\n// Our solution is to combine the best part of the two approaches: a\n// user would write Templates<T1, ..., TN>, and Google Test will translate\n// that to TemplatesN<T1, ..., TN> internally to make error messages\n// readable.  The translation is done by the 'type' member of the\n// Templates template.\ntemplate <GTEST_TEMPLATE_ T1 = NoneT, GTEST_TEMPLATE_ T2 = NoneT,\n    GTEST_TEMPLATE_ T3 = NoneT, GTEST_TEMPLATE_ T4 = NoneT,\n    GTEST_TEMPLATE_ T5 = NoneT, GTEST_TEMPLATE_ T6 = NoneT,\n    GTEST_TEMPLATE_ T7 = NoneT, GTEST_TEMPLATE_ T8 = NoneT,\n    GTEST_TEMPLATE_ T9 = NoneT, GTEST_TEMPLATE_ T10 = NoneT,\n    GTEST_TEMPLATE_ T11 = NoneT, GTEST_TEMPLATE_ T12 = NoneT,\n    GTEST_TEMPLATE_ T13 = NoneT, GTEST_TEMPLATE_ T14 = NoneT,\n    GTEST_TEMPLATE_ T15 = NoneT, GTEST_TEMPLATE_ T16 = NoneT,\n    GTEST_TEMPLATE_ T17 = NoneT, GTEST_TEMPLATE_ T18 = NoneT,\n    GTEST_TEMPLATE_ T19 = NoneT, GTEST_TEMPLATE_ T20 = NoneT,\n    GTEST_TEMPLATE_ T21 = NoneT, GTEST_TEMPLATE_ T22 = NoneT,\n    GTEST_TEMPLATE_ T23 = NoneT, GTEST_TEMPLATE_ T24 = NoneT,\n    GTEST_TEMPLATE_ T25 = NoneT, GTEST_TEMPLATE_ T26 = NoneT,\n    GTEST_TEMPLATE_ T27 = NoneT, GTEST_TEMPLATE_ T28 = NoneT,\n    GTEST_TEMPLATE_ T29 = NoneT, GTEST_TEMPLATE_ T30 = NoneT,\n    GTEST_TEMPLATE_ T31 = NoneT, GTEST_TEMPLATE_ T32 = NoneT,\n    GTEST_TEMPLATE_ T33 = NoneT, GTEST_TEMPLATE_ T34 = NoneT,\n    GTEST_TEMPLATE_ T35 = NoneT, GTEST_TEMPLATE_ T36 = NoneT,\n    GTEST_TEMPLATE_ T37 = NoneT, GTEST_TEMPLATE_ T38 = NoneT,\n    GTEST_TEMPLATE_ T39 = NoneT, GTEST_TEMPLATE_ T40 = NoneT,\n    GTEST_TEMPLATE_ T41 = NoneT, GTEST_TEMPLATE_ T42 = NoneT,\n    GTEST_TEMPLATE_ T43 = NoneT, GTEST_TEMPLATE_ T44 = NoneT,\n    GTEST_TEMPLATE_ T45 = NoneT, GTEST_TEMPLATE_ T46 = NoneT,\n    GTEST_TEMPLATE_ T47 = NoneT, GTEST_TEMPLATE_ T48 = NoneT,\n    GTEST_TEMPLATE_ T49 = NoneT, GTEST_TEMPLATE_ T50 = NoneT>\nstruct Templates {\n  typedef Templates50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44, T45, T46, T47, T48, T49, T50> type;\n};\n\ntemplate <>\nstruct Templates<NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT> {\n  typedef Templates0 type;\n};\ntemplate <GTEST_TEMPLATE_ T1>\nstruct Templates<T1, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT> {\n  typedef Templates1<T1> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2>\nstruct Templates<T1, T2, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT> {\n  typedef Templates2<T1, T2> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3>\nstruct Templates<T1, T2, T3, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates3<T1, T2, T3> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4>\nstruct Templates<T1, T2, T3, T4, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates4<T1, T2, T3, T4> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5>\nstruct Templates<T1, T2, T3, T4, T5, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates5<T1, T2, T3, T4, T5> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6>\nstruct Templates<T1, T2, T3, T4, T5, T6, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates6<T1, T2, T3, T4, T5, T6> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates7<T1, T2, T3, T4, T5, T6, T7> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates8<T1, T2, T3, T4, T5, T6, T7, T8> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates9<T1, T2, T3, T4, T5, T6, T7, T8, T9> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT> {\n  typedef Templates22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT> {\n  typedef Templates23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT> {\n  typedef Templates24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT> {\n  typedef Templates25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT> {\n  typedef Templates26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT> {\n  typedef Templates27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT> {\n  typedef Templates28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT> {\n  typedef Templates29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, NoneT, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, NoneT, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, NoneT, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, NoneT, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, NoneT,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    NoneT, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    T45, NoneT, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44, T45> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    T45, T46, NoneT, NoneT, NoneT, NoneT> {\n  typedef Templates46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44, T45, T46> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    T45, T46, T47, NoneT, NoneT, NoneT> {\n  typedef Templates47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44, T45, T46, T47> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    T45, T46, T47, T48, NoneT, NoneT> {\n  typedef Templates48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44, T45, T46, T47, T48> type;\n};\ntemplate <GTEST_TEMPLATE_ T1, GTEST_TEMPLATE_ T2, GTEST_TEMPLATE_ T3,\n    GTEST_TEMPLATE_ T4, GTEST_TEMPLATE_ T5, GTEST_TEMPLATE_ T6,\n    GTEST_TEMPLATE_ T7, GTEST_TEMPLATE_ T8, GTEST_TEMPLATE_ T9,\n    GTEST_TEMPLATE_ T10, GTEST_TEMPLATE_ T11, GTEST_TEMPLATE_ T12,\n    GTEST_TEMPLATE_ T13, GTEST_TEMPLATE_ T14, GTEST_TEMPLATE_ T15,\n    GTEST_TEMPLATE_ T16, GTEST_TEMPLATE_ T17, GTEST_TEMPLATE_ T18,\n    GTEST_TEMPLATE_ T19, GTEST_TEMPLATE_ T20, GTEST_TEMPLATE_ T21,\n    GTEST_TEMPLATE_ T22, GTEST_TEMPLATE_ T23, GTEST_TEMPLATE_ T24,\n    GTEST_TEMPLATE_ T25, GTEST_TEMPLATE_ T26, GTEST_TEMPLATE_ T27,\n    GTEST_TEMPLATE_ T28, GTEST_TEMPLATE_ T29, GTEST_TEMPLATE_ T30,\n    GTEST_TEMPLATE_ T31, GTEST_TEMPLATE_ T32, GTEST_TEMPLATE_ T33,\n    GTEST_TEMPLATE_ T34, GTEST_TEMPLATE_ T35, GTEST_TEMPLATE_ T36,\n    GTEST_TEMPLATE_ T37, GTEST_TEMPLATE_ T38, GTEST_TEMPLATE_ T39,\n    GTEST_TEMPLATE_ T40, GTEST_TEMPLATE_ T41, GTEST_TEMPLATE_ T42,\n    GTEST_TEMPLATE_ T43, GTEST_TEMPLATE_ T44, GTEST_TEMPLATE_ T45,\n    GTEST_TEMPLATE_ T46, GTEST_TEMPLATE_ T47, GTEST_TEMPLATE_ T48,\n    GTEST_TEMPLATE_ T49>\nstruct Templates<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,\n    T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29,\n    T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43, T44,\n    T45, T46, T47, T48, T49, NoneT> {\n  typedef Templates49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n      T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n      T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n      T42, T43, T44, T45, T46, T47, T48, T49> type;\n};\n\n// The TypeList template makes it possible to use either a single type\n// or a Types<...> list in TYPED_TEST_CASE() and\n// INSTANTIATE_TYPED_TEST_CASE_P().\n\ntemplate <typename T>\nstruct TypeList {\n  typedef Types1<T> type;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49, typename T50>\nstruct TypeList<Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45, T46, T47, T48, T49, T50> > {\n  typedef typename Types<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n      T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n      T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n      T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>::type type;\n};\n\n#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_\n\n// Due to C++ preprocessor weirdness, we need double indirection to\n// concatenate two tokens when one of them is __LINE__.  Writing\n//\n//   foo ## __LINE__\n//\n// will result in the token foo__LINE__, instead of foo followed by\n// the current line number.  For more details, see\n// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6\n#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)\n#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar\n\n// Stringifies its argument.\n#define GTEST_STRINGIFY_(name) #name\n\nclass ProtocolMessage;\nnamespace proto2 { class Message; }\n\nnamespace testing {\n\n// Forward declarations.\n\nclass AssertionResult;                 // Result of an assertion.\nclass Message;                         // Represents a failure message.\nclass Test;                            // Represents a test.\nclass TestInfo;                        // Information about a test.\nclass TestPartResult;                  // Result of a test part.\nclass UnitTest;                        // A collection of test cases.\n\ntemplate <typename T>\n::std::string PrintToString(const T& value);\n\nnamespace internal {\n\nstruct TraceInfo;                      // Information about a trace point.\nclass TestInfoImpl;                    // Opaque implementation of TestInfo\nclass UnitTestImpl;                    // Opaque implementation of UnitTest\n\n// The text used in failure messages to indicate the start of the\n// stack trace.\nGTEST_API_ extern const char kStackTraceMarker[];\n\n// Two overloaded helpers for checking at compile time whether an\n// expression is a null pointer literal (i.e. NULL or any 0-valued\n// compile-time integral constant).  Their return values have\n// different sizes, so we can use sizeof() to test which version is\n// picked by the compiler.  These helpers have no implementations, as\n// we only need their signatures.\n//\n// Given IsNullLiteralHelper(x), the compiler will pick the first\n// version if x can be implicitly converted to Secret*, and pick the\n// second version otherwise.  Since Secret is a secret and incomplete\n// type, the only expression a user can write that has type Secret* is\n// a null pointer literal.  Therefore, we know that x is a null\n// pointer literal if and only if the first version is picked by the\n// compiler.\nchar IsNullLiteralHelper(Secret* p);\nchar (&IsNullLiteralHelper(...))[2];  // NOLINT\n\n// A compile-time bool constant that is true if and only if x is a\n// null pointer literal (i.e. NULL or any 0-valued compile-time\n// integral constant).\n#ifdef GTEST_ELLIPSIS_NEEDS_POD_\n// We lose support for NULL detection where the compiler doesn't like\n// passing non-POD classes through ellipsis (...).\n# define GTEST_IS_NULL_LITERAL_(x) false\n#else\n# define GTEST_IS_NULL_LITERAL_(x) \\\n    (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1)\n#endif  // GTEST_ELLIPSIS_NEEDS_POD_\n\n// Appends the user-supplied message to the Google-Test-generated message.\nGTEST_API_ std::string AppendUserMessage(\n    const std::string& gtest_msg, const Message& user_msg);\n\n#if GTEST_HAS_EXCEPTIONS\n\nGTEST_DISABLE_MSC_WARNINGS_PUSH_(4275 \\\n/* an exported class was derived from a class that was not exported */)\n\n// This exception is thrown by (and only by) a failed Google Test\n// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions\n// are enabled).  We derive it from std::runtime_error, which is for\n// errors presumably detectable only at run time.  Since\n// std::runtime_error inherits from std::exception, many testing\n// frameworks know how to extract and print the message inside it.\nclass GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {\n public:\n  explicit GoogleTestFailureException(const TestPartResult& failure);\n};\n\nGTEST_DISABLE_MSC_WARNINGS_POP_()  //  4275\n\n#endif  // GTEST_HAS_EXCEPTIONS\n\nnamespace edit_distance {\n// Returns the optimal edits to go from 'left' to 'right'.\n// All edits cost the same, with replace having lower priority than\n// add/remove.\n// Simple implementation of the Wagner-Fischer algorithm.\n// See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm\nenum EditType { kMatch, kAdd, kRemove, kReplace };\nGTEST_API_ std::vector<EditType> CalculateOptimalEdits(\n    const std::vector<size_t>& left, const std::vector<size_t>& right);\n\n// Same as above, but the input is represented as strings.\nGTEST_API_ std::vector<EditType> CalculateOptimalEdits(\n    const std::vector<std::string>& left,\n    const std::vector<std::string>& right);\n\n// Create a diff of the input strings in Unified diff format.\nGTEST_API_ std::string CreateUnifiedDiff(const std::vector<std::string>& left,\n                                         const std::vector<std::string>& right,\n                                         size_t context = 2);\n\n}  // namespace edit_distance\n\n// Calculate the diff between 'left' and 'right' and return it in unified diff\n// format.\n// If not null, stores in 'total_line_count' the total number of lines found\n// in left + right.\nGTEST_API_ std::string DiffStrings(const std::string& left,\n                                   const std::string& right,\n                                   size_t* total_line_count);\n\n// Constructs and returns the message for an equality assertion\n// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.\n//\n// The first four parameters are the expressions used in the assertion\n// and their values, as strings.  For example, for ASSERT_EQ(foo, bar)\n// where foo is 5 and bar is 6, we have:\n//\n//   expected_expression: \"foo\"\n//   actual_expression:   \"bar\"\n//   expected_value:      \"5\"\n//   actual_value:        \"6\"\n//\n// The ignoring_case parameter is true iff the assertion is a\n// *_STRCASEEQ*.  When it's true, the string \" (ignoring case)\" will\n// be inserted into the message.\nGTEST_API_ AssertionResult EqFailure(const char* expected_expression,\n                                     const char* actual_expression,\n                                     const std::string& expected_value,\n                                     const std::string& actual_value,\n                                     bool ignoring_case);\n\n// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.\nGTEST_API_ std::string GetBoolAssertionFailureMessage(\n    const AssertionResult& assertion_result,\n    const char* expression_text,\n    const char* actual_predicate_value,\n    const char* expected_predicate_value);\n\n// This template class represents an IEEE floating-point number\n// (either single-precision or double-precision, depending on the\n// template parameters).\n//\n// The purpose of this class is to do more sophisticated number\n// comparison.  (Due to round-off error, etc, it's very unlikely that\n// two floating-points will be equal exactly.  Hence a naive\n// comparison by the == operation often doesn't work.)\n//\n// Format of IEEE floating-point:\n//\n//   The most-significant bit being the leftmost, an IEEE\n//   floating-point looks like\n//\n//     sign_bit exponent_bits fraction_bits\n//\n//   Here, sign_bit is a single bit that designates the sign of the\n//   number.\n//\n//   For float, there are 8 exponent bits and 23 fraction bits.\n//\n//   For double, there are 11 exponent bits and 52 fraction bits.\n//\n//   More details can be found at\n//   http://en.wikipedia.org/wiki/IEEE_floating-point_standard.\n//\n// Template parameter:\n//\n//   RawType: the raw floating-point type (either float or double)\ntemplate <typename RawType>\nclass FloatingPoint {\n public:\n  // Defines the unsigned integer type that has the same size as the\n  // floating point number.\n  typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;\n\n  // Constants.\n\n  // # of bits in a number.\n  static const size_t kBitCount = 8*sizeof(RawType);\n\n  // # of fraction bits in a number.\n  static const size_t kFractionBitCount =\n    std::numeric_limits<RawType>::digits - 1;\n\n  // # of exponent bits in a number.\n  static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;\n\n  // The mask for the sign bit.\n  static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);\n\n  // The mask for the fraction bits.\n  static const Bits kFractionBitMask =\n    ~static_cast<Bits>(0) >> (kExponentBitCount + 1);\n\n  // The mask for the exponent bits.\n  static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);\n\n  // How many ULP's (Units in the Last Place) we want to tolerate when\n  // comparing two numbers.  The larger the value, the more error we\n  // allow.  A 0 value means that two numbers must be exactly the same\n  // to be considered equal.\n  //\n  // The maximum error of a single floating-point operation is 0.5\n  // units in the last place.  On Intel CPU's, all floating-point\n  // calculations are done with 80-bit precision, while double has 64\n  // bits.  Therefore, 4 should be enough for ordinary use.\n  //\n  // See the following article for more details on ULP:\n  // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/\n  static const size_t kMaxUlps = 4;\n\n  // Constructs a FloatingPoint from a raw floating-point number.\n  //\n  // On an Intel CPU, passing a non-normalized NAN (Not a Number)\n  // around may change its bits, although the new value is guaranteed\n  // to be also a NAN.  Therefore, don't expect this constructor to\n  // preserve the bits in x when x is a NAN.\n  explicit FloatingPoint(const RawType& x) { u_.value_ = x; }\n\n  // Static methods\n\n  // Reinterprets a bit pattern as a floating-point number.\n  //\n  // This function is needed to test the AlmostEquals() method.\n  static RawType ReinterpretBits(const Bits bits) {\n    FloatingPoint fp(0);\n    fp.u_.bits_ = bits;\n    return fp.u_.value_;\n  }\n\n  // Returns the floating-point number that represent positive infinity.\n  static RawType Infinity() {\n    return ReinterpretBits(kExponentBitMask);\n  }\n\n  // Returns the maximum representable finite floating-point number.\n  static RawType Max();\n\n  // Non-static methods\n\n  // Returns the bits that represents this number.\n  const Bits &bits() const { return u_.bits_; }\n\n  // Returns the exponent bits of this number.\n  Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }\n\n  // Returns the fraction bits of this number.\n  Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }\n\n  // Returns the sign bit of this number.\n  Bits sign_bit() const { return kSignBitMask & u_.bits_; }\n\n  // Returns true iff this is NAN (not a number).\n  bool is_nan() const {\n    // It's a NAN if the exponent bits are all ones and the fraction\n    // bits are not entirely zeros.\n    return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);\n  }\n\n  // Returns true iff this number is at most kMaxUlps ULP's away from\n  // rhs.  In particular, this function:\n  //\n  //   - returns false if either number is (or both are) NAN.\n  //   - treats really large numbers as almost equal to infinity.\n  //   - thinks +0.0 and -0.0 are 0 DLP's apart.\n  bool AlmostEquals(const FloatingPoint& rhs) const {\n    // The IEEE standard says that any comparison operation involving\n    // a NAN must return false.\n    if (is_nan() || rhs.is_nan()) return false;\n\n    return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)\n        <= kMaxUlps;\n  }\n\n private:\n  // The data type used to store the actual floating-point number.\n  union FloatingPointUnion {\n    RawType value_;  // The raw floating-point number.\n    Bits bits_;      // The bits that represent the number.\n  };\n\n  // Converts an integer from the sign-and-magnitude representation to\n  // the biased representation.  More precisely, let N be 2 to the\n  // power of (kBitCount - 1), an integer x is represented by the\n  // unsigned number x + N.\n  //\n  // For instance,\n  //\n  //   -N + 1 (the most negative number representable using\n  //          sign-and-magnitude) is represented by 1;\n  //   0      is represented by N; and\n  //   N - 1  (the biggest number representable using\n  //          sign-and-magnitude) is represented by 2N - 1.\n  //\n  // Read http://en.wikipedia.org/wiki/Signed_number_representations\n  // for more details on signed number representations.\n  static Bits SignAndMagnitudeToBiased(const Bits &sam) {\n    if (kSignBitMask & sam) {\n      // sam represents a negative number.\n      return ~sam + 1;\n    } else {\n      // sam represents a positive number.\n      return kSignBitMask | sam;\n    }\n  }\n\n  // Given two numbers in the sign-and-magnitude representation,\n  // returns the distance between them as an unsigned number.\n  static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,\n                                                     const Bits &sam2) {\n    const Bits biased1 = SignAndMagnitudeToBiased(sam1);\n    const Bits biased2 = SignAndMagnitudeToBiased(sam2);\n    return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);\n  }\n\n  FloatingPointUnion u_;\n};\n\n// We cannot use std::numeric_limits<T>::max() as it clashes with the max()\n// macro defined by <windows.h>.\ntemplate <>\ninline float FloatingPoint<float>::Max() { return FLT_MAX; }\ntemplate <>\ninline double FloatingPoint<double>::Max() { return DBL_MAX; }\n\n// Typedefs the instances of the FloatingPoint template class that we\n// care to use.\ntypedef FloatingPoint<float> Float;\ntypedef FloatingPoint<double> Double;\n\n// In order to catch the mistake of putting tests that use different\n// test fixture classes in the same test case, we need to assign\n// unique IDs to fixture classes and compare them.  The TypeId type is\n// used to hold such IDs.  The user should treat TypeId as an opaque\n// type: the only operation allowed on TypeId values is to compare\n// them for equality using the == operator.\ntypedef const void* TypeId;\n\ntemplate <typename T>\nclass TypeIdHelper {\n public:\n  // dummy_ must not have a const type.  Otherwise an overly eager\n  // compiler (e.g. MSVC 7.1 & 8.0) may try to merge\n  // TypeIdHelper<T>::dummy_ for different Ts as an \"optimization\".\n  static bool dummy_;\n};\n\ntemplate <typename T>\nbool TypeIdHelper<T>::dummy_ = false;\n\n// GetTypeId<T>() returns the ID of type T.  Different values will be\n// returned for different types.  Calling the function twice with the\n// same type argument is guaranteed to return the same ID.\ntemplate <typename T>\nTypeId GetTypeId() {\n  // The compiler is required to allocate a different\n  // TypeIdHelper<T>::dummy_ variable for each T used to instantiate\n  // the template.  Therefore, the address of dummy_ is guaranteed to\n  // be unique.\n  return &(TypeIdHelper<T>::dummy_);\n}\n\n// Returns the type ID of ::testing::Test.  Always call this instead\n// of GetTypeId< ::testing::Test>() to get the type ID of\n// ::testing::Test, as the latter may give the wrong result due to a\n// suspected linker bug when compiling Google Test as a Mac OS X\n// framework.\nGTEST_API_ TypeId GetTestTypeId();\n\n// Defines the abstract factory interface that creates instances\n// of a Test object.\nclass TestFactoryBase {\n public:\n  virtual ~TestFactoryBase() {}\n\n  // Creates a test instance to run. The instance is both created and destroyed\n  // within TestInfoImpl::Run()\n  virtual Test* CreateTest() = 0;\n\n protected:\n  TestFactoryBase() {}\n\n private:\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);\n};\n\n// This class provides implementation of TeastFactoryBase interface.\n// It is used in TEST and TEST_F macros.\ntemplate <class TestClass>\nclass TestFactoryImpl : public TestFactoryBase {\n public:\n  virtual Test* CreateTest() { return new TestClass; }\n};\n\n#if GTEST_OS_WINDOWS\n\n// Predicate-formatters for implementing the HRESULT checking macros\n// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}\n// We pass a long instead of HRESULT to avoid causing an\n// include dependency for the HRESULT type.\nGTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,\n                                            long hr);  // NOLINT\nGTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,\n                                            long hr);  // NOLINT\n\n#endif  // GTEST_OS_WINDOWS\n\n// Types of SetUpTestCase() and TearDownTestCase() functions.\ntypedef void (*SetUpTestCaseFunc)();\ntypedef void (*TearDownTestCaseFunc)();\n\nstruct CodeLocation {\n  CodeLocation(const std::string& a_file, int a_line)\n      : file(a_file), line(a_line) {}\n\n  std::string file;\n  int line;\n};\n\n// Creates a new TestInfo object and registers it with Google Test;\n// returns the created object.\n//\n// Arguments:\n//\n//   test_case_name:   name of the test case\n//   name:             name of the test\n//   type_param        the name of the test's type parameter, or NULL if\n//                     this is not a typed or a type-parameterized test.\n//   value_param       text representation of the test's value parameter,\n//                     or NULL if this is not a type-parameterized test.\n//   code_location:    code location where the test is defined\n//   fixture_class_id: ID of the test fixture class\n//   set_up_tc:        pointer to the function that sets up the test case\n//   tear_down_tc:     pointer to the function that tears down the test case\n//   factory:          pointer to the factory that creates a test object.\n//                     The newly created TestInfo instance will assume\n//                     ownership of the factory object.\nGTEST_API_ TestInfo* MakeAndRegisterTestInfo(\n    const char* test_case_name,\n    const char* name,\n    const char* type_param,\n    const char* value_param,\n    CodeLocation code_location,\n    TypeId fixture_class_id,\n    SetUpTestCaseFunc set_up_tc,\n    TearDownTestCaseFunc tear_down_tc,\n    TestFactoryBase* factory);\n\n// If *pstr starts with the given prefix, modifies *pstr to be right\n// past the prefix and returns true; otherwise leaves *pstr unchanged\n// and returns false.  None of pstr, *pstr, and prefix can be NULL.\nGTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);\n\n#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P\n\nGTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \\\n/* class A needs to have dll-interface to be used by clients of class B */)\n\n// State of the definition of a type-parameterized test case.\nclass GTEST_API_ TypedTestCasePState {\n public:\n  TypedTestCasePState() : registered_(false) {}\n\n  // Adds the given test name to defined_test_names_ and return true\n  // if the test case hasn't been registered; otherwise aborts the\n  // program.\n  bool AddTestName(const char* file, int line, const char* case_name,\n                   const char* test_name) {\n    if (registered_) {\n      fprintf(stderr, \"%s Test %s must be defined before \"\n              \"REGISTER_TYPED_TEST_CASE_P(%s, ...).\\n\",\n              FormatFileLocation(file, line).c_str(), test_name, case_name);\n      fflush(stderr);\n      posix::Abort();\n    }\n    registered_tests_.insert(\n        ::std::make_pair(test_name, CodeLocation(file, line)));\n    return true;\n  }\n\n  bool TestExists(const std::string& test_name) const {\n    return registered_tests_.count(test_name) > 0;\n  }\n\n  const CodeLocation& GetCodeLocation(const std::string& test_name) const {\n    RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);\n    GTEST_CHECK_(it != registered_tests_.end());\n    return it->second;\n  }\n\n  // Verifies that registered_tests match the test names in\n  // defined_test_names_; returns registered_tests if successful, or\n  // aborts the program otherwise.\n  const char* VerifyRegisteredTestNames(\n      const char* file, int line, const char* registered_tests);\n\n private:\n  typedef ::std::map<std::string, CodeLocation> RegisteredTestsMap;\n\n  bool registered_;\n  RegisteredTestsMap registered_tests_;\n};\n\nGTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251\n\n// Skips to the first non-space char after the first comma in 'str';\n// returns NULL if no comma is found in 'str'.\ninline const char* SkipComma(const char* str) {\n  const char* comma = strchr(str, ',');\n  if (comma == NULL) {\n    return NULL;\n  }\n  while (IsSpace(*(++comma))) {}\n  return comma;\n}\n\n// Returns the prefix of 'str' before the first comma in it; returns\n// the entire string if it contains no comma.\ninline std::string GetPrefixUntilComma(const char* str) {\n  const char* comma = strchr(str, ',');\n  return comma == NULL ? str : std::string(str, comma);\n}\n\n// Splits a given string on a given delimiter, populating a given\n// vector with the fields.\nvoid SplitString(const ::std::string& str, char delimiter,\n                 ::std::vector< ::std::string>* dest);\n\n// The default argument to the template below for the case when the user does\n// not provide a name generator.\nstruct DefaultNameGenerator {\n  template <typename T>\n  static std::string GetName(int i) {\n    return StreamableToString(i);\n  }\n};\n\ntemplate <typename Provided = DefaultNameGenerator>\nstruct NameGeneratorSelector {\n  typedef Provided type;\n};\n\ntemplate <typename NameGenerator>\nvoid GenerateNamesRecursively(Types0, std::vector<std::string>*, int) {}\n\ntemplate <typename NameGenerator, typename Types>\nvoid GenerateNamesRecursively(Types, std::vector<std::string>* result, int i) {\n  result->push_back(NameGenerator::template GetName<typename Types::Head>(i));\n  GenerateNamesRecursively<NameGenerator>(typename Types::Tail(), result,\n                                          i + 1);\n}\n\ntemplate <typename NameGenerator, typename Types>\nstd::vector<std::string> GenerateNames() {\n  std::vector<std::string> result;\n  GenerateNamesRecursively<NameGenerator>(Types(), &result, 0);\n  return result;\n}\n\n// TypeParameterizedTest<Fixture, TestSel, Types>::Register()\n// registers a list of type-parameterized tests with Google Test.  The\n// return value is insignificant - we just need to return something\n// such that we can call this function in a namespace scope.\n//\n// Implementation note: The GTEST_TEMPLATE_ macro declares a template\n// template parameter.  It's defined in gtest-type-util.h.\ntemplate <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>\nclass TypeParameterizedTest {\n public:\n  // 'index' is the index of the test in the type list 'Types'\n  // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,\n  // Types).  Valid values for 'index' are [0, N - 1] where N is the\n  // length of Types.\n  static bool Register(const char* prefix, const char* case_name,\n     const char* test_names, int index) {\n     typedef typename Types::Head Type;\n     typedef Fixture<Type> FixtureClass;\n     typedef typename GTEST_BIND_(TestSel, Type) TestClass;\n\n     // First, registers the first type-parameterized test in the type\n     // list.\n     MakeAndRegisterTestInfo(\n         (std::string(prefix) + (prefix[0] == '\\0' ? \"\" : \"/\") + case_name + \"/\"\n             + StreamableToString(index)).c_str(),\n         GetPrefixUntilComma(test_names).c_str(),\n         GetTypeName<Type>().c_str(),\n         NULL,  // No value parameter.\n         GetTypeId<FixtureClass>(),\n         TestClass::SetUpTestCase,\n         TestClass::TearDownTestCase,\n         new TestFactoryImpl<TestClass>);\n\n         // Next, recurses (at compile time) with the tail of the type list.\n         return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>\n             ::Register(prefix, case_name, test_names, index + 1);\n     }\n};\n\n\n// The base case for the compile time recursion.\ntemplate <GTEST_TEMPLATE_ Fixture, class TestSel>\nclass TypeParameterizedTest<Fixture, TestSel, Types0> {\n public:\n  static bool Register(const char* /*prefix*/, const CodeLocation&,\n                       const char* /*case_name*/, const char* /*test_names*/,\n                       int /*index*/,\n                       const std::vector<std::string>& =\n                           std::vector<std::string>() /*type_names*/) {\n    return true;\n  }\n};\n\n// TypeParameterizedTestCase<Fixture, Tests, Types>::Register()\n// registers *all combinations* of 'Tests' and 'Types' with Google\n// Test.  The return value is insignificant - we just need to return\n// something such that we can call this function in a namespace scope.\ntemplate <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>\nclass TypeParameterizedTestCase {\npublic:\n     static bool Register(const char* prefix, const char* case_name,\n         const char* test_names) {\n         typedef typename Tests::Head Head;\n\n         // First, register the first test in 'Test' for each type in 'Types'.\n         TypeParameterizedTest<Fixture, Head, Types>::Register(\n             prefix, case_name, test_names, 0);\n\n         // Next, recurses (at compile time) with the tail of the test list.\n         return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>\n             ::Register(prefix, case_name, SkipComma(test_names));\n     }\n};\n\n\n// The base case for the compile time recursion.\ntemplate <GTEST_TEMPLATE_ Fixture, typename Types>\nclass TypeParameterizedTestCase<Fixture, Templates0, Types> {\n public:\n  static bool Register(const char* /*prefix*/, const CodeLocation&,\n                       const TypedTestCasePState* /*state*/,\n                       const char* /*case_name*/, const char* /*test_names*/,\n                       const std::vector<std::string>& =\n                           std::vector<std::string>() /*type_names*/) {\n    return true;\n  }\n};\n\n#endif  // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P\n\n// Returns the current OS stack trace as an std::string.\n//\n// The maximum number of stack frames to be included is specified by\n// the gtest_stack_trace_depth flag.  The skip_count parameter\n// specifies the number of top frames to be skipped, which doesn't\n// count against the number of frames to be included.\n//\n// For example, if Foo() calls Bar(), which in turn calls\n// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in\n// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.\nGTEST_API_ std::string GetCurrentOsStackTraceExceptTop(\n    UnitTest* unit_test, int skip_count);\n\n// Helpers for suppressing warnings on unreachable code or constant\n// condition.\n\n// Always returns true.\nGTEST_API_ bool AlwaysTrue();\n\n// Always returns false.\ninline bool AlwaysFalse() { return !AlwaysTrue(); }\n\n// Helper for suppressing false warning from Clang on a const char*\n// variable declared in a conditional expression always being NULL in\n// the else branch.\nstruct GTEST_API_ ConstCharPtr {\n  ConstCharPtr(const char* str) : value(str) {}\n  operator bool() const { return true; }\n  const char* value;\n};\n\n// A simple Linear Congruential Generator for generating random\n// numbers with a uniform distribution.  Unlike rand() and srand(), it\n// doesn't use global state (and therefore can't interfere with user\n// code).  Unlike rand_r(), it's portable.  An LCG isn't very random,\n// but it's good enough for our purposes.\nclass GTEST_API_ Random {\n public:\n  static const UInt32 kMaxRange = 1u << 31;\n\n  explicit Random(UInt32 seed) : state_(seed) {}\n\n  void Reseed(UInt32 seed) { state_ = seed; }\n\n  // Generates a random number from [0, range).  Crashes if 'range' is\n  // 0 or greater than kMaxRange.\n  UInt32 Generate(UInt32 range);\n\n private:\n  UInt32 state_;\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);\n};\n\n// Defining a variable of type CompileAssertTypesEqual<T1, T2> will cause a\n// compiler error iff T1 and T2 are different types.\ntemplate <typename T1, typename T2>\nstruct CompileAssertTypesEqual;\n\ntemplate <typename T>\nstruct CompileAssertTypesEqual<T, T> {\n};\n\n// Removes the reference from a type if it is a reference type,\n// otherwise leaves it unchanged.  This is the same as\n// tr1::remove_reference, which is not widely available yet.\ntemplate <typename T>\nstruct RemoveReference { typedef T type; };  // NOLINT\ntemplate <typename T>\nstruct RemoveReference<T&> { typedef T type; };  // NOLINT\n\n// A handy wrapper around RemoveReference that works when the argument\n// T depends on template parameters.\n#define GTEST_REMOVE_REFERENCE_(T) \\\n    typename ::testing::internal::RemoveReference<T>::type\n\n// Removes const from a type if it is a const type, otherwise leaves\n// it unchanged.  This is the same as tr1::remove_const, which is not\n// widely available yet.\ntemplate <typename T>\nstruct RemoveConst { typedef T type; };  // NOLINT\ntemplate <typename T>\nstruct RemoveConst<const T> { typedef T type; };  // NOLINT\n\n// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above\n// definition to fail to remove the const in 'const int[3]' and 'const\n// char[3][4]'.  The following specialization works around the bug.\ntemplate <typename T, size_t N>\nstruct RemoveConst<const T[N]> {\n  typedef typename RemoveConst<T>::type type[N];\n};\n\n#if defined(_MSC_VER) && _MSC_VER < 1400\n// This is the only specialization that allows VC++ 7.1 to remove const in\n// 'const int[3] and 'const int[3][4]'.  However, it causes trouble with GCC\n// and thus needs to be conditionally compiled.\ntemplate <typename T, size_t N>\nstruct RemoveConst<T[N]> {\n  typedef typename RemoveConst<T>::type type[N];\n};\n#endif\n\n// A handy wrapper around RemoveConst that works when the argument\n// T depends on template parameters.\n#define GTEST_REMOVE_CONST_(T) \\\n    typename ::testing::internal::RemoveConst<T>::type\n\n// Turns const U&, U&, const U, and U all into U.\n#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \\\n    GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T))\n\n// ImplicitlyConvertible<From, To>::value is a compile-time bool\n// constant that's true iff type From can be implicitly converted to\n// type To.\ntemplate <typename From, typename To>\nclass ImplicitlyConvertible {\n private:\n  // We need the following helper functions only for their types.\n  // They have no implementations.\n\n  // MakeFrom() is an expression whose type is From.  We cannot simply\n  // use From(), as the type From may not have a public default\n  // constructor.\n  static typename AddReference<From>::type MakeFrom();\n\n  // These two functions are overloaded.  Given an expression\n  // Helper(x), the compiler will pick the first version if x can be\n  // implicitly converted to type To; otherwise it will pick the\n  // second version.\n  //\n  // The first version returns a value of size 1, and the second\n  // version returns a value of size 2.  Therefore, by checking the\n  // size of Helper(x), which can be done at compile time, we can tell\n  // which version of Helper() is used, and hence whether x can be\n  // implicitly converted to type To.\n  static char Helper(To);\n  static char (&Helper(...))[2];  // NOLINT\n\n  // We have to put the 'public' section after the 'private' section,\n  // or MSVC refuses to compile the code.\n public:\n#if defined(__BORLANDC__)\n  // C++Builder cannot use member overload resolution during template\n  // instantiation.  The simplest workaround is to use its C++0x type traits\n  // functions (C++Builder 2009 and above only).\n  static const bool value = __is_convertible(From, To);\n#else\n  // MSVC warns about implicitly converting from double to int for\n  // possible loss of data, so we need to temporarily disable the\n  // warning.\n  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)\n  static const bool value =\n      sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;\n  GTEST_DISABLE_MSC_WARNINGS_POP_()\n#endif  // __BORLANDC__\n};\ntemplate <typename From, typename To>\nconst bool ImplicitlyConvertible<From, To>::value;\n\n// IsAProtocolMessage<T>::value is a compile-time bool constant that's\n// true iff T is type ProtocolMessage, proto2::Message, or a subclass\n// of those.\ntemplate <typename T>\nstruct IsAProtocolMessage\n    : public bool_constant<\n  ImplicitlyConvertible<const T*, const ::ProtocolMessage*>::value ||\n  ImplicitlyConvertible<const T*, const ::proto2::Message*>::value> {\n};\n\n// When the compiler sees expression IsContainerTest<C>(0), if C is an\n// STL-style container class, the first overload of IsContainerTest\n// will be viable (since both C::iterator* and C::const_iterator* are\n// valid types and NULL can be implicitly converted to them).  It will\n// be picked over the second overload as 'int' is a perfect match for\n// the type of argument 0.  If C::iterator or C::const_iterator is not\n// a valid type, the first overload is not viable, and the second\n// overload will be picked.  Therefore, we can determine whether C is\n// a container class by checking the type of IsContainerTest<C>(0).\n// The value of the expression is insignificant.\n//\n// In C++11 mode we check the existence of a const_iterator and that an\n// iterator is properly implemented for the container.\n//\n// For pre-C++11 that we look for both C::iterator and C::const_iterator.\n// The reason is that C++ injects the name of a class as a member of the\n// class itself (e.g. you can refer to class iterator as either\n// 'iterator' or 'iterator::iterator').  If we look for C::iterator\n// only, for example, we would mistakenly think that a class named\n// iterator is an STL container.\n//\n// Also note that the simpler approach of overloading\n// IsContainerTest(typename C::const_iterator*) and\n// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.\ntypedef int IsContainer;\n#if GTEST_LANG_CXX11\ntemplate <class C,\n          class Iterator = decltype(::std::declval<const C&>().begin()),\n          class = decltype(::std::declval<const C&>().end()),\n          class = decltype(++::std::declval<Iterator&>()),\n          class = decltype(*::std::declval<Iterator>()),\n          class = typename C::const_iterator>\nIsContainer IsContainerTest(int /* dummy */) {\n  return 0;\n}\n#else\ntemplate <class C>\nIsContainer IsContainerTest(int /* dummy */,\n                            typename C::iterator* /* it */ = NULL,\n                            typename C::const_iterator* /* const_it */ = NULL) {\n  return 0;\n}\n#endif  // GTEST_LANG_CXX11\n\ntypedef char IsNotContainer;\ntemplate <class C>\nIsNotContainer IsContainerTest(long /* dummy */) { return '\\0'; }\n\n// Trait to detect whether a type T is a hash table.\n// The heuristic used is that the type contains an inner type `hasher` and does\n// not contain an inner type `reverse_iterator`.\n// If the container is iterable in reverse, then order might actually matter.\ntemplate <typename T>\nstruct IsHashTable {\n private:\n  template <typename U>\n  static char test(typename U::hasher*, typename U::reverse_iterator*);\n  template <typename U>\n  static int test(typename U::hasher*, ...);\n  template <typename U>\n  static char test(...);\n\n public:\n  static const bool value = sizeof(test<T>(0, 0)) == sizeof(int);\n};\n\ntemplate <typename T>\nconst bool IsHashTable<T>::value;\n\ntemplate<typename T>\nstruct VoidT {\n    typedef void value_type;\n};\n\ntemplate <typename T, typename = void>\nstruct HasValueType : false_type {};\ntemplate <typename T>\nstruct HasValueType<T, VoidT<typename T::value_type> > : true_type {\n};\n\ntemplate <typename C,\n          bool = sizeof(IsContainerTest<C>(0)) == sizeof(IsContainer),\n          bool = HasValueType<C>::value>\nstruct IsRecursiveContainerImpl;\n\ntemplate <typename C, bool HV>\nstruct IsRecursiveContainerImpl<C, false, HV> : public false_type {};\n\n// Since the IsRecursiveContainerImpl depends on the IsContainerTest we need to\n// obey the same inconsistencies as the IsContainerTest, namely check if\n// something is a container is relying on only const_iterator in C++11 and\n// is relying on both const_iterator and iterator otherwise\ntemplate <typename C>\nstruct IsRecursiveContainerImpl<C, true, false> : public false_type {};\n\ntemplate <typename C>\nstruct IsRecursiveContainerImpl<C, true, true> {\n  #if GTEST_LANG_CXX11\n  typedef typename IteratorTraits<typename C::const_iterator>::value_type\n      value_type;\n#else\n  typedef typename IteratorTraits<typename C::iterator>::value_type value_type;\n#endif\n  typedef is_same<value_type, C> type;\n};\n\n// IsRecursiveContainer<Type> is a unary compile-time predicate that\n// evaluates whether C is a recursive container type. A recursive container\n// type is a container type whose value_type is equal to the container type\n// itself. An example for a recursive container type is\n// boost::filesystem::path, whose iterator has a value_type that is equal to\n// boost::filesystem::path.\ntemplate <typename C>\nstruct IsRecursiveContainer : public IsRecursiveContainerImpl<C>::type {};\n\n// EnableIf<condition>::type is void when 'Cond' is true, and\n// undefined when 'Cond' is false.  To use SFINAE to make a function\n// overload only apply when a particular expression is true, add\n// \"typename EnableIf<expression>::type* = 0\" as the last parameter.\ntemplate<bool> struct EnableIf;\ntemplate<> struct EnableIf<true> { typedef void type; };  // NOLINT\n\n// Utilities for native arrays.\n\n// ArrayEq() compares two k-dimensional native arrays using the\n// elements' operator==, where k can be any integer >= 0.  When k is\n// 0, ArrayEq() degenerates into comparing a single pair of values.\n\ntemplate <typename T, typename U>\nbool ArrayEq(const T* lhs, size_t size, const U* rhs);\n\n// This generic version is used when k is 0.\ntemplate <typename T, typename U>\ninline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }\n\n// This overload is used when k >= 1.\ntemplate <typename T, typename U, size_t N>\ninline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {\n  return internal::ArrayEq(lhs, N, rhs);\n}\n\n// This helper reduces code bloat.  If we instead put its logic inside\n// the previous ArrayEq() function, arrays with different sizes would\n// lead to different copies of the template code.\ntemplate <typename T, typename U>\nbool ArrayEq(const T* lhs, size_t size, const U* rhs) {\n  for (size_t i = 0; i != size; i++) {\n    if (!internal::ArrayEq(lhs[i], rhs[i]))\n      return false;\n  }\n  return true;\n}\n\n// Finds the first element in the iterator range [begin, end) that\n// equals elem.  Element may be a native array type itself.\ntemplate <typename Iter, typename Element>\nIter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {\n  for (Iter it = begin; it != end; ++it) {\n    if (internal::ArrayEq(*it, elem))\n      return it;\n  }\n  return end;\n}\n\n// CopyArray() copies a k-dimensional native array using the elements'\n// operator=, where k can be any integer >= 0.  When k is 0,\n// CopyArray() degenerates into copying a single value.\n\ntemplate <typename T, typename U>\nvoid CopyArray(const T* from, size_t size, U* to);\n\n// This generic version is used when k is 0.\ntemplate <typename T, typename U>\ninline void CopyArray(const T& from, U* to) { *to = from; }\n\n// This overload is used when k >= 1.\ntemplate <typename T, typename U, size_t N>\ninline void CopyArray(const T(&from)[N], U(*to)[N]) {\n  internal::CopyArray(from, N, *to);\n}\n\n// This helper reduces code bloat.  If we instead put its logic inside\n// the previous CopyArray() function, arrays with different sizes\n// would lead to different copies of the template code.\ntemplate <typename T, typename U>\nvoid CopyArray(const T* from, size_t size, U* to) {\n  for (size_t i = 0; i != size; i++) {\n    internal::CopyArray(from[i], to + i);\n  }\n}\n\n// The relation between an NativeArray object (see below) and the\n// native array it represents.\n// We use 2 different structs to allow non-copyable types to be used, as long\n// as RelationToSourceReference() is passed.\nstruct RelationToSourceReference {};\nstruct RelationToSourceCopy {};\n\n// Adapts a native array to a read-only STL-style container.  Instead\n// of the complete STL container concept, this adaptor only implements\n// members useful for Google Mock's container matchers.  New members\n// should be added as needed.  To simplify the implementation, we only\n// support Element being a raw type (i.e. having no top-level const or\n// reference modifier).  It's the client's responsibility to satisfy\n// this requirement.  Element can be an array type itself (hence\n// multi-dimensional arrays are supported).\ntemplate <typename Element>\nclass NativeArray {\n public:\n  // STL-style container typedefs.\n  typedef Element value_type;\n  typedef Element* iterator;\n  typedef const Element* const_iterator;\n\n  // Constructs from a native array. References the source.\n  NativeArray(const Element* array, size_t count, RelationToSourceReference) {\n    InitRef(array, count);\n  }\n\n  // Constructs from a native array. Copies the source.\n  NativeArray(const Element* array, size_t count, RelationToSourceCopy) {\n    InitCopy(array, count);\n  }\n\n  // Copy constructor.\n  NativeArray(const NativeArray& rhs) {\n    (this->*rhs.clone_)(rhs.array_, rhs.size_);\n  }\n\n  ~NativeArray() {\n    if (clone_ != &NativeArray::InitRef)\n      delete[] array_;\n  }\n\n  // STL-style container methods.\n  size_t size() const { return size_; }\n  const_iterator begin() const { return array_; }\n  const_iterator end() const { return array_ + size_; }\n  bool operator==(const NativeArray& rhs) const {\n    return size() == rhs.size() &&\n        ArrayEq(begin(), size(), rhs.begin());\n  }\n\n private:\n  enum {\n    kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<\n        Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value\n  };\n\n  // Initializes this object with a copy of the input.\n  void InitCopy(const Element* array, size_t a_size) {\n    Element* const copy = new Element[a_size];\n    CopyArray(array, a_size, copy);\n    array_ = copy;\n    size_ = a_size;\n    clone_ = &NativeArray::InitCopy;\n  }\n\n  // Initializes this object with a reference of the input.\n  void InitRef(const Element* array, size_t a_size) {\n    array_ = array;\n    size_ = a_size;\n    clone_ = &NativeArray::InitRef;\n  }\n\n  const Element* array_;\n  size_t size_;\n  void (NativeArray::*clone_)(const Element*, size_t);\n\n  GTEST_DISALLOW_ASSIGN_(NativeArray);\n};\n\n}  // namespace internal\n}  // namespace testing\n\n#define GTEST_MESSAGE_AT_(file, line, message, result_type) \\\n  ::testing::internal::AssertHelper(result_type, file, line, message) \\\n    = ::testing::Message()\n\n#define GTEST_MESSAGE_(message, result_type) \\\n  GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)\n\n#define GTEST_FATAL_FAILURE_(message) \\\n  return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)\n\n#define GTEST_NONFATAL_FAILURE_(message) \\\n  GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)\n\n#define GTEST_SUCCESS_(message) \\\n  GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)\n\n// Suppress MSVC warning 4702 (unreachable code) for the code following\n// statement if it returns or throws (or doesn't return or throw in some\n// situations).\n#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \\\n  if (::testing::internal::AlwaysTrue()) { statement; }\n\n#define GTEST_TEST_THROW_(statement, expected_exception, fail) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (::testing::internal::ConstCharPtr gtest_msg = \"\") { \\\n    bool gtest_caught_expected = false; \\\n    try { \\\n      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n    } \\\n    catch (expected_exception const&) { \\\n      gtest_caught_expected = true; \\\n    } \\\n    catch (...) { \\\n      gtest_msg.value = \\\n          \"Expected: \" #statement \" throws an exception of type \" \\\n          #expected_exception \".\\n  Actual: it throws a different type.\"; \\\n      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \\\n    } \\\n    if (!gtest_caught_expected) { \\\n      gtest_msg.value = \\\n          \"Expected: \" #statement \" throws an exception of type \" \\\n          #expected_exception \".\\n  Actual: it throws nothing.\"; \\\n      goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \\\n    } \\\n  } else \\\n    GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \\\n      fail(gtest_msg.value)\n\n#define GTEST_TEST_NO_THROW_(statement, fail) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (::testing::internal::AlwaysTrue()) { \\\n    try { \\\n      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n    } \\\n    catch (...) { \\\n      goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \\\n    } \\\n  } else \\\n    GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \\\n      fail(\"Expected: \" #statement \" doesn't throw an exception.\\n\" \\\n           \"  Actual: it throws.\")\n\n#define GTEST_TEST_ANY_THROW_(statement, fail) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (::testing::internal::AlwaysTrue()) { \\\n    bool gtest_caught_any = false; \\\n    try { \\\n      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n    } \\\n    catch (...) { \\\n      gtest_caught_any = true; \\\n    } \\\n    if (!gtest_caught_any) { \\\n      goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \\\n    } \\\n  } else \\\n    GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \\\n      fail(\"Expected: \" #statement \" throws an exception.\\n\" \\\n           \"  Actual: it doesn't.\")\n\n\n// Implements Boolean test assertions such as EXPECT_TRUE. expression can be\n// either a boolean expression or an AssertionResult. text is a textual\n// represenation of expression as it was passed into the EXPECT_TRUE.\n#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (const ::testing::AssertionResult gtest_ar_ = \\\n      ::testing::AssertionResult(expression)) \\\n    ; \\\n  else \\\n    fail(::testing::internal::GetBoolAssertionFailureMessage(\\\n        gtest_ar_, text, #actual, #expected).c_str())\n\n#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (::testing::internal::AlwaysTrue()) { \\\n    ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \\\n    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n    if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \\\n      goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \\\n    } \\\n  } else \\\n    GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \\\n      fail(\"Expected: \" #statement \" doesn't generate new fatal \" \\\n           \"failures in the current thread.\\n\" \\\n           \"  Actual: it does.\")\n\n// Expands to the name of the class that implements the given test.\n#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \\\n  test_case_name##_##test_name##_Test\n\n// Helper macro for defining tests.\n#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\\\nclass GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\\\n public:\\\n  GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\\\n private:\\\n  virtual void TestBody();\\\n  static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\\\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(\\\n      GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\\\n};\\\n\\\n::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\\\n  ::test_info_ =\\\n    ::testing::internal::MakeAndRegisterTestInfo(\\\n        #test_case_name, #test_name, NULL, NULL, \\\n        ::testing::internal::CodeLocation(__FILE__, __LINE__), \\\n        (parent_id), \\\n        parent_class::SetUpTestCase, \\\n        parent_class::TearDownTestCase, \\\n        new ::testing::internal::TestFactoryImpl<\\\n            GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\\\nvoid GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n//\n// The Google C++ Testing and Mocking Framework (Google Test)\n//\n// This header file defines the public API for death tests.  It is\n// #included by gtest.h so a user doesn't need to include this\n// directly.\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_\n#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_\n\n// Copyright 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// The Google C++ Testing and Mocking Framework (Google Test)\n//\n// This header file defines internal utilities needed for implementing\n// death tests.  They are subject to change without notice.\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_\n\n\n#include <stdio.h>\n\nnamespace testing {\nnamespace internal {\n\nGTEST_DECLARE_string_(internal_run_death_test);\n\n// Names of the flags (needed for parsing Google Test flags).\nconst char kDeathTestStyleFlag[] = \"death_test_style\";\nconst char kDeathTestUseFork[] = \"death_test_use_fork\";\nconst char kInternalRunDeathTestFlag[] = \"internal_run_death_test\";\n\n#if GTEST_HAS_DEATH_TEST\n\nGTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \\\n/* class A needs to have dll-interface to be used by clients of class B */)\n\n// DeathTest is a class that hides much of the complexity of the\n// GTEST_DEATH_TEST_ macro.  It is abstract; its static Create method\n// returns a concrete class that depends on the prevailing death test\n// style, as defined by the --gtest_death_test_style and/or\n// --gtest_internal_run_death_test flags.\n\n// In describing the results of death tests, these terms are used with\n// the corresponding definitions:\n//\n// exit status:  The integer exit information in the format specified\n//               by wait(2)\n// exit code:    The integer code passed to exit(3), _exit(2), or\n//               returned from main()\nclass GTEST_API_ DeathTest {\n public:\n  // Create returns false if there was an error determining the\n  // appropriate action to take for the current death test; for example,\n  // if the gtest_death_test_style flag is set to an invalid value.\n  // The LastMessage method will return a more detailed message in that\n  // case.  Otherwise, the DeathTest pointer pointed to by the \"test\"\n  // argument is set.  If the death test should be skipped, the pointer\n  // is set to NULL; otherwise, it is set to the address of a new concrete\n  // DeathTest object that controls the execution of the current test.\n  static bool Create(const char* statement, const RE* regex,\n                     const char* file, int line, DeathTest** test);\n  DeathTest();\n  virtual ~DeathTest() { }\n\n  // A helper class that aborts a death test when it's deleted.\n  class ReturnSentinel {\n   public:\n    explicit ReturnSentinel(DeathTest* test) : test_(test) { }\n    ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }\n   private:\n    DeathTest* const test_;\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);\n  } GTEST_ATTRIBUTE_UNUSED_;\n\n  // An enumeration of possible roles that may be taken when a death\n  // test is encountered.  EXECUTE means that the death test logic should\n  // be executed immediately.  OVERSEE means that the program should prepare\n  // the appropriate environment for a child process to execute the death\n  // test, then wait for it to complete.\n  enum TestRole { OVERSEE_TEST, EXECUTE_TEST };\n\n  // An enumeration of the three reasons that a test might be aborted.\n  enum AbortReason {\n    TEST_ENCOUNTERED_RETURN_STATEMENT,\n    TEST_THREW_EXCEPTION,\n    TEST_DID_NOT_DIE\n  };\n\n  // Assumes one of the above roles.\n  virtual TestRole AssumeRole() = 0;\n\n  // Waits for the death test to finish and returns its status.\n  virtual int Wait() = 0;\n\n  // Returns true if the death test passed; that is, the test process\n  // exited during the test, its exit status matches a user-supplied\n  // predicate, and its stderr output matches a user-supplied regular\n  // expression.\n  // The user-supplied predicate may be a macro expression rather\n  // than a function pointer or functor, or else Wait and Passed could\n  // be combined.\n  virtual bool Passed(bool exit_status_ok) = 0;\n\n  // Signals that the death test did not die as expected.\n  virtual void Abort(AbortReason reason) = 0;\n\n  // Returns a human-readable outcome message regarding the outcome of\n  // the last death test.\n  static const char* LastMessage();\n\n  static void set_last_death_test_message(const std::string& message);\n\n private:\n  // A string containing a description of the outcome of the last death test.\n  static std::string last_death_test_message_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);\n};\n\nGTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251\n\n// Factory interface for death tests.  May be mocked out for testing.\nclass DeathTestFactory {\n public:\n  virtual ~DeathTestFactory() { }\n  virtual bool Create(const char* statement, const RE* regex,\n                      const char* file, int line, DeathTest** test) = 0;\n};\n\n// A concrete DeathTestFactory implementation for normal use.\nclass DefaultDeathTestFactory : public DeathTestFactory {\n public:\n  virtual bool Create(const char* statement, const RE* regex,\n                      const char* file, int line, DeathTest** test);\n};\n\n// Returns true if exit_status describes a process that was terminated\n// by a signal, or exited normally with a nonzero exit code.\nGTEST_API_ bool ExitedUnsuccessfully(int exit_status);\n\n// Traps C++ exceptions escaping statement and reports them as test\n// failures. Note that trapping SEH exceptions is not implemented here.\n# if GTEST_HAS_EXCEPTIONS\n#  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \\\n  try { \\\n    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n  } catch (const ::std::exception& gtest_exception) { \\\n    fprintf(\\\n        stderr, \\\n        \"\\n%s: Caught std::exception-derived exception escaping the \" \\\n        \"death test statement. Exception message: %s\\n\", \\\n        ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \\\n        gtest_exception.what()); \\\n    fflush(stderr); \\\n    death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \\\n  } catch (...) { \\\n    death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \\\n  }\n\n# else\n#  define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \\\n  GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)\n\n# endif\n\n// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,\n// ASSERT_EXIT*, and EXPECT_EXIT*.\n# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (::testing::internal::AlwaysTrue()) { \\\n    const ::testing::internal::RE& gtest_regex = (regex); \\\n    ::testing::internal::DeathTest* gtest_dt; \\\n    if (!::testing::internal::DeathTest::Create(#statement, &gtest_regex, \\\n        __FILE__, __LINE__, &gtest_dt)) { \\\n      goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \\\n    } \\\n    if (gtest_dt != NULL) { \\\n      ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \\\n          gtest_dt_ptr(gtest_dt); \\\n      switch (gtest_dt->AssumeRole()) { \\\n        case ::testing::internal::DeathTest::OVERSEE_TEST: \\\n          if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \\\n            goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \\\n          } \\\n          break; \\\n        case ::testing::internal::DeathTest::EXECUTE_TEST: { \\\n          ::testing::internal::DeathTest::ReturnSentinel \\\n              gtest_sentinel(gtest_dt); \\\n          GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \\\n          gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \\\n          break; \\\n        } \\\n        default: \\\n          break; \\\n      } \\\n    } \\\n  } else \\\n    GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \\\n      fail(::testing::internal::DeathTest::LastMessage())\n// The symbol \"fail\" here expands to something into which a message\n// can be streamed.\n\n// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in\n// NDEBUG mode. In this case we need the statements to be executed and the macro\n// must accept a streamed message even though the message is never printed.\n// The regex object is not evaluated, but it is used to prevent \"unused\"\n// warnings and to avoid an expression that doesn't compile in debug mode.\n#define GTEST_EXECUTE_STATEMENT_(statement, regex)             \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_                                \\\n  if (::testing::internal::AlwaysTrue()) {                     \\\n    GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n  } else if (!::testing::internal::AlwaysTrue()) {             \\\n    const ::testing::internal::RE& gtest_regex = (regex);      \\\n    static_cast<void>(gtest_regex);                            \\\n  } else                                                       \\\n    ::testing::Message()\n\n// A class representing the parsed contents of the\n// --gtest_internal_run_death_test flag, as it existed when\n// RUN_ALL_TESTS was called.\nclass InternalRunDeathTestFlag {\n public:\n  InternalRunDeathTestFlag(const std::string& a_file,\n                           int a_line,\n                           int an_index,\n                           int a_write_fd)\n      : file_(a_file), line_(a_line), index_(an_index),\n        write_fd_(a_write_fd) {}\n\n  ~InternalRunDeathTestFlag() {\n    if (write_fd_ >= 0)\n      posix::Close(write_fd_);\n  }\n\n  const std::string& file() const { return file_; }\n  int line() const { return line_; }\n  int index() const { return index_; }\n  int write_fd() const { return write_fd_; }\n\n private:\n  std::string file_;\n  int line_;\n  int index_;\n  int write_fd_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);\n};\n\n// Returns a newly created InternalRunDeathTestFlag object with fields\n// initialized from the GTEST_FLAG(internal_run_death_test) flag if\n// the flag is specified; otherwise returns NULL.\nInternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();\n\n#endif  // GTEST_HAS_DEATH_TEST\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_\n\nnamespace testing {\n\n// This flag controls the style of death tests.  Valid values are \"threadsafe\",\n// meaning that the death test child process will re-execute the test binary\n// from the start, running only a single death test, or \"fast\",\n// meaning that the child process will execute the test logic immediately\n// after forking.\nGTEST_DECLARE_string_(death_test_style);\n\n#if GTEST_HAS_DEATH_TEST\n\nnamespace internal {\n\n// Returns a Boolean value indicating whether the caller is currently\n// executing in the context of the death test child process.  Tools such as\n// Valgrind heap checkers may need this to modify their behavior in death\n// tests.  IMPORTANT: This is an internal utility.  Using it may break the\n// implementation of death tests.  User code MUST NOT use it.\nGTEST_API_ bool InDeathTestChild();\n\n}  // namespace internal\n\n// The following macros are useful for writing death tests.\n\n// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is\n// executed:\n//\n//   1. It generates a warning if there is more than one active\n//   thread.  This is because it's safe to fork() or clone() only\n//   when there is a single thread.\n//\n//   2. The parent process clone()s a sub-process and runs the death\n//   test in it; the sub-process exits with code 0 at the end of the\n//   death test, if it hasn't exited already.\n//\n//   3. The parent process waits for the sub-process to terminate.\n//\n//   4. The parent process checks the exit code and error message of\n//   the sub-process.\n//\n// Examples:\n//\n//   ASSERT_DEATH(server.SendMessage(56, \"Hello\"), \"Invalid port number\");\n//   for (int i = 0; i < 5; i++) {\n//     EXPECT_DEATH(server.ProcessRequest(i),\n//                  \"Invalid request .* in ProcessRequest()\")\n//                  << \"Failed to die on request \" << i;\n//   }\n//\n//   ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), \"Exiting\");\n//\n//   bool KilledBySIGHUP(int exit_code) {\n//     return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;\n//   }\n//\n//   ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, \"Hanging up!\");\n//\n// On the regular expressions used in death tests:\n//\n//   GOOGLETEST_CM0005 DO NOT DELETE\n//   On POSIX-compliant systems (*nix), we use the <regex.h> library,\n//   which uses the POSIX extended regex syntax.\n//\n//   On other platforms (e.g. Windows or Mac), we only support a simple regex\n//   syntax implemented as part of Google Test.  This limited\n//   implementation should be enough most of the time when writing\n//   death tests; though it lacks many features you can find in PCRE\n//   or POSIX extended regex syntax.  For example, we don't support\n//   union (\"x|y\"), grouping (\"(xy)\"), brackets (\"[xy]\"), and\n//   repetition count (\"x{5,7}\"), among others.\n//\n//   Below is the syntax that we do support.  We chose it to be a\n//   subset of both PCRE and POSIX extended regex, so it's easy to\n//   learn wherever you come from.  In the following: 'A' denotes a\n//   literal character, period (.), or a single \\\\ escape sequence;\n//   'x' and 'y' denote regular expressions; 'm' and 'n' are for\n//   natural numbers.\n//\n//     c     matches any literal character c\n//     \\\\d   matches any decimal digit\n//     \\\\D   matches any character that's not a decimal digit\n//     \\\\f   matches \\f\n//     \\\\n   matches \\n\n//     \\\\r   matches \\r\n//     \\\\s   matches any ASCII whitespace, including \\n\n//     \\\\S   matches any character that's not a whitespace\n//     \\\\t   matches \\t\n//     \\\\v   matches \\v\n//     \\\\w   matches any letter, _, or decimal digit\n//     \\\\W   matches any character that \\\\w doesn't match\n//     \\\\c   matches any literal character c, which must be a punctuation\n//     .     matches any single character except \\n\n//     A?    matches 0 or 1 occurrences of A\n//     A*    matches 0 or many occurrences of A\n//     A+    matches 1 or many occurrences of A\n//     ^     matches the beginning of a string (not that of each line)\n//     $     matches the end of a string (not that of each line)\n//     xy    matches x followed by y\n//\n//   If you accidentally use PCRE or POSIX extended regex features\n//   not implemented by us, you will get a run-time failure.  In that\n//   case, please try to rewrite your regular expression within the\n//   above syntax.\n//\n//   This implementation is *not* meant to be as highly tuned or robust\n//   as a compiled regex library, but should perform well enough for a\n//   death test, which already incurs significant overhead by launching\n//   a child process.\n//\n// Known caveats:\n//\n//   A \"threadsafe\" style death test obtains the path to the test\n//   program from argv[0] and re-executes it in the sub-process.  For\n//   simplicity, the current implementation doesn't search the PATH\n//   when launching the sub-process.  This means that the user must\n//   invoke the test program via a path that contains at least one\n//   path separator (e.g. path/to/foo_test and\n//   /absolute/path/to/bar_test are fine, but foo_test is not).  This\n//   is rarely a problem as people usually don't put the test binary\n//   directory in PATH.\n//\n// FIXME: make thread-safe death tests search the PATH.\n\n// Asserts that a given statement causes the program to exit, with an\n// integer exit status that satisfies predicate, and emitting error output\n// that matches regex.\n# define ASSERT_EXIT(statement, predicate, regex) \\\n    GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)\n\n// Like ASSERT_EXIT, but continues on to successive tests in the\n// test case, if any:\n# define EXPECT_EXIT(statement, predicate, regex) \\\n    GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)\n\n// Asserts that a given statement causes the program to exit, either by\n// explicitly exiting with a nonzero exit code or being killed by a\n// signal, and emitting error output that matches regex.\n# define ASSERT_DEATH(statement, regex) \\\n    ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)\n\n// Like ASSERT_DEATH, but continues on to successive tests in the\n// test case, if any:\n# define EXPECT_DEATH(statement, regex) \\\n    EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)\n\n// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:\n\n// Tests that an exit code describes a normal exit with a given exit code.\nclass GTEST_API_ ExitedWithCode {\n public:\n  explicit ExitedWithCode(int exit_code);\n  bool operator()(int exit_status) const;\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ExitedWithCode& other);\n\n  const int exit_code_;\n};\n\n# if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA\n// Tests that an exit code describes an exit due to termination by a\n// given signal.\n// GOOGLETEST_CM0006 DO NOT DELETE\nclass GTEST_API_ KilledBySignal {\n public:\n  explicit KilledBySignal(int signum);\n  bool operator()(int exit_status) const;\n private:\n  const int signum_;\n};\n# endif  // !GTEST_OS_WINDOWS\n\n// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.\n// The death testing framework causes this to have interesting semantics,\n// since the sideeffects of the call are only visible in opt mode, and not\n// in debug mode.\n//\n// In practice, this can be used to test functions that utilize the\n// LOG(DFATAL) macro using the following style:\n//\n// int DieInDebugOr12(int* sideeffect) {\n//   if (sideeffect) {\n//     *sideeffect = 12;\n//   }\n//   LOG(DFATAL) << \"death\";\n//   return 12;\n// }\n//\n// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {\n//   int sideeffect = 0;\n//   // Only asserts in dbg.\n//   EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), \"death\");\n//\n// #ifdef NDEBUG\n//   // opt-mode has sideeffect visible.\n//   EXPECT_EQ(12, sideeffect);\n// #else\n//   // dbg-mode no visible sideeffect.\n//   EXPECT_EQ(0, sideeffect);\n// #endif\n// }\n//\n// This will assert that DieInDebugReturn12InOpt() crashes in debug\n// mode, usually due to a DCHECK or LOG(DFATAL), but returns the\n// appropriate fallback value (12 in this case) in opt mode. If you\n// need to test that a function has appropriate side-effects in opt\n// mode, include assertions against the side-effects.  A general\n// pattern for this is:\n//\n// EXPECT_DEBUG_DEATH({\n//   // Side-effects here will have an effect after this statement in\n//   // opt mode, but none in debug mode.\n//   EXPECT_EQ(12, DieInDebugOr12(&sideeffect));\n// }, \"death\");\n//\n# ifdef NDEBUG\n\n#  define EXPECT_DEBUG_DEATH(statement, regex) \\\n  GTEST_EXECUTE_STATEMENT_(statement, regex)\n\n#  define ASSERT_DEBUG_DEATH(statement, regex) \\\n  GTEST_EXECUTE_STATEMENT_(statement, regex)\n\n# else\n\n#  define EXPECT_DEBUG_DEATH(statement, regex) \\\n  EXPECT_DEATH(statement, regex)\n\n#  define ASSERT_DEBUG_DEATH(statement, regex) \\\n  ASSERT_DEATH(statement, regex)\n\n# endif  // NDEBUG for EXPECT_DEBUG_DEATH\n#endif  // GTEST_HAS_DEATH_TEST\n\n// This macro is used for implementing macros such as\n// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where\n// death tests are not supported. Those macros must compile on such systems\n// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on\n// systems that support death tests. This allows one to write such a macro\n// on a system that does not support death tests and be sure that it will\n// compile on a death-test supporting system. It is exposed publicly so that\n// systems that have death-tests with stricter requirements than\n// GTEST_HAS_DEATH_TEST can write their own equivalent of\n// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED.\n//\n// Parameters:\n//   statement -  A statement that a macro such as EXPECT_DEATH would test\n//                for program termination. This macro has to make sure this\n//                statement is compiled but not executed, to ensure that\n//                EXPECT_DEATH_IF_SUPPORTED compiles with a certain\n//                parameter iff EXPECT_DEATH compiles with it.\n//   regex     -  A regex that a macro such as EXPECT_DEATH would use to test\n//                the output of statement.  This parameter has to be\n//                compiled but not evaluated by this macro, to ensure that\n//                this macro only accepts expressions that a macro such as\n//                EXPECT_DEATH would accept.\n//   terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED\n//                and a return statement for ASSERT_DEATH_IF_SUPPORTED.\n//                This ensures that ASSERT_DEATH_IF_SUPPORTED will not\n//                compile inside functions where ASSERT_DEATH doesn't\n//                compile.\n//\n//  The branch that has an always false condition is used to ensure that\n//  statement and regex are compiled (and thus syntactically correct) but\n//  never executed. The unreachable code macro protects the terminator\n//  statement from generating an 'unreachable code' warning in case\n//  statement unconditionally returns or throws. The Message constructor at\n//  the end allows the syntax of streaming additional messages into the\n//  macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.\n# define GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, terminator) \\\n    GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n    if (::testing::internal::AlwaysTrue()) { \\\n      GTEST_LOG_(WARNING) \\\n          << \"Death tests are not supported on this platform.\\n\" \\\n          << \"Statement '\" #statement \"' cannot be verified.\"; \\\n    } else if (::testing::internal::AlwaysFalse()) { \\\n      ::testing::internal::RE::PartialMatch(\".*\", (regex)); \\\n      GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \\\n      terminator; \\\n    } else \\\n      ::testing::Message()\n\n// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and\n// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if\n// death tests are supported; otherwise they just issue a warning.  This is\n// useful when you are combining death test assertions with normal test\n// assertions in one test.\n#if GTEST_HAS_DEATH_TEST\n# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \\\n    EXPECT_DEATH(statement, regex)\n# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \\\n    ASSERT_DEATH(statement, regex)\n#else\n# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \\\n    GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, )\n# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \\\n    GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, return)\n#endif\n\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_\n// This file was GENERATED by command:\n//     pump.py gtest-param-test.h.pump\n// DO NOT EDIT BY HAND!!!\n\n// Copyright 2008, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// Macros and functions for implementing parameterized tests\n// in Google C++ Testing and Mocking Framework (Google Test)\n//\n// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!\n//\n// GOOGLETEST_CM0001 DO NOT DELETE\n#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_\n#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_\n\n\n// Value-parameterized tests allow you to test your code with different\n// parameters without writing multiple copies of the same test.\n//\n// Here is how you use value-parameterized tests:\n\n#if 0\n\n// To write value-parameterized tests, first you should define a fixture\n// class. It is usually derived from testing::TestWithParam<T> (see below for\n// another inheritance scheme that's sometimes useful in more complicated\n// class hierarchies), where the type of your parameter values.\n// TestWithParam<T> is itself derived from testing::Test. T can be any\n// copyable type. If it's a raw pointer, you are responsible for managing the\n// lifespan of the pointed values.\n\nclass FooTest : public ::testing::TestWithParam<const char*> {\n  // You can implement all the usual class fixture members here.\n};\n\n// Then, use the TEST_P macro to define as many parameterized tests\n// for this fixture as you want. The _P suffix is for \"parameterized\"\n// or \"pattern\", whichever you prefer to think.\n\nTEST_P(FooTest, DoesBlah) {\n  // Inside a test, access the test parameter with the GetParam() method\n  // of the TestWithParam<T> class:\n  EXPECT_TRUE(foo.Blah(GetParam()));\n  ...\n}\n\nTEST_P(FooTest, HasBlahBlah) {\n  ...\n}\n\n// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test\n// case with any set of parameters you want. Google Test defines a number\n// of functions for generating test parameters. They return what we call\n// (surprise!) parameter generators. Here is a summary of them, which\n// are all in the testing namespace:\n//\n//\n//  Range(begin, end [, step]) - Yields values {begin, begin+step,\n//                               begin+step+step, ...}. The values do not\n//                               include end. step defaults to 1.\n//  Values(v1, v2, ..., vN)    - Yields values {v1, v2, ..., vN}.\n//  ValuesIn(container)        - Yields values from a C-style array, an STL\n//  ValuesIn(begin,end)          container, or an iterator range [begin, end).\n//  Bool()                     - Yields sequence {false, true}.\n//  Combine(g1, g2, ..., gN)   - Yields all combinations (the Cartesian product\n//                               for the math savvy) of the values generated\n//                               by the N generators.\n//\n// For more details, see comments at the definitions of these functions below\n// in this file.\n//\n// The following statement will instantiate tests from the FooTest test case\n// each with parameter values \"meeny\", \"miny\", and \"moe\".\n\nINSTANTIATE_TEST_CASE_P(InstantiationName,\n                        FooTest,\n                        Values(\"meeny\", \"miny\", \"moe\"));\n\n// To distinguish different instances of the pattern, (yes, you\n// can instantiate it more then once) the first argument to the\n// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the\n// actual test case name. Remember to pick unique prefixes for different\n// instantiations. The tests from the instantiation above will have\n// these names:\n//\n//    * InstantiationName/FooTest.DoesBlah/0 for \"meeny\"\n//    * InstantiationName/FooTest.DoesBlah/1 for \"miny\"\n//    * InstantiationName/FooTest.DoesBlah/2 for \"moe\"\n//    * InstantiationName/FooTest.HasBlahBlah/0 for \"meeny\"\n//    * InstantiationName/FooTest.HasBlahBlah/1 for \"miny\"\n//    * InstantiationName/FooTest.HasBlahBlah/2 for \"moe\"\n//\n// You can use these names in --gtest_filter.\n//\n// This statement will instantiate all tests from FooTest again, each\n// with parameter values \"cat\" and \"dog\":\n\nconst char* pets[] = {\"cat\", \"dog\"};\nINSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));\n\n// The tests from the instantiation above will have these names:\n//\n//    * AnotherInstantiationName/FooTest.DoesBlah/0 for \"cat\"\n//    * AnotherInstantiationName/FooTest.DoesBlah/1 for \"dog\"\n//    * AnotherInstantiationName/FooTest.HasBlahBlah/0 for \"cat\"\n//    * AnotherInstantiationName/FooTest.HasBlahBlah/1 for \"dog\"\n//\n// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests\n// in the given test case, whether their definitions come before or\n// AFTER the INSTANTIATE_TEST_CASE_P statement.\n//\n// Please also note that generator expressions (including parameters to the\n// generators) are evaluated in InitGoogleTest(), after main() has started.\n// This allows the user on one hand, to adjust generator parameters in order\n// to dynamically determine a set of tests to run and on the other hand,\n// give the user a chance to inspect the generated tests with Google Test\n// reflection API before RUN_ALL_TESTS() is executed.\n//\n// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc\n// for more examples.\n//\n// In the future, we plan to publish the API for defining new parameter\n// generators. But for now this interface remains part of the internal\n// implementation and is subject to change.\n//\n//\n// A parameterized test fixture must be derived from testing::Test and from\n// testing::WithParamInterface<T>, where T is the type of the parameter\n// values. Inheriting from TestWithParam<T> satisfies that requirement because\n// TestWithParam<T> inherits from both Test and WithParamInterface. In more\n// complicated hierarchies, however, it is occasionally useful to inherit\n// separately from Test and WithParamInterface. For example:\n\nclass BaseTest : public ::testing::Test {\n  // You can inherit all the usual members for a non-parameterized test\n  // fixture here.\n};\n\nclass DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {\n  // The usual test fixture members go here too.\n};\n\nTEST_F(BaseTest, HasFoo) {\n  // This is an ordinary non-parameterized test.\n}\n\nTEST_P(DerivedTest, DoesBlah) {\n  // GetParam works just the same here as if you inherit from TestWithParam.\n  EXPECT_TRUE(foo.Blah(GetParam()));\n}\n\n#endif  // 0\n\n\n#if !GTEST_OS_SYMBIAN\n# include <utility>\n#endif\n\n// Copyright 2008 Google Inc.\n// All Rights Reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n// Type and function utilities for implementing parameterized tests.\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_\n\n#include <ctype.h>\n\n#include <iterator>\n#include <set>\n#include <utility>\n#include <vector>\n\n// Copyright 2003 Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// A \"smart\" pointer type with reference tracking.  Every pointer to a\n// particular object is kept on a circular linked list.  When the last pointer\n// to an object is destroyed or reassigned, the object is deleted.\n//\n// Used properly, this deletes the object when the last reference goes away.\n// There are several caveats:\n// - Like all reference counting schemes, cycles lead to leaks.\n// - Each smart pointer is actually two pointers (8 bytes instead of 4).\n// - Every time a pointer is assigned, the entire list of pointers to that\n//   object is traversed.  This class is therefore NOT SUITABLE when there\n//   will often be more than two or three pointers to a particular object.\n// - References are only tracked as long as linked_ptr<> objects are copied.\n//   If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS\n//   will happen (double deletion).\n//\n// A good use of this class is storing object references in STL containers.\n// You can safely put linked_ptr<> in a vector<>.\n// Other uses may not be as good.\n//\n// Note: If you use an incomplete type with linked_ptr<>, the class\n// *containing* linked_ptr<> must have a constructor and destructor (even\n// if they do nothing!).\n//\n// Bill Gibbons suggested we use something like this.\n//\n// Thread Safety:\n//   Unlike other linked_ptr implementations, in this implementation\n//   a linked_ptr object is thread-safe in the sense that:\n//     - it's safe to copy linked_ptr objects concurrently,\n//     - it's safe to copy *from* a linked_ptr and read its underlying\n//       raw pointer (e.g. via get()) concurrently, and\n//     - it's safe to write to two linked_ptrs that point to the same\n//       shared object concurrently.\n// FIXME: rename this to safe_linked_ptr to avoid\n// confusion with normal linked_ptr.\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_\n\n#include <stdlib.h>\n#include <assert.h>\n\n\nnamespace testing {\nnamespace internal {\n\n// Protects copying of all linked_ptr objects.\nGTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex);\n\n// This is used internally by all instances of linked_ptr<>.  It needs to be\n// a non-template class because different types of linked_ptr<> can refer to\n// the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).\n// So, it needs to be possible for different types of linked_ptr to participate\n// in the same circular linked list, so we need a single class type here.\n//\n// DO NOT USE THIS CLASS DIRECTLY YOURSELF.  Use linked_ptr<T>.\nclass linked_ptr_internal {\n public:\n  // Create a new circle that includes only this instance.\n  void join_new() {\n    next_ = this;\n  }\n\n  // Many linked_ptr operations may change p.link_ for some linked_ptr\n  // variable p in the same circle as this object.  Therefore we need\n  // to prevent two such operations from occurring concurrently.\n  //\n  // Note that different types of linked_ptr objects can coexist in a\n  // circle (e.g. linked_ptr<Base>, linked_ptr<Derived1>, and\n  // linked_ptr<Derived2>).  Therefore we must use a single mutex to\n  // protect all linked_ptr objects.  This can create serious\n  // contention in production code, but is acceptable in a testing\n  // framework.\n\n  // Join an existing circle.\n  void join(linked_ptr_internal const* ptr)\n      GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {\n    MutexLock lock(&g_linked_ptr_mutex);\n\n    linked_ptr_internal const* p = ptr;\n    while (p->next_ != ptr) {\n      assert(p->next_ != this &&\n             \"Trying to join() a linked ring we are already in. \"\n             \"Is GMock thread safety enabled?\");\n      p = p->next_;\n    }\n    p->next_ = this;\n    next_ = ptr;\n  }\n\n  // Leave whatever circle we're part of.  Returns true if we were the\n  // last member of the circle.  Once this is done, you can join() another.\n  bool depart()\n      GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) {\n    MutexLock lock(&g_linked_ptr_mutex);\n\n    if (next_ == this) return true;\n    linked_ptr_internal const* p = next_;\n    while (p->next_ != this) {\n      assert(p->next_ != next_ &&\n             \"Trying to depart() a linked ring we are not in. \"\n             \"Is GMock thread safety enabled?\");\n      p = p->next_;\n    }\n    p->next_ = next_;\n    return false;\n  }\n\n private:\n  mutable linked_ptr_internal const* next_;\n};\n\ntemplate <typename T>\nclass linked_ptr {\n public:\n  typedef T element_type;\n\n  // Take over ownership of a raw pointer.  This should happen as soon as\n  // possible after the object is created.\n  explicit linked_ptr(T* ptr = NULL) { capture(ptr); }\n  ~linked_ptr() { depart(); }\n\n  // Copy an existing linked_ptr<>, adding ourselves to the list of references.\n  template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }\n  linked_ptr(linked_ptr const& ptr) {  // NOLINT\n    assert(&ptr != this);\n    copy(&ptr);\n  }\n\n  // Assignment releases the old value and acquires the new.\n  template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {\n    depart();\n    copy(&ptr);\n    return *this;\n  }\n\n  linked_ptr& operator=(linked_ptr const& ptr) {\n    if (&ptr != this) {\n      depart();\n      copy(&ptr);\n    }\n    return *this;\n  }\n\n  // Smart pointer members.\n  void reset(T* ptr = NULL) {\n    depart();\n    capture(ptr);\n  }\n  T* get() const { return value_; }\n  T* operator->() const { return value_; }\n  T& operator*() const { return *value_; }\n\n  bool operator==(T* p) const { return value_ == p; }\n  bool operator!=(T* p) const { return value_ != p; }\n  template <typename U>\n  bool operator==(linked_ptr<U> const& ptr) const {\n    return value_ == ptr.get();\n  }\n  template <typename U>\n  bool operator!=(linked_ptr<U> const& ptr) const {\n    return value_ != ptr.get();\n  }\n\n private:\n  template <typename U>\n  friend class linked_ptr;\n\n  T* value_;\n  linked_ptr_internal link_;\n\n  void depart() {\n    if (link_.depart()) delete value_;\n  }\n\n  void capture(T* ptr) {\n    value_ = ptr;\n    link_.join_new();\n  }\n\n  template <typename U> void copy(linked_ptr<U> const* ptr) {\n    value_ = ptr->get();\n    if (value_)\n      link_.join(&ptr->link_);\n    else\n      link_.join_new();\n  }\n};\n\ntemplate<typename T> inline\nbool operator==(T* ptr, const linked_ptr<T>& x) {\n  return ptr == x.get();\n}\n\ntemplate<typename T> inline\nbool operator!=(T* ptr, const linked_ptr<T>& x) {\n  return ptr != x.get();\n}\n\n// A function to convert T* into linked_ptr<T>\n// Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation\n// for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))\ntemplate <typename T>\nlinked_ptr<T> make_linked_ptr(T* ptr) {\n  return linked_ptr<T>(ptr);\n}\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_\n// Copyright 2007, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n// Google Test - The Google C++ Testing and Mocking Framework\n//\n// This file implements a universal value printer that can print a\n// value of any type T:\n//\n//   void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);\n//\n// A user can teach this function how to print a class type T by\n// defining either operator<<() or PrintTo() in the namespace that\n// defines T.  More specifically, the FIRST defined function in the\n// following list will be used (assuming T is defined in namespace\n// foo):\n//\n//   1. foo::PrintTo(const T&, ostream*)\n//   2. operator<<(ostream&, const T&) defined in either foo or the\n//      global namespace.\n//\n// However if T is an STL-style container then it is printed element-wise\n// unless foo::PrintTo(const T&, ostream*) is defined. Note that\n// operator<<() is ignored for container types.\n//\n// If none of the above is defined, it will print the debug string of\n// the value if it is a protocol buffer, or print the raw bytes in the\n// value otherwise.\n//\n// To aid debugging: when T is a reference type, the address of the\n// value is also printed; when T is a (const) char pointer, both the\n// pointer value and the NUL-terminated string it points to are\n// printed.\n//\n// We also provide some convenient wrappers:\n//\n//   // Prints a value to a string.  For a (const or not) char\n//   // pointer, the NUL-terminated string (but not the pointer) is\n//   // printed.\n//   std::string ::testing::PrintToString(const T& value);\n//\n//   // Prints a value tersely: for a reference type, the referenced\n//   // value (but not the address) is printed; for a (const or not) char\n//   // pointer, the NUL-terminated string (but not the pointer) is\n//   // printed.\n//   void ::testing::internal::UniversalTersePrint(const T& value, ostream*);\n//\n//   // Prints value using the type inferred by the compiler.  The difference\n//   // from UniversalTersePrint() is that this function prints both the\n//   // pointer and the NUL-terminated string for a (const or not) char pointer.\n//   void ::testing::internal::UniversalPrint(const T& value, ostream*);\n//\n//   // Prints the fields of a tuple tersely to a string vector, one\n//   // element for each field. Tuple support must be enabled in\n//   // gtest-port.h.\n//   std::vector<string> UniversalTersePrintTupleFieldsToStrings(\n//       const Tuple& value);\n//\n// Known limitation:\n//\n// The print primitives print the elements of an STL-style container\n// using the compiler-inferred type of *iter where iter is a\n// const_iterator of the container.  When const_iterator is an input\n// iterator but not a forward iterator, this inferred type may not\n// match value_type, and the print output may be incorrect.  In\n// practice, this is rarely a problem as for most containers\n// const_iterator is a forward iterator.  We'll fix this if there's an\n// actual need for it.  Note that this fix cannot rely on value_type\n// being defined as many user-defined container types don't have\n// value_type.\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_\n#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_\n\n#include <ostream>  // NOLINT\n#include <sstream>\n#include <string>\n#include <utility>\n#include <vector>\n\n#if GTEST_HAS_STD_TUPLE_\n# include <tuple>\n#endif\n\n#if GTEST_HAS_ABSL\n#include \"absl/strings/string_view.h\"\n#include \"absl/types/optional.h\"\n#include \"absl/types/variant.h\"\n#endif  // GTEST_HAS_ABSL\n\nnamespace testing {\n\n// Definitions in the 'internal' and 'internal2' name spaces are\n// subject to change without notice.  DO NOT USE THEM IN USER CODE!\nnamespace internal2 {\n\n// Prints the given number of bytes in the given object to the given\n// ostream.\nGTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,\n                                     size_t count,\n                                     ::std::ostream* os);\n\n// For selecting which printer to use when a given type has neither <<\n// nor PrintTo().\nenum TypeKind {\n  kProtobuf,              // a protobuf type\n  kConvertibleToInteger,  // a type implicitly convertible to BiggestInt\n                          // (e.g. a named or unnamed enum type)\n#if GTEST_HAS_ABSL\n  kConvertibleToStringView,  // a type implicitly convertible to\n                             // absl::string_view\n#endif\n  kOtherType  // anything else\n};\n\n// TypeWithoutFormatter<T, kTypeKind>::PrintValue(value, os) is called\n// by the universal printer to print a value of type T when neither\n// operator<< nor PrintTo() is defined for T, where kTypeKind is the\n// \"kind\" of T as defined by enum TypeKind.\ntemplate <typename T, TypeKind kTypeKind>\nclass TypeWithoutFormatter {\n public:\n  // This default version is called when kTypeKind is kOtherType.\n  static void PrintValue(const T& value, ::std::ostream* os) {\n    PrintBytesInObjectTo(static_cast<const unsigned char*>(\n                             reinterpret_cast<const void*>(&value)),\n                         sizeof(value), os);\n  }\n};\n\n// We print a protobuf using its ShortDebugString() when the string\n// doesn't exceed this many characters; otherwise we print it using\n// DebugString() for better readability.\nconst size_t kProtobufOneLinerMaxLength = 50;\n\ntemplate <typename T>\nclass TypeWithoutFormatter<T, kProtobuf> {\n public:\n  static void PrintValue(const T& value, ::std::ostream* os) {\n    std::string pretty_str = value.ShortDebugString();\n    if (pretty_str.length() > kProtobufOneLinerMaxLength) {\n      pretty_str = \"\\n\" + value.DebugString();\n    }\n    *os << (\"<\" + pretty_str + \">\");\n  }\n};\n\ntemplate <typename T>\nclass TypeWithoutFormatter<T, kConvertibleToInteger> {\n public:\n  // Since T has no << operator or PrintTo() but can be implicitly\n  // converted to BiggestInt, we print it as a BiggestInt.\n  //\n  // Most likely T is an enum type (either named or unnamed), in which\n  // case printing it as an integer is the desired behavior.  In case\n  // T is not an enum, printing it as an integer is the best we can do\n  // given that it has no user-defined printer.\n  static void PrintValue(const T& value, ::std::ostream* os) {\n    const internal::BiggestInt kBigInt = value;\n    *os << kBigInt;\n  }\n};\n\n#if GTEST_HAS_ABSL\ntemplate <typename T>\nclass TypeWithoutFormatter<T, kConvertibleToStringView> {\n public:\n  // Since T has neither operator<< nor PrintTo() but can be implicitly\n  // converted to absl::string_view, we print it as a absl::string_view.\n  //\n  // Note: the implementation is further below, as it depends on\n  // internal::PrintTo symbol which is defined later in the file.\n  static void PrintValue(const T& value, ::std::ostream* os);\n};\n#endif\n\n// Prints the given value to the given ostream.  If the value is a\n// protocol message, its debug string is printed; if it's an enum or\n// of a type implicitly convertible to BiggestInt, it's printed as an\n// integer; otherwise the bytes in the value are printed.  This is\n// what UniversalPrinter<T>::Print() does when it knows nothing about\n// type T and T has neither << operator nor PrintTo().\n//\n// A user can override this behavior for a class type Foo by defining\n// a << operator in the namespace where Foo is defined.\n//\n// We put this operator in namespace 'internal2' instead of 'internal'\n// to simplify the implementation, as much code in 'internal' needs to\n// use << in STL, which would conflict with our own << were it defined\n// in 'internal'.\n//\n// Note that this operator<< takes a generic std::basic_ostream<Char,\n// CharTraits> type instead of the more restricted std::ostream.  If\n// we define it to take an std::ostream instead, we'll get an\n// \"ambiguous overloads\" compiler error when trying to print a type\n// Foo that supports streaming to std::basic_ostream<Char,\n// CharTraits>, as the compiler cannot tell whether\n// operator<<(std::ostream&, const T&) or\n// operator<<(std::basic_stream<Char, CharTraits>, const Foo&) is more\n// specific.\ntemplate <typename Char, typename CharTraits, typename T>\n::std::basic_ostream<Char, CharTraits>& operator<<(\n    ::std::basic_ostream<Char, CharTraits>& os, const T& x) {\n  TypeWithoutFormatter<T, (internal::IsAProtocolMessage<T>::value\n                               ? kProtobuf\n                               : internal::ImplicitlyConvertible<\n                                     const T&, internal::BiggestInt>::value\n                                     ? kConvertibleToInteger\n                                     :\n#if GTEST_HAS_ABSL\n                                     internal::ImplicitlyConvertible<\n                                         const T&, absl::string_view>::value\n                                         ? kConvertibleToStringView\n                                         :\n#endif\n                                         kOtherType)>::PrintValue(x, &os);\n  return os;\n}\n\n}  // namespace internal2\n}  // namespace testing\n\n// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up\n// magic needed for implementing UniversalPrinter won't work.\nnamespace testing_internal {\n\n// Used to print a value that is not an STL-style container when the\n// user doesn't define PrintTo() for it.\ntemplate <typename T>\nvoid DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {\n  // With the following statement, during unqualified name lookup,\n  // testing::internal2::operator<< appears as if it was declared in\n  // the nearest enclosing namespace that contains both\n  // ::testing_internal and ::testing::internal2, i.e. the global\n  // namespace.  For more details, refer to the C++ Standard section\n  // 7.3.4-1 [namespace.udir].  This allows us to fall back onto\n  // testing::internal2::operator<< in case T doesn't come with a <<\n  // operator.\n  //\n  // We cannot write 'using ::testing::internal2::operator<<;', which\n  // gcc 3.3 fails to compile due to a compiler bug.\n  using namespace ::testing::internal2;  // NOLINT\n\n  // Assuming T is defined in namespace foo, in the next statement,\n  // the compiler will consider all of:\n  //\n  //   1. foo::operator<< (thanks to Koenig look-up),\n  //   2. ::operator<< (as the current namespace is enclosed in ::),\n  //   3. testing::internal2::operator<< (thanks to the using statement above).\n  //\n  // The operator<< whose type matches T best will be picked.\n  //\n  // We deliberately allow #2 to be a candidate, as sometimes it's\n  // impossible to define #1 (e.g. when foo is ::std, defining\n  // anything in it is undefined behavior unless you are a compiler\n  // vendor.).\n  *os << value;\n}\n\n}  // namespace testing_internal\n\nnamespace testing {\nnamespace internal {\n\n// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a\n// value of type ToPrint that is an operand of a comparison assertion\n// (e.g. ASSERT_EQ).  OtherOperand is the type of the other operand in\n// the comparison, and is used to help determine the best way to\n// format the value.  In particular, when the value is a C string\n// (char pointer) and the other operand is an STL string object, we\n// want to format the C string as a string, since we know it is\n// compared by value with the string object.  If the value is a char\n// pointer but the other operand is not an STL string object, we don't\n// know whether the pointer is supposed to point to a NUL-terminated\n// string, and thus want to print it as a pointer to be safe.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n\n// The default case.\ntemplate <typename ToPrint, typename OtherOperand>\nclass FormatForComparison {\n public:\n  static ::std::string Format(const ToPrint& value) {\n    return ::testing::PrintToString(value);\n  }\n};\n\n// Array.\ntemplate <typename ToPrint, size_t N, typename OtherOperand>\nclass FormatForComparison<ToPrint[N], OtherOperand> {\n public:\n  static ::std::string Format(const ToPrint* value) {\n    return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);\n  }\n};\n\n// By default, print C string as pointers to be safe, as we don't know\n// whether they actually point to a NUL-terminated string.\n\n#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)                \\\n  template <typename OtherOperand>                                      \\\n  class FormatForComparison<CharType*, OtherOperand> {                  \\\n   public:                                                              \\\n    static ::std::string Format(CharType* value) {                      \\\n      return ::testing::PrintToString(static_cast<const void*>(value)); \\\n    }                                                                   \\\n  }\n\nGTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);\nGTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);\nGTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);\nGTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);\n\n#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_\n\n// If a C string is compared with an STL string object, we know it's meant\n// to point to a NUL-terminated string, and thus can print it as a string.\n\n#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \\\n  template <>                                                           \\\n  class FormatForComparison<CharType*, OtherStringType> {               \\\n   public:                                                              \\\n    static ::std::string Format(CharType* value) {                      \\\n      return ::testing::PrintToString(value);                           \\\n    }                                                                   \\\n  }\n\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);\n\n#if GTEST_HAS_GLOBAL_STRING\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);\n#endif\n\n#if GTEST_HAS_GLOBAL_WSTRING\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);\n#endif\n\n#if GTEST_HAS_STD_WSTRING\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);\nGTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);\n#endif\n\n#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_\n\n// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)\n// operand to be used in a failure message.  The type (but not value)\n// of the other operand may affect the format.  This allows us to\n// print a char* as a raw pointer when it is compared against another\n// char* or void*, and print it as a C string when it is compared\n// against an std::string object, for example.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\ntemplate <typename T1, typename T2>\nstd::string FormatForComparisonFailureMessage(\n    const T1& value, const T2& /* other_operand */) {\n  return FormatForComparison<T1, T2>::Format(value);\n}\n\n// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given\n// value to the given ostream.  The caller must ensure that\n// 'ostream_ptr' is not NULL, or the behavior is undefined.\n//\n// We define UniversalPrinter as a class template (as opposed to a\n// function template), as we need to partially specialize it for\n// reference types, which cannot be done with function templates.\ntemplate <typename T>\nclass UniversalPrinter;\n\ntemplate <typename T>\nvoid UniversalPrint(const T& value, ::std::ostream* os);\n\nenum DefaultPrinterType {\n  kPrintContainer,\n  kPrintPointer,\n  kPrintFunctionPointer,\n  kPrintOther,\n};\ntemplate <DefaultPrinterType type> struct WrapPrinterType {};\n\n// Used to print an STL-style container when the user doesn't define\n// a PrintTo() for it.\ntemplate <typename C>\nvoid DefaultPrintTo(WrapPrinterType<kPrintContainer> /* dummy */,\n                    const C& container, ::std::ostream* os) {\n  const size_t kMaxCount = 32;  // The maximum number of elements to print.\n  *os << '{';\n  size_t count = 0;\n  for (typename C::const_iterator it = container.begin();\n       it != container.end(); ++it, ++count) {\n    if (count > 0) {\n      *os << ',';\n      if (count == kMaxCount) {  // Enough has been printed.\n        *os << \" ...\";\n        break;\n      }\n    }\n    *os << ' ';\n    // We cannot call PrintTo(*it, os) here as PrintTo() doesn't\n    // handle *it being a native array.\n    internal::UniversalPrint(*it, os);\n  }\n\n  if (count > 0) {\n    *os << ' ';\n  }\n  *os << '}';\n}\n\n// Used to print a pointer that is neither a char pointer nor a member\n// pointer, when the user doesn't define PrintTo() for it.  (A member\n// variable pointer or member function pointer doesn't really point to\n// a location in the address space.  Their representation is\n// implementation-defined.  Therefore they will be printed as raw\n// bytes.)\ntemplate <typename T>\nvoid DefaultPrintTo(WrapPrinterType<kPrintPointer> /* dummy */,\n                    T* p, ::std::ostream* os) {\n  if (p == NULL) {\n    *os << \"NULL\";\n  } else {\n    // T is not a function type.  We just call << to print p,\n    // relying on ADL to pick up user-defined << for their pointer\n    // types, if any.\n    *os << p;\n  }\n}\ntemplate <typename T>\nvoid DefaultPrintTo(WrapPrinterType<kPrintFunctionPointer> /* dummy */,\n                    T* p, ::std::ostream* os) {\n  if (p == NULL) {\n    *os << \"NULL\";\n  } else {\n    // T is a function type, so '*os << p' doesn't do what we want\n    // (it just prints p as bool).  We want to print p as a const\n    // void*.\n    *os << reinterpret_cast<const void*>(p);\n  }\n}\n\n// Used to print a non-container, non-pointer value when the user\n// doesn't define PrintTo() for it.\ntemplate <typename T>\nvoid DefaultPrintTo(WrapPrinterType<kPrintOther> /* dummy */,\n                    const T& value, ::std::ostream* os) {\n  ::testing_internal::DefaultPrintNonContainerTo(value, os);\n}\n\n// Prints the given value using the << operator if it has one;\n// otherwise prints the bytes in it.  This is what\n// UniversalPrinter<T>::Print() does when PrintTo() is not specialized\n// or overloaded for type T.\n//\n// A user can override this behavior for a class type Foo by defining\n// an overload of PrintTo() in the namespace where Foo is defined.  We\n// give the user this option as sometimes defining a << operator for\n// Foo is not desirable (e.g. the coding style may prevent doing it,\n// or there is already a << operator but it doesn't do what the user\n// wants).\ntemplate <typename T>\nvoid PrintTo(const T& value, ::std::ostream* os) {\n  // DefaultPrintTo() is overloaded.  The type of its first argument\n  // determines which version will be picked.\n  //\n  // Note that we check for container types here, prior to we check\n  // for protocol message types in our operator<<.  The rationale is:\n  //\n  // For protocol messages, we want to give people a chance to\n  // override Google Mock's format by defining a PrintTo() or\n  // operator<<.  For STL containers, other formats can be\n  // incompatible with Google Mock's format for the container\n  // elements; therefore we check for container types here to ensure\n  // that our format is used.\n  //\n  // Note that MSVC and clang-cl do allow an implicit conversion from\n  // pointer-to-function to pointer-to-object, but clang-cl warns on it.\n  // So don't use ImplicitlyConvertible if it can be helped since it will\n  // cause this warning, and use a separate overload of DefaultPrintTo for\n  // function pointers so that the `*os << p` in the object pointer overload\n  // doesn't cause that warning either.\n  DefaultPrintTo(\n      WrapPrinterType <\n                  (sizeof(IsContainerTest<T>(0)) == sizeof(IsContainer)) &&\n              !IsRecursiveContainer<T>::value\n          ? kPrintContainer\n          : !is_pointer<T>::value\n                ? kPrintOther\n#if GTEST_LANG_CXX11\n                : std::is_function<typename std::remove_pointer<T>::type>::value\n#else\n                : !internal::ImplicitlyConvertible<T, const void*>::value\n#endif\n                      ? kPrintFunctionPointer\n                      : kPrintPointer > (),\n      value, os);\n}\n\n// The following list of PrintTo() overloads tells\n// UniversalPrinter<T>::Print() how to print standard types (built-in\n// types, strings, plain arrays, and pointers).\n\n// Overloads for various char types.\nGTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);\nGTEST_API_ void PrintTo(signed char c, ::std::ostream* os);\ninline void PrintTo(char c, ::std::ostream* os) {\n  // When printing a plain char, we always treat it as unsigned.  This\n  // way, the output won't be affected by whether the compiler thinks\n  // char is signed or not.\n  PrintTo(static_cast<unsigned char>(c), os);\n}\n\n// Overloads for other simple built-in types.\ninline void PrintTo(bool x, ::std::ostream* os) {\n  *os << (x ? \"true\" : \"false\");\n}\n\n// Overload for wchar_t type.\n// Prints a wchar_t as a symbol if it is printable or as its internal\n// code otherwise and also as its decimal code (except for L'\\0').\n// The L'\\0' char is printed as \"L'\\\\0'\". The decimal code is printed\n// as signed integer when wchar_t is implemented by the compiler\n// as a signed type and is printed as an unsigned integer when wchar_t\n// is implemented as an unsigned type.\nGTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);\n\n// Overloads for C strings.\nGTEST_API_ void PrintTo(const char* s, ::std::ostream* os);\ninline void PrintTo(char* s, ::std::ostream* os) {\n  PrintTo(ImplicitCast_<const char*>(s), os);\n}\n\n// signed/unsigned char is often used for representing binary data, so\n// we print pointers to it as void* to be safe.\ninline void PrintTo(const signed char* s, ::std::ostream* os) {\n  PrintTo(ImplicitCast_<const void*>(s), os);\n}\ninline void PrintTo(signed char* s, ::std::ostream* os) {\n  PrintTo(ImplicitCast_<const void*>(s), os);\n}\ninline void PrintTo(const unsigned char* s, ::std::ostream* os) {\n  PrintTo(ImplicitCast_<const void*>(s), os);\n}\ninline void PrintTo(unsigned char* s, ::std::ostream* os) {\n  PrintTo(ImplicitCast_<const void*>(s), os);\n}\n\n// MSVC can be configured to define wchar_t as a typedef of unsigned\n// short.  It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native\n// type.  When wchar_t is a typedef, defining an overload for const\n// wchar_t* would cause unsigned short* be printed as a wide string,\n// possibly causing invalid memory accesses.\n#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)\n// Overloads for wide C strings\nGTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);\ninline void PrintTo(wchar_t* s, ::std::ostream* os) {\n  PrintTo(ImplicitCast_<const wchar_t*>(s), os);\n}\n#endif\n\n// Overload for C arrays.  Multi-dimensional arrays are printed\n// properly.\n\n// Prints the given number of elements in an array, without printing\n// the curly braces.\ntemplate <typename T>\nvoid PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {\n  UniversalPrint(a[0], os);\n  for (size_t i = 1; i != count; i++) {\n    *os << \", \";\n    UniversalPrint(a[i], os);\n  }\n}\n\n// Overloads for ::string and ::std::string.\n#if GTEST_HAS_GLOBAL_STRING\nGTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os);\ninline void PrintTo(const ::string& s, ::std::ostream* os) {\n  PrintStringTo(s, os);\n}\n#endif  // GTEST_HAS_GLOBAL_STRING\n\nGTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);\ninline void PrintTo(const ::std::string& s, ::std::ostream* os) {\n  PrintStringTo(s, os);\n}\n\n// Overloads for ::wstring and ::std::wstring.\n#if GTEST_HAS_GLOBAL_WSTRING\nGTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os);\ninline void PrintTo(const ::wstring& s, ::std::ostream* os) {\n  PrintWideStringTo(s, os);\n}\n#endif  // GTEST_HAS_GLOBAL_WSTRING\n\n#if GTEST_HAS_STD_WSTRING\nGTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);\ninline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {\n  PrintWideStringTo(s, os);\n}\n#endif  // GTEST_HAS_STD_WSTRING\n\n#if GTEST_HAS_ABSL\n// Overload for absl::string_view.\ninline void PrintTo(absl::string_view sp, ::std::ostream* os) {\n  PrintTo(::std::string(sp), os);\n}\n#endif  // GTEST_HAS_ABSL\n\n#if GTEST_LANG_CXX11\ninline void PrintTo(std::nullptr_t, ::std::ostream* os) { *os << \"(nullptr)\"; }\n#endif  // GTEST_LANG_CXX11\n\n#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_\n// Helper function for printing a tuple.  T must be instantiated with\n// a tuple type.\ntemplate <typename T>\nvoid PrintTupleTo(const T& t, ::std::ostream* os);\n#endif  // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_\n\n#if GTEST_HAS_TR1_TUPLE\n// Overload for ::std::tr1::tuple.  Needed for printing function arguments,\n// which are packed as tuples.\n\n// Overloaded PrintTo() for tuples of various arities.  We support\n// tuples of up-to 10 fields.  The following implementation works\n// regardless of whether tr1::tuple is implemented using the\n// non-standard variadic template feature or not.\n\ninline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1>\nvoid PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,\n             ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n          typename T6>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,\n             ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n          typename T6, typename T7>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,\n             ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n          typename T6, typename T7, typename T8>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,\n             ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n          typename T6, typename T7, typename T8, typename T9>\nvoid PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,\n             ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n          typename T6, typename T7, typename T8, typename T9, typename T10>\nvoid PrintTo(\n    const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,\n    ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n#endif  // GTEST_HAS_TR1_TUPLE\n\n#if GTEST_HAS_STD_TUPLE_\ntemplate <typename... Types>\nvoid PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {\n  PrintTupleTo(t, os);\n}\n#endif  // GTEST_HAS_STD_TUPLE_\n\n// Overload for std::pair.\ntemplate <typename T1, typename T2>\nvoid PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {\n  *os << '(';\n  // We cannot use UniversalPrint(value.first, os) here, as T1 may be\n  // a reference type.  The same for printing value.second.\n  UniversalPrinter<T1>::Print(value.first, os);\n  *os << \", \";\n  UniversalPrinter<T2>::Print(value.second, os);\n  *os << ')';\n}\n\n// Implements printing a non-reference type T by letting the compiler\n// pick the right overload of PrintTo() for T.\ntemplate <typename T>\nclass UniversalPrinter {\n public:\n  // MSVC warns about adding const to a function type, so we want to\n  // disable the warning.\n  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)\n\n  // Note: we deliberately don't call this PrintTo(), as that name\n  // conflicts with ::testing::internal::PrintTo in the body of the\n  // function.\n  static void Print(const T& value, ::std::ostream* os) {\n    // By default, ::testing::internal::PrintTo() is used for printing\n    // the value.\n    //\n    // Thanks to Koenig look-up, if T is a class and has its own\n    // PrintTo() function defined in its namespace, that function will\n    // be visible here.  Since it is more specific than the generic ones\n    // in ::testing::internal, it will be picked by the compiler in the\n    // following statement - exactly what we want.\n    PrintTo(value, os);\n  }\n\n  GTEST_DISABLE_MSC_WARNINGS_POP_()\n};\n\n#if GTEST_HAS_ABSL\n\n// Printer for absl::optional\n\ntemplate <typename T>\nclass UniversalPrinter<::absl::optional<T>> {\n public:\n  static void Print(const ::absl::optional<T>& value, ::std::ostream* os) {\n    *os << '(';\n    if (!value) {\n      *os << \"nullopt\";\n    } else {\n      UniversalPrint(*value, os);\n    }\n    *os << ')';\n  }\n};\n\n// Printer for absl::variant\n\ntemplate <typename... T>\nclass UniversalPrinter<::absl::variant<T...>> {\n public:\n  static void Print(const ::absl::variant<T...>& value, ::std::ostream* os) {\n    *os << '(';\n    absl::visit(Visitor{os}, value);\n    *os << ')';\n  }\n\n private:\n  struct Visitor {\n    template <typename U>\n    void operator()(const U& u) const {\n      *os << \"'\" << GetTypeName<U>() << \"' with value \";\n      UniversalPrint(u, os);\n    }\n    ::std::ostream* os;\n  };\n};\n\n#endif  // GTEST_HAS_ABSL\n\n// UniversalPrintArray(begin, len, os) prints an array of 'len'\n// elements, starting at address 'begin'.\ntemplate <typename T>\nvoid UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {\n  if (len == 0) {\n    *os << \"{}\";\n  } else {\n    *os << \"{ \";\n    const size_t kThreshold = 18;\n    const size_t kChunkSize = 8;\n    // If the array has more than kThreshold elements, we'll have to\n    // omit some details by printing only the first and the last\n    // kChunkSize elements.\n    // FIXME: let the user control the threshold using a flag.\n    if (len <= kThreshold) {\n      PrintRawArrayTo(begin, len, os);\n    } else {\n      PrintRawArrayTo(begin, kChunkSize, os);\n      *os << \", ..., \";\n      PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);\n    }\n    *os << \" }\";\n  }\n}\n// This overload prints a (const) char array compactly.\nGTEST_API_ void UniversalPrintArray(\n    const char* begin, size_t len, ::std::ostream* os);\n\n// This overload prints a (const) wchar_t array compactly.\nGTEST_API_ void UniversalPrintArray(\n    const wchar_t* begin, size_t len, ::std::ostream* os);\n\n// Implements printing an array type T[N].\ntemplate <typename T, size_t N>\nclass UniversalPrinter<T[N]> {\n public:\n  // Prints the given array, omitting some elements when there are too\n  // many.\n  static void Print(const T (&a)[N], ::std::ostream* os) {\n    UniversalPrintArray(a, N, os);\n  }\n};\n\n// Implements printing a reference type T&.\ntemplate <typename T>\nclass UniversalPrinter<T&> {\n public:\n  // MSVC warns about adding const to a function type, so we want to\n  // disable the warning.\n  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)\n\n  static void Print(const T& value, ::std::ostream* os) {\n    // Prints the address of the value.  We use reinterpret_cast here\n    // as static_cast doesn't compile when T is a function type.\n    *os << \"@\" << reinterpret_cast<const void*>(&value) << \" \";\n\n    // Then prints the value itself.\n    UniversalPrint(value, os);\n  }\n\n  GTEST_DISABLE_MSC_WARNINGS_POP_()\n};\n\n// Prints a value tersely: for a reference type, the referenced value\n// (but not the address) is printed; for a (const) char pointer, the\n// NUL-terminated string (but not the pointer) is printed.\n\ntemplate <typename T>\nclass UniversalTersePrinter {\n public:\n  static void Print(const T& value, ::std::ostream* os) {\n    UniversalPrint(value, os);\n  }\n};\ntemplate <typename T>\nclass UniversalTersePrinter<T&> {\n public:\n  static void Print(const T& value, ::std::ostream* os) {\n    UniversalPrint(value, os);\n  }\n};\ntemplate <typename T, size_t N>\nclass UniversalTersePrinter<T[N]> {\n public:\n  static void Print(const T (&value)[N], ::std::ostream* os) {\n    UniversalPrinter<T[N]>::Print(value, os);\n  }\n};\ntemplate <>\nclass UniversalTersePrinter<const char*> {\n public:\n  static void Print(const char* str, ::std::ostream* os) {\n    if (str == NULL) {\n      *os << \"NULL\";\n    } else {\n      UniversalPrint(std::string(str), os);\n    }\n  }\n};\ntemplate <>\nclass UniversalTersePrinter<char*> {\n public:\n  static void Print(char* str, ::std::ostream* os) {\n    UniversalTersePrinter<const char*>::Print(str, os);\n  }\n};\n\n#if GTEST_HAS_STD_WSTRING\ntemplate <>\nclass UniversalTersePrinter<const wchar_t*> {\n public:\n  static void Print(const wchar_t* str, ::std::ostream* os) {\n    if (str == NULL) {\n      *os << \"NULL\";\n    } else {\n      UniversalPrint(::std::wstring(str), os);\n    }\n  }\n};\n#endif\n\ntemplate <>\nclass UniversalTersePrinter<wchar_t*> {\n public:\n  static void Print(wchar_t* str, ::std::ostream* os) {\n    UniversalTersePrinter<const wchar_t*>::Print(str, os);\n  }\n};\n\ntemplate <typename T>\nvoid UniversalTersePrint(const T& value, ::std::ostream* os) {\n  UniversalTersePrinter<T>::Print(value, os);\n}\n\n// Prints a value using the type inferred by the compiler.  The\n// difference between this and UniversalTersePrint() is that for a\n// (const) char pointer, this prints both the pointer and the\n// NUL-terminated string.\ntemplate <typename T>\nvoid UniversalPrint(const T& value, ::std::ostream* os) {\n  // A workarond for the bug in VC++ 7.1 that prevents us from instantiating\n  // UniversalPrinter with T directly.\n  typedef T T1;\n  UniversalPrinter<T1>::Print(value, os);\n}\n\ntypedef ::std::vector< ::std::string> Strings;\n\n// TuplePolicy<TupleT> must provide:\n// - tuple_size\n//     size of tuple TupleT.\n// - get<size_t I>(const TupleT& t)\n//     static function extracting element I of tuple TupleT.\n// - tuple_element<size_t I>::type\n//     type of element I of tuple TupleT.\ntemplate <typename TupleT>\nstruct TuplePolicy;\n\n#if GTEST_HAS_TR1_TUPLE\ntemplate <typename TupleT>\nstruct TuplePolicy {\n  typedef TupleT Tuple;\n  static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;\n\n  template <size_t I>\n  struct tuple_element : ::std::tr1::tuple_element<static_cast<int>(I), Tuple> {\n  };\n\n  template <size_t I>\n  static typename AddReference<const typename ::std::tr1::tuple_element<\n      static_cast<int>(I), Tuple>::type>::type\n  get(const Tuple& tuple) {\n    return ::std::tr1::get<I>(tuple);\n  }\n};\ntemplate <typename TupleT>\nconst size_t TuplePolicy<TupleT>::tuple_size;\n#endif  // GTEST_HAS_TR1_TUPLE\n\n#if GTEST_HAS_STD_TUPLE_\ntemplate <typename... Types>\nstruct TuplePolicy< ::std::tuple<Types...> > {\n  typedef ::std::tuple<Types...> Tuple;\n  static const size_t tuple_size = ::std::tuple_size<Tuple>::value;\n\n  template <size_t I>\n  struct tuple_element : ::std::tuple_element<I, Tuple> {};\n\n  template <size_t I>\n  static const typename ::std::tuple_element<I, Tuple>::type& get(\n      const Tuple& tuple) {\n    return ::std::get<I>(tuple);\n  }\n};\ntemplate <typename... Types>\nconst size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;\n#endif  // GTEST_HAS_STD_TUPLE_\n\n#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_\n// This helper template allows PrintTo() for tuples and\n// UniversalTersePrintTupleFieldsToStrings() to be defined by\n// induction on the number of tuple fields.  The idea is that\n// TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N\n// fields in tuple t, and can be defined in terms of\n// TuplePrefixPrinter<N - 1>.\n//\n// The inductive case.\ntemplate <size_t N>\nstruct TuplePrefixPrinter {\n  // Prints the first N fields of a tuple.\n  template <typename Tuple>\n  static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {\n    TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);\n    GTEST_INTENTIONAL_CONST_COND_PUSH_()\n    if (N > 1) {\n    GTEST_INTENTIONAL_CONST_COND_POP_()\n      *os << \", \";\n    }\n    UniversalPrinter<\n        typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>\n        ::Print(TuplePolicy<Tuple>::template get<N - 1>(t), os);\n  }\n\n  // Tersely prints the first N fields of a tuple to a string vector,\n  // one element for each field.\n  template <typename Tuple>\n  static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {\n    TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);\n    ::std::stringstream ss;\n    UniversalTersePrint(TuplePolicy<Tuple>::template get<N - 1>(t), &ss);\n    strings->push_back(ss.str());\n  }\n};\n\n// Base case.\ntemplate <>\nstruct TuplePrefixPrinter<0> {\n  template <typename Tuple>\n  static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}\n\n  template <typename Tuple>\n  static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}\n};\n\n// Helper function for printing a tuple.\n// Tuple must be either std::tr1::tuple or std::tuple type.\ntemplate <typename Tuple>\nvoid PrintTupleTo(const Tuple& t, ::std::ostream* os) {\n  *os << \"(\";\n  TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);\n  *os << \")\";\n}\n\n// Prints the fields of a tuple tersely to a string vector, one\n// element for each field.  See the comment before\n// UniversalTersePrint() for how we define \"tersely\".\ntemplate <typename Tuple>\nStrings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {\n  Strings result;\n  TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::\n      TersePrintPrefixToStrings(value, &result);\n  return result;\n}\n#endif  // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_\n\n}  // namespace internal\n\n#if GTEST_HAS_ABSL\nnamespace internal2 {\ntemplate <typename T>\nvoid TypeWithoutFormatter<T, kConvertibleToStringView>::PrintValue(\n    const T& value, ::std::ostream* os) {\n  internal::PrintTo(absl::string_view(value), os);\n}\n}  // namespace internal2\n#endif\n\ntemplate <typename T>\n::std::string PrintToString(const T& value) {\n  ::std::stringstream ss;\n  internal::UniversalTersePrinter<T>::Print(value, &ss);\n  return ss.str();\n}\n\n}  // namespace testing\n\n// Include any custom printer added by the local installation.\n// We must include this header at the end to make sure it can use the\n// declarations from this file.\n// Copyright 2015, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// This file provides an injection point for custom printers in a local\n// installation of gTest.\n// It will be included from gtest-printers.h and the overrides in this file\n// will be visible to everyone.\n//\n// Injection point for custom user configurations. See README for details\n//\n// ** Custom implementation starts here **\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_\n\nnamespace testing {\n\n// Input to a parameterized test name generator, describing a test parameter.\n// Consists of the parameter value and the integer parameter index.\ntemplate <class ParamType>\nstruct TestParamInfo {\n  TestParamInfo(const ParamType& a_param, size_t an_index) :\n    param(a_param),\n    index(an_index) {}\n  ParamType param;\n  size_t index;\n};\n\n// A builtin parameterized test name generator which returns the result of\n// testing::PrintToString.\nstruct PrintToStringParamName {\n  template <class ParamType>\n  std::string operator()(const TestParamInfo<ParamType>& info) const {\n    return PrintToString(info.param);\n  }\n};\n\nnamespace internal {\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Outputs a message explaining invalid registration of different\n// fixture class for the same test case. This may happen when\n// TEST_P macro is used to define two tests with the same name\n// but in different namespaces.\nGTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,\n                                          CodeLocation code_location);\n\ntemplate <typename> class ParamGeneratorInterface;\ntemplate <typename> class ParamGenerator;\n\n// Interface for iterating over elements provided by an implementation\n// of ParamGeneratorInterface<T>.\ntemplate <typename T>\nclass ParamIteratorInterface {\n public:\n  virtual ~ParamIteratorInterface() {}\n  // A pointer to the base generator instance.\n  // Used only for the purposes of iterator comparison\n  // to make sure that two iterators belong to the same generator.\n  virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;\n  // Advances iterator to point to the next element\n  // provided by the generator. The caller is responsible\n  // for not calling Advance() on an iterator equal to\n  // BaseGenerator()->End().\n  virtual void Advance() = 0;\n  // Clones the iterator object. Used for implementing copy semantics\n  // of ParamIterator<T>.\n  virtual ParamIteratorInterface* Clone() const = 0;\n  // Dereferences the current iterator and provides (read-only) access\n  // to the pointed value. It is the caller's responsibility not to call\n  // Current() on an iterator equal to BaseGenerator()->End().\n  // Used for implementing ParamGenerator<T>::operator*().\n  virtual const T* Current() const = 0;\n  // Determines whether the given iterator and other point to the same\n  // element in the sequence generated by the generator.\n  // Used for implementing ParamGenerator<T>::operator==().\n  virtual bool Equals(const ParamIteratorInterface& other) const = 0;\n};\n\n// Class iterating over elements provided by an implementation of\n// ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>\n// and implements the const forward iterator concept.\ntemplate <typename T>\nclass ParamIterator {\n public:\n  typedef T value_type;\n  typedef const T& reference;\n  typedef ptrdiff_t difference_type;\n\n  // ParamIterator assumes ownership of the impl_ pointer.\n  ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}\n  ParamIterator& operator=(const ParamIterator& other) {\n    if (this != &other)\n      impl_.reset(other.impl_->Clone());\n    return *this;\n  }\n\n  const T& operator*() const { return *impl_->Current(); }\n  const T* operator->() const { return impl_->Current(); }\n  // Prefix version of operator++.\n  ParamIterator& operator++() {\n    impl_->Advance();\n    return *this;\n  }\n  // Postfix version of operator++.\n  ParamIterator operator++(int /*unused*/) {\n    ParamIteratorInterface<T>* clone = impl_->Clone();\n    impl_->Advance();\n    return ParamIterator(clone);\n  }\n  bool operator==(const ParamIterator& other) const {\n    return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);\n  }\n  bool operator!=(const ParamIterator& other) const {\n    return !(*this == other);\n  }\n\n private:\n  friend class ParamGenerator<T>;\n  explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}\n  scoped_ptr<ParamIteratorInterface<T> > impl_;\n};\n\n// ParamGeneratorInterface<T> is the binary interface to access generators\n// defined in other translation units.\ntemplate <typename T>\nclass ParamGeneratorInterface {\n public:\n  typedef T ParamType;\n\n  virtual ~ParamGeneratorInterface() {}\n\n  // Generator interface definition\n  virtual ParamIteratorInterface<T>* Begin() const = 0;\n  virtual ParamIteratorInterface<T>* End() const = 0;\n};\n\n// Wraps ParamGeneratorInterface<T> and provides general generator syntax\n// compatible with the STL Container concept.\n// This class implements copy initialization semantics and the contained\n// ParamGeneratorInterface<T> instance is shared among all copies\n// of the original object. This is possible because that instance is immutable.\ntemplate<typename T>\nclass ParamGenerator {\n public:\n  typedef ParamIterator<T> iterator;\n\n  explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}\n  ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}\n\n  ParamGenerator& operator=(const ParamGenerator& other) {\n    impl_ = other.impl_;\n    return *this;\n  }\n\n  iterator begin() const { return iterator(impl_->Begin()); }\n  iterator end() const { return iterator(impl_->End()); }\n\n private:\n  linked_ptr<const ParamGeneratorInterface<T> > impl_;\n};\n\n// Generates values from a range of two comparable values. Can be used to\n// generate sequences of user-defined types that implement operator+() and\n// operator<().\n// This class is used in the Range() function.\ntemplate <typename T, typename IncrementT>\nclass RangeGenerator : public ParamGeneratorInterface<T> {\n public:\n  RangeGenerator(T begin, T end, IncrementT step)\n      : begin_(begin), end_(end),\n        step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}\n  virtual ~RangeGenerator() {}\n\n  virtual ParamIteratorInterface<T>* Begin() const {\n    return new Iterator(this, begin_, 0, step_);\n  }\n  virtual ParamIteratorInterface<T>* End() const {\n    return new Iterator(this, end_, end_index_, step_);\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<T> {\n   public:\n    Iterator(const ParamGeneratorInterface<T>* base, T value, int index,\n             IncrementT step)\n        : base_(base), value_(value), index_(index), step_(step) {}\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {\n      return base_;\n    }\n    virtual void Advance() {\n      value_ = static_cast<T>(value_ + step_);\n      index_++;\n    }\n    virtual ParamIteratorInterface<T>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const T* Current() const { return &value_; }\n    virtual bool Equals(const ParamIteratorInterface<T>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const int other_index =\n          CheckedDowncastToActualType<const Iterator>(&other)->index_;\n      return index_ == other_index;\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : ParamIteratorInterface<T>(),\n          base_(other.base_), value_(other.value_), index_(other.index_),\n          step_(other.step_) {}\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<T>* const base_;\n    T value_;\n    int index_;\n    const IncrementT step_;\n  };  // class RangeGenerator::Iterator\n\n  static int CalculateEndIndex(const T& begin,\n                               const T& end,\n                               const IncrementT& step) {\n    int end_index = 0;\n    for (T i = begin; i < end; i = static_cast<T>(i + step))\n      end_index++;\n    return end_index;\n  }\n\n  // No implementation - assignment is unsupported.\n  void operator=(const RangeGenerator& other);\n\n  const T begin_;\n  const T end_;\n  const IncrementT step_;\n  // The index for the end() iterator. All the elements in the generated\n  // sequence are indexed (0-based) to aid iterator comparison.\n  const int end_index_;\n};  // class RangeGenerator\n\n\n// Generates values from a pair of STL-style iterators. Used in the\n// ValuesIn() function. The elements are copied from the source range\n// since the source can be located on the stack, and the generator\n// is likely to persist beyond that stack frame.\ntemplate <typename T>\nclass ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {\n public:\n  template <typename ForwardIterator>\n  ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)\n      : container_(begin, end) {}\n  virtual ~ValuesInIteratorRangeGenerator() {}\n\n  virtual ParamIteratorInterface<T>* Begin() const {\n    return new Iterator(this, container_.begin());\n  }\n  virtual ParamIteratorInterface<T>* End() const {\n    return new Iterator(this, container_.end());\n  }\n\n private:\n  typedef typename ::std::vector<T> ContainerType;\n\n  class Iterator : public ParamIteratorInterface<T> {\n   public:\n    Iterator(const ParamGeneratorInterface<T>* base,\n             typename ContainerType::const_iterator iterator)\n        : base_(base), iterator_(iterator) {}\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<T>* BaseGenerator() const {\n      return base_;\n    }\n    virtual void Advance() {\n      ++iterator_;\n      value_.reset();\n    }\n    virtual ParamIteratorInterface<T>* Clone() const {\n      return new Iterator(*this);\n    }\n    // We need to use cached value referenced by iterator_ because *iterator_\n    // can return a temporary object (and of type other then T), so just\n    // having \"return &*iterator_;\" doesn't work.\n    // value_ is updated here and not in Advance() because Advance()\n    // can advance iterator_ beyond the end of the range, and we cannot\n    // detect that fact. The client code, on the other hand, is\n    // responsible for not calling Current() on an out-of-range iterator.\n    virtual const T* Current() const {\n      if (value_.get() == NULL)\n        value_.reset(new T(*iterator_));\n      return value_.get();\n    }\n    virtual bool Equals(const ParamIteratorInterface<T>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      return iterator_ ==\n          CheckedDowncastToActualType<const Iterator>(&other)->iterator_;\n    }\n\n   private:\n    Iterator(const Iterator& other)\n          // The explicit constructor call suppresses a false warning\n          // emitted by gcc when supplied with the -Wextra option.\n        : ParamIteratorInterface<T>(),\n          base_(other.base_),\n          iterator_(other.iterator_) {}\n\n    const ParamGeneratorInterface<T>* const base_;\n    typename ContainerType::const_iterator iterator_;\n    // A cached value of *iterator_. We keep it here to allow access by\n    // pointer in the wrapping iterator's operator->().\n    // value_ needs to be mutable to be accessed in Current().\n    // Use of scoped_ptr helps manage cached value's lifetime,\n    // which is bound by the lifespan of the iterator itself.\n    mutable scoped_ptr<const T> value_;\n  };  // class ValuesInIteratorRangeGenerator::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const ValuesInIteratorRangeGenerator& other);\n\n  const ContainerType container_;\n};  // class ValuesInIteratorRangeGenerator\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Default parameterized test name generator, returns a string containing the\n// integer test parameter index.\ntemplate <class ParamType>\nstd::string DefaultParamName(const TestParamInfo<ParamType>& info) {\n  Message name_stream;\n  name_stream << info.index;\n  return name_stream.GetString();\n}\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Parameterized test name overload helpers, which help the\n// INSTANTIATE_TEST_CASE_P macro choose between the default parameterized\n// test name generator and user param name generator.\ntemplate <class ParamType, class ParamNameGenFunctor>\nParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {\n  return func;\n}\n\ntemplate <class ParamType>\nstruct ParamNameGenFunc {\n  typedef std::string Type(const TestParamInfo<ParamType>&);\n};\n\ntemplate <class ParamType>\ntypename ParamNameGenFunc<ParamType>::Type *GetParamNameGen() {\n  return DefaultParamName;\n}\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Stores a parameter value and later creates tests parameterized with that\n// value.\ntemplate <class TestClass>\nclass ParameterizedTestFactory : public TestFactoryBase {\n public:\n  typedef typename TestClass::ParamType ParamType;\n  explicit ParameterizedTestFactory(ParamType parameter) :\n      parameter_(parameter) {}\n  virtual Test* CreateTest() {\n    TestClass::SetParam(&parameter_);\n    return new TestClass();\n  }\n\n private:\n  const ParamType parameter_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);\n};\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// TestMetaFactoryBase is a base class for meta-factories that create\n// test factories for passing into MakeAndRegisterTestInfo function.\ntemplate <class ParamType>\nclass TestMetaFactoryBase {\n public:\n  virtual ~TestMetaFactoryBase() {}\n\n  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;\n};\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// TestMetaFactory creates test factories for passing into\n// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives\n// ownership of test factory pointer, same factory object cannot be passed\n// into that method twice. But ParameterizedTestCaseInfo is going to call\n// it for each Test/Parameter value combination. Thus it needs meta factory\n// creator class.\ntemplate <class TestCase>\nclass TestMetaFactory\n    : public TestMetaFactoryBase<typename TestCase::ParamType> {\n public:\n  typedef typename TestCase::ParamType ParamType;\n\n  TestMetaFactory() {}\n\n  virtual TestFactoryBase* CreateTestFactory(ParamType parameter) {\n    return new ParameterizedTestFactory<TestCase>(parameter);\n  }\n\n private:\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);\n};\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// ParameterizedTestCaseInfoBase is a generic interface\n// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase\n// accumulates test information provided by TEST_P macro invocations\n// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations\n// and uses that information to register all resulting test instances\n// in RegisterTests method. The ParameterizeTestCaseRegistry class holds\n// a collection of pointers to the ParameterizedTestCaseInfo objects\n// and calls RegisterTests() on each of them when asked.\nclass ParameterizedTestCaseInfoBase {\n public:\n  virtual ~ParameterizedTestCaseInfoBase() {}\n\n  // Base part of test case name for display purposes.\n  virtual const std::string& GetTestCaseName() const = 0;\n  // Test case id to verify identity.\n  virtual TypeId GetTestCaseTypeId() const = 0;\n  // UnitTest class invokes this method to register tests in this\n  // test case right before running them in RUN_ALL_TESTS macro.\n  // This method should not be called more then once on any single\n  // instance of a ParameterizedTestCaseInfoBase derived class.\n  virtual void RegisterTests() = 0;\n\n protected:\n  ParameterizedTestCaseInfoBase() {}\n\n private:\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase);\n};\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P\n// macro invocations for a particular test case and generators\n// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that\n// test case. It registers tests with all values generated by all\n// generators when asked.\ntemplate <class TestCase>\nclass ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {\n public:\n  // ParamType and GeneratorCreationFunc are private types but are required\n  // for declarations of public methods AddTestPattern() and\n  // AddTestCaseInstantiation().\n  typedef typename TestCase::ParamType ParamType;\n  // A function that returns an instance of appropriate generator type.\n  typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();\n  typedef typename ParamNameGenFunc<ParamType>::Type ParamNameGeneratorFunc;\n\n  explicit ParameterizedTestCaseInfo(\n      const char* name, CodeLocation code_location)\n      : test_case_name_(name), code_location_(code_location) {}\n\n  // Test case base name for display purposes.\n  virtual const std::string& GetTestCaseName() const { return test_case_name_; }\n  // Test case id to verify identity.\n  virtual TypeId GetTestCaseTypeId() const { return GetTypeId<TestCase>(); }\n  // TEST_P macro uses AddTestPattern() to record information\n  // about a single test in a LocalTestInfo structure.\n  // test_case_name is the base name of the test case (without invocation\n  // prefix). test_base_name is the name of an individual test without\n  // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is\n  // test case base name and DoBar is test base name.\n  void AddTestPattern(const char* test_case_name,\n                      const char* test_base_name,\n                      TestMetaFactoryBase<ParamType>* meta_factory) {\n    tests_.push_back(linked_ptr<TestInfo>(new TestInfo(test_case_name,\n                                                       test_base_name,\n                                                       meta_factory)));\n  }\n  // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information\n  // about a generator.\n  int AddTestCaseInstantiation(const std::string& instantiation_name,\n                               GeneratorCreationFunc* func,\n                               ParamNameGeneratorFunc* name_func,\n                               const char* file, int line) {\n    instantiations_.push_back(\n        InstantiationInfo(instantiation_name, func, name_func, file, line));\n    return 0;  // Return value used only to run this method in namespace scope.\n  }\n  // UnitTest class invokes this method to register tests in this test case\n  // test cases right before running tests in RUN_ALL_TESTS macro.\n  // This method should not be called more then once on any single\n  // instance of a ParameterizedTestCaseInfoBase derived class.\n  // UnitTest has a guard to prevent from calling this method more then once.\n  virtual void RegisterTests() {\n    for (typename TestInfoContainer::iterator test_it = tests_.begin();\n         test_it != tests_.end(); ++test_it) {\n      linked_ptr<TestInfo> test_info = *test_it;\n      for (typename InstantiationContainer::iterator gen_it =\n               instantiations_.begin(); gen_it != instantiations_.end();\n               ++gen_it) {\n        const std::string& instantiation_name = gen_it->name;\n        ParamGenerator<ParamType> generator((*gen_it->generator)());\n        ParamNameGeneratorFunc* name_func = gen_it->name_func;\n        const char* file = gen_it->file;\n        int line = gen_it->line;\n\n        std::string test_case_name;\n        if ( !instantiation_name.empty() )\n          test_case_name = instantiation_name + \"/\";\n        test_case_name += test_info->test_case_base_name;\n\n        size_t i = 0;\n        std::set<std::string> test_param_names;\n        for (typename ParamGenerator<ParamType>::iterator param_it =\n                 generator.begin();\n             param_it != generator.end(); ++param_it, ++i) {\n          Message test_name_stream;\n\n          std::string param_name = name_func(\n              TestParamInfo<ParamType>(*param_it, i));\n\n          GTEST_CHECK_(IsValidParamName(param_name))\n              << \"Parameterized test name '\" << param_name\n              << \"' is invalid, in \" << file\n              << \" line \" << line << std::endl;\n\n          GTEST_CHECK_(test_param_names.count(param_name) == 0)\n              << \"Duplicate parameterized test name '\" << param_name\n              << \"', in \" << file << \" line \" << line << std::endl;\n\n          test_param_names.insert(param_name);\n\n          test_name_stream << test_info->test_base_name << \"/\" << param_name;\n          MakeAndRegisterTestInfo(\n              test_case_name.c_str(),\n              test_name_stream.GetString().c_str(),\n              NULL,  // No type parameter.\n              PrintToString(*param_it).c_str(),\n              code_location_,\n              GetTestCaseTypeId(),\n              TestCase::SetUpTestCase,\n              TestCase::TearDownTestCase,\n              test_info->test_meta_factory->CreateTestFactory(*param_it));\n        }  // for param_it\n      }  // for gen_it\n    }  // for test_it\n  }  // RegisterTests\n\n private:\n  // LocalTestInfo structure keeps information about a single test registered\n  // with TEST_P macro.\n  struct TestInfo {\n    TestInfo(const char* a_test_case_base_name,\n             const char* a_test_base_name,\n             TestMetaFactoryBase<ParamType>* a_test_meta_factory) :\n        test_case_base_name(a_test_case_base_name),\n        test_base_name(a_test_base_name),\n        test_meta_factory(a_test_meta_factory) {}\n\n    const std::string test_case_base_name;\n    const std::string test_base_name;\n    const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;\n  };\n  typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;\n  // Records data received from INSTANTIATE_TEST_CASE_P macros:\n  //  <Instantiation name, Sequence generator creation function,\n  //     Name generator function, Source file, Source line>\n  struct InstantiationInfo {\n      InstantiationInfo(const std::string &name_in,\n                        GeneratorCreationFunc* generator_in,\n                        ParamNameGeneratorFunc* name_func_in,\n                        const char* file_in,\n                        int line_in)\n          : name(name_in),\n            generator(generator_in),\n            name_func(name_func_in),\n            file(file_in),\n            line(line_in) {}\n\n      std::string name;\n      GeneratorCreationFunc* generator;\n      ParamNameGeneratorFunc* name_func;\n      const char* file;\n      int line;\n  };\n  typedef ::std::vector<InstantiationInfo> InstantiationContainer;\n\n  static bool IsValidParamName(const std::string& name) {\n    // Check for empty string\n    if (name.empty())\n      return false;\n\n    // Check for invalid characters\n    for (std::string::size_type index = 0; index < name.size(); ++index) {\n      if (!isalnum(name[index]) && name[index] != '_')\n        return false;\n    }\n\n    return true;\n  }\n\n  const std::string test_case_name_;\n  CodeLocation code_location_;\n  TestInfoContainer tests_;\n  InstantiationContainer instantiations_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo);\n};  // class ParameterizedTestCaseInfo\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase\n// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P\n// macros use it to locate their corresponding ParameterizedTestCaseInfo\n// descriptors.\nclass ParameterizedTestCaseRegistry {\n public:\n  ParameterizedTestCaseRegistry() {}\n  ~ParameterizedTestCaseRegistry() {\n    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();\n         it != test_case_infos_.end(); ++it) {\n      delete *it;\n    }\n  }\n\n  // Looks up or creates and returns a structure containing information about\n  // tests and instantiations of a particular test case.\n  template <class TestCase>\n  ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(\n      const char* test_case_name,\n      CodeLocation code_location) {\n    ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;\n    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();\n         it != test_case_infos_.end(); ++it) {\n      if ((*it)->GetTestCaseName() == test_case_name) {\n        if ((*it)->GetTestCaseTypeId() != GetTypeId<TestCase>()) {\n          // Complain about incorrect usage of Google Test facilities\n          // and terminate the program since we cannot guaranty correct\n          // test case setup and tear-down in this case.\n          ReportInvalidTestCaseType(test_case_name, code_location);\n          posix::Abort();\n        } else {\n          // At this point we are sure that the object we found is of the same\n          // type we are looking for, so we downcast it to that type\n          // without further checks.\n          typed_test_info = CheckedDowncastToActualType<\n              ParameterizedTestCaseInfo<TestCase> >(*it);\n        }\n        break;\n      }\n    }\n    if (typed_test_info == NULL) {\n      typed_test_info = new ParameterizedTestCaseInfo<TestCase>(\n          test_case_name, code_location);\n      test_case_infos_.push_back(typed_test_info);\n    }\n    return typed_test_info;\n  }\n  void RegisterTests() {\n    for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();\n         it != test_case_infos_.end(); ++it) {\n      (*it)->RegisterTests();\n    }\n  }\n\n private:\n  typedef ::std::vector<ParameterizedTestCaseInfoBase*> TestCaseInfoContainer;\n\n  TestCaseInfoContainer test_case_infos_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry);\n};\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_\n// This file was GENERATED by command:\n//     pump.py gtest-param-util-generated.h.pump\n// DO NOT EDIT BY HAND!!!\n\n// Copyright 2008 Google Inc.\n// All Rights Reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n// Type and function utilities for implementing parameterized tests.\n// This file is generated by a SCRIPT.  DO NOT EDIT BY HAND!\n//\n// Currently Google Test supports at most 50 arguments in Values,\n// and at most 10 arguments in Combine. Please contact\n// googletestframework@googlegroups.com if you need more.\n// Please note that the number of arguments to Combine is limited\n// by the maximum arity of the implementation of tuple which is\n// currently set at 10.\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_\n#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_\n\n\nnamespace testing {\n\n// Forward declarations of ValuesIn(), which is implemented in\n// include/gtest/gtest-param-test.h.\ntemplate <typename ForwardIterator>\ninternal::ParamGenerator<\n  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>\nValuesIn(ForwardIterator begin, ForwardIterator end);\n\ntemplate <typename T, size_t N>\ninternal::ParamGenerator<T> ValuesIn(const T (&array)[N]);\n\ntemplate <class Container>\ninternal::ParamGenerator<typename Container::value_type> ValuesIn(\n    const Container& container);\n\nnamespace internal {\n\n// Used in the Values() function to provide polymorphic capabilities.\ntemplate <typename T1>\nclass ValueArray1 {\n public:\n  explicit ValueArray1(T1 v1) : v1_(v1) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray1(const ValueArray1& other) : v1_(other.v1_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray1& other);\n\n  const T1 v1_;\n};\n\ntemplate <typename T1, typename T2>\nclass ValueArray2 {\n public:\n  ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray2(const ValueArray2& other) : v1_(other.v1_), v2_(other.v2_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray2& other);\n\n  const T1 v1_;\n  const T2 v2_;\n};\n\ntemplate <typename T1, typename T2, typename T3>\nclass ValueArray3 {\n public:\n  ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray3(const ValueArray3& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray3& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4>\nclass ValueArray4 {\n public:\n  ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray4(const ValueArray4& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray4& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5>\nclass ValueArray5 {\n public:\n  ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4), v5_(v5) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray5(const ValueArray5& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray5& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6>\nclass ValueArray6 {\n public:\n  ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2),\n      v3_(v3), v4_(v4), v5_(v5), v6_(v6) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray6(const ValueArray6& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray6& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7>\nclass ValueArray7 {\n public:\n  ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1),\n      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray7(const ValueArray7& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray7& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8>\nclass ValueArray8 {\n public:\n  ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n      T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray8(const ValueArray8& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray8& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9>\nclass ValueArray9 {\n public:\n  ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,\n      T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray9(const ValueArray9& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray9& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10>\nclass ValueArray10 {\n public:\n  ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray10(const ValueArray10& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray10& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11>\nclass ValueArray11 {\n public:\n  ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),\n      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray11(const ValueArray11& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray11& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12>\nclass ValueArray12 {\n public:\n  ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),\n      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray12(const ValueArray12& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray12& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13>\nclass ValueArray13 {\n public:\n  ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),\n      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),\n      v12_(v12), v13_(v13) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray13(const ValueArray13& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray13& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14>\nclass ValueArray14 {\n public:\n  ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray14(const ValueArray14& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray14& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15>\nclass ValueArray15 {\n public:\n  ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2),\n      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray15(const ValueArray15& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray15& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16>\nclass ValueArray16 {\n public:\n  ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1),\n      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),\n      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),\n      v16_(v16) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray16(const ValueArray16& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray16& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17>\nclass ValueArray17 {\n public:\n  ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,\n      T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray17(const ValueArray17& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray17& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18>\nclass ValueArray18 {\n public:\n  ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray18(const ValueArray18& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray18& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19>\nclass ValueArray19 {\n public:\n  ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),\n      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),\n      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray19(const ValueArray19& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray19& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20>\nclass ValueArray20 {\n public:\n  ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),\n      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),\n      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),\n      v19_(v19), v20_(v20) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray20(const ValueArray20& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray20& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21>\nclass ValueArray21 {\n public:\n  ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),\n      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),\n      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),\n      v18_(v18), v19_(v19), v20_(v20), v21_(v21) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray21(const ValueArray21& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray21& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22>\nclass ValueArray22 {\n public:\n  ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray22(const ValueArray22& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray22& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23>\nclass ValueArray23 {\n public:\n  ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2),\n      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray23(const ValueArray23& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray23& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24>\nclass ValueArray24 {\n public:\n  ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1),\n      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),\n      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),\n      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),\n      v22_(v22), v23_(v23), v24_(v24) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray24(const ValueArray24& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray24& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25>\nclass ValueArray25 {\n public:\n  ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,\n      T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray25(const ValueArray25& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray25& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26>\nclass ValueArray26 {\n public:\n  ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray26(const ValueArray26& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray26& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27>\nclass ValueArray27 {\n public:\n  ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),\n      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),\n      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),\n      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),\n      v26_(v26), v27_(v27) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray27(const ValueArray27& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray27& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28>\nclass ValueArray28 {\n public:\n  ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),\n      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),\n      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),\n      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),\n      v25_(v25), v26_(v26), v27_(v27), v28_(v28) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray28(const ValueArray28& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray28& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29>\nclass ValueArray29 {\n public:\n  ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),\n      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),\n      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),\n      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),\n      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray29(const ValueArray29& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray29& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30>\nclass ValueArray30 {\n public:\n  ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),\n      v29_(v29), v30_(v30) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray30(const ValueArray30& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray30& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31>\nclass ValueArray31 {\n public:\n  ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2),\n      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),\n      v29_(v29), v30_(v30), v31_(v31) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray31(const ValueArray31& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray31& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32>\nclass ValueArray32 {\n public:\n  ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1),\n      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),\n      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),\n      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),\n      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),\n      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray32(const ValueArray32& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray32& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33>\nclass ValueArray33 {\n public:\n  ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,\n      T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),\n      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),\n      v33_(v33) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray33(const ValueArray33& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray33& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34>\nclass ValueArray34 {\n public:\n  ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),\n      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),\n      v33_(v33), v34_(v34) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray34(const ValueArray34& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray34& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35>\nclass ValueArray35 {\n public:\n  ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),\n      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),\n      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),\n      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),\n      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),\n      v32_(v32), v33_(v33), v34_(v34), v35_(v35) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray35(const ValueArray35& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray35& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36>\nclass ValueArray36 {\n public:\n  ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),\n      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),\n      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),\n      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),\n      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),\n      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray36(const ValueArray36& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray36& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37>\nclass ValueArray37 {\n public:\n  ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),\n      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),\n      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),\n      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),\n      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),\n      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),\n      v36_(v36), v37_(v37) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray37(const ValueArray37& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray37& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38>\nclass ValueArray38 {\n public:\n  ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),\n      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),\n      v35_(v35), v36_(v36), v37_(v37), v38_(v38) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray38(const ValueArray38& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray38& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39>\nclass ValueArray39 {\n public:\n  ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2),\n      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),\n      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),\n      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray39(const ValueArray39& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),\n      v39_(other.v39_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray39& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40>\nclass ValueArray40 {\n public:\n  ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1),\n      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),\n      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),\n      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),\n      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),\n      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),\n      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),\n      v40_(v40) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray40(const ValueArray40& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),\n      v39_(other.v39_), v40_(other.v40_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray40& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41>\nclass ValueArray41 {\n public:\n  ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,\n      T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),\n      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),\n      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),\n      v39_(v39), v40_(v40), v41_(v41) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray41(const ValueArray41& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),\n      v39_(other.v39_), v40_(other.v40_), v41_(other.v41_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray41& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42>\nclass ValueArray42 {\n public:\n  ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),\n      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),\n      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),\n      v39_(v39), v40_(v40), v41_(v41), v42_(v42) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray42(const ValueArray42& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),\n      v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray42& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43>\nclass ValueArray43 {\n public:\n  ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6),\n      v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13),\n      v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19),\n      v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25),\n      v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31),\n      v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37),\n      v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray43(const ValueArray43& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),\n      v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),\n      v43_(other.v43_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray43& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44>\nclass ValueArray44 {\n public:\n  ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5),\n      v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12),\n      v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18),\n      v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24),\n      v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30),\n      v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36),\n      v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42),\n      v43_(v43), v44_(v44) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray44(const ValueArray44& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),\n      v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),\n      v43_(other.v43_), v44_(other.v44_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray44& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45>\nclass ValueArray45 {\n public:\n  ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4),\n      v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11),\n      v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17),\n      v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23),\n      v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29),\n      v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35),\n      v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41),\n      v42_(v42), v43_(v43), v44_(v44), v45_(v45) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),\n        static_cast<T>(v45_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray45(const ValueArray45& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),\n      v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),\n      v43_(other.v43_), v44_(other.v44_), v45_(other.v45_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray45& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n  const T45 v45_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46>\nclass ValueArray46 {\n public:\n  ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3),\n      v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),\n      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),\n      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),\n      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),\n        static_cast<T>(v45_), static_cast<T>(v46_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray46(const ValueArray46& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),\n      v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),\n      v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray46& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n  const T45 v45_;\n  const T46 v46_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47>\nclass ValueArray47 {\n public:\n  ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2),\n      v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10),\n      v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16),\n      v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22),\n      v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28),\n      v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34),\n      v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40),\n      v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46),\n      v47_(v47) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),\n        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray47(const ValueArray47& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),\n      v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),\n      v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),\n      v47_(other.v47_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray47& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n  const T45 v45_;\n  const T46 v46_;\n  const T47 v47_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48>\nclass ValueArray48 {\n public:\n  ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1),\n      v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9),\n      v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15),\n      v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21),\n      v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27),\n      v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33),\n      v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39),\n      v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45),\n      v46_(v46), v47_(v47), v48_(v48) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),\n        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),\n        static_cast<T>(v48_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray48(const ValueArray48& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),\n      v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),\n      v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),\n      v47_(other.v47_), v48_(other.v48_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray48& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n  const T45 v45_;\n  const T46 v46_;\n  const T47 v47_;\n  const T48 v48_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49>\nclass ValueArray49 {\n public:\n  ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48,\n      T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),\n      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),\n      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),\n      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),\n      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),\n        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),\n        static_cast<T>(v48_), static_cast<T>(v49_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray49(const ValueArray49& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),\n      v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),\n      v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),\n      v47_(other.v47_), v48_(other.v48_), v49_(other.v49_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray49& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n  const T45 v45_;\n  const T46 v46_;\n  const T47 v47_;\n  const T48 v48_;\n  const T49 v49_;\n};\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49, typename T50>\nclass ValueArray50 {\n public:\n  ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n      T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n      T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n      T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n      T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n      T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49,\n      T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7),\n      v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14),\n      v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20),\n      v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26),\n      v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32),\n      v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38),\n      v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44),\n      v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {}\n\n  template <typename T>\n  operator ParamGenerator<T>() const {\n    const T array[] = {static_cast<T>(v1_), static_cast<T>(v2_),\n        static_cast<T>(v3_), static_cast<T>(v4_), static_cast<T>(v5_),\n        static_cast<T>(v6_), static_cast<T>(v7_), static_cast<T>(v8_),\n        static_cast<T>(v9_), static_cast<T>(v10_), static_cast<T>(v11_),\n        static_cast<T>(v12_), static_cast<T>(v13_), static_cast<T>(v14_),\n        static_cast<T>(v15_), static_cast<T>(v16_), static_cast<T>(v17_),\n        static_cast<T>(v18_), static_cast<T>(v19_), static_cast<T>(v20_),\n        static_cast<T>(v21_), static_cast<T>(v22_), static_cast<T>(v23_),\n        static_cast<T>(v24_), static_cast<T>(v25_), static_cast<T>(v26_),\n        static_cast<T>(v27_), static_cast<T>(v28_), static_cast<T>(v29_),\n        static_cast<T>(v30_), static_cast<T>(v31_), static_cast<T>(v32_),\n        static_cast<T>(v33_), static_cast<T>(v34_), static_cast<T>(v35_),\n        static_cast<T>(v36_), static_cast<T>(v37_), static_cast<T>(v38_),\n        static_cast<T>(v39_), static_cast<T>(v40_), static_cast<T>(v41_),\n        static_cast<T>(v42_), static_cast<T>(v43_), static_cast<T>(v44_),\n        static_cast<T>(v45_), static_cast<T>(v46_), static_cast<T>(v47_),\n        static_cast<T>(v48_), static_cast<T>(v49_), static_cast<T>(v50_)};\n    return ValuesIn(array);\n  }\n\n  ValueArray50(const ValueArray50& other) : v1_(other.v1_), v2_(other.v2_),\n      v3_(other.v3_), v4_(other.v4_), v5_(other.v5_), v6_(other.v6_),\n      v7_(other.v7_), v8_(other.v8_), v9_(other.v9_), v10_(other.v10_),\n      v11_(other.v11_), v12_(other.v12_), v13_(other.v13_), v14_(other.v14_),\n      v15_(other.v15_), v16_(other.v16_), v17_(other.v17_), v18_(other.v18_),\n      v19_(other.v19_), v20_(other.v20_), v21_(other.v21_), v22_(other.v22_),\n      v23_(other.v23_), v24_(other.v24_), v25_(other.v25_), v26_(other.v26_),\n      v27_(other.v27_), v28_(other.v28_), v29_(other.v29_), v30_(other.v30_),\n      v31_(other.v31_), v32_(other.v32_), v33_(other.v33_), v34_(other.v34_),\n      v35_(other.v35_), v36_(other.v36_), v37_(other.v37_), v38_(other.v38_),\n      v39_(other.v39_), v40_(other.v40_), v41_(other.v41_), v42_(other.v42_),\n      v43_(other.v43_), v44_(other.v44_), v45_(other.v45_), v46_(other.v46_),\n      v47_(other.v47_), v48_(other.v48_), v49_(other.v49_), v50_(other.v50_) {}\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const ValueArray50& other);\n\n  const T1 v1_;\n  const T2 v2_;\n  const T3 v3_;\n  const T4 v4_;\n  const T5 v5_;\n  const T6 v6_;\n  const T7 v7_;\n  const T8 v8_;\n  const T9 v9_;\n  const T10 v10_;\n  const T11 v11_;\n  const T12 v12_;\n  const T13 v13_;\n  const T14 v14_;\n  const T15 v15_;\n  const T16 v16_;\n  const T17 v17_;\n  const T18 v18_;\n  const T19 v19_;\n  const T20 v20_;\n  const T21 v21_;\n  const T22 v22_;\n  const T23 v23_;\n  const T24 v24_;\n  const T25 v25_;\n  const T26 v26_;\n  const T27 v27_;\n  const T28 v28_;\n  const T29 v29_;\n  const T30 v30_;\n  const T31 v31_;\n  const T32 v32_;\n  const T33 v33_;\n  const T34 v34_;\n  const T35 v35_;\n  const T36 v36_;\n  const T37 v37_;\n  const T38 v38_;\n  const T39 v39_;\n  const T40 v40_;\n  const T41 v41_;\n  const T42 v42_;\n  const T43 v43_;\n  const T44 v44_;\n  const T45 v45_;\n  const T46 v46_;\n  const T47 v47_;\n  const T48 v48_;\n  const T49 v49_;\n  const T50 v50_;\n};\n\n# if GTEST_HAS_COMBINE\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Generates values from the Cartesian product of values produced\n// by the argument generators.\n//\ntemplate <typename T1, typename T2>\nclass CartesianProductGenerator2\n    : public ParamGeneratorInterface< ::testing::tuple<T1, T2> > {\n public:\n  typedef ::testing::tuple<T1, T2> ParamType;\n\n  CartesianProductGenerator2(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2)\n      : g1_(g1), g2_(g2) {}\n  virtual ~CartesianProductGenerator2() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current2_;\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return current_value_.get(); }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_.reset(new ParamType(*current1_, *current2_));\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    linked_ptr<ParamType> current_value_;\n  };  // class CartesianProductGenerator2::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator2& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n};  // class CartesianProductGenerator2\n\n\ntemplate <typename T1, typename T2, typename T3>\nclass CartesianProductGenerator3\n    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3> > {\n public:\n  typedef ::testing::tuple<T1, T2, T3> ParamType;\n\n  CartesianProductGenerator3(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)\n      : g1_(g1), g2_(g2), g3_(g3) {}\n  virtual ~CartesianProductGenerator3() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current3_;\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return current_value_.get(); }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_.reset(new ParamType(*current1_, *current2_, *current3_));\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    linked_ptr<ParamType> current_value_;\n  };  // class CartesianProductGenerator3::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator3& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n};  // class CartesianProductGenerator3\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4>\nclass CartesianProductGenerator4\n    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4> > {\n public:\n  typedef ::testing::tuple<T1, T2, T3, T4> ParamType;\n\n  CartesianProductGenerator4(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}\n  virtual ~CartesianProductGenerator4() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current4_;\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return current_value_.get(); }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_.reset(new ParamType(*current1_, *current2_, *current3_,\n            *current4_));\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    linked_ptr<ParamType> current_value_;\n  };  // class CartesianProductGenerator4::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator4& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n};  // class CartesianProductGenerator4\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5>\nclass CartesianProductGenerator5\n    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5> > {\n public:\n  typedef ::testing::tuple<T1, T2, T3, T4, T5> ParamType;\n\n  CartesianProductGenerator5(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}\n  virtual ~CartesianProductGenerator5() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end(), g5_, g5_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4,\n      const ParamGenerator<T5>& g5,\n      const typename ParamGenerator<T5>::iterator& current5)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),\n          begin5_(g5.begin()), end5_(g5.end()), current5_(current5)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current5_;\n      if (current5_ == end5_) {\n        current5_ = begin5_;\n        ++current4_;\n      }\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return current_value_.get(); }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_ &&\n          current5_ == typed_other->current5_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_),\n        begin5_(other.begin5_),\n        end5_(other.end5_),\n        current5_(other.current5_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_.reset(new ParamType(*current1_, *current2_, *current3_,\n            *current4_, *current5_));\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_ ||\n          current5_ == end5_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    const typename ParamGenerator<T5>::iterator begin5_;\n    const typename ParamGenerator<T5>::iterator end5_;\n    typename ParamGenerator<T5>::iterator current5_;\n    linked_ptr<ParamType> current_value_;\n  };  // class CartesianProductGenerator5::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator5& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n  const ParamGenerator<T5> g5_;\n};  // class CartesianProductGenerator5\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6>\nclass CartesianProductGenerator6\n    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5,\n        T6> > {\n public:\n  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6> ParamType;\n\n  CartesianProductGenerator6(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,\n      const ParamGenerator<T6>& g6)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}\n  virtual ~CartesianProductGenerator6() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4,\n      const ParamGenerator<T5>& g5,\n      const typename ParamGenerator<T5>::iterator& current5,\n      const ParamGenerator<T6>& g6,\n      const typename ParamGenerator<T6>::iterator& current6)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),\n          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),\n          begin6_(g6.begin()), end6_(g6.end()), current6_(current6)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current6_;\n      if (current6_ == end6_) {\n        current6_ = begin6_;\n        ++current5_;\n      }\n      if (current5_ == end5_) {\n        current5_ = begin5_;\n        ++current4_;\n      }\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return current_value_.get(); }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_ &&\n          current5_ == typed_other->current5_ &&\n          current6_ == typed_other->current6_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_),\n        begin5_(other.begin5_),\n        end5_(other.end5_),\n        current5_(other.current5_),\n        begin6_(other.begin6_),\n        end6_(other.end6_),\n        current6_(other.current6_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_.reset(new ParamType(*current1_, *current2_, *current3_,\n            *current4_, *current5_, *current6_));\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_ ||\n          current5_ == end5_ ||\n          current6_ == end6_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    const typename ParamGenerator<T5>::iterator begin5_;\n    const typename ParamGenerator<T5>::iterator end5_;\n    typename ParamGenerator<T5>::iterator current5_;\n    const typename ParamGenerator<T6>::iterator begin6_;\n    const typename ParamGenerator<T6>::iterator end6_;\n    typename ParamGenerator<T6>::iterator current6_;\n    linked_ptr<ParamType> current_value_;\n  };  // class CartesianProductGenerator6::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator6& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n  const ParamGenerator<T5> g5_;\n  const ParamGenerator<T6> g6_;\n};  // class CartesianProductGenerator6\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7>\nclass CartesianProductGenerator7\n    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,\n        T7> > {\n public:\n  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;\n\n  CartesianProductGenerator7(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,\n      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}\n  virtual ~CartesianProductGenerator7() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,\n        g7_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4,\n      const ParamGenerator<T5>& g5,\n      const typename ParamGenerator<T5>::iterator& current5,\n      const ParamGenerator<T6>& g6,\n      const typename ParamGenerator<T6>::iterator& current6,\n      const ParamGenerator<T7>& g7,\n      const typename ParamGenerator<T7>::iterator& current7)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),\n          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),\n          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),\n          begin7_(g7.begin()), end7_(g7.end()), current7_(current7)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current7_;\n      if (current7_ == end7_) {\n        current7_ = begin7_;\n        ++current6_;\n      }\n      if (current6_ == end6_) {\n        current6_ = begin6_;\n        ++current5_;\n      }\n      if (current5_ == end5_) {\n        current5_ = begin5_;\n        ++current4_;\n      }\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return current_value_.get(); }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_ &&\n          current5_ == typed_other->current5_ &&\n          current6_ == typed_other->current6_ &&\n          current7_ == typed_other->current7_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_),\n        begin5_(other.begin5_),\n        end5_(other.end5_),\n        current5_(other.current5_),\n        begin6_(other.begin6_),\n        end6_(other.end6_),\n        current6_(other.current6_),\n        begin7_(other.begin7_),\n        end7_(other.end7_),\n        current7_(other.current7_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_.reset(new ParamType(*current1_, *current2_, *current3_,\n            *current4_, *current5_, *current6_, *current7_));\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_ ||\n          current5_ == end5_ ||\n          current6_ == end6_ ||\n          current7_ == end7_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    const typename ParamGenerator<T5>::iterator begin5_;\n    const typename ParamGenerator<T5>::iterator end5_;\n    typename ParamGenerator<T5>::iterator current5_;\n    const typename ParamGenerator<T6>::iterator begin6_;\n    const typename ParamGenerator<T6>::iterator end6_;\n    typename ParamGenerator<T6>::iterator current6_;\n    const typename ParamGenerator<T7>::iterator begin7_;\n    const typename ParamGenerator<T7>::iterator end7_;\n    typename ParamGenerator<T7>::iterator current7_;\n    linked_ptr<ParamType> current_value_;\n  };  // class CartesianProductGenerator7::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator7& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n  const ParamGenerator<T5> g5_;\n  const ParamGenerator<T6> g6_;\n  const ParamGenerator<T7> g7_;\n};  // class CartesianProductGenerator7\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8>\nclass CartesianProductGenerator8\n    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,\n        T7, T8> > {\n public:\n  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;\n\n  CartesianProductGenerator8(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,\n      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,\n      const ParamGenerator<T8>& g8)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),\n          g8_(g8) {}\n  virtual ~CartesianProductGenerator8() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,\n        g7_.begin(), g8_, g8_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,\n        g8_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4,\n      const ParamGenerator<T5>& g5,\n      const typename ParamGenerator<T5>::iterator& current5,\n      const ParamGenerator<T6>& g6,\n      const typename ParamGenerator<T6>::iterator& current6,\n      const ParamGenerator<T7>& g7,\n      const typename ParamGenerator<T7>::iterator& current7,\n      const ParamGenerator<T8>& g8,\n      const typename ParamGenerator<T8>::iterator& current8)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),\n          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),\n          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),\n          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),\n          begin8_(g8.begin()), end8_(g8.end()), current8_(current8)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current8_;\n      if (current8_ == end8_) {\n        current8_ = begin8_;\n        ++current7_;\n      }\n      if (current7_ == end7_) {\n        current7_ = begin7_;\n        ++current6_;\n      }\n      if (current6_ == end6_) {\n        current6_ = begin6_;\n        ++current5_;\n      }\n      if (current5_ == end5_) {\n        current5_ = begin5_;\n        ++current4_;\n      }\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return current_value_.get(); }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_ &&\n          current5_ == typed_other->current5_ &&\n          current6_ == typed_other->current6_ &&\n          current7_ == typed_other->current7_ &&\n          current8_ == typed_other->current8_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_),\n        begin5_(other.begin5_),\n        end5_(other.end5_),\n        current5_(other.current5_),\n        begin6_(other.begin6_),\n        end6_(other.end6_),\n        current6_(other.current6_),\n        begin7_(other.begin7_),\n        end7_(other.end7_),\n        current7_(other.current7_),\n        begin8_(other.begin8_),\n        end8_(other.end8_),\n        current8_(other.current8_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_.reset(new ParamType(*current1_, *current2_, *current3_,\n            *current4_, *current5_, *current6_, *current7_, *current8_));\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_ ||\n          current5_ == end5_ ||\n          current6_ == end6_ ||\n          current7_ == end7_ ||\n          current8_ == end8_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    const typename ParamGenerator<T5>::iterator begin5_;\n    const typename ParamGenerator<T5>::iterator end5_;\n    typename ParamGenerator<T5>::iterator current5_;\n    const typename ParamGenerator<T6>::iterator begin6_;\n    const typename ParamGenerator<T6>::iterator end6_;\n    typename ParamGenerator<T6>::iterator current6_;\n    const typename ParamGenerator<T7>::iterator begin7_;\n    const typename ParamGenerator<T7>::iterator end7_;\n    typename ParamGenerator<T7>::iterator current7_;\n    const typename ParamGenerator<T8>::iterator begin8_;\n    const typename ParamGenerator<T8>::iterator end8_;\n    typename ParamGenerator<T8>::iterator current8_;\n    linked_ptr<ParamType> current_value_;\n  };  // class CartesianProductGenerator8::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator8& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n  const ParamGenerator<T5> g5_;\n  const ParamGenerator<T6> g6_;\n  const ParamGenerator<T7> g7_;\n  const ParamGenerator<T8> g8_;\n};  // class CartesianProductGenerator8\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9>\nclass CartesianProductGenerator9\n    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,\n        T7, T8, T9> > {\n public:\n  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;\n\n  CartesianProductGenerator9(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,\n      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,\n      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),\n          g9_(g9) {}\n  virtual ~CartesianProductGenerator9() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,\n        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,\n        g8_.end(), g9_, g9_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4,\n      const ParamGenerator<T5>& g5,\n      const typename ParamGenerator<T5>::iterator& current5,\n      const ParamGenerator<T6>& g6,\n      const typename ParamGenerator<T6>::iterator& current6,\n      const ParamGenerator<T7>& g7,\n      const typename ParamGenerator<T7>::iterator& current7,\n      const ParamGenerator<T8>& g8,\n      const typename ParamGenerator<T8>::iterator& current8,\n      const ParamGenerator<T9>& g9,\n      const typename ParamGenerator<T9>::iterator& current9)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),\n          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),\n          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),\n          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),\n          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),\n          begin9_(g9.begin()), end9_(g9.end()), current9_(current9)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current9_;\n      if (current9_ == end9_) {\n        current9_ = begin9_;\n        ++current8_;\n      }\n      if (current8_ == end8_) {\n        current8_ = begin8_;\n        ++current7_;\n      }\n      if (current7_ == end7_) {\n        current7_ = begin7_;\n        ++current6_;\n      }\n      if (current6_ == end6_) {\n        current6_ = begin6_;\n        ++current5_;\n      }\n      if (current5_ == end5_) {\n        current5_ = begin5_;\n        ++current4_;\n      }\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return current_value_.get(); }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_ &&\n          current5_ == typed_other->current5_ &&\n          current6_ == typed_other->current6_ &&\n          current7_ == typed_other->current7_ &&\n          current8_ == typed_other->current8_ &&\n          current9_ == typed_other->current9_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_),\n        begin5_(other.begin5_),\n        end5_(other.end5_),\n        current5_(other.current5_),\n        begin6_(other.begin6_),\n        end6_(other.end6_),\n        current6_(other.current6_),\n        begin7_(other.begin7_),\n        end7_(other.end7_),\n        current7_(other.current7_),\n        begin8_(other.begin8_),\n        end8_(other.end8_),\n        current8_(other.current8_),\n        begin9_(other.begin9_),\n        end9_(other.end9_),\n        current9_(other.current9_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_.reset(new ParamType(*current1_, *current2_, *current3_,\n            *current4_, *current5_, *current6_, *current7_, *current8_,\n            *current9_));\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_ ||\n          current5_ == end5_ ||\n          current6_ == end6_ ||\n          current7_ == end7_ ||\n          current8_ == end8_ ||\n          current9_ == end9_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    const typename ParamGenerator<T5>::iterator begin5_;\n    const typename ParamGenerator<T5>::iterator end5_;\n    typename ParamGenerator<T5>::iterator current5_;\n    const typename ParamGenerator<T6>::iterator begin6_;\n    const typename ParamGenerator<T6>::iterator end6_;\n    typename ParamGenerator<T6>::iterator current6_;\n    const typename ParamGenerator<T7>::iterator begin7_;\n    const typename ParamGenerator<T7>::iterator end7_;\n    typename ParamGenerator<T7>::iterator current7_;\n    const typename ParamGenerator<T8>::iterator begin8_;\n    const typename ParamGenerator<T8>::iterator end8_;\n    typename ParamGenerator<T8>::iterator current8_;\n    const typename ParamGenerator<T9>::iterator begin9_;\n    const typename ParamGenerator<T9>::iterator end9_;\n    typename ParamGenerator<T9>::iterator current9_;\n    linked_ptr<ParamType> current_value_;\n  };  // class CartesianProductGenerator9::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator9& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n  const ParamGenerator<T5> g5_;\n  const ParamGenerator<T6> g6_;\n  const ParamGenerator<T7> g7_;\n  const ParamGenerator<T8> g8_;\n  const ParamGenerator<T9> g9_;\n};  // class CartesianProductGenerator9\n\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10>\nclass CartesianProductGenerator10\n    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,\n        T7, T8, T9, T10> > {\n public:\n  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;\n\n  CartesianProductGenerator10(const ParamGenerator<T1>& g1,\n      const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,\n      const ParamGenerator<T4>& g4, const ParamGenerator<T5>& g5,\n      const ParamGenerator<T6>& g6, const ParamGenerator<T7>& g7,\n      const ParamGenerator<T8>& g8, const ParamGenerator<T9>& g9,\n      const ParamGenerator<T10>& g10)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),\n          g9_(g9), g10_(g10) {}\n  virtual ~CartesianProductGenerator10() {}\n\n  virtual ParamIteratorInterface<ParamType>* Begin() const {\n    return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_,\n        g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_,\n        g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin());\n  }\n  virtual ParamIteratorInterface<ParamType>* End() const {\n    return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(),\n        g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_,\n        g8_.end(), g9_, g9_.end(), g10_, g10_.end());\n  }\n\n private:\n  class Iterator : public ParamIteratorInterface<ParamType> {\n   public:\n    Iterator(const ParamGeneratorInterface<ParamType>* base,\n      const ParamGenerator<T1>& g1,\n      const typename ParamGenerator<T1>::iterator& current1,\n      const ParamGenerator<T2>& g2,\n      const typename ParamGenerator<T2>::iterator& current2,\n      const ParamGenerator<T3>& g3,\n      const typename ParamGenerator<T3>::iterator& current3,\n      const ParamGenerator<T4>& g4,\n      const typename ParamGenerator<T4>::iterator& current4,\n      const ParamGenerator<T5>& g5,\n      const typename ParamGenerator<T5>::iterator& current5,\n      const ParamGenerator<T6>& g6,\n      const typename ParamGenerator<T6>::iterator& current6,\n      const ParamGenerator<T7>& g7,\n      const typename ParamGenerator<T7>::iterator& current7,\n      const ParamGenerator<T8>& g8,\n      const typename ParamGenerator<T8>::iterator& current8,\n      const ParamGenerator<T9>& g9,\n      const typename ParamGenerator<T9>::iterator& current9,\n      const ParamGenerator<T10>& g10,\n      const typename ParamGenerator<T10>::iterator& current10)\n        : base_(base),\n          begin1_(g1.begin()), end1_(g1.end()), current1_(current1),\n          begin2_(g2.begin()), end2_(g2.end()), current2_(current2),\n          begin3_(g3.begin()), end3_(g3.end()), current3_(current3),\n          begin4_(g4.begin()), end4_(g4.end()), current4_(current4),\n          begin5_(g5.begin()), end5_(g5.end()), current5_(current5),\n          begin6_(g6.begin()), end6_(g6.end()), current6_(current6),\n          begin7_(g7.begin()), end7_(g7.end()), current7_(current7),\n          begin8_(g8.begin()), end8_(g8.end()), current8_(current8),\n          begin9_(g9.begin()), end9_(g9.end()), current9_(current9),\n          begin10_(g10.begin()), end10_(g10.end()), current10_(current10)    {\n      ComputeCurrentValue();\n    }\n    virtual ~Iterator() {}\n\n    virtual const ParamGeneratorInterface<ParamType>* BaseGenerator() const {\n      return base_;\n    }\n    // Advance should not be called on beyond-of-range iterators\n    // so no component iterators must be beyond end of range, either.\n    virtual void Advance() {\n      assert(!AtEnd());\n      ++current10_;\n      if (current10_ == end10_) {\n        current10_ = begin10_;\n        ++current9_;\n      }\n      if (current9_ == end9_) {\n        current9_ = begin9_;\n        ++current8_;\n      }\n      if (current8_ == end8_) {\n        current8_ = begin8_;\n        ++current7_;\n      }\n      if (current7_ == end7_) {\n        current7_ = begin7_;\n        ++current6_;\n      }\n      if (current6_ == end6_) {\n        current6_ = begin6_;\n        ++current5_;\n      }\n      if (current5_ == end5_) {\n        current5_ = begin5_;\n        ++current4_;\n      }\n      if (current4_ == end4_) {\n        current4_ = begin4_;\n        ++current3_;\n      }\n      if (current3_ == end3_) {\n        current3_ = begin3_;\n        ++current2_;\n      }\n      if (current2_ == end2_) {\n        current2_ = begin2_;\n        ++current1_;\n      }\n      ComputeCurrentValue();\n    }\n    virtual ParamIteratorInterface<ParamType>* Clone() const {\n      return new Iterator(*this);\n    }\n    virtual const ParamType* Current() const { return current_value_.get(); }\n    virtual bool Equals(const ParamIteratorInterface<ParamType>& other) const {\n      // Having the same base generator guarantees that the other\n      // iterator is of the same type and we can downcast.\n      GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())\n          << \"The program attempted to compare iterators \"\n          << \"from different generators.\" << std::endl;\n      const Iterator* typed_other =\n          CheckedDowncastToActualType<const Iterator>(&other);\n      // We must report iterators equal if they both point beyond their\n      // respective ranges. That can happen in a variety of fashions,\n      // so we have to consult AtEnd().\n      return (AtEnd() && typed_other->AtEnd()) ||\n         (\n          current1_ == typed_other->current1_ &&\n          current2_ == typed_other->current2_ &&\n          current3_ == typed_other->current3_ &&\n          current4_ == typed_other->current4_ &&\n          current5_ == typed_other->current5_ &&\n          current6_ == typed_other->current6_ &&\n          current7_ == typed_other->current7_ &&\n          current8_ == typed_other->current8_ &&\n          current9_ == typed_other->current9_ &&\n          current10_ == typed_other->current10_);\n    }\n\n   private:\n    Iterator(const Iterator& other)\n        : base_(other.base_),\n        begin1_(other.begin1_),\n        end1_(other.end1_),\n        current1_(other.current1_),\n        begin2_(other.begin2_),\n        end2_(other.end2_),\n        current2_(other.current2_),\n        begin3_(other.begin3_),\n        end3_(other.end3_),\n        current3_(other.current3_),\n        begin4_(other.begin4_),\n        end4_(other.end4_),\n        current4_(other.current4_),\n        begin5_(other.begin5_),\n        end5_(other.end5_),\n        current5_(other.current5_),\n        begin6_(other.begin6_),\n        end6_(other.end6_),\n        current6_(other.current6_),\n        begin7_(other.begin7_),\n        end7_(other.end7_),\n        current7_(other.current7_),\n        begin8_(other.begin8_),\n        end8_(other.end8_),\n        current8_(other.current8_),\n        begin9_(other.begin9_),\n        end9_(other.end9_),\n        current9_(other.current9_),\n        begin10_(other.begin10_),\n        end10_(other.end10_),\n        current10_(other.current10_) {\n      ComputeCurrentValue();\n    }\n\n    void ComputeCurrentValue() {\n      if (!AtEnd())\n        current_value_.reset(new ParamType(*current1_, *current2_, *current3_,\n            *current4_, *current5_, *current6_, *current7_, *current8_,\n            *current9_, *current10_));\n    }\n    bool AtEnd() const {\n      // We must report iterator past the end of the range when either of the\n      // component iterators has reached the end of its range.\n      return\n          current1_ == end1_ ||\n          current2_ == end2_ ||\n          current3_ == end3_ ||\n          current4_ == end4_ ||\n          current5_ == end5_ ||\n          current6_ == end6_ ||\n          current7_ == end7_ ||\n          current8_ == end8_ ||\n          current9_ == end9_ ||\n          current10_ == end10_;\n    }\n\n    // No implementation - assignment is unsupported.\n    void operator=(const Iterator& other);\n\n    const ParamGeneratorInterface<ParamType>* const base_;\n    // begin[i]_ and end[i]_ define the i-th range that Iterator traverses.\n    // current[i]_ is the actual traversing iterator.\n    const typename ParamGenerator<T1>::iterator begin1_;\n    const typename ParamGenerator<T1>::iterator end1_;\n    typename ParamGenerator<T1>::iterator current1_;\n    const typename ParamGenerator<T2>::iterator begin2_;\n    const typename ParamGenerator<T2>::iterator end2_;\n    typename ParamGenerator<T2>::iterator current2_;\n    const typename ParamGenerator<T3>::iterator begin3_;\n    const typename ParamGenerator<T3>::iterator end3_;\n    typename ParamGenerator<T3>::iterator current3_;\n    const typename ParamGenerator<T4>::iterator begin4_;\n    const typename ParamGenerator<T4>::iterator end4_;\n    typename ParamGenerator<T4>::iterator current4_;\n    const typename ParamGenerator<T5>::iterator begin5_;\n    const typename ParamGenerator<T5>::iterator end5_;\n    typename ParamGenerator<T5>::iterator current5_;\n    const typename ParamGenerator<T6>::iterator begin6_;\n    const typename ParamGenerator<T6>::iterator end6_;\n    typename ParamGenerator<T6>::iterator current6_;\n    const typename ParamGenerator<T7>::iterator begin7_;\n    const typename ParamGenerator<T7>::iterator end7_;\n    typename ParamGenerator<T7>::iterator current7_;\n    const typename ParamGenerator<T8>::iterator begin8_;\n    const typename ParamGenerator<T8>::iterator end8_;\n    typename ParamGenerator<T8>::iterator current8_;\n    const typename ParamGenerator<T9>::iterator begin9_;\n    const typename ParamGenerator<T9>::iterator end9_;\n    typename ParamGenerator<T9>::iterator current9_;\n    const typename ParamGenerator<T10>::iterator begin10_;\n    const typename ParamGenerator<T10>::iterator end10_;\n    typename ParamGenerator<T10>::iterator current10_;\n    linked_ptr<ParamType> current_value_;\n  };  // class CartesianProductGenerator10::Iterator\n\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductGenerator10& other);\n\n  const ParamGenerator<T1> g1_;\n  const ParamGenerator<T2> g2_;\n  const ParamGenerator<T3> g3_;\n  const ParamGenerator<T4> g4_;\n  const ParamGenerator<T5> g5_;\n  const ParamGenerator<T6> g6_;\n  const ParamGenerator<T7> g7_;\n  const ParamGenerator<T8> g8_;\n  const ParamGenerator<T9> g9_;\n  const ParamGenerator<T10> g10_;\n};  // class CartesianProductGenerator10\n\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Helper classes providing Combine() with polymorphic features. They allow\n// casting CartesianProductGeneratorN<T> to ParamGenerator<U> if T is\n// convertible to U.\n//\ntemplate <class Generator1, class Generator2>\nclass CartesianProductHolder2 {\n public:\nCartesianProductHolder2(const Generator1& g1, const Generator2& g2)\n      : g1_(g1), g2_(g2) {}\n  template <typename T1, typename T2>\n  operator ParamGenerator< ::testing::tuple<T1, T2> >() const {\n    return ParamGenerator< ::testing::tuple<T1, T2> >(\n        new CartesianProductGenerator2<T1, T2>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder2& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n};  // class CartesianProductHolder2\n\ntemplate <class Generator1, class Generator2, class Generator3>\nclass CartesianProductHolder3 {\n public:\nCartesianProductHolder3(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3)\n      : g1_(g1), g2_(g2), g3_(g3) {}\n  template <typename T1, typename T2, typename T3>\n  operator ParamGenerator< ::testing::tuple<T1, T2, T3> >() const {\n    return ParamGenerator< ::testing::tuple<T1, T2, T3> >(\n        new CartesianProductGenerator3<T1, T2, T3>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder3& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n};  // class CartesianProductHolder3\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4>\nclass CartesianProductHolder4 {\n public:\nCartesianProductHolder4(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}\n  template <typename T1, typename T2, typename T3, typename T4>\n  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >() const {\n    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >(\n        new CartesianProductGenerator4<T1, T2, T3, T4>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder4& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n};  // class CartesianProductHolder4\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4, class Generator5>\nclass CartesianProductHolder5 {\n public:\nCartesianProductHolder5(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4, const Generator5& g5)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}\n  template <typename T1, typename T2, typename T3, typename T4, typename T5>\n  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >() const {\n    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >(\n        new CartesianProductGenerator5<T1, T2, T3, T4, T5>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_),\n        static_cast<ParamGenerator<T5> >(g5_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder5& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n  const Generator5 g5_;\n};  // class CartesianProductHolder5\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4, class Generator5, class Generator6>\nclass CartesianProductHolder6 {\n public:\nCartesianProductHolder6(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4, const Generator5& g5,\n    const Generator6& g6)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}\n  template <typename T1, typename T2, typename T3, typename T4, typename T5,\n      typename T6>\n  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >() const {\n    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >(\n        new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_),\n        static_cast<ParamGenerator<T5> >(g5_),\n        static_cast<ParamGenerator<T6> >(g6_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder6& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n  const Generator5 g5_;\n  const Generator6 g6_;\n};  // class CartesianProductHolder6\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4, class Generator5, class Generator6, class Generator7>\nclass CartesianProductHolder7 {\n public:\nCartesianProductHolder7(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4, const Generator5& g5,\n    const Generator6& g6, const Generator7& g7)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}\n  template <typename T1, typename T2, typename T3, typename T4, typename T5,\n      typename T6, typename T7>\n  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6,\n      T7> >() const {\n    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> >(\n        new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_),\n        static_cast<ParamGenerator<T5> >(g5_),\n        static_cast<ParamGenerator<T6> >(g6_),\n        static_cast<ParamGenerator<T7> >(g7_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder7& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n  const Generator5 g5_;\n  const Generator6 g6_;\n  const Generator7 g7_;\n};  // class CartesianProductHolder7\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4, class Generator5, class Generator6, class Generator7,\n    class Generator8>\nclass CartesianProductHolder8 {\n public:\nCartesianProductHolder8(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4, const Generator5& g5,\n    const Generator6& g6, const Generator7& g7, const Generator8& g8)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7),\n          g8_(g8) {}\n  template <typename T1, typename T2, typename T3, typename T4, typename T5,\n      typename T6, typename T7, typename T8>\n  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7,\n      T8> >() const {\n    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(\n        new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_),\n        static_cast<ParamGenerator<T5> >(g5_),\n        static_cast<ParamGenerator<T6> >(g6_),\n        static_cast<ParamGenerator<T7> >(g7_),\n        static_cast<ParamGenerator<T8> >(g8_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder8& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n  const Generator5 g5_;\n  const Generator6 g6_;\n  const Generator7 g7_;\n  const Generator8 g8_;\n};  // class CartesianProductHolder8\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4, class Generator5, class Generator6, class Generator7,\n    class Generator8, class Generator9>\nclass CartesianProductHolder9 {\n public:\nCartesianProductHolder9(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4, const Generator5& g5,\n    const Generator6& g6, const Generator7& g7, const Generator8& g8,\n    const Generator9& g9)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),\n          g9_(g9) {}\n  template <typename T1, typename T2, typename T3, typename T4, typename T5,\n      typename T6, typename T7, typename T8, typename T9>\n  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,\n      T9> >() const {\n    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,\n        T9> >(\n        new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_),\n        static_cast<ParamGenerator<T5> >(g5_),\n        static_cast<ParamGenerator<T6> >(g6_),\n        static_cast<ParamGenerator<T7> >(g7_),\n        static_cast<ParamGenerator<T8> >(g8_),\n        static_cast<ParamGenerator<T9> >(g9_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder9& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n  const Generator5 g5_;\n  const Generator6 g6_;\n  const Generator7 g7_;\n  const Generator8 g8_;\n  const Generator9 g9_;\n};  // class CartesianProductHolder9\n\ntemplate <class Generator1, class Generator2, class Generator3,\n    class Generator4, class Generator5, class Generator6, class Generator7,\n    class Generator8, class Generator9, class Generator10>\nclass CartesianProductHolder10 {\n public:\nCartesianProductHolder10(const Generator1& g1, const Generator2& g2,\n    const Generator3& g3, const Generator4& g4, const Generator5& g5,\n    const Generator6& g6, const Generator7& g7, const Generator8& g8,\n    const Generator9& g9, const Generator10& g10)\n      : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8),\n          g9_(g9), g10_(g10) {}\n  template <typename T1, typename T2, typename T3, typename T4, typename T5,\n      typename T6, typename T7, typename T8, typename T9, typename T10>\n  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,\n      T10> >() const {\n    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,\n        T10> >(\n        new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,\n            T10>(\n        static_cast<ParamGenerator<T1> >(g1_),\n        static_cast<ParamGenerator<T2> >(g2_),\n        static_cast<ParamGenerator<T3> >(g3_),\n        static_cast<ParamGenerator<T4> >(g4_),\n        static_cast<ParamGenerator<T5> >(g5_),\n        static_cast<ParamGenerator<T6> >(g6_),\n        static_cast<ParamGenerator<T7> >(g7_),\n        static_cast<ParamGenerator<T8> >(g8_),\n        static_cast<ParamGenerator<T9> >(g9_),\n        static_cast<ParamGenerator<T10> >(g10_)));\n  }\n\n private:\n  // No implementation - assignment is unsupported.\n  void operator=(const CartesianProductHolder10& other);\n\n  const Generator1 g1_;\n  const Generator2 g2_;\n  const Generator3 g3_;\n  const Generator4 g4_;\n  const Generator5 g5_;\n  const Generator6 g6_;\n  const Generator7 g7_;\n  const Generator8 g8_;\n  const Generator9 g9_;\n  const Generator10 g10_;\n};  // class CartesianProductHolder10\n\n# endif  // GTEST_HAS_COMBINE\n\n}  // namespace internal\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_\n\nnamespace testing {\n\n// Functions producing parameter generators.\n//\n// Google Test uses these generators to produce parameters for value-\n// parameterized tests. When a parameterized test case is instantiated\n// with a particular generator, Google Test creates and runs tests\n// for each element in the sequence produced by the generator.\n//\n// In the following sample, tests from test case FooTest are instantiated\n// each three times with parameter values 3, 5, and 8:\n//\n// class FooTest : public TestWithParam<int> { ... };\n//\n// TEST_P(FooTest, TestThis) {\n// }\n// TEST_P(FooTest, TestThat) {\n// }\n// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8));\n//\n\n// Range() returns generators providing sequences of values in a range.\n//\n// Synopsis:\n// Range(start, end)\n//   - returns a generator producing a sequence of values {start, start+1,\n//     start+2, ..., }.\n// Range(start, end, step)\n//   - returns a generator producing a sequence of values {start, start+step,\n//     start+step+step, ..., }.\n// Notes:\n//   * The generated sequences never include end. For example, Range(1, 5)\n//     returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)\n//     returns a generator producing {1, 3, 5, 7}.\n//   * start and end must have the same type. That type may be any integral or\n//     floating-point type or a user defined type satisfying these conditions:\n//     * It must be assignable (have operator=() defined).\n//     * It must have operator+() (operator+(int-compatible type) for\n//       two-operand version).\n//     * It must have operator<() defined.\n//     Elements in the resulting sequences will also have that type.\n//   * Condition start < end must be satisfied in order for resulting sequences\n//     to contain any elements.\n//\ntemplate <typename T, typename IncrementT>\ninternal::ParamGenerator<T> Range(T start, T end, IncrementT step) {\n  return internal::ParamGenerator<T>(\n      new internal::RangeGenerator<T, IncrementT>(start, end, step));\n}\n\ntemplate <typename T>\ninternal::ParamGenerator<T> Range(T start, T end) {\n  return Range(start, end, 1);\n}\n\n// ValuesIn() function allows generation of tests with parameters coming from\n// a container.\n//\n// Synopsis:\n// ValuesIn(const T (&array)[N])\n//   - returns a generator producing sequences with elements from\n//     a C-style array.\n// ValuesIn(const Container& container)\n//   - returns a generator producing sequences with elements from\n//     an STL-style container.\n// ValuesIn(Iterator begin, Iterator end)\n//   - returns a generator producing sequences with elements from\n//     a range [begin, end) defined by a pair of STL-style iterators. These\n//     iterators can also be plain C pointers.\n//\n// Please note that ValuesIn copies the values from the containers\n// passed in and keeps them to generate tests in RUN_ALL_TESTS().\n//\n// Examples:\n//\n// This instantiates tests from test case StringTest\n// each with C-string values of \"foo\", \"bar\", and \"baz\":\n//\n// const char* strings[] = {\"foo\", \"bar\", \"baz\"};\n// INSTANTIATE_TEST_CASE_P(StringSequence, StringTest, ValuesIn(strings));\n//\n// This instantiates tests from test case StlStringTest\n// each with STL strings with values \"a\" and \"b\":\n//\n// ::std::vector< ::std::string> GetParameterStrings() {\n//   ::std::vector< ::std::string> v;\n//   v.push_back(\"a\");\n//   v.push_back(\"b\");\n//   return v;\n// }\n//\n// INSTANTIATE_TEST_CASE_P(CharSequence,\n//                         StlStringTest,\n//                         ValuesIn(GetParameterStrings()));\n//\n//\n// This will also instantiate tests from CharTest\n// each with parameter values 'a' and 'b':\n//\n// ::std::list<char> GetParameterChars() {\n//   ::std::list<char> list;\n//   list.push_back('a');\n//   list.push_back('b');\n//   return list;\n// }\n// ::std::list<char> l = GetParameterChars();\n// INSTANTIATE_TEST_CASE_P(CharSequence2,\n//                         CharTest,\n//                         ValuesIn(l.begin(), l.end()));\n//\ntemplate <typename ForwardIterator>\ninternal::ParamGenerator<\n  typename ::testing::internal::IteratorTraits<ForwardIterator>::value_type>\nValuesIn(ForwardIterator begin, ForwardIterator end) {\n  typedef typename ::testing::internal::IteratorTraits<ForwardIterator>\n      ::value_type ParamType;\n  return internal::ParamGenerator<ParamType>(\n      new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));\n}\n\ntemplate <typename T, size_t N>\ninternal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {\n  return ValuesIn(array, array + N);\n}\n\ntemplate <class Container>\ninternal::ParamGenerator<typename Container::value_type> ValuesIn(\n    const Container& container) {\n  return ValuesIn(container.begin(), container.end());\n}\n\n// Values() allows generating tests from explicitly specified list of\n// parameters.\n//\n// Synopsis:\n// Values(T v1, T v2, ..., T vN)\n//   - returns a generator producing sequences with elements v1, v2, ..., vN.\n//\n// For example, this instantiates tests from test case BarTest each\n// with values \"one\", \"two\", and \"three\":\n//\n// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values(\"one\", \"two\", \"three\"));\n//\n// This instantiates tests from test case BazTest each with values 1, 2, 3.5.\n// The exact type of values will depend on the type of parameter in BazTest.\n//\n// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));\n//\n// Currently, Values() supports from 1 to 50 parameters.\n//\ntemplate <typename T1>\ninternal::ValueArray1<T1> Values(T1 v1) {\n  return internal::ValueArray1<T1>(v1);\n}\n\ntemplate <typename T1, typename T2>\ninternal::ValueArray2<T1, T2> Values(T1 v1, T2 v2) {\n  return internal::ValueArray2<T1, T2>(v1, v2);\n}\n\ntemplate <typename T1, typename T2, typename T3>\ninternal::ValueArray3<T1, T2, T3> Values(T1 v1, T2 v2, T3 v3) {\n  return internal::ValueArray3<T1, T2, T3>(v1, v2, v3);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4>\ninternal::ValueArray4<T1, T2, T3, T4> Values(T1 v1, T2 v2, T3 v3, T4 v4) {\n  return internal::ValueArray4<T1, T2, T3, T4>(v1, v2, v3, v4);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5>\ninternal::ValueArray5<T1, T2, T3, T4, T5> Values(T1 v1, T2 v2, T3 v3, T4 v4,\n    T5 v5) {\n  return internal::ValueArray5<T1, T2, T3, T4, T5>(v1, v2, v3, v4, v5);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6>\ninternal::ValueArray6<T1, T2, T3, T4, T5, T6> Values(T1 v1, T2 v2, T3 v3,\n    T4 v4, T5 v5, T6 v6) {\n  return internal::ValueArray6<T1, T2, T3, T4, T5, T6>(v1, v2, v3, v4, v5, v6);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7>\ninternal::ValueArray7<T1, T2, T3, T4, T5, T6, T7> Values(T1 v1, T2 v2, T3 v3,\n    T4 v4, T5 v5, T6 v6, T7 v7) {\n  return internal::ValueArray7<T1, T2, T3, T4, T5, T6, T7>(v1, v2, v3, v4, v5,\n      v6, v7);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8>\ninternal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8> Values(T1 v1, T2 v2,\n    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) {\n  return internal::ValueArray8<T1, T2, T3, T4, T5, T6, T7, T8>(v1, v2, v3, v4,\n      v5, v6, v7, v8);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9>\ninternal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9> Values(T1 v1, T2 v2,\n    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) {\n  return internal::ValueArray9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(v1, v2, v3,\n      v4, v5, v6, v7, v8, v9);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10>\ninternal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Values(T1 v1,\n    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) {\n  return internal::ValueArray10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(v1,\n      v2, v3, v4, v5, v6, v7, v8, v9, v10);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11>\ninternal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,\n    T11> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11) {\n  return internal::ValueArray11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10,\n      T11>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12>\ninternal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n    T12> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12) {\n  return internal::ValueArray12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13>\ninternal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,\n    T13> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13) {\n  return internal::ValueArray13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14>\ninternal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) {\n  return internal::ValueArray14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,\n      v14);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15>\ninternal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,\n    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) {\n  return internal::ValueArray15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,\n      v13, v14, v15);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16>\ninternal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16) {\n  return internal::ValueArray16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,\n      v12, v13, v14, v15, v16);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17>\ninternal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17) {\n  return internal::ValueArray17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,\n      v11, v12, v13, v14, v15, v16, v17);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18>\ninternal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,\n    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18) {\n  return internal::ValueArray18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18>(v1, v2, v3, v4, v5, v6, v7, v8, v9,\n      v10, v11, v12, v13, v14, v15, v16, v17, v18);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19>\ninternal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,\n    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,\n    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) {\n  return internal::ValueArray19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19>(v1, v2, v3, v4, v5, v6, v7, v8,\n      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20>\ninternal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20> Values(T1 v1, T2 v2, T3 v3, T4 v4,\n    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,\n    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) {\n  return internal::ValueArray20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20>(v1, v2, v3, v4, v5, v6, v7,\n      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21>\ninternal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21> Values(T1 v1, T2 v2, T3 v3, T4 v4,\n    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,\n    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) {\n  return internal::ValueArray21<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(v1, v2, v3, v4, v5, v6,\n      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22>\ninternal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22> Values(T1 v1, T2 v2, T3 v3,\n    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,\n    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,\n    T21 v21, T22 v22) {\n  return internal::ValueArray22<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22>(v1, v2, v3, v4,\n      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,\n      v20, v21, v22);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23>\ninternal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23> Values(T1 v1, T2 v2,\n    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,\n    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,\n    T21 v21, T22 v22, T23 v23) {\n  return internal::ValueArray23<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23>(v1, v2, v3,\n      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,\n      v20, v21, v22, v23);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24>\ninternal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24> Values(T1 v1, T2 v2,\n    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,\n    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,\n    T21 v21, T22 v22, T23 v23, T24 v24) {\n  return internal::ValueArray24<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24>(v1, v2,\n      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,\n      v19, v20, v21, v22, v23, v24);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25>\ninternal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25> Values(T1 v1,\n    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,\n    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,\n    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) {\n  return internal::ValueArray25<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25>(v1,\n      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,\n      v18, v19, v20, v21, v22, v23, v24, v25);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26>\ninternal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n    T26> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26) {\n  return internal::ValueArray26<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,\n      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27>\ninternal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26,\n    T27> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27) {\n  return internal::ValueArray27<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,\n      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28>\ninternal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27,\n    T28> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27, T28 v28) {\n  return internal::ValueArray28<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,\n      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,\n      v28);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29>\ninternal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27, T28 v28, T29 v29) {\n  return internal::ValueArray29<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,\n      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,\n      v27, v28, v29);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30>\ninternal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,\n    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,\n    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,\n    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) {\n  return internal::ValueArray30<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,\n      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,\n      v26, v27, v28, v29, v30);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31>\ninternal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,\n    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) {\n  return internal::ValueArray31<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,\n      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,\n      v25, v26, v27, v28, v29, v30, v31);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32>\ninternal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,\n    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,\n    T32 v32) {\n  return internal::ValueArray32<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32>(v1, v2, v3, v4, v5, v6, v7, v8, v9,\n      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,\n      v24, v25, v26, v27, v28, v29, v30, v31, v32);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33>\ninternal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,\n    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,\n    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,\n    T32 v32, T33 v33) {\n  return internal::ValueArray33<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33>(v1, v2, v3, v4, v5, v6, v7, v8,\n      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,\n      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34>\ninternal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,\n    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,\n    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,\n    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,\n    T31 v31, T32 v32, T33 v33, T34 v34) {\n  return internal::ValueArray34<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34>(v1, v2, v3, v4, v5, v6, v7,\n      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,\n      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35>\ninternal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35> Values(T1 v1, T2 v2, T3 v3, T4 v4,\n    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,\n    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,\n    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,\n    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) {\n  return internal::ValueArray35<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35>(v1, v2, v3, v4, v5, v6,\n      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,\n      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36>\ninternal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36> Values(T1 v1, T2 v2, T3 v3, T4 v4,\n    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,\n    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,\n    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,\n    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) {\n  return internal::ValueArray36<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36>(v1, v2, v3, v4,\n      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,\n      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,\n      v34, v35, v36);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37>\ninternal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37> Values(T1 v1, T2 v2, T3 v3,\n    T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,\n    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,\n    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,\n    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,\n    T37 v37) {\n  return internal::ValueArray37<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37>(v1, v2, v3,\n      v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,\n      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,\n      v34, v35, v36, v37);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38>\ninternal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38> Values(T1 v1, T2 v2,\n    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,\n    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,\n    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,\n    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,\n    T37 v37, T38 v38) {\n  return internal::ValueArray38<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38>(v1, v2,\n      v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18,\n      v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32,\n      v33, v34, v35, v36, v37, v38);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39>\ninternal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39> Values(T1 v1, T2 v2,\n    T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12,\n    T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20,\n    T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28,\n    T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36,\n    T37 v37, T38 v38, T39 v39) {\n  return internal::ValueArray39<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39>(v1,\n      v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17,\n      v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31,\n      v32, v33, v34, v35, v36, v37, v38, v39);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40>\ninternal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40> Values(T1 v1,\n    T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11,\n    T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19,\n    T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27,\n    T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35,\n    T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) {\n  return internal::ValueArray40<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15,\n      v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29,\n      v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41>\ninternal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40,\n    T41> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) {\n  return internal::ValueArray41<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14,\n      v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28,\n      v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42>\ninternal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41,\n    T42> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n    T42 v42) {\n  return internal::ValueArray42<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13,\n      v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27,\n      v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41,\n      v42);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43>\ninternal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42,\n    T43> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n    T42 v42, T43 v43) {\n  return internal::ValueArray43<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12,\n      v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26,\n      v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40,\n      v41, v42, v43);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44>\ninternal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9,\n    T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17,\n    T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25,\n    T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33,\n    T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41,\n    T42 v42, T43 v43, T44 v44) {\n  return internal::ValueArray44<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11,\n      v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25,\n      v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39,\n      v40, v41, v42, v43, v44);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45>\ninternal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8,\n    T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16,\n    T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24,\n    T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32,\n    T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40,\n    T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) {\n  return internal::ValueArray45<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44, T45>(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10,\n      v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24,\n      v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38,\n      v39, v40, v41, v42, v43, v44, v45);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46>\ninternal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45, T46> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,\n    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,\n    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,\n    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) {\n  return internal::ValueArray46<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44, T45, T46>(v1, v2, v3, v4, v5, v6, v7, v8, v9,\n      v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,\n      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,\n      v38, v39, v40, v41, v42, v43, v44, v45, v46);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47>\ninternal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45, T46, T47> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7,\n    T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,\n    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,\n    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,\n    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) {\n  return internal::ValueArray47<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44, T45, T46, T47>(v1, v2, v3, v4, v5, v6, v7, v8,\n      v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23,\n      v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37,\n      v38, v39, v40, v41, v42, v43, v44, v45, v46, v47);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48>\ninternal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45, T46, T47, T48> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6,\n    T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15,\n    T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23,\n    T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31,\n    T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39,\n    T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47,\n    T48 v48) {\n  return internal::ValueArray48<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44, T45, T46, T47, T48>(v1, v2, v3, v4, v5, v6, v7,\n      v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22,\n      v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36,\n      v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49>\ninternal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45, T46, T47, T48, T49> Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5,\n    T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14,\n    T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22,\n    T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30,\n    T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38,\n    T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46,\n    T47 v47, T48 v48, T49 v49) {\n  return internal::ValueArray49<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49>(v1, v2, v3, v4, v5, v6,\n      v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21,\n      v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35,\n      v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49);\n}\n\ntemplate <typename T1, typename T2, typename T3, typename T4, typename T5,\n    typename T6, typename T7, typename T8, typename T9, typename T10,\n    typename T11, typename T12, typename T13, typename T14, typename T15,\n    typename T16, typename T17, typename T18, typename T19, typename T20,\n    typename T21, typename T22, typename T23, typename T24, typename T25,\n    typename T26, typename T27, typename T28, typename T29, typename T30,\n    typename T31, typename T32, typename T33, typename T34, typename T35,\n    typename T36, typename T37, typename T38, typename T39, typename T40,\n    typename T41, typename T42, typename T43, typename T44, typename T45,\n    typename T46, typename T47, typename T48, typename T49, typename T50>\ninternal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,\n    T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28,\n    T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39, T40, T41, T42, T43,\n    T44, T45, T46, T47, T48, T49, T50> Values(T1 v1, T2 v2, T3 v3, T4 v4,\n    T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13,\n    T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21,\n    T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29,\n    T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37,\n    T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45,\n    T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) {\n  return internal::ValueArray50<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,\n      T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25,\n      T26, T27, T28, T29, T30, T31, T32, T33, T34, T35, T36, T37, T38, T39,\n      T40, T41, T42, T43, T44, T45, T46, T47, T48, T49, T50>(v1, v2, v3, v4,\n      v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19,\n      v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33,\n      v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47,\n      v48, v49, v50);\n}\n\n// Bool() allows generating tests with parameters in a set of (false, true).\n//\n// Synopsis:\n// Bool()\n//   - returns a generator producing sequences with elements {false, true}.\n//\n// It is useful when testing code that depends on Boolean flags. Combinations\n// of multiple flags can be tested when several Bool()'s are combined using\n// Combine() function.\n//\n// In the following example all tests in the test case FlagDependentTest\n// will be instantiated twice with parameters false and true.\n//\n// class FlagDependentTest : public testing::TestWithParam<bool> {\n//   virtual void SetUp() {\n//     external_flag = GetParam();\n//   }\n// }\n// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool());\n//\ninline internal::ParamGenerator<bool> Bool() {\n  return Values(false, true);\n}\n\n# if GTEST_HAS_COMBINE\n// Combine() allows the user to combine two or more sequences to produce\n// values of a Cartesian product of those sequences' elements.\n//\n// Synopsis:\n// Combine(gen1, gen2, ..., genN)\n//   - returns a generator producing sequences with elements coming from\n//     the Cartesian product of elements from the sequences generated by\n//     gen1, gen2, ..., genN. The sequence elements will have a type of\n//     tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types\n//     of elements from sequences produces by gen1, gen2, ..., genN.\n//\n// Combine can have up to 10 arguments. This number is currently limited\n// by the maximum number of elements in the tuple implementation used by Google\n// Test.\n//\n// Example:\n//\n// This will instantiate tests in test case AnimalTest each one with\n// the parameter values tuple(\"cat\", BLACK), tuple(\"cat\", WHITE),\n// tuple(\"dog\", BLACK), and tuple(\"dog\", WHITE):\n//\n// enum Color { BLACK, GRAY, WHITE };\n// class AnimalTest\n//     : public testing::TestWithParam<tuple<const char*, Color> > {...};\n//\n// TEST_P(AnimalTest, AnimalLooksNice) {...}\n//\n// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest,\n//                         Combine(Values(\"cat\", \"dog\"),\n//                                 Values(BLACK, WHITE)));\n//\n// This will instantiate tests in FlagDependentTest with all variations of two\n// Boolean flags:\n//\n// class FlagDependentTest\n//     : public testing::TestWithParam<tuple<bool, bool> > {\n//   virtual void SetUp() {\n//     // Assigns external_flag_1 and external_flag_2 values from the tuple.\n//     tie(external_flag_1, external_flag_2) = GetParam();\n//   }\n// };\n//\n// TEST_P(FlagDependentTest, TestFeature1) {\n//   // Test your code using external_flag_1 and external_flag_2 here.\n// }\n// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest,\n//                         Combine(Bool(), Bool()));\n//\ntemplate <typename Generator1, typename Generator2>\ninternal::CartesianProductHolder2<Generator1, Generator2> Combine(\n    const Generator1& g1, const Generator2& g2) {\n  return internal::CartesianProductHolder2<Generator1, Generator2>(\n      g1, g2);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3>\ninternal::CartesianProductHolder3<Generator1, Generator2, Generator3> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3) {\n  return internal::CartesianProductHolder3<Generator1, Generator2, Generator3>(\n      g1, g2, g3);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4>\ninternal::CartesianProductHolder4<Generator1, Generator2, Generator3,\n    Generator4> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4) {\n  return internal::CartesianProductHolder4<Generator1, Generator2, Generator3,\n      Generator4>(\n      g1, g2, g3, g4);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4, typename Generator5>\ninternal::CartesianProductHolder5<Generator1, Generator2, Generator3,\n    Generator4, Generator5> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4, const Generator5& g5) {\n  return internal::CartesianProductHolder5<Generator1, Generator2, Generator3,\n      Generator4, Generator5>(\n      g1, g2, g3, g4, g5);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4, typename Generator5, typename Generator6>\ninternal::CartesianProductHolder6<Generator1, Generator2, Generator3,\n    Generator4, Generator5, Generator6> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4, const Generator5& g5, const Generator6& g6) {\n  return internal::CartesianProductHolder6<Generator1, Generator2, Generator3,\n      Generator4, Generator5, Generator6>(\n      g1, g2, g3, g4, g5, g6);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4, typename Generator5, typename Generator6,\n    typename Generator7>\ninternal::CartesianProductHolder7<Generator1, Generator2, Generator3,\n    Generator4, Generator5, Generator6, Generator7> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4, const Generator5& g5, const Generator6& g6,\n        const Generator7& g7) {\n  return internal::CartesianProductHolder7<Generator1, Generator2, Generator3,\n      Generator4, Generator5, Generator6, Generator7>(\n      g1, g2, g3, g4, g5, g6, g7);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4, typename Generator5, typename Generator6,\n    typename Generator7, typename Generator8>\ninternal::CartesianProductHolder8<Generator1, Generator2, Generator3,\n    Generator4, Generator5, Generator6, Generator7, Generator8> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4, const Generator5& g5, const Generator6& g6,\n        const Generator7& g7, const Generator8& g8) {\n  return internal::CartesianProductHolder8<Generator1, Generator2, Generator3,\n      Generator4, Generator5, Generator6, Generator7, Generator8>(\n      g1, g2, g3, g4, g5, g6, g7, g8);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4, typename Generator5, typename Generator6,\n    typename Generator7, typename Generator8, typename Generator9>\ninternal::CartesianProductHolder9<Generator1, Generator2, Generator3,\n    Generator4, Generator5, Generator6, Generator7, Generator8,\n    Generator9> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4, const Generator5& g5, const Generator6& g6,\n        const Generator7& g7, const Generator8& g8, const Generator9& g9) {\n  return internal::CartesianProductHolder9<Generator1, Generator2, Generator3,\n      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9>(\n      g1, g2, g3, g4, g5, g6, g7, g8, g9);\n}\n\ntemplate <typename Generator1, typename Generator2, typename Generator3,\n    typename Generator4, typename Generator5, typename Generator6,\n    typename Generator7, typename Generator8, typename Generator9,\n    typename Generator10>\ninternal::CartesianProductHolder10<Generator1, Generator2, Generator3,\n    Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,\n    Generator10> Combine(\n    const Generator1& g1, const Generator2& g2, const Generator3& g3,\n        const Generator4& g4, const Generator5& g5, const Generator6& g6,\n        const Generator7& g7, const Generator8& g8, const Generator9& g9,\n        const Generator10& g10) {\n  return internal::CartesianProductHolder10<Generator1, Generator2, Generator3,\n      Generator4, Generator5, Generator6, Generator7, Generator8, Generator9,\n      Generator10>(\n      g1, g2, g3, g4, g5, g6, g7, g8, g9, g10);\n}\n# endif  // GTEST_HAS_COMBINE\n\n# define TEST_P(test_case_name, test_name) \\\n  class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \\\n      : public test_case_name { \\\n   public: \\\n    GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \\\n    virtual void TestBody(); \\\n   private: \\\n    static int AddToRegistry() { \\\n      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \\\n          GetTestCasePatternHolder<test_case_name>(\\\n              #test_case_name, \\\n              ::testing::internal::CodeLocation(\\\n                  __FILE__, __LINE__))->AddTestPattern(\\\n                      GTEST_STRINGIFY_(test_case_name), \\\n                      GTEST_STRINGIFY_(test_name), \\\n                      new ::testing::internal::TestMetaFactory< \\\n                          GTEST_TEST_CLASS_NAME_(\\\n                              test_case_name, test_name)>()); \\\n      return 0; \\\n    } \\\n    static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \\\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(\\\n        GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \\\n  }; \\\n  int GTEST_TEST_CLASS_NAME_(test_case_name, \\\n                             test_name)::gtest_registering_dummy_ = \\\n      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \\\n  void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()\n\n// The optional last argument to INSTANTIATE_TEST_CASE_P allows the user\n// to specify a function or functor that generates custom test name suffixes\n// based on the test parameters. The function should accept one argument of\n// type testing::TestParamInfo<class ParamType>, and return std::string.\n//\n// testing::PrintToStringParamName is a builtin test suffix generator that\n// returns the value of testing::PrintToString(GetParam()).\n//\n// Note: test names must be non-empty, unique, and may only contain ASCII\n// alphanumeric characters or underscore. Because PrintToString adds quotes\n// to std::string and C strings, it won't work for these types.\n\n# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \\\n  static ::testing::internal::ParamGenerator<test_case_name::ParamType> \\\n      gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \\\n  static ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \\\n      const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \\\n    return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \\\n        (__VA_ARGS__)(info); \\\n  } \\\n  static int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \\\n      ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \\\n          GetTestCasePatternHolder<test_case_name>(\\\n              #test_case_name, \\\n              ::testing::internal::CodeLocation(\\\n                  __FILE__, __LINE__))->AddTestCaseInstantiation(\\\n                      #prefix, \\\n                      &gtest_##prefix##test_case_name##_EvalGenerator_, \\\n                      &gtest_##prefix##test_case_name##_EvalGenerateName_, \\\n                      __FILE__, __LINE__)\n\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_\n// Copyright 2006, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n//\n// Google C++ Testing and Mocking Framework definitions useful in production code.\n// GOOGLETEST_CM0003 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_\n#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_\n\n// When you need to test the private or protected members of a class,\n// use the FRIEND_TEST macro to declare your tests as friends of the\n// class.  For example:\n//\n// class MyClass {\n//  private:\n//   void PrivateMethod();\n//   FRIEND_TEST(MyClassTest, PrivateMethodWorks);\n// };\n//\n// class MyClassTest : public testing::Test {\n//   // ...\n// };\n//\n// TEST_F(MyClassTest, PrivateMethodWorks) {\n//   // Can call MyClass::PrivateMethod() here.\n// }\n//\n// Note: The test class must be in the same namespace as the class being tested.\n// For example, putting MyClassTest in an anonymous namespace will not work.\n\n#define FRIEND_TEST(test_case_name, test_name)\\\nfriend class test_case_name##_##test_name##_Test\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_PROD_H_\n// Copyright 2008, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_\n#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_\n\n#include <iosfwd>\n#include <vector>\n\nGTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \\\n/* class A needs to have dll-interface to be used by clients of class B */)\n\nnamespace testing {\n\n// A copyable object representing the result of a test part (i.e. an\n// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).\n//\n// Don't inherit from TestPartResult as its destructor is not virtual.\nclass GTEST_API_ TestPartResult {\n public:\n  // The possible outcomes of a test part (i.e. an assertion or an\n  // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).\n  enum Type {\n    kSuccess,          // Succeeded.\n    kNonFatalFailure,  // Failed but the test can continue.\n    kFatalFailure      // Failed and the test should be terminated.\n  };\n\n  // C'tor.  TestPartResult does NOT have a default constructor.\n  // Always use this constructor (with parameters) to create a\n  // TestPartResult object.\n  TestPartResult(Type a_type,\n                 const char* a_file_name,\n                 int a_line_number,\n                 const char* a_message)\n      : type_(a_type),\n        file_name_(a_file_name == NULL ? \"\" : a_file_name),\n        line_number_(a_line_number),\n        summary_(ExtractSummary(a_message)),\n        message_(a_message) {\n  }\n\n  // Gets the outcome of the test part.\n  Type type() const { return type_; }\n\n  // Gets the name of the source file where the test part took place, or\n  // NULL if it's unknown.\n  const char* file_name() const {\n    return file_name_.empty() ? NULL : file_name_.c_str();\n  }\n\n  // Gets the line in the source file where the test part took place,\n  // or -1 if it's unknown.\n  int line_number() const { return line_number_; }\n\n  // Gets the summary of the failure message.\n  const char* summary() const { return summary_.c_str(); }\n\n  // Gets the message associated with the test part.\n  const char* message() const { return message_.c_str(); }\n\n  // Returns true iff the test part passed.\n  bool passed() const { return type_ == kSuccess; }\n\n  // Returns true iff the test part failed.\n  bool failed() const { return type_ != kSuccess; }\n\n  // Returns true iff the test part non-fatally failed.\n  bool nonfatally_failed() const { return type_ == kNonFatalFailure; }\n\n  // Returns true iff the test part fatally failed.\n  bool fatally_failed() const { return type_ == kFatalFailure; }\n\n private:\n  Type type_;\n\n  // Gets the summary of the failure message by omitting the stack\n  // trace in it.\n  static std::string ExtractSummary(const char* message);\n\n  // The name of the source file where the test part took place, or\n  // \"\" if the source file is unknown.\n  std::string file_name_;\n  // The line in the source file where the test part took place, or -1\n  // if the line number is unknown.\n  int line_number_;\n  std::string summary_;  // The test failure summary.\n  std::string message_;  // The test failure message.\n};\n\n// Prints a TestPartResult object.\nstd::ostream& operator<<(std::ostream& os, const TestPartResult& result);\n\n// An array of TestPartResult objects.\n//\n// Don't inherit from TestPartResultArray as its destructor is not\n// virtual.\nclass GTEST_API_ TestPartResultArray {\n public:\n  TestPartResultArray() {}\n\n  // Appends the given TestPartResult to the array.\n  void Append(const TestPartResult& result);\n\n  // Returns the TestPartResult at the given index (0-based).\n  const TestPartResult& GetTestPartResult(int index) const;\n\n  // Returns the number of TestPartResult objects in the array.\n  int size() const;\n\n private:\n  std::vector<TestPartResult> array_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);\n};\n\n// This interface knows how to report a test part result.\nclass GTEST_API_ TestPartResultReporterInterface {\n public:\n  virtual ~TestPartResultReporterInterface() {}\n\n  virtual void ReportTestPartResult(const TestPartResult& result) = 0;\n};\n\nnamespace internal {\n\n// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a\n// statement generates new fatal failures. To do so it registers itself as the\n// current test part result reporter. Besides checking if fatal failures were\n// reported, it only delegates the reporting to the former result reporter.\n// The original result reporter is restored in the destructor.\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nclass GTEST_API_ HasNewFatalFailureHelper\n    : public TestPartResultReporterInterface {\n public:\n  HasNewFatalFailureHelper();\n  virtual ~HasNewFatalFailureHelper();\n  virtual void ReportTestPartResult(const TestPartResult& result);\n  bool has_new_fatal_failure() const { return has_new_fatal_failure_; }\n private:\n  bool has_new_fatal_failure_;\n  TestPartResultReporterInterface* original_reporter_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);\n};\n\n}  // namespace internal\n\n}  // namespace testing\n\nGTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_\n// Copyright 2008 Google Inc.\n// All Rights Reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_\n#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_\n\n// This header implements typed tests and type-parameterized tests.\n\n// Typed (aka type-driven) tests repeat the same test for types in a\n// list.  You must know which types you want to test with when writing\n// typed tests. Here's how you do it:\n\n#if 0\n\n// First, define a fixture class template.  It should be parameterized\n// by a type.  Remember to derive it from testing::Test.\ntemplate <typename T>\nclass FooTest : public testing::Test {\n public:\n  ...\n  typedef std::list<T> List;\n  static T shared_;\n  T value_;\n};\n\n// Next, associate a list of types with the test case, which will be\n// repeated for each type in the list.  The typedef is necessary for\n// the macro to parse correctly.\ntypedef testing::Types<char, int, unsigned int> MyTypes;\nTYPED_TEST_CASE(FooTest, MyTypes);\n\n// If the type list contains only one type, you can write that type\n// directly without Types<...>:\n//   TYPED_TEST_CASE(FooTest, int);\n\n// Then, use TYPED_TEST() instead of TEST_F() to define as many typed\n// tests for this test case as you want.\nTYPED_TEST(FooTest, DoesBlah) {\n  // Inside a test, refer to TypeParam to get the type parameter.\n  // Since we are inside a derived class template, C++ requires use to\n  // visit the members of FooTest via 'this'.\n  TypeParam n = this->value_;\n\n  // To visit static members of the fixture, add the TestFixture::\n  // prefix.\n  n += TestFixture::shared_;\n\n  // To refer to typedefs in the fixture, add the \"typename\n  // TestFixture::\" prefix.\n  typename TestFixture::List values;\n  values.push_back(n);\n  ...\n}\n\nTYPED_TEST(FooTest, HasPropertyA) { ... }\n\n// TYPED_TEST_CASE takes an optional third argument which allows to specify a\n// class that generates custom test name suffixes based on the type. This should\n// be a class which has a static template function GetName(int index) returning\n// a string for each type. The provided integer index equals the index of the\n// type in the provided type list. In many cases the index can be ignored.\n//\n// For example:\n//   class MyTypeNames {\n//    public:\n//     template <typename T>\n//     static std::string GetName(int) {\n//       if (std::is_same<T, char>()) return \"char\";\n//       if (std::is_same<T, int>()) return \"int\";\n//       if (std::is_same<T, unsigned int>()) return \"unsignedInt\";\n//     }\n//   };\n//   TYPED_TEST_CASE(FooTest, MyTypes, MyTypeNames);\n\n#endif  // 0\n\n// Type-parameterized tests are abstract test patterns parameterized\n// by a type.  Compared with typed tests, type-parameterized tests\n// allow you to define the test pattern without knowing what the type\n// parameters are.  The defined pattern can be instantiated with\n// different types any number of times, in any number of translation\n// units.\n//\n// If you are designing an interface or concept, you can define a\n// suite of type-parameterized tests to verify properties that any\n// valid implementation of the interface/concept should have.  Then,\n// each implementation can easily instantiate the test suite to verify\n// that it conforms to the requirements, without having to write\n// similar tests repeatedly.  Here's an example:\n\n#if 0\n\n// First, define a fixture class template.  It should be parameterized\n// by a type.  Remember to derive it from testing::Test.\ntemplate <typename T>\nclass FooTest : public testing::Test {\n  ...\n};\n\n// Next, declare that you will define a type-parameterized test case\n// (the _P suffix is for \"parameterized\" or \"pattern\", whichever you\n// prefer):\nTYPED_TEST_CASE_P(FooTest);\n\n// Then, use TYPED_TEST_P() to define as many type-parameterized tests\n// for this type-parameterized test case as you want.\nTYPED_TEST_P(FooTest, DoesBlah) {\n  // Inside a test, refer to TypeParam to get the type parameter.\n  TypeParam n = 0;\n  ...\n}\n\nTYPED_TEST_P(FooTest, HasPropertyA) { ... }\n\n// Now the tricky part: you need to register all test patterns before\n// you can instantiate them.  The first argument of the macro is the\n// test case name; the rest are the names of the tests in this test\n// case.\nREGISTER_TYPED_TEST_CASE_P(FooTest,\n                           DoesBlah, HasPropertyA);\n\n// Finally, you are free to instantiate the pattern with the types you\n// want.  If you put the above code in a header file, you can #include\n// it in multiple C++ source files and instantiate it multiple times.\n//\n// To distinguish different instances of the pattern, the first\n// argument to the INSTANTIATE_* macro is a prefix that will be added\n// to the actual test case name.  Remember to pick unique prefixes for\n// different instances.\ntypedef testing::Types<char, int, unsigned int> MyTypes;\nINSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);\n\n// If the type list contains only one type, you can write that type\n// directly without Types<...>:\n//   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);\n//\n// Similar to the optional argument of TYPED_TEST_CASE above,\n// INSTANTIATE_TEST_CASE_P takes an optional fourth argument which allows to\n// generate custom names.\n//   INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes, MyTypeNames);\n\n#endif  // 0\n\n\n// Implements typed tests.\n\n#if GTEST_HAS_TYPED_TEST\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Expands to the name of the typedef for the type parameters of the\n// given test case.\n# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_\n\n// Expands to the name of the typedef for the NameGenerator, responsible for\n// creating the suffixes of the name.\n#define GTEST_NAME_GENERATOR_(TestCaseName) \\\n  gtest_type_params_##TestCaseName##_NameGenerator\n\n// The 'Types' template argument below must have spaces around it\n// since some compilers may choke on '>>' when passing a template\n// instance (e.g. Types<int>)\n# define TYPED_TEST_CASE(CaseName, Types, ...)                             \\\n  typedef ::testing::internal::TypeList< Types >::type GTEST_TYPE_PARAMS_( \\\n      CaseName);                                                           \\\n  typedef ::testing::internal::NameGeneratorSelector<__VA_ARGS__>::type    \\\n      GTEST_NAME_GENERATOR_(CaseName)\n\n# define TYPED_TEST(CaseName, TestName)                                       \\\n  template <typename gtest_TypeParam_>                                        \\\n  class GTEST_TEST_CLASS_NAME_(CaseName, TestName)                            \\\n      : public CaseName<gtest_TypeParam_> {                                   \\\n   private:                                                                   \\\n    typedef CaseName<gtest_TypeParam_> TestFixture;                           \\\n    typedef gtest_TypeParam_ TypeParam;                                       \\\n    virtual void TestBody();                                                  \\\n  };                                                                          \\\n  static bool gtest_##CaseName##_##TestName##_registered_                     \\\n        GTEST_ATTRIBUTE_UNUSED_ =                                             \\\n      ::testing::internal::TypeParameterizedTest<                             \\\n          CaseName,                                                           \\\n          ::testing::internal::TemplateSel<GTEST_TEST_CLASS_NAME_(CaseName,   \\\n                                                                  TestName)>, \\\n          GTEST_TYPE_PARAMS_(                                                 \\\n              CaseName)>::Register(\"\",                                        \\\n                                   ::testing::internal::CodeLocation(         \\\n                                       __FILE__, __LINE__),                   \\\n                                   #CaseName, #TestName, 0,                   \\\n                                   ::testing::internal::GenerateNames<        \\\n                                       GTEST_NAME_GENERATOR_(CaseName),       \\\n                                       GTEST_TYPE_PARAMS_(CaseName)>());      \\\n  template <typename gtest_TypeParam_>                                        \\\n  void GTEST_TEST_CLASS_NAME_(CaseName,                                       \\\n                              TestName)<gtest_TypeParam_>::TestBody()\n\n#endif  // GTEST_HAS_TYPED_TEST\n\n// Implements type-parameterized tests.\n\n#if GTEST_HAS_TYPED_TEST_P\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Expands to the namespace name that the type-parameterized tests for\n// the given type-parameterized test case are defined in.  The exact\n// name of the namespace is subject to change without notice.\n# define GTEST_CASE_NAMESPACE_(TestCaseName) \\\n  gtest_case_##TestCaseName##_\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n//\n// Expands to the name of the variable used to remember the names of\n// the defined tests in the given test case.\n# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \\\n  gtest_typed_test_case_p_state_##TestCaseName##_\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.\n//\n// Expands to the name of the variable used to remember the names of\n// the registered tests in the given test case.\n# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \\\n  gtest_registered_test_names_##TestCaseName##_\n\n// The variables defined in the type-parameterized test macros are\n// static as typically these macros are used in a .h file that can be\n// #included in multiple translation units linked together.\n# define TYPED_TEST_CASE_P(CaseName) \\\n  static ::testing::internal::TypedTestCasePState \\\n      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName)\n\n# define TYPED_TEST_P(CaseName, TestName) \\\n  namespace GTEST_CASE_NAMESPACE_(CaseName) { \\\n  template <typename gtest_TypeParam_> \\\n  class TestName : public CaseName<gtest_TypeParam_> { \\\n   private: \\\n    typedef CaseName<gtest_TypeParam_> TestFixture; \\\n    typedef gtest_TypeParam_ TypeParam; \\\n    virtual void TestBody(); \\\n  }; \\\n  static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \\\n      GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\\\n          __FILE__, __LINE__, #CaseName, #TestName); \\\n  } \\\n  template <typename gtest_TypeParam_> \\\n  void GTEST_CASE_NAMESPACE_(CaseName)::TestName<gtest_TypeParam_>::TestBody()\n\n# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \\\n  namespace GTEST_CASE_NAMESPACE_(CaseName) { \\\n  typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \\\n  } \\\n  static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) \\\n      GTEST_ATTRIBUTE_UNUSED_ = \\\n          GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames( \\\n              __FILE__, __LINE__, #__VA_ARGS__)\n\n// The 'Types' template argument below must have spaces around it\n// since some compilers may choke on '>>' when passing a template\n// instance (e.g. Types<int>)\n# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types, ...)      \\\n  static bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ =       \\\n      ::testing::internal::TypeParameterizedTestCase<                     \\\n          CaseName, GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_,     \\\n          ::testing::internal::TypeList< Types >::type>::                 \\\n          Register(#Prefix,                                               \\\n                   ::testing::internal::CodeLocation(__FILE__, __LINE__), \\\n                   &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), #CaseName,  \\\n                   GTEST_REGISTERED_TEST_NAMES_(CaseName),                \\\n                   ::testing::internal::GenerateNames<                    \\\n                       ::testing::internal::NameGeneratorSelector<        \\\n                           __VA_ARGS__>::type,                            \\\n                       ::testing::internal::TypeList< Types >::type>())\n\n#endif  // GTEST_HAS_TYPED_TEST_P\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_\n\nGTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \\\n/* class A needs to have dll-interface to be used by clients of class B */)\n\n// Depending on the platform, different string classes are available.\n// On Linux, in addition to ::std::string, Google also makes use of\n// class ::string, which has the same interface as ::std::string, but\n// has a different implementation.\n//\n// You can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that\n// ::string is available AND is a distinct type to ::std::string, or\n// define it to 0 to indicate otherwise.\n//\n// If ::std::string and ::string are the same class on your platform\n// due to aliasing, you should define GTEST_HAS_GLOBAL_STRING to 0.\n//\n// If you do not define GTEST_HAS_GLOBAL_STRING, it is defined\n// heuristically.\n\nnamespace testing {\n\n// Silence C4100 (unreferenced formal parameter) and 4805\n// unsafe mix of type 'const int' and type 'const bool'\n#ifdef _MSC_VER\n# pragma warning(push)\n# pragma warning(disable:4805)\n# pragma warning(disable:4100)\n#endif\n\n\n// Declares the flags.\n\n// This flag temporary enables the disabled tests.\nGTEST_DECLARE_bool_(also_run_disabled_tests);\n\n// This flag brings the debugger on an assertion failure.\nGTEST_DECLARE_bool_(break_on_failure);\n\n// This flag controls whether Google Test catches all test-thrown exceptions\n// and logs them as failures.\nGTEST_DECLARE_bool_(catch_exceptions);\n\n// This flag enables using colors in terminal output. Available values are\n// \"yes\" to enable colors, \"no\" (disable colors), or \"auto\" (the default)\n// to let Google Test decide.\nGTEST_DECLARE_string_(color);\n\n// This flag sets up the filter to select by name using a glob pattern\n// the tests to run. If the filter is not given all tests are executed.\nGTEST_DECLARE_string_(filter);\n\n// This flag controls whether Google Test installs a signal handler that dumps\n// debugging information when fatal signals are raised.\nGTEST_DECLARE_bool_(install_failure_signal_handler);\n\n// This flag causes the Google Test to list tests. None of the tests listed\n// are actually run if the flag is provided.\nGTEST_DECLARE_bool_(list_tests);\n\n// This flag controls whether Google Test emits a detailed XML report to a file\n// in addition to its normal textual output.\nGTEST_DECLARE_string_(output);\n\n// This flags control whether Google Test prints the elapsed time for each\n// test.\nGTEST_DECLARE_bool_(print_time);\n\n// This flags control whether Google Test prints UTF8 characters as text.\nGTEST_DECLARE_bool_(print_utf8);\n\n// This flag specifies the random number seed.\nGTEST_DECLARE_int32_(random_seed);\n\n// This flag sets how many times the tests are repeated. The default value\n// is 1. If the value is -1 the tests are repeating forever.\nGTEST_DECLARE_int32_(repeat);\n\n// This flag controls whether Google Test includes Google Test internal\n// stack frames in failure stack traces.\nGTEST_DECLARE_bool_(show_internal_stack_frames);\n\n// When this flag is specified, tests' order is randomized on every iteration.\nGTEST_DECLARE_bool_(shuffle);\n\n// This flag specifies the maximum number of stack frames to be\n// printed in a failure message.\nGTEST_DECLARE_int32_(stack_trace_depth);\n\n// When this flag is specified, a failed assertion will throw an\n// exception if exceptions are enabled, or exit the program with a\n// non-zero code otherwise. For use with an external test framework.\nGTEST_DECLARE_bool_(throw_on_failure);\n\n// When this flag is set with a \"host:port\" string, on supported\n// platforms test results are streamed to the specified port on\n// the specified host machine.\nGTEST_DECLARE_string_(stream_result_to);\n\n#if GTEST_USE_OWN_FLAGFILE_FLAG_\nGTEST_DECLARE_string_(flagfile);\n#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_\n\n// The upper limit for valid stack trace depths.\nconst int kMaxStackTraceDepth = 100;\n\nnamespace internal {\n\nclass AssertHelper;\nclass DefaultGlobalTestPartResultReporter;\nclass ExecDeathTest;\nclass NoExecDeathTest;\nclass FinalSuccessChecker;\nclass GTestFlagSaver;\nclass StreamingListenerTest;\nclass TestResultAccessor;\nclass TestEventListenersAccessor;\nclass TestEventRepeater;\nclass UnitTestRecordPropertyTestHelper;\nclass WindowsDeathTest;\nclass FuchsiaDeathTest;\nclass UnitTestImpl* GetUnitTestImpl();\nvoid ReportFailureInUnknownLocation(TestPartResult::Type result_type,\n                                    const std::string& message);\n\n}  // namespace internal\n\n// The friend relationship of some of these classes is cyclic.\n// If we don't forward declare them the compiler might confuse the classes\n// in friendship clauses with same named classes on the scope.\nclass Test;\nclass TestCase;\nclass TestInfo;\nclass UnitTest;\n\n// A class for indicating whether an assertion was successful.  When\n// the assertion wasn't successful, the AssertionResult object\n// remembers a non-empty message that describes how it failed.\n//\n// To create an instance of this class, use one of the factory functions\n// (AssertionSuccess() and AssertionFailure()).\n//\n// This class is useful for two purposes:\n//   1. Defining predicate functions to be used with Boolean test assertions\n//      EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts\n//   2. Defining predicate-format functions to be\n//      used with predicate assertions (ASSERT_PRED_FORMAT*, etc).\n//\n// For example, if you define IsEven predicate:\n//\n//   testing::AssertionResult IsEven(int n) {\n//     if ((n % 2) == 0)\n//       return testing::AssertionSuccess();\n//     else\n//       return testing::AssertionFailure() << n << \" is odd\";\n//   }\n//\n// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))\n// will print the message\n//\n//   Value of: IsEven(Fib(5))\n//     Actual: false (5 is odd)\n//   Expected: true\n//\n// instead of a more opaque\n//\n//   Value of: IsEven(Fib(5))\n//     Actual: false\n//   Expected: true\n//\n// in case IsEven is a simple Boolean predicate.\n//\n// If you expect your predicate to be reused and want to support informative\n// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up\n// about half as often as positive ones in our tests), supply messages for\n// both success and failure cases:\n//\n//   testing::AssertionResult IsEven(int n) {\n//     if ((n % 2) == 0)\n//       return testing::AssertionSuccess() << n << \" is even\";\n//     else\n//       return testing::AssertionFailure() << n << \" is odd\";\n//   }\n//\n// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print\n//\n//   Value of: IsEven(Fib(6))\n//     Actual: true (8 is even)\n//   Expected: false\n//\n// NB: Predicates that support negative Boolean assertions have reduced\n// performance in positive ones so be careful not to use them in tests\n// that have lots (tens of thousands) of positive Boolean assertions.\n//\n// To use this class with EXPECT_PRED_FORMAT assertions such as:\n//\n//   // Verifies that Foo() returns an even number.\n//   EXPECT_PRED_FORMAT1(IsEven, Foo());\n//\n// you need to define:\n//\n//   testing::AssertionResult IsEven(const char* expr, int n) {\n//     if ((n % 2) == 0)\n//       return testing::AssertionSuccess();\n//     else\n//       return testing::AssertionFailure()\n//         << \"Expected: \" << expr << \" is even\\n  Actual: it's \" << n;\n//   }\n//\n// If Foo() returns 5, you will see the following message:\n//\n//   Expected: Foo() is even\n//     Actual: it's 5\n//\nclass GTEST_API_ AssertionResult {\n public:\n  // Copy constructor.\n  // Used in EXPECT_TRUE/FALSE(assertion_result).\n  AssertionResult(const AssertionResult& other);\n\n#if defined(_MSC_VER) && _MSC_VER < 1910\n  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */)\n#endif\n\n  // Used in the EXPECT_TRUE/FALSE(bool_expression).\n  //\n  // T must be contextually convertible to bool.\n  //\n  // The second parameter prevents this overload from being considered if\n  // the argument is implicitly convertible to AssertionResult. In that case\n  // we want AssertionResult's copy constructor to be used.\n  template <typename T>\n  explicit AssertionResult(\n      const T& success,\n      typename internal::EnableIf<\n          !internal::ImplicitlyConvertible<T, AssertionResult>::value>::type*\n          /*enabler*/ = NULL)\n      : success_(success) {}\n\n#if defined(_MSC_VER) && _MSC_VER < 1910\n  GTEST_DISABLE_MSC_WARNINGS_POP_()\n#endif\n\n  // Assignment operator.\n  AssertionResult& operator=(AssertionResult other) {\n    swap(other);\n    return *this;\n  }\n\n  // Returns true iff the assertion succeeded.\n  operator bool() const { return success_; }  // NOLINT\n\n  // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.\n  AssertionResult operator!() const;\n\n  // Returns the text streamed into this AssertionResult. Test assertions\n  // use it when they fail (i.e., the predicate's outcome doesn't match the\n  // assertion's expectation). When nothing has been streamed into the\n  // object, returns an empty string.\n  const char* message() const {\n    return message_.get() != NULL ?  message_->c_str() : \"\";\n  }\n  // FIXME: Remove this after making sure no clients use it.\n  // Deprecated; please use message() instead.\n  const char* failure_message() const { return message(); }\n\n  // Streams a custom failure message into this object.\n  template <typename T> AssertionResult& operator<<(const T& value) {\n    AppendMessage(Message() << value);\n    return *this;\n  }\n\n  // Allows streaming basic output manipulators such as endl or flush into\n  // this object.\n  AssertionResult& operator<<(\n      ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {\n    AppendMessage(Message() << basic_manipulator);\n    return *this;\n  }\n\n private:\n  // Appends the contents of message to message_.\n  void AppendMessage(const Message& a_message) {\n    if (message_.get() == NULL)\n      message_.reset(new ::std::string);\n    message_->append(a_message.GetString().c_str());\n  }\n\n  // Swap the contents of this AssertionResult with other.\n  void swap(AssertionResult& other);\n\n  // Stores result of the assertion predicate.\n  bool success_;\n  // Stores the message describing the condition in case the expectation\n  // construct is not satisfied with the predicate's outcome.\n  // Referenced via a pointer to avoid taking too much stack frame space\n  // with test assertions.\n  internal::scoped_ptr< ::std::string> message_;\n};\n\n// Makes a successful assertion result.\nGTEST_API_ AssertionResult AssertionSuccess();\n\n// Makes a failed assertion result.\nGTEST_API_ AssertionResult AssertionFailure();\n\n// Makes a failed assertion result with the given failure message.\n// Deprecated; use AssertionFailure() << msg.\nGTEST_API_ AssertionResult AssertionFailure(const Message& msg);\n\n}  // namespace testing\n\n// Includes the auto-generated header that implements a family of generic\n// predicate assertion macros. This include comes late because it relies on\n// APIs declared above.\n// Copyright 2006, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// This file is AUTOMATICALLY GENERATED on 01/02/2018 by command\n// 'gen_gtest_pred_impl.py 5'.  DO NOT EDIT BY HAND!\n//\n// Implements a family of generic predicate assertion macros.\n\n// GOOGLETEST_CM0001 DO NOT DELETE\n\n#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_\n#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_\n\n\nnamespace testing {\n\n// This header implements a family of generic predicate assertion\n// macros:\n//\n//   ASSERT_PRED_FORMAT1(pred_format, v1)\n//   ASSERT_PRED_FORMAT2(pred_format, v1, v2)\n//   ...\n//\n// where pred_format is a function or functor that takes n (in the\n// case of ASSERT_PRED_FORMATn) values and their source expression\n// text, and returns a testing::AssertionResult.  See the definition\n// of ASSERT_EQ in gtest.h for an example.\n//\n// If you don't care about formatting, you can use the more\n// restrictive version:\n//\n//   ASSERT_PRED1(pred, v1)\n//   ASSERT_PRED2(pred, v1, v2)\n//   ...\n//\n// where pred is an n-ary function or functor that returns bool,\n// and the values v1, v2, ..., must support the << operator for\n// streaming to std::ostream.\n//\n// We also define the EXPECT_* variations.\n//\n// For now we only support predicates whose arity is at most 5.\n\n// GTEST_ASSERT_ is the basic statement to which all of the assertions\n// in this file reduce.  Don't use this in your code.\n\n#define GTEST_ASSERT_(expression, on_failure) \\\n  GTEST_AMBIGUOUS_ELSE_BLOCKER_ \\\n  if (const ::testing::AssertionResult gtest_ar = (expression)) \\\n    ; \\\n  else \\\n    on_failure(gtest_ar.failure_message())\n\n\n// Helper function for implementing {EXPECT|ASSERT}_PRED1.  Don't use\n// this in your code.\ntemplate <typename Pred,\n          typename T1>\nAssertionResult AssertPred1Helper(const char* pred_text,\n                                  const char* e1,\n                                  Pred pred,\n                                  const T1& v1) {\n  if (pred(v1)) return AssertionSuccess();\n\n  return AssertionFailure() << pred_text << \"(\"\n                            << e1 << \") evaluates to false, where\"\n                            << \"\\n\" << e1 << \" evaluates to \" << v1;\n}\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.\n// Don't use this in your code.\n#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\\\n  GTEST_ASSERT_(pred_format(#v1, v1), \\\n                on_failure)\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED1.  Don't use\n// this in your code.\n#define GTEST_PRED1_(pred, v1, on_failure)\\\n  GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \\\n                                             #v1, \\\n                                             pred, \\\n                                             v1), on_failure)\n\n// Unary predicate assertion macros.\n#define EXPECT_PRED_FORMAT1(pred_format, v1) \\\n  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_PRED1(pred, v1) \\\n  GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)\n#define ASSERT_PRED_FORMAT1(pred_format, v1) \\\n  GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)\n#define ASSERT_PRED1(pred, v1) \\\n  GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)\n\n\n\n// Helper function for implementing {EXPECT|ASSERT}_PRED2.  Don't use\n// this in your code.\ntemplate <typename Pred,\n          typename T1,\n          typename T2>\nAssertionResult AssertPred2Helper(const char* pred_text,\n                                  const char* e1,\n                                  const char* e2,\n                                  Pred pred,\n                                  const T1& v1,\n                                  const T2& v2) {\n  if (pred(v1, v2)) return AssertionSuccess();\n\n  return AssertionFailure() << pred_text << \"(\"\n                            << e1 << \", \"\n                            << e2 << \") evaluates to false, where\"\n                            << \"\\n\" << e1 << \" evaluates to \" << v1\n                            << \"\\n\" << e2 << \" evaluates to \" << v2;\n}\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.\n// Don't use this in your code.\n#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\\\n  GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \\\n                on_failure)\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED2.  Don't use\n// this in your code.\n#define GTEST_PRED2_(pred, v1, v2, on_failure)\\\n  GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \\\n                                             #v1, \\\n                                             #v2, \\\n                                             pred, \\\n                                             v1, \\\n                                             v2), on_failure)\n\n// Binary predicate assertion macros.\n#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \\\n  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_PRED2(pred, v1, v2) \\\n  GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)\n#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \\\n  GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)\n#define ASSERT_PRED2(pred, v1, v2) \\\n  GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)\n\n\n\n// Helper function for implementing {EXPECT|ASSERT}_PRED3.  Don't use\n// this in your code.\ntemplate <typename Pred,\n          typename T1,\n          typename T2,\n          typename T3>\nAssertionResult AssertPred3Helper(const char* pred_text,\n                                  const char* e1,\n                                  const char* e2,\n                                  const char* e3,\n                                  Pred pred,\n                                  const T1& v1,\n                                  const T2& v2,\n                                  const T3& v3) {\n  if (pred(v1, v2, v3)) return AssertionSuccess();\n\n  return AssertionFailure() << pred_text << \"(\"\n                            << e1 << \", \"\n                            << e2 << \", \"\n                            << e3 << \") evaluates to false, where\"\n                            << \"\\n\" << e1 << \" evaluates to \" << v1\n                            << \"\\n\" << e2 << \" evaluates to \" << v2\n                            << \"\\n\" << e3 << \" evaluates to \" << v3;\n}\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.\n// Don't use this in your code.\n#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\\\n  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \\\n                on_failure)\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED3.  Don't use\n// this in your code.\n#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\\\n  GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \\\n                                             #v1, \\\n                                             #v2, \\\n                                             #v3, \\\n                                             pred, \\\n                                             v1, \\\n                                             v2, \\\n                                             v3), on_failure)\n\n// Ternary predicate assertion macros.\n#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \\\n  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_PRED3(pred, v1, v2, v3) \\\n  GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)\n#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \\\n  GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)\n#define ASSERT_PRED3(pred, v1, v2, v3) \\\n  GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)\n\n\n\n// Helper function for implementing {EXPECT|ASSERT}_PRED4.  Don't use\n// this in your code.\ntemplate <typename Pred,\n          typename T1,\n          typename T2,\n          typename T3,\n          typename T4>\nAssertionResult AssertPred4Helper(const char* pred_text,\n                                  const char* e1,\n                                  const char* e2,\n                                  const char* e3,\n                                  const char* e4,\n                                  Pred pred,\n                                  const T1& v1,\n                                  const T2& v2,\n                                  const T3& v3,\n                                  const T4& v4) {\n  if (pred(v1, v2, v3, v4)) return AssertionSuccess();\n\n  return AssertionFailure() << pred_text << \"(\"\n                            << e1 << \", \"\n                            << e2 << \", \"\n                            << e3 << \", \"\n                            << e4 << \") evaluates to false, where\"\n                            << \"\\n\" << e1 << \" evaluates to \" << v1\n                            << \"\\n\" << e2 << \" evaluates to \" << v2\n                            << \"\\n\" << e3 << \" evaluates to \" << v3\n                            << \"\\n\" << e4 << \" evaluates to \" << v4;\n}\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.\n// Don't use this in your code.\n#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\\\n  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \\\n                on_failure)\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED4.  Don't use\n// this in your code.\n#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\\\n  GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \\\n                                             #v1, \\\n                                             #v2, \\\n                                             #v3, \\\n                                             #v4, \\\n                                             pred, \\\n                                             v1, \\\n                                             v2, \\\n                                             v3, \\\n                                             v4), on_failure)\n\n// 4-ary predicate assertion macros.\n#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \\\n  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_PRED4(pred, v1, v2, v3, v4) \\\n  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)\n#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \\\n  GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)\n#define ASSERT_PRED4(pred, v1, v2, v3, v4) \\\n  GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)\n\n\n\n// Helper function for implementing {EXPECT|ASSERT}_PRED5.  Don't use\n// this in your code.\ntemplate <typename Pred,\n          typename T1,\n          typename T2,\n          typename T3,\n          typename T4,\n          typename T5>\nAssertionResult AssertPred5Helper(const char* pred_text,\n                                  const char* e1,\n                                  const char* e2,\n                                  const char* e3,\n                                  const char* e4,\n                                  const char* e5,\n                                  Pred pred,\n                                  const T1& v1,\n                                  const T2& v2,\n                                  const T3& v3,\n                                  const T4& v4,\n                                  const T5& v5) {\n  if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();\n\n  return AssertionFailure() << pred_text << \"(\"\n                            << e1 << \", \"\n                            << e2 << \", \"\n                            << e3 << \", \"\n                            << e4 << \", \"\n                            << e5 << \") evaluates to false, where\"\n                            << \"\\n\" << e1 << \" evaluates to \" << v1\n                            << \"\\n\" << e2 << \" evaluates to \" << v2\n                            << \"\\n\" << e3 << \" evaluates to \" << v3\n                            << \"\\n\" << e4 << \" evaluates to \" << v4\n                            << \"\\n\" << e5 << \" evaluates to \" << v5;\n}\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.\n// Don't use this in your code.\n#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\\\n  GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \\\n                on_failure)\n\n// Internal macro for implementing {EXPECT|ASSERT}_PRED5.  Don't use\n// this in your code.\n#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\\\n  GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \\\n                                             #v1, \\\n                                             #v2, \\\n                                             #v3, \\\n                                             #v4, \\\n                                             #v5, \\\n                                             pred, \\\n                                             v1, \\\n                                             v2, \\\n                                             v3, \\\n                                             v4, \\\n                                             v5), on_failure)\n\n// 5-ary predicate assertion macros.\n#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \\\n  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \\\n  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)\n#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \\\n  GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)\n#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \\\n  GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)\n\n\n\n}  // namespace testing\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_\n\nnamespace testing {\n\n// The abstract class that all tests inherit from.\n//\n// In Google Test, a unit test program contains one or many TestCases, and\n// each TestCase contains one or many Tests.\n//\n// When you define a test using the TEST macro, you don't need to\n// explicitly derive from Test - the TEST macro automatically does\n// this for you.\n//\n// The only time you derive from Test is when defining a test fixture\n// to be used in a TEST_F.  For example:\n//\n//   class FooTest : public testing::Test {\n//    protected:\n//     void SetUp() override { ... }\n//     void TearDown() override { ... }\n//     ...\n//   };\n//\n//   TEST_F(FooTest, Bar) { ... }\n//   TEST_F(FooTest, Baz) { ... }\n//\n// Test is not copyable.\nclass GTEST_API_ Test {\n public:\n  friend class TestInfo;\n\n  // Defines types for pointers to functions that set up and tear down\n  // a test case.\n  typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc;\n  typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc;\n\n  // The d'tor is virtual as we intend to inherit from Test.\n  virtual ~Test();\n\n  // Sets up the stuff shared by all tests in this test case.\n  //\n  // Google Test will call Foo::SetUpTestCase() before running the first\n  // test in test case Foo.  Hence a sub-class can define its own\n  // SetUpTestCase() method to shadow the one defined in the super\n  // class.\n  static void SetUpTestCase() {}\n\n  // Tears down the stuff shared by all tests in this test case.\n  //\n  // Google Test will call Foo::TearDownTestCase() after running the last\n  // test in test case Foo.  Hence a sub-class can define its own\n  // TearDownTestCase() method to shadow the one defined in the super\n  // class.\n  static void TearDownTestCase() {}\n\n  // Returns true iff the current test has a fatal failure.\n  static bool HasFatalFailure();\n\n  // Returns true iff the current test has a non-fatal failure.\n  static bool HasNonfatalFailure();\n\n  // Returns true iff the current test has a (either fatal or\n  // non-fatal) failure.\n  static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }\n\n  // Logs a property for the current test, test case, or for the entire\n  // invocation of the test program when used outside of the context of a\n  // test case.  Only the last value for a given key is remembered.  These\n  // are public static so they can be called from utility functions that are\n  // not members of the test fixture.  Calls to RecordProperty made during\n  // lifespan of the test (from the moment its constructor starts to the\n  // moment its destructor finishes) will be output in XML as attributes of\n  // the <testcase> element.  Properties recorded from fixture's\n  // SetUpTestCase or TearDownTestCase are logged as attributes of the\n  // corresponding <testsuite> element.  Calls to RecordProperty made in the\n  // global context (before or after invocation of RUN_ALL_TESTS and from\n  // SetUp/TearDown method of Environment objects registered with Google\n  // Test) will be output as attributes of the <testsuites> element.\n  static void RecordProperty(const std::string& key, const std::string& value);\n  static void RecordProperty(const std::string& key, int value);\n\n protected:\n  // Creates a Test object.\n  Test();\n\n  // Sets up the test fixture.\n  virtual void SetUp();\n\n  // Tears down the test fixture.\n  virtual void TearDown();\n\n private:\n  // Returns true iff the current test has the same fixture class as\n  // the first test in the current test case.\n  static bool HasSameFixtureClass();\n\n  // Runs the test after the test fixture has been set up.\n  //\n  // A sub-class must implement this to define the test logic.\n  //\n  // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.\n  // Instead, use the TEST or TEST_F macro.\n  virtual void TestBody() = 0;\n\n  // Sets up, executes, and tears down the test.\n  void Run();\n\n  // Deletes self.  We deliberately pick an unusual name for this\n  // internal method to avoid clashing with names used in user TESTs.\n  void DeleteSelf_() { delete this; }\n\n  const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_;\n\n  // Often a user misspells SetUp() as Setup() and spends a long time\n  // wondering why it is never called by Google Test.  The declaration of\n  // the following method is solely for catching such an error at\n  // compile time:\n  //\n  //   - The return type is deliberately chosen to be not void, so it\n  //   will be a conflict if void Setup() is declared in the user's\n  //   test fixture.\n  //\n  //   - This method is private, so it will be another compiler error\n  //   if the method is called from the user's test fixture.\n  //\n  // DO NOT OVERRIDE THIS FUNCTION.\n  //\n  // If you see an error about overriding the following function or\n  // about it being private, you have mis-spelled SetUp() as Setup().\n  struct Setup_should_be_spelled_SetUp {};\n  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }\n\n  // We disallow copying Tests.\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);\n};\n\ntypedef internal::TimeInMillis TimeInMillis;\n\n// A copyable object representing a user specified test property which can be\n// output as a key/value string pair.\n//\n// Don't inherit from TestProperty as its destructor is not virtual.\nclass TestProperty {\n public:\n  // C'tor.  TestProperty does NOT have a default constructor.\n  // Always use this constructor (with parameters) to create a\n  // TestProperty object.\n  TestProperty(const std::string& a_key, const std::string& a_value) :\n    key_(a_key), value_(a_value) {\n  }\n\n  // Gets the user supplied key.\n  const char* key() const {\n    return key_.c_str();\n  }\n\n  // Gets the user supplied value.\n  const char* value() const {\n    return value_.c_str();\n  }\n\n  // Sets a new value, overriding the one supplied in the constructor.\n  void SetValue(const std::string& new_value) {\n    value_ = new_value;\n  }\n\n private:\n  // The key supplied by the user.\n  std::string key_;\n  // The value supplied by the user.\n  std::string value_;\n};\n\n// The result of a single Test.  This includes a list of\n// TestPartResults, a list of TestProperties, a count of how many\n// death tests there are in the Test, and how much time it took to run\n// the Test.\n//\n// TestResult is not copyable.\nclass GTEST_API_ TestResult {\n public:\n  // Creates an empty TestResult.\n  TestResult();\n\n  // D'tor.  Do not inherit from TestResult.\n  ~TestResult();\n\n  // Gets the number of all test parts.  This is the sum of the number\n  // of successful test parts and the number of failed test parts.\n  int total_part_count() const;\n\n  // Returns the number of the test properties.\n  int test_property_count() const;\n\n  // Returns true iff the test passed (i.e. no test part failed).\n  bool Passed() const { return !Failed(); }\n\n  // Returns true iff the test failed.\n  bool Failed() const;\n\n  // Returns true iff the test fatally failed.\n  bool HasFatalFailure() const;\n\n  // Returns true iff the test has a non-fatal failure.\n  bool HasNonfatalFailure() const;\n\n  // Returns the elapsed time, in milliseconds.\n  TimeInMillis elapsed_time() const { return elapsed_time_; }\n\n  // Returns the i-th test part result among all the results. i can range from 0\n  // to total_part_count() - 1. If i is not in that range, aborts the program.\n  const TestPartResult& GetTestPartResult(int i) const;\n\n  // Returns the i-th test property. i can range from 0 to\n  // test_property_count() - 1. If i is not in that range, aborts the\n  // program.\n  const TestProperty& GetTestProperty(int i) const;\n\n private:\n  friend class TestInfo;\n  friend class TestCase;\n  friend class UnitTest;\n  friend class internal::DefaultGlobalTestPartResultReporter;\n  friend class internal::ExecDeathTest;\n  friend class internal::TestResultAccessor;\n  friend class internal::UnitTestImpl;\n  friend class internal::WindowsDeathTest;\n  friend class internal::FuchsiaDeathTest;\n\n  // Gets the vector of TestPartResults.\n  const std::vector<TestPartResult>& test_part_results() const {\n    return test_part_results_;\n  }\n\n  // Gets the vector of TestProperties.\n  const std::vector<TestProperty>& test_properties() const {\n    return test_properties_;\n  }\n\n  // Sets the elapsed time.\n  void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }\n\n  // Adds a test property to the list. The property is validated and may add\n  // a non-fatal failure if invalid (e.g., if it conflicts with reserved\n  // key names). If a property is already recorded for the same key, the\n  // value will be updated, rather than storing multiple values for the same\n  // key.  xml_element specifies the element for which the property is being\n  // recorded and is used for validation.\n  void RecordProperty(const std::string& xml_element,\n                      const TestProperty& test_property);\n\n  // Adds a failure if the key is a reserved attribute of Google Test\n  // testcase tags.  Returns true if the property is valid.\n  // FIXME: Validate attribute names are legal and human readable.\n  static bool ValidateTestProperty(const std::string& xml_element,\n                                   const TestProperty& test_property);\n\n  // Adds a test part result to the list.\n  void AddTestPartResult(const TestPartResult& test_part_result);\n\n  // Returns the death test count.\n  int death_test_count() const { return death_test_count_; }\n\n  // Increments the death test count, returning the new count.\n  int increment_death_test_count() { return ++death_test_count_; }\n\n  // Clears the test part results.\n  void ClearTestPartResults();\n\n  // Clears the object.\n  void Clear();\n\n  // Protects mutable state of the property vector and of owned\n  // properties, whose values may be updated.\n  internal::Mutex test_properites_mutex_;\n\n  // The vector of TestPartResults\n  std::vector<TestPartResult> test_part_results_;\n  // The vector of TestProperties\n  std::vector<TestProperty> test_properties_;\n  // Running count of death tests.\n  int death_test_count_;\n  // The elapsed time, in milliseconds.\n  TimeInMillis elapsed_time_;\n\n  // We disallow copying TestResult.\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);\n};  // class TestResult\n\n// A TestInfo object stores the following information about a test:\n//\n//   Test case name\n//   Test name\n//   Whether the test should be run\n//   A function pointer that creates the test object when invoked\n//   Test result\n//\n// The constructor of TestInfo registers itself with the UnitTest\n// singleton such that the RUN_ALL_TESTS() macro knows which tests to\n// run.\nclass GTEST_API_ TestInfo {\n public:\n  // Destructs a TestInfo object.  This function is not virtual, so\n  // don't inherit from TestInfo.\n  ~TestInfo();\n\n  // Returns the test case name.\n  const char* test_case_name() const { return test_case_name_.c_str(); }\n\n  // Returns the test name.\n  const char* name() const { return name_.c_str(); }\n\n  // Returns the name of the parameter type, or NULL if this is not a typed\n  // or a type-parameterized test.\n  const char* type_param() const {\n    if (type_param_.get() != NULL)\n      return type_param_->c_str();\n    return NULL;\n  }\n\n  // Returns the text representation of the value parameter, or NULL if this\n  // is not a value-parameterized test.\n  const char* value_param() const {\n    if (value_param_.get() != NULL)\n      return value_param_->c_str();\n    return NULL;\n  }\n\n  // Returns the file name where this test is defined.\n  const char* file() const { return location_.file.c_str(); }\n\n  // Returns the line where this test is defined.\n  int line() const { return location_.line; }\n\n  // Return true if this test should not be run because it's in another shard.\n  bool is_in_another_shard() const { return is_in_another_shard_; }\n\n  // Returns true if this test should run, that is if the test is not\n  // disabled (or it is disabled but the also_run_disabled_tests flag has\n  // been specified) and its full name matches the user-specified filter.\n  //\n  // Google Test allows the user to filter the tests by their full names.\n  // The full name of a test Bar in test case Foo is defined as\n  // \"Foo.Bar\".  Only the tests that match the filter will run.\n  //\n  // A filter is a colon-separated list of glob (not regex) patterns,\n  // optionally followed by a '-' and a colon-separated list of\n  // negative patterns (tests to exclude).  A test is run if it\n  // matches one of the positive patterns and does not match any of\n  // the negative patterns.\n  //\n  // For example, *A*:Foo.* is a filter that matches any string that\n  // contains the character 'A' or starts with \"Foo.\".\n  bool should_run() const { return should_run_; }\n\n  // Returns true iff this test will appear in the XML report.\n  bool is_reportable() const {\n    // The XML report includes tests matching the filter, excluding those\n    // run in other shards.\n    return matches_filter_ && !is_in_another_shard_;\n  }\n\n  // Returns the result of the test.\n  const TestResult* result() const { return &result_; }\n\n private:\n#if GTEST_HAS_DEATH_TEST\n  friend class internal::DefaultDeathTestFactory;\n#endif  // GTEST_HAS_DEATH_TEST\n  friend class Test;\n  friend class TestCase;\n  friend class internal::UnitTestImpl;\n  friend class internal::StreamingListenerTest;\n  friend TestInfo* internal::MakeAndRegisterTestInfo(\n      const char* test_case_name,\n      const char* name,\n      const char* type_param,\n      const char* value_param,\n      internal::CodeLocation code_location,\n      internal::TypeId fixture_class_id,\n      Test::SetUpTestCaseFunc set_up_tc,\n      Test::TearDownTestCaseFunc tear_down_tc,\n      internal::TestFactoryBase* factory);\n\n  // Constructs a TestInfo object. The newly constructed instance assumes\n  // ownership of the factory object.\n  TestInfo(const std::string& test_case_name,\n           const std::string& name,\n           const char* a_type_param,   // NULL if not a type-parameterized test\n           const char* a_value_param,  // NULL if not a value-parameterized test\n           internal::CodeLocation a_code_location,\n           internal::TypeId fixture_class_id,\n           internal::TestFactoryBase* factory);\n\n  // Increments the number of death tests encountered in this test so\n  // far.\n  int increment_death_test_count() {\n    return result_.increment_death_test_count();\n  }\n\n  // Creates the test object, runs it, records its result, and then\n  // deletes it.\n  void Run();\n\n  static void ClearTestResult(TestInfo* test_info) {\n    test_info->result_.Clear();\n  }\n\n  // These fields are immutable properties of the test.\n  const std::string test_case_name_;     // Test case name\n  const std::string name_;               // Test name\n  // Name of the parameter type, or NULL if this is not a typed or a\n  // type-parameterized test.\n  const internal::scoped_ptr<const ::std::string> type_param_;\n  // Text representation of the value parameter, or NULL if this is not a\n  // value-parameterized test.\n  const internal::scoped_ptr<const ::std::string> value_param_;\n  internal::CodeLocation location_;\n  const internal::TypeId fixture_class_id_;   // ID of the test fixture class\n  bool should_run_;                 // True iff this test should run\n  bool is_disabled_;                // True iff this test is disabled\n  bool matches_filter_;             // True if this test matches the\n                                    // user-specified filter.\n  bool is_in_another_shard_;        // Will be run in another shard.\n  internal::TestFactoryBase* const factory_;  // The factory that creates\n                                              // the test object\n\n  // This field is mutable and needs to be reset before running the\n  // test for the second time.\n  TestResult result_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);\n};\n\n// A test case, which consists of a vector of TestInfos.\n//\n// TestCase is not copyable.\nclass GTEST_API_ TestCase {\n public:\n  // Creates a TestCase with the given name.\n  //\n  // TestCase does NOT have a default constructor.  Always use this\n  // constructor to create a TestCase object.\n  //\n  // Arguments:\n  //\n  //   name:         name of the test case\n  //   a_type_param: the name of the test's type parameter, or NULL if\n  //                 this is not a type-parameterized test.\n  //   set_up_tc:    pointer to the function that sets up the test case\n  //   tear_down_tc: pointer to the function that tears down the test case\n  TestCase(const char* name, const char* a_type_param,\n           Test::SetUpTestCaseFunc set_up_tc,\n           Test::TearDownTestCaseFunc tear_down_tc);\n\n  // Destructor of TestCase.\n  virtual ~TestCase();\n\n  // Gets the name of the TestCase.\n  const char* name() const { return name_.c_str(); }\n\n  // Returns the name of the parameter type, or NULL if this is not a\n  // type-parameterized test case.\n  const char* type_param() const {\n    if (type_param_.get() != NULL)\n      return type_param_->c_str();\n    return NULL;\n  }\n\n  // Returns true if any test in this test case should run.\n  bool should_run() const { return should_run_; }\n\n  // Gets the number of successful tests in this test case.\n  int successful_test_count() const;\n\n  // Gets the number of failed tests in this test case.\n  int failed_test_count() const;\n\n  // Gets the number of disabled tests that will be reported in the XML report.\n  int reportable_disabled_test_count() const;\n\n  // Gets the number of disabled tests in this test case.\n  int disabled_test_count() const;\n\n  // Gets the number of tests to be printed in the XML report.\n  int reportable_test_count() const;\n\n  // Get the number of tests in this test case that should run.\n  int test_to_run_count() const;\n\n  // Gets the number of all tests in this test case.\n  int total_test_count() const;\n\n  // Returns true iff the test case passed.\n  bool Passed() const { return !Failed(); }\n\n  // Returns true iff the test case failed.\n  bool Failed() const { return failed_test_count() > 0; }\n\n  // Returns the elapsed time, in milliseconds.\n  TimeInMillis elapsed_time() const { return elapsed_time_; }\n\n  // Returns the i-th test among all the tests. i can range from 0 to\n  // total_test_count() - 1. If i is not in that range, returns NULL.\n  const TestInfo* GetTestInfo(int i) const;\n\n  // Returns the TestResult that holds test properties recorded during\n  // execution of SetUpTestCase and TearDownTestCase.\n  const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }\n\n private:\n  friend class Test;\n  friend class internal::UnitTestImpl;\n\n  // Gets the (mutable) vector of TestInfos in this TestCase.\n  std::vector<TestInfo*>& test_info_list() { return test_info_list_; }\n\n  // Gets the (immutable) vector of TestInfos in this TestCase.\n  const std::vector<TestInfo*>& test_info_list() const {\n    return test_info_list_;\n  }\n\n  // Returns the i-th test among all the tests. i can range from 0 to\n  // total_test_count() - 1. If i is not in that range, returns NULL.\n  TestInfo* GetMutableTestInfo(int i);\n\n  // Sets the should_run member.\n  void set_should_run(bool should) { should_run_ = should; }\n\n  // Adds a TestInfo to this test case.  Will delete the TestInfo upon\n  // destruction of the TestCase object.\n  void AddTestInfo(TestInfo * test_info);\n\n  // Clears the results of all tests in this test case.\n  void ClearResult();\n\n  // Clears the results of all tests in the given test case.\n  static void ClearTestCaseResult(TestCase* test_case) {\n    test_case->ClearResult();\n  }\n\n  // Runs every test in this TestCase.\n  void Run();\n\n  // Runs SetUpTestCase() for this TestCase.  This wrapper is needed\n  // for catching exceptions thrown from SetUpTestCase().\n  void RunSetUpTestCase() { (*set_up_tc_)(); }\n\n  // Runs TearDownTestCase() for this TestCase.  This wrapper is\n  // needed for catching exceptions thrown from TearDownTestCase().\n  void RunTearDownTestCase() { (*tear_down_tc_)(); }\n\n  // Returns true iff test passed.\n  static bool TestPassed(const TestInfo* test_info) {\n    return test_info->should_run() && test_info->result()->Passed();\n  }\n\n  // Returns true iff test failed.\n  static bool TestFailed(const TestInfo* test_info) {\n    return test_info->should_run() && test_info->result()->Failed();\n  }\n\n  // Returns true iff the test is disabled and will be reported in the XML\n  // report.\n  static bool TestReportableDisabled(const TestInfo* test_info) {\n    return test_info->is_reportable() && test_info->is_disabled_;\n  }\n\n  // Returns true iff test is disabled.\n  static bool TestDisabled(const TestInfo* test_info) {\n    return test_info->is_disabled_;\n  }\n\n  // Returns true iff this test will appear in the XML report.\n  static bool TestReportable(const TestInfo* test_info) {\n    return test_info->is_reportable();\n  }\n\n  // Returns true if the given test should run.\n  static bool ShouldRunTest(const TestInfo* test_info) {\n    return test_info->should_run();\n  }\n\n  // Shuffles the tests in this test case.\n  void ShuffleTests(internal::Random* random);\n\n  // Restores the test order to before the first shuffle.\n  void UnshuffleTests();\n\n  // Name of the test case.\n  std::string name_;\n  // Name of the parameter type, or NULL if this is not a typed or a\n  // type-parameterized test.\n  const internal::scoped_ptr<const ::std::string> type_param_;\n  // The vector of TestInfos in their original order.  It owns the\n  // elements in the vector.\n  std::vector<TestInfo*> test_info_list_;\n  // Provides a level of indirection for the test list to allow easy\n  // shuffling and restoring the test order.  The i-th element in this\n  // vector is the index of the i-th test in the shuffled test list.\n  std::vector<int> test_indices_;\n  // Pointer to the function that sets up the test case.\n  Test::SetUpTestCaseFunc set_up_tc_;\n  // Pointer to the function that tears down the test case.\n  Test::TearDownTestCaseFunc tear_down_tc_;\n  // True iff any test in this test case should run.\n  bool should_run_;\n  // Elapsed time, in milliseconds.\n  TimeInMillis elapsed_time_;\n  // Holds test properties recorded during execution of SetUpTestCase and\n  // TearDownTestCase.\n  TestResult ad_hoc_test_result_;\n\n  // We disallow copying TestCases.\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase);\n};\n\n// An Environment object is capable of setting up and tearing down an\n// environment.  You should subclass this to define your own\n// environment(s).\n//\n// An Environment object does the set-up and tear-down in virtual\n// methods SetUp() and TearDown() instead of the constructor and the\n// destructor, as:\n//\n//   1. You cannot safely throw from a destructor.  This is a problem\n//      as in some cases Google Test is used where exceptions are enabled, and\n//      we may want to implement ASSERT_* using exceptions where they are\n//      available.\n//   2. You cannot use ASSERT_* directly in a constructor or\n//      destructor.\nclass Environment {\n public:\n  // The d'tor is virtual as we need to subclass Environment.\n  virtual ~Environment() {}\n\n  // Override this to define how to set up the environment.\n  virtual void SetUp() {}\n\n  // Override this to define how to tear down the environment.\n  virtual void TearDown() {}\n private:\n  // If you see an error about overriding the following function or\n  // about it being private, you have mis-spelled SetUp() as Setup().\n  struct Setup_should_be_spelled_SetUp {};\n  virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; }\n};\n\n#if GTEST_HAS_EXCEPTIONS\n\n// Exception which can be thrown from TestEventListener::OnTestPartResult.\nclass GTEST_API_ AssertionException\n    : public internal::GoogleTestFailureException {\n public:\n  explicit AssertionException(const TestPartResult& result)\n      : GoogleTestFailureException(result) {}\n};\n\n#endif  // GTEST_HAS_EXCEPTIONS\n\n// The interface for tracing execution of tests. The methods are organized in\n// the order the corresponding events are fired.\nclass TestEventListener {\n public:\n  virtual ~TestEventListener() {}\n\n  // Fired before any test activity starts.\n  virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;\n\n  // Fired before each iteration of tests starts.  There may be more than\n  // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration\n  // index, starting from 0.\n  virtual void OnTestIterationStart(const UnitTest& unit_test,\n                                    int iteration) = 0;\n\n  // Fired before environment set-up for each iteration of tests starts.\n  virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;\n\n  // Fired after environment set-up for each iteration of tests ends.\n  virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;\n\n  // Fired before the test case starts.\n  virtual void OnTestCaseStart(const TestCase& test_case) = 0;\n\n  // Fired before the test starts.\n  virtual void OnTestStart(const TestInfo& test_info) = 0;\n\n  // Fired after a failed assertion or a SUCCEED() invocation.\n  // If you want to throw an exception from this function to skip to the next\n  // TEST, it must be AssertionException defined above, or inherited from it.\n  virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;\n\n  // Fired after the test ends.\n  virtual void OnTestEnd(const TestInfo& test_info) = 0;\n\n  // Fired after the test case ends.\n  virtual void OnTestCaseEnd(const TestCase& test_case) = 0;\n\n  // Fired before environment tear-down for each iteration of tests starts.\n  virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;\n\n  // Fired after environment tear-down for each iteration of tests ends.\n  virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;\n\n  // Fired after each iteration of tests finishes.\n  virtual void OnTestIterationEnd(const UnitTest& unit_test,\n                                  int iteration) = 0;\n\n  // Fired after all test activities have ended.\n  virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;\n};\n\n// The convenience class for users who need to override just one or two\n// methods and are not concerned that a possible change to a signature of\n// the methods they override will not be caught during the build.  For\n// comments about each method please see the definition of TestEventListener\n// above.\nclass EmptyTestEventListener : public TestEventListener {\n public:\n  virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {}\n  virtual void OnTestIterationStart(const UnitTest& /*unit_test*/,\n                                    int /*iteration*/) {}\n  virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {}\n  virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {}\n  virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}\n  virtual void OnTestStart(const TestInfo& /*test_info*/) {}\n  virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {}\n  virtual void OnTestEnd(const TestInfo& /*test_info*/) {}\n  virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}\n  virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {}\n  virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {}\n  virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/,\n                                  int /*iteration*/) {}\n  virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {}\n};\n\n// TestEventListeners lets users add listeners to track events in Google Test.\nclass GTEST_API_ TestEventListeners {\n public:\n  TestEventListeners();\n  ~TestEventListeners();\n\n  // Appends an event listener to the end of the list. Google Test assumes\n  // the ownership of the listener (i.e. it will delete the listener when\n  // the test program finishes).\n  void Append(TestEventListener* listener);\n\n  // Removes the given event listener from the list and returns it.  It then\n  // becomes the caller's responsibility to delete the listener. Returns\n  // NULL if the listener is not found in the list.\n  TestEventListener* Release(TestEventListener* listener);\n\n  // Returns the standard listener responsible for the default console\n  // output.  Can be removed from the listeners list to shut down default\n  // console output.  Note that removing this object from the listener list\n  // with Release transfers its ownership to the caller and makes this\n  // function return NULL the next time.\n  TestEventListener* default_result_printer() const {\n    return default_result_printer_;\n  }\n\n  // Returns the standard listener responsible for the default XML output\n  // controlled by the --gtest_output=xml flag.  Can be removed from the\n  // listeners list by users who want to shut down the default XML output\n  // controlled by this flag and substitute it with custom one.  Note that\n  // removing this object from the listener list with Release transfers its\n  // ownership to the caller and makes this function return NULL the next\n  // time.\n  TestEventListener* default_xml_generator() const {\n    return default_xml_generator_;\n  }\n\n private:\n  friend class TestCase;\n  friend class TestInfo;\n  friend class internal::DefaultGlobalTestPartResultReporter;\n  friend class internal::NoExecDeathTest;\n  friend class internal::TestEventListenersAccessor;\n  friend class internal::UnitTestImpl;\n\n  // Returns repeater that broadcasts the TestEventListener events to all\n  // subscribers.\n  TestEventListener* repeater();\n\n  // Sets the default_result_printer attribute to the provided listener.\n  // The listener is also added to the listener list and previous\n  // default_result_printer is removed from it and deleted. The listener can\n  // also be NULL in which case it will not be added to the list. Does\n  // nothing if the previous and the current listener objects are the same.\n  void SetDefaultResultPrinter(TestEventListener* listener);\n\n  // Sets the default_xml_generator attribute to the provided listener.  The\n  // listener is also added to the listener list and previous\n  // default_xml_generator is removed from it and deleted. The listener can\n  // also be NULL in which case it will not be added to the list. Does\n  // nothing if the previous and the current listener objects are the same.\n  void SetDefaultXmlGenerator(TestEventListener* listener);\n\n  // Controls whether events will be forwarded by the repeater to the\n  // listeners in the list.\n  bool EventForwardingEnabled() const;\n  void SuppressEventForwarding();\n\n  // The actual list of listeners.\n  internal::TestEventRepeater* repeater_;\n  // Listener responsible for the standard result output.\n  TestEventListener* default_result_printer_;\n  // Listener responsible for the creation of the XML output file.\n  TestEventListener* default_xml_generator_;\n\n  // We disallow copying TestEventListeners.\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);\n};\n\n// A UnitTest consists of a vector of TestCases.\n//\n// This is a singleton class.  The only instance of UnitTest is\n// created when UnitTest::GetInstance() is first called.  This\n// instance is never deleted.\n//\n// UnitTest is not copyable.\n//\n// This class is thread-safe as long as the methods are called\n// according to their specification.\nclass GTEST_API_ UnitTest {\n public:\n  // Gets the singleton UnitTest object.  The first time this method\n  // is called, a UnitTest object is constructed and returned.\n  // Consecutive calls will return the same object.\n  static UnitTest* GetInstance();\n\n  // Runs all tests in this UnitTest object and prints the result.\n  // Returns 0 if successful, or 1 otherwise.\n  //\n  // This method can only be called from the main thread.\n  //\n  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n  int Run() GTEST_MUST_USE_RESULT_;\n\n  // Returns the working directory when the first TEST() or TEST_F()\n  // was executed.  The UnitTest object owns the string.\n  const char* original_working_dir() const;\n\n  // Returns the TestCase object for the test that's currently running,\n  // or NULL if no test is running.\n  const TestCase* current_test_case() const\n      GTEST_LOCK_EXCLUDED_(mutex_);\n\n  // Returns the TestInfo object for the test that's currently running,\n  // or NULL if no test is running.\n  const TestInfo* current_test_info() const\n      GTEST_LOCK_EXCLUDED_(mutex_);\n\n  // Returns the random seed used at the start of the current test run.\n  int random_seed() const;\n\n  // Returns the ParameterizedTestCaseRegistry object used to keep track of\n  // value-parameterized tests and instantiate and register them.\n  //\n  // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n  internal::ParameterizedTestCaseRegistry& parameterized_test_registry()\n      GTEST_LOCK_EXCLUDED_(mutex_);\n\n  // Gets the number of successful test cases.\n  int successful_test_case_count() const;\n\n  // Gets the number of failed test cases.\n  int failed_test_case_count() const;\n\n  // Gets the number of all test cases.\n  int total_test_case_count() const;\n\n  // Gets the number of all test cases that contain at least one test\n  // that should run.\n  int test_case_to_run_count() const;\n\n  // Gets the number of successful tests.\n  int successful_test_count() const;\n\n  // Gets the number of failed tests.\n  int failed_test_count() const;\n\n  // Gets the number of disabled tests that will be reported in the XML report.\n  int reportable_disabled_test_count() const;\n\n  // Gets the number of disabled tests.\n  int disabled_test_count() const;\n\n  // Gets the number of tests to be printed in the XML report.\n  int reportable_test_count() const;\n\n  // Gets the number of all tests.\n  int total_test_count() const;\n\n  // Gets the number of tests that should run.\n  int test_to_run_count() const;\n\n  // Gets the time of the test program start, in ms from the start of the\n  // UNIX epoch.\n  TimeInMillis start_timestamp() const;\n\n  // Gets the elapsed time, in milliseconds.\n  TimeInMillis elapsed_time() const;\n\n  // Returns true iff the unit test passed (i.e. all test cases passed).\n  bool Passed() const;\n\n  // Returns true iff the unit test failed (i.e. some test case failed\n  // or something outside of all tests failed).\n  bool Failed() const;\n\n  // Gets the i-th test case among all the test cases. i can range from 0 to\n  // total_test_case_count() - 1. If i is not in that range, returns NULL.\n  const TestCase* GetTestCase(int i) const;\n\n  // Returns the TestResult containing information on test failures and\n  // properties logged outside of individual test cases.\n  const TestResult& ad_hoc_test_result() const;\n\n  // Returns the list of event listeners that can be used to track events\n  // inside Google Test.\n  TestEventListeners& listeners();\n\n private:\n  // Registers and returns a global test environment.  When a test\n  // program is run, all global test environments will be set-up in\n  // the order they were registered.  After all tests in the program\n  // have finished, all global test environments will be torn-down in\n  // the *reverse* order they were registered.\n  //\n  // The UnitTest object takes ownership of the given environment.\n  //\n  // This method can only be called from the main thread.\n  Environment* AddEnvironment(Environment* env);\n\n  // Adds a TestPartResult to the current TestResult object.  All\n  // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)\n  // eventually call this to report their results.  The user code\n  // should use the assertion macros instead of calling this directly.\n  void AddTestPartResult(TestPartResult::Type result_type,\n                         const char* file_name,\n                         int line_number,\n                         const std::string& message,\n                         const std::string& os_stack_trace)\n      GTEST_LOCK_EXCLUDED_(mutex_);\n\n  // Adds a TestProperty to the current TestResult object when invoked from\n  // inside a test, to current TestCase's ad_hoc_test_result_ when invoked\n  // from SetUpTestCase or TearDownTestCase, or to the global property set\n  // when invoked elsewhere.  If the result already contains a property with\n  // the same key, the value will be updated.\n  void RecordProperty(const std::string& key, const std::string& value);\n\n  // Gets the i-th test case among all the test cases. i can range from 0 to\n  // total_test_case_count() - 1. If i is not in that range, returns NULL.\n  TestCase* GetMutableTestCase(int i);\n\n  // Accessors for the implementation object.\n  internal::UnitTestImpl* impl() { return impl_; }\n  const internal::UnitTestImpl* impl() const { return impl_; }\n\n  // These classes and functions are friends as they need to access private\n  // members of UnitTest.\n  friend class ScopedTrace;\n  friend class Test;\n  friend class internal::AssertHelper;\n  friend class internal::StreamingListenerTest;\n  friend class internal::UnitTestRecordPropertyTestHelper;\n  friend Environment* AddGlobalTestEnvironment(Environment* env);\n  friend internal::UnitTestImpl* internal::GetUnitTestImpl();\n  friend void internal::ReportFailureInUnknownLocation(\n      TestPartResult::Type result_type,\n      const std::string& message);\n\n  // Creates an empty UnitTest.\n  UnitTest();\n\n  // D'tor\n  virtual ~UnitTest();\n\n  // Pushes a trace defined by SCOPED_TRACE() on to the per-thread\n  // Google Test trace stack.\n  void PushGTestTrace(const internal::TraceInfo& trace)\n      GTEST_LOCK_EXCLUDED_(mutex_);\n\n  // Pops a trace from the per-thread Google Test trace stack.\n  void PopGTestTrace()\n      GTEST_LOCK_EXCLUDED_(mutex_);\n\n  // Protects mutable state in *impl_.  This is mutable as some const\n  // methods need to lock it too.\n  mutable internal::Mutex mutex_;\n\n  // Opaque implementation object.  This field is never changed once\n  // the object is constructed.  We don't mark it as const here, as\n  // doing so will cause a warning in the constructor of UnitTest.\n  // Mutable state in *impl_ is protected by mutex_.\n  internal::UnitTestImpl* impl_;\n\n  // We disallow copying UnitTest.\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);\n};\n\n// A convenient wrapper for adding an environment for the test\n// program.\n//\n// You should call this before RUN_ALL_TESTS() is called, probably in\n// main().  If you use gtest_main, you need to call this before main()\n// starts for it to take effect.  For example, you can define a global\n// variable like this:\n//\n//   testing::Environment* const foo_env =\n//       testing::AddGlobalTestEnvironment(new FooEnvironment);\n//\n// However, we strongly recommend you to write your own main() and\n// call AddGlobalTestEnvironment() there, as relying on initialization\n// of global variables makes the code harder to read and may cause\n// problems when you register multiple environments from different\n// translation units and the environments have dependencies among them\n// (remember that the compiler doesn't guarantee the order in which\n// global variables from different translation units are initialized).\ninline Environment* AddGlobalTestEnvironment(Environment* env) {\n  return UnitTest::GetInstance()->AddEnvironment(env);\n}\n\n// Initializes Google Test.  This must be called before calling\n// RUN_ALL_TESTS().  In particular, it parses a command line for the\n// flags that Google Test recognizes.  Whenever a Google Test flag is\n// seen, it is removed from argv, and *argc is decremented.\n//\n// No value is returned.  Instead, the Google Test flag variables are\n// updated.\n//\n// Calling the function for the second time has no user-visible effect.\nGTEST_API_ void InitGoogleTest(int* argc, char** argv);\n\n// This overloaded version can be used in Windows programs compiled in\n// UNICODE mode.\nGTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);\n\nnamespace internal {\n\n// Separate the error generating code from the code path to reduce the stack\n// frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers\n// when calling EXPECT_* in a tight loop.\ntemplate <typename T1, typename T2>\nAssertionResult CmpHelperEQFailure(const char* lhs_expression,\n                                   const char* rhs_expression,\n                                   const T1& lhs, const T2& rhs) {\n  return EqFailure(lhs_expression,\n                   rhs_expression,\n                   FormatForComparisonFailureMessage(lhs, rhs),\n                   FormatForComparisonFailureMessage(rhs, lhs),\n                   false);\n}\n\n// The helper function for {ASSERT|EXPECT}_EQ.\ntemplate <typename T1, typename T2>\nAssertionResult CmpHelperEQ(const char* lhs_expression,\n                            const char* rhs_expression,\n                            const T1& lhs,\n                            const T2& rhs) {\n  if (lhs == rhs) {\n    return AssertionSuccess();\n  }\n\n  return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs);\n}\n\n// With this overloaded version, we allow anonymous enums to be used\n// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums\n// can be implicitly cast to BiggestInt.\nGTEST_API_ AssertionResult CmpHelperEQ(const char* lhs_expression,\n                                       const char* rhs_expression,\n                                       BiggestInt lhs,\n                                       BiggestInt rhs);\n\n// The helper class for {ASSERT|EXPECT}_EQ.  The template argument\n// lhs_is_null_literal is true iff the first argument to ASSERT_EQ()\n// is a null pointer literal.  The following default implementation is\n// for lhs_is_null_literal being false.\ntemplate <bool lhs_is_null_literal>\nclass EqHelper {\n public:\n  // This templatized version is for the general case.\n  template <typename T1, typename T2>\n  static AssertionResult Compare(const char* lhs_expression,\n                                 const char* rhs_expression,\n                                 const T1& lhs,\n                                 const T2& rhs) {\n    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);\n  }\n\n  // With this overloaded version, we allow anonymous enums to be used\n  // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous\n  // enums can be implicitly cast to BiggestInt.\n  //\n  // Even though its body looks the same as the above version, we\n  // cannot merge the two, as it will make anonymous enums unhappy.\n  static AssertionResult Compare(const char* lhs_expression,\n                                 const char* rhs_expression,\n                                 BiggestInt lhs,\n                                 BiggestInt rhs) {\n    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);\n  }\n};\n\n// This specialization is used when the first argument to ASSERT_EQ()\n// is a null pointer literal, like NULL, false, or 0.\ntemplate <>\nclass EqHelper<true> {\n public:\n  // We define two overloaded versions of Compare().  The first\n  // version will be picked when the second argument to ASSERT_EQ() is\n  // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or\n  // EXPECT_EQ(false, a_bool).\n  template <typename T1, typename T2>\n  static AssertionResult Compare(\n      const char* lhs_expression,\n      const char* rhs_expression,\n      const T1& lhs,\n      const T2& rhs,\n      // The following line prevents this overload from being considered if T2\n      // is not a pointer type.  We need this because ASSERT_EQ(NULL, my_ptr)\n      // expands to Compare(\"\", \"\", NULL, my_ptr), which requires a conversion\n      // to match the Secret* in the other overload, which would otherwise make\n      // this template match better.\n      typename EnableIf<!is_pointer<T2>::value>::type* = 0) {\n    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);\n  }\n\n  // This version will be picked when the second argument to ASSERT_EQ() is a\n  // pointer, e.g. ASSERT_EQ(NULL, a_pointer).\n  template <typename T>\n  static AssertionResult Compare(\n      const char* lhs_expression,\n      const char* rhs_expression,\n      // We used to have a second template parameter instead of Secret*.  That\n      // template parameter would deduce to 'long', making this a better match\n      // than the first overload even without the first overload's EnableIf.\n      // Unfortunately, gcc with -Wconversion-null warns when \"passing NULL to\n      // non-pointer argument\" (even a deduced integral argument), so the old\n      // implementation caused warnings in user code.\n      Secret* /* lhs (NULL) */,\n      T* rhs) {\n    // We already know that 'lhs' is a null pointer.\n    return CmpHelperEQ(lhs_expression, rhs_expression,\n                       static_cast<T*>(NULL), rhs);\n  }\n};\n\n// Separate the error generating code from the code path to reduce the stack\n// frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers\n// when calling EXPECT_OP in a tight loop.\ntemplate <typename T1, typename T2>\nAssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,\n                                   const T1& val1, const T2& val2,\n                                   const char* op) {\n  return AssertionFailure()\n         << \"Expected: (\" << expr1 << \") \" << op << \" (\" << expr2\n         << \"), actual: \" << FormatForComparisonFailureMessage(val1, val2)\n         << \" vs \" << FormatForComparisonFailureMessage(val2, val1);\n}\n\n// A macro for implementing the helper functions needed to implement\n// ASSERT_?? and EXPECT_??.  It is here just to avoid copy-and-paste\n// of similar code.\n//\n// For each templatized helper function, we also define an overloaded\n// version for BiggestInt in order to reduce code bloat and allow\n// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled\n// with gcc 4.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n\n#define GTEST_IMPL_CMP_HELPER_(op_name, op)\\\ntemplate <typename T1, typename T2>\\\nAssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \\\n                                   const T1& val1, const T2& val2) {\\\n  if (val1 op val2) {\\\n    return AssertionSuccess();\\\n  } else {\\\n    return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\\\n  }\\\n}\\\nGTEST_API_ AssertionResult CmpHelper##op_name(\\\n    const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\n\n// Implements the helper function for {ASSERT|EXPECT}_NE\nGTEST_IMPL_CMP_HELPER_(NE, !=);\n// Implements the helper function for {ASSERT|EXPECT}_LE\nGTEST_IMPL_CMP_HELPER_(LE, <=);\n// Implements the helper function for {ASSERT|EXPECT}_LT\nGTEST_IMPL_CMP_HELPER_(LT, <);\n// Implements the helper function for {ASSERT|EXPECT}_GE\nGTEST_IMPL_CMP_HELPER_(GE, >=);\n// Implements the helper function for {ASSERT|EXPECT}_GT\nGTEST_IMPL_CMP_HELPER_(GT, >);\n\n#undef GTEST_IMPL_CMP_HELPER_\n\n// The helper function for {ASSERT|EXPECT}_STREQ.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,\n                                          const char* s2_expression,\n                                          const char* s1,\n                                          const char* s2);\n\n// The helper function for {ASSERT|EXPECT}_STRCASEEQ.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression,\n                                              const char* s2_expression,\n                                              const char* s1,\n                                              const char* s2);\n\n// The helper function for {ASSERT|EXPECT}_STRNE.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,\n                                          const char* s2_expression,\n                                          const char* s1,\n                                          const char* s2);\n\n// The helper function for {ASSERT|EXPECT}_STRCASENE.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,\n                                              const char* s2_expression,\n                                              const char* s1,\n                                              const char* s2);\n\n\n// Helper function for *_STREQ on wide strings.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,\n                                          const char* s2_expression,\n                                          const wchar_t* s1,\n                                          const wchar_t* s2);\n\n// Helper function for *_STRNE on wide strings.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,\n                                          const char* s2_expression,\n                                          const wchar_t* s1,\n                                          const wchar_t* s2);\n\n}  // namespace internal\n\n// IsSubstring() and IsNotSubstring() are intended to be used as the\n// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by\n// themselves.  They check whether needle is a substring of haystack\n// (NULL is considered a substring of itself only), and return an\n// appropriate error message when they fail.\n//\n// The {needle,haystack}_expr arguments are the stringified\n// expressions that generated the two real arguments.\nGTEST_API_ AssertionResult IsSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const char* needle, const char* haystack);\nGTEST_API_ AssertionResult IsSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const wchar_t* needle, const wchar_t* haystack);\nGTEST_API_ AssertionResult IsNotSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const char* needle, const char* haystack);\nGTEST_API_ AssertionResult IsNotSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const wchar_t* needle, const wchar_t* haystack);\nGTEST_API_ AssertionResult IsSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const ::std::string& needle, const ::std::string& haystack);\nGTEST_API_ AssertionResult IsNotSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const ::std::string& needle, const ::std::string& haystack);\n\n#if GTEST_HAS_STD_WSTRING\nGTEST_API_ AssertionResult IsSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const ::std::wstring& needle, const ::std::wstring& haystack);\nGTEST_API_ AssertionResult IsNotSubstring(\n    const char* needle_expr, const char* haystack_expr,\n    const ::std::wstring& needle, const ::std::wstring& haystack);\n#endif  // GTEST_HAS_STD_WSTRING\n\nnamespace internal {\n\n// Helper template function for comparing floating-points.\n//\n// Template parameter:\n//\n//   RawType: the raw floating-point type (either float or double)\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\ntemplate <typename RawType>\nAssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,\n                                         const char* rhs_expression,\n                                         RawType lhs_value,\n                                         RawType rhs_value) {\n  const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value);\n\n  if (lhs.AlmostEquals(rhs)) {\n    return AssertionSuccess();\n  }\n\n  ::std::stringstream lhs_ss;\n  lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)\n         << lhs_value;\n\n  ::std::stringstream rhs_ss;\n  rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)\n         << rhs_value;\n\n  return EqFailure(lhs_expression,\n                   rhs_expression,\n                   StringStreamToString(&lhs_ss),\n                   StringStreamToString(&rhs_ss),\n                   false);\n}\n\n// Helper function for implementing ASSERT_NEAR.\n//\n// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.\nGTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,\n                                                const char* expr2,\n                                                const char* abs_error_expr,\n                                                double val1,\n                                                double val2,\n                                                double abs_error);\n\n// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.\n// A class that enables one to stream messages to assertion macros\nclass GTEST_API_ AssertHelper {\n public:\n  // Constructor.\n  AssertHelper(TestPartResult::Type type,\n               const char* file,\n               int line,\n               const char* message);\n  ~AssertHelper();\n\n  // Message assignment is a semantic trick to enable assertion\n  // streaming; see the GTEST_MESSAGE_ macro below.\n  void operator=(const Message& message) const;\n\n private:\n  // We put our data in a struct so that the size of the AssertHelper class can\n  // be as small as possible.  This is important because gcc is incapable of\n  // re-using stack space even for temporary variables, so every EXPECT_EQ\n  // reserves stack space for another AssertHelper.\n  struct AssertHelperData {\n    AssertHelperData(TestPartResult::Type t,\n                     const char* srcfile,\n                     int line_num,\n                     const char* msg)\n        : type(t), file(srcfile), line(line_num), message(msg) { }\n\n    TestPartResult::Type const type;\n    const char* const file;\n    int const line;\n    std::string const message;\n\n   private:\n    GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);\n  };\n\n  AssertHelperData* const data_;\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);\n};\n\n}  // namespace internal\n\n// The pure interface class that all value-parameterized tests inherit from.\n// A value-parameterized class must inherit from both ::testing::Test and\n// ::testing::WithParamInterface. In most cases that just means inheriting\n// from ::testing::TestWithParam, but more complicated test hierarchies\n// may need to inherit from Test and WithParamInterface at different levels.\n//\n// This interface has support for accessing the test parameter value via\n// the GetParam() method.\n//\n// Use it with one of the parameter generator defining functions, like Range(),\n// Values(), ValuesIn(), Bool(), and Combine().\n//\n// class FooTest : public ::testing::TestWithParam<int> {\n//  protected:\n//   FooTest() {\n//     // Can use GetParam() here.\n//   }\n//   virtual ~FooTest() {\n//     // Can use GetParam() here.\n//   }\n//   virtual void SetUp() {\n//     // Can use GetParam() here.\n//   }\n//   virtual void TearDown {\n//     // Can use GetParam() here.\n//   }\n// };\n// TEST_P(FooTest, DoesBar) {\n//   // Can use GetParam() method here.\n//   Foo foo;\n//   ASSERT_TRUE(foo.DoesBar(GetParam()));\n// }\n// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));\n\ntemplate <typename T>\nclass WithParamInterface {\n public:\n  typedef T ParamType;\n  virtual ~WithParamInterface() {}\n\n  // The current parameter value. Is also available in the test fixture's\n  // constructor. This member function is non-static, even though it only\n  // references static data, to reduce the opportunity for incorrect uses\n  // like writing 'WithParamInterface<bool>::GetParam()' for a test that\n  // uses a fixture whose parameter type is int.\n  const ParamType& GetParam() const {\n    GTEST_CHECK_(parameter_ != NULL)\n        << \"GetParam() can only be called inside a value-parameterized test \"\n        << \"-- did you intend to write TEST_P instead of TEST_F?\";\n    return *parameter_;\n  }\n\n private:\n  // Sets parameter value. The caller is responsible for making sure the value\n  // remains alive and unchanged throughout the current test.\n  static void SetParam(const ParamType* parameter) {\n    parameter_ = parameter;\n  }\n\n  // Static value used for accessing parameter during a test lifetime.\n  static const ParamType* parameter_;\n\n  // TestClass must be a subclass of WithParamInterface<T> and Test.\n  template <class TestClass> friend class internal::ParameterizedTestFactory;\n};\n\ntemplate <typename T>\nconst T* WithParamInterface<T>::parameter_ = NULL;\n\n// Most value-parameterized classes can ignore the existence of\n// WithParamInterface, and can just inherit from ::testing::TestWithParam.\n\ntemplate <typename T>\nclass TestWithParam : public Test, public WithParamInterface<T> {\n};\n\n// Macros for indicating success/failure in test code.\n\n// ADD_FAILURE unconditionally adds a failure to the current test.\n// SUCCEED generates a success - it doesn't automatically make the\n// current test successful, as a test is only successful when it has\n// no failure.\n//\n// EXPECT_* verifies that a certain condition is satisfied.  If not,\n// it behaves like ADD_FAILURE.  In particular:\n//\n//   EXPECT_TRUE  verifies that a Boolean condition is true.\n//   EXPECT_FALSE verifies that a Boolean condition is false.\n//\n// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except\n// that they will also abort the current function on failure.  People\n// usually want the fail-fast behavior of FAIL and ASSERT_*, but those\n// writing data-driven tests often find themselves using ADD_FAILURE\n// and EXPECT_* more.\n\n// Generates a nonfatal failure with a generic message.\n#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_(\"Failed\")\n\n// Generates a nonfatal failure at the given source file location with\n// a generic message.\n#define ADD_FAILURE_AT(file, line) \\\n  GTEST_MESSAGE_AT_(file, line, \"Failed\", \\\n                    ::testing::TestPartResult::kNonFatalFailure)\n\n// Generates a fatal failure with a generic message.\n#define GTEST_FAIL() GTEST_FATAL_FAILURE_(\"Failed\")\n\n// Define this macro to 1 to omit the definition of FAIL(), which is a\n// generic name and clashes with some other libraries.\n#if !GTEST_DONT_DEFINE_FAIL\n# define FAIL() GTEST_FAIL()\n#endif\n\n// Generates a success with a generic message.\n#define GTEST_SUCCEED() GTEST_SUCCESS_(\"Succeeded\")\n\n// Define this macro to 1 to omit the definition of SUCCEED(), which\n// is a generic name and clashes with some other libraries.\n#if !GTEST_DONT_DEFINE_SUCCEED\n# define SUCCEED() GTEST_SUCCEED()\n#endif\n\n// Macros for testing exceptions.\n//\n//    * {ASSERT|EXPECT}_THROW(statement, expected_exception):\n//         Tests that the statement throws the expected exception.\n//    * {ASSERT|EXPECT}_NO_THROW(statement):\n//         Tests that the statement doesn't throw any exception.\n//    * {ASSERT|EXPECT}_ANY_THROW(statement):\n//         Tests that the statement throws an exception.\n\n#define EXPECT_THROW(statement, expected_exception) \\\n  GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_NO_THROW(statement) \\\n  GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)\n#define EXPECT_ANY_THROW(statement) \\\n  GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)\n#define ASSERT_THROW(statement, expected_exception) \\\n  GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)\n#define ASSERT_NO_THROW(statement) \\\n  GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)\n#define ASSERT_ANY_THROW(statement) \\\n  GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)\n\n// Boolean assertions. Condition can be either a Boolean expression or an\n// AssertionResult. For more information on how to use AssertionResult with\n// these macros see comments on that class.\n#define EXPECT_TRUE(condition) \\\n  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \\\n                      GTEST_NONFATAL_FAILURE_)\n#define EXPECT_FALSE(condition) \\\n  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \\\n                      GTEST_NONFATAL_FAILURE_)\n#define ASSERT_TRUE(condition) \\\n  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \\\n                      GTEST_FATAL_FAILURE_)\n#define ASSERT_FALSE(condition) \\\n  GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \\\n                      GTEST_FATAL_FAILURE_)\n\n// Macros for testing equalities and inequalities.\n//\n//    * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2\n//    * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2\n//    * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2\n//    * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2\n//    * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2\n//    * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2\n//\n// When they are not, Google Test prints both the tested expressions and\n// their actual values.  The values must be compatible built-in types,\n// or you will get a compiler error.  By \"compatible\" we mean that the\n// values can be compared by the respective operator.\n//\n// Note:\n//\n//   1. It is possible to make a user-defined type work with\n//   {ASSERT|EXPECT}_??(), but that requires overloading the\n//   comparison operators and is thus discouraged by the Google C++\n//   Usage Guide.  Therefore, you are advised to use the\n//   {ASSERT|EXPECT}_TRUE() macro to assert that two objects are\n//   equal.\n//\n//   2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on\n//   pointers (in particular, C strings).  Therefore, if you use it\n//   with two C strings, you are testing how their locations in memory\n//   are related, not how their content is related.  To compare two C\n//   strings by content, use {ASSERT|EXPECT}_STR*().\n//\n//   3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to\n//   {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you\n//   what the actual value is when it fails, and similarly for the\n//   other comparisons.\n//\n//   4. Do not depend on the order in which {ASSERT|EXPECT}_??()\n//   evaluate their arguments, which is undefined.\n//\n//   5. These macros evaluate their arguments exactly once.\n//\n// Examples:\n//\n//   EXPECT_NE(Foo(), 5);\n//   EXPECT_EQ(a_pointer, NULL);\n//   ASSERT_LT(i, array_size);\n//   ASSERT_GT(records.size(), 0) << \"There is no record left.\";\n\n#define EXPECT_EQ(val1, val2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal:: \\\n                      EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \\\n                      val1, val2)\n#define EXPECT_NE(val1, val2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)\n#define EXPECT_LE(val1, val2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)\n#define EXPECT_LT(val1, val2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)\n#define EXPECT_GE(val1, val2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)\n#define EXPECT_GT(val1, val2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)\n\n#define GTEST_ASSERT_EQ(val1, val2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal:: \\\n                      EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \\\n                      val1, val2)\n#define GTEST_ASSERT_NE(val1, val2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)\n#define GTEST_ASSERT_LE(val1, val2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)\n#define GTEST_ASSERT_LT(val1, val2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)\n#define GTEST_ASSERT_GE(val1, val2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)\n#define GTEST_ASSERT_GT(val1, val2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)\n\n// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of\n// ASSERT_XY(), which clashes with some users' own code.\n\n#if !GTEST_DONT_DEFINE_ASSERT_EQ\n# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)\n#endif\n\n#if !GTEST_DONT_DEFINE_ASSERT_NE\n# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)\n#endif\n\n#if !GTEST_DONT_DEFINE_ASSERT_LE\n# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)\n#endif\n\n#if !GTEST_DONT_DEFINE_ASSERT_LT\n# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)\n#endif\n\n#if !GTEST_DONT_DEFINE_ASSERT_GE\n# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)\n#endif\n\n#if !GTEST_DONT_DEFINE_ASSERT_GT\n# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)\n#endif\n\n// C-string Comparisons.  All tests treat NULL and any non-NULL string\n// as different.  Two NULLs are equal.\n//\n//    * {ASSERT|EXPECT}_STREQ(s1, s2):     Tests that s1 == s2\n//    * {ASSERT|EXPECT}_STRNE(s1, s2):     Tests that s1 != s2\n//    * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case\n//    * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case\n//\n// For wide or narrow string objects, you can use the\n// {ASSERT|EXPECT}_??() macros.\n//\n// Don't depend on the order in which the arguments are evaluated,\n// which is undefined.\n//\n// These macros evaluate their arguments exactly once.\n\n#define EXPECT_STREQ(s1, s2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)\n#define EXPECT_STRNE(s1, s2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)\n#define EXPECT_STRCASEEQ(s1, s2) \\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)\n#define EXPECT_STRCASENE(s1, s2)\\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)\n\n#define ASSERT_STREQ(s1, s2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)\n#define ASSERT_STRNE(s1, s2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)\n#define ASSERT_STRCASEEQ(s1, s2) \\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)\n#define ASSERT_STRCASENE(s1, s2)\\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)\n\n// Macros for comparing floating-point numbers.\n//\n//    * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2):\n//         Tests that two float values are almost equal.\n//    * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2):\n//         Tests that two double values are almost equal.\n//    * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):\n//         Tests that v1 and v2 are within the given distance to each other.\n//\n// Google Test uses ULP-based comparison to automatically pick a default\n// error bound that is appropriate for the operands.  See the\n// FloatingPoint template class in gtest-internal.h if you are\n// interested in the implementation details.\n\n#define EXPECT_FLOAT_EQ(val1, val2)\\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \\\n                      val1, val2)\n\n#define EXPECT_DOUBLE_EQ(val1, val2)\\\n  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \\\n                      val1, val2)\n\n#define ASSERT_FLOAT_EQ(val1, val2)\\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \\\n                      val1, val2)\n\n#define ASSERT_DOUBLE_EQ(val1, val2)\\\n  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \\\n                      val1, val2)\n\n#define EXPECT_NEAR(val1, val2, abs_error)\\\n  EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \\\n                      val1, val2, abs_error)\n\n#define ASSERT_NEAR(val1, val2, abs_error)\\\n  ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \\\n                      val1, val2, abs_error)\n\n// These predicate format functions work on floating-point values, and\n// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.\n//\n//   EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);\n\n// Asserts that val1 is less than, or almost equal to, val2.  Fails\n// otherwise.  In particular, it fails if either val1 or val2 is NaN.\nGTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,\n                                   float val1, float val2);\nGTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,\n                                    double val1, double val2);\n\n\n#if GTEST_OS_WINDOWS\n\n// Macros that test for HRESULT failure and success, these are only useful\n// on Windows, and rely on Windows SDK macros and APIs to compile.\n//\n//    * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)\n//\n// When expr unexpectedly fails or succeeds, Google Test prints the\n// expected result and the actual result with both a human-readable\n// string representation of the error, if available, as well as the\n// hex result code.\n# define EXPECT_HRESULT_SUCCEEDED(expr) \\\n    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))\n\n# define ASSERT_HRESULT_SUCCEEDED(expr) \\\n    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))\n\n# define EXPECT_HRESULT_FAILED(expr) \\\n    EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))\n\n# define ASSERT_HRESULT_FAILED(expr) \\\n    ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))\n\n#endif  // GTEST_OS_WINDOWS\n\n// Macros that execute statement and check that it doesn't generate new fatal\n// failures in the current thread.\n//\n//   * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);\n//\n// Examples:\n//\n//   EXPECT_NO_FATAL_FAILURE(Process());\n//   ASSERT_NO_FATAL_FAILURE(Process()) << \"Process() failed\";\n//\n#define ASSERT_NO_FATAL_FAILURE(statement) \\\n    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)\n#define EXPECT_NO_FATAL_FAILURE(statement) \\\n    GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)\n\n// Causes a trace (including the given source file path and line number,\n// and the given message) to be included in every test failure message generated\n// by code in the scope of the lifetime of an instance of this class. The effect\n// is undone with the destruction of the instance.\n//\n// The message argument can be anything streamable to std::ostream.\n//\n// Example:\n//   testing::ScopedTrace trace(\"file.cc\", 123, \"message\");\n//\nclass GTEST_API_ ScopedTrace {\n public:\n  // The c'tor pushes the given source file location and message onto\n  // a trace stack maintained by Google Test.\n\n  // Template version. Uses Message() to convert the values into strings.\n  // Slow, but flexible.\n  template <typename T>\n  ScopedTrace(const char* file, int line, const T& message) {\n    PushTrace(file, line, (Message() << message).GetString());\n  }\n\n  // Optimize for some known types.\n  ScopedTrace(const char* file, int line, const char* message) {\n    PushTrace(file, line, message ? message : \"(null)\");\n  }\n\n#if GTEST_HAS_GLOBAL_STRING\n  ScopedTrace(const char* file, int line, const ::string& message) {\n    PushTrace(file, line, message);\n  }\n#endif\n\n  ScopedTrace(const char* file, int line, const std::string& message) {\n    PushTrace(file, line, message);\n  }\n\n  // The d'tor pops the info pushed by the c'tor.\n  //\n  // Note that the d'tor is not virtual in order to be efficient.\n  // Don't inherit from ScopedTrace!\n  ~ScopedTrace();\n\n private:\n  void PushTrace(const char* file, int line, std::string message);\n\n  GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);\n} GTEST_ATTRIBUTE_UNUSED_;  // A ScopedTrace object does its job in its\n                            // c'tor and d'tor.  Therefore it doesn't\n                            // need to be used otherwise.\n\n// Causes a trace (including the source file path, the current line\n// number, and the given message) to be included in every test failure\n// message generated by code in the current scope.  The effect is\n// undone when the control leaves the current scope.\n//\n// The message argument can be anything streamable to std::ostream.\n//\n// In the implementation, we include the current line number as part\n// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s\n// to appear in the same block - as long as they are on different\n// lines.\n//\n// Assuming that each thread maintains its own stack of traces.\n// Therefore, a SCOPED_TRACE() would (correctly) only affect the\n// assertions in its own thread.\n#define SCOPED_TRACE(message) \\\n  ::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\\\n    __FILE__, __LINE__, (message))\n\n\n// Compile-time assertion for type equality.\n// StaticAssertTypeEq<type1, type2>() compiles iff type1 and type2 are\n// the same type.  The value it returns is not interesting.\n//\n// Instead of making StaticAssertTypeEq a class template, we make it a\n// function template that invokes a helper class template.  This\n// prevents a user from misusing StaticAssertTypeEq<T1, T2> by\n// defining objects of that type.\n//\n// CAVEAT:\n//\n// When used inside a method of a class template,\n// StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is\n// instantiated.  For example, given:\n//\n//   template <typename T> class Foo {\n//    public:\n//     void Bar() { testing::StaticAssertTypeEq<int, T>(); }\n//   };\n//\n// the code:\n//\n//   void Test1() { Foo<bool> foo; }\n//\n// will NOT generate a compiler error, as Foo<bool>::Bar() is never\n// actually instantiated.  Instead, you need:\n//\n//   void Test2() { Foo<bool> foo; foo.Bar(); }\n//\n// to cause a compiler error.\ntemplate <typename T1, typename T2>\nbool StaticAssertTypeEq() {\n  (void)internal::StaticAssertTypeEqHelper<T1, T2>();\n  return true;\n}\n\n// Defines a test.\n//\n// The first parameter is the name of the test case, and the second\n// parameter is the name of the test within the test case.\n//\n// The convention is to end the test case name with \"Test\".  For\n// example, a test case for the Foo class can be named FooTest.\n//\n// Test code should appear between braces after an invocation of\n// this macro.  Example:\n//\n//   TEST(FooTest, InitializesCorrectly) {\n//     Foo foo;\n//     EXPECT_TRUE(foo.StatusIsOK());\n//   }\n\n// Note that we call GetTestTypeId() instead of GetTypeId<\n// ::testing::Test>() here to get the type ID of testing::Test.  This\n// is to work around a suspected linker bug when using Google Test as\n// a framework on Mac OS X.  The bug causes GetTypeId<\n// ::testing::Test>() to return different values depending on whether\n// the call is from the Google Test framework itself or from user test\n// code.  GetTestTypeId() is guaranteed to always return the same\n// value, as it always calls GetTypeId<>() from the Google Test\n// framework.\n#define GTEST_TEST(test_case_name, test_name)\\\n  GTEST_TEST_(test_case_name, test_name, \\\n              ::testing::Test, ::testing::internal::GetTestTypeId())\n\n// Define this macro to 1 to omit the definition of TEST(), which\n// is a generic name and clashes with some other libraries.\n#if !GTEST_DONT_DEFINE_TEST\n# define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)\n#endif\n\n// Defines a test that uses a test fixture.\n//\n// The first parameter is the name of the test fixture class, which\n// also doubles as the test case name.  The second parameter is the\n// name of the test within the test case.\n//\n// A test fixture class must be declared earlier.  The user should put\n// the test code between braces after using this macro.  Example:\n//\n//   class FooTest : public testing::Test {\n//    protected:\n//     virtual void SetUp() { b_.AddElement(3); }\n//\n//     Foo a_;\n//     Foo b_;\n//   };\n//\n//   TEST_F(FooTest, InitializesCorrectly) {\n//     EXPECT_TRUE(a_.StatusIsOK());\n//   }\n//\n//   TEST_F(FooTest, ReturnsElementCountCorrectly) {\n//     EXPECT_EQ(a_.size(), 0);\n//     EXPECT_EQ(b_.size(), 1);\n//   }\n\n#define TEST_F(test_fixture, test_name)\\\n  GTEST_TEST_(test_fixture, test_name, test_fixture, \\\n              ::testing::internal::GetTypeId<test_fixture>())\n\n// Returns a path to temporary directory.\n// Tries to determine an appropriate directory for the platform.\nGTEST_API_ std::string TempDir();\n\n#ifdef _MSC_VER\n#  pragma warning(pop)\n#endif\n\n}  // namespace testing\n\n// Use this function in main() to run all tests.  It returns 0 if all\n// tests are successful, or 1 otherwise.\n//\n// RUN_ALL_TESTS() should be invoked after the command line has been\n// parsed by InitGoogleTest().\n//\n// This function was formerly a macro; thus, it is in the global\n// namespace and has an all-caps name.\nint RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;\n\ninline int RUN_ALL_TESTS() {\n  return ::testing::UnitTest::GetInstance()->Run();\n}\n\nGTEST_DISABLE_MSC_WARNINGS_POP_()  //  4251\n\n#endif  // GTEST_INCLUDE_GTEST_GTEST_H_\n"
  },
  {
    "path": "test/src/AccessKey/AccessKeyTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass AccessKeyTest : public ::testing::Test {\nprotected:\n    AccessKeyTest()\n    {\n    }\n\n    ~AccessKeyTest() override\n    {\n    }\n\n    void SetUp() override\n    {\n    }\n\n    void TearDown() override\n    {\n    }\n};\n\nTEST_F(AccessKeyTest, InvalidAccessKeyIdTest)\n{\n    ClientConfiguration conf;\n    std::shared_ptr<OssClient> client = std::make_shared<OssClient>(Config::Endpoint, \"invalidAccessKeyId\", Config::AccessKeySecret, conf);\n    auto outcome = client->ListBuckets(ListBucketsRequest());\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"InvalidAccessKeyId\");\n}\n\nTEST_F(AccessKeyTest, InvalidAccessKeySecretTest)\n{\n    ClientConfiguration conf;\n    std::shared_ptr<OssClient> client = std::make_shared<OssClient>(Config::Endpoint, \n        Config::AccessKeyId, \"invalidAccessKeySecret\", \n        conf);\n    auto outcome = client->ListBuckets(ListBucketsRequest());\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"SignatureDoesNotMatch\");\n}\n\nTEST_F(AccessKeyTest, InvalidSecurityTokenTest)\n{\n    ClientConfiguration conf;\n    std::shared_ptr<OssClient> client = std::make_shared<OssClient>(Config::Endpoint,\n        Config::AccessKeyId, Config::AccessKeySecret, \"InvalidSecurityToken\",\n        conf);\n    auto outcome = client->ListBuckets(ListBucketsRequest());\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"InvalidAccessKeyId\");\n}\n\nTEST_F(AccessKeyTest, ValidAccessKeyTest)\n{\n    ClientConfiguration conf;\n    std::shared_ptr<OssClient> client = std::make_shared<OssClient>(Config::Endpoint,\n        Config::AccessKeyId, Config::AccessKeySecret,\n        conf);\n    auto outcome = client->ListBuckets(ListBucketsRequest());\n    EXPECT_EQ(outcome.isSuccess(), true);\n}\n\n\nclass MyCredentialsProvider : public CredentialsProvider\n{\npublic:\n    MyCredentialsProvider(const Credentials &credentials):\n        CredentialsProvider(),\n        credentials_(credentials)\n    {}\n\n    MyCredentialsProvider(const std::string &accessKeyId,\n        const std::string &accessKeySecret, const std::string &securityToken = \"\"):\n        CredentialsProvider(),\n        credentials_(accessKeyId, accessKeySecret, securityToken)\n    {}\n    ~MyCredentialsProvider() {};\n\n    virtual Credentials getCredentials() override { return credentials_; }\nprivate:\n    Credentials credentials_;\n};\n\nTEST_F(AccessKeyTest, InValidCredentialsProviderTest)\n{\n    ClientConfiguration conf;\n    auto credentialsProvider = std::make_shared<MyCredentialsProvider>(\"\", \"\", \"\");\n    credentialsProvider->getCredentials().setAccessKeyId(Config::AccessKeyId);\n    credentialsProvider->getCredentials().setAccessKeySecret(Config::AccessKeySecret);\n    credentialsProvider->getCredentials().setSessionToken(\"haha\");\n    std::shared_ptr<OssClient> client = std::make_shared<OssClient>(Config::Endpoint, credentialsProvider, conf);\n    auto outcome = client->ListBuckets(ListBucketsRequest());\n    EXPECT_EQ(outcome.isSuccess(), false);\n}\n\nTEST_F(AccessKeyTest, ValidCredentialsProviderTest)\n{\n    ClientConfiguration conf;\n    auto credentialsProvider = std::make_shared<MyCredentialsProvider>(Config::AccessKeyId, Config::AccessKeySecret, \"\");\n    std::shared_ptr<OssClient> client = std::make_shared<OssClient>(Config::Endpoint, credentialsProvider, conf);\n    auto outcome = client->ListBuckets(ListBucketsRequest());\n    EXPECT_EQ(outcome.isSuccess(), true);\n}\n\nTEST_F(AccessKeyTest, InValidCredentialsTest)\n{\n    ClientConfiguration conf;\n    auto credentialsProvider = std::make_shared<MyCredentialsProvider>(\"\", \"\", \"\");\n    std::shared_ptr<OssClient> client = std::make_shared<OssClient>(Config::Endpoint, credentialsProvider->getCredentials(), conf);\n    auto outcome = client->ListBuckets(ListBucketsRequest());\n    EXPECT_EQ(outcome.isSuccess(), false);\n}\n\nTEST_F(AccessKeyTest, ValidCredentialsTest)\n{\n    ClientConfiguration conf;\n    auto credentialsProvider = std::make_shared<MyCredentialsProvider>(Config::AccessKeyId, Config::AccessKeySecret, \"\");\n    std::shared_ptr<OssClient> client = std::make_shared<OssClient>(Config::Endpoint, credentialsProvider->getCredentials(), conf);\n    auto outcome = client->ListBuckets(ListBucketsRequest());\n    EXPECT_EQ(outcome.isSuccess(), true);\n}\n\nTEST_F(AccessKeyTest, GeneratePresignedUrlRequestCredentialsProviderTest)\n{\n    ClientConfiguration conf;\n    auto credentialsProvider = std::make_shared<MyCredentialsProvider>(Config::AccessKeyId, Config::AccessKeySecret, \"haha\");\n    std::shared_ptr<OssClient> client = std::make_shared<OssClient>(Config::Endpoint, credentialsProvider, conf);\n    auto outcome = client->GeneratePresignedUrl(GeneratePresignedUrlRequest(\"bucket\",\"key\"));\n    EXPECT_EQ(outcome.isSuccess(), true);\n}\n\nTEST_F(AccessKeyTest, GenerateRTMPSignatureUrlCredentialsProviderTest)\n{\n    ClientConfiguration conf;\n    auto credentialsProvider = std::make_shared<MyCredentialsProvider>(Config::AccessKeyId, Config::AccessKeySecret, \"haha\");\n    std::shared_ptr<OssClient> client = std::make_shared<OssClient>(Config::Endpoint, credentialsProvider, conf);\n    std::string channelName = \"channel\";\n    GenerateRTMPSignedUrlRequest request(\"bucket\", channelName, \"\", 0);\n    request.setPlayList(\"test.m3u8\");\n\n    time_t tExpire = time(nullptr) + 15 * 60;\n    request.setExpires(tExpire);\n    auto generateOutcome = client->GenerateRTMPSignedUrl(request);\n\n    EXPECT_EQ(generateOutcome.isSuccess(), true);\n\n    auto outcome = generateOutcome;\n    outcome = outcome;\n    EXPECT_EQ(outcome.isSuccess(), generateOutcome.isSuccess());\n    EXPECT_EQ(outcome.result(), generateOutcome.result());\n\n#ifndef __clang__\n    outcome = std::move(outcome);\n    EXPECT_EQ(outcome.isSuccess(), generateOutcome.isSuccess());\n    EXPECT_EQ(outcome.result(), generateOutcome.result());\n#endif\n}\n\nTEST_F(AccessKeyTest, EndpointTest)\n{\n    ClientConfiguration conf;\n    auto request = ListBucketsRequest();\n    request.setMaxKeys(1);\n\n    auto endpoint = Config::Endpoint;\n    auto client = std::make_shared<OssClient>(endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    auto outcome = client->ListBuckets(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    endpoint = \"http://oss-cn-hangzhou.aliyuncs.com\";\n    client = std::make_shared<OssClient>(endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    outcome = client->ListBuckets(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    endpoint = \"http://oss-cn-hangzhou.aliyuncs.com:80\";\n    client = std::make_shared<OssClient>(endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    outcome = client->ListBuckets(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    endpoint = \"http://oss-cn-hangzhou.aliyuncs.com:80/?test=123\";\n    client = std::make_shared<OssClient>(endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    outcome = client->ListBuckets(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    endpoint = \"www.test-inc.com\\\\oss-cn-hangzhou.aliyuncs.com\";\n    client = std::make_shared<OssClient>(endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    outcome = client->ListBuckets(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    EXPECT_EQ(outcome.error().Message(), \"The endpoint is invalid.\");\n\n    endpoint = \"www.test-inc*test.com\";\n    client = std::make_shared<OssClient>(endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    outcome = client->ListBuckets(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    EXPECT_EQ(outcome.error().Message(), \"The endpoint is invalid.\");\n\n    endpoint = \"\";\n    client = std::make_shared<OssClient>(endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    outcome = client->ListBuckets(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    EXPECT_EQ(outcome.error().Message(), \"The endpoint is invalid.\");\n}\n\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketAclSettingsTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass BucketAclSettingsTest : public ::testing::Test {\nprotected:\n    BucketAclSettingsTest()\n    {\n    }\n\n    ~BucketAclSettingsTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase() \n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketaclsettings\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase() \n    {\n        Client->DeleteBucket(DeleteBucketRequest(BucketName));\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> BucketAclSettingsTest::Client = nullptr;\nstd::string BucketAclSettingsTest::BucketName = \"\";\n\nTEST_F(BucketAclSettingsTest, SetBucketAclUseRequestTest)\n{\n    Client->SetBucketAcl(SetBucketAclRequest(BucketName, CannedAccessControlList::PublicRead));\n    TestUtils::WaitForCacheExpire(5);\n    auto aclOutcome = Client->GetBucketAcl(GetBucketAclRequest(BucketName));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n    EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::PublicRead);\n\n    //set to readwrite\n    Client->SetBucketAcl(SetBucketAclRequest(BucketName, CannedAccessControlList::PublicReadWrite));\n    TestUtils::WaitForCacheExpire(5);\n    aclOutcome = Client->GetBucketAcl(GetBucketAclRequest(BucketName));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n    EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::PublicReadWrite);\n\n    //set to private\n    Client->SetBucketAcl(SetBucketAclRequest(BucketName, CannedAccessControlList::Private));\n    TestUtils::WaitForCacheExpire(5);\n    aclOutcome = Client->GetBucketAcl(GetBucketAclRequest(BucketName));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n    EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::Private);\n}\n\nTEST_F(BucketAclSettingsTest, SetBucketAclUseDefaultTest)\n{\n    auto aclOutcome = Client->GetBucketAcl(GetBucketAclRequest(BucketName));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n\n    //set to Default\n    Client->SetBucketAcl(SetBucketAclRequest(BucketName, CannedAccessControlList::Default));\n    TestUtils::WaitForCacheExpire(5);\n    auto aclOutcome1 = Client->GetBucketAcl(GetBucketAclRequest(BucketName));\n    EXPECT_EQ(aclOutcome1.isSuccess(), true);\n   \n    EXPECT_EQ(aclOutcome1.result().Acl(), aclOutcome.result().Acl());\n}\n\nTEST_F(BucketAclSettingsTest, SetBucketAclPublicReadTest)\n{\n    auto aclOutcome = Client->GetBucketAcl(GetBucketAclRequest(BucketName));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n\n    //set to Default\n    SetBucketAclRequest request(BucketName, CannedAccessControlList::Default);\n    request.setAcl(CannedAccessControlList::PublicRead);\n    Client->SetBucketAcl(request);\n    TestUtils::WaitForCacheExpire(5);\n    auto aclOutcome1 = Client->GetBucketAcl(GetBucketAclRequest(BucketName));\n    TestUtils::WaitForCacheExpire(5);\n    aclOutcome1 = Client->GetBucketAcl(GetBucketAclRequest(BucketName));\n    EXPECT_EQ(aclOutcome1.isSuccess(), true);\n    EXPECT_EQ(aclOutcome1.result().Acl(), CannedAccessControlList::PublicRead);\n}\n\nTEST_F(BucketAclSettingsTest, GetBucketAclNegativeTest)\n{\n    auto name = TestUtils::GetBucketName(\"no-exist-bucket-acl\");\n    auto aclOutcome = Client->GetBucketAcl(name);\n    EXPECT_EQ(aclOutcome.isSuccess(), false);\n    EXPECT_EQ(aclOutcome.error().Code(), \"NoSuchBucket\");\n}\n\n#if 0\n//NG\nTEST_F(BucketAclSettingsTest, SetBucketAclNegativeTest)\n{\n    auto aclOutcome = Client->SetBucketAcl(\"no-exist-bucket\", CannedAccessControlList::PublicRead);\n    EXPECT_EQ(aclOutcome.isSuccess(), false);\n    EXPECT_EQ(aclOutcome.error().Code(), \"NoSuchBucket\");\n}\n#endif\n\n#if 0\n//NG\nTEST_F(BucketAclSettingsTest, SetBucketAclNegativeTest)\n{\n    auto aclOutcome = Client->SetBucketAcl(\"no-exist-bucket\", CannedAccessControlList::PublicRead);\n    EXPECT_EQ(aclOutcome.isSuccess(), false);\n    EXPECT_EQ(aclOutcome.error().code(), \"NoSuchBucket\");\n}\n#endif\n\nTEST_F(BucketAclSettingsTest, GetBucketAclResult)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" ?>\n                        <AccessControlPolicy>\n                            <Owner>\n                                <ID>00220120222</ID>\n                                <DisplayName>user_example</DisplayName>\n                            </Owner>\n                            <AccessControlList>\n                                <Grant>public-read</Grant>\n                            </AccessControlList>\n                        </AccessControlPolicy>)\";\n    GetBucketAclResult result(xml);\n    EXPECT_EQ(result.Acl(), CannedAccessControlList::PublicRead);\n    EXPECT_EQ(result.Owner().DisplayName(), \"user_example\");\n}\n\nTEST_F(BucketAclSettingsTest, SetBucketAclInvalidValidateTest)\n{\n    auto aclOutcome = Client->SetBucketAcl(\"Invalid-bucket-test\", CannedAccessControlList::PublicRead);\n    EXPECT_EQ(aclOutcome.isSuccess(), false);\n    EXPECT_EQ(aclOutcome.error().Code(), \"ValidateError\");\n}\n\nTEST_F(BucketAclSettingsTest, OssBucketRequestSetBucketTest)\n{\n    GetBucketAclRequest request(BucketName);\n    request.setBucket(BucketName);\n    auto aclOutcome = Client->GetBucketAcl(request);\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n}\n\nTEST_F(BucketAclSettingsTest, BucketAclWithInvalidResponseBodyTest)\n{\n    auto gbaRequest = GetBucketAclRequest(BucketName);\n    gbaRequest.setResponseStreamFactory([=]() {\n        auto content = std::make_shared<std::stringstream>();\n        content->write(\"invlid data\", 11);\n        return content;\n    });\n    auto gbaOutcome = Client->GetBucketAcl(gbaRequest);\n    EXPECT_EQ(gbaOutcome.isSuccess(), false);\n    EXPECT_EQ(gbaOutcome.error().Code(), \"ParseXMLError\");\n}\n\nTEST_F(BucketAclSettingsTest, GetBucketAclResultBranchTest)\n{\n    GetBucketAclResult result(\"test\");\n\n    std::string xml = R\"(<?xml version=\"1.0\" ?>\n                        <AccessControl>\n                            <Owner>\n                            </Owner>\n                            <AccessControlList>\n                            </AccessControlList>\n                        </AccessControl>)\";\n    GetBucketAclResult result1(std::make_shared<std::stringstream>(xml));\n\n    xml = R\"(<?xml version=\"1.0\" ?>\n                        <AccessControlPolicy>\n                                <ID>00220120222</ID>\n                                <DisplayName>user_example</DisplayName>\n                                <Grant>public-read</Grant>\n                        </AccessControlPolicy>)\";\n    GetBucketAclResult result2(xml);\n\n    xml = R\"(<?xml version=\"1.0\" ?>\n                        <AccessControlPolicy>\n                            <Owner>\n                            </Owner>\n                            <AccessControlList>\n                            </AccessControlList>\n                        </AccessControlPolicy>)\";\n    GetBucketAclResult result4(xml);\n\n    xml = R\"(<?xml version=\"1.0\" ?>\n                        <AccessControlPolicy>\n                            <Owner>\n                                <ID></ID>\n                                <DisplayName></DisplayName>\n                            </Owner>\n                            <AccessControlList>\n                                <Grant></Grant>\n                            </AccessControlList>\n                        </AccessControlPolicy>)\";\n    GetBucketAclResult result5(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    GetBucketAclResult result6(xml);\n\n}\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketBasicOperationTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass BucketBasicOperationTest : public ::testing::Test {\r\nprotected:\r\n    BucketBasicOperationTest()\r\n    {\r\n    }\r\n\r\n    ~BucketBasicOperationTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase()\r\n    {\r\n        Client = TestUtils::GetOssClientDefault();\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase()\r\n    {\r\n        Client = nullptr;\r\n    }\r\n\r\n    // Sets up the test fixture.\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    // Tears down the test fixture.\r\n    void TearDown() override\r\n    {\r\n    }\r\npublic:\r\n    static std::shared_ptr<OssClient> Client;\r\n    static std::string BucketNamePrefix;\r\n};\r\n\r\nstd::shared_ptr<OssClient> BucketBasicOperationTest::Client = nullptr;\r\nstd::string BucketBasicOperationTest::BucketNamePrefix = \"cpp-sdk-bucketbasicoperation\";\r\n#define testPrefix  BucketBasicOperationTest::BucketNamePrefix\r\n//testPrefix =  \"cpp-sdk-bucketbasicoperation\";\r\n\r\nTEST_F(BucketBasicOperationTest, CreateBucketInvalidNameTest)\r\n{\r\n    for(auto const &name : TestUtils::InvalidBucketNamesList())\r\n    {\r\n        auto outcome = Client->CreateBucket(CreateBucketRequest(name));\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\r\n    }\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, DeleteBucketInvalidNameTest)\r\n{\r\n    for (auto const &name : TestUtils::InvalidBucketNamesList())\r\n    {\r\n        auto outcome = Client->DeleteBucket(DeleteBucketRequest(name));\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\r\n    }\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, CreateBucketWithAclTest)\r\n{\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(testPrefix);\r\n    EXPECT_EQ(Client->DoesBucketExist(bucketName), false);\r\n\r\n    //create a new bucket\r\n    Client->CreateBucket(bucketName, StorageClass::Archive, CannedAccessControlList::PublicReadWrite);\r\n    //TestUtils::WaitForCacheExpire(8);\r\n    EXPECT_EQ(Client->DoesBucketExist(bucketName), true);\r\n\r\n    auto outcome = Client->GetBucketAcl(bucketName);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().Acl(), CannedAccessControlList::PublicReadWrite);\r\n\r\n    Client->DeleteBucket(bucketName);\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, CreateAndDeleteArchiveBucketTest)\r\n{\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(testPrefix);\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), false);\r\n\r\n    //create a new bucket\r\n    auto outcome = Client->CreateBucket(CreateBucketRequest(bucketName, StorageClass::Archive));\r\n    //TestUtils::WaitForCacheExpire(8);\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), true);\r\n\r\n    auto objectName = bucketName;\r\n    objectName.append(\"firstobject\");\r\n    Client->PutObject(PutObjectRequest(bucketName, objectName, std::make_shared<std::stringstream>()));\r\n\r\n    auto metaOutcome = Client->HeadObject(HeadObjectRequest(bucketName, objectName));\r\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\r\n    EXPECT_STREQ(metaOutcome.result().HttpMetaData().at(\"x-oss-storage-class\").c_str(), \"Archive\");\r\n    Client->DeleteObject(DeleteObjectRequest(bucketName, objectName));\r\n\r\n    //delete the new created bucket\r\n    Client->DeleteBucket(DeleteBucketRequest(bucketName));\r\n    TestUtils::WaitForCacheExpire(5);\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), false);\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, CreateAndDeleteBucketDefaultRegionTest)\r\n{\r\n    //point to default region\r\n    ClientConfiguration conf;\r\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(testPrefix);\r\n\r\n    //assert bucket does not exist\r\n    EXPECT_EQ(TestUtils::BucketExists(client, bucketName), false);\r\n\r\n    //create a new bucket\r\n    client.CreateBucket(CreateBucketRequest(bucketName));\r\n    EXPECT_EQ(TestUtils::BucketExists(client, bucketName), true);\r\n\r\n    //delete the bucket\r\n    client.DeleteBucket(DeleteBucketRequest(bucketName));\r\n    TestUtils::WaitForCacheExpire(5);\r\n    EXPECT_EQ(TestUtils::BucketExists(client, bucketName), false);\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, CreateAndDeleteBucketTest)\r\n{\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(testPrefix);\r\n\r\n    //assert bucket does not exist\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), false);\r\n\r\n    //create a new bucket\r\n    Client->CreateBucket(CreateBucketRequest(bucketName));\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), true);\r\n\r\n    //delete the bucket\r\n    Client->DeleteBucket(DeleteBucketRequest(bucketName));\r\n    TestUtils::WaitForCacheExpire(5);\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), false);\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, CreateAndDeleteIABucketTest)\r\n{\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(testPrefix);\r\n\r\n    //assert bucket does not exist\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), false);\r\n\r\n    //create a new bucket\r\n    auto outcome = Client->CreateBucket(CreateBucketRequest(bucketName, StorageClass::IA));\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), true);\r\n\r\n    auto objectName = bucketName;\r\n    objectName.append(\"firstobject\");\r\n    Client->PutObject(PutObjectRequest(bucketName, objectName, std::make_shared<std::stringstream>()));\r\n\r\n    auto metaOutcome = Client->HeadObject(HeadObjectRequest(bucketName, objectName));\r\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\r\n    EXPECT_STREQ(metaOutcome.result().HttpMetaData().at(\"x-oss-storage-class\").c_str(), \"IA\");\r\n    Client->DeleteObject(DeleteObjectRequest(bucketName, objectName));\r\n\r\n    //delete the new created bucket\r\n    Client->DeleteBucket(DeleteBucketRequest(bucketName));\r\n    TestUtils::WaitForCacheExpire(5);\r\n    TestUtils::BucketExists(*Client, bucketName);\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), false);\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, GetBucketInfoTest)\r\n{\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(testPrefix);\r\n\r\n    //assert bucket does not exist\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), false);\r\n\r\n    //create a new bucket\r\n    Client->CreateBucket(CreateBucketRequest(bucketName, StorageClass::IA));\r\n\r\n    GetBucketInfoRequest request(bucketName);\r\n    auto bfOutcome = Client->GetBucketInfo(request);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().Acl(), CannedAccessControlList::Private);\r\n\r\n    Client->SetBucketAcl(SetBucketAclRequest(bucketName, CannedAccessControlList::PublicRead));\r\n    TestUtils::WaitForCacheExpire(5);\r\n    bfOutcome = Client->GetBucketInfo(request);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().Acl(), CannedAccessControlList::PublicRead);\r\n\r\n    Client->SetBucketAcl(SetBucketAclRequest(bucketName, CannedAccessControlList::PublicReadWrite));\r\n    TestUtils::WaitForCacheExpire(5);\r\n    bfOutcome = Client->GetBucketInfo(request);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().Acl(), CannedAccessControlList::PublicReadWrite);\r\n\r\n    EXPECT_EQ(bfOutcome.result().Location().empty(), false);\r\n    EXPECT_EQ(bfOutcome.result().ExtranetEndpoint().empty(), false);\r\n    EXPECT_EQ(bfOutcome.result().IntranetEndpoint().empty(), false);\r\n\r\n    EXPECT_EQ(bfOutcome.result().StorageClass(), StorageClass::IA);\r\n    EXPECT_STREQ(bfOutcome.result().Name().c_str(), bucketName.c_str());\r\n\r\n    //delete the bucket\r\n    Client->DeleteBucket(DeleteBucketRequest(bucketName));\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, GetBucketLocationTest)\r\n{\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(testPrefix);\r\n\r\n    //assert bucket does not exist\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), false);\r\n\r\n    //create a new bucket\r\n    Client->CreateBucket(CreateBucketRequest(bucketName));\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), true);\r\n\r\n    //get bucket location\r\n    auto locOutcome = Client->GetBucketLocation(GetBucketLocationRequest(bucketName));\r\n    EXPECT_EQ(locOutcome.isSuccess(), true);\r\n    EXPECT_EQ(locOutcome.result().Location().compare(0,4,\"oss-\", 4), 0);\r\n\r\n    //delete the bucket\r\n    Client->DeleteBucket(DeleteBucketRequest(bucketName));\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, GetBucketLocationNegativeTest)\r\n{\r\n    auto outcome = Client->GetBucketLocation(\"no-exist-bucket-location\");\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, GetBucketStatTest)\r\n{\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(testPrefix);\r\n\r\n    //assert bucket does not exist\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), false);\r\n\r\n    //create a new bucket\r\n    Client->CreateBucket(CreateBucketRequest(bucketName));\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), true);\r\n\r\n    //put object\r\n    auto objectName = bucketName;\r\n    objectName.append(\"firstobject\");\r\n    Client->PutObject(PutObjectRequest(bucketName, objectName, std::make_shared<std::stringstream>(\"1234\")));\r\n\r\n    auto bsOutcome = Client->GetBucketStat(GetBucketStatRequest(bucketName));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bsOutcome.result().Storage(), 4ULL);\r\n    EXPECT_EQ(bsOutcome.result().ObjectCount(), 1ULL);\r\n    EXPECT_EQ(bsOutcome.result().MultipartUploadCount(), 0ULL);\r\n\r\n    //delete the bucket\r\n    Client->DeleteObject(DeleteObjectRequest(bucketName, objectName));\r\n    Client->DeleteBucket(DeleteBucketRequest(bucketName));\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, GetNonExistBucketInfoTest)\r\n{\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(testPrefix);\r\n\r\n    //assert bucket does not exist\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), false);\r\n\r\n    auto outcome = Client->GetBucketInfo(GetBucketInfoRequest(bucketName));\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"NoSuchBucket\");\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, GetNonExistBucketStatTest)\r\n{\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(testPrefix);\r\n\r\n    //assert bucket does not exist\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), false);\r\n\r\n    auto outcome = Client->GetBucketStat(GetBucketStatRequest(bucketName));\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"NoSuchBucket\");\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, ListBucketspagingTest)\r\n{\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(testPrefix);\r\n\r\n    //assert bucket does not exist\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), false);\r\n\r\n    for (int i = 0; i < 5; i++)\r\n    {\r\n        auto name = bucketName;\r\n        name.append(\"-\").append(std::to_string(i));\r\n        Client->CreateBucket(CreateBucketRequest(name));\r\n    }\r\n\r\n    //list all\r\n    ListBucketsRequest request;\r\n    request.setPrefix(bucketName);\r\n    request.setMaxKeys(100);\r\n    auto outcome = Client->ListBuckets(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().Buckets().size(), 5UL);\r\n\r\n    outcome = Client->ListBuckets();\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_TRUE(outcome.result().Buckets().size() > 5UL);\r\n\r\n    //list by step\r\n    request.setMaxKeys(2);\r\n    bool IsTruncated = false;\r\n    size_t total = 0;\r\n    do {\r\n        outcome = Client->ListBuckets(request);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        EXPECT_LT(outcome.result().Buckets().size(), 3UL);\r\n        total += outcome.result().Buckets().size();\r\n        request.setMarker(outcome.result().NextMarker());\r\n        IsTruncated = outcome.result().IsTruncated();\r\n    } while (IsTruncated);\r\n    EXPECT_EQ(total, 5UL);\r\n\r\n    //delete all\r\n    //request.setMaxKeys(100);\r\n    outcome = Client->ListBuckets(ListBucketsRequest(bucketName, \"\", 100));\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    for (auto const &bucket : outcome.result().Buckets()) {\r\n        Client->DeleteBucket(DeleteBucketRequest(bucket.Name()));\r\n    }\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, GetBucketInfoResult)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <BucketInfo>\r\n                          <Bucket>\r\n                            <CreationDate>2013-07-31T10:56:21.000Z</CreationDate>\r\n                            <ExtranetEndpoint>oss-cn-hangzhou.aliyuncs.com</ExtranetEndpoint>\r\n                            <IntranetEndpoint>oss-cn-hangzhou-internal.aliyuncs.com</IntranetEndpoint>\r\n                            <Location>oss-cn-hangzhou</Location>\r\n                            <Name>oss-example</Name>\r\n                            <Owner>\r\n                              <DisplayName>username</DisplayName>\r\n                              <ID>271834739143143</ID>\r\n                            </Owner>\r\n                            <AccessControlList>\r\n                              <Grant>private</Grant>\r\n                            </AccessControlList>\r\n                            <Comment>test</Comment>\r\n                            <DataRedundancyType>LRS</DataRedundancyType>\r\n                          </Bucket>\r\n                        </BucketInfo>)\";\r\n    GetBucketInfoResult result(xml);\r\n    EXPECT_EQ(result.CreationDate(), \"2013-07-31T10:56:21.000Z\");\r\n    EXPECT_EQ(result.Location(), \"oss-cn-hangzhou\");\r\n    EXPECT_EQ(result.ExtranetEndpoint(), \"oss-cn-hangzhou.aliyuncs.com\");\r\n    EXPECT_EQ(result.Acl(), CannedAccessControlList::Private);\r\n    EXPECT_EQ(result.Comment(), \"test\");\r\n    EXPECT_EQ(result.DataRedundancyType(), DataRedundancyType::LRS);\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, ListBucketsResultTest)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListAllMyBucketsResult>\r\n                          <Owner>\r\n                            <ID>1305433695277957</ID>\r\n                            <DisplayName>1305433695277957</DisplayName>\r\n                          </Owner>\r\n                          <Buckets>\r\n                            <Bucket>\r\n                              <CreationDate>2018-10-27T07:42:26.000Z</CreationDate>\r\n                              <ExtranetEndpoint>oss-cn-hangzhou.aliyuncs.com</ExtranetEndpoint>\r\n                              <IntranetEndpoint>oss-cn-hangzhou-internal.aliyuncs.com</IntranetEndpoint>\r\n                              <Location>oss-cn-hangzhou</Location>\r\n                              <Name>cpp-sdk-bucketbasicoperation-bucket-1540626145748-0</Name>\r\n                              <StorageClass>Standard</StorageClass>\r\n                            </Bucket>\r\n                            <Bucket>\r\n                              <CreationDate>2018-10-27T07:42:26.000Z</CreationDate>\r\n                              <ExtranetEndpoint>oss-cn-hangzhou.aliyuncs.com</ExtranetEndpoint>\r\n                              <IntranetEndpoint>oss-cn-hangzhou-internal.aliyuncs.com</IntranetEndpoint>\r\n                              <Location>oss-cn-hangzhou</Location>\r\n                              <Name>cpp-sdk-bucketbasicoperation-bucket-1540626145748-1</Name>\r\n                              <StorageClass>Standard</StorageClass>\r\n                            </Bucket>\r\n                            <Bucket>\r\n                              <CreationDate>2018-10-27T07:42:26.000Z</CreationDate>\r\n                              <ExtranetEndpoint>oss-cn-hangzhou.aliyuncs.com</ExtranetEndpoint>\r\n                              <IntranetEndpoint>oss-cn-hangzhou-internal.aliyuncs.com</IntranetEndpoint>\r\n                              <Location>oss-cn-hangzhou</Location>\r\n                              <Name>cpp-sdk-bucketbasicoperation-bucket-1540626145748-2</Name>\r\n                              <StorageClass>Standard</StorageClass>\r\n                            </Bucket>\r\n                            <Bucket>\r\n                              <CreationDate>2018-10-27T07:42:27.000Z</CreationDate>\r\n                              <ExtranetEndpoint>oss-cn-hangzhou.aliyuncs.com</ExtranetEndpoint>\r\n                              <IntranetEndpoint>oss-cn-hangzhou-internal.aliyuncs.com</IntranetEndpoint>\r\n                              <Location>oss-cn-hangzhou</Location>\r\n                              <Name>cpp-sdk-bucketbasicoperation-bucket-1540626145748-3</Name>\r\n                              <StorageClass>Standard</StorageClass>\r\n                            </Bucket>\r\n                          </Buckets>\r\n                        </ListAllMyBucketsResult>)\";\r\n    ListBucketsResult result(xml);\r\n    EXPECT_EQ(result.Buckets().size(), 4UL);\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, ListBucketsResultWithEncodeTypeTest)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListAllMyBucketsResult>\r\n                          <Owner>\r\n                            <ID>1305433695277957</ID>\r\n                            <DisplayName>1305433695277957</DisplayName>\r\n                          </Owner>\r\n                          <Buckets>\r\n                            <Bucket>\r\n                              <CreationDate>2018-10-27T07:42:26.000Z</CreationDate>\r\n                              <ExtranetEndpoint>oss-cn-hangzhou.aliyuncs.com</ExtranetEndpoint>\r\n                              <IntranetEndpoint>oss-cn-hangzhou-internal.aliyuncs.com</IntranetEndpoint>\r\n                              <Location>oss-cn-hangzhou</Location>\r\n                              <Name>cpp-sdk-bucketbasicoperation-bucket-1540626145748-0</Name>\r\n                              <StorageClass>Standard</StorageClass>\r\n                            </Bucket>\r\n                            <Bucket>\r\n                              <CreationDate>2018-10-27T07:42:26.000Z</CreationDate>\r\n                              <ExtranetEndpoint>oss-cn-hangzhou.aliyuncs.com</ExtranetEndpoint>\r\n                              <IntranetEndpoint>oss-cn-hangzhou-internal.aliyuncs.com</IntranetEndpoint>\r\n                              <Location>oss-cn-hangzhou</Location>\r\n                              <Name>cpp-sdk-bucketbasicoperation-bucket-1540626145748-1</Name>\r\n                              <StorageClass>Standard</StorageClass>\r\n                            </Bucket>\r\n                            <Bucket>\r\n                              <CreationDate>2018-10-27T07:42:26.000Z</CreationDate>\r\n                              <ExtranetEndpoint>oss-cn-hangzhou.aliyuncs.com</ExtranetEndpoint>\r\n                              <IntranetEndpoint>oss-cn-hangzhou-internal.aliyuncs.com</IntranetEndpoint>\r\n                              <Location>oss-cn-hangzhou</Location>\r\n                              <Name>cpp-sdk-bucketbasicoperation-bucket-1540626145748-2</Name>\r\n                              <StorageClass>Standard</StorageClass>\r\n                            </Bucket>\r\n                            <Bucket>\r\n                              <CreationDate>2018-10-27T07:42:27.000Z</CreationDate>\r\n                              <ExtranetEndpoint>oss-cn-hangzhou.aliyuncs.com</ExtranetEndpoint>\r\n                              <IntranetEndpoint>oss-cn-hangzhou-internal.aliyuncs.com</IntranetEndpoint>\r\n                              <Location>oss-cn-hangzhou</Location>\r\n                              <Name>cpp-sdk-bucketbasicoperation-bucket-1540626145748-3</Name>\r\n                              <StorageClass>Standard</StorageClass>\r\n                            </Bucket>\r\n                          </Buckets>\r\n                        </ListAllMyBucketsResult>)\";\r\n    ListBucketsResult result(xml);\r\n    EXPECT_EQ(result.Buckets().size(), 4UL);\r\n}\r\n\r\n\r\nTEST_F(BucketBasicOperationTest, GetBucketStatResult)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <BucketStat>\r\n                          <Storage>1024123</Storage>\r\n                          <ObjectCount>1000</ObjectCount>\r\n                          <MultipartUploadCount>20</MultipartUploadCount>\r\n                        </BucketStat>)\";\r\n    GetBucketStatResult result(xml);\r\n    EXPECT_EQ(result.MultipartUploadCount(), 20ULL);\r\n    EXPECT_EQ(result.ObjectCount(), 1000ULL);\r\n    EXPECT_EQ(result.Storage(), 1024123ULL);\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, GetBucketStatResultEnhancedTest)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <BucketStat>\r\n                          <Storage>1600</Storage>\r\n                          <ObjectCount>230</ObjectCount>\r\n                          <MultipartUploadCount>40</MultipartUploadCount>\r\n                          <LiveChannelCount>4</LiveChannelCount>\r\n                          <LastModifiedTime>153221331</LastModifiedTime>\r\n                          <StandardStorage>430</StandardStorage>\r\n                          <StandardObjectCount>66</StandardObjectCount>\r\n                          <InfrequentAccessStorage>2359296</InfrequentAccessStorage>\r\n                          <InfrequentAccessObjectCount>54</InfrequentAccessObjectCount>\r\n                          <ArchiveStorage>2949120</ArchiveStorage>\r\n                          <ArchiveObjectCount>74</ArchiveObjectCount>\r\n                          <ColdArchiveStorage>2359296</ColdArchiveStorage>\r\n                          <ColdArchiveObjectCount>36</ColdArchiveObjectCount>\r\n                        </BucketStat>)\";\r\n\r\n    GetBucketStatResult result(xml);\r\n    EXPECT_EQ(result.MultipartUploadCount(), 40ULL);\r\n    EXPECT_EQ(result.ObjectCount(), 230ULL);\r\n    EXPECT_EQ(result.Storage(), 1600ULL);\r\n    EXPECT_EQ(result.LiveChannelCount(), 4ULL);\r\n    EXPECT_EQ(result.LastModifiedTime(), 153221331ULL);\r\n    EXPECT_EQ(result.StandardStorage(), 430ULL);\r\n    EXPECT_EQ(result.StandardObjectCount(), 66ULL);\r\n    EXPECT_EQ(result.InfrequentAccessStorage(), 2359296ULL);\r\n    EXPECT_EQ(result.InfrequentAccessObjectCount(), 54ULL);\r\n    EXPECT_EQ(result.ArchiveStorage(), 2949120ULL);\r\n    EXPECT_EQ(result.ArchiveObjectCount(), 74ULL);\r\n    EXPECT_EQ(result.ColdArchiveStorage(), 2359296ULL);\r\n    EXPECT_EQ(result.ColdArchiveObjectCount(), 36ULL);\r\n}\r\n\r\n\r\nTEST_F(BucketBasicOperationTest, GetBucketLocationResult)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <LocationConstraint xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">oss-cn-hangzhou</LocationConstraint>)\";\r\n    GetBucketLocationResult result(xml);\r\n    EXPECT_EQ(result.Location(), \"oss-cn-hangzhou\");\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, CreateBucketDataRedundancyTypeTest)\r\n{\r\n    auto bucketName = TestUtils::GetBucketName(testPrefix);\r\n\r\n    //LRS\r\n    CreateBucketRequest request(bucketName);\r\n    request.setDataRedundancyType(DataRedundancyType::LRS);\r\n    auto outcome = Client->CreateBucket(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    TestUtils::WaitForCacheExpire(2);\r\n    auto infoOutcome = Client->GetBucketInfo(bucketName);\r\n    EXPECT_EQ(infoOutcome.isSuccess(), true);\r\n    EXPECT_EQ(infoOutcome.result().DataRedundancyType(), DataRedundancyType::LRS);\r\n\r\n    Client->DeleteBucket(bucketName);\r\n\r\n    //ZRS\r\n    bucketName = TestUtils::GetBucketName(testPrefix);\r\n    request.setBucket(bucketName);\r\n    request.setDataRedundancyType(DataRedundancyType::ZRS);\r\n    outcome = Client->CreateBucket(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    TestUtils::WaitForCacheExpire(2);\r\n    infoOutcome = Client->GetBucketInfo(bucketName);\r\n    EXPECT_EQ(infoOutcome.isSuccess(), true);\r\n    EXPECT_EQ(infoOutcome.result().DataRedundancyType(), DataRedundancyType::ZRS);\r\n    Client->DeleteBucket(bucketName);\r\n\r\n    //NotSet\r\n    bucketName = TestUtils::GetBucketName(testPrefix);\r\n    request.setBucket(bucketName);\r\n    request.setDataRedundancyType(DataRedundancyType::NotSet);\r\n    outcome = Client->CreateBucket(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    TestUtils::WaitForCacheExpire(2);\r\n    infoOutcome = Client->GetBucketInfo(bucketName);\r\n    EXPECT_EQ(infoOutcome.isSuccess(), true);\r\n    EXPECT_EQ(infoOutcome.result().DataRedundancyType(), DataRedundancyType::LRS);\r\n    Client->DeleteBucket(bucketName);\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, ObjectMetaDataFunctionTest)\r\n{\r\n    ObjectMetaData meta;\r\n    meta.addHeader(\"x-oss-object-type\", \"test\");\r\n    meta.ObjectType();\r\n\r\n    meta.addUserHeader(\"value\", \"key\");\r\n    meta.hasUserHeader(\"value\");\r\n    meta.removeUserHeader(\"value\");\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, InvalidResponseBodyTest)\r\n{\r\n    auto bucketName = TestUtils::GetBucketName(\"invalid-body\");\r\n    Client->CreateBucket(bucketName);\r\n\r\n    auto lsRequest = ListBucketsRequest();\r\n    lsRequest.setResponseStreamFactory([=]() {\r\n        auto content = std::make_shared<std::stringstream>();\r\n        content->write(\"invlid data\", 11);\r\n        return content;\r\n    });\r\n    auto lsOutcome = Client->ListBuckets(lsRequest);\r\n    EXPECT_EQ(lsOutcome.isSuccess(), false);\r\n    EXPECT_EQ(lsOutcome.error().Code(), \"ParseXMLError\");\r\n\r\n    auto gbiRequest = GetBucketInfoRequest(bucketName);\r\n    gbiRequest.setResponseStreamFactory([=]() {\r\n        auto content = std::make_shared<std::stringstream>();\r\n        content->write(\"invlid data\", 11);\r\n        return content;\r\n    });\r\n    auto gbiOutcome = Client->GetBucketInfo(gbiRequest);\r\n    EXPECT_EQ(gbiOutcome.isSuccess(), false);\r\n    EXPECT_EQ(gbiOutcome.error().Code(), \"ParseXMLError\");\r\n\r\n    auto gbrRequest = GetBucketRefererRequest(bucketName);\r\n    gbrRequest.setResponseStreamFactory([=]() {\r\n        auto content = std::make_shared<std::stringstream>();\r\n        content->write(\"invlid data\", 11);\r\n        return content;\r\n    });\r\n    auto gbrOutcome = Client->GetBucketReferer(gbrRequest);\r\n    EXPECT_EQ(gbrOutcome.isSuccess(), false);\r\n    EXPECT_EQ(gbrOutcome.error().Code(), \"ParseXMLError\");\r\n\r\n    auto gbsRequest = GetBucketStatRequest(bucketName);\r\n    gbsRequest.setResponseStreamFactory([=]() {\r\n        auto content = std::make_shared<std::stringstream>();\r\n        content->write(\"invlid data\", 11);\r\n        return content;\r\n    });\r\n    auto gbsOutcome = Client->GetBucketStat(gbsRequest);\r\n    EXPECT_EQ(gbsOutcome.isSuccess(), false);\r\n    EXPECT_EQ(gbsOutcome.error().Code(), \"ParseXMLError\");\r\n\r\n    auto gblRequest = GetBucketLocationRequest(bucketName);\r\n    gblRequest.setResponseStreamFactory([=]() {\r\n        auto content = std::make_shared<std::stringstream>();\r\n        content->write(\"invlid data\", 11);\r\n        return content;\r\n    });\r\n    auto gblOutcome = Client->GetBucketLocation(gblRequest);\r\n    EXPECT_EQ(gblOutcome.isSuccess(), false);\r\n    EXPECT_EQ(gblOutcome.error().Code(), \"ParseXMLError\");\r\n\r\n    Client->DeleteBucket(bucketName);\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, GetBucketInfoResultBranchTest)\r\n{\r\n    GetBucketInfoResult result(\"test\");\r\n\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <Bucket>\r\n                        </Bucket>)\";\r\n    GetBucketInfoResult result1(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <BucketInfo>\r\n                        </BucketInfo>)\";\r\n    GetBucketInfoResult result2(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <BucketInfo>\r\n                          <Bucket>\r\n\r\n                          </Bucket>\r\n                        </BucketInfo>)\";\r\n    GetBucketInfoResult result3(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <BucketInfo>\r\n                          <Bucket>\r\n                            <CreationDate></CreationDate>\r\n                            <ExtranetEndpoint></ExtranetEndpoint>\r\n                            <IntranetEndpoint></IntranetEndpoint>\r\n                            <Location></Location>\r\n                            <Name></Name>\r\n                            <Owner>\r\n                            </Owner>\r\n                            <AccessControlList>\r\n                            </AccessControlList>\r\n                            <Comment></Comment>\r\n                            <DataRedundancyType>LRS</DataRedundancyType>\r\n                          </Bucket>\r\n                        </BucketInfo>)\";\r\n    GetBucketInfoResult result4(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <BucketInfo>\r\n                          <Bucket>\r\n                            <CreationDate>2013-07-31T10:56:21.000Z</CreationDate>\r\n                            <ExtranetEndpoint>oss-cn-hangzhou.aliyuncs.com</ExtranetEndpoint>\r\n                            <IntranetEndpoint>oss-cn-hangzhou-internal.aliyuncs.com</IntranetEndpoint>\r\n                            <Location>oss-cn-hangzhou</Location>\r\n                            <Name>oss-example</Name>\r\n                            <StorageClass></StorageClass>\r\n                            <DataRedundancyType></DataRedundancyType>\r\n                            <Owner>\r\n                              <DisplayName></DisplayName>\r\n                              <ID></ID>\r\n                            </Owner>\r\n                            <AccessControlList>\r\n                              <Grant></Grant>\r\n                            </AccessControlList>\r\n                            <Comment>test</Comment>\r\n                            <DataRedundancyType>LRS</DataRedundancyType>\r\n                          </Bucket>\r\n                        </BucketInfo>)\";\r\n    GetBucketInfoResult result10(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <BucketInfo>\r\n                          <Bucket>\r\n                            <CreationDate></CreationDate>\r\n                            <ExtranetEndpoint></ExtranetEndpoint>\r\n                            <IntranetEndpoint></IntranetEndpoint>\r\n                            <Location></Location>\r\n                            <Name></Name>\r\n                            <StorageClass></StorageClass>\r\n                            <Owner>\r\n                              <DisplayName></DisplayName>\r\n                              <ID></ID>\r\n                            </Owner>\r\n                            <AccessControlList>\r\n                              <Grant></Grant>\r\n                            </AccessControlList>\r\n                            <Comment></Comment>\r\n                            <DataRedundancyType></DataRedundancyType>\r\n                            <ServerSideEncryptionRule>\r\n                              <SSEAlgorithm></SSEAlgorithm>\r\n                              <KMSMasterKeyID></KMSMasterKeyID>\r\n                            </ServerSideEncryptionRule>\r\n                            <Versioning></Versioning>\r\n                          </Bucket>\r\n                        </BucketInfo>)\";\r\n    result10 = GetBucketInfoResult(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <BucketInfo>\r\n                          <Bucket>\r\n                            <CreationDate></CreationDate>\r\n                            <ExtranetEndpoint></ExtranetEndpoint>\r\n                            <IntranetEndpoint></IntranetEndpoint>\r\n                            <Location></Location>\r\n                            <Name></Name>\r\n                            <StorageClass></StorageClass>\r\n                            <Owner>\r\n                            </Owner>\r\n                            <AccessControlList>\r\n                            </AccessControlList>\r\n                            <Comment></Comment>\r\n                            <DataRedundancyType></DataRedundancyType>\r\n                            <ServerSideEncryptionRule>\r\n                            </ServerSideEncryptionRule>\r\n                            <Versioning></Versioning>\r\n                          </Bucket>\r\n                        </BucketInfo>)\";\r\n    result10 = GetBucketInfoResult(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <BucketInfo>\r\n                          <Bucket>\r\n                          </Bucket>\r\n                        </BucketInfo>)\";\r\n    result10 = GetBucketInfoResult(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <BucketInfo>\r\n                        </BucketInfo>)\";\r\n    result10 = GetBucketInfoResult(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\r\n    GetBucketInfoResult result13(xml);\r\n\r\n    GetBucketLocationResult result5(\"test\");\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <Location xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">oss-cn-hangzhou</Location>)\";\r\n    GetBucketLocationResult result6(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <LocationConstraint></LocationConstraint>)\";\r\n    GetBucketLocationResult result11(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\r\n    GetBucketLocationResult result14(xml);\r\n\r\n    GetBucketStatResult result7(\"test\");\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <Bucket>\r\n                          <Storage>1024123</Storage>\r\n                          <ObjectCount>1000</ObjectCount>\r\n                          <MultipartUploadCount>20</MultipartUploadCount>\r\n                        </Bucket>)\";\r\n    GetBucketStatResult result8(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <BucketStat>\r\n\r\n                        </BucketStat>)\";\r\n    GetBucketStatResult result9(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <BucketStat>\r\n                          <Storage></Storage>\r\n                          <ObjectCount></ObjectCount>\r\n                          <MultipartUploadCount></MultipartUploadCount>\r\n                        </BucketStat>)\";\r\n    GetBucketStatResult result12(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\r\n    GetBucketStatResult result15(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n              <BucketStat>\r\n                <Storage></Storage>\r\n                <ObjectCount></ObjectCount>\r\n                <MultipartUploadCount></MultipartUploadCount>\r\n                <LiveChannelCount></LiveChannelCount>\r\n                <LastModifiedTime></LastModifiedTime>\r\n                <StandardStorage></StandardStorage>\r\n                <StandardObjectCount></StandardObjectCount>\r\n                <InfrequentAccessStorage></InfrequentAccessStorage>\r\n                <InfrequentAccessObjectCount></InfrequentAccessObjectCount>\r\n                <ArchiveStorage></ArchiveStorage>\r\n                <ArchiveObjectCount></ArchiveObjectCount>\r\n                <ColdArchiveStorage></ColdArchiveStorage>\r\n                <ColdArchiveObjectCount></ColdArchiveObjectCount>\r\n              </BucketStat>)\";\r\n    GetBucketStatResult result16(xml);\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, ListBucketsResultBranchTest)\r\n{\r\n    ListBucketsResult result(\"test\");\r\n\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListAllMyBuckets>\r\n\r\n                        </ListAllMyBuckets>)\";\r\n    ListBucketsResult result1(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListAllMyBucketsResult>\r\n\r\n                        </ListAllMyBucketsResult>)\";\r\n    ListBucketsResult result2(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListAllMyBucketsResult>\r\n                          <Owner>\r\n\r\n                          </Owner>\r\n                          <Buckets>\r\n                          </Buckets>\r\n                        </ListAllMyBucketsResult>)\";\r\n    ListBucketsResult result3(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListAllMyBucketsResult>\r\n                          <Owner>\r\n                            <ID>1305433695277957</ID>\r\n                            <DisplayName>1305433695277957</DisplayName>\r\n                          </Owner>\r\n                          <Buckets>\r\n                            <Bucket>\r\n\r\n                            </Bucket>\r\n\r\n                          </Buckets>\r\n                        </ListAllMyBucketsResult>)\";\r\n    ListBucketsResult result4(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListAllMyBucketsResult>\r\n                          <Owner>\r\n                            <ID></ID>\r\n                            <DisplayName></DisplayName>\r\n                          </Owner>\r\n                            <Prefix></Prefix>\r\n                            <Marker></Marker>\r\n                            <MaxKeys></MaxKeys>\r\n                            <IsTruncated></IsTruncated>\r\n                            <NextMarker></NextMarker>\r\n\r\n                          <Buckets>\r\n                            <Bucket>\r\n                            <CreationDate></CreationDate>\r\n                            <ExtranetEndpoint></ExtranetEndpoint>\r\n                            <IntranetEndpoint></IntranetEndpoint>\r\n                            <Location></Location>\r\n                            <Name></Name>\r\n                            <StorageClass></StorageClass>\r\n                            </Bucket>\r\n\r\n                          </Buckets>\r\n                        </ListAllMyBucketsResult>)\";\r\n    ListBucketsResult result5(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\r\n    ListBucketsResult result6(xml);\r\n}\r\n\r\nTEST_F(BucketBasicOperationTest, BucketColdArchiveTest)\r\n{\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(testPrefix);\r\n\r\n    //assert bucket does not exist\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), false);\r\n\r\n    //create a new bucket\r\n    Client->CreateBucket(CreateBucketRequest(bucketName, StorageClass::ColdArchive));\r\n    EXPECT_EQ(TestUtils::BucketExists(*Client, bucketName), true);\r\n\r\n    //get bucket info\r\n    auto bfOutcome = Client->GetBucketInfo(GetBucketInfoRequest(bucketName));\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().Acl(), CannedAccessControlList::Private);\r\n    EXPECT_EQ(bfOutcome.result().StorageClass(), StorageClass::ColdArchive);\r\n\r\n    //list buckets\r\n    auto lbOutcome = Client->ListBuckets(ListBucketsRequest(bucketName, \"\"));\r\n    EXPECT_EQ(lbOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lbOutcome.result().Buckets().size(), 1U);\r\n    EXPECT_EQ(lbOutcome.result().Buckets().at(0).StorageClass(), StorageClass::ColdArchive);\r\n\r\n    //delete the bucket\r\n    Client->DeleteBucket(DeleteBucketRequest(bucketName));\r\n}\r\n\r\n}\r\n}"
  },
  {
    "path": "test/src/Bucket/BucketCorsSettingsTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include <ctime>\n#include <time.h>\n#include <ctime>\n#include <chrono>\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass BucketCorsSettingsTest : public ::testing::Test {\nprotected:\n    BucketCorsSettingsTest()\n    {\n    }\n\n    ~BucketCorsSettingsTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase() \n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketcorssettings\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase() \n    {\n        Client->DeleteBucket(DeleteBucketRequest(BucketName));\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> BucketCorsSettingsTest::Client = nullptr;\nstd::string  BucketCorsSettingsTest::BucketName = \"\";\n\nstatic std::string GenSeqId()\n{\n    auto tp = std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::system_clock::now());\n    return std::to_string(tp.time_since_epoch().count());\n}\n\nstatic std::string GenOriginal()\n{\n    std::string original(\"Original \");\n    original.append(GenSeqId());\n    return original;\n}\n\nstatic CORSRule ConstructDummyCorsRule()\n{\n    std::string original(\"Original \");\n    original.append(GenSeqId());\n\n    CORSRule rule;\n    rule.addAllowedOrigin(original);\n    rule.addAllowedMethod(\"GET\");\n    rule.addAllowedHeader(\"HTTP\");\n    rule.addExposeHeader(\"HTTP\");\n    return rule;\n}\n\nstatic CORSRule ConstructDummyCorsRuleWithMultiAllowedMethod()\n{\n    std::string original(\"Original \");\n    original.append(GenSeqId());\n\n    CORSRule rule;\n    rule.addAllowedOrigin(original);\n    rule.addAllowedMethod(\"GET\");\n    rule.addAllowedMethod(\"PUT\");\n    rule.addAllowedMethod(\"DELETE\");\n    rule.addAllowedMethod(\"POST\");\n    rule.addAllowedMethod(\"HEAD\");\n    rule.setMaxAgeSeconds(120);\n    return rule;\n}\n\nTEST_F(BucketCorsSettingsTest, GetBucketNotSetCorsTest)\n{\n    auto dOutcome = Client->DeleteBucketCors(DeleteBucketCorsRequest(BucketName));\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n\n    auto gOutcome = Client->GetBucketCors(GetBucketCorsRequest(BucketName));\n    EXPECT_EQ(gOutcome.isSuccess(), false);\n    EXPECT_STREQ(gOutcome.error().Code().c_str(), \"NoSuchCORSConfiguration\");\n}\n\nTEST_F(BucketCorsSettingsTest, EnableBucketCorsEmptyTest)\n{\n    SetBucketCorsRequest request(BucketName);\n    request.addCORSRule(CORSRule());\n    auto outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n}\n\nTEST_F(BucketCorsSettingsTest, EnableBucketCorsAddAndDeleteSingleRuleTest)\n{\n    //SetBucketCorsRequest request(BucketName);\n    //request.addCORSRule(ConstructDummyCorsRule());\n    CORSRuleList ruleList;\n    ruleList.push_back(ConstructDummyCorsRule());\n    auto outcome = Client->SetBucketCors(BucketName, ruleList);// (request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n    \n    auto gOutcome = Client->GetBucketCors(GetBucketCorsRequest(BucketName));\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().CORSRules().size(), 1UL);\n\n    auto dOutcome = Client->DeleteBucketCors(DeleteBucketCorsRequest(BucketName));\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n\n    TestUtils::WaitForCacheExpire(5);\n    //gOutcome = Client->GetBucketCors(GetBucketCorsRequest(BucketName));\n    gOutcome = Client->GetBucketCors(BucketName);\n    EXPECT_EQ(gOutcome.isSuccess(), false);\n    EXPECT_STREQ(gOutcome.error().Code().c_str(), \"NoSuchCORSConfiguration\");\n}\n\nTEST_F(BucketCorsSettingsTest, EnableBucketCorsAddAndDeleteMultipleRulesTest)\n{\n    SetBucketCorsRequest request(BucketName);\n    request.addCORSRule(ConstructDummyCorsRule());\n    request.addCORSRule(ConstructDummyCorsRuleWithMultiAllowedMethod());\n    auto outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n\n    auto gOutcome = Client->GetBucketCors(GetBucketCorsRequest(BucketName));\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().CORSRules().size(), 2UL);\n\n    Client->DeleteBucketCors(DeleteBucketCorsRequest(BucketName));\n}\n\nTEST_F(BucketCorsSettingsTest, EnableBucketCorsSetAndDeleteMultipleRulesTest)\n{\n    SetBucketCorsRequest request(BucketName);\n    CORSRuleList ruleList;\n    ruleList.push_back(ConstructDummyCorsRule());\n    ruleList.push_back(ConstructDummyCorsRuleWithMultiAllowedMethod());\n    request.setCORSRules(ruleList);\n    request.addCORSRule(ConstructDummyCorsRule());\n    request.addCORSRule(ConstructDummyCorsRuleWithMultiAllowedMethod());\n    auto outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n\n    auto gOutcome = Client->GetBucketCors(GetBucketCorsRequest(BucketName));\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().CORSRules().size(), 4UL);\n\n    Client->DeleteBucketCors(DeleteBucketCorsRequest(BucketName));\n}\n\nTEST_F(BucketCorsSettingsTest, EnableBucketCorsAddInvalidSingleRuleTest)\n{\n    SetBucketCorsRequest request(BucketName);\n    CORSRule rule;\n    rule.addAllowedOrigin(GenOriginal());\n    rule.addAllowedMethod(\"GETGET\");\n    request.addCORSRule(rule);\n    auto outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n\n    Client->DeleteBucketCors(DeleteBucketCorsRequest(BucketName));\n}\n\nTEST_F(BucketCorsSettingsTest, SetBucketCorsRequestInvalidArgumentTest)\n{\n    SetBucketCorsRequest request(BucketName);\n    CORSRule rule;\n\n    //rules over 10\n    rule.addAllowedOrigin(GenOriginal());\n    rule.addAllowedMethod(\"GET\");\n    for (int i = 0; i < 12; i++) {\n        request.addCORSRule(rule);\n    }\n    auto outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n\n    //no method\n    request.clearCORSRules();\n    rule.clear();\n    rule.addAllowedOrigin(GenOriginal());\n    request.addCORSRule(rule);\n    outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n\n    //\n    request.clearCORSRules();\n    rule.clear();\n    rule.addAllowedOrigin(GenOriginal());\n    rule.addAllowedMethod(\"GET\");\n    for (int i = 0; i < 9; i++)\n    {\n        request.addCORSRule(rule);\n    }\n    outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    request.addCORSRule(rule);\n    request.addCORSRule(rule);\n    outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n\n    Client->DeleteBucketCors(DeleteBucketCorsRequest(BucketName));\n}\n\nTEST_F(BucketCorsSettingsTest, SetBucketCorsRequestAllowedOriginAsteriskTest)\n{\n    SetBucketCorsRequest request(BucketName);\n    CORSRule rule;\n\n    rule.addAllowedOrigin(\"*\");\n    rule.addAllowedOrigin(\"*\");\n    rule.addAllowedMethod(\"GET\");\n    request.addCORSRule(rule);\n\n    auto outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n\n    request.clearCORSRules();\n    rule.clear();\n    rule.addAllowedOrigin(\"*\");\n    rule.addAllowedMethod(\"GET\");\n    request.addCORSRule(rule);\n\n    outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n\n    Client->DeleteBucketCors(DeleteBucketCorsRequest(BucketName));\n}\n\nTEST_F(BucketCorsSettingsTest, SetBucketCorsRequestAllowedHeaderAsteriskTest)\n{\n    SetBucketCorsRequest request(BucketName);\n    CORSRule rule;\n\n    rule.addAllowedOrigin(GenOriginal());\n    rule.addAllowedHeader(\"*\");\n    rule.addAllowedHeader(\"*\");\n    rule.addAllowedMethod(\"GET\");\n    request.addCORSRule(rule);\n\n    auto outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n\n    request.clearCORSRules();\n    rule.clear();\n    rule.addAllowedOrigin(GenOriginal());\n    rule.addAllowedHeader(\"*\");\n    rule.addAllowedMethod(\"GET\");\n    request.addCORSRule(rule);\n\n    outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n\n    Client->DeleteBucketCors(DeleteBucketCorsRequest(BucketName));\n}\n\nTEST_F(BucketCorsSettingsTest, SetBucketCorsRequestExposeHeaderAsteriskTest)\n{\n    SetBucketCorsRequest request(BucketName);\n    CORSRule rule;\n\n    rule.addAllowedOrigin(GenOriginal());\n    rule.addAllowedMethod(\"GET\");\n    rule.addExposeHeader(\"*\");\n    request.addCORSRule(rule);\n\n    auto outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n\n    Client->DeleteBucketCors(DeleteBucketCorsRequest(BucketName));\n}\n\nTEST_F(BucketCorsSettingsTest, SetBucketCorsRequestMaxAgeSecondsTest)\n{\n    SetBucketCorsRequest request(BucketName);\n    CORSRule rule;\n    \n    //less -1\n    rule.addAllowedOrigin(GenOriginal());\n    rule.addAllowedMethod(\"GET\");\n    rule.addExposeHeader(\"x-oss-test\");\n    rule.setMaxAgeSeconds(-10);\n    request.addCORSRule(rule);\n\n    auto outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n\n    request.clearCORSRules();\n    rule.clear();\n    rule.addAllowedOrigin(GenOriginal());\n    rule.addAllowedMethod(\"GET\");\n    rule.addExposeHeader(\"x-oss-test\");\n    rule.setMaxAgeSeconds(999999999 + 1);\n    request.addCORSRule(rule);\n\n    outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n\n    Client->DeleteBucketCors(DeleteBucketCorsRequest(BucketName));\n}\n\nTEST_F(BucketCorsSettingsTest, SetBucketCorsNegativeTest)\n{\n    auto name = TestUtils::GetBucketName(\"no-exist-bucket-cors\");\n    SetBucketCorsRequest request(name);\n    request.addCORSRule(ConstructDummyCorsRule());\n    auto outcome = Client->SetBucketCors(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\n}\n\nTEST_F(BucketCorsSettingsTest, GetBucketCorsWithInvalidResponseBodyTest)\n{\n    CORSRuleList ruleList;\n    ruleList.push_back(ConstructDummyCorsRule());\n    Client->SetBucketCors(BucketName, ruleList);\n\n    auto gbcRequest = GetBucketCorsRequest(BucketName);\n    gbcRequest.setResponseStreamFactory([=]() {\n        auto content = std::make_shared<std::stringstream>();\n        content->write(\"invlid data\", 11);\n        return content;\n    });\n    auto gbcOutcome = Client->GetBucketCors(gbcRequest);\n    EXPECT_EQ(gbcOutcome.isSuccess(), false);\n    EXPECT_EQ(gbcOutcome.error().Code(), \"ParseXMLError\");\n}\n\nTEST_F(BucketCorsSettingsTest, GetBucketCorsResult)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <CORSConfiguration>\n                            <CORSRule>\n                              <AllowedOrigin>*</AllowedOrigin>\n                              <AllowedMethod>GET</AllowedMethod>\n                              <AllowedHeader>*</AllowedHeader>\n                              <ExposeHeader>x-oss-test</ExposeHeader>\n                              <MaxAgeSeconds>100</MaxAgeSeconds>\n                            </CORSRule>\n                            <CORSRule>\n                              <AllowedOrigin>www.test.com</AllowedOrigin>\n                              <AllowedMethod>PUT</AllowedMethod>\n                              <AllowedHeader>*</AllowedHeader>\n                              <ExposeHeader></ExposeHeader>\n                              <MaxAgeSeconds>100</MaxAgeSeconds>\n                            </CORSRule>\n\n                        </CORSConfiguration>)\";\n    GetBucketCorsResult result(xml);\n    EXPECT_EQ(result.CORSRules().size(), 2UL);\n    EXPECT_EQ(*(result.CORSRules().begin()->AllowedMethods().begin()), \"GET\");\n    EXPECT_EQ(*(result.CORSRules().rbegin()->AllowedMethods().begin()), \"PUT\");\n\n    EXPECT_EQ(*(result.CORSRules().begin()->AllowedOrigins().begin()), \"*\");\n    EXPECT_EQ(*(result.CORSRules().rbegin()->AllowedOrigins().begin()), \"www.test.com\");\n}\n\nTEST_F(BucketCorsSettingsTest, GetBucketCorsResultWithEmpty)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <CORSConfiguration>\n                            <CORSRule>\n                              <AllowedOrigin></AllowedOrigin>\n                              <AllowedMethod></AllowedMethod>\n                              <AllowedHeader></AllowedHeader>\n                              <ExposeHeader></ExposeHeader>\n                              <MaxAgeSeconds></MaxAgeSeconds>\n                            </CORSRule>\n                            <CORSRule>\n                              <AllowedOrigin></AllowedOrigin>\n                              <AllowedMethod></AllowedMethod>\n                              <AllowedHeader></AllowedHeader>\n                              <ExposeHeader></ExposeHeader>\n                              <MaxAgeSeconds></MaxAgeSeconds>\n                            </CORSRule>\n                        </CORSConfiguration>)\";\n    GetBucketCorsResult result(xml);\n    EXPECT_EQ(result.CORSRules().size(), 2UL);\n}\n\nTEST_F(BucketCorsSettingsTest, DeleteBucketTest)\n{\n    auto dOutcome = Client->DeleteBucketCors(BucketName);\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n}\n\nTEST_F(BucketCorsSettingsTest, DeleteBucketCorsInvalidValidateTest)\n{\n    auto deloutcome = Client->DeleteBucketCors(DeleteBucketCorsRequest(\"Invalid-bucket-test\"));\n\n    EXPECT_EQ(deloutcome.isSuccess(), false);\n    EXPECT_EQ(deloutcome.error().Code(), \"ValidateError\");\n}\n\nTEST_F(BucketCorsSettingsTest, GetBucketCorsResultBranchTest)\n{\n    GetBucketCorsResult result(\"test\");\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <CORS>\n                            <CORSRule>\n                              <AllowedOrigin></AllowedOrigin>\n                              <AllowedMethod></AllowedMethod>\n                              <AllowedHeader></AllowedHeader>\n                              <ExposeHeader></ExposeHeader>\n                              <MaxAgeSeconds></MaxAgeSeconds>\n                            </CORSRule>\n                            <CORSRule>\n                              <AllowedOrigin></AllowedOrigin>\n                              <AllowedMethod></AllowedMethod>\n                              <AllowedHeader></AllowedHeader>\n                              <ExposeHeader></ExposeHeader>\n                              <MaxAgeSeconds></MaxAgeSeconds>\n                            </CORSRule>\n                        </CORS>)\";\n    GetBucketCorsResult result1(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    GetBucketCorsResult result2(xml);\n}\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketEncryptionTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\n    class BucketEncryptionTest : public ::testing::Test {\n    protected:\n        BucketEncryptionTest()\n        {\n        }\n\n        ~BucketEncryptionTest() override\n        {\n        }\n\n        // Sets up the stuff shared by all tests in this test case.\n        static void SetUpTestCase()\n        {\n            Client = TestUtils::GetOssClientDefault();\n            BucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketencryption\");\n            Client->CreateBucket(CreateBucketRequest(BucketName));\n        }\n\n        // Tears down the stuff shared by all tests in this test case.\n        static void TearDownTestCase()\n        {\n            Client->DeleteBucket(DeleteBucketRequest(BucketName));\n            Client = nullptr;\n        }\n\n        // Sets up the test fixture.\n        void SetUp() override\n        {\n        }\n\n        // Tears down the test fixture.\n        void TearDown() override\n        {\n        }\n    public:\n        static std::shared_ptr<OssClient> Client;\n        static std::string BucketName;\n    };\n\n    std::shared_ptr<OssClient> BucketEncryptionTest::Client = nullptr;\n    std::string BucketEncryptionTest::BucketName = \"\";\n\n    TEST_F(BucketEncryptionTest, SetAndDeleteBucketEncryptionTest)\n    {\n        SetBucketEncryptionRequest setrequest(BucketName);\n        setrequest.setSSEAlgorithm(SSEAlgorithm::KMS);\n        auto setoutcome = Client->SetBucketEncryption(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), true);\n\n        DeleteBucketEncryptionRequest delrequest(BucketName);\n        auto deloutcome = Client->DeleteBucketEncryption(delrequest);\n        EXPECT_EQ(deloutcome.isSuccess(), true);\n\n        auto infoOutcome = Client->GetBucketInfo(BucketName);\r\n        EXPECT_EQ(infoOutcome.isSuccess(), true);\r\n        EXPECT_EQ(infoOutcome.result().SSEAlgorithm(), SSEAlgorithm::NotSet);\r\n        EXPECT_EQ(infoOutcome.result().KMSMasterKeyID(), \"\");\r\n    }\n\n    TEST_F(BucketEncryptionTest, GetBucketEncryptionTest)\n    {\n        SetBucketEncryptionRequest setrequest(BucketName);\n        setrequest.setSSEAlgorithm(SSEAlgorithm::KMS);\n        setrequest.setKMSMasterKeyID(\"1234\");\n        auto setoutcome = Client->SetBucketEncryption(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), true);\n\n        GetBucketEncryptionRequest getrequest(BucketName);\n        auto getoutcome = Client->GetBucketEncryption(getrequest);\n        EXPECT_EQ(getoutcome.isSuccess(),true);\n        EXPECT_EQ(getoutcome.result().SSEAlgorithm(), SSEAlgorithm::KMS);\n        EXPECT_EQ(getoutcome.result().KMSMasterKeyID(), \"1234\");\n\n        auto infoOutcome = Client->GetBucketInfo(BucketName);\r\n        EXPECT_EQ(infoOutcome.isSuccess(), true);\r\n        EXPECT_EQ(infoOutcome.result().SSEAlgorithm(), SSEAlgorithm::KMS);\r\n        EXPECT_EQ(infoOutcome.result().KMSMasterKeyID(), \"1234\");\r\n\n\n        setrequest.setSSEAlgorithm(SSEAlgorithm::AES256);\n        setrequest.setKMSMasterKeyID(\"\");\n        setoutcome = Client->SetBucketEncryption(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), true);\n\n        getoutcome = Client->GetBucketEncryption(getrequest);\n        EXPECT_EQ(getoutcome.isSuccess(), true);\n        EXPECT_EQ(getoutcome.result().SSEAlgorithm(), SSEAlgorithm::AES256);\n\n        infoOutcome = Client->GetBucketInfo(BucketName);\r\n        EXPECT_EQ(infoOutcome.isSuccess(), true);\r\n        EXPECT_EQ(infoOutcome.result().SSEAlgorithm(), SSEAlgorithm::AES256);\r\n        EXPECT_EQ(infoOutcome.result().KMSMasterKeyID(), \"\");\r\n    }\n\n    TEST_F(BucketEncryptionTest, BucketEncryptionNegativeTest)\n    {\n        SetBucketEncryptionRequest setrequest(BucketName);\n        setrequest.setSSEAlgorithm(SSEAlgorithm::NotSet);\n        auto setoutcome = Client->SetBucketEncryption(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), false);\n\n        GetBucketEncryptionRequest getRequest(\"Invalid-bucket\");\n        auto getOutcome = Client->GetBucketEncryption(getRequest);\n        EXPECT_EQ(getOutcome.isSuccess(), false);\n\n        DeleteBucketEncryptionRequest delRequest(\"Invalid-bucket\");\n        auto delOutcome = Client->DeleteBucketEncryption(delRequest);\n        EXPECT_EQ(delOutcome.isSuccess(), false);\n    }\n\n    TEST_F(BucketEncryptionTest, GetBucketVersioningWithInvalidResponseBodyTest)\n    {\n        SetBucketEncryptionRequest setrequest(BucketName);\n        setrequest.setSSEAlgorithm(SSEAlgorithm::KMS);\n        setrequest.setKMSMasterKeyID(\"1234\");\n        auto setoutcome = Client->SetBucketEncryption(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), true);\n\n        auto gbeRequest = GetBucketEncryptionRequest(BucketName);\n        gbeRequest.setResponseStreamFactory([=]() {\n            auto content = std::make_shared<std::stringstream>();\n            content->write(\"invlid data\", 11);\n            return content;\n        });\n        auto gbeOutcome = Client->GetBucketEncryption(gbeRequest);\n        EXPECT_EQ(gbeOutcome.isSuccess(), false);\n        EXPECT_EQ(gbeOutcome.error().Code(), \"ParseXMLError\");\n    }\n\n    TEST_F(BucketEncryptionTest, GetBucketEncryptionResult)\n    {\n        std::string xml = R\"(<?xml version=\"1.0\" ?>\n                        <ServerSideEncryptionRule>\n                            <ApplyServerSideEncryptionByDefault>\n                                <SSEAlgorithm>KMS</SSEAlgorithm>\n                                <KMSMasterKeyID>1234</KMSMasterKeyID>\n                            </ApplyServerSideEncryptionByDefault>\n                        </ServerSideEncryptionRule>)\";\n        GetBucketEncryptionResult result(xml);\n        EXPECT_EQ(result.SSEAlgorithm(), SSEAlgorithm::KMS);\n        EXPECT_EQ(result.KMSMasterKeyID(), \"1234\");\n    }\n\n    TEST_F(BucketEncryptionTest, GetBucketEncryptionResultBranchTest)\n    {\n        GetBucketEncryptionResult result(\"test\");\n        std::string xml = R\"(<?xml version=\"1.0\" ?>\n                        <ServerSideEncryption>\n\n                        </ServerSideEncryption>)\";\n        GetBucketEncryptionResult result1(xml);\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                        <ServerSideEncryptionRule>\n                        </ServerSideEncryptionRule>)\";\n        GetBucketEncryptionResult result2(xml);\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                        <ServerSideEncryptionRule>\n                            <ApplyServerSideEncryptionByDefault>\n                            </ApplyServerSideEncryptionByDefault>\n                        </ServerSideEncryptionRule>)\";\n        GetBucketEncryptionResult result3(xml);\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                        <ServerSideEncryptionRule>\n                            <ApplyServerSideEncryptionByDefault>\n                                <SSEAlgorithm></SSEAlgorithm>\n                                <KMSMasterKeyID></KMSMasterKeyID>\n                            </ApplyServerSideEncryptionByDefault>\n                        </ServerSideEncryptionRule>)\";\n        GetBucketEncryptionResult result4(xml);\n\n        xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n        GetBucketEncryptionResult result5(xml);\n    }\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketInventoryConfigurationTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass BucketInventoryConfigurationTest : public ::testing::Test {\nprotected:\n    BucketInventoryConfigurationTest()\n    {\n    }\n\n    ~BucketInventoryConfigurationTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-inventory\");\n        DstBucketName = TestUtils::GetBucketName(\"cpp-sdk-inventory-dst\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n        Client->CreateBucket(CreateBucketRequest(DstBucketName));\n        auto content = TestUtils::GetRandomStream(10);\n        PutObjectRequest request(BucketName, \"kms-key\", content);\n        request.MetaData().addHeader(\"x-oss-server-side-encryption\", \"KMS\");\n        auto outcome = Client->PutObject(request);\n        auto metaOutcome = Client->HeadObject(BucketName, \"kms-key\");\n        KmsKeyId = metaOutcome.result().HttpMetaData()[\"x-oss-server-side-encryption-key-id\"];\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n        Client->DeleteBucket(DeleteBucketRequest(BucketName));\n        Client->DeleteBucket(DeleteBucketRequest(DstBucketName));\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n    static std::string DstBucketName;\n    static std::string KmsKeyId;\n};\n\nstd::shared_ptr<OssClient> BucketInventoryConfigurationTest::Client = nullptr;\nstd::string BucketInventoryConfigurationTest::BucketName = \"\";\nstd::string BucketInventoryConfigurationTest::DstBucketName = \"\";\nstd::string BucketInventoryConfigurationTest::KmsKeyId = \"\";\n\nTEST_F(BucketInventoryConfigurationTest, BucketInventoryConfigurationAllTest)\n{\n    InventoryConfiguration conf;\n    conf.setId(\"report1\");\n    conf.setIsEnabled(true);\n    conf.setFilter(InventoryFilter(\"filterPrefix\"));\n\n    InventoryOSSBucketDestination dest;\n    dest.setFormat(InventoryFormat::CSV);\n    dest.setAccountId(Config::RamUID);\n    dest.setRoleArn(Config::RamRoleArn);\n    dest.setBucket(DstBucketName);\n    dest.setPrefix(\"prefix1\");\n    dest.setEncryption(InventoryEncryption(InventorySSEKMS(KmsKeyId)));\n    conf.setDestination(dest);\n\n    conf.setSchedule(InventoryFrequency::Daily);\n    conf.setIncludedObjectVersions(InventoryIncludedObjectVersions::All);\n\n    InventoryOptionalFields field { \n        InventoryOptionalField::Size, InventoryOptionalField::LastModifiedDate, \n        InventoryOptionalField::ETag, InventoryOptionalField::StorageClass, \n        InventoryOptionalField::IsMultipartUploaded, InventoryOptionalField::EncryptionStatus\n    };\n    conf.setOptionalFields(field);\n\n    auto setOutcome = Client->SetBucketInventoryConfiguration(SetBucketInventoryConfigurationRequest(BucketName, conf));\n    EXPECT_EQ(setOutcome.isSuccess(), true);\n     \n    auto getOutcome = Client->GetBucketInventoryConfiguration(GetBucketInventoryConfigurationRequest(BucketName, \"report1\"));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Id(), \"report1\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().IsEnabled(), true);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Filter().Prefix(), \"filterPrefix\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().AccountId(), Config::RamUID);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().RoleArn(), Config::RamRoleArn);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Bucket(), DstBucketName);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Prefix(), \"prefix1\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Encryption().hasSSEKMS(), true);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Encryption().SSEKMS().KeyId(), KmsKeyId);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Schedule(), InventoryFrequency::Daily);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().IncludedObjectVersions(), InventoryIncludedObjectVersions::All);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields().size(), 6U);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[0], InventoryOptionalField::Size);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[1], InventoryOptionalField::LastModifiedDate);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[2], InventoryOptionalField::ETag);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[3], InventoryOptionalField::StorageClass);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[4], InventoryOptionalField::IsMultipartUploaded);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[5], InventoryOptionalField::EncryptionStatus);\n\n    auto delOutcome = Client->DeleteBucketInventoryConfiguration(DeleteBucketInventoryConfigurationRequest(BucketName, \"report1\"));\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n\n    //report2\n    conf.setId(\"report2\");\n    conf.setIsEnabled(false);\n    conf.setFilter(InventoryFilter(\"filterPrefix2\"));\n    InventoryOSSBucketDestination dest1;\n    dest1.setFormat(InventoryFormat::CSV);\n    dest1.setAccountId(Config::RamUID);\n    dest1.setRoleArn(Config::RamRoleArn);\n    dest1.setBucket(DstBucketName);\n    dest1.setPrefix(\"prefix2\");\n    dest1.setEncryption(InventoryEncryption(InventorySSEOSS()));\n    conf.setDestination(dest1);\n    conf.setSchedule(InventoryFrequency::Weekly);\n    conf.setIncludedObjectVersions(InventoryIncludedObjectVersions::Current);\n    InventoryOptionalFields field2 {\n        InventoryOptionalField::Size, InventoryOptionalField::LastModifiedDate,\n        InventoryOptionalField::ETag, InventoryOptionalField::StorageClass\n    };\n    conf.setOptionalFields(field2);\n\n    setOutcome = Client->SetBucketInventoryConfiguration(SetBucketInventoryConfigurationRequest(BucketName, conf));\n    EXPECT_EQ(setOutcome.isSuccess(), true);\n\n    getOutcome = Client->GetBucketInventoryConfiguration(GetBucketInventoryConfigurationRequest(BucketName, \"report2\"));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Id(), \"report2\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().IsEnabled(), false);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Filter().Prefix(), \"filterPrefix2\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().AccountId(), Config::RamUID);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().RoleArn(), Config::RamRoleArn);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Bucket(), DstBucketName);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Prefix(), \"prefix2\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Encryption().hasSSEKMS(), false);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Encryption().hasSSEOSS(), true);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Schedule(), InventoryFrequency::Weekly);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().IncludedObjectVersions(), InventoryIncludedObjectVersions::Current);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields().size(), 4U);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[0], InventoryOptionalField::Size);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[1], InventoryOptionalField::LastModifiedDate);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[2], InventoryOptionalField::ETag);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[3], InventoryOptionalField::StorageClass);\n\n    delOutcome = Client->DeleteBucketInventoryConfiguration(DeleteBucketInventoryConfigurationRequest(BucketName, \"report2\"));\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n}\n\nTEST_F(BucketInventoryConfigurationTest, BucketInventoryConfigurationWithoutFilterTest)\n{\n    InventoryConfiguration conf;\n    conf.setId(\"report1\");\n    conf.setIsEnabled(true);\n\n    InventoryOSSBucketDestination dest;\n    dest.setFormat(InventoryFormat::CSV);\n    dest.setAccountId(Config::RamUID);\n    dest.setRoleArn(Config::RamRoleArn);\n    dest.setBucket(DstBucketName);\n    dest.setPrefix(\"prefix1\");\n    dest.setEncryption(InventoryEncryption(InventorySSEKMS(KmsKeyId)));\n    conf.setDestination(dest);\n\n    conf.setSchedule(InventoryFrequency::Daily);\n    conf.setIncludedObjectVersions(InventoryIncludedObjectVersions::All);\n\n    InventoryOptionalFields field{\n        InventoryOptionalField::Size, InventoryOptionalField::LastModifiedDate,\n        InventoryOptionalField::ETag, InventoryOptionalField::StorageClass,\n        InventoryOptionalField::IsMultipartUploaded, InventoryOptionalField::EncryptionStatus\n    };\n    conf.setOptionalFields(field);\n\n    auto setOutcome = Client->SetBucketInventoryConfiguration(SetBucketInventoryConfigurationRequest(BucketName, conf));\n    EXPECT_EQ(setOutcome.isSuccess(), true);\n\n    auto getOutcome = Client->GetBucketInventoryConfiguration(GetBucketInventoryConfigurationRequest(BucketName, \"report1\"));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Id(), \"report1\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().IsEnabled(), true);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Filter().Prefix(), \"\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().AccountId(), Config::RamUID);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().RoleArn(), Config::RamRoleArn);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Bucket(), DstBucketName);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Prefix(), \"prefix1\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Encryption().hasSSEKMS(), true);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Encryption().SSEKMS().KeyId(), KmsKeyId);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Schedule(), InventoryFrequency::Daily);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().IncludedObjectVersions(), InventoryIncludedObjectVersions::All);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields().size(), 6U);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[0], InventoryOptionalField::Size);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[1], InventoryOptionalField::LastModifiedDate);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[2], InventoryOptionalField::ETag);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[3], InventoryOptionalField::StorageClass);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[4], InventoryOptionalField::IsMultipartUploaded);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[5], InventoryOptionalField::EncryptionStatus);\n\n    auto delOutcome = Client->DeleteBucketInventoryConfiguration(DeleteBucketInventoryConfigurationRequest(BucketName, \"report1\"));\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n}\n\nTEST_F(BucketInventoryConfigurationTest, BucketInventoryConfigurationWithoutEncryptionTest)\n{\n    InventoryConfiguration conf;\n    conf.setId(\"report1\");\n    conf.setIsEnabled(true);\n\n    InventoryOSSBucketDestination dest;\n    dest.setFormat(InventoryFormat::CSV);\n    dest.setAccountId(Config::RamUID);\n    dest.setRoleArn(Config::RamRoleArn);\n    dest.setBucket(DstBucketName);\n    dest.setPrefix(\"prefix1\");\n    conf.setDestination(dest);\n\n    conf.setSchedule(InventoryFrequency::Daily);\n    conf.setIncludedObjectVersions(InventoryIncludedObjectVersions::All);\n\n    InventoryOptionalFields field{\n        InventoryOptionalField::Size, InventoryOptionalField::LastModifiedDate,\n        InventoryOptionalField::ETag, InventoryOptionalField::StorageClass,\n        InventoryOptionalField::IsMultipartUploaded, InventoryOptionalField::EncryptionStatus\n    };\n    conf.setOptionalFields(field);\n\n    auto setOutcome = Client->SetBucketInventoryConfiguration(SetBucketInventoryConfigurationRequest(BucketName, conf));\n    EXPECT_EQ(setOutcome.isSuccess(), true);\n\n    auto getOutcome = Client->GetBucketInventoryConfiguration(GetBucketInventoryConfigurationRequest(BucketName, \"report1\"));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Id(), \"report1\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().IsEnabled(), true);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Filter().Prefix(), \"\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().AccountId(), Config::RamUID);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().RoleArn(), Config::RamRoleArn);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Bucket(), DstBucketName);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Prefix(), \"prefix1\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Encryption().hasSSEKMS(), false);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Encryption().hasSSEOSS(), false);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Schedule(), InventoryFrequency::Daily);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().IncludedObjectVersions(), InventoryIncludedObjectVersions::All);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields().size(), 6U);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[0], InventoryOptionalField::Size);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[1], InventoryOptionalField::LastModifiedDate);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[2], InventoryOptionalField::ETag);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[3], InventoryOptionalField::StorageClass);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[4], InventoryOptionalField::IsMultipartUploaded);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields()[5], InventoryOptionalField::EncryptionStatus);\n\n    auto delOutcome = Client->DeleteBucketInventoryConfiguration(DeleteBucketInventoryConfigurationRequest(BucketName, \"report1\"));\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n}\n\nTEST_F(BucketInventoryConfigurationTest, BucketInventoryConfigurationWithoutOptionalFieldsTest)\n{\n    InventoryConfiguration conf;\n    conf.setId(\"report1\");\n    conf.setIsEnabled(true);\n\n    InventoryOSSBucketDestination dest;\n    dest.setFormat(InventoryFormat::CSV);\n    dest.setAccountId(Config::RamUID);\n    dest.setRoleArn(Config::RamRoleArn);\n    dest.setBucket(DstBucketName);\n    dest.setPrefix(\"prefix1\");\n    conf.setDestination(dest);\n\n    conf.setSchedule(InventoryFrequency::Daily);\n    conf.setIncludedObjectVersions(InventoryIncludedObjectVersions::All);\n\n    auto setOutcome = Client->SetBucketInventoryConfiguration(SetBucketInventoryConfigurationRequest(BucketName, conf));\n    EXPECT_EQ(setOutcome.isSuccess(), true);\n\n    auto getOutcome = Client->GetBucketInventoryConfiguration(GetBucketInventoryConfigurationRequest(BucketName, \"report1\"));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Id(), \"report1\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().IsEnabled(), true);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Filter().Prefix(), \"\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().AccountId(), Config::RamUID);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().RoleArn(), Config::RamRoleArn);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Bucket(), DstBucketName);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Prefix(), \"prefix1\");\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Encryption().hasSSEKMS(), false);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Destination().OSSBucketDestination().Encryption().hasSSEOSS(), false);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().Schedule(), InventoryFrequency::Daily);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().IncludedObjectVersions(), InventoryIncludedObjectVersions::All);\n    EXPECT_EQ(getOutcome.result().InventoryConfiguration().OptionalFields().size(), 0U);\n\n    auto delOutcome = Client->DeleteBucketInventoryConfiguration(DeleteBucketInventoryConfigurationRequest(BucketName, \"report1\"));\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n}\n\nTEST_F(BucketInventoryConfigurationTest, ListBucketInventoryConfigurationTest)\n{\n    int i;\n    for (i = 1; i < 102; i++) {\n        InventoryConfiguration conf;\n        conf.setId(std::to_string(i));\n        conf.setIsEnabled( (i % 4)? true: false);\n        conf.setFilter((i % 5) ? InventoryFilter(\"filterPrefix\"): InventoryFilter());\n\n        InventoryOSSBucketDestination dest;\n        dest.setFormat(InventoryFormat::CSV);\n        dest.setAccountId(Config::RamUID);\n        dest.setRoleArn(Config::RamRoleArn);\n        dest.setBucket(DstBucketName);\n        dest.setPrefix(\"prefix1\");\n        dest.setEncryption(InventoryEncryption(InventorySSEKMS(KmsKeyId)));\n        conf.setDestination(dest);\n\n        conf.setSchedule(InventoryFrequency::Daily);\n        conf.setIncludedObjectVersions(InventoryIncludedObjectVersions::All);\n\n        InventoryOptionalFields field { \n            InventoryOptionalField::Size, InventoryOptionalField::LastModifiedDate,\n            InventoryOptionalField::ETag, InventoryOptionalField::StorageClass,\n            InventoryOptionalField::IsMultipartUploaded, InventoryOptionalField::EncryptionStatus \n        };\n        InventoryOptionalFields field1 {\n            InventoryOptionalField::Size\n        };\n        conf.setOptionalFields((i % 7) ? field: field1);\n\n        SetBucketInventoryConfigurationRequest request(BucketName);\n        request.setInventoryConfiguration(conf);\n        auto setoutcome = Client->SetBucketInventoryConfiguration(request);\n        EXPECT_EQ(setoutcome.isSuccess(), true);\n    }\n\n    ListBucketInventoryConfigurationsRequest listrequest(BucketName);\n    auto listOutcome = Client->ListBucketInventoryConfigurations(listrequest);\n    EXPECT_EQ(listOutcome.isSuccess(), true);\n    EXPECT_EQ(listOutcome.result().NextContinuationToken(), \"98\");\n    EXPECT_EQ(listOutcome.result().IsTruncated(), true);\n    EXPECT_EQ(listOutcome.result().InventoryConfigurationList().size(), 100U);\n    for (const auto& conf : listOutcome.result().InventoryConfigurationList()) {\n        int j = std::strtol(conf.Id().c_str(), nullptr, 10);\n        EXPECT_EQ(conf.IsEnabled(), ((j % 4) ? true : false));\n        EXPECT_EQ(conf.Filter().Prefix(), ((j % 5) ? \"filterPrefix\" : \"\"));\n        EXPECT_EQ(conf.Destination().OSSBucketDestination().AccountId(), Config::RamUID);\n        EXPECT_EQ(conf.Destination().OSSBucketDestination().RoleArn(), Config::RamRoleArn);\n        EXPECT_EQ(conf.Destination().OSSBucketDestination().Bucket(), DstBucketName);\n        EXPECT_EQ(conf.Destination().OSSBucketDestination().Prefix(), \"prefix1\");\n        EXPECT_EQ(conf.Destination().OSSBucketDestination().Encryption().hasSSEKMS(), true);\n        EXPECT_EQ(conf.Destination().OSSBucketDestination().Encryption().SSEKMS().KeyId(), KmsKeyId);\n        EXPECT_EQ(conf.Schedule(), InventoryFrequency::Daily);\n        EXPECT_EQ(conf.IncludedObjectVersions(), InventoryIncludedObjectVersions::All);\n        EXPECT_EQ(conf.OptionalFields().size(), ((j % 7)? 6U : 1U));\n        EXPECT_EQ(conf.OptionalFields()[0], InventoryOptionalField::Size);\n        if(conf.OptionalFields().size() > 1U) {\n            EXPECT_EQ(conf.OptionalFields()[1], InventoryOptionalField::LastModifiedDate);\n            EXPECT_EQ(conf.OptionalFields()[2], InventoryOptionalField::ETag);\n            EXPECT_EQ(conf.OptionalFields()[3], InventoryOptionalField::StorageClass);\n            EXPECT_EQ(conf.OptionalFields()[4], InventoryOptionalField::IsMultipartUploaded);\n            EXPECT_EQ(conf.OptionalFields()[5], InventoryOptionalField::EncryptionStatus);\n        }\n    }\n\n    listrequest.setContinuationToken(listOutcome.result().NextContinuationToken());\n    listOutcome = Client->ListBucketInventoryConfigurations(listrequest);\n    EXPECT_EQ(listOutcome.result().NextContinuationToken(), \"\");\n    EXPECT_EQ(listOutcome.result().IsTruncated(), false);\n    EXPECT_EQ(listOutcome.result().InventoryConfigurationList().size(), 1U);\n    EXPECT_EQ(listOutcome.result().InventoryConfigurationList()[0].Id(), \"99\");\n\n    for (i = 1; i < 102; i++) {\n        DeleteBucketInventoryConfigurationRequest delrequest(BucketName);\n        delrequest.setId(std::to_string(i));\n        auto delOutcome = Client->DeleteBucketInventoryConfiguration(delrequest);\n        EXPECT_EQ(delOutcome.isSuccess(), true);\n    }\n}\n\nTEST_F(BucketInventoryConfigurationTest, BucketInventoryConfigurationNegativeTest)\n{\n    InventoryConfiguration conf;\n    conf.setId(\"report1\");\n    conf.setIsEnabled(true);\n\n    InventoryOSSBucketDestination dest;\n    dest.setFormat(InventoryFormat::CSV);\n    dest.setAccountId(Config::RamUID);\n    dest.setRoleArn(Config::RamRoleArn);\n    dest.setBucket(\"not-exist-bucket\");\n    dest.setPrefix(\"prefix1\");\n    conf.setDestination(dest);\n\n    conf.setSchedule(InventoryFrequency::Daily);\n    conf.setIncludedObjectVersions(InventoryIncludedObjectVersions::All);\n\n    auto setOutcome = Client->SetBucketInventoryConfiguration(SetBucketInventoryConfigurationRequest(BucketName, conf));\n    EXPECT_EQ(setOutcome.isSuccess(), false);\n    EXPECT_EQ(setOutcome.error().Code(), \"InvalidArgument\");\n\n    auto getOutcome = Client->GetBucketInventoryConfiguration(GetBucketInventoryConfigurationRequest(BucketName, \"not-exist-report-id\"));\n    EXPECT_EQ(getOutcome.isSuccess(), false);\n    EXPECT_EQ(getOutcome.error().Code(), \"NoSuchInventory\");\n\n    auto delOutcome = Client->DeleteBucketInventoryConfiguration(DeleteBucketInventoryConfigurationRequest(BucketName + \"-not-exist-bucket\", \"not-exist-report-id\"));\n    EXPECT_EQ(delOutcome.isSuccess(), false);\n    EXPECT_EQ(delOutcome.error().Code(), \"NoSuchBucket\");\n\n    delOutcome = Client->DeleteBucketInventoryConfiguration(DeleteBucketInventoryConfigurationRequest(BucketName, \"not-exist-report-id\"));\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n\n    auto listOutcome = Client->ListBucketInventoryConfigurations(ListBucketInventoryConfigurationsRequest(BucketName + \"-not-exist-bucket\"));\n    EXPECT_EQ(listOutcome.isSuccess(), false);\n    EXPECT_EQ(listOutcome.error().Code(), \"NoSuchBucket\");\n}\n\nTEST_F(BucketInventoryConfigurationTest, InventoryFilter)\n{\n    InventoryFilter filter;\n    EXPECT_EQ(filter.Prefix(), \"\");\n\n    filter.setPrefix(\"filter\");\n    EXPECT_EQ(filter.Prefix(), \"filter\");\n\n    InventoryFilter filter1(\"filter1\");\n    EXPECT_EQ(filter1.Prefix(), \"filter1\");\n}\n\nTEST_F(BucketInventoryConfigurationTest, InventorySSEKMS)\n{\n    InventorySSEKMS ssekms;\n    EXPECT_EQ(ssekms.KeyId(), \"\");\n\n    ssekms.setKeyId(\"Id\");\n    EXPECT_EQ(ssekms.KeyId(), \"Id\");\n\n    InventorySSEKMS ssekms1(\"id1\");\n    EXPECT_EQ(ssekms1.KeyId(), \"id1\");\n}\n\nTEST_F(BucketInventoryConfigurationTest, InventoryEncryption)\n{\n    InventorySSEOSS sseoss;\n    InventorySSEKMS ssekms(\"keyId\");\n    InventoryEncryption encryption;\n    EXPECT_EQ(encryption.hasSSEOSS(), false);\n    EXPECT_EQ(encryption.hasSSEKMS(), false);\n    \n    encryption = InventoryEncryption();\n    encryption.setSSEOSS(sseoss);\n    EXPECT_EQ(encryption.hasSSEOSS(), true);\n    EXPECT_EQ(encryption.hasSSEKMS(), false);\n\n    encryption = InventoryEncryption();\n    encryption.setSSEKMS(ssekms);\n    EXPECT_EQ(encryption.hasSSEOSS(), false);\n    EXPECT_EQ(encryption.hasSSEKMS(), true);\n    EXPECT_EQ(encryption.SSEKMS().KeyId(), \"keyId\");\n\n    InventoryEncryption encryption1(sseoss);\n    EXPECT_EQ(encryption1.hasSSEOSS(), true);\n    EXPECT_EQ(encryption1.hasSSEKMS(), false);\n\n    InventoryEncryption encryption2(InventorySSEKMS(\"keyId\"));\n    EXPECT_EQ(encryption2.hasSSEOSS(), false);\n    EXPECT_EQ(encryption2.hasSSEKMS(), true);\n    EXPECT_EQ(encryption2.SSEKMS().KeyId(), \"keyId\");\n}\n\nTEST_F(BucketInventoryConfigurationTest, InventoryOSSBucketDestination)\n{\n    InventoryOSSBucketDestination ossBucket;\n    EXPECT_EQ(ossBucket.Format(), InventoryFormat::NotSet);\n    EXPECT_EQ(ossBucket.AccountId(), \"\");\n    EXPECT_EQ(ossBucket.RoleArn(), \"\");\n    EXPECT_EQ(ossBucket.Bucket(), \"\");\n    EXPECT_EQ(ossBucket.Prefix(), \"\");\n    EXPECT_EQ(ossBucket.Encryption().hasSSEKMS(), false);\n    EXPECT_EQ(ossBucket.Encryption().hasSSEOSS(), false);\n\n    ossBucket.setAccountId(\"AccountId\");\n    ossBucket.setRoleArn(\"RoleArn\");\n    ossBucket.setBucket(\"Bucket\");\n    ossBucket.setPrefix(\"Prefix\");\n    ossBucket.setEncryption(InventoryEncryption(InventorySSEKMS(\"keyId\")));\n    EXPECT_EQ(ossBucket.AccountId(), \"AccountId\");\n    EXPECT_EQ(ossBucket.RoleArn(), \"RoleArn\");\n    EXPECT_EQ(ossBucket.Bucket(), \"Bucket\");\n    EXPECT_EQ(ossBucket.Prefix(), \"Prefix\");\n    EXPECT_EQ(ossBucket.Encryption().hasSSEKMS(), true);\n    EXPECT_EQ(ossBucket.Encryption().SSEKMS().KeyId(), \"keyId\");\n    EXPECT_EQ(ossBucket.Encryption().hasSSEOSS(), false);\n}\n\nTEST_F(BucketInventoryConfigurationTest, InventoryDestination)\n{\n    InventoryDestination destination;\n    EXPECT_EQ(destination.OSSBucketDestination().Format(), InventoryFormat::NotSet);\n    EXPECT_EQ(destination.OSSBucketDestination().AccountId(), \"\");\n    EXPECT_EQ(destination.OSSBucketDestination().RoleArn(), \"\");\n    EXPECT_EQ(destination.OSSBucketDestination().Bucket(), \"\");\n    EXPECT_EQ(destination.OSSBucketDestination().Prefix(), \"\");\n    EXPECT_EQ(destination.OSSBucketDestination().Encryption().hasSSEKMS(), false);\n    EXPECT_EQ(destination.OSSBucketDestination().Encryption().hasSSEOSS(), false);\n\n    InventoryOSSBucketDestination ossBucket;\n    ossBucket.setFormat(InventoryFormat::CSV);\n    ossBucket.setAccountId(\"AccountId\");\n    destination.setOSSBucketDestination(ossBucket);\n    EXPECT_EQ(destination.OSSBucketDestination().Format(), InventoryFormat::CSV);\n    EXPECT_EQ(destination.OSSBucketDestination().AccountId(), \"AccountId\");\n    EXPECT_EQ(destination.OSSBucketDestination().RoleArn(), \"\");\n    EXPECT_EQ(destination.OSSBucketDestination().Bucket(), \"\");\n    EXPECT_EQ(destination.OSSBucketDestination().Prefix(), \"\");\n    EXPECT_EQ(destination.OSSBucketDestination().Encryption().hasSSEKMS(), false);\n    EXPECT_EQ(destination.OSSBucketDestination().Encryption().hasSSEOSS(), false);\n}\n\nTEST_F(BucketInventoryConfigurationTest, InventoryConfiguration)\n{\n    InventoryConfiguration configuration;\n    EXPECT_EQ(configuration.Id(), \"\");\n    EXPECT_EQ(configuration.IsEnabled(), false);\n    EXPECT_EQ(configuration.Schedule(), InventoryFrequency::NotSet);\n    EXPECT_EQ(configuration.IncludedObjectVersions(), InventoryIncludedObjectVersions::NotSet);\n}\n\nTEST_F(BucketInventoryConfigurationTest, GetBucketInventoryConfigurationResult)\n{\n    std::string xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <InventoryConfiguration>\n            <Id>report1</Id>\n            <IsEnabled>true</IsEnabled>\n            <Filter>\n                <Prefix>filterPrefix</Prefix>\n            </Filter>\n            <Destination>\n                <OSSBucketDestination>\n                    <Format>CSV</Format>\n                    <AccountId>123456789012</AccountId>\n                    <RoleArn>xxx</RoleArn>\n                    <Bucket>acs:oss:::destination-bucket</Bucket>\n                    <Prefix>prefix1</Prefix>\n                    <Encryption>\n                    <SSE-KMS>\n                        <KeyId>keyId</KeyId>\n                    </SSE-KMS>\n                    </Encryption>\n                </OSSBucketDestination>\n            </Destination>\n            <Schedule>\n                <Frequency>Daily</Frequency>\n            </Schedule>\n            <IncludedObjectVersions>All</IncludedObjectVersions>\n            <OptionalFields>\n                <Field>Size</Field>\n                <Field>LastModifiedDate</Field>\n                <Field>ETag</Field>\n                <Field>StorageClass</Field>\n                <Field>IsMultipartUploaded</Field>\n                <Field>EncryptionStatus</Field>\n            </OptionalFields>\n        </InventoryConfiguration>)\";\n    GetBucketInventoryConfigurationResult result(xml);\n    EXPECT_EQ(result.InventoryConfiguration().Id(), \"report1\");\n    EXPECT_EQ(result.InventoryConfiguration().IsEnabled(), true);\n    EXPECT_EQ(result.InventoryConfiguration().Filter().Prefix(), \"filterPrefix\");\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().Format(), InventoryFormat::CSV);\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().AccountId(), \"123456789012\");\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().RoleArn(), \"xxx\");\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().Bucket(), \"destination-bucket\");\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().Prefix(), \"prefix1\");\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().Encryption().hasSSEKMS(), true);\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().Encryption().hasSSEOSS(), false);\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().Encryption().SSEKMS().KeyId(), \"keyId\");\n    EXPECT_EQ(result.InventoryConfiguration().Schedule(), InventoryFrequency::Daily);\n    EXPECT_EQ(result.InventoryConfiguration().IncludedObjectVersions(), InventoryIncludedObjectVersions::All);\n    EXPECT_EQ(result.InventoryConfiguration().OptionalFields().size(), 6U);\n    EXPECT_EQ(result.InventoryConfiguration().OptionalFields()[0], InventoryOptionalField::Size);\n    EXPECT_EQ(result.InventoryConfiguration().OptionalFields()[1], InventoryOptionalField::LastModifiedDate);\n    EXPECT_EQ(result.InventoryConfiguration().OptionalFields()[2], InventoryOptionalField::ETag);\n    EXPECT_EQ(result.InventoryConfiguration().OptionalFields()[3], InventoryOptionalField::StorageClass);\n    EXPECT_EQ(result.InventoryConfiguration().OptionalFields()[4], InventoryOptionalField::IsMultipartUploaded);\n    EXPECT_EQ(result.InventoryConfiguration().OptionalFields()[5], InventoryOptionalField::EncryptionStatus);\n\n    xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <InventoryConfiguration>\n            <Id>report2</Id>\n            <IsEnabled>false</IsEnabled>\n            <Filter>\n                <Prefix/>\n            </Filter>\n            <Destination>\n                <OSSBucketDestination>\n                    <Format>CSV</Format>\n                    <AccountId>123456789012</AccountId>\n                    <RoleArn>xxx</RoleArn>\n                    <Bucket>acs:oss:::destination-bucket1</Bucket>\n                    <Prefix>prefix1</Prefix>\n                    <Encryption>\n                        <SSE-OSS/>\n                    </Encryption>\n                </OSSBucketDestination>\n            </Destination>\n            <Schedule>\n                <Frequency>Weekly</Frequency>\n            </Schedule>\n            <IncludedObjectVersions>Current</IncludedObjectVersions>\n            <OptionalFields>\n                <Field>Size</Field>\n                <Field>LastModifiedDate</Field>\n                <Field>ETag</Field>\n            </OptionalFields>\n        </InventoryConfiguration>)\";\n    result = GetBucketInventoryConfigurationResult(xml);\n    EXPECT_EQ(result.InventoryConfiguration().Id(), \"report2\");\n    EXPECT_EQ(result.InventoryConfiguration().IsEnabled(), false);\n    EXPECT_EQ(result.InventoryConfiguration().Filter().Prefix(), \"\");\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().Format(), InventoryFormat::CSV);\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().AccountId(), \"123456789012\");\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().RoleArn(), \"xxx\");\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().Bucket(), \"destination-bucket1\");\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().Prefix(), \"prefix1\");\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().Encryption().hasSSEKMS(), false);\n    EXPECT_EQ(result.InventoryConfiguration().Destination().OSSBucketDestination().Encryption().hasSSEOSS(), true);\n    EXPECT_EQ(result.InventoryConfiguration().Schedule(), InventoryFrequency::Weekly);\n    EXPECT_EQ(result.InventoryConfiguration().IncludedObjectVersions(), InventoryIncludedObjectVersions::Current);\n    EXPECT_EQ(result.InventoryConfiguration().OptionalFields().size(), 3U);\n    EXPECT_EQ(result.InventoryConfiguration().OptionalFields()[0], InventoryOptionalField::Size);\n    EXPECT_EQ(result.InventoryConfiguration().OptionalFields()[1], InventoryOptionalField::LastModifiedDate);\n    EXPECT_EQ(result.InventoryConfiguration().OptionalFields()[2], InventoryOptionalField::ETag);\n}\n\nTEST_F(BucketInventoryConfigurationTest, ListBucketInventoryConfigurationsResult)\n{\n    std::string xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <ListInventoryConfigurationsResult>\n            <InventoryConfiguration>\n                <Id>report1</Id>\n                <IsEnabled>true</IsEnabled>\n                <Filter>\n                    <Prefix>filterPrefix</Prefix>\n                </Filter>\n                <Destination>\n                    <OSSBucketDestination>\n                    <Format>CSV</Format>\n                    <AccountId>123456789012</AccountId>\n                    <RoleArn>xxx</RoleArn>\n                    <Bucket>acs:oss:::destination-bucket</Bucket>\n                    <Prefix>prefix1</Prefix>\n                    <Encryption>\n                        <SSE-KMS>\n                            <KeyId>keyId</KeyId>\n                        </SSE-KMS>\n                    </Encryption>\n                    </OSSBucketDestination>\n                </Destination>\n                <Schedule>\n                    <Frequency>Daily</Frequency>\n                </Schedule>\n                <IncludedObjectVersions>All</IncludedObjectVersions>\n                <OptionalFields>\n                    <Field>Size</Field>\n                    <Field>LastModifiedDate</Field>\n                    <Field>ETag</Field>\n                    <Field>StorageClass</Field>\n                    <Field>IsMultipartUploaded</Field>\n                    <Field>EncryptionStatus</Field>\n                </OptionalFields>\n            </InventoryConfiguration>\n            <InventoryConfiguration>\n                <Id>report2</Id>\n                <IsEnabled>true</IsEnabled>\n                <Filter>\n                <Prefix>filterPrefix</Prefix>\n                </Filter>\n                <Destination>\n                    <OSSBucketDestination>\n                        <Format>CSV</Format>\n                        <AccountId>123456789012</AccountId>\n                        <RoleArn>xxx</RoleArn>\n                        <Bucket>acs:oss:::destination-bucket</Bucket>\n                        <Prefix>prefix1</Prefix>\n                        <Encryption>\n                        <SSE-OSS/>\n                        </Encryption>\n                    </OSSBucketDestination>\n                </Destination>\n                <Schedule>\n                    <Frequency>Weekly</Frequency>\n                </Schedule>\n                <IncludedObjectVersions>Current</IncludedObjectVersions>\n                <OptionalFields>\n                    <Field>Size</Field>\n                    <Field>LastModifiedDate</Field>\n                    <Field>ETag</Field>\n                    <Field>StorageClass</Field>\n                    <Field>IsMultipartUploaded</Field>\n                </OptionalFields>\n            </InventoryConfiguration>\n            <IsTruncated>true</IsTruncated>\n            <NextContinuationToken>test</NextContinuationToken>\n        </ListInventoryConfigurationsResult>)\";\n\n    ListBucketInventoryConfigurationsResult result(xml);\n    EXPECT_EQ(result.InventoryConfigurationList()[0].Id(), \"report1\");\n    EXPECT_EQ(result.InventoryConfigurationList()[0].IsEnabled(), true);\n    EXPECT_EQ(result.InventoryConfigurationList()[0].Filter().Prefix(), \"filterPrefix\");\n    EXPECT_EQ(result.InventoryConfigurationList()[0].Destination().OSSBucketDestination().Format(), InventoryFormat::CSV);\n    EXPECT_EQ(result.InventoryConfigurationList()[0].Destination().OSSBucketDestination().AccountId(), \"123456789012\");\n    EXPECT_EQ(result.InventoryConfigurationList()[0].Destination().OSSBucketDestination().RoleArn(), \"xxx\");\n    EXPECT_EQ(result.InventoryConfigurationList()[0].Destination().OSSBucketDestination().Bucket(), \"destination-bucket\");\n    EXPECT_EQ(result.InventoryConfigurationList()[0].Destination().OSSBucketDestination().Prefix(), \"prefix1\");\n    EXPECT_EQ(result.InventoryConfigurationList()[0].Destination().OSSBucketDestination().Encryption().hasSSEKMS(), true);\n    EXPECT_EQ(result.InventoryConfigurationList()[0].Destination().OSSBucketDestination().Encryption().hasSSEOSS(), false);\n    EXPECT_EQ(result.InventoryConfigurationList()[0].Destination().OSSBucketDestination().Encryption().SSEKMS().KeyId(), \"keyId\");\n    EXPECT_EQ(result.InventoryConfigurationList()[0].Schedule(), InventoryFrequency::Daily);\n    EXPECT_EQ(result.InventoryConfigurationList()[0].IncludedObjectVersions(), InventoryIncludedObjectVersions::All);\n    EXPECT_EQ(result.InventoryConfigurationList()[0].OptionalFields().size(), 6U);\n    EXPECT_EQ(result.InventoryConfigurationList()[0].OptionalFields()[0], InventoryOptionalField::Size);\n    EXPECT_EQ(result.InventoryConfigurationList()[0].OptionalFields()[1], InventoryOptionalField::LastModifiedDate);\n    EXPECT_EQ(result.InventoryConfigurationList()[0].OptionalFields()[2], InventoryOptionalField::ETag);\n    EXPECT_EQ(result.InventoryConfigurationList()[0].OptionalFields()[3], InventoryOptionalField::StorageClass);\n    EXPECT_EQ(result.InventoryConfigurationList()[0].OptionalFields()[4], InventoryOptionalField::IsMultipartUploaded);\n    EXPECT_EQ(result.InventoryConfigurationList()[0].OptionalFields()[5], InventoryOptionalField::EncryptionStatus);\n\n    EXPECT_EQ(result.InventoryConfigurationList()[1].Id(), \"report2\");\n    EXPECT_EQ(result.InventoryConfigurationList()[1].IsEnabled(), true);\n    EXPECT_EQ(result.InventoryConfigurationList()[1].Filter().Prefix(), \"filterPrefix\");\n    EXPECT_EQ(result.InventoryConfigurationList()[1].Destination().OSSBucketDestination().Format(), InventoryFormat::CSV);\n    EXPECT_EQ(result.InventoryConfigurationList()[1].Destination().OSSBucketDestination().AccountId(), \"123456789012\");\n    EXPECT_EQ(result.InventoryConfigurationList()[1].Destination().OSSBucketDestination().RoleArn(), \"xxx\");\n    EXPECT_EQ(result.InventoryConfigurationList()[1].Destination().OSSBucketDestination().Bucket(), \"destination-bucket\");\n    EXPECT_EQ(result.InventoryConfigurationList()[1].Destination().OSSBucketDestination().Prefix(), \"prefix1\");\n    EXPECT_EQ(result.InventoryConfigurationList()[1].Destination().OSSBucketDestination().Encryption().hasSSEKMS(), false);\n    EXPECT_EQ(result.InventoryConfigurationList()[1].Destination().OSSBucketDestination().Encryption().hasSSEOSS(), true);\n    EXPECT_EQ(result.InventoryConfigurationList()[1].Schedule(), InventoryFrequency::Weekly);\n    EXPECT_EQ(result.InventoryConfigurationList()[1].IncludedObjectVersions(), InventoryIncludedObjectVersions::Current);\n    EXPECT_EQ(result.InventoryConfigurationList()[1].OptionalFields().size(), 5U);\n    EXPECT_EQ(result.InventoryConfigurationList()[1].OptionalFields()[0], InventoryOptionalField::Size);\n    EXPECT_EQ(result.InventoryConfigurationList()[1].OptionalFields()[1], InventoryOptionalField::LastModifiedDate);\n    EXPECT_EQ(result.InventoryConfigurationList()[1].OptionalFields()[2], InventoryOptionalField::ETag);\n    EXPECT_EQ(result.InventoryConfigurationList()[1].OptionalFields()[3], InventoryOptionalField::StorageClass);\n    EXPECT_EQ(result.InventoryConfigurationList()[1].OptionalFields()[4], InventoryOptionalField::IsMultipartUploaded);\n\n    EXPECT_EQ(result.IsTruncated(), true);\n    EXPECT_EQ(result.NextContinuationToken(), \"test\");\n\n}\n\nTEST_F(BucketInventoryConfigurationTest, GetBucketInventoryConfigurationResultBranchTest)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    GetBucketInventoryConfigurationResult result(xml);\n\n    GetBucketInventoryConfigurationResult result1(\"test\");\n\n    xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <Inventory>\n        </Inventory>)\";\n    GetBucketInventoryConfigurationResult result2(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <InventoryConfiguration>\n        </InventoryConfiguration>)\";\n    GetBucketInventoryConfigurationResult result3(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <InventoryConfiguration>\n            <Id></Id>\n            <IsEnabled></IsEnabled>\n            <Filter>\n            </Filter>\n            <Destination>\n            </Destination>\n            <Schedule>\n            </Schedule>\n            <IncludedObjectVersions></IncludedObjectVersions>\n            <OptionalFields>\n            </OptionalFields>\n        </InventoryConfiguration>)\";\n    GetBucketInventoryConfigurationResult result4(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <InventoryConfiguration>\n            <Id>report1</Id>\n            <IsEnabled>true</IsEnabled>\n            <Filter>\n                <Prefix></Prefix>\n            </Filter>\n            <Destination>\n                <OSSBucketDestination>\n\n                </OSSBucketDestination>\n            </Destination>\n            <Schedule>\n                <Frequency></Frequency>\n            </Schedule>\n            <IncludedObjectVersions>All</IncludedObjectVersions>\n            <OptionalFields>\n                <Field></Field>\n                <Field></Field>\n                <Field></Field>\n                <Field></Field>\n                <Field></Field>\n                <Field></Field>\n            </OptionalFields>\n        </InventoryConfiguration>)\";\n    GetBucketInventoryConfigurationResult result5(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <InventoryConfiguration>\n            <Id>report1</Id>\n            <IsEnabled>true</IsEnabled>\n            <Filter>\n                <Prefix>filterPrefix</Prefix>\n            </Filter>\n            <Destination>\n                <OSSBucketDestination>\n                    <Format></Format>\n                    <AccountId></AccountId>\n                    <RoleArn></RoleArn>\n                    <Bucket></Bucket>\n                    <Prefix></Prefix>\n                    <Encryption>\n                    </Encryption>\n                </OSSBucketDestination>\n            </Destination>\n            <Schedule>\n                <Frequency>Daily</Frequency>\n            </Schedule>\n            <IncludedObjectVersions>All</IncludedObjectVersions>\n            <OptionalFields>\n                <Field>Size</Field>\n                <Field>LastModifiedDate</Field>\n                <Field>ETag</Field>\n                <Field>StorageClass</Field>\n                <Field>IsMultipartUploaded</Field>\n                <Field>EncryptionStatus</Field>\n            </OptionalFields>\n        </InventoryConfiguration>)\";\n    GetBucketInventoryConfigurationResult result6(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <InventoryConfiguration>\n            <Id>report1</Id>\n            <IsEnabled>true</IsEnabled>\n            <Filter>\n                <Prefix>filterPrefix</Prefix>\n            </Filter>\n            <Destination>\n                <OSSBucketDestination>\n                    <Format>CSV</Format>\n                    <AccountId>123456789012</AccountId>\n                    <RoleArn>xxx</RoleArn>\n                    <Bucket>acs:oss:::destination-bucket</Bucket>\n                    <Prefix>prefix1</Prefix>\n                    <Encryption>\n                        <SSE-KMS>\n                        </SSE-KMS>\n                    </Encryption>\n                </OSSBucketDestination>\n            </Destination>\n            <Schedule>\n                <Frequency>Daily</Frequency>\n            </Schedule>\n            <IncludedObjectVersions>All</IncludedObjectVersions>\n            <OptionalFields>\n                <Field>Size</Field>\n                <Field>LastModifiedDate</Field>\n                <Field>ETag</Field>\n                <Field>StorageClass</Field>\n                <Field>IsMultipartUploaded</Field>\n                <Field>EncryptionStatus</Field>\n            </OptionalFields>\n        </InventoryConfiguration>)\";\n    GetBucketInventoryConfigurationResult result7(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <InventoryConfiguration>\n            <Id>report1</Id>\n            <IsEnabled>true</IsEnabled>\n            <Filter>\n                <Prefix>filterPrefix</Prefix>\n            </Filter>\n            <Destination>\n                <OSSBucketDestination>\n                    <Format>CSV</Format>\n                    <AccountId>123456789012</AccountId>\n                    <RoleArn>xxx</RoleArn>\n                    <Bucket>acs:oss:::destination-bucket</Bucket>\n                    <Prefix>prefix1</Prefix>\n                    <Encryption>\n                        <SSE-KMS>\n                            <KeyId></KeyId>\n                        </SSE-KMS>\n                    </Encryption>\n                </OSSBucketDestination>\n            </Destination>\n            <Schedule>\n                <Frequency>Daily</Frequency>\n            </Schedule>\n            <IncludedObjectVersions>All</IncludedObjectVersions>\n            <OptionalFields>\n                <Field>Size</Field>\n                <Field>LastModifiedDate</Field>\n                <Field>ETag</Field>\n                <Field>StorageClass</Field>\n                <Field>IsMultipartUploaded</Field>\n                <Field>EncryptionStatus</Field>\n            </OptionalFields>\n        </InventoryConfiguration>)\";\n    GetBucketInventoryConfigurationResult result8(xml);\n\n}\n\nTEST_F(BucketInventoryConfigurationTest, ListBucketInventoryConfigurationResultBranchtest)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    ListBucketInventoryConfigurationsResult result(xml);\n\n    ListBucketInventoryConfigurationsResult result1(\"test\");\n\n    xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <ListInventoryConfigurations>\n        </ListInventoryConfigurations>)\";\n    ListBucketInventoryConfigurationsResult result2(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <ListInventoryConfigurationsResult>\n        </ListInventoryConfigurationsResult>)\";\n    ListBucketInventoryConfigurationsResult result3(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <ListInventoryConfigurationsResult>\n            <InventoryConfiguration>                        \n            </InventoryConfiguration>\n            <IsTruncated></IsTruncated>\n            <NextContinuationToken></NextContinuationToken>\n        </ListInventoryConfigurationsResult>)\";\n    ListBucketInventoryConfigurationsResult result4(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <ListInventoryConfigurationsResult>\n            <InventoryConfiguration>\n                <Id></Id>\n                <IsEnabled></IsEnabled>\n                <Filter>\n                </Filter>\n                <Destination>\n                </Destination>\n                <Schedule>\n                </Schedule>\n                <IncludedObjectVersions></IncludedObjectVersions>\n                <OptionalFields>\n                </OptionalFields>\n            </InventoryConfiguration>\n            <InventoryConfiguration>\n                <Id></Id>\n                <IsEnabled></IsEnabled>\n                <Filter>\n                </Filter>\n                <Destination>\n                </Destination>\n                <Schedule>\n                </Schedule>\n                <IncludedObjectVersions></IncludedObjectVersions>\n                <OptionalFields>\n                </OptionalFields>\n            </InventoryConfiguration>\n            <IsTruncated>true</IsTruncated>\n            <NextContinuationToken>test</NextContinuationToken>\n        </ListInventoryConfigurationsResult>)\";\n    ListBucketInventoryConfigurationsResult result5(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" ?>\n        <ListInventoryConfigurationsResult>\n            <InventoryConfiguration>\n                <Id>report1</Id>\n                <IsEnabled>true</IsEnabled>\n                <Filter>\n                    <Prefix></Prefix>\n                </Filter>\n                <Destination>\n                    <OSSBucketDestination>\n                    </OSSBucketDestination>\n                </Destination>\n                <Schedule>\n                    <Frequency></Frequency>\n                </Schedule>\n                <IncludedObjectVersions>All</IncludedObjectVersions>\n                <OptionalFields>\n                    <Field></Field>\n                    <Field></Field>\n                    <Field></Field>\n                    <Field></Field>\n                    <Field></Field>\n                    <Field></Field>\n                </OptionalFields>\n            </InventoryConfiguration>\n            <InventoryConfiguration>\n                <Id>report2</Id>\n                <IsEnabled>true</IsEnabled>\n                <Filter>\n                    <Prefix></Prefix>\n                </Filter>\n                <Destination>\n                    <OSSBucketDestination>\n                    </OSSBucketDestination>\n                </Destination>\n                <Schedule>\n                    <Frequency></Frequency>\n                </Schedule>\n                <IncludedObjectVersions>All</IncludedObjectVersions>\n                <OptionalFields>\n                    <Field></Field>\n                    <Field></Field>\n                    <Field></Field>\n                    <Field></Field>\n                    <Field></Field>\n                    <Field></Field>\n                </OptionalFields>\n            </InventoryConfiguration>\n            <IsTruncated>true</IsTruncated>\n            <NextContinuationToken>test</NextContinuationToken>\n        </ListInventoryConfigurationsResult>)\";\n    ListBucketInventoryConfigurationsResult result6(xml);\n\n    xml = R\"(<?xml version=\"1.0\" ?>\n        <ListInventoryConfigurationsResult>\n            <InventoryConfiguration>\n                <Id>report1</Id>\n                <IsEnabled>true</IsEnabled>\n                <Filter>\n                    <Prefix>filterPrefix</Prefix>\n                </Filter>\n                <Destination>\n                    <OSSBucketDestination>\n                        <Format></Format>\n                        <AccountId></AccountId>\n                        <RoleArn></RoleArn>\n                        <Bucket></Bucket>\n                        <Prefix></Prefix>\n                        <Encryption>\n                        </Encryption>\n                    </OSSBucketDestination>\n                </Destination>\n                <Schedule>\n                    <Frequency>Daily</Frequency>\n                </Schedule>\n                <IncludedObjectVersions>All</IncludedObjectVersions>\n                <OptionalFields>\n                    <Field>Size</Field>\n                    <Field>LastModifiedDate</Field>\n                    <Field>ETag</Field>\n                    <Field>StorageClass</Field>\n                    <Field>IsMultipartUploaded</Field>\n                    <Field>EncryptionStatus</Field>\n                </OptionalFields>\n            </InventoryConfiguration>\n            <InventoryConfiguration>\n                <Id>report2</Id>\n                <IsEnabled>true</IsEnabled>\n                <Filter>\n                    <Prefix>filterPrefix</Prefix>\n                </Filter>\n                <Destination>\n                    <OSSBucketDestination>\n                        <Format>CSV</Format>\n                        <AccountId>123456789012</AccountId>\n                        <RoleArn>xxx</RoleArn>\n                        <Bucket>acs:oss:::destination-bucket</Bucket>\n                        <Prefix>prefix1</Prefix>\n                        <Encryption>\n                            <SSE-KMS>\n                            </SSE-KMS>\n                        </Encryption>\n                    </OSSBucketDestination>\n                </Destination>\n                <Schedule>\n                    <Frequency>Daily</Frequency>\n                </Schedule>\n                <IncludedObjectVersions>All</IncludedObjectVersions>\n                <OptionalFields>\n                    <Field>Size</Field>\n                    <Field>LastModifiedDate</Field>\n                    <Field>ETag</Field>\n                    <Field>StorageClass</Field>\n                    <Field>IsMultipartUploaded</Field>\n                    <Field>EncryptionStatus</Field>\n                </OptionalFields>\n            </InventoryConfiguration>\n            <IsTruncated>true</IsTruncated>\n            <NextContinuationToken>test</NextContinuationToken>\n        </ListInventoryConfigurationsResult>)\";\n    ListBucketInventoryConfigurationsResult result7(xml);\n\n    xml = R\"(<?xml version=\"1.0\" ?>\n        <ListInventoryConfigurationsResult>\n            <InventoryConfiguration>\n                <Id>report1</Id>\n                <IsEnabled>true</IsEnabled>\n                <Filter>\n                    <Prefix>filterPrefix</Prefix>\n                </Filter>\n                <Destination>\n                    <OSSBucketDestination>\n                        <Format>CSV</Format>\n                        <AccountId>123456789012</AccountId>\n                        <RoleArn>xxx</RoleArn>\n                        <Bucket>acs:oss:::destination-bucket</Bucket>\n                        <Prefix>prefix1</Prefix>\n                        <Encryption>\n                            <SSE-KMS>\n                            <KeyId></KeyId>\n                            </SSE-KMS>\n                        </Encryption>\n                    </OSSBucketDestination>\n                </Destination>\n                <Schedule>\n                    <Frequency>Daily</Frequency>\n                </Schedule>\n                <IncludedObjectVersions>All</IncludedObjectVersions>\n                <OptionalFields>\n                    <Field>Size</Field>\n                    <Field>LastModifiedDate</Field>\n                    <Field>ETag</Field>\n                    <Field>StorageClass</Field>\n                    <Field>IsMultipartUploaded</Field>\n                    <Field>EncryptionStatus</Field>\n                </OptionalFields>\n            </InventoryConfiguration>\n            <InventoryConfiguration>\n                <Id>report2</Id>\n                <IsEnabled>true</IsEnabled>\n                <Filter>\n                    <Prefix>filterPrefix</Prefix>\n                </Filter>\n                <Destination>\n                    <OSSBucketDestination>\n                        <Format>CSV</Format>\n                        <AccountId>123456789012</AccountId>\n                        <RoleArn>xxx</RoleArn>\n                        <Bucket>acs:oss:::destination-bucket</Bucket>\n                        <Prefix>prefix1</Prefix>\n                        <Encryption>\n                            <SSE-KMS>\n                                <KeyId></KeyId>\n                            </SSE-KMS>\n                        </Encryption>\n                    </OSSBucketDestination>\n                </Destination>\n                <Schedule>\n                    <Frequency>Daily</Frequency>\n                </Schedule>\n                <IncludedObjectVersions>All</IncludedObjectVersions>\n                <OptionalFields>\n                    <Field>Size</Field>\n                    <Field>LastModifiedDate</Field>\n                    <Field>ETag</Field>\n                    <Field>StorageClass</Field>\n                    <Field>IsMultipartUploaded</Field>\n                    <Field>EncryptionStatus</Field>\n                </OptionalFields>\n            </InventoryConfiguration>\n            <IsTruncated>true</IsTruncated>\n            <NextContinuationToken>test</NextContinuationToken>\n        </ListInventoryConfigurationsResult>)\";\n    ListBucketInventoryConfigurationsResult result8(xml);\n}\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketLifecycleSettingsTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include <alibabacloud/oss/Const.h>\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass BucketLifecycleSettingsTest : public ::testing::Test {\nprotected:\n    BucketLifecycleSettingsTest()\n    {\n    }\n\n    ~BucketLifecycleSettingsTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketlifecyclesettings\");\n        Client->CreateBucket(BucketName);\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n        Client->DeleteBucket(BucketName);\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\n\n    static bool TestRule(LifecycleRule rule)\n    {\n        SetBucketLifecycleRequest request(BucketName);\n        request.addLifecycleRule(rule);\n        auto outcome = Client->SetBucketLifecycle(request);\n        if (!outcome.isSuccess())\n            return false;\n\n        TestUtils::WaitForCacheExpire(5);\n        auto gOutcome = Client->GetBucketLifecycle(BucketName);\n        Client->DeleteBucketLifecycle(BucketName);\n        TestUtils::WaitForCacheExpire(5);\n\n        if (!gOutcome.isSuccess())\n            return false;\n\n        if (gOutcome.result().LifecycleRules().size() == 1 &&\n            *(gOutcome.result().LifecycleRules().begin()) == rule) {\n            return true;\n        }\n        return false;\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> BucketLifecycleSettingsTest::Client = nullptr;\nstd::string BucketLifecycleSettingsTest::BucketName = \"\";\n\nTEST_F(BucketLifecycleSettingsTest, GetBucketLifecycleResult)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <LifecycleConfiguration>\n                      <Rule>\n                        <ID>36e24c61-227f-4ea9-aee2-bc5af12dbc90</ID>\n                        <Prefix>prefix1</Prefix>\n                        <Status>Disabled</Status>\n                        <Transition>\n                          <Days>60</Days>\n                          <StorageClass>IA</StorageClass>\n                        </Transition>\n                        <Transition>\n                          <Days>180</Days>\n                          <StorageClass>Archive</StorageClass>\n                        </Transition>\n                        <Expiration>\n                          <Days>240</Days>\n                        </Expiration>\n                        <AbortMultipartUpload>\n                          <Days>30</Days>\n                        </AbortMultipartUpload>\n                      </Rule>\n                      <Rule>\n                        <ID>6a7f02d9-97f0-4a58-8a55-f3fe604e2cd5</ID>\n                        <Prefix>prefix2</Prefix>\n                        <Status>Disabled</Status>\n                        <Transition>\n                          <CreatedBeforeDate>2018-05-05T00:00:00.000Z</CreatedBeforeDate>\n                          <StorageClass>IA</StorageClass>\n                        </Transition>\n                        <Transition>\n                          <CreatedBeforeDate>2018-08-05T00:00:00.000Z</CreatedBeforeDate>\n                          <StorageClass>Archive</StorageClass>\n                        </Transition>\n                        <Expiration>\n                          <CreatedBeforeDate>2018-10-05T00:00:00.000Z</CreatedBeforeDate>\n                        </Expiration>\n                        <AbortMultipartUpload>\n                          <CreatedBeforeDate>2018-11-05T00:00:00.000Z</CreatedBeforeDate>\n                        </AbortMultipartUpload>\n                      </Rule>\n                      <Rule>\n                        <ID>11598635-ce8d-4a4f-991d-28b11e24e664</ID>\n                        <Prefix>prefix3</Prefix>\n                        <Status>Enabled</Status>\n                        <Transition>\n                          <CreatedBeforeDate>2018-05-05T00:00:00.000Z</CreatedBeforeDate>\n                          <StorageClass>IA</StorageClass>\n                        </Transition>\n                        <Transition>\n                          <CreatedBeforeDate>2018-08-05T00:00:00.000Z</CreatedBeforeDate>\n                          <StorageClass>Archive</StorageClass>\n                        </Transition>\n                        <Expiration>\n                          <CreatedBeforeDate>2018-10-05T00:00:00.000Z</CreatedBeforeDate>\n                        </Expiration>\n                        <AbortMultipartUpload>\n                          <CreatedBeforeDate>2018-11-05T00:00:00.000Z</CreatedBeforeDate>\n                        </AbortMultipartUpload>\n                      </Rule>\n                      <Rule>\n                        <ID>1e267ae9-db1d-4396-bea1-4238e3d219c7</ID>\n                        <Prefix>prefix4</Prefix>\n                        <Status>Enabled</Status>\n                        <AbortMultipartUpload>\n                          <Days>30</Days>\n                        </AbortMultipartUpload>\n                      </Rule>\n                      <Rule>\n                        <ID>ac10167f-b4ba-489b-affc-112a5e581f71</ID>\n                        <Prefix>prefix5</Prefix>\n                        <Status>Enabled</Status>\n                        <Transition>\n                          <Days>60</Days>\n                          <StorageClass>IA</StorageClass>\n                        </Transition>\n                        <Transition>\n                          <Days>180</Days>\n                          <StorageClass>Archive</StorageClass>\n                        </Transition>\n                        <Expiration>\n                          <Days>240</Days>\n                        </Expiration>\n                      </Rule>\n                    </LifecycleConfiguration>)\";\n    GetBucketLifecycleResult result(xml);\n    EXPECT_EQ(result.LifecycleRules().size(), 5UL);\n    EXPECT_EQ(result.LifecycleRules().begin()->ID(), \"36e24c61-227f-4ea9-aee2-bc5af12dbc90\");\n    EXPECT_EQ(result.LifecycleRules().begin()->Prefix(), \"prefix1\");\n    EXPECT_EQ(result.LifecycleRules().begin()->Status(), RuleStatus::Disabled);\n    EXPECT_EQ(result.LifecycleRules().begin()->TransitionList().size(), 2UL);\n    EXPECT_EQ(result.LifecycleRules().begin()->TransitionList().begin()->StorageClass(), StorageClass::IA);\n    EXPECT_EQ(result.LifecycleRules().begin()->TransitionList().begin()->Expiration().Days(), 60UL);\n    EXPECT_EQ(result.LifecycleRules().begin()->Expiration().Days(), 240UL);\n    EXPECT_EQ(result.LifecycleRules().begin()->AbortMultipartUpload().Days(), 30UL);\n\n    EXPECT_EQ(result.LifecycleRules().rbegin()->ID(), \"ac10167f-b4ba-489b-affc-112a5e581f71\");\n    EXPECT_EQ(result.LifecycleRules().rbegin()->Prefix(), \"prefix5\");\n    EXPECT_EQ(result.LifecycleRules().rbegin()->Status(), RuleStatus::Enabled);\n    EXPECT_EQ(result.LifecycleRules().rbegin()->TransitionList().size(), 2UL);\n    EXPECT_EQ(result.LifecycleRules().rbegin()->TransitionList().rbegin()->StorageClass(), StorageClass::Archive);\n    EXPECT_EQ(result.LifecycleRules().rbegin()->TransitionList().rbegin()->Expiration().Days(), 180UL);\n    EXPECT_EQ(result.LifecycleRules().rbegin()->Expiration().Days(), 240UL);\n    EXPECT_EQ(result.LifecycleRules().rbegin()->AbortMultipartUpload().Days(), 0UL);\n    EXPECT_EQ(result.LifecycleRules().rbegin()->AbortMultipartUpload().CreatedBeforeDate(), \"\");\n    EXPECT_EQ(result.LifecycleRules().rbegin()->hasAbortMultipartUpload(), false);\n}\n\nTEST_F(BucketLifecycleSettingsTest, LifecycleSetGetDeleteRequestTest)\n{\n    auto rule = LifecycleRule();\n    rule.setID(\"basic-test\");\n    rule.setPrefix(\"test\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule.Expiration().setDays(200);\n\n    SetBucketLifecycleRequest request(BucketName);\n    request.addLifecycleRule(rule);\n    auto outcome = Client->SetBucketLifecycle(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    GetBucketLifecycleRequest gRequest(BucketName);\n    auto gOutcome = Client->GetBucketLifecycle(gRequest);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().LifecycleRules().size(), 1UL);\n    if (gOutcome.result().LifecycleRules().size() == 1UL) {\n        EXPECT_TRUE(*(gOutcome.result().LifecycleRules().begin()) == rule);\n    }\n\n    DeleteBucketLifecycleRequest dRequest(BucketName);\n    auto dOutcome = Client->DeleteBucketLifecycle(dRequest);\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n}\n\nTEST_F(BucketLifecycleSettingsTest, LifecycleBasicSettingTest)\n{\n    auto rule = LifecycleRule();\n    rule.setID(\"StandardExpireRule-001\");\n    rule.setPrefix(\"test\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule.Expiration().setDays(200);\n    EXPECT_TRUE(TestRule(rule));\n\n    rule = LifecycleRule();\n    rule.setID(\"StandardExpireRule-002\");\n    rule.setPrefix(\"object\");\n    rule.setStatus(RuleStatus::Disabled);\n    rule.Expiration().setDays(365);\n    EXPECT_TRUE(TestRule(rule));\n\n    rule = LifecycleRule();\n    rule.setID(\"StandardExpireRule-003\");\n    rule.setPrefix(\"object\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule.Expiration().setCreatedBeforeDate(TestUtils::GetUTCString(200, true));\n    EXPECT_TRUE(TestRule(rule));\n\n    rule = LifecycleRule();\n    rule.setID(\"StandardExpireRule-004\");\n    rule.setPrefix(\"object\");\n    rule.setStatus(RuleStatus::Disabled);\n    rule.Expiration().setCreatedBeforeDate(TestUtils::GetUTCString(365, true));\n    EXPECT_TRUE(TestRule(rule));\n}\n\nTEST_F(BucketLifecycleSettingsTest, LifecycleAdvancedSettingTest)\n{\n    auto rule = LifecycleRule();\n    rule.setID(\"StandardExpireRule-101\");\n    rule.setPrefix(\"test\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule.Expiration().setDays(400);\n    rule.AbortMultipartUpload().setCreatedBeforeDate(TestUtils::GetUTCString(400, true));\n    \n    auto transition = LifeCycleTransition();\n    transition.Expiration().setDays(180);\n    transition.setStorageClass(StorageClass::IA);\n    rule.addTransition(transition);\n    \n    transition.Expiration().setDays(365);\n    transition.setStorageClass(StorageClass::Archive);\n    rule.addTransition(transition);\n    EXPECT_TRUE(TestRule(rule));\n    \n    rule = LifecycleRule();\n    rule.setID(\"StandardExpireRule-102\");\n    rule.setPrefix(\"object\");\n    rule.setStatus(RuleStatus::Disabled);\n    rule.Expiration().setDays(365);\n    rule.AbortMultipartUpload().setDays(200);\n\n    transition.Expiration().setDays(250);\n    transition.setStorageClass(StorageClass::Archive);\n    rule.addTransition(transition);\n    EXPECT_TRUE(TestRule(rule));\n\n    rule = LifecycleRule();\n    rule.setID(\"StandardExpireRule-103\");\n    rule.setPrefix(\"object\");\n    rule.setStatus(RuleStatus::Disabled);\n    rule.Expiration().setCreatedBeforeDate(TestUtils::GetUTCString(365, true));\n    rule.AbortMultipartUpload().setDays(200);\n    EXPECT_TRUE(TestRule(rule));\n\n    rule = LifecycleRule();\n    rule.setID(\"StandardExpireRule-104\");\n    rule.setPrefix(\"test\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule.Expiration().setCreatedBeforeDate(TestUtils::GetUTCString(-400, true));\n    rule.AbortMultipartUpload().setCreatedBeforeDate(TestUtils::GetUTCString(400, true));\n\n    transition = LifeCycleTransition();\n    transition.Expiration().setCreatedBeforeDate(TestUtils::GetUTCString(-180, true));\n    transition.setStorageClass(StorageClass::IA);\n    rule.addTransition(transition);\n\n    transition.Expiration().setCreatedBeforeDate(TestUtils::GetUTCString(-365, true));\n    transition.setStorageClass(StorageClass::Archive);\n    rule.addTransition(transition);\n    EXPECT_TRUE(TestRule(rule));\n}\n\nTEST_F(BucketLifecycleSettingsTest, SetLifecycleRequestLifecycleRuleEmptyTest)\n{\n    SetBucketLifecycleRequest request(BucketName);\n    auto outcome = Client->SetBucketLifecycle(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    EXPECT_TRUE(strstr(outcome.error().Message().c_str(), \"LifecycleRule should not be null or empty\") != nullptr);\n}\n\nTEST_F(BucketLifecycleSettingsTest, SetLifecycleRequestLifecycleRuleNoConfigTest)\n{\n    SetBucketLifecycleRequest request(BucketName);\n    auto rule = LifecycleRule();\n    request.addLifecycleRule(rule);\n    auto outcome = Client->SetBucketLifecycle(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    EXPECT_TRUE(strstr(outcome.error().Message().c_str(), \"Configure at least one of file and fragment lifecycle.\") != nullptr);\n}\n\nTEST_F(BucketLifecycleSettingsTest, SetLifecycleRequestRuleForBucketPasitiveTest)\n{\n    auto rule = LifecycleRule();\n    rule.setID(\"StandardExpireRule-301\");\n    rule.setStatus(RuleStatus::Disabled);\n    rule.Expiration().setCreatedBeforeDate(TestUtils::GetUTCString(365, true));\n    EXPECT_TRUE(TestRule(rule));\n}\n\nTEST_F(BucketLifecycleSettingsTest, SetLifecycleRequestRuleForBucketNegativeTest)\n{\n    SetBucketLifecycleRequest request(BucketName);\n    auto rule = LifecycleRule();\n    rule.setID(\"StandardExpireRule-401\");\n    rule.setStatus(RuleStatus::Disabled);\n    rule.Expiration().setCreatedBeforeDate(TestUtils::GetUTCString(365, true));\n    request.addLifecycleRule(rule);\n\n    rule = LifecycleRule();\n    rule.setID(\"StandardExpireRule-402\");\n    rule.setPrefix(\"object\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule.Expiration().setCreatedBeforeDate(TestUtils::GetUTCString(365, true));\n    request.addLifecycleRule(rule);\n\n    auto outcome = Client->SetBucketLifecycle(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    EXPECT_TRUE(strstr(outcome.error().Message().c_str(), \"You have a rule for a prefix\") != nullptr);\n}\n\nTEST_F(BucketLifecycleSettingsTest, SetLifecycleRequestInvalidBucketNameTest)\n{\n    SetBucketLifecycleRequest request(\"InvalidBucketName\");\n    auto rule = LifecycleRule();\n    request.addLifecycleRule(rule);\n    auto outcome = Client->SetBucketLifecycle(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    EXPECT_TRUE(strstr(outcome.error().Message().c_str(), \"The bucket name is invalid\") != nullptr);\n}\n\nTEST_F(BucketLifecycleSettingsTest, LifecycleRuleEqualOperationTest)\n{\n    //ID NG\n    auto rule  = LifecycleRule();\n    auto rule1 = LifecycleRule();\n    rule.setID(\"id0\");\n    rule1.setID(\"id1\");\n    EXPECT_FALSE(rule == rule1);\n\n    //Prefix NG\n    rule  = LifecycleRule();\n    rule1 = LifecycleRule();\n    rule.setID(\"id\");\n    rule1.setID(\"id\");\n    rule.setPrefix(\"prefix0\");\n    rule.setPrefix(\"prefix1\");\n    EXPECT_FALSE(rule == rule1);\n\n    //RuleStatus NG\n    rule  = LifecycleRule();\n    rule1 = LifecycleRule();\n    rule.setID(\"id\");\n    rule1.setID(\"id\");\n    rule.setPrefix(\"prefix\");\n    rule1.setPrefix(\"prefix\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule1.setStatus(RuleStatus::Disabled);\n    EXPECT_FALSE(rule == rule1);\n\n    //Expiration CreatedBeforeDate NG\n    rule = LifecycleRule();\n    rule.setID(\"id\");\n    rule.setPrefix(\"prefix\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule1 = rule;\n    rule.Expiration().setCreatedBeforeDate(TestUtils::GetUTCString(10));\n    rule1.Expiration().setCreatedBeforeDate(TestUtils::GetUTCString(20));\n    EXPECT_FALSE(rule == rule1);\n\n    //Expiration Days NG\n    rule = LifecycleRule();\n    rule.setID(\"id\");\n    rule.setPrefix(\"prefix\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule1 = rule;\n    rule.Expiration().setDays(10);\n    rule1.Expiration().setDays(20);\n    EXPECT_FALSE(rule == rule1);\n\n    //AbortMultipartUpload CreatedBeforeDate NG\n    rule = LifecycleRule();\n    rule.setID(\"id\");\n    rule.setPrefix(\"prefix\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule1 = rule;\n    rule.AbortMultipartUpload().setCreatedBeforeDate(TestUtils::GetUTCString(10));\n    rule1.AbortMultipartUpload().setCreatedBeforeDate(TestUtils::GetUTCString(20));\n    EXPECT_FALSE(rule == rule1);\n\n    //AbortMultipartUpload Days NG\n    rule = LifecycleRule();\n    rule.setID(\"id\");\n    rule.setPrefix(\"prefix\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule1 = rule;\n    rule.AbortMultipartUpload().setDays(20);\n    rule1.AbortMultipartUpload().setDays(50);\n    EXPECT_FALSE(rule == rule1);\n\n    //TransitionList size NG\n    rule = LifecycleRule();\n    rule1 = LifecycleRule();\n    rule.setID(\"id\");\n    rule.setPrefix(\"prefix\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule1 = rule;\n    auto transition = LifeCycleTransition();\n    transition.Expiration().setDays(10);\n    transition.setStorageClass(StorageClass::IA);\n    rule.addTransition(transition);\n    rule1.addTransition(transition);\n    transition.Expiration().setDays(60);\n    transition.setStorageClass(StorageClass::Archive);\n    rule1.addTransition(transition);\n    EXPECT_FALSE(rule == rule1);\n\n    //Transition StorageClass NG\n    rule = LifecycleRule();\n    rule.setID(\"id\");\n    rule.setPrefix(\"prefix\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule1 = rule;\n    transition = LifeCycleTransition();\n    transition.Expiration().setDays(10);\n    transition.setStorageClass(StorageClass::IA);\n    rule.addTransition(transition);\n    transition.Expiration().setDays(10);\n    transition.setStorageClass(StorageClass::Archive);\n    rule1.addTransition(transition);\n    EXPECT_FALSE(rule == rule1);\n\n    //Transition Days NG\n    rule = LifecycleRule();\n    rule.setID(\"id\");\n    rule.setPrefix(\"prefix\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule1 = rule;\n    transition = LifeCycleTransition();\n    transition.Expiration().setDays(10);\n    transition.setStorageClass(StorageClass::IA);\n    rule.addTransition(transition);\n    transition.Expiration().setDays(20);\n    transition.setStorageClass(StorageClass::IA);\n    rule1.addTransition(transition);\n    EXPECT_FALSE(rule == rule1);\n\n    //Transition CreatedBeforeDate NG\n    rule = LifecycleRule();\n    rule.setID(\"id\");\n    rule.setPrefix(\"prefix\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule1 = rule;\n    transition = LifeCycleTransition();\n    transition.Expiration().setCreatedBeforeDate(TestUtils::GetUTCString(10));\n    transition.setStorageClass(StorageClass::IA);\n    rule.addTransition(transition);\n    transition.Expiration().setCreatedBeforeDate(TestUtils::GetUTCString(20));\n    transition.setStorageClass(StorageClass::IA);\n    rule1.addTransition(transition);\n    EXPECT_FALSE(rule == rule1);\n}\n\nTEST_F(BucketLifecycleSettingsTest, LifeCycleExpirationTest)\n{\n    auto expiration  = LifeCycleExpiration(30);\n    auto expiration1 = LifeCycleExpiration();\n    expiration1.setDays(30);\n    EXPECT_EQ(expiration.Days(), expiration1.Days());\n\n    expiration  = LifeCycleExpiration(TestUtils::GetUTCString(10));\n    expiration1 = LifeCycleExpiration();\n    expiration1.setCreatedBeforeDate(TestUtils::GetUTCString(10));\n    EXPECT_EQ(expiration.CreatedBeforeDate(), expiration1.CreatedBeforeDate());\n\n    auto utcStr = TestUtils::GetUTCString(10);\n    expiration = LifeCycleExpiration(utcStr);\n    EXPECT_EQ(expiration.Days(), 0UL);\n    EXPECT_EQ(expiration.CreatedBeforeDate(), utcStr);\n    expiration.setDays(20);\n    EXPECT_EQ(expiration.Days(), 20UL);\n    EXPECT_EQ(expiration.CreatedBeforeDate(), \"\");\n    expiration.setCreatedBeforeDate(utcStr);\n    EXPECT_EQ(expiration.Days(), 0UL);\n    EXPECT_EQ(expiration.CreatedBeforeDate(), utcStr);\n}\n\nTEST_F(BucketLifecycleSettingsTest, LifeCycleTransitionTest)\n{\n    auto expiration = LifeCycleExpiration(30);\n    auto transition = LifeCycleTransition(expiration, StorageClass::IA);\n    EXPECT_EQ(transition.Expiration().Days(), 30UL);\n    EXPECT_EQ(transition.StorageClass(), StorageClass::IA);\n\n    expiration = LifeCycleExpiration(60);\n    transition = LifeCycleTransition();\n    transition.setExpiration(expiration);\n    EXPECT_EQ(transition.Expiration().Days(), 60UL);\n}\n\nTEST_F(BucketLifecycleSettingsTest, LifeCycleRuleLimitTest)\n{\n    SetBucketLifecycleRequest request(BucketName);\n    for (int i = 0; i < LifecycleRuleLimit + 1; i++) {\n        auto rule = LifecycleRule();\n        std::string prefix = \"prefix\"; prefix.append(std::to_string(i));\n        rule.setPrefix(prefix);\n        rule.Expiration().setDays(10 + i);\n        request.addLifecycleRule(rule);\n    }\n\n    auto outcome = Client->SetBucketLifecycle(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    EXPECT_TRUE(strstr(outcome.error().Message().c_str(), \"One bucket not allow exceed one thousand\") != nullptr);\n}\n\n\nTEST_F(BucketLifecycleSettingsTest, DeleteBucketLifecycleNegativeTest)\n{\n    auto name = TestUtils::GetBucketName(\"no-exist-lifecycle\");\n    auto outcome = Client->DeleteBucketLifecycle(name);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\n}\n\nTEST_F(BucketLifecycleSettingsTest, GetBucketLifecycleNegativeTest)\n{\n    auto name = TestUtils::GetBucketName(\"no-exist-lifecycle\");\n    auto outcome = Client->GetBucketLifecycle(name);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\n}\n\nTEST_F(BucketLifecycleSettingsTest, GetBucketLifecycleResultBranchTest)\n{\n    GetBucketLifecycleResult result(\"test\");\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <Lifecycle>\n\n                    </Lifecycle>)\";\n    GetBucketLifecycleResult result1(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <LifecycleConfiguration>\n                      <Rule>\n                        <ID>36e24c61-227f-4ea9-aee2-bc5af12dbc90</ID>\n                        <Prefix>prefix1</Prefix>\n                        <Status>Disabled</Status>\n                        <Transition>\n                        </Transition>\n                        <Transition>\n                          <Days>180</Days>\n                          <StorageClass>Archive</StorageClass>\n                        </Transition>\n                        <Expiration>\n                        </Expiration>\n                        <AbortMultipartUpload>\n                        </AbortMultipartUpload>\n                      </Rule>\n                    </LifecycleConfiguration>)\";\n    GetBucketLifecycleResult result2(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <LifecycleConfiguration>\n                      <Rule>\n                          <Days>180</Days>\n                          <StorageClass>Archive</StorageClass>\n                          <Days>240</Days>\n                          <Days>30</Days>\n                      </Rule>\n                    </LifecycleConfiguration>)\";\n    GetBucketLifecycleResult result3(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <LifecycleConfiguration>\n                    <Rule>\n                        <ID></ID>\n                        <Prefix></Prefix>\n                        <Status></Status>\n                        <Transition>\n                        <CreatedBeforeDate></CreatedBeforeDate>\n                        <StorageClass></StorageClass>\n                        </Transition>\n                        <Expiration>\n                        <CreatedBeforeDate></CreatedBeforeDate>\n                          <Days></Days>\n                        </Expiration>\n                        <AbortMultipartUpload>\n                        <CreatedBeforeDate></CreatedBeforeDate>\n                        </AbortMultipartUpload>\n                        <Tag>\n                        </Tag>\n                        </Rule>\n                    </LifecycleConfiguration>)\";\n    GetBucketLifecycleResult result4(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <LifecycleConfiguration>\n                    <Rule>\n                        <ID></ID>\n                        <Prefix></Prefix>\n                        <Status></Status>\n                        <Transition>\n                          <Days></Days>\n                        <CreatedBeforeDate></CreatedBeforeDate>\n                        <StorageClass></StorageClass>\n                        </Transition>\n                        <Expiration>\n                        <CreatedBeforeDate></CreatedBeforeDate>\n                        </Expiration>\n                        <AbortMultipartUpload>\n                          <Days></Days>\n                        <CreatedBeforeDate></CreatedBeforeDate>\n                        </AbortMultipartUpload>\n                        <Tag>\n                          <Key></Key>\n                          <Value></Value>\n                        </Tag>\n                        </Rule>\n                    </LifecycleConfiguration>)\";\n    GetBucketLifecycleResult result5(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    GetBucketLifecycleResult result6(xml);\n}\n\nTEST_F(BucketLifecycleSettingsTest, GetBucketLifecycleResultWithVersioningTest)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <LifecycleConfiguration>\n                      <Rule>\n                        <ID>36e24c61-227f-4ea9-aee2-bc5af12dbc90</ID>\n                        <Prefix>prefix1</Prefix>\n                        <Status>Disabled</Status>\n                        <Transition>\n                          <Days>60</Days>\n                          <StorageClass>IA</StorageClass>\n                        </Transition>\n                        <Transition>\n                          <Days>180</Days>\n                          <StorageClass>Archive</StorageClass>\n                        </Transition>\n                        <Expiration>\n                          <Days>240</Days>\n                        </Expiration>\n                        <AbortMultipartUpload>\n                          <Days>30</Days>\n                        </AbortMultipartUpload>\n                      </Rule>\n                      <Rule>\n                        <ID>6a7f02d9-97f0-4a58-8a55-f3fe604e2cd5</ID>\n                        <Prefix>prefix2</Prefix>\n                        <Status>Disabled</Status>\n                        <Transition>\n                          <CreatedBeforeDate>2018-05-05T00:00:00.000Z</CreatedBeforeDate>\n                          <StorageClass>IA</StorageClass>\n                        </Transition>\n                        <Transition>\n                          <CreatedBeforeDate>2018-08-05T00:00:00.000Z</CreatedBeforeDate>\n                          <StorageClass>Archive</StorageClass>\n                        </Transition>\n                        <Expiration>\n                          <CreatedBeforeDate>2018-10-05T00:00:00.000Z</CreatedBeforeDate>\n                        </Expiration>\n                        <AbortMultipartUpload>\n                          <CreatedBeforeDate>2018-11-05T00:00:00.000Z</CreatedBeforeDate>\n                        </AbortMultipartUpload>\n                      </Rule>\n                      <Rule>\n                        <ID>delete example</ID>\n                        <Prefix>logs/</Prefix>\n                        <Status>Enabled</Status>\n                        <Expiration>\n                          <ExpiredObjectDeleteMarker>true</ExpiredObjectDeleteMarker>\n                        </Expiration>\n                        <NoncurrentVersionExpiration>\n                          <NoncurrentDays>5</NoncurrentDays>\n                        </NoncurrentVersionExpiration>\n                        <AbortMultipartUpload>\n                          <Days>1</Days>\n                        </AbortMultipartUpload>\n                      </Rule>\n                      <Rule>\n                        <ID>transit example</ID>\n                        <Prefix>data/</Prefix>\n                        <Status>Enabled</Status>\n                        <Transition>\n                          <Days>30</Days>\n                          <StorageClass>IA</StorageClass>\n                        </Transition>\n                        <Transition>\n                          <Days>130</Days>\n                          <StorageClass>Archive</StorageClass>\n                        </Transition>\n                        <NoncurrentVersionTransition>\n                          <NoncurrentDays>10</NoncurrentDays>\n                          <StorageClass>IA</StorageClass>\n                        </NoncurrentVersionTransition>\n                        <NoncurrentVersionTransition>\n                          <NoncurrentDays>20</NoncurrentDays>\n                          <StorageClass>Archive</StorageClass>\n                        </NoncurrentVersionTransition>\n                      </Rule>\n                    </LifecycleConfiguration>)\";\n    GetBucketLifecycleResult result(xml);\n    EXPECT_EQ(result.LifecycleRules().size(), 4UL);\n    //rule 36e24c61-227f-4ea9-aee2-bc5af12dbc90\n    EXPECT_EQ(result.LifecycleRules().begin()->ID(), \"36e24c61-227f-4ea9-aee2-bc5af12dbc90\");\n    EXPECT_EQ(result.LifecycleRules().begin()->Prefix(), \"prefix1\");\n    EXPECT_EQ(result.LifecycleRules().begin()->Status(), RuleStatus::Disabled);\n    EXPECT_EQ(result.LifecycleRules().begin()->TransitionList().size(), 2UL);\n    EXPECT_EQ(result.LifecycleRules().begin()->TransitionList().begin()->StorageClass(), StorageClass::IA);\n    EXPECT_EQ(result.LifecycleRules().begin()->TransitionList().begin()->Expiration().Days(), 60U);\n    EXPECT_EQ(result.LifecycleRules().begin()->Expiration().Days(), 240U);\n    EXPECT_EQ(result.LifecycleRules().begin()->ExpiredObjectDeleteMarker(), false);\n    EXPECT_EQ(result.LifecycleRules().begin()->AbortMultipartUpload().Days(), 30U);\n\n    //rule delete example\n    EXPECT_EQ(result.LifecycleRules().at(2).ID(), \"delete example\");\n    EXPECT_EQ(result.LifecycleRules().at(2).Prefix(), \"logs/\");\n    EXPECT_EQ(result.LifecycleRules().at(2).Status(), RuleStatus::Enabled);\n    EXPECT_EQ(result.LifecycleRules().at(2).TransitionList().size(), 0UL);\n    EXPECT_EQ(result.LifecycleRules().at(2).Expiration().Days(), 0U);\n    EXPECT_EQ(result.LifecycleRules().at(2).ExpiredObjectDeleteMarker(), true);\n    EXPECT_EQ(result.LifecycleRules().at(2).NoncurrentVersionExpiration().Days(), 5U);\n    EXPECT_EQ(result.LifecycleRules().at(2).AbortMultipartUpload().Days(), 1U);\n    EXPECT_EQ(result.LifecycleRules().at(2).hasAbortMultipartUpload(), true);\n    EXPECT_EQ(result.LifecycleRules().at(2).hasTransitionList(), false);\n    EXPECT_EQ(result.LifecycleRules().at(2).hasNoncurrentVersionTransitionList(), false);\n\n    //rule transit example\n    EXPECT_EQ(result.LifecycleRules().at(3).ID(), \"transit example\");\n    EXPECT_EQ(result.LifecycleRules().at(3).Prefix(), \"data/\");\n    EXPECT_EQ(result.LifecycleRules().at(3).Status(), RuleStatus::Enabled);\n    EXPECT_EQ(result.LifecycleRules().at(3).TransitionList().size(), 2UL);\n    EXPECT_EQ(result.LifecycleRules().at(3).TransitionList().at(0).StorageClass(), StorageClass::IA);\n    EXPECT_EQ(result.LifecycleRules().at(3).TransitionList().at(0).Expiration().Days(), 30U);\n    EXPECT_EQ(result.LifecycleRules().at(3).TransitionList().at(1).StorageClass(), StorageClass::Archive);\n    EXPECT_EQ(result.LifecycleRules().at(3).TransitionList().at(1).Expiration().Days(), 130U);\n    EXPECT_EQ(result.LifecycleRules().at(3).NoncurrentVersionTransitionList().size(), 2U);\n    EXPECT_EQ(result.LifecycleRules().at(3).NoncurrentVersionTransitionList().at(0).StorageClass(), StorageClass::IA);\n    EXPECT_EQ(result.LifecycleRules().at(3).NoncurrentVersionTransitionList().at(0).Expiration().Days(), 10U);\n    EXPECT_EQ(result.LifecycleRules().at(3).NoncurrentVersionTransitionList().at(1).StorageClass(), StorageClass::Archive);\n    EXPECT_EQ(result.LifecycleRules().at(3).NoncurrentVersionTransitionList().at(1).Expiration().Days(), 20U);\n    EXPECT_EQ(result.LifecycleRules().at(3).hasAbortMultipartUpload(), false);\n    EXPECT_EQ(result.LifecycleRules().at(3).hasExpiration(), false);\n\n    xml = R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <LifecycleConfiguration>\n            <Rule>\n                <ID>delete example</ID>\n                <Prefix>logs/</Prefix>\n                <Status>Enabled</Status>\n                <Expiration>\n                    <ExpiredObjectDeleteMarker></ExpiredObjectDeleteMarker>\n                </Expiration>\n                <NoncurrentVersionExpiration>\n                    <NoncurrentDays></NoncurrentDays>\n                </NoncurrentVersionExpiration>\n            </Rule>\n            <Rule>\n            <ID>transit example</ID>\n            <Prefix>data/</Prefix>\n            <Status>Enabled</Status>\n            <Transition>\n                <Days>30</Days>\n                <StorageClass>IA</StorageClass>\n            </Transition>\n            <Transition>\n                <Days>130</Days>\n                <StorageClass>Archive</StorageClass>\n            </Transition>\n            <NoncurrentVersionTransition>\n                <NoncurrentDays></NoncurrentDays>\n                <StorageClass></StorageClass>\n            </NoncurrentVersionTransition>\n            <NoncurrentVersionTransition>\n                <NoncurrentDays></NoncurrentDays>\n                <StorageClass></StorageClass>\n            </NoncurrentVersionTransition>\n            </Rule>\n        </LifecycleConfiguration>)\";\n    result = GetBucketLifecycleResult(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <LifecycleConfiguration>\n            <Rule>\n                <ID>delete example</ID>\n                <Prefix>logs/</Prefix>\n                <Status>Enabled</Status>\n                <Expiration>\n                </Expiration>\n                <NoncurrentVersionExpiration>\n                </NoncurrentVersionExpiration>\n            </Rule>\n            <Rule>\n            <ID>transit example</ID>\n            <Prefix>data/</Prefix>\n            <Status>Enabled</Status>\n            <Transition>\n                <Days>30</Days>\n                <StorageClass>IA</StorageClass>\n            </Transition>\n            <Transition>\n                <Days>130</Days>\n                <StorageClass>Archive</StorageClass>\n            </Transition>\n            <NoncurrentVersionTransition>\n            </NoncurrentVersionTransition>\n            <NoncurrentVersionTransition>\n            </NoncurrentVersionTransition>\n            </Rule>\n        </LifecycleConfiguration>)\";\n    result = GetBucketLifecycleResult(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <LifecycleConfiguration>\n            <Rule>\n            </Rule>\n            <Rule>\n            </Rule>\n        </LifecycleConfiguration>)\";\n    result = GetBucketLifecycleResult(xml);\n}\n\nTEST_F(BucketLifecycleSettingsTest, LifecycleRuleWithVersioningTest)\n{\n    auto rule1 = LifecycleRule();\n    auto rule2 = LifecycleRule();\n    EXPECT_EQ(rule1 == rule2, true);\n\n    //ExpiredObjectDeleteMarker\n    rule1 = LifecycleRule();\n    rule1.setExpiredObjectDeleteMarker(true);\n    rule2 = LifecycleRule();\n    rule2.setExpiredObjectDeleteMarker(true);\n    EXPECT_EQ(rule1 == rule2, true);\n\n    rule1 = LifecycleRule();\n    rule2 = LifecycleRule();\n    rule2.setExpiredObjectDeleteMarker(true);\n    EXPECT_EQ(rule1 == rule2, false);\n\n    //NoncurrentVersionExpiration\n    rule1 = LifecycleRule();\n    rule1.setNoncurrentVersionExpiration(LifeCycleExpiration(30U));\n    rule2 = LifecycleRule();\n    rule2.setNoncurrentVersionExpiration(LifeCycleExpiration(30U));\n    EXPECT_EQ(rule1 == rule2, true);\n\n    rule1 = LifecycleRule();\n    rule1.setNoncurrentVersionExpiration(LifeCycleExpiration(10U));\n    rule2 = LifecycleRule();\n    rule2.setNoncurrentVersionExpiration(LifeCycleExpiration(30U));\n    EXPECT_EQ(rule1 == rule2, false);\n\n    rule1 = LifecycleRule();\n    rule2 = LifecycleRule();\n    rule2.setNoncurrentVersionExpiration(LifeCycleExpiration(30U));\n    EXPECT_EQ(rule1 == rule2, false);\n\n    //NoncurrentVersionTransition\n    rule1 = LifecycleRule();\n    rule1.addNoncurrentVersionTransition(LifeCycleTransition(LifeCycleExpiration(10U), StorageClass::IA));\n    rule2 = LifecycleRule();\n    rule2.addNoncurrentVersionTransition(LifeCycleTransition(LifeCycleExpiration(10U), StorageClass::IA));\n    EXPECT_EQ(rule1 == rule2, true);\n\n    rule1 = LifecycleRule();\n    rule2 = LifecycleRule();\n    rule2.addNoncurrentVersionTransition(LifeCycleTransition(LifeCycleExpiration(10U), StorageClass::IA));\n    EXPECT_EQ(rule1 == rule2, false);\n\n    rule1 = LifecycleRule();\n    rule1.addNoncurrentVersionTransition(LifeCycleTransition(LifeCycleExpiration(20U), StorageClass::IA));\n    rule2 = LifecycleRule();\n    rule2.addNoncurrentVersionTransition(LifeCycleTransition(LifeCycleExpiration(10U), StorageClass::IA));\n    EXPECT_EQ(rule1 == rule2, false);\n\n    rule1 = LifecycleRule();\n    rule1.addNoncurrentVersionTransition(LifeCycleTransition(LifeCycleExpiration(20U), StorageClass::IA));\n    rule2 = LifecycleRule();\n    rule2.addNoncurrentVersionTransition(LifeCycleTransition(LifeCycleExpiration(20U), StorageClass::Archive));\n    EXPECT_EQ(rule1 == rule2, false);\n\n    rule1 = LifecycleRule();\n    rule1.addNoncurrentVersionTransition(LifeCycleTransition(LifeCycleExpiration(\"2018-05-05T00:00:00.000Z\"), StorageClass::IA));\n    rule2 = LifecycleRule();\n    rule2.addNoncurrentVersionTransition(LifeCycleTransition(LifeCycleExpiration(\"2018-05-06T00:00:00.000Z\"), StorageClass::IA));\n    EXPECT_EQ(rule1 == rule2, false);\n\n    //LifecycleRule() get & set test\n    auto rule = LifecycleRule();\n    LifeCycleExpiration expiration;\n    expiration.setDays(30U);\n    rule.setNoncurrentVersionExpiration(expiration);\n    EXPECT_EQ(rule.NoncurrentVersionExpiration().Days(), expiration.Days());\n    EXPECT_EQ(rule.NoncurrentVersionExpiration().CreatedBeforeDate(), expiration.CreatedBeforeDate());\n\n    rule.addNoncurrentVersionTransition(LifeCycleTransition(LifeCycleExpiration(20U), StorageClass::IA));\n    rule.addNoncurrentVersionTransition(LifeCycleTransition(LifeCycleExpiration(200U), StorageClass::Archive));\n\n    EXPECT_EQ(rule.hasNoncurrentVersionTransitionList(), true);\n    EXPECT_EQ(rule.NoncurrentVersionTransitionList().size(), 2UL);\n    EXPECT_EQ(rule.NoncurrentVersionTransitionList().at(0).StorageClass(), StorageClass::IA);\n    EXPECT_EQ(rule.NoncurrentVersionTransitionList().at(1).StorageClass(), StorageClass::Archive);\n}\n\nTEST_F(BucketLifecycleSettingsTest, SetAndGetLifecycleRuleWithVersioningTest)\n{\n    auto bucketName = BucketName;\n    bucketName.append(\"-lc-version\");\n\n    auto client = TestUtils::GetOssClientDefault();\n\n    auto cOutcome = client->CreateBucket(bucketName);\n    EXPECT_EQ(cOutcome.isSuccess(), true);\n\n    auto bsOutcome = client->SetBucketVersioning(SetBucketVersioningRequest(bucketName, VersioningStatus::Enabled));\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\n\n    auto bfOutcome = client->GetBucketInfo(bucketName);\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\n\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\n        return;\n\n    SetBucketLifecycleRequest request(bucketName);\n\n    //rule 1\n    auto rule1 = LifecycleRule();\n    rule1.setID(\"StandardExpireRule-101\");\n    rule1.setPrefix(\"standard/\");\n    rule1.setStatus(RuleStatus::Enabled);\n    rule1.Expiration().setDays(400);\n    rule1.AbortMultipartUpload().setCreatedBeforeDate(TestUtils::GetUTCString(400, true));\n\n    auto transition = LifeCycleTransition();\n    transition.Expiration().setDays(180);\n    transition.setStorageClass(StorageClass::IA);\n    rule1.addTransition(transition);\n\n    transition.Expiration().setDays(365);\n    transition.setStorageClass(StorageClass::Archive);\n    rule1.addTransition(transition);\n\n    request.addLifecycleRule(rule1);\n\n    //rule 2\n    auto rule2 = LifecycleRule();\n    rule2.setID(\"transit example\");\n    rule2.setPrefix(\"test\");\n    rule2.setStatus(RuleStatus::Enabled);\n    rule2.Expiration().setDays(100);\n    rule2.AbortMultipartUpload().setCreatedBeforeDate(TestUtils::GetUTCString(400, true));\n\n    transition = LifeCycleTransition();\n    transition.Expiration().setDays(180);\n    transition.setStorageClass(StorageClass::IA);\n    rule2.addNoncurrentVersionTransition(transition);\n\n    transition.Expiration().setDays(365);\n    transition.setStorageClass(StorageClass::Archive);\n    rule2.addNoncurrentVersionTransition(transition);\n\n    request.addLifecycleRule(rule2);\n\n    //rule 3\n    auto rule3 = LifecycleRule();\n    rule3.setID(\"delete example\");\n    rule3.setPrefix(\"log/\");\n    rule3.setStatus(RuleStatus::Enabled);\n    rule3.setExpiredObjectDeleteMarker(true);\n    rule3.AbortMultipartUpload().setCreatedBeforeDate(TestUtils::GetUTCString(300, true));\n\n    rule3.NoncurrentVersionExpiration().setDays(200U);\n    request.addLifecycleRule(rule3);\n\n\n    auto sOutcome = client->SetBucketLifecycle(request);\n    EXPECT_EQ(sOutcome.isSuccess(), true);\n\n    TestUtils::WaitForCacheExpire(5);\n\n    auto gOutcome = client->GetBucketLifecycle(bucketName);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().LifecycleRules().size(), 3UL);\n    EXPECT_EQ(gOutcome.result().LifecycleRules().at(0), rule1);\n    EXPECT_EQ(gOutcome.result().LifecycleRules().at(1), rule2);\n    EXPECT_EQ(gOutcome.result().LifecycleRules().at(2), rule3);\n\n    auto dOutcome = client->DeleteBucketLifecycle(bucketName);\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n\n    //Only ExpiredObjectDeleteMarker\n    auto rule4 = LifecycleRule();\n    rule4.setID(\"only delete marker\");\n    rule4.setPrefix(\"log/\");\n    rule4.setStatus(RuleStatus::Enabled);\n    rule4.setExpiredObjectDeleteMarker(true);\n\n    request.clearLifecycleRules();\n    request.addLifecycleRule(rule4);\n    sOutcome = client->SetBucketLifecycle(request);\n    EXPECT_EQ(sOutcome.isSuccess(), true);\n\n    TestUtils::WaitForCacheExpire(5);\n    gOutcome = client->GetBucketLifecycle(bucketName);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().LifecycleRules().size(), 1UL);\n    EXPECT_EQ(gOutcome.result().LifecycleRules().at(0), rule4);\n\n    //Only NoncurrentVersionTransition\n    auto rule5 = LifecycleRule();\n    rule5.setID(\"only transit\");\n    rule5.setPrefix(\"test\");\n    rule5.setStatus(RuleStatus::Enabled);\n\n    transition = LifeCycleTransition();\n    transition.Expiration().setDays(180);\n    transition.setStorageClass(StorageClass::IA);\n    rule5.addNoncurrentVersionTransition(transition);\n    transition.Expiration().setDays(365);\n    transition.setStorageClass(StorageClass::Archive);\n    rule5.addNoncurrentVersionTransition(transition);\n\n    request.clearLifecycleRules();\n    request.addLifecycleRule(rule5);\n    sOutcome = client->SetBucketLifecycle(request);\n    EXPECT_EQ(sOutcome.isSuccess(), true);\n\n    TestUtils::WaitForCacheExpire(5);\n    gOutcome = client->GetBucketLifecycle(bucketName);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().LifecycleRules().size(), 1UL);\n    EXPECT_EQ(gOutcome.result().LifecycleRules().at(0), rule5);\n\n    //Only NoncurrentVersionExpiration\n    auto rule6 = LifecycleRule();\n    rule6.setID(\"only expiration\");\n    rule6.setPrefix(\"log/\");\n    rule6.setStatus(RuleStatus::Enabled);\n    rule6.setNoncurrentVersionExpiration(LifeCycleExpiration(30U));\n\n    request.clearLifecycleRules();\n    request.addLifecycleRule(rule6);\n    sOutcome = client->SetBucketLifecycle(request);\n    EXPECT_EQ(sOutcome.isSuccess(), true);\n\n    TestUtils::WaitForCacheExpire(5);\n    gOutcome = client->GetBucketLifecycle(bucketName);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().LifecycleRules().size(), 1UL);\n    EXPECT_EQ(gOutcome.result().LifecycleRules().at(0), rule6);\n\n    client->DeleteBucket(bucketName);\n}\n\nTEST_F(BucketLifecycleSettingsTest, GetBucketLifecycleWithInvalidResponseBodyTest)\n{\n    auto rule = LifecycleRule();\n    rule.setID(\"basic-test\");\n    rule.setPrefix(\"test\");\n    rule.setStatus(RuleStatus::Enabled);\n    rule.Expiration().setDays(200);\n    auto sblRequest = SetBucketLifecycleRequest(BucketName);\n    sblRequest.addLifecycleRule(rule);\n    Client->SetBucketLifecycle(sblRequest);\n\n    auto gblfRequest = GetBucketLifecycleRequest(BucketName);\n    gblfRequest.setResponseStreamFactory([=]() {\n        auto content = std::make_shared<std::stringstream>();\n        content->write(\"invlid data\", 11);\n        return content;\n    });\n    auto gblfOutcome = Client->GetBucketLifecycle(gblfRequest);\n    EXPECT_EQ(gblfOutcome.isSuccess(), false);\n    EXPECT_EQ(gblfOutcome.error().Code(), \"ParseXMLError\");\n}\n\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketLoggingSettingsTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass BucketLoggingSettingsTest : public ::testing::Test {\nprotected:\n    BucketLoggingSettingsTest()\n    {\n    }\n\n    ~BucketLoggingSettingsTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase() \n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketloggingsettings\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase() \n    {\n        Client->DeleteBucket(DeleteBucketRequest(BucketName));\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> BucketLoggingSettingsTest::Client = nullptr;\nstd::string BucketLoggingSettingsTest::BucketName = \"\";\n\n\nTEST_F(BucketLoggingSettingsTest, InvalidBucketNameTest)\n{\n    for (auto const& invalidBucketName : TestUtils::InvalidBucketNamesList()) {\n        auto outcome = Client->SetBucketLogging(invalidBucketName, \"bucket\", \"LogPrefix\");\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n    }\n}\n\nTEST_F(BucketLoggingSettingsTest, GetBucketNotSetLoggingTest)\n{\n    auto dOutcome = Client->DeleteBucketLogging(DeleteBucketLoggingRequest(BucketName));\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n\n    auto gOutcome = Client->GetBucketLogging(GetBucketLoggingRequest(BucketName));\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().TargetBucket().empty(), true);\n    EXPECT_EQ(gOutcome.result().TargetPrefix().empty(), true);\n}\n\nTEST_F(BucketLoggingSettingsTest, GetBucketLoggingNegativeTest)\n{\n    auto bucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketloggingsettings\");\n    auto outcome = Client->GetBucketLogging(bucketName);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\n}\n\nTEST_F(BucketLoggingSettingsTest, DeleteBucketLoggingNegativeTest)\n{\n    auto bucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketloggingsettings\");\n    auto outcome = Client->DeleteBucketLogging(bucketName);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\n}\n\n\nTEST_F(BucketLoggingSettingsTest, EnableLoggingTest)\n{\n    auto sOutcome = Client->SetBucketLogging(SetBucketLoggingRequest(BucketName, BucketName, \"LoggingTest\"));\n    EXPECT_EQ(sOutcome.isSuccess(), true);\n\n    TestUtils::WaitForCacheExpire(5);\n    auto gOutcome = Client->GetBucketLogging(GetBucketLoggingRequest(BucketName));\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().TargetPrefix(), \"LoggingTest\");\n\n    auto dOutcome = Client->DeleteBucketLogging(DeleteBucketLoggingRequest(BucketName));\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n    gOutcome = Client->GetBucketLogging(GetBucketLoggingRequest(BucketName));\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().TargetBucket().empty(), true);\n    EXPECT_EQ(gOutcome.result().TargetPrefix().empty(), true);\n\n}\n\nTEST_F(BucketLoggingSettingsTest, EnableLoggingInvalidTargetBucketNameTest)\n{\n    for (auto invalidBucketName : TestUtils::InvalidBucketNamesList())\n    {\n        auto outcome = Client->SetBucketLogging(SetBucketLoggingRequest(BucketName, invalidBucketName, \"LogPrefix\"));\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n    }\n}\n\nTEST_F(BucketLoggingSettingsTest, EnableLoggingNonExistTargetBucketNameTest)\n{\n    auto targetBucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketloggingsettings\");\n    EXPECT_EQ(TestUtils::BucketExists(*Client, targetBucketName), false);\n\n    auto outcome = Client->SetBucketLogging(SetBucketLoggingRequest(BucketName, targetBucketName, \"LogPrefix\"));\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"InvalidTargetBucketForLogging\");\n}\n\nTEST_F(BucketLoggingSettingsTest, EnableLoggingInvalidPrefixNameTest)\n{\n    for (auto const &invalidPrefix : TestUtils::InvalidLoggingPrefixNamesList()) {\n        auto outcome = Client->SetBucketLogging(SetBucketLoggingRequest(BucketName, BucketName, invalidPrefix));\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n    }\n}\n\nTEST_F(BucketLoggingSettingsTest, EnableLoggingWithEmtpyPrefixNameTest)\n{\n    auto outcome = Client->SetBucketLogging(SetBucketLoggingRequest(BucketName, BucketName, \"\"));\n    std::cout << \"SetBucketLogging, requestid:\" << outcome.result().RequestId() << std::endl;\n    TestUtils::WaitForCacheExpire(5);\n    auto blOutcome = Client->GetBucketLogging(BucketName);\n    int i = 0;\n    while (blOutcome.result().TargetBucket() != BucketName) {\n        std::cout << \"GetBucketLogging, cnt:\" << i++ << \", requestid:\" << blOutcome.result().RequestId() << std::endl;\n        TestUtils::WaitForCacheExpire(5);\n        blOutcome = Client->GetBucketLogging(BucketName);\n    }\n    EXPECT_EQ(blOutcome.isSuccess(), true);\n    EXPECT_STREQ(blOutcome.result().TargetBucket().c_str(), BucketName.c_str());\n    EXPECT_STREQ(blOutcome.result().TargetPrefix().c_str(), \"\");\n}\n\nTEST_F(BucketLoggingSettingsTest, BucketLoggingWithInvalidResponseBodyTest)\n{\n    auto gblRequest = GetBucketLoggingRequest(BucketName);\n    gblRequest.setResponseStreamFactory([=]() {\n        auto content = std::make_shared<std::stringstream>();\n        content->write(\"invlid data\", 11);\n        return content;\n    });\n    auto gblOutcome = Client->GetBucketLogging(gblRequest);\n    EXPECT_EQ(gblOutcome.isSuccess(), false);\n    EXPECT_EQ(gblOutcome.error().Code(), \"ParseXMLError\");\n}\n\nTEST_F(BucketLoggingSettingsTest, GetBucketLoggingResult)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <BucketLoggingStatus xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\n                            <LoggingEnabled>\n                                <TargetBucket>mybucketlogs</TargetBucket>\n                                <TargetPrefix>mybucket-access_log/</TargetPrefix>\n                            </LoggingEnabled>\n                        </BucketLoggingStatus>)\";\n    GetBucketLoggingResult result(xml);\n    EXPECT_EQ(result.TargetBucket(), \"mybucketlogs\");\n    EXPECT_EQ(result.TargetPrefix(), \"mybucket-access_log/\");\n}\n\nTEST_F(BucketLoggingSettingsTest, SetBucketLoggingRequestConstructionFunctiontest)\n{ \n    SetBucketLoggingRequest request(\"test\");\n}\n\nTEST_F(BucketLoggingSettingsTest, GetBucketLoggingResultBranchtest)\n{\n    GetBucketLoggingResult result(\"test\");\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <BucketLogging xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\n                            <LoggingEnabled>\n                                <TargetBucket>mybucketlogs</TargetBucket>\n                                <TargetPrefix>mybucket-access_log/</TargetPrefix>\n                            </LoggingEnabled>\n                        </BucketLogging>)\";\n    GetBucketLoggingResult result1(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <BucketLoggingStatus xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\n                            <LoggingEnabled>\n                            </LoggingEnabled>\n                        </BucketLoggingStatus>)\";\n    GetBucketLoggingResult result2(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <BucketLoggingStatus xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\n                                <TargetBucket>mybucketlogs</TargetBucket>\n                                <TargetPrefix>mybucket-access_log/</TargetPrefix>\n                        </BucketLoggingStatus>)\";\n    GetBucketLoggingResult result3(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    GetBucketLoggingResult result4(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <BucketLogging xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\n                            <LoggingEnabled>\n                                <TargetBucket></TargetBucket>\n                                <TargetPrefix></TargetPrefix>\n                            </LoggingEnabled>\n                        </BucketLogging>)\";\n    GetBucketLoggingResult result5(xml);\n}\n\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketPolicySettingsTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass BucketPolicySettingsTest : public ::testing::Test {\nprotected:\n\tBucketPolicySettingsTest()\n    {\n    }\n\n    ~BucketPolicySettingsTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase() \n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketpolicysettings\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase() \n    {\n        Client->DeleteBucket(DeleteBucketRequest(BucketName));\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\nstd::shared_ptr<OssClient> BucketPolicySettingsTest::Client = nullptr;\nstd::string BucketPolicySettingsTest::BucketName = \"\";\n\nTEST_F(BucketPolicySettingsTest, InvalidBucketNameTest)\n{\n    std::string policy = \"invalidpolicy\";\n    for (auto const& invalidBucketName : TestUtils::InvalidBucketNamesList()) {\n        SetBucketPolicyRequest  request(invalidBucketName);\n        request.setPolicy(policy);\n        auto outcome = Client->SetBucketPolicy(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n    }\n}\n\nTEST_F(BucketPolicySettingsTest, SetBucketPolicyInvalidInputTest)\n{\n    SetBucketPolicyRequest request(BucketName);\n    request.setPolicy(\"policy\");\n    auto outcome = Client->SetBucketPolicy(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"InvalidPolicyDocument\");\n    EXPECT_EQ(outcome.error().Message(), \"unknown char p\");\n}\n\nTEST_F(BucketPolicySettingsTest, SetBucketPolicyTest)\n{\n    SetBucketPolicyRequest request(BucketName);\n    std::string policy = \"{\\\"Version\\\":\\\"1\\\",\\\"Statement\\\":[{\\\"Action\\\":[\\\"oss:PutObject\\\",\\\"oss:GetObject\\\"],\\\"Resource\\\": \\\"acs:oss:*:*:*\\\",\\\"Effect\\\": \\\"Deny\\\"}]}\\n\";\n    request.setPolicy(policy);\n    auto outcome = Client->SetBucketPolicy(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    GetBucketPolicyRequest request1(BucketName);\n    auto outcome1 = Client->GetBucketPolicy(request1);\n    EXPECT_EQ(outcome1.isSuccess(), true);\n    EXPECT_EQ(outcome1.result().Policy(), policy);\n    DeleteBucketPolicyRequest request2(BucketName);\n    auto outcome2 = Client->DeleteBucketPolicy(request2);\n    EXPECT_EQ(outcome2.isSuccess(), true);\n}\n\nTEST_F(BucketPolicySettingsTest, GetBucketPolicyResult)\n{\n    std::string policy = \"policy\";\n    GetBucketPolicyResult result(policy);\n    EXPECT_EQ(result.Policy(), \"policy\");\n}\n\nTEST_F(BucketPolicySettingsTest, DeleteBucketPolicyInvalidValidateTest)\n{\n    auto deloutcome = Client->DeleteBucketPolicy(DeleteBucketPolicyRequest(\"Invalid-bucket-test\"));\n\n    EXPECT_EQ(deloutcome.isSuccess(), false);\n    EXPECT_EQ(deloutcome.error().Code(), \"ValidateError\");\n}\n\nTEST_F(BucketPolicySettingsTest, GetBucketPolicyInvalidValidateTest)\n{\n    auto getoutcome = Client->GetBucketPolicy(GetBucketPolicyRequest(\"Invalid-bucket-test\"));\n\n    EXPECT_EQ(getoutcome.isSuccess(), false);\n    EXPECT_EQ(getoutcome.error().Code(), \"ValidateError\");\n}\n\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketQosInfoTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud \n{\nnamespace OSS \n{\n    class BucketQosInfoTest : public ::testing::Test {\n    protected:\n        BucketQosInfoTest()\n        {\n        }\n\n        ~BucketQosInfoTest() override\n        {\n        }\n\n        // Sets up the stuff shared by all tests in this test case.\n        static void SetUpTestCase()\n        {\n            Client = TestUtils::GetOssClientDefault();\n            BucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketqosinfo\");\n            Client->CreateBucket(CreateBucketRequest(BucketName));\n        }\n\n        // Tears down the stuff shared by all tests in this test case.\n        static void TearDownTestCase()\n        {\n            Client->DeleteBucket(DeleteBucketRequest(BucketName));\n            Client = nullptr;\n        }\n\n        // Sets up the test fixture.\n        void SetUp() override\n        {\n        }\n\n        // Tears down the test fixture.\n        void TearDown() override\n        {\n        }\n    public:\n        static std::shared_ptr<OssClient> Client;\n        static std::string BucketName;\n    };\n\n    std::shared_ptr<OssClient> BucketQosInfoTest::Client = nullptr;\n    std::string BucketQosInfoTest::BucketName = \"\";\n\n    TEST_F(BucketQosInfoTest, SetAndDeleteBucketQosInfoTest)\n    {\n        QosConfiguration qos;\n        qos.setTotalUploadBandwidth(10);\n        qos.setExtranetUploadBandwidth(-1);\n        qos.setIntranetUploadBandwidth(-1);\n        qos.setTotalDownloadBandwidth(10);\n        qos.setExtranetDownloadBandwidth(-1);\n        qos.setIntranetDownloadBandwidth(-1);\n        qos.setTotalQps(1000);\n        qos.setExtranetQps(-1);\n        qos.setIntranetQps(-1);\n        SetBucketQosInfoRequest setrequest(BucketName, qos);\n\n        auto setoutcome = Client->SetBucketQosInfo(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), true);\n\n        DeleteBucketQosInfoRequest delrequest(BucketName);\n        auto deloutcome = Client->DeleteBucketQosInfo(delrequest);\n        EXPECT_EQ(deloutcome.isSuccess(), true);\n    }\n\n    TEST_F(BucketQosInfoTest, GetBucketQosInfoTest)\n    {\n        QosConfiguration qos;\n        qos.setTotalUploadBandwidth(10);\n        qos.setExtranetUploadBandwidth(-1);\n        qos.setIntranetUploadBandwidth(-1);\n        qos.setTotalDownloadBandwidth(10);\n        qos.setExtranetDownloadBandwidth(-1);\n        qos.setIntranetDownloadBandwidth(-1);\n        qos.setTotalQps(1000);\n        qos.setExtranetQps(-1);\n        qos.setIntranetQps(-1);\n        SetBucketQosInfoRequest setrequest(BucketName, qos);\n\n        auto setoutcome = Client->SetBucketQosInfo(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), true);\n\n        GetBucketQosInfoRequest getrequest(BucketName);\n        auto getoutcome = Client->GetBucketQosInfo(getrequest);\n        EXPECT_EQ(getoutcome.isSuccess(), true);       \n        EXPECT_EQ(getoutcome.result().QosInfo().TotalUploadBandwidth(), 10);\n        EXPECT_EQ(getoutcome.result().QosInfo().ExtranetUploadBandwidth(), -1);\n        EXPECT_EQ(getoutcome.result().QosInfo().IntranetUploadBandwidth(), -1);\n        EXPECT_EQ(getoutcome.result().QosInfo().TotalDownloadBandwidth(), 10);\n        EXPECT_EQ(getoutcome.result().QosInfo().ExtranetDownloadBandwidth(), -1);\n        EXPECT_EQ(getoutcome.result().QosInfo().IntranetDownloadBandwidth(), -1);\n        EXPECT_EQ(getoutcome.result().QosInfo().TotalQps(), 1000);\n        EXPECT_EQ(getoutcome.result().QosInfo().IntranetQps(), -1);\n        EXPECT_EQ(getoutcome.result().QosInfo().ExtranetQps(), -1);\n\n        GetUserQosInfoRequest getrequest1;\n        auto getoutcome1 = Client->GetUserQosInfo(getrequest1);\n        EXPECT_EQ(getoutcome1.isSuccess(), true);\n\n        DeleteBucketQosInfoRequest delrequest(BucketName);\n        auto deloutcome = Client->DeleteBucketQosInfo(delrequest);\n        EXPECT_EQ(deloutcome.isSuccess(), true);\n    }\n\n    TEST_F(BucketQosInfoTest, GetUserQosInfoTest)\n    {\n        QosConfiguration qos;\n        qos.setTotalUploadBandwidth(10);\n        qos.setExtranetUploadBandwidth(-1);\n        qos.setIntranetUploadBandwidth(-1);\n        qos.setTotalDownloadBandwidth(10);\n        qos.setExtranetDownloadBandwidth(-1);\n        qos.setIntranetDownloadBandwidth(-1);\n        qos.setTotalQps(1000);\n        qos.setExtranetQps(-1);\n        qos.setIntranetQps(-1);\n        SetBucketQosInfoRequest setrequest(BucketName, qos);\n\n        auto setoutcome = Client->SetBucketQosInfo(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), true);\n\n        GetUserQosInfoRequest getrequest;\n        auto getoutcome = Client->GetUserQosInfo(getrequest);\n        EXPECT_EQ(getoutcome.isSuccess(), true);\n        EXPECT_EQ(getoutcome.result().QosInfo().TotalUploadBandwidth(), 10);\n        EXPECT_EQ(getoutcome.result().QosInfo().ExtranetUploadBandwidth(), -1);\n        EXPECT_EQ(getoutcome.result().QosInfo().IntranetUploadBandwidth(), -1);\n        EXPECT_EQ(getoutcome.result().QosInfo().TotalDownloadBandwidth(), 10);\n        EXPECT_EQ(getoutcome.result().QosInfo().ExtranetDownloadBandwidth(), -1);\n        EXPECT_EQ(getoutcome.result().QosInfo().IntranetDownloadBandwidth(), -1);\n        //EXPECT_EQ(getoutcome.result().QosInfo().TotalQps(), 1000);\n        EXPECT_EQ(getoutcome.result().QosInfo().IntranetQps(), -1);\n        EXPECT_EQ(getoutcome.result().QosInfo().ExtranetQps(), -1);\n\n        DeleteBucketQosInfoRequest delrequest(BucketName);\n        auto deloutcome = Client->DeleteBucketQosInfo(delrequest);\n        EXPECT_EQ(deloutcome.isSuccess(), true);\n    }\n\n    TEST_F(BucketQosInfoTest, GetUserQosInfoWithInvalidResponseBodyTest)\n    {\n        QosConfiguration qos;\n        qos.setTotalUploadBandwidth(10);\n        qos.setExtranetUploadBandwidth(-1);\n        qos.setIntranetUploadBandwidth(-1);\n        qos.setTotalDownloadBandwidth(10);\n        qos.setExtranetDownloadBandwidth(-1);\n        qos.setIntranetDownloadBandwidth(-1);\n        qos.setTotalQps(1000);\n        qos.setExtranetQps(-1);\n        qos.setIntranetQps(-1);\n        SetBucketQosInfoRequest setrequest(BucketName, qos);\n        Client->SetBucketQosInfo(setrequest);\n\n        auto gbqiRequest = GetBucketQosInfoRequest(BucketName);\n        gbqiRequest.setResponseStreamFactory([=]() {\n            auto content = std::make_shared<std::stringstream>();\n            content->write(\"invlid data\", 11);\n            return content;\n        });\n        auto gbqiOutcome = Client->GetBucketQosInfo(gbqiRequest);\n        EXPECT_EQ(gbqiOutcome.isSuccess(), false);\n        EXPECT_EQ(gbqiOutcome.error().Code(), \"ParseXMLError\");\n\n        auto guqiRequest = GetUserQosInfoRequest();\n        guqiRequest.setResponseStreamFactory([=]() {\n            auto content = std::make_shared<std::stringstream>();\n            content->write(\"invlid data\", 11);\n            return content;\n        });\n        auto guqiOutcome = Client->GetUserQosInfo(guqiRequest);\n        EXPECT_EQ(guqiOutcome.isSuccess(), false);\n        EXPECT_EQ(guqiOutcome.error().Code(), \"ParseXMLError\");\n    }\n\n    TEST_F(BucketQosInfoTest, GetBucketQosInfoResultTest)\n    {\n        std::string xml = R\"(<?xml version=\"1.0\" ?>\n                        <QoSConfiguration>\n                                <TotalUploadBandwidth>10</TotalUploadBandwidth>\n                                <IntranetUploadBandwidth>-1</IntranetUploadBandwidth>\n                                <ExtranetUploadBandwidth>-1</ExtranetUploadBandwidth>\n                                <TotalDownloadBandwidth>10</TotalDownloadBandwidth>\n                                <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth>\n                                <ExtranetDownloadBandwidth>-1</ExtranetDownloadBandwidth>\n                                <TotalQps>1000</TotalQps>\n                                <IntranetQps>-1</IntranetQps>\n                                <ExtranetQps>-1</ExtranetQps>\n                        </QoSConfiguration>)\";\n        GetBucketQosInfoResult result(xml);\n        EXPECT_EQ(result.QosInfo().TotalUploadBandwidth(), 10);\n        EXPECT_EQ(result.QosInfo().ExtranetUploadBandwidth(), -1);\n        EXPECT_EQ(result.QosInfo().IntranetUploadBandwidth(), -1);\n        EXPECT_EQ(result.QosInfo().TotalDownloadBandwidth(), 10);\n        EXPECT_EQ(result.QosInfo().ExtranetDownloadBandwidth(), -1);\n        EXPECT_EQ(result.QosInfo().IntranetDownloadBandwidth(), -1);\n        EXPECT_EQ(result.QosInfo().TotalQps(), 1000);\n        EXPECT_EQ(result.QosInfo().IntranetQps(), -1);\n        EXPECT_EQ(result.QosInfo().ExtranetQps(), -1);\n    }\n\n    TEST_F(BucketQosInfoTest, GetUserQosInfoResultTest)\n    {\n        std::string xml = R\"(<?xml version=\"1.0\" ?>\n                        <QoSConfiguration>\n                                <Region>oss-cn-hangzhou</Region>\n                                <TotalUploadBandwidth>10</TotalUploadBandwidth>\n                                <IntranetUploadBandwidth>-1</IntranetUploadBandwidth>\n                                <ExtranetUploadBandwidth>-1</ExtranetUploadBandwidth>\n                                <TotalDownloadBandwidth>10</TotalDownloadBandwidth>\n                                <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth>\n                                <ExtranetDownloadBandwidth>-1</ExtranetDownloadBandwidth>\n                                <TotalQps>1000</TotalQps>\n                                <IntranetQps>-1</IntranetQps>\n                                <ExtranetQps>-1</ExtranetQps>\n                        </QoSConfiguration>)\";\n        GetUserQosInfoResult result(xml);\n        EXPECT_EQ(result.Region(), \"oss-cn-hangzhou\");\n        EXPECT_EQ(result.QosInfo().TotalUploadBandwidth(), 10);\n        EXPECT_EQ(result.QosInfo().ExtranetUploadBandwidth(), -1);\n        EXPECT_EQ(result.QosInfo().IntranetUploadBandwidth(), -1);\n        EXPECT_EQ(result.QosInfo().TotalDownloadBandwidth(), 10);\n        EXPECT_EQ(result.QosInfo().ExtranetDownloadBandwidth(), -1);\n        EXPECT_EQ(result.QosInfo().IntranetDownloadBandwidth(), -1);\n        EXPECT_EQ(result.QosInfo().TotalQps(), 1000);\n        EXPECT_EQ(result.QosInfo().IntranetQps(), -1);\n        EXPECT_EQ(result.QosInfo().ExtranetQps(), -1);\n    }\n\n    TEST_F(BucketQosInfoTest, GetUserQosInfoResultBranchTest)\n    {\n        GetUserQosInfoResult result(\"test\");\n\n        std::string xml = R\"(<?xml version=\"1.0\" ?>\n                        <QoS>\n                                <Region>oss-cn-hangzhou</Region>\n                                <TotalUploadBandwidth>10</TotalUploadBandwidth>\n                                <IntranetUploadBandwidth>-1</IntranetUploadBandwidth>\n                                <ExtranetUploadBandwidth>-1</ExtranetUploadBandwidth>\n                                <TotalDownloadBandwidth>10</TotalDownloadBandwidth>\n                                <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth>\n                                <ExtranetDownloadBandwidth>-1</ExtranetDownloadBandwidth>\n                                <TotalQps>1000</TotalQps>\n                                <IntranetQps>-1</IntranetQps>\n                                <ExtranetQps>-1</ExtranetQps>\n                        </QoS>)\";\n        GetUserQosInfoResult result1(xml);\n\n       xml = R\"(<?xml version=\"1.0\" ?>\n                        <QoSConfiguration>\n                        </QoSConfiguration>)\";\n        GetUserQosInfoResult result2(xml);\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                        <QoSConfiguration>\n                                <Region></Region>\n                                <TotalUploadBandwidth></TotalUploadBandwidth>\n                                <IntranetUploadBandwidth></IntranetUploadBandwidth>\n                                <ExtranetUploadBandwidth></ExtranetUploadBandwidth>\n                                <TotalDownloadBandwidth></TotalDownloadBandwidth>\n                                <IntranetDownloadBandwidth></IntranetDownloadBandwidth>\n                                <ExtranetDownloadBandwidth></ExtranetDownloadBandwidth>\n                                <TotalQps></TotalQps>\n                                <IntranetQps></IntranetQps>\n                                <ExtranetQps></ExtranetQps>\n                        </QoSConfiguration>)\";\n        GetUserQosInfoResult result3(xml);\n\n        xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n        GetUserQosInfoResult result10(xml);\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                        <QoSConfiguration>\n                                <Region>oss-cn-hangzhou</Region>\n                                <TotalUploadBandwidth>10</TotalUploadBandwidth>\n                                <IntranetUploadBandwidth>-1</IntranetUploadBandwidth>\n                                <ExtranetUploadBandwidth>-1</ExtranetUploadBandwidth>\n                                <TotalDownloadBandwidth>10</TotalDownloadBandwidth>\n                                <IntranetDownloadBandwidth>-1</IntranetDownloadBandwidth>\n                                <ExtranetDownloadBandwidth>-1</ExtranetDownloadBandwidth>\n                                <TotalQps>1000</TotalQps>\n                                <IntranetQps>-1</IntranetQps>\n                                <ExtranetQps>-1</ExtranetQps>\n                        </QoSConfiguration>)\";\n        GetBucketQosInfoResult result4(xml);\n\n        xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n        GetBucketQosInfoResult result5(xml);\n\n        GetBucketQosInfoResult result6(\"test\");\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                        <QoSConfiguration>\n                        </QoSConfiguration>)\";\n        GetBucketQosInfoResult result7(xml);\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                        <QoS>\n                        </QoS>)\";\n        GetBucketQosInfoResult result8(xml);\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                        <QoSConfiguration>\n                                <Region></Region>\n                                <TotalUploadBandwidth></TotalUploadBandwidth>\n                                <IntranetUploadBandwidth></IntranetUploadBandwidth>\n                                <ExtranetUploadBandwidth></ExtranetUploadBandwidth>\n                                <TotalDownloadBandwidth></TotalDownloadBandwidth>\n                                <IntranetDownloadBandwidth></IntranetDownloadBandwidth>\n                                <ExtranetDownloadBandwidth></ExtranetDownloadBandwidth>\n                                <TotalQps></TotalQps>\n                                <IntranetQps></IntranetQps>\n                                <ExtranetQps></ExtranetQps>\n                        </QoSConfiguration>)\";\n        GetBucketQosInfoResult result9(xml);\n\n    }\n\n    TEST_F(BucketQosInfoTest, SetBucketQosInfoFailTest)\n    {\n        QosConfiguration qos;\n        SetBucketQosInfoRequest setrequest(\"INVALIDNAME\", qos);\n\n        auto setoutcome = Client->SetBucketQosInfo(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), false);\n\n        DeleteBucketQosInfoRequest delrequest(\"INVALIDNAME\");\n        auto deloutcome = Client->DeleteBucketQosInfo(delrequest);\n        EXPECT_EQ(deloutcome.isSuccess(), false);\n\n        GetBucketQosInfoRequest getrequest(\"INVALIDNAME\");\n        auto getoutcome = Client->GetBucketQosInfo(getrequest);\n        EXPECT_EQ(getoutcome.isSuccess(), false);\n    }\n\n    TEST_F(BucketQosInfoTest, UserQosInfoFailTest)\n    {\n        auto invalidClient = std::make_shared<OssClient>(Config::Endpoint, Config::AccessKeyId, \"Invalid\", ClientConfiguration());\n        GetUserQosInfoRequest getrequest1;\n        auto getoutcome1 = invalidClient->GetUserQosInfo(getrequest1);\n        EXPECT_EQ(getoutcome1.isSuccess(), false);\n    }\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketRefersSettingsTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass BucketRefersSettingsTest : public ::testing::Test {\nprotected:\n    BucketRefersSettingsTest()\n    {\n    }\n\n    ~BucketRefersSettingsTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase() \n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketreferssettings\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase() \n    {\n        Client->DeleteBucket(DeleteBucketRequest(BucketName));\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> BucketRefersSettingsTest::Client = nullptr;\nstd::string BucketRefersSettingsTest::BucketName = \"\";\n\nTEST_F(BucketRefersSettingsTest, GetBucketDefaultRefersTest)\n{\n    auto bucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketreferssettings\");\n\n    auto cOutcome = Client->CreateBucket(CreateBucketRequest(bucketName));\n    EXPECT_EQ(cOutcome.isSuccess(), true);\n\n    auto refOutcome = Client->GetBucketReferer(bucketName);\n    EXPECT_EQ(refOutcome.isSuccess(), true);\n    EXPECT_EQ(refOutcome.result().RefererList().size(), 0UL);\n    EXPECT_EQ(refOutcome.result().AllowEmptyReferer(), true);\n\n    Client->DeleteBucket(DeleteBucketRequest(bucketName));\n}\n\nTEST_F(BucketRefersSettingsTest, SetBucketRefersPositiveTest)\n{\n    //initialize refer list\n    RefererList referList = {\n        \"http://*.aliyun.com\", \n        \"http://wwww.alibaba.com\" \n    };\n    //use construct which pass in 3 parameters\n    auto outcome = Client->SetBucketReferer(SetBucketRefererRequest(BucketName, referList, false));\n    EXPECT_EQ(outcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n    auto refOutcome = Client->GetBucketReferer(GetBucketRefererRequest(BucketName));\n    EXPECT_EQ(refOutcome.isSuccess(), true);\n    EXPECT_EQ(refOutcome.result().RefererList().size(), 2UL);\n    EXPECT_EQ(refOutcome.result().AllowEmptyReferer(), false);\n\n    referList.push_back(\"http://www.taobao?.com\");\n    //use construct which pass in 2 parameters, and allowEmptyRefer set to true\n    //outcome = Client->SetBucketReferer(SetBucketRefererRequest(BucketName, referList));\n    outcome = Client->SetBucketReferer(BucketName, referList, true);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n    refOutcome = Client->GetBucketReferer(GetBucketRefererRequest(BucketName));\n    EXPECT_EQ(refOutcome.isSuccess(), true);\n    EXPECT_EQ(refOutcome.result().RefererList().size(), 3UL);\n    //it is true this time\n    EXPECT_EQ(refOutcome.result().AllowEmptyReferer(), true);\n\n    //use construct which pass in 1 parameter, which means set it back to init status\n    outcome = Client->SetBucketReferer(SetBucketRefererRequest(BucketName));\n    EXPECT_EQ(outcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n    refOutcome = Client->GetBucketReferer(GetBucketRefererRequest(BucketName));\n    EXPECT_EQ(refOutcome.isSuccess(), true);\n    EXPECT_EQ(refOutcome.result().RefererList().empty(), true);\n    EXPECT_EQ(refOutcome.result().AllowEmptyReferer(), true);\n}\n\nTEST_F(BucketRefersSettingsTest, SetBucketRefersEmptyListTest)\n{\n    auto outcome = Client->SetBucketReferer(SetBucketRefererRequest(BucketName, RefererList(), false));\n    EXPECT_EQ(outcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n    auto refOutcome = Client->GetBucketReferer(GetBucketRefererRequest(BucketName));\n    EXPECT_EQ(refOutcome.isSuccess(), true);\n    EXPECT_EQ(refOutcome.result().RefererList().empty(), true);\n    EXPECT_EQ(refOutcome.result().AllowEmptyReferer(), false);\n}\n\nTEST_F(BucketRefersSettingsTest, GetBucketRefersNegativeTest)\n{\n    auto bucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketreferssettings\");\n    auto outcome = Client->GetBucketReferer(bucketName);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\n}\n\nTEST_F(BucketRefersSettingsTest, SetBucketRefersNegativeTest)\n{\n    auto bucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketreferssettings\");\n    auto outcome = Client->SetBucketReferer(SetBucketRefererRequest(bucketName, RefererList(), false));\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\n}\n\n\nTEST_F(BucketRefersSettingsTest, SetBucketRefersEmptyElementTest)\n{\n    RefererList referList = {\n        \"\", \"\"\n    };\n\n    auto outcome = Client->SetBucketReferer(SetBucketRefererRequest(BucketName, referList));\n    EXPECT_EQ(outcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n    auto refOutcome = Client->GetBucketReferer(GetBucketRefererRequest(BucketName));\n    EXPECT_EQ(refOutcome.isSuccess(), true);\n    EXPECT_EQ(refOutcome.result().RefererList().empty(), true);\n    EXPECT_EQ(refOutcome.result().AllowEmptyReferer(), true);\n}\n\nTEST_F(BucketRefersSettingsTest, SetBucketRefererNegativeTest)\n{\n    auto name = TestUtils::GetBucketName(\"no-exist-bucket-refer\");\n    RefererList referList;\n    referList.push_back(\"http://www.taobao?.com\");\n    auto outcome = Client->SetBucketReferer(name, referList, true);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\n}\n\nTEST_F(BucketRefersSettingsTest, GetBucketRefererResult)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <RefererConfiguration>\n                    <AllowEmptyReferer>true</AllowEmptyReferer >\n                        <RefererList>\n                            <Referer> http://www.aliyun.com</Referer>\n                            <Referer> https://www.aliyun.com</Referer>\n                            <Referer> http://www.*.com</Referer>\n                            <Referer> https://www.?.aliyuncs.com</Referer>\n                        </RefererList>\n                    </RefererConfiguration>)\";\n    GetBucketRefererResult result(xml);\n    EXPECT_EQ(result.AllowEmptyReferer(), true);\n    EXPECT_EQ(result.RefererList().size(), 4UL);\n\n}\n\nTEST_F(BucketRefersSettingsTest, GetBucketRefererResultBranchTest)\n{\n    GetBucketRefererResult result(\"test\");\n\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <Referer>\n                    <AllowEmptyReferer>true</AllowEmptyReferer >\n                        <RefererList>\n                            <Referer> http://www.aliyun.com</Referer>\n                            <Referer> https://www.aliyun.com</Referer>\n                            <Referer> http://www.*.com</Referer>\n                            <Referer> https://www.?.aliyuncs.com</Referer>\n                        </RefererList>\n                    </Referer>)\";\n    GetBucketRefererResult result1(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <RefererConfiguration>\n                    </RefererConfiguration>)\";\n    GetBucketRefererResult result2(xml);\n\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <RefererConfiguration>\n                    <AllowEmptyReferer>true</AllowEmptyReferer >\n                        <RefererList>\n                        </RefererList>\n                    </RefererConfiguration>)\";\n    GetBucketRefererResult result3(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <RefererConfiguration>\n                    <AllowEmptyReferer></AllowEmptyReferer >\n                        <RefererList>\n                            <Referer> </Referer>\n                            <Referer> </Referer>\n                        </RefererList>\n                    </RefererConfiguration>)\";\n    GetBucketRefererResult result4(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    GetBucketRefererResult result5(xml);\n}\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketRequestPaymentTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include <alibabacloud/oss/Types.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include \"src/utils/FileSystemUtils.h\"\n#include \"src/utils/Utils.h\"\n#include <fstream>\n\nnamespace AlibabaCloud\n{ \nnamespace OSS \n{\n\nclass BucketRequestPaymentTest : public ::testing::Test\n{\nprotected:\n    BucketRequestPaymentTest()\n    {\n    }\n\n    ~BucketRequestPaymentTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n        ClientConfiguration conf;\n        conf.enableCrc64 = false;\n        Client = TestUtils::GetOssClientDefault();\n\n        BucketName1 = TestUtils::GetBucketName(\"cpp-sdk-objectcopy1\");\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName1));\n        EXPECT_EQ(outCome.isSuccess(), true);\n\n        PayerClient = std::make_shared<OssClient>(Config::Endpoint, Config::PayerAccessKeyId, Config::PayerAccessKeySecret, ClientConfiguration());\n\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n        TestUtils::CleanBucket(*Client, BucketName1);\n        Client = nullptr;\n        PayerClient = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\n\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::shared_ptr<OssClient> PayerClient;\n    static std::string BucketName1;\n};\n\nstd::shared_ptr<OssClient> BucketRequestPaymentTest::Client = nullptr;\nstd::shared_ptr<OssClient> BucketRequestPaymentTest::PayerClient = nullptr;\nstd::string BucketRequestPaymentTest::BucketName1 = \"\";\n\nTEST_F(BucketRequestPaymentTest, PutAndGetBucketRequestPayment)\n{\n    GetBucketRequestPaymentRequest getRequest(BucketName1);\n    GetBucketPaymentOutcome getOutcome = Client->GetBucketRequestPayment(getRequest);\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    EXPECT_EQ(getOutcome.result().Payer(), RequestPayer::BucketOwner);\n\n    SetBucketRequestPaymentRequest setRequest(BucketName1);\n    setRequest.setRequestPayer(RequestPayer::NotSet);\n    VoidOutcome setOutcome = Client->SetBucketRequestPayment(setRequest);\n    EXPECT_EQ(setOutcome.isSuccess(), false);\n\n    setRequest.setRequestPayer(RequestPayer::BucketOwner);\n    setOutcome = Client->SetBucketRequestPayment(setRequest);\n    EXPECT_EQ(setOutcome.isSuccess(), true);\n\n    setRequest.setRequestPayer(RequestPayer::Requester);\n    setOutcome = Client->SetBucketRequestPayment(setRequest);\n    EXPECT_EQ(setOutcome.isSuccess(), true);\n\n    getOutcome = Client->GetBucketRequestPayment(getRequest);\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    EXPECT_EQ(getOutcome.result().Payer(), RequestPayer::Requester);\n}\n\nTEST_F(BucketRequestPaymentTest, BucketRequestPaymentWithInvalidResponseBodyTest)\n{\n    auto gbrpRequest = GetBucketRequestPaymentRequest(BucketName1);\n    gbrpRequest.setResponseStreamFactory([=]() {\n        auto content = std::make_shared<std::stringstream>();\n        content->write(\"invlid data\", 11);\n        return content;\n    });\n    auto gbrpOutcome = Client->GetBucketRequestPayment(gbrpRequest);\n    EXPECT_EQ(gbrpOutcome.isSuccess(), false);\n    EXPECT_EQ(gbrpOutcome.error().Code(), \"ParseXMLError\");\n}\n\nTEST_F(BucketRequestPaymentTest, BucketPaymentResult)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <RequestPaymentConfiguration>\n                        <Payer>BucketOwner</Payer>\n                        </RequestPaymentConfiguration>)\";\n    GetBucketPaymentResult result(xml);\n    EXPECT_EQ(result.Payer(), RequestPayer::BucketOwner);\n}\n\nTEST_F(BucketRequestPaymentTest, GetBucketRequestPaymentInvalidValidateTest)\n{\n    auto getoutcome = Client->GetBucketRequestPayment(GetBucketRequestPaymentRequest(\"Invalid-bucket-test\"));\n\n    EXPECT_EQ(getoutcome.isSuccess(), false);\n    EXPECT_EQ(getoutcome.error().Code(), \"ValidateError\");\n}\n\nTEST_F(BucketRequestPaymentTest, BucketPaymentResultBranchTest)\n{\n    GetBucketPaymentResult result(\"test\");\n\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <RequestPayment>\n                        <Payer>BucketOwner</Payer>\n                        </RequestPayment>)\";\n    GetBucketPaymentResult result1(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <RequestPaymentConfiguration>\n                        </RequestPaymentConfiguration>)\";\n    GetBucketPaymentResult result2(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <RequestPaymentConfiguration>\n                        <Payer></Payer>\n                        </RequestPaymentConfiguration>)\";\n    GetBucketPaymentResult result3(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    GetBucketPaymentResult result4(xml);\n}\n}\n}\n"
  },
  {
    "path": "test/src/Bucket/BucketStorageCapacityTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass BucketStorageCapacityTest : public ::testing::Test {\nprotected:\n    BucketStorageCapacityTest()\n    {\n    }\n\n    ~BucketStorageCapacityTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase() \n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketstoragecapacity\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase() \n    {\n        Client->DeleteBucket(DeleteBucketRequest(BucketName));\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\nstd::shared_ptr<OssClient> BucketStorageCapacityTest::Client = nullptr;\nstd::string BucketStorageCapacityTest::BucketName = \"\";\n\nTEST_F(BucketStorageCapacityTest, InvalidBucketNameTest)\n{\n    for (auto const& invalidBucketName : TestUtils::InvalidBucketNamesList()) {\n        auto outcome = Client->SetBucketStorageCapacity(invalidBucketName, 10240);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n    }\n}\n\nTEST_F(BucketStorageCapacityTest, SetBucketStorageCapacityTest)\n{\n    auto sOutcome = Client->SetBucketStorageCapacity(SetBucketStorageCapacityRequest(BucketName, 10240));\n    EXPECT_EQ(sOutcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n\n    auto outcome = Client->GetBucketStorageCapacity(GetBucketStorageCapacityRequest(BucketName));\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().StorageCapacity(), 10240LL);\n}\n\nTEST_F(BucketStorageCapacityTest, GetBucketStorageCapacityNegativeTest)\n{\n    auto bucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketstoragecapacity\");\n    auto outcome = Client->GetBucketStorageCapacity(bucketName);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\n}\n\nTEST_F(BucketStorageCapacityTest, BucketStorageCapacityWithInvalidResponseBodyTest)\n{\n    auto gbscRequest = GetBucketStorageCapacityRequest(BucketName);\n    gbscRequest.setResponseStreamFactory([=]() {\n        auto content = std::make_shared<std::stringstream>();\n        content->write(\"invlid data\", 11);\n        return content;\n    });\n    auto gbscOutcome = Client->GetBucketStorageCapacity(gbscRequest);\n    EXPECT_EQ(gbscOutcome.isSuccess(), false);\n    EXPECT_EQ(gbscOutcome.error().Code(), \"ParseXMLError\");\n}\n\nTEST_F(BucketStorageCapacityTest, SetBucketStorageCapacityInvalidInputTest)\n{\n    auto outcome = Client->SetBucketStorageCapacity(SetBucketStorageCapacityRequest(BucketName, -2));\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n}\n\nTEST_F(BucketStorageCapacityTest, GetBucketStorageCapacityResult)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <BucketUserQos>\n                          <StorageCapacity>10240</StorageCapacity>\n                        </BucketUserQos>)\";\n    GetBucketStorageCapacityResult result(xml);\n    EXPECT_EQ(result.StorageCapacity(), 10240LL);\n}\n\nTEST_F(BucketStorageCapacityTest, GetBucketStorageCapacityResultBranchTest)\n{\n    GetBucketStorageCapacityResult result(\"test\");\n\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <BucketUser>\n                          <StorageCapacity>10240</StorageCapacity>\n                        </BucketUser>)\";\n    GetBucketStorageCapacityResult result1(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <BucketUserQos>\n                        </BucketUserQos>)\";\n    GetBucketStorageCapacityResult result2(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <BucketUserQos>\n                          <StorageCapacity></StorageCapacity>\n                        </BucketUserQos>)\";\n    GetBucketStorageCapacityResult result3(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    GetBucketStorageCapacityResult result4(xml);\n}\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketTaggingtTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud \n{\nnamespace OSS \n{\n\n    class BucketTaggingTest : public ::testing::Test {\n    protected:\n        BucketTaggingTest()\n        {\n        }\n\n        ~BucketTaggingTest() override\n        {\n        }\n\n        // Sets up the stuff shared by all tests in this test case.\n        static void SetUpTestCase()\n        {\n            Client = TestUtils::GetOssClientDefault();\n            BucketName = TestUtils::GetBucketName(\"cpp-sdk-buckettagging\");\n            Client->CreateBucket(CreateBucketRequest(BucketName));\n        }\n\n        // Tears down the stuff shared by all tests in this test case.\n        static void TearDownTestCase()\n        {\n            Client->DeleteBucket(DeleteBucketRequest(BucketName));\n            Client = nullptr;\n        }\n\n        // Sets up the test fixture.\n        void SetUp() override\n        {\n        }\n\n        // Tears down the test fixture.\n        void TearDown() override\n        {\n        }\n    public:\n        static std::shared_ptr<OssClient> Client;\n        static std::string BucketName;\n    };\n\n    std::shared_ptr<OssClient> BucketTaggingTest::Client = nullptr;\n    std::string BucketTaggingTest::BucketName = \"\";\n\n    TEST_F(BucketTaggingTest, SetAndDeleteBucketTaggingTest)\n    {\n        SetBucketTaggingRequest setrequest(BucketName);\n        Tag tag1(\"project\",\"projectone\");\n        Tag tag2(\"user\", \"jsmith\");\n        TagSet tagset;\n        tagset.push_back(tag1);\n        tagset.push_back(tag2);\n        Tagging taging;\n        taging.setTags(tagset);\n        setrequest.setTagging(taging);\n        auto setoutcome = Client->SetBucketTagging(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), true);\n\n        DeleteBucketTaggingRequest delrequest(BucketName);\n        auto deloutcome = Client->DeleteBucketTagging(delrequest);\n        EXPECT_EQ(deloutcome.isSuccess(), true);\n    }\n\n    TEST_F(BucketTaggingTest, GetBucketTaggingTest)\n    {\n        SetBucketTaggingRequest setrequest(BucketName);\n        Tag tag1(\"project\", \"projectone\");\n        Tag tag2(\"user\", \"jsmith\");\n        TagSet tagset;\n        tagset.push_back(tag1);\n        tagset.push_back(tag2);\n        Tagging taging;\n        taging.setTags(tagset);\n        setrequest.setTagging(taging);\n        auto setoutcome = Client->SetBucketTagging(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), true);\n\n        auto getoutcome = Client->GetBucketTagging(GetBucketTaggingRequest(BucketName));\n        EXPECT_EQ(getoutcome.isSuccess(), true);\n        EXPECT_EQ(getoutcome.result().Tagging().Tags().size(), 2U);\n        EXPECT_TRUE(getoutcome.result().RequestId().size() > 0U);\n\n        size_t i = 0;\n        for (const auto& tag : getoutcome.result().Tagging().Tags()) {\n            EXPECT_EQ(taging.Tags()[i].Key(), tag.Key());\n            EXPECT_EQ(taging.Tags()[i].Value(), tag.Value());\n            i++;\n        }\n\n        DeleteBucketTaggingRequest delrequest(BucketName);\n        auto deloutcome = Client->DeleteBucketTagging(delrequest);\n        EXPECT_EQ(deloutcome.isSuccess(), true);\n    }\n\n    TEST_F(BucketTaggingTest, GetBucketTaggingResult)\n    {\n        std::string xml = R\"(<?xml version=\"1.0\" ?>\n                        <Tagging>\n                            <TagSet>\n                            <Tag>\n                                <Key>project</Key>\n                                <Value>projectone</Value>\n                            </Tag>\n                            <Tag>\n                                <Key>user</Key>\n                                <Value>jsmith</Value>\n                            </Tag>\n                            </TagSet>\n                        </Tagging>)\";\n        GetBucketTaggingResult result1(xml);\n        EXPECT_EQ(result1.Tagging().Tags().size(), 2U);\n        EXPECT_EQ(result1.Tagging().Tags()[0].Key(), \"project\");\n        EXPECT_EQ(result1.Tagging().Tags()[0].Value(), \"projectone\");\n        EXPECT_EQ(result1.Tagging().Tags()[1].Key(), \"user\");\n        EXPECT_EQ(result1.Tagging().Tags()[1].Value(), \"jsmith\");\n    }\n\n    TEST_F(BucketTaggingTest, ListBucketByTaggingTest)\n    {\n        SetBucketTaggingRequest setrequest(BucketName);\n        Tag tag1(\"project\", \"projectone\");\n        TagSet tagset;\n        tagset.push_back(tag1);\n        Tagging taging;\n        taging.setTags(tagset);\n        setrequest.setTagging(taging);\n        auto setoutcome = Client->SetBucketTagging(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), true);\n\n        ListBucketsRequest listrequest;\n        listrequest.setTag(tag1);\n        auto listoutcome = Client->ListBuckets(listrequest);\n\n        EXPECT_EQ(listoutcome.isSuccess(), true);\n        EXPECT_EQ(listoutcome.result().Buckets().size(), 1U);\n        EXPECT_EQ(listoutcome.result().Buckets()[0].Name(), BucketName);\n    }\n\n    TEST_F(BucketTaggingTest, BucketTaggingWithInvalidResponseBodyTest)\n    {\n        auto gbtRequest = GetBucketTaggingRequest(BucketName);\n        gbtRequest.setResponseStreamFactory([=]() {\n            auto content = std::make_shared<std::stringstream>();\n            content->write(\"invlid data\", 11);\n            return content;\n        });\n        auto gbtOutcome = Client->GetBucketTagging(gbtRequest);\n        EXPECT_EQ(gbtOutcome.isSuccess(), false);\n        EXPECT_EQ(gbtOutcome.error().Code(), \"ParseXMLError\");\n    }\n\n    TEST_F(BucketTaggingTest, GetBucketTaggingResultBranchTest)\n    {\n        GetBucketTaggingResult result(\"test\");\n\n        std::string xml = R\"(<?xml version=\"1.0\" ?>\n                        <Tagg>\n                            <TagSet>\n                            <Tag>\n                                <Key>project</Key>\n                                <Value>projectone</Value>\n                            </Tag>\n                            <Tag>\n                                <Key>user</Key>\n                                <Value>jsmith</Value>\n                            </Tag>\n                            </TagSet>\n                        </Tagg>)\";\n        GetBucketTaggingResult result1(xml);\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                        <Tagging>\n                            <Tag>\n                                <Key>project</Key>\n                                <Value>projectone</Value>\n                            </Tag>\n                            <Tag>\n                                <Key>user</Key>\n                                <Value>jsmith</Value>\n                            </Tag>\n                        </Tagging>)\";\n        GetBucketTaggingResult result2(xml);\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                        <Tagging>\n                            <TagSet>\n                            </TagSet>\n                        </Tagging>)\";\n        GetBucketTaggingResult result3(xml);\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                        <Tagging>\n                            <TagSet>\n                            <Tag>\n                            </Tag>\n                            <Tag>\n\n                            </Tag>\n                            </TagSet>\n                        </Tagging>)\";\n        GetBucketTaggingResult result4(xml);\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                        <Tagging>\n                            <TagSet>\n                            <Tag>\n                                <Key></Key>\n                                <Value></Value>\n                            </Tag>\n\n                            </TagSet>\n                        </Tagging>)\";\n        GetBucketTaggingResult result5(xml);\n\n        xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n        GetBucketTaggingResult result6(xml);\n    }\n\n    TEST_F(BucketTaggingTest, SetBucketTaggingFailTest)\n    {\n        SetBucketTaggingRequest setrequest(\"INVALIDNAME\");\n        auto setoutcome = Client->SetBucketTagging(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), false);\n\n\n        DeleteBucketTaggingRequest delrequest(\"INVALIDNAME\");\n        auto deloutcome = Client->DeleteBucketTagging(delrequest);\n        EXPECT_EQ(deloutcome.isSuccess(), false);\n\n        auto getoutcome = Client->GetBucketTagging(GetBucketTaggingRequest(\"INVALIDNAME\"));\n        EXPECT_EQ(getoutcome.isSuccess(), false);\n    }\n\n    TEST_F(BucketTaggingTest, SetBucketTaggingKeyTest)\n    {\n        SetBucketTaggingRequest setrequest(BucketName);\n        Tag tag1(\"project\", \"projectone\");\n        Tag tag2(\"user\", \"jsmith\");\n        TagSet tagset;\n        tagset.push_back(tag1);\n        tagset.push_back(tag2);\n        Tagging taging;\n        taging.setTags(tagset);\n        setrequest.setTagging(taging);\n        auto setoutcome = Client->SetBucketTagging(setrequest);\n        EXPECT_EQ(setoutcome.isSuccess(), true);\n\n        DeleteBucketTaggingRequest delrequest(BucketName);\n        Tagging taging1;\n        TagSet tagset1;\n        tagset1.push_back(tag1);\n        taging1.setTags(tagset1);\n        delrequest.setTagging(taging1);\n        auto deloutcome = Client->DeleteBucketTagging(delrequest);\n        EXPECT_EQ(deloutcome.isSuccess(), true);\n\n        auto getoutcome = Client->GetBucketTagging(GetBucketTaggingRequest(BucketName));\n        EXPECT_EQ(getoutcome.isSuccess(), true);\n        EXPECT_EQ(getoutcome.result().Tagging().Tags().size(), 1U);\n        EXPECT_EQ(getoutcome.result().Tagging().Tags()[0].Key(), tag2.Key());\n\n        delrequest.setTagging(taging);\n        deloutcome = Client->DeleteBucketTagging(delrequest);\n        EXPECT_EQ(deloutcome.isSuccess(), true);\n\n        getoutcome = Client->GetBucketTagging(GetBucketTaggingRequest(BucketName));\n        EXPECT_EQ(getoutcome.isSuccess(), true);\n        EXPECT_EQ(getoutcome.result().Tagging().Tags().size(), 0U);\n    }\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketVersioningTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\n    class BucketVersioningTest : public ::testing::Test {\n    protected:\n        BucketVersioningTest()\n        {\n        }\n\n        ~BucketVersioningTest() override\n        {\n        }\n\n        // Sets up the stuff shared by all tests in this test case.\n        static void SetUpTestCase()\n        {\n            Client = TestUtils::GetOssClientDefault();\n            BucketName = TestUtils::GetBucketName(\"cpp-sdk-versioning\");\n            Client->CreateBucket(CreateBucketRequest(BucketName));\n        }\n\n        // Tears down the stuff shared by all tests in this test case.\n        static void TearDownTestCase()\n        {\n            Client->DeleteBucket(DeleteBucketRequest(BucketName));\n            Client = nullptr;\n        }\n\n        // Sets up the test fixture.\n        void SetUp() override\n        {\n        }\n\n        // Tears down the test fixture.\n        void TearDown() override\n        {\n        }\n    public:\n        static std::shared_ptr<OssClient> Client;\n        static std::string BucketName;\n    };\n\n    std::shared_ptr<OssClient> BucketVersioningTest::Client = nullptr;\n    std::string BucketVersioningTest::BucketName = \"\";\n\n    TEST_F(BucketVersioningTest, SetAndGetBucketVersioningTest)\n    {\n        //default\n        auto gOutcome = Client->GetBucketVersioning(GetBucketVersioningRequest(BucketName));\n        EXPECT_EQ(gOutcome.isSuccess(), true);\n        EXPECT_EQ(gOutcome.result().RequestId().size(), 24UL);\n        EXPECT_EQ(gOutcome.result().Status(), VersioningStatus::NotSet);\n\n        auto bfOutcome = Client->GetBucketInfo(BucketName);\n        EXPECT_EQ(bfOutcome.isSuccess(), true);\n        EXPECT_EQ(bfOutcome.result().RequestId().size(), 24UL);\n        EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::NotSet);\n\n        //set Enabled\n        SetBucketVersioningRequest request(BucketName, VersioningStatus::Enabled);\n        auto sOutcome = Client->SetBucketVersioning(request);\n        EXPECT_EQ(sOutcome.isSuccess(), true);\n        EXPECT_EQ(sOutcome.result().RequestId().size(), 24UL);\n\n        gOutcome = Client->GetBucketVersioning(GetBucketVersioningRequest(BucketName));\n        EXPECT_EQ(gOutcome.isSuccess(), true);\n        EXPECT_EQ(gOutcome.result().Status(), VersioningStatus::Enabled);\n\n        bfOutcome = Client->GetBucketInfo(BucketName);\n        EXPECT_EQ(bfOutcome.isSuccess(), true);\n        EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\n\n        //set Suspended\n        request.setStatus(VersioningStatus::Suspended);\n        sOutcome = Client->SetBucketVersioning(request);\n        EXPECT_EQ(sOutcome.isSuccess(), true);\n        EXPECT_EQ(sOutcome.result().RequestId().size(), 24UL);\n\n        gOutcome = Client->GetBucketVersioning(GetBucketVersioningRequest(BucketName));\n        EXPECT_EQ(gOutcome.isSuccess(), true);\n        EXPECT_EQ(gOutcome.result().Status(), VersioningStatus::Suspended);\n\n        bfOutcome = Client->GetBucketInfo(BucketName);\n        EXPECT_EQ(bfOutcome.isSuccess(), true);\n        EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Suspended);\n\n        //set Enabled again\n        sOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\n        EXPECT_EQ(sOutcome.isSuccess(), true);\n        EXPECT_EQ(sOutcome.result().RequestId().size(), 24UL);\n\n        gOutcome = Client->GetBucketVersioning(GetBucketVersioningRequest(BucketName));\n        EXPECT_EQ(gOutcome.isSuccess(), true);\n        EXPECT_EQ(gOutcome.result().Status(), VersioningStatus::Enabled);\n\n        bfOutcome = Client->GetBucketInfo(BucketName);\n        EXPECT_EQ(bfOutcome.isSuccess(), true);\n        EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\n    }\n    \n    TEST_F(BucketVersioningTest, SetAndGetBucketVersioningNGTest)\n    {\n        SetBucketVersioningRequest sRequest(\"Invalid-Bucket\", VersioningStatus::Enabled);\n        auto sOutcome = Client->SetBucketVersioning(sRequest);\n        EXPECT_EQ(sOutcome.isSuccess(), false);\n\n        GetBucketVersioningRequest gRequest(\"Invalid-Bucket\");\n        auto gOutcome = Client->GetBucketVersioning(gRequest);\n        EXPECT_EQ(gOutcome.isSuccess(), false);\n    }\n\n    TEST_F(BucketVersioningTest, GetBucketVersioningWithInvalidResponseBodyTest)\n    {\n        SetBucketVersioningRequest request(BucketName, VersioningStatus::Enabled);\n        auto sOutcome = Client->SetBucketVersioning(request);\n        EXPECT_EQ(sOutcome.isSuccess(), true);\n        EXPECT_EQ(sOutcome.result().RequestId().size(), 24UL);\n\n        auto gbvRequest = GetBucketVersioningRequest(BucketName);\n        gbvRequest.setResponseStreamFactory([=]() {\n            auto content = std::make_shared<std::stringstream>();\n            content->write(\"invlid data\", 11);\n            return content;\n        });\n        auto gbvOutcome = Client->GetBucketVersioning(gbvRequest);\n        EXPECT_EQ(gbvOutcome.isSuccess(), false);\n        EXPECT_EQ(gbvOutcome.error().Code(), \"ParseXMLError\");\n    }\n\n    TEST_F(BucketVersioningTest, GetBucketVersioningResult)\n    {\n        std::string xml;\n        GetBucketVersioningResult result;\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                <VersioningConfiguration>\n                    <Status>Enabled</Status>\n                </VersioningConfiguration>)\";\n\n        result = GetBucketVersioningResult(xml);\n        EXPECT_EQ(result.Status(), VersioningStatus::Enabled);\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                <VersioningConfiguration>\n                    <Status>Suspended</Status>\n                </VersioningConfiguration>)\";\n        result = GetBucketVersioningResult(xml);\n        EXPECT_EQ(result.Status(), VersioningStatus::Suspended);\n\n        xml = R\"(<?xml version=\"1.0\" ?>\n                <VersioningConfiguration>\n                </VersioningConfiguration>)\";\n        result = GetBucketVersioningResult(xml);\n        EXPECT_EQ(result.Status(), VersioningStatus::NotSet);\n    }\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketWebsiteSettingsTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass BucketWebsiteSettingsTest : public ::testing::Test {\nprotected:\n    BucketWebsiteSettingsTest()\n    {\n    }\n\n    ~BucketWebsiteSettingsTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase() \n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketwebsitesettings\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase() \n    {\n        Client->DeleteBucket(DeleteBucketRequest(BucketName));\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\nstd::shared_ptr<OssClient> BucketWebsiteSettingsTest::Client = nullptr;\nstd::string BucketWebsiteSettingsTest::BucketName = \"\";\n\nTEST_F(BucketWebsiteSettingsTest, InvalidBucketNameTest)\n{\n    std::string indexDoc = \"index.html\";\n    for (auto const& invalidBucketName : TestUtils::InvalidBucketNamesList()) {\n        auto outcome = Client->SetBucketWebsite(invalidBucketName, indexDoc);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\n    }\n}\n\nTEST_F(BucketWebsiteSettingsTest, GetBucketNotSetWebsiteTest)\n{\n    auto dOutcome = Client->DeleteBucketWebsite(DeleteBucketWebsiteRequest(BucketName));\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n\n    auto gOutcome = Client->GetBucketWebsite(GetBucketWebsiteRequest(BucketName));\n    EXPECT_EQ(gOutcome.isSuccess(), false);\n    EXPECT_STREQ(gOutcome.error().Code().c_str(), \"NoSuchWebsiteConfiguration\");\n}\n\nTEST_F(BucketWebsiteSettingsTest, DeleteBucketWebsiteNegativeTest)\n{\n    auto bucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketwebsitesettings\");\n    auto outcome = Client->DeleteBucketWebsite(bucketName);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\n}\n\nTEST_F(BucketWebsiteSettingsTest, SetBucketWebsiteTest)\n{\n    auto gOutcome = Client->GetBucketWebsite(GetBucketWebsiteRequest(BucketName));\n    EXPECT_EQ(gOutcome.isSuccess(), false);\n    EXPECT_STREQ(gOutcome.error().Code().c_str(), \"NoSuchWebsiteConfiguration\");\n\n    const std::string indexPage = \"index.html\";\n    const std::string errorPage = \"NotFound.html\";\n    SetBucketWebsiteRequest request(BucketName);\n    request.setIndexDocument(indexPage);\n    request.setErrorDocument(errorPage);\n    auto outcome = Client->SetBucketWebsite(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n    gOutcome = Client->GetBucketWebsite(GetBucketWebsiteRequest(BucketName));\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_STREQ(gOutcome.result().IndexDocument().c_str(), indexPage.c_str());\n    EXPECT_STREQ(gOutcome.result().ErrorDocument().c_str(), errorPage.c_str());\n\n    outcome = Client->SetBucketWebsite(BucketName, \"index2.html\", \"NotFound2.html\");\n    EXPECT_EQ(outcome.isSuccess(), true);\n    TestUtils::WaitForCacheExpire(5);\n    gOutcome = Client->GetBucketWebsite(BucketName);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().IndexDocument(), \"index2.html\");\n    EXPECT_EQ(gOutcome.result().ErrorDocument(), \"NotFound2.html\");\n}\n\nTEST_F(BucketWebsiteSettingsTest, SetBucketWebsiteInvalidInputTest)\n{\n    SetBucketWebsiteRequest request(BucketName);\n    for (auto const &invalidPageName : TestUtils::InvalidPageNamesList()) {\n        request.setIndexDocument(invalidPageName);\n        request.setIndexDocument(invalidPageName);\n        auto outcome = Client->SetBucketWebsite(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n        if (invalidPageName.empty()) {\n            EXPECT_EQ(outcome.error().Message(), \"Index document must not be empty.\");\n        }\n        else {\n            EXPECT_EQ(outcome.error().Message(), \"Invalid index document, must be end with.html.\");\n        }\n    }\n\n    request.setIndexDocument(\"index.html\");\n    request.setErrorDocument(\".html\");\n    auto outcome = Client->SetBucketWebsite(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    EXPECT_EQ(outcome.error().Message(), \"Invalid error document, must be end with .html.\");\n}\n\nTEST_F(BucketWebsiteSettingsTest, GetBucketWebsiteWithInvalidResponseBodyTest)\n{\n    auto sbwRequest = SetBucketWebsiteRequest(BucketName);\n    sbwRequest.setIndexDocument(\"index.html\");\n    sbwRequest.setErrorDocument(\"NotFound.html\");\n    Client->SetBucketWebsite(sbwRequest);\n\n    auto gbwRequest = GetBucketWebsiteRequest(BucketName);\n    gbwRequest.setResponseStreamFactory([=]() {\n        auto content = std::make_shared<std::stringstream>();\n        content->write(\"invlid data\", 11);\n        return content;\n    });\n    auto gbwOutcome = Client->GetBucketWebsite(gbwRequest);\n    EXPECT_EQ(gbwOutcome.isSuccess(), false);\n    EXPECT_EQ(gbwOutcome.error().Code(), \"ParseXMLError\");\n}\n\nTEST_F(BucketWebsiteSettingsTest, GetBucketWebsiteResult)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <WebsiteConfiguration>\n                          <IndexDocument>\n                            <Suffix>index.html</Suffix>\n                          </IndexDocument>\n                          <ErrorDocument>\n                            <Key>NotFound.html</Key>\n                          </ErrorDocument>\n                        </WebsiteConfiguration>)\";\n    GetBucketWebsiteResult result(xml);\n    EXPECT_EQ(result.IndexDocument(), \"index.html\");\n    EXPECT_EQ(result.ErrorDocument(), \"NotFound.html\");\n\n    xml = R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <WebsiteConfiguration>\n            <IndexDocument>\n                <Suffix></Suffix>\n            </IndexDocument>\n            <ErrorDocument>\n                <Key></Key>\n            </ErrorDocument>\n        </WebsiteConfiguration>\n        )\";\n    result = GetBucketWebsiteResult(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <WebsiteConfiguration>\n            <IndexDocument>\n            </IndexDocument>\n            <ErrorDocument>\n            </ErrorDocument>\n        </WebsiteConfiguration>\n        )\";\n    result = GetBucketWebsiteResult(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <WebsiteConfiguration>\n        </WebsiteConfiguration>\n        )\";\n    result = GetBucketWebsiteResult(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <Other>\n        </Other>\n        )\";\n    result = GetBucketWebsiteResult(xml);\n\n    xml = R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        )\";\n    result = GetBucketWebsiteResult(xml);\n\n    xml = R\"(\n        invalid xml\n        )\";\n    result = GetBucketWebsiteResult(xml);\n}\n\n}\n}"
  },
  {
    "path": "test/src/Bucket/BucketWormSettings.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass BucketWormSettings : public ::testing::Test {\nprotected:\n    BucketWormSettings()\n    {\n    }\n\n    ~BucketWormSettings() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase() \n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-bucketwormsettings\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase() \n    {\n        Client->DeleteBucket(DeleteBucketRequest(BucketName));\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\nstd::shared_ptr<OssClient> BucketWormSettings::Client = nullptr;\nstd::string BucketWormSettings::BucketName = \"\";\n\nTEST_F(BucketWormSettings, InvalidBucketNameTest)\n{\n    for (auto const& invalidBucketName : TestUtils::InvalidBucketNamesList()) {\n        auto ibWOutcome = Client->InitiateBucketWorm(InitiateBucketWormRequest(invalidBucketName, 10));\n        EXPECT_EQ(ibWOutcome.isSuccess(), false);\n        EXPECT_STREQ(ibWOutcome.error().Code().c_str(), \"ValidateError\");\n\n        auto abWOutcome = Client->AbortBucketWorm(AbortBucketWormRequest(invalidBucketName));\n        EXPECT_EQ(abWOutcome.isSuccess(), false);\n        EXPECT_STREQ(abWOutcome.error().Code().c_str(), \"ValidateError\");\n\n        auto cbWOutcome = Client->CompleteBucketWorm(CompleteBucketWormRequest(invalidBucketName, \"wormId\"));\n        EXPECT_EQ(cbWOutcome.isSuccess(), false);\n        EXPECT_STREQ(cbWOutcome.error().Code().c_str(), \"ValidateError\");\n\n        auto ebWOutcome = Client->ExtendBucketWormWorm(ExtendBucketWormRequest(invalidBucketName, \"wormId\", 20));\n        EXPECT_EQ(ebWOutcome.isSuccess(), false);\n        EXPECT_STREQ(ebWOutcome.error().Code().c_str(), \"ValidateError\");\n\n        auto gbWOutcome = Client->GetBucketWorm(GetBucketWormRequest(invalidBucketName));\n        EXPECT_EQ(gbWOutcome.isSuccess(), false);\n        EXPECT_STREQ(gbWOutcome.error().Code().c_str(), \"ValidateError\");\n    }\n}\n\nTEST_F(BucketWormSettings, BucketWormBasicTest)\n{\n    auto ibWOutcome = Client->InitiateBucketWorm(InitiateBucketWormRequest(BucketName, 10));\n    EXPECT_EQ(ibWOutcome.isSuccess(), true);\n    EXPECT_EQ(ibWOutcome.result().WormId().empty(), false);\n\n    auto gbWOutcome = Client->GetBucketWorm(GetBucketWormRequest(BucketName));\n    EXPECT_EQ(gbWOutcome.isSuccess(), true);\n    EXPECT_EQ(gbWOutcome.result().CreationDate().empty(), false);\n    EXPECT_EQ(gbWOutcome.result().Day(), 10UL);\n    EXPECT_EQ(gbWOutcome.result().State(), \"InProgress\");\n    EXPECT_EQ(gbWOutcome.result().WormId(), ibWOutcome.result().WormId());\n\n    auto abWOutcome = Client->AbortBucketWorm(AbortBucketWormRequest(BucketName));\n    EXPECT_EQ(abWOutcome.isSuccess(), true);\n\n    auto cbWOutcome = Client->CompleteBucketWorm(CompleteBucketWormRequest(BucketName, ibWOutcome.result().WormId()));\n    EXPECT_EQ(cbWOutcome.isSuccess(), false);\n\n    ibWOutcome = Client->InitiateBucketWorm(InitiateBucketWormRequest(BucketName, 8));\n    EXPECT_EQ(ibWOutcome.isSuccess(), true);\n    EXPECT_EQ(ibWOutcome.result().WormId().empty(), false);\n\n    gbWOutcome = Client->GetBucketWorm(GetBucketWormRequest(BucketName));\n    EXPECT_EQ(gbWOutcome.isSuccess(), true);\n    EXPECT_EQ(gbWOutcome.result().CreationDate().empty(), false);\n    EXPECT_EQ(gbWOutcome.result().Day(), 8UL);\n    EXPECT_EQ(gbWOutcome.result().State(), \"InProgress\");\n    EXPECT_EQ(gbWOutcome.result().WormId(), ibWOutcome.result().WormId());\n\n    cbWOutcome = Client->CompleteBucketWorm(CompleteBucketWormRequest(BucketName, ibWOutcome.result().WormId()));\n    EXPECT_EQ(cbWOutcome.isSuccess(), true);\n\n    gbWOutcome = Client->GetBucketWorm(GetBucketWormRequest(BucketName));\n    EXPECT_EQ(gbWOutcome.isSuccess(), true);\n    EXPECT_EQ(gbWOutcome.result().State(), \"Locked\");\n\n    auto ebWOutcome = Client->ExtendBucketWormWorm(ExtendBucketWormRequest(BucketName, ibWOutcome.result().WormId(), 20));\n    EXPECT_EQ(ebWOutcome.isSuccess(), true);\n\n    gbWOutcome = Client->GetBucketWorm(GetBucketWormRequest(BucketName));\n    EXPECT_EQ(gbWOutcome.isSuccess(), true);\n    EXPECT_EQ(gbWOutcome.result().Day(), 20UL);\n\n    abWOutcome = Client->AbortBucketWorm(AbortBucketWormRequest(BucketName));\n    EXPECT_EQ(abWOutcome.isSuccess(), false);\n    EXPECT_EQ(abWOutcome.error().Code(), \"WORMConfigurationLocked\");\n}\n\nTEST_F(BucketWormSettings, GetBucketWormResult)\n{\n    std::string xml = \n        R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <WormConfiguration>\r\n          <WormId>ID</WormId>\r\n          <State>Locked</State>\r\n          <RetentionPeriodInDays>1</RetentionPeriodInDays>\r\n          <CreationDate>2018-08-14T15:50:32</CreationDate>\r\n        </WormConfiguration>\n        )\";\n    auto result = GetBucketWormResult(xml);\n    EXPECT_EQ(result.CreationDate(), \"2018-08-14T15:50:32\");\n    EXPECT_EQ(result.WormId(), \"ID\");\n    EXPECT_EQ(result.State(), \"Locked\");\n    EXPECT_EQ(result.Day(), 1UL);\n\n    xml =\n        R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <WormConfiguration>\r\n          <WormId>ID</WormId>\r\n          <State>InProgress</State>\r\n          <RetentionPeriodInDays>365</RetentionPeriodInDays>\r\n          <CreationDate>2018-08-14T15:50:32</CreationDate>\r\n        </WormConfiguration>\n        )\";\n    result = GetBucketWormResult(xml);\n    EXPECT_EQ(result.CreationDate(), \"2018-08-14T15:50:32\");\n    EXPECT_EQ(result.WormId(), \"ID\");\n    EXPECT_EQ(result.State(), \"InProgress\");\n    EXPECT_EQ(result.Day(), 365UL);\n\n    xml =\n        R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <WormConfiguration>\r\n          <WormId></WormId>\r\n          <State></State>\r\n          <RetentionPeriodInDays></RetentionPeriodInDays>\r\n          <CreationDate></CreationDate>\r\n        </WormConfiguration>\n        )\";\n    result = GetBucketWormResult(xml);\n    EXPECT_EQ(result.CreationDate(), \"\");\n    EXPECT_EQ(result.WormId(), \"\");\n    EXPECT_EQ(result.State(), \"\");\n    EXPECT_EQ(result.Day(), 0UL);\n\n    xml =\n        R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <WormConfiguration>\r\n        </WormConfiguration>\n        )\";\n    result = GetBucketWormResult(xml);\n    EXPECT_EQ(result.CreationDate(), \"\");\n    EXPECT_EQ(result.WormId(), \"\");\n    EXPECT_EQ(result.State(), \"\");\n    EXPECT_EQ(result.Day(), 0UL);\n\n    xml =\n        R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <Invalid>\r\n        </Invalid>\n        )\";\n    result = GetBucketWormResult(xml);\n    EXPECT_EQ(result.CreationDate(), \"\");\n    EXPECT_EQ(result.WormId(), \"\");\n    EXPECT_EQ(result.State(), \"\");\n    EXPECT_EQ(result.Day(), 0UL);\n\n    xml =\n        R\"(\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        )\";\n    result = GetBucketWormResult(xml);\n    EXPECT_EQ(result.CreationDate(), \"\");\n    EXPECT_EQ(result.WormId(), \"\");\n    EXPECT_EQ(result.State(), \"\");\n    EXPECT_EQ(result.Day(), 0UL);\n}\n\n\n}\n}"
  },
  {
    "path": "test/src/Config.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n#include <string.h>\n#include <string>\n#include \"Config.h\"\n#include <fstream>\n#include <algorithm>\n\nstatic std::string dataPath_;\n#ifdef _WIN32\n#define delimiter \"\\\\\"\n#pragma warning( disable : 4996)\n#else\n#define delimiter \"/\"\n#endif\n\nstd::string Config::AccessKeyId = \"\";\nstd::string Config::AccessKeySecret = \"\";\nstd::string Config::Endpoint = \"\";\nstd::string Config::Region = \"\";\nstd::string Config::SecondEndpoint = \"\";\nstd::string Config::CallbackServer = \"\";\nstd::string Config::CfgFilePath = \"oss.ini\";\nstd::string Config::PayerAccessKeyId = \"\";\nstd::string Config::PayerAccessKeySecret = \"\";\nstd::string Config::PayerUID = \"\";\nstd::string Config::RamRoleArn = \"\";\nstd::string Config::RamUID = \"\";\n\nstatic std::string LeftTrim(const char* source)\n{\n    std::string copy(source);\n    copy.erase(copy.begin(), std::find_if(copy.begin(), copy.end(), [](unsigned char ch) { return !::isspace(ch); }));\n    return copy;\n}\n\nstatic std::string RightTrim(const char* source)\n{\n    std::string copy(source);\n    copy.erase(std::find_if(copy.rbegin(), copy.rend(), [](unsigned char ch) { return !::isspace(ch); }).base(), copy.end());\n    return copy;\n}\n\nstatic std::string Trim(const char* source)\n{\n    return LeftTrim(RightTrim(source).c_str());\n}\n\nstatic std::string LeftTrimQuotes(const char* source)\n{\n    std::string copy(source);\n    copy.erase(copy.begin(), std::find_if(copy.begin(), copy.end(), [](int ch) { return !(ch == '\"'); }));\n    return copy;\n}\n\nstatic std::string RightTrimQuotes(const char* source)\n{\n    std::string copy(source);\n    copy.erase(std::find_if(copy.rbegin(), copy.rend(), [](int ch) { return !(ch == '\"'); }).base(), copy.end());\n    return copy;\n}\n\nstatic std::string TrimQuotes(const char* source)\n{\n    return LeftTrimQuotes(RightTrimQuotes(source).c_str());\n}\n\nstatic bool hasCfgInfo()\n{\n    if (!Config::AccessKeyId.empty() &&\n        !Config::AccessKeySecret.empty() &&\n        !Config::Endpoint.empty()) {\n        return true;\n    }\n    return false;\n}\n\nstatic void LoadCfgFromFile()\n{\n    if (hasCfgInfo())\n        return;\n\n    std::fstream in(Config::CfgFilePath, std::ios::in | std::ios::binary);\n    if (!in.good())\n        return;\n\n    char buffer[256];\n    char *ptr;\n\n    while (in.getline(buffer, 256)) {\n        ptr = strchr(buffer, '=');\n        if (!ptr) {\n            continue;\n        }\n        if (!strncmp(buffer, \"AccessKeyId\", 11)) {\n            Config::AccessKeyId = TrimQuotes(Trim(ptr + 1).c_str());\n        }\n        else if (!strncmp(buffer, \"AccessKeySecret\", 15)) {\n            Config::AccessKeySecret = TrimQuotes(Trim(ptr + 1).c_str());\n        }\n        else if (!strncmp(buffer, \"Endpoint\", 8)) {\n            Config::Endpoint = TrimQuotes(Trim(ptr + 1).c_str());\n        }\n        else if (!strncmp(buffer, \"Region\", 6)) {\n            Config::Region = TrimQuotes(Trim(ptr + 1).c_str());\n        }\n        else if (!strncmp(buffer, \"SecondEndpoint\", 14)) {\n            Config::SecondEndpoint = TrimQuotes(Trim(ptr + 1).c_str());\n        }\n        else if (!strncmp(buffer, \"CallbackServer\", 14)) {\n            Config::CallbackServer = TrimQuotes(Trim(ptr + 1).c_str());\n        }\n        else if (!strncmp(buffer, \"PayerAccessKeyId\", 16)) {\n            Config::PayerAccessKeyId = TrimQuotes(Trim(ptr + 1).c_str());\n        }\n        else if (!strncmp(buffer, \"PayerAccessKeySecret\", 20)) {\n            Config::PayerAccessKeySecret = TrimQuotes(Trim(ptr + 1).c_str());\n        }\n        else if (!strncmp(buffer, \"PayerUID\", 8)) {\n            Config::PayerUID = TrimQuotes(Trim(ptr + 1).c_str());\n        }\n        else if (!strncmp(buffer, \"RamRoleArn\", 10)) {\n            Config::RamRoleArn = TrimQuotes(Trim(ptr + 1).c_str());\n        }\n        else if (!strncmp(buffer, \"RamUID\", 6)) {\n            Config::RamUID = TrimQuotes(Trim(ptr + 1).c_str());\n        }\n    }\n    in.close();\n}\n\nstatic void LoadCfgFromEnv()\n{\n    if (hasCfgInfo())\n        return;\n\n    const char *value;\n    value = std::getenv(\"TEST_ACCESS_KEY_ID\");\n    if (value) {\n        Config::AccessKeyId = TrimQuotes(Trim(value).c_str());\n    }\n\n    value = std::getenv(\"TEST_ACCESS_KEY_SECRET\");\n    if (value) {\n        Config::AccessKeySecret = TrimQuotes(Trim(value).c_str());\n    }\n\n    value = std::getenv(\"TEST_OSS_ENDPOINT\");\n    if (value) {\n        Config::Endpoint = TrimQuotes(Trim(value).c_str());\n    }\n\n    value = std::getenv(\"TEST_OSS_REGION\");\n    if (value) {\n        Config::Region = TrimQuotes(Trim(value).c_str());\n    }\n\n    value = std::getenv(\"TEST_OSS_CALLBACKSERVER\");\n    if (value) {\n        Config::CallbackServer = TrimQuotes(Trim(value).c_str());\n    }\n\n    value = std::getenv(\"TEST_OSS_PAYER_ACCESS_KEY_ID\");\n    if (value) {\n        Config::PayerAccessKeyId = TrimQuotes(Trim(value).c_str());\n    }\n\n    value = std::getenv(\"TEST_OSS_PAYER_ACCESS_KEY_SECRET\");\n    if (value) {\n        Config::PayerAccessKeySecret = TrimQuotes(Trim(value).c_str());\n    }\n\n    value = std::getenv(\"TEST_OSS_PAYER_UID\");\n    if (value) {\n        Config::PayerUID = TrimQuotes(Trim(value).c_str());\n    }\n\n    value = std::getenv(\"TEST_OSS_STS_ARN\");\n    if (value) {\n        Config::RamRoleArn = TrimQuotes(Trim(value).c_str());\n    }\n\n    value = std::getenv(\"TEST_OSS_ACCOUNT_ID\");\n    if (value) {\n        Config::RamUID = TrimQuotes(Trim(value).c_str());\n    }\n}\n\nbool Config::InitTestEnv()\n{\n    /*Get from Env*/\n    LoadCfgFromEnv();\n\n    /*Get from file*/\n    LoadCfgFromFile();\n\n    /*Inti Data Path*/\n    std::string path = __FILE__;\n    auto last_pos = path.rfind(\"src\");\n    path = path.substr(0, last_pos);\n    path.append(\"data\").append(delimiter);\n    dataPath_ = path;\n\n    return hasCfgInfo();\n}\n\nstd::string Config::GetDataPath()\n{\n    return dataPath_;\n}\n\nvoid Config::ParseArg(int argc, char **argv)\n{\n    int i = 1;\n    while (i < argc)\n    {\n        if (argv[i][0] == '-') \n        {\n            if (!strcmp(\"-oss_cfg\", argv[i]) && (i+1) < argc) {\n                Config::CfgFilePath = Trim(argv[i + 1]);\n                i++;\n            }\n        }\n        i++;\n    }\n}\n"
  },
  {
    "path": "test/src/Config.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <string>\nclass Config\n{\npublic:\n    static void ParseArg(int argc, char **argv);\n    static bool InitTestEnv();\n    static std::string GetDataPath();\npublic:\n    static std::string AccessKeyId;\n    static std::string AccessKeySecret;\n    static std::string Endpoint;\n    static std::string Region;\n    static std::string SecondEndpoint;\n    static std::string CallbackServer;\n    static std::string CfgFilePath;\n    static std::string PayerAccessKeyId;\n    static std::string PayerAccessKeySecret;\n    static std::string PayerUID;\n    static std::string RamRoleArn;\n    static std::string RamUID;\n};\n\n"
  },
  {
    "path": "test/src/Encryption/CipherTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <src/utils/Crc64.h>\r\n#include <src/utils/Utils.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include <alibabacloud/oss/encryption/Cipher.h>\r\n#include <alibabacloud/oss/encryption/EncryptionMaterials.h>\r\n#include <openssl/pem.h>\r\n#include <openssl/rsa.h>\r\n\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass CipherTest : public ::testing::Test {\r\nprotected:\r\n    CipherTest()\r\n    {\r\n    }\r\n\r\n    ~CipherTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase()\r\n    {\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase()\r\n    {\r\n    }\r\n\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    void TearDown() override\r\n    {\r\n    }\r\npublic:\r\n\r\n};\r\n\r\nTEST_F(CipherTest, ByteBufferTest)\r\n{\r\n    ByteBuffer buff = ByteBuffer(1024);\r\n    for (auto i = 0U; i < buff.size(); i++) {\r\n        buff[i] = static_cast<char>(i + 10U);\r\n    }\r\n    buff.resize(25U);\r\n    EXPECT_EQ(buff.size(), 25U);\r\n\r\n    for (auto i = 0U; i < buff.size(); i++) {\r\n        EXPECT_EQ(buff[i], static_cast<char>(i + 10U));\r\n    }\r\n}\r\n\r\nTEST_F(CipherTest, GenerateKeyTest)\r\n{\r\n    ByteBuffer key1 = SymmetricCipher::GenerateKey(32);\r\n    ByteBuffer key2 = SymmetricCipher::GenerateKey(32);\r\n    EXPECT_EQ(key1.size(), 32U);\r\n    EXPECT_EQ(key2.size(), 32U);\r\n    EXPECT_NE(key1, key2);\r\n\r\n    key1 = key2;\r\n    EXPECT_EQ(key1, key2);\r\n\r\n    key1 = SymmetricCipher::GenerateKey((size_t)16);\r\n    EXPECT_EQ(key1.size(), 16U);\r\n    EXPECT_NE(key1, key2);\r\n}\r\n\r\nTEST_F(CipherTest, GenerateIVTest)\r\n{\r\n    ByteBuffer iv1 = SymmetricCipher::GenerateKey((size_t)32);\r\n    ByteBuffer iv2 = SymmetricCipher::GenerateKey((size_t)32);\r\n    EXPECT_EQ(iv1.size(), 32U);\r\n    EXPECT_EQ(iv2.size(), 32U);\r\n    EXPECT_NE(iv1, iv2);\r\n\r\n    iv1 = iv2;\r\n    EXPECT_EQ(iv1, iv2);\r\n\r\n    iv1 = SymmetricCipher::GenerateKey((size_t)16);\r\n    EXPECT_EQ(iv1.size(), 16U);\r\n    EXPECT_NE(iv1, iv2);\r\n}\r\n\r\nTEST_F(CipherTest, AES128_CBCTest)\r\n{\r\n    auto cipher = SymmetricCipher::CreateAES128_CBCImpl();\r\n    auto key = ByteBuffer(16);\r\n    auto iv = ByteBuffer(16);\r\n    auto data = ByteBuffer(16);\r\n    memcpy((void *)key.data(), (void *)(\"1234567890123456\"), 16);\r\n    memcpy((void *)iv.data(), (void *)(\"1234567890123456\"), 16);\r\n    memcpy((void *)data.data(), (void *)(\"1234567890123456\"), 16);\r\n\r\n    cipher->EncryptInit(key, iv);\r\n    auto out = cipher->Encrypt(data);\r\n    auto res = cipher->EncryptFinish();\r\n    out.insert(out.end(), res.begin(), res.end());\r\n    auto encryptedOut = Base64Encode(out);\r\n    EXPECT_EQ(encryptedOut, \"2LWYSMdnDJSym1TSN54uesXryeud7lOPCtlpWV16dAw=\");\r\n\r\n    data = ByteBuffer(32);\r\n    memcpy((void *)data.data(), (void *)(\"12345678901234561234567890123456\"), 32);\r\n    cipher->EncryptInit(key, iv);\r\n    out = cipher->Encrypt(data);\r\n    res = cipher->EncryptFinish();\r\n    out.insert(out.end(), res.begin(), res.end());\r\n    encryptedOut = Base64Encode(out);\r\n    EXPECT_EQ(encryptedOut, \"2LWYSMdnDJSym1TSN54uetDw/KrpkJ7D+YYFVxZjfqGV1OFBxxlBNPpKFFwBegWk\");\r\n\r\n    data = ByteBuffer(33);\r\n    memcpy((void *)data.data(), (void *)(\"123456789012345612345678901234561\"), 33);\r\n    cipher->EncryptInit(key, iv);\r\n    out = cipher->Encrypt(data);\r\n    res = cipher->EncryptFinish();\r\n    out.insert(out.end(), res.begin(), res.end());\r\n    encryptedOut = Base64Encode(out);\r\n    EXPECT_EQ(encryptedOut, \"2LWYSMdnDJSym1TSN54uetDw/KrpkJ7D+YYFVxZjfqGzz+k3f0nDhB4D6GcOJxcy\");\r\n    \r\n    memcpy((void *)key.data(), (void *)(\"abcdefghijklmnop\"), 16);\r\n    memcpy((void *)iv.data(), (void *)(\"ABCDEFGHIJKLMNOP\"), 16);\r\n    data = ByteBuffer(34);\r\n    memcpy((void *)data.data(), (void *)(\"1234567890123456123456789012345612\"), 34);\r\n    cipher->EncryptInit(key, iv);\r\n    out = cipher->Encrypt(data);\r\n    res = cipher->EncryptFinish();\r\n    out.insert(out.end(), res.begin(), res.end());\r\n    encryptedOut = Base64Encode(out);\r\n    EXPECT_EQ(encryptedOut, \"Ck22xnBoI63Di96xD7wA4wKNM3JtJE9QLmRSYne6XaAABklNJi5Tv7U6zZW0eKWC\");\r\n\r\n    EXPECT_EQ(cipher->Name(), \"AES/CBC/PKCS5Padding\");\r\n    EXPECT_EQ(cipher->Algorithm(), CipherAlgorithm::AES);\r\n    EXPECT_EQ(cipher->Mode(), CipherMode::CBC);\r\n    EXPECT_EQ(cipher->Padding(), CipherPadding::PKCS5Padding);\r\n}\r\n\r\n\r\nTEST_F(CipherTest, AES256_CTRTest)\r\n{\r\n    auto cipher = SymmetricCipher::CreateAES256_CTRImpl();\r\n    auto key = ByteBuffer(32);\r\n    auto iv = ByteBuffer(16);\r\n    auto data = ByteBuffer(16);\r\n    memcpy((void *)key.data(), (void *)(\"12345678901234561234567890123456\"), 32);\r\n    memcpy((void *)iv.data(), (void *)(\"1234567890123456\"), 16);\r\n    memcpy((void *)data.data(), (void *)(\"1234567890123456\"), 16);\r\n\r\n    //Encrypt\r\n    cipher->EncryptInit(key, iv);\r\n    auto out = cipher->Encrypt(data);\r\n    auto encryptedOut = Base64Encode(out);\r\n    EXPECT_EQ(encryptedOut, \"wrnuWSenVochXx3m0QzCBQ==\");\r\n\r\n    cipher->EncryptInit(key, iv);\r\n    out.resize(16);\r\n    memset(out.data(), 0, out.size());\r\n    auto ret = cipher->Encrypt(out.data(), (int)data.size(), data.data(), (int)data.size());\r\n    EXPECT_EQ(ret, 16);\r\n    encryptedOut = Base64Encode(out);\r\n    EXPECT_EQ(encryptedOut, \"wrnuWSenVochXx3m0QzCBQ==\");\r\n\r\n    //Decrypt\r\n    cipher->DecryptInit(key, iv);\r\n    auto reout = cipher->Decrypt(out);\r\n    EXPECT_EQ(TestUtils::IsByteBufferEQ(reout, data), true);\r\n\r\n    cipher->DecryptInit(key, iv);\r\n    reout.resize(16);\r\n    memset(reout.data(), 0, reout.size());\r\n    ret = cipher->Decrypt(reout.data(), (int)reout.size(), out.data(), (int)out.size());\r\n    EXPECT_EQ(ret, 16);\r\n    EXPECT_EQ(TestUtils::IsByteBufferEQ(reout, data), true);\r\n\r\n\r\n    //data is empty\r\n    cipher->EncryptInit(key, iv);\r\n    out = cipher->Encrypt(ByteBuffer());\r\n    EXPECT_EQ(out.empty(), true);\r\n\r\n    ret = cipher->Encrypt(nullptr, 0, out.data(), (int)out.size());\r\n    EXPECT_EQ(ret, -1);\r\n\r\n    ret = cipher->Encrypt(out.data(), (int)out.size(), nullptr, (int)out.size());\r\n    EXPECT_EQ(ret, -1);\r\n\r\n    cipher->DecryptInit(key, iv);\r\n    reout = cipher->Decrypt(ByteBuffer());\r\n    EXPECT_EQ(reout.empty(), true);\r\n\r\n    ret = cipher->Decrypt(nullptr, 0, out.data(), (int)out.size());\r\n    EXPECT_EQ(ret, -1);\r\n\r\n    ret = cipher->Decrypt(reout.data(), (int)reout.size(), nullptr, 0);\r\n    EXPECT_EQ(ret, -1);\r\n}\r\n\r\nTEST_F(CipherTest, AES256_CTRCounterTest)\r\n{\r\n    auto cipher = SymmetricCipher::CreateAES256_CTRImpl();\r\n    auto key = ByteBuffer(32);\r\n    auto iv = ByteBuffer(16);\r\n    auto data = ByteBuffer(32);\r\n    auto data1 = ByteBuffer(16);\r\n    memcpy((void *)key.data(), (void *)(\"12345678901234561234567890123456\"), 32);\r\n    memcpy((void *)iv.data(), (void *)(\"1234567890123456\"), 16);\r\n    memcpy((void *)data.data(), (void *)(\"12345678901234561234567890123456\"), 32);\r\n    memcpy((void *)data1.data(), (void *)(\"1234567890123456\"), 16);\r\n\r\n    cipher->EncryptInit(key, iv);\r\n    auto out = cipher->Encrypt(data);\r\n\r\n    auto iv1 = SymmetricCipher::IncCTRCounter(iv, 1);\r\n    cipher->EncryptInit(key, iv1);\r\n    auto out1 = cipher->Encrypt(data1);\r\n\r\n    EXPECT_TRUE(TestUtils::IsByteBufferEQ(out.data() + 16, out1.data(), 16));\r\n}\r\n\r\n\r\nTEST_F(CipherTest, RSA_RSAPEMTest)\r\n{\r\n    auto cipher = AsymmetricCipher::CreateRSA_NONEImpl();\r\n\r\n    const std::string publicKey =\r\n        \"-----BEGIN RSA PUBLIC KEY-----\\n\"\r\n        \"MIGJAoGBALpUiB+w+r3v2Fgw0SgMbWl8bnzUVc3t3YbA89H13lrw7v6RUbL8+HGl\\n\"\r\n        \"s5YGoqD4lObG/sCQyaWd0B/XzOhjlSc1b53nyZhms84MGJ6nF2NQP+1gjY1ByDMK\\n\"\r\n        \"zeyVFFFvl9prlr6XpuJQlY0F/W4pbjLsk8Px4Qix5AoJbShElUu1AgMBAAE=\\n\"\r\n        \"-----END RSA PUBLIC KEY-----\";\r\n\r\n    const std::string privateKey = \r\n        \"-----BEGIN RSA PRIVATE KEY-----\\n\"\r\n        \"MIICXgIBAAKBgQC6VIgfsPq979hYMNEoDG1pfG581FXN7d2GwPPR9d5a8O7+kVGy\\n\"\r\n        \"/PhxpbOWBqKg+JTmxv7AkMmlndAf18zoY5UnNW+d58mYZrPODBiepxdjUD/tYI2N\\n\"\r\n        \"QcgzCs3slRRRb5faa5a+l6biUJWNBf1uKW4y7JPD8eEIseQKCW0oRJVLtQIDAQAB\\n\"\r\n        \"AoGBAJrzWRAhuSLipeMRFZ5cV1B1rdwZKBHMUYCSTTC5amPuIJGKf4p9XI4F4kZM\\n\"\r\n        \"1klO72TK72dsAIS9rCoO59QJnCpG4CvLYlJ37wA2UbhQ1rBH5dpBD/tv3CUyfdtI\\n\"\r\n        \"9CLUsZR3DGBWXYwGG0KGMYPExe5Hq3PUH9+QmuO+lXqJO4IBAkEA6iLee6oBzu6v\\n\"\r\n        \"90zrr4YA9NNr+JvtplpISOiL/XzsU6WmdXjzsFLSsZCeaJKsfdzijYEceXY7zUNa\\n\"\r\n        \"0/qQh2BKoQJBAMu61rQ5wKtql2oR4ePTSm00/iHoIfdFnBNU+b8uuPXlfwU80OwJ\\n\"\r\n        \"Gbs0xBHe+dt4uT53QLci4KgnNkHS5lu4XJUCQQCisCvrvcuX4B6BNf+mbPSJKcci\\n\"\r\n        \"biaJqr4DeyKatoz36mhpw+uAH2yrWRPZEeGtayg4rvf8Jf2TuTOJi9eVWYFBAkEA\\n\"\r\n        \"uIPzyS81TQsxL6QajpjjI52HPXZcrPOis++Wco0Cf9LnA/tczSpA38iefAETEq94\\n\"\r\n        \"NxcSycsQ5br97QfyEsgbMQJANTZ/HyMowmDPIC+n9ExdLSrf4JydARSfntFbPsy1\\n\"\r\n        \"4oC6ciKpRdtAtAtiU8s9eAUSWi7xoaPJzjAHWbmGSHHckg==\\n\"\r\n        \"-----END RSA PRIVATE KEY-----\";\r\n\r\n    cipher->setPublicKey(publicKey);\r\n    cipher->setPrivateKey(privateKey);\r\n\r\n    auto data = ByteBuffer(32);\r\n    memcpy((void *)data.data(), (void *)(\"12345678901234561234567890123456\"), 32);\r\n\r\n    auto encoded = cipher->Encrypt(data);\r\n    EXPECT_EQ(encoded.size(), 128U);\r\n\r\n    auto decoded = cipher->Decrypt(encoded);\r\n    EXPECT_EQ(decoded.size(), data.size());\r\n    EXPECT_TRUE(TestUtils::IsByteBufferEQ(data.data(), decoded.data(), (int)data.size()));\r\n    EXPECT_EQ(cipher->Name(), \"RSA/NONE/PKCS1Padding\");\r\n}\r\n\r\nTEST_F(CipherTest, RSA_PEMTest)\r\n{\r\n    auto cipher = AsymmetricCipher::CreateRSA_NONEImpl();\r\n\r\n    const std::string publicKey =\r\n        \"-----BEGIN PUBLIC KEY-----\\n\"\r\n        \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6VIgfsPq979hYMNEoDG1pfG58\\n\"\r\n        \"1FXN7d2GwPPR9d5a8O7+kVGy/PhxpbOWBqKg+JTmxv7AkMmlndAf18zoY5UnNW+d\\n\"\r\n        \"58mYZrPODBiepxdjUD/tYI2NQcgzCs3slRRRb5faa5a+l6biUJWNBf1uKW4y7JPD\\n\"\r\n        \"8eEIseQKCW0oRJVLtQIDAQAB\\n\"\r\n        \"-----END PUBLIC KEY-----\";\r\n\r\n    const std::string privateKey =\r\n        \"-----BEGIN PRIVATE KEY-----\\n\"\r\n        \"MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBALpUiB+w+r3v2Fgw\\n\"\r\n        \"0SgMbWl8bnzUVc3t3YbA89H13lrw7v6RUbL8+HGls5YGoqD4lObG/sCQyaWd0B/X\\n\"\r\n        \"zOhjlSc1b53nyZhms84MGJ6nF2NQP+1gjY1ByDMKzeyVFFFvl9prlr6XpuJQlY0F\\n\"\r\n        \"/W4pbjLsk8Px4Qix5AoJbShElUu1AgMBAAECgYEAmvNZECG5IuKl4xEVnlxXUHWt\\n\"\r\n        \"3BkoEcxRgJJNMLlqY+4gkYp/in1cjgXiRkzWSU7vZMrvZ2wAhL2sKg7n1AmcKkbg\\n\"\r\n        \"K8tiUnfvADZRuFDWsEfl2kEP+2/cJTJ920j0ItSxlHcMYFZdjAYbQoYxg8TF7ker\\n\"\r\n        \"c9Qf35Ca476Veok7ggECQQDqIt57qgHO7q/3TOuvhgD002v4m+2mWkhI6Iv9fOxT\\n\"\r\n        \"paZ1ePOwUtKxkJ5okqx93OKNgRx5djvNQ1rT+pCHYEqhAkEAy7rWtDnAq2qXahHh\\n\"\r\n        \"49NKbTT+Iegh90WcE1T5vy649eV/BTzQ7AkZuzTEEd7523i5PndAtyLgqCc2QdLm\\n\"\r\n        \"W7hclQJBAKKwK+u9y5fgHoE1/6Zs9IkpxyJuJomqvgN7Ipq2jPfqaGnD64AfbKtZ\\n\"\r\n        \"E9kR4a1rKDiu9/wl/ZO5M4mL15VZgUECQQC4g/PJLzVNCzEvpBqOmOMjnYc9dlys\\n\"\r\n        \"86Kz75ZyjQJ/0ucD+1zNKkDfyJ58ARMSr3g3FxLJyxDluv3tB/ISyBsxAkA1Nn8f\\n\"\r\n        \"IyjCYM8gL6f0TF0tKt/gnJ0BFJ+e0Vs+zLXigLpyIqlF20C0C2JTyz14BRJaLvGh\\n\"\r\n        \"o8nOMAdZuYZIcdyS\\n\"\r\n        \"-----END PRIVATE KEY-----\";\r\n\r\n    cipher->setPublicKey(publicKey);\r\n    cipher->setPrivateKey(privateKey);\r\n\r\n    auto data = ByteBuffer(32);\r\n    memcpy((void *)data.data(), (void *)(\"12345678901234561234567890123456\"), 32);\r\n\r\n    auto encoded = cipher->Encrypt(data);\r\n    EXPECT_EQ(encoded.size(), 128U);\r\n\r\n    auto decoded = cipher->Decrypt(encoded);\r\n    EXPECT_EQ(decoded.size(), data.size());\r\n    EXPECT_TRUE(TestUtils::IsByteBufferEQ(data.data(), decoded.data(), (int)data.size()));\r\n    EXPECT_EQ(cipher->Name(), \"RSA/NONE/PKCS1Padding\");\r\n}\r\n\r\n\r\nTEST_F(CipherTest, RSA_DifferentPEMTest)\r\n{\r\n    const std::string publicKey1 =\r\n        \"-----BEGIN PUBLIC KEY-----\\n\"\r\n        \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6VIgfsPq979hYMNEoDG1pfG58\\n\"\r\n        \"1FXN7d2GwPPR9d5a8O7+kVGy/PhxpbOWBqKg+JTmxv7AkMmlndAf18zoY5UnNW+d\\n\"\r\n        \"58mYZrPODBiepxdjUD/tYI2NQcgzCs3slRRRb5faa5a+l6biUJWNBf1uKW4y7JPD\\n\"\r\n        \"8eEIseQKCW0oRJVLtQIDAQAB\\n\"\r\n        \"-----END PUBLIC KEY-----\";\r\n\r\n    const std::string privateKey1 =\r\n        \"-----BEGIN PRIVATE KEY-----\\n\"\r\n        \"MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBALpUiB+w+r3v2Fgw\\n\"\r\n        \"0SgMbWl8bnzUVc3t3YbA89H13lrw7v6RUbL8+HGls5YGoqD4lObG/sCQyaWd0B/X\\n\"\r\n        \"zOhjlSc1b53nyZhms84MGJ6nF2NQP+1gjY1ByDMKzeyVFFFvl9prlr6XpuJQlY0F\\n\"\r\n        \"/W4pbjLsk8Px4Qix5AoJbShElUu1AgMBAAECgYEAmvNZECG5IuKl4xEVnlxXUHWt\\n\"\r\n        \"3BkoEcxRgJJNMLlqY+4gkYp/in1cjgXiRkzWSU7vZMrvZ2wAhL2sKg7n1AmcKkbg\\n\"\r\n        \"K8tiUnfvADZRuFDWsEfl2kEP+2/cJTJ920j0ItSxlHcMYFZdjAYbQoYxg8TF7ker\\n\"\r\n        \"c9Qf35Ca476Veok7ggECQQDqIt57qgHO7q/3TOuvhgD002v4m+2mWkhI6Iv9fOxT\\n\"\r\n        \"paZ1ePOwUtKxkJ5okqx93OKNgRx5djvNQ1rT+pCHYEqhAkEAy7rWtDnAq2qXahHh\\n\"\r\n        \"49NKbTT+Iegh90WcE1T5vy649eV/BTzQ7AkZuzTEEd7523i5PndAtyLgqCc2QdLm\\n\"\r\n        \"W7hclQJBAKKwK+u9y5fgHoE1/6Zs9IkpxyJuJomqvgN7Ipq2jPfqaGnD64AfbKtZ\\n\"\r\n        \"E9kR4a1rKDiu9/wl/ZO5M4mL15VZgUECQQC4g/PJLzVNCzEvpBqOmOMjnYc9dlys\\n\"\r\n        \"86Kz75ZyjQJ/0ucD+1zNKkDfyJ58ARMSr3g3FxLJyxDluv3tB/ISyBsxAkA1Nn8f\\n\"\r\n        \"IyjCYM8gL6f0TF0tKt/gnJ0BFJ+e0Vs+zLXigLpyIqlF20C0C2JTyz14BRJaLvGh\\n\"\r\n        \"o8nOMAdZuYZIcdyS\\n\"\r\n        \"-----END PRIVATE KEY-----\";\r\n\r\n    const std::string publicKey2 =\r\n        \"-----BEGIN PUBLIC KEY-----\\n\"\r\n        \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCokfiAVXXf5ImFzKDw+XO/UByW\\n\"\r\n        \"6mse2QsIgz3ZwBtMNu59fR5zttSx+8fB7vR4CN3bTztrP9A6bjoN0FFnhlQ3vNJC\\n\"\r\n        \"5MFO1PByrE/MNd5AAfSVba93I6sx8NSk5MzUCA4NJzAUqYOEWGtGBcom6kEF6MmR\\n\"\r\n        \"1EKib1Id8hpooY5xaQIDAQAB\\n\"\r\n        \"-----END PUBLIC KEY-----\";\r\n\r\n    const std::string privateKey2 =\r\n        \"-----BEGIN RSA PRIVATE KEY-----\\n\"\r\n        \"MIICWwIBAAKBgQCokfiAVXXf5ImFzKDw+XO/UByW6mse2QsIgz3ZwBtMNu59fR5z\\n\"\r\n        \"ttSx+8fB7vR4CN3bTztrP9A6bjoN0FFnhlQ3vNJC5MFO1PByrE/MNd5AAfSVba93\\n\"\r\n        \"I6sx8NSk5MzUCA4NJzAUqYOEWGtGBcom6kEF6MmR1EKib1Id8hpooY5xaQIDAQAB\\n\"\r\n        \"AoGAOPUZgkNeEMinrw31U3b2JS5sepG6oDG2CKpPu8OtdZMaAkzEfVTJiVoJpP2Y\\n\"\r\n        \"nPZiADhFW3e0ZAnak9BPsSsySRaSNmR465cG9tbqpXFKh9Rp/sCPo4Jq2n65yood\\n\"\r\n        \"JBrnGr6/xhYvNa14sQ6xjjfSgRNBSXD1XXNF4kALwgZyCAECQQDV7t4bTx9FbEs5\\n\"\r\n        \"36nAxPsPM6aACXaOkv6d9LXI7A0J8Zf42FeBV6RK0q7QG5iNNd1WJHSXIITUizVF\\n\"\r\n        \"6aX5NnvFAkEAybeXNOwUvYtkgxF4s28s6gn11c5HZw4/a8vZm2tXXK/QfTQrJVXp\\n\"\r\n        \"VwxmSr0FAajWAlcYN/fGkX1pWA041CKFVQJAG08ozzekeEpAuByTIOaEXgZr5MBQ\\n\"\r\n        \"gBbHpgZNBl8Lsw9CJSQI15wGfv6yDiLXsH8FyC9TKs+d5Tv4Cvquk0efOQJAd9OC\\n\"\r\n        \"lCKFs48hdyaiz9yEDsc57PdrvRFepVdj/gpGzD14mVerJbOiOF6aSV19ot27u4on\\n\"\r\n        \"Td/3aifYs0CveHzFPQJAWb4LCDwqLctfzziG7/S7Z74gyq5qZF4FUElOAZkz718E\\n\"\r\n        \"yZvADwuz/4aK0od0lX9c4Jp7Mo5vQ4TvdoBnPuGoyw==\\n\"\r\n        \"-----END RSA PRIVATE KEY-----\";\r\n\r\n    auto cipher1 = AsymmetricCipher::CreateRSA_NONEImpl();\r\n    cipher1->setPublicKey(publicKey1);\r\n    cipher1->setPrivateKey(privateKey1);\r\n\r\n    auto cipher2 = AsymmetricCipher::CreateRSA_NONEImpl();\r\n    cipher2->setPublicKey(publicKey2);\r\n    cipher2->setPrivateKey(privateKey2);\r\n\r\n    auto data = ByteBuffer(32);\r\n    memcpy((void *)data.data(), (void *)(\"12345678901234561234567890123456\"), 32);\r\n\r\n    //key1\r\n    auto encoded1 = cipher1->Encrypt(data);\r\n    EXPECT_EQ(encoded1.size(), 128U);\r\n\r\n    auto decoded1 = cipher1->Decrypt(encoded1);\r\n    EXPECT_EQ(decoded1.size(), data.size());\r\n    EXPECT_TRUE(TestUtils::IsByteBufferEQ(data, decoded1));\r\n\r\n    //key2\r\n    auto encoded2 = cipher2->Encrypt(data);\r\n    EXPECT_EQ(encoded1.size(), 128U);\r\n\r\n    auto decoded2 = cipher2->Decrypt(encoded2);\r\n    EXPECT_EQ(decoded2.size(), data.size());\r\n    EXPECT_TRUE(TestUtils::IsByteBufferEQ(data, decoded2));\r\n\r\n    //decrypt encode1 by key2\r\n    auto decoded1_2 = cipher2->Decrypt(encoded1);\r\n    EXPECT_EQ(decoded1_2.size(), 0U);\r\n\r\n    //decrypt encode2 by key1\r\n    auto decoded2_1 = cipher1->Decrypt(encoded2);\r\n    EXPECT_EQ(decoded2_1.size(), 0U);\r\n}\r\n\r\nTEST_F(CipherTest, SimpleRSAEncryptionMaterialsTest)\r\n{\r\n    const std::string publicKey1 =\r\n        \"-----BEGIN PUBLIC KEY-----\\n\"\r\n        \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6VIgfsPq979hYMNEoDG1pfG58\\n\"\r\n        \"1FXN7d2GwPPR9d5a8O7+kVGy/PhxpbOWBqKg+JTmxv7AkMmlndAf18zoY5UnNW+d\\n\"\r\n        \"58mYZrPODBiepxdjUD/tYI2NQcgzCs3slRRRb5faa5a+l6biUJWNBf1uKW4y7JPD\\n\"\r\n        \"8eEIseQKCW0oRJVLtQIDAQAB\\n\"\r\n        \"-----END PUBLIC KEY-----\";\r\n\r\n    const std::string privateKey1 =\r\n        \"-----BEGIN PRIVATE KEY-----\\n\"\r\n        \"MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBALpUiB+w+r3v2Fgw\\n\"\r\n        \"0SgMbWl8bnzUVc3t3YbA89H13lrw7v6RUbL8+HGls5YGoqD4lObG/sCQyaWd0B/X\\n\"\r\n        \"zOhjlSc1b53nyZhms84MGJ6nF2NQP+1gjY1ByDMKzeyVFFFvl9prlr6XpuJQlY0F\\n\"\r\n        \"/W4pbjLsk8Px4Qix5AoJbShElUu1AgMBAAECgYEAmvNZECG5IuKl4xEVnlxXUHWt\\n\"\r\n        \"3BkoEcxRgJJNMLlqY+4gkYp/in1cjgXiRkzWSU7vZMrvZ2wAhL2sKg7n1AmcKkbg\\n\"\r\n        \"K8tiUnfvADZRuFDWsEfl2kEP+2/cJTJ920j0ItSxlHcMYFZdjAYbQoYxg8TF7ker\\n\"\r\n        \"c9Qf35Ca476Veok7ggECQQDqIt57qgHO7q/3TOuvhgD002v4m+2mWkhI6Iv9fOxT\\n\"\r\n        \"paZ1ePOwUtKxkJ5okqx93OKNgRx5djvNQ1rT+pCHYEqhAkEAy7rWtDnAq2qXahHh\\n\"\r\n        \"49NKbTT+Iegh90WcE1T5vy649eV/BTzQ7AkZuzTEEd7523i5PndAtyLgqCc2QdLm\\n\"\r\n        \"W7hclQJBAKKwK+u9y5fgHoE1/6Zs9IkpxyJuJomqvgN7Ipq2jPfqaGnD64AfbKtZ\\n\"\r\n        \"E9kR4a1rKDiu9/wl/ZO5M4mL15VZgUECQQC4g/PJLzVNCzEvpBqOmOMjnYc9dlys\\n\"\r\n        \"86Kz75ZyjQJ/0ucD+1zNKkDfyJ58ARMSr3g3FxLJyxDluv3tB/ISyBsxAkA1Nn8f\\n\"\r\n        \"IyjCYM8gL6f0TF0tKt/gnJ0BFJ+e0Vs+zLXigLpyIqlF20C0C2JTyz14BRJaLvGh\\n\"\r\n        \"o8nOMAdZuYZIcdyS\\n\"\r\n        \"-----END PRIVATE KEY-----\";\r\n\r\n    const std::string publicKey2 =\r\n        \"-----BEGIN PUBLIC KEY-----\\n\"\r\n        \"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCokfiAVXXf5ImFzKDw+XO/UByW\\n\"\r\n        \"6mse2QsIgz3ZwBtMNu59fR5zttSx+8fB7vR4CN3bTztrP9A6bjoN0FFnhlQ3vNJC\\n\"\r\n        \"5MFO1PByrE/MNd5AAfSVba93I6sx8NSk5MzUCA4NJzAUqYOEWGtGBcom6kEF6MmR\\n\"\r\n        \"1EKib1Id8hpooY5xaQIDAQAB\\n\"\r\n        \"-----END PUBLIC KEY-----\";\r\n\r\n    const std::string privateKey2 =\r\n        \"-----BEGIN RSA PRIVATE KEY-----\\n\"\r\n        \"MIICWwIBAAKBgQCokfiAVXXf5ImFzKDw+XO/UByW6mse2QsIgz3ZwBtMNu59fR5z\\n\"\r\n        \"ttSx+8fB7vR4CN3bTztrP9A6bjoN0FFnhlQ3vNJC5MFO1PByrE/MNd5AAfSVba93\\n\"\r\n        \"I6sx8NSk5MzUCA4NJzAUqYOEWGtGBcom6kEF6MmR1EKib1Id8hpooY5xaQIDAQAB\\n\"\r\n        \"AoGAOPUZgkNeEMinrw31U3b2JS5sepG6oDG2CKpPu8OtdZMaAkzEfVTJiVoJpP2Y\\n\"\r\n        \"nPZiADhFW3e0ZAnak9BPsSsySRaSNmR465cG9tbqpXFKh9Rp/sCPo4Jq2n65yood\\n\"\r\n        \"JBrnGr6/xhYvNa14sQ6xjjfSgRNBSXD1XXNF4kALwgZyCAECQQDV7t4bTx9FbEs5\\n\"\r\n        \"36nAxPsPM6aACXaOkv6d9LXI7A0J8Zf42FeBV6RK0q7QG5iNNd1WJHSXIITUizVF\\n\"\r\n        \"6aX5NnvFAkEAybeXNOwUvYtkgxF4s28s6gn11c5HZw4/a8vZm2tXXK/QfTQrJVXp\\n\"\r\n        \"VwxmSr0FAajWAlcYN/fGkX1pWA041CKFVQJAG08ozzekeEpAuByTIOaEXgZr5MBQ\\n\"\r\n        \"gBbHpgZNBl8Lsw9CJSQI15wGfv6yDiLXsH8FyC9TKs+d5Tv4Cvquk0efOQJAd9OC\\n\"\r\n        \"lCKFs48hdyaiz9yEDsc57PdrvRFepVdj/gpGzD14mVerJbOiOF6aSV19ot27u4on\\n\"\r\n        \"Td/3aifYs0CveHzFPQJAWb4LCDwqLctfzziG7/S7Z74gyq5qZF4FUElOAZkz718E\\n\"\r\n        \"yZvADwuz/4aK0od0lX9c4Jp7Mo5vQ4TvdoBnPuGoyw==\\n\"\r\n        \"-----END RSA PRIVATE KEY-----\";\r\n\r\n    auto cipher = AsymmetricCipher::CreateRSA_NONEImpl();\r\n\r\n    const ByteBuffer key = SymmetricCipher::GenerateKey(32);\r\n    const ByteBuffer iv = SymmetricCipher::GenerateKey(16);\r\n    std::map<std::string, std::string> description1;\r\n    std::map<std::string, std::string> description2;\r\n    std::map<std::string, std::string> description3;\r\n    description1[\"desc\"] = \"key1\";\r\n    description2[\"desc\"] = \"key2\";\r\n\r\n    cipher->setPublicKey(publicKey1);\r\n    const ByteBuffer encryptedKey1 = cipher->Encrypt(key);\r\n    const ByteBuffer encryptedIV1  = cipher->Encrypt(iv);\r\n\r\n    cipher->setPublicKey(publicKey2);\r\n    const ByteBuffer encryptedKey2 = cipher->Encrypt(key);\r\n    const ByteBuffer encryptedIV2 = cipher->Encrypt(iv);\r\n\r\n    EXPECT_TRUE(!encryptedKey1.empty());\r\n    EXPECT_TRUE(!encryptedIV1.empty());\r\n\r\n    EXPECT_EQ(encryptedKey1.size(), encryptedKey2.size());\r\n    EXPECT_EQ(encryptedIV1.size(), encryptedIV2.size());\r\n\r\n    SimpleRSAEncryptionMaterials materials(publicKey1, privateKey1, description1);\r\n    materials.addEncryptionMaterial(publicKey2, privateKey2, description2);\r\n\r\n    int ret;\r\n\r\n    //EncryptCEK\r\n    ContentCryptoMaterial content;\r\n    content.setCipherName(\"AES/CTR/NoPadding\");\r\n    content.setContentKey(key);\r\n    content.setContentIV(iv);\r\n    ret = materials.EncryptCEK(content);\r\n    EXPECT_EQ(0, ret);\r\n    EXPECT_EQ(description1, content.Description());\r\n\r\n    //DecryptCEK\r\n    content.setKeyWrapAlgorithm(\"RSA/NONE/PKCS1Padding\");\r\n    content.setContentKey(ByteBuffer());\r\n    content.setContentIV(ByteBuffer());\r\n    content.setEncryptedContentKey(encryptedKey2);\r\n    content.setEncryptedContentIV(encryptedIV2);\r\n    content.setDescription(description2);\r\n    ret = materials.DecryptCEK(content);\r\n    EXPECT_EQ(0, ret);\r\n    EXPECT_TRUE(TestUtils::IsByteBufferEQ(key.data(), content.ContentKey().data(), (int)key.size()));\r\n    EXPECT_TRUE(TestUtils::IsByteBufferEQ(iv.data(), content.ContentIV().data(), (int)iv.size()));\r\n\r\n    content.setContentKey(ByteBuffer());\r\n    content.setContentIV(ByteBuffer());\r\n    content.setEncryptedContentKey(encryptedKey1);\r\n    content.setEncryptedContentIV(encryptedIV1);\r\n    content.setDescription(description1);\r\n    ret = materials.DecryptCEK(content);\r\n    EXPECT_EQ(0, ret);\r\n    EXPECT_TRUE(TestUtils::IsByteBufferEQ(key.data(), content.ContentKey().data(), (int)key.size()));\r\n    EXPECT_TRUE(TestUtils::IsByteBufferEQ(iv.data(), content.ContentIV().data(), (int)iv.size()));\r\n\r\n    //EncryptCEK fail with no key or no iv\r\n    content.setCipherName(\"AES/CTR/NoPadding\");\r\n    content.setContentKey(key);\r\n    content.setContentIV(ByteBuffer());\r\n    ret = materials.EncryptCEK(content);\r\n    EXPECT_TRUE(ret != 0);\r\n\r\n    content.setContentKey(ByteBuffer());\r\n    content.setContentIV(iv);\r\n    ret = materials.EncryptCEK(content);\r\n    EXPECT_TRUE(ret != 0);\r\n\r\n    content.setContentKey(ByteBuffer());\r\n    content.setContentIV(ByteBuffer());\r\n    ret = materials.EncryptCEK(content);\r\n    EXPECT_TRUE(ret != 0);\r\n\r\n    //DecryptCEK fail with no key or no iv\r\n    content.setKeyWrapAlgorithm(\"RSA/NONE/PKCS1Padding\");\r\n    content.setEncryptedContentKey(ByteBuffer());\r\n    content.setEncryptedContentIV(ByteBuffer());\r\n    content.setDescription(description1);\r\n    ret = materials.DecryptCEK(content);\r\n    EXPECT_TRUE(ret != 0);\r\n\r\n    content.setEncryptedContentKey(encryptedKey1);\r\n    content.setEncryptedContentIV(ByteBuffer());\r\n    content.setDescription(description1);\r\n    ret = materials.DecryptCEK(content);\r\n    EXPECT_TRUE(ret != 0);\r\n\r\n    content.setEncryptedContentKey(ByteBuffer());\r\n    content.setEncryptedContentIV(encryptedIV1);\r\n    content.setDescription(description1);\r\n    ret = materials.DecryptCEK(content);\r\n    EXPECT_TRUE(ret != 0);\r\n\r\n    //DecryptCEK fail with no desc\r\n    content.setEncryptedContentKey(encryptedKey1);\r\n    content.setEncryptedContentIV(encryptedIV1);\r\n    content.setDescription(description3);\r\n    ret = materials.DecryptCEK(content);\r\n    EXPECT_TRUE(ret != 0);\r\n\r\n    //DecryptCEK fail with non-match algo\r\n    content.setKeyWrapAlgorithm(\"None\");\r\n    content.setEncryptedContentKey(encryptedKey1);\r\n    content.setEncryptedContentIV(encryptedIV1);\r\n    content.setDescription(description1);\r\n    ret = materials.DecryptCEK(content);\r\n    EXPECT_TRUE(ret != 0);\r\n    \r\n    //key invalid test\r\n    SimpleRSAEncryptionMaterials invalidMaterials(\"invalid\", \"invalid\");\r\n    content.setCipherName(\"AES/CTR/NoPadding\");\r\n    content.setContentKey(key);\r\n    content.setContentIV(iv);\r\n    ret = invalidMaterials.EncryptCEK(content);\r\n    EXPECT_TRUE(ret != 0);\r\n\r\n    content.setKeyWrapAlgorithm(\"RSA/NONE/PKCS1Padding\");\r\n    content.setEncryptedContentKey(encryptedKey2);\r\n    content.setEncryptedContentIV(encryptedIV2);\r\n    content.setDescription(description2);\r\n    ret = invalidMaterials.DecryptCEK(content);\r\n    EXPECT_TRUE(ret != 0);\r\n\r\n}\r\n\r\n\r\n}\r\n}"
  },
  {
    "path": "test/src/Encryption/CryptoObjectTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <src/utils/Crc64.h>\r\n#include \"src/utils/FileSystemUtils.h\"\r\n#include \"src/utils/Utils.h\"\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include <alibabacloud/oss/OssEncryptionClient.h>\r\n#include <fstream>\r\n\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass CryptoObjectTest : public ::testing::Test {\r\nprotected:\r\n    CryptoObjectTest()\r\n    {\r\n    }\r\n\r\n    ~CryptoObjectTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase()\r\n    {\r\n        const std::string publicKey =\r\n            \"-----BEGIN RSA PUBLIC KEY-----\\n\"\n            \"MIGJAoGBALpUiB+w+r3v2Fgw0SgMbWl8bnzUVc3t3YbA89H13lrw7v6RUbL8+HGl\\n\"\n            \"s5YGoqD4lObG/sCQyaWd0B/XzOhjlSc1b53nyZhms84MGJ6nF2NQP+1gjY1ByDMK\\n\"\n            \"zeyVFFFvl9prlr6XpuJQlY0F/W4pbjLsk8Px4Qix5AoJbShElUu1AgMBAAE=\\n\"\n            \"-----END RSA PUBLIC KEY-----\";\r\n\r\n        const std::string privateKey =\r\n            \"-----BEGIN RSA PRIVATE KEY-----\\n\"\r\n            \"MIICXgIBAAKBgQC6VIgfsPq979hYMNEoDG1pfG581FXN7d2GwPPR9d5a8O7+kVGy\\n\"\r\n            \"/PhxpbOWBqKg+JTmxv7AkMmlndAf18zoY5UnNW+d58mYZrPODBiepxdjUD/tYI2N\\n\"\r\n            \"QcgzCs3slRRRb5faa5a+l6biUJWNBf1uKW4y7JPD8eEIseQKCW0oRJVLtQIDAQAB\\n\"\r\n            \"AoGBAJrzWRAhuSLipeMRFZ5cV1B1rdwZKBHMUYCSTTC5amPuIJGKf4p9XI4F4kZM\\n\"\r\n            \"1klO72TK72dsAIS9rCoO59QJnCpG4CvLYlJ37wA2UbhQ1rBH5dpBD/tv3CUyfdtI\\n\"\r\n            \"9CLUsZR3DGBWXYwGG0KGMYPExe5Hq3PUH9+QmuO+lXqJO4IBAkEA6iLee6oBzu6v\\n\"\r\n            \"90zrr4YA9NNr+JvtplpISOiL/XzsU6WmdXjzsFLSsZCeaJKsfdzijYEceXY7zUNa\\n\"\r\n            \"0/qQh2BKoQJBAMu61rQ5wKtql2oR4ePTSm00/iHoIfdFnBNU+b8uuPXlfwU80OwJ\\n\"\r\n            \"Gbs0xBHe+dt4uT53QLci4KgnNkHS5lu4XJUCQQCisCvrvcuX4B6BNf+mbPSJKcci\\n\"\r\n            \"biaJqr4DeyKatoz36mhpw+uAH2yrWRPZEeGtayg4rvf8Jf2TuTOJi9eVWYFBAkEA\\n\"\r\n            \"uIPzyS81TQsxL6QajpjjI52HPXZcrPOis++Wco0Cf9LnA/tczSpA38iefAETEq94\\n\"\r\n            \"NxcSycsQ5br97QfyEsgbMQJANTZ/HyMowmDPIC+n9ExdLSrf4JydARSfntFbPsy1\\n\"\r\n            \"4oC6ciKpRdtAtAtiU8s9eAUSWi7xoaPJzjAHWbmGSHHckg==\\n\"\r\n            \"-----END RSA PRIVATE KEY-----\";\r\n\r\n        Endpoint = Config::Endpoint;\n        Client = std::make_shared<OssEncryptionClient>(Endpoint, Config::AccessKeyId, Config::AccessKeySecret,\r\n            ClientConfiguration(), std::make_shared<SimpleRSAEncryptionMaterials>(publicKey, privateKey),\r\n            CryptoConfiguration());\r\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-crypto-object\");\r\n        Client->CreateBucket(BucketName);\r\n        TestFile = TestUtils::GetTargetFileName(\"cpp-sdk-multipartupload\");\r\n        TestUtils::WriteRandomDatatoFile(TestFile, 1 * 1024 * 1024 + 100);\r\n        TestFileMd5 = TestUtils::GetFileMd5(TestFile);\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase()\r\n    {\r\n        RemoveFile(TestFile);\r\n        TestUtils::CleanBucket(*Client, BucketName);\r\n        Client = nullptr;\r\n    }\r\n\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    void TearDown() override\r\n    {\r\n    }\r\npublic:\r\n    static std::shared_ptr<OssEncryptionClient> Client;\r\n    static std::string BucketName;\r\n    static std::string TestFile;\r\n    static std::string TestFileMd5;\r\n    static std::string Endpoint;\r\n};\r\n\r\nstd::shared_ptr<OssEncryptionClient> CryptoObjectTest::Client = nullptr;\r\nstd::string CryptoObjectTest::BucketName = \"\";\r\nstd::string CryptoObjectTest::TestFile = \"\";\r\nstd::string CryptoObjectTest::TestFileMd5 = \"\";\r\nstd::string CryptoObjectTest::Endpoint = \"\";\r\n\r\nconst int DownloadPartFailedFlag = 1 << 30;\n\r\n\r\nstatic int64_t GetFileLength(const std::string& file)\r\n{\r\n    std::fstream f(file, std::ios::in | std::ios::binary);\r\n    f.seekg(0, f.end);\r\n    int64_t size = f.tellg();\r\n    f.close();\r\n    return size;\r\n}\r\n\r\nstatic int CalculatePartCount(int64_t totalSize, int singleSize)\r\n{\r\n    // Calculate the part count\r\n    auto partCount = (int)(totalSize / singleSize);\r\n    if (totalSize % singleSize != 0)\r\n    {\r\n        partCount++;\r\n    }\r\n    return partCount;\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutAndGetObjectTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutAndGetObjectTest\");\r\n    auto content = std::make_shared<std::stringstream>();\r\n    *content << \"123\";\r\n\r\n    PutObjectRequest pRequest(BucketName, key, content);\r\n    auto pOutcome = Client->PutObject(pRequest);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() == nullptr);\r\n\r\n    GetObjectRequest gRequest(BucketName, key);\r\n    auto outcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    \r\n    auto oriMd5 = ComputeContentMD5(*content);\r\n    auto getMd5 = ComputeContentMD5(*outcome.result().Content());\r\n\r\n    auto ss = std::make_shared<std::stringstream>();\r\n    outcome = Client->GetObject(BucketName, key, ss);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    getMd5 = ComputeContentMD5(*ss);\r\n\r\n    EXPECT_EQ(oriMd5, getMd5);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectBasicTest)\r\n{\r\n    GetObjectOutcome dummy;\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectBasicTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectBasicTest\").append(\".tmp\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto outcome = Client->GetObject(GetObjectRequest(BucketName, key));\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto fOutcome = Client->GetObject(BucketName, key, tmpFile);\r\n    EXPECT_EQ(fOutcome.isSuccess(), true);\r\n    fOutcome = dummy;\r\n\r\n    std::shared_ptr<std::iostream> fileContent = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content.get());\r\n    std::string memMd5 = ComputeContentMD5(*outcome.result().Content().get());\r\n    std::string fileMd5 = ComputeContentMD5(*fileContent.get());\r\n\r\n    EXPECT_STREQ(oriMd5.c_str(), memMd5.c_str());\r\n    EXPECT_STREQ(oriMd5.c_str(), fileMd5.c_str());\r\n    fileContent = nullptr;\r\n    EXPECT_EQ(RemoveFile(tmpFile), true);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectToFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectToFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectBasicTest\").append(\".tmp\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto fOutcome = Client->GetObject(BucketName, key, tmpFile);\r\n    EXPECT_EQ(fOutcome.isSuccess(), true);\r\n\r\n    auto fileETag = TestUtils::GetFileETag(tmpFile);\r\n\r\n    EXPECT_NE(fileETag, pOutcome.result().ETag());\r\n\r\n    fOutcome.result().setContent(std::shared_ptr<std::iostream>());\r\n\r\n    EXPECT_EQ(RemoveFile(tmpFile), true);\r\n}\r\n\r\n\r\nTEST_F(CryptoObjectTest, GetObjectToNullContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectToNullContentTest\");\r\n    std::shared_ptr<std::iostream> content = nullptr;\r\n    auto outcome = Client->GetObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectToFailContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectToFailContentTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectBasicNegativeTest\").append(\".tmp\");\r\n\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n    auto outcome = Client->GetObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectToBadContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectToBadContentTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectBasicNegativeTest\").append(\".tmp\");\r\n\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\r\n    content->setstate(content->badbit);\r\n    auto outcome = Client->GetObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectToBadKeyTest)\r\n{\r\n    std::string key = \"/InvalidObjectName\";\r\n    auto outcome = Client->GetObject(GetObjectRequest(BucketName, key));\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectUsingRangeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectUsingRangeTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    GetObjectRequest request(BucketName, key);\r\n    request.setRange(10, 19);\r\n    auto outcome = Client->GetObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    char buffer[10];\r\n    content->clear();\r\n    content->seekg(10, content->beg);\r\n    EXPECT_EQ(content->good(), true);\r\n    content->read(buffer, 10);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(buffer, 10);\r\n    std::string memMd5 = ComputeContentMD5(*outcome.result().Content().get());\r\n\r\n    EXPECT_STREQ(oriMd5.c_str(), memMd5.c_str());\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectUsingRangeNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectUsingRangeNegativeTest\");\r\n\r\n    GetObjectRequest request(BucketName, key);\r\n    request.setRange(10, 9);\r\n    auto outcome = Client->GetObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_TRUE(strstr(outcome.error().Message().c_str(), \"The range is invalid.\") != nullptr);\r\n\r\n    request.setRange(10, -2);\r\n    outcome = Client->GetObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_TRUE(strstr(outcome.error().Message().c_str(), \"The range is invalid.\") != nullptr);\r\n\r\n    request.setRange(-1, 9);\r\n    outcome = Client->GetObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_TRUE(strstr(outcome.error().Message().c_str(), \"The range is invalid.\") != nullptr);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectMatchingETagPositiveTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectMatchingETagPositiveTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    std::string eTag = outcome.result().ETag();\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.addMatchingETagConstraint(eTag);\r\n\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_STREQ(gOutcome.result().Metadata().ETag().c_str(), eTag.c_str());\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectMatchingETagsPositiveTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectMatchingETagsPositiveTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    std::string eTag = outcome.result().ETag();\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    std::vector<std::string> eTagList;\r\n    eTagList.push_back(eTag);\r\n    reqeust.addMatchingETagConstraint(\"invalidETag\");\r\n    reqeust.setMatchingETagConstraints(eTagList);\r\n\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_STREQ(gOutcome.result().Metadata().ETag().c_str(), eTag.c_str());\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectMatchingETagNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectMatchingETagNegativeTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.addMatchingETagConstraint(\"Dummy1\");\r\n    reqeust.addMatchingETagConstraint(\"Dummy2\");\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_STREQ(gOutcome.error().Code().c_str(), \"PreconditionFailed\");\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectModifiedSincePositiveTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectModifiedSincePositiveTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    std::string timeStr = TestUtils::GetGMTString(-10);\r\n\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.setModifiedSinceConstraint(timeStr);\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectModifiedSinceNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectModifiedSinceNegativeTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    std::string timeStr = TestUtils::GetGMTString(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.setModifiedSinceConstraint(timeStr);\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_STREQ(gOutcome.error().Code().c_str(), \"ServerError:304\");\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectNonMatchingETagPositiveTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectNonMatchingETagPositiveTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    std::string eTag = \"Dummy\";\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.addNonmatchingETagConstraint(eTag);\r\n\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectNonMatchingETagsPositiveTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectNonMatchingETagsPositiveTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    std::vector<std::string> eTagList;\r\n    eTagList.push_back(\"Dummy1\");\r\n    eTagList.push_back(\"Dummy2\");\r\n    reqeust.setNonmatchingETagConstraints(eTagList);\r\n\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectNonMatchingETagNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectNonMatchingETagNegativeTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    std::string eTag = outcome.result().ETag();\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.addNonmatchingETagConstraint(eTag);\r\n\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_STREQ(gOutcome.error().Code().c_str(), \"ServerError:304\");\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectUnmodifiedSincePositiveTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectUnmodifiedSincePositiveTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    std::string timeStr = TestUtils::GetGMTString(100);\r\n\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.setUnmodifiedSinceConstraint(timeStr);\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectUnmodifiedSinceNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectUnmodifiedSinceNegativeTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    std::string timeStr = TestUtils::GetGMTString(-10);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.setUnmodifiedSinceConstraint(timeStr);\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_STREQ(gOutcome.error().Code().c_str(), \"PreconditionFailed\");\r\n}\r\n\r\n/* no supported\r\nTEST_F(CryptoObjectTest, GetObjectWithResponseHeadersSettingTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectWithResponseHeadersSettingTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    std::string timeStr = TestUtils::GetGMTString(100);\r\n\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().Metadata().ContentType(), \"application/octet-stream\");\r\n\r\n    reqeust.addResponseHeaders(RequestResponseHeader::ContentType, \"test/haah\");\r\n    gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().Metadata().ContentType(), \"test/haah\");\r\n}\r\n*/\r\n\r\nclass GetObjectAsyncContex : public AsyncCallerContext\r\n{\r\npublic:\r\n    GetObjectAsyncContex() :ready(false) {}\r\n    ~GetObjectAsyncContex() {}\r\n    mutable std::mutex mtx;\r\n    mutable std::condition_variable cv;\r\n    mutable std::string md5;\r\n    mutable bool ready;\r\n};\r\n\r\nstatic void GetObjectHandler(const AlibabaCloud::OSS::OssClient* client,\r\n    const GetObjectRequest& request,\r\n    const GetObjectOutcome& outcome,\r\n    const std::shared_ptr<const AsyncCallerContext>& context)\r\n{\r\n    std::cout << \"Client[\" << client << \"]\" << \"GetObjectHandler\" << \", key:\" << request.Key() << std::endl;\r\n    if (context != nullptr) {\r\n        auto ctx = static_cast<const GetObjectAsyncContex *>(context.get());\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        std::string memMd5 = ComputeContentMD5(*outcome.result().Content().get());\r\n        ctx->md5 = memMd5;\r\n        std::unique_lock<std::mutex> lck(ctx->mtx);\r\n        ctx->ready = true;\r\n        ctx->cv.notify_all();\r\n    }\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectAsyncBasicTest)\r\n{\r\n    GetObjectOutcome dummy;\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectAsyncBasicTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectAsyncBasicTest\").append(\".tmp\");\r\n    auto content = TestUtils::GetRandomStream(102400);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    GetObjectAsyncHandler handler = GetObjectHandler;\r\n    GetObjectRequest request(BucketName, key);\r\n    std::shared_ptr<GetObjectAsyncContex> memContext = std::make_shared<GetObjectAsyncContex>();\r\n\r\n    GetObjectRequest fileRequest(BucketName, key);\r\n    fileRequest.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios_base::out | std::ios_base::trunc | std::ios::binary); });\r\n    std::shared_ptr<GetObjectAsyncContex> fileContext = std::make_shared<GetObjectAsyncContex>();\r\n\r\n    Client->GetObjectAsync(request, handler, memContext);\r\n    Client->GetObjectAsync(fileRequest, handler, fileContext);\r\n    std::cout << \"Client[\" << Client << \"]\" << \"Issue GetObjectAsync done.\" << std::endl;\r\n\r\n    {\r\n        std::unique_lock<std::mutex> lck(fileContext->mtx);\r\n        if (!fileContext->ready) fileContext->cv.wait(lck);\r\n    }\r\n\r\n    {\r\n        std::unique_lock<std::mutex> lck(memContext->mtx);\r\n        if (!memContext->ready) memContext->cv.wait(lck);\r\n    }\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content.get());\r\n\r\n    EXPECT_EQ(oriMd5, memContext->md5);\r\n    EXPECT_EQ(oriMd5, fileContext->md5);\r\n    memContext = nullptr;\r\n    fileContext = nullptr;\r\n    TestUtils::WaitForCacheExpire(1);\r\n    EXPECT_EQ(RemoveFile(tmpFile), true);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectCallableBasicTest)\r\n{\r\n    GetObjectOutcome dummy;\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectCallableBasicTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectCallableBasicTest\").append(\".tmp\");\r\n    auto content = TestUtils::GetRandomStream(102400);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    GetObjectRequest request(BucketName, key);\r\n    std::shared_ptr<GetObjectAsyncContex> memContext = std::make_shared<GetObjectAsyncContex>();\r\n\r\n    GetObjectRequest fileRequest(BucketName, key);\r\n    fileRequest.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios_base::out | std::ios_base::trunc | std::ios::binary); });\r\n\r\n    auto memOutcomeCallable = Client->GetObjectCallable(request);\r\n    auto fileOutcomeCallable = Client->GetObjectCallable(fileRequest);\r\n\r\n\r\n    std::cout << \"Client[\" << Client << \"]\" << \"Issue GetObjectCallable done.\" << std::endl;\r\n\r\n    auto fileOutcome = fileOutcomeCallable.get();\r\n    auto memOutcome = memOutcomeCallable.get();\r\n    EXPECT_EQ(fileOutcome.isSuccess(), true);\r\n    EXPECT_EQ(memOutcome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content.get());\r\n    std::string memMd5 = ComputeContentMD5(*memOutcome.result().Content());\r\n    std::string fileMd5 = ComputeContentMD5(*fileOutcome.result().Content());\r\n\r\n    EXPECT_EQ(oriMd5, fileMd5);\r\n    EXPECT_EQ(oriMd5, fileMd5);\r\n    memOutcome = dummy;\r\n    fileOutcome = dummy;\r\n    //EXPECT_EQ(RemoveFile(tmpFile), true);\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectBasicTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectBasicTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() == nullptr);\r\n\r\n    auto outcome = Client->GetObject(GetObjectRequest(BucketName, key));\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content);\r\n    std::string memMd5 = ComputeContentMD5(*outcome.result().Content());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectWithExpiresTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithExpiresTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.MetaData().setContentType(\"application/x-test\");\r\n    request.setExpires(TestUtils::GetGMTString(120));\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto outcome = Client->GetObject(GetObjectRequest(BucketName, key));\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content);\r\n    std::string memMd5 = ComputeContentMD5(*outcome.result().Content());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectUsingContentLengthTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectUsingContentLengthTest\");\r\n    std::shared_ptr<std::stringstream> content = std::make_shared<std::stringstream>();\r\n    *content << \"123456789\";\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.MetaData().setContentLength(2);\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto outcome = Client->GetObject(GetObjectRequest(BucketName, key));\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(\"12\", 2);\r\n    std::string memMd5 = ComputeContentMD5(*outcome.result().Content().get());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectFullSettingsTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectFullSettingsTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    key.append(\"/attachement_test.data\");\r\n\r\n    std::string saveAs = \"abc123.zip\";\r\n    std::string contentDisposition = \"attachment;filename*=utf-8''\";\r\n    contentDisposition.append(UrlEncode(saveAs));\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.setCacheControl(\"no-cache\");\r\n    request.setContentDisposition(contentDisposition);\r\n    request.setContentEncoding(\"gzip\");\r\n\r\n    std::string contentMd5 = ComputeContentMD5(*content);\r\n    request.setContentMd5(contentMd5);\r\n\r\n    //user metadata\r\n    request.MetaData().UserMetaData()[\"MyKey1\"] = \"MyValue1\";\r\n    request.MetaData().UserMetaData()[\"MyKey2\"] = \"MyValue2\";\r\n    request.MetaData().UserMetaData()[\"MyKey3\"] = \"\";\r\n\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto metaOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\r\n\r\n    EXPECT_EQ(metaOutcome.result().CacheControl(), \"no-cache\");\r\n    EXPECT_EQ(metaOutcome.result().ContentDisposition(), contentDisposition);\r\n    EXPECT_EQ(metaOutcome.result().ContentEncoding(), \"gzip\");\r\n\r\n    EXPECT_EQ(metaOutcome.result().UserMetaData().at(\"MyKey1\"), \"MyValue1\");\r\n    EXPECT_EQ(metaOutcome.result().UserMetaData().at(\"MyKey2\"), \"MyValue2\");\r\n    EXPECT_EQ(metaOutcome.result().UserMetaData().at(\"MyKey3\"), \"\");\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectDefaultMetadataTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectDefaultMetadataTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectFromFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectFromFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectFromFileTest\").append(\"-put.tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, tmpFile);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto outcome = Client->GetObject(GetObjectRequest(BucketName, key));\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    std::fstream file(tmpFile, std::ios::in | std::ios::binary);\r\n    std::string oriMd5 = ComputeContentMD5(file);\r\n    std::string memMd5 = ComputeContentMD5(*outcome.result().Content());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n    file.close();\r\n    EXPECT_EQ(RemoveFile(tmpFile), true);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectUsingContentLengthFromFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectUsingContentLengthFromFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectUsingContentLengthFromFileTest\").append(\"-put.tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    std::shared_ptr<std::fstream> file = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(file->good(), true);\r\n\r\n    file->seekg(0, file->end);\r\n    auto content_length = file->tellg();\r\n    EXPECT_EQ(content_length, 1024LL);\r\n\r\n    file->seekg(content_length / 2, file->beg);\r\n\r\n    PutObjectRequest request(BucketName, key, file);\r\n    request.MetaData().setContentLength(content_length / 2);\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto outcome = Client->GetObject(GetObjectRequest(BucketName, key));\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    char buff[2048];\r\n    file->clear();\r\n    file->seekg(content_length / 2, file->beg);\r\n    file->read(buff, 2048);\r\n    size_t readSize = static_cast<size_t>(file->gcount());\r\n\r\n    std::string oriMd5 = ComputeContentMD5(buff, readSize);\r\n    std::string memMd5 = ComputeContentMD5(*outcome.result().Content().get());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n    file->close();\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectFullSettingsFromFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectFullSettingsFromFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectFullSettingsFromFileTest\").append(\"-put.tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    std::shared_ptr<std::fstream> file = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(file->good(), true);\r\n    key.append(\"/attachement_test.data\");\r\n\r\n    std::string saveAs = \"abc123.zip\";\r\n    std::string contentDisposition = \"attachment;filename*=utf-8''\";\r\n    contentDisposition.append(UrlEncode(saveAs));\r\n\r\n    PutObjectRequest request(BucketName, key, file);\r\n    request.setCacheControl(\"no-cache\");\r\n    request.setContentDisposition(contentDisposition);\r\n    request.setContentEncoding(\"gzip\");\r\n\r\n    std::string contentMd5 = ComputeContentMD5(*file);\r\n    request.setContentMd5(contentMd5);\r\n\r\n    //user metadata\r\n    request.MetaData().UserMetaData()[\"MyKey1\"] = \"MyValue1\";\r\n    request.MetaData().UserMetaData()[\"MyKey2\"] = \"MyValue2\";\r\n\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto metaOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\r\n\r\n    EXPECT_EQ(metaOutcome.result().CacheControl(), \"no-cache\");\r\n    EXPECT_EQ(metaOutcome.result().ContentDisposition(), contentDisposition);\r\n    EXPECT_EQ(metaOutcome.result().ContentEncoding(), \"gzip\");\r\n\r\n    EXPECT_EQ(metaOutcome.result().UserMetaData().at(\"MyKey1\"), \"MyValue1\");\r\n    EXPECT_EQ(metaOutcome.result().UserMetaData().at(\"MyKey2\"), \"MyValue2\");\r\n    file->close();\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectDefaultMetadataFromFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectDefaultMetadataFromFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectDefaultMetadataFromFileTest\").append(\"-put.tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    std::shared_ptr<std::fstream> file = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(file->good(), true);\r\n\r\n    auto outcome = Client->PutObject(BucketName, key, file);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n    file->close();\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectUserMetadataFromFileContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectUserMetadataFromFileContentTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectUserMetadataFromFileContentTest\").append(\"-put.tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    std::shared_ptr<std::fstream> file = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(file->good(), true);\r\n\r\n    PutObjectRequest request(BucketName, key, file);\r\n    request.MetaData().UserMetaData()[\"test\"] = \"testvalue\";\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n\r\n    auto hOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().UserMetaData().at(\"test\"), \"testvalue\");\r\n    file->close();\r\n    file = nullptr;\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectUserMetadataFromFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectUserMetadataFromFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectUserMetadataFromFileTest\").append(\"-put.tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    std::shared_ptr<std::fstream> file = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n\r\n    ObjectMetaData metaData;\r\n    PutObjectRequest request(BucketName, key, file);\r\n    request.MetaData().UserMetaData()[\"test\"] = \"testvalue\";\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n\r\n    auto hOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().UserMetaData().at(\"test\"), \"testvalue\");\r\n    EXPECT_EQ(hOutcome.result().ContentLength(), 1024LL);\r\n    file->close();\r\n    file = nullptr;\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectWithNotExistFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithNotExistFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectFromFileTest\").append(\"-put.tmp\");\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, tmpFile);\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"ValidateError\");\r\n    EXPECT_EQ(pOutcome.error().Message(), \"Request body is in fail state. Logical error on i/o operation.\");\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectWithNullContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithNullContentTest\");\r\n    std::shared_ptr<std::iostream> content = nullptr;\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"ValidateError\");\r\n    EXPECT_EQ(pOutcome.error().Message(), \"Request body is null.\");\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectWithBadContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithNullContentTest\");\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\r\n    content->setstate(content->badbit);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"ValidateError\");\r\n    EXPECT_EQ(pOutcome.error().Message(), \"Request body is in bad state. Read/writing error on i/o operation.\");\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectWithSameContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithSameContentTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto outcome = Client->GetObject(GetObjectRequest(BucketName, key));\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content);\r\n    std::string memMd5 = ComputeContentMD5(*outcome.result().Content());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nclass PutObjectAsyncContex : public AsyncCallerContext\r\n{\r\npublic:\r\n    PutObjectAsyncContex() :ready(false) {}\r\n    virtual ~PutObjectAsyncContex()\r\n    {\r\n    }\r\n\r\n    mutable std::mutex mtx;\r\n    mutable std::condition_variable cv;\r\n    mutable bool ready;\r\n};\r\n\r\nstatic void PutObjectHandler(const AlibabaCloud::OSS::OssClient* client,\r\n    const PutObjectRequest& request,\r\n    const PutObjectOutcome& outcome,\r\n    const std::shared_ptr<const AsyncCallerContext>& context)\r\n{\r\n    std::cout << \"Client[\" << client << \"]\" << \"PutObjectHandler, tag:\" << context->Uuid() <<\r\n        \", key:\" << request.Key() << std::endl;\r\n    if (context != nullptr) {\r\n        auto ctx = static_cast<const PutObjectAsyncContex *>(context.get());\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        std::unique_lock<std::mutex> lck(ctx->mtx);\r\n        ctx->ready = true;\r\n        ctx->cv.notify_all();\r\n    }\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectAsyncBasicTest)\r\n{\r\n    std::string memKey = TestUtils::GetObjectKey(\"PutObjectAsyncBasicTest\");\r\n    auto memContent = TestUtils::GetRandomStream(102400);\r\n\r\n    std::string fileKey = TestUtils::GetObjectKey(\"PutObjectAsyncBasicTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectAsyncBasicTest\").append(\".tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    auto fileContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::out | std::ios::binary);\r\n\r\n    PutObjectAsyncHandler handler = PutObjectHandler;\r\n    PutObjectRequest memRequest(BucketName, memKey, memContent);\r\n    std::shared_ptr<PutObjectAsyncContex> memContext = std::make_shared<PutObjectAsyncContex>();\r\n    memContext->setUuid(\"PutobjectasyncFromMem\");\r\n\r\n    PutObjectRequest fileRequest(BucketName, fileKey, fileContent);\r\n    std::shared_ptr<PutObjectAsyncContex> fileContext = std::make_shared<PutObjectAsyncContex>();\r\n    fileContext->setUuid(\"PutobjectasyncFromFile\");\r\n\r\n    Client->PutObjectAsync(memRequest, handler, memContext);\r\n    Client->PutObjectAsync(fileRequest, handler, fileContext);\r\n    std::cout << \"Client[\" << Client << \"]\" << \"Issue PutObjectAsync done.\" << std::endl;\r\n\r\n    {\r\n        std::unique_lock<std::mutex> lck(fileContext->mtx);\r\n        if (!fileContext->ready) fileContext->cv.wait(lck);\r\n    }\r\n\r\n    {\r\n        std::unique_lock<std::mutex> lck(memContext->mtx);\r\n        if (!memContext->ready) memContext->cv.wait(lck);\r\n    }\r\n\r\n    fileContent->close();\r\n\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, memKey), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, fileKey), true);\r\n\r\n    fileContext = nullptr;\r\n\r\n    TestUtils::WaitForCacheExpire(1);\r\n    EXPECT_EQ(RemoveFile(tmpFile), true);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectCallableBasicTest)\r\n{\r\n    std::string memKey = TestUtils::GetObjectKey(\"PutObjectCallableBasicTest\");\r\n    auto memContent = TestUtils::GetRandomStream(102400);\r\n\r\n    std::string fileKey = TestUtils::GetObjectKey(\"PutObjectCallableBasicTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectCallableBasicTest\").append(\".tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    auto fileContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios::binary);\r\n\r\n\r\n\r\n    auto memOutcomeCallable = Client->PutObjectCallable(PutObjectRequest(BucketName, memKey, memContent));\r\n    auto fileOutcomeCallable = Client->PutObjectCallable(PutObjectRequest(BucketName, fileKey, fileContent));\r\n\r\n\r\n    std::cout << \"Client[\" << Client << \"]\" << \"Issue PutObjectCallable done.\" << std::endl;\r\n\r\n    auto fileOutcome = fileOutcomeCallable.get();\r\n    auto memOutcome = memOutcomeCallable.get();\r\n    EXPECT_EQ(fileOutcome.isSuccess(), true);\r\n    EXPECT_EQ(memOutcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, memKey), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, fileKey), true);\r\n\r\n    memContent = nullptr;\r\n    fileContent = nullptr;\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutAndGetObjectFailTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutAndGetObjectFailTest\");\r\n    auto content = std::make_shared<std::stringstream>();\r\n    *content << \"123\";\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, \"invalid path\");\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n\r\n    auto outcome = Client->GetObject(BucketName, key, \"invalid path\");\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectWithContentMd5Test)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithContentMd5Test\");\r\n    auto content = std::make_shared<std::stringstream>();\r\n    *content << \"123\";\r\n    auto oriMd5 = ComputeContentMD5(*content);\r\n\r\n    PutObjectRequest pRequest(BucketName, key, content);\r\n    pRequest.setContentMd5(oriMd5);\r\n    auto pOutcome = Client->PutObject(pRequest);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() == nullptr);\r\n\r\n    GetObjectRequest gRequest(BucketName, key);\r\n    auto outcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    auto getMd5 = ComputeContentMD5(*outcome.result().Content());\r\n    auto unencryptMd5 = outcome.result().Metadata().UserMetaData().at(\"client-side-encryption-unencrypted-content-md5\");\r\n\r\n    EXPECT_EQ(unencryptMd5, getMd5);\r\n}\r\n\r\n\r\nTEST_F(CryptoObjectTest, GetObjectWithRangeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectWithRangeTest\");\r\n    auto content = std::make_shared<std::stringstream>();\r\n    std::string contentStr = \"1234567890abcdefjhijklmnopqrstuvwxzyQAZWSXEDC\";\r\n    *content << contentStr;\r\n    int64_t contentLen = contentStr.size();\r\n\r\n    PutObjectRequest pRequest(BucketName, key, content);\r\n    auto pOutcome = Client->PutObject(pRequest);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() == nullptr);\r\n\r\n    //from offset to end\r\n    for (int64_t i = 0; i < contentLen - 1; i++) {\r\n        GetObjectRequest gRequest(BucketName, key);\r\n        gRequest.setRange(i, -1);\r\n        auto outcome = Client->GetObject(gRequest);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        EXPECT_EQ(outcome.result().Metadata().ContentLength(), contentLen - i);\r\n        std::string getStr;\r\n        *outcome.result().Content() >> getStr;\r\n        EXPECT_EQ(getStr, contentStr.substr(i));\r\n    }\r\n\r\n    //from offset to contentLen - 3\r\n    int64_t last_remain = 2;\r\n    for (int64_t i = 0; i < contentLen - 1 - last_remain; i++) {\r\n        GetObjectRequest gRequest(BucketName, key);\r\n        gRequest.setRange(i, contentLen - last_remain);\r\n        auto outcome = Client->GetObject(gRequest);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        EXPECT_EQ(outcome.result().Metadata().ContentLength(), (contentLen - last_remain - i + 1) );\r\n        std::string getStr;\r\n        *outcome.result().Content() >> getStr;\r\n        EXPECT_EQ(getStr, contentStr.substr(i, (contentLen - last_remain - i + 1)));\r\n    }\r\n}\r\n\r\n//\r\nstatic void ProgressCallback(size_t increment, int64_t transfered, int64_t total, void* userData)\r\n{\r\n    UNUSED_PARAM(increment);\r\n    UNUSED_PARAM(transfered);\r\n    UNUSED_PARAM(total);\r\n    UNUSED_PARAM(userData);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, PutObjectProgressTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectProgressTest\");\r\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    TransferProgress arg;\r\n    arg.Handler = ProgressCallback;\r\n    arg.UserData = this;\r\n    request.setTransferProgress(arg);\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, GetObjectProgressTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectProgressTest\");\r\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\r\n\r\n    auto pOutcome = Client->PutObject(PutObjectRequest(BucketName, key, content));\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    GetObjectRequest grequest(BucketName, key);\r\n    TransferProgress arg;\r\n    arg.Handler = ProgressCallback;\r\n    arg.UserData = this;\r\n    grequest.setTransferProgress(arg);\r\n    auto gOutcome = Client->GetObject(grequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, MultipartUploadComplexStepTest)\r\n{\r\n    const int partSize = 100 * 1024;\r\n    auto sourceFile = TestFile;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadComplexStepTest\");\r\n    const int64_t fileLength = GetFileLength(sourceFile);\r\n\r\n    MultipartUploadCryptoContext cryptoCTX;\r\n    cryptoCTX.setPartSize(partSize);\r\n    cryptoCTX.setDataSize(fileLength);\r\n\r\n    InitiateMultipartUploadRequest imuRequest(BucketName, targetObjectKey);\r\n    auto initOutcome = Client->InitiateMultipartUpload(imuRequest, cryptoCTX);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(initOutcome.result().RequestId().empty());\r\n    EXPECT_EQ(cryptoCTX.ContentMaterial().ContentIV().size(), static_cast<size_t>(16));\r\n    EXPECT_EQ(cryptoCTX.ContentMaterial().ContentKey().size(), static_cast<size_t>(32));\r\n    EXPECT_EQ(cryptoCTX.UploadId(), initOutcome.result().UploadId());\r\n\r\n    // Set the part size, must be 16 alignment\r\n    auto partCount = CalculatePartCount(fileLength, partSize);\r\n\r\n    // Create a list to save result \r\n    PartList partETags;\r\n    //upload the file\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(sourceFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(content->good(), true);\r\n    if (content->good())\r\n    {\r\n        for (auto i = 0; i < partCount; i++)\r\n        {\r\n            // Skip to the start position\r\n            int64_t skipBytes = partSize * i;\r\n            int64_t position = skipBytes;\r\n\r\n            // Create a UploadPartRequest, uploading parts\r\n            content->clear();\r\n            content->seekg(position, content->beg);\r\n            UploadPartRequest request(BucketName, targetObjectKey, content);\r\n            request.setPartNumber(i + 1);\r\n            request.setUploadId(initOutcome.result().UploadId());\r\n            request.setContentLength(partSize);\r\n            auto uploadPartOutcome = Client->UploadPart(request, cryptoCTX);\r\n            EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n            EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\r\n\r\n            // Save the result\r\n            Part part(i + 1, uploadPartOutcome.result().ETag());\r\n            partETags.push_back(part);\r\n        }\r\n    }\r\n\r\n    auto lmuOutcome = Client->ListMultipartUploads(ListMultipartUploadsRequest(BucketName));\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(lmuOutcome.result().RequestId().empty());\r\n\r\n    std::string uploadId;\r\n\r\n    for (auto const &upload : lmuOutcome.result().MultipartUploadList())\r\n    {\r\n        if (upload.UploadId == initOutcome.result().UploadId())\r\n        {\r\n            uploadId = upload.UploadId;\r\n        }\r\n    }\r\n\r\n    EXPECT_EQ(uploadId.empty(), false);\r\n\r\n    CompleteMultipartUploadRequest completeRequest(BucketName, targetObjectKey, partETags);\r\n    completeRequest.setUploadId(uploadId);\r\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest, cryptoCTX);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(cOutcome.result().RequestId().empty());\r\n\r\n    auto gOutcome = Client->GetObject(GetObjectRequest(BucketName, targetObjectKey));\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().Metadata().ContentLength(), fileLength);\r\n    auto calcMd5 = ComputeContentMD5(*gOutcome.result().Content());\r\n    EXPECT_EQ(calcMd5, TestFileMd5);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, InitiateMultipartUploadWithoutSpecialHeadersTest)\r\n{\r\n    const int partSize = 100 * 1024;\r\n    auto sourceFile = TestFile;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadComplexStepTest\");\r\n    const int64_t fileLength = GetFileLength(sourceFile);\r\n\r\n    MultipartUploadCryptoContext cryptoCTX;\r\n\r\n    InitiateMultipartUploadRequest request(BucketName, targetObjectKey);\r\n    auto initOutcome = Client->InitiateMultipartUpload(request, cryptoCTX);\r\n    EXPECT_EQ(initOutcome.isSuccess(), false);\r\n    EXPECT_EQ(initOutcome.error().Code(), \"EncryptionClientError\");\r\n\r\n    cryptoCTX.setPartSize(partSize);\r\n    initOutcome = Client->InitiateMultipartUpload(request, cryptoCTX);\r\n    EXPECT_EQ(initOutcome.isSuccess(), false);\r\n    EXPECT_EQ(initOutcome.error().Code(), \"InvalidEncryptionRequest\");\r\n\r\n    cryptoCTX.setPartSize(partSize);\r\n    cryptoCTX.setDataSize(fileLength);\r\n    initOutcome = Client->InitiateMultipartUpload(request, cryptoCTX);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(initOutcome.result().RequestId().empty());\r\n    EXPECT_EQ(cryptoCTX.ContentMaterial().ContentIV().size(), static_cast<size_t>(16));\r\n    EXPECT_EQ(cryptoCTX.ContentMaterial().ContentKey().size(), static_cast<size_t>(32));\r\n    EXPECT_EQ(cryptoCTX.UploadId(), initOutcome.result().UploadId());\r\n}\r\n\r\n\r\nTEST_F(CryptoObjectTest, CompleteMultipartUploadNegativeTest)\r\n{\r\n    const int partSize = 100 * 1024;\r\n    auto sourceFile = TestFile;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadComplexStepTest\");\r\n    const int64_t fileLength = GetFileLength(sourceFile);\r\n\r\n    MultipartUploadCryptoContext cryptoCTX;\r\n    cryptoCTX.setPartSize(partSize);\r\n    cryptoCTX.setDataSize(fileLength);\r\n\r\n    InitiateMultipartUploadRequest imuRequest(BucketName, targetObjectKey);\r\n    auto initOutcome = Client->InitiateMultipartUpload(imuRequest, cryptoCTX);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(initOutcome.result().RequestId().empty());\r\n    EXPECT_EQ(cryptoCTX.ContentMaterial().ContentIV().size(), static_cast<size_t>(16));\r\n    EXPECT_EQ(cryptoCTX.ContentMaterial().ContentKey().size(), static_cast<size_t>(32));\r\n    EXPECT_EQ(cryptoCTX.UploadId(), initOutcome.result().UploadId());\r\n\r\n\r\n    // Create a list to save result \r\n    PartList partETags;\r\n    //upload the file\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(sourceFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(content->good(), true);\r\n    if (content->good())\r\n    {\r\n        for (auto i = 0; i < 2; i++)\r\n        {\r\n            // Skip to the start position\r\n            int64_t skipBytes = partSize * i;\r\n            int64_t position = skipBytes;\r\n\r\n            // Create a UploadPartRequest, uploading parts\r\n            content->clear();\r\n            content->seekg(position, content->beg);\r\n            UploadPartRequest request(BucketName, targetObjectKey, content);\r\n            request.setPartNumber(i + 1);\r\n            request.setUploadId(initOutcome.result().UploadId());\r\n            request.setContentLength(partSize);\r\n            auto uploadPartOutcome = Client->UploadPart(request, cryptoCTX);\r\n            EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n            EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\r\n\r\n            // Save the result\r\n            Part part(i + 1, uploadPartOutcome.result().ETag());\r\n            partETags.push_back(part);\r\n        }\r\n    }\r\n\r\n    CompleteMultipartUploadRequest completeRequest(BucketName, targetObjectKey, partETags);\r\n    completeRequest.setUploadId(cryptoCTX.UploadId());\r\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest, cryptoCTX);\r\n    EXPECT_EQ(cOutcome.isSuccess(), false);\r\n    EXPECT_EQ(cOutcome.error().Code(), \"InvalidEncryptionRequest\");\r\n    EXPECT_EQ(cOutcome.error().Message(), \"The client encryption part list is unexpected with init_multipart setted.\");\r\n}\r\n\r\nTEST_F(CryptoObjectTest, MultipartUploadCryptoContextTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"MultipartUploadCryptoContextTest\");\r\n\r\n    MultipartUploadCryptoContext cryptoCtx;\r\n    cryptoCtx.setPartSize(102401);\r\n    cryptoCtx.setDataSize(11);\r\n    auto initOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, key), cryptoCtx);\r\n    EXPECT_EQ(initOutcome.isSuccess(), false);\r\n    EXPECT_EQ(initOutcome.error().Code(), \"EncryptionClientError\");\r\n\r\n    auto content = std::make_shared<std::stringstream>(\"hello world\");\r\n    UploadPartRequest request(BucketName, key, content);\r\n    request.setPartNumber(1);\r\n    request.setUploadId(\"uploadid\");\r\n    request.setContentLength(11);\r\n    auto uploadPartOutcome = Client->UploadPart(request, cryptoCtx);\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), false);\r\n    EXPECT_EQ(uploadPartOutcome.error().Code(), \"EncryptionClientError\");\r\n}\r\n\r\n\r\nTEST_F(CryptoObjectTest, MultipartUploadCallableBasicTest)\r\n{\r\n    auto memKey = TestUtils::GetObjectKey(\"MultipartUploadCallable-MemObject\");\r\n    auto memContent = TestUtils::GetRandomStream(102400);\r\n    MultipartUploadCryptoContext memCryptoCtx;\r\n    memCryptoCtx.setPartSize(102400);\r\n    memCryptoCtx.setDataSize(102400);\r\n    auto memInitOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, memKey), memCryptoCtx);\r\n    EXPECT_EQ(memInitOutcome.isSuccess(), true);\r\n\r\n    auto fileKey = TestUtils::GetObjectKey(\"MultipartUploadCallable-FileObject\");\r\n    auto tmpFile = TestUtils::GetObjectKey(\"MultipartUploadCallable-FileObject\").append(\".tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    {\r\n        MultipartUploadCryptoContext fileCryptoCtx;\r\n        fileCryptoCtx.setPartSize(102400);\r\n        fileCryptoCtx.setDataSize(1024);\r\n        auto fileContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios::binary);\r\n        auto fileInitOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, fileKey), fileCryptoCtx);\r\n        EXPECT_EQ(fileInitOutcome.isSuccess(), true);\r\n\r\n        auto memOutcomeCallable = Client->UploadPartCallable(UploadPartRequest(BucketName, memKey,\r\n            1, memInitOutcome.result().UploadId(), memContent), memCryptoCtx);\r\n        auto fileOutcomeCallable = Client->UploadPartCallable(UploadPartRequest(BucketName, fileKey,\r\n            1, fileInitOutcome.result().UploadId(), fileContent), fileCryptoCtx);\r\n\r\n        std::cout << \"Client[\" << Client << \"]\" << \"Issue MultipartUploadCallable done.\" << std::endl;\r\n\r\n        auto fileOutcome = fileOutcomeCallable.get();\r\n        auto menOutcome = memOutcomeCallable.get();\r\n        EXPECT_EQ(fileOutcome.isSuccess(), true);\r\n        EXPECT_EQ(menOutcome.isSuccess(), true);\r\n\r\n        // list part\r\n        auto memListPartOutcome = Client->ListParts(ListPartsRequest(BucketName, memKey, memInitOutcome.result().UploadId()));\r\n        auto fileListPartOutcome = Client->ListParts(ListPartsRequest(BucketName, fileKey, fileInitOutcome.result().UploadId()));\r\n        EXPECT_EQ(memListPartOutcome.isSuccess(), true);\r\n        EXPECT_EQ(fileListPartOutcome.isSuccess(), true);\r\n\r\n        auto memCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, memKey,\r\n            memListPartOutcome.result().PartList(), memInitOutcome.result().UploadId()), memCryptoCtx);\r\n        auto fileCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, fileKey,\r\n            fileListPartOutcome.result().PartList(), fileInitOutcome.result().UploadId()), fileCryptoCtx);\r\n        EXPECT_EQ(memCompleteOutcome.isSuccess(), true);\r\n        EXPECT_EQ(fileCompleteOutcome.isSuccess(), true);\r\n\r\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, memKey), true);\r\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, fileKey), true);\r\n\r\n        memContent = nullptr;\r\n        fileContent = nullptr;\r\n    }\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nclass UploadPartAsyncContext : public AsyncCallerContext\r\n{\r\npublic:\r\n    UploadPartAsyncContext() :ready(false) {}\r\n    virtual ~UploadPartAsyncContext()\r\n    {\r\n    }\r\n\r\n    mutable std::mutex mtx;\r\n    mutable std::condition_variable cv;\r\n    mutable bool ready;\r\n};\r\n\r\nstatic void UploadPartInvalidHandler(const AlibabaCloud::OSS::OssClient* client,\r\n    const UploadPartRequest& request,\r\n    const PutObjectOutcome& outcome,\r\n    const std::shared_ptr<const AsyncCallerContext>& context)\r\n{\r\n    UNUSED_PARAM(request);\r\n    std::cout << \"Client[\" << client << \"]\" << \"UploadPartInvalidHandler, tag:\" << context->Uuid() << std::endl;\r\n    if (context != nullptr) {\r\n        auto ctx = static_cast<const UploadPartAsyncContext *>(context.get());\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        std::cout << __FUNCTION__ << \" InvalidHandler, code:\" << outcome.error().Code()\r\n            << \", message:\" << outcome.error().Message() << std::endl;\r\n        std::unique_lock<std::mutex> lck(ctx->mtx);\r\n        ctx->ready = true;\r\n        ctx->cv.notify_all();\r\n    }\r\n}\r\n\r\nstatic void UploadPartHandler(const AlibabaCloud::OSS::OssClient* client,\r\n    const UploadPartRequest& request,\r\n    const PutObjectOutcome& outcome,\r\n    const std::shared_ptr<const AsyncCallerContext>& context)\r\n{\r\n    UNUSED_PARAM(request);\r\n    std::cout << \"Client[\" << client << \"]\" << \"UploadPartHandler,tag:\" << context->Uuid() << std::endl;\r\n    if (context != nullptr) {\r\n        auto ctx = static_cast<const UploadPartAsyncContext *>(context.get());\r\n        if (!outcome.isSuccess()) {\r\n            std::cout << __FUNCTION__ << \" failed, Code:\" << outcome.error().Code()\r\n                << \", message:\" << outcome.error().Message() << std::endl;\r\n        }\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        std::unique_lock<std::mutex> lck(ctx->mtx);\r\n        ctx->ready = true;\r\n        ctx->cv.notify_all();\r\n    }\r\n}\r\n\r\nTEST_F(CryptoObjectTest, UploadPartAsyncBasicTest)\r\n{\r\n    std::string memKey = TestUtils::GetObjectKey(\"UploadPartMemObjectAsyncBasicTest\");\r\n    auto memContent = TestUtils::GetRandomStream(102400);\r\n    MultipartUploadCryptoContext memCryptoCtx;\r\n    memCryptoCtx.setPartSize(102400);\r\n    memCryptoCtx.setDataSize(102400);\r\n    InitiateMultipartUploadRequest memInitRequest(BucketName, memKey);\r\n    auto memInitOutcome = Client->InitiateMultipartUpload(memInitRequest, memCryptoCtx);\r\n    EXPECT_EQ(memInitOutcome.isSuccess(), true);\r\n    EXPECT_EQ(memInitOutcome.result().Key(), memKey);\r\n\r\n    std::string fileKey = TestUtils::GetObjectKey(\"UploadPartFileObjectAsyncBasicTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"UploadPartFileObjectAsyncBasicTest\").append(\".tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    auto fileContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::out | std::ios::binary);\r\n    MultipartUploadCryptoContext fileCryptoCtx;\r\n    fileCryptoCtx.setPartSize(102400);\r\n    fileCryptoCtx.setDataSize(1024);\r\n    InitiateMultipartUploadRequest fileInitRequest(BucketName, fileKey);\r\n    auto fileInitOutcome = Client->InitiateMultipartUpload(fileInitRequest, fileCryptoCtx);\r\n    EXPECT_EQ(fileInitOutcome.isSuccess(), true);\r\n    EXPECT_EQ(fileInitOutcome.result().Key(), fileKey);\r\n\r\n    UploadPartAsyncHandler handler = UploadPartHandler;\r\n\r\n    UploadPartRequest memRequest(BucketName, memKey, 1, memInitOutcome.result().UploadId(), memContent);\r\n    std::shared_ptr<UploadPartAsyncContext> memContext = std::make_shared<UploadPartAsyncContext>();\r\n    memContext->setUuid(\"UploadPartAsyncFromMem\");\r\n\r\n    UploadPartRequest fileRequest(BucketName, fileKey, 1, fileInitOutcome.result().UploadId(), fileContent);\r\n    std::shared_ptr<UploadPartAsyncContext> fileContext = std::make_shared<UploadPartAsyncContext>();\r\n    fileContext->setUuid(\"UploadPartAsyncFromFile\");\r\n\r\n    Client->UploadPartAsync(memRequest, handler, memCryptoCtx, memContext);\r\n    Client->UploadPartAsync(fileRequest, handler, fileCryptoCtx, fileContext);\r\n    std::cout << \"Client[\" << Client << \"]\" << \"Issue UploadPartAsync done.\" << std::endl;\r\n    {\r\n        std::unique_lock<std::mutex> lck(fileContext->mtx);\r\n        if (!fileContext->ready) fileContext->cv.wait(lck);\r\n    }\r\n\r\n    {\r\n        std::unique_lock<std::mutex> lck(memContext->mtx);\r\n        if (!memContext->ready) memContext->cv.wait(lck);\r\n    }\r\n\r\n    fileContent->close();\r\n\r\n    auto memListPartsOutcome = Client->ListParts(ListPartsRequest(BucketName, memKey, memInitOutcome.result().UploadId()));\r\n    EXPECT_EQ(memListPartsOutcome.isSuccess(), true);\r\n    auto fileListPartsOutcome = Client->ListParts(ListPartsRequest(BucketName, fileKey, fileInitOutcome.result().UploadId()));\r\n    EXPECT_EQ(fileListPartsOutcome.isSuccess(), true);\r\n\r\n    auto memCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, memKey,\r\n        memListPartsOutcome.result().PartList(), memInitOutcome.result().UploadId()), memCryptoCtx);\r\n    EXPECT_EQ(memCompleteOutcome.isSuccess(), true);\r\n    auto fileCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, fileKey,\r\n        fileListPartsOutcome.result().PartList(), fileInitOutcome.result().UploadId()), fileCryptoCtx);\r\n    EXPECT_EQ(fileCompleteOutcome.isSuccess(), true);\r\n        \r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, memKey), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, fileKey), true);\r\n\r\n    fileContext = nullptr;\r\n    TestUtils::WaitForCacheExpire(1);\r\n    EXPECT_EQ(RemoveFile(tmpFile), true);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, UploadPartAsyncInvalidContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"UploadPartCopyAsyncInvalidContentTest\");\r\n    UploadPartAsyncHandler handler = UploadPartInvalidHandler;\r\n    std::shared_ptr<std::iostream> content = nullptr;\r\n    MultipartUploadCryptoContext cryptoCtx;\r\n    cryptoCtx.setPartSize(102400);\r\n    cryptoCtx.setDataSize(1024);\r\n    UploadPartRequest request(BucketName, key, 1, \"id\", content);\r\n    std::shared_ptr<UploadPartAsyncContext> context = std::make_shared<UploadPartAsyncContext>();\r\n    context->setUuid(\"UploadPartCopyAsyncInvalidContent\");\r\n    Client->UploadPartAsync(request, handler, cryptoCtx, context);\r\n\r\n    TestUtils::WaitForCacheExpire(1);\r\n\r\n    content = TestUtils::GetRandomStream(100);\r\n    request.setConetent(content);\r\n    Client->UploadPartAsync(request, handler, cryptoCtx, context);\r\n\r\n    TestUtils::WaitForCacheExpire(1);\r\n\r\n    request.setContentLength(5LL * 1024LL * 1024LL * 1024LL + 1LL);\r\n    Client->UploadPartAsync(request, handler, cryptoCtx, context);\r\n\r\n    TestUtils::WaitForCacheExpire(1);\r\n\r\n    ContentCryptoMaterial contentMaterial;\r\n    contentMaterial.setContentIV(ByteBuffer(16));\r\n    contentMaterial.setContentKey(ByteBuffer(32));\r\n    cryptoCtx.setContentMaterial(contentMaterial);\r\n    request.setContentLength(100);\r\n    Client->UploadPartAsync(request, handler, cryptoCtx, context);\r\n\r\n    TestUtils::WaitForCacheExpire(1);\r\n\r\n    request.setBucket(\"non-existent-bucket\");\r\n    request.setContentLength(100);\r\n    Client->UploadPartAsync(request, handler, cryptoCtx, context);\r\n    request.setBucket(BucketName);\r\n}\r\n\r\n\r\nTEST_F(CryptoObjectTest, NormalResumableDownloadRetryWithCheckpointTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalDownloadObjectRetryWithCheckpoint\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalDownloadObjectRetryWithCheckpoint\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n    std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n    std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointDir), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n    // upload object\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n    auto uploadOutcome = Client->PutObject(PutObjectRequest(BucketName, key, content));\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n    content = nullptr;\n\n    // download object\n    DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, 1);\n    request.setFlags(request.Flags() | DownloadPartFailedFlag);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // retry\n    request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n    auto retryOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n\n    std::string uploadFileMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string downloadFileMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(uploadFileMd5, downloadFileMd5);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n}\n\nTEST_F(CryptoObjectTest, MultiResumableDownloadRetryWithCheckpointTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"MultiDownloadObjectRetryWithCheckpoint\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"MultiDownloadObjectRetryWithCheckpoint\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n    std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n    std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointDir), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n    // upload object\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n    auto uploadOutcome = Client->PutObject(PutObjectRequest(BucketName, key, content));\n    content = nullptr;\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download object\n    int threadNum = 1 + rand() % 100;\n    DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, threadNum);\n    request.setFlags(request.Flags() | DownloadPartFailedFlag);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // retry\n    request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n    auto retryOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n\n    std::string uploadFileMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string downloadFileMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(uploadFileMd5, downloadFileMd5);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n}\n\r\nTEST_F(CryptoObjectTest, EncryptionMaterialsFunctionFailTest)\n{\r\n    std::string publicKey = \"invalid\";\r\n    std::string privateKey = \"invalid\";\r\n    auto client = std::make_shared<OssEncryptionClient>(Endpoint, Config::AccessKeyId, Config::AccessKeySecret,\r\n        ClientConfiguration(), std::make_shared<SimpleRSAEncryptionMaterials>(publicKey, privateKey),\r\n        CryptoConfiguration());\r\n\r\n    //put\r\n    auto content = std::make_shared<std::stringstream>(\"just for test\");\r\n    auto pOutcome = client->PutObject(BucketName, \"test-key\", content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"EncryptionClientError\");\r\n    EXPECT_EQ(pOutcome.error().Message(), \"EncryptCEK fail, return value:-1\");\r\n\r\n    //get\r\n    std::string key = TestUtils::GetObjectKey(\"test-key\");\n    pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    auto gOutcome = client->GetObject(GetObjectRequest(BucketName, key));\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_EQ(gOutcome.error().Code(), \"EncryptionClientError\");\r\n    EXPECT_EQ(gOutcome.error().Message(), \"DecryptCEK fail, return value:-1\");\r\n\r\n    //init\r\n    MultipartUploadCryptoContext cryptoCTX;\r\n    cryptoCTX.setPartSize(1001024);\r\n    InitiateMultipartUploadRequest request(BucketName, \"test-key\");\r\n    auto initOutcome = client->InitiateMultipartUpload(request, cryptoCTX);\r\n    EXPECT_EQ(initOutcome.isSuccess(), false);\r\n    EXPECT_EQ(initOutcome.error().Code(), \"EncryptionClientError\");\r\n    EXPECT_EQ(initOutcome.error().Message(), \"EncryptCEK fail, return value:-1\");\r\n}\r\n\r\nTEST_F(CryptoObjectTest, DifferentEncryptionMaterialsTest)\n{\r\n    const std::string publicKey =\r\n        \"-----BEGIN RSA PUBLIC KEY-----\\n\"\n        \"MIGJAoGBALpUiB+w+r3v2Fgw0SgMbWl8bnzUVc3t3YbA89H13lrw7v6RUbL8+HGl\\n\"\n        \"s5YGoqD4lObG/sCQyaWd0B/XzOhjlSc1b53nyZhms84MGJ6nF2NQP+1gjY1ByDMK\\n\"\n        \"zeyVFFFvl9prlr6XpuJQlY0F/W4pbjLsk8Px4Qix5AoJbShElUu1AgMBAAE=\\n\"\n        \"-----END RSA PUBLIC KEY-----\";\r\n    const std::string privateKey =\r\n        \"-----BEGIN RSA PRIVATE KEY-----\\n\"\r\n        \"MIICXgIBAAKBgQC6VIgfsPq979hYMNEoDG1pfG581FXN7d2GwPPR9d5a8O7+kVGy\\n\"\r\n        \"/PhxpbOWBqKg+JTmxv7AkMmlndAf18zoY5UnNW+d58mYZrPODBiepxdjUD/tYI2N\\n\"\r\n        \"QcgzCs3slRRRb5faa5a+l6biUJWNBf1uKW4y7JPD8eEIseQKCW0oRJVLtQIDAQAB\\n\"\r\n        \"AoGBAJrzWRAhuSLipeMRFZ5cV1B1rdwZKBHMUYCSTTC5amPuIJGKf4p9XI4F4kZM\\n\"\r\n        \"1klO72TK72dsAIS9rCoO59QJnCpG4CvLYlJ37wA2UbhQ1rBH5dpBD/tv3CUyfdtI\\n\"\r\n        \"9CLUsZR3DGBWXYwGG0KGMYPExe5Hq3PUH9+QmuO+lXqJO4IBAkEA6iLee6oBzu6v\\n\"\r\n        \"90zrr4YA9NNr+JvtplpISOiL/XzsU6WmdXjzsFLSsZCeaJKsfdzijYEceXY7zUNa\\n\"\r\n        \"0/qQh2BKoQJBAMu61rQ5wKtql2oR4ePTSm00/iHoIfdFnBNU+b8uuPXlfwU80OwJ\\n\"\r\n        \"Gbs0xBHe+dt4uT53QLci4KgnNkHS5lu4XJUCQQCisCvrvcuX4B6BNf+mbPSJKcci\\n\"\r\n        \"biaJqr4DeyKatoz36mhpw+uAH2yrWRPZEeGtayg4rvf8Jf2TuTOJi9eVWYFBAkEA\\n\"\r\n        \"uIPzyS81TQsxL6QajpjjI52HPXZcrPOis++Wco0Cf9LnA/tczSpA38iefAETEq94\\n\"\r\n        \"NxcSycsQ5br97QfyEsgbMQJANTZ/HyMowmDPIC+n9ExdLSrf4JydARSfntFbPsy1\\n\"\r\n        \"4oC6ciKpRdtAtAtiU8s9eAUSWi7xoaPJzjAHWbmGSHHckg==\\n\"\r\n        \"-----END RSA PRIVATE KEY-----\";\r\n    std::map<std::string, std::string> description;\r\n    description[\"provider\"] = \"aliclould\";\r\n\r\n    auto otherClient = std::make_shared<OssEncryptionClient>(Endpoint, Config::AccessKeyId, Config::AccessKeySecret,\r\n        ClientConfiguration(), std::make_shared<SimpleRSAEncryptionMaterials>(publicKey, privateKey, description),\r\n        CryptoConfiguration());\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"DifferentEncryptionMaterialsTest\");\n    auto content = std::make_shared<std::stringstream>(\"just for test\");\r\n    auto pOutcome = otherClient->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto gOutcome = otherClient->GetObject(GetObjectRequest(BucketName, key));\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n    //\r\n    gOutcome = Client->GetObject(GetObjectRequest(BucketName, key));\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_EQ(gOutcome.error().Code(), \"EncryptionClientError\");\r\n    EXPECT_EQ(gOutcome.error().Message(), \"DecryptCEK fail, return value:-1\");\r\n\r\n    auto otherClient2 = std::make_shared<OssEncryptionClient>(Endpoint, Config::AccessKeyId, Config::AccessKeySecret,\r\n        ClientConfiguration(), std::make_shared<SimpleRSAEncryptionMaterials>(publicKey, privateKey, description),\r\n        CryptoConfiguration());\r\n\r\n    gOutcome = otherClient2->GetObject(GetObjectRequest(BucketName, key));\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n    auto oriMd5 = ComputeContentMD5(*content);\r\n    auto getMd5 = ComputeContentMD5(*gOutcome.result().Content());\r\n    EXPECT_EQ(oriMd5, getMd5);\r\n}\r\n\r\n\r\nTEST_F(CryptoObjectTest, DownloadUnencryptedObjectTest)\n{\r\n    auto otherClient = std::make_shared<OssClient>(Endpoint, Config::AccessKeyId, Config::AccessKeySecret,\r\n        ClientConfiguration());\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"DownloadUnencryptedObjectTest\");\n    auto content = std::make_shared<std::stringstream>(\"just for test\");\r\n    auto pOutcome = otherClient->PutObject(BucketName, key, content);\r\n\r\n    GetObjectRequest gRequest(BucketName, key);\r\n    auto outcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto oriMd5 = ComputeContentMD5(*content);\r\n    auto getMd5 = ComputeContentMD5(*outcome.result().Content());\r\n    EXPECT_EQ(oriMd5, getMd5);\r\n}\r\n\r\nTEST_F(CryptoObjectTest, UnsupportCEKAlgoTest)\n{\r\n    auto otherClient = std::make_shared<OssClient>(Endpoint, Config::AccessKeyId, Config::AccessKeySecret,\r\n        ClientConfiguration());\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"UnsupportCEKAlgoTest\");\n    auto content = std::make_shared<std::stringstream>(\"just for test\");\r\n    PutObjectRequest pRequest(BucketName, key, content);\r\n    pRequest.MetaData().addUserHeader(\"client-side-encryption-key\", \"1234\");\r\n    pRequest.MetaData().addUserHeader(\"client-side-encryption-start\", \"1234\");\r\n    pRequest.MetaData().addUserHeader(\"client-side-encryption-cek-alg\", \"AES/ECB/NoPadding\");\r\n    pRequest.MetaData().addUserHeader(\"client-side-encryption-wrap-alg\", \"RSA/NONE/PKCS1Padding\");\r\n    auto pOutcome = otherClient->PutObject(pRequest);\r\n\r\n    GetObjectRequest gRequest(BucketName, key);\r\n    auto outcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"EncryptionClientError\");\r\n    EXPECT_EQ(outcome.error().Message(), \"Cipher name is not support, expect AES/CTR/NoPadding, got AES/ECB/NoPadding.\");\r\n}\r\n\r\nTEST_F(CryptoObjectTest, CompatibilityTest)\n{\r\n    #define ArraySize(a) sizeof(a)/sizeof(a[0])\r\n    std::string fileNames[] = { \"cpp-enc-example.jpg\", \"go-enc-example.jpg\" };\r\n    std::map<std::string, std::string> userMetas[] = { \r\n        //cpp-enc-example.jpg\r\n        { \r\n            {\"client-side-encryption-key\", \"nyXOp7delQ/MQLjKQMhHLaT0w7u2yQoDLkSnK8MFg/MwYdh4na4/LS8LLbLcM18m8I/ObWUHU775I50sJCpdv+f4e0jLeVRRiDFWe+uo7Puc9j4xHj8YB3QlcIOFQiTxHIB6q+C+RA6lGwqqYVa+n3aV5uWhygyv1MWmESurppg=\"},\r\n            {\"client-side-encryption-start\", \"De/S3T8wFjx7QPxAAFl7h7TeI2EsZlfCwox4WhLGng5DK2vNXxULmulMUUpYkdc9umqmDilgSy5Z3Foafw+v4JJThfw68T/9G2gxZLrQTbAlvFPFfPM9Ehk6cY4+8WpY32uN8w5vrHyoSZGr343NxCUGIp6fQ9sSuOLMoJg7hNw=\"},\r\n            {\"client-side-encryption-cek-alg\", \"AES/CTR/NoPadding\"},\r\n            {\"client-side-encryption-wrap-alg\", \"RSA/NONE/PKCS1Padding\"},\r\n        },\r\n        //go-enc-example.jpg\r\n        {\r\n            {\"client-side-encryption-key\", \"F2L5QjyA2s85tPvaGdQ5EKnU/XN5dUWqZfgwcM4gfzPMcDWR93AZGSpeB9VSJBYPdIqhy1cevKEJv+Dv2ckDuDJ7nzijwcBnO5tPl5jXYlWxgzj6t1gMqQr/LENbB5iC8hzGkkoVWjWtSPDB+uE3+qf4V1A0308OqSM3OKxV0VI=\"},\r\n            {\"client-side-encryption-start\", \"D+3z6ftLp500eVnvsat5awYdYI/jTeSRlGlmHNrhTm3l1bonYP1v72vGqZhvOpT++9ZXOhdePu82gjhqVfh8Qv2HZsVGeJLzQJRU8kIKc7PRI4SoqpHZh2VYsASvnDtxVy2MQmpJzvG8xr4j3I29EgsEha7NV+2hGq/dolxLHNc=\"},\r\n            {\"client-side-encryption-cek-alg\", \"AES/CTR/NoPadding\"},\r\n            {\"client-side-encryption-wrap-alg\", \"RSA/NONE/PKCS1Padding\"},\r\n        },\r\n    };\r\n\r\n    std::string privateKey =\n        \"-----BEGIN RSA PRIVATE KEY-----\\n\"\n        \"MIICWwIBAAKBgQCokfiAVXXf5ImFzKDw+XO/UByW6mse2QsIgz3ZwBtMNu59fR5z\\n\"\n        \"ttSx+8fB7vR4CN3bTztrP9A6bjoN0FFnhlQ3vNJC5MFO1PByrE/MNd5AAfSVba93\\n\"\n        \"I6sx8NSk5MzUCA4NJzAUqYOEWGtGBcom6kEF6MmR1EKib1Id8hpooY5xaQIDAQAB\\n\"\n        \"AoGAOPUZgkNeEMinrw31U3b2JS5sepG6oDG2CKpPu8OtdZMaAkzEfVTJiVoJpP2Y\\n\"\n        \"nPZiADhFW3e0ZAnak9BPsSsySRaSNmR465cG9tbqpXFKh9Rp/sCPo4Jq2n65yood\\n\"\n        \"JBrnGr6/xhYvNa14sQ6xjjfSgRNBSXD1XXNF4kALwgZyCAECQQDV7t4bTx9FbEs5\\n\"\n        \"36nAxPsPM6aACXaOkv6d9LXI7A0J8Zf42FeBV6RK0q7QG5iNNd1WJHSXIITUizVF\\n\"\n        \"6aX5NnvFAkEAybeXNOwUvYtkgxF4s28s6gn11c5HZw4/a8vZm2tXXK/QfTQrJVXp\\n\"\n        \"VwxmSr0FAajWAlcYN/fGkX1pWA041CKFVQJAG08ozzekeEpAuByTIOaEXgZr5MBQ\\n\"\n        \"gBbHpgZNBl8Lsw9CJSQI15wGfv6yDiLXsH8FyC9TKs+d5Tv4Cvquk0efOQJAd9OC\\n\"\n        \"lCKFs48hdyaiz9yEDsc57PdrvRFepVdj/gpGzD14mVerJbOiOF6aSV19ot27u4on\\n\"\n        \"Td/3aifYs0CveHzFPQJAWb4LCDwqLctfzziG7/S7Z74gyq5qZF4FUElOAZkz718E\\n\"\n        \"yZvADwuz/4aK0od0lX9c4Jp7Mo5vQ4TvdoBnPuGoyw==\\n\"\n        \"-----END RSA PRIVATE KEY-----\";\r\n    \r\n    EXPECT_EQ(ArraySize(fileNames), ArraySize(userMetas));\r\n\r\n    ClientConfiguration conf;\r\n    auto unencryptedClient = std::make_shared<OssClient>(Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n    auto encryptedClient = std::make_shared<OssEncryptionClient>(Endpoint,\r\n        std::make_shared<SimpleCredentialsProvider>(Config::AccessKeyId, Config::AccessKeySecret), conf,\r\n        std::make_shared<SimpleRSAEncryptionMaterials>(\"\", privateKey), CryptoConfiguration());\r\n\r\n    size_t index = 0;\r\n    for (const auto& file : fileNames) {\r\n        std::string encryptedFile = Config::GetDataPath();\r\n        encryptedFile.append(file);\r\n        \r\n        std::string oriFile = Config::GetDataPath();\r\n        oriFile.append(\"example.jpg\");\r\n\r\n        std::string key = file;\r\n        ObjectMetaData meta;\r\n        for (const auto& it : userMetas[index]) {\r\n            meta.addUserHeader(it.first, it.second);\r\n        }\r\n        \r\n        auto pOutcome = unencryptedClient->PutObject(BucketName, key, encryptedFile, meta);\r\n        EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n        auto gOutcome = encryptedClient->GetObject(GetObjectRequest(BucketName, key));\r\n        EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n        for (const auto& it : userMetas[index]) {\r\n            EXPECT_EQ(gOutcome.result().Metadata().UserMetaData().at(it.first), it.second);\r\n        }\r\n\r\n        auto getMd5 = ComputeContentMD5(*gOutcome.result().Content());\r\n        auto oriMd5 = TestUtils::GetFileMd5(oriFile);\r\n\r\n        EXPECT_EQ(oriMd5, getMd5);\r\n        index++;\r\n    }\r\n\r\n    EXPECT_EQ(index, ArraySize(fileNames));\r\n}\r\n\r\nclass EncryptionDisableFuncClient : public OssEncryptionClient {\r\n\r\npublic:\r\n    EncryptionDisableFuncClient(const std::string& endpoint, const std::string& accessKeyId, const std::string& accessKeySecret) :\r\n        OssEncryptionClient(endpoint, accessKeyId, accessKeySecret, ClientConfiguration(),\r\n            std::make_shared<SimpleRSAEncryptionMaterials>(\"\", \"\"), CryptoConfiguration())\r\n    {}\r\n\r\npublic:\r\n    AppendObjectOutcome AppendObject(const AppendObjectRequest& request) const\r\n    {\r\n        return OssEncryptionClient::AppendObject(request);\r\n    }\r\n    \r\n    UploadPartCopyOutcome UploadPartCopy(const UploadPartCopyRequest& request, const MultipartUploadCryptoContext& ctx) const\r\n    {\r\n        return OssEncryptionClient::UploadPartCopy(request, ctx);\r\n    }\r\n    void UploadPartCopyAsync(const UploadPartCopyRequest& request, const UploadPartCopyAsyncHandler& handler, const MultipartUploadCryptoContext& cryptoCtx, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const\r\n    {\r\n        OssEncryptionClient::UploadPartCopyAsync(request, handler, cryptoCtx, context);\r\n    }\r\n    UploadPartCopyOutcomeCallable UploadPartCopyCallable(const UploadPartCopyRequest& request, const MultipartUploadCryptoContext& cryptoCtx) const\r\n    {\r\n        return OssEncryptionClient::UploadPartCopyCallable(request, cryptoCtx);\r\n    }\r\n    CopyObjectOutcome ResumableCopyObject(const MultiCopyObjectRequest& request) const\r\n    {\r\n        return OssEncryptionClient::ResumableCopyObject(request);\r\n    }\r\n    GetObjectOutcome GetObjectByUrl(const GetObjectByUrlRequest& request) const\r\n    {\r\n        return OssEncryptionClient::GetObjectByUrl(request);\r\n    }\r\n    PutObjectOutcome PutObjectByUrl(const PutObjectByUrlRequest& request) const\r\n    {\r\n        return OssEncryptionClient::PutObjectByUrl(request);\r\n    }\r\n};\r\n\r\nstatic void UploadPartCopyDisableFuncHandler(const AlibabaCloud::OSS::OssClient* client,\n    const UploadPartCopyRequest& request,\n    const UploadPartCopyOutcome& outcome,\n    const std::shared_ptr<const AsyncCallerContext>& context)\n{\n    UNUSED_PARAM(request);\n    std::cout << \"Client[\" << client << \"]\" << \"UploadPartCopyHandler, tag:\" << context->Uuid() << std::endl;\n    if (context != nullptr) {\n        auto ctx = static_cast<const UploadPartAsyncContext *>(context.get());\n        if (!outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \" failed, Code:\" << outcome.error().Code()\n                << \", message:\" << outcome.error().Message() << std::endl;\n        }\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"EncryptionClientError\");\r\n        std::unique_lock<std::mutex> lck(ctx->mtx);\n        ctx->ready = true;\n        ctx->cv.notify_all();\n    }\n}\r\n\r\nTEST_F(CryptoObjectTest, TestDisableFunctionTest)\r\n{\r\n    EncryptionDisableFuncClient disableClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret);\r\n\r\n    auto content = std::make_shared<std::stringstream>();\r\n\r\n    auto aOutcome = disableClient.AppendObject(AppendObjectRequest(BucketName, \"key\", content));\r\n    EXPECT_EQ(aOutcome.isSuccess(), false);\r\n    EXPECT_EQ(aOutcome.error().Code(), \"EncryptionClientError\");\r\n\r\n    MultipartUploadCryptoContext ctx;\r\n    auto uOutcome = disableClient.UploadPartCopy(UploadPartCopyRequest(BucketName, \"key\"), ctx);\r\n    EXPECT_EQ(uOutcome.isSuccess(), false);\r\n    EXPECT_EQ(uOutcome.error().Code(), \"EncryptionClientError\");\r\n\r\n    auto uOutcomeCallable = disableClient.UploadPartCopyCallable(UploadPartCopyRequest(BucketName, \"key\"), ctx);\r\n    uOutcome = uOutcomeCallable.get();\r\n    EXPECT_EQ(uOutcome.isSuccess(), false);\r\n    EXPECT_EQ(uOutcome.error().Code(), \"EncryptionClientError\");\r\n\r\n    auto rOutcome = disableClient.ResumableCopyObject(MultiCopyObjectRequest(BucketName, \"key\", \"\", \"\"));\r\n    EXPECT_EQ(rOutcome.isSuccess(), false);\r\n    EXPECT_EQ(rOutcome.error().Code(), \"EncryptionClientError\");\r\n\r\n    auto gOutcome = disableClient.GetObjectByUrl(GetObjectByUrlRequest(\"url\"));\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_EQ(gOutcome.error().Code(), \"EncryptionClientError\");\r\n\r\n    auto pOutcome = disableClient.PutObjectByUrl(PutObjectByUrlRequest(\"key\", content));\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"EncryptionClientError\");\r\n\r\n\r\n    UploadPartCopyAsyncHandler handler = UploadPartCopyDisableFuncHandler;\n    UploadPartCopyRequest cRequest(BucketName, \"key\");\n    std::shared_ptr<UploadPartAsyncContext> cContext = std::make_shared<UploadPartAsyncContext>();\n    cContext->setUuid(\"UploadPartCopyAsync\");\n    disableClient.UploadPartCopyAsync(cRequest, handler, ctx, cContext);\n    {\r\n        std::unique_lock<std::mutex> lck(cContext->mtx);\r\n        if (!cContext->ready) cContext->cv.wait(lck);\r\n    }\r\n}\r\n\r\n}\r\n}"
  },
  {
    "path": "test/src/Encryption/CryptoObjectVersioningTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include <alibabacloud/oss/OssEncryptionClient.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include \"src/utils/FileSystemUtils.h\"\n#include <fstream>\r\n\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass CryptoObjectVersioningTest : public ::testing::Test {\r\nprotected:\r\n    CryptoObjectVersioningTest()\r\n    {\r\n    }\r\n\r\n    ~CryptoObjectVersioningTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase() \r\n    {\r\n        const std::string publicKey =\r\n            \"-----BEGIN RSA PUBLIC KEY-----\\n\"\n            \"MIGJAoGBALpUiB+w+r3v2Fgw0SgMbWl8bnzUVc3t3YbA89H13lrw7v6RUbL8+HGl\\n\"\n            \"s5YGoqD4lObG/sCQyaWd0B/XzOhjlSc1b53nyZhms84MGJ6nF2NQP+1gjY1ByDMK\\n\"\n            \"zeyVFFFvl9prlr6XpuJQlY0F/W4pbjLsk8Px4Qix5AoJbShElUu1AgMBAAE=\\n\"\n            \"-----END RSA PUBLIC KEY-----\";\r\n\r\n        const std::string privateKey =\r\n            \"-----BEGIN RSA PRIVATE KEY-----\\n\"\r\n            \"MIICXgIBAAKBgQC6VIgfsPq979hYMNEoDG1pfG581FXN7d2GwPPR9d5a8O7+kVGy\\n\"\r\n            \"/PhxpbOWBqKg+JTmxv7AkMmlndAf18zoY5UnNW+d58mYZrPODBiepxdjUD/tYI2N\\n\"\r\n            \"QcgzCs3slRRRb5faa5a+l6biUJWNBf1uKW4y7JPD8eEIseQKCW0oRJVLtQIDAQAB\\n\"\r\n            \"AoGBAJrzWRAhuSLipeMRFZ5cV1B1rdwZKBHMUYCSTTC5amPuIJGKf4p9XI4F4kZM\\n\"\r\n            \"1klO72TK72dsAIS9rCoO59QJnCpG4CvLYlJ37wA2UbhQ1rBH5dpBD/tv3CUyfdtI\\n\"\r\n            \"9CLUsZR3DGBWXYwGG0KGMYPExe5Hq3PUH9+QmuO+lXqJO4IBAkEA6iLee6oBzu6v\\n\"\r\n            \"90zrr4YA9NNr+JvtplpISOiL/XzsU6WmdXjzsFLSsZCeaJKsfdzijYEceXY7zUNa\\n\"\r\n            \"0/qQh2BKoQJBAMu61rQ5wKtql2oR4ePTSm00/iHoIfdFnBNU+b8uuPXlfwU80OwJ\\n\"\r\n            \"Gbs0xBHe+dt4uT53QLci4KgnNkHS5lu4XJUCQQCisCvrvcuX4B6BNf+mbPSJKcci\\n\"\r\n            \"biaJqr4DeyKatoz36mhpw+uAH2yrWRPZEeGtayg4rvf8Jf2TuTOJi9eVWYFBAkEA\\n\"\r\n            \"uIPzyS81TQsxL6QajpjjI52HPXZcrPOis++Wco0Cf9LnA/tczSpA38iefAETEq94\\n\"\r\n            \"NxcSycsQ5br97QfyEsgbMQJANTZ/HyMowmDPIC+n9ExdLSrf4JydARSfntFbPsy1\\n\"\r\n            \"4oC6ciKpRdtAtAtiU8s9eAUSWi7xoaPJzjAHWbmGSHHckg==\\n\"\r\n            \"-----END RSA PRIVATE KEY-----\";\r\n\r\n        Endpoint = Config::Endpoint;\n        Client = std::make_shared<OssEncryptionClient>(Endpoint, Config::AccessKeyId, Config::AccessKeySecret,\r\n            ClientConfiguration(), std::make_shared<SimpleRSAEncryptionMaterials>(publicKey, privateKey),\r\n            CryptoConfiguration());\r\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-crypto-versioning\");\r\n        Client->CreateBucket(BucketName);\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase() \r\n    {\r\n        TestUtils::CleanBucketVersioning(*Client, BucketName);\r\n        Client = nullptr;\r\n    }\r\n\r\n    // Sets up the test fixture.\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    // Tears down the test fixture.\r\n    void TearDown() override\r\n    {\r\n    }\r\n\r\npublic:\r\n    static std::shared_ptr<OssEncryptionClient> Client;\r\n    static std::string BucketName;\r\n    static std::string Endpoint;\r\n};\r\n\r\nstd::shared_ptr<OssEncryptionClient> CryptoObjectVersioningTest::Client = nullptr;\r\nstd::string CryptoObjectVersioningTest::BucketName = \"\";\r\nstd::string CryptoObjectVersioningTest::Endpoint = \"\";\r\n\r\n\r\nTEST_F(CryptoObjectVersioningTest, ObjectBasicWithVersioningEnableTest)\n{\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\n\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\n\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\n        return;\n\n    //test put, get, head and getmeta \n    auto content1 = std::make_shared<std::stringstream>(\"versioning test 1.\");\n    auto content2 = std::make_shared<std::stringstream>(\"versioning test 2.\");\n    auto etag1 = ComputeContentETag(*content1);\n    auto etag2 = ComputeContentETag(*content2);\n    auto key = TestUtils::GetObjectKey(\"ObjectBasicWithVersioningEnableTest\");\n\n    auto pOutcome = Client->PutObject(BucketName, key, content1);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\n    auto versionId1 = pOutcome.result().VersionId();\n\n    pOutcome = Client->PutObject(BucketName, key, content2);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\n    auto versionId2 = pOutcome.result().VersionId();\n\n    EXPECT_NE(versionId1, versionId2);\n    EXPECT_NE(etag1, etag2);\n\n    //head \n    HeadObjectRequest request(BucketName, key);\n    auto hOutcome = Client->HeadObject(request);\n    EXPECT_EQ(hOutcome.isSuccess(), true);\n    EXPECT_EQ(hOutcome.result().VersionId(), versionId2);\n\n    request.setVersionId(versionId1);\n    hOutcome = Client->HeadObject(request);\n    EXPECT_EQ(hOutcome.isSuccess(), true);\n    EXPECT_EQ(hOutcome.result().VersionId(), versionId1);\n\n    request.setVersionId(versionId2);\n    hOutcome = Client->HeadObject(request);\n    EXPECT_EQ(hOutcome.isSuccess(), true);\n    EXPECT_EQ(hOutcome.result().VersionId(), versionId2);\n\n    //Get\n    GetObjectRequest gRequest(BucketName, key);\n    auto gOutcome = Client->GetObject(gRequest);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().VersionId(), versionId2);\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag2);\n\n    gRequest.setVersionId(versionId1);\n    gOutcome = Client->GetObject(gRequest);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().VersionId(), versionId1);\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag1);\n\n    gRequest.setVersionId(versionId2);\n    gOutcome = Client->GetObject(gRequest);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().VersionId(), versionId2);\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag2);\n\n    auto lOutcome = Client->ListObjects(BucketName, key);\n    EXPECT_EQ(lOutcome.isSuccess(), true);\n    EXPECT_EQ(lOutcome.result().ObjectSummarys().size(), 1UL);\n\n    ListObjectVersionsRequest lvRequest(BucketName);\n    lvRequest.setPrefix(key);\n    auto lvOutcome = Client->ListObjectVersions(lvRequest);\n    EXPECT_EQ(lvOutcome.isSuccess(), true);\n    EXPECT_EQ(lvOutcome.result().ObjectVersionSummarys().size(), 2UL);\n\n    //Delete\n    DeleteObjectRequest dRequest(BucketName, key);\n    auto dOutcome = Client->DeleteObject(dRequest);\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n    EXPECT_EQ(dOutcome.result().RequestId().size(), 24UL);\n    EXPECT_EQ(dOutcome.result().VersionId().empty(), false);\n    EXPECT_EQ(dOutcome.result().DeleteMarker(), true);\n    auto dversionId = dOutcome.result().VersionId();\n\n    //Get simple meta\n    GetObjectMetaRequest gmRequest(BucketName, key);\n    auto gmOutcome = Client->GetObjectMeta(gmRequest);\n    EXPECT_EQ(gmOutcome.isSuccess(), false);\n    EXPECT_EQ(gmOutcome.error().Code(), \"NoSuchKey\");\n\n    gmRequest.setVersionId(versionId1);\n    gmOutcome = Client->GetObjectMeta(gmRequest);\n    EXPECT_EQ(gmOutcome.isSuccess(), true);\n    EXPECT_EQ(gmOutcome.result().VersionId(), versionId1);\n\n    gmRequest.setVersionId(versionId2);\n    gmOutcome = Client->GetObjectMeta(gmRequest);\n    EXPECT_EQ(gmOutcome.isSuccess(), true);\n    EXPECT_EQ(gmOutcome.result().VersionId(), versionId2);\n\n    //list agian\n    lOutcome = Client->ListObjects(BucketName, key);\n    EXPECT_EQ(lOutcome.isSuccess(), true);\n    EXPECT_EQ(lOutcome.result().ObjectSummarys().size(), 0UL);\n\n    lvRequest.setBucket(BucketName);\n    lvRequest.setPrefix(key);\n    lvOutcome = Client->ListObjectVersions(lvRequest);\n    EXPECT_EQ(lvOutcome.isSuccess(), true);\n    EXPECT_EQ(lvOutcome.result().ObjectVersionSummarys().size(), 2UL);\n    EXPECT_EQ(lvOutcome.result().DeleteMarkerSummarys().size(), 1UL);\n\n    //Get agian\n    gOutcome = Client->GetObject(GetObjectRequest(BucketName, key));\n    EXPECT_EQ(gOutcome.isSuccess(), false);\n\n    gRequest.setVersionId(versionId1);\n    gOutcome = Client->GetObject(gRequest);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().VersionId(), versionId1);\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag1);\n\n    gRequest.setVersionId(versionId2);\n    gOutcome = Client->GetObject(gRequest);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().VersionId(), versionId2);\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag2);\n\n    //delete by version id\n    dRequest.setVersionId(dversionId);\n    dOutcome = Client->DeleteObject(dRequest);\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n    EXPECT_EQ(dOutcome.result().RequestId().size(), 24UL);\n    EXPECT_EQ(dOutcome.result().VersionId(), dversionId);\n    EXPECT_EQ(dOutcome.result().DeleteMarker(), true);\n\n    gmOutcome = Client->GetObjectMeta(BucketName, key);\n    EXPECT_EQ(gmOutcome.isSuccess(), true);\n    EXPECT_EQ(gmOutcome.result().VersionId(), versionId2);\n\n    dRequest.setVersionId(versionId1);\n    EXPECT_EQ(dRequest.VersionId(), versionId1);\r\n    dOutcome = Client->DeleteObject(dRequest);\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n    EXPECT_EQ(dOutcome.result().VersionId(), versionId1);\n    EXPECT_EQ(dOutcome.result().DeleteMarker(), false);\n\n    dRequest.setVersionId(versionId2);\n    dOutcome = Client->DeleteObject(dRequest);\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n    EXPECT_EQ(dOutcome.result().VersionId(), versionId2);\n    EXPECT_EQ(dOutcome.result().DeleteMarker(), false);\n\n    //list again\n    //lvRequest.setBucket(BucketName);\n    //lvRequest.setPrefix(key);\n    lvOutcome = Client->ListObjectVersions(BucketName, key);\n    EXPECT_EQ(lvOutcome.isSuccess(), true);\n    EXPECT_EQ(lvOutcome.result().ObjectVersionSummarys().size(), 0UL);\n    EXPECT_EQ(lvOutcome.result().DeleteMarkerSummarys().size(), 0UL);\n}\r\n\r\n\r\nTEST_F(CryptoObjectVersioningTest, ResumableUploadWithVersioningEnableTest)\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\n\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\n\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\n        return;\r\n\r\n    //multi-part mode\r\n    std::string key = TestUtils::GetObjectKey(\"ResumableUploadWithVersioningEnableTestOverPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableUploadWithVersioningEnableTestOverPartSize\").append(\".tmp\");\n    // limit file size between 800KB and 2000KB\n    int num = 8 + rand() % 12;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num + 10);\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(3);\n    auto ruOutcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(ruOutcome.isSuccess(), true);\n    EXPECT_EQ(ruOutcome.result().RequestId().size(), 24UL);\n    EXPECT_EQ(ruOutcome.result().VersionId().empty(), false);\n\n    GetObjectRequest gRequest(BucketName, key);\n    gRequest.setVersionId(ruOutcome.result().VersionId());\n    auto gOutcome = Client->GetObject(gRequest);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(TestUtils::GetFileMd5(tmpFile), ComputeContentMD5(*gOutcome.result().Content()));\n    RemoveFile(tmpFile);\r\n\r\n    //put object mode\r\n    std::string key1 = TestUtils::GetObjectKey(\"ResumableUploadWithVersioningEnableTestUnderPartSize\");\n    std::string tmpFile1 = TestUtils::GetTargetFileName(\"ResumableUploadWithVersioningEnableTestUnderPartSize\").append(\".tmp\");\n    num = rand() % 8;\n    TestUtils::WriteRandomDatatoFile(tmpFile1, 10240 * num);\n\n    UploadObjectRequest request1(BucketName, key1, tmpFile1);\n    request1.setPartSize(100 * 1024);\n    request1.setThreadNum(1);\n    auto ruOutcome1 = Client->ResumableUploadObject(request1);\n    EXPECT_EQ(ruOutcome1.isSuccess(), true);\n    EXPECT_EQ(ruOutcome1.result().RequestId().size(), 24UL);\n    EXPECT_EQ(ruOutcome1.result().VersionId().empty(), false);\n\n    GetObjectRequest gRequest1(BucketName, key1);\n    gRequest1.setVersionId(ruOutcome1.result().VersionId());\n    auto gOutcome1 = Client->GetObject(gRequest1);\n    EXPECT_EQ(gOutcome1.isSuccess(), true);\n    EXPECT_EQ(TestUtils::GetFileMd5(tmpFile1), ComputeContentMD5(*gOutcome1.result().Content()));\n    RemoveFile(tmpFile1);\r\n}\r\n\r\nTEST_F(CryptoObjectVersioningTest, ResumableDownloadWithVersioningEnableTest)\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\n\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\n\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\n        return;\r\n\r\n    //multi-part mode\r\n    std::string key = TestUtils::GetObjectKey(\"ResumableDownloadWithVersioningEnableTestOverPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableDownloadWithVersioningEnableTestOverPartSize\").append(\".tmp\");\n    std::string tmpFileDonwload = TestUtils::GetTargetFileName(\"ResumableDownloadWithVersioningEnableTestOverPartSize\").append(\".dat\");\n    // limit file size between 800KB and 2000KB\n    int num = 8 + rand() % 12;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num + 10);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, tmpFile);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\n\n    auto dOutcome = Client->DeleteObject(BucketName, key);\r\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n    EXPECT_EQ(dOutcome.result().VersionId().empty(), false);\n    EXPECT_EQ(dOutcome.result().DeleteMarker(), true);\n\n    DownloadObjectRequest rdRequest(BucketName, key, tmpFileDonwload);\n    rdRequest.setPartSize(100 * 1024);\n    rdRequest.setThreadNum(3);\n    auto rdOutcome = Client->ResumableDownloadObject(rdRequest);\n    EXPECT_EQ(rdOutcome.isSuccess(), false);\n    EXPECT_EQ(rdOutcome.error().Code(), \"NoSuchKey\");\n\n    rdRequest.setVersionId(pOutcome.result().VersionId());\n    rdOutcome = Client->ResumableDownloadObject(rdRequest);\n    EXPECT_EQ(rdOutcome.isSuccess(), true);\n    EXPECT_EQ(rdOutcome.result().VersionId(), pOutcome.result().VersionId());\n    EXPECT_EQ(TestUtils::GetFileMd5(tmpFile), TestUtils::GetFileMd5(tmpFileDonwload));\r\n\r\n    RemoveFile(tmpFileDonwload);\r\n\r\n    //get object mode\r\n    std::string tmpFileDonwload1 = TestUtils::GetTargetFileName(\"ResumableDownloadWithVersioningEnableTestUnderPartSize\").append(\".dat\");\n    DownloadObjectRequest rdRequest1(BucketName, key, tmpFileDonwload1);\n    rdRequest1.setPartSize(4 * 1024 * 1024);\n    rdOutcome = Client->ResumableDownloadObject(rdRequest1);\n    EXPECT_EQ(rdOutcome.isSuccess(), false);\n    EXPECT_EQ(rdOutcome.error().Code(), \"NoSuchKey\");\r\n\r\n    rdRequest1.setVersionId(pOutcome.result().VersionId());\n    rdOutcome = Client->ResumableDownloadObject(rdRequest1);\n    EXPECT_EQ(rdOutcome.isSuccess(), true);\n    EXPECT_EQ(rdOutcome.result().VersionId(), pOutcome.result().VersionId());\n    EXPECT_EQ(TestUtils::GetFileMd5(tmpFile), TestUtils::GetFileMd5(tmpFileDonwload1));\r\n\r\n    RemoveFile(tmpFileDonwload1);\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\n}\r\n}"
  },
  {
    "path": "test/src/Encryption/CryptoResumableObjectTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssEncryptionClient.h>\n#include <alibabacloud/oss/Const.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include \"src/utils/FileSystemUtils.h\"\n#include \"src/utils/Utils.h\"\n#include \"src/external/json/json.h\"\n#include <fstream>\n#include <ctime>\n\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass CryptoResumableObjectTest : public::testing::Test {\nprotected:\n    CryptoResumableObjectTest()\n    {\n    }\n    ~CryptoResumableObjectTest()override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n        PublicKey =\n            \"-----BEGIN RSA PUBLIC KEY-----\\n\"\n            \"MIGJAoGBALpUiB+w+r3v2Fgw0SgMbWl8bnzUVc3t3YbA89H13lrw7v6RUbL8+HGl\\n\"\n            \"s5YGoqD4lObG/sCQyaWd0B/XzOhjlSc1b53nyZhms84MGJ6nF2NQP+1gjY1ByDMK\\n\"\n            \"zeyVFFFvl9prlr6XpuJQlY0F/W4pbjLsk8Px4Qix5AoJbShElUu1AgMBAAE=\\n\"\n            \"-----END RSA PUBLIC KEY-----\";\n\n        PrivateKey =\n            \"-----BEGIN RSA PRIVATE KEY-----\\n\"\n            \"MIICXgIBAAKBgQC6VIgfsPq979hYMNEoDG1pfG581FXN7d2GwPPR9d5a8O7+kVGy\\n\"\n            \"/PhxpbOWBqKg+JTmxv7AkMmlndAf18zoY5UnNW+d58mYZrPODBiepxdjUD/tYI2N\\n\"\n            \"QcgzCs3slRRRb5faa5a+l6biUJWNBf1uKW4y7JPD8eEIseQKCW0oRJVLtQIDAQAB\\n\"\n            \"AoGBAJrzWRAhuSLipeMRFZ5cV1B1rdwZKBHMUYCSTTC5amPuIJGKf4p9XI4F4kZM\\n\"\n            \"1klO72TK72dsAIS9rCoO59QJnCpG4CvLYlJ37wA2UbhQ1rBH5dpBD/tv3CUyfdtI\\n\"\n            \"9CLUsZR3DGBWXYwGG0KGMYPExe5Hq3PUH9+QmuO+lXqJO4IBAkEA6iLee6oBzu6v\\n\"\n            \"90zrr4YA9NNr+JvtplpISOiL/XzsU6WmdXjzsFLSsZCeaJKsfdzijYEceXY7zUNa\\n\"\n            \"0/qQh2BKoQJBAMu61rQ5wKtql2oR4ePTSm00/iHoIfdFnBNU+b8uuPXlfwU80OwJ\\n\"\n            \"Gbs0xBHe+dt4uT53QLci4KgnNkHS5lu4XJUCQQCisCvrvcuX4B6BNf+mbPSJKcci\\n\"\n            \"biaJqr4DeyKatoz36mhpw+uAH2yrWRPZEeGtayg4rvf8Jf2TuTOJi9eVWYFBAkEA\\n\"\n            \"uIPzyS81TQsxL6QajpjjI52HPXZcrPOis++Wco0Cf9LnA/tczSpA38iefAETEq94\\n\"\n            \"NxcSycsQ5br97QfyEsgbMQJANTZ/HyMowmDPIC+n9ExdLSrf4JydARSfntFbPsy1\\n\"\n            \"4oC6ciKpRdtAtAtiU8s9eAUSWi7xoaPJzjAHWbmGSHHckg==\\n\"\n            \"-----END RSA PRIVATE KEY-----\";\n\n        Description[\"comment\"] = \"rsa test\";\n        Description[\"provider\"] = \"aliclould\";\n        Endpoint = Config::Endpoint;\n        Client = std::make_shared<OssEncryptionClient>(Endpoint, Config::AccessKeyId, Config::AccessKeySecret,\n            ClientConfiguration(), std::make_shared<SimpleRSAEncryptionMaterials>(PublicKey, PrivateKey, Description),\n            CryptoConfiguration());\n\n        UnEncryptionClient = std::make_shared<OssClient>(Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\n\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-crypto-resumableobject\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n        UploadPartFailedFlag = 1 << 30;\n        DownloadPartFailedFlag = 1 << 30;\n        CopyPartFailedFlag = 1 << 30;\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n        TestUtils::CleanBucket(*Client, BucketName);\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\n\n    static std::string GetCheckpointFileByResumableUploader(std::string bucket, std::string key,\n        std::string checkpointDir, std::string filePath);\n    static std::string GetCheckpointFileByResumableDownloader(std::string bucket, std::string key,\n        std::string checkpointDir, std::string filePath);\n    static std::string GetCheckpointFileByResumableCopier(std::string bucket, std::string key,\n        std::string srcBucket, std::string srcKey, std::string checkpointDir);\n    static void ProgressCallback(size_t increment, int64_t transfered, int64_t total, void* userData);\n\npublic:\n    static std::shared_ptr<OssEncryptionClient> Client;\n    static std::shared_ptr<OssClient> UnEncryptionClient;\n    static std::string BucketName;\n    static int UploadPartFailedFlag;\n    static int DownloadPartFailedFlag;\n    static int CopyPartFailedFlag;\n    static std::string PublicKey;\n    static std::string PrivateKey;\n    static std::map<std::string, std::string> Description;\n    static std::string Endpoint;\n\n    class Timer\n    {\n    public:\n        Timer() : begin_(std::chrono::high_resolution_clock::now()) {}\n        void reset() { begin_ = std::chrono::high_resolution_clock::now(); }\n        int64_t elapsed() const\n        {\n            return std::chrono::duration_cast<std::chrono::seconds>(std::chrono::high_resolution_clock::now() - begin_).count();\n        }\n    private:\n        std::chrono::time_point<std::chrono::high_resolution_clock> begin_;\n    };\n};\n\nstd::string CryptoResumableObjectTest::GetCheckpointFileByResumableUploader(std::string bucket,\n    std::string key, std::string checkpointDir, std::string filePath)\n{\n    if (!checkpointDir.empty()) {\n        std::stringstream ss;\n        ss << \"oss://\" << bucket << \"/\" << key;\n        auto destPath = ss.str();\n        auto safeFileName = ComputeContentETag(filePath) + \"--\" + ComputeContentETag(destPath);\n        return checkpointDir + PATH_DELIMITER + safeFileName;\n    }\n    return \"\";\n}\n\nstd::string CryptoResumableObjectTest::GetCheckpointFileByResumableDownloader(std::string bucket,\n    std::string key, std::string checkpointDir, std::string filePath)\n{\n    if (!checkpointDir.empty()) {\n        std::stringstream ss;\n        ss << \"oss://\" << bucket << \"/\" << key;\n        auto srcPath = ss.str();\n        auto safeFileName = ComputeContentETag(srcPath) + \"--\" + ComputeContentETag(filePath);\n        return checkpointDir + PATH_DELIMITER + safeFileName;\n    }\n    return \"\";\n}\n\nstd::string CryptoResumableObjectTest::GetCheckpointFileByResumableCopier(std::string bucket, std::string key,\n    std::string srcBucket, std::string srcKey, std::string checkpointDir)\n{\n    if (!checkpointDir.empty()) {\n        std::stringstream ss;\n        ss << \"oss://\" << srcBucket << \"/\" << srcKey;\n        auto srcPath = ss.str();\n        ss.str(\"\");\n        ss << \"oss://\" << bucket << \"/\" << key;\n        auto destPath = ss.str();\n\n        auto safeFileName = ComputeContentETag(srcPath) + \"--\" + ComputeContentETag(destPath);\n        return checkpointDir + PATH_DELIMITER + safeFileName;\n    }\n    return \"\";\n}\n\nvoid CryptoResumableObjectTest::ProgressCallback(size_t increment, int64_t transfered, int64_t total, void* userData)\n{\n    std::cout << \"ProgressCallback[\" << userData << \"] => \" <<\n        increment << \",\" << transfered << \",\" << total << std::endl;\n}\n\nstd::shared_ptr<OssEncryptionClient> CryptoResumableObjectTest::Client = nullptr;\nstd::shared_ptr<OssClient> CryptoResumableObjectTest::UnEncryptionClient = nullptr;\nstd::string CryptoResumableObjectTest::BucketName = \"\";\nint CryptoResumableObjectTest::UploadPartFailedFlag = 0;\nint CryptoResumableObjectTest::DownloadPartFailedFlag = 0;\nint CryptoResumableObjectTest::CopyPartFailedFlag = 0;\nstd::string CryptoResumableObjectTest::PublicKey = \"\";\nstd::string CryptoResumableObjectTest::PrivateKey = \"\";\nstd::map<std::string, std::string> CryptoResumableObjectTest::Description = std::map<std::string, std::string>();\nstd::string CryptoResumableObjectTest::Endpoint = \"\";\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadWithSizeOverPartSizeTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"ResumableUploadObjectOverPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableUploadObjectOverPartSize\").append(\".tmp\");\n    // limit file size between 800KB and 2000KB\n    int num = 8 + rand() % 12;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num + 10);\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(1);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    auto getObjectOutcome = Client->GetObject(GetObjectRequest(BucketName, key));\n    EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n\n    auto getoutcome = Client->GetObject(GetObjectRequest(BucketName, key));\n\n    std::fstream file(tmpFile, std::ios::in | std::ios::binary);\n    std::string oriMd5 = ComputeContentMD5(file);\n    std::string memMd5 = ComputeContentMD5(*getObjectOutcome.result().Content());\n    EXPECT_EQ(oriMd5, memMd5);\n\n    file.close();\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadWithSizeUnderPartSizeTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"ResumableUploadObjectUnderPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableUploadObjectUnderPartSize\").append(\".tmp\");\n    int num = rand() % 8;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 10240 * num);\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(1);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    auto getObjectOutcome = Client->GetObject(GetObjectRequest(BucketName, key));\n    EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, UnnormalResumableObjectWithDisableRequest)\n{\n    std::string key = TestUtils::GetObjectKey(\"UnnormalUploadObjectWithDisableRequest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalUploadObjectWithDisableRequest\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n    Client->DisableRequest();\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(102400);\n    request.setThreadNum(1);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ClientError:100002\");\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    Client->EnableRequest();\n}\n\nTEST_F(CryptoResumableObjectTest, MultiResumableUploadWithSizeOverPartSizeTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"MultiUploadObjectOverPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"MultiUploadObjectOverPartSize\").append(\".tmp\");\n    int num = 8 + rand() % 12;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n    int threadNum = 1 + rand() % 99;\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(threadNum);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadSetMinPartSizeTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectSetMinPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectSetMinPartSize\").append(\".tmp\");\n    int num = 1 + rand() % 20;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n    int partSize = 1 + rand() % 99;\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(partSize * 102400);\n    request.setThreadNum(1);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, UnnormalResumableUploadWithoutSourceFilePathTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"UnnormalUplloadObjectWithoutFilePath\");\n    std::string tmpFile;\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n}\n\nTEST_F(CryptoResumableObjectTest, UnnormalResumableUploadWithoutRealFileTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"UnnormalUplloadObjectWithoutRealFile\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalUplloadObjectWithoutRealFile\").append(\".tmp\");\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setThreadNum(1);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n}\n\nTEST_F(CryptoResumableObjectTest, UnnormalResumableUploadWithNotExitsCheckpointTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"UnnormalUploadObjectWithNotExitsCheckpoint\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalUploadObjectWithNotExitsCheckpoint\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 100);\n    std::string checkPoint = \"NotExistDir\";\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(1);\n    request.setCheckpointDir(checkPoint);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadWithCheckpointTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithCheckpoint\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithCheckpoint\").append(\".tmp\");\n    std::string checkpointDir = TestUtils::GetExecutableDirectory();\n    int num = 1 + rand() % 10;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(1);\n    request.setCheckpointDir(checkpointDir);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, MultiResumableUploadWithCheckpointTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"MultiUploadObjectWithCheckpoint\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithCheckpoint\").append(\".tmp\");\n    std::string checkpointDir = TestUtils::GetExecutableDirectory();\n    int num = 8 + rand() % 12;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n    int threadNum = 1 + rand() % 99;\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(100 * 1024);\n    request.setCheckpointDir(checkpointDir);\n    request.setThreadNum(threadNum);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, UnnormalResumableUploadWithFailedPartUploadTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"UnnormalUploadObjectWithFailedPart\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalUploadObjectWithFailedPart\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(1024);\n    auto failOutcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(failOutcome.isSuccess(), false);\n\n    request.setPartSize(102400);\n    request.setFlags(request.Flags() | UploadPartFailedFlag);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadRetryAfterFailedPartTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithFailedPart\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithFailedPart\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n    std::string checkpointKey = TestUtils::GetObjectKey(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointKey), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n    // resumable upload object failed\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(102400);\n    request.setThreadNum(1);\n    request.setFlags(request.Flags() | UploadPartFailedFlag);\n    request.setCheckpointDir(checkpointKey);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // retry\n    request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n    auto retryOutcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n}\n\nTEST_F(CryptoResumableObjectTest, MultiResumableUploadRetryAfterFailedPartTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalMultiUploadObjectWithFailedPart\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalMultiUploadObjectWithFailedPart\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n    std::string checkpointKey = TestUtils::GetObjectKey(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointKey), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n    // resumable upload object failed\n    int threadNum = 1 + rand() % 100;\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(102400);\n    request.setThreadNum(threadNum);\n    request.setFlags(request.Flags() | UploadPartFailedFlag);\n    request.setCheckpointDir(checkpointKey);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // retry\n    request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n    auto retryOutcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadRetryWithSourceFileChangedTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithSourceFileChanged\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithSourceFileChanged\").append(\".tmp\");\n    int num = 2 + rand() % 10;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n    std::string sourceFileMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string checkpointKey = TestUtils::GetObjectKey(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointKey), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n    // resumable upload object failed\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setThreadNum(1);\n    request.setPartSize(102400);\n    request.setFlags(request.Flags() | UploadPartFailedFlag);\n    request.setCheckpointDir(checkpointKey);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // change source file\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    // TODO: API only check file size, don't check the contents of file\n    TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (num + 1));\n    std::string newSourceFileMd5 = TestUtils::GetFileMd5(tmpFile);\n    EXPECT_NE(sourceFileMd5, newSourceFileMd5);\n\n    // retry\n    request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n    auto retryOutcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download target object\n    std::string targetFile = TestUtils::GetObjectKey(\"DownloadResumableUploadObject\");\n    auto getObjectOutcome = Client->GetObject(BucketName, key, targetFile);\n    std::shared_ptr<std::iostream> getObjectContent = nullptr;\n    getObjectOutcome.result().setContent(getObjectContent);\n    EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n\n    std::string targetFileMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(targetFileMd5, newSourceFileMd5);\n    EXPECT_NE(targetFileMd5, sourceFileMd5);\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n}\n\nTEST_F(CryptoResumableObjectTest, MultiResumableUploadRetryWithSourceFileChangedTest)\n{\n\n    std::string key = TestUtils::GetObjectKey(\"MultiUploadObjectWithSourceFileChanged\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"MultiUploadObjectWithSourceFileChanged\").append(\".tmp\");\n    int num = 2 + rand() % 10;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n    std::string sourceFileMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string checkpointKey = TestUtils::GetObjectKey(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointKey), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n    // upload object failed\n    int threadNum = 1 + rand() % 100;\n    UploadObjectRequest request(BucketName, key, tmpFile, checkpointKey, 102400, threadNum);\n    request.setFlags(request.Flags() | UploadPartFailedFlag);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // change source file\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num + 100);\n    std::string newSourceFileMd5 = TestUtils::GetFileMd5(tmpFile);\n    EXPECT_NE(sourceFileMd5, newSourceFileMd5);\n\n    // retry\n    request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n    auto retryOutcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download\n    std::string targetFile = TestUtils::GetObjectKey(\"DownloadResumableUploadObject\");\n    auto getObjectOutcome = Client->GetObject(BucketName, key, targetFile);\n    std::shared_ptr<std::iostream> getObjectContent = nullptr;\n    getObjectOutcome.result().setContent(getObjectContent);\n    EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n\n    std::string targetFileMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(targetFileMd5, newSourceFileMd5);\n    EXPECT_NE(targetFileMd5, sourceFileMd5);\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadRetryWithCheckpointFileChangedTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithCheckpointFileChanged\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithCheckpointFileChanged\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n    std::string checkpointKey = TestUtils::GetTargetFileName(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointKey), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n    // resumable upload object failed\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(102400);\n    request.setThreadNum(1);\n    request.setFlags(request.Flags() | UploadPartFailedFlag);\n    request.setCheckpointDir(checkpointKey);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // change the checkpoint file\n    std::string checkpointFilename = GetCheckpointFileByResumableUploader(BucketName, key, checkpointKey, tmpFile);\n    std::string checkpointTmpFile = std::string(checkpointFilename).append(\".tmp\");\n    std::ifstream jsonStream(checkpointFilename, std::ios::in | std::ios::binary);\n    Json::CharReaderBuilder rbuilder;\n    Json::Value readRoot;\n    Json::Value writeRoot;\n    std::string uploadId = \"InvaliedUploadID\";\n    //if (reader.parse(jsonStream, readRoot)) {\n    if (Json::parseFromStream(rbuilder, jsonStream, &readRoot, nullptr)) {\n        writeRoot[\"opType\"] = readRoot[\"opType\"].asString();\n        writeRoot[\"uploadID\"] = uploadId;\n        writeRoot[\"bucket\"] = readRoot[\"bucket\"].asString();\n        writeRoot[\"key\"] = readRoot[\"key\"].asString();\n        writeRoot[\"mtime\"] = readRoot[\"mtime\"].asString();\n        writeRoot[\"size\"] = readRoot[\"size\"].asInt64();\n        writeRoot[\"partSize\"] = readRoot[\"partSize\"].asInt64();\n        writeRoot[\"md5Sum\"] = readRoot[\"md5Sum\"].asString();\n    }\n    jsonStream.close();\n\n    std::fstream recordStream(checkpointTmpFile, std::ios::out);\n    if (recordStream.is_open()) {\n        recordStream << writeRoot;\n    }\n    recordStream.close();\n    EXPECT_EQ(RemoveFile(checkpointFilename), true);\n    EXPECT_EQ(RenameFile(checkpointTmpFile, checkpointFilename), true);\n\n    // retry\n    request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n    auto retryOutcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n}\n\nTEST_F(CryptoResumableObjectTest, MultiResumableUploadRetryWithCheckpointFileChangedTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"MultiUploadObjectWithCheckpointFileChanged\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"MultiUploadObjectWithCheckpointFileChanged\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n    std::string checkpointKey = TestUtils::GetTargetFileName(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointKey), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n    // resumable upload object failed\n    int threadNum = 1 + rand() % 100;\n    UploadObjectRequest request(BucketName, key, tmpFile, checkpointKey, 102400, threadNum);\n    request.setFlags(request.Flags() | UploadPartFailedFlag);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // change the checkpoint file\n    std::string checkpointFilename = GetCheckpointFileByResumableUploader(BucketName, key, checkpointKey, tmpFile);\n    std::string checkpointTmpFile = std::string(checkpointFilename).append(\".tmp\");\n    std::ifstream jsonStream(checkpointFilename, std::ios::in | std::ios::binary);\n    Json::CharReaderBuilder rbuilder;\n    Json::Value readRoot;\n    Json::Value writeRoot;\n    std::string uploadId = \"InvaliedUploadID\";\n    //if (reader.parse(jsonStream, readRoot)) {\n    if (Json::parseFromStream(rbuilder, jsonStream, &readRoot, nullptr)) {\n        writeRoot[\"opType\"] = readRoot[\"opType\"].asString();\n        writeRoot[\"uploadID\"] = uploadId;\n        writeRoot[\"bucket\"] = readRoot[\"bucket\"].asString();\n        writeRoot[\"key\"] = readRoot[\"key\"].asString();\n        writeRoot[\"mtime\"] = readRoot[\"mtime\"].asString();\n        writeRoot[\"size\"] = readRoot[\"size\"].asInt64();\n        writeRoot[\"partSize\"] = readRoot[\"partSize\"].asInt64();\n        writeRoot[\"md5Sum\"] = readRoot[\"md5Sum\"].asString();\n    }\n    jsonStream.close();\n\n    std::fstream recordStream(checkpointTmpFile, std::ios::out);\n    if (recordStream.is_open()) {\n        recordStream << writeRoot;\n    }\n    recordStream.close();\n    EXPECT_EQ(RemoveFile(checkpointFilename), true);\n    EXPECT_EQ(RenameFile(checkpointTmpFile, checkpointFilename), true);\n\n    // retry\n    request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n    auto retryOutcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadWithProgressCallbackTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalResumableUploadObjectWithCallback\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalResumableUploadObjectWithCallback\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n    std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointDir), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n    TransferProgress progressCallback = { ProgressCallback, this };\n    UploadObjectRequest request(BucketName, key, tmpFile, checkpointDir, 102400, 1);\n    request.setTransferProgress(progressCallback);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    request = UploadObjectRequest(BucketName, key, tmpFile, checkpointDir, 10240000, 1);\n    request.setTransferProgress(progressCallback);\n    outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadProgressCallbackWithUploadPartFailedTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalResumableUploadObjectWithCallback\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalResumableUploadObjectWithCallback\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n    std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointDir), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n    TransferProgress progressCallback = { ProgressCallback, this };\n    UploadObjectRequest request(BucketName, key, tmpFile, checkpointDir, 102400, 1);\n    request.setFlags(request.Flags() | UploadPartFailedFlag);\n    request.setTransferProgress(progressCallback);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // retry\n    std::cout << \"Retry : \" << std::endl;\n    request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n    auto retryOutcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n}\n\nTEST_F(CryptoResumableObjectTest, MultiResumableUploadWithThreadNumberOverPartNumber)\n{\n    std::string key = TestUtils::GetObjectKey(\"MultiUploadObjectWithThreadNumberOverPartNumber\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"MultiUploadObjectWithThreadNumberOverPartNumber\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n\n    int threadNum = 0;\n    UploadObjectRequest request(BucketName, key, tmpFile, \"\");\n    request.setPartSize(102400);\n    request.setThreadNum(threadNum);\n    auto invalidateOutcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(invalidateOutcome.isSuccess(), false);\n\n    // the thread num over part num\n    threadNum = 20;\n    request.setThreadNum(threadNum);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadWithObjectMetaDataSetTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithObjectMetaDateSetTest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithObjectMetaDateSetTest\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n\n    ObjectMetaData meta;\n    meta.setCacheControl(\"No-Cache\");\n    meta.setExpirationTime(\"Fri, 09 Nov 2018 05:57:16 GMT\");\n    // upload object\n    UploadObjectRequest request(BucketName, key, tmpFile, \"\", meta);\n    request.setPartSize(102400);\n    request.setThreadNum(1);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    auto hOutcome = Client->HeadObject(BucketName, key);\n    EXPECT_EQ(hOutcome.isSuccess(), true);\n    EXPECT_EQ(hOutcome.result().CacheControl(), \"No-Cache\");\n    EXPECT_EQ(hOutcome.result().ExpirationTime(), \"Fri, 09 Nov 2018 05:57:16 GMT\");\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadWithUserMetaDataTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithUserDataTest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithUserDataTest\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n\n    // upload object\n    ObjectMetaData metaDate;\n    metaDate.UserMetaData()[\"test\"] = \"testvalue\";\n    UploadObjectRequest request(BucketName, key, tmpFile, \"\", 102400, 1, metaDate);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    auto hOutcome = Client->HeadObject(BucketName, key);\n    EXPECT_EQ(hOutcome.isSuccess(), true);\n    EXPECT_EQ(hOutcome.result().UserMetaData().at(\"test\"), \"testvalue\");\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadWithObjectAclSetTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithObjectAclSetTest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n\n    // upload object\n    UploadObjectRequest request(BucketName, key, tmpFile, \"\", 102400, 1);\n    CannedAccessControlList acl = CannedAccessControlList::PublicReadWrite;\n    request.setAcl(acl);\n    request.setEncodingType(\"url\");\n    EXPECT_EQ(request.EncodingType(), \"url\");\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    auto aclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName, key));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n    EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::PublicReadWrite);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadWithNon16AlignmentPartSizeTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalResumableUploadWithNon16AlignmentPartSizeTest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalResumableUploadWithNon16AlignmentPartSizeTest\").append(\".tmp\");\n    // limit file size between 800KB and 2000KB\n    int num = 8 + rand() % 12;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num + 10);\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(100 * 1024 + 3);\n    request.setThreadNum(3);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    auto getObjectOutcome = Client->GetObject(GetObjectRequest(BucketName, key));\n    EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n\n    std::fstream file(tmpFile, std::ios::in | std::ios::binary);\n    std::string oriMd5 = ComputeContentMD5(file);\n    std::string memMd5 = ComputeContentMD5(*getObjectOutcome.result().Content());\n    EXPECT_EQ(oriMd5, memMd5);\n    auto value = getObjectOutcome.result().Metadata().UserMetaData().at(\"client-side-encryption-part-size\");\n    EXPECT_EQ(\"102400\", value);\n\n    file.close();\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableUploadWithContentMD5Test)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalResumableUploadWithContentMD5Test\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalResumableUploadWithContentMD5Test\").append(\".tmp\");\n\n    // limit file size between 800KB and 2000KB\n    int num = 8 + rand() % 12;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num + 10);\n    std::fstream file(tmpFile, std::ios::in | std::ios::binary);\n    std::string oriMd5 = ComputeContentMD5(file);\n    file.close();\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(200 * 1024);\n    request.setThreadNum(3);\n    request.MetaData().setContentMd5(oriMd5);\n    auto outcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    auto getObjectOutcome = Client->GetObject(GetObjectRequest(BucketName, key));\n    EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n\n    std::string memMd5 = ComputeContentMD5(*getObjectOutcome.result().Content());\n    auto unencryptedMd5 = getObjectOutcome.result().Metadata().UserMetaData().at(\"client-side-encryption-unencrypted-content-md5\");\n    EXPECT_EQ(unencryptedMd5, memMd5);\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, UnnormalResumableDownloadObjectWithDisableRequest)\n{\n    // upload object\n    std::string key = TestUtils::GetObjectKey(\"UnnormalResumableDownloadObjectWithDisableRequest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalResumableDownloadObjectWithDisableRequest\").append(\".tmp\");\n    std::string targetKey = TestUtils::GetObjectKey(\"UnnormalResumableDownloadTargetObject\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (1 + rand() % 10));\n\n    auto putObjectOutcome = Client->PutObject(BucketName, key, tmpFile);\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n\n    // download object\n    Client->DisableRequest();\n    DownloadObjectRequest request(BucketName, key, targetKey);\n    request.setPartSize(102400);\n    request.setThreadNum(1);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ClientError:100002\");\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    RemoveFile(targetKey.append(\".temp\"));\n    Client->EnableRequest();\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDownloadWithSizeOverPartSizeTest)\n{\n    // upload object\n    std::string key = TestUtils::GetObjectKey(\"ResumableDownloadObjectOverPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableDownloadObjectOverPartSize\").append(\".tmp\");\n    std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n    int num = 1 + rand() % 10;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n    auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download object\n    DownloadObjectRequest request(BucketName, key, targetFile);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(1);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(uploadMd5, downloadMd5);\n\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDownloadWithSizeUnderPartSizeTest)\n{\n    // upload object\n    std::string key = TestUtils::GetObjectKey(\"ResumableDownloadObjectUnderPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableDownloadObjectUnderPartSize\").append(\".tmp\");\n    std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n    int num = 10 + rand() % 10;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n    auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download object\n    DownloadObjectRequest request(BucketName, key, targetFile);\n    request.setThreadNum(1);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(uploadMd5, downloadMd5);\n\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, MultiResumableDownloadWithSizeOverPartSizeTest)\n{\n    // upload\n    std::string key = TestUtils::GetObjectKey(\"MultiResumableDownloadObjectOverPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"MultiResumableDownloadObjectOverPartSize\").append(\".tmp\");\n    std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n    int num = 1 + rand() % 10;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n    int threadNum = 1 + rand() % 100;\n    auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(uploadOutcome.result().VersionId().empty(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download\n    DownloadObjectRequest request(BucketName, key, targetFile);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(threadNum);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(uploadMd5, downloadMd5);\n\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDownloadSetMinPartSizeTest)\n{\n    // upload\n    std::string key = TestUtils::GetObjectKey(\"ResumableDownloadObjectSetMinPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableDownloadObjectSetMinPartSize\").append(\".tmp\");\n    std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n    int num = 1 + rand() % 10;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n    auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(uploadOutcome.result().VersionId().empty(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download\n    int partSize = 1 + rand() % 99;\n    DownloadObjectRequest request(BucketName, key, targetFile);\n    request.setPartSize(partSize * 1024);\n    request.setThreadNum(1);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    request.setPartSize(102400);\n    auto retryOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n\n    std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(uploadMd5, downloadMd5);\n\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, UnnormalResumableDownloadWithoutTargetFilePathTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"UnnormalUplloadObjectWithoutFilePath\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalUplloadObjectWithoutFilePath\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1));\n    auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download\n    std::string targetFile;\n    DownloadObjectRequest request(BucketName, key, targetFile);\n    request.setPartSize(100 * 1024);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDownloadWithCheckpointTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalDownloadObjectWithCheckpoint\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalDownloadObjectWithCheckpoint\").append(\".tmp\");\n    std::string checkpointDir = TestUtils::GetExecutableDirectory();\n    std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n\n    // upload\n    auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download\n    DownloadObjectRequest request(BucketName, key, targetFile);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(1);\n    request.setCheckpointDir(checkpointDir);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(uploadMd5, downloadMd5);\n\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, UnnormalResumableDownloadWithNotExitsCheckpointTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"UnnormalDownloadObjectWithNotExistCheckpoint\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalDownloadObjectWithNotExistCheckpoint\").append(\".tmp\");\n    std::string checkpointDir = \"NotExistDir\";\n    std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n\n    // upload\n    auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download\n    DownloadObjectRequest request(BucketName, key, targetFile);\n    request.setPartSize(100 * 1024);\n    request.setCheckpointDir(checkpointDir);\n    auto outcome = Client->ResumableDownloadObject(request);\n    std::shared_ptr<std::iostream> content = nullptr;\n    outcome.result().setContent(content);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    RemoveFile(targetFile.append(\".temp\"));\n    RemoveFile(tmpFile);\n}\n\nTEST_F(CryptoResumableObjectTest, MultiResumableDownloadWithCheckpointTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"MultiDownloadObjectWithCheckpoint\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"MultiDownloadObjectWithCheckpoint\").append(\".tmp\");\n    std::string checkpointDir = TestUtils::GetExecutableDirectory();\n    std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n\n    // upload\n    auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download\n    int threadNum = 1 + rand() % 99;\n    DownloadObjectRequest request(BucketName, key, targetFile);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(threadNum);\n    request.setCheckpointDir(checkpointDir);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(uploadMd5, downloadMd5);\n\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CryptoResumableObjectTest, UnnormalResumableDownloadWithDownloadPartFailedTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"UnnormalDownloadObjectWithPartFailed\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalDownloadObjectWithPartFailed\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n    std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n    std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointDir), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n    // upload object\n    auto uploadOutcome = Client->PutObject(BucketName, key, tmpFile);\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download object\n    DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, 1);\n    request.setFlags(request.Flags() | DownloadPartFailedFlag);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    std::string checkpointFile = GetCheckpointFileByResumableDownloader(BucketName, key, checkpointDir, targetFile);\n    std::string failedDownloadFile = targetFile.append(\".temp\");\n    EXPECT_EQ(RemoveFile(checkpointFile), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveFile(failedDownloadFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDownloadRetryWithCheckpointTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalDownloadObjectRetryWithCheckpoint\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalDownloadObjectRetryWithCheckpoint\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n    std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n    std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointDir), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n    // upload object\n    auto uploadOutcome = Client->PutObject(BucketName, key, tmpFile);\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download object\n    DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, 1);\n    request.setFlags(request.Flags() | DownloadPartFailedFlag);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // retry\n    request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n    auto retryOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n\n    std::string uploadFileMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string downloadFileMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(uploadFileMd5, downloadFileMd5);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n}\n\nTEST_F(CryptoResumableObjectTest, MultiResumableDownloadRetryWithCheckpointTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"MultiDownloadObjectRetryWithCheckpoint\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"MultiDownloadObjectRetryWithCheckpoint\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n    std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n    std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointDir), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n    // upload object\n    auto uploadOutcome = Client->PutObject(BucketName, key, tmpFile);\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download object\n    int threadNum = 1 + rand() % 100;\n    DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, threadNum);\n    request.setFlags(request.Flags() | DownloadPartFailedFlag);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // retry\n    request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n    auto retryOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n\n    std::string uploadFileMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string downloadFileMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(uploadFileMd5, downloadFileMd5);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDownloadRetryWithSourceObjectDeletedTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalDownloadObjectRetryWithSourceObjectDeleted\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalDownloadObjectRetryWithSourceObjectDeleted\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n    std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n    std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointDir), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n    // put object\n    auto putObjectOutcome = Client->PutObject(BucketName, key, tmpFile);\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download object\n    DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, 1);\n    request.setFlags(request.Flags() | DownloadPartFailedFlag);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // delete source object\n    auto deleteObjectOutcome = Client->DeleteObject(BucketName, key);\n    EXPECT_EQ(deleteObjectOutcome.isSuccess(), true);\n\n    // retry\n    request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n    auto retryOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), false);\n\n    std::string checkpointFile = GetCheckpointFileByResumableDownloader(BucketName, key, checkpointDir, targetFile);\n    EXPECT_EQ(RemoveFile(checkpointFile), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveFile(targetFile.append(\".temp\")), true);\n    EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDownloadRetryWithCheckpointFileChangedTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"NormalDownloadObjectRetryWithCheckpointFileChanged\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"NormalDownloadObjectRetryWithCheckpointFileChanged\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n    std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n    std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointDir), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n    auto uploadOutcome = Client->PutObject(BucketName, key, tmpFile);\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download object\n    DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, 1);\n    request.setFlags(request.Flags() | DownloadPartFailedFlag);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // change the checkpoint file\n    std::string checkpointFile = GetCheckpointFileByResumableDownloader(BucketName, key, checkpointDir, targetFile);\n    std::string checkpointTmpFile = std::string(checkpointFile).append(\".tmp\");\n    std::ifstream jsonStream(checkpointFile, std::ios::in | std::ios::binary);\n    Json::CharReaderBuilder rbuilder;\n    Json::Value readRoot;\n    Json::Value writeRoot;\n    std::string invaliedKey = \"InvaliedKey\";\n    if (Json::parseFromStream(rbuilder, jsonStream, &readRoot, nullptr)) {\n    //if (reader.parse(jsonStream, readRoot)) {\n        writeRoot[\"opType\"] = readRoot[\"opType\"].asString();\n        writeRoot[\"bucket\"] = readRoot[\"bucket\"].asString();\n        writeRoot[\"key\"] = invaliedKey;\n        writeRoot[\"filePath\"] = readRoot[\"filePath\"].asString();\n        writeRoot[\"mtime\"] = readRoot[\"mtime\"].asString();\n        writeRoot[\"sizesize\"] = readRoot[\"size\"].asUInt64();\n        writeRoot[\"partSize\"] = readRoot[\"partSize\"].asUInt64();\n\n        for (uint32_t i = 0; i < readRoot[\"parts\"].size(); i++) {\n            Json::Value partValue = readRoot[\"parts\"][i];\n            writeRoot[\"parts\"][i][\"partNumber\"] = partValue[\"partNumber\"].asInt();\n            writeRoot[\"parts\"][i][\"size\"] = partValue[\"size\"].asInt64();\n            writeRoot[\"parts\"][i][\"crc64\"] = partValue[\"crc64\"].asUInt64();\n        }\n        writeRoot[\"md5Sum\"] = readRoot[\"md5Sum\"].asString();\n\n        if (readRoot[\"rangeStart\"] != Json::nullValue && readRoot[\"rangeEnd\"] != Json::nullValue) {\n            writeRoot[\"rangeStart\"] = readRoot[\"rangeStart\"].asInt64();\n            writeRoot[\"rangeEnd\"] = readRoot[\"rangeEnd\"].asInt64();\n        }\n    }\n    jsonStream.close();\n\n    std::fstream recordStream(checkpointTmpFile, std::ios::out);\n    if (recordStream.is_open()) {\n        recordStream << writeRoot;\n    }\n    recordStream.close();\n    EXPECT_EQ(RemoveFile(checkpointFile), true);\n    EXPECT_EQ(RenameFile(checkpointTmpFile, checkpointFile), true);\n\n    // retry\n    request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n    auto retryOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n    EXPECT_EQ(retryOutcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n\n    std::string sourceFileMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string targetFileMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(sourceFileMd5, targetFileMd5);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n}\n\nTEST_F(CryptoResumableObjectTest, MultiResumableDownloadRetryWithCheckpointFileChangedTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"MultiDownloadObjectRetryWithCheckpointFileChanged\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"MultiDownloadObjectRetryWithCheckpointFileChanged\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n    std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n    std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointDir), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n    auto uploadOutcome = Client->PutObject(BucketName, key, tmpFile);\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download object\n    int threadNum = 1 + rand() % 100;\n    DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, threadNum);\n    request.setFlags(request.Flags() | DownloadPartFailedFlag);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    // change the checkpoint file\n    std::string checkpointFile = GetCheckpointFileByResumableDownloader(BucketName, key, checkpointDir, targetFile);\n    std::string checkpointTmpFile = std::string(checkpointFile).append(\".tmp\");\n    std::ifstream jsonStream(checkpointFile, std::ios::in | std::ios::binary);\n    Json::CharReaderBuilder rbuilder;\n    Json::Value readRoot;\n    Json::Value writeRoot;\n    std::string invaliedKey = \"InvaliedKey\";\n    if (Json::parseFromStream(rbuilder, jsonStream, &readRoot, nullptr)) {\n    //if (reader.parse(jsonStream, readRoot)) {\n        writeRoot[\"opType\"] = readRoot[\"opType\"].asString();\n        writeRoot[\"bucket\"] = readRoot[\"bucket\"].asString();\n        writeRoot[\"key\"] = invaliedKey;\n        writeRoot[\"filePath\"] = readRoot[\"filePath\"].asString();\n        writeRoot[\"mtime\"] = readRoot[\"mtime\"].asString();\n        writeRoot[\"sizesize\"] = readRoot[\"size\"].asUInt64();\n        writeRoot[\"partSize\"] = readRoot[\"partSize\"].asUInt64();\n\n        for (uint32_t i = 0; i < readRoot[\"parts\"].size(); i++) {\n            Json::Value partValue = readRoot[\"parts\"][i];\n            writeRoot[\"parts\"][i][\"partNumber\"] = partValue[\"partNumber\"].asInt();\n            writeRoot[\"parts\"][i][\"size\"] = partValue[\"size\"].asInt64();\n            writeRoot[\"parts\"][i][\"crc64\"] = partValue[\"crc64\"].asUInt64();\n        }\n        writeRoot[\"md5Sum\"] = readRoot[\"md5Sum\"].asString();\n\n        if (readRoot[\"rangeStart\"] != Json::nullValue && readRoot[\"rangeEnd\"] != Json::nullValue) {\n            writeRoot[\"rangeStart\"] = readRoot[\"rangeStart\"].asInt64();\n            writeRoot[\"rangeEnd\"] = readRoot[\"rangeEnd\"].asInt64();\n        }\n    }\n    jsonStream.close();\n\n    std::fstream recordStream(checkpointTmpFile, std::ios::out);\n    if (recordStream.is_open()) {\n        recordStream << writeRoot;\n    }\n    recordStream.close();\n    EXPECT_EQ(RemoveFile(checkpointFile), true);\n    EXPECT_EQ(RenameFile(checkpointTmpFile, checkpointFile), true);\n\n    // retry\n    request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n    auto retryOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n    EXPECT_EQ(retryOutcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n\n    std::string sourceFileMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string targetFileMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(sourceFileMd5, targetFileMd5);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDownloadWithProgressCallbackTest)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectWithProgressCallback\");\n    std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithProgressCallback\");\n\n    auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n    TransferProgress progressCallback = { ProgressCallback, this };\n    DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n    request.setTransferProgress(progressCallback);\n    request.setPartSize(102400);\n    request.setThreadNum(1);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n    EXPECT_EQ(TestUtils::GetFileMd5(targetKey), ComputeContentMD5(*putObjectContent));\n    EXPECT_EQ(RemoveFile(targetKey), true);\n\n    std::string targetKey1 = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithProgressCallback\");\n    request = DownloadObjectRequest(BucketName, sourceKey, targetKey1);\n    request.setTransferProgress(progressCallback);\n    request.setPartSize(10240000);\n    outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n    EXPECT_EQ(TestUtils::GetFileMd5(targetKey1), ComputeContentMD5(*putObjectContent));\n    EXPECT_EQ(RemoveFile(targetKey1), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDownloadProgressCallbackWithDownloadPartFailedTest)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectProgressCallbackWithPartFailed\");\n    std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectProgressCallbackWithPartFailed\");\n    std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n    EXPECT_EQ(CreateDirectory(checkpointDir), true);\n    EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n    auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n    TransferProgress progressCallback = { ProgressCallback, this };\n    DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n    request.setCheckpointDir(checkpointDir);\n    request.setTransferProgress(progressCallback);\n    request.setFlags(request.Flags() | DownloadPartFailedFlag);\n    request.setPartSize(102400);\n    request.setThreadNum(1);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n\n    std::cout << \"Retry : \" << std::endl;\n    request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n    auto retryOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n    EXPECT_EQ(retryOutcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n    EXPECT_EQ(TestUtils::GetFileMd5(targetKey), ComputeContentMD5(*putObjectContent));\n    EXPECT_NE(TestUtils::GetFileCRC64(targetKey), outcome.result().Metadata().CRC64());\n    EXPECT_EQ(RemoveFile(targetKey), true);\n    EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDownloadWithRangeLength)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectWithRangeLength\");\n    std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithRangeLength\");\n    auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n    DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n    request.setPartSize(102400);\n    request.setRange(20, 30);\n    request.setThreadNum(1);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().ContentLength(), 30 - 20 + 1);\n    EXPECT_EQ(outcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n\n    std::string targetKey1 = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithRangeLength1\");\n    request = DownloadObjectRequest(BucketName, sourceKey, targetKey1);\n    request.setPartSize(10240000);\n    request.setRange(20, 30);\n    auto outcome1 = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome1.isSuccess(), true);\n    EXPECT_EQ(outcome1.result().Metadata().ContentLength(), 30 - 20 + 1);\n    EXPECT_EQ(outcome1.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n\n    EXPECT_EQ(TestUtils::GetFileMd5(targetKey), TestUtils::GetFileMd5(targetKey1));\n\n    EXPECT_EQ(RemoveFile(targetKey), true);\n    EXPECT_EQ(RemoveFile(targetKey1), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDownloadWithErrorRangeLength)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectWithErrorRangeLength\");\n    std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithErrorRangeLength\");\n    int length = 102400 * (2 + rand() % 10);\n    auto putObjectContent = TestUtils::GetRandomStream(length);\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n    DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n    request.setPartSize(102400);\n    request.setRange(20, -1);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n    EXPECT_EQ(RemoveFile(targetKey), true);\n    EXPECT_EQ(outcome.result().Metadata().ContentLength(), length - 20);\n}\n\nTEST_F(CryptoResumableObjectTest, UnnormalResumableDownloadWithErrorRangeLength)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"UnnormalDownloadSourceObjectWithErrorRangeLength\");\n    std::string targetKey = TestUtils::GetObjectKey(\"UnnormalDownloadTargetObjectWithErrorRangeLength\");\n    auto putObjectContent = TestUtils::GetRandomStream(102400 * 2);\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n    DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n    request.setPartSize(102400);\n    request.setRange(102400, 20);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n}\n\nTEST_F(CryptoResumableObjectTest, MultiResumableDwoanloadWithThreadNumberOverPartNumber)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"MultiDownloadSourceObjectWithThreadNumberOverPartNumber\");\n    std::string targetKey = TestUtils::GetObjectKey(\"MultiDownloadTargetObjectWithThreadNumberOverPartNumber\");\n    auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n    // download\n    int threadNum = 0;\n    DownloadObjectRequest request(BucketName, sourceKey, targetKey, \"\");\n    request.setPartSize(102400);\n    request.setThreadNum(threadNum);\n    auto invalidateOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(invalidateOutcome.isSuccess(), false);\n\n    threadNum = 20;\n    request.setThreadNum(threadNum);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n    EXPECT_EQ(TestUtils::GetFileMd5(targetKey), ComputeContentMD5(*putObjectContent));\n    EXPECT_NE(TestUtils::GetFileCRC64(targetKey), outcome.result().Metadata().CRC64());\n    EXPECT_EQ(RemoveFile(targetKey), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDwoanloadWithResponseHeadersSetTest)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"MultiDownloadSourceObjectWithResponseHeadersSetTest\");\n    std::string targetKey = TestUtils::GetObjectKey(\"MultiDownloadTargetObjectWithResponseHeadersSetTest\");\n    int length = 102400 * (2 + rand() % 10);\n    auto putObjectContent = TestUtils::GetRandomStream(length);\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n    // download\n    DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n    request.setPartSize(102400);\n    request.setThreadNum(1);\n    request.addResponseHeaders(RequestResponseHeader::CacheControl, \"max-age=3\");\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().CacheControl(), \"max-age=3\");\n    EXPECT_EQ(outcome.result().Metadata().ContentLength(), length);\n    EXPECT_EQ(outcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n    EXPECT_EQ(TestUtils::GetFileMd5(targetKey), ComputeContentMD5(*putObjectContent));\n    EXPECT_NE(TestUtils::GetFileCRC64(targetKey), outcome.result().Metadata().CRC64());\n    EXPECT_EQ(RemoveFile(targetKey), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDownloadWithModifiedSetTest)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectWithModifiedSetTest\");\n    std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithModifiedSetTest\");\n    auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n    // download\n    DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n    request.setPartSize(102400);\n\n    // error set Modified-Since time\n    request.setModifiedSinceConstraint(TestUtils::GetGMTString(100));\n    auto modifiedOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(modifiedOutcome.isSuccess(), false);\n    EXPECT_EQ(modifiedOutcome.error().Code(), \"ServerError:304\");\n\n    // error set Unmodified-Since time \n    request.setModifiedSinceConstraint(TestUtils::GetGMTString(0));\n    request.setUnmodifiedSinceConstraint(TestUtils::GetGMTString(-100));\n    auto unmodifiedOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(unmodifiedOutcome.isSuccess(), false);\n    EXPECT_EQ(unmodifiedOutcome.error().Code(), \"PreconditionFailed\");\n\n    // normal download\n    request.setModifiedSinceConstraint(TestUtils::GetGMTString(-100));\n    request.setUnmodifiedSinceConstraint(TestUtils::GetGMTString(100));\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n    EXPECT_EQ(TestUtils::GetFileMd5(targetKey), ComputeContentMD5(*putObjectContent));\n    EXPECT_NE(TestUtils::GetFileCRC64(targetKey), outcome.result().Metadata().CRC64());\n    EXPECT_EQ(RemoveFile(targetKey), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDownloadWithMatchSetTest)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectWithMatchSetTest\");\n    std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithMatchSetTest\");\n    auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n    auto hOutcom = Client->HeadObject(BucketName, sourceKey);\n    EXPECT_EQ(hOutcom.isSuccess(), true);\n    std::string realETag = hOutcom.result().ETag();\n    std::vector<std::string> eTagMatchList;\n    std::vector<std::string> eTagNoneMatchList;\n\n    // download\n    DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n    request.setPartSize(102400);\n\n    // error set If-Match\n    eTagMatchList.push_back(\"invalidateETag\");\n    request.setMatchingETagConstraints(eTagMatchList);\n    auto matchOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(matchOutcome.isSuccess(), false);\n    EXPECT_EQ(matchOutcome.error().Code(), \"PreconditionFailed\");\n\n    // error set If-None-Match\n    eTagMatchList.clear();\n    eTagNoneMatchList.push_back(realETag);\n    request.setMatchingETagConstraints(eTagMatchList);\n    request.setNonmatchingETagConstraints(eTagNoneMatchList);\n    auto noneMatchOutcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(noneMatchOutcome.isSuccess(), false);\n    EXPECT_EQ(noneMatchOutcome.error().Code(), \"ServerError:304\");\n       \n    // normal download\n    eTagNoneMatchList.clear();\n    eTagMatchList.push_back(realETag);\n    eTagNoneMatchList.push_back(\"invalidateETag\");\n    request.setMatchingETagConstraints(eTagMatchList);\n    request.setNonmatchingETagConstraints(eTagNoneMatchList);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().ContentLength(), hOutcom.result().ContentLength());\n    EXPECT_EQ(outcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n    EXPECT_EQ(TestUtils::GetFileMd5(targetKey), ComputeContentMD5(*putObjectContent));\n    EXPECT_NE(TestUtils::GetFileCRC64(targetKey), outcome.result().Metadata().CRC64());\n    EXPECT_EQ(RemoveFile(targetKey), true);\n}\n\nTEST_F(CryptoResumableObjectTest, NormalResumableDwoanloadWithoutCRCCheckTest)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"NormalResumableDwoanloadWithoutCRCCheckTest\");\n    std::string targetKey = TestUtils::GetObjectKey(\"NormalResumableDwoanloadWithoutCRCCheckTest\");\n    int length = 102400 * (2 + rand() % 10);\n    auto putObjectContent = TestUtils::GetRandomStream(length);\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n    // download\n    ClientConfiguration conf;\n    conf.enableCrc64 = false;\n    auto client = std::make_shared<OssEncryptionClient>(Endpoint, Config::AccessKeyId, Config::AccessKeySecret,\n        ClientConfiguration(), std::make_shared<SimpleRSAEncryptionMaterials>(PublicKey, PrivateKey, Description),\n        CryptoConfiguration());\n\n    DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n    request.setPartSize(102400);\n    request.setThreadNum(1);\n    request.addResponseHeaders(RequestResponseHeader::CacheControl, \"max-age=3\");\n    auto outcome = client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().CacheControl(), \"max-age=3\");\n    EXPECT_EQ(outcome.result().Metadata().ContentLength(), length);\n    EXPECT_EQ(outcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n    EXPECT_EQ(TestUtils::GetFileMd5(targetKey), ComputeContentMD5(*putObjectContent));\n    EXPECT_EQ(RemoveFile(targetKey), true);\n}\n\nTEST_F(CryptoResumableObjectTest, ResumableDwoanloadWithUnEncryptedObjectTest)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"ResumableDwoanloadWithUnEncryptedObjectTest\");\n    std::string targetKey = TestUtils::GetObjectKey(\"NormalResumableDwoanloadWithoutCRCCheckTest\");\n    int length = 102400 * (2 + rand() % 10);\n    auto putObjectContent = TestUtils::GetRandomStream(length);\n    auto putObjectOutcome = UnEncryptionClient->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    auto hOutcome = UnEncryptionClient->HeadObject(BucketName, sourceKey);\n    EXPECT_EQ(hOutcome.isSuccess(), true);\n    EXPECT_EQ(hOutcome.result().hasUserHeader(\"client-side-encryption-key\"), false);\n\n    DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n    request.setPartSize(102400);\n    auto outcome = Client->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().ContentLength(), length);\n    EXPECT_EQ(outcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), false);\n    EXPECT_EQ(TestUtils::GetFileMd5(targetKey), ComputeContentMD5(*putObjectContent));\n    EXPECT_EQ(RemoveFile(targetKey), true);\n}\n\nTEST_F(CryptoResumableObjectTest, ResumableUploadAndDownloadTrafficLimitTest)\n{\n    Timer timer;\n    std::string key = TestUtils::GetObjectKey(\"ResumableUploadAndDownloadTrafficLimitTest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableUploadAndDownloadTrafficLimitTest\").append(\".tmp\");\n    /*set content 800 KB*/\n    TestUtils::WriteRandomDatatoFile(tmpFile, 800 * 1024);\n\n    //upload\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(10240000);\n    /* set upload traffic limit 200KB/s*/\n    request.setTrafficLimit(819200 * 2);\n    auto theory_time = (800 * 1024 * 8) / (819200 * 2);\n    timer.reset();\n    auto uOutcome = Client->ResumableUploadObject(request);\n    EXPECT_EQ(uOutcome.isSuccess(), true);\n    auto diff_put = timer.elapsed();\n    EXPECT_NEAR((double)diff_put, (double)theory_time, 1.0);\n\n    //download\n    std::string targetKey = TestUtils::GetObjectKey(\"ResumableUploadAndDownloadTrafficLimitTest\");\n    DownloadObjectRequest dRequest(BucketName, key, targetKey);\n    dRequest.setTrafficLimit(8192000);\n    dRequest.setPartSize(10240000);\n\n    auto dOutcome = Client->ResumableDownloadObject(dRequest);\n    EXPECT_EQ(dOutcome.isSuccess(), true);\n    EXPECT_EQ(dOutcome.result().Metadata().ContentLength(), 800 * 1024);\n    EXPECT_EQ(dOutcome.result().Metadata().hasHeader(\"x-oss-qos-delay-time\"), true);\n    EXPECT_EQ(dOutcome.result().Metadata().hasUserHeader(\"client-side-encryption-key\"), true);\n    EXPECT_EQ(TestUtils::GetFileMd5(targetKey), TestUtils::GetFileMd5(tmpFile));\n\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n    EXPECT_EQ(RemoveFile(targetKey), true);\n }\n\n\n}\n}"
  },
  {
    "path": "test/src/Encryption/CryptoStreamBufTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <src/utils/Crc64.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include <src/encryption/CryptoStreamBuf.h>\r\n#include <fstream>\r\n\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass CryptoStreamBufTest : public ::testing::Test {\r\nprotected:\r\n    CryptoStreamBufTest()\r\n    {\r\n    }\r\n\r\n    ~CryptoStreamBufTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase()\r\n    {\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase()\r\n    {\r\n    }\r\n\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    void TearDown() override\r\n    {\r\n    }\r\npublic:\r\n\r\n};\r\n\r\nTEST_F(CryptoStreamBufTest, EncryptBufferTest)\r\n{\r\n    auto key = ByteBuffer(32);\r\n    auto iv = ByteBuffer(16);\r\n    memcpy((void *)key.data(), (void *)(\"12345678901234561234567890123456\"), 32);\r\n    memcpy((void *)iv.data(), (void *)(\"1234567890123456\"), 16);\r\n\r\n    auto cipher = SymmetricCipher::CreateAES256_CTRImpl();\r\n    cipher->EncryptInit(key, iv);\r\n\r\n    auto content = std::make_shared<std::stringstream>();\r\n    *content << \"11223344556677889900aabbccddeeffb\";\r\n    CryptoStreamBuf cryptoStream(*content, cipher, key, iv);\n\n    unsigned char encoded[] = { 0xc2, 0xba, 0xef, 0x5f, 0x21, 0xa2, 0x55, 0x8b, 0x2d, 0x5a, 0x1a, 0xe2, 0xd5, 0x0f, 0xcf, 0x0b,\n                       0xa3, 0x00, 0x36, 0xa8, 0xf5, 0x79, 0x03, 0xaa, 0x4c, 0xc5, 0x65, 0xbb, 0x67, 0x0a, 0x07, 0x14, 0x9d };\n\n    const int test_size = sizeof(encoded) / sizeof(encoded[0]);\n    char buff[256];\n    //content->read(buff, 128);\n    //EXPECT_EQ(33, content->gcount());\n\n    //read n byte by step\n    //int step = 1;\n    for (auto step = 1; step < test_size; step++) {\n        int size = 0;\n        memset(buff, 0, sizeof(buff) / sizeof(buff[0]));\n        for (int offset = 0; offset < test_size; offset += step) {\n            content->read(buff + offset, step);\n            size += static_cast<int>(content->gcount());\n        }\n        EXPECT_EQ(size, test_size);\n        EXPECT_TRUE(TestUtils::IsByteBufferEQ((char *)encoded, buff, test_size));\n        content->clear();\n        content->seekg(0, content->beg);\n    }\n\n    //seek to x offset and read n byte\n    for (int n = 1; n < test_size; n++) {\n        for (int offset = 0; offset < test_size; offset++) {\n            memset(buff, 1, sizeof(buff) / sizeof(buff[0]));\n            content->clear();\n            content->seekg(offset, content->beg);\n            content->read(buff + offset, n);\n            int size = static_cast<int>(content->gcount());\n            EXPECT_TRUE(TestUtils::IsByteBufferEQ((char *)encoded + offset, buff + offset, size));\n        }\n    }\n}\r\n\r\nTEST_F(CryptoStreamBufTest, DecryptBufferTest)\r\n{\r\n    auto key = ByteBuffer(32);\r\n    auto iv = ByteBuffer(16);\r\n    memcpy((void *)key.data(), (void *)(\"12345678901234561234567890123456\"), 32);\r\n    memcpy((void *)iv.data(), (void *)(\"1234567890123456\"), 16);\r\n\r\n    auto cipher = SymmetricCipher::CreateAES256_CTRImpl();\r\n\r\n\n    unsigned char encoded[] = { 0xc2, 0xba, 0xef, 0x5f, 0x21, 0xa2, 0x55, 0x8b, 0x2d, 0x5a, 0x1a, 0xe2, 0xd5, 0x0f, 0xcf, 0x0b,\n                       0xa3, 0x00, 0x36, 0xa8, 0xf5, 0x79, 0x03, 0xaa, 0x4c, 0xc5, 0x65, 0xbb, 0x67, 0x0a, 0x07, 0x14, 0x9d };\r\n\r\n    const int test_size = sizeof(encoded) / sizeof(encoded[0]);\n\r\n    for (auto step = 1; step <= test_size; step++)\r\n    {\r\n        std::string out;\r\n        auto content = std::make_shared<std::stringstream>();\r\n        auto cryptoStreamBuff = std::make_shared< CryptoStreamBuf>(*content, cipher, key, iv);\r\n        for (auto i = 0; i < test_size;) {\r\n            auto writeCnt = std::min(step, test_size - i);\r\n            content->write((const char*)encoded + i, writeCnt);\r\n            i += writeCnt;\r\n        }\r\n        cryptoStreamBuff = nullptr;\r\n        *content >> out;\r\n        EXPECT_EQ(out, \"11223344556677889900aabbccddeeffb\");\r\n    }\r\n\r\n}\r\n\r\nTEST_F(CryptoStreamBufTest, DecryptBufferWithSkipCntTest)\r\n{\r\n    auto key = ByteBuffer(32);\r\n    auto iv = ByteBuffer(16);\r\n    memcpy((void *)key.data(), (void *)(\"12345678901234561234567890123456\"), 32);\r\n    memcpy((void *)iv.data(), (void *)(\"1234567890123456\"), 16);\r\n\r\n    auto cipher = SymmetricCipher::CreateAES256_CTRImpl();\r\n\n    unsigned char encoded[] = { 0xc2, 0xba, 0xef, 0x5f, 0x21, 0xa2, 0x55, 0x8b, 0x2d, 0x5a, 0x1a, 0xe2, 0xd5, 0x0f, 0xcf, 0x0b,\n                       0xa3, 0x00, 0x36, 0xa8, 0xf5, 0x79, 0x03, 0xaa, 0x4c, 0xc5, 0x65, 0xbb, 0x67, 0x0a, 0x07, 0x14, 0x9d };\r\n\r\n    const int test_size = sizeof(encoded) / sizeof(encoded[0]);\n\r\n    std::string pattern = \"11223344556677889900aabbccddeeffb\";\r\n\r\n    for (auto skip = 0; skip <= CryptoStreamBuf::BLK_SIZE; skip++)\r\n    {\r\n        for (auto step = 1; step <= test_size; step++)\r\n        {\r\n            std::string out;\r\n            auto content = std::make_shared<std::stringstream>();\r\n            auto cryptoStreamBuff = std::make_shared< CryptoStreamBuf>(*content, cipher, key, iv, skip);\r\n            for (auto i = 0; i < test_size;) {\r\n                auto writeCnt = std::min(step, test_size - i);\r\n                content->write((const char*)(encoded) + i, writeCnt);\r\n                i += writeCnt;\r\n            }\r\n            cryptoStreamBuff = nullptr;\r\n            *content >> out;\r\n            EXPECT_EQ(out, pattern.substr(skip));\r\n        }\r\n    }\r\n}\r\n\r\n\r\nTEST_F(CryptoStreamBufTest, CryptoStreamTest)\r\n{\r\n    auto cipher = SymmetricCipher::CreateAES256_CTRImpl();\r\n    auto content = std::make_shared<std::fstream>(\"\", std::ios_base::out | std::ios_base::in | std::ios_base::trunc | std::ios_base::binary);\r\n    auto cryptoStream = std::make_shared<CryptoStreamBuf>(*content, cipher, ByteBuffer(32), ByteBuffer(16));\n    cryptoStream = nullptr;\n}\r\n\r\n}\r\n}"
  },
  {
    "path": "test/src/LiveChannel/DeleteLiveChannelTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud\n{\nnamespace OSS \n{\n\nclass DeleteLiveChannelTest : public ::testing::Test\n{\nprotected:\n    DeleteLiveChannelTest()\n    {\n    }\n\n    ~DeleteLiveChannelTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n\t\tClientConfiguration conf;\n\t\tconf.enableCrc64 = false;\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-delete-live-channel\");\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\n        EXPECT_EQ(outCome.isSuccess(), true);\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n       TestUtils::CleanBucket(*Client, BucketName);\n       Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> DeleteLiveChannelTest::Client = nullptr;\nstd::string DeleteLiveChannelTest::BucketName = \"\";\n\nTEST_F(DeleteLiveChannelTest, DeleteLiveChannelErrorParam)\n{\n    std::string channelName = \"not_exist\";\n    DeleteLiveChannelRequest request(BucketName, channelName);\n    auto deleteOutcome = Client->DeleteLiveChannel(request);\n    // with http code 204 No Content\n    EXPECT_EQ(deleteOutcome.isSuccess(), true);\n\n    DeleteLiveChannelRequest request2(BucketName, channelName+\"/test\");\n    deleteOutcome = Client->DeleteLiveChannel(request2);\n    EXPECT_EQ(deleteOutcome.isSuccess(), false);\n}\n\n}\n}\n"
  },
  {
    "path": "test/src/LiveChannel/GenerateRTMPSignatrueUrlTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud\n{\nnamespace OSS \n{\n\nclass GenerateRTMPSignatureUrlTest : public ::testing::Test\n{\nprotected:\n    GenerateRTMPSignatureUrlTest()\n    {\n    }\n\n    ~GenerateRTMPSignatureUrlTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n\t\tClientConfiguration conf;\n\t\tconf.enableCrc64 = false;\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-delete-live-channel\");\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n       Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> GenerateRTMPSignatureUrlTest::Client = nullptr;\nstd::string GenerateRTMPSignatureUrlTest::BucketName = \"\";\n\nTEST_F(GenerateRTMPSignatureUrlTest, GenerateRTMPSignatureUrlUT)\n{\n    std::string channelName = \"not_exist\";\n    GenerateRTMPSignedUrlRequest request(BucketName, channelName, \"\", 0);\n    \n    EXPECT_EQ(request.PlayList(), \"\");\n    EXPECT_EQ(request.Expires(), 0U);\n    \n\trequest.setPlayList(\"test.m3u8\");\n    EXPECT_EQ(request.PlayList(), \"test.m3u8\");\n\n\ttime_t tExpire = time(nullptr) + 15 * 60;\n\trequest.setExpires(tExpire);\n    EXPECT_EQ(request.Expires(), (uint64_t)tExpire);\n\n    auto generateOutcome = Client->GenerateRTMPSignedUrl(request);\n    EXPECT_EQ(generateOutcome.isSuccess(), true);\n    EXPECT_EQ(generateOutcome.result().empty(), false);\n\n\tstd::string signedURL = generateOutcome.result();\n\tEXPECT_TRUE(signedURL.find(\"playlistName\") != std::string::npos);\n}\n\nTEST_F(GenerateRTMPSignatureUrlTest, GenerateRTMPSignatureUrlUT2)\n{\n    // v1\n    auto conf = ClientConfiguration();\n    auto client = std::make_shared<OssClient>(Config::Endpoint, \"ak\", \"sk\", conf);\n\n    GenerateRTMPSignedUrlRequest request(\"cpp-sdk-live-channel-bucket\", \"channel\", \"\", 0);\n    request.setPlayList(\"test.m3u8\");\n\n    time_t tExpire = (time_t)1706289617;\n    request.setExpires(tExpire);\n    EXPECT_EQ(request.Expires(), (uint64_t)tExpire);\n\n    auto generateOutcome = client->GenerateRTMPSignedUrl(request);\n    EXPECT_EQ(generateOutcome.isSuccess(), true);\n    EXPECT_EQ(generateOutcome.result().empty(), false);\n\n    std::string path = \"/live/channel?Expires=1706289617&OSSAccessKeyId=ak&Signature=Y1LCM2PzyECssQhTdi%2BGKra7iXE%3D&playlistName=test.m3u8\";\n    std::string signedURL = generateOutcome.result();\n    EXPECT_TRUE(signedURL.find(path) != std::string::npos);\n\n    // v4\n    auto conf1 = ClientConfiguration();\n    conf1.signatureVersion = SignatureVersionType::V4;\n    auto client1 = std::make_shared<OssClient>(Config::Endpoint, \"ak\", \"sk\", conf1);\n\n    auto generateOutcome1 = client1->GenerateRTMPSignedUrl(request);\n    EXPECT_EQ(generateOutcome1.isSuccess(), true);\n    EXPECT_EQ(generateOutcome1.result().empty(), false);\n    std::string signedURL1 = generateOutcome1.result();\n    EXPECT_TRUE(signedURL1.find(path) != std::string::npos);\n}\n\nTEST_F(GenerateRTMPSignatureUrlTest, GenerateRTMPSignatureUrlInvalidBucketTest)\n{\n    GenerateRTMPSignedUrlRequest request(\"Invalid-bucket-test\", \"channel-name\", \"playlist.m3u8\", 1000);\n    auto generateOutcome = Client->GenerateRTMPSignedUrl(request);\n    EXPECT_EQ(generateOutcome.isSuccess(), false);\n    EXPECT_EQ(generateOutcome.error().Code(), \"ValidateError\");\n\n    //channel invalid\n    request.setBucket(BucketName);\n    request.setChannelName(\"\");\n    request.setPlayList(\"playlist.m3u8\");\n    request.setExpires(1000);\n    generateOutcome = Client->GenerateRTMPSignedUrl(request);\n    EXPECT_EQ(generateOutcome.isSuccess(), false);\n    EXPECT_EQ(generateOutcome.error().Code(), \"ValidateError\");\n\n    request.setBucket(BucketName);\n    request.setChannelName(\"chanelname\");\n    request.setPlayList(\"\");\n    request.setExpires(1000);\n    generateOutcome = Client->GenerateRTMPSignedUrl(request);\n    EXPECT_EQ(generateOutcome.isSuccess(), false);\n    EXPECT_EQ(generateOutcome.error().Code(), \"ValidateError\");\n\n    request.setBucket(BucketName);\n    request.setChannelName(\"chanelname\");\n    request.setPlayList(\"playlist.m3u8\");\n    request.setExpires(0);\n    generateOutcome = Client->GenerateRTMPSignedUrl(request);\n    EXPECT_EQ(generateOutcome.isSuccess(), false);\n    EXPECT_EQ(generateOutcome.error().Code(), \"ValidateError\");\n}\n\nTEST_F(GenerateRTMPSignatureUrlTest, GenerateRTMPSignedUrlRequestBranchTest)\n{\n    std::string str;\n    GenerateRTMPSignedUrlRequest request(\"INVALIDNAME\", \"test\", str, 0);\n    Client->GenerateRTMPSignedUrl(request);\n}\n}\n}\n"
  },
  {
    "path": "test/src/LiveChannel/GetLiveChannelHistoryTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud\n{\nnamespace OSS \n{\n\nclass GetLiveChannelHistoryTest : public ::testing::Test\n{\nprotected:\n    GetLiveChannelHistoryTest()\n    {\n    }\n\n    ~GetLiveChannelHistoryTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n\t\tClientConfiguration conf;\n\t\tconf.enableCrc64 = false;\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-get-live-channel-history\");\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\n        EXPECT_EQ(outCome.isSuccess(), true);\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n       TestUtils::CleanBucket(*Client, BucketName);\n       Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> GetLiveChannelHistoryTest::Client = nullptr;\nstd::string GetLiveChannelHistoryTest::BucketName = \"\";\n\nTEST_F(GetLiveChannelHistoryTest, GetLiveChannelHistoryGetTest)\n{\n    std::string channelName = \"test-channel\";\n    PutLiveChannelRequest request(BucketName, channelName, \"HLS\");\n    auto putOutcome = Client->PutLiveChannel(request);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    GetLiveChannelHistoryRequest request2(BucketName, channelName);\n    auto getOutcome = Client->GetLiveChannelHistory(request2);\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    EXPECT_EQ(getOutcome.result().LiveRecordList().size(), 0u);\n\n    GetLiveChannelHistoryRequest request3(BucketName, \"not_exist\");\n    auto getOutcome2 = Client->GetLiveChannelHistory(request3);\n    EXPECT_EQ(getOutcome2.isSuccess(), false);\n    EXPECT_EQ(getOutcome2.result().LiveRecordList().size(), 0u);\n}\n\nTEST_F(GetLiveChannelHistoryTest, GetLiveChannelHistoryWithInvalidResponseBodyTest)\n{\n    std::string channelName = \"test-channel1\";\n    PutLiveChannelRequest request(BucketName, channelName, \"HLS\");\n    auto putOutcome = Client->PutLiveChannel(request);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    GetLiveChannelHistoryRequest request2(BucketName, channelName);\n    request2.setResponseStreamFactory([=]() {\n        auto content = std::make_shared<std::stringstream>();\n        content->write(\"invlid data\", 11);\n        return content;\n    });\n    auto getOutcome = Client->GetLiveChannelHistory(request2);\n    EXPECT_EQ(getOutcome.isSuccess(), false);\n    EXPECT_EQ(getOutcome.error().Code(), \"GetLiveChannelStatError\");\n}\n\nTEST_F(GetLiveChannelHistoryTest, GetLiveChannelHistoryResultTest)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t          <LiveChannelHistory>\n\t\t\t\t\t\t\t            <LiveRecord>\n\t\t\t\t\t\t\t\t          <StartTime>2016-07-30T01:53:21.000Z</StartTime>\n\t\t\t\t\t\t\t\t          <EndTime>2016-07-30T01:53:31.000Z</EndTime>\n\t\t\t\t\t\t\t\t          <RemoteAddr>10.101.194.148:56861</RemoteAddr>\n\t\t\t\t\t\t\t          </LiveRecord>\n\t\t\t\t\t\t\t          <LiveRecord>\n\t\t\t\t\t\t\t\t          <StartTime>2016-07-30T01:53:35.000Z</StartTime>\n\t\t\t\t\t\t\t\t          <EndTime>2016-07-30T01:53:45.000Z</EndTime>\n\t\t\t\t\t\t\t\t          <RemoteAddr>10.101.194.148:57126</RemoteAddr>\n\t\t\t\t\t\t\t          </LiveRecord>\n\t\t\t\t\t\t\t          <LiveRecord>\n\t\t\t\t\t\t\t\t          <StartTime>2016-07-30T01:53:49.000Z</StartTime>\n\t\t\t\t\t\t\t\t          <EndTime>2016-07-30T01:53:59.000Z</EndTime>\n\t\t\t\t\t\t\t\t          <RemoteAddr>10.101.194.148:57577</RemoteAddr>\n\t\t\t\t\t\t\t          </LiveRecord>\n\t\t\t\t\t\t\t          <LiveRecord>\n\t\t\t\t\t\t\t\t          <StartTime>2016-07-30T01:54:04.000Z</StartTime>\n\t\t\t\t\t\t\t\t          <EndTime>2016-07-30T01:54:14.000Z</EndTime>\n\t\t\t\t\t\t\t\t          <RemoteAddr>10.101.194.148:57632</RemoteAddr>\n\t\t\t\t\t\t\t          </LiveRecord>\n\t\t\t\t\t\t\t        </LiveChannelHistory>)\";\n    GetLiveChannelHistoryResult result(xml);\n    std::vector<LiveRecord>vec = result.LiveRecordList();\n    EXPECT_EQ(vec.size(), 4u);\n    EXPECT_EQ(vec[0].startTime, \"2016-07-30T01:53:21.000Z\");\n    EXPECT_EQ(vec[0].endTime, \"2016-07-30T01:53:31.000Z\");\n    EXPECT_EQ(vec[0].remoteAddr, \"10.101.194.148:56861\");\n\n    EXPECT_EQ(vec[1].startTime, \"2016-07-30T01:53:35.000Z\");\n    EXPECT_EQ(vec[1].endTime, \"2016-07-30T01:53:45.000Z\");\n    EXPECT_EQ(vec[1].remoteAddr, \"10.101.194.148:57126\");\n\n    EXPECT_EQ(vec[2].startTime, \"2016-07-30T01:53:49.000Z\");\n    EXPECT_EQ(vec[2].endTime, \"2016-07-30T01:53:59.000Z\");\n    EXPECT_EQ(vec[2].remoteAddr, \"10.101.194.148:57577\");\n\n    EXPECT_EQ(vec[3].startTime, \"2016-07-30T01:54:04.000Z\");\n    EXPECT_EQ(vec[3].endTime, \"2016-07-30T01:54:14.000Z\");\n    EXPECT_EQ(vec[3].remoteAddr, \"10.101.194.148:57632\");\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t          <LiveChannelHistory>\n\t\t\t\t\t\t\t        </LiveChannelHistory>)\";\n    GetLiveChannelHistoryResult result2(xml);\n    EXPECT_EQ(result2.LiveRecordList().empty(), true);\n}\n\nTEST_F(GetLiveChannelHistoryTest, GetLiveChannelHistoryResultBranchTest)\n{\n    GetLiveChannelHistoryResult result(\"test\");\n\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t          <LiveChannel>\n\t\t\t\t\t\t\t            <LiveRecord>\n\t\t\t\t\t\t\t\t          <StartTime>2016-07-30T01:53:21.000Z</StartTime>\n\t\t\t\t\t\t\t\t          <EndTime>2016-07-30T01:53:31.000Z</EndTime>\n\t\t\t\t\t\t\t\t          <RemoteAddr>10.101.194.148:56861</RemoteAddr>\n\t\t\t\t\t\t\t          </LiveRecord>\n\t\t\t\t\t\t\t        </LiveChannel>)\";\n    GetLiveChannelHistoryResult result1(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t          <LiveChannelHistory>\n\t\t\t\t\t\t\t        </LiveChannelHistory>)\";\n    GetLiveChannelHistoryResult result2(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t          <LiveChannelHistory>\n\t\t\t\t\t\t\t            <LiveRecord>\n\t\t\t\t\t\t\t          </LiveRecord>\n\t\t\t\t\t\t\t        </LiveChannelHistory>)\";\n    GetLiveChannelHistoryResult result3(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\t\t\t\t\t\t\t          <LiveChannelHistory>\n\t\t\t\t\t\t\t            <LiveRecord>\n\t\t\t\t\t\t\t\t          <StartTime></StartTime>\n\t\t\t\t\t\t\t\t          <EndTime></EndTime>\n\t\t\t\t\t\t\t\t          <RemoteAddr></RemoteAddr>\n\t\t\t\t\t\t\t          </LiveRecord>\n\t\t\t\t\t\t\t        </LiveChannelHistory>)\";\n    GetLiveChannelHistoryResult result4(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    GetLiveChannelHistoryResult result5(xml);\n\n}\n}\n}\n"
  },
  {
    "path": "test/src/LiveChannel/ListLiveChannelTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud\n{\nnamespace OSS \n{\n\nclass ListLiveChannelTest : public ::testing::Test\n{\nprotected:\n    ListLiveChannelTest()\n    {\n    }\n\n    ~ListLiveChannelTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n\t\tClientConfiguration conf;\n\t\tconf.enableCrc64 = false;\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-list-live-channel\");\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\n        EXPECT_EQ(outCome.isSuccess(), true);\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n       TestUtils::CleanBucket(*Client, BucketName);\n       Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> ListLiveChannelTest::Client = nullptr;\nstd::string ListLiveChannelTest::BucketName = \"\";\n\nTEST_F(ListLiveChannelTest, ListLiveChannelListTest)\n{\n    ListLiveChannelRequest request(BucketName);\n    auto listOutcome = Client->ListLiveChannel(request);\n    EXPECT_EQ(listOutcome.isSuccess(), true);\n    EXPECT_EQ(listOutcome.result().LiveChannelList().size(), 0u);\n\n    std::string channelName = \"test_channel\";\n    PutLiveChannelRequest request2(BucketName, channelName, \"HLS\");\n    auto putOutcome = Client->PutLiveChannel(request2);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    listOutcome = Client->ListLiveChannel(request);\n    EXPECT_EQ(listOutcome.isSuccess(), true);\n    EXPECT_EQ(listOutcome.result().LiveChannelList().size(), 1u);\n    std::vector<LiveChannelInfo> vec = listOutcome.result().LiveChannelList();\n    EXPECT_EQ(vec[0].name, \"test_channel\");\n    EXPECT_EQ(vec[0].description, \"\");\n    EXPECT_EQ(vec[0].status, \"enabled\");\n    EXPECT_EQ(vec[0].lastModified.empty(), false);\n    EXPECT_EQ(vec[0].publishUrl.empty(), false);\n    EXPECT_EQ(vec[0].playUrl.empty(), false);\n\n\n    //\n    ListLiveChannelRequest request3(BucketName);\n    request3.setMaxKeys(1001u);\n    listOutcome = Client->ListLiveChannel(request3);\n    EXPECT_EQ(listOutcome.isSuccess(), false);\n    EXPECT_EQ(listOutcome.error().Code(), \"ValidateError\");\n    EXPECT_EQ(listOutcome.error().Message(), \"The Max Key param is invalid, it's default valus is 100, and smaller than 1000\");\n\n\t//\n\tListLiveChannelRequest request4(BucketName);\n\trequest4.setMarker(\"/\");\n\trequest4.setPrefix(\"test_test\");\n\trequest4.setMaxKeys(999);\n\tlistOutcome = Client->ListLiveChannel(request4);\n\tEXPECT_EQ(listOutcome.isSuccess(), true);\n\tvec = listOutcome.result().LiveChannelList();\n\tEXPECT_EQ(vec.size(), 0U);\n}\n\nTEST_F(ListLiveChannelTest, ListLiveChannelWithInvalidResponseBodyTest)\n{\n    ListLiveChannelRequest request(BucketName);\n    request.setResponseStreamFactory([=]() {\n        auto content = std::make_shared<std::stringstream>();\n        content->write(\"invlid data\", 11);\n        return content;\n    });\n    auto listOutcome = Client->ListLiveChannel(request);\n    EXPECT_EQ(listOutcome.isSuccess(), false);\n    EXPECT_EQ(listOutcome.error().Code(), \"GetLiveChannelStatError\");\n}\n\nTEST_F(ListLiveChannelTest, ListLiveChannelResultTest)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <ListLiveChannelResult>\n                            <Prefix></Prefix>\n                            <Marker></Marker>\n                            <MaxKeys>1</MaxKeys>\n                            <IsTruncated>true</IsTruncated>\n                            <NextMarker>channel-0</NextMarker>\n                            <LiveChannel>\n                                <Name>channel-0</Name>\n                                <Description>test</Description>\n                                <Status>disabled</Status>\n                                <LastModified>2016-07-30T01:54:21.000Z</LastModified>\n                                <PublishUrls>\n                                    <Url>rtmp://test-bucket.oss-cn-hangzhou.aliyuncs.com/live/channel-0</Url>\n                                </PublishUrls>\n                                <PlayUrls>\n                                    <Url>http://test-bucket.oss-cn-hangzhou.aliyuncs.com/channel-0/playlist.m3u8</Url>\n                                </PlayUrls>\n                            </LiveChannel>\n                            <LiveChannel>\n                                <Name>channel-0</Name>\n                                <Description></Description>\n                                <Status>disabled</Status>\n                                <LastModified>2016-07-30T01:54:21.000Z</LastModified>\n                                <PublishUrls>\n                                    <Url>rtmp://test-bucket.oss-cn-hangzhou.aliyuncs.com/live/channel-0</Url>\n                                </PublishUrls>\n                                <PlayUrls>\n                                    <Url>http://test-bucket.oss-cn-hangzhou.aliyuncs.com/channel-0/playlist.m3u8</Url>\n                                </PlayUrls>\n                            </LiveChannel>\n                        </ListLiveChannelResult>)\";\n\n    ListLiveChannelResult result(xml);\n    EXPECT_EQ(result.Prefix(), \"\");\n    EXPECT_EQ(result.Marker(), \"\");\n    EXPECT_EQ(result.MaxKeys(), 1u);\n    EXPECT_EQ(result.IsTruncated(), true);\n    EXPECT_EQ(result.NextMarker(), \"channel-0\");\n    std::vector<LiveChannelInfo> vec = result.LiveChannelList();\n    EXPECT_EQ(vec.size(), 2u);\n    EXPECT_EQ(vec[0].description, \"test\");\n    EXPECT_EQ(vec[0].status, \"disabled\");\n    EXPECT_EQ(vec[0].name, \"channel-0\");\n    EXPECT_EQ(vec[0].lastModified, \"2016-07-30T01:54:21.000Z\");\n    EXPECT_EQ(vec[0].publishUrl, \"rtmp://test-bucket.oss-cn-hangzhou.aliyuncs.com/live/channel-0\");\n    EXPECT_EQ(vec[0].playUrl, \"http://test-bucket.oss-cn-hangzhou.aliyuncs.com/channel-0/playlist.m3u8\");\n}\n\nTEST_F(ListLiveChannelTest, ListLiveChannelResultBranchTest)\n{\n    ListLiveChannelResult result(\"test\");\n\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <ListLiveChannel>\n                        </ListLiveChannel>)\";\n\n    ListLiveChannelResult result1(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <ListLiveChannelResult>\n                            \n                        </ListLiveChannelResult>)\";\n\n    ListLiveChannelResult result2(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <ListLiveChannelResult>\n\n                            <LiveChannel>\n                                \n                            </LiveChannel>\n                            <LiveChannel>\n                                \n                            </LiveChannel>\n                        </ListLiveChannelResult>)\";\n\n    ListLiveChannelResult result3(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <ListLiveChannelResult>\n                            <Prefix></Prefix>\n                            <Marker></Marker>\n                            <MaxKeys></MaxKeys>\n                            <IsTruncated></IsTruncated>\n                            <NextMarker></NextMarker>\n                            <LiveChannel>\n                                <Name></Name>\n                                <Description></Description>\n                                <Status></Status>\n                                <LastModified></LastModified>\n                                <PublishUrls>\n                                <Url></Url>\n                                </PublishUrls>\n                                <PlayUrls>\n                                    <Url></Url>\n                                </PlayUrls>\n                            </LiveChannel>\n                            <LiveChannel>\n                                <Name></Name>\n                                <Description></Description>\n                                <Status></Status>\n                                <LastModified></LastModified>\n                                <PublishUrls>\n                                    <Url></Url>\n                                </PublishUrls>\n                                <PlayUrls>\n                                <Url></Url>\n                                </PlayUrls>\n                            </LiveChannel>\n                        </ListLiveChannelResult>)\";\n\n    ListLiveChannelResult result4(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    ListLiveChannelResult result5(xml);\n\n}\n}\n}\n"
  },
  {
    "path": "test/src/LiveChannel/PostAndGetVodPlayListTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <time.h>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud\n{\nnamespace OSS \n{\n\nclass PostAndGetVodPlayListTest : public ::testing::Test\n{\nprotected:\n    PostAndGetVodPlayListTest()\n    {\n    }\n\n    ~PostAndGetVodPlayListTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n\t\tClientConfiguration conf;\n\t\tconf.enableCrc64 = false;\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-post-and-get-vod-play-list\");\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\n        EXPECT_EQ(outCome.isSuccess(), true);\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n       TestUtils::CleanBucket(*Client, BucketName);\n       Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> PostAndGetVodPlayListTest::Client = nullptr;\nstd::string PostAndGetVodPlayListTest::BucketName = \"\";\n\nTEST_F(PostAndGetVodPlayListTest, PostVodPlayListTest)\n{\n    std::string channelName = \"test-channel\";\n    std::string playList = \"my_play_list.m3u8\";\n    std::string channelType = \"HLS\";\n\n    uint64_t startTime = time(NULL);\n    uint64_t endTime = startTime + 3600;\n\n    PostVodPlaylistRequest request(BucketName, channelName,\n         playList, startTime, endTime);\n\n    auto postOutcome = Client->PostVodPlaylist(request);\n    EXPECT_EQ(postOutcome.isSuccess(), false);\n\n    auto putOutcome = Client->PutLiveChannel(PutLiveChannelRequest(BucketName, channelName, channelType));\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    PostVodPlaylistRequest request2(BucketName, channelName,\n         playList, startTime, endTime);\n\n    postOutcome = Client->PostVodPlaylist(request2);\n    EXPECT_EQ(postOutcome.isSuccess(), false);\n\n\tPostVodPlaylistRequest request3(BucketName, channelName,\n\t\tplayList, startTime, endTime);\n\trequest3.setPlayList(\"another_play_list.m3u8\");\n\trequest3.setStartTime(startTime);\n\trequest3.setEndTime(endTime);\n\n\tpostOutcome = Client->PostVodPlaylist(request3);\n\tEXPECT_EQ(postOutcome.isSuccess(), false);\n\tEXPECT_TRUE(postOutcome.error().Code() != \"ValidateError\");\n\n    auto getOutcome = Client->GetVodPlaylist(GetVodPlaylistRequest(BucketName, channelName, startTime, endTime));\n    EXPECT_EQ(getOutcome.isSuccess(), false);\n\n}\n\nTEST_F(PostAndGetVodPlayListTest, PostVodPlayListErrorParamTest)\n{\n    std::string channelName = \"test-channel\";\n    std::string playList = \"my_play_list/.m3u8\";\n\n    uint64_t startTime = 1543978300;\n    uint64_t endTime = 1543989000;\n\n    PostVodPlaylistRequest request(BucketName, channelName,\n         playList, startTime, endTime);\n\n    auto postOutcome = Client->PostVodPlaylist(request);\n    EXPECT_EQ(postOutcome.isSuccess(), false);\n\n    playList = \"my_play_list.m3u8\";\n    channelName = \"/test/channel/name\";\n    PostVodPlaylistRequest request2(BucketName, channelName,\n         playList, startTime, endTime);\n\n    auto postOutcome2 = Client->PostVodPlaylist(request2);\n    EXPECT_EQ(postOutcome2.isSuccess(), false);\n\n    //\n    channelName = \"test_channel_name测试\";\n    PostVodPlaylistRequest request3(BucketName, channelName,\n         playList, startTime, endTime);\n\n    auto postOutcome3 = Client->PostVodPlaylist(request3);\n    EXPECT_EQ(postOutcome3.isSuccess(), false);\n\n    //\n    startTime = 0;\n    PostVodPlaylistRequest request4(BucketName, channelName,\n         playList, startTime, endTime);\n\n    auto postOutcome4 = Client->PostVodPlaylist(request4);\n    EXPECT_EQ(postOutcome4.isSuccess(), false);\n\n    //\n    startTime = 1543978300;\n    endTime = 1543978299;\n    PostVodPlaylistRequest request5(BucketName, channelName,\n         playList, startTime, endTime);\n\n    auto postOutcome5 = Client->PostVodPlaylist(request5);\n    EXPECT_EQ(postOutcome5.isSuccess(), false);\n\n    //\n    startTime = 1543978300;\n    endTime = 1544064701;\n    PostVodPlaylistRequest request6(BucketName, channelName,\n         playList, startTime, endTime);\n\n    auto postOutcome6 = Client->PostVodPlaylist(request6);\n    EXPECT_EQ(postOutcome6.isSuccess(), false);\n\n    //\n    startTime = time(NULL);\n    endTime = 0;\n    PostVodPlaylistRequest request7(BucketName, channelName,\n         playList, startTime, endTime);\n\n    auto postOutcome7 = Client->PostVodPlaylist(request7);\n    EXPECT_EQ(postOutcome7.isSuccess(), false);\n\n    GetVodPlaylistRequest getRequest1(BucketName, channelName);\n    getRequest1.setStartTime(0);\n    getRequest1.setEndTime(0);\n\n    auto getVodOutcome = Client->GetVodPlaylist(getRequest1);\n    EXPECT_EQ(getVodOutcome.isSuccess(), false);\n\n    GetVodPlaylistRequest getRequest2(BucketName, channelName);\n    getRequest2.setStartTime(1000000);\n    getRequest2.setEndTime(99999);\n\n    getVodOutcome = Client->GetVodPlaylist(getRequest2);\n    EXPECT_EQ(getVodOutcome.isSuccess(), false);\n\n    GetVodPlaylistRequest getRequest3(BucketName, channelName);\n\ttime_t tNow = time(nullptr);\n\ttime_t tNext = tNow + 60 * 60 * 24 + 1;\n    getRequest3.setStartTime(tNow);\n    getRequest3.setEndTime(tNext);\n\n    getVodOutcome = Client->GetVodPlaylist(getRequest3);\n    EXPECT_EQ(getVodOutcome.isSuccess(), false);\n\tEXPECT_STREQ(getVodOutcome.error().Code().c_str(), \"ValidateError\");\n}\n\nTEST_F(PostAndGetVodPlayListTest, GetVodPlaylistResultTest)\n{\n    std::string xml = R\"(#EXTM3U\n                    #EXT-X-VERSION:3\n                    #EXT-X-MEDIA-SEQUENCE:0\n                    #EXT-X-TARGETDURATION:13\n                    #EXTINF:7.120,\n                    1543895706266.ts\n                    #EXTINF:5.840,\n                    1543895706323.ts\n                    #EXTINF:6.400,\n                    1543895706356.ts\n                    #EXTINF:5.520,\n                    1543895706389.ts\n                    #EXTINF:5.240,\n                    1543895706428.ts\n                    #EXTINF:13.320,\n                    1543895706468.ts\n                    #EXTINF:5.960,\n                    1543895706538.ts\n                    #EXTINF:6.520,\n                    1543895706561.ts\n                    #EXT-X-ENDLIST)\";\n    GetVodPlaylistResult result(xml);\n    EXPECT_EQ(result.PlaylistContent().empty(), false);\n\n\tstd::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>(xml);\n    GetVodPlaylistResult result2(content);\n    EXPECT_EQ(result2.PlaylistContent().empty(), false);\n}\n\nTEST_F(PostAndGetVodPlayListTest, GetVodPlaylistRequestFunctionTest)\n{\n    auto getOutcome = Client->GetVodPlaylist(GetVodPlaylistRequest(\"INVLAIDNAME\", \"test-channel\", 1, 2));\n}\n}\n}\n"
  },
  {
    "path": "test/src/LiveChannel/PutAndGetLiveChannelStatusTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud\n{\nnamespace OSS \n{\n\nclass PutAndGetLiveChannelStatusTest : public ::testing::Test\n{\nprotected:\n    PutAndGetLiveChannelStatusTest()\n    {\n    }\n\n    ~PutAndGetLiveChannelStatusTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n\t\tClientConfiguration conf;\n\t\tconf.enableCrc64 = false;\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-delete-live-channel\");\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\n        EXPECT_EQ(outCome.isSuccess(), true);\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n       TestUtils::CleanBucket(*Client, BucketName);\n       Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> PutAndGetLiveChannelStatusTest::Client = nullptr;\nstd::string PutAndGetLiveChannelStatusTest::BucketName = \"\";\n\nTEST_F(PutAndGetLiveChannelStatusTest, PutLiveChannelStatusAndGetTest)\n{\n    std::string channelName = \"not_exist\";\n    PutLiveChannelStatusRequest request(BucketName, channelName, LiveChannelStatus::EnabledStatus);\n    auto putOutcome = Client->PutLiveChannelStatus(request);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n\n    channelName = \"new_channel\";\n    PutLiveChannelRequest request2(BucketName, channelName, \"HLS\");\n    auto putOutcome2 = Client->PutLiveChannel(request2);\n    EXPECT_EQ(putOutcome2.isSuccess(), true);\n\n    PutLiveChannelStatusRequest request3(BucketName, channelName, LiveChannelStatus::DisabledStatus);\n    auto putOutcome3 = Client->PutLiveChannelStatus(request3);\n    EXPECT_EQ(putOutcome3.isSuccess(), true);\n\n    GetLiveChannelStatRequest request4(BucketName, channelName);\n    auto getStatOutcome = Client->GetLiveChannelStat(request4);\n    EXPECT_EQ(getStatOutcome.isSuccess(), true);\n    EXPECT_EQ(getStatOutcome.result().Status(), LiveChannelStatus::DisabledStatus);\n    EXPECT_EQ(getStatOutcome.result().ConnectedTime(), \"\");\n    EXPECT_EQ(getStatOutcome.result().RemoteAddr(), \"\");\n    EXPECT_EQ(getStatOutcome.result().VideoBandWidth(), 0u);\n    EXPECT_EQ(getStatOutcome.result().AudioBandWidth(), 0u);\n\n\tPutLiveChannelStatusRequest request5(BucketName, channelName);\n\trequest5.setStatus(LiveChannelStatus::IdleStatus);\n\tauto putOutcome5 = Client->PutLiveChannelStatus(request5);\n\tEXPECT_EQ(putOutcome5.isSuccess(), false);\n\n\tPutLiveChannelStatusRequest request6(BucketName, channelName);\n\trequest6.setStatus(LiveChannelStatus::EnabledStatus);\n\tauto putOutcome6 = Client->PutLiveChannelStatus(request6);\n\tEXPECT_EQ(putOutcome6.isSuccess(), true);\n\n}\n\nTEST_F(PutAndGetLiveChannelStatusTest, GetLiveChannelStatusWithInvalidResponseBodyTest)\n{\n    // case 1 default\n    std::string channelName = \"test-channel1\";\n\n    PutLiveChannelRequest request2(BucketName, channelName, \"HLS\");\n    auto putOutcome2 = Client->PutLiveChannel(request2);\n    EXPECT_EQ(putOutcome2.isSuccess(), true);\n\n    PutLiveChannelStatusRequest request3(BucketName, channelName, LiveChannelStatus::DisabledStatus);\n    auto putOutcome3 = Client->PutLiveChannelStatus(request3);\n    EXPECT_EQ(putOutcome3.isSuccess(), true);\n\n    GetLiveChannelStatRequest request4(BucketName, channelName);\n    request4.setResponseStreamFactory([=]() {\n        auto content = std::make_shared<std::stringstream>();\n        content->write(\"invlid data\", 11);\n        return content;\n    });\n    auto getStatOutcome = Client->GetLiveChannelStat(request4);\n    EXPECT_EQ(getStatOutcome.isSuccess(), false);\n    EXPECT_EQ(getStatOutcome.error().Code(), \"GetLiveChannelStatError\");\n}\n\nTEST_F(PutAndGetLiveChannelStatusTest, GetLiveChannelResultTest)\n{\n    std::string xml1 = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <LiveChannelStat>\n                            <Status>Idle</Status>\n                        </LiveChannelStat>)\";\n    GetLiveChannelStatResult result(xml1);\n    EXPECT_EQ(result.Status(), LiveChannelStatus::IdleStatus);\n    EXPECT_EQ(result.ConnectedTime(), \"\");\n    EXPECT_EQ(result.RemoteAddr(), \"\");\n\n    std::string xml2 = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                            <LiveChannelStat>\n                                <Status>Live</Status>\n                                <ConnectedTime>2016-08-25T06:25:15.000Z</ConnectedTime>\n                                <RemoteAddr>10.1.2.3:47745</RemoteAddr>\n                            <Video>\n                                <Width>1280</Width>\n                                <Height>536</Height>\n                                <FrameRate>24</FrameRate>\n                                <Bandwidth>0</Bandwidth>\n                                <Codec>H264</Codec>\n                            </Video>\n                            <Audio>\n                                <Bandwidth>0</Bandwidth>\n                                <SampleRate>44100</SampleRate>\n                                <Codec>ADPCM</Codec>\n                            </Audio>\n                            </LiveChannelStat>)\";\n    GetLiveChannelStatResult result2(xml2);\n    EXPECT_EQ(result2.Status(), LiveChannelStatus::LiveStatus);\n    EXPECT_EQ(result2.ConnectedTime(), \"2016-08-25T06:25:15.000Z\");\n    EXPECT_EQ(result2.RemoteAddr(), \"10.1.2.3:47745\");\n    EXPECT_EQ(result2.Width(), 1280u);\n    EXPECT_EQ(result2.Height(), 536u);\n    EXPECT_EQ(result2.VideoBandWidth(), 0u);\n    EXPECT_EQ(result2.VideoCodec(), \"H264\");\n    EXPECT_EQ(result2.AudioBandWidth(), 0u);\n    EXPECT_EQ(result2.AudioCodec(), \"ADPCM\");\n}\n\nTEST_F(PutAndGetLiveChannelStatusTest, GetLiveChannelStatusInvalidBucketTest)\n{\n    std::string channelName = \"not_exist\";\n\n    GetLiveChannelStatRequest request4(\"Invalid-bucket-test\", channelName);\n    auto getStatOutcome = Client->GetLiveChannelStat(request4);\n    EXPECT_EQ(getStatOutcome.isSuccess(), false);\n    EXPECT_EQ(getStatOutcome.error().Code(), \"ValidateError\");\n}\n\nTEST_F(PutAndGetLiveChannelStatusTest, GetLiveChannelStatResultFunctionTest)\n{\n    GetLiveChannelStatResult result(\"test\");\n    result.FrameRate();\n    result.SampleRate();\n}\nTEST_F(PutAndGetLiveChannelStatusTest, PutLiveChannelStatusRequestValidateFailFunctionTest)\n{\n    PutLiveChannelStatusRequest request(\"INVLAIDNAME\", \"test2\");\n    auto putOutcome = Client->PutLiveChannelStatus(request);\n}\nTEST_F(PutAndGetLiveChannelStatusTest, GetLiveChannelResultBranchTest)\n{\n    GetLiveChannelStatResult result(\"test\");\n\n    std::string xml2 = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                            <LiveChannel>\n                                <Status>Live</Status>\n                                <ConnectedTime>2016-08-25T06:25:15.000Z</ConnectedTime>\n                                <RemoteAddr>10.1.2.3:47745</RemoteAddr>\n                            <Video>\n                                <Width>1280</Width>\n                                <Height>536</Height>\n                                <FrameRate>24</FrameRate>\n                                <Bandwidth>0</Bandwidth>\n                                <Codec>H264</Codec>\n                            </Video>\n                            <Audio>\n                                <Bandwidth>0</Bandwidth>\n                                <SampleRate>44100</SampleRate>\n                                <Codec>ADPCM</Codec>\n                            </Audio>\n                            </LiveChannel>)\";\n    GetLiveChannelStatResult result2(xml2);\n\n    xml2 = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                            <LiveChannelStat>\n\n                                <Width>1280</Width>\n                                <Height>536</Height>\n                                <FrameRate>24</FrameRate>\n                                <Bandwidth>0</Bandwidth>\n                                <Codec>H264</Codec>\n                                <Bandwidth>0</Bandwidth>\n                                <SampleRate>44100</SampleRate>\n                                <Codec>ADPCM</Codec>\n                            </LiveChannelStat>)\";\n    GetLiveChannelStatResult result3(xml2);\n\n    xml2 = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                            <LiveChannelStat>\n                            <Video>\n\n                            </Video>\n                            <Audio>\n\n                            </Audio>\n                            </LiveChannelStat>)\";\n    GetLiveChannelStatResult result4(xml2);\n\n    xml2 = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                            <LiveChannelStat>\n                                <Status></Status>\n                                <ConnectedTime></ConnectedTime>\n                                <RemoteAddr></RemoteAddr>\n                            <Video>\n                                <Width></Width>\n                                <Height></Height>\n                                <FrameRate></FrameRate>\n                                <Bandwidth></Bandwidth>\n                                <Codec></Codec>\n                            </Video>\n                            <Audio>\n                                <Bandwidth></Bandwidth>\n                                <SampleRate></SampleRate>\n                                <Codec></Codec>\n                            </Audio>\n                            </LiveChannelStat>)\";\n    GetLiveChannelStatResult result5(xml2);\n\n    xml2 = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    GetLiveChannelStatResult result6(xml2);\n\n}\n\n}\n}\n"
  },
  {
    "path": "test/src/LiveChannel/PutAndGetLiveChannelTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud\n{\nnamespace OSS \n{\n\nclass PutAndGetLiveChannelTest : public ::testing::Test\n{\nprotected:\n    PutAndGetLiveChannelTest()\n    {\n    }\n\n    ~PutAndGetLiveChannelTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n\t\tClientConfiguration conf;\n\t\tconf.enableCrc64 = false;\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-put-and-get-live-channel\");\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\n        EXPECT_EQ(outCome.isSuccess(), true);\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n       TestUtils::CleanBucket(*Client, BucketName);\n       Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> PutAndGetLiveChannelTest::Client = nullptr;\nstd::string PutAndGetLiveChannelTest::BucketName = \"\";\n\nTEST_F(PutAndGetLiveChannelTest, PutAndGetLiveChannelInfoTest)\n{\n    // case 1 default\n    std::string channelName = \"test-channel\";\n    std::string channelType = \"HLS\";\n\n    auto putOutcome = Client->PutLiveChannel(PutLiveChannelRequest(BucketName, channelName, channelType));\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    auto getOutcome = Client->GetLiveChannelInfo(GetLiveChannelInfoRequest(BucketName, channelName));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    EXPECT_EQ(getOutcome.result().Type(), \"HLS\");\n    EXPECT_EQ(getOutcome.result().FragDuration(), 5u);\n    EXPECT_EQ(getOutcome.result().FragCount(), 3u);\n    EXPECT_EQ(getOutcome.result().Status(), LiveChannelStatus::EnabledStatus);\n    EXPECT_EQ(getOutcome.result().Description(), \"\");\n    EXPECT_EQ(getOutcome.result().PlaylistName(), \"playlist.m3u8\");\n\n    // case 2 no snapshot\n    std::string channelName2 = channelName;\n    PutLiveChannelRequest request(BucketName, channelName2, \"HLS\");\n    request.setChannelName(channelName2+\"-test\");\n    request.setDescripition(\"just_a_test\");\n    request.setFragDuration(25u);\n    request.setFragCount(30u);\n    request.setStatus(LiveChannelStatus::DisabledStatus);\n    request.setPlayListName(\"test_play-list.m3u8\");\n    auto putOutcome2 = Client->PutLiveChannel(request);\n    EXPECT_EQ(putOutcome2.isSuccess(), true);\n\n    auto getOutcome2 = Client->GetLiveChannelInfo(GetLiveChannelInfoRequest(BucketName, channelName2+\"-test\"));\n    EXPECT_EQ(getOutcome2.isSuccess(), true);\n    EXPECT_EQ(getOutcome2.result().Type(), \"HLS\");\n    EXPECT_EQ(getOutcome2.result().FragDuration(), 25u);\n    EXPECT_EQ(getOutcome2.result().FragCount(), 30u);\n    EXPECT_EQ(getOutcome2.result().Status(), LiveChannelStatus::DisabledStatus);\n    EXPECT_EQ(getOutcome2.result().Description(), \"just_a_test\");\n    EXPECT_EQ(getOutcome2.result().PlaylistName(), \"test_play-list.m3u8\");\n\n    std::string channelName3 = \"test_channel_name测试\";\n    PutLiveChannelRequest request2(BucketName, channelName2, \"HLS\");\n    auto putOutcome3 = Client->PutLiveChannel(request2);\n    EXPECT_EQ(putOutcome3.isSuccess(), true);\n    EXPECT_EQ(putOutcome3.result().PublishUrl().empty(), false);\n    EXPECT_EQ(putOutcome3.result().PlayUrl().empty(), false);\n\n    // case 3 snapshot partial\n\tPutLiveChannelRequest request3(BucketName, channelName2+\"-test2\", \"HLS\");\n\trequest3.setChannelType(\"HLS\");\n\trequest3.setDestBucket(\"not_exist_bucket\");\n\tputOutcome3 = Client->PutLiveChannel(request3);\n\tEXPECT_EQ(putOutcome3.isSuccess(), false);\n\tEXPECT_STREQ(putOutcome3.error().Code().c_str(), \"ValidateError\");\n\n\t// case 4 snapshot full\n\tPutLiveChannelRequest request4(BucketName, channelName2 + \"-test3\", \"HLS\");\n\trequest4.setChannelType(\"HLS\");\n\trequest4.setDestBucket(\"not_exist_bucket\");\n\trequest4.setInterval(6);\n\trequest4.setNotifyTopic(\"not_exist_topic\");\n\trequest4.setRoleName(\"not_exist_role_name\");\n\tputOutcome3 = Client->PutLiveChannel(request4);\n\tEXPECT_EQ(putOutcome3.isSuccess(), false);\n\n    // clear env\n    auto deleteOutcome1 = Client->DeleteLiveChannel(DeleteLiveChannelRequest(BucketName, channelName));\n    EXPECT_EQ(deleteOutcome1.isSuccess(), true);\n\n    auto deleteOutcome2 = Client->DeleteLiveChannel(DeleteLiveChannelRequest(BucketName, channelName2+\"-test\"));\n    EXPECT_EQ(deleteOutcome2.isSuccess(), true);\n}\n\nTEST_F(PutAndGetLiveChannelTest, PutLiveChannelErrorParamTest)\n{\n    std::string channelName;\n    channelName.assign(1024, 'a');\n    EXPECT_EQ(channelName.size(), 1024u);\n\n    auto putOutcome = Client->PutLiveChannel(PutLiveChannelRequest(BucketName, channelName, \"HLS\"));\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n    EXPECT_EQ(putOutcome.error().Code(), \"ValidateError\");\n    EXPECT_EQ(putOutcome.error().Message(), \"The channelName param is invalid, it shouldn't contain '/' and length < 1023\");\n\n    //\n    channelName.clear();\n    channelName = \"/test\";\n    EXPECT_EQ(channelName, \"/test\");\n\n    auto putOutcome2 = Client->PutLiveChannel(PutLiveChannelRequest(BucketName, channelName, \"HLS\"));\n    EXPECT_EQ(putOutcome2.isSuccess(), false);\n    EXPECT_EQ(putOutcome2.error().Code(), \"ValidateError\");\n    EXPECT_EQ(putOutcome2.error().Message(), \"The channelName param is invalid, it shouldn't contain '/' and length < 1023\");\n\n    //\n    channelName.clear();\n    channelName = \"/test/test/test/test/aaa\";\n    EXPECT_EQ(channelName, \"/test/test/test/test/aaa\");\n\n    auto putOutcome3 = Client->PutLiveChannel(PutLiveChannelRequest(BucketName, channelName, \"HLS\"));\n    EXPECT_EQ(putOutcome3.isSuccess(), false);\n    EXPECT_EQ(putOutcome3.error().Code(), \"ValidateError\");\n    EXPECT_EQ(putOutcome3.error().Message(), \"The channelName param is invalid, it shouldn't contain '/' and length < 1023\");\n\n\n    //\n    channelName.clear();\n    channelName = \"测试通过\";\n    EXPECT_EQ(channelName, \"测试通过\");\n\n    auto putOutcome4 = Client->PutLiveChannel(PutLiveChannelRequest(BucketName,\n         channelName, \"HLS\"));\n    EXPECT_EQ(putOutcome4.isSuccess(), true);\n\n    auto getOutcome = Client->GetLiveChannelInfo(GetLiveChannelInfoRequest(\n        BucketName, channelName));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n\n    auto deleteOutcome = Client->DeleteLiveChannel(DeleteLiveChannelRequest(\n        BucketName, channelName));\n    EXPECT_EQ(deleteOutcome.isSuccess(), true);\n\n    //\n    channelName.clear();\n    channelName = \"test-channel\";\n    EXPECT_EQ(channelName, \"test-channel\");\n\n    putOutcome = Client->PutLiveChannel(PutLiveChannelRequest(BucketName,\n         channelName, \"HLs\"));\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n\n    putOutcome = Client->PutLiveChannel(PutLiveChannelRequest(BucketName,\n         channelName, \"test\"));\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n\n    //\n    PutLiveChannelRequest request1(BucketName, channelName, \"HLS\");\n    request1.setFragDuration(101u);\n    putOutcome = Client->PutLiveChannel(request1);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n\n    PutLiveChannelRequest request2(BucketName, channelName, \"HLS\");\n    request2.setFragDuration(0u);\n    putOutcome = Client->PutLiveChannel(request2);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n    EXPECT_EQ(putOutcome.error().Code(), \"ValidateError\");\n    EXPECT_EQ(putOutcome.error().Message(), \"The live channel frag duration param is invalid, it should be [1,100]\");\n\n    //\n    PutLiveChannelRequest request3(BucketName, channelName, \"HLS\");\n    request3.setFragCount(1011111u);\n    putOutcome = Client->PutLiveChannel(request1);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n\n    PutLiveChannelRequest request4(BucketName, channelName, \"HLS\");\n    request4.setFragCount(0u);\n    putOutcome = Client->PutLiveChannel(request4);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n    \n    //\n    PutLiveChannelRequest request5(BucketName, channelName, \"HLS\");\n    request5.setPlayListName(\"myplay.m3\");\n    putOutcome = Client->PutLiveChannel(request5);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n\n    PutLiveChannelRequest request6(BucketName, channelName, \"HLS\");\n    request6.setPlayListName(\"myplay.M3U8\");\n    putOutcome = Client->PutLiveChannel(request6);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n\tPutLiveChannelRequest request7(BucketName, channelName, \"HLS\");\n\trequest7.setStatus(LiveChannelStatus::LiveStatus);\n\tputOutcome = Client->PutLiveChannel(request7);\n\tEXPECT_EQ(putOutcome.isSuccess(), false);\n\n\tPutLiveChannelRequest request8(BucketName, channelName, \"HLS\");\n\tstd::string too_long;\n\ttoo_long.assign(129, 'a');\n\trequest8.setDescripition(too_long);\n\tputOutcome = Client->PutLiveChannel(request8);\n\tEXPECT_EQ(putOutcome.isSuccess(), false);\n\n    getOutcome = Client->GetLiveChannelInfo(GetLiveChannelInfoRequest(\n        BucketName, channelName));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    EXPECT_EQ(getOutcome.result().PlaylistName(), \"myplay.m3u8\");\n\n    auto deleteOutcome2 = Client->DeleteLiveChannel(DeleteLiveChannelRequest(\n        BucketName, channelName));\n    EXPECT_EQ(deleteOutcome.isSuccess(), true);\n\n    request6.setPlayListName(\"myplay..M3U8\");\n    putOutcome = Client->PutLiveChannel(request6);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n    EXPECT_EQ(putOutcome.error().Code(), \"ValidateError\");\n    EXPECT_EQ(putOutcome.error().Message(), \"The live channel play list param is invalid, it should end with '.m3u8' & length in [6,128]\");\n\n    request6.setPlayListName(\"..M3U8\");\n    putOutcome = Client->PutLiveChannel(request6);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n\n    request6.setPlayListName(\"..m3u8\");\n    putOutcome = Client->PutLiveChannel(request6);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n\n    request6.setPlayListName(\"a.b..m3u8\");\n    putOutcome = Client->PutLiveChannel(request6);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n\n    request6.setPlayListName(\"a.b..m3u\");\n    putOutcome = Client->PutLiveChannel(request6);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n\n    request6.setPlayListName(\"a.b.m3u8\");\n    putOutcome = Client->PutLiveChannel(request6);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    getOutcome = Client->GetLiveChannelInfo(GetLiveChannelInfoRequest(\n        BucketName, channelName));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    EXPECT_EQ(getOutcome.result().PlaylistName(), \"a.b.m3u8\");\n\n    deleteOutcome2 = Client->DeleteLiveChannel(DeleteLiveChannelRequest(\n        BucketName, channelName));\n    EXPECT_EQ(deleteOutcome2.isSuccess(), true);\n\n    std::string longStr(1028, 'a');\n    longStr.append(\".m3u8\");\n    PutLiveChannelRequest request9(BucketName, channelName, \"HLS\");\n    request9.setPlayListName(longStr);\n    putOutcome = Client->PutLiveChannel(request9);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n}\n\nTEST_F(PutAndGetLiveChannelTest, PutAndGetLiveChannelResultTest)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <CreateLiveChannelResult>\n                            <PublishUrls>\n                                <Url>rtmp://test-bucket.oss-cn-hangzhou.aliyuncs.com/live/test-channel</Url>\n                            </PublishUrls>\n                            <PlayUrls>\n                                <Url>http://test-bucket.oss-cn-hangzhou.aliyuncs.com/test-channel/playlist.m3u8</Url>\n                            </PlayUrls>\n                        </CreateLiveChannelResult>)\";\n    PutLiveChannelResult result(xml);\n    EXPECT_EQ(result.PublishUrl(), \"rtmp://test-bucket.oss-cn-hangzhou.aliyuncs.com/live/test-channel\");\n    EXPECT_EQ(result.PlayUrl(), \"http://test-bucket.oss-cn-hangzhou.aliyuncs.com/test-channel/playlist.m3u8\");\n}\n\nTEST_F(PutAndGetLiveChannelTest, GetLiveChannelInfoInvalidBucketTest)\n{\n    std::string channelName;\n    channelName.assign(1024, 'a');\n\n    auto getOutcome = Client->GetLiveChannelInfo(GetLiveChannelInfoRequest(\n        \"Invalid-bucket-test\", channelName));\n    EXPECT_EQ(getOutcome.isSuccess(), false);\n    EXPECT_EQ(getOutcome.error().Code(), \"ValidateError\");\n}\n\nTEST_F(PutAndGetLiveChannelTest, LiveChannelRequestTest)\n{\n    std::string channelName;\n    channelName.assign(1024, 'a');\n\n    GetLiveChannelInfoRequest request(\"bucket\", channelName);\n    request.setBucket(\"bucket\");\n    auto getOutcome = Client->GetLiveChannelInfo(request);\n}\n\nTEST_F(PutAndGetLiveChannelTest, PutLiveChannelWithInvalidResponseBodyTest)\n{\n    // case 1 default\n    std::string channelName = \"test-channel-1\";\n    std::string channelType = \"HLS\";\n\n    PutLiveChannelRequest plcRequest(BucketName, channelName, channelType);\n    plcRequest.setResponseStreamFactory([=]() {\n        auto content = std::make_shared<std::stringstream>();\n        content->write(\"invlid data\", 11);\n        return content;\n    });\n    auto putOutcome = Client->PutLiveChannel(plcRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n    EXPECT_EQ(putOutcome.error().Code(), \"PutLiveChannelError\");\n\n    GetLiveChannelInfoRequest glcRequest(BucketName, channelName);\n    glcRequest.setResponseStreamFactory([=]() {\n        auto content = std::make_shared<std::stringstream>();\n        content->write(\"invlid data\", 11);\n        return content;\n    });\n    auto glcOutcome = Client->GetLiveChannelInfo(glcRequest);\n    EXPECT_EQ(glcOutcome.isSuccess(), false);\n    EXPECT_EQ(glcOutcome.error().Code(), \"GetLiveChannelStatError\");\n}\n\nTEST_F(PutAndGetLiveChannelTest, PutLiveChannelResultFunctionTest)\n{\n\n    PutLiveChannelResult result(\"test\");\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <CreateLiveChannel>\n                            <PublishUrls>\n                                <Url>rtmp://test-bucket.oss-cn-hangzhou.aliyuncs.com/live/test-channel</Url>\n                            </PublishUrls>\n                            <PlayUrls>\n                                <Url>http://test-bucket.oss-cn-hangzhou.aliyuncs.com/test-channel/playlist.m3u8</Url>\n                            </PlayUrls>\n                        </CreateLiveChannel>)\";\n    PutLiveChannelResult result1(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <CreateLiveChannelResult>\n                                <Url>rtmp://test-bucket.oss-cn-hangzhou.aliyuncs.com/live/test-channel</Url>\n                                <Url>http://test-bucket.oss-cn-hangzhou.aliyuncs.com/test-channel/playlist.m3u8</Url>\n                        </CreateLiveChannelResult>)\";\n    PutLiveChannelResult result2(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <CreateLiveChannelResult>\n                            <PublishUrls>\n                            </PublishUrls>\n                            <PlayUrls>\n                            </PlayUrls>\n                        </CreateLiveChannelResult>)\";\n    PutLiveChannelResult result3(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <CreateLiveChannel>\n                            <PublishUrls>\n                                <Url></Url>\n                            </PublishUrls>\n                            <PlayUrls>\n                                <Url></Url>\n                            </PlayUrls>\n                        </CreateLiveChannel>)\";\n    PutLiveChannelResult result4(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    PutLiveChannelResult result5(xml);\n}\n\nTEST_F(PutAndGetLiveChannelTest, GetLiveChannelInfoResultBranchTest)\n{\n    GetLiveChannelInfoResult result(\"test\");\n\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <LiveChannel>\n\n                        </LiveChannel>)\";\n    GetLiveChannelInfoResult result1(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <LiveChannelConfiguration>\n\n                        </LiveChannelConfiguration>)\";\n    GetLiveChannelInfoResult result2(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <LiveChannelConfiguration>\n\n                            <Target>\n\n                            </Target>\n\n                        </LiveChannelConfiguration>)\";\n    GetLiveChannelInfoResult result3(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                        <LiveChannelConfiguration>\n                                <Description></Description>\n                                <Status></Status>\n                            <Target>\n                                <Type></Type>\n                                <FragDuration></FragDuration>\n                                <FragCount></FragCount>\n                                <PlaylistName></PlaylistName>\n                            </Target>\n                        </LiveChannelConfiguration>)\";\n    GetLiveChannelInfoResult result4(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    GetLiveChannelInfoResult result5(xml);\n}\n}\n}\n"
  },
  {
    "path": "test/src/MultipartUpload/CallableTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include <fstream>\n#include <src/utils/Utils.h>\n#include <src/utils/FileSystemUtils.h>\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass CallableTest : public ::testing::Test {\nprotected:\n\tCallableTest()\n\t{\n\t}\n\t~CallableTest()\n\t{\n\t}\n\n\t// Sets up the stuff shared by all tests in this test case.\n\tstatic void SetUpTestCase()\n\t{\n\t\tClient = TestUtils::GetOssClientDefault();\n\t\tBucketName = TestUtils::GetBucketName(\"cpp-sdk-callable\");\n\t\tClient->CreateBucket(CreateBucketRequest(BucketName));\n\t}\n\n\t// Tears down the stuff shared by all tests in this test case.\n\tstatic void TearDownTestCase()\n\t{\n\t\tTestUtils::CleanBucket(*Client, BucketName);\n\t\tClient = nullptr;\n\t}\n\n\t// Sets up the test fixture.\n\tvoid SetUp() override\n\t{\n\t}\n\n\t// Tears down the test fixture.\n\tvoid TearDown() override\n\t{\n\t}\n\npublic:\n\tstatic std::shared_ptr<OssClient> Client;\n\tstatic std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> CallableTest::Client = nullptr;\nstd::string CallableTest::BucketName = \"\";\n\nTEST_F(CallableTest, MultipartUploadCallableBasicTest)\n{\n    auto memKey = TestUtils::GetObjectKey(\"MultipartUploadCallable-MemObject\");\n    auto memContent = TestUtils::GetRandomStream(102400);\n    auto memInitOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, memKey));\n    EXPECT_EQ(memInitOutcome.isSuccess(), true);\n\n    auto fileKey = TestUtils::GetObjectKey(\"MultipartUploadCallable-FileObject\");\n    auto tmpFile = TestUtils::GetObjectKey(\"MultipartUploadCallable-FileObject\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\n    {\n    auto fileContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios::binary);\n    auto fileInitOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, fileKey));\n    EXPECT_EQ(fileInitOutcome.isSuccess(), true);\n\n    auto memOutcomeCallable = Client->UploadPartCallable(UploadPartRequest(BucketName, memKey,\n        1, memInitOutcome.result().UploadId(), memContent));\n    auto fileOutcomeCallable = Client->UploadPartCallable(UploadPartRequest(BucketName, fileKey,\n        1, fileInitOutcome.result().UploadId(), fileContent));\n    \n    std::cout << \"Client[\" << Client << \"]\" << \"Issue MultipartUploadCallable done.\" << std::endl;\n\n    auto fileOutcome = fileOutcomeCallable.get();\n    auto menOutcome = memOutcomeCallable.get();\n    EXPECT_EQ(fileOutcome.isSuccess(), true);\n    EXPECT_EQ(menOutcome.isSuccess(), true);\n\n    // list part\n    auto memListPartOutcome = Client->ListParts(ListPartsRequest(BucketName, memKey, memInitOutcome.result().UploadId()));\n    auto fileListPartOutcome = Client->ListParts(ListPartsRequest(BucketName, fileKey, fileInitOutcome.result().UploadId()));\n    EXPECT_EQ(memListPartOutcome.isSuccess(), true);\n    EXPECT_EQ(fileListPartOutcome.isSuccess(), true);\n\n    auto memCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, memKey,\n        memListPartOutcome.result().PartList(), memInitOutcome.result().UploadId()));\n    auto fileCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, fileKey,\n        fileListPartOutcome.result().PartList(), fileInitOutcome.result().UploadId()));\n    EXPECT_EQ(memCompleteOutcome.isSuccess(), true);\n    EXPECT_EQ(fileCompleteOutcome.isSuccess(), true);\n\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, memKey), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, fileKey), true);\n\n    memContent = nullptr;\n    fileContent = nullptr;\n    }\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(CallableTest, MultipartUploadCopyCallableBasicTest)\n{\n    // put object from buffer\n    std::string memObjKey = TestUtils::GetObjectKey(\"PutObjectFromBuffer\");\n    auto memObjContent = TestUtils::GetRandomStream(102400);\n    auto putMemObjOutcome = Client->PutObject(PutObjectRequest(BucketName, memObjKey, memObjContent));\n    EXPECT_EQ(putMemObjOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, memObjKey), true);\n\n    // put object from local file\n    std::string fileObjKey = TestUtils::GetObjectKey(\"PutObjectFromFile\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectFromFile\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\n    auto fileObjContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios::binary);\n    auto putFileObjOutcome = Client->PutObject(PutObjectRequest(BucketName, fileObjKey, fileObjContent));\n    EXPECT_EQ(putFileObjOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, fileObjKey), true);\n\n    // close file\n    fileObjContent->close();\n\n    // apply upload id\n    std::string memKey = TestUtils::GetObjectKey(\"UploadPartCopyCallableMemObjectBasicTest\");\n    auto memInitObjOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, memKey));\n    EXPECT_EQ(memInitObjOutcome.isSuccess(), true);\n    EXPECT_EQ(memInitObjOutcome.result().Key(), memKey);\n\n    std::string fileKey = TestUtils::GetObjectKey(\"UploadPartCopyCallableFileObjectBasicTest\");\n    auto fileInitObjOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, fileKey));\n    EXPECT_EQ(fileInitObjOutcome.isSuccess(), true);\n    EXPECT_EQ(fileInitObjOutcome.result().Key(), fileKey);\n\n    // upload part copy\n    auto memOutcomeCallable = Client->UploadPartCopyCallable(UploadPartCopyRequest(BucketName, memKey,\n        BucketName, memObjKey, memInitObjOutcome.result().UploadId(), 1));\n    auto fileOutcomeCallable = Client->UploadPartCopyCallable(UploadPartCopyRequest(BucketName, fileKey,\n        BucketName, fileObjKey, fileInitObjOutcome.result().UploadId(), 1));\n\n    std::cout << \"Client[\" << Client << \"]\" << \"Issue UploadPartCopyCallable done.\" << std::endl;\n\n    auto fileOutcome = fileOutcomeCallable.get();\n    auto memOutcome = memOutcomeCallable.get();\n    EXPECT_EQ(fileOutcome.isSuccess(), true);\n    EXPECT_EQ(memOutcome.isSuccess(), true);\n\n    // list part\n    auto memListPartOutcome = Client->ListParts(ListPartsRequest(BucketName, memKey, memInitObjOutcome.result().UploadId()));\n    auto fileListPartOutcome = Client->ListParts(ListPartsRequest(BucketName, fileKey, fileInitObjOutcome.result().UploadId()));\n    EXPECT_EQ(memListPartOutcome.isSuccess(), true);\n    EXPECT_EQ(fileListPartOutcome.isSuccess(), true);\n\n    // complete the part\n    auto memCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, memKey,\n        memListPartOutcome.result().PartList(), memInitObjOutcome.result().UploadId()));\n    auto fileCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, fileKey,\n        fileListPartOutcome.result().PartList(), fileInitObjOutcome.result().UploadId()));\n    EXPECT_EQ(memCompleteOutcome.isSuccess(), true);\n    EXPECT_EQ(fileCompleteOutcome.isSuccess(), true);\n\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, memKey), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, fileKey), true);\n\n    memObjContent = nullptr;\n    fileObjContent = nullptr;\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\n}\n}"
  },
  {
    "path": "test/src/MultipartUpload/MultipartUploadTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include \"src/utils/FileSystemUtils.h\"\r\n#include \"src/utils/Utils.h\"\r\n#include <fstream>\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass MultipartUploadTest : public ::testing::Test {\r\nprotected:\r\n    MultipartUploadTest()\r\n    {\r\n    }\r\n\r\n    ~MultipartUploadTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase() \r\n    {\r\n        Client = TestUtils::GetOssClientDefault();\r\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-multipartupload\");\r\n        Client->CreateBucket(CreateBucketRequest(BucketName));\r\n        TestFile = TestUtils::GetTargetFileName(\"cpp-sdk-multipartupload\");\r\n        TestUtils::WriteRandomDatatoFile(TestFile, 1 * 1024 * 1024 + 100);\r\n        TestFileMd5 = TestUtils::GetFileMd5(TestFile);\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase() \r\n    {\r\n        RemoveFile(TestFile);\r\n        TestUtils::CleanBucket(*Client, BucketName);\r\n        Client = nullptr;\r\n    }\r\n\r\n    // Sets up the test fixture.\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    // Tears down the test fixture.\r\n    void TearDown() override\r\n    {\r\n    }\r\n\r\n    static int CalculatePartCount(int64_t totalSize, int singleSize);\r\n    static int64_t GetFileLength(const std::string file);\r\n\r\npublic:\r\n    static std::shared_ptr<OssClient> Client;\r\n    static std::string BucketName;\r\n    static std::string TestFile;\r\n    static std::string TestFileMd5;\r\n\r\n};\r\n\r\nstd::shared_ptr<OssClient> MultipartUploadTest::Client = nullptr;\r\nstd::string MultipartUploadTest::BucketName = \"\";\r\nstd::string MultipartUploadTest::TestFile = \"\";\r\nstd::string MultipartUploadTest::TestFileMd5 = \"\";\r\n\r\n\r\nint64_t MultipartUploadTest::GetFileLength(const std::string file)\r\n{\r\n    std::fstream f(file, std::ios::in | std::ios::binary);\r\n    f.seekg(0, f.end);\r\n    int64_t size = f.tellg();\r\n    f.close();\r\n    return size;\r\n}\r\n\r\nint MultipartUploadTest::CalculatePartCount(int64_t totalSize, int singleSize)\r\n{\r\n    // Calculate the part count\r\n    auto partCount = (int)(totalSize / singleSize);\r\n    if (totalSize % singleSize != 0)\r\n    {\r\n        partCount++;\r\n    }\r\n    return partCount;\r\n}\r\n\r\nTEST_F(MultipartUploadTest, InitiateMultipartUploadBasicTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"InitiateMultipartUploadBasicTest\");\r\n    InitiateMultipartUploadRequest request(BucketName, key);\r\n    auto initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_EQ(initOutcome.result().Key(), key);\r\n    EXPECT_FALSE(initOutcome.result().RequestId().empty());\r\n}\r\n\r\nTEST_F(MultipartUploadTest, InitiateMultipartUploadWithEncodingTypeTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"InitiateMultipartUploadWithEncodingTypeTest\");\r\n    key.push_back(0x1c); key.push_back(0x1a); key.append(\".1.t\");\r\n    InitiateMultipartUploadRequest request(BucketName, key);\r\n    request.setEncodingType(\"url\");\r\n    auto initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_EQ(initOutcome.result().Key(), key);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, InitiateMultipartUploadWithMetaDataTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"InitiateMultipartUploadWithMetaTest\");\r\n    ObjectMetaData metaData;\r\n    metaData.UserMetaData()[\"test\"] = \"test\";\r\n    metaData.UserMetaData()[\"data\"] = \"data\";\r\n    InitiateMultipartUploadRequest request(BucketName, key, metaData);\r\n    auto initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_EQ(initOutcome.result().Key(), key);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, InitiateMultipartUploadWithFullSettingTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"InitiateMultipartUploadWithFullSettingTest\");\r\n    ObjectMetaData metaData;\r\n    metaData.setCacheControl(\"No-Cache\");\r\n    metaData.setContentType(\"user/test\");\r\n    metaData.setContentEncoding(\"myzip\");\r\n    metaData.setContentDisposition(\"test.zip\");\r\n    metaData.UserMetaData()[\"test\"] = \"test\";\r\n    metaData.UserMetaData()[\"data\"] = \"data\";\r\n    InitiateMultipartUploadRequest request(BucketName, key, metaData);\r\n    auto initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_EQ(initOutcome.result().Key(), key);\r\n\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto uploadPartOutcome = Client->UploadPart(UploadPartRequest(BucketName, key, 1, initOutcome.result().UploadId(), content));\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n\r\n    auto lOutcome = Client->ListParts(ListPartsRequest(BucketName, key, initOutcome.result().UploadId()));\r\n    EXPECT_EQ(lOutcome.isSuccess(), true);\r\n\r\n    CompleteMultipartUploadRequest cRequest(BucketName, key,\r\n        lOutcome.result().PartList(), initOutcome.result().UploadId());\r\n\r\n    auto outcome = Client->CompleteMultipartUpload(cRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto hOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().ContentLength(), 100);\r\n    EXPECT_EQ(hOutcome.result().CacheControl(), \"No-Cache\");\r\n    EXPECT_EQ(hOutcome.result().ContentType(), \"user/test\");\r\n    EXPECT_EQ(hOutcome.result().ContentDisposition(), \"test.zip\");\r\n    EXPECT_EQ(hOutcome.result().ContentEncoding(), \"myzip\");\r\n    EXPECT_EQ(hOutcome.result().UserMetaData().at(\"test\"), \"test\");\r\n    EXPECT_EQ(hOutcome.result().UserMetaData().at(\"data\"), \"data\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, InitiateMultipartUploadWithFullSetting2Test)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"InitiateMultipartUploadWithFullSetting2Test\");\r\n    InitiateMultipartUploadRequest request(BucketName, key);\r\n    request.setCacheControl(\"No-Cache\");\r\n    request.setContentEncoding(\"myzip\");\r\n    request.setContentDisposition(\"test.zip\");\r\n    request.MetaData().setContentType(\"user/test\");\r\n    request.MetaData().UserMetaData()[\"test\"] = \"test\";\r\n    request.MetaData().UserMetaData()[\"data\"] = \"data\";\r\n    request.setExpires(TestUtils::GetGMTString(3600));\r\n\r\n    auto initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_EQ(initOutcome.result().Key(), key);\r\n\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto uploadPartOutcome = Client->UploadPart(UploadPartRequest(BucketName, key, 1, initOutcome.result().UploadId(), content));\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n\r\n    auto lOutcome = Client->ListParts(ListPartsRequest(BucketName, key, initOutcome.result().UploadId()));\r\n    EXPECT_EQ(lOutcome.isSuccess(), true);\r\n\r\n    CompleteMultipartUploadRequest cRequest(BucketName, key,\r\n        lOutcome.result().PartList(), initOutcome.result().UploadId());\r\n\r\n    auto outcome = Client->CompleteMultipartUpload(cRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto hOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().ContentLength(), 100);\r\n    EXPECT_EQ(hOutcome.result().CacheControl(), \"No-Cache\");\r\n    EXPECT_EQ(hOutcome.result().ContentType(), \"user/test\");\r\n    EXPECT_EQ(hOutcome.result().ContentDisposition(), \"test.zip\");\r\n    EXPECT_EQ(hOutcome.result().ContentEncoding(), \"myzip\");\r\n    EXPECT_EQ(hOutcome.result().UserMetaData().at(\"test\"), \"test\");\r\n    EXPECT_EQ(hOutcome.result().UserMetaData().at(\"data\"), \"data\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, InitiateMultipartUploadResult)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <InitiateMultipartUploadResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            <Bucket>multipart_upload</Bucket>\r\n                            <Key>multipart.data</Key>\r\n                            <UploadId>0004B9894A22E5B1888A1E29F8236E2D</UploadId>\r\n                        </InitiateMultipartUploadResult>)\";\r\n    InitiateMultipartUploadResult result(xml);\r\n    EXPECT_EQ(result.Bucket(), \"multipart_upload\");\r\n    EXPECT_EQ(result.Key(), \"multipart.data\");\r\n    EXPECT_EQ(result.UploadId(), \"0004B9894A22E5B1888A1E29F8236E2D\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, InitiateMultipartUploadResultEncodingType)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <InitiateMultipartUploadResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            <EncodingType>url</EncodingType>\r\n                            <Bucket>multipart_upload</Bucket>\r\n                            <Key>multipart%20%2Fdata</Key>\r\n                            <UploadId>0004B9894A22E5B1888A1E29F8236E2D</UploadId>\r\n                        </InitiateMultipartUploadResult>)\";\r\n    InitiateMultipartUploadResult result(xml);\r\n    EXPECT_EQ(result.Bucket(), \"multipart_upload\");\r\n    EXPECT_EQ(result.Key(), \"multipart /data\");\r\n    EXPECT_EQ(result.UploadId(), \"0004B9894A22E5B1888A1E29F8236E2D\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, InitiateMultipartUploadResultEmptyNodeTest)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <InitiateMultipartUploadResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            <EncodingType></EncodingType>\r\n                            <Bucket></Bucket>\r\n                            <Key></Key>\r\n                            <UploadId></UploadId>\r\n                        </InitiateMultipartUploadResult>)\";\r\n    InitiateMultipartUploadResult result(xml);\r\n    EXPECT_EQ(result.Bucket(), \"\");\r\n    EXPECT_EQ(result.Key(), \"\");\r\n    EXPECT_EQ(result.UploadId(), \"\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UploadPartBasicTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"UploadPartBasicTest\");\r\n    InitiateMultipartUploadRequest request(BucketName, key);\r\n    auto initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_EQ(initOutcome.result().Key(), key);\r\n\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto uploadPartOutcome = Client->UploadPart(UploadPartRequest(BucketName, key, 1, initOutcome.result().UploadId(), content));\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n\r\n    auto calcETag = ComputeContentETag(*content);\r\n    EXPECT_EQ(uploadPartOutcome.result().ETag(), calcETag);\r\n    EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UploadPartNegativeTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"UploadPartNegativeTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->UploadPart(UploadPartRequest(BucketName, key, 1, \"invaliduploadid\", content));\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchUpload\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UploadPartInvalidContentTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"UploadPartInvalidContentTest\");\r\n\r\n    std::shared_ptr<std::iostream> content = nullptr;\r\n    auto outcome = Client->UploadPart(UploadPartRequest(BucketName, key, 1, \"id\", content));\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_EQ(outcome.error().Message(), \"Request body is null.\");\r\n\r\n    content = TestUtils::GetRandomStream(100);\r\n    content->setstate(content->badbit);\r\n    outcome = Client->UploadPart(UploadPartRequest(BucketName, key, 1, \"id\", content));\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_EQ(outcome.error().Message(), \"Request body is in bad state. Read/writing error on i/o operation.\");\r\n\r\n    content = TestUtils::GetRandomStream(100);\r\n    content->setstate(content->failbit);\r\n    outcome = Client->UploadPart(UploadPartRequest(BucketName, key, 1, \"id\", content));\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_EQ(outcome.error().Message(), \"Request body is in fail state. Logical error on i/o operation.\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UploadPartInvalidContentLengthTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"UploadPartInvalidContentLengthTest\");\r\n\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    UploadPartRequest request(BucketName, key, 1, \"id\", content);\r\n    request.setContentLength(5LL * 1024LL * 1024LL * 1024LL + 1LL);\r\n    auto outcome = Client->UploadPart(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_EQ(outcome.error().Message(), \"PartSize should not be less than 100*1024 or greater than 5*1024*1024*1024.\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UploadPartInvalidPartNumberTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"UploadPartInvalidPartNumberTest\");\r\n\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    UploadPartRequest request(BucketName, key, 10001, \"id\", content);\r\n    auto outcome = Client->UploadPart(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_EQ(outcome.error().Message(), \"PartNumber should not be less than 1 or greater than 10000.\");\r\n\r\n    request.setPartNumber(0);\r\n    outcome = Client->UploadPart(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_EQ(outcome.error().Message(), \"PartNumber should not be less than 1 or greater than 10000.\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UploadPartInvalidBucketObjectTest)\r\n{\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    UploadPartRequest request(\"InvalidBucket\", \"key\", 10001, \"id\", content);\r\n    auto outcome = Client->UploadPart(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n\r\n    request.setBucket(\"bucket\");\r\n    request.setKey(\"\");\r\n    outcome = Client->UploadPart(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, CompleteMultipartUploadNegativeTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CompleteMultipartUploadNegativeTest\");\r\n    PartList partList;\r\n    partList.push_back(Part(1, \"invalidetag\"));\r\n\r\n    CompleteMultipartUploadRequest cRequest(BucketName, key, partList, \"invaliduploadid\");\r\n    auto outcome = Client->CompleteMultipartUpload(cRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchUpload\");\r\n    EXPECT_FALSE(outcome.error().RequestId().empty());\r\n}\r\n\r\nTEST_F(MultipartUploadTest, CompleteMultipartUploadWithEmptyPartListTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CompleteMultipartUploadWithEmptyPartListTest\");\r\n    CompleteMultipartUploadRequest cRequest(BucketName, key);\r\n    auto outcome = Client->CompleteMultipartUpload(cRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_EQ(outcome.error().Message(), \"PartList is empty.\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, CompleteMultipartUploadInvalidBucketNameTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CompleteMultipartUploadInvalidBucketNameTest\");\r\n    CompleteMultipartUploadRequest cRequest(\"InavlidBucketName\", key);\r\n    auto outcome = Client->CompleteMultipartUpload(cRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_TRUE(strstr(outcome.error().Message().c_str(), \"The bucket name is invalid\") != nullptr);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, CompleteMultipartUploadWithEncodingTypeTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CompleteMultipartUploadWithEncodingTypeTest  \");\r\n    InitiateMultipartUploadRequest request(BucketName, key);\r\n    auto initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_EQ(initOutcome.result().Key(), key);\r\n\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto uploadPartOutcome = Client->UploadPart(UploadPartRequest(BucketName, key, 1, initOutcome.result().UploadId(), content));\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n\r\n    PartList partList;\r\n    Part part(1, uploadPartOutcome.result().ETag());\r\n    partList.push_back(part);\r\n    \r\n    CompleteMultipartUploadRequest completeRequest(BucketName, key);\r\n    completeRequest.setPartList(partList);\r\n    completeRequest.setUploadId(initOutcome.result().UploadId());\r\n    completeRequest.setEncodingType(\"url\");\r\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n    EXPECT_EQ(cOutcome.result().Key(), key);\r\n    EXPECT_TRUE(strstr(cOutcome.result().Location().c_str(), key.c_str()) != nullptr);\r\n    EXPECT_EQ(cOutcome.result().EncodingType(), \"url\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, CompleteMultipartUploadResultTest)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <CompleteMultipartUploadResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            <Location>http://oss-example.oss-cn-hangzhou.aliyuncs.com/multipart.data</Location>\r\n                            <Bucket>oss-example</Bucket>\r\n                            <Key>multipart.data</Key>\r\n                            <ETag>B864DB6A936D376F9F8D3ED3BBE540DD-3</ETag>\r\n                        </CompleteMultipartUploadResult>)\";\r\n    CompleteMultipartUploadResult result(xml);\r\n    EXPECT_EQ(result.Bucket(), \"oss-example\");\r\n    EXPECT_EQ(result.Location(), \"http://oss-example.oss-cn-hangzhou.aliyuncs.com/multipart.data\");\r\n    EXPECT_EQ(result.Key(), \"multipart.data\");\r\n    EXPECT_EQ(result.ETag(), \"B864DB6A936D376F9F8D3ED3BBE540DD-3\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, CompleteMultipartUploadResultEncodingTypeTest)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <CompleteMultipartUploadResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            <Location>oss-example.oss-cn-hangzhou.aliyuncs.com</Location>\r\n                            <Bucket>oss-example</Bucket>\r\n                            <Key>multipart%2F%20.data</Key>\r\n                            <ETag>B864DB6A936D376F9F8D3ED3BBE540DD-3</ETag>\r\n                            <EncodingType>url</EncodingType>\r\n                        </CompleteMultipartUploadResult>)\";\r\n    CompleteMultipartUploadResult result(xml);\r\n    EXPECT_EQ(result.Bucket(), \"oss-example\");\r\n    EXPECT_EQ(result.Location(), \"oss-example.oss-cn-hangzhou.aliyuncs.com\");\r\n    EXPECT_EQ(result.Key(), \"multipart/ .data\");\r\n    EXPECT_EQ(result.ETag(), \"B864DB6A936D376F9F8D3ED3BBE540DD-3\");\r\n    EXPECT_EQ(result.EncodingType(), \"url\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, CompleteMultipartUploadResultEmptyNodeTest)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <CompleteMultipartUploadResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            <Location></Location>\r\n                            <Bucket></Bucket>\r\n                            <Key></Key>\r\n                            <ETag></ETag>\r\n                            <EncodingType></EncodingType>\r\n                        </CompleteMultipartUploadResult>)\";\r\n    CompleteMultipartUploadResult result(xml);\r\n    EXPECT_EQ(result.Bucket(), \"\");\r\n    EXPECT_EQ(result.Location(), \"\");\r\n    EXPECT_EQ(result.Key(), \"\");\r\n    EXPECT_EQ(result.ETag(), \"\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UploadPartCopyTest)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <CopyPartResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            <LastModified>2014-07-17T06:27:54.000Z</LastModified>\r\n                            <ETag>\"5B3C1A2E053D763E1B002CC607C5A0FE\"</ETag>\r\n                        </CopyPartResult>)\";\r\n    UploadPartCopyResult result(xml);\r\n    EXPECT_EQ(result.LastModified(), \"2014-07-17T06:27:54.000Z\");\r\n    EXPECT_EQ(result.ETag(), \"5B3C1A2E053D763E1B002CC607C5A0FE\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, CompleteMultipartUploadResultEmptyTest)\r\n{\r\n    CompleteMultipartUploadResult result(\"\");\r\n    EXPECT_EQ(result.Bucket(), \"\");\r\n    EXPECT_EQ(result.Location(), \"\");\r\n    EXPECT_EQ(result.Key(), \"\");\r\n    EXPECT_EQ(result.ETag(), \"\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListMultipartUploadsResultTest)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListMultipartUploadsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            <Bucket>oss-example</Bucket>\r\n                            <KeyMarker>keyMarker</KeyMarker>\r\n                            <UploadIdMarker>1104B99B8E707874FC2D692FA5D77D3F</UploadIdMarker>\r\n                            <NextKeyMarker>oss.avi</NextKeyMarker>\r\n                            <NextUploadIdMarker>0004B99B8E707874FC2D692FA5D77D3F</NextUploadIdMarker>\r\n                            <Delimiter>/</Delimiter>\r\n                            <Prefix>prefix</Prefix>\r\n                            <MaxUploads>1000</MaxUploads>\r\n                            <IsTruncated>false</IsTruncated>\r\n                            <Upload>\r\n                                <Key>multipart.data</Key>\r\n                                <UploadId>0004B999EF518A1FE585B0C9360DC4C8</UploadId>\r\n                                <Initiated>2012-02-23T04:18:23.000Z</Initiated>\r\n                            </Upload>\r\n                            <Upload>\r\n                                <Key>multipart.data</Key>\r\n                                <UploadId>0004B999EF5A239BB9138C6227D69F95</UploadId>\r\n                                <Initiated>2012-02-23T04:18:23.000Z</Initiated>\r\n                            </Upload>\r\n                            <Upload>\r\n                                <Key>oss.avi</Key>\r\n                                <UploadId>0004B99B8E707874FC2D692FA5D77D3F</UploadId>\r\n                                <Initiated>2012-02-23T06:14:27.000Z</Initiated>\r\n                            </Upload>\r\n                        </ListMultipartUploadsResult>)\";\r\n    ListMultipartUploadsResult result(xml);\r\n    EXPECT_EQ(result.Bucket(), \"oss-example\");\r\n    EXPECT_EQ(result.KeyMarker(), \"keyMarker\");\r\n    EXPECT_EQ(result.UploadIdMarker(), \"1104B99B8E707874FC2D692FA5D77D3F\");\r\n    EXPECT_EQ(result.NextKeyMarker(), \"oss.avi\");\r\n    EXPECT_EQ(result.NextUploadIdMarker(), \"0004B99B8E707874FC2D692FA5D77D3F\");\r\n    EXPECT_EQ(result.MaxUploads(), 1000U);\r\n    EXPECT_EQ(result.IsTruncated(), false);\r\n    EXPECT_EQ(result.MultipartUploadList().size(), 3U);\r\n    EXPECT_EQ(result.MultipartUploadList().begin()->Key, \"multipart.data\");\r\n    EXPECT_EQ(result.MultipartUploadList().begin()->UploadId, \"0004B999EF518A1FE585B0C9360DC4C8\");\r\n    EXPECT_EQ(result.MultipartUploadList().begin()->Initiated, \"2012-02-23T04:18:23.000Z\");\r\n    EXPECT_EQ(result.MultipartUploadList().rbegin()->Key, \"oss.avi\");\r\n    EXPECT_EQ(result.MultipartUploadList().rbegin()->UploadId, \"0004B99B8E707874FC2D692FA5D77D3F\");\r\n    EXPECT_EQ(result.MultipartUploadList().rbegin()->Initiated, \"2012-02-23T06:14:27.000Z\");\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <ListMultipartUploadsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <Bucket>oss-example</Bucket>\r\n            <KeyMarker>keyMarker1</KeyMarker>\r\n            <UploadIdMarker>1104B99B8E707874FC2D692FA5D77D3F</UploadIdMarker>\r\n            <NextKeyMarker>oss.avi</NextKeyMarker>\r\n            <NextUploadIdMarker>0004B99B8E707874FC2D692FA5D77D3F</NextUploadIdMarker>\r\n            <Delimiter>/</Delimiter>\r\n            <Prefix>prefix</Prefix>\r\n            <MaxUploads>1000</MaxUploads>\r\n            <EncodingType>url</EncodingType>\r\n            <IsTruncated>false</IsTruncated>\r\n            <Upload>\r\n                <Key>multipart.data</Key>\r\n                <UploadId>0004B999EF518A1FE585B0C9360DC4C8</UploadId>\r\n                <Initiated>2012-02-23T04:18:23.000Z</Initiated>\r\n            </Upload>\r\n            <Upload>\r\n                <Key>multipart.data</Key>\r\n                <UploadId>0004B999EF5A239BB9138C6227D69F95</UploadId>\r\n                <Initiated>2012-02-23T04:18:23.000Z</Initiated>\r\n            </Upload>\r\n            <Upload>\r\n                <Key>oss.avi</Key>\r\n                <UploadId>0004B99B8E707874FC2D692FA5D77D3F</UploadId>\r\n                <Initiated>2012-02-23T06:14:27.000Z</Initiated>\r\n            </Upload>\r\n        </ListMultipartUploadsResult>\r\n    )\";\r\n    result = ListMultipartUploadsResult(xml);\r\n    EXPECT_EQ(result.KeyMarker(), \"keyMarker1\");\r\n\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListMultipartUploadsResultEmptyNodeTest)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListMultipartUploadsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            <Bucket></Bucket>\r\n                            <KeyMarker></KeyMarker>\r\n                            <UploadIdMarker></UploadIdMarker>\r\n                            <NextKeyMarker></NextKeyMarker>\r\n                            <NextUploadIdMarker></NextUploadIdMarker>\r\n                            <Delimiter></Delimiter>\r\n                            <Prefix></Prefix>\r\n                            <MaxUploads></MaxUploads>\r\n                            <IsTruncated></IsTruncated>\r\n                            <Upload>\r\n                                <Key></Key>\r\n                                <UploadId></UploadId>\r\n                                <Initiated></Initiated>\r\n                            </Upload>\r\n                            <Upload>\r\n                                <Key></Key>\r\n                                <UploadId></UploadId>\r\n                                <Initiated></Initiated>\r\n                            </Upload>\r\n                        </ListMultipartUploadsResult>)\";\r\n    ListMultipartUploadsResult result(xml);\r\n    EXPECT_EQ(result.Bucket(), \"\");\r\n    EXPECT_EQ(result.KeyMarker(), \"\");\r\n    EXPECT_EQ(result.UploadIdMarker(), \"\");\r\n    EXPECT_EQ(result.NextKeyMarker(), \"\");\r\n    EXPECT_EQ(result.NextUploadIdMarker(), \"\");\r\n    EXPECT_EQ(result.MaxUploads(), 0UL);\r\n    EXPECT_EQ(result.IsTruncated(), false);\r\n    EXPECT_EQ(result.MultipartUploadList().size(), 2U);\r\n    EXPECT_EQ(result.MultipartUploadList().begin()->Key, \"\");\r\n    EXPECT_EQ(result.MultipartUploadList().begin()->UploadId, \"\");\r\n    EXPECT_EQ(result.MultipartUploadList().begin()->Initiated, \"\");\r\n    EXPECT_EQ(result.MultipartUploadList().rbegin()->Key, \"\");\r\n    EXPECT_EQ(result.MultipartUploadList().rbegin()->UploadId, \"\");\r\n    EXPECT_EQ(result.MultipartUploadList().rbegin()->Initiated, \"\");\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <ListMultipartUploadsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <Bucket></Bucket>\r\n            <KeyMarker></KeyMarker>\r\n            <UploadIdMarker></UploadIdMarker>\r\n            <NextKeyMarker></NextKeyMarker>\r\n            <NextUploadIdMarker></NextUploadIdMarker>\r\n            <Delimiter></Delimiter>\r\n            <Prefix></Prefix>\r\n            <MaxUploads></MaxUploads>\r\n            <IsTruncated></IsTruncated>\r\n            <Upload>\r\n                <Key></Key>\r\n                <UploadId></UploadId>\r\n                <Initiated></Initiated>\r\n            </Upload>\r\n            <Upload>\r\n                <Key></Key>\r\n                <UploadId></UploadId>\r\n                <Initiated></Initiated>\r\n            </Upload>\r\n            <CommonPrefixes>\r\n            </CommonPrefixes>\r\n        </ListMultipartUploadsResult>\r\n        )\";\r\n    result = ListMultipartUploadsResult(xml);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListPartsResultTest)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <ListPartsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                <Bucket>multipart_upload</Bucket>\r\n                <Key>multipart.data</Key>\r\n                <UploadId>0004B999EF5A239BB9138C6227D69F95</UploadId>\r\n                <NextPartNumberMarker>5</NextPartNumberMarker>\r\n                <MaxParts>1000</MaxParts>\r\n                <IsTruncated>false</IsTruncated>\r\n                <Part>\r\n                    <PartNumber>1</PartNumber>\r\n                    <LastModified>2012-02-23T07:01:34.000Z</LastModified>\r\n                    <ETag>&quot;3349DC700140D7F86A078484278075A9&quot;</ETag>\r\n                    <Size>6291456</Size>\r\n                </Part>\r\n                <Part>\r\n                    <PartNumber>2</PartNumber>\r\n                    <LastModified>2012-02-23T07:01:12.000Z</LastModified>\r\n                    <ETag>&quot;3349DC700140D7F86A078484278075A9&quot;</ETag>\r\n                    <Size>6291456</Size>\r\n                </Part>\r\n                <Part>\r\n                    <PartNumber>5</PartNumber>\r\n                    <LastModified>2012-02-23T07:02:03.000Z</LastModified>\r\n                    <ETag>&quot;7265F4D211B56873A381D321F586E4A9&quot;</ETag>\r\n                    <Size>1024</Size>\r\n                </Part>\r\n            </ListPartsResult>)\";\r\n    ListPartsResult result(xml);\r\n    EXPECT_EQ(result.Bucket(), \"multipart_upload\");\r\n    EXPECT_EQ(result.Key(), \"multipart.data\");\r\n    EXPECT_EQ(result.UploadId(), \"0004B999EF5A239BB9138C6227D69F95\");\r\n    EXPECT_EQ(result.EncodingType(), \"\");\r\n    EXPECT_EQ(result.NextPartNumberMarker(), 5U);\r\n    EXPECT_EQ(result.MaxParts(), 1000U);\r\n    EXPECT_EQ(result.IsTruncated(), false);\r\n    EXPECT_EQ(result.PartList().size(), 3U);\r\n    EXPECT_EQ(result.PartList().begin()->ETag(), \"3349DC700140D7F86A078484278075A9\");\r\n    EXPECT_EQ(result.PartList().begin()->PartNumber(), 1);\r\n    EXPECT_EQ(result.PartList().begin()->LastModified(), \"2012-02-23T07:01:34.000Z\");\r\n    EXPECT_EQ(result.PartList().begin()->Size(), 6291456LL);\r\n\r\n    EXPECT_EQ(result.PartList().rbegin()->ETag(), \"7265F4D211B56873A381D321F586E4A9\");\r\n    EXPECT_EQ(result.PartList().rbegin()->PartNumber(), 5);\r\n    EXPECT_EQ(result.PartList().rbegin()->LastModified(), \"2012-02-23T07:02:03.000Z\");\r\n    EXPECT_EQ(result.PartList().rbegin()->Size(), 1024LL);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListPartsResultEmptyTest)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <ListPartsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                <Bucket></Bucket>\r\n                <Key></Key>\r\n                <UploadId></UploadId>\r\n                <NextPartNumberMarker></NextPartNumberMarker>\r\n                <MaxParts></MaxParts>\r\n                <IsTruncated></IsTruncated>\r\n                <Part>\r\n                    <PartNumber></PartNumber>\r\n                    <LastModified></LastModified>\r\n                    <ETag></ETag>\r\n                    <Size></Size>\r\n                </Part>\r\n                <Part>\r\n                    <PartNumber></PartNumber>\r\n                    <LastModified></LastModified>\r\n                    <ETag></ETag>\r\n                    <Size></Size>\r\n                </Part>\r\n            </ListPartsResult>)\";\r\n    ListPartsResult result(xml);\r\n    EXPECT_EQ(result.Bucket(), \"\");\r\n    EXPECT_EQ(result.Key(), \"\");\r\n    EXPECT_EQ(result.UploadId(), \"\");\r\n    EXPECT_EQ(result.NextPartNumberMarker(), 0UL);\r\n    EXPECT_EQ(result.MaxParts(), 0U);\r\n    EXPECT_EQ(result.IsTruncated(), false);\r\n    EXPECT_EQ(result.PartList().size(), 2U);\r\n    EXPECT_EQ(result.PartList().begin()->ETag(), \"\");\r\n    EXPECT_EQ(result.PartList().begin()->PartNumber(), 0);\r\n    EXPECT_EQ(result.PartList().begin()->LastModified(), \"\");\r\n    EXPECT_EQ(result.PartList().begin()->Size(), 0);\r\n\r\n    EXPECT_EQ(result.PartList().rbegin()->ETag(), \"\");\r\n    EXPECT_EQ(result.PartList().rbegin()->PartNumber(), 0);\r\n    EXPECT_EQ(result.PartList().rbegin()->LastModified(), \"\");\r\n    EXPECT_EQ(result.PartList().rbegin()->Size(), 0);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, MultipartUploadComplexStepTest)\r\n{\r\n    auto sourceFile = TestFile;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadComplexStepTest\");\r\n\r\n    InitiateMultipartUploadRequest imuRequest(BucketName, targetObjectKey);\r\n    auto initOutcome = Client->InitiateMultipartUpload(imuRequest);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(initOutcome.result().RequestId().empty());\r\n\r\n    // Set the part size \r\n    const int partSize = 100 * 1024;\r\n    const int64_t fileLength = GetFileLength(sourceFile);\r\n\r\n    auto partCount = CalculatePartCount(fileLength, partSize);\r\n\r\n    // Create a list to save result \r\n    PartList partETags;\r\n    //upload the file\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(sourceFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(content->good(), true);\r\n    if (content->good())\r\n    {\r\n        for (auto i = 0; i < partCount; i++)\r\n        {\r\n            // Skip to the start position\r\n            int64_t skipBytes = partSize * i;\r\n            int64_t position = skipBytes;\r\n\r\n\r\n            // Create a UploadPartRequest, uploading parts\r\n            content->clear();\r\n            content->seekg(position, content->beg);\r\n            UploadPartRequest request(BucketName, targetObjectKey, content);\r\n            request.setPartNumber(i + 1);\r\n            request.setUploadId(initOutcome.result().UploadId());\r\n            request.setContentLength(partSize);\r\n            auto uploadPartOutcome = Client->UploadPart(request);\r\n            EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n            EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\r\n\r\n            // Save the result\r\n            Part part(i + 1, uploadPartOutcome.result().ETag());\r\n            partETags.push_back(part);\r\n        }\r\n    }\r\n\r\n    auto lmuOutcome = Client->ListMultipartUploads(ListMultipartUploadsRequest(BucketName));\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(lmuOutcome.result().RequestId().empty());\r\n\r\n    std::string uploadId;\r\n\r\n    for (auto const &upload : lmuOutcome.result().MultipartUploadList())\r\n    {\r\n        if (upload.UploadId == initOutcome.result().UploadId())\r\n        {\r\n            uploadId = upload.UploadId;\r\n        }\r\n    }\r\n\r\n    EXPECT_EQ(uploadId.empty(), false);\r\n\r\n    CompleteMultipartUploadRequest completeRequest(BucketName, targetObjectKey, partETags);\r\n    completeRequest.setUploadId(uploadId);\r\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(cOutcome.result().RequestId().empty());\r\n\r\n    auto gOutcome = Client->GetObject(BucketName, targetObjectKey);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().Metadata().ContentLength(), fileLength);\r\n    auto calcMd5 = ComputeContentMD5(*gOutcome.result().Content());\r\n    EXPECT_EQ(calcMd5, TestFileMd5);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, MultipartUploadComplexStepTestWithoutCrc)\r\n{\r\n    ClientConfiguration conf;\r\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n    OssClient *XClient = &client;\r\n\r\n    auto sourceFile = TestFile;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadComplexStepTestWithoutCrc\");\r\n\r\n    InitiateMultipartUploadRequest imuRequest(BucketName, targetObjectKey);\r\n    auto initOutcome = XClient->InitiateMultipartUpload(imuRequest);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n\r\n    // Set the part size \r\n    const int partSize = 100 * 1024;\r\n    const int64_t fileLength = GetFileLength(sourceFile);\r\n\r\n    auto partCount = CalculatePartCount(fileLength, partSize);\r\n\r\n    // Create a list to save result \r\n    PartList partETags;\r\n    //upload the file\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(sourceFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(content->good(), true);\r\n    if (content->good())\r\n    {\r\n        for (auto i = 0; i < partCount; i++)\r\n        {\r\n            // Skip to the start position\r\n            int64_t skipBytes = partSize * i;\r\n            int64_t position = skipBytes;\r\n\r\n\r\n            // Create a UploadPartRequest, uploading parts\r\n            content->clear();\r\n            content->seekg(position, content->beg);\r\n            UploadPartRequest request(BucketName, targetObjectKey, content);\r\n            request.setPartNumber(i + 1);\r\n            request.setUploadId(initOutcome.result().UploadId());\r\n            request.setContentLength(partSize);\r\n            auto uploadPartOutcome = XClient->UploadPart(request);\r\n            EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n\r\n            // Save the result\r\n            Part part(i + 1, uploadPartOutcome.result().ETag());\r\n            partETags.push_back(part);\r\n        }\r\n    }\r\n\r\n    auto lmuOutcome = XClient->ListMultipartUploads(ListMultipartUploadsRequest(BucketName));\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n\r\n    std::string uploadId;\r\n\r\n    for (auto const &upload : lmuOutcome.result().MultipartUploadList())\r\n    {\r\n        if (upload.UploadId == initOutcome.result().UploadId())\r\n        {\r\n            uploadId = upload.UploadId;\r\n        }\r\n    }\r\n\r\n    EXPECT_EQ(uploadId.empty(), false);\r\n\r\n    CompleteMultipartUploadRequest completeRequest(BucketName, targetObjectKey, partETags);\r\n    completeRequest.setUploadId(uploadId);\r\n    auto cOutcome = XClient->CompleteMultipartUpload(completeRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n\r\n\r\n    auto gOutcome = XClient->GetObject(BucketName, targetObjectKey);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().Metadata().ContentLength(), fileLength);\r\n    auto calcMd5 = ComputeContentMD5(*gOutcome.result().Content());\r\n    EXPECT_EQ(calcMd5, TestFileMd5);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, CompleteMultipartUploadWithListParts)\r\n{\r\n    auto sourceFile = TestFile;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"CompleteMultipartUploadWithListParts\");\r\n\r\n    InitiateMultipartUploadRequest imuRequest(BucketName, targetObjectKey);\r\n    auto initOutcome = Client->InitiateMultipartUpload(imuRequest);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n\r\n    // Set the part size \r\n    const int partSize = 100 * 1024;\r\n    const int64_t fileLength = GetFileLength(sourceFile);\r\n\r\n    auto partCount = CalculatePartCount(fileLength, partSize);\r\n\r\n    //upload the file\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(sourceFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(content->good(), true);\r\n    if (content->good())\r\n    {\r\n        for (auto i = 0; i < partCount; i++)\r\n        {\r\n            // Skip to the start position\r\n            int64_t skipBytes = partSize * i;\r\n            int64_t position = skipBytes;\r\n\r\n\r\n            // Create a UploadPartRequest, uploading parts\r\n            content->clear();\r\n            content->seekg(position, content->beg);\r\n            UploadPartRequest request(BucketName, targetObjectKey, content);\r\n            request.setPartNumber(i + 1);\r\n            request.setUploadId(initOutcome.result().UploadId());\r\n            request.setContentLength(partSize);\r\n            auto uploadPartOutcome = Client->UploadPart(request);\r\n            EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n\r\n            // Save the result\r\n            //Part part(i+1, uploadPartOutcome.result().ETag());\r\n        }\r\n    }\r\n\r\n    auto lmuOutcome = Client->ListMultipartUploads(ListMultipartUploadsRequest(BucketName));\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n\r\n    std::string uploadId;\r\n\r\n    for (auto const &upload : lmuOutcome.result().MultipartUploadList())\r\n    {\r\n        if (upload.UploadId == initOutcome.result().UploadId())\r\n        {\r\n            uploadId = upload.UploadId;\r\n        }\r\n    }\r\n    EXPECT_EQ(uploadId.empty(), false);\r\n\r\n    ListPartsRequest listRequest(BucketName, targetObjectKey);\r\n    listRequest.setUploadId(uploadId);\r\n    auto listOutcome = Client->ListParts(listRequest);\r\n    EXPECT_EQ(listOutcome.isSuccess(), true);\r\n\r\n    CompleteMultipartUploadRequest completeRequest(BucketName, targetObjectKey, listOutcome.result().PartList());\r\n    completeRequest.setUploadId(uploadId);\r\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n\r\n    auto gOutcome = Client->GetObject(BucketName, targetObjectKey);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().Metadata().ContentLength(), fileLength);\r\n    auto calcMd5 = ComputeContentMD5(*gOutcome.result().Content());\r\n    EXPECT_EQ(calcMd5, TestFileMd5);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, MultipartUploadAbortInMiddleTest)\r\n{\r\n    auto sourceFile = TestFile;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadAbortInMiddleTest\");\r\n\r\n    InitiateMultipartUploadRequest imuRequest(BucketName, targetObjectKey);\r\n    auto initOutcome = Client->InitiateMultipartUpload(imuRequest);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n\r\n    // Set the part size \r\n    const int partSize = 100 * 1024;;\r\n    const int64_t fileLength = GetFileLength(sourceFile);\r\n\r\n    auto partCount = CalculatePartCount(fileLength, partSize);\r\n\r\n    //upload the file\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(sourceFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(content->good(), true);\r\n    if (content->good())\r\n    {\r\n        for (auto i = 0; i < partCount; i++)\r\n        {\r\n            // Skip to the start position\r\n            int64_t skipBytes = partSize * i;\r\n            int64_t position = skipBytes;\r\n\r\n            // Create a UploadPartRequest, uploading parts\r\n            content->clear();\r\n            content->seekg(position, content->beg);\r\n            UploadPartRequest request(BucketName, targetObjectKey, content);\r\n            request.setPartNumber(i + 1);\r\n            request.setUploadId(initOutcome.result().UploadId());\r\n            request.setContentLength(partSize);\r\n            auto uploadPartOutcome = Client->UploadPart(request);\r\n            EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n\r\n        }\r\n    }\r\n\r\n    auto lmuOutcome = Client->ListMultipartUploads(ListMultipartUploadsRequest(BucketName));\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n\r\n    std::string uploadId;\r\n    for (auto const &upload : lmuOutcome.result().MultipartUploadList())\r\n    {\r\n        if (upload.UploadId == initOutcome.result().UploadId())\r\n        {\r\n            uploadId = upload.UploadId;\r\n        }\r\n    }\r\n    EXPECT_EQ(uploadId.empty(), false);\r\n\r\n    auto abortOutcome = Client->AbortMultipartUpload(AbortMultipartUploadRequest(BucketName, targetObjectKey, uploadId));\r\n    EXPECT_EQ(abortOutcome.isSuccess(), true);\r\n\r\n    abortOutcome = Client->AbortMultipartUpload(AbortMultipartUploadRequest(BucketName, targetObjectKey, uploadId));\r\n    EXPECT_EQ(abortOutcome.isSuccess(), false);\r\n    EXPECT_EQ(abortOutcome.error().Code(), \"NoSuchUpload\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, MultipartUploadPartCopyComplexStepTest)\r\n{\r\n    //put test file\r\n    auto testKey = TestUtils::GetObjectKey(\"MultipartUploadPartCopyComplexStepTest-TestKey\");\r\n    Client->PutObject(BucketName, testKey, TestFile);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, testKey), true);\r\n\r\n    auto sourceFile = TestFile;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadPartCopyComplexStepTest\");\r\n\r\n    InitiateMultipartUploadRequest imuRequest(BucketName, targetObjectKey);\r\n    auto initOutcome = Client->InitiateMultipartUpload(imuRequest);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n\r\n    // Set the part size \r\n    const int partSize = 100 * 1024;\r\n    const int64_t fileLength = GetFileLength(sourceFile);\r\n\r\n    auto partCount = CalculatePartCount(fileLength, partSize);\r\n    for (auto i = 0; i < partCount; i++)\r\n    {\r\n        // Skip to the start position\r\n        int64_t skipBytes = partSize * i;\r\n        int64_t position = skipBytes;\r\n\r\n        // calculate the part size\r\n        auto size = partSize < (fileLength - skipBytes) ? partSize : fileLength - skipBytes;\r\n\r\n        UploadPartCopyRequest request(BucketName, targetObjectKey, BucketName, testKey);\r\n        request.setPartNumber(i + 1);\r\n        request.setUploadId(initOutcome.result().UploadId());\r\n        request.setCopySourceRange(position, position + size - 1);\r\n        auto uploadPartOutcome = Client->UploadPartCopy(request);\r\n        EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n        EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\r\n    }\r\n\r\n    auto lmuOutcome = Client->ListMultipartUploads(ListMultipartUploadsRequest(BucketName));\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n\r\n    std::string uploadId;\r\n\r\n    for (auto const &upload : lmuOutcome.result().MultipartUploadList())\r\n    {\r\n        if (upload.UploadId == initOutcome.result().UploadId())\r\n        {\r\n            uploadId = upload.UploadId;\r\n        }\r\n    }\r\n    EXPECT_EQ(uploadId.empty(), false);\r\n\r\n    ListPartsRequest listRequest(BucketName, targetObjectKey);\r\n    listRequest.setUploadId(uploadId);\r\n    auto listOutcome = Client->ListParts(listRequest);\r\n    EXPECT_EQ(listOutcome.isSuccess(), true);\r\n\r\n    CompleteMultipartUploadRequest completeRequest(BucketName, targetObjectKey, listOutcome.result().PartList());\r\n    completeRequest.setUploadId(uploadId);\r\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n\r\n    auto gOutcome = Client->GetObject(BucketName, targetObjectKey);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().Metadata().ContentLength(), fileLength);\r\n    auto calcMd5 = ComputeContentMD5(*gOutcome.result().Content());\r\n    EXPECT_EQ(calcMd5, TestFileMd5);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, MultipartUploadPartCopyWithSpecialKeyNameTest)\r\n{\r\n    //put test file\r\n    unsigned char buff[] = { 0xE4, 0XB8, 0XAD, 0XE6, 0X96, 0X87, 0XE5, 0X90, 0X8D, 0XE5, 0XAD, 0X97, 0X2B, 0X0 };\r\n    std::string u8_str((char *)buff);\r\n    auto testKey = u8_str;\r\n    Client->PutObject(BucketName, testKey, TestFile);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, testKey), true);\r\n\r\n    auto sourceFile = TestFile;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadPartCopyComplexStepTest\");\r\n\r\n    InitiateMultipartUploadRequest imuRequest(BucketName, targetObjectKey);\r\n    auto initOutcome = Client->InitiateMultipartUpload(imuRequest);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n\r\n    // Set the part size \r\n    const int partSize = 100 * 1024;\r\n    const int64_t fileLength = GetFileLength(sourceFile);\r\n\r\n    auto partCount = CalculatePartCount(fileLength, partSize);\r\n\r\n    //upload the file\r\n    //std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(sourceFile, std::ios::in | std::ios::binary);\r\n    //EXPECT_EQ(content->good(), true);\r\n    //if (content->good())\r\n    {\r\n        for (auto i = 0; i < partCount; i++)\r\n        {\r\n            // Skip to the start position\r\n            int64_t skipBytes = partSize * i;\r\n            int64_t position = skipBytes;\r\n\r\n            // calculate the part size\r\n            auto size = partSize < (fileLength - skipBytes) ? partSize : fileLength - skipBytes;\r\n\r\n            // Create a UploadPartRequest, uploading parts\r\n            //content->clear();\r\n            //content->seekg(position, content->beg);\r\n            UploadPartCopyRequest request(BucketName, targetObjectKey, BucketName, testKey);\r\n            request.setPartNumber(i + 1);\r\n            request.setUploadId(initOutcome.result().UploadId());\r\n            request.setCopySourceRange(position, position + size - 1);\r\n            auto uploadPartOutcome = Client->UploadPartCopy(request);\r\n            EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n        }\r\n    }\r\n\r\n    auto lmuOutcome = Client->ListMultipartUploads(ListMultipartUploadsRequest(BucketName));\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n\r\n    std::string uploadId;\r\n\r\n    for (auto const &upload : lmuOutcome.result().MultipartUploadList())\r\n    {\r\n        if (upload.UploadId == initOutcome.result().UploadId())\r\n        {\r\n            uploadId = upload.UploadId;\r\n        }\r\n    }\r\n    EXPECT_EQ(uploadId.empty(), false);\r\n\r\n    ListPartsRequest listRequest(BucketName, targetObjectKey);\r\n    listRequest.setUploadId(uploadId);\r\n    auto listOutcome = Client->ListParts(listRequest);\r\n    EXPECT_EQ(listOutcome.isSuccess(), true);\r\n\r\n    CompleteMultipartUploadRequest completeRequest(BucketName, targetObjectKey, listOutcome.result().PartList());\r\n    completeRequest.setUploadId(uploadId);\r\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n\r\n    auto gOutcome = Client->GetObject(BucketName, targetObjectKey);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().Metadata().ContentLength(), fileLength);\r\n    auto calcMd5 = ComputeContentMD5(*gOutcome.result().Content());\r\n    EXPECT_EQ(calcMd5, TestFileMd5);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UploadPartCopyWithSourceIfMatchTest)\r\n{\r\n    std::string sourceKey = TestUtils::GetObjectKey(\"upload-part-copy-object-source\");\r\n    std::string targetKey = TestUtils::GetObjectKey(\"upload-part-copy-object-target\");\r\n\r\n    // put the source obj\r\n    auto putObjectContent = TestUtils::GetRandomStream(102400);\r\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\r\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\r\n    std::string eTag = putObjectOutcome.result().ETag();\r\n\r\n    // apply upload id\r\n    auto uploadPartCopyInitOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, targetKey));\r\n    EXPECT_EQ(uploadPartCopyInitOutcome.isSuccess(), true);\r\n    auto uploadId = uploadPartCopyInitOutcome.result().UploadId();\r\n\r\n    {\r\n        UploadPartCopyRequest request(BucketName, targetKey);\r\n        request.SetCopySource(BucketName, sourceKey);\r\n        request.setUploadId(uploadId);\r\n        request.setPartNumber(1);\r\n        request.SetSourceIfMatchETag(\"ErrorETag\");\r\n        auto outcome = Client->UploadPartCopy(request);\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        // http status code : 412\r\n        EXPECT_EQ(outcome.error().Code(), \"PreconditionFailed\");\r\n    }\r\n\r\n    // success upload part copy with the real ETag\r\n    UploadPartCopyRequest request(BucketName, targetKey);\r\n    request.SetCopySource(BucketName, sourceKey);\r\n    request.setUploadId(uploadId);\r\n    request.setPartNumber(1);\r\n    request.SetSourceIfMatchETag(eTag);\r\n    auto outcome = Client->UploadPartCopy(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UploadPartCopyWithSourceIfNoneMatchTest)\r\n{\r\n    std::string sourceKey = TestUtils::GetObjectKey(\"upload-part-copy-object-source\");\r\n    std::string targetKey = TestUtils::GetObjectKey(\"upload-part-copy-object-target\");\r\n\r\n    // put the source obj\r\n    auto putObjectContent = TestUtils::GetRandomStream(102400);\r\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\r\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\r\n    std::string eTag = putObjectOutcome.result().ETag();\r\n\r\n    // apply upload id\r\n    auto uploadPartCopyInitOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, targetKey));\r\n    EXPECT_EQ(uploadPartCopyInitOutcome.isSuccess(), true);\r\n    auto uploadId = uploadPartCopyInitOutcome.result().UploadId();\r\n\r\n    {\r\n        UploadPartCopyRequest request(BucketName, targetKey);\r\n        request.SetCopySource(BucketName, sourceKey);\r\n        request.setUploadId(uploadId);\r\n        request.setPartNumber(1);\r\n        request.SetSourceIfNotMatchETag(eTag);\r\n        auto outcome = Client->UploadPartCopy(request);\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        EXPECT_EQ(outcome.error().Code(), \"ServerError:304\");\r\n    }\r\n\r\n    // success upload part copy with the real ETag\r\n    UploadPartCopyRequest request(BucketName, targetKey);\r\n    request.SetCopySource(BucketName, sourceKey);\r\n    request.setUploadId(uploadId);\r\n    request.setPartNumber(1);\r\n    request.SetSourceIfNotMatchETag(\"ErrorETag\");\r\n    auto outcome = Client->UploadPartCopy(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UploadPartCopyWithIfUnmodifiedSinceTest)\r\n{\r\n    std::string sourceKey = TestUtils::GetObjectKey(\"upload-part-copy-object-source\");\r\n    std::string targetKey = TestUtils::GetObjectKey(\"upload-part-copy-object-target\");\r\n\r\n    // put the source obj\r\n    auto putObjectContent = TestUtils::GetRandomStream(102400);\r\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\r\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\r\n    std::string eTag = putObjectOutcome.result().ETag();\r\n\r\n    // apply upload id\r\n    auto uploadPartCopyInitOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, targetKey));\r\n    EXPECT_EQ(uploadPartCopyInitOutcome.isSuccess(), true);\r\n    auto uploadId = uploadPartCopyInitOutcome.result().UploadId();\r\n\r\n    std::string beforeChangeTime = TestUtils::GetGMTString(-100);\r\n    std::string afterChangeTime = TestUtils::GetGMTString(100);\r\n\r\n    // the target time before the last modified time of sourceObj\r\n    {\r\n        UploadPartCopyRequest request(BucketName, targetKey);\r\n        request.SetCopySource(BucketName, sourceKey);\r\n        request.setUploadId(uploadId);\r\n        request.setPartNumber(1);\r\n        request.SetSourceIfUnModifiedSince(beforeChangeTime);\r\n        auto outcome = Client->UploadPartCopy(request);\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        // http status code : 412\r\n        EXPECT_EQ(outcome.error().Code(), \"PreconditionFailed\");\r\n    }\r\n\r\n    // the target time equals the last modified time of sourceObj\r\n    {\r\n        auto objectMetaOutcome = Client->GetObjectMeta(BucketName, sourceKey);\r\n        EXPECT_EQ(objectMetaOutcome.isSuccess(), true);\r\n\r\n        UploadPartCopyRequest request(BucketName, targetKey);\r\n        request.SetCopySource(BucketName, sourceKey);\r\n        request.setUploadId(uploadId);\r\n        request.setPartNumber(1);\r\n        request.SetSourceIfUnModifiedSince(objectMetaOutcome.result().LastModified());\r\n        auto outcome = Client->UploadPartCopy(request);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    // the target time after the last modified time of sourceObj\r\n    UploadPartCopyRequest request(BucketName, targetKey);\r\n    request.SetCopySource(BucketName, sourceKey);\r\n    request.setUploadId(uploadId);\r\n    request.setPartNumber(1);\r\n    request.SetSourceIfUnModifiedSince(afterChangeTime);\r\n    auto outcome = Client->UploadPartCopy(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UploadPartCopyWithIfModifiedSinceTest)\r\n{\r\n    std::string sourceKey = TestUtils::GetObjectKey(\"upload-part-copy-object-source\");\r\n    std::string targetKey = TestUtils::GetObjectKey(\"upload-part-copy-object-target\");\r\n\r\n    // put the source obj\r\n    auto putObjectContent = TestUtils::GetRandomStream(102400);\r\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\r\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\r\n\r\n    // apply upload id\r\n    auto uploadPartCopyInitOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, targetKey));\r\n    EXPECT_EQ(uploadPartCopyInitOutcome.isSuccess(), true);\r\n    auto uploadId = uploadPartCopyInitOutcome.result().UploadId();\r\n\r\n    // time\r\n    std::string beforeChangeTime = TestUtils::GetGMTString(-100);\r\n    std::string afterChangeTime = TestUtils::GetGMTString(100);\r\n\r\n    {\r\n        UploadPartCopyRequest request(BucketName, targetKey);\r\n        request.SetCopySource(BucketName, sourceKey);\r\n        request.setUploadId(uploadId);\r\n        request.setPartNumber(1);\r\n        request.SetSourceIfModifiedSince(beforeChangeTime);\r\n        auto outcome = Client->UploadPartCopy(request);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    {\r\n        UploadPartCopyRequest request(BucketName, targetKey);\r\n        request.SetCopySource(BucketName, sourceKey);\r\n        request.setUploadId(uploadId);\r\n        request.setPartNumber(1);\r\n        request.SetSourceIfModifiedSince(afterChangeTime);\r\n        auto outcome = Client->UploadPartCopy(request);\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        EXPECT_EQ(outcome.error().Code(), \"ServerError:304\");\r\n    }\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UnormalUploadPartCopyTest)\r\n{\r\n    std::string sourceBucket = TestUtils::GetBucketName(\"unormal-upload-part-copy-bucket-source\");\r\n    std::string targetBucket = TestUtils::GetBucketName(\"unormal-upload-part-copy-bucket-target\");\r\n    std::string sourceKey = TestUtils::GetObjectKey(\"unormal-upload-part-copy-object-source\");\r\n    std::string targetKey = TestUtils::GetObjectKey(\"unormal-upload-part-copy-object-target\");\r\n    // Set length of parts less than minimum limit(100KB)\r\n\r\n    EXPECT_EQ(Client->CreateBucket(sourceBucket).isSuccess(), true);\r\n    EXPECT_EQ(Client->CreateBucket(targetBucket).isSuccess(), true);\r\n\r\n    // put object into source bucket\r\n    auto putObjectContent = TestUtils::GetRandomStream(102400);\r\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(sourceBucket, sourceKey, putObjectContent));\r\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\r\n    std::string eTag = putObjectOutcome.result().ETag();\r\n\r\n    // apply upload id for target bucket\r\n    auto uploadPartCopyInitOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(targetBucket, targetKey));\r\n    EXPECT_EQ(uploadPartCopyInitOutcome.isSuccess(), true);\r\n    auto uploadId = uploadPartCopyInitOutcome.result().UploadId();\r\n\r\n    // Copy part to non-existent target bucket\r\n    {\r\n        std::string nonexistentTargetBucket = TestUtils::GetBucketName(\"nonexistent-target-key\");\r\n        UploadPartCopyRequest request(nonexistentTargetBucket, targetKey);\r\n        request.SetCopySource(sourceBucket, sourceKey);\r\n        request.setUploadId(uploadId);\r\n        request.setPartNumber(1);\r\n        auto outcome = Client->UploadPartCopy(request);\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\r\n    }\r\n\r\n    // Copy part from non-existent source bucket\r\n    {\r\n        std::string nonexistentSourceBucket = TestUtils::GetBucketName(\"nonexistent-source-bucket\");\r\n        UploadPartCopyRequest request(targetBucket, targetKey, nonexistentSourceBucket, sourceKey, uploadId, 1);\r\n        auto outcome = Client->UploadPartCopy(request);\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\r\n    }\r\n\r\n    // Copy part with non-existent source key\r\n    {\r\n        std::string nonexistentSourceKey = \"nonexistent-source-key\";\r\n        UploadPartCopyRequest request(targetBucket, targetKey, sourceBucket, nonexistentSourceKey, uploadId, 1);\r\n        auto outcome = Client->UploadPartCopy(request);\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        EXPECT_EQ(outcome.error().Code(), \"NoSuchKey\");\r\n    }\r\n\r\n    // Copy part with non-existent upload id\r\n    {\r\n        auto outcome = Client->UploadPartCopy(UploadPartCopyRequest(targetBucket, targetKey,\r\n            sourceBucket, sourceKey, \"id\", 1));\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        EXPECT_EQ(outcome.error().Code(), \"NoSuchUpload\");\r\n    }\r\n\r\n    // Upload part copy\r\n    PartList partETags;\r\n    auto firstUploadOutcome = Client->UploadPartCopy(UploadPartCopyRequest(targetBucket, targetKey,\r\n        sourceBucket, sourceKey, uploadId, 1));\r\n    EXPECT_EQ(firstUploadOutcome.isSuccess(), true);\r\n    // EXPECT_EQ(firstUploadOutcome.result().ETag(), eTag);\r\n    // partETags.push_back(Part(1, firstUploadOutcome.result().ETag()));\r\n\r\n    auto secondUploadOutcome = Client->UploadPartCopy(UploadPartCopyRequest(targetBucket, targetKey,\r\n        sourceBucket, sourceKey, uploadId, 2));\r\n    EXPECT_EQ(secondUploadOutcome.isSuccess(), true);\r\n    // EXPECT_EQ(secondUploadOutcome.result().ETag(), eTag);\r\n    // partETags.push_back(Part(2, secondUploadOutcome.result().ETag()));\r\n\r\n    auto partListOutcome = Client->ListParts(ListPartsRequest(targetBucket, targetKey, uploadId));\r\n    EXPECT_EQ(partListOutcome.isSuccess(), true);\r\n    EXPECT_EQ(partListOutcome.result().PartList().size(), 2U);\r\n\r\n    // Try to complete multipart upload with all uploaded parts\r\n    CompleteMultipartUploadRequest request(targetBucket, targetKey, partListOutcome.result().PartList(), uploadId);\r\n    auto completeOutcome = Client->CompleteMultipartUpload(request);\r\n    EXPECT_EQ(completeOutcome.isSuccess(), true);\r\n\r\n    // get the source object\r\n    EXPECT_EQ(Client->DoesObjectExist(targetBucket, targetKey), true);\r\n\r\n    // delete source bucket and target bucket\r\n    EXPECT_EQ(Client->DeleteObject(sourceBucket, sourceKey).isSuccess(), true);\r\n    EXPECT_EQ(Client->DeleteObject(targetBucket, targetKey).isSuccess(), true);\r\n    EXPECT_EQ(Client->DeleteBucket(sourceBucket).isSuccess(), true);\r\n    EXPECT_EQ(Client->DeleteBucket(targetBucket).isSuccess(), true);\r\n}\r\n\r\n\r\nTEST_F(MultipartUploadTest, ListMultipartUploadsTest)\r\n{\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"ListMultipartUploadsTest\");\r\n\r\n    for (size_t i = 0; i < 20; i++) {\r\n        auto key = targetObjectKey;\r\n        key.append(\"-\").append(std::to_string(i));\r\n        InitiateMultipartUploadRequest request(BucketName, key);\r\n        auto initOutcome = Client->InitiateMultipartUpload(request);\r\n        EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    }\r\n\r\n    auto lmuOutcome = Client->ListMultipartUploads(ListMultipartUploadsRequest(BucketName));\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(lmuOutcome.result().MultipartUploadList().size() >= 20UL);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListMultipartUploadsByPrefixTest)\r\n{\r\n    const size_t TestLoop = 10;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"ListMultipartUploadsByPrefixTest\");\r\n\r\n    for (size_t i = 0; i < TestLoop; i++) {\r\n        auto key = targetObjectKey;\r\n        key.append(\"-\").append(std::to_string(i));\r\n        InitiateMultipartUploadRequest request(BucketName, key);\r\n        auto initOutcome = Client->InitiateMultipartUpload(request);\r\n        EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    }\r\n\r\n    auto lmuOutcome = Client->ListMultipartUploads(ListMultipartUploadsRequest(BucketName));\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(lmuOutcome.result().MultipartUploadList().size() >= TestLoop);\r\n\r\n    ListMultipartUploadsRequest request(BucketName);\r\n    request.setPrefix(\"ListMultipartUploadsByPrefixTest\");\r\n    request.setMaxUploads(1U);\r\n    size_t cnt = 0;\r\n    do {\r\n        lmuOutcome = Client->ListMultipartUploads(request);\r\n        EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n        EXPECT_EQ(lmuOutcome.result().MultipartUploadList().size(), 1U);\r\n        request.setKeyMarker(lmuOutcome.result().NextKeyMarker());\r\n        request.setUploadIdMarker(lmuOutcome.result().NextUploadIdMarker());\r\n        cnt++;\r\n    } while (lmuOutcome.result().IsTruncated());\r\n\r\n    EXPECT_EQ(cnt, TestLoop);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListMultipartUploadsByPrefixAndKeyMarkerTest)\r\n{\r\n    const size_t TestLoop = 10;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"ListMultipartUploadsByPrefixAndKeyMarkerTest\");\r\n\r\n    for (size_t i = 0; i < TestLoop; i++) {\r\n        auto key = targetObjectKey;\r\n        key.append(\"-\").append(std::to_string(i));\r\n        InitiateMultipartUploadRequest request(BucketName, key);\r\n        auto initOutcome = Client->InitiateMultipartUpload(request);\r\n        EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    }\r\n\r\n    auto index = TestLoop / 2;\r\n    auto keyMarker = targetObjectKey.append(\"-\").append(std::to_string(index));\r\n    index = TestLoop - index - 1;\r\n    ListMultipartUploadsRequest request(BucketName);\r\n    request.setPrefix(\"ListMultipartUploadsByPrefixAndKeyMarkerTest\");\r\n    request.setMaxUploads(TestLoop);\r\n    request.setKeyMarker(keyMarker);\r\n    auto lmuOutcome = Client->ListMultipartUploads(request);\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lmuOutcome.result().MultipartUploadList().size(), index);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListMultipartUploadsByPrefixWithEncodingTypeTest)\r\n{\r\n    const size_t TestLoop = 5;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"ListMultipartUploadsWithEncodingTypeTest\");\r\n    targetObjectKey.push_back(0x1c); targetObjectKey.push_back(0x1a);\r\n\r\n    for (size_t i = 0; i < TestLoop; i++) {\r\n        auto key = targetObjectKey;\r\n        key.append(\"-\").append(std::to_string(i));\r\n        InitiateMultipartUploadRequest request(BucketName, key);\r\n        auto initOutcome = Client->InitiateMultipartUpload(request);\r\n        EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    }\r\n\r\n    ListMultipartUploadsRequest request(BucketName);\r\n    request.setPrefix(targetObjectKey);\r\n    request.setEncodingType(\"url\");\r\n    request.setMaxUploads(1U);\r\n    auto lmuOutcome = Client->ListMultipartUploads(request);\r\n    size_t cnt = 0;\r\n    do {\r\n        lmuOutcome = Client->ListMultipartUploads(request);\r\n        EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n        EXPECT_EQ(lmuOutcome.result().MultipartUploadList().size(), 1U);\r\n        EXPECT_EQ(lmuOutcome.result().NextKeyMarker().compare(0, targetObjectKey.size(), targetObjectKey), 0);\r\n        EXPECT_EQ(lmuOutcome.result().MultipartUploadList().begin()->Key.compare(0, targetObjectKey.size(), targetObjectKey), 0);\r\n        request.setKeyMarker(lmuOutcome.result().NextKeyMarker());\r\n        request.setUploadIdMarker(lmuOutcome.result().NextUploadIdMarker());\r\n        cnt++;\r\n    } while (lmuOutcome.result().IsTruncated());\r\n\r\n    EXPECT_EQ(cnt, TestLoop);\r\n\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListMultipartUploadsWithDelimiterTest)\r\n{\r\n    const size_t TestLoop = 10;\r\n    std::vector<std::string> commonPrefixs;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"ListMultipartUploadsWithDelimiterTest\");\r\n\r\n    for (size_t i = 0; i < TestLoop; i++) {\r\n        auto key = targetObjectKey;\r\n        key.append(\"/\").append(\"-\").append(std::to_string(i));\r\n        InitiateMultipartUploadRequest request(BucketName, key);\r\n        auto initOutcome = Client->InitiateMultipartUpload(request);\r\n        EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    }\r\n    targetObjectKey.append(\"/\");\r\n    commonPrefixs.push_back(targetObjectKey);\r\n\r\n    targetObjectKey = TestUtils::GetObjectKey(\"ListMultipartUploadsWithDelimiterTest\");\r\n    for (size_t i = 0; i < TestLoop; i++) {\r\n        auto key = targetObjectKey;\r\n        key.append(\"/\").append(\"-\").append(std::to_string(i));\r\n        InitiateMultipartUploadRequest request(BucketName, key);\r\n        auto initOutcome = Client->InitiateMultipartUpload(request);\r\n        EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    }\r\n    targetObjectKey.append(\"/\");\r\n    commonPrefixs.push_back(targetObjectKey);\r\n\r\n    ListMultipartUploadsRequest request(BucketName);\r\n    request.setPrefix(\"ListMultipartUploadsWithDelimiterTest\");\r\n    request.setDelimiter(\"/\");\r\n    auto lmuOutcome = Client->ListMultipartUploads(request);\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lmuOutcome.result().CommonPrefixes().size(), 2U);\r\n    size_t index = 0;\r\n    auto first = commonPrefixs.begin();\r\n    for (auto const &prefix : lmuOutcome.result().CommonPrefixes()) {\r\n        EXPECT_EQ(prefix, *first);\r\n        first++;\r\n        index++;\r\n    }\r\n    EXPECT_EQ(index, 2U);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListMultipartUploadsWithDelimiterAndEncodingTypeTest)\r\n{\r\n    const size_t TestLoop = 5;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"ListMultipartUploadsWithDelimiterAndEncodingTypeTest\");\r\n    targetObjectKey.push_back(0x1c); targetObjectKey.push_back(0x1a);\r\n\r\n    for (size_t i = 0; i < TestLoop; i++) {\r\n        auto key = targetObjectKey;\r\n        key.append(\"/-\").append(std::to_string(i));\r\n        InitiateMultipartUploadRequest request(BucketName, key);\r\n        auto initOutcome = Client->InitiateMultipartUpload(request);\r\n        EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    }\r\n\r\n    auto commonKey = targetObjectKey;\r\n    commonKey.append(\"/\");\r\n    ListMultipartUploadsRequest request(BucketName);\r\n    request.setPrefix(targetObjectKey);\r\n    request.setEncodingType(\"url\");\r\n    request.setDelimiter(\"/\");\r\n    auto lmuOutcome = Client->ListMultipartUploads(request);\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lmuOutcome.result().CommonPrefixes().size(), 1U);\r\n    EXPECT_EQ(*lmuOutcome.result().CommonPrefixes().begin(), commonKey);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListMultipartUploadsWithMuiltiUploadForSameKeyTest)\r\n{\r\n    const size_t TestLoop = 10;\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"ListMultipartUploadsWithMuiltiUploadForSameKeyTest\");\r\n\r\n    for (size_t i = 0; i < TestLoop; i++) {\r\n        auto key = targetObjectKey;\r\n        key.append(\"-\").append(std::to_string(i));\r\n        InitiateMultipartUploadRequest request(BucketName, key);\r\n        auto initOutcome = Client->InitiateMultipartUpload(request);\r\n        EXPECT_EQ(initOutcome.isSuccess(), true);\r\n\r\n        initOutcome = Client->InitiateMultipartUpload(request);\r\n        EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    }\r\n    ListMultipartUploadsRequest request(BucketName);\r\n    request.setPrefix(\"ListMultipartUploadsWithMuiltiUploadForSameKeyTest\");\r\n    auto lmuOutcome = Client->ListMultipartUploads(request);\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lmuOutcome.result().MultipartUploadList().size(), 2 * TestLoop);\r\n\r\n    auto prefixKey = targetObjectKey;\r\n    prefixKey.append(\"-0\");\r\n    request.setPrefix(prefixKey);\r\n    lmuOutcome = Client->ListMultipartUploads(request);\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lmuOutcome.result().MultipartUploadList().size(), 2UL);\r\n    for (auto const &upload : lmuOutcome.result().MultipartUploadList()) {\r\n        EXPECT_EQ(upload.Key, prefixKey);\r\n    }\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListMultipartUploadsNegativeTest)\r\n{\r\n    //get target object name\r\n    auto bucket = TestUtils::GetBucketName(\"cpp-sdk-multipartuploadtest\");\r\n\r\n    ListMultipartUploadsRequest request(bucket);\r\n    auto outcome = Client->ListMultipartUploads(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListPartsTest)\r\n{\r\n    const size_t TestLoop = 10;\r\n    //get target object name\r\n    auto key = TestUtils::GetObjectKey(\"ListPartsTest\");\r\n    InitiateMultipartUploadRequest imuRequest(BucketName, key);\r\n    auto initOutcome = Client->InitiateMultipartUpload(imuRequest);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n\r\n\r\n    for (int i = 0; i < static_cast<int>(TestLoop); i++) {\r\n        std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(100 * 1024 + i);\r\n        UploadPartRequest request(BucketName, key, content);\r\n        request.setPartNumber(i + 1);\r\n        request.setUploadId(initOutcome.result().UploadId());\r\n        auto uploadPartOutcome = Client->UploadPart(request);\r\n        EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n    }\r\n\r\n    ListPartsRequest listRequest(BucketName, key, initOutcome.result().UploadId());\r\n    auto outcome = Client->ListParts(listRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().PartList().size(), TestLoop);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListPartsSetpTest)\r\n{\r\n    const size_t TestLoop = 10;\r\n    //get target object name\r\n    auto key = TestUtils::GetObjectKey(\"ListPartsSetpTest\");\r\n    InitiateMultipartUploadRequest imuRequest(BucketName, key);\r\n    auto initOutcome = Client->InitiateMultipartUpload(imuRequest);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n\r\n\r\n    for (int i = 0; i < static_cast<int>(TestLoop); i++) {\r\n        std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(100 * 1024 + i);\r\n        UploadPartRequest request(BucketName, key, content);\r\n        request.setPartNumber(i + 1);\r\n        request.setUploadId(initOutcome.result().UploadId());\r\n        auto uploadPartOutcome = Client->UploadPart(request);\r\n        EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n    }\r\n\r\n    ListPartsRequest listRequest(BucketName, key, initOutcome.result().UploadId());\r\n    listRequest.setMaxParts(1);\r\n    auto outcome = Client->ListParts(listRequest);\r\n    size_t cnt = 0;\r\n    do {\r\n        outcome = Client->ListParts(listRequest);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        EXPECT_EQ(outcome.result().PartList().size(), 1U);\r\n        EXPECT_EQ(outcome.result().PartNumberMarker(), cnt);\r\n        listRequest.setPartNumberMarker(outcome.result().NextPartNumberMarker());\r\n        cnt++;\r\n    } while (outcome.result().IsTruncated());\r\n\r\n    EXPECT_EQ(cnt, TestLoop);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListPartsSetpUseEncodingTypeTest)\r\n{\r\n    const size_t TestLoop = 5;\r\n    //get target object name\r\n    auto key = TestUtils::GetObjectKey(\"ListPartsSetpUseEncodingTypeTest\");\r\n    key.push_back(0x1c); key.push_back(0x1a); key.append(\".1.cd\");\r\n\r\n    InitiateMultipartUploadRequest imuRequest(BucketName, key);\r\n    auto initOutcome = Client->InitiateMultipartUpload(imuRequest);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n\r\n    for (int i = 0; i < static_cast<int>(TestLoop); i++) {\r\n        std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(100 * 1024 + i);\r\n        UploadPartRequest request(BucketName, key, content);\r\n        request.setPartNumber(i + 1);\r\n        request.setUploadId(initOutcome.result().UploadId());\r\n        auto uploadPartOutcome = Client->UploadPart(request);\r\n        EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n    }\r\n\r\n    ListPartsRequest listRequest(BucketName, key, initOutcome.result().UploadId());\r\n    listRequest.setMaxParts(1U);\r\n    listRequest.setEncodingType(\"url\");\r\n    auto outcome = Client->ListParts(listRequest);\r\n    size_t cnt = 0;\r\n    do {\r\n        outcome = Client->ListParts(listRequest);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        EXPECT_EQ(outcome.result().PartList().size(), 1U);\r\n        EXPECT_EQ(outcome.result().Key(), key);\r\n        EXPECT_EQ(outcome.result().MaxParts(), 1U);\r\n        listRequest.setPartNumberMarker(outcome.result().NextPartNumberMarker());\r\n        cnt++;\r\n    } while (outcome.result().IsTruncated());\r\n\r\n    EXPECT_EQ(cnt, TestLoop);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListPartsNegativeTest)\r\n{\r\n    //get target object name\r\n    auto key = TestUtils::GetObjectKey(\"ListPartsNegativeTest\");\r\n\r\n    ListPartsRequest listRequest(BucketName, key, \"asdadf\");\r\n    listRequest.setMaxParts(1U);\r\n    auto outcome = Client->ListParts(listRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchUpload\");\r\n}\r\n\r\nTEST_F(MultipartUploadTest, MultipartUploadWithInvalidResponseBodyTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"MultipartUploadWithInvalidResponseBodyTest\");\r\n\r\n    //test init\r\n    InitiateMultipartUploadRequest imuRequest(BucketName, key);\r\n    imuRequest.setResponseStreamFactory([=]() {\r\n        auto content = std::make_shared<std::stringstream>();\r\n        content->write(\"invlid data\", 11);\r\n        return content;\r\n    });\r\n    auto initOutcome = Client->InitiateMultipartUpload(imuRequest);\r\n    EXPECT_EQ(initOutcome.isSuccess(), false);\r\n    EXPECT_EQ(initOutcome.error().Code(), \"InitiateMultipartUploadError\");\r\n\r\n    InitiateMultipartUploadRequest request(BucketName, key);\r\n    initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n\r\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(100);\r\n    UploadPartRequest upRequest(BucketName, key, content);\r\n    upRequest.setPartNumber(1);\r\n    upRequest.setUploadId(initOutcome.result().UploadId());\r\n    auto uploadPartOutcome = Client->UploadPart(upRequest);\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n\r\n    //test listParts\r\n    ListPartsRequest listRequest(BucketName, key, initOutcome.result().UploadId());\r\n    listRequest.setResponseStreamFactory([=]() {\r\n        auto data = std::make_shared<std::stringstream>();\r\n        data->write(\"invlid data\", 11);\r\n        return data;\r\n    });\r\n    auto listOutcome = Client->ListParts(listRequest);\r\n    EXPECT_EQ(listOutcome.isSuccess(), false);\r\n    EXPECT_EQ(listOutcome.error().Code(), \"ListParts\");\r\n\r\n    //test listUploads\r\n    ListMultipartUploadsRequest lmuRequest(BucketName);\r\n    lmuRequest.setResponseStreamFactory([=]() {\r\n        auto data = std::make_shared<std::stringstream>();\r\n        data->write(\"invlid data\", 11);\r\n        return data;\r\n    });\r\n    auto lmuOutcome = Client->ListMultipartUploads(lmuRequest);\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), false);\r\n    EXPECT_EQ(lmuOutcome.error().Code(), \"ListMultipartUploads\");\r\n\r\n    //test compelete\r\n    PartList partList;\r\n    Part part(1, uploadPartOutcome.result().ETag());\r\n    partList.push_back(part);\r\n\r\n    CompleteMultipartUploadRequest completeRequest(BucketName, key);\r\n    completeRequest.setPartList(partList);\r\n    completeRequest.setUploadId(initOutcome.result().UploadId());\r\n    completeRequest.setResponseStreamFactory([=]() {\r\n        auto data = std::make_shared<std::stringstream>();\r\n        data->write(\"invlid data\", 11);\r\n        return data;\r\n    });\r\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), false);\r\n    EXPECT_EQ(cOutcome.error().Code(), \"CompleteMultipartUpload\");\r\n\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UploadPartCopyRequestValidateNegativeTest)\r\n{\r\n    UploadPartCopyRequest request1(\"INVALIDNAME\", \"test1\", BucketName, \"test2\");\r\n\r\n    auto uploadPartOutcome = Client->UploadPartCopy(request1);\r\n\r\n    \r\n    UploadPartCopyRequest request2(BucketName, \"test1\", \"INVALIDNAME\", \"test2\");\r\n\r\n   uploadPartOutcome = Client->UploadPartCopy(request2);\r\n\r\n   UploadPartCopyRequest request3(BucketName, \"test1\", BucketName, \"/invalidkey\");\r\n\r\n   uploadPartOutcome = Client->UploadPartCopy(request3);\r\n\r\n   CompleteMultipartUploadRequest request4(BucketName, \"test1\");\r\n   std::string str;\r\n   request4.setCallback(str, \"test\");\r\n\r\n   std::string text = \"hellowworld\";\r\n   HeaderCollection header;\r\n   CompleteMultipartUploadResult result(std::make_shared<std::stringstream>(text), header);\r\n\r\n   CompleteMultipartUploadResult result1(\"test\");\r\n\r\n   std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <CompleteMultipartUpload xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                        </CompleteMultipartUpload>)\";\r\n   CompleteMultipartUploadResult result2(xml);\r\n\r\n   xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <CompleteMultipartUploadResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n\r\n                        </CompleteMultipartUploadResult>)\";\r\n   CompleteMultipartUploadResult result3(xml);\r\n\r\n   xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\r\n   CompleteMultipartUploadResult result4(xml);\r\n\r\n}\r\n\r\nTEST_F(MultipartUploadTest, InitiateMultipartUploadResultBranchTest)\r\n{\r\n    InitiateMultipartUploadResult result(\"test\");\r\n\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <InitiateMultipartUpload xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            <Bucket>multipart_upload</Bucket>\r\n                            <Key>multipart.data</Key>\r\n                            <UploadId>0004B9894A22E5B1888A1E29F8236E2D</UploadId>\r\n                        </InitiateMultipartUpload>)\";\r\n    InitiateMultipartUploadResult result1(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <InitiateMultipartUploadResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n\r\n                        </InitiateMultipartUploadResult>)\";\r\n    InitiateMultipartUploadResult result2(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <InitiateMultipartUploadResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            <Bucket></Bucket>\r\n                            <Key></Key>\r\n                            <UploadId></UploadId>\r\n                        </InitiateMultipartUploadResult>)\";\r\n    InitiateMultipartUploadResult result3(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\r\n    InitiateMultipartUploadResult result4(xml);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListMultipartUploadsResultBranchTest)\r\n{\r\n    ListMultipartUploadsResult result(\"test\");\r\n\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListMultipartUploads xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n\r\n                        </ListMultipartUploads>)\";\r\n    ListMultipartUploadsResult result1(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListMultipartUploadsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            \r\n                        </ListMultipartUploadsResult>)\";\r\n    ListMultipartUploadsResult result2(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListMultipartUploadsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n           \r\n                            <Upload>\r\n\r\n                            </Upload>\r\n\r\n                        </ListMultipartUploadsResult>)\";\r\n    ListMultipartUploadsResult result3(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListMultipartUploadsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            <EncodingType></EncodingType>\r\n\r\n                            <Upload>\r\n\r\n                            </Upload>\r\n\r\n                        </ListMultipartUploadsResult>)\";\r\n    ListMultipartUploadsResult result4(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\r\n    ListMultipartUploadsResult result5(xml);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, ListPartsResultBranchTest)\r\n{\r\n    ListPartsResult result(\"test\");\r\n\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <ListPart sxmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n\r\n            </ListParts>)\";\r\n    ListPartsResult result1(xml);\r\n    \r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <ListPartsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n               \r\n            </ListPartsResult>)\";\r\n    ListPartsResult result2(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <ListPartsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                <Part>\r\n                </Part>\r\n            </ListPartsResult>)\";\r\n    ListPartsResult result3(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <ListPartsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                <Bucket></Bucket>\r\n                <Key></Key>\r\n                <UploadId></UploadId>\r\n                <NextPartNumberMarker></NextPartNumberMarker>\r\n                <MaxParts></MaxParts>\r\n                <IsTruncated></IsTruncated>\r\n                <PartNumberMarker></PartNumberMarker>\r\n                <EncodingType></EncodingType>\r\n                <Part>\r\n                    <PartNumber></PartNumber>\r\n                    <LastModified></LastModified>\r\n                    <ETag></ETag>\r\n                    <Size></Size>\r\n                </Part>\r\n                <Part>\r\n                    <PartNumber></PartNumber>\r\n                    <LastModified></LastModified>\r\n                    <ETag></ETag>\r\n                    <Size></Size>\r\n                    <HashCrc64ecma></HashCrc64ecma>\r\n                </Part>\r\n                <Part>\r\n                    <PartNumber></PartNumber>\r\n                    <LastModified></LastModified>\r\n                    <ETag></ETag>\r\n                    <Size></Size>\r\n                </Part>\r\n            </ListPartsResult>)\";\r\n    ListPartsResult result4(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\r\n    ListPartsResult result5(xml);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, UploadPartCopyResultBranchTest)\r\n{\r\n    HeaderCollection header;\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\r\n    *content << \"test\";\r\n    UploadPartCopyResult  result1(content, header);\r\n\r\n    UploadPartCopyResult result(\"test\");\r\n\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <CopyPart xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n\r\n                        </CopyPart>)\";\r\n    UploadPartCopyResult result2(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <CopyPartResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n\r\n                        </CopyPartResult>)\";\r\n    UploadPartCopyResult result3(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <CopyPartResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                            <LastModified></LastModified>\r\n                            <ETag></ETag>\r\n                        </CopyPartResult>)\";\r\n    UploadPartCopyResult result4(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\r\n    UploadPartCopyResult result5(xml);\r\n}\r\n\r\nTEST_F(MultipartUploadTest, MultiUploadWithSequentialTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"MultiUploadWithSequentialTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto calcETag = ComputeContentETag(*content);\r\n\r\n    //default\r\n    InitiateMultipartUploadRequest request(BucketName, key);\r\n    auto initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_EQ(initOutcome.result().Key(), key);\r\n\r\n    auto uploadPartOutcome = Client->UploadPart(UploadPartRequest(BucketName, key, 2, initOutcome.result().UploadId(), content));\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n    EXPECT_EQ(uploadPartOutcome.result().ETag(), calcETag);\r\n    EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\r\n\r\n    //set true\r\n    InitiateMultipartUploadRequest request1(BucketName, key);\r\n    request1.setSequential(true);\r\n    initOutcome = Client->InitiateMultipartUpload(request1);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_EQ(initOutcome.result().Key(), key);\r\n\r\n    uploadPartOutcome = Client->UploadPart(UploadPartRequest(BucketName, key, 2, initOutcome.result().UploadId(), content));\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), false);\r\n\r\n    uploadPartOutcome = Client->UploadPart(UploadPartRequest(BucketName, key, 1, initOutcome.result().UploadId(), content));\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n    EXPECT_EQ(uploadPartOutcome.result().ETag(), calcETag);\r\n    EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\r\n\r\n\r\n    //set false\r\n    request1.setSequential(false);\r\n    initOutcome = Client->InitiateMultipartUpload(request1);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_EQ(initOutcome.result().Key(), key);\r\n\r\n    uploadPartOutcome = Client->UploadPart(UploadPartRequest(BucketName, key, 2, initOutcome.result().UploadId(), content));\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n    EXPECT_EQ(uploadPartOutcome.result().ETag(), calcETag);\r\n    EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\r\n\r\n}\r\n\nTEST_F(MultipartUploadTest, UploadPartWithContentMd5Test)\n{\n    std::string key = TestUtils::GetObjectKey(\"UploadPartWithContentMd5Test\");\n    InitiateMultipartUploadRequest initUploadRequest(BucketName, key);\n    auto ulOutcome = Client->InitiateMultipartUpload(initUploadRequest);\n    EXPECT_EQ(ulOutcome.isSuccess(), true);\n    auto uploadId = ulOutcome.result().UploadId();\n    PartList partETagList;\n\n    // Upload multiparts to bucket\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>(\"hello\");\n\n    UploadPartRequest uploadPartRequest(BucketName, key, content);\n    uploadPartRequest.setUploadId(uploadId);\n    uploadPartRequest.setPartNumber(1);\n    uploadPartRequest.setContentMd5(ComputeContentMD5(\"hello\", 5));\n    auto upOutcome = Client->UploadPart(uploadPartRequest);\n    EXPECT_EQ(upOutcome.isSuccess(), true);\n\n    partETagList.push_back(Part(1, upOutcome.result().ETag()));\n\n    // Complete to upload multiparts\n    CompleteMultipartUploadRequest request(BucketName, key);\n    request.setUploadId(uploadId);\n    request.setPartList(partETagList);\n    auto cmOutcome = Client->CompleteMultipartUpload(request);\n    EXPECT_EQ(cmOutcome.isSuccess(), true);\n}\r\n\r\n}\r\n}"
  },
  {
    "path": "test/src/MultipartUpload/ObjectAsyncTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include \"src/utils/FileSystemUtils.h\"\n#include \"src/utils/Utils.h\"\n#include <fstream>\n#ifdef _WIN32\n#include <Windows.h>\n#else\n#include <unistd.h>\n#endif\n\nnamespace AlibabaCloud {\nnamespace OSS {\nclass ObjectAsyncTest : public ::testing::Test {\nprotected:\n    ObjectAsyncTest()\n\t{\n\t}\n\t~ObjectAsyncTest() override\n\t{\n\t}\n\t// Sets up the stuff shared by all tests in this test case.\n\tstatic void SetUpTestCase()\n\t{\n\t\tClient = TestUtils::GetOssClientDefault();\n\t\tBucketName = TestUtils::GetBucketName(\"cpp-sdk-multipartupload\");\n\t\tClient->CreateBucket(CreateBucketRequest(BucketName));\n\t\tTestFile = TestUtils::GetTargetFileName(\"cpp-sdk-multipartupload\");\n\t\tTestUtils::WriteRandomDatatoFile(TestFile, 1 * 1024 * 1024 + 100);\n\t\tTestFileMd5 = TestUtils::GetFileMd5(TestFile);\n\t}\n\n\t// Tears down the stuff shared by all tests in this test case.\n\tstatic void TearDownTestCase()\n\t{\n\t\tRemoveFile(TestFile);\n\t\tTestUtils::CleanBucket(*Client, BucketName);\n\t\tClient = nullptr;\n\t}\n\n\t// Sets up the test fixture.\n\tvoid SetUp() override\n\t{\n\t}\n\n\t// Tears down the test fixture.\n\tvoid TearDown() override\n\t{\n\t}\n\npublic:\n\tstatic std::shared_ptr<OssClient> Client;\n\tstatic std::string BucketName;\n\tstatic std::string TestFile;\n\tstatic std::string TestFileMd5;\n\n};\n\nstd::shared_ptr<OssClient> ObjectAsyncTest::Client = nullptr;\nstd::string ObjectAsyncTest::BucketName = \"\";\nstd::string ObjectAsyncTest::TestFile = \"\";\nstd::string ObjectAsyncTest::TestFileMd5 = \"\";\n\nclass UploadPartAsyncContext : public AsyncCallerContext\n{\npublic:\n\tUploadPartAsyncContext() :ready(false) {}\n\tvirtual ~UploadPartAsyncContext()\n\t{\n\t}\n\n\tmutable std::mutex mtx;\n\tmutable std::condition_variable cv;\n\tmutable bool ready;\n};\n\nvoid UploadPartInvalidHandler(const AlibabaCloud::OSS::OssClient* client,\n\tconst UploadPartRequest& request,\n\tconst PutObjectOutcome& outcome,\n\tconst std::shared_ptr<const AsyncCallerContext>& context)\n{\n\tUNUSED_PARAM(request);\n\tstd::cout << \"Client[\" << client << \"]\" << \"UploadPartInvalidHandler, tag:\" << context->Uuid() << std::endl;\n\tif (context != nullptr) {\n\t\tauto ctx = static_cast<const UploadPartAsyncContext *>(context.get());\n\t\tEXPECT_EQ(outcome.isSuccess(), false);\n\t\tstd::cout << __FUNCTION__ << \" InvalidHandler, code:\" << outcome.error().Code() \n\t\t\t<< \", message:\" << outcome.error().Message() << std::endl;\n\t\tstd::unique_lock<std::mutex> lck(ctx->mtx);\n\t\tctx->ready = true;\n\t\tctx->cv.notify_all();\n\t}\n}\n\nvoid UploadPartHandler(const AlibabaCloud::OSS::OssClient* client,\n\tconst UploadPartRequest& request,\n\tconst PutObjectOutcome& outcome,\n\tconst std::shared_ptr<const AsyncCallerContext>& context)\n{\n\tUNUSED_PARAM(request);\n\tstd::cout << \"Client[\" << client << \"]\" << \"UploadPartHandler,tag:\" << context->Uuid() << std::endl;\n\tif (context != nullptr) {\n\t\tauto ctx = static_cast<const UploadPartAsyncContext *>(context.get());\n\t\tif (!outcome.isSuccess()) {\n\t\t\tstd::cout << __FUNCTION__ << \" failed, Code:\" << outcome.error().Code()\n\t\t\t\t<< \", message:\" << outcome.error().Message() << std::endl;\n\t\t}\n\t\tEXPECT_EQ(outcome.isSuccess(), true);\n\t\tstd::unique_lock<std::mutex> lck(ctx->mtx);\n\t\tctx->ready = true;\n\t\tctx->cv.notify_all();\n\t}\n}\n\nTEST_F(ObjectAsyncTest, UploadPartAsyncBasicTest)\n{\n\tstd::string memKey = TestUtils::GetObjectKey(\"UploadPartMemObjectAsyncBasicTest\");\n\tauto memContent = TestUtils::GetRandomStream(102400);\n\tInitiateMultipartUploadRequest memInitRequest(BucketName, memKey);\n\tauto memInitOutcome = Client->InitiateMultipartUpload(memInitRequest);\n\tEXPECT_EQ(memInitOutcome.isSuccess(), true);\n\tEXPECT_EQ(memInitOutcome.result().Key(), memKey);\n\n\tstd::string fileKey = TestUtils::GetObjectKey(\"UploadPartFileObjectAsyncBasicTest\");\n\tstd::string tmpFile = TestUtils::GetTargetFileName(\"UploadPartFileObjectAsyncBasicTest\").append(\".tmp\");\n\tTestUtils::WriteRandomDatatoFile(tmpFile, 1024);\n\tauto fileContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::out | std::ios::binary);\n\tInitiateMultipartUploadRequest fileInitRequest(BucketName, fileKey);\n\tauto fileInitOutcome = Client->InitiateMultipartUpload(fileInitRequest);\n\tEXPECT_EQ(fileInitOutcome.isSuccess(), true);\n\tEXPECT_EQ(fileInitOutcome.result().Key(), fileKey);\n\n\tUploadPartAsyncHandler handler = UploadPartHandler;\n\n\tUploadPartRequest memRequest(BucketName, memKey, 1, memInitOutcome.result().UploadId(), memContent);\n\tstd::shared_ptr<UploadPartAsyncContext> memContext = std::make_shared<UploadPartAsyncContext>();\n\tmemContext->setUuid(\"UploadPartAsyncFromMem\");\n\n\tUploadPartRequest fileRequest(BucketName, fileKey, 1, fileInitOutcome.result().UploadId(), fileContent);\n\tstd::shared_ptr<UploadPartAsyncContext> fileContext = std::make_shared<UploadPartAsyncContext>();\n\tfileContext->setUuid(\"UploadPartAsyncFromFile\");\n\n\tClient->UploadPartAsync(memRequest, handler, memContext);\n\tClient->UploadPartAsync(fileRequest, handler, fileContext);\n\tstd::cout << \"Client[\" << Client << \"]\" << \"Issue UploadPartAsync done.\" << std::endl;\n\t{\n\t\tstd::unique_lock<std::mutex> lck(fileContext->mtx);\n\t\tif (!fileContext->ready) fileContext->cv.wait(lck);\n\t}\n\n\t{\n\t\tstd::unique_lock<std::mutex> lck(memContext->mtx);\n\t\tif (!memContext->ready) memContext->cv.wait(lck);\n\t}\n\n\tfileContent->close();\n\n\tauto memListPartsOutcome = Client->ListParts(ListPartsRequest(BucketName, memKey, memInitOutcome.result().UploadId()));\n\tEXPECT_EQ(memListPartsOutcome.isSuccess(), true);\n\tauto fileListPartsOutcome = Client->ListParts(ListPartsRequest(BucketName, fileKey, fileInitOutcome.result().UploadId()));\n\tEXPECT_EQ(fileListPartsOutcome.isSuccess(), true);\n\n\tauto memCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, memKey,\n\t\tmemListPartsOutcome.result().PartList(), memInitOutcome.result().UploadId()));\n\tEXPECT_EQ(memCompleteOutcome.isSuccess(), true);\n\tauto fileCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, fileKey,\n\t\tfileListPartsOutcome.result().PartList(), fileInitOutcome.result().UploadId()));\n\tEXPECT_EQ(fileCompleteOutcome.isSuccess(), true);\n\n\tEXPECT_EQ(Client->DoesObjectExist(BucketName, memKey), true);\n\tEXPECT_EQ(Client->DoesObjectExist(BucketName, fileKey), true);\n\n\tfileContext = nullptr;\n\tTestUtils::WaitForCacheExpire(1);\n\tEXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(ObjectAsyncTest, UploadPartAsyncInvalidContentTest)\n{\n\tstd::string key = TestUtils::GetObjectKey(\"UploadPartCopyAsyncInvalidContentTest\");\n\tUploadPartAsyncHandler handler = UploadPartInvalidHandler;\n\tstd::shared_ptr<std::iostream> content = nullptr;\n\tUploadPartRequest request(BucketName, key, 1, \"id\", content);\n\tstd::shared_ptr<UploadPartAsyncContext> context = std::make_shared<UploadPartAsyncContext>();\n\tcontext->setUuid(\"UploadPartCopyAsyncInvalidContent\");\n\tClient->UploadPartAsync(request, handler, context);\n\n#ifdef _WIN32\n\tSleep(1 * 1000);\n#else\n\tsleep(1);\n#endif\n\tcontent = TestUtils::GetRandomStream(100);\n\trequest.setConetent(content);\n\tClient->UploadPartAsync(request, handler, context);\n\n#ifdef _WIN32\n\tSleep(1 * 1000);\n#else\n\tsleep(1);\n#endif\n\trequest.setContentLength(5LL * 1024LL * 1024LL * 1024LL + 1LL);\n\tClient->UploadPartAsync(request, handler, context);\n\trequest.setContentLength(100);\n#ifdef _WIN32\n\tSleep(1 * 1000);\n#else\n\tsleep(1);\n#endif\n\trequest.setBucket(\"non-existent-bucket\");\n\tClient->UploadPartAsync(request, handler, context);\n\trequest.setBucket(BucketName);\n}\n\nvoid UploadPartCopyHandler(const AlibabaCloud::OSS::OssClient* client,\n\tconst UploadPartCopyRequest& request,\n\tconst UploadPartCopyOutcome& outcome,\n\tconst std::shared_ptr<const AsyncCallerContext>& context)\n{\n\tUNUSED_PARAM(request);\n\tstd::cout << \"Client[\" << client << \"]\" << \"UploadPartCopyHandler, tag:\" << context->Uuid() << std::endl;\n\tif (context != nullptr) {\n\t\tauto ctx = static_cast<const UploadPartAsyncContext *>(context.get());\n\t\tif (!outcome.isSuccess()) {\n\t\t\tstd::cout << __FUNCTION__ << \" failed, Code:\" << outcome.error().Code()\n\t\t\t\t<< \", message:\" << outcome.error().Message() << std::endl;\n\t\t}\n\t\tEXPECT_EQ(outcome.isSuccess(), true);\n\t\tstd::unique_lock<std::mutex> lck(ctx->mtx);\n\t\tctx->ready = true;\n\t\tctx->cv.notify_all();\n\t}\n}\n\n\nTEST_F(ObjectAsyncTest, UploadPartCopyAsyncBasicTest)\n{\n\t// put object from buffer\n\tstd::string memObjKey = TestUtils::GetObjectKey(\"PutObjectFromBuffer\");\n\tauto memObjContent = TestUtils::GetRandomStream(102400);\n\tauto putMemObjOutcome = Client->PutObject(PutObjectRequest(BucketName, memObjKey, memObjContent));\n\tEXPECT_EQ(putMemObjOutcome.isSuccess(), true);\n\tEXPECT_EQ(Client->DoesObjectExist(BucketName, memObjKey), true);\n\n\t// put object from local file\n\tstd::string fileObjKey = TestUtils::GetObjectKey(\"PutObjectFromFile\");\n\tstd::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectFromFile\").append(\".tmp\");\n\tTestUtils::WriteRandomDatatoFile(tmpFile, 1024);\n\tauto fileObjContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::out | std::ios::binary);\n\tauto putFileObjOutcome = Client->PutObject(PutObjectRequest(BucketName, fileObjKey, fileObjContent));\n\tEXPECT_EQ(putFileObjOutcome.isSuccess(), true);\n\tEXPECT_EQ(Client->DoesObjectExist(BucketName, fileObjKey), true);\n\n\t// close the file\n\tfileObjContent->close();\n\n\t// apply the upload id\n\tstd::string memKey = TestUtils::GetObjectKey(\"UploadPartCopyMemObjectAsyncBasicTest\");\n\tauto memInitObjOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, memKey));\n\tEXPECT_EQ(memInitObjOutcome.isSuccess(), true);\n\tEXPECT_EQ(memInitObjOutcome.result().Key(), memKey);\n\n\tstd::string fileKey = TestUtils::GetObjectKey(\"UploadPartCopyFileObjectAsyncBasicTest\");\n\tauto fileInitObjOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, fileKey));\n\tEXPECT_EQ(fileInitObjOutcome.isSuccess(), true);\n\tEXPECT_EQ(fileInitObjOutcome.result().Key(), fileKey);\n\n\t// construct parameter\n\tUploadPartCopyAsyncHandler handler = UploadPartCopyHandler;\n\tUploadPartCopyRequest memRequest(BucketName, memKey, BucketName, memObjKey, memInitObjOutcome.result().UploadId(), 1);\n\tstd::shared_ptr<UploadPartAsyncContext> memContext = std::make_shared<UploadPartAsyncContext>();\n\tmemContext->setUuid(\"UploadPartCopyAsyncFromMem\");\n\tUploadPartCopyRequest fileRequest(BucketName, fileKey, BucketName, fileObjKey, fileInitObjOutcome.result().UploadId(), 1);\n\tstd::shared_ptr<UploadPartAsyncContext> fileContext = std::make_shared<UploadPartAsyncContext>();\n\tfileContext->setUuid(\"UploadPartCopyAsyncFromFile\");\n\n\tClient->UploadPartCopyAsync(memRequest, handler, memContext);\n\tClient->UploadPartCopyAsync(fileRequest, handler, fileContext);\n\tstd::cout << \"Client[\" << Client << \"]\" << \"Issue UploadPartCopyAsync done.\" << std::endl;\n\t{\n\t\tstd::unique_lock<std::mutex> lck(fileContext->mtx);\n\t\tif(!fileContext->ready) fileContext->cv.wait(lck);\n\t}\n\t{\n\t\tstd::unique_lock<std::mutex> lck(memContext->mtx);\n\t\tif (!memContext->ready) memContext->cv.wait(lck);\n\t}\n\n\t// list parts\n\tauto memListPartsOutcome = Client->ListParts(ListPartsRequest(BucketName, memKey, memInitObjOutcome.result().UploadId()));\n\tEXPECT_EQ(memListPartsOutcome.isSuccess(), true);\n\tauto fileListPartsOutcome = Client->ListParts(ListPartsRequest(BucketName, fileKey, fileInitObjOutcome.result().UploadId()));\n\tEXPECT_EQ(fileListPartsOutcome.isSuccess(), true);\n\n\t// complete\n\tCompleteMultipartUploadRequest memCompleteRequest(BucketName, memKey, memListPartsOutcome.result().PartList());\n\tmemCompleteRequest.setUploadId(memInitObjOutcome.result().UploadId());\n\tauto memCompleteOutcome = Client->CompleteMultipartUpload(memCompleteRequest);\n\tEXPECT_EQ(memCompleteOutcome.isSuccess(), true);\n\tCompleteMultipartUploadRequest fileCompleteRequest(BucketName, fileKey, fileListPartsOutcome.result().PartList());\n\tfileCompleteRequest.setUploadId(fileInitObjOutcome.result().UploadId());\n\tauto fileCompleteOutcome = Client->CompleteMultipartUpload(fileCompleteRequest);\n\tEXPECT_EQ(fileCompleteOutcome.isSuccess(), true);\n\n\tEXPECT_EQ(Client->DoesObjectExist(BucketName, memKey), true);\n\tEXPECT_EQ(Client->DoesObjectExist(BucketName, fileKey), true);\n\n\tfileObjContent = nullptr;\n\tTestUtils::WaitForCacheExpire(1);\n\tEXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nclass ListObjectsAsyncContext : public AsyncCallerContext\n{\npublic:\n    ListObjectsAsyncContext() :ready(false) {}\n    virtual ~ListObjectsAsyncContext()\n    {\n    }\n\n    const ObjectSummaryList& ObjectSummarys() const { return objectSummarys_; }\n    void setObjectSummaryList(const AlibabaCloud::OSS::ObjectSummaryList& objectSummarys) const\n    {\n        objectSummarys_ = objectSummarys;\n    }\n    \n    mutable std::mutex mtx;\n    mutable std::condition_variable cv;\n    mutable bool ready;\n    mutable AlibabaCloud::OSS::ObjectSummaryList objectSummarys_;\n};\n\nvoid ListObjectsHandler(const AlibabaCloud::OSS::OssClient* client,\n    const ListObjectsRequest& request,\n    const ListObjectOutcome& outcome,\n    const std::shared_ptr<const AsyncCallerContext>& context)\n{\n\tUNUSED_PARAM(request);\n    std::cout << \"Client[\" << client << \"]\" << \"ListObjectsHandler\" << std::endl;\n    if (context != nullptr) {\n        auto ctx = static_cast<const ListObjectsAsyncContext *>(context.get());\n        if (!outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \" failed, Code:\" << outcome.error().Code()\n                << \", message:\" << outcome.error().Message() << std::endl;\n        }\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(outcome.result().ObjectSummarys().size(), 20U);\n        EXPECT_EQ(outcome.result().IsTruncated(), false);\n\n        ctx->setObjectSummaryList(outcome.result().ObjectSummarys());\n        std::unique_lock<std::mutex> lck(ctx->mtx);\n        ctx->ready = true;\n        ctx->cv.notify_all();\n    }\n}\n\nTEST_F(ObjectAsyncTest, ListObjectsAsyncBasicTest)\n{\n    auto ListObjectBucketName = TestUtils::GetBucketName(\"list-object-async-bucket\");\n    auto bucketOutcome = Client->CreateBucket(CreateBucketRequest(ListObjectBucketName));\n    EXPECT_EQ(bucketOutcome.isSuccess(), true);\n\n    // create test file\n    for (int i = 0; i < 20; i++) {\n        std::string key = TestUtils::GetObjectKey(\"ListAllObjectsAsync\");\n        auto content = TestUtils::GetRandomStream(100);\n        auto outcome = Client->PutObject(ListObjectBucketName, key, content);\n        EXPECT_EQ(outcome.isSuccess(), true);\n    }\n\n    // list objects async\n    ListObjectsRequest request(ListObjectBucketName);\n    ListObjectAsyncHandler handler = ListObjectsHandler;\n    std::shared_ptr<ListObjectsAsyncContext> content = std::make_shared<ListObjectsAsyncContext>();\n    Client->ListObjectsAsync(request, handler, content);\n    std::cout << \"Client[\" << Client << \"]\" << \"Issue ListObjectsAsync done.\" << std::endl;\n\n    {\n        std::unique_lock<std::mutex> lck(content->mtx);\n        if (!content->ready) content->cv.wait(lck);\n    }\n    int i = 0;\n    for (auto const &obj : content->ObjectSummarys()) {\n        EXPECT_EQ(obj.Size(), 100LL);\n        i++;\n    }\n    EXPECT_EQ(i, 20);\n\n    TestUtils::CleanBucket(*Client, ListObjectBucketName);\n    EXPECT_EQ(Client->DoesBucketExist(ListObjectBucketName), false);\n}\n\nTEST_F(ObjectAsyncTest, AsyncCallerContextClassTest)\n{\n    AsyncCallerContext context(\"AsyncCallerContextClassTest\");\n}\n}\n}"
  },
  {
    "path": "test/src/MultipartUpload/ResumableObjectTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include <alibabacloud/oss/Const.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include \"src/utils/FileSystemUtils.h\"\n#include \"src/utils/Utils.h\"\n#include \"src/external/json/json.h\"\n#include <fstream>\n#include <ctime>\n#ifdef _WIN32\n#include <codecvt>        // std::codecvt_utf8\n#endif\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass ResumableObjectTest : public::testing::Test {\nprotected:\n    ResumableObjectTest()\n    {\n    }\n    ~ResumableObjectTest()override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-resumableobject\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n        UploadPartFailedFlag = 1 << 30;\n        DownloadPartFailedFlag = 1 << 30;\n        CopyPartFailedFlag = 1 << 30;\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n        TestUtils::CleanBucket(*Client, BucketName);\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\n\n    static std::string GetCheckpointFileByResumableUploader(std::string bucket, std::string key,\n        std::string checkpointDir, std::string filePath);\n    static std::string GetCheckpointFileByResumableDownloader(std::string bucket, std::string key,\n        std::string checkpointDir, std::string filePath);\n    static std::string GetCheckpointFileByResumableCopier(std::string bucket, std::string key,\n        std::string srcBucket, std::string srcKey, std::string checkpointDir);\n    static void ProgressCallback(size_t increment, int64_t transfered, int64_t total, void* userData);\n\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n    static int UploadPartFailedFlag;\n    static int DownloadPartFailedFlag;\n    static int CopyPartFailedFlag;\n};\n\n    std::string ResumableObjectTest::GetCheckpointFileByResumableUploader(std::string bucket,\n        std::string key, std::string checkpointDir, std::string filePath)\n    {\n        if (!checkpointDir.empty()) {\n            std::stringstream ss;\n            ss << \"oss://\" << bucket << \"/\" << key;\n            auto destPath = ss.str();\n            auto safeFileName = ComputeContentETag(filePath) + \"--\" + ComputeContentETag(destPath);\n            return checkpointDir + PATH_DELIMITER + safeFileName;\n        }\n        return \"\";\n    }\n\n    std::string ResumableObjectTest::GetCheckpointFileByResumableDownloader(std::string bucket,\n        std::string key, std::string checkpointDir, std::string filePath)\n    {\n        if (!checkpointDir.empty()) {\n            std::stringstream ss;\n            ss << \"oss://\" << bucket << \"/\" << key;\n            auto srcPath = ss.str();\n            auto safeFileName = ComputeContentETag(srcPath) + \"--\" + ComputeContentETag(filePath);\n            return checkpointDir + PATH_DELIMITER + safeFileName;\n        }\n        return \"\";\n    }\n\n    std::string ResumableObjectTest::GetCheckpointFileByResumableCopier(std::string bucket, std::string key,\n        std::string srcBucket, std::string srcKey, std::string checkpointDir)\n    {\n        if (!checkpointDir.empty()) {\n            std::stringstream ss;\n            ss << \"oss://\" << srcBucket << \"/\" << srcKey;\n            auto srcPath = ss.str();\n            ss.str(\"\");\n            ss << \"oss://\" << bucket << \"/\" << key;\n            auto destPath = ss.str();\n\n            auto safeFileName = ComputeContentETag(srcPath) + \"--\" + ComputeContentETag(destPath);\n            return checkpointDir + PATH_DELIMITER + safeFileName;\n        }\n        return \"\";\n    }\n\n    void ResumableObjectTest::ProgressCallback(size_t increment, int64_t transfered, int64_t total, void* userData)\n    {\n        std::cout << \"ProgressCallback[\" << userData << \"] => \" <<\n            increment << \",\" << transfered << \",\" << total << std::endl;\n    }\n\n    std::shared_ptr<OssClient> ResumableObjectTest::Client = nullptr;\n    std::string ResumableObjectTest::BucketName = \"\";\n    int ResumableObjectTest::UploadPartFailedFlag = 0;\n    int ResumableObjectTest::DownloadPartFailedFlag = 0;\n    int ResumableObjectTest::CopyPartFailedFlag = 0;\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadWithSizeOverPartSizeTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"ResumableUploadObjectOverPartSize\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableUploadObjectOverPartSize\").append(\".tmp\");\n        // limit file size between 800KB and 2000KB\n        int num = 8 + rand() % 12;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num + 10);\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        auto getObjectOutcome = Client->GetObject(BucketName, key);\n        EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n\n        auto getoutcome = Client->GetObject(GetObjectRequest(BucketName, key));\n\n        std::fstream file(tmpFile, std::ios::in | std::ios::binary);\n        std::string oriMd5 = ComputeContentMD5(file);\n        std::string memMd5 = ComputeContentMD5(*getObjectOutcome.result().Content());\n        EXPECT_EQ(oriMd5, memMd5);\n\n        file.close();\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadWithSizeUnderPartSizeTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"ResumableUploadObjectUnderPartSize\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableUploadObjectUnderPartSize\").append(\".tmp\");\n        int num = rand() % 8;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 10240 * num);\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        auto getObjectOutcome = Client->GetObject(BucketName, key);\n        EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableObjectWithDisableRequest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalUploadObjectWithDisableRequest\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalUploadObjectWithDisableRequest\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n        Client->DisableRequest();\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ClientError:100002\");\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        Client->EnableRequest();\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableUploadWithSizeOverPartSizeTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"MultiUploadObjectOverPartSize\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"MultiUploadObjectOverPartSize\").append(\".tmp\");\n        int num = 8 + rand() % 12;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        int threadNum = 1 + rand() % 99;\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(threadNum);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadSetMinPartSizeTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectSetMinPartSize\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectSetMinPartSize\").append(\".tmp\");\n        int num = 1 + rand() % 20;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        int partSize = 1 + rand() % 99;\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(partSize * 102400);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableUploadWithoutSourceFilePathTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalUplloadObjectWithoutFilePath\");\n        std::string tmpFile;\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableUploadWithoutRealFileTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalUplloadObjectWithoutRealFile\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalUplloadObjectWithoutRealFile\").append(\".tmp\");\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableUploadWithNotExitsCheckpointTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalUploadObjectWithNotExitsCheckpoint\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalUploadObjectWithNotExitsCheckpoint\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 100);\n        std::string checkPoint = \"NotExistDir\";\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(1);\n        request.setCheckpointDir(checkPoint);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadWithCheckpointTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithCheckpoint\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithCheckpoint\").append(\".tmp\");\n        std::string checkpointDir = TestUtils::GetExecutableDirectory();\n        int num = 1 + rand() % 10;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(1);\n        request.setCheckpointDir(checkpointDir);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableUploadWithCheckpointTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"MultiUploadObjectWithCheckpoint\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithCheckpoint\").append(\".tmp\");\n        std::string checkpointDir = TestUtils::GetExecutableDirectory();\n        int num = 8 + rand() % 12;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        int threadNum = 1 + rand() % 99;\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(100 * 1024);\n        request.setCheckpointDir(checkpointDir);\n        request.setThreadNum(threadNum);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableUploadWithFailedPartUploadTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalUploadObjectWithFailedPart\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalUploadObjectWithFailedPart\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(1024);\n        auto failOutcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(failOutcome.isSuccess(), false);\n\n        request.setPartSize(102400);\n        request.setFlags(request.Flags() | UploadPartFailedFlag);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadRetryAfterFailedPartTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithFailedPart\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithFailedPart\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n        std::string checkpointKey = TestUtils::GetObjectKey(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointKey), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n        // resumable upload object failed\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        request.setFlags(request.Flags() | UploadPartFailedFlag);\n        request.setCheckpointDir(checkpointKey);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // retry\n        request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n        auto retryOutcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableUploadRetryAfterFailedPartTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalMultiUploadObjectWithFailedPart\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalMultiUploadObjectWithFailedPart\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n        std::string checkpointKey = TestUtils::GetObjectKey(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointKey), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n        // resumable upload object failed\n        int threadNum = 1 + rand() % 100;\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(102400);\n        request.setThreadNum(threadNum);\n        request.setFlags(request.Flags() | UploadPartFailedFlag);\n        request.setCheckpointDir(checkpointKey);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // retry\n        request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n        auto retryOutcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadRetryWithUploadPartTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectRetryWithUploadPart\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalUploadObjectRetryWithUploadPart\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n        std::string checkpointKey = TestUtils::GetObjectKey(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointKey), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n        // resumable upload object failed\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        request.setFlags(request.Flags() | UploadPartFailedFlag);\n        request.setCheckpointDir(checkpointKey);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // read the checkpoint json file\n        std::string filename = GetCheckpointFileByResumableUploader(BucketName, key, checkpointKey, tmpFile);\n        auto listMultipartOutcome = Client->ListMultipartUploads(ListMultipartUploadsRequest(BucketName));\n        EXPECT_EQ(listMultipartOutcome.isSuccess(), true);\n        auto multipartUpload = listMultipartOutcome.result().MultipartUploadList()[0];\n\n        // resend the NO.2 part data\n        std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\n        content->seekg(102400, content->beg);\n        UploadPartRequest uploadPartRequest(BucketName, multipartUpload.Key, 2, multipartUpload.UploadId, content);\n        uploadPartRequest.setContentLength(102400);\n        auto reuploadOutcome = Client->UploadPart(uploadPartRequest);\n        content = nullptr;\n        uploadPartRequest.setConetent(content);\n        EXPECT_EQ(reuploadOutcome.isSuccess(), true);\n\n        // Complete object\n        auto listpartsOutcome = Client->ListParts(ListPartsRequest(BucketName, multipartUpload.Key, multipartUpload.UploadId));\n        EXPECT_EQ(listpartsOutcome.isSuccess(), true);\n        auto partlist = listpartsOutcome.result().PartList();\n        CompleteMultipartUploadRequest completeRequest(BucketName, multipartUpload.Key, partlist, multipartUpload.UploadId);\n        auto completeOutcome = Client->CompleteMultipartUpload(completeRequest);\n        EXPECT_EQ(completeOutcome.isSuccess(), true);\n\n        // download the file\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n        std::string targetFile = TestUtils::GetObjectKey(\"DownloadUploadPartObject\");\n        auto getObjectOutcome = Client->GetObject(BucketName, key, targetFile);\n        std::shared_ptr<std::iostream> getObjectContent = nullptr;\n        getObjectOutcome.result().setContent(getObjectContent);\n        EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n\n        std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(uploadMd5, downloadMd5);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveFile(filename), true);\n        EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadRetryWithSourceFileChangedTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithSourceFileChanged\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithSourceFileChanged\").append(\".tmp\");\n        int num = 2 + rand() % 10;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        std::string sourceFileMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string checkpointKey = TestUtils::GetObjectKey(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointKey), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n        // resumable upload object failed\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setThreadNum(1);\n        request.setPartSize(102400);\n        request.setFlags(request.Flags() | UploadPartFailedFlag);\n        request.setCheckpointDir(checkpointKey);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // change source file\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        // TODO: API only check file size, don't check the contents of file\n        TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (num + 1));\n        std::string newSourceFileMd5 = TestUtils::GetFileMd5(tmpFile);\n        EXPECT_NE(sourceFileMd5, newSourceFileMd5);\n\n        // retry\n        request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n        auto retryOutcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download target object\n        std::string targetFile = TestUtils::GetObjectKey(\"DownloadResumableUploadObject\");\n        auto getObjectOutcome = Client->GetObject(BucketName, key, targetFile);\n        std::shared_ptr<std::iostream> getObjectContent = nullptr;\n        getObjectOutcome.result().setContent(getObjectContent);\n        EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n\n        std::string targetFileMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(targetFileMd5, newSourceFileMd5);\n        EXPECT_NE(targetFileMd5, sourceFileMd5);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableUploadRetryWithSourceFileChangedTest)\n    {\n\n        std::string key = TestUtils::GetObjectKey(\"MultiUploadObjectWithSourceFileChanged\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"MultiUploadObjectWithSourceFileChanged\").append(\".tmp\");\n        int num = 2 + rand() % 10;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        std::string sourceFileMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string checkpointKey = TestUtils::GetObjectKey(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointKey), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n        // upload object failed\n        int threadNum = 1 + rand() % 100;\n        UploadObjectRequest request(BucketName, key, tmpFile, checkpointKey, 102400, threadNum);\n        request.setFlags(request.Flags() | UploadPartFailedFlag);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // change source file\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num + 100);\n        std::string newSourceFileMd5 = TestUtils::GetFileMd5(tmpFile);\n        EXPECT_NE(sourceFileMd5, newSourceFileMd5);\n\n        // retry\n        request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n        auto retryOutcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download\n        std::string targetFile = TestUtils::GetObjectKey(\"DownloadResumableUploadObject\");\n        auto getObjectOutcome = Client->GetObject(BucketName, key, targetFile);\n        std::shared_ptr<std::iostream> getObjectContent = nullptr;\n        getObjectOutcome.result().setContent(getObjectContent);\n        EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n\n        std::string targetFileMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(targetFileMd5, newSourceFileMd5);\n        EXPECT_NE(targetFileMd5, sourceFileMd5);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadRetryWithCheckpointFileChangedTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithCheckpointFileChanged\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithCheckpointFileChanged\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n        std::string checkpointKey = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointKey), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n        // resumable upload object failed\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        request.setFlags(request.Flags() | UploadPartFailedFlag);\n        request.setCheckpointDir(checkpointKey);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // change the checkpoint file\n        std::string checkpointFilename = GetCheckpointFileByResumableUploader(BucketName, key, checkpointKey, tmpFile);\n        std::string checkpointTmpFile = std::string(checkpointFilename).append(\".tmp\");\n        std::ifstream jsonStream(checkpointFilename, std::ios::in | std::ios::binary);\n        Json::CharReaderBuilder rbuilder;\n        Json::Value readRoot;\n        Json::Value writeRoot;\n        std::string uploadId = \"InvaliedUploadID\";\n        //if (reader.parse(jsonStream, readRoot)) {\n        if (Json::parseFromStream(rbuilder, jsonStream, &readRoot, nullptr)) {\n            writeRoot[\"opType\"] = readRoot[\"opType\"].asString();\n            writeRoot[\"uploadID\"] = uploadId;\n            writeRoot[\"bucket\"] = readRoot[\"bucket\"].asString();\n            writeRoot[\"key\"] = readRoot[\"key\"].asString();\n            writeRoot[\"mtime\"] = readRoot[\"mtime\"].asString();\n            writeRoot[\"size\"] = readRoot[\"size\"].asInt64();\n            writeRoot[\"partSize\"] = readRoot[\"partSize\"].asInt64();\n            writeRoot[\"md5Sum\"] = readRoot[\"md5Sum\"].asString();\n        }\n        jsonStream.close();\n\n        std::fstream recordStream(checkpointTmpFile, std::ios::out);\n        if (recordStream.is_open()) {\n            recordStream << writeRoot;\n        }\n        recordStream.close();\n        EXPECT_EQ(RemoveFile(checkpointFilename), true);\n        EXPECT_EQ(RenameFile(checkpointTmpFile, checkpointFilename), true);\n\n        // retry\n        request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n        auto retryOutcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableUploadRetryWithCheckpointFileChangedTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"MultiUploadObjectWithCheckpointFileChanged\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"MultiUploadObjectWithCheckpointFileChanged\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n        std::string checkpointKey = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointKey), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n        // resumable upload object failed\n        int threadNum = 1 + rand() % 100;\n        UploadObjectRequest request(BucketName, key, tmpFile, checkpointKey, 102400, threadNum);\n        request.setFlags(request.Flags() | UploadPartFailedFlag);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // change the checkpoint file\n        std::string checkpointFilename = GetCheckpointFileByResumableUploader(BucketName, key, checkpointKey, tmpFile);\n        std::string checkpointTmpFile = std::string(checkpointFilename).append(\".tmp\");\n        std::ifstream jsonStream(checkpointFilename, std::ios::in | std::ios::binary);\n        Json::CharReaderBuilder rbuilder;\n        Json::Value readRoot;\n        Json::Value writeRoot;\n        std::string uploadId = \"InvaliedUploadID\";\n        //if (reader.parse(jsonStream, readRoot)) {\n        if (Json::parseFromStream(rbuilder, jsonStream, &readRoot, nullptr)) {\n            writeRoot[\"opType\"] = readRoot[\"opType\"].asString();\n            writeRoot[\"uploadID\"] = uploadId;\n            writeRoot[\"bucket\"] = readRoot[\"bucket\"].asString();\n            writeRoot[\"key\"] = readRoot[\"key\"].asString();\n            writeRoot[\"mtime\"] = readRoot[\"mtime\"].asString();\n            writeRoot[\"size\"] = readRoot[\"size\"].asInt64();\n            writeRoot[\"partSize\"] = readRoot[\"partSize\"].asInt64();\n            writeRoot[\"md5Sum\"] = readRoot[\"md5Sum\"].asString();\n        }\n        jsonStream.close();\n\n        std::fstream recordStream(checkpointTmpFile, std::ios::out);\n        if (recordStream.is_open()) {\n            recordStream << writeRoot;\n        }\n        recordStream.close();\n        EXPECT_EQ(RemoveFile(checkpointFilename), true);\n        EXPECT_EQ(RenameFile(checkpointTmpFile, checkpointFilename), true);\n\n        // retry\n        request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n        auto retryOutcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadRetryWithUploadIdAbortTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalResumableUploadRetryWithUploadIdAbortTest\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalResumableUploadRetryWithUploadIdAbortTest\").append(\".tmp\");\n        int num = 2 + rand() % 10;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        std::string sourceFileMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string checkpointKey = TestUtils::GetObjectKey(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointKey), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n        // resumable upload object failed\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setThreadNum(1);\n        request.setPartSize(102400);\n        request.setFlags(request.Flags() | UploadPartFailedFlag);\n        request.setCheckpointDir(checkpointKey);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // abort upload Id\n        ListMultipartUploadsRequest lmuRequest(BucketName);\n        lmuRequest.setPrefix(key);\n        auto lmuOutcome = Client->ListMultipartUploads(lmuRequest);\n        EXPECT_EQ(lmuOutcome.isSuccess(), true);\n        EXPECT_EQ(lmuOutcome.result().MultipartUploadList().size(), 1UL);\n        auto uploadId = lmuOutcome.result().MultipartUploadList()[0].UploadId;\n        AbortMultipartUploadRequest abortRequest(BucketName, key, uploadId);\n        auto abortOutcome = Client->AbortMultipartUpload(abortRequest);\n        EXPECT_EQ(abortOutcome.isSuccess(), true);\n\n        // retry\n        request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n        auto retryOutcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download target object\n        std::string targetFile = TestUtils::GetObjectKey(\"DownloadResumableUploadObject\");\n        auto getObjectOutcome = Client->GetObject(BucketName, key, targetFile);\n        std::shared_ptr<std::iostream> getObjectContent = nullptr;\n        getObjectOutcome.result().setContent(getObjectContent);\n        EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n\n        std::string targetFileMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(targetFileMd5, sourceFileMd5);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadWithProgressCallbackTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalResumableUploadObjectWithCallback\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalResumableUploadObjectWithCallback\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        std::cout << \"this ptr:\" << this << std::endl;\n        TransferProgress progressCallback = { ProgressCallback, this };\n        UploadObjectRequest request(BucketName, key, tmpFile, checkpointDir, 102400, 1);\n        request.setTransferProgress(progressCallback);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadProgressCallbackWithUploadPartFailedTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalResumableUploadObjectWithCallback\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalResumableUploadObjectWithCallback\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        TransferProgress progressCallback = { ProgressCallback, this };\n        UploadObjectRequest request(BucketName, key, tmpFile, checkpointDir, 102400, 1);\n        request.setFlags(request.Flags() | UploadPartFailedFlag);\n        request.setTransferProgress(progressCallback);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // retry\n        std::cout << \"Retry : \" << std::endl;\n        request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n        auto retryOutcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableUploadWithThreadNumberOverPartNumber)\n    {\n        std::string key = TestUtils::GetObjectKey(\"MultiUploadObjectWithThreadNumberOverPartNumber\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"MultiUploadObjectWithThreadNumberOverPartNumber\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n\n        int threadNum = 0;\n        UploadObjectRequest request(BucketName, key, tmpFile, \"\");\n        request.setPartSize(102400);\n        request.setThreadNum(threadNum);\n        auto invalidateOutcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(invalidateOutcome.isSuccess(), false);\n\n        // the thread num over part num\n        threadNum = 20;\n        request.setThreadNum(threadNum);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadWithObjectMetaDataSetTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithObjectMetaDateSetTest\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithObjectMetaDateSetTest\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n\n        ObjectMetaData meta;\n        meta.setCacheControl(\"No-Cache\");\n        meta.setExpirationTime(\"Fri, 09 Nov 2018 05:57:16 GMT\");\n        // upload object\n        UploadObjectRequest request(BucketName, key, tmpFile, \"\", meta);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        auto hOutcome = Client->HeadObject(BucketName, key);\n        EXPECT_EQ(hOutcome.isSuccess(), true);\n        EXPECT_EQ(hOutcome.result().CacheControl(), \"No-Cache\");\n        EXPECT_EQ(hOutcome.result().ExpirationTime(), \"Fri, 09 Nov 2018 05:57:16 GMT\");\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadWithUserMetaDataTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithUserDataTest\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalUploadObjectWithUserDataTest\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n\n        // upload object\n        ObjectMetaData metaDate;\n        metaDate.UserMetaData()[\"test\"] = \"testvalue\";\n        UploadObjectRequest request(BucketName, key, tmpFile, \"\", 102400, 1, metaDate);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        auto hOutcome = Client->HeadObject(BucketName, key);\n        EXPECT_EQ(hOutcome.isSuccess(), true);\n        EXPECT_EQ(hOutcome.result().UserMetaData().at(\"test\"), \"testvalue\");\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadWithObjectAclSetTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectWithObjectAclSetTest\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n\n        // upload object\n        UploadObjectRequest request(BucketName, key, tmpFile, \"\", 102400, 1);\n        CannedAccessControlList acl = CannedAccessControlList::PublicReadWrite;\n        request.setAcl(acl);\n        request.setEncodingType(\"url\");\n        EXPECT_EQ(request.EncodingType(), \"url\");\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        auto aclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName, key));\n        EXPECT_EQ(aclOutcome.isSuccess(), true);\n        EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::PublicReadWrite);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n\n\n    TEST_F(ResumableObjectTest, UnnormalResumableDownloadObjectWithDisableRequest)\n    {\n        // upload object\n        std::string key = TestUtils::GetObjectKey(\"UnnormalResumableDownloadObjectWithDisableRequest\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalResumableDownloadObjectWithDisableRequest\").append(\".tmp\");\n        std::string targetKey = TestUtils::GetObjectKey(\"UnnormalResumableDownloadTargetObject\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (1 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, key, tmpFile);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n\n        // download object\n        Client->DisableRequest();\n        DownloadObjectRequest request(BucketName, key, targetKey);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ClientError:100002\");\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveFile(targetKey.append(\".temp\")), true);\n        Client->EnableRequest();\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadWithSizeOverPartSizeTest)\n    {\n        // upload object\n        std::string key = TestUtils::GetObjectKey(\"ResumableDownloadObjectOverPartSize\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableDownloadObjectOverPartSize\").append(\".tmp\");\n        std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n        int num = 1 + rand() % 10;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download object\n        DownloadObjectRequest request(BucketName, key, targetFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(uploadMd5, downloadMd5);\n\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadWithSizeUnderPartSizeTest)\n    {\n        // upload object\n        std::string key = TestUtils::GetObjectKey(\"ResumableDownloadObjectUnderPartSize\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableDownloadObjectUnderPartSize\").append(\".tmp\");\n        std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n        int num = 10 + rand() % 10;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download object\n        DownloadObjectRequest request(BucketName, key, targetFile);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(uploadMd5, downloadMd5);\n\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableDownloadWithSizeOverPartSizeTest)\n    {\n        // upload\n        std::string key = TestUtils::GetObjectKey(\"MultiResumableDownloadObjectOverPartSize\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"MultiResumableDownloadObjectOverPartSize\").append(\".tmp\");\n        std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n        int num = 1 + rand() % 10;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        int threadNum = 1 + rand() % 100;\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download\n        DownloadObjectRequest request(BucketName, key, targetFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(threadNum);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(uploadMd5, downloadMd5);\n\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadSetMinPartSizeTest)\n    {\n        // upload\n        std::string key = TestUtils::GetObjectKey(\"ResumableDownloadObjectSetMinPartSize\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableDownloadObjectSetMinPartSize\").append(\".tmp\");\n        std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n        int num = 1 + rand() % 10;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download\n        int partSize = 1 + rand() % 99;\n        DownloadObjectRequest request(BucketName, key, targetFile);\n        request.setPartSize(partSize * 1024);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        request.setPartSize(102400);\n        auto retryOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n\n        std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(uploadMd5, downloadMd5);\n\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableDownloadWithoutTargetFilePathTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalUplloadObjectWithoutFilePath\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalUplloadObjectWithoutFilePath\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download\n        std::string targetFile;\n        DownloadObjectRequest request(BucketName, key, targetFile);\n        request.setPartSize(100 * 1024);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadWithCheckpointTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalDownloadObjectWithCheckpoint\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalDownloadObjectWithCheckpoint\").append(\".tmp\");\n        std::string checkpointDir = TestUtils::GetExecutableDirectory();\n        std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n\n        // upload\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download\n        DownloadObjectRequest request(BucketName, key, targetFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(1);\n        request.setCheckpointDir(checkpointDir);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(uploadMd5, downloadMd5);\n\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableDownloadWithNotExitsCheckpointTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalDownloadObjectWithNotExistCheckpoint\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalDownloadObjectWithNotExistCheckpoint\").append(\".tmp\");\n        std::string checkpointDir = \"NotExistDir\";\n        std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n\n        // upload\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download\n        DownloadObjectRequest request(BucketName, key, targetFile);\n        request.setPartSize(100 * 1024);\n        request.setCheckpointDir(checkpointDir);\n        auto outcome = Client->ResumableDownloadObject(request);\n        std::shared_ptr<std::iostream> content = nullptr;\n        outcome.result().setContent(content);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n        EXPECT_EQ(outcome.error().Message(), \"Checkpoint directory is not exist.\");\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        RemoveFile(targetFile.append(\".temp\"));\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableDownloadWithCheckpointTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"MultiDownloadObjectWithCheckpoint\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"MultiDownloadObjectWithCheckpoint\").append(\".tmp\");\n        std::string checkpointDir = TestUtils::GetExecutableDirectory();\n        std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n\n        // upload\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download\n        int threadNum = 1 + rand() % 99;\n        DownloadObjectRequest request(BucketName, key, targetFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(threadNum);\n        request.setCheckpointDir(checkpointDir);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(uploadMd5, downloadMd5);\n\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableDownloadWithDownloadPartFailedTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalDownloadObjectWithPartFailed\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalDownloadObjectWithPartFailed\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n        std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        // upload object\n        auto uploadOutcome = Client->PutObject(BucketName, key, tmpFile);\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download object\n        DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, 1);\n        request.setFlags(request.Flags() | DownloadPartFailedFlag);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        std::string checkpointFile = GetCheckpointFileByResumableDownloader(BucketName, key, checkpointDir, targetFile);\n        std::string failedDownloadFile = targetFile.append(\".temp\");\n        EXPECT_EQ(RemoveFile(checkpointFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveFile(failedDownloadFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadRetryWithCheckpointTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalDownloadObjectRetryWithCheckpoint\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalDownloadObjectRetryWithCheckpoint\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n        std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        // upload object\n        auto uploadOutcome = Client->PutObject(BucketName, key, tmpFile);\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download object\n        DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, 1);\n        request.setFlags(request.Flags() | DownloadPartFailedFlag);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // retry\n        request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n        auto retryOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n\n        std::string uploadFileMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadFileMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(uploadFileMd5, downloadFileMd5);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableDownloadRetryWithCheckpointTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"MultiDownloadObjectRetryWithCheckpoint\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"MultiDownloadObjectRetryWithCheckpoint\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n        std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        // upload object\n        auto uploadOutcome = Client->PutObject(BucketName, key, tmpFile);\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download object\n        int threadNum = 1 + rand() % 100;\n        DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, threadNum);\n        request.setFlags(request.Flags() | DownloadPartFailedFlag);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // retry\n        request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n        auto retryOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n\n        std::string uploadFileMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadFileMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(uploadFileMd5, downloadFileMd5);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadRetryWithSourceObjectDeletedTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalDownloadObjectRetryWithSourceObjectDeleted\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalDownloadObjectRetryWithSourceObjectDeleted\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n        std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        // put object\n        auto putObjectOutcome = Client->PutObject(BucketName, key, tmpFile);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download object\n        DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, 1);\n        request.setFlags(request.Flags() | DownloadPartFailedFlag);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // delete source object\n        auto deleteObjectOutcome = Client->DeleteObject(BucketName, key);\n        EXPECT_EQ(deleteObjectOutcome.isSuccess(), true);\n\n        // retry\n        request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n        auto retryOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), false);\n\n        std::string checkpointFile = GetCheckpointFileByResumableDownloader(BucketName, key, checkpointDir, targetFile);\n        EXPECT_EQ(RemoveFile(checkpointFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveFile(targetFile.append(\".temp\")), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadRetryWithCheckpointFileChangedTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalDownloadObjectRetryWithCheckpointFileChanged\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalDownloadObjectRetryWithCheckpointFileChanged\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n        std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto uploadOutcome = Client->PutObject(BucketName, key, tmpFile);\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download object\n        DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, 1);\n        request.setFlags(request.Flags() | DownloadPartFailedFlag);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // change the checkpoint file\n        std::string checkpointFile = GetCheckpointFileByResumableDownloader(BucketName, key, checkpointDir, targetFile);\n        std::string checkpointTmpFile = std::string(checkpointFile).append(\".tmp\");\n        std::ifstream jsonStream(checkpointFile, std::ios::in | std::ios::binary);\n        Json::CharReaderBuilder rbuilder;\n        Json::Value readRoot;\n        Json::Value writeRoot;\n        std::string invaliedKey = \"InvaliedKey\";\n        if (Json::parseFromStream(rbuilder, jsonStream, &readRoot, nullptr)) {\n        //if (reader.parse(jsonStream, readRoot)) {\n            writeRoot[\"opType\"] = readRoot[\"opType\"].asString();\n            writeRoot[\"bucket\"] = readRoot[\"bucket\"].asString();\n            writeRoot[\"key\"] = invaliedKey;\n            writeRoot[\"filePath\"] = readRoot[\"filePath\"].asString();\n            writeRoot[\"mtime\"] = readRoot[\"mtime\"].asString();\n            writeRoot[\"sizesize\"] = readRoot[\"size\"].asUInt64();\n            writeRoot[\"partSize\"] = readRoot[\"partSize\"].asUInt64();\n\n            for (uint32_t i = 0; i < readRoot[\"parts\"].size(); i++) {\n                Json::Value partValue = readRoot[\"parts\"][i];\n                writeRoot[\"parts\"][i][\"partNumber\"] = partValue[\"partNumber\"].asInt();\n                writeRoot[\"parts\"][i][\"size\"] = partValue[\"size\"].asInt64();\n                writeRoot[\"parts\"][i][\"crc64\"] = partValue[\"crc64\"].asUInt64();\n            }\n            writeRoot[\"md5Sum\"] = readRoot[\"md5Sum\"].asString();\n\n            if (readRoot[\"rangeStart\"] != Json::nullValue && readRoot[\"rangeEnd\"] != Json::nullValue) {\n                writeRoot[\"rangeStart\"] = readRoot[\"rangeStart\"].asInt64();\n                writeRoot[\"rangeEnd\"] = readRoot[\"rangeEnd\"].asInt64();\n            }\n        }\n        jsonStream.close();\n\n        std::fstream recordStream(checkpointTmpFile, std::ios::out);\n        if (recordStream.is_open()) {\n            recordStream << writeRoot;\n        }\n        recordStream.close();\n        EXPECT_EQ(RemoveFile(checkpointFile), true);\n        EXPECT_EQ(RenameFile(checkpointTmpFile, checkpointFile), true);\n\n        // retry\n        request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n        auto retryOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n\n        std::string sourceFileMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string targetFileMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(sourceFileMd5, targetFileMd5);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableDownloadRetryWithCheckpointFileChangedTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"MultiDownloadObjectRetryWithCheckpointFileChanged\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"MultiDownloadObjectRetryWithCheckpointFileChanged\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (2 + rand() % 10));\n        std::string targetFile = TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto uploadOutcome = Client->PutObject(BucketName, key, tmpFile);\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download object\n        int threadNum = 1 + rand() % 100;\n        DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, threadNum);\n        request.setFlags(request.Flags() | DownloadPartFailedFlag);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // change the checkpoint file\n        std::string checkpointFile = GetCheckpointFileByResumableDownloader(BucketName, key, checkpointDir, targetFile);\n        std::string checkpointTmpFile = std::string(checkpointFile).append(\".tmp\");\n        std::ifstream jsonStream(checkpointFile, std::ios::in | std::ios::binary);\n        Json::CharReaderBuilder rbuilder;\n        Json::Value readRoot;\n        Json::Value writeRoot;\n        std::string invaliedKey = \"InvaliedKey\";\n        if (Json::parseFromStream(rbuilder, jsonStream, &readRoot, nullptr)) {\n        //if (reader.parse(jsonStream, readRoot)) {\n            writeRoot[\"opType\"] = readRoot[\"opType\"].asString();\n            writeRoot[\"bucket\"] = readRoot[\"bucket\"].asString();\n            writeRoot[\"key\"] = invaliedKey;\n            writeRoot[\"filePath\"] = readRoot[\"filePath\"].asString();\n            writeRoot[\"mtime\"] = readRoot[\"mtime\"].asString();\n            writeRoot[\"sizesize\"] = readRoot[\"size\"].asUInt64();\n            writeRoot[\"partSize\"] = readRoot[\"partSize\"].asUInt64();\n\n            for (uint32_t i = 0; i < readRoot[\"parts\"].size(); i++) {\n                Json::Value partValue = readRoot[\"parts\"][i];\n                writeRoot[\"parts\"][i][\"partNumber\"] = partValue[\"partNumber\"].asInt();\n                writeRoot[\"parts\"][i][\"size\"] = partValue[\"size\"].asInt64();\n                writeRoot[\"parts\"][i][\"crc64\"] = partValue[\"crc64\"].asUInt64();\n            }\n            writeRoot[\"md5Sum\"] = readRoot[\"md5Sum\"].asString();\n\n            if (readRoot[\"rangeStart\"] != Json::nullValue && readRoot[\"rangeEnd\"] != Json::nullValue) {\n                writeRoot[\"rangeStart\"] = readRoot[\"rangeStart\"].asInt64();\n                writeRoot[\"rangeEnd\"] = readRoot[\"rangeEnd\"].asInt64();\n            }\n        }\n        jsonStream.close();\n\n        std::fstream recordStream(checkpointTmpFile, std::ios::out);\n        if (recordStream.is_open()) {\n            recordStream << writeRoot;\n        }\n        recordStream.close();\n        EXPECT_EQ(RemoveFile(checkpointFile), true);\n        EXPECT_EQ(RenameFile(checkpointTmpFile, checkpointFile), true);\n\n        // retry\n        request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n        auto retryOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n\n        std::string sourceFileMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string targetFileMd5 = TestUtils::GetFileMd5(targetFile);\n        EXPECT_EQ(sourceFileMd5, targetFileMd5);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadWithProgressCallbackTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectWithProgressCallback\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithProgressCallback\");\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        std::cout << \"this ptr:\" << this << std::endl;\n        TransferProgress progressCallback = { ProgressCallback, this };\n        DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n        request.setTransferProgress(progressCallback);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadProgressCallbackWithDownloadPartFailedTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectProgressCallbackWithPartFailed\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectProgressCallbackWithPartFailed\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        TransferProgress progressCallback = { ProgressCallback, this };\n        DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n        request.setCheckpointDir(checkpointDir);\n        request.setTransferProgress(progressCallback);\n        request.setFlags(request.Flags() | DownloadPartFailedFlag);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        std::cout << \"Retry : \" << std::endl;\n        request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n        auto retryOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(targetKey), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadWithRangeLength)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectWithRangeLength\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithRangeLength\");\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n        request.setPartSize(102400);\n        request.setRange(20, 30);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(outcome.result().Metadata().ContentLength(), 30 - 20 + 1);\n        EXPECT_EQ(RemoveFile(targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadWithErrorRangeLength)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectWithErrorRangeLength\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithErrorRangeLength\");\n        int length = 102400 * (2 + rand() % 10);\n        auto putObjectContent = TestUtils::GetRandomStream(length);\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n        request.setPartSize(102400);\n        request.setRange(20, -1);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(targetKey), true);\n        EXPECT_EQ(outcome.result().Metadata().ContentLength(), length - 20);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableDownloadWithErrorRangeLength)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"UnnormalDownloadSourceObjectWithErrorRangeLength\");\n        std::string targetKey = TestUtils::GetObjectKey(\"UnnormalDownloadTargetObjectWithErrorRangeLength\");\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * 2);\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n        request.setPartSize(102400);\n        request.setRange(102400, 20);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableDwoanloadWithThreadNumberOverPartNumber)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"MultiDownloadSourceObjectWithThreadNumberOverPartNumber\");\n        std::string targetKey = TestUtils::GetObjectKey(\"MultiDownloadTargetObjectWithThreadNumberOverPartNumber\");\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // download\n        int threadNum = 0;\n        DownloadObjectRequest request(BucketName, sourceKey, targetKey, \"\");\n        request.setPartSize(102400);\n        request.setThreadNum(threadNum);\n        auto invalidateOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(invalidateOutcome.isSuccess(), false);\n\n        threadNum = 20;\n        request.setThreadNum(threadNum);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDwoanloadWithResponseHeadersSetTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"MultiDownloadSourceObjectWithResponseHeadersSetTest\");\n        std::string targetKey = TestUtils::GetObjectKey(\"MultiDownloadTargetObjectWithResponseHeadersSetTest\");\n        int length = 102400 * (2 + rand() % 10);\n        auto putObjectContent = TestUtils::GetRandomStream(length);\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // download\n        DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        request.addResponseHeaders(RequestResponseHeader::CacheControl, \"max-age=3\");\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(outcome.result().Metadata().CacheControl(), \"max-age=3\");\n        EXPECT_EQ(outcome.result().Metadata().ContentLength(), length);\n        EXPECT_EQ(RemoveFile(targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadWithModifiedSetTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectWithModifiedSetTest\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithModifiedSetTest\");\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // download\n        DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n        request.setPartSize(102400);\n\n        // error set Modified-Since time\n        request.setModifiedSinceConstraint(TestUtils::GetGMTString(100));\n        auto modifiedOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(modifiedOutcome.isSuccess(), false);\n        EXPECT_EQ(modifiedOutcome.error().Code(), \"ServerError:304\");\n\n        // error set Unmodified-Since time \n        request.setModifiedSinceConstraint(TestUtils::GetGMTString(0));\n        request.setUnmodifiedSinceConstraint(TestUtils::GetGMTString(-100));\n        auto unmodifiedOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(unmodifiedOutcome.isSuccess(), false);\n        EXPECT_EQ(unmodifiedOutcome.error().Code(), \"PreconditionFailed\");\n\n        // normal download\n        request.setModifiedSinceConstraint(TestUtils::GetGMTString(-100));\n        request.setUnmodifiedSinceConstraint(TestUtils::GetGMTString(100));\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadWithMatchSetTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectWithMatchSetTest\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithMatchSetTest\");\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        auto hOutcom = Client->HeadObject(BucketName, sourceKey);\n        EXPECT_EQ(hOutcom.isSuccess(), true);\n        std::string realETag = hOutcom.result().ETag();\n        std::vector<std::string> eTagMatchList;\n        std::vector<std::string> eTagNoneMatchList;\n\n        // download\n        DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n        request.setPartSize(102400);\n\n        // error set If-Match\n        eTagMatchList.push_back(\"invalidateETag\");\n        request.setMatchingETagConstraints(eTagMatchList);\n        auto matchOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(matchOutcome.isSuccess(), false);\n        EXPECT_EQ(matchOutcome.error().Code(), \"PreconditionFailed\");\n\n        // error set If-None-Match\n        eTagMatchList.clear();\n        eTagNoneMatchList.push_back(realETag);\n        request.setMatchingETagConstraints(eTagMatchList);\n        request.setNonmatchingETagConstraints(eTagNoneMatchList);\n        auto noneMatchOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(noneMatchOutcome.isSuccess(), false);\n        EXPECT_EQ(noneMatchOutcome.error().Code(), \"ServerError:304\");\n       \n        // normal download\n        eTagNoneMatchList.clear();\n        eTagMatchList.push_back(realETag);\n        eTagNoneMatchList.push_back(\"invalidateETag\");\n        request.setMatchingETagConstraints(eTagMatchList);\n        request.setNonmatchingETagConstraints(eTagNoneMatchList);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(outcome.result().Metadata().ContentLength(), hOutcom.result().ContentLength());\n        EXPECT_EQ(RemoveFile(targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDwoanloadWithoutCRCCheckTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalResumableDwoanloadWithoutCRCCheckTest\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalResumableDwoanloadWithoutCRCCheckTest\");\n        int length = 102400 * (2 + rand() % 10);\n        auto putObjectContent = TestUtils::GetRandomStream(length);\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // download\n        ClientConfiguration conf;\n        conf.enableCrc64 = false;\n        OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n        DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        request.addResponseHeaders(RequestResponseHeader::CacheControl, \"max-age=3\");\n        auto outcome = client.ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(outcome.result().Metadata().CacheControl(), \"max-age=3\");\n        EXPECT_EQ(outcome.result().Metadata().ContentLength(), length);\n        EXPECT_EQ(RemoveFile(targetKey), true);\n    }\n\n\n    TEST_F(ResumableObjectTest, UnnormalResumableCopyObjectWithDisableRequest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"UnnormalResumableCopyObjectSourceKey\");\n        std::string targetKey = TestUtils::GetObjectKey(\"UnnormalResumableCopyObjectTargetKey\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalResumableCopyObject\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 102400 * (1 + rand() % 10));\n        // upload object\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, tmpFile);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // copy object\n        Client->DisableRequest();\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ClientError:100002\");\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        Client->EnableRequest();\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableCopyOperationTest)\n    {\n        std::string sourceBucket = TestUtils::GetBucketName(\"unormal-resumable-copy-bucket-source\");\n        std::string targetBucket = TestUtils::GetBucketName(\"unormal-resumable-copy-bucket-target\");\n        std::string sourceKey = TestUtils::GetObjectKey(\"UnnormalCopyObjectSourceKey\");\n        std::string targetKey = TestUtils::GetObjectKey(\"UnnormalCopyObjectTargetKey\");\n        EXPECT_EQ(Client->CreateBucket(sourceBucket).isSuccess(), true);\n        EXPECT_EQ(Client->CreateBucket(targetBucket).isSuccess(), true);\n\n        // put object into source bucket\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(PutObjectRequest(sourceBucket, sourceKey, putObjectContent));\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n\n        // Copy Object to non-existent target bucket\n        {\n            MultiCopyObjectRequest request(\"notexist-target-bucket\", targetKey, sourceBucket, sourceKey);\n            auto outcome = Client->ResumableCopyObject(request);\n            EXPECT_EQ(outcome.isSuccess(), false);\n            EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\n        }\n        // Copy Object to non-existent source bucket\n        {\n            MultiCopyObjectRequest request(targetBucket, targetKey, \"notexist-source-bucket\", sourceKey);\n            auto outcome = Client->ResumableCopyObject(request);\n            EXPECT_EQ(outcome.isSuccess(), false);\n        }\n        // Copy Object with non-existent source key\n        {\n            MultiCopyObjectRequest request(targetBucket, targetKey, sourceBucket, \"notexist-source-key\");\n            auto outcome = Client->ResumableCopyObject(request);\n            EXPECT_EQ(outcome.isSuccess(), false);\n        }\n        // set illegal partsize parameter\n        {\n            MultiCopyObjectRequest request(targetBucket, targetKey, sourceBucket, sourceKey);\n            request.setPartSize(rand() % 102400 - 1);\n            auto outcome = Client->ResumableCopyObject(request);\n            EXPECT_EQ(outcome.isSuccess(), false);\n        }\n\n        TestUtils::CleanBucket(*Client, sourceBucket);\n        TestUtils::CleanBucket(*Client, targetBucket);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyWithSizeOverPartSizeTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectOverPartSize\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectOverPartSize\");\n        // put object into bucket\n        int num = 1 + rand() % 10;\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * num);\n        auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // Copy Object\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyWithSizeUnderPartSizeTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectUnderPartSize\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectUnderPartSize\");\n        // put Object into bucket\n        auto putObjectContent = TestUtils::GetRandomStream(1024 * (rand() % 100));\n        auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // copy object\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n        request.setPartSize(100 * 1024 + 1);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableCopyWithSizeOverPartSizeTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"MultiCopySourceObjectOverPartSize\");\n        std::string targetKey = TestUtils::GetObjectKey(\"MultiCopyTargetObjectOverPartSize\");\n        // put object\n        auto putObjectContent = TestUtils::GetRandomStream(1024 * 100 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // copy object\n        int threadNum = 1 + rand() % 100;\n        std::string checkpointDir = TestUtils::GetExecutableDirectory();\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n        request.setPartSize(1024 * 100 + 1);\n        request.setThreadNum(threadNum);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableCopyWithEmptyTargetKeyTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"UnnormalCopyObjectSourceKeyWithEmptyTargetKey\");\n        std::string targetKey;\n\n        // put object into source bucket\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // copy object\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n        request.setPartSize(102401);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableCopyWithNotExistCheckpointTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"UnnormalCopySourceObjectWithNotExistCheckpoint\");\n        std::string targetKey = TestUtils::GetObjectKey(\"UnnormalCopyTargetObjectWithNotExistCheckpoint\");\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjcetOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n        EXPECT_EQ(putObjcetOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        std::string checkpointDir = \"NotExistCheckpointDir\";\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n        request.setPartSize(102401);\n        request.setCheckpointDir(checkpointDir);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyWithCheckpointTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectWithCheckpoint\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectWithCheckpoint\");\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjcetOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n        EXPECT_EQ(putObjcetOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        request.setCheckpointDir(TestUtils::GetExecutableDirectory());\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableCopyWithCheckpointTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"MultiCopySourceObjectWithCheckpoint\");\n        std::string targetKey = TestUtils::GetObjectKey(\"MultiCopyTargetObjectWithCheckpoint\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjcetOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n        EXPECT_EQ(putObjcetOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey,\n            checkpointDir, 102401, (2 + rand() % 10));\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableCopyWithUploadPartCopyFailedTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"UnnormalCopySourceObjectWithUploadPartCopyFailed\");\n        std::string targetKey = TestUtils::GetObjectKey(\"UnnormalCopyTargetObjectWithUploadPartCopyFailed\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, checkpointDir, 102401, 1);\n        request.setFlags(request.Flags() | CopyPartFailedFlag);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), false);\n\n        std::string checkpointFile = GetCheckpointFileByResumableCopier(BucketName, targetKey, BucketName, sourceKey, checkpointDir);\n        EXPECT_EQ(RemoveFile(checkpointFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnMultiResumableCopyWithUploadPartCopyFailedTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"MultiCopySourceObjectWithUploadPartCopyFailed\");\n        std::string targetKey = TestUtils::GetObjectKey(\"MultiCopyTargetObjectWithUploadPartCopyFailed\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        int threadNum = 1 + rand() % 100;\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, checkpointDir, 102400, threadNum);\n        request.setFlags(request.Flags() | CopyPartFailedFlag);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), false);\n\n        std::string checkpointFile = GetCheckpointFileByResumableCopier(BucketName, targetKey, BucketName, sourceKey, checkpointDir);\n        EXPECT_EQ(RemoveFile(checkpointFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyRetryWithUploadPartCopyFailedTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectRetryWithUploadPartCopyFailed\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectRetryWithUploadPartCopyFailed\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, checkpointDir, 102401, 1);\n        request.setFlags(request.Flags() | CopyPartFailedFlag);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), false);\n\n        // retry\n        request.setFlags(request.Flags() ^ CopyPartFailedFlag);\n        auto retryOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableCopyRetryWithUploadPartCopyFailedTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"MultiCopySourceObjectRetryWithUploadPartCopyFailed\");\n        std::string targetKey = TestUtils::GetObjectKey(\"MultiCopyTargetObjectRetryWithUploadPartCopyFailed\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        int threadNum = 1 + rand() % 100;\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, checkpointDir, 102401, threadNum);\n        request.setFlags(request.Flags() | CopyPartFailedFlag);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), false);\n\n        // retry\n        request.setFlags(request.Flags() ^ CopyPartFailedFlag);\n        auto retryOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableCopyRetryWithSourceObjectDeletedTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"UnnormalCopySourceObjectRetryWithSourceObjectDeleted\");\n        std::string targetKey = TestUtils::GetObjectKey(\"UnnormalCopyTargetObjectRetryWithSourceObjectDeleted\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, checkpointDir, 102401, 1);\n        request.setFlags(request.Flags() | CopyPartFailedFlag);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), false);\n\n        // delete the source object\n        auto deleteObjectOutcome = Client->DeleteObject(BucketName, sourceKey);\n        EXPECT_EQ(deleteObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), false);\n\n        // retry\n        request.setFlags(request.Flags() ^ CopyPartFailedFlag);\n        auto retryOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), false);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), false);\n\n        std::string checkpointFile = GetCheckpointFileByResumableCopier(BucketName, targetKey, BucketName, sourceKey, checkpointDir);\n        EXPECT_EQ(RemoveFile(checkpointFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnMultiResumableCopyRetryWithSourceObjectDeletedTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"UnMultiCopySourceObjectRetryWithSourceObjectDeleted\");\n        std::string targetKey = TestUtils::GetObjectKey(\"UnMultiCopyTargetObjectRetryWithSourceObjectDeleted\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        int threadNum = 1 + rand() % 100;\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, checkpointDir, 102401, threadNum);\n        request.setFlags(request.Flags() | CopyPartFailedFlag);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), false);\n\n        // delete the source object\n        auto deleteObjectOutcome = Client->DeleteObject(BucketName, sourceKey);\n        EXPECT_EQ(deleteObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), false);\n\n        // retry\n        request.setFlags(request.Flags() ^ CopyPartFailedFlag);\n        auto retryOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), false);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), false);\n\n        std::string checkpointFile = GetCheckpointFileByResumableCopier(BucketName, targetKey, BucketName, sourceKey, checkpointDir);\n        EXPECT_EQ(RemoveFile(checkpointFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyRetryWithCheckpointFileChangedTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"source\");\n        std::string targetKey = TestUtils::GetObjectKey(\"target\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, checkpointDir, 102401, 1);\n        request.setFlags(request.Flags() | CopyPartFailedFlag);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), false);\n\n        // modify checkpoint file\n        std::string checkpointFile = GetCheckpointFileByResumableCopier(BucketName, targetKey, BucketName, sourceKey, checkpointDir);\n        std::string checkpointTmpFile = std::string(checkpointFile).append(\".tmp\");\n        std::ifstream jsonStream(checkpointFile, std::ios::in | std::ios::binary);\n        Json::CharReaderBuilder rbuilder;\n        Json::Value readRoot;\n        Json::Value writeRoot;\n        std::string uploadID = \"InvaliedUploadID\";\n        if (Json::parseFromStream(rbuilder, jsonStream, &readRoot, nullptr)) {\n        //if (reader.parse(jsonStream, readRoot)) {\n            writeRoot[\"opType\"] = readRoot[\"opType\"].asString();\n            writeRoot[\"uploadID\"] = uploadID;\n            writeRoot[\"srcBucket\"] = readRoot[\"srcBucket\"].asString();\n            writeRoot[\"srcKey\"] = readRoot[\"srckey\"].asString();\n            writeRoot[\"bucket\"] = readRoot[\"bucket\"].asString();\n            writeRoot[\"key\"] = readRoot[\"key\"].asString();\n            writeRoot[\"size\"] = readRoot[\"size\"].asUInt64();\n            writeRoot[\"mtime\"] = readRoot[\"mtime\"].asString();\n            writeRoot[\"partSize\"] = readRoot[\"partSize\"].asUInt64();\n            writeRoot[\"md5Sum\"] = readRoot[\"md5Sum\"].asString();\n        }\n        jsonStream.close();\n\n        std::fstream recordStream(checkpointTmpFile, std::ios::out);\n        if (recordStream.is_open()) {\n            recordStream << writeRoot;\n        }\n        recordStream.close();\n        EXPECT_EQ(RemoveFile(checkpointFile), true);\n        EXPECT_EQ(RenameFile(checkpointTmpFile, checkpointFile), true);\n\n        // retry\n        request.setFlags(request.Flags() ^ CopyPartFailedFlag);\n        auto retryOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableCopyRetryWithCheckpointFileChangedTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"source\");\n        std::string targetKey = TestUtils::GetObjectKey(\"target\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        int threadNum = 1 + rand() % 100;\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, checkpointDir, 102401, threadNum);\n        request.setFlags(request.Flags() | CopyPartFailedFlag);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), false);\n\n        // modify checkpoint file\n        std::string checkpointFile = GetCheckpointFileByResumableCopier(BucketName, targetKey, BucketName, sourceKey, checkpointDir);\n        std::string checkpointTmpFile = std::string(checkpointFile).append(\".tmp\");\n        std::ifstream jsonStream(checkpointFile, std::ios::in | std::ios::binary);\n        Json::CharReaderBuilder rbuilder;\n        Json::Value readRoot;\n        Json::Value writeRoot;\n        std::string uploadID = \"InvaliedUploadID\";\n        if (Json::parseFromStream(rbuilder, jsonStream, &readRoot, nullptr)) {\n        //if (reader.parse(jsonStream, readRoot)) {\n            writeRoot[\"opType\"] = readRoot[\"opType\"].asString();\n            writeRoot[\"uploadID\"] = uploadID;\n            writeRoot[\"srcBucket\"] = readRoot[\"srcBucket\"].asString();\n            writeRoot[\"srcKey\"] = readRoot[\"srckey\"].asString();\n            writeRoot[\"bucket\"] = readRoot[\"bucket\"].asString();\n            writeRoot[\"key\"] = readRoot[\"key\"].asString();\n            writeRoot[\"size\"] = readRoot[\"size\"].asUInt64();\n            writeRoot[\"mtime\"] = readRoot[\"mtime\"].asString();\n            writeRoot[\"partSize\"] = readRoot[\"partSize\"].asUInt64();\n            writeRoot[\"md5Sum\"] = readRoot[\"md5Sum\"].asString();\n        }\n        jsonStream.close();\n\n        std::fstream recordStream(checkpointTmpFile, std::ios::out);\n        if (recordStream.is_open()) {\n            recordStream << writeRoot;\n        }\n        recordStream.close();\n        EXPECT_EQ(RemoveFile(checkpointFile), true);\n        EXPECT_EQ(RenameFile(checkpointTmpFile, checkpointFile), true);\n\n        // retry\n        request.setFlags(request.Flags() ^ CopyPartFailedFlag);\n        auto retryOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyRetryWithUploadAbortTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalResumableCopyRetryWithUploadAbortTest\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalResumableCopyRetryWithUploadAbortTest-target\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, checkpointDir, 102401, 1);\n        request.setFlags(request.Flags() | CopyPartFailedFlag);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), false);\n\n        // abort upload Id\n        ListMultipartUploadsRequest lmuRequest(BucketName);\n        lmuRequest.setPrefix(targetKey);\n        auto lmuOutcome = Client->ListMultipartUploads(lmuRequest);\n        EXPECT_EQ(lmuOutcome.isSuccess(), true);\n        EXPECT_EQ(lmuOutcome.result().MultipartUploadList().size(), 1UL);\n        auto uploadId = lmuOutcome.result().MultipartUploadList()[0].UploadId;\n        AbortMultipartUploadRequest abortRequest(BucketName, targetKey, uploadId);\n        auto abortOutcome = Client->AbortMultipartUpload(abortRequest);\n        EXPECT_EQ(abortOutcome.isSuccess(), true);\n\n        // retry\n        request.setFlags(request.Flags() ^ CopyPartFailedFlag);\n        auto retryOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyWithProgressCallbackTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectWithProgressCallback\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithProgressCallback\");\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        TransferProgress progressCallback = { ProgressCallback, this };\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n        request.setTransferProgress(progressCallback);\n        request.setPartSize(102400);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyProgressCallbackWithCopyPartFailedTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectProgressCallbackWithPartFailed\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectProgressCallbackWithPartFailed\");\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        TransferProgress progressCallback = { ProgressCallback, this };\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n        request.setTransferProgress(progressCallback);\n        request.setFlags(request.Flags() | CopyPartFailedFlag);\n        request.setCheckpointDir(checkpointDir);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        // retry\n        std::cout << \"Retry : \" << std::endl;\n        request.setFlags(request.Flags() ^ CopyPartFailedFlag);\n        auto retryOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableCopyWithThreadNumberOverPartNumber)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"MultiCopySourceObjectWithThreadNumberOverPartNumber\");\n        std::string targetKey = TestUtils::GetObjectKey(\"MultiCopyTargetObjectWithThreadNumberOverPartNumber\");\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // copy\n        int threadNum = 0;\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, \"\");\n        request.setPartSize(102400);\n        request.setThreadNum(threadNum);\n        auto invalidateOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(invalidateOutcome.isSuccess(), false);\n\n        threadNum = 20;\n        request.setThreadNum(threadNum);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyWithObjectMetaDataSetTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectWithObjectMetaDataSet\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectWithObjectMetaDataSet\");\n\n        // put object\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        ObjectMetaData meta;\n        meta.setCacheControl(\"max-age=3\");\n        meta.setExpirationTime(\"Fri, 09 Nov 2018 05:57:16 GMT\");\n        // copy object\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, \"\", meta);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n\n        auto hOutcome = Client->HeadObject(BucketName, targetKey);\n        EXPECT_EQ(hOutcome.isSuccess(), true);\n        EXPECT_EQ(hOutcome.result().CacheControl(), \"max-age=3\");\n        EXPECT_EQ(hOutcome.result().ExpirationTime(), \"Fri, 09 Nov 2018 05:57:16 GMT\");\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyWithUserMetaDataSetTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectWithUserMetaDataSet\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectWithUserMetaDataSet\");\n\n        // put object\n        ObjectMetaData meta;\n        meta.UserMetaData()[\"test\"] = \"testvalue\";\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent, meta);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        \n        auto putObjectHeadOutcome = Client->HeadObject(BucketName, sourceKey);\n        EXPECT_EQ(putObjectHeadOutcome.isSuccess(), true);\n        EXPECT_EQ(putObjectHeadOutcome.result().UserMetaData().at(\"test\"), \"testvalue\");\n\n        // copy object\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, \"\", 102400, 1, meta);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n\n        auto hOutcome = Client->HeadObject(BucketName, targetKey);\n        EXPECT_EQ(hOutcome.isSuccess(), true);\n        EXPECT_EQ(hOutcome.result().UserMetaData().at(\"test\"), \"testvalue\");\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyWithModifiedSetTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectWithModifiedSetTest\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectWithModifiedSetTest\");\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // copy\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n\n        // error set Modified-Since time\n        request.setSourceIfModifiedSince(TestUtils::GetGMTString(100));\n        auto modifiedOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(modifiedOutcome.isSuccess(), false);\n        EXPECT_EQ(modifiedOutcome.error().Code(), \"ServerError:304\");\n\n        // error set Unmodifird-Since time\n        request.setSourceIfModifiedSince(TestUtils::GetGMTString(0));\n        request.setSourceIfUnModifiedSince(TestUtils::GetGMTString(-100));\n        auto unmodifiedOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(unmodifiedOutcome.isSuccess(), false);\n        EXPECT_EQ(unmodifiedOutcome.error().Code(), \"PreconditionFailed\");\n\n        // normal copy\n        request.setSourceIfModifiedSince(TestUtils::GetGMTString(-100));\n        request.setSourceIfUnModifiedSince(TestUtils::GetGMTString(100));\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyWithMatchSetTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectWithMatchSetTest\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectWithMatchSetTest\");\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        auto hOutcome = Client->HeadObject(BucketName, sourceKey);\n        EXPECT_EQ(hOutcome.isSuccess(), true);\n        std::string realETag = hOutcome.result().ETag();\n        std::vector<std::string> eTagMatchList;\n        std::vector<std::string> eTagNoneMatchList;\n\n        // copy\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n\n        // error set If-Match\n        request.setSourceIfMatchEtag(\"invalidateETag\");\n        auto matchOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(matchOutcome.isSuccess(), false);\n        EXPECT_EQ(matchOutcome.error().Code(), \"PreconditionFailed\");\n\n        // error set If-None-Match\n        request.setSourceIfMatchEtag(realETag);\n        request.setSourceIfNotMatchEtag(realETag);\n        auto noneMatchOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(noneMatchOutcome.isSuccess(), false);\n        EXPECT_EQ(noneMatchOutcome.error().Code(), \"ServerError:304\");\n\n        // normal copy\n        request.setSourceIfMatchEtag(realETag);\n        request.setSourceIfNotMatchEtag(\"invalidateETag\");\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyWithMetadataDirectiveTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectWithMetadataDirectiveTest\");\n        std::string copyTargetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectWithCopyMetadataTest\");\n        std::string replaceTargetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectWithReplaceMetadataDirectiveTest\");\n\n        // put object\n        ObjectMetaData meta;\n        meta.UserMetaData()[\"copy\"] = \"copyvalue\";\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent, meta);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // normal copy meta\n        MultiCopyObjectRequest copyRequest(BucketName, copyTargetKey, BucketName, sourceKey);\n        copyRequest.setPartSize(102400);\n        copyRequest.setThreadNum(1);\n        copyRequest.setMetadataDirective(CopyActionList::Copy);\n        auto copyOutcome = Client->ResumableCopyObject(copyRequest);\n        EXPECT_EQ(copyOutcome.isSuccess(), true);\n        auto copyHeadOutcome = Client->HeadObject(HeadObjectRequest(BucketName, copyTargetKey));\n        EXPECT_EQ(copyHeadOutcome.isSuccess(), true);\n        EXPECT_EQ(copyHeadOutcome.result().UserMetaData().at(\"copy\"), \"copyvalue\");\n\n        // replace \n        ObjectMetaData replaceMeta;\n        replaceMeta.UserMetaData()[\"replace\"] = \"replacevalue\";\n        MultiCopyObjectRequest replaceRequest(BucketName, replaceTargetKey, BucketName, sourceKey, \"\", replaceMeta);\n        replaceRequest.setPartSize(102400);\n        replaceRequest.setMetadataDirective(CopyActionList::Replace);\n        auto replaceOutcome = Client->ResumableCopyObject(replaceRequest);\n        EXPECT_EQ(replaceOutcome.isSuccess(), true);\n        auto replaceHeadOutcome = Client->HeadObject(HeadObjectRequest(BucketName, replaceTargetKey));\n        EXPECT_EQ(replaceHeadOutcome.isSuccess(), true);\n        EXPECT_EQ(replaceHeadOutcome.result().UserMetaData().at(\"replace\"), \"replacevalue\");\n        EXPECT_EQ(replaceHeadOutcome.result().UserMetaData().find(\"copy\") == replaceHeadOutcome.result().UserMetaData().end(), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyWithObjectAclSetTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectWithObjectAclSetTest\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectWithObjectAclSetTest\");\n        // put object\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // set acl\n        auto aclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName, sourceKey));\n        EXPECT_EQ(aclOutcome.isSuccess(), true);\n        EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::Default);\n\n        // copy\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n        request.setPartSize(102400);\n        request.setAcl(CannedAccessControlList::PublicReadWrite);\n        request.setEncodingType(\"url\");\n        EXPECT_EQ(request.EncodingType(), \"url\");\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n\n        auto copyAclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName, targetKey));\n        EXPECT_EQ(copyAclOutcome.isSuccess(), true);\n        EXPECT_EQ(copyAclOutcome.result().Acl(), CannedAccessControlList::PublicReadWrite);\n    }\n\n    TEST_F(ResumableObjectTest, ResumableUploadWithProgressCallbackTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalResumableUploadObjectWithCallback\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalResumableUploadObjectWithCallback\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 102400);\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n        std::cout << \"this ptr:\" << this << std::endl;\n        TransferProgress progressCallback = { ProgressCallback, this };\n        UploadObjectRequest request(BucketName, key, tmpFile, checkpointDir, 102400, 1);\n        request.setTransferProgress(progressCallback);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadWithRangeAndProgressCallbackTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalDownloadSourceObjectWithRangeLength\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalDownloadTargetObjectWithRangeLength\");\n        auto putObjectContent = TestUtils::GetRandomStream(102400 - 1);\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        TransferProgress progressCallback = { ProgressCallback, this };\n        DownloadObjectRequest request(BucketName, sourceKey, targetKey);\n        request.setPartSize(102400);\n        request.setRange(20, 30);\n        request.setThreadNum(1);\n        request.setTransferProgress(progressCallback);\n\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(outcome.result().Metadata().ContentLength(), 30 - 20 + 1);\n        EXPECT_EQ(RemoveFile(targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, OssResumableBaseRequestTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalResumableUploadObjectWithCallback\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalResumableUploadObjectWithCallback\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 102400);\n        std::string checkpointDir = TestUtils::GetTargetFileName(\"checkpoint\");\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        UploadObjectRequest request(BucketName, key, tmpFile, checkpointDir, 102400, 1);\n        request.setBucket(BucketName);\n        request.setKey(key);\n        request.setObjectSize(102400);\n        request.setObjectMtime(\"invalid\");\n\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, ResumableCopierTrafficLimitTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectWithMetadataDirectiveTest\");\n        std::string copyTargetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectWithCopyMetadataTest\");\n        std::string replaceTargetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectWithReplaceMetadataDirectiveTest\");\n\n        // put object\n        ObjectMetaData meta;\n        meta.UserMetaData()[\"copy\"] = \"copyvalue\";\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent, meta);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        // normal copy meta\n        MultiCopyObjectRequest copyRequest(BucketName, copyTargetKey, BucketName, sourceKey);\n        copyRequest.setPartSize(102400);\n        copyRequest.setThreadNum(1);\n        copyRequest.setTrafficLimit(819201);\n        auto copyOutcome = Client->ResumableCopyObject(copyRequest);\n        EXPECT_EQ(copyOutcome.isSuccess(), true);\n    }\n\n    TEST_F(ResumableObjectTest, DownloadObjectRequestBranchTest)\n    {\n        DownloadObjectRequest request(BucketName, \"test\", \"test\");\n        request.setRange(1,1);\n        Client->ResumableDownloadObject(request);\n\n        OssResumableBaseRequest request1(\"test\",\"test\",\"test\",1,0);\n    }\n\n\n#ifdef _WIN32\n    static std::wstring StringToWString(std::string& str)\n    {\n        //just cover 0x00~0x7f char\n        std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;\n        return converter.from_bytes(str);\n    }\n\n    static std::string WStringToString(std::wstring& str)\n    {\n        //just cover 0x00~0x7f char\n        std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;\n        return converter.to_bytes(str);\n    }\n\n    static void WriteRandomDatatoFile(const std::wstring &file, int length)\n    {\n        std::fstream of(file, std::ios::out | std::ios::binary | std::ios::trunc);\n        of << TestUtils::GetRandomString(length);\n        of.close();\n    }\n\n    static std::string GetFileMd5(const std::wstring file)\n    {\n        std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(file, std::ios::in | std::ios::binary);\n        return ComputeContentMD5(*content);\n    }\n\n    std::wstring GetCheckpointFileByResumableUploaderW(std::string bucket, std::string key, \n        std::wstring checkpointDir, std::wstring filePath)\n    {\n        std::stringstream ss;\n        ss << \"oss://\" << bucket << \"/\" << key;\n        auto destPath = ss.str();\n        auto safeFileName = ComputeContentETag(WStringToString(filePath)) + \"--\" + ComputeContentETag(destPath);\n        return checkpointDir + WPATH_DELIMITER + StringToWString(safeFileName);\n    }\n\n    static std::wstring GetCheckpointFileByResumableDownloaderW(std::string bucket, std::string key, \n        std::wstring checkpointDir, std::wstring filePath)\n    {\n        std::stringstream ss;\n        ss << \"oss://\" << bucket << \"/\" << key;\n        auto srcPath = ss.str();\n        auto safeFileName = ComputeContentETag(srcPath) + \"--\" + ComputeContentETag(WStringToString(filePath));\n        return checkpointDir + WPATH_DELIMITER + StringToWString(safeFileName);\n    }\n\n    static std::wstring GetCheckpointFileByResumableCopierW(std::string bucket, std::string key,\n        std::string srcBucket, std::string srcKey, std::wstring checkpointDir)\n    {\n        std::stringstream ss;\n        ss << \"oss://\" << srcBucket << \"/\" << srcKey;\n        auto srcPath = ss.str();\n        ss.str(\"\");\n        ss << \"oss://\" << bucket << \"/\" << key;\n        auto destPath = ss.str();\n        auto safeFileName = ComputeContentETag(srcPath) + \"--\" + ComputeContentETag(destPath);\n        return checkpointDir + WPATH_DELIMITER + StringToWString(safeFileName);\n    }\n\n    //wstring path\n    TEST_F(ResumableObjectTest, NormalResumableUploadWithSizeOverPartSizeWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"ResumableUploadObjectOverPartSizeW\");\n        std::wstring tmpFile = StringToWString(TestUtils::GetTargetFileName(\"ResumableUploadObjectOverPartSizeW\").append(\".tmp\"));\n        // limit file size between 800KB and 2000KB\n        int num = 8 + rand() % 12;\n        WriteRandomDatatoFile(tmpFile, 1024 * 100 * num + 10);\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        auto getObjectOutcome = Client->GetObject(BucketName, key);\n        EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n\n        auto getoutcome = Client->GetObject(GetObjectRequest(BucketName, key));\n\n        std::fstream file(tmpFile, std::ios::in | std::ios::binary);\n        std::string oriMd5 = ComputeContentMD5(file);\n        std::string memMd5 = ComputeContentMD5(*getObjectOutcome.result().Content());\n        EXPECT_EQ(oriMd5, memMd5);\n\n        file.close();\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadWithSizeUnderPartSizeWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"ResumableUploadObjectUnderPartSizeW\");\n        std::wstring tmpFile = StringToWString(TestUtils::GetTargetFileName(\"ResumableUploadObjectUnderPartSizeW\").append(\".tmp\"));\n        int num = rand() % 8;\n        WriteRandomDatatoFile(tmpFile, 10240 * num);\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        auto getObjectOutcome = Client->GetObject(BucketName, key);\n        EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableObjectWithDisableRequestWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalUploadObjectWithDisableRequestW\");\n        std::wstring tmpFile = StringToWString(TestUtils::GetTargetFileName(\"UnnormalUploadObjectWithDisableRequestW\").append(\".tmp\"));\n        WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n        Client->DisableRequest();\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ClientError:100002\");\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        Client->EnableRequest();\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableUploadWithSizeOverPartSizeWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"MultiUploadObjectOverPartSizeW\");\n        std::wstring tmpFile = StringToWString(TestUtils::GetTargetFileName(\"MultiUploadObjectOverPartSizeW\").append(\".tmp\"));\n        int num = 8 + rand() % 12;\n        WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        int threadNum = 1 + rand() % 99;\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(threadNum);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadSetMinPartSizeWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalUploadObjectSetMinPartSizeW\");\n        std::wstring tmpFile = StringToWString(TestUtils::GetTargetFileName(\"NormalUploadObjectSetMinPartSizeW\").append(\".tmp\"));\n        int num = 1 + rand() % 20;\n        WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        int partSize = 1 + rand() % 99;\n\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(partSize * 102400);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableUploadWithoutSourceFilePathWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalUplloadObjectWithoutFilePathW\");\n        std::wstring tmpFile;\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableUploadWithoutRealFileWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalUplloadObjectWithoutRealFileW\");\n        std::wstring tmpFile = StringToWString(TestUtils::GetTargetFileName(\"UnnormalUplloadObjectWithoutRealFileW\").append(\".tmp\"));\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableUploadWithNotExitsCheckpointWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalUploadObjectWithNotExitsCheckpoint\");\n        std::wstring tmpFile = StringToWString(TestUtils::GetTargetFileName(\"UnnormalUploadObjectWithNotExitsCheckpoint\").append(\".tmp\"));\n        WriteRandomDatatoFile(tmpFile, 100);\n\n        UploadObjectRequest request(BucketName, key, tmpFile, L\"NotExistDir\");\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableUploadRetryAfterFailedPartWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalResumableUploadRetryAfterFailedPartWTest\");\n        std::wstring tmpFile = StringToWString(TestUtils::GetTargetFileName(\"NormalResumableUploadRetryAfterFailedPartWTest\").append(\".tmp\"));\n        WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n        std::wstring checkpointKey = StringToWString(TestUtils::GetObjectKey(\"checkpoint\"));\n        EXPECT_EQ(CreateDirectory(checkpointKey), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointKey), true);\n\n        // resumable upload object failed\n        UploadObjectRequest request(BucketName, key, tmpFile);\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        request.setFlags(request.Flags() | UploadPartFailedFlag);\n        request.setCheckpointDir(checkpointKey);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        EXPECT_EQ(IsFileExist(GetCheckpointFileByResumableUploaderW(BucketName, key, checkpointKey, tmpFile)), true);\n\n        // retry\n        request.setFlags(request.Flags() ^ UploadPartFailedFlag);\n        auto retryOutcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, ResumableUploadWithMixPathTypeTest)\n    {\n        std::wstring checkpointDir = StringToWString(TestUtils::GetTargetFileName(\"checkpoint\"));\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n\n        UploadObjectRequest request(BucketName, \"targetKey\", \"filePath\");\n        request.setCheckpointDir(checkpointDir);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n        EXPECT_EQ(outcome.error().Message(), \"The type of filePath and checkpointDir should be the same, either string or wstring.\");\n\n        UploadObjectRequest request1(BucketName, \"targetKey\", L\"filePath\");\n        request1.setCheckpointDir(WStringToString(checkpointDir));\n        outcome = Client->ResumableUploadObject(request1);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n        EXPECT_EQ(outcome.error().Message(), \"The type of filePath and checkpointDir should be the same, either string or wstring.\");\n\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadWithSizeOverPartSizeWTest)\n    {\n        // upload object\n        std::string key = TestUtils::GetObjectKey(\"ResumableDownloadObjectOverPartSizeW\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableDownloadObjectOverPartSizeW\").append(\".tmp\");\n        int num = 1 + rand() % 10;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download object\n        std::wstring targetFile = StringToWString(TestUtils::GetTargetFileName(\"ResumableDownloadTargetObjectW\"));\n        DownloadObjectRequest request(BucketName, key, targetFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadMd5 = GetFileMd5(targetFile);\n        EXPECT_EQ(uploadMd5, downloadMd5);\n\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadWithSizeUnderPartSizeWTest)\n    {\n        // upload object\n        std::string key = TestUtils::GetObjectKey(\"ResumableDownloadObjectUnderPartSize\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableDownloadObjectUnderPartSize\").append(\".tmp\");\n        int num = 10 + rand() % 10;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download object\n        std::wstring targetFile = StringToWString(TestUtils::GetTargetFileName(\"ResumableDownloadTargetObjectW\"));\n        DownloadObjectRequest request(BucketName, key, targetFile);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadMd5 = GetFileMd5(targetFile);\n        EXPECT_EQ(uploadMd5, downloadMd5);\n\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableDownloadWithSizeOverPartSizeWTest)\n    {\n        // upload\n        std::string key = TestUtils::GetObjectKey(\"MultiResumableDownloadObjectOverPartSizeW\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"MultiResumableDownloadObjectOverPartSizeW\").append(\".tmp\");\n        int num = 1 + rand() % 10;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        int threadNum = 1 + rand() % 100;\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download\n        std::wstring targetFile = StringToWString(TestUtils::GetTargetFileName(\"ResumableDownloadTargetObjectW\"));\n        DownloadObjectRequest request(BucketName, key, targetFile);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(threadNum);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadMd5 = GetFileMd5(targetFile);\n        EXPECT_EQ(uploadMd5, downloadMd5);\n\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadSetMinPartSizeWTest)\n    {\n        // upload\n        std::string key = TestUtils::GetObjectKey(\"ResumableDownloadObjectSetMinPartSizeW\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableDownloadObjectSetMinPartSizeW\").append(\".tmp\");\n        int num = 1 + rand() % 10;\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download\n        std::wstring targetFile = StringToWString(TestUtils::GetTargetFileName(\"ResumableDownloadTargetObjectW\"));\n        int partSize = 1 + rand() % 99;\n        DownloadObjectRequest request(BucketName, key, targetFile);\n        request.setPartSize(partSize * 1024);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        request.setPartSize(102400);\n        auto retryOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n\n        std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadMd5 = GetFileMd5(targetFile);\n        EXPECT_EQ(uploadMd5, downloadMd5);\n\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableDownloadWithoutTargetFilePathWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalUplloadObjectWithoutFilePathW\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalUplloadObjectWithoutFilePathW\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download\n        std::wstring targetFile;\n        DownloadObjectRequest request(BucketName, key, targetFile);\n        request.setPartSize(100 * 1024);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadWithCheckpointWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalDownloadObjectWithCheckpointW\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalDownloadObjectWithCheckpointW\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n\n        // upload\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download\n        std::wstring checkpointDir = TestUtils::GetExecutableDirectoryW();\n        std::wstring targetFile = StringToWString(TestUtils::GetTargetFileName(\"ResumableDownloadTargetObjectW\"));\n        DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadMd5 = GetFileMd5(targetFile);\n        EXPECT_EQ(uploadMd5, downloadMd5);\n\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableDownloadWithNotExitsCheckpointWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UnnormalDownloadObjectWithNotExistCheckpointW\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalDownloadObjectWithNotExistCheckpointW\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n\n        // upload\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download\n        std::wstring checkpointDir = L\"NotExistDir\";\n        std::wstring targetFile = StringToWString(TestUtils::GetTargetFileName(\"ResumableDownloadTargetObjectW\"));\n        DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir);\n        request.setPartSize(100 * 1024);\n        auto outcome = Client->ResumableDownloadObject(request);\n        std::shared_ptr<std::iostream> content = nullptr;\n        outcome.result().setContent(content);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n        EXPECT_EQ(outcome.error().Message(), \"Checkpoint directory is not exist.\");\n\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        RemoveFile(targetFile.append(L\".temp\"));\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableDownloadWithCheckpointWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"MultiDownloadObjectWithCheckpointW\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"MultiDownloadObjectWithCheckpointW\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (1 + rand() % 10));\n\n        // upload\n        auto uploadOutcome = Client->ResumableUploadObject(UploadObjectRequest(BucketName, key, tmpFile));\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download\n        std::wstring checkpointDir = TestUtils::GetExecutableDirectoryW();\n        std::wstring targetFile = StringToWString(TestUtils::GetTargetFileName(\"ResumableDownloadTargetObjectW\"));\n        int threadNum = 1 + rand() % 99;\n        DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(threadNum);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n\n        std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadMd5 = GetFileMd5(targetFile);\n        EXPECT_EQ(uploadMd5, downloadMd5);\n\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableDownloadRetryWithCheckpointWTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"NormalResumableDownloadRetryWithCheckpointWTest\");\n        std::string tmpFile = TestUtils::GetTargetFileName(\"NormalResumableDownloadRetryWithCheckpointWTest\").append(\".tmp\");\n        TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * (2 + rand() % 10));\n        std::wstring targetFile = StringToWString(TestUtils::GetObjectKey(\"ResumableDownloadTargetObject\"));\n        std::wstring checkpointDir = StringToWString(TestUtils::GetTargetFileName(\"checkpoint\"));\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        // upload object\n        auto uploadOutcome = Client->PutObject(BucketName, key, tmpFile);\n        EXPECT_EQ(uploadOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n        // download object\n        DownloadObjectRequest request(BucketName, key, targetFile, checkpointDir, 102400, 1);\n        request.setFlags(request.Flags() | DownloadPartFailedFlag);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n\n        EXPECT_EQ(IsFileExist(GetCheckpointFileByResumableDownloaderW(BucketName, key, checkpointDir, targetFile)), true);\n\n        // retry\n        request.setFlags(request.Flags() ^ DownloadPartFailedFlag);\n        auto retryOutcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n\n        std::string uploadFileMd5 = TestUtils::GetFileMd5(tmpFile);\n        std::string downloadFileMd5 = GetFileMd5(targetFile);\n        EXPECT_EQ(uploadFileMd5, downloadFileMd5);\n        EXPECT_EQ(RemoveFile(tmpFile), true);\n        EXPECT_EQ(RemoveFile(targetFile), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, ResumableDownloadWithMixPathTypeTest)\n    {\n        std::wstring checkpointDir = StringToWString(TestUtils::GetTargetFileName(\"checkpoint\"));\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n\n        DownloadObjectRequest request(BucketName, \"targetKey\", \"filePath\");\n        request.setCheckpointDir(checkpointDir);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n        EXPECT_EQ(outcome.error().Message(), \"The type of filePath and checkpointDir should be the same, either string or wstring.\");\n\n        DownloadObjectRequest request1(BucketName, \"targetKey\", L\"filePath\");\n        request1.setCheckpointDir(WStringToString(checkpointDir));\n        outcome = Client->ResumableDownloadObject(request1);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n        EXPECT_EQ(outcome.error().Message(), \"The type of filePath and checkpointDir should be the same, either string or wstring.\");\n\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, UnnormalResumableCopyWithNotExistCheckpointWTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"UnnormalCopySourceObjectWithNotExistCheckpointW\");\n        std::string targetKey = TestUtils::GetObjectKey(\"UnnormalCopyTargetObjectWithNotExistCheckpointW\");\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjcetOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n        EXPECT_EQ(putObjcetOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        std::wstring checkpointDir = L\"NotExistCheckpointDir\";\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, checkpointDir);\n        request.setPartSize(102401);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyWithCheckpointWTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectWithCheckpointW\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectWithCheckpointW\");\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjcetOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n        EXPECT_EQ(putObjcetOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, TestUtils::GetExecutableDirectoryW());\n        request.setPartSize(102400);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableCopyWithCheckpointWTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"MultiCopySourceObjectWithCheckpointW\");\n        std::string targetKey = TestUtils::GetObjectKey(\"MultiCopyTargetObjectWithCheckpointW\");\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjcetOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n        EXPECT_EQ(putObjcetOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        std::wstring checkpointDir = StringToWString(TestUtils::GetTargetFileName(\"checkpoint\"));\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey,\n            checkpointDir, 102401, (2 + rand() % 10));\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, NormalResumableCopyRetryWithCheckpointWTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalResumableCopyRetryWithCheckpointWTest\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalResumableCopyRetryWithCheckpointWTest-1\");\n        std::wstring checkpointDir = StringToWString(TestUtils::GetTargetFileName(\"checkpoint\"));\n        EXPECT_EQ(CreateDirectory(checkpointDir), true);\n        EXPECT_EQ(IsDirectoryExist(checkpointDir), true);\n\n        auto putObjectContent = TestUtils::GetRandomStream(102400 * (2 + rand() % 10));\n        auto putObjectOutcome = Client->PutObject(BucketName, sourceKey, putObjectContent);\n        EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, checkpointDir, 102401, 1);\n        request.setFlags(request.Flags() | CopyPartFailedFlag);\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), false);\n\n        EXPECT_EQ(IsFileExist(GetCheckpointFileByResumableCopierW(BucketName, targetKey, BucketName, sourceKey, checkpointDir)), true);\n\n        // retry\n        request.setFlags(request.Flags() ^ CopyPartFailedFlag);\n        auto retryOutcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(retryOutcome.isSuccess(), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n        EXPECT_EQ(RemoveDirectory(checkpointDir), true);\n    }\n\n    TEST_F(ResumableObjectTest, ResumableCopyWithMixPathTypeTest)\n    {\n        MultiCopyObjectRequest request(BucketName, \"targetKey\", BucketName, \"sourceKey\", \"checkPoint\");\n        EXPECT_EQ(request.CheckpointDirW().empty(), true);\n        EXPECT_EQ(request.CheckpointDir(), \"checkPoint\");\n        \n        request.setCheckpointDir(L\"check\");\n        EXPECT_EQ(request.CheckpointDirW(), L\"check\");\n        EXPECT_EQ(request.CheckpointDir().empty(), true);\n    }\n\n#else\n    //not support wstring path in non-windows\n    TEST_F(ResumableObjectTest, NormalResumableUploadWithSizeOverPartSizeWTest)\n    {\n        UploadObjectRequest request(BucketName, \"key\", L\"TestKey\");\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(1);\n        auto outcome = Client->ResumableUploadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n        EXPECT_EQ(outcome.error().Message(), \"Only support wstring path in windows os.\");\n\n        UploadObjectRequest request1(BucketName, \"key\", L\"testFile\", L\"TestDir\");\n        request1.setPartSize(100 * 1024);\n        request1.setThreadNum(1);\n        outcome = Client->ResumableUploadObject(request1);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n        EXPECT_EQ(outcome.error().Message(), \"Only support wstring path in windows os.\");\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableDownloadWithCheckpointWTest)\n    {\n        DownloadObjectRequest request(BucketName, \"key\", L\"TestKey\");\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(2);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n        EXPECT_EQ(outcome.error().Message(), \"Only support wstring path in windows os.\");\n\n        DownloadObjectRequest request1(BucketName, \"key\", L\"TestKey\", L\"TestDir\");\n        request1.setPartSize(100 * 1024);\n        request1.setThreadNum(2);\n        outcome = Client->ResumableDownloadObject(request1);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n        EXPECT_EQ(outcome.error().Message(), \"Only support wstring path in windows os.\");\n    }\n\n    TEST_F(ResumableObjectTest, MultiResumableCopyWithWPathTest)\n    {\n        MultiCopyObjectRequest request(BucketName, \"key\", BucketName, \"srcKey\",\n            L\"checkpoint\", 102401, (2 + rand() % 10));\n        auto outcome = Client->ResumableCopyObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n        EXPECT_EQ(outcome.error().Message(), \"Only support wstring path in windows os.\");\n    }\n\n#endif\n\n    TEST_F(ResumableObjectTest, MultiResumableInvalidBucketNameTest)\n    {\n        DownloadObjectRequest request(\"Invalid-Bucket\", \"key\", L\"filePath\", L\"TestKey\");\n        EXPECT_EQ(request.CheckpointDir().empty(), true);\n        EXPECT_EQ(request.CheckpointDirW(), L\"TestKey\");\n        request.setCheckpointDir(\"TestKey\");\n        EXPECT_EQ(request.CheckpointDir(), \"TestKey\");\n        EXPECT_EQ(request.CheckpointDirW().empty(), true);\n        request.setPartSize(100 * 1024);\n        request.setThreadNum(2);\n        auto outcome = Client->ResumableDownloadObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n\n    TEST_F(ResumableObjectTest, MultiCopyObjectRequestTest)\n    {\n        std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObject\");\n        std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObject\");\n\n        // copy\n        MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey, L\"CheckPoint\");\n        EXPECT_EQ(request.CheckpointDirW(), L\"CheckPoint\");\n\n        MultiCopyObjectRequest request1(BucketName, targetKey, BucketName, sourceKey, L\"CheckPoint1\", ObjectMetaData());\n        EXPECT_EQ(request1.CheckpointDirW(), L\"CheckPoint1\");\n\n        MultiCopyObjectRequest request2(BucketName, targetKey, BucketName, sourceKey, L\"CheckPoint2\", 100*1024, 2, ObjectMetaData());\n        EXPECT_EQ(request2.CheckpointDirW(), L\"CheckPoint2\");\n    }\n\n    TEST_F(ResumableObjectTest, UploadObjectRequestTest)\n    {\n        std::string key = TestUtils::GetObjectKey(\"UploadObjectRequestTest\");\n\n        UploadObjectRequest reqeust(BucketName, key, L\"filePath1\", L\"checkPoint1\", 100 * 1024, 2, ObjectMetaData());\n        EXPECT_EQ(reqeust.CheckpointDirW(), L\"checkPoint1\");\n\n        UploadObjectRequest reqeust1(BucketName, key, L\"filePath2\", L\"checkPoint2\", ObjectMetaData());\n        EXPECT_EQ(reqeust1.CheckpointDirW(), L\"checkPoint2\");\n    }\n    \n}\n}"
  },
  {
    "path": "test/src/Object/ObjectAclTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud\n{\nnamespace OSS \n{\n\nclass ObjectAclTest : public ::testing::Test\n{\nprotected:\n    ObjectAclTest()\n    {\n    }\n\n    ~ObjectAclTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n\t\tClientConfiguration conf;\n\t\tconf.enableCrc64 = false;\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-objectacl\");\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\n        EXPECT_EQ(outCome.isSuccess(), true);\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n       TestUtils::CleanBucket(*Client, BucketName);\n       Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> ObjectAclTest::Client = nullptr;\nstd::string ObjectAclTest::BucketName = \"\";\n\nTEST_F(ObjectAclTest, SetAndGetObjectAclSuccessTest)\n{\n    std::string objName = TestUtils::GetObjectKey(\"test-cpp-sdk-objectacl\");\n\n    std::string text = \"hellowworld\";\n    auto putOutcome = Client->PutObject(PutObjectRequest(BucketName, objName, std::make_shared<std::stringstream>(text)));\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    auto aclOutcome =  Client->GetObjectAcl(GetObjectAclRequest(BucketName, objName));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n    EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::Default);\n\n    auto setOutCome = Client->SetObjectAcl(SetObjectAclRequest(BucketName, objName, CannedAccessControlList::PublicRead));\n\tEXPECT_EQ(aclOutcome.isSuccess(), true);\n\n    TestUtils::WaitForCacheExpire(2);\n    aclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName, objName));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n    EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::PublicRead);\n\n    //set to readwrite\n    Client->SetObjectAcl(SetObjectAclRequest(BucketName, objName, CannedAccessControlList::PublicReadWrite));\n    TestUtils::WaitForCacheExpire(2);\n    aclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName, objName));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n    EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::PublicReadWrite);\n\n    //set to private\n    Client->SetObjectAcl(SetObjectAclRequest(BucketName, objName, CannedAccessControlList::Private));\n    TestUtils::WaitForCacheExpire(2);\n    aclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName, objName));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n    EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::Private);\n\n    // set to default\n    Client->SetObjectAcl(SetObjectAclRequest(BucketName, objName, CannedAccessControlList::Default));\n    TestUtils::WaitForCacheExpire(2);\n    aclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName, objName));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n    EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::Default);\n\n    // set to private\n\tTestUtils::WaitForCacheExpire(2);\n    SetObjectAclRequest aclRequest(BucketName, objName);\n    aclRequest.setAcl(CannedAccessControlList::Private);\n    Client->SetObjectAcl(aclRequest);\n\n    aclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName, objName));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n    EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::Private);\n\n    // set to void\n\tTestUtils::WaitForCacheExpire(2);\n    SetObjectAclRequest aclRequest1(BucketName, objName);\n\tauto setOutcom = Client->SetObjectAcl(aclRequest1);\n\tEXPECT_EQ(setOutcom.isSuccess(), false);\n    TestUtils::WaitForCacheExpire(5);\n\n    aclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName, objName));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n    EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::Private);\n}\n\n\nTEST_F(ObjectAclTest, SetAndGetObjectAclErrorTest)\n{\n    auto aclOutcome1 = Client->SetObjectAcl(SetObjectAclRequest(BucketName, \"test-void\", CannedAccessControlList::PublicRead));\n    TestUtils::WaitForCacheExpire(5);\n    EXPECT_EQ(aclOutcome1.isSuccess(), false);\n    EXPECT_EQ(aclOutcome1.error().Code().size()>0, true);\n\n    auto aclOutcome2 = Client->GetObjectAcl(GetObjectAclRequest(BucketName, \"test-void\"));\n    TestUtils::WaitForCacheExpire(5);\n\tEXPECT_EQ(aclOutcome2.isSuccess(), false);\n    EXPECT_EQ(aclOutcome2.error().Code().size()>0, true);\n}\n\nTEST_F(ObjectAclTest, GetObjectAclWithInvalidResponseBodyTest)\n{\n    std::string objName = TestUtils::GetObjectKey(\"GetObjectAclWithInvalidResponseBodyTest\");\n    std::string text = \"hellowworld\";\n    auto putOutcome = Client->PutObject(PutObjectRequest(BucketName, objName, std::make_shared<std::stringstream>(text)));\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    GetObjectAclRequest gaclRequest(BucketName, objName);\n    gaclRequest.setResponseStreamFactory([=]() {\n        auto content = std::make_shared<std::stringstream>();\n        content->write(\"invlid data\", 11);\n        return content;\n    });\n    auto gaclOutcome = Client->GetObjectAcl(gaclRequest);\n    EXPECT_EQ(gaclOutcome.isSuccess(), false);\n    EXPECT_EQ(gaclOutcome.error().Code(), \"ParseXMLError\");\n}\n\nTEST_F(ObjectAclTest, GetObjectAclResultTest)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" ?>\n                    <AccessControlPolicy>\n                        <Owner>\n                            <ID>00220120222</ID>\n                            <DisplayName>00220120222</DisplayName>\n                        </Owner>\n                        <AccessControlList>\n                            <Grant>public-read</Grant>\n                        </AccessControlList>\n                    </AccessControlPolicy>)\";\n    GetObjectAclResult result(xml);\n    EXPECT_EQ(result.Owner().DisplayName(), \"00220120222\");\n    EXPECT_EQ(result.Owner().Id(), \"00220120222\");\n    EXPECT_EQ(result.Acl(), CannedAccessControlList::PublicRead);\n}\n\nTEST_F(ObjectAclTest, GetObjectAclResultBranchTest)\n{\n    GetObjectAclResult result(\"test\");\n\n    std::string xml = R\"(<?xml version=\"1.0\" ?>\n                    <AccessControl>\n                    </AccessControl>)\";\n    GetObjectAclResult result1(xml);\n\n    xml = R\"(<?xml version=\"1.0\" ?>\n                    <AccessControlPolicy>\n                            <ID>00220120222</ID>\n                            <DisplayName>00220120222</DisplayName>\n                            <Grant>public-read</Grant>\n                    </AccessControlPolicy>)\";\n    GetObjectAclResult result2(xml);\n\n    xml = R\"(<?xml version=\"1.0\" ?>\n                    <AccessControlPolicy>\n                        <Owner>\n\n                        </Owner>\n                        <AccessControlList>\n\n                        </AccessControlList>\n                    </AccessControlPolicy>)\";\n    GetObjectAclResult result3(xml);\n\n    xml = R\"(<?xml version=\"1.0\" ?>\n                    <AccessControlPolicy>\n                        <Owner>\n                            <ID></ID>\n                            <DisplayName></DisplayName>\n                        </Owner>\n                        <AccessControlList>\n                            <Grant></Grant>\n                        </AccessControlList>\n                    </AccessControlPolicy>)\";\n    GetObjectAclResult result4(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    GetObjectAclResult result5(xml);\n}\n}\n}\n"
  },
  {
    "path": "test/src/Object/ObjectAppendTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud{ namespace OSS {\nclass ObjectAppendTest : public ::testing::Test\n{\nprotected:\n    ObjectAppendTest()\n    {\n    }\n\n    ~ObjectAppendTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n        ClientConfiguration conf;\n        conf.enableCrc64 = false;\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-objectappend\");\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\n        EXPECT_EQ(outCome.isSuccess(), true);\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n        TestUtils::CleanBucket(*Client, BucketName);\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> ObjectAppendTest::Client = nullptr;\nstd::string ObjectAppendTest::BucketName = \"\";\n\nTEST_F(ObjectAppendTest, appendDataNormalTest)\n{\n    std::string objName = TestUtils::GetObjectKey(\"test-cpp-sdk-objectappend\");\n\n    // put object\n    std::string text = \"hellowworld\";\n    AppendObjectRequest appendRequest(BucketName, objName, std::make_shared<std::stringstream>(text));\n    appendRequest.setExpires(TestUtils::GetGMTString(100));\n    auto appendOutcome = Client->AppendObject(appendRequest);\n    EXPECT_EQ(appendOutcome.isSuccess(), true);\n    EXPECT_EQ(appendOutcome.result().Length(), text.size());\n\n    auto testOutcome = Client->GetObject(BucketName, objName);\n\n    AppendObjectRequest  requestOther(BucketName, objName, std::make_shared<std::stringstream>(text));\n    requestOther.setPosition(text.size());\n    appendOutcome = Client->AppendObject(requestOther);\n    EXPECT_EQ(appendOutcome.isSuccess(), true);\n    EXPECT_EQ(appendOutcome.result().Length(), text.size()*2);\n    \n    // read object\n    GetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName, objName));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    std::string strData ;\n    (*getOutcome.result().Content().get())>>strData;\n    EXPECT_EQ(strData, text+text);\n}\n\nTEST_F(ObjectAppendTest, appendDataPositionErrorTest)\n{\n    std::string objName = TestUtils::GetObjectKey(\"test-cpp-sdk-objectappend\");\n\n    // put object\n    std::string text = \"hellowworld\";\n    AppendObjectRequest appendRequest(BucketName, objName, std::make_shared<std::stringstream>(text));\n    auto appendOutcome = Client->AppendObject(appendRequest);\n    EXPECT_EQ(appendOutcome.isSuccess(), true);\n    EXPECT_EQ(appendOutcome.result().Length(), text.size());\n\n    AppendObjectRequest  requestOther(BucketName, objName, std::make_shared<std::stringstream>(text));\n    appendOutcome = Client->AppendObject(requestOther);\n    EXPECT_EQ(appendOutcome.isSuccess(), false);\n    \n    // read object\n    GetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName, objName));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    std::string strData;\n    (*getOutcome.result().Content().get()) >> strData;\n    EXPECT_EQ(strData, text);\n}\n\nTEST_F(ObjectAppendTest, appendDataNormalMeta1Test)\n{\n    std::string objName = TestUtils::GetObjectKey(\"test-cpp-sdk-objectappend\");\n\n    // put object\n    std::string text = \"helloworld\";\n    ObjectMetaData MetaInfo;\n    MetaInfo.UserMetaData()[\"author1\"] = \"chanju1-src\";\n\n    AppendObjectRequest appendRequest(BucketName, objName, std::make_shared<std::stringstream>(text), MetaInfo);\n    appendRequest.setCacheControl(\"max-age=3\");\n    appendRequest.setContentDisposition(\"append-object-disposition\");\n    appendRequest.setContentEncoding(\"myzip\");\n    auto appendOutcome = Client->AppendObject(appendRequest);\n    EXPECT_EQ(appendOutcome.isSuccess(), true);\n    EXPECT_EQ(appendOutcome.result().Length(), text.size());\n\n    // read object\n    GetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName, objName));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    std::string strData;\n    (*getOutcome.result().Content().get()) >> strData;\n    EXPECT_EQ(strData, text);\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author1\"), \"chanju1-src\");\n    EXPECT_EQ(getOutcome.result().Metadata().HttpMetaData().at(\"Cache-Control\"), \"max-age=3\");\n    EXPECT_EQ(getOutcome.result().Metadata().HttpMetaData().at(\"Content-Disposition\"), \"append-object-disposition\");\n    EXPECT_EQ(getOutcome.result().Metadata().HttpMetaData().at(\"Content-Encoding\"), \"myzip\");\n}\n\nTEST_F(ObjectAppendTest, appendDataNormalMeta2Test)\n{\n    std::string objName = TestUtils::GetObjectKey(\"test-cpp-sdk-objectappend\");\n\n    // put object\n    std::string text = \"hellowworld\";\n    ObjectMetaData MetaInfo;\n    MetaInfo.UserMetaData()[\"author1\"] = \"chanju1-src\";\n    AppendObjectRequest appendRequest(BucketName, objName, std::make_shared<std::stringstream>(text), MetaInfo);\n    auto appendOutcome = Client->AppendObject(appendRequest);\n    EXPECT_EQ(appendOutcome.isSuccess(), true);\n    EXPECT_EQ(appendOutcome.result().Length(), text.size());\n\n    // read object\n    GetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName, objName));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    std::string strData;\n    (*getOutcome.result().Content().get()) >> strData;\n    EXPECT_EQ(strData, text);\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author1\"), \"chanju1-src\");\n\n    MetaInfo.UserMetaData()[\"author1\"] = \"chanju1-diffrent\";\n    MetaInfo.UserMetaData()[\"author2\"] = \"chanju2\";\n    AppendObjectRequest  requestOther(BucketName, objName, std::make_shared<std::stringstream>(text), MetaInfo);\n    requestOther.setPosition(text.size());\n    appendOutcome = Client->AppendObject(requestOther);\n    EXPECT_EQ(appendOutcome.isSuccess(), true);\n    EXPECT_EQ(appendOutcome.result().Length(), text.size() * 2);\n\n    // read object\n    getOutcome = Client->GetObject(GetObjectRequest(BucketName, objName));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    (*getOutcome.result().Content().get()) >> strData;\n    EXPECT_EQ(strData, text + text);\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author1\"), \"chanju1-src\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().find(\"author2\"),\n        getOutcome.result().Metadata().UserMetaData().end());\n}\n\n\nTEST_F(ObjectAppendTest, appendDataAclTest)\n{\n    std::string objName = TestUtils::GetObjectKey(\"test-cpp-sdk-objectappend\");\n\n    // put object\n    std::string text = \"hellowworld\";\n    ObjectMetaData MetaInfo;\n    MetaInfo.UserMetaData()[\"author1\"] = \"chanju1-src\";\n    AppendObjectRequest appendRequest(BucketName, objName, std::make_shared<std::stringstream>(text), MetaInfo);\n    appendRequest.setAcl(CannedAccessControlList::PublicReadWrite);\n    \n    auto appendOutcome = Client->AppendObject(appendRequest);\n    EXPECT_EQ(appendOutcome.isSuccess(), true);\n    EXPECT_EQ(appendOutcome.result().Length(), text.size());\n\n    // get acl\n    auto aclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName, objName));\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n    EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::PublicReadWrite);\n}\n\n\nTEST_F(ObjectAppendTest, appendNormalObjectTest)\n{\n    // put object\n    std::string objName = TestUtils::GetObjectKey(\"test-cpp-sdk-objectappend\");\n    std::string text = \"hellowworld\";\n    PutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName, objName, std::make_shared<std::stringstream>(text)));\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // append failure\n    AppendObjectRequest appendRequest(BucketName, objName, std::make_shared<std::stringstream>(text));\n    auto appendOutcome = Client->AppendObject(appendRequest);\n    EXPECT_EQ(appendOutcome.isSuccess(), false);\n}\n\nTEST_F(ObjectAppendTest, AppendObjectResultTest)\n{\n    HeaderCollection header;\n    AppendObjectResult result(header);\n    EXPECT_EQ(result.CRC64(), 0UL);\n    EXPECT_EQ(result.Length(), 0UL);\n}\n\nTEST_F(ObjectAppendTest, AppendObjectFuntionTest)\n{\n    std::string objName = std::string(\"test-cpp-sdk-objectappend\");\n    std::string text = \"hellowworld\";\n    AppendObjectRequest appendRequest(BucketName, objName, std::make_shared<std::stringstream>(text));\n    appendRequest.setContentMd5(\"test\");\n    appendRequest.setExpires(\"1\");\n    appendRequest.setExpires(1);\n\n    ObjectMetaData meta;\n    meta.setContentType(\"test\");\n    AppendObjectRequest appendRequest1(BucketName, objName, std::make_shared<std::stringstream>(text), meta);\n    Client->AppendObject(appendRequest1);\n\n}\n\n}\n}\n"
  },
  {
    "path": "test/src/Object/ObjectBasicOperationTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include <fstream>\r\n#include <src/utils/Utils.h>\r\n#include <src/utils/FileSystemUtils.h>\r\n\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass ObjectBasicOperationTest : public ::testing::Test {\r\nprotected:\r\n    ObjectBasicOperationTest()\r\n    {\r\n    }\r\n\r\n    ~ObjectBasicOperationTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase() \r\n    {\r\n        Client = TestUtils::GetOssClientDefault();\r\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-objectbasicoperation\");\r\n        Client->CreateBucket(CreateBucketRequest(BucketName));\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase() \r\n    {\r\n        TestUtils::CleanBucketsByPrefix(*Client, BucketName);\r\n        Client = nullptr;\r\n    }\r\n\r\n    // Sets up the test fixture.\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    // Tears down the test fixture.\r\n    void TearDown() override\r\n    {\r\n    }\r\n\r\npublic:\r\n    static std::shared_ptr<OssClient> Client;\r\n    static std::string BucketName;\r\n};\r\n\r\nstd::shared_ptr<OssClient> ObjectBasicOperationTest::Client = nullptr;\r\nstd::string ObjectBasicOperationTest::BucketName = \"\";\r\n\r\n\r\nTEST_F(ObjectBasicOperationTest, InvalidBucketNameTest)\r\n{\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    for (auto const& invalidBucketName : TestUtils::InvalidBucketNamesList()) {\r\n        auto outcome = Client->PutObject(invalidBucketName, \"InvalidBucketNameTest\", content);\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\r\n    }\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, InvalidObjectKeyTest)\r\n{\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    for (auto const& invalidKeyName : TestUtils::InvalidObjectKeyNamesList()) {\r\n        auto outcome = Client->PutObject(BucketName, invalidKeyName, content);\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\r\n    }\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, UserMetaDataTest)\r\n{\r\n    ObjectMetaData meta;\r\n    meta.addHeader(\"x-oss-copy-source\", \"11111\");\r\n    meta.addHeader(\"x-oss-copy-source-if-match\", \"22222\");\r\n    meta.addHeader(\"x\", \"aaaaaa\");\r\n    meta.addHeader(\"x1\", \"bbb\");\r\n    meta.addHeader(\"aa\", \"aaaaa\");\r\n    meta.addHeader(\"AA\", \"bbbbb\");\r\n    meta.addHeader(\"ab\", \"aaaa\");\r\n    meta.addHeader(\"Ab\", \"bbbb\");\r\n    EXPECT_EQ(meta.HttpMetaData().size(), 6UL);\r\n\r\n    static const char *keys[] = { \"aa\", \"ab\", \"x\", \"x-oss-copy-source\", \"x-oss-copy-source-if-match\", \"x1\" };\r\n    static const char *values[] = { \"bbbbb\", \"bbbb\", \"aaaaaa\", \"11111\", \"22222\", \"bbb\" };\r\n\r\n    int i = 0;\r\n    for (auto const &header : meta.HttpMetaData()) {\r\n        EXPECT_STREQ(header.first.c_str(), keys[i]);\r\n        EXPECT_STREQ(header.second.c_str(), values[i]);\r\n        i++;\r\n    }\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, ListAllObjectsTest)\r\n{\r\n    //create test file\r\n    for (int i = 0; i < 20; i++) {\r\n        std::string key = TestUtils::GetObjectKey(\"ListAllObjectsTest\");\r\n        auto content = TestUtils::GetRandomStream(100);\r\n        auto outcome = Client->PutObject(BucketName, key, content);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    //list object use default\r\n    auto listOutcome = Client->ListObjects(BucketName);\r\n    EXPECT_EQ(listOutcome.isSuccess(), true);\r\n    EXPECT_EQ(listOutcome.result().ObjectSummarys().size(), 20UL);\r\n    EXPECT_EQ(listOutcome.result().IsTruncated(), false);\r\n\r\n    int i = 0;\r\n    for (auto const &obj : listOutcome.result().ObjectSummarys()) {\r\n        EXPECT_EQ(obj.Size(), 100LL);\r\n        EXPECT_EQ(obj.StorageClass(), \"Standard\");\r\n        i++;\r\n    }\r\n    EXPECT_EQ(i, 20);\r\n\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, ListObjectsWithPrefixTest)\r\n{\r\n    //create test file\r\n    for (int i = 0; i < 30; i++) {\r\n        std::string key = TestUtils::GetObjectKey(\"ListObjectsWithPrefixTest\");\r\n        auto content = TestUtils::GetRandomStream(100);\r\n        auto outcome = Client->PutObject(BucketName, key, content);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    //list object by prefix\r\n    ListObjectsRequest request(BucketName);\r\n    request.setMaxKeys(2);\r\n    request.setPrefix(\"ListObjectsWithPrefixTest\");\r\n\r\n    bool IsTruncated = false;\r\n    size_t total = 0;\r\n    do {\r\n        auto outcome = Client->ListObjects(request);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        request.setMarker(outcome.result().NextMarker());\r\n        IsTruncated = outcome.result().IsTruncated();\r\n        total += outcome.result().ObjectSummarys().size();\r\n    } while (IsTruncated);\r\n\r\n    EXPECT_EQ(30UL, total);\r\n\r\n    auto lOutcome = Client->ListObjects(BucketName, \"ListObjectsWithPrefixTest\");\r\n    EXPECT_EQ(lOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lOutcome.result().ObjectSummarys().size(), 30UL);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, ListObjectsWithIllegalMaxKeys)\r\n{\r\n    ListObjectsRequest request(BucketName);\r\n    request.setMaxKeys(1000 + 1);\r\n    auto outcome = Client->ListObjects(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"InvalidArgument\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, ListObjectsWithDelimiterTest)\r\n{\r\n    std::string folder = TestUtils::GetObjectKey(\"ListObjectsWithDelimiterTest\").append(\"folder/\");\r\n    for (int i = 0; i < 5; i++) {\r\n        std::string key = folder;\r\n        key.append(std::to_string(i)).append(\"-empty.txt\");\r\n        std::shared_ptr<std::stringstream> ss = std::make_shared<std::stringstream>();\r\n        auto outcome = Client->PutObject(BucketName, key, ss);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    std::string folder2 = TestUtils::GetObjectKey(\"ListObjectsWithDelimiterTest\").append(\"folder/\");\r\n    for (int i = 0; i < 5; i++) {\r\n        std::string key = folder2;\r\n        std::shared_ptr<std::stringstream> ss = std::make_shared<std::stringstream>();\r\n        key.append(std::to_string(i)).append(\"-empty.txt\");\r\n        auto outcome = Client->PutObject(BucketName, key, ss);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    //list object by prefix\r\n    ListObjectsRequest request(BucketName);\r\n    request.setPrefix(\"ListObjectsWithDelimiterTest\");\r\n    request.setDelimiter(\"/\");\r\n    auto outcome = Client->ListObjects(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().CommonPrefixes().size(), 2UL);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, ListAllObjectsCallableTest)\r\n{\r\n    //create test file\r\n    for (int i = 0; i < 20; i++) {\r\n        std::string key = TestUtils::GetObjectKey(\"ListAllObjectsCallableTest\");\r\n        auto content = TestUtils::GetRandomStream(100);\r\n        auto outcome = Client->PutObject(BucketName, key, content);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    //list object use default\r\n    ListObjectsRequest request(BucketName);\r\n    request.setPrefix(\"ListAllObjectsCallableTest\");\r\n    auto listOutcomeCallable = Client->ListObjectsCallable(request);\r\n    auto listOutcome = listOutcomeCallable.get();\r\n    EXPECT_EQ(listOutcome.isSuccess(), true);\r\n    EXPECT_EQ(listOutcome.result().ObjectSummarys().size(), 20UL);\r\n    EXPECT_EQ(listOutcome.result().IsTruncated(), false);\r\n\r\n    int i = 0;\r\n    for (auto const &obj : listOutcome.result().ObjectSummarys()) {\r\n        EXPECT_EQ(obj.Size(), 100LL);\r\n        i++;\r\n    }\r\n    EXPECT_EQ(i, 20);\r\n\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, ListObjectsNegativeTest)\r\n{\r\n    auto name = TestUtils::GetBucketName(\"no-exist-listobject\");\r\n    auto outcome = Client->ListObjects(name);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\r\n}\r\n\r\n/*Get Object Test*/\r\nTEST_F(ObjectBasicOperationTest, GetAndDeleteNonExistObjectTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetAndDeleteNonExistObjectTest\");\r\n    EXPECT_EQ(TestUtils::ObjectExists(*Client, BucketName, key), false);\r\n    auto outome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(outome.isSuccess(), false);\r\n    EXPECT_EQ(outome.error().Code(), \"NoSuchKey\");\r\n\r\n    auto dOutcome = Client->DeleteObject(BucketName, key);\r\n    EXPECT_EQ(dOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectBasicTest)\r\n{\r\n    GetObjectOutcome dummy;\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectBasicTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectBasicTest\").append(\".tmp\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto outome   = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(outome.isSuccess(), true);\r\n\r\n    auto fOutcome = Client->GetObject(BucketName, key, tmpFile);\r\n    EXPECT_EQ(fOutcome.isSuccess(), true);\r\n    fOutcome = dummy;\r\n\r\n    std::shared_ptr<std::iostream> fileContent = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n\r\n    std::string oriMd5  = ComputeContentMD5(*content.get());\r\n    std::string memMd5  = ComputeContentMD5(*outome.result().Content().get());\r\n    std::string fileMd5 = ComputeContentMD5(*fileContent.get());\r\n\r\n    EXPECT_STREQ(oriMd5.c_str(), memMd5.c_str());\r\n    EXPECT_STREQ(oriMd5.c_str(), fileMd5.c_str());\r\n    fileContent = nullptr;\r\n    EXPECT_EQ(RemoveFile(tmpFile), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectToFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectToFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectBasicTest\").append(\".tmp\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto fOutcome = Client->GetObject(BucketName, key, tmpFile);\r\n    EXPECT_EQ(fOutcome.isSuccess(), true);\r\n    //EXPECT_EQ(RemoveFile(tmpFile), false);\r\n\r\n    auto fileETag = TestUtils::GetFileETag(tmpFile);\r\n\r\n    EXPECT_EQ(fileETag, pOutcome.result().ETag());\r\n\r\n    fOutcome.result().setContent(std::shared_ptr<std::iostream>());\r\n\r\n    EXPECT_EQ(RemoveFile(tmpFile), true);\r\n}\r\n\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectToNullContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectToNullContentTest\");\r\n    std::shared_ptr<std::iostream> content = nullptr;\r\n    auto outome = Client->GetObject(BucketName, key, content);\r\n    EXPECT_EQ(outome.isSuccess(), false);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectToFailContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectToFailContentTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectBasicNegativeTest\").append(\".tmp\");\r\n\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(tmpFile, std::ios::in| std::ios::binary);\r\n    auto outome = Client->GetObject(BucketName, key, content);\r\n    EXPECT_EQ(outome.isSuccess(), false);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectToBadContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectToBadContentTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectBasicNegativeTest\").append(\".tmp\");\r\n\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\r\n    content->setstate(content->badbit);\r\n    auto outome = Client->GetObject(BucketName, key, content);\r\n    EXPECT_EQ(outome.isSuccess(), false);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectToBadKeyTest)\r\n{\r\n    std::string key = \"/InvalidObjectName\";\r\n    auto outcome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectUsingRangeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectUsingRangeTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    GetObjectRequest request(BucketName, key);\r\n    request.setRange(10, 19);\r\n    auto outome = Client->GetObject(request);\r\n    EXPECT_EQ(outome.isSuccess(), true);\r\n\r\n    char buffer[10];\r\n    content->clear();\r\n    content->seekg(10, content->beg);\r\n    EXPECT_EQ(content->good(), true);\r\n    content->read(buffer, 10);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(buffer, 10);\r\n    std::string memMd5 = ComputeContentMD5(*outome.result().Content().get());\r\n\r\n    EXPECT_STREQ(oriMd5.c_str(), memMd5.c_str());\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectUsingRangeNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectUsingRangeNegativeTest\");\r\n\r\n    GetObjectRequest request(BucketName, key);\r\n    request.setRange(10, 9);\r\n    auto outcome = Client->GetObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_TRUE(strstr(outcome.error().Message().c_str(), \"The range is invalid.\") != nullptr);\r\n\r\n    request.setRange(10, -2);\r\n    outcome = Client->GetObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_TRUE(strstr(outcome.error().Message().c_str(), \"The range is invalid.\") != nullptr);\r\n\r\n    request.setRange(-1, 9);\r\n    outcome = Client->GetObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n    EXPECT_TRUE(strstr(outcome.error().Message().c_str(), \"The range is invalid.\") != nullptr);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectMatchingETagPositiveTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectMatchingETagPositiveTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    std::string eTag = outcome.result().ETag();\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.addMatchingETagConstraint(eTag);\r\n\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_STREQ(gOutcome.result().Metadata().ETag().c_str(), eTag.c_str());\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectMatchingETagsPositiveTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectMatchingETagsPositiveTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    std::string eTag = outcome.result().ETag();\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    std::vector<std::string> eTagList;\r\n    eTagList.push_back(eTag);\r\n    reqeust.addMatchingETagConstraint(\"invalidETag\");\r\n    reqeust.setMatchingETagConstraints(eTagList);\r\n\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_STREQ(gOutcome.result().Metadata().ETag().c_str(), eTag.c_str());\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectMatchingETagNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectMatchingETagNegativeTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.addMatchingETagConstraint(\"Dummy1\");\r\n    reqeust.addMatchingETagConstraint(\"Dummy2\");\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_STREQ(gOutcome.error().Code().c_str(), \"PreconditionFailed\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectModifiedSincePositiveTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectModifiedSincePositiveTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    std::string timeStr = TestUtils::GetGMTString(-10);\r\n\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.setModifiedSinceConstraint(timeStr);\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectModifiedSinceNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectModifiedSinceNegativeTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    std::string timeStr = TestUtils::GetGMTString(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.setModifiedSinceConstraint(timeStr);\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_STREQ(gOutcome.error().Code().c_str(), \"ServerError:304\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectNonMatchingETagPositiveTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectNonMatchingETagPositiveTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    std::string eTag = \"Dummy\";\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.addNonmatchingETagConstraint(eTag);\r\n\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectNonMatchingETagsPositiveTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectNonMatchingETagsPositiveTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    std::vector<std::string> eTagList;\r\n    eTagList.push_back(\"Dummy1\");\r\n    eTagList.push_back(\"Dummy2\");\r\n    reqeust.setNonmatchingETagConstraints(eTagList);\r\n\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectNonMatchingETagNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectNonMatchingETagNegativeTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    std::string eTag = outcome.result().ETag();\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.addNonmatchingETagConstraint(eTag);\r\n\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_STREQ(gOutcome.error().Code().c_str(), \"ServerError:304\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectUnmodifiedSincePositiveTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectUnmodifiedSincePositiveTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    std::string timeStr = TestUtils::GetGMTString(100);\r\n\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.setUnmodifiedSinceConstraint(timeStr);\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectUnmodifiedSinceNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectUnmodifiedSinceNegativeTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    std::string timeStr = TestUtils::GetGMTString(-10);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    reqeust.setUnmodifiedSinceConstraint(timeStr);\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_STREQ(gOutcome.error().Code().c_str(), \"PreconditionFailed\");\r\n}\r\n/* no supported\r\nTEST_F(ObjectBasicOperationTest, GetObjectWithResponseHeadersSettingTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectWithResponseHeadersSettingTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    std::string timeStr = TestUtils::GetGMTString(100);\r\n\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest reqeust(BucketName, key);\r\n    auto gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().Metadata().ContentType(), \"application/octet-stream\");\r\n\r\n    reqeust.addResponseHeaders(RequestResponseHeader::ContentType, \"test/haah\");\r\n    gOutcome = Client->GetObject(reqeust);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().Metadata().ContentType(), \"test/haah\");\r\n}\r\n*/\r\nclass GetObjectAsyncContex : public AsyncCallerContext\r\n{\r\npublic:\r\n    GetObjectAsyncContex():ready(false) {}\r\n    ~GetObjectAsyncContex() {}\r\n    mutable std::mutex mtx;\r\n    mutable std::condition_variable cv;\r\n    mutable std::string md5;\r\n    mutable bool ready;\r\n};\r\n\r\nvoid GetObjectHandler(const AlibabaCloud::OSS::OssClient* client, \r\n                      const GetObjectRequest& request, \r\n                      const GetObjectOutcome& outcome, \r\n                      const std::shared_ptr<const AsyncCallerContext>& context)\r\n{\r\n    std::cout << \"Client[\" << client << \"]\" << \"GetObjectHandler\" << \", key:\" << request.Key() << std::endl;\r\n    if (context != nullptr) {\r\n        auto ctx = static_cast<const GetObjectAsyncContex *>(context.get());\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        std::string memMd5 = ComputeContentMD5(*outcome.result().Content().get());\r\n        ctx->md5 = memMd5;\r\n        std::unique_lock<std::mutex> lck(ctx->mtx);\r\n        ctx->ready = true;\r\n        ctx->cv.notify_all();\r\n    }\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectAsyncBasicTest)\r\n{\r\n    GetObjectOutcome dummy;\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectAsyncBasicTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectAsyncBasicTest\").append(\".tmp\");\r\n    auto content = TestUtils::GetRandomStream(102400);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    GetObjectAsyncHandler handler = GetObjectHandler;\r\n    GetObjectRequest request(BucketName, key);\r\n    std::shared_ptr<GetObjectAsyncContex> memContext = std::make_shared<GetObjectAsyncContex> ();\r\n\r\n    GetObjectRequest fileRequest(BucketName, key);\r\n    fileRequest.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios_base::out | std::ios_base::trunc | std::ios::binary); });\r\n    std::shared_ptr<GetObjectAsyncContex> fileContext = std::make_shared<GetObjectAsyncContex>();\r\n\r\n    Client->GetObjectAsync(request, handler, memContext);\r\n    Client->GetObjectAsync(fileRequest, handler, fileContext);\r\n    std::cout << \"Client[\" << Client << \"]\" << \"Issue GetObjectAsync done.\" << std::endl;\r\n\r\n    {\r\n    std::unique_lock<std::mutex> lck(fileContext->mtx);\r\n    if (!fileContext->ready) fileContext->cv.wait(lck);\r\n    }\r\n\r\n    {\r\n    std::unique_lock<std::mutex> lck(memContext->mtx);\r\n    if (!memContext->ready) memContext->cv.wait(lck);\r\n    }\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content.get());\r\n\r\n    EXPECT_EQ(oriMd5, memContext->md5);\r\n    EXPECT_EQ(oriMd5, fileContext->md5);\r\n    memContext = nullptr;\r\n    fileContext = nullptr;\r\n    TestUtils::WaitForCacheExpire(1);\r\n    EXPECT_EQ(RemoveFile(tmpFile), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectCallableBasicTest)\r\n{\r\n    GetObjectOutcome dummy;\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectCallableBasicTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectCallableBasicTest\").append(\".tmp\");\r\n    auto content = TestUtils::GetRandomStream(102400);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    GetObjectRequest request(BucketName, key);\r\n    std::shared_ptr<GetObjectAsyncContex> memContext = std::make_shared<GetObjectAsyncContex>();\r\n\r\n    GetObjectRequest fileRequest(BucketName, key);\r\n    fileRequest.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios_base::out | std::ios_base::trunc | std::ios::binary); });\r\n\r\n    auto memOutcomeCallable  = Client->GetObjectCallable(request);\r\n    auto fileOutcomeCallable = Client->GetObjectCallable(fileRequest);\r\n\r\n\r\n    std::cout << \"Client[\" << Client << \"]\" << \"Issue GetObjectCallable done.\" << std::endl;\r\n\r\n    auto fileOutcome = fileOutcomeCallable.get();\r\n    auto memOutcome  = memOutcomeCallable.get();\r\n    EXPECT_EQ(fileOutcome.isSuccess(), true);\r\n    EXPECT_EQ(memOutcome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content.get());\r\n    std::string memMd5 = ComputeContentMD5(*memOutcome.result().Content());\r\n    std::string fileMd5 = ComputeContentMD5(*fileOutcome.result().Content());\r\n\r\n    EXPECT_EQ(oriMd5, fileMd5);\r\n    EXPECT_EQ(oriMd5, fileMd5);\r\n    memOutcome = dummy;\r\n    fileOutcome = dummy;\r\n    //EXPECT_EQ(RemoveFile(tmpFile), true);\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectBasicTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectBasicTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() == nullptr);\r\n\r\n    auto outome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(outome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content);\r\n    std::string memMd5 = ComputeContentMD5(*outome.result().Content());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectWithExpiresTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithExpiresTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.MetaData().setContentType(\"application/x-test\");\r\n    request.setExpires(TestUtils::GetGMTString(120));\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto outome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(outome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content);\r\n    std::string memMd5 = ComputeContentMD5(*outome.result().Content());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectUsingContentLengthTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectUsingContentLengthTest\");\r\n    std::shared_ptr<std::stringstream> content = std::make_shared<std::stringstream>();\r\n    *content << \"123456789\";\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.MetaData().setContentLength(2);\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto outome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(outome.isSuccess(), true);\r\n \r\n    std::string oriMd5 = ComputeContentMD5(\"12\", 2);\r\n    std::string memMd5 = ComputeContentMD5(*outome.result().Content().get());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectFullSettingsTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectFullSettingsTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    key.append(\"/attachement_test.data\");\r\n\r\n    std::string saveAs = \"abc123.zip\";\r\n    std::string contentDisposition = \"attachment;filename*=utf-8''\";\r\n    contentDisposition.append(UrlEncode(saveAs));\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.setCacheControl(\"no-cache\");\r\n    request.setContentDisposition(contentDisposition);\r\n    request.setContentEncoding(\"gzip\");\r\n\r\n    std::string contentMd5 = ComputeContentMD5(*content);\r\n    request.setContentMd5(contentMd5);\r\n\r\n    //user metadata\r\n    request.MetaData().UserMetaData()[\"MyKey1\"] = \"MyValue1\";\r\n    request.MetaData().UserMetaData()[\"MyKey2\"] = \"MyValue2\";\r\n    request.MetaData().UserMetaData()[\"MyKey3\"] = \"\";\r\n\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto metaOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\r\n\r\n    EXPECT_EQ(metaOutcome.result().CacheControl(), \"no-cache\");\r\n    EXPECT_EQ(metaOutcome.result().ContentDisposition(), contentDisposition);\r\n    EXPECT_EQ(metaOutcome.result().ContentEncoding(), \"gzip\");\r\n\r\n    EXPECT_EQ(metaOutcome.result().UserMetaData().at(\"MyKey1\"), \"MyValue1\");\r\n    EXPECT_EQ(metaOutcome.result().UserMetaData().at(\"MyKey2\"), \"MyValue2\");\r\n    EXPECT_EQ(metaOutcome.result().UserMetaData().at(\"MyKey3\"), \"\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectDefaultMetadataTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectDefaultMetadataTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectFromFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectFromFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectFromFileTest\").append(\"-put.tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, tmpFile);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto outome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(outome.isSuccess(), true);\r\n\r\n    std::fstream file(tmpFile, std::ios::in | std::ios::binary);\r\n    std::string oriMd5 = ComputeContentMD5(file);\r\n    std::string memMd5 = ComputeContentMD5(*outome.result().Content());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n    file.close();\r\n    EXPECT_EQ(RemoveFile(tmpFile), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectUsingContentLengthFromFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectUsingContentLengthFromFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectUsingContentLengthFromFileTest\").append(\"-put.tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    std::shared_ptr<std::fstream> file = std::make_shared<std::fstream> (tmpFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(file->good(), true);\r\n\r\n    file->seekg(0, file->end);\r\n    auto content_length = file->tellg();\r\n    EXPECT_EQ(content_length, 1024LL);\r\n\r\n    file->seekg(content_length / 2, file->beg);\r\n\r\n    PutObjectRequest request(BucketName, key, file);\r\n    request.MetaData().setContentLength(content_length / 2);\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto outome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(outome.isSuccess(), true);\r\n\r\n    char buff[2048];\r\n    file->clear();\r\n    file->seekg(content_length / 2, file->beg);\r\n    file->read(buff, 2048);\r\n    size_t readSize = static_cast<size_t>(file->gcount());\r\n\r\n    std::string oriMd5 = ComputeContentMD5(buff, readSize);\r\n    std::string memMd5 = ComputeContentMD5(*outome.result().Content().get());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n    file->close();\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectFullSettingsFromFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectFullSettingsFromFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectFullSettingsFromFileTest\").append(\"-put.tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    std::shared_ptr<std::fstream> file = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(file->good(), true);\r\n    key.append(\"/attachement_test.data\");\r\n\r\n    std::string saveAs = \"abc123.zip\";\r\n    std::string contentDisposition = \"attachment;filename*=utf-8''\";\r\n    contentDisposition.append(UrlEncode(saveAs));\r\n\r\n    PutObjectRequest request(BucketName, key, file);\r\n    request.setCacheControl(\"no-cache\");\r\n    request.setContentDisposition(contentDisposition);\r\n    request.setContentEncoding(\"gzip\");\r\n\r\n    std::string contentMd5 = ComputeContentMD5(*file);\r\n    request.setContentMd5(contentMd5);\r\n\r\n    //user metadata\r\n    request.MetaData().UserMetaData()[\"MyKey1\"] = \"MyValue1\";\r\n    request.MetaData().UserMetaData()[\"MyKey2\"] = \"MyValue2\";\r\n\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto metaOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\r\n\r\n    EXPECT_EQ(metaOutcome.result().CacheControl(), \"no-cache\");\r\n    EXPECT_EQ(metaOutcome.result().ContentDisposition(), contentDisposition);\r\n    EXPECT_EQ(metaOutcome.result().ContentEncoding(), \"gzip\");\r\n\r\n    EXPECT_EQ(metaOutcome.result().UserMetaData().at(\"MyKey1\"), \"MyValue1\");\r\n    EXPECT_EQ(metaOutcome.result().UserMetaData().at(\"MyKey2\"), \"MyValue2\");\r\n    file->close();\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectDefaultMetadataFromFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectDefaultMetadataFromFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectDefaultMetadataFromFileTest\").append(\"-put.tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    std::shared_ptr<std::fstream> file = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(file->good(), true);\r\n\r\n    auto outcome = Client->PutObject(BucketName, key, file);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n    file->close();\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectUserMetadataFromFileContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectUserMetadataFromFileContentTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectUserMetadataFromFileContentTest\").append(\"-put.tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    std::shared_ptr<std::fstream> file = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n    EXPECT_EQ(file->good(), true);\r\n\r\n    ObjectMetaData metaData;\r\n    metaData.UserMetaData()[\"test\"] = \"testvalue\";\r\n    auto outcome = Client->PutObject(BucketName, key, file, metaData);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n\r\n    auto hOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().UserMetaData().at(\"test\"), \"testvalue\");\r\n    file->close();\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectUserMetadataFromFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectUserMetadataFromFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectUserMetadataFromFileTest\").append(\"-put.tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n\r\n    ObjectMetaData metaData;\r\n    metaData.UserMetaData()[\"test\"] = \"testvalue\";\r\n    auto outcome = Client->PutObject(BucketName, key, tmpFile, metaData);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n\r\n    auto hOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().UserMetaData().at(\"test\"), \"testvalue\");\r\n    EXPECT_EQ(hOutcome.result().ContentLength(), 1024LL);\r\n    EXPECT_EQ(RemoveFile(tmpFile), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectWithNotExistFileTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithNotExistFileTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectFromFileTest\").append(\"-put.tmp\");\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, tmpFile);\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"ValidateError\");\r\n    EXPECT_EQ(pOutcome.error().Message(), \"Request body is in fail state. Logical error on i/o operation.\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectWithNullContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithNullContentTest\");\r\n    std::shared_ptr<std::iostream> content = nullptr;\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"ValidateError\");\r\n    EXPECT_EQ(pOutcome.error().Message(), \"Request body is null.\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectWithBadContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithNullContentTest\");\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\r\n    content->setstate(content->badbit);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"ValidateError\");\r\n    EXPECT_EQ(pOutcome.error().Message(), \"Request body is in bad state. Read/writing error on i/o operation.\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectWithSameContentTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithSameContentTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto outome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(outome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content);\r\n    std::string memMd5 = ComputeContentMD5(*outome.result().Content());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nclass PutObjectAsyncContex : public AsyncCallerContext\r\n{\r\npublic:\r\n    PutObjectAsyncContex() :ready(false) {}\r\n    virtual ~PutObjectAsyncContex()\r\n    {\r\n    }\r\n\r\n    mutable std::mutex mtx;\r\n    mutable std::condition_variable cv;\r\n    mutable bool ready;\r\n};\r\n\r\nvoid PutObjectHandler(const AlibabaCloud::OSS::OssClient* client,\r\n    const PutObjectRequest& request,\r\n    const PutObjectOutcome& outcome,\r\n    const std::shared_ptr<const AsyncCallerContext>& context)\r\n{\r\n    std::cout << \"Client[\" << client << \"]\" << \"PutObjectHandler, tag:\" << context->Uuid() << \r\n        \", key:\" << request.Key() << std::endl;\r\n    if (context != nullptr) {\r\n        auto ctx = static_cast<const PutObjectAsyncContex *>(context.get());\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        std::unique_lock<std::mutex> lck(ctx->mtx);\r\n        ctx->ready = true;\r\n        ctx->cv.notify_all();\r\n    }\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectAsyncBasicTest)\r\n{\r\n    std::string memKey = TestUtils::GetObjectKey(\"PutObjectAsyncBasicTest\");\r\n    auto memContent = TestUtils::GetRandomStream(102400);\r\n\r\n    std::string fileKey = TestUtils::GetObjectKey(\"PutObjectAsyncBasicTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectAsyncBasicTest\").append(\".tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    auto fileContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::out | std::ios::binary);\r\n\r\n    PutObjectAsyncHandler handler = PutObjectHandler;\r\n    PutObjectRequest memRequest(BucketName, memKey, memContent);\r\n    std::shared_ptr<PutObjectAsyncContex> memContext = std::make_shared<PutObjectAsyncContex>();\r\n    memContext->setUuid(\"PutobjectasyncFromMem\");\r\n\r\n    PutObjectRequest fileRequest(BucketName, fileKey, fileContent);\r\n    std::shared_ptr<PutObjectAsyncContex> fileContext = std::make_shared<PutObjectAsyncContex>();\r\n    fileContext->setUuid(\"PutobjectasyncFromFile\");\r\n\r\n    Client->PutObjectAsync(memRequest, handler, memContext);\r\n    Client->PutObjectAsync(fileRequest, handler, fileContext);\r\n    std::cout << \"Client[\" << Client << \"]\" << \"Issue PutObjectAsync done.\" << std::endl;\r\n\r\n    {\r\n        std::unique_lock<std::mutex> lck(fileContext->mtx);\r\n        if (!fileContext->ready) fileContext->cv.wait(lck);\r\n    }\r\n\r\n    {\r\n        std::unique_lock<std::mutex> lck(memContext->mtx);\r\n        if (!memContext->ready) memContext->cv.wait(lck);\r\n    }\r\n\r\n    fileContent->close();\r\n\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, memKey), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, fileKey), true);\r\n\r\n    fileContext = nullptr;\r\n\r\n    TestUtils::WaitForCacheExpire(1);\r\n    EXPECT_EQ(RemoveFile(tmpFile), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectCallableBasicTest)\r\n{\r\n    std::string memKey = TestUtils::GetObjectKey(\"PutObjectCallableBasicTest\");\r\n    auto memContent = TestUtils::GetRandomStream(102400);\r\n\r\n    std::string fileKey = TestUtils::GetObjectKey(\"PutObjectCallableBasicTest\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectCallableBasicTest\").append(\".tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    auto fileContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios::binary);\r\n\r\n\r\n\r\n    auto memOutcomeCallable = Client->PutObjectCallable(PutObjectRequest(BucketName, memKey, memContent));\r\n    auto fileOutcomeCallable = Client->PutObjectCallable(PutObjectRequest(BucketName, fileKey, fileContent));\r\n\r\n\r\n    std::cout << \"Client[\" << Client << \"]\" << \"Issue PutObjectCallable done.\" << std::endl;\r\n\r\n    auto fileOutcome = fileOutcomeCallable.get();\r\n    auto memOutcome = memOutcomeCallable.get();\r\n    EXPECT_EQ(fileOutcome.isSuccess(), true);\r\n    EXPECT_EQ(memOutcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, memKey), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, fileKey), true);\r\n\r\n    memContent = nullptr;\r\n    fileContent = nullptr;\r\n    //EXPECT_EQ(RemoveFile(tmpFile), true);\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, ListObjectsResult)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListBucketResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                        <Name>oss-example</Name>\r\n                        <Prefix></Prefix>\r\n                        <Marker></Marker>\r\n                        <MaxKeys>100</MaxKeys>\r\n                        <Delimiter></Delimiter>\r\n                        <IsTruncated>false</IsTruncated>\r\n                        <Contents>\r\n                            <Key>fun/movie/001.avi</Key>\r\n                            <LastModified>2012-02-24T08:43:07.000Z</LastModified>\r\n                            <ETag>&quot;5B3C1A2E053D763E1B002CC607C5A0FE&quot;</ETag>\r\n                            <Type>Normal</Type>\r\n                            <Size>5368709120</Size>\r\n                            <StorageClass>Standard</StorageClass>\r\n                            <Owner>\r\n                                <ID>00220120222</ID>\r\n                                <DisplayName>user-example</DisplayName>\r\n                            </Owner>\r\n                        </Contents>\r\n                        <Contents>\r\n                            <Key>fun/movie/007.avi</Key>\r\n                            <LastModified>2012-02-24T08:43:27.000Z</LastModified>\r\n                            <ETag>&quot;5B3C1A2E053D763E1B002CC607C5A0FE&quot;</ETag>\r\n                            <Type>Normal</Type>\r\n                            <Size>344606</Size>\r\n                            <StorageClass>IA</StorageClass>\r\n                            <Owner>\r\n                                <ID>00220120222</ID>\r\n                                <DisplayName>user-example</DisplayName>\r\n                            </Owner>\r\n                        </Contents>\r\n                        <Contents>\r\n                            <Key>fun/test.jpg</Key>\r\n                            <LastModified>2012-02-24T08:42:32.000Z</LastModified>\r\n                            <ETag>&quot;5B3C1A2E053D763E1B002CC607C5A0FE&quot;</ETag>\r\n                            <Type>Normal</Type>\r\n                            <Size>344606</Size>\r\n                            <StorageClass>Standard</StorageClass>\r\n                            <Owner>\r\n                                <ID>00220120222</ID>\r\n                                <DisplayName>user-example</DisplayName>\r\n                            </Owner>\r\n                        </Contents>\r\n                        <Contents>\r\n                            <Key>oss.jpg</Key>\r\n                            <LastModified>2012-02-24T06:07:48.000Z</LastModified>\r\n                            <ETag>&quot;5B3C1A2E053D763E1B002CC607C5A0FE&quot;</ETag>\r\n                            <Type>Normal</Type>\r\n                            <Size>344606</Size>\r\n                            <StorageClass>Standard</StorageClass>\r\n                            <RestoreInfo>ongoing-request=\"true\"</RestoreInfo>\r\n                            <Owner>\r\n                                <ID>00220120222</ID>\r\n                                <DisplayName>user-example</DisplayName>\r\n                            </Owner>\r\n                        </Contents>\r\n                    </ListBucketResult>)\";\r\n    ListObjectsResult result(xml);\r\n    EXPECT_EQ(result.ObjectSummarys().size(), 4UL);\r\n    EXPECT_EQ(result.ObjectSummarys()[0].ETag(), \"5B3C1A2E053D763E1B002CC607C5A0FE\");\r\n    EXPECT_EQ(result.ObjectSummarys()[0].Size(), 5368709120LL);\r\n    EXPECT_EQ(result.ObjectSummarys()[0].StorageClass(), \"Standard\");\r\n    EXPECT_EQ(result.ObjectSummarys()[1].StorageClass(), \"IA\");\r\n\r\n    EXPECT_EQ(result.ObjectSummarys()[3].Key(), \"oss.jpg\");\r\n    EXPECT_EQ(result.ObjectSummarys()[3].LastModified(), \"2012-02-24T06:07:48.000Z\");\r\n    EXPECT_EQ(result.ObjectSummarys()[3].Type(), \"Normal\");\r\n    EXPECT_EQ(result.ObjectSummarys()[3].StorageClass(), \"Standard\");\r\n    EXPECT_EQ(result.ObjectSummarys()[3].Owner().Id(), \"00220120222\");\r\n    EXPECT_EQ(result.ObjectSummarys()[3].Owner().DisplayName(), \"user-example\");\r\n    EXPECT_EQ(result.ObjectSummarys()[3].RestoreInfo(), \"ongoing-request=\\\"true\\\"\");\r\n\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, ListObjectsResultWithEncodingType)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListBucketResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                        <Name>oss-example</Name>\r\n                        <Prefix>hello%20world%21</Prefix>\r\n                        <Marker>hello%20</Marker>\r\n                        <MaxKeys>100</MaxKeys>\r\n                        <Delimiter>hello%20%21world</Delimiter>\r\n                        <IsTruncated>false</IsTruncated>\r\n                        <EncodingType>url</EncodingType>\r\n                        <Contents>\r\n                            <Key>fun/movie/001.avi</Key>\r\n                            <LastModified>2012-02-24T08:43:07.000Z</LastModified>\r\n                            <ETag>&quot;5B3C1A2E053D763E1B002CC607C5A0FE&quot;</ETag>\r\n                            <Type>Normal</Type>\r\n                            <Size>344606</Size>\r\n                            <StorageClass>Standard</StorageClass>\r\n                            <Owner>\r\n                                <ID>00220120222</ID>\r\n                                <DisplayName>user-example</DisplayName>\r\n                            </Owner>\r\n                        </Contents>\r\n                        <Contents>\r\n                            <Key>fun/movie/007.avi</Key>\r\n                            <LastModified>2012-02-24T08:43:27.000Z</LastModified>\r\n                            <ETag>&quot;5B3C1A2E053D763E1B002CC607C5A0FE&quot;</ETag>\r\n                            <Type>Normal</Type>\r\n                            <Size>344606</Size>\r\n                            <StorageClass>Standard</StorageClass>\r\n                            <Owner>\r\n                                <ID>00220120222</ID>\r\n                                <DisplayName>user-example</DisplayName>\r\n                            </Owner>\r\n                        </Contents>\r\n                        <Contents>\r\n                            <Key>fun/test.jpg</Key>\r\n                            <LastModified>2012-02-24T08:42:32.000Z</LastModified>\r\n                            <ETag>&quot;5B3C1A2E053D763E1B002CC607C5A0FE&quot;</ETag>\r\n                            <Type>Normal</Type>\r\n                            <Size>344606</Size>\r\n                            <StorageClass>Standard</StorageClass>\r\n                            <Owner>\r\n                                <ID>00220120222</ID>\r\n                                <DisplayName>user-example</DisplayName>\r\n                            </Owner>\r\n                        </Contents>\r\n                        <Contents>\r\n                            <Key>oss.jpg</Key>\r\n                            <LastModified>2012-02-24T06:07:48.000Z</LastModified>\r\n                            <ETag>&quot;5B3C1A2E053D763E1B002CC607C5A0FE&quot;</ETag>\r\n                            <Type>Normal</Type>\r\n                            <Size>344606</Size>\r\n                            <StorageClass>Standard</StorageClass>\r\n                            <Owner>\r\n                                <ID>00220120222</ID>\r\n                                <DisplayName>user-example</DisplayName>\r\n                            </Owner>\r\n                        </Contents>\r\n                    </ListBucketResult>)\";\r\n    ListObjectsResult result(xml);\r\n    EXPECT_EQ(result.ObjectSummarys().size(), 4UL);\r\n    EXPECT_EQ(result.ObjectSummarys()[0].ETag(), \"5B3C1A2E053D763E1B002CC607C5A0FE\");\r\n    EXPECT_EQ(result.Marker(), \"hello \");\r\n    EXPECT_EQ(result.Prefix(), \"hello world!\");\r\n    EXPECT_EQ(result.Delimiter(), \"hello !world\");\r\n}\r\n\r\n\r\nTEST_F(ObjectBasicOperationTest, DeleteObjectsResult)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                    <DeleteResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                        <Deleted>\r\n                           <Key>multipart.data</Key>\r\n                        </Deleted>\r\n                        <Deleted>\r\n                           <Key>test.jpg</Key>\r\n                        </Deleted>\r\n                        <Deleted>\r\n                           <Key>demo.jpg</Key>\r\n                        </Deleted>\r\n                    </DeleteResult>)\";\r\n    DeleteObjectsResult result(xml);\r\n    EXPECT_EQ(result.keyList().size(), 3UL);\r\n    EXPECT_EQ(result.Quiet(), false);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, DeleteObjectsResultWithEmtpy)\r\n{\r\n    std::string xml = \"\";\r\n    DeleteObjectsResult result(xml);\r\n    EXPECT_EQ(result.keyList().size(), 0UL);\r\n    EXPECT_EQ(result.Quiet(), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, DeleteObjectsBasicTest)\r\n{\r\n    const size_t TestKeysCnt = 10;\r\n    auto keyPrefix = TestUtils::GetObjectKey(\"DeleteObjectsBasicTest\");\r\n\r\n    for (size_t i = 0; i < TestKeysCnt; i++) {\r\n        auto key = keyPrefix;\r\n        auto content = TestUtils::GetRandomStream(100);\r\n        key.append(std::to_string(i)).append(\".txt\");\r\n        auto outcome = Client->PutObject(BucketName, key, content);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    DeleteObjectsRequest delRequest(BucketName);\r\n    for (size_t i = 0; i < TestKeysCnt; i++) {\r\n        auto key = keyPrefix;\r\n        key.append(std::to_string(i)).append(\".txt\");\r\n        delRequest.addKey(key);\r\n    }\r\n    auto delOutcome = Client->DeleteObjects(delRequest);\r\n    EXPECT_EQ(delOutcome.isSuccess(), true);\r\n    EXPECT_EQ(delOutcome.result().keyList().size(), TestKeysCnt);\r\n    EXPECT_EQ(delOutcome.result().Quiet(), false);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, DeleteObjectsQuietTest)\r\n{\r\n    const size_t TestKeysCnt = 10;\r\n    auto keyPrefix = TestUtils::GetObjectKey(\"DeleteObjectsQuietTest\");\r\n\r\n    for (size_t i = 0; i < TestKeysCnt; i++) {\r\n        auto key = keyPrefix;\r\n        auto content = TestUtils::GetRandomStream(100);\r\n        key.append(std::to_string(i)).append(\".txt\");\r\n        auto outcome = Client->PutObject(BucketName, key, content);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    DeleteObjectsRequest delRequest(BucketName);\r\n    for (size_t i = 0; i < TestKeysCnt; i++) {\r\n        auto key = keyPrefix;\r\n        key.append(std::to_string(i)).append(\".txt\");\r\n        delRequest.addKey(key);\r\n    }\r\n    delRequest.setQuiet(true);\r\n    EXPECT_EQ(delRequest.Quiet(), true);\r\n    auto delOutcome = Client->DeleteObjects(delRequest);\r\n    EXPECT_EQ(delOutcome.isSuccess(), true);\r\n    EXPECT_EQ(delOutcome.result().keyList().size(), 0UL);\r\n    EXPECT_EQ(delOutcome.result().Quiet(), true);\r\n}\r\n\r\n\r\nTEST_F(ObjectBasicOperationTest, DeleteObjectsByStepTest)\r\n{\r\n    const size_t TestKeysCnt = 10;\r\n    EXPECT_TRUE(TestKeysCnt > 8);\r\n    auto keyPrefix = TestUtils::GetObjectKey(\"DeleteObjectsByStepTest\");\r\n\r\n    for (size_t i = 0; i < TestKeysCnt; i++) {\r\n        auto key = keyPrefix;\r\n        auto content = TestUtils::GetRandomStream(100);\r\n        key.append(std::to_string(i)).append(\".txt\");\r\n        auto outcome = Client->PutObject(BucketName, key, content);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    ListObjectsRequest lRequest(BucketName);\r\n    lRequest.setPrefix(keyPrefix);\r\n    auto lOutcome = Client->ListObjects(lRequest);\r\n    EXPECT_EQ(lOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lOutcome.result().ObjectSummarys().size(), TestKeysCnt);\r\n\r\n    //Delete 0, 1 objects\r\n    DeleteObjectsRequest delRequest(BucketName);\r\n    for (size_t i = 0; i < 2; i++) {\r\n        auto key = keyPrefix;\r\n        key.append(std::to_string(i)).append(\".txt\");\r\n        delRequest.addKey(key);\r\n    }\r\n    EXPECT_EQ(delRequest.KeyList().size(), 2UL);\r\n\r\n    auto delOutcome = Client->DeleteObjects(delRequest);\r\n    EXPECT_EQ(delOutcome.isSuccess(), true);\r\n    EXPECT_EQ(delOutcome.result().keyList().size(), 2UL);\r\n\r\n    //delete  2, 3, 4\r\n    delRequest.clearKeyList();\r\n    for (int i = 2; i < 5; i++) {\r\n        auto key = keyPrefix;\r\n        key.append(std::to_string(i)).append(\".txt\");\r\n        delRequest.addKey(key);\r\n    }\r\n    delOutcome = Client->DeleteObjects(delRequest);\r\n    EXPECT_EQ(delOutcome.isSuccess(), true);\r\n    EXPECT_EQ(delOutcome.result().keyList().size(), 3UL);\r\n\r\n    DeletedKeyList keyList;\r\n    for (size_t i = 5; i < TestKeysCnt; i++) {\r\n        auto key = keyPrefix;\r\n        key.append(std::to_string(i)).append(\".txt\");\r\n        keyList.push_back(key);\r\n    }\r\n    delRequest.setKeyList(keyList);\r\n    delOutcome = Client->DeleteObjects(delRequest);\r\n    EXPECT_EQ(delOutcome.isSuccess(), true);\r\n    EXPECT_EQ(delOutcome.result().keyList().size(), (TestKeysCnt-5));\r\n\r\n    lOutcome = Client->ListObjects(lRequest);\r\n    EXPECT_EQ(lOutcome.result().ObjectSummarys().size(), 0UL);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, DeleteObjectsWithEncodingTypeTest)\r\n{\r\n    const size_t TestKeysCnt = 10;\r\n    auto keyPrefix = TestUtils::GetObjectKey(\"DeleteObjectsWithEncodingTypeTest\");\r\n\r\n    for (size_t i = 0; i < TestKeysCnt; i++) {\r\n        auto key = keyPrefix;\r\n        auto content = TestUtils::GetRandomStream(100);\r\n        key.append(std::to_string(i)).append(\".txt\");\r\n        auto outcome = Client->PutObject(BucketName, key, content);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    DeleteObjectsRequest delRequest(BucketName);\r\n    for (size_t i = 0; i < TestKeysCnt; i++) {\r\n        auto key = keyPrefix;\r\n        key.append(std::to_string(i)).append(\".txt\");\r\n        delRequest.addKey(key);\r\n    }\r\n    delRequest.setEncodingType(\"url\");\r\n    EXPECT_EQ(delRequest.EncodingType(), \"url\");\r\n\r\n    auto delOutcome = Client->DeleteObjects(delRequest);\r\n    EXPECT_EQ(delOutcome.isSuccess(), true);\r\n    EXPECT_EQ(delOutcome.result().keyList().size(), TestKeysCnt);\r\n    EXPECT_EQ(delOutcome.result().Quiet(), false);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, DeleteObjectsInvalidBucketNameTest)\r\n{\r\n    DeletedKeyList keyList;\r\n    keyList.push_back(\"key\");\r\n    auto outcome = Client->DeleteObjects(\"InvalidBucketName\", keyList);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, DeleteObjectInvalidBucketNameTest)\r\n{\r\n    auto outcome = Client->DeleteObject(\"InvalidBucketName\", \"key\");\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, DeleteObjectInvalidKeyTest)\r\n{\r\n    auto outcome = Client->DeleteObject(\"bucketname\", \"\");\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectMultiTimesUseTheSameContentTest)\r\n{\r\n    const size_t TestKeysCnt = 5;\r\n    auto keyPrefix = TestUtils::GetObjectKey(\"PutObjectMultiTimesUseTheSameContentTest\");\r\n\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\r\n    *content << \"123456789\";\r\n\r\n    for (size_t i = 0; i < TestKeysCnt; i++) {\r\n        auto key = keyPrefix;\r\n        content->clear();\r\n        content->seekg(0, content->beg);\r\n        key.append(std::to_string(i)).append(\".txt\");\r\n        auto outcome = Client->PutObject(BucketName, key, content);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, HeadObjectsNegativeTest)\r\n{\r\n    auto outcome = Client->HeadObject(\"no-exist-bucket\", \"object\");\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\r\n\r\n    outcome = Client->HeadObject(BucketName, \"object\");\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchKey\");\r\n    EXPECT_EQ(outcome.error().RequestId().empty(), false);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, ObjectMetaDataDefaultTest)\r\n{\r\n    ObjectMetaData meta;\r\n    EXPECT_EQ(meta.LastModified(), \"\");\r\n    EXPECT_EQ(meta.ExpirationTime(), \"\");\r\n    EXPECT_EQ(meta.ContentLength(), -1LL);\r\n    EXPECT_EQ(meta.ContentType(), \"\");\r\n    EXPECT_EQ(meta.ContentEncoding(), \"\");\r\n    EXPECT_EQ(meta.CacheControl(), \"\");\r\n    EXPECT_EQ(meta.ContentDisposition(), \"\");\r\n    EXPECT_EQ(meta.ETag(), \"\");\r\n    EXPECT_EQ(meta.ContentMd5(), \"\");\r\n    EXPECT_EQ(meta.CRC64(), 0ULL);\r\n    EXPECT_EQ(meta.ObjectType(), \"\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, ObjectMetaDataSetTest)\r\n{\r\n    ObjectMetaData meta;\r\n\r\n    meta.setCacheControl(\"No-Cache\");\r\n    meta.setExpirationTime(\"Fri, 09 Nov 2018 05:57:16 GMT\");\r\n    meta.setContentLength(10000LL);\r\n    meta.setContentType(\"application/xml\");\r\n    meta.setContentEncoding(\"url\");\r\n    meta.setContentDisposition(\".zip\");\r\n    meta.setETag(\"ETAG\");\r\n    meta.setContentMd5(\"MD5\");\r\n    meta.setCrc64(1000ULL);\r\n    EXPECT_EQ(meta.CacheControl(), \"No-Cache\");\r\n    EXPECT_EQ(meta.ExpirationTime(), \"Fri, 09 Nov 2018 05:57:16 GMT\");\r\n    EXPECT_EQ(meta.ContentLength(), 10000LL);\r\n    EXPECT_EQ(meta.ContentType(), \"application/xml\");\r\n    EXPECT_EQ(meta.ContentEncoding(), \"url\");\r\n    EXPECT_EQ(meta.ContentDisposition(), \".zip\");\r\n    EXPECT_EQ(meta.ETag(), \"ETAG\");\r\n    EXPECT_EQ(meta.ContentMd5(), \"MD5\");\r\n    EXPECT_EQ(meta.CRC64(), 1000ULL);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectResultTest)\r\n{\r\n    std::string bucketName = TestUtils::GetBucketName(\"get-object-result-test\");\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectResultTestKey\");\r\n    ObjectMetaData meta;\r\n\r\n    GetObjectResult result(bucketName, key, meta);\r\n    EXPECT_EQ(result.RequestId(), \"\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, UtilsfunctionTest)\r\n{\r\n    auto md5 = ComputeContentMD5(\"test\");\r\n    std::string invalidKey;\r\n    IsValidTagKey(invalidKey);\r\n    ToRequestPayer(invalidKey.c_str());\r\n\r\n    DeleteObjectsResult result(\"test\");\r\n\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                    <Delete xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n\r\n                    </Delete>)\";\r\n    DeleteObjectsResult result1(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                    <DeleteResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                        <EncodingType></EncodingType>\r\n                        <Deleted>\r\n                        </Deleted>\r\n                        <Deleted>\r\n                           <Key></Key>\r\n                        </Deleted>\r\n                    </DeleteResult>)\";\r\n    DeleteObjectsResult result2(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                    <DeleteResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                       \r\n                    </DeleteResult>)\";\r\n    DeleteObjectsResult result3(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\r\n    DeleteObjectsResult result4(xml);\r\n\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, ListObjectsResultBranchTest)\r\n{\r\n    ListObjectsResult result(\"test\");\r\n\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListBucket xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n\r\n                    </ListBucket>)\";\r\n    ListObjectsResult result1(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListBucketResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                        \r\n                    </ListBucketResult>)\";\r\n    ListObjectsResult result2(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListBucketResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n\r\n                        <Contents>\r\n\r\n                        </Contents>\r\n                    </ListBucketResult>)\";\r\n    ListObjectsResult result3(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListBucketResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                        <Name></Name>\r\n                        <Prefix></Prefix>\r\n                        <Marker></Marker>\r\n                        <MaxKeys></MaxKeys>\r\n                        <Delimiter></Delimiter>\r\n                        <IsTruncated></IsTruncated>\r\n                        <NextMarker></NextMarker>\r\n                        <EncodingType></EncodingType>\r\n                        <CommonPrefixes>\r\n                        <Prefix></Prefix>\r\n                        </CommonPrefixes>\r\n                        <Contents>\r\n                            <Key></Key>\r\n                            <LastModified></LastModified>\r\n                            <ETag></ETag>\r\n                            <Type></Type>\r\n                            <Size></Size>\r\n                            <StorageClass></StorageClass>\r\n                            <Owner>\r\n                                <ID></ID>\r\n                                <DisplayName></DisplayName>\r\n                            </Owner>\r\n                        </Contents>\r\n                        <Contents>\r\n                            <Key></Key>\r\n                            <LastModified></LastModified>\r\n                            <ETag></ETag>\r\n                            <Type></Type>\r\n                            <Size></Size>\r\n                            <StorageClass></StorageClass>\r\n                            <Owner>\r\n                                <ID></ID>\r\n                                <DisplayName></DisplayName>\r\n                            </Owner>\r\n                        </Contents>\r\n                        <Contents>\r\n                            <Key></Key>\r\n                            <LastModified></LastModified>\r\n                            <ETag></ETag>\r\n                            <Type></Type>\r\n                            <Size></Size>\r\n                            <StorageClass></StorageClass>\r\n                            <Owner>\r\n                                <ID></ID>\r\n                                <DisplayName></DisplayName>\r\n                            </Owner>\r\n                        </Contents>\r\n                        <Contents>\r\n                            <Key></Key>\r\n                            <LastModified></LastModified>\r\n                            <ETag></ETag>\r\n                            <Type></Type>\r\n                            <Size></Size>\r\n                            <StorageClass></StorageClass>\r\n                            <Owner>\r\n                                <ID></ID>\r\n                                <DisplayName></DisplayName>\r\n                            </Owner>\r\n                        </Contents>\r\n                    </ListBucketResult>)\";\r\n    ListObjectsResult result4(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\r\n    ListObjectsResult result5(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <ListBucketResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n                        <CommonPrefixes>\r\n                        </CommonPrefixes>\r\n                        <Contents>\r\n                            <Key></Key>\r\n                            <LastModified></LastModified>\r\n                            <ETag></ETag>\r\n                            <Type></Type>\r\n                            <Size></Size>\r\n                            <StorageClass></StorageClass>\r\n                            <Owner>\r\n                            </Owner>\r\n                        </Contents>\r\n                    </ListBucketResult>)\";\r\n    ListObjectsResult result6(xml);\r\n\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, PutObjectResultBranchTest)\r\n{\r\n    HeaderCollection header;\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\r\n    *content << \"test\";\r\n    PutObjectResult result(header, content);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectWithOssDateHeaderTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectWithOssDateHeaderTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    std::time_t t = std::time(nullptr);\r\n    request.MetaData().addHeader(\"x-oss-date\", ToGmtTime(t));\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, DeleteObjectsWithSpecialCharsTest)\r\n{\r\n    std::string key = \"bswodnvsttpqvnzwsgifetwe\\n\\n\\t@#$!\\t<!@#$%^&*()-=\";\r\n    for (int i = 1; i < 0x1F; i++)\r\n        key.push_back((char)i);\r\n    key.append(\"--\");\r\n\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n\r\n    DeleteObjectsRequest delRequest(BucketName);\r\n    delRequest.addKey(key);\r\n    auto delOutcome = Client->DeleteObjects(delRequest);\r\n    EXPECT_EQ(delOutcome.isSuccess(), true);\r\n    EXPECT_EQ(delOutcome.result().keyList().size(), 1U);\r\n    EXPECT_EQ(delOutcome.result().Quiet(), false);\r\n\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), false);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, DeleteObjectsWithInvalidResponseBodyTest)\r\n{\r\n    std::string key = \"bswodnvsttpqvnzwsgifetwe\\n\\n\\t@#$!\\t<!@#$%^&*()-=\";\r\n    for (int i = 1; i < 0x1F; i++)\r\n        key.push_back((char)i);\r\n    key.append(\"--\");\r\n\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n\r\n    DeleteObjectsRequest delRequest(BucketName);\r\n    delRequest.addKey(key);\r\n    delRequest.setResponseStreamFactory([=]() {\r\n        auto data = std::make_shared<std::stringstream>();\r\n        data->write(\"invlid data\", 11);\r\n        return data;\r\n    });    \r\n    auto delOutcome = Client->DeleteObjects(delRequest);\r\n    EXPECT_EQ(delOutcome.isSuccess(), false);\r\n    EXPECT_EQ(delOutcome.error().Code(), \"ParseXMLError\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, ListObjectsWithInvalidResponseBodyTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"ListObjectsWithInvalidResponseBodyTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n\r\n    ListObjectsRequest lsRequest(BucketName);\r\n    lsRequest.setResponseStreamFactory([=]() {\r\n        auto data = std::make_shared<std::stringstream>();\r\n        data->write(\"invlid data\", 11);\r\n        return data;\r\n    });\r\n    auto listOutcome = Client->ListObjects(lsRequest);\r\n    EXPECT_EQ(listOutcome.isSuccess(), false);\r\n    EXPECT_EQ(listOutcome.error().Code(), \"ParseXMLError\");\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, GetObjectRequestStandardModeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectRequestStandardModeTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n\r\n    auto getRequet = GetObjectRequest(BucketName, key);\r\n    getRequet.setRange(10, 200);\r\n    auto getOutcome = Client->GetObject(getRequet);\r\n    EXPECT_EQ(getOutcome.result().Metadata().ContentLength(), 100);\r\n\r\n    getRequet = GetObjectRequest(BucketName, key);\r\n    getRequet.setRange(10, 200, true);\r\n    getOutcome = Client->GetObject(getRequet);\r\n    EXPECT_EQ(getOutcome.result().Metadata().ContentLength(), 90);\r\n\r\n    std::vector<std::string> etags;\r\n    std::map<std::string, std::string> maps;\r\n    getRequet = GetObjectRequest(BucketName, key, \"\", \"\", etags, etags, maps);\r\n    getRequet.setRange(10, 200);\r\n    getOutcome = Client->GetObject(getRequet);\r\n    EXPECT_EQ(getOutcome.result().Metadata().ContentLength(), 100);\r\n\r\n    getRequet = GetObjectRequest(BucketName, key, \"\", \"\", etags, etags, maps);\r\n    getRequet.setRange(10, 200, true);\r\n    getOutcome = Client->GetObject(getRequet);\r\n    EXPECT_EQ(getOutcome.result().Metadata().ContentLength(), 90);\r\n}\r\n\r\n//listobject2V2\r\nTEST_F(ObjectBasicOperationTest, ListObjectsV2Test)\r\n{\r\n    auto bucketName = BucketName + \"-v2\";\r\n    Client->CreateBucket(CreateBucketRequest(bucketName));\r\n\r\n    std::vector<std::string> keyArray;\r\n    //create test file\r\n    for (int i = 0; i < 10; i++) {\r\n        std::string key = TestUtils::GetObjectKey(\"folder/ListAllObjectsV2Test\");\r\n        auto content = TestUtils::GetRandomStream(100);\r\n        auto outcome = Client->PutObject(bucketName, key, content);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        keyArray.push_back(key);\r\n    }\r\n\r\n    for (int i = 0; i < 8; i++) {\r\n        std::string key = TestUtils::GetObjectKey(\"sub/ListAllObjectsV2Test\");\r\n        auto content = TestUtils::GetRandomStream(100);\r\n        auto outcome = Client->PutObject(bucketName, key, content);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    for (int i = 0; i < 5; i++) {\r\n        std::string key = TestUtils::GetObjectKey(\"list/ListAllObjectsV2Test\");\r\n        auto content = TestUtils::GetRandomStream(100);\r\n        auto outcome = Client->PutObject(bucketName, key, content);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    //list object use default\r\n    auto request = ListObjectsV2Request(bucketName);\r\n    auto listOutcome = Client->ListObjectsV2(request);\r\n    EXPECT_EQ(listOutcome.isSuccess(), true);\r\n    EXPECT_EQ(listOutcome.result().ObjectSummarys().size(), 23UL);\r\n    EXPECT_EQ(listOutcome.result().KeyCount(), 23L);\r\n    EXPECT_EQ(listOutcome.result().MaxKeys(), 100L);\r\n    EXPECT_EQ(listOutcome.result().Prefix(), \"\");\r\n    EXPECT_EQ(listOutcome.result().Delimiter(), \"\");\r\n    EXPECT_EQ(listOutcome.result().IsTruncated(), false);\r\n\r\n    int i = 0;\r\n    for (auto const &obj : listOutcome.result().ObjectSummarys()) {\r\n        EXPECT_EQ(obj.Size(), 100LL);\r\n        i++;\r\n    }\r\n    EXPECT_EQ(i, 23L);\r\n\r\n    //list object with prefix\r\n    request = ListObjectsV2Request(bucketName);\r\n    request.setMaxKeys(2);\r\n    request.setPrefix(\"folder\");\r\n\r\n    bool IsTruncated = false;\r\n    size_t total = 0;\r\n    do {\r\n        auto outcome = Client->ListObjectsV2(request);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        request.setContinuationToken(outcome.result().NextContinuationToken());\r\n        IsTruncated = outcome.result().IsTruncated();\r\n        total += outcome.result().ObjectSummarys().size();\r\n        EXPECT_EQ(outcome.result().KeyCount(), 2L);\r\n        EXPECT_EQ(outcome.result().MaxKeys(), 2L);\r\n        EXPECT_EQ(outcome.result().Prefix(), \"folder\");\r\n    } while (IsTruncated);\r\n\r\n    EXPECT_EQ(total, 10UL);\r\n\r\n    //with Delimiter\r\n    request = ListObjectsV2Request(bucketName);\r\n    request.setDelimiter(\"/\");\r\n    listOutcome = Client->ListObjectsV2(request);\r\n    EXPECT_EQ(listOutcome.isSuccess(), true);\r\n    EXPECT_EQ(listOutcome.result().CommonPrefixes().size(), 3UL);\r\n    EXPECT_EQ(listOutcome.result().KeyCount(), 3L);\r\n\r\n    //start-After\r\n    request = ListObjectsV2Request(bucketName);\r\n    request.setStartAfter(keyArray.at(3));\r\n    request.setPrefix(\"folder\");\r\n    listOutcome = Client->ListObjectsV2(request);\r\n    EXPECT_EQ(listOutcome.isSuccess(), true);\r\n    EXPECT_EQ(listOutcome.result().KeyCount(), 6L);\r\n    EXPECT_EQ(listOutcome.result().ObjectSummarys()[0].Key(), keyArray.at(4));\r\n    EXPECT_EQ(listOutcome.result().ObjectSummarys()[0].Owner().DisplayName().empty(), true);\r\n    EXPECT_EQ(listOutcome.result().ObjectSummarys()[0].Owner().Id().empty(), true);\r\n\r\n    //Fetch Owner\r\n    request = ListObjectsV2Request(bucketName);\r\n    request.setStartAfter(keyArray.at(4));\r\n    request.setPrefix(\"folder\");\r\n    request.setFetchOwner(true);\r\n    listOutcome = Client->ListObjectsV2(request);\r\n    EXPECT_EQ(listOutcome.isSuccess(), true);\r\n    EXPECT_EQ(listOutcome.result().KeyCount(), 5L);\r\n    EXPECT_EQ(listOutcome.result().ObjectSummarys()[0].Key(), keyArray.at(5));\r\n    EXPECT_EQ(listOutcome.result().ObjectSummarys()[0].Owner().DisplayName().empty(), false);\r\n    EXPECT_EQ(listOutcome.result().ObjectSummarys()[0].Owner().Id().empty(), false);\r\n\r\n    //encoding type\r\n    request = ListObjectsV2Request(bucketName);\r\n    request.setStartAfter(keyArray.at(5));\r\n    request.setPrefix(\"folder/ListAllObjectsV2Test\");\r\n    request.setEncodingType(\"url\");\r\n    listOutcome = Client->ListObjectsV2(request);\r\n    EXPECT_EQ(listOutcome.isSuccess(), true);\r\n    EXPECT_EQ(listOutcome.result().EncodingType(), \"url\");\r\n    EXPECT_EQ(listOutcome.result().KeyCount(), 4L);\r\n    EXPECT_EQ(listOutcome.result().Prefix(), \"folder/ListAllObjectsV2Test\");\r\n    EXPECT_EQ(listOutcome.result().ObjectSummarys()[0].Key(), keyArray.at(6));\r\n    EXPECT_EQ(listOutcome.result().ObjectSummarys()[0].Owner().DisplayName().empty(), true);\r\n    EXPECT_EQ(listOutcome.result().ObjectSummarys()[0].Owner().Id().empty(), true);\r\n}\r\n\r\nTEST_F(ObjectBasicOperationTest, ListObjectsV2ResultTest)\r\n{\r\n    ListObjectsV2Result result(\"test\");\r\n\r\n    std::string xml = R\"(\r\n            <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <ListBucket xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            </ListBucket>\r\n            )\";\r\n    ListObjectsV2Result result1(xml);\r\n\r\n    xml = R\"(\r\n            <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <ListBucketResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            </ListBucketResult>\r\n            )\";\r\n    ListObjectsV2Result result2(xml);\r\n\r\n    xml = R\"(\r\n            <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <ListBucketResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <Contents>\r\n            </Contents>\r\n            </ListBucketResult>\r\n            )\";\r\n    ListObjectsV2Result result3(xml);\r\n\r\n    xml = R\"(\r\n            <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <ListBucketResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <Name></Name>\r\n            <Prefix></Prefix>\r\n            <StartAfter></StartAfter>\r\n            <MaxKeys></MaxKeys>\r\n            <Delimiter></Delimiter>\r\n            <IsTruncated></IsTruncated>\r\n            <NextContinuationToken></NextContinuationToken>\r\n            <EncodingType></EncodingType>\r\n            <CommonPrefixes>\r\n            <Prefix></Prefix>\r\n            </CommonPrefixes>\r\n            <Contents>\r\n                <Key></Key>\r\n                <LastModified></LastModified>\r\n                <ETag></ETag>\r\n                <Type></Type>\r\n                <Size></Size>\r\n                <StorageClass></StorageClass>\r\n                <Owner>\r\n                    <ID></ID>\r\n                    <DisplayName></DisplayName>\r\n                </Owner>\r\n            </Contents>\r\n            <Contents>\r\n                <Key></Key>\r\n                <LastModified></LastModified>\r\n                <ETag></ETag>\r\n                <Type></Type>\r\n                <Size></Size>\r\n                <StorageClass></StorageClass>\r\n                <Owner>\r\n                    <ID></ID>\r\n                    <DisplayName></DisplayName>\r\n                </Owner>\r\n            </Contents>\r\n        </ListBucketResult>\r\n        )\";\r\n    ListObjectsV2Result result4(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\r\n    ListObjectsV2Result result5(xml);\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <ListBucketResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <CommonPrefixes>\r\n            </CommonPrefixes>\r\n            <Contents>\r\n                <Key></Key>\r\n                <LastModified></LastModified>\r\n                <ETag></ETag>\r\n                <Type></Type>\r\n                <Size></Size>\r\n                <StorageClass></StorageClass>\r\n                <Owner>\r\n                </Owner>\r\n            </Contents>\r\n        </ListBucketResult>\r\n        )\";\r\n    ListObjectsV2Result result6(xml);\r\n\r\n    xml = R\"(\r\n            <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <ListBucketResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <Name>name</Name>\r\n            <Prefix>prefix</Prefix>\r\n            <StartAfter>start</StartAfter>\r\n            <MaxKeys>20</MaxKeys>\r\n            <Delimiter>/</Delimiter>\r\n            <IsTruncated>true</IsTruncated>\r\n            <NextContinuationToken>next</NextContinuationToken>\r\n            <ContinuationToken>current</ContinuationToken>\r\n            <EncodingType>type</EncodingType>\r\n            <CommonPrefixes>\r\n                <Prefix>com-prefix</Prefix>\r\n            </CommonPrefixes>\r\n            <Contents>\r\n                <Key>key</Key>\r\n                <LastModified>last</LastModified>\r\n                <ETag>tag</ETag>\r\n                <Type>type</Type>\r\n                <Size>100</Size>\r\n                <StorageClass>class</StorageClass>\r\n                <Owner>\r\n                    <ID>id</ID>\r\n                    <DisplayName>display</DisplayName>\r\n                </Owner>\r\n            </Contents>\r\n            <KeyCount>3</KeyCount>\r\n        </ListBucketResult>\r\n        )\";\r\n    ListObjectsV2Result result7(xml);\r\n    EXPECT_EQ(result7.Name(), \"name\");\r\n    EXPECT_EQ(result7.Prefix(), \"prefix\");\r\n    EXPECT_EQ(result7.MaxKeys(), 20L);\r\n    EXPECT_EQ(result7.Delimiter(), \"/\");\r\n    EXPECT_EQ(result7.IsTruncated(), true);\r\n    EXPECT_EQ(result7.NextContinuationToken(), \"next\");\r\n    EXPECT_EQ(result7.ContinuationToken(), \"current\");\r\n    EXPECT_EQ(result7.EncodingType(), \"type\");\r\n    EXPECT_EQ(result7.CommonPrefixes().size(), 1UL);\r\n    EXPECT_EQ(result7.CommonPrefixes()[0], \"com-prefix\");\r\n    EXPECT_EQ(result7.ObjectSummarys().size(), 1UL);\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].Key(), \"key\");\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].LastModified(), \"last\");\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].ETag(), \"tag\");\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].Type(), \"type\");\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].Size(), 100LL);\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].StorageClass(), \"class\");\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].Owner().DisplayName(), \"display\");\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].Owner().Id(), \"id\");\r\n\r\n    xml = R\"(\r\n            <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <ListBucketResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <Name>name</Name>\r\n            <Prefix>prefix</Prefix>\r\n            <StartAfter>start</StartAfter>\r\n            <MaxKeys>20</MaxKeys>\r\n            <Delimiter>/</Delimiter>\r\n            <IsTruncated>true</IsTruncated>\r\n            <NextContinuationToken>next</NextContinuationToken>\r\n            <ContinuationToken>current</ContinuationToken>\r\n            <EncodingType>type</EncodingType>\r\n            <CommonPrefixes>\r\n                <Prefix>com-prefix</Prefix>\r\n            </CommonPrefixes>\r\n            <Contents>\r\n                <Key>key</Key>\r\n                <LastModified>last</LastModified>\r\n                <ETag>tag</ETag>\r\n                <Type>type</Type>\r\n                <Size>100</Size>\r\n                <StorageClass>class</StorageClass>\r\n                <Owner>\r\n                    <ID>id</ID>\r\n                    <DisplayName>display</DisplayName>\r\n                </Owner>\r\n                <RestoreInfo>ongoing-request=\"true\"</RestoreInfo>\r\n            </Contents>\r\n            <KeyCount>3</KeyCount>\r\n        </ListBucketResult>\r\n        )\";\r\n    result7 = ListObjectsV2Result(xml);\r\n    EXPECT_EQ(result7.Name(), \"name\");\r\n    EXPECT_EQ(result7.Prefix(), \"prefix\");\r\n    EXPECT_EQ(result7.MaxKeys(), 20L);\r\n    EXPECT_EQ(result7.Delimiter(), \"/\");\r\n    EXPECT_EQ(result7.IsTruncated(), true);\r\n    EXPECT_EQ(result7.NextContinuationToken(), \"next\");\r\n    EXPECT_EQ(result7.ContinuationToken(), \"current\");\r\n    EXPECT_EQ(result7.EncodingType(), \"type\");\r\n    EXPECT_EQ(result7.CommonPrefixes().size(), 1UL);\r\n    EXPECT_EQ(result7.CommonPrefixes()[0], \"com-prefix\");\r\n    EXPECT_EQ(result7.ObjectSummarys().size(), 1UL);\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].Key(), \"key\");\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].LastModified(), \"last\");\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].ETag(), \"tag\");\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].Type(), \"type\");\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].Size(), 100LL);\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].StorageClass(), \"class\");\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].Owner().DisplayName(), \"display\");\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].Owner().Id(), \"id\");\r\n    EXPECT_EQ(result7.ObjectSummarys()[0].RestoreInfo(), \"ongoing-request=\\\"true\\\"\");\r\n}\r\n\r\n}\r\n}"
  },
  {
    "path": "test/src/Object/ObjectCallbackTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <stdlib.h>\r\n#include <sstream>\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include <src/utils/Utils.h>\r\n#include <src/utils/FileSystemUtils.h>\r\n#include \"src/external/json/json.h\"\r\n\r\nnamespace AlibabaCloud\r\n{ \r\nnamespace OSS \r\n{\r\nclass ObjectCallbackTest : public ::testing::Test\r\n{\r\nprotected:\r\n    ObjectCallbackTest()\r\n    {\r\n    }\r\n\r\n    ~ObjectCallbackTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase()\r\n    {\r\n\t\tClientConfiguration conf;\r\n        Client = std::make_shared<OssClient>(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n\t\tBucketName = TestUtils::GetBucketName(\"cpp-sdk-objectcallback\");\r\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\r\n        EXPECT_EQ(outCome.isSuccess(), true);\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase()\r\n    {\r\n\t\tTestUtils::CleanBucket(*Client, BucketName);\r\n        Client = nullptr;\r\n    }\r\n\r\n    // Sets up the test fixture.\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    // Tears down the test fixture.\r\n    void TearDown() override\r\n    {\r\n    }\r\npublic:\r\n    static std::shared_ptr<OssClient> Client;\r\n    static std::string BucketName;\r\n};\r\n\r\nstd::shared_ptr<OssClient> ObjectCallbackTest::Client = nullptr;\r\nstd::string ObjectCallbackTest::BucketName = \"\";\r\n\r\nTEST_F(ObjectCallbackTest, PutObjectCallbackTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectCallbackTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    std::string callbackUrl = Config::CallbackServer;\r\n    std::string callbackBody = \"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var1=${x:var1}\";\r\n\r\n    ObjectCallbackBuilder builder(callbackUrl, callbackBody);\r\n    std::string value = builder.build();\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.setCallback(value);\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() != nullptr);\r\n\r\n    auto outome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(outome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content);\r\n    std::string memMd5 = ComputeContentMD5(*outome.result().Content());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, PutObjectCallbackVarTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectCallbackVarTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    std::string callbackUrl = Config::CallbackServer;\r\n    std::string callbackBody = \"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var1=${x:var1}\";\r\n\r\n    ObjectCallbackBuilder builder(callbackUrl, callbackBody, \"\", ObjectCallbackBuilder::URL);\r\n    std::string value = builder.build();\r\n\r\n    ObjectCallbackVariableBuilder varBuilder;\r\n    varBuilder.addCallbackVariable(\"x:var1\", \"value1\");\r\n    varBuilder.addCallbackVariable(\"x:var2\", \"value2\");\r\n    std::string varValue = varBuilder.build();\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.setCallback(value, varValue);\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() != nullptr);\r\n\r\n    auto outome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(outome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content);\r\n    std::string memMd5 = ComputeContentMD5(*outome.result().Content());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, MultipartUploadCallbackTest)\r\n{\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadCallbackTest\");\r\n\r\n    InitiateMultipartUploadRequest request(BucketName, targetObjectKey);\r\n    auto initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(initOutcome.result().RequestId().empty());\r\n\r\n    PartList partETags;\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    UploadPartRequest uRequest(BucketName, targetObjectKey, content);\r\n    uRequest.setPartNumber(1);\r\n    uRequest.setUploadId(initOutcome.result().UploadId());\r\n    auto uploadPartOutcome = Client->UploadPart(uRequest);\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\r\n    Part part(1, uploadPartOutcome.result().ETag());\r\n    partETags.push_back(part);\r\n\r\n    std::string callbackUrl = Config::CallbackServer;\r\n    std::string callbackBody = \"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var1=${x:var1}\";\r\n\r\n    ObjectCallbackBuilder builder(callbackUrl, callbackBody);\r\n    std::string value = builder.build();\r\n\r\n    CompleteMultipartUploadRequest completeRequest(BucketName, targetObjectKey, partETags);\r\n    completeRequest.setUploadId(initOutcome.result().UploadId());\r\n    completeRequest.setCallback(value);\r\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(cOutcome.result().Content() != nullptr);\r\n\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, MultipartUploadCallbackVarTest)\r\n{\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadCallbackTest\");\r\n\r\n    InitiateMultipartUploadRequest request(BucketName, targetObjectKey);\r\n    auto initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(initOutcome.result().RequestId().empty());\r\n\r\n    PartList partETags;\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    UploadPartRequest uRequest(BucketName, targetObjectKey, content);\r\n    uRequest.setPartNumber(1);\r\n    uRequest.setUploadId(initOutcome.result().UploadId());\r\n    auto uploadPartOutcome = Client->UploadPart(uRequest);\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\r\n    Part part(1, uploadPartOutcome.result().ETag());\r\n    partETags.push_back(part);\r\n\r\n    std::string callbackUrl = Config::CallbackServer;\r\n    std::string callbackBody = \"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var1=${x:var1}\";\r\n\r\n    ObjectCallbackBuilder builder(callbackUrl, callbackBody, \"\", ObjectCallbackBuilder::URL);\r\n    std::string value = builder.build();\r\n\r\n    ObjectCallbackVariableBuilder varBuilder;\r\n    varBuilder.addCallbackVariable(\"x:var1\", \"value1\");\r\n    varBuilder.addCallbackVariable(\"x:var2\", \"value2\");\r\n    std::string varValue = varBuilder.build();\r\n\r\n    CompleteMultipartUploadRequest completeRequest(BucketName, targetObjectKey, partETags);\r\n    completeRequest.setUploadId(initOutcome.result().UploadId());\r\n    completeRequest.setCallback(value, varValue);\r\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(cOutcome.result().Content() != nullptr);\r\n\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, ResumableUploadCallbackTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"ResumableUploadCallbackTest\");\r\n    std::string file = TestUtils::GetTargetFileName(\"ResumableUploadCallbackTest\");\r\n    TestUtils::WriteRandomDatatoFile(file, 204800);\r\n\r\n    std::string callbackUrl = Config::CallbackServer;\r\n    std::string callbackBody = \"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var1=${x:var1}\";\r\n\r\n    ObjectCallbackBuilder builder(callbackUrl, callbackBody);\r\n    std::string value = builder.build();\r\n    //simple mode \r\n    UploadObjectRequest request(BucketName, key, file);\r\n    request.setPartSize(309600);\r\n    request.setCallback(value);\r\n    auto pOutcome = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() != nullptr);\r\n    std::string fileETag = TestUtils::GetFileETag(file);\r\n    EXPECT_EQ(fileETag, pOutcome.result().ETag());\r\n\r\n    //multiprat mode\r\n    request.setPartSize(102400);\r\n    auto pOutcome2 = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(pOutcome2.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome2.result().Content() != nullptr);\r\n\r\n    EXPECT_EQ(pOutcome2.result().CRC64(), pOutcome.result().CRC64());\r\n    EXPECT_NE(pOutcome2.result().ETag(), pOutcome.result().ETag());\r\n\r\n    EXPECT_EQ(RemoveFile(file), true);\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, ResumableUploadCallbackVarTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"ResumableUploadCallbackVarTest\");\r\n    std::string file = TestUtils::GetTargetFileName(\"ResumableUploadCallbackVarTest\");\r\n    TestUtils::WriteRandomDatatoFile(file, 204800);\r\n\r\n    std::string callbackUrl = Config::CallbackServer;\r\n    std::string callbackBody = \"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var1=${x:var1}\";\r\n\r\n    ObjectCallbackBuilder builder(callbackUrl, callbackBody);\r\n    std::string value = builder.build();\r\n    ObjectCallbackVariableBuilder varBuilder;\r\n    varBuilder.addCallbackVariable(\"x:var1\", \"value1\");\r\n    varBuilder.addCallbackVariable(\"x:var2\", \"value2\");\r\n    std::string varValue = varBuilder.build();\r\n\r\n    //simple mode \r\n    UploadObjectRequest request(BucketName, key, file);\r\n    request.setPartSize(309600);\r\n    request.setCallback(value, varValue);\r\n    auto pOutcome = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() != nullptr);\r\n    std::string fileETag = TestUtils::GetFileETag(file);\r\n    EXPECT_EQ(fileETag, pOutcome.result().ETag());\r\n\r\n    //multiprat mode\r\n    request.setPartSize(102400);\r\n    auto pOutcome2 = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(pOutcome2.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome2.result().Content() != nullptr);\r\n\r\n    EXPECT_EQ(pOutcome2.result().CRC64(), pOutcome.result().CRC64());\r\n    EXPECT_NE(pOutcome2.result().ETag(), pOutcome.result().ETag());\r\n\r\n    EXPECT_EQ(RemoveFile(file), true);\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, PutPreSignedCallbackTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutPreSignedCallbackTest\");\r\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\r\n\r\n    std::string callbackUrl = Config::CallbackServer;\r\n    std::string callbackBody = \"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var1=${x:var1}\";\r\n    ObjectCallbackBuilder builder(callbackUrl, callbackBody);\r\n    std::string value = builder.build();\r\n\r\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\r\n    request.addParameter(\"callback\", value);\r\n\r\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n\r\n    auto pOutcome = Client->PutObjectByUrl(PutObjectByUrlRequest(urlOutcome.result(), content));\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() != nullptr);\r\n\r\n    auto outcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().ContentLength(), 1024LL);\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, PutPreSignedCallbackVarTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutPreSignedCallbackVarTest\");\r\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\r\n\r\n    std::string callbackUrl = Config::CallbackServer;\r\n    std::string callbackBody = \"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var1=${x:var1}\";\r\n    ObjectCallbackBuilder builder(callbackUrl, callbackBody);\r\n    std::string value = builder.build();\r\n    ObjectCallbackVariableBuilder varBuilder;\r\n    varBuilder.addCallbackVariable(\"x:var1\", \"value1\");\r\n    varBuilder.addCallbackVariable(\"x:var2\", \"value2\");\r\n    std::string varValue = varBuilder.build();\r\n\r\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\r\n    request.addParameter(\"callback\", value);\r\n    request.addParameter(\"callback-var\", varValue);\r\n\r\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n\r\n    auto pOutcome = Client->PutObjectByUrl(PutObjectByUrlRequest(urlOutcome.result(), content));\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() != nullptr);\r\n\r\n    auto outcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().ContentLength(), 1024LL);\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, ResumableUploadCallbackUrlNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"ResumableUploadCallbackUrlNegativeTest\");\r\n    std::string file = TestUtils::GetTargetFileName(\"ResumableUploadCallbackUrlNegativeTest\");\r\n    TestUtils::WriteRandomDatatoFile(file, 204800);\r\n\r\n    std::string callbackUrl = \"http://192.168.1.1\";\r\n    std::string callbackBody = \"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var1=${x:var1}\";\r\n\r\n    ObjectCallbackBuilder builder(callbackUrl, callbackBody);\r\n    std::string value = builder.build();\r\n    //simple mode \r\n    UploadObjectRequest request(BucketName, key, file);\r\n    request.setPartSize(309600);\r\n    request.setCallback(value);\r\n    auto pOutcome = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"InvalidArgument\");\r\n    EXPECT_EQ(pOutcome.error().Message(), \"Private address is forbidden to callback.\");\r\n    EXPECT_TRUE(pOutcome.error().RequestId().size() > 0);\r\n\r\n    //multiprat mode\r\n    request.setPartSize(102400);\r\n    auto pOutcome2 = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(pOutcome2.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome2.error().Code(), \"InvalidArgument\");\r\n    EXPECT_EQ(pOutcome.error().Message(), \"Private address is forbidden to callback.\");\r\n    EXPECT_TRUE(pOutcome.error().RequestId().size() > 0);\r\n\r\n    //simple mode \r\n    builder.setCallbackUrl(\"http://oss-cn-hangzhou.aliyuncs.com\");\r\n    value = builder.build();\r\n    request.setPartSize(309600);\r\n    request.setCallback(value);\r\n    pOutcome = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"CallbackFailed\");\r\n    EXPECT_TRUE(pOutcome.error().RequestId().size() > 0);\r\n\r\n    request.setPartSize(102400);\r\n    pOutcome2 = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(pOutcome2.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome2.error().Code(), \"CallbackFailed\");\r\n    EXPECT_TRUE(pOutcome.error().RequestId().size() > 0);\r\n\r\n    EXPECT_EQ(RemoveFile(file), true);\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, PutObjectCallbackNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectCallbackBodyNegativeTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.setCallback(\"error argument\");\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"InvalidArgument\");\r\n    EXPECT_EQ(pOutcome.error().Message(), \"The callback configuration is not base64 encoded.\");\r\n\r\n    request.setCallback(Base64Encode(\"error argument\"));\r\n    pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"InvalidArgument\");\r\n    EXPECT_EQ(pOutcome.error().Message(), \"The callback configuration is not json format.\");\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, PutPreSignedCallbackNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutPreSignedCallbackNegativeTest\");\r\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\r\n\r\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\r\n    request.addParameter(\"callback\", Base64Encode(\"error argument\"));\r\n\r\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n\r\n    auto pOutcome = Client->PutObjectByUrl(PutObjectByUrlRequest(urlOutcome.result(), content));\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"InvalidArgument\");\r\n    EXPECT_EQ(pOutcome.error().Message(), \"The callback configuration is not json format.\");\r\n\r\n    //invalid callback server\r\n    std::string callbackUrl = \"http://oss-cn-hangzhou.aliyuncs.com\";\r\n    std::string callbackBody = \"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var1=${x:var1}\";\r\n\r\n    ObjectCallbackBuilder builder(callbackUrl, callbackBody);\r\n    std::string value = builder.build();\r\n    request.addParameter(\"callback\", value);\r\n\r\n    urlOutcome = Client->GeneratePresignedUrl(request);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n    pOutcome = Client->PutObjectByUrl(PutObjectByUrlRequest(urlOutcome.result(), content));\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"CallbackFailed\");\r\n    EXPECT_TRUE(pOutcome.error().RequestId().size() > 0);\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, ObjectCallbackBuilderTest)\r\n{\r\n    ObjectCallbackBuilder builder(\"192.168.1.100\", \"11111\");\r\n\r\n    std::stringstream ss;\r\n    std::string value;\r\n    Json::CharReaderBuilder rbuilder;\r\n    Json::Value readRoot;\r\n    std::string errMessage;\r\n\r\n    builder.setCallbackUrl(\"192.168.1.1\");\r\n    builder.setCallbackBody(\"123456\");\r\n    value = TestUtils::Base64Decode(builder.build());\r\n    ss << value;\r\n    if (Json::parseFromStream(rbuilder, ss, &readRoot, &errMessage)) {\r\n        EXPECT_EQ(readRoot[\"callbackUrl\"].asString(), \"192.168.1.1\");\r\n        EXPECT_EQ(readRoot[\"callbackHost\"].asString(), \"\");\r\n        EXPECT_EQ(readRoot[\"callbackBody\"].asString(), \"123456\");\r\n        EXPECT_EQ(readRoot[\"callbackBodyType\"].asString(), \"\");\r\n    }\r\n    else {\r\n        EXPECT_EQ(errMessage, \"\");\r\n    }\r\n\r\n    builder.setCallbackHost(\"demo.com\");\r\n    ss.str(\"\");\r\n    value = TestUtils::Base64Decode(builder.build());\r\n    ss << value;\r\n    if (Json::parseFromStream(rbuilder, ss, &readRoot, &errMessage)) {\r\n        EXPECT_EQ(readRoot[\"callbackUrl\"].asString(), \"192.168.1.1\");\r\n        EXPECT_EQ(readRoot[\"callbackHost\"].asString(), \"demo.com\");\r\n        EXPECT_EQ(readRoot[\"callbackBody\"].asString(), \"123456\");\r\n        EXPECT_EQ(readRoot[\"callbackBodyType\"].asString(), \"\");\r\n    }\r\n    else {\r\n        EXPECT_EQ(errMessage, \"\");\r\n    }\r\n\r\n    builder.setCallbackBodyType(ObjectCallbackBuilder::JSON);\r\n    ss.str(\"\");\r\n    value = TestUtils::Base64Decode(builder.build());\r\n    ss << value;\r\n    if (Json::parseFromStream(rbuilder, ss, &readRoot, &errMessage)) {\r\n        EXPECT_EQ(readRoot[\"callbackUrl\"].asString(), \"192.168.1.1\");\r\n        EXPECT_EQ(readRoot[\"callbackHost\"].asString(), \"demo.com\");\r\n        EXPECT_EQ(readRoot[\"callbackBody\"].asString(), \"123456\");\r\n        EXPECT_EQ(readRoot[\"callbackBodyType\"].asString(), \"application/json\");\r\n    }\r\n    else {\r\n        EXPECT_EQ(errMessage, \"\");\r\n    }\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, ObjectCallbackVariableBuilderTest)\r\n{\r\n    ObjectCallbackVariableBuilder builder;\r\n    builder.addCallbackVariable(\"x:var1\", \"value1\");\r\n    builder.addCallbackVariable(\"x:var2\", \"value2\");\r\n\r\n    std::stringstream ss;\r\n    std::string value;\r\n    Json::CharReaderBuilder rbuilder;\r\n    Json::Value readRoot;\r\n    std::string errMessage;\r\n\r\n    value = TestUtils::Base64Decode(builder.build());\r\n    ss << value;\r\n    if (Json::parseFromStream(rbuilder, ss, &readRoot, &errMessage)) {\r\n        EXPECT_EQ(readRoot[\"x:var1\"].asString(), \"value1\");\r\n        EXPECT_EQ(readRoot[\"x:var2\"].asString(), \"value2\");\r\n    }\r\n    else {\r\n        EXPECT_EQ(errMessage, \"\");\r\n    }\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, PutObjectWithoutCallbackTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithoutCallbackTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() == nullptr);\r\n\r\n    auto outome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(outome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content);\r\n    std::string memMd5 = ComputeContentMD5(*outome.result().Content());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, MultipartUploadWitoutCallbackTest)\r\n{\r\n    //get target object name\r\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadWitoutCallbackTest\");\r\n\r\n    InitiateMultipartUploadRequest request(BucketName, targetObjectKey);\r\n    auto initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(initOutcome.result().RequestId().empty());\r\n\r\n    PartList partETags;\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    UploadPartRequest uRequest(BucketName, targetObjectKey, content);\r\n    uRequest.setPartNumber(1);\r\n    uRequest.setUploadId(initOutcome.result().UploadId());\r\n    auto uploadPartOutcome = Client->UploadPart(uRequest);\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\r\n    Part part(1, uploadPartOutcome.result().ETag());\r\n    partETags.push_back(part);\r\n\r\n    CompleteMultipartUploadRequest completeRequest(BucketName, targetObjectKey, partETags);\r\n    completeRequest.setUploadId(initOutcome.result().UploadId());\r\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(cOutcome.result().Content() == nullptr);\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, ResumableUploadWithoutCallbackTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"ResumableUploadWithoutCallbackTest\");\r\n    std::string file = TestUtils::GetTargetFileName(\"ResumableUploadWithoutCallbackTest\");\r\n    TestUtils::WriteRandomDatatoFile(file, 204800);\r\n\r\n    //simple mode \r\n    UploadObjectRequest request(BucketName, key, file);\r\n    request.setPartSize(309600);\r\n    auto pOutcome = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() == nullptr);\r\n    std::string fileETag = TestUtils::GetFileETag(file);\r\n    EXPECT_EQ(fileETag, pOutcome.result().ETag());\r\n\r\n    //multiprat mode\r\n    request.setPartSize(102400);\r\n    auto pOutcome2 = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(pOutcome2.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome2.result().Content() == nullptr);\r\n\r\n    EXPECT_EQ(pOutcome2.result().CRC64(), pOutcome.result().CRC64());\r\n    EXPECT_NE(pOutcome2.result().ETag(), pOutcome.result().ETag());\r\n\r\n    EXPECT_EQ(RemoveFile(file), true);\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, PutPreSignedWithoutCallbackTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutPreSignedWithoutCallbackTest\");\r\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\r\n\r\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\r\n\r\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n\r\n    auto pOutcome = Client->PutObjectByUrl(PutObjectByUrlRequest(urlOutcome.result(), content));\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(pOutcome.result().Content() == nullptr);\r\n\r\n    auto outcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().ContentLength(), 1024LL);\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, ObjectCallbackBuilderFunctionTest)\r\n{\r\n    std::string callbackUrl;\r\n    std::string callbackBody;\r\n    ObjectCallbackBuilder builder(callbackUrl, callbackBody);\r\n\r\n    builder.build();\r\n\r\n    ObjectCallbackVariableBuilder varBuilder;\r\n    varBuilder.addCallbackVariable(\"var1\", \"value1\");\r\n    varBuilder.build();\r\n}\r\n\r\nTEST_F(ObjectCallbackTest, PutPreSignedCallbackWithInvalidResponseTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutPreSignedCallbackWithInvalidResponseTest\");\r\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\r\n\r\n    //invalid callback server\r\n    std::string callbackUrl = \"http://oss-cn-hangzhou.aliyuncs.com\";\r\n    std::string callbackBody = \"bucket=${bucket}&object=${object}&etag=${etag}&size=${size}&mimeType=${mimeType}&my_var1=${x:var1}\";\r\n\r\n    ObjectCallbackBuilder builder(callbackUrl, callbackBody);\r\n    std::string value = builder.build();\r\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\r\n    request.addParameter(\"callback\", value);\r\n\r\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n\r\n    PutObjectByUrlRequest poRequest(urlOutcome.result(), content);\r\n    poRequest.setResponseStreamFactory([=]() {\r\n        auto data = std::make_shared<std::stringstream>();\r\n        data->write(\"invlid data\", 11);\r\n        return data;\r\n    });\r\n    auto pOutcome = Client->PutObjectByUrl(poRequest);\r\n    EXPECT_EQ(pOutcome.isSuccess(), false);\r\n    EXPECT_EQ(pOutcome.error().Code(), \"ParseXMLError:13\");\r\n}\r\n\r\n}\r\n}\r\n"
  },
  {
    "path": "test/src/Object/ObjectCopyTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud{ namespace OSS {\nclass ObjectCopyTest : public ::testing::Test\n{\nprotected:\n    ObjectCopyTest()\n    {\n    }\n\n    ~ObjectCopyTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n\t\tClientConfiguration conf;\n\t\tconf.enableCrc64 = false;\n        Client = TestUtils::GetOssClientDefault();\n\n        ListBucketsRequest request;\n\t\trequest.setPrefix(\"cpp-sdk-objectcopy\");\n\t\trequest.setMaxKeys(200);\n\t\tauto outcome = Client->ListBuckets(request);\n\t\tEXPECT_EQ(outcome.isSuccess(), true);\n\n        BucketName1 = TestUtils::GetBucketName(\"cpp-sdk-objectcopy1\");\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName1));\n        EXPECT_EQ(outCome.isSuccess(), true);\n\n        BucketName2 = TestUtils::GetBucketName(\"cpp-sdk-objectcopy2\");\n        outCome = Client->CreateBucket(CreateBucketRequest(BucketName2));\n        EXPECT_EQ(outCome.isSuccess(), true);\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n\t\tTestUtils::CleanBucket(*Client, BucketName1);\n\t\tTestUtils::CleanBucket(*Client, BucketName2);\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName1;\n    static std::string BucketName2;\n};\n\nstd::shared_ptr<OssClient> ObjectCopyTest::Client = nullptr;\nstd::string ObjectCopyTest::BucketName1 = \"\";\nstd::string ObjectCopyTest::BucketName2 = \"\";\n\nTEST_F(ObjectCopyTest, ObjectCopyNewObject)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text1 = \"hellowworld\";\n\n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\tCopyObjectRequest copyRequest(BucketName2, objName2);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n\n\t//begin copy object\n\tCopyObjectOutcome copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);\n}\n\nTEST_F(ObjectCopyTest, ObjectCopyNewObjectWithSrcMeta)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text1 = \"hellowworld\";\n\n    ObjectMetaData MetaInfo;\n\tMetaInfo.UserMetaData()[\"author\"] = \"chanju\";\n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1),MetaInfo));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\tCopyObjectRequest copyRequest(BucketName2, objName2);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n\n\t//begin copy object\n\tCopyObjectOutcome copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);\n    std::string metaValue = getOutcome.result().Metadata().UserMetaData().at(\"author\");\n    EXPECT_EQ(metaValue, \"chanju\");\n}\n\n\nTEST_F(ObjectCopyTest, ObjectCopyNewObjectNotCreateNewMetaCopy)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text1 = \"hellowworld\";\n\n    ObjectMetaData MetaInfo;\n\tMetaInfo.UserMetaData()[\"author\"] = \"chanju\";\n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1),MetaInfo));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n    ObjectMetaData MetaInfoCopy;\n\tMetaInfoCopy.UserMetaData()[\"author1\"] = \"chanju1\";\n    \n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\tCopyObjectRequest copyRequest(BucketName2, objName2,MetaInfoCopy);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n    copyRequest.setMetadataDirective(CopyActionList::Copy);\n\n\t//begin copy object\n\tCopyObjectOutcome copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author\"), \"chanju\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().find(\"author1\"),\n              getOutcome.result().Metadata().UserMetaData().end());\n}\n\nTEST_F(ObjectCopyTest, ObjectCopyNewObjectNotCreateNewMetaReplace)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text1 = \"hellowworld\";\n\n    ObjectMetaData MetaInfo;\n\tMetaInfo.UserMetaData()[\"author\"] = \"chanju\";\n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1),MetaInfo));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n    ObjectMetaData MetaInfoCopy;\n\tMetaInfoCopy.UserMetaData()[\"author1\"] = \"chanju1\";\n    MetaInfoCopy.UserMetaData()[\"author2\"] = \"chanju2\";\n    \n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\tCopyObjectRequest copyRequest(BucketName2, objName2,MetaInfoCopy);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n    copyRequest.setMetadataDirective(CopyActionList::Replace);\n\n\t//begin copy object\n\tCopyObjectOutcome copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().find(\"author\"),\n              getOutcome.result().Metadata().UserMetaData().end());\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author1\"),\"chanju1\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author2\"),\"chanju2\");\n}\n\nTEST_F(ObjectCopyTest, ObjectCopyExistObject)\n{\n    std::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n    std::string text1 = \"hellowworld\";\n\n    std::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n    std::string text2 = text1 + text1;\n\n    PutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1)));\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n    std::string etag1 = putOutcome.result().ETag();\n\n    putOutcome = Client->PutObject(PutObjectRequest(BucketName2, objName2, std::make_shared<std::stringstream>(text2)));\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n    std::string etag2 = putOutcome.result().ETag();\n\n    EXPECT_EQ(etag1!=etag2, true);\n\n    CopyObjectRequest copyRequest(BucketName2,objName2);\n    copyRequest.setCopySource(BucketName1,objName1);\n\n    //begin copy object\n    CopyObjectOutcome copyOutCome = Client->CopyObject(copyRequest);\n    EXPECT_EQ(copyOutCome.isSuccess(), true);\n\n    // get object\n    GetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    std::string strData ;\n    (*getOutcome.result().Content().get()) >> strData;\n    EXPECT_EQ(strData, text1);  \n}\n\nTEST_F(ObjectCopyTest, ObjectCopyETagMatch)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text1 = \"hellowworld\";\n\n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\tstd::string text2 = text1 + text1;\n\n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n\tputOutcome = Client->PutObject(PutObjectRequest(BucketName2, objName2, std::make_shared<std::stringstream>(text2)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag2 = putOutcome.result().ETag();\n\n\tEXPECT_EQ((etag1 != etag2), true);\n\n    // set etag invalid\n\tCopyObjectRequest copyRequest(BucketName2, objName2);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n\tcopyRequest.setSourceIfMatchETag(\"aaa\");\n\t\n\t//begin copy object\n\tCopyObjectOutcome copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), false);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text2);\n\n    // set valid etag\n    copyRequest.setSourceIfMatchETag(etag1);\n    copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tgetOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);\n}\n\n\nTEST_F(ObjectCopyTest, ObjectCopyETagNotMatch)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text1 = \"hellowworld\";\n\n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\tstd::string text2 = text1 + text1;\n\n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n\tputOutcome = Client->PutObject(PutObjectRequest(BucketName2, objName2, std::make_shared<std::stringstream>(text2)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag2 = putOutcome.result().ETag();\n\n\tEXPECT_EQ((etag1 != etag2), true);\n\n    CopyObjectRequest copyRequest(BucketName2, objName2);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n\n    // set valid etag\n\tcopyRequest.setSourceIfNotMatchETag(etag1);\n    CopyObjectOutcome  copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), false);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text2);\n\n    // set etag invalid\n\tcopyRequest.setSourceIfNotMatchETag(\"aaa\");\n\t\n\t//begin copy object\n\tcopyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tgetOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);  \n}\n\nTEST_F(ObjectCopyTest, ObjectCopyUnModifiedSince)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text1 = \"hellowworld\";\n\n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\tstd::string text2 = text1 + text1;\n\n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n\tputOutcome = Client->PutObject(PutObjectRequest(BucketName2, objName2, std::make_shared<std::stringstream>(text2)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag2 = putOutcome.result().ETag();\n\n\tEXPECT_EQ((etag1 != etag2), true);\n\n    TestUtils::WaitForCacheExpire(2);\n\n    // set early time,not copy\n    CopyObjectRequest copyRequest(BucketName2, objName2);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n\n    std::string earlyDate = TestUtils::GetGMTString(-100);\n\tcopyRequest.setSourceIfUnModifiedSince(earlyDate);\n    \n    CopyObjectOutcome  copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), false);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text2);\n\n    // set later date,copy\n    std::string laterDate = TestUtils::GetGMTString(100);\n\tcopyRequest.setSourceIfUnModifiedSince(laterDate);\n\t\n\t//begin copy object\n\tcopyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tgetOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);  \n}\n\nTEST_F(ObjectCopyTest, ObjectCopyModifiedSince)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text1 = \"hellowworld\";\n\n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\tstd::string text2 = text1 + text1;\n\n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n\tputOutcome = Client->PutObject(PutObjectRequest(BucketName2, objName2, std::make_shared<std::stringstream>(text2)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag2 = putOutcome.result().ETag();\n\n\tEXPECT_EQ((etag1 != etag2), true);\n\n\tTestUtils::WaitForCacheExpire(2);\n\n\t// set later time,not copy\n\tCopyObjectRequest copyRequest(BucketName2, objName2);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n\n\tstd::string laterDate = TestUtils::GetGMTString(100);\n\tcopyRequest.setSourceIfModifiedSince(laterDate);\n\n\tCopyObjectOutcome  copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), false);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text2);\n\n\t// set early date,copy\n\tstd::string earlyDate = TestUtils::GetGMTString(-100);\n\tcopyRequest.setSourceIfModifiedSince(earlyDate);\n\n\t//begin copy object\n\tcopyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tgetOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);\n}\n\n\nTEST_F(ObjectCopyTest, ObjectCopyAclPrivate)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text = \"hellowworld\";\n\n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n\tTestUtils::WaitForCacheExpire(2);\n\n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\n\tCopyObjectRequest copyRequest(BucketName2, objName2);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n\tcopyRequest.setAcl(CannedAccessControlList::Private);\n\n\tCopyObjectOutcome  copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text);\n\n\t// get acl\n\tauto aclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName2, objName2));\n\tEXPECT_EQ(aclOutcome.isSuccess(), true);\n\tEXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::Private);\n}\n\nTEST_F(ObjectCopyTest, ObjectCopyAclPublicRead)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text = \"hellowworld\";\n\n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n\tTestUtils::WaitForCacheExpire(2);\n\n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\n\tCopyObjectRequest copyRequest(BucketName2, objName2);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n\tcopyRequest.setAcl(CannedAccessControlList::PublicRead);\n\n\tCopyObjectOutcome  copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text);\n\n\t// get acl\n\tauto aclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName2, objName2));\n\tEXPECT_EQ(aclOutcome.isSuccess(), true);\n\tEXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::PublicRead);\n}\n\nTEST_F(ObjectCopyTest, ObjectCopyAclPublicReadWrite)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text = \"hellowworld\";\n\n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n\tTestUtils::WaitForCacheExpire(2);\n\n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\n\tCopyObjectRequest copyRequest(BucketName2, objName2);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n\tcopyRequest.setAcl(CannedAccessControlList::PublicReadWrite);\n\n\tCopyObjectOutcome  copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text);\n\n\t// get acl\n\tauto aclOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName2, objName2));\n\tEXPECT_EQ(aclOutcome.isSuccess(), true);\n\tEXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::PublicReadWrite);\n}\n\nTEST_F(ObjectCopyTest, ObjectCopyExistObjectMeta)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text1 = \"hellowworld\";\n\n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\tstd::string text2 = text1 + text1;\n\n    ObjectMetaData MetaInfo1;\n    MetaInfo1.UserMetaData()[\"author1\"] = \"chanju1-src\";\n    MetaInfo1.UserMetaData()[\"author2\"] = \"chanju2-src\";\n    \n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1),MetaInfo1));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n    ObjectMetaData MetaInfo2;\n    MetaInfo1.UserMetaData()[\"author1\"] = \"chanju1-dest\";\n    MetaInfo1.UserMetaData()[\"author3\"] = \"chanju3-dest\";\n\tputOutcome = Client->PutObject(PutObjectRequest(BucketName2, objName2, std::make_shared<std::stringstream>(text2),MetaInfo2));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag2 = putOutcome.result().ETag();\n\n\tEXPECT_EQ((etag1 != etag2), true);\n\n\tTestUtils::WaitForCacheExpire(2);\n\n\t//ObjectMetaData MetaInfoCopy;\n    //MetaInfoCopy.UserMetaData()[\"author1\"] = \"chanju1-dest\";\n    //MetaInfoCopy.UserMetaData()[\"author2\"] = \"chanju2-dest\";\n    //MetaInfoCopy.UserMetaData()[\"author3\"] = \"chanju3-dest\";\n    \n\tCopyObjectRequest copyRequest(BucketName2, objName2);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n\tCopyObjectOutcome  copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author1\"),\"chanju1-src\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author2\"),\"chanju2-src\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().find(\"author3\"),\n              getOutcome.result().Metadata().UserMetaData().end());\n\n}\n\nTEST_F(ObjectCopyTest, ObjectCopyExistObjectMetaCopy)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text1 = \"hellowworld\";\n\n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\tstd::string text2 = text1 + text1;\n\n    ObjectMetaData MetaInfo1;\n    MetaInfo1.UserMetaData()[\"author1\"] = \"chanju1-src\";\n    MetaInfo1.UserMetaData()[\"author2\"] = \"chanju2-src\";\n    \n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1),MetaInfo1));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n    ObjectMetaData MetaInfo2;\n    MetaInfo1.UserMetaData()[\"author1\"] = \"chanju1-dest\";\n    MetaInfo1.UserMetaData()[\"author3\"] = \"chanju3-dest\";\n\tputOutcome = Client->PutObject(PutObjectRequest(BucketName2, objName2, std::make_shared<std::stringstream>(text2),MetaInfo2));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag2 = putOutcome.result().ETag();\n\n\tEXPECT_EQ((etag1 != etag2), true);\n\n\tTestUtils::WaitForCacheExpire(2);\n\n\tObjectMetaData MetaInfoCopy;\n    MetaInfoCopy.UserMetaData()[\"author1\"] = \"chanju1-copy\";\n    MetaInfoCopy.UserMetaData()[\"author2\"] = \"chanju2-copy\";\n    MetaInfoCopy.UserMetaData()[\"author3\"] = \"chanju3-copy\";\n    \n\tCopyObjectRequest copyRequest(BucketName2, objName2,MetaInfoCopy);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n    copyRequest.setMetadataDirective(CopyActionList::Copy);\n\tCopyObjectOutcome  copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author1\"),\"chanju1-src\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author2\"),\"chanju2-src\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().find(\"author3\"),\n                  getOutcome.result().Metadata().UserMetaData().end());\n}\n\n\nTEST_F(ObjectCopyTest, ObjectCopyExistObjectMetaReplace)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n\tstd::string text1 = \"hellowworld\";\n\n\tstd::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n\tstd::string text2 = text1 + text1;\n\n    ObjectMetaData MetaInfo1;\n    MetaInfo1.UserMetaData()[\"author1\"] = \"chanju1-src\";\n    MetaInfo1.UserMetaData()[\"author2\"] = \"chanju2-src\";\n    \n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1),MetaInfo1));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n    ObjectMetaData MetaInfo2;\n    MetaInfo1.UserMetaData()[\"author1\"] = \"chanju1-dest\";\n    MetaInfo1.UserMetaData()[\"author3\"] = \"chanju3-dest\";\n\tputOutcome = Client->PutObject(PutObjectRequest(BucketName2, objName2, std::make_shared<std::stringstream>(text2),MetaInfo2));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag2 = putOutcome.result().ETag();\n\n\tEXPECT_EQ((etag1 != etag2), true);\n\n\tTestUtils::WaitForCacheExpire(2);\n\n\tObjectMetaData MetaInfoCopy;\n    MetaInfoCopy.UserMetaData()[\"author1\"] = \"chanju1-copy\";\n    MetaInfoCopy.UserMetaData()[\"author2\"] = \"chanju2-copy\";\n    MetaInfoCopy.UserMetaData()[\"author3\"] = \"chanju3-copy\";\n    \n\tCopyObjectRequest copyRequest(BucketName2, objName2,MetaInfoCopy);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n    copyRequest.setMetadataDirective(CopyActionList::Replace);\n\tCopyObjectOutcome  copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName2, objName2));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author1\"),\"chanju1-copy\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author2\"),\"chanju2-copy\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author3\"),\"chanju3-copy\");\n}\n\n\nTEST_F(ObjectCopyTest, ObjectCopySameObjectMetaCopy)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-ObjectCopySameObjectMetaCopy\");\n\tstd::string text1 = \"hellowworld\";\n\n    ObjectMetaData MetaInfo1;\n    MetaInfo1.UserMetaData()[\"author1\"] = \"chanju1-src\";\n    MetaInfo1.UserMetaData()[\"author2\"] = \"chanju2-src\";\n    \n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1),MetaInfo1));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n\tTestUtils::WaitForCacheExpire(2);\n\n\tObjectMetaData MetaInfoCopy;\n    MetaInfoCopy.UserMetaData()[\"author1\"] = \"chanju1-copy\";\n    MetaInfoCopy.UserMetaData()[\"author2\"] = \"chanju2-copy\";\n    MetaInfoCopy.UserMetaData()[\"author3\"] = \"chanju3-copy\";\n    \n\tCopyObjectRequest copyRequest(BucketName1, objName1,MetaInfoCopy);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n    copyRequest.setMetadataDirective(CopyActionList::Copy);\n\tCopyObjectOutcome  copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName1, objName1));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author1\"),\"chanju1-copy\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author2\"),\"chanju2-copy\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author3\"),\"chanju3-copy\");\n}\n\nTEST_F(ObjectCopyTest, ObjectCopySameObjectMetaReplace)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-ObjectCopySameObjectMetaReplace\");\n\tstd::string text1 = \"hellowworld\";\n\n    ObjectMetaData MetaInfo1;\n    MetaInfo1.UserMetaData()[\"author1\"] = \"chanju1-src\";\n    MetaInfo1.UserMetaData()[\"author2\"] = \"chanju2-src\";\n    \n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1),MetaInfo1));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n\tTestUtils::WaitForCacheExpire(2);\n\n\tObjectMetaData MetaInfoCopy;\n    MetaInfoCopy.UserMetaData()[\"author1\"] = \"chanju1-copy\";\n    MetaInfoCopy.UserMetaData()[\"author2\"] = \"chanju2-copy\";\n    MetaInfoCopy.UserMetaData()[\"author3\"] = \"chanju3-copy\";\n    \n\tCopyObjectRequest copyRequest(BucketName1, objName1,MetaInfoCopy);\n\tcopyRequest.setCopySource(BucketName1, objName1);\n    copyRequest.setMetadataDirective(CopyActionList::Replace);\n\tCopyObjectOutcome  copyOutCome = Client->CopyObject(copyRequest);\n\tEXPECT_EQ(copyOutCome.isSuccess(), true);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName1, objName1));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author1\"),\"chanju1-copy\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author2\"),\"chanju2-copy\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author3\"),\"chanju3-copy\");\n}\n\nTEST_F(ObjectCopyTest, ObjectCopyUpdateUserMeta1)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-ObjectCopyUpdateUserMeta1\");\n\tstd::string text1 = \"hellowworld\";\n\n    ObjectMetaData MetaInfo1;\n    MetaInfo1.UserMetaData()[\"author1\"] = \"chanju1-src\";\n    MetaInfo1.UserMetaData()[\"author2\"] = \"chanju2-src\";\n    \n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1),MetaInfo1));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n\tTestUtils::WaitForCacheExpire(2);\n\n\tObjectMetaData MetaInfoCopy;\n    MetaInfoCopy.UserMetaData()[\"author1\"] = \"chanju1-copy\";\n    MetaInfoCopy.UserMetaData()[\"author2\"] = \"chanju2-copy\";\n    MetaInfoCopy.UserMetaData()[\"author3\"] = \"chanju3-copy\";\n\n\tCopyObjectOutcome  copyOutCome = Client->ModifyObjectMeta(BucketName1, objName1, MetaInfoCopy);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName1, objName1));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author1\"),\"chanju1-copy\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author2\"),\"chanju2-copy\");\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().at(\"author3\"),\"chanju3-copy\");\n}\n\nTEST_F(ObjectCopyTest, ObjectCopyUpdateUserMeta2)\n{\n\tstd::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-ObjectCopyUpdateUserMeta2\");\n\tstd::string text1 = \"hellowworld\";\n\n    ObjectMetaData MetaInfo1;\n    MetaInfo1.UserMetaData()[\"author1\"] = \"chanju1-src\";\n    MetaInfo1.UserMetaData()[\"author2\"] = \"chanju2-src\";\n    \n\tPutObjectOutcome putOutcome = Client->PutObject(PutObjectRequest(BucketName1, objName1, std::make_shared<std::stringstream>(text1),MetaInfo1));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\tstd::string etag1 = putOutcome.result().ETag();\n\n\tTestUtils::WaitForCacheExpire(2);\n\n\tObjectMetaData MetaInfoCopy;  \n\tCopyObjectOutcome  copyOutCome = Client->ModifyObjectMeta(BucketName1, objName1, MetaInfoCopy);\n\n\t// get object\n\tGetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName1, objName1));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\tstd::string strData;\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, text1);\n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().find(\"author1\"),\n                  getOutcome.result().Metadata().UserMetaData().end());    \n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().find(\"author2\"),\n                  getOutcome.result().Metadata().UserMetaData().end());  \n    EXPECT_EQ(getOutcome.result().Metadata().UserMetaData().find(\"author3\"),\n                  getOutcome.result().Metadata().UserMetaData().end());  \n}\n\n\n\nTEST_F(ObjectCopyTest, CopyObjectResultTest)\n{\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <CopyObjectResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\n                     <LastModified>Fri, 24 Feb 2012 07:18:48 GMT</LastModified>\n                     <ETag>\"5B3C1A2E053D763E1B002CC607C5A0FE\"</ETag>\n                    </CopyObjectResult>)\";\n    CopyObjectResult result(std::make_shared<std::stringstream>(xml));\n    EXPECT_EQ(result.LastModified(), \"Fri, 24 Feb 2012 07:18:48 GMT\");\n    EXPECT_EQ(result.ETag(), \"5B3C1A2E053D763E1B002CC607C5A0FE\");\n}\n\nTEST_F(ObjectCopyTest, CopyObjectWithSpecialKeyNameTest)\n{\n    //put test file\n    unsigned char buff[] = { 0xE4, 0XB8, 0XAD, 0XE6, 0X96, 0X87, 0XE5, 0X90, 0X8D, 0XE5, 0XAD, 0X97, 0X2B, 0X0 };\n    std::string u8_str((char *)buff);\n    auto testKey = u8_str;\n    auto content = TestUtils::GetRandomStream(100);\n    Client->PutObject(BucketName1, testKey, content);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName1, testKey), true);\n\n    //get target object name\n    auto targetObjectKey = TestUtils::GetObjectKey(\"CopyObjectWithSpecialKeyNameTest\");\n\n    CopyObjectRequest request(BucketName1, targetObjectKey);\n    request.setCopySource(BucketName1, testKey);\n    auto outcome = Client->CopyObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n}\n\nTEST_F(ObjectCopyTest, CopyObjectRequestBranchTest)\n{\n    ObjectMetaData meta;\n    meta.setContentType(\"test\");\n\n    CopyObjectRequest request(BucketName1,\"test\", meta);\n    Client->CopyObject(request);\n\n    CopyObjectResult result(\"test\");\n\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <CopyObject xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\n                     <LastModified>Fri, 24 Feb 2012 07:18:48 GMT</LastModified>\n                     <ETag>\"5B3C1A2E053D763E1B002CC607C5A0FE\"</ETag>\n                    </CopyObject>)\";\n    CopyObjectResult result1(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <CopyObjectResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\n                    </CopyObjectResult>)\";\n    CopyObjectResult result2(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n                    <CopyObjectResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\n                     <LastModified></LastModified>\n                     <ETag></ETag>\n                    </CopyObjectResult>)\";\n    CopyObjectResult result3(xml);\n\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\n    CopyObjectResult result4(xml);\n}\n}\n}\n"
  },
  {
    "path": "test/src/Object/ObjectEncodingTypeTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include <fstream>\r\n\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass ObjectEncodingTypeTest : public ::testing::Test {\r\nprotected:\r\n    ObjectEncodingTypeTest()\r\n    {\r\n    }\r\n\r\n    ~ObjectEncodingTypeTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase() \r\n    {\r\n        Client = TestUtils::GetOssClientDefault();\r\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-objectencodingtype\");\r\n        Client->CreateBucket(CreateBucketRequest(BucketName));\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase() \r\n    {\r\n        TestUtils::CleanBucket(*Client, BucketName);\r\n        Client = nullptr;\r\n    }\r\n\r\n    // Sets up the test fixture.\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    // Tears down the test fixture.\r\n    void TearDown() override\r\n    {\r\n    }\r\n\r\npublic:\r\n    static std::shared_ptr<OssClient> Client;\r\n    static std::string BucketName;\r\n};\r\n\r\nstd::shared_ptr<OssClient> ObjectEncodingTypeTest::Client = nullptr;\r\nstd::string ObjectEncodingTypeTest::BucketName = \"\";\r\n\r\n\r\nTEST_F(ObjectEncodingTypeTest, DeleteObjectsWithHiddenCharacters)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"DeleteObjectsWithHiddenCharacters\");\r\n\r\n    std::string newKey1 = key;\r\n    newKey1.push_back(0x1c); newKey1.push_back(0x1a); newKey1.append(\".1.cd\");\r\n\r\n    std::string newKey2 = key;\r\n    newKey2.push_back(0x1c); newKey2.push_back(0x1a); newKey2.append(\".2.cd\");\r\n\r\n    std::string newKey3 = key;\r\n    newKey3.append(\".3.cd\");\r\n\r\n    std::string src = TestUtils::GetRandomString(1024);\r\n\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>(src);\r\n    auto outcome = Client->PutObject(BucketName, newKey1, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    content = std::make_shared<std::stringstream>(src);\r\n    outcome = Client->PutObject(BucketName, newKey2, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    content = std::make_shared<std::stringstream>(src);\r\n    outcome = Client->PutObject(BucketName, newKey3, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    DeletedKeyList keyList;\r\n    keyList.push_back(newKey1);\r\n    keyList.push_back(newKey2);\r\n    keyList.push_back(newKey3);\r\n    auto dOutcome = Client->DeleteObjects(BucketName, keyList);\r\n    EXPECT_EQ(dOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(ObjectEncodingTypeTest, DeleteObjectsWithHiddenCharactersUseUrlEncoding)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"DeleteObjectsWithHiddenCharactersUseUrlEncoding\");\r\n\r\n    std::string newKey1 = key;\r\n    newKey1.push_back(0x1c); newKey1.push_back(0x1a); newKey1.append(\".1.cd\");\r\n\r\n    std::string newKey2 = key;\r\n    newKey2.push_back(0x1c); newKey2.push_back(0x1a); newKey2.append(\".2.cd\");\r\n\r\n    std::string newKey3 = key;\r\n    newKey3.append(\".3.cd\");\r\n\r\n    std::string src = TestUtils::GetRandomString(1024);\r\n\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>(src);\r\n    auto outcome = Client->PutObject(BucketName, newKey1, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    content = std::make_shared<std::stringstream>(src);\r\n    outcome = Client->PutObject(BucketName, newKey2, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    content = std::make_shared<std::stringstream>(src);\r\n    outcome = Client->PutObject(BucketName, newKey3, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto lsOutcome = Client->ListObjects(BucketName, key);\r\n    EXPECT_EQ(lsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lsOutcome.result().ObjectSummarys().size(), 3UL);\r\n\r\n    DeletedKeyList keyList;\r\n    keyList.push_back(newKey1);\r\n    keyList.push_back(newKey2);\r\n    keyList.push_back(newKey3);\r\n    DeleteObjectsRequest request(BucketName);\r\n    request.setEncodingType(\"url\");\r\n    request.setKeyList(keyList);\r\n    auto dOutcome = Client->DeleteObjects(request);\r\n    EXPECT_EQ(dOutcome.isSuccess(), true);\r\n\r\n    std::list<std::string> patList;\r\n    patList.push_back(newKey1);\r\n    patList.push_back(newKey2);\r\n    patList.push_back(newKey3);\r\n    EXPECT_EQ(dOutcome.result().keyList(), patList);\r\n\r\n    lsOutcome = Client->ListObjects(BucketName, key);\r\n    EXPECT_EQ(lsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lsOutcome.result().ObjectSummarys().size(), 0UL);\r\n}\r\n\r\nTEST_F(ObjectEncodingTypeTest, DeleteObjectsWithEscapeCharacters)\r\n{\r\n    std::string keyPrefix = TestUtils::GetObjectKey(\"DeleteObjectsWithEscapeCharacters\");\r\n    char entities[] = { '\\\"', '&', '\\'', '<', '>' };\r\n\r\n    std::vector<std::string> keys;\r\n\r\n    for (size_t i = 0; i < sizeof(entities) / sizeof(entities[0]); i++) {\r\n        std::string key = keyPrefix;\r\n        key.append(\"-\").append(std::to_string(i));\r\n        key.push_back(entities[i]);\r\n        key.append(\".dat\");\r\n        keys.push_back(key);\r\n        auto outcome = Client->PutObject(BucketName, key, std::make_shared<std::stringstream>(\"just for test.\"));\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n    {\r\n    std::string key = keyPrefix;\r\n    key.append(\"-\").append(std::to_string(9));\r\n    key.append(\"\\\"&\\'<>-10.dat\");\r\n    keys.push_back(key);\r\n    auto outcome = Client->PutObject(BucketName, key, std::make_shared<std::stringstream>(\"just for test.\"));\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    }\r\n\r\n    EXPECT_EQ(keys.size(), 6UL);\r\n\r\n    auto lsOutcome = Client->ListObjects(BucketName, keyPrefix);\r\n    EXPECT_EQ(lsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lsOutcome.result().ObjectSummarys().size(), keys.size());\r\n\r\n    DeletedKeyList keyList;\r\n    std::list<std::string> patList;\r\n    for (const auto& key : keys) {\r\n        keyList.push_back(key);\r\n        patList.push_back(key);\r\n    }\r\n    auto dOutcome = Client->DeleteObjects(BucketName, keyList);\r\n    EXPECT_EQ(dOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dOutcome.result().keyList(), patList);\r\n\r\n    lsOutcome = Client->ListObjects(BucketName, keyPrefix);\r\n    EXPECT_EQ(lsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lsOutcome.result().ObjectSummarys().size(), 0UL);\r\n}\r\n\r\n}\r\n}"
  },
  {
    "path": "test/src/Object/ObjectHashCheckTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include <fstream>\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass ObjectHashCheckTest : public ::testing::Test {\nprotected:\n    ObjectHashCheckTest()\n    {\n    }\n\n    ~ObjectHashCheckTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase() \n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-objecthashcheck\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase() \n    {\n        TestUtils::CleanBucket(*Client, BucketName);\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\n\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> ObjectHashCheckTest::Client = nullptr;\nstd::string ObjectHashCheckTest::BucketName = \"\";\n\n\n\n}\n}"
  },
  {
    "path": "test/src/Object/ObjectProcessTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include <fstream>\r\n#include <string.h>\r\n\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass ObjectProcessTest : public ::testing::Test {\r\nprotected:\r\n    ObjectProcessTest()\r\n    {\r\n    }\r\n\r\n    ~ObjectProcessTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase() \r\n    {\r\n        Client = TestUtils::GetOssClientDefault();\r\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-objectprocess\");\r\n        ImageFilePath = Config::GetDataPath();\r\n        ImageFilePath.append(\"example.jpg\");\r\n        Process   = \"image/resize,m_fixed,w_100,h_100\";\r\n        ImageInfo = \"{\\n    \\\"FileSize\\\": {\\\"value\\\": \\\"3267\\\"},\\n    \\\"Format\\\": {\\\"value\\\": \\\"jpg\\\"},\\n    \\\"FrameCount\\\": {\\\"value\\\": \\\"1\\\"},\\n    \\\"ImageHeight\\\": {\\\"value\\\": \\\"100\\\"},\\n    \\\"ImageWidth\\\": {\\\"value\\\": \\\"100\\\"},\\n    \\\"ResolutionUnit\\\": {\\\"value\\\": \\\"1\\\"},\\n    \\\"XResolution\\\": {\\\"value\\\": \\\"1/1\\\"},\\n    \\\"YResolution\\\": {\\\"value\\\": \\\"1/1\\\"}}\";\r\n\r\n        Client->CreateBucket(CreateBucketRequest(BucketName));\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase() \r\n    {\r\n        TestUtils::CleanBucket(*Client, BucketName);\r\n        Client = nullptr;\r\n    }\r\n\r\n    // Sets up the test fixture.\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    // Tears down the test fixture.\r\n    void TearDown() override\r\n    {\r\n    }\r\n\r\n    static std::string GetOssImageObjectInfo(const std::string &bucket, const std::string &key)\r\n    {\r\n        auto outcome = Client->GetObject(GetObjectRequest(bucket, key, \"image/info\"));\r\n\r\n        if (outcome.isSuccess()) {\r\n            std::istreambuf_iterator<char> isb(*outcome.result().Content().get()), end;\r\n            return std::string(isb, end);\r\n        }\r\n        return \"\";\r\n    }\r\n\r\n\r\npublic:\r\n    static std::shared_ptr<OssClient> Client;\r\n    static std::string BucketName;\r\n    static std::string ImageFilePath;\r\n    static std::string Process;\r\n    static std::string ImageInfo;\r\n\r\n};\r\n\r\nstd::shared_ptr<OssClient> ObjectProcessTest::Client = nullptr;\r\nstd::string ObjectProcessTest::BucketName = \"\";\r\nstd::string ObjectProcessTest::ImageFilePath = \"\";\r\nstd::string ObjectProcessTest::Process = \"\";\r\nstd::string ObjectProcessTest::ImageInfo = \"\";\r\n\r\nstatic bool CompareImageInfo(const std::string &src, const std::string &dst)\r\n{\r\n    if (src == dst) {\r\n        return true;\r\n    }\r\n    //the filesize maybe not equal \r\n    const char * srcPtr = strstr(src.c_str(), \"Format\");\r\n    const char * dstPtr = strstr(dst.c_str(), \"Format\");\r\n    return strcmp(srcPtr, dstPtr) == 0 ? true : false;\r\n}\r\n\r\nTEST_F(ObjectProcessTest, ImageProcessTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"cpp-sdk-objectprocess\");\r\n    key.append(\"-noraml.jpg\");\r\n    auto pOutcome = Client->PutObject(BucketName, key, ImageFilePath);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    GetObjectRequest request(BucketName, key, Process);\r\n    auto gOutcome = Client->GetObject(request);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n    if (gOutcome.isSuccess()) {\r\n        std::string key1 = TestUtils::GetObjectKey(\"cpp-sdk-objectprocess\");\r\n        key1.append(\"-precessed.jpg\");\r\n        auto outcome = Client->PutObject(BucketName, key1, gOutcome.result().Content());\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        std::string imageInfo    = GetOssImageObjectInfo(BucketName, key1);\r\n        //EXPECT_STREQ(imageInfo.c_str(), ImageInfo.c_str());\r\n        EXPECT_TRUE(CompareImageInfo(imageInfo, ImageInfo));\r\n    }\r\n    else {\r\n        EXPECT_TRUE(false);\r\n    }\r\n}\r\n\r\nTEST_F(ObjectProcessTest, ImageProcessBysetProcessTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"ImageProcessBysetProcessTest\");\r\n    key.append(\"-noraml.jpg\");\r\n    auto pOutcome = Client->PutObject(BucketName, key, ImageFilePath);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    GetObjectRequest request(BucketName, key);\r\n    request.setProcess(Process);\r\n    auto gOutcome = Client->GetObject(request);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n    if (gOutcome.isSuccess()) {\r\n        std::string key1 = TestUtils::GetObjectKey(\"ImageProcessBysetProcessTest\");\r\n        key1.append(\"-precessed.jpg\");\r\n        auto outcome = Client->PutObject(BucketName, key1, gOutcome.result().Content());\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        std::string imageInfo = GetOssImageObjectInfo(BucketName, key1);\r\n        EXPECT_TRUE(CompareImageInfo(imageInfo, ImageInfo));\r\n    }\r\n    else {\r\n        EXPECT_TRUE(false);\r\n    }\r\n}\r\n\r\n\r\nTEST_F(ObjectProcessTest, GenerateUriWithProcessTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"cpp-sdk-objectprocess\");\r\n    key.append(\"-url-noraml.jpg\");\r\n    auto pOutcome = Client->PutObject(BucketName, key, ImageFilePath);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Get);\r\n    request.setProcess(Process);\r\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n\r\n    auto gOutcome = Client->GetObjectByUrl(urlOutcome.result());\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n    if (gOutcome.isSuccess()) {\r\n        std::string key1 = TestUtils::GetObjectKey(\"cpp-sdk-objectprocess\");\r\n        key1.append(\"-url-precessed.jpg\");\r\n        auto outcome = Client->PutObject(BucketName, key1, gOutcome.result().Content());\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        std::string imageInfo = GetOssImageObjectInfo(BucketName, key1);\r\n        //EXPECT_STREQ(imageInfo.c_str(), ImageInfo.c_str());\r\n        EXPECT_TRUE(CompareImageInfo(imageInfo, ImageInfo));\r\n    }\r\n    else {\r\n        EXPECT_TRUE(false);\r\n    }\r\n}\r\n\r\nTEST_F(ObjectProcessTest, ProcessObjectRequestTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"ImageProcessBysetProcessAndSavetoTest\");\r\n    std::string key1 = key;\r\n    std::string key2 = key;\r\n    key.append(\"-noraml.jpg\");\r\n    key1.append(\"-saveas.jpg\");\r\n    key2.append(\"-saveas2.jpg\");\r\n    auto pOutcome = Client->PutObject(BucketName, key, ImageFilePath);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    std::stringstream ss;\r\n    ss  << Process \r\n        <<\"|sys/saveas\"\r\n        << \",o_\" << Base64EncodeUrlSafe(key1)\r\n        << \",b_\" << Base64EncodeUrlSafe(BucketName);\r\n\r\n    ProcessObjectRequest request(BucketName, key, ss.str());\r\n    auto gOutcome = Client->ProcessObject(request);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n    std::istreambuf_iterator<char> isb(*gOutcome.result().Content()), end;\r\n    std::string json_str = std::string(isb, end);\r\n    //std::cout << json_str << std::endl;\r\n    EXPECT_TRUE(json_str.find(key1) != std::string::npos);\r\n\r\n    std::string imageInfo = GetOssImageObjectInfo(BucketName, key1);\r\n    EXPECT_TRUE(CompareImageInfo(imageInfo, ImageInfo));\r\n\r\n    //Use default bucketName\r\n    ss.str(\"\");\r\n    ss << Process\r\n        << \"|sys/saveas\"\r\n        << \",o_\" << Base64EncodeUrlSafe(key2);\r\n    request.setProcess(ss.str());\r\n    gOutcome = Client->ProcessObject(request);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n    std::istreambuf_iterator<char> isb1(*gOutcome.result().Content()), end1;\r\n    json_str = std::string(isb1, end1);\r\n    //std::cout << json_str << std::endl;\r\n    EXPECT_TRUE(json_str.find(key2) != std::string::npos);\r\n    imageInfo = GetOssImageObjectInfo(BucketName, key2);\r\n    EXPECT_TRUE(CompareImageInfo(imageInfo, ImageInfo));\r\n}\r\n\r\nTEST_F(ObjectProcessTest, ProcessObjectRequestNegativeTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"ProcessObjectRequestNegativeTest\");\r\n    key.append(\"-noraml.jpg\");\r\n    auto pOutcome = Client->PutObject(BucketName, key, ImageFilePath);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    ProcessObjectRequest request(BucketName, key);\r\n    auto gOutcome = Client->ProcessObject(request);\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_EQ(gOutcome.error().Code(), \"InvalidRequest\");\r\n}\r\n\r\n}\r\n}"
  },
  {
    "path": "test/src/Object/ObjectProgressTest .cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include <fstream>\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass ObjectProgressTest : public ::testing::Test {\nprotected:\n    ObjectProgressTest()\n    {\n    }\n\n    ~ObjectProgressTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase() \n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-objectprogress\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase() \n    {\n        TestUtils::CleanBucket(*Client, BucketName);\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\n\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> ObjectProgressTest::Client = nullptr;\nstd::string ObjectProgressTest::BucketName = \"\";\n\nstatic void ProgressCallback(size_t increment, int64_t transfered, int64_t total, void* userData)\n{\n    std::cout << \"ProgressCallback[\" << userData << \"] => \" <<\n        increment << \" ,\" << transfered << \",\" << total << std::endl;\n}\n\nTEST_F(ObjectProgressTest, PutObjectProgressTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"PutObjectProgressTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\n\n    PutObjectRequest request(BucketName, key, content);\n    TransferProgress arg;\n    arg.Handler = ProgressCallback;\n    arg.UserData = this;\n    request.setTransferProgress(arg);\n    auto pOutcome = Client->PutObject(request);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n}\n\nTEST_F(ObjectProgressTest, GetObjectProgressTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"GetObjectProgressTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\n\n    auto pOutcome = Client->PutObject(PutObjectRequest(BucketName, key, content));\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    GetObjectRequest grequest(BucketName, key);\n    TransferProgress arg;\n    arg.Handler = ProgressCallback;\n    arg.UserData = this;\n    grequest.setTransferProgress(arg);\n    auto gOutcome = Client->GetObject(grequest);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n}\n\n\n}\n}"
  },
  {
    "path": "test/src/Object/ObjectRequestPaymentTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include <alibabacloud/oss/Types.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include \"src/utils/FileSystemUtils.h\"\n#include \"src/utils/Utils.h\"\n#include <fstream>\n\n\nnamespace AlibabaCloud\n{ \nnamespace OSS \n{\n\nclass ObjectRequestPaymentTest : public ::testing::Test\n{\nprotected:\n    ObjectRequestPaymentTest()\n    {\n    }\n\n    ~ObjectRequestPaymentTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n        Client = TestUtils::GetOssClientDefault();\n        PayerClient = std::make_shared<OssClient>(Config::Endpoint, Config::PayerAccessKeyId, Config::PayerAccessKeySecret, ClientConfiguration());\n\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-objectcopy1\");\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\n        EXPECT_EQ(outCome.isSuccess(), true);\n\n        SetBucketPolicyRequest request(BucketName);\n        std::string policy = std::string(\"{\\\"Version\\\":\\\"1\\\",\\\"Statement\\\":[{\\\"Action\\\":[\\\"oss:*\\\"],\\\"Effect\\\": \\\"Allow\\\",\")\n            .append(\"\\\"Principal\\\":[\\\"\").append(Config::PayerUID).append(\"\\\"],\")\n            .append(\"\\\"Resource\\\": [\\\"acs:oss:*:*:\").append(BucketName).append(\"\\\",\\\"acs:oss:*:*:\").append(BucketName).append(\"/*\\\"]}]}\");\n        request.setPolicy(policy);\n        auto policyOutcome1 = Client->SetBucketPolicy(request);\n        EXPECT_EQ(policyOutcome1.isSuccess(), true);\n\n        SetBucketRequestPaymentRequest setRequest(BucketName);\n        setRequest.setRequestPayer(RequestPayer::Requester);\n        VoidOutcome setOutcome = Client->SetBucketRequestPayment(setRequest);\n        EXPECT_EQ(setOutcome.isSuccess(), true);\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n        TestUtils::CleanBucket(*Client, BucketName);\n        Client = nullptr;\n        PayerClient = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\n    static int CalculatePartCount(int64_t totalSize, int singleSize)\n    {\n        // Calculate the part count\n        auto partCount = (int)(totalSize / singleSize);\n        if (totalSize % singleSize != 0)\n        {\n            partCount++;\n        }\n        return partCount;\n    }\n    \n    static int64_t GetFileLength(const std::string file)\n    {\n        std::fstream f(file, std::ios::in | std::ios::binary);\n        f.seekg(0, f.end);\n        int64_t size = f.tellg();\n        f.close();\n        return size;\n    }\n    \n    static std::string GetOssImageObjectInfo(const std::string &bucket, const std::string &key)\n    {\n        auto outcome = Client->GetObject(GetObjectRequest(bucket, key, \"image/info\"));\n\n        if (outcome.isSuccess()) {\n            std::istreambuf_iterator<char> isb(*outcome.result().Content().get()), end;\n            return std::string(isb, end);\n        }\n        return \"\";\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::shared_ptr<OssClient> PayerClient;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> ObjectRequestPaymentTest::Client = nullptr;\nstd::shared_ptr<OssClient> ObjectRequestPaymentTest::PayerClient = nullptr;\nstd::string ObjectRequestPaymentTest::BucketName = \"\";\n\nTEST_F(ObjectRequestPaymentTest, PutObjectTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"put-object\");\n    \n    PutObjectRequest putRequest(BucketName, key, std::make_shared<std::stringstream>(\"hello world\"));\n    auto putOutcome = PayerClient->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n    EXPECT_EQ(putOutcome.error().Code(), \"AccessDenied\");\n\n    putRequest.setRequestPayer(RequestPayer::BucketOwner);\n    putOutcome = PayerClient->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), false);\n    EXPECT_EQ(putOutcome.error().Code(), \"AccessDenied\");\n\n    putRequest.setRequestPayer(RequestPayer::Requester);\n    putOutcome = PayerClient->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, GetObjectTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"put-object\");\n\n    PutObjectRequest putRequest(BucketName, key, std::make_shared<std::stringstream>(\"hello world\"));\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    GetObjectRequest getRequest(BucketName, key);\n    auto getOutcome = PayerClient->GetObject(getRequest);\n    EXPECT_EQ(getOutcome.isSuccess(), false);\n    EXPECT_EQ(getOutcome.error().Code(), \"AccessDenied\");\n\n    getRequest.setRequestPayer(RequestPayer::BucketOwner);\n    getOutcome = PayerClient->GetObject(getRequest);\n    EXPECT_EQ(getOutcome.isSuccess(), false);\n    EXPECT_EQ(getOutcome.error().Code(), \"AccessDenied\");\n\n    getRequest.setRequestPayer(RequestPayer::Requester);\n    getOutcome = PayerClient->GetObject(getRequest);\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, DeleteObjectTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"delete-object\");\n\n    PutObjectRequest putRequest(BucketName, key, std::make_shared<std::stringstream>(\"hello world\"));\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    DeleteObjectRequest delRequest(BucketName, key);\n    auto delOutcome = PayerClient->DeleteObject(delRequest);\n    EXPECT_EQ(delOutcome.isSuccess(), false);\n    EXPECT_EQ(delOutcome.error().Code(), \"AccessDenied\");\n\n    delRequest.setRequestPayer(RequestPayer::Requester);\n    delOutcome = PayerClient->DeleteObject(delRequest);\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, GetObjectMetaTest)\n{\n    auto meta = ObjectMetaData();\n    // sets the content type.\n    meta.setContentType(\"text/plain\");\n    // sets the cache control\n    meta.setCacheControl(\"max-age=3\");\n    // sets the custom metadata.\n    meta.UserMetaData()[\"meta\"] = \"meta-value\";\n\n    // uploads the file\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << \"Thank you for using Aliyun Object Storage Service!\";\n    PutObjectRequest putrequest(BucketName, \"GetObjectMeta\", content);\n    auto putOutcome = Client->PutObject(putrequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    GetObjectMetaRequest request(BucketName, \"GetObjectMeta\");\n    auto outcome = PayerClient->GetObjectMeta(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"AccessDenied\");\n\n    request.setRequestPayer(RequestPayer::Requester);\n    outcome = PayerClient->GetObjectMeta(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, HeadObjectTest)\n{\n    auto meta = ObjectMetaData();\n    // sets the content type.\n    meta.setContentType(\"text/plain\");\n    // sets the cache control\n    meta.setCacheControl(\"max-age=3\");\n    // sets the custom metadata.\n    meta.UserMetaData()[\"meta\"] = \"meta-value\";\n\n    // uploads the file\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << \"Thank you for using Aliyun Object Storage Service!\";\n    PutObjectRequest putrequest(BucketName, \"HeadObject\", content);\n    auto putOutcome = Client->PutObject(putrequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    HeadObjectRequest request(BucketName, \"HeadObject\");\n    auto outcome = PayerClient->HeadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"AccessDenied\");\n\n    request.setRequestPayer(RequestPayer::Requester);\n    outcome = PayerClient->HeadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, SetAndGetObjectAclTest)\n{\n    std::string objName = TestUtils::GetObjectKey(\"test-cpp-sdk-objectacl\");\n\n    PutObjectRequest putRequest(BucketName, objName, std::make_shared<std::stringstream>(\"hello world\"));\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    GetObjectAclRequest getAclrequest(BucketName, objName);\n    auto aclOutcome = PayerClient->GetObjectAcl(getAclrequest);\n    EXPECT_EQ(aclOutcome.isSuccess(), false);\n    EXPECT_EQ(aclOutcome.error().Code(), \"AccessDenied\");\n\n    getAclrequest.setRequestPayer(RequestPayer::Requester);\n    aclOutcome = PayerClient->GetObjectAcl(getAclrequest);\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\n    EXPECT_EQ(aclOutcome.result().Acl(), CannedAccessControlList::Default);\n\n    SetObjectAclRequest setAclRequest(BucketName, objName, CannedAccessControlList::PublicRead);\n    auto setOutCome = PayerClient->SetObjectAcl(setAclRequest);\n    EXPECT_EQ(setOutCome.isSuccess(), false);\n    EXPECT_EQ(setOutCome.error().Code(), \"AccessDenied\");\n\n    setAclRequest.setRequestPayer(RequestPayer::Requester);\n    setOutCome = PayerClient->SetObjectAcl(setAclRequest);\n    EXPECT_EQ(setOutCome.isSuccess(), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, CopyObjectTest)\n{\n    std::string objName1 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy1\");\n    PutObjectRequest putRequest(BucketName, objName1, std::make_shared<std::stringstream>(\"hello world\"));\n    PutObjectOutcome putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    std::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy2\");\n    CopyObjectRequest copyRequest(BucketName, objName2);\n    copyRequest.setCopySource(BucketName, objName1);\n    CopyObjectOutcome copyOutCome = PayerClient->CopyObject(copyRequest);\n    EXPECT_EQ(copyOutCome.isSuccess(), false);\n    EXPECT_EQ(copyOutCome.error().Code(), \"AccessDenied\");\n\n    copyRequest.setRequestPayer(RequestPayer::Requester);\n    copyOutCome = PayerClient->CopyObject(copyRequest);\n    EXPECT_EQ(copyOutCome.isSuccess(), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, AppendObjectTest)\n{\n    std::string objName = TestUtils::GetObjectKey(\"test-cpp-sdk-objectappend\");\n\n    // append object\n    std::string text = \"helloworld\";\n    AppendObjectRequest appendRequest(BucketName, objName, std::make_shared<std::stringstream>(text));\n    auto appendOutcome = PayerClient->AppendObject(appendRequest);\n    EXPECT_EQ(appendOutcome.isSuccess(), false);\n    EXPECT_EQ(appendOutcome.error().Code(), \"AccessDenied\");\n\n    appendRequest.setRequestPayer(RequestPayer::Requester);\n    appendOutcome = PayerClient->AppendObject(appendRequest);\n    EXPECT_EQ(appendOutcome.isSuccess(), true);\n    EXPECT_EQ(appendOutcome.result().Length(), text.size());\n\n    // append object again\n    AppendObjectRequest  requestOther(BucketName, objName, std::make_shared<std::stringstream>(text));\n    requestOther.setPosition(text.size());\n    appendOutcome = PayerClient->AppendObject(requestOther);\n    EXPECT_EQ(appendOutcome.isSuccess(), false);\n    EXPECT_EQ(appendOutcome.error().Code(), \"AccessDenied\");\n\n    requestOther.setRequestPayer(RequestPayer::Requester);\n    appendOutcome = PayerClient->AppendObject(requestOther);\n    EXPECT_EQ(appendOutcome.isSuccess(), true);\n    EXPECT_EQ(appendOutcome.result().Length(), text.size()*2);\n\n    // read object\n    GetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName, objName));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    std::string strData;\n    (*getOutcome.result().Content().get()) >> strData;\n    EXPECT_EQ(strData, text + text);\n}\n\nTEST_F(ObjectRequestPaymentTest, DeleteObjectsTest)\n{\n    const size_t TestKeysCnt = 10;\n    auto keyPrefix = TestUtils::GetObjectKey(\"DeleteObjectsBasicTest\");\n\n    for (size_t i = 0; i < TestKeysCnt; i++) {\n        auto key = keyPrefix;\n        auto content = TestUtils::GetRandomStream(100);\n        key.append(std::to_string(i)).append(\".txt\");\n        PutObjectRequest putrequest(BucketName, key, content);\n        auto outcome = Client->PutObject(putrequest);\n        EXPECT_EQ(outcome.isSuccess(), true);\n    }\n\n    DeleteObjectsRequest delRequest(BucketName);\n    for (size_t i = 0; i < TestKeysCnt; i++) {\n        auto key = keyPrefix;\n        key.append(std::to_string(i)).append(\".txt\");\n        delRequest.addKey(key);\n    }\n    auto delOutcome = PayerClient->DeleteObjects(delRequest);\n    EXPECT_EQ(delOutcome.isSuccess(), false);\n    EXPECT_EQ(delOutcome.error().Code(), \"AccessDenied\");\n\n    delRequest.setRequestPayer(RequestPayer::Requester);\n    delOutcome = PayerClient->DeleteObjects(delRequest);\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n    EXPECT_EQ(delOutcome.result().keyList().size(), TestKeysCnt);\n    EXPECT_EQ(delOutcome.result().Quiet(), false);\n}\n\nTEST_F(ObjectRequestPaymentTest, ListObjectsTest)\n{\n    ListObjectsRequest request(BucketName);\n    ListObjectOutcome outCome = PayerClient->ListObjects(request);\n    EXPECT_EQ(outCome.isSuccess(), false);\n    EXPECT_EQ(outCome.error().Code(), \"AccessDenied\");\n\n    request.setRequestPayer(RequestPayer::Requester);\n    outCome = PayerClient->ListObjects(request);\n    EXPECT_EQ(outCome.isSuccess(), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, SetAndGetObjectSymlinkTest)\n{\n\n    std::string objName = TestUtils::GetObjectKey(\"test-cpp-sdk-objectsymlink\");\n    // put object\n    PutObjectRequest putrequest(BucketName, objName, std::make_shared<std::stringstream>(\"hello world\"));\n    putrequest.setRequestPayer(RequestPayer::Requester);\n    auto putOutcome = Client->PutObject(putrequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // create symlink success\n    std::string linkName = objName + \"-link\";\n    CreateSymlinkRequest setRequest(BucketName, linkName);\n    setRequest.SetSymlinkTarget(objName);\n    auto  linkOutcom = PayerClient->CreateSymlink(setRequest);\n    EXPECT_EQ(linkOutcom.isSuccess(), false);\n    EXPECT_EQ(linkOutcom.error().Code(), \"AccessDenied\");\n\n    setRequest.setRequestPayer(RequestPayer::Requester);\n    linkOutcom = PayerClient->CreateSymlink(setRequest);\n    EXPECT_EQ(linkOutcom.isSuccess(), true);\n\n    GetSymlinkRequest getRequest(BucketName, linkName);\n    auto getLinkOutcome = PayerClient->GetSymlink(getRequest);\n    EXPECT_EQ(getLinkOutcome.isSuccess(), false);\n    EXPECT_EQ(getLinkOutcome.error().Code(), \"AccessDenied\");\n\n    getRequest.setRequestPayer(RequestPayer::Requester);\n    getLinkOutcome = PayerClient->GetSymlink(getRequest);\n    EXPECT_EQ(getLinkOutcome.isSuccess(), true);\n    EXPECT_EQ(getLinkOutcome.result().SymlinkTarget(), objName);\n}\n\nTEST_F(ObjectRequestPaymentTest, RestoreObjectTest)\n{\n    std::string objName = TestUtils::GetObjectKey(\"test-cpp-sdk-objectrestore\");\n\n    // first: put object\n    ObjectMetaData meta;\n    meta.addHeader(\"x-oss-storage-class\", \"Archive\");\n    PutObjectRequest putrequest(BucketName, objName, std::make_shared<std::stringstream>(\"hello world\"), meta);\n    auto putOutcome = Client->PutObject(putrequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    TestUtils::WaitForCacheExpire(2);\n\n    //second:restore object\n    RestoreObjectRequest request(BucketName, objName);\n    auto restoreOutCome = PayerClient->RestoreObject(request);\n    EXPECT_EQ(restoreOutCome.isSuccess(), false);\n    EXPECT_EQ(restoreOutCome.error().Code(), \"AccessDenied\");\n\n    request.setRequestPayer(RequestPayer::Requester);\n    restoreOutCome = PayerClient->RestoreObject(request);\n    EXPECT_EQ(restoreOutCome.isSuccess(), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, MultipartUploadTest)\n{\n    auto key = TestUtils::GetObjectKey(\"InitiateMultipartUploadWithFullSettingTest\");\n    ObjectMetaData metaData;\n    metaData.setCacheControl(\"No-Cache\");\n    metaData.setContentType(\"user/test\");\n    metaData.setContentEncoding(\"myzip\");\n    metaData.setContentDisposition(\"test.zip\");\n    metaData.UserMetaData()[\"test\"] = \"test\";\n    metaData.UserMetaData()[\"data\"] = \"data\";\n    InitiateMultipartUploadRequest request(BucketName, key, metaData);\n    auto initOutcome = PayerClient->InitiateMultipartUpload(request);\n    EXPECT_EQ(initOutcome.isSuccess(), false);\n    EXPECT_EQ(initOutcome.error().Code(), \"AccessDenied\");\n    request.setRequestPayer(RequestPayer::Requester);\n    initOutcome = PayerClient->InitiateMultipartUpload(request);\n    EXPECT_EQ(initOutcome.isSuccess(), true);\n    EXPECT_EQ(initOutcome.result().Key(), key);\n\n    auto content = TestUtils::GetRandomStream(100);\n    UploadPartRequest upRequest(BucketName, key, 1, initOutcome.result().UploadId(), content);\n    auto uploadPartOutcome = PayerClient->UploadPart(upRequest);\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), false);\n    EXPECT_EQ(uploadPartOutcome.error().Code(), \"AccessDenied\");\n    upRequest.setRequestPayer(RequestPayer::Requester);\n    uploadPartOutcome = PayerClient->UploadPart(upRequest);\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\n\n    ListPartsRequest listRequest(BucketName, key, initOutcome.result().UploadId());\n    auto lOutcome = PayerClient->ListParts(listRequest);\n    EXPECT_EQ(lOutcome.isSuccess(), false);\n    EXPECT_EQ(lOutcome.error().Code(), \"AccessDenied\");\n    listRequest.setRequestPayer(RequestPayer::Requester);\n    lOutcome = PayerClient->ListParts(listRequest);\n    EXPECT_EQ(lOutcome.isSuccess(), true);\n\n    CompleteMultipartUploadRequest cRequest(BucketName, key,\n        lOutcome.result().PartList(), initOutcome.result().UploadId());\n    auto outcome = PayerClient->CompleteMultipartUpload(cRequest);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"AccessDenied\");\n    cRequest.setRequestPayer(RequestPayer::Requester);\n    outcome = PayerClient->CompleteMultipartUpload(cRequest);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    HeadObjectRequest headRequest(BucketName, key);\n    auto hOutcome = Client->HeadObject(headRequest);\n    EXPECT_EQ(hOutcome.isSuccess(), true);\n    EXPECT_EQ(hOutcome.result().ContentLength(), 100);\n    EXPECT_EQ(hOutcome.result().CacheControl(), \"No-Cache\");\n    EXPECT_EQ(hOutcome.result().ContentType(), \"user/test\");\n    EXPECT_EQ(hOutcome.result().ContentDisposition(), \"test.zip\");\n    EXPECT_EQ(hOutcome.result().ContentEncoding(), \"myzip\");\n    EXPECT_EQ(hOutcome.result().UserMetaData().at(\"test\"), \"test\");\n    EXPECT_EQ(hOutcome.result().UserMetaData().at(\"data\"), \"data\");\n}\n\nTEST_F(ObjectRequestPaymentTest, MultipartUploadPartCopyTest)\n{\n    auto sourceFile = TestUtils::GetTargetFileName(\"cpp-sdk-multipartupload\");\n    TestUtils::WriteRandomDatatoFile(sourceFile, 500 * 1024);\n\n    auto testKey = TestUtils::GetObjectKey(\"MultipartUploadPartCopyComplexStepTest-TestKey\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(sourceFile, std::ios::in | std::ios::binary);\n    PutObjectRequest putrequest(BucketName, testKey, content);\n    auto putoutcome = Client->PutObject(putrequest);\n\n    //get target object name\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadPartCopyComplexStepTest\");\n\n    InitiateMultipartUploadRequest request(BucketName, targetObjectKey);\n    request.setRequestPayer(RequestPayer::Requester);\n    auto initOutcome = PayerClient->InitiateMultipartUpload(request);\n    EXPECT_EQ(initOutcome.isSuccess(), true);\n\n    // Set the part size \n    const int partSize = 200*1024;\n    const int64_t fileLength = GetFileLength(sourceFile);\n\n    auto partCount = CalculatePartCount(fileLength, partSize);\n    for (auto i = 0; i < partCount; i++)\n    {\n        // Skip to the start position\n        int64_t skipBytes = partSize * i;\n        int64_t position = skipBytes;\n\n        // calculate the part size\n        auto size = partSize < (fileLength - skipBytes) ? partSize : fileLength - skipBytes;\n\n        UploadPartCopyRequest copyRequest(BucketName, targetObjectKey, BucketName, testKey);\n        copyRequest.setPartNumber(i + 1);\n        copyRequest.setUploadId(initOutcome.result().UploadId());\n        copyRequest.setCopySourceRange(position, position + size - 1);\n        auto uploadPartOutcome = PayerClient->UploadPartCopy(copyRequest);\n        EXPECT_EQ(uploadPartOutcome.isSuccess(), false);\n        EXPECT_EQ(uploadPartOutcome.error().Code(), \"AccessDenied\");\n\n        copyRequest.setRequestPayer(RequestPayer::Requester);\n        uploadPartOutcome = PayerClient->UploadPartCopy(copyRequest);\n        EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\n        EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\n    }\n\n    ListMultipartUploadsRequest listRequest1(BucketName);\n    auto lmuOutcome = PayerClient->ListMultipartUploads(ListMultipartUploadsRequest(listRequest1));\n    EXPECT_EQ(lmuOutcome.isSuccess(), false);\n    EXPECT_EQ(lmuOutcome.error().Code(), \"AccessDenied\");\n    listRequest1.setRequestPayer(RequestPayer::Requester);\n    lmuOutcome = PayerClient->ListMultipartUploads(ListMultipartUploadsRequest(listRequest1));\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\n\n    std::string uploadId;\n\n    for (auto const& upload : lmuOutcome.result().MultipartUploadList())\n    {\n        if (upload.UploadId == initOutcome.result().UploadId())\n        {\n            uploadId = upload.UploadId;\n        }\n    }\n    EXPECT_EQ(uploadId.empty(), false);\n\n    ListPartsRequest listRequest(BucketName, targetObjectKey);\n    listRequest.setUploadId(uploadId);\n    auto listOutcome = PayerClient->ListParts(listRequest);\n    EXPECT_EQ(listOutcome.isSuccess(), false);\n    EXPECT_EQ(listOutcome.error().Code(), \"AccessDenied\");\n    listRequest.setRequestPayer(RequestPayer::Requester);\n    listOutcome = PayerClient->ListParts(listRequest);\n    EXPECT_EQ(listOutcome.isSuccess(), true);\n\n    CompleteMultipartUploadRequest completeRequest(BucketName, targetObjectKey, listOutcome.result().PartList());\n    completeRequest.setUploadId(uploadId);\n    completeRequest.setUploadId(uploadId);\n    completeRequest.setRequestPayer(RequestPayer::Requester);\n    auto cOutcome = PayerClient->CompleteMultipartUpload(completeRequest);\n    EXPECT_EQ(cOutcome.isSuccess(), true);\n\n    GetObjectRequest getRequest(BucketName, targetObjectKey);\n    auto gOutcome = Client->GetObject(getRequest);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(gOutcome.result().Metadata().ContentLength(), fileLength);\n\n    RemoveFile(sourceFile);\n}\n\nTEST_F(ObjectRequestPaymentTest, MultipartUploadAbortTest)\n{\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadAbortInMiddleTest\");\n\n    InitiateMultipartUploadRequest request(BucketName, targetObjectKey);\n    auto initOutcome = Client->InitiateMultipartUpload(request);\n    EXPECT_EQ(initOutcome.isSuccess(), true);\n\n    AbortMultipartUploadRequest abortRequest(BucketName, targetObjectKey, initOutcome.result().UploadId());\n    auto abortOutcome = PayerClient->AbortMultipartUpload(abortRequest);\n    EXPECT_EQ(abortOutcome.isSuccess(), false);\n    EXPECT_EQ(abortOutcome.error().Code(), \"AccessDenied\");\n    \n    abortRequest.setRequestPayer(RequestPayer::Requester);\n    abortOutcome = PayerClient->AbortMultipartUpload(abortRequest);\n    EXPECT_EQ(abortOutcome.isSuccess(), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, SelectObjectTest)\n{\n    std::string sqlMessage = std::string(\"name,school,company,age\\r\\n\")\n        .append(\"Lora Francis,School A,Staples Inc,27\\r\\n\")\n        .append(\"Eleanor Little,School B,\\\"Conectiv, Inc\\\",43\\r\\n\")\n        .append(\"Rosie Hughes,School C,Western Gas Resources Inc,44\\r\\n\")\n        .append(\"Lawrence Ross,School D,MetLife Inc.,24\");\n    std::string key = TestUtils::GetObjectKey(\"SqlObjectWithCsvData\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << sqlMessage;\n    // put object\n    PutObjectRequest putRequest(BucketName, key, content);\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // select object\n    SelectObjectRequest selectRequest(BucketName, key);\n    selectRequest.setExpression(\"select * from ossobject\");\n\n    CSVInputFormat csvInputFormat;\n    csvInputFormat.setHeaderInfo(CSVHeader::Use);\n    csvInputFormat.setRecordDelimiter(\"\\r\\n\");\n    csvInputFormat.setFieldDelimiter(\",\");\n    csvInputFormat.setQuoteChar(\"\\\"\");\n    csvInputFormat.setCommentChar(\"#\");\n    selectRequest.setInputFormat(csvInputFormat);\n\n    CSVOutputFormat csvOutputFormat;\n    selectRequest.setOutputFormat(csvOutputFormat);\n\n    auto outcome = PayerClient->SelectObject(selectRequest);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"AccessDenied\");\n\n    selectRequest.setRequestPayer(RequestPayer::Requester);\n    outcome = PayerClient->SelectObject(selectRequest);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"AccessDenied\");\n    EXPECT_EQ(outcome.error().Message(), \"Select API does not support requester pay now.\");\n\n    // createSelectObjectMeta\n    CreateSelectObjectMetaRequest metaRequest(BucketName, key);\n    metaRequest.setInputFormat(csvInputFormat);\n    auto metaOutcome = PayerClient->CreateSelectObjectMeta(metaRequest);\n    EXPECT_EQ(metaOutcome.isSuccess(), false);\n    EXPECT_EQ(metaOutcome.error().Code(), \"AccessDenied\");\n\n    metaRequest.setRequestPayer(RequestPayer::Requester);\n    metaOutcome = PayerClient->CreateSelectObjectMeta(metaRequest);\n    EXPECT_EQ(metaOutcome.isSuccess(), false);\n    EXPECT_EQ(metaOutcome.error().Code(), \"AccessDenied\");\n    EXPECT_EQ(metaOutcome.error().Message(), \"Select API does not support requester pay now.\");\n}\n\nclass ListObjectsAsyncContext : public AsyncCallerContext\n{\npublic:\n    ListObjectsAsyncContext() :ready(false) {}\n    virtual ~ListObjectsAsyncContext()\n    {\n    }\n\n    const ObjectSummaryList& ObjectSummarys() const { return objectSummarys_; }\n    void setObjectSummaryList(const AlibabaCloud::OSS::ObjectSummaryList& objectSummarys) const\n    {\n        objectSummarys_ = objectSummarys;\n    }\n\n    mutable std::mutex mtx;\n    mutable std::condition_variable cv;\n    mutable bool ready;\n    mutable AlibabaCloud::OSS::ObjectSummaryList objectSummarys_;\n};\n\nstatic void ListObjectsHandler(const AlibabaCloud::OSS::OssClient* client,\n    const ListObjectsRequest& request,\n    const ListObjectOutcome& outcome,\n    const std::shared_ptr<const AsyncCallerContext>& context)\n{\n    UNUSED_PARAM(request);\n    std::cout << \"PayerClient[\" << client << \"]\" << \"ListObjectsHandler\" << std::endl;\n    if (context != nullptr) {\n        auto ctx = static_cast<const ListObjectsAsyncContext*>(context.get());\n        if (!outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \" failed, Code:\" << outcome.error().Code()\n                << \", message:\" << outcome.error().Message() << std::endl;\n        }\n        EXPECT_EQ(outcome.isSuccess(), true);\n        EXPECT_EQ(outcome.result().ObjectSummarys().size(), 20U);\n        EXPECT_EQ(outcome.result().IsTruncated(), false);\n\n        ctx->setObjectSummaryList(outcome.result().ObjectSummarys());\n        std::unique_lock<std::mutex> lck(ctx->mtx);\n        ctx->ready = true;\n        ctx->cv.notify_all();\n    }\n}\n\nTEST_F(ObjectRequestPaymentTest, ListObjectsAsyncTest)\n{\n    // create test file\n    for (int i = 0; i < 20; i++) {\n        std::string key = TestUtils::GetObjectKey(\"ListAllObjectsAsync\");\n        auto content = TestUtils::GetRandomStream(100);\n        auto outcome = Client->PutObject(BucketName, key, content);\n        EXPECT_EQ(outcome.isSuccess(), true);\n    }\n\n    // list objects async\n    ListObjectsRequest request(BucketName);\n    request.setPrefix(\"ListAllObjectsAsync\");\n    request.setRequestPayer(RequestPayer::Requester);\n    ListObjectAsyncHandler handler = ListObjectsHandler;\n    std::shared_ptr<ListObjectsAsyncContext> content = std::make_shared<ListObjectsAsyncContext>();\n    PayerClient->ListObjectsAsync(request, handler, content);\n    std::cout << \"PayerClient[\" << PayerClient << \"]\" << \"Issue ListObjectsAsync done.\" << std::endl;\n\n    {\n        std::unique_lock<std::mutex> lck(content->mtx);\n        if (!content->ready) content->cv.wait(lck);\n    }\n    int i = 0;\n    for (auto const& obj : content->ObjectSummarys()) {\n        EXPECT_EQ(obj.Size(), 100LL);\n        i++;\n    }\n    EXPECT_EQ(i, 20);\n}\n\nclass GetObjectAsyncContex : public AsyncCallerContext\n{\npublic:\n    GetObjectAsyncContex() :ready(false) {}\n    ~GetObjectAsyncContex() {}\n    mutable std::mutex mtx;\n    mutable std::condition_variable cv;\n    mutable std::string md5;\n    mutable bool ready;\n};\n\nstatic void GetObjectHandler(const AlibabaCloud::OSS::OssClient* client,\n    const GetObjectRequest& request,\n    const GetObjectOutcome& outcome,\n    const std::shared_ptr<const AsyncCallerContext>& context)\n{\n    std::cout << \"PayerClient[\" << client << \"]\" << \"GetObjectHandler\" << \", key:\" << request.Key() << std::endl;\n    if (context != nullptr) {\n        auto ctx = static_cast<const GetObjectAsyncContex*>(context.get());\n        EXPECT_EQ(outcome.isSuccess(), true);\n        std::string memMd5 = ComputeContentMD5(*outcome.result().Content().get());\n        ctx->md5 = memMd5;\n        std::unique_lock<std::mutex> lck(ctx->mtx);\n        ctx->ready = true;\n        ctx->cv.notify_all();\n    }\n}\nTEST_F(ObjectRequestPaymentTest, GetObjectAsyncTest)\n{\n\n    GetObjectOutcome dummy;\n    std::string key = TestUtils::GetObjectKey(\"GetObjectAsyncBasicTest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectAsyncBasicTest\").append(\".tmp\");\n    auto content = TestUtils::GetRandomStream(102400);\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    GetObjectAsyncHandler handler = GetObjectHandler;\n    GetObjectRequest request(BucketName, key);\n    request.setRequestPayer(RequestPayer::Requester);\n    std::shared_ptr<GetObjectAsyncContex> memContext = std::make_shared<GetObjectAsyncContex>();\n\n    GetObjectRequest fileRequest(BucketName, key);\n    fileRequest.setRequestPayer(RequestPayer::Requester);\n    fileRequest.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios_base::out | std::ios_base::trunc | std::ios::binary); });\n    std::shared_ptr<GetObjectAsyncContex> fileContext = std::make_shared<GetObjectAsyncContex>();\n\n    PayerClient->GetObjectAsync(request, handler, memContext);\n    PayerClient->GetObjectAsync(fileRequest, handler, fileContext);\n    std::cout << \"PayerClient[\" << PayerClient << \"]\" << \"Issue GetObjectAsync done.\" << std::endl;\n\n    {\n        std::unique_lock<std::mutex> lck(fileContext->mtx);\n        if (!fileContext->ready) fileContext->cv.wait(lck);\n    }\n\n    {\n        std::unique_lock<std::mutex> lck(memContext->mtx);\n        if (!memContext->ready) memContext->cv.wait(lck);\n    }\n\n    std::string oriMd5 = ComputeContentMD5(*content.get());\n\n    EXPECT_EQ(oriMd5, memContext->md5);\n    EXPECT_EQ(oriMd5, fileContext->md5);\n    memContext = nullptr;\n    fileContext = nullptr;\n    TestUtils::WaitForCacheExpire(1);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nclass PutObjectAsyncContex : public AsyncCallerContext\n{\npublic:\n    PutObjectAsyncContex() :ready(false) {}\n    virtual ~PutObjectAsyncContex()\n    {\n    }\n\n    mutable std::mutex mtx;\n    mutable std::condition_variable cv;\n    mutable bool ready;\n};\n\nstatic void PutObjectHandler(const AlibabaCloud::OSS::OssClient* client,\n    const PutObjectRequest& request,\n    const PutObjectOutcome& outcome,\n    const std::shared_ptr<const AsyncCallerContext>& context)\n{\n    std::cout << \"PayerClient[\" << client << \"]\" << \"PutObjectHandler, tag:\" << context->Uuid() <<\n        \", key:\" << request.Key() << std::endl;\n    if (context != nullptr) {\n        auto ctx = static_cast<const PutObjectAsyncContex*>(context.get());\n        EXPECT_EQ(outcome.isSuccess(), true);\n        std::unique_lock<std::mutex> lck(ctx->mtx);\n        ctx->ready = true;\n        ctx->cv.notify_all();\n    }\n}\n\nTEST_F(ObjectRequestPaymentTest, PutObjectAsyncTest)\n{\n\n    std::string memKey = TestUtils::GetObjectKey(\"PutObjectAsyncBasicTest\");\n    auto memContent = TestUtils::GetRandomStream(102400);\n\n    std::string fileKey = TestUtils::GetObjectKey(\"PutObjectAsyncBasicTest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectAsyncBasicTest\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\n    auto fileContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::out | std::ios::binary);\n\n    PutObjectAsyncHandler handler = PutObjectHandler;\n    PutObjectRequest memRequest(BucketName, memKey, memContent);\n    memRequest.setRequestPayer(RequestPayer::Requester);\n    std::shared_ptr<PutObjectAsyncContex> memContext = std::make_shared<PutObjectAsyncContex>();\n    memContext->setUuid(\"PutobjectasyncFromMem\");\n\n    PutObjectRequest fileRequest(BucketName, fileKey, fileContent);\n    fileRequest.setRequestPayer(RequestPayer::Requester);\n    std::shared_ptr<PutObjectAsyncContex> fileContext = std::make_shared<PutObjectAsyncContex>();\n    fileContext->setUuid(\"PutobjectasyncFromFile\");\n\n    PayerClient->PutObjectAsync(memRequest, handler, memContext);\n    PayerClient->PutObjectAsync(fileRequest, handler, fileContext);\n    std::cout << \"PayerClient[\" << PayerClient << \"]\" << \"Issue PutObjectAsync done.\" << std::endl;\n\n    {\n        std::unique_lock<std::mutex> lck(fileContext->mtx);\n        if (!fileContext->ready) fileContext->cv.wait(lck);\n    }\n\n    {\n        std::unique_lock<std::mutex> lck(memContext->mtx);\n        if (!memContext->ready) memContext->cv.wait(lck);\n    }\n\n    fileContent->close();\n\n    fileContext = nullptr;\n\n    TestUtils::WaitForCacheExpire(1);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nclass UploadPartAsyncContext : public AsyncCallerContext\n{\npublic:\n    UploadPartAsyncContext() :ready(false) {}\n    virtual ~UploadPartAsyncContext()\n    {\n    }\n\n    mutable std::mutex mtx;\n    mutable std::condition_variable cv;\n    mutable bool ready;\n};\n\nstatic void UploadPartHandler(const AlibabaCloud::OSS::OssClient* client,\n    const UploadPartRequest& request,\n    const PutObjectOutcome& outcome,\n    const std::shared_ptr<const AsyncCallerContext>& context)\n{\n    UNUSED_PARAM(request);\n    std::cout << \"PayerClient[\" << client << \"]\" << \"UploadPartHandler,tag:\" << context->Uuid() << std::endl;\n    if (context != nullptr) {\n        auto ctx = static_cast<const UploadPartAsyncContext*>(context.get());\n        if (!outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \" failed, Code:\" << outcome.error().Code()\n                << \", message:\" << outcome.error().Message() << std::endl;\n        }\n        EXPECT_EQ(outcome.isSuccess(), true);\n        std::unique_lock<std::mutex> lck(ctx->mtx);\n        ctx->ready = true;\n        ctx->cv.notify_all();\n    }\n}\n\nTEST_F(ObjectRequestPaymentTest, UploadPartAsyncTest)\n{\n\n    std::string memKey = TestUtils::GetObjectKey(\"UploadPartMemObjectAsyncBasicTest\");\n    auto memContent = TestUtils::GetRandomStream(102400);\n    InitiateMultipartUploadRequest memInitRequest(BucketName, memKey);\n    auto memInitOutcome = Client->InitiateMultipartUpload(memInitRequest);\n    EXPECT_EQ(memInitOutcome.isSuccess(), true);\n    EXPECT_EQ(memInitOutcome.result().Key(), memKey);\n\n    std::string fileKey = TestUtils::GetObjectKey(\"UploadPartFileObjectAsyncBasicTest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"UploadPartFileObjectAsyncBasicTest\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\n    auto fileContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::out | std::ios::binary);\n    InitiateMultipartUploadRequest fileInitRequest(BucketName, fileKey);\n    auto fileInitOutcome = Client->InitiateMultipartUpload(fileInitRequest);\n    EXPECT_EQ(fileInitOutcome.isSuccess(), true);\n    EXPECT_EQ(fileInitOutcome.result().Key(), fileKey);\n\n    UploadPartAsyncHandler handler = UploadPartHandler;\n\n    UploadPartRequest memRequest(BucketName, memKey, 1, memInitOutcome.result().UploadId(), memContent);\n    memRequest.setRequestPayer(RequestPayer::Requester);\n    std::shared_ptr<UploadPartAsyncContext> memContext = std::make_shared<UploadPartAsyncContext>();\n    memContext->setUuid(\"UploadPartAsyncFromMem\");\n\n    UploadPartRequest fileRequest(BucketName, fileKey, 1, fileInitOutcome.result().UploadId(), fileContent);\n    fileRequest.setRequestPayer(RequestPayer::Requester);\n    std::shared_ptr<UploadPartAsyncContext> fileContext = std::make_shared<UploadPartAsyncContext>();\n    fileContext->setUuid(\"UploadPartAsyncFromFile\");\n\n    PayerClient->UploadPartAsync(memRequest, handler, memContext);\n    PayerClient->UploadPartAsync(fileRequest, handler, fileContext);\n    std::cout << \"Client[\" << Client << \"]\" << \"Issue UploadPartAsync done.\" << std::endl;\n    {\n        std::unique_lock<std::mutex> lck(fileContext->mtx);\n        if (!fileContext->ready) fileContext->cv.wait(lck);\n    }\n\n    {\n        std::unique_lock<std::mutex> lck(memContext->mtx);\n        if (!memContext->ready) memContext->cv.wait(lck);\n    }\n\n    fileContent->close();\n\n    auto memListPartsOutcome = Client->ListParts(ListPartsRequest(BucketName, memKey, memInitOutcome.result().UploadId()));\n    EXPECT_EQ(memListPartsOutcome.isSuccess(), true);\n    auto fileListPartsOutcome = Client->ListParts(ListPartsRequest(BucketName, fileKey, fileInitOutcome.result().UploadId()));\n    EXPECT_EQ(fileListPartsOutcome.isSuccess(), true);\n\n    auto memCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, memKey,\n        memListPartsOutcome.result().PartList(), memInitOutcome.result().UploadId()));\n    EXPECT_EQ(memCompleteOutcome.isSuccess(), true);\n    auto fileCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, fileKey,\n        fileListPartsOutcome.result().PartList(), fileInitOutcome.result().UploadId()));\n    EXPECT_EQ(fileCompleteOutcome.isSuccess(), true);\n\n    fileContext = nullptr;\n    TestUtils::WaitForCacheExpire(1);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nstatic void UploadPartCopyHandler(const AlibabaCloud::OSS::OssClient* client,\n    const UploadPartCopyRequest& request,\n    const UploadPartCopyOutcome& outcome,\n    const std::shared_ptr<const AsyncCallerContext>& context)\n{\n    UNUSED_PARAM(request);\n    std::cout << \"PayerClient[\" << client << \"]\" << \"UploadPartCopyHandler, tag:\" << context->Uuid() << std::endl;\n    if (context != nullptr) {\n        auto ctx = static_cast<const UploadPartAsyncContext*>(context.get());\n        if (!outcome.isSuccess()) {\n            std::cout << __FUNCTION__ << \" failed, Code:\" << outcome.error().Code()\n                << \", message:\" << outcome.error().Message() << std::endl;\n        }\n        EXPECT_EQ(outcome.isSuccess(), true);\n        std::unique_lock<std::mutex> lck(ctx->mtx);\n        ctx->ready = true;\n        ctx->cv.notify_all();\n    }\n}\n\nTEST_F(ObjectRequestPaymentTest, UploadPartCopyAsyncTest)\n{\n    // put object from buffer\n    std::string memObjKey = TestUtils::GetObjectKey(\"PutObjectFromBuffer\");\n    auto memObjContent = TestUtils::GetRandomStream(102400);\n    auto putMemObjOutcome = Client->PutObject(PutObjectRequest(BucketName, memObjKey, memObjContent));\n    EXPECT_EQ(putMemObjOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, memObjKey), true);\n\n    // put object from local file\n    std::string fileObjKey = TestUtils::GetObjectKey(\"PutObjectFromFile\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectFromFile\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\n    auto fileObjContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::out | std::ios::binary);\n    auto putFileObjOutcome = Client->PutObject(PutObjectRequest(BucketName, fileObjKey, fileObjContent));\n    EXPECT_EQ(putFileObjOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, fileObjKey), true);\n\n    // close the file\n    fileObjContent->close();\n\n    // apply the upload id\n    std::string memKey = TestUtils::GetObjectKey(\"UploadPartCopyMemObjectAsyncBasicTest\");\n    auto memInitObjOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, memKey));\n    EXPECT_EQ(memInitObjOutcome.isSuccess(), true);\n    EXPECT_EQ(memInitObjOutcome.result().Key(), memKey);\n\n    std::string fileKey = TestUtils::GetObjectKey(\"UploadPartCopyFileObjectAsyncBasicTest\");\n    auto fileInitObjOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, fileKey));\n    EXPECT_EQ(fileInitObjOutcome.isSuccess(), true);\n    EXPECT_EQ(fileInitObjOutcome.result().Key(), fileKey);\n\n    // construct parameter\n    UploadPartCopyAsyncHandler handler = UploadPartCopyHandler;\n    UploadPartCopyRequest memRequest(BucketName, memKey, BucketName, memObjKey, memInitObjOutcome.result().UploadId(), 1);\n    memRequest.setRequestPayer(RequestPayer::Requester);\n    std::shared_ptr<UploadPartAsyncContext> memContext = std::make_shared<UploadPartAsyncContext>();\n    memContext->setUuid(\"UploadPartCopyAsyncFromMem\");\n    UploadPartCopyRequest fileRequest(BucketName, fileKey, BucketName, fileObjKey, fileInitObjOutcome.result().UploadId(), 1);\n    fileRequest.setRequestPayer(RequestPayer::Requester);\n    std::shared_ptr<UploadPartAsyncContext> fileContext = std::make_shared<UploadPartAsyncContext>();\n    fileContext->setUuid(\"UploadPartCopyAsyncFromFile\");\n\n    PayerClient->UploadPartCopyAsync(memRequest, handler, memContext);\n    PayerClient->UploadPartCopyAsync(fileRequest, handler, fileContext);\n    std::cout << \"PayerClient[\" << Client << \"]\" << \"Issue UploadPartCopyAsync done.\" << std::endl;\n    {\n        std::unique_lock<std::mutex> lck(fileContext->mtx);\n        if (!fileContext->ready) fileContext->cv.wait(lck);\n    }\n    {\n        std::unique_lock<std::mutex> lck(memContext->mtx);\n        if (!memContext->ready) memContext->cv.wait(lck);\n    }\n\n    // list parts\n    auto memListPartsOutcome = Client->ListParts(ListPartsRequest(BucketName, memKey, memInitObjOutcome.result().UploadId()));\n    EXPECT_EQ(memListPartsOutcome.isSuccess(), true);\n    auto fileListPartsOutcome = Client->ListParts(ListPartsRequest(BucketName, fileKey, fileInitObjOutcome.result().UploadId()));\n    EXPECT_EQ(fileListPartsOutcome.isSuccess(), true);\n\n    // complete\n    CompleteMultipartUploadRequest memCompleteRequest(BucketName, memKey, memListPartsOutcome.result().PartList());\n    memCompleteRequest.setUploadId(memInitObjOutcome.result().UploadId());\n    auto memCompleteOutcome = Client->CompleteMultipartUpload(memCompleteRequest);\n    EXPECT_EQ(memCompleteOutcome.isSuccess(), true);\n    CompleteMultipartUploadRequest fileCompleteRequest(BucketName, fileKey, fileListPartsOutcome.result().PartList());\n    fileCompleteRequest.setUploadId(fileInitObjOutcome.result().UploadId());\n    auto fileCompleteOutcome = Client->CompleteMultipartUpload(fileCompleteRequest);\n    EXPECT_EQ(fileCompleteOutcome.isSuccess(), true);\n\n    fileObjContent = nullptr;\n    TestUtils::WaitForCacheExpire(1);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, ListObjectsCallableTest)\n{\n    for (int i = 0; i < 20; i++) {\n        std::string key = TestUtils::GetObjectKey(\"ListAllObjectsCallableTest\");\n        auto content = TestUtils::GetRandomStream(100);\n        auto outcome = Client->PutObject(BucketName, key, content);\n        EXPECT_EQ(outcome.isSuccess(), true);\n    }\n\n    //list object use default\n    ListObjectsRequest request(BucketName);\n    request.setPrefix(\"ListAllObjectsCallableTest\");\n    request.setRequestPayer(RequestPayer::Requester);\n    auto listOutcomeCallable = PayerClient->ListObjectsCallable(request);\n    auto listOutcome = listOutcomeCallable.get();\n    EXPECT_EQ(listOutcome.isSuccess(), true);\n    EXPECT_EQ(listOutcome.result().ObjectSummarys().size(), 20UL);\n    EXPECT_EQ(listOutcome.result().IsTruncated(), false);\n\n    int i = 0;\n    for (auto const& obj : listOutcome.result().ObjectSummarys()) {\n        EXPECT_EQ(obj.Size(), 100LL);\n        i++;\n    }\n    EXPECT_EQ(i, 20);\n}\n\nTEST_F(ObjectRequestPaymentTest, GetObjectCallableTest)\n{\n    GetObjectOutcome dummy;\n    std::string key = TestUtils::GetObjectKey(\"GetObjectCallableBasicTest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectCallableBasicTest\").append(\".tmp\");\n    auto content = TestUtils::GetRandomStream(102400);\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    GetObjectRequest request(BucketName, key);\n    request.setRequestPayer(RequestPayer::Requester);\n    std::shared_ptr<GetObjectAsyncContex> memContext = std::make_shared<GetObjectAsyncContex>();\n\n    GetObjectRequest fileRequest(BucketName, key);\n    fileRequest.setRequestPayer(RequestPayer::Requester);\n    fileRequest.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios_base::out | std::ios_base::trunc | std::ios::binary); });\n\n    auto memOutcomeCallable = PayerClient->GetObjectCallable(request);\n    auto fileOutcomeCallable = PayerClient->GetObjectCallable(fileRequest);\n\n\n    std::cout << \"PayerClient[\" << PayerClient << \"]\" << \"Issue GetObjectCallable done.\" << std::endl;\n\n    auto fileOutcome = fileOutcomeCallable.get();\n    auto memOutcome = memOutcomeCallable.get();\n    EXPECT_EQ(fileOutcome.isSuccess(), true);\n    EXPECT_EQ(memOutcome.isSuccess(), true);\n\n    std::string oriMd5 = ComputeContentMD5(*content.get());\n    std::string memMd5 = ComputeContentMD5(*memOutcome.result().Content());\n    std::string fileMd5 = ComputeContentMD5(*fileOutcome.result().Content());\n\n    EXPECT_EQ(oriMd5, fileMd5);\n    EXPECT_EQ(oriMd5, fileMd5);\n    memOutcome = dummy;\n    fileOutcome = dummy;\n    //EXPECT_EQ(RemoveFile(tmpFile), true);\n    RemoveFile(tmpFile);\n}\n\nTEST_F(ObjectRequestPaymentTest, PutObjectCallableTest)\n{\n    std::string memKey = TestUtils::GetObjectKey(\"PutObjectCallableBasicTest\");\n    auto memContent = TestUtils::GetRandomStream(102400);\n\n    std::string fileKey = TestUtils::GetObjectKey(\"PutObjectCallableBasicTest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectCallableBasicTest\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\n    auto fileContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios::binary);\n\n    PutObjectRequest putrequest1(BucketName, memKey, memContent);\n    putrequest1.setRequestPayer(RequestPayer::Requester);\n    PutObjectRequest putrequest2(BucketName, fileKey, fileContent);\n    putrequest2.setRequestPayer(RequestPayer::Requester);\n    auto memOutcomeCallable = PayerClient->PutObjectCallable(putrequest1);\n    auto fileOutcomeCallable = PayerClient->PutObjectCallable(putrequest2);\n\n    std::cout << \"PayerClient[\" << PayerClient << \"]\" << \"Issue PutObjectCallable done.\" << std::endl;\n\n    auto fileOutcome = fileOutcomeCallable.get();\n    auto memOutcome = memOutcomeCallable.get();\n    EXPECT_EQ(fileOutcome.isSuccess(), true);\n    EXPECT_EQ(memOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, memKey), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, fileKey), true);\n\n    memContent = nullptr;\n    fileContent = nullptr;\n    //EXPECT_EQ(RemoveFile(tmpFile), true);\n    RemoveFile(tmpFile);\n}\n\nTEST_F(ObjectRequestPaymentTest, UploadPartCallableTest)\n{\n    auto memKey = TestUtils::GetObjectKey(\"MultipartUploadCallable-MemObject\");\n    auto memContent = TestUtils::GetRandomStream(102400);\n    auto memInitOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, memKey));\n    EXPECT_EQ(memInitOutcome.isSuccess(), true);\n\n    auto fileKey = TestUtils::GetObjectKey(\"MultipartUploadCallable-FileObject\");\n    auto tmpFile = TestUtils::GetObjectKey(\"MultipartUploadCallable-FileObject\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\n    {\n        auto fileContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios::binary);\n        auto fileInitOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, fileKey));\n        EXPECT_EQ(fileInitOutcome.isSuccess(), true);\n\n        UploadPartRequest uprequest1(BucketName, memKey, 1, memInitOutcome.result().UploadId(), memContent);\n        UploadPartRequest uprequest2(BucketName, fileKey, 1, fileInitOutcome.result().UploadId(), fileContent);\n        uprequest1.setRequestPayer(RequestPayer::Requester);\n        uprequest2.setRequestPayer(RequestPayer::Requester);\n\n        auto memOutcomeCallable = PayerClient->UploadPartCallable(uprequest1);\n        auto fileOutcomeCallable = PayerClient->UploadPartCallable(uprequest2);\n\n        std::cout << \"PayerClient[\" << PayerClient << \"]\" << \"Issue MultipartUploadCallable done.\" << std::endl;\n\n        auto fileOutcome = fileOutcomeCallable.get();\n        auto menOutcome = memOutcomeCallable.get();\n        EXPECT_EQ(fileOutcome.isSuccess(), true);\n        EXPECT_EQ(menOutcome.isSuccess(), true);\n\n        // list part\n        auto memListPartOutcome = Client->ListParts(ListPartsRequest(BucketName, memKey, memInitOutcome.result().UploadId()));\n        auto fileListPartOutcome = Client->ListParts(ListPartsRequest(BucketName, fileKey, fileInitOutcome.result().UploadId()));\n        EXPECT_EQ(memListPartOutcome.isSuccess(), true);\n        EXPECT_EQ(fileListPartOutcome.isSuccess(), true);\n\n        auto memCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, memKey,\n            memListPartOutcome.result().PartList(), memInitOutcome.result().UploadId()));\n        auto fileCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, fileKey,\n            fileListPartOutcome.result().PartList(), fileInitOutcome.result().UploadId()));\n        EXPECT_EQ(memCompleteOutcome.isSuccess(), true);\n        EXPECT_EQ(fileCompleteOutcome.isSuccess(), true);\n\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, memKey), true);\n        EXPECT_EQ(Client->DoesObjectExist(BucketName, fileKey), true);\n\n        memContent = nullptr;\n        fileContent = nullptr;\n    }\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, UploadPartCopyCallableTest)\n{\n    // put object from buffer\n    std::string memObjKey = TestUtils::GetObjectKey(\"PutObjectFromBuffer\");\n    auto memObjContent = TestUtils::GetRandomStream(102400);\n    auto putMemObjOutcome = Client->PutObject(PutObjectRequest(BucketName, memObjKey, memObjContent));\n    EXPECT_EQ(putMemObjOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, memObjKey), true);\n\n    // put object from local file\n    std::string fileObjKey = TestUtils::GetObjectKey(\"PutObjectFromFile\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutObjectFromFile\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\n    auto fileObjContent = std::make_shared<std::fstream>(tmpFile, std::ios_base::in | std::ios::binary);\n    auto putFileObjOutcome = Client->PutObject(PutObjectRequest(BucketName, fileObjKey, fileObjContent));\n    EXPECT_EQ(putFileObjOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, fileObjKey), true);\n\n    // close file\n    fileObjContent->close();\n\n    // apply upload id\n    std::string memKey = TestUtils::GetObjectKey(\"UploadPartCopyCallableMemObjectBasicTest\");\n    auto memInitObjOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, memKey));\n    EXPECT_EQ(memInitObjOutcome.isSuccess(), true);\n    EXPECT_EQ(memInitObjOutcome.result().Key(), memKey);\n\n    std::string fileKey = TestUtils::GetObjectKey(\"UploadPartCopyCallableFileObjectBasicTest\");\n    auto fileInitObjOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, fileKey));\n    EXPECT_EQ(fileInitObjOutcome.isSuccess(), true);\n    EXPECT_EQ(fileInitObjOutcome.result().Key(), fileKey);\n\n    // upload part copy\n    UploadPartCopyRequest request1(BucketName, memKey, BucketName, memObjKey, memInitObjOutcome.result().UploadId(), 1);\n    UploadPartCopyRequest request2(BucketName, fileKey, BucketName, fileObjKey, fileInitObjOutcome.result().UploadId(), 1);\n    request1.setRequestPayer(RequestPayer::Requester);\n    request2.setRequestPayer(RequestPayer::Requester);\n    auto memOutcomeCallable = PayerClient->UploadPartCopyCallable(request1);\n    auto fileOutcomeCallable = PayerClient->UploadPartCopyCallable(request2);\n\n    std::cout << \"PayerClient[\" << PayerClient << \"]\" << \"Issue UploadPartCopyCallable done.\" << std::endl;\n\n    auto fileOutcome = fileOutcomeCallable.get();\n    auto memOutcome = memOutcomeCallable.get();\n    EXPECT_EQ(fileOutcome.isSuccess(), true);\n    EXPECT_EQ(memOutcome.isSuccess(), true);\n\n    // list part\n    auto memListPartOutcome = Client->ListParts(ListPartsRequest(BucketName, memKey, memInitObjOutcome.result().UploadId()));\n    auto fileListPartOutcome = Client->ListParts(ListPartsRequest(BucketName, fileKey, fileInitObjOutcome.result().UploadId()));\n    EXPECT_EQ(memListPartOutcome.isSuccess(), true);\n    EXPECT_EQ(fileListPartOutcome.isSuccess(), true);\n\n    // complete the part\n    auto memCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, memKey,\n        memListPartOutcome.result().PartList(), memInitObjOutcome.result().UploadId()));\n    auto fileCompleteOutcome = Client->CompleteMultipartUpload(CompleteMultipartUploadRequest(BucketName, fileKey,\n        fileListPartOutcome.result().PartList(), fileInitObjOutcome.result().UploadId()));\n    EXPECT_EQ(memCompleteOutcome.isSuccess(), true);\n    EXPECT_EQ(fileCompleteOutcome.isSuccess(), true);\n\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, memKey), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, fileKey), true);\n\n    memObjContent = nullptr;\n    fileObjContent = nullptr;\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nstatic bool CompareImageInfo(const std::string &src, const std::string &dst)\n{\n    if (src == dst) {\n        return true;\n    }\n    //the filesize maybe not equal \n    const char * srcPtr = strstr(src.c_str(), \"Format\");\n    const char * dstPtr = strstr(dst.c_str(), \"Format\");\n    return strcmp(srcPtr, dstPtr) == 0 ? true : false;\n}\nTEST_F(ObjectRequestPaymentTest, ProcessObjectRequestTest)\n{\n    std::string ImageFilePath = Config::GetDataPath();\n    ImageFilePath.append(\"example.jpg\");\n    std::string Process = \"image/resize,m_fixed,w_100,h_100\";\n    std::string ImageInfo = \"{\\n    \\\"FileSize\\\": {\\\"value\\\": \\\"3267\\\"},\\n    \\\"Format\\\": {\\\"value\\\": \\\"jpg\\\"},\\n    \\\"FrameCount\\\": {\\\"value\\\": \\\"1\\\"},\\n    \\\"ImageHeight\\\": {\\\"value\\\": \\\"100\\\"},\\n    \\\"ImageWidth\\\": {\\\"value\\\": \\\"100\\\"},\\n    \\\"ResolutionUnit\\\": {\\\"value\\\": \\\"1\\\"},\\n    \\\"XResolution\\\": {\\\"value\\\": \\\"1/1\\\"},\\n    \\\"YResolution\\\": {\\\"value\\\": \\\"1/1\\\"}}\";\n\n    std::string key = TestUtils::GetObjectKey(\"ImageProcessBysetProcessAndSavetoTest\");\n    std::string key1 = key;\n    std::string key2 = key;\n    key.append(\"-noraml.jpg\");\n    key1.append(\"-saveas.jpg\");\n    key2.append(\"-saveas2.jpg\");\n    auto pOutcome = Client->PutObject(BucketName, key, ImageFilePath);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    std::stringstream ss;\n    ss << Process\n        << \"|sys/saveas\"\n        << \",o_\" << Base64EncodeUrlSafe(key1)\n        << \",b_\" << Base64EncodeUrlSafe(BucketName);\n\n    ProcessObjectRequest request(BucketName, key, ss.str());\n    auto gOutcome = PayerClient->ProcessObject(request);\n    EXPECT_EQ(gOutcome.isSuccess(), false);\n    EXPECT_EQ(gOutcome.error().Code(), \"AccessDenied\");\n\n    request.setRequestPayer(RequestPayer::Requester);\n    gOutcome = PayerClient->ProcessObject(request);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n\n    std::istreambuf_iterator<char> isb(*gOutcome.result().Content()), end;\n    std::string json_str = std::string(isb, end);\n    //std::cout << json_str << std::endl;\n    EXPECT_TRUE(json_str.find(key1) != std::string::npos);\n\n    std::string imageInfo = GetOssImageObjectInfo(BucketName, key1);\n    EXPECT_TRUE(CompareImageInfo(imageInfo, ImageInfo));\n}\n\nTEST_F(ObjectRequestPaymentTest, ObjectTaggingBasicTest)\n{\n    auto key = TestUtils::GetObjectKey(\"ObjectTaggingBasicTest\");\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\n    auto outcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    Tagging tagging;\n    tagging.addTag(Tag(\"key1\", \"value1\"));\n    tagging.addTag(Tag(\"key2\", \"value2\"));\n    SetObjectTaggingRequest request(BucketName, key, tagging);\n    auto putTaggingOutcome = PayerClient->SetObjectTagging(request);\n    EXPECT_EQ(putTaggingOutcome.isSuccess(), false);\n    EXPECT_EQ(putTaggingOutcome.error().Code(), \"AccessDenied\");\n\n    request.setRequestPayer(RequestPayer::Requester);\n    putTaggingOutcome = PayerClient->SetObjectTagging(request);\n    EXPECT_EQ(putTaggingOutcome.isSuccess(), true);\n    EXPECT_TRUE(putTaggingOutcome.result().RequestId().size() > 0U);\n\n    GetObjectTaggingRequest gRequest(BucketName, key);\n    auto getTaggingOutcome = PayerClient->GetObjectTagging(gRequest);\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), false);\n    EXPECT_EQ(getTaggingOutcome.error().Code(), \"AccessDenied\");\n\n    gRequest.setRequestPayer(RequestPayer::Requester);\n    getTaggingOutcome = PayerClient->GetObjectTagging(gRequest);\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 2U);\n    EXPECT_TRUE(getTaggingOutcome.result().RequestId().size() > 0U);\n\n    size_t i = 0;\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\n        i++;\n    }\n\n    DeleteObjectTaggingRequest dRequest(BucketName, key);\n    auto delTaggingOutcome = PayerClient->DeleteObjectTagging(dRequest);\n    EXPECT_EQ(delTaggingOutcome.isSuccess(), false);\n    EXPECT_EQ(delTaggingOutcome.error().Code(), \"AccessDenied\");\n\n    dRequest.setRequestPayer(RequestPayer::Requester);\n    delTaggingOutcome = PayerClient->DeleteObjectTagging(dRequest);\n    EXPECT_EQ(delTaggingOutcome.isSuccess(), true);\n    EXPECT_TRUE(delTaggingOutcome.result().RequestId().size() > 0U);\n    \n    getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key));\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 0U);\n}\n\nTEST_F(ObjectRequestPaymentTest, NormalResumableUploadWithSizeOverPartSizeTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"ResumableUploadObjectOverPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableUploadObjectOverPartSize\").append(\".tmp\");\n    int num = 4;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num + 10);\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(1);\n    auto outcome = PayerClient->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"AccessDenied\");\n\n    request.setRequestPayer(RequestPayer::Requester);\n    outcome = PayerClient->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    auto getObjectOutcome = Client->GetObject(BucketName, key);\n    EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n\n    std::fstream file(tmpFile, std::ios::in | std::ios::binary);\n    std::string oriMd5 = ComputeContentMD5(file);\n    std::string memMd5 = ComputeContentMD5(*getObjectOutcome.result().Content());\n    EXPECT_EQ(oriMd5, memMd5);\n\n    file.close();\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, NormalResumableUploadWithSizeUnderPartSizeTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"ResumableUploadObjectUnderPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableUploadObjectUnderPartSize\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 10240);\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(1);\n    auto outcome = PayerClient->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"AccessDenied\");\n\n    request.setRequestPayer(RequestPayer::Requester);\n    outcome = PayerClient->ResumableUploadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    auto getObjectOutcome = Client->GetObject(BucketName, key);\n    EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, NormalResumableDownloadWithSizeOverPartSizeTest)\n{\n    // upload object\n    std::string key = TestUtils::GetObjectKey(\"ResumableDownloadObjectOverPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableDownloadObjectOverPartSize\").append(\".tmp\");\n    std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n    int num = 4;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n    auto uploadOutcome = Client->PutObject(BucketName, key, tmpFile);\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download object\n    DownloadObjectRequest request(BucketName, key, targetFile);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(1);\n    auto outcome = PayerClient->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"AccessDenied\");\n\n    request.setRequestPayer(RequestPayer::Requester);\n    outcome = PayerClient->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(uploadMd5, downloadMd5);\n\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, NormalResumableDownloadWithSizeUnderPartSizeTest)\n{\n    // upload object\n    std::string key = TestUtils::GetObjectKey(\"ResumableDownloadObjectUnderPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableDownloadObjectUnderPartSize\").append(\".tmp\");\n    std::string targetFile = TestUtils::GetTargetFileName(\"ResumableDownloadTargetObject\");\n    int num = 4;\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num);\n    auto uploadOutcome = Client->PutObject(BucketName, key, tmpFile);\n    EXPECT_EQ(uploadOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\n\n    // download object\n    DownloadObjectRequest request(BucketName, key, targetFile);\n    request.setThreadNum(1);\n    auto outcome = PayerClient->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"AccessDenied\");\n\n    request.setRequestPayer(RequestPayer::Requester);\n    outcome = PayerClient->ResumableDownloadObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    std::string uploadMd5 = TestUtils::GetFileMd5(tmpFile);\n    std::string downloadMd5 = TestUtils::GetFileMd5(targetFile);\n    EXPECT_EQ(uploadMd5, downloadMd5);\n\n    EXPECT_EQ(RemoveFile(targetFile), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, NormalResumableCopyWithSizeOverPartSizeTest)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectOverPartSize\");\n    std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectOverPartSize\");\n    // put object into bucket\n    int num = 1 + rand() % 10;\n    auto putObjectContent = TestUtils::GetRandomStream(102400 * num);\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n    // Copy Object\n    MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(1);\n    auto outcome = PayerClient->ResumableCopyObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"AccessDenied\");\n\n    request.setRequestPayer(RequestPayer::Requester);\n    outcome = PayerClient->ResumableCopyObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, NormalResumableCopyWithSizeUnderPartSizeTest)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectUnderPartSize\");\n    std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectUnderPartSize\");\n    // put Object into bucket\n    auto putObjectContent = TestUtils::GetRandomStream(1024 * (rand() % 100));\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n    // copy object\n    MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n    request.setPartSize(100 * 1024 + 1);\n    auto outcome = PayerClient->ResumableCopyObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"AccessDenied\");\n\n    request.setRequestPayer(RequestPayer::Requester);\n    outcome = PayerClient->ResumableCopyObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n}\n\nTEST_F(ObjectRequestPaymentTest, SignUrlTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"SignUrlTest\");\n\n    PutObjectRequest putRequest(BucketName, key, std::make_shared<std::stringstream>(\"hello world\"));\n    putRequest.setRequestPayer(RequestPayer::Requester);\n    auto putOutcome = PayerClient->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    GeneratePresignedUrlRequest gRequest(BucketName, key, Http::Method::Get);\n    auto gOutcome = PayerClient->GeneratePresignedUrl(gRequest);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n\n    auto gurlOutcome = PayerClient->GetObjectByUrl(gOutcome.result());\n    EXPECT_EQ(gurlOutcome.isSuccess(), false);\n    EXPECT_EQ(gurlOutcome.error().Code(), \"AccessDenied\");\n\n    gRequest.setRequestPayer(RequestPayer::Requester);\n    gOutcome = PayerClient->GeneratePresignedUrl(gRequest);\n    gurlOutcome = PayerClient->GetObjectByUrl(gOutcome.result());\n    EXPECT_EQ(gurlOutcome.isSuccess(), true);\n    std::istreambuf_iterator<char> isb(*gurlOutcome.result().Content().get()), end;\n    std::string str(isb, end);\n    EXPECT_EQ(str, \"hello world\");\n}\n\n}\n}\n"
  },
  {
    "path": "test/src/Object/ObjectRestoreTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <stdlib.h>\r\n#include <sstream>\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n\r\nnamespace AlibabaCloud{ namespace OSS{\r\nclass ObjectRestoreTest : public ::testing::Test\r\n{\r\nprotected:\r\n    ObjectRestoreTest()\r\n    {\r\n    }\r\n\r\n    ~ObjectRestoreTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase()\r\n    {\r\n        ClientConfiguration conf;\r\n        conf.enableCrc64 = false;\r\n        Client = TestUtils::GetOssClientDefault();\r\n        \r\n\t\tBucketName = TestUtils::GetBucketName(\"cpp-sdk-objectrestore-standard\");\r\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\r\n        EXPECT_EQ(outCome.isSuccess(), true);\r\n\r\n\t\tBucketNameRestore = TestUtils::GetBucketName(\"cpp-sdk-objectrestore-archive\");\r\n\t\toutCome = Client->CreateBucket(CreateBucketRequest(BucketNameRestore, Archive));\r\n        EXPECT_EQ(outCome.isSuccess(), true);\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase()\r\n    {\r\n        TestUtils::CleanBucket(*Client, BucketName);\r\n        TestUtils::CleanBucket(*Client, BucketNameRestore);\r\n        Client = nullptr;\r\n    }\r\n\r\n    // Sets up the test fixture.\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    // Tears down the test fixture.\r\n    void TearDown() override\r\n    {\r\n    }\r\npublic:\r\n    static std::shared_ptr<OssClient> Client;\r\n    static std::string BucketName;\r\n    static std::string BucketNameRestore;\r\n};\r\n\r\nstd::shared_ptr<OssClient> ObjectRestoreTest::Client = nullptr;\r\nstd::string ObjectRestoreTest::BucketName = \"\";\r\nstd::string ObjectRestoreTest::BucketNameRestore = \"\";\r\n\r\n\r\nTEST_F(ObjectRestoreTest, SetAndGetObjectRestoreSuccessTest)\r\n{\r\n    std::string objName = TestUtils::GetObjectKey(\"test-cpp-sdk-objectrestore\");\r\n\r\n    // first: put object\r\n    std::string text = \"hellowworld\";\r\n    auto putOutcome = Client->PutObject(PutObjectRequest(BucketNameRestore, objName, std::make_shared<std::stringstream>(text)));\r\n    EXPECT_EQ(putOutcome.isSuccess(), true);\r\n\r\n    //second:restore object\r\n    auto restoreOutCome =  Client->RestoreObject(BucketNameRestore, objName);\r\n    EXPECT_EQ(restoreOutCome.isSuccess(), true);\r\n\r\n    // third:wait restore success\r\n    bool result = false;\r\n    do {\r\n        TestUtils::WaitForCacheExpire(5);\r\n        restoreOutCome =  Client->RestoreObject(RestoreObjectRequest(BucketNameRestore, objName));\r\n        if(restoreOutCome.isSuccess()) {\r\n            result = true;\r\n        } else {\r\n            std::string errorCode = restoreOutCome.error().Code();\r\n\t\t\tprintf(\"errorcode:%s.\\n\",errorCode.c_str());\r\n            EXPECT_EQ((errorCode == \"RestoreAlreadyInProgress\") || (errorCode == \"ValidateError\"), true);\r\n        }\r\n    } while (!result);\r\n\r\n    //repeated success\r\n    restoreOutCome =  Client->RestoreObject(RestoreObjectRequest(BucketNameRestore, objName));\r\n    EXPECT_EQ(restoreOutCome.isSuccess(), true);\r\n\r\n\tTestUtils::WaitForCacheExpire(2);\r\n\r\n    // read data\r\n    GetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketNameRestore, objName));\r\n    EXPECT_EQ(getOutcome.isSuccess(), true);\r\n    std::string strData ;\r\n    (*getOutcome.result().Content().get()) >> strData;\r\n    EXPECT_EQ(strData, text);\r\n\r\n    // restore not exist object\r\n    restoreOutCome =  Client->RestoreObject(RestoreObjectRequest(BucketNameRestore, \"aaa\"));\r\n    EXPECT_EQ(restoreOutCome.isSuccess(), false);\r\n\r\n    //restore  standard object\r\n    std::string objStandard = TestUtils::GetObjectKey(\"test-cpp-sdk-objectrestore\");\r\n    putOutcome = Client->PutObject(PutObjectRequest(BucketName, objStandard, std::make_shared<std::stringstream>(text)));\r\n    EXPECT_EQ(putOutcome.isSuccess(), true);\r\n    restoreOutCome =  Client->RestoreObject(RestoreObjectRequest(BucketName, objStandard));\r\n    EXPECT_EQ(restoreOutCome.isSuccess(), false);\r\n    EXPECT_EQ(restoreOutCome.error().Code(), \"OperationNotSupported\");\r\n}\r\n\r\nTEST_F(ObjectRestoreTest, RestoreWithColdArchiveTest)\r\n{\r\n    std::string objName = TestUtils::GetObjectKey(\"RestoreWithTierTypeTest\");\r\n\r\n    std::string bucket = TestUtils::GetBucketName(\"cpp-sdk-objectrestore-ltarchive\");\r\n    auto outcome = Client->CreateBucket(CreateBucketRequest(bucket, StorageClass::ColdArchive));\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    // first: put object\r\n    std::string text = \"hellowworld\";\r\n    auto putOutcome = Client->PutObject(PutObjectRequest(bucket, objName, std::make_shared<std::stringstream>(text)));\r\n    EXPECT_EQ(putOutcome.isSuccess(), true);\r\n\r\n    //second:restore object\r\n    RestoreObjectRequest roRequest(bucket, objName);\r\n    roRequest.setDays(2);\r\n    roRequest.setTierType(TierType::Expedited);\r\n    auto restoreOutCome = Client->RestoreObject(roRequest);\r\n    EXPECT_EQ(restoreOutCome.isSuccess(), true);\r\n\r\n    TestUtils::WaitForCacheExpire(5);\r\n    restoreOutCome = Client->RestoreObject(roRequest);\r\n    EXPECT_EQ(restoreOutCome.isSuccess(), false);\r\n    EXPECT_EQ(restoreOutCome.error().Code(), \"RestoreAlreadyInProgress\");\r\n\r\n    TestUtils::CleanBucket(*Client, bucket);\r\n}\r\n\r\n}}\r\n\r\n"
  },
  {
    "path": "test/src/Object/ObjectSignedUrlTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include <fstream>\n#include \"src/utils/Utils.h\"\n#include \"src/utils/FileSystemUtils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass ObjectSignedUrlTest : public ::testing::Test {\nprotected:\n    ObjectSignedUrlTest()\n    {\n    }\n\n    ~ObjectSignedUrlTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase() \n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-objectsignedurl\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase() \n    {\n        TestUtils::CleanBucket(*Client, BucketName);\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\n    static int64_t GetExpiresDelayS(int64_t value)\n    {\n        auto tp = std::chrono::time_point_cast<std::chrono::seconds>(std::chrono::system_clock::now());\n        return tp.time_since_epoch().count() + value;\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> ObjectSignedUrlTest::Client = nullptr;\nstd::string ObjectSignedUrlTest::BucketName = \"\";\n\n\nTEST_F(ObjectSignedUrlTest, GetObjectWithPreSignedAndAclParameter)\n{\n    std::string key = TestUtils::GetObjectKey(\"GetObjectWithPreSignedAndAclParameter\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Get);\n    request.setExpires(GetExpiresDelayS(120));\n    request.addParameter(\"acl\", \"\");\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto gOutcome = Client->GetObjectByUrl(urlOutcome.result());\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n\n    if (gOutcome.isSuccess()) {\n        std::istreambuf_iterator<char> isb(*gOutcome.result().Content().get()), end;\n        std::string data(isb, end);\n        EXPECT_TRUE(strstr(data.c_str(), \"default\") != nullptr);\n    }\n    else {\n        EXPECT_TRUE(false);\n    }\n}\n\nTEST_F(ObjectSignedUrlTest, GetPreSignedUriDefaultExpireDatePositiveTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"GetPreSignedUriDefaultExpireDatePositiveTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    std::string actualETag = pOutcome.result().ETag();\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Get);\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto gOutcome = Client->GetObjectByUrl(urlOutcome.result());\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n\n    if (gOutcome.isSuccess()) {\n        EXPECT_STREQ(actualETag.c_str(), gOutcome.result().Metadata().ETag().c_str());\n    }\n    else {\n        EXPECT_TRUE(false);\n    }\n}\n\nTEST_F(ObjectSignedUrlTest, GetPreSignedUriDefaultNegativeTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"GetPreSignedUriDefaultNegativeTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Get);\n    request.setExpires(GetExpiresDelayS(-10));\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto gOutcome = Client->GetObjectByUrl(urlOutcome.result());\n    EXPECT_EQ(gOutcome.isSuccess(), false);\n    // v1\n    auto url = urlOutcome.result();\n     if (url.find(\"x-oss-date=\") == url.npos) {\n        EXPECT_STREQ(gOutcome.error().Code().c_str(), \"AccessDenied\");\n    } else {\n        EXPECT_STREQ(gOutcome.error().Code().c_str(), \"AuthorizationArgumentError\");\n    }\n}\n\nTEST_F(ObjectSignedUrlTest, GetPreSignedUriDefaultPositiveTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"GetPreSignedUriDefaultPositiveTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Get);\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto gOutcome = Client->GetObjectByUrl(urlOutcome.result());\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(TestUtils::ObjectExists(*Client, BucketName, key), true);\n}\n\nTEST_F(ObjectSignedUrlTest, GetPreSignedUriWithExpiresTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"GetPreSignedUriWithExpiresTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    std::time_t t = std::time(nullptr) + 60;\n    auto urlOutcome = Client->GeneratePresignedUrl(BucketName, key, t);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto gOutcome = Client->GetObjectByUrl(urlOutcome.result());\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_EQ(TestUtils::ObjectExists(*Client, BucketName, key), true);\n}\n\nTEST_F(ObjectSignedUrlTest, GetPreSignedUriFullSettingsPositiveTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"GetPreSignedUriFullSettingsPositiveTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n    std::string md5 = ComputeContentMD5(*content.get());\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Get);\n    request.setContentMd5(md5);\n    request.setContentType(\"application/zip\");\n    request.setExpires(GetExpiresDelayS(120));\n    request.addResponseHeaders(RequestResponseHeader::CacheControl, \"No-cache\");\n    // no support now\n    //request.addResponseHeaders(RequestResponseHeader::ContentType, \"application/zip\");\n    request.addResponseHeaders(RequestResponseHeader::ContentDisposition, \"myDownload.zip\");\n    request.UserMetaData()[\"name1\"] = \"value1\";\n    request.UserMetaData()[\"name2\"] = \"value2\";\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    ObjectMetaData meta;\n    meta.setContentMd5(md5);\n    meta.setContentType(\"application/zip\");\n    meta.UserMetaData()[\"name1\"] = \"value1\";\n    meta.UserMetaData()[\"name2\"] = \"value2\";\n\n    auto gOutcome = Client->GetObjectByUrl(GetObjectByUrlRequest(urlOutcome.result(), meta));\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_STREQ(gOutcome.result().Metadata().ContentDisposition().c_str(), \"myDownload.zip\");\n    EXPECT_STREQ(gOutcome.result().Metadata().CacheControl().c_str(), \"No-cache\");\n    //EXPECT_STREQ(gOutcome.result().Metadata().ContentType().c_str(), \"application/zip\");\n}\n\nTEST_F(ObjectSignedUrlTest, GetPreSignedUriWithContentTypeAndMd5NegativeTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"GetPreSignedUriWithContentTypeAndMd5NegativeTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n    std::string md5 = ComputeContentMD5(*content.get());\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Get);\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    ObjectMetaData meta;\n    meta.setContentMd5(md5);\n\n    auto gOutcome = Client->GetObjectByUrl(GetObjectByUrlRequest(urlOutcome.result(), meta));\n    EXPECT_EQ(gOutcome.isSuccess(), false);\n    EXPECT_STREQ(gOutcome.error().Code().c_str(), \"SignatureDoesNotMatch\");\n}\n\nTEST_F(ObjectSignedUrlTest, GetPreSignedUriWithContentTypeAndMd5PositiveTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"GetPreSignedUriWithContentTypeAndMd5PositiveTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n    std::string md5 = ComputeContentMD5(*content.get());\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Get);\n    request.setContentMd5(md5);\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    ObjectMetaData meta;\n    meta.setContentMd5(md5);\n\n    auto gOutcome = Client->GetObjectByUrl(GetObjectByUrlRequest(urlOutcome.result(), meta));\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n}\n\nTEST_F(ObjectSignedUrlTest, GetPreSignedUriWithResponseHeaderPositiveTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"GetPreSignedUriWithResponseHeaderPositiveTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Get);\n    request.addResponseHeaders(RequestResponseHeader::CacheControl, \"No-cache\");\n    //request.addResponseHeaders(RequestResponseHeader::ContentType, \"application/zip\");\n    request.addResponseHeaders(RequestResponseHeader::ContentDisposition, \"myDownload.zip\");\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto gOutcome = Client->GetObjectByUrl(GetObjectByUrlRequest(urlOutcome.result()));\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n    EXPECT_STREQ(gOutcome.result().Metadata().ContentDisposition().c_str(), \"myDownload.zip\");\n    EXPECT_STREQ(gOutcome.result().Metadata().CacheControl().c_str(), \"No-cache\");\n    //EXPECT_STREQ(gOutcome.result().Metadata().ContentType().c_str(), \"application/zip\");\n}\n\nTEST_F(ObjectSignedUrlTest, GetPreSignedUriWithUserMetaPositiveTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"GetPreSignedUriWithUserMetaPositiveTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Get);\n    request.setExpires(GetExpiresDelayS(120));\n    request.UserMetaData()[\"name1\"] = \"value1\";\n    request.UserMetaData()[\"name2\"] = \"value2\";\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    ObjectMetaData meta;\n    meta.UserMetaData()[\"name1\"] = \"value1\";\n    meta.UserMetaData()[\"name2\"] = \"value2\";\n\n    auto gOutcome = Client->GetObjectByUrl(GetObjectByUrlRequest(urlOutcome.result(), meta));\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n}\n\n\nTEST_F(ObjectSignedUrlTest, PutPreSignedUriDefaultPositiveTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"PutPreSignedUriDefaultPositiveTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    std::string md5 = ComputeContentMD5(*content.get());\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\n    request.setExpires(GetExpiresDelayS(120));\n    request.setContentMd5(md5);\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    ObjectMetaData meta;\n    meta.setContentMd5(md5);\n\n    auto pOutcome = Client->PutObjectByUrl(urlOutcome.result(), content, meta);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    auto metaOutcome = Client->HeadObject(BucketName, key);\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\n}\n\nTEST_F(ObjectSignedUrlTest, PutObjectWithPreSignedUriAndCrc)\n{\n    ClientConfiguration conf;\n    conf.enableCrc64 = true;\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithPreSignedUriAndCrc\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\n    request.setExpires(GetExpiresDelayS(120));\n    auto urlOutcome = client.GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto pOutcome = client.PutObjectByUrl(urlOutcome.result(), content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    EXPECT_EQ(TestUtils::ObjectExists(*Client, BucketName, key), true);\n\n}\n\nTEST_F(ObjectSignedUrlTest, PutObjectWithPreSignedUriWithoutCrc)\n{\n    ClientConfiguration conf;\n    conf.enableCrc64 = false;\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithPreSignedUriWithoutCrc\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\n    request.setExpires(GetExpiresDelayS(120));\n    auto urlOutcome = client.GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto pOutcome = client.PutObjectByUrl(urlOutcome.result(), content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    EXPECT_EQ(TestUtils::ObjectExists(*Client, BucketName, key), true);\n\n}\n\nTEST_F(ObjectSignedUrlTest, PutPreSignedWithExpiresTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"PutPreSignedWithExpiresTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\n\n    auto urlOutcome = Client->GeneratePresignedUrl(BucketName, key, GetExpiresDelayS(60), Http::Put);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto pOutcome = Client->PutObjectByUrl(PutObjectByUrlRequest(urlOutcome.result(), content));\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    auto outcome = Client->HeadObject(BucketName, key);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().ContentLength(), 1024LL);\n}\n\nTEST_F(ObjectSignedUrlTest, PutPreSignedByFileNameTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"PutPreSignedByFileNameTest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutPreSignedByFileNameTest\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 2048);\n    auto fileETag = TestUtils::GetFileETag(tmpFile);\n\n    auto urlOutcome = Client->GeneratePresignedUrl(BucketName, key, GetExpiresDelayS(60), Http::Put);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto pOutcome = Client->PutObjectByUrl(urlOutcome.result(), tmpFile);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    EXPECT_EQ(pOutcome.result().ETag(), fileETag);\n    RemoveFile(tmpFile);\n}\n\nTEST_F(ObjectSignedUrlTest, PutPreSignedByFileNameWithMetaDataTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"PutPreSignedByFileNameWithMetaDataTest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"PutPreSignedByFileNameWithMetaDataTest\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 2048);\n    auto fileETag = TestUtils::GetFileETag(tmpFile);\n\n    ObjectMetaData metaData;\n    metaData.UserMetaData()[\"test0\"] = \"value0\";\n    metaData.UserMetaData()[\"test1\"] = \"value1\";\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\n    request.UserMetaData()[\"test0\"] = \"value0\";\n    request.UserMetaData()[\"test1\"] = \"value1\";\n\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto pOutcome = Client->PutObjectByUrl(urlOutcome.result(), tmpFile, metaData);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    EXPECT_EQ(pOutcome.result().ETag(), fileETag);\n\n    RemoveFile(tmpFile);\n}\n\nTEST_F(ObjectSignedUrlTest, PutPreSignedUriDefaultNegativeTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"PutPreSignedUriDefaultNegativeTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\n    request.setExpires(GetExpiresDelayS(-5));\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto pOutcome = Client->PutObjectByUrl(urlOutcome.result(), content);\n    EXPECT_EQ(pOutcome.isSuccess(), false);\n    auto url = urlOutcome.result();\n    if (url.find(\"x-oss-date=\") == url.npos) {\n        EXPECT_STREQ(pOutcome.error().Code().c_str(), \"AccessDenied\");\n    } else {\n        EXPECT_STREQ(pOutcome.error().Code().c_str(), \"AuthorizationArgumentError\");\n    }    \n}\n\nTEST_F(ObjectSignedUrlTest, PutObjectWithPreSignedUriWithParameter)\n{\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithPreSignedUriWithParameter\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    std::string md5 = ComputeContentMD5(*content.get());\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\n    request.setExpires(GetExpiresDelayS(120));\n    request.setContentMd5(md5);\n    request.setContentType(\"text/rtf\");\n    request.UserMetaData()[\"Author\"] = \"oss\";\n    request.UserMetaData()[\"Test\"] = \"test\";\n    request.addParameter(\"x-param-null\", \"\");\n    request.addParameter(\"x-param-space0\", \" \");\n    request.addParameter(\"x-param-value\", \"value\");\n    request.addParameter(\"x-param-space1\", \" \");\n\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    ObjectMetaData meta;\n    meta.setContentMd5(md5);\n    meta.setContentType(\"text/rtf\");\n    meta.UserMetaData()[\"Author\"] = \"oss\";\n    meta.UserMetaData()[\"Test\"] = \"test\";\n\n    auto pOutcome = Client->PutObjectByUrl(urlOutcome.result(), content, meta);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    EXPECT_EQ(TestUtils::ObjectExists(*Client, BucketName, key), true);\n\n    auto metaOutcome = Client->HeadObject(BucketName, key);\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\n    EXPECT_STREQ(metaOutcome.result().ContentType().c_str(), \"text/rtf\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"Author\").c_str(), \"oss\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"author\").c_str(), \"oss\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"Test\").c_str(), \"test\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"tesT\").c_str(), \"test\");\n}\n\nTEST_F(ObjectSignedUrlTest, PutObjectWithPreSignedUriWithParameterNegativeTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithPreSignedUriWithParameterNegativeTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    std::string md5 = ComputeContentMD5(*content.get());\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\n    request.setExpires(GetExpiresDelayS(120));\n    request.setContentMd5(md5);\n    request.setContentType(\"text/rtf\");\n    request.UserMetaData()[\"Author\"] = \"oss\";\n    request.UserMetaData()[\"Test\"] = \"test\";\n    request.addParameter(\"x-param-null\", \"\");\n    request.addParameter(\"x-param-space0\", \" \");\n    request.addParameter(\"x-param-value\", \"value\");\n    request.addParameter(\"x-param-space1\", \" \");\n\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    ObjectMetaData meta;\n    meta.setContentMd5(md5);\n    meta.setContentType(\"text/rtf\");\n    meta.UserMetaData()[\"Author\"] = \"oss\";\n\n    auto pOutcome = Client->PutObjectByUrl(urlOutcome.result(), content, meta);\n    EXPECT_EQ(pOutcome.isSuccess(), false);\n    EXPECT_STREQ(pOutcome.error().Code().c_str(), \"SignatureDoesNotMatch\");\n}\n\nTEST_F(ObjectSignedUrlTest, GetPreSignedUriSetBucketObjectPositiveTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"GetPreSignedUriSetBucketObjectPositiveTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    std::string actualETag = pOutcome.result().ETag();\n\n    GeneratePresignedUrlRequest request(\"\", \"\");\n    request.setBucket(BucketName);\n    request.setKey(key);\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto gOutcome = Client->GetObjectByUrl(urlOutcome.result());\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n\n    if (gOutcome.isSuccess()) {\n        EXPECT_STREQ(actualETag.c_str(), gOutcome.result().Metadata().ETag().c_str());\n    }\n    else {\n        EXPECT_TRUE(false);\n    }\n}\n\nTEST_F(ObjectSignedUrlTest, GetObjectToFilePositiveTest)\n{\n    GetObjectOutcome dummy;\n    std::string key = TestUtils::GetObjectKey(\"GetObjectToFilePositiveTest\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    auto pOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    std::string actualETag = pOutcome.result().ETag();\n\n    std::string tmpFile = TestUtils::GetTargetFileName(\"GetObjectToFilePositiveTest\");\n\n    auto urlOutcome = Client->GeneratePresignedUrl(BucketName, key);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto gOutcome = Client->GetObjectByUrl(urlOutcome.result(), tmpFile);\n    EXPECT_EQ(gOutcome.isSuccess(), true);\n\n    auto fileContent = gOutcome.result().Content();\n    fileContent->seekg(0, fileContent->beg);\n    \n    auto fileETag0 = ComputeContentETag(*fileContent);\n\n    gOutcome = dummy;\n    fileContent = nullptr;\n    auto fileETag = TestUtils::GetFileETag(tmpFile);\n\n    EXPECT_EQ(actualETag, fileETag0);\n    EXPECT_EQ(actualETag, fileETag);\n    RemoveFile(tmpFile);\n}\n\nTEST_F(ObjectSignedUrlTest, GeneratePresignedUrlInvalidBucketNameTest)\n{\n    auto outcome = Client->GeneratePresignedUrl(\"InvalidBucketName\", \"key\");\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n}\n\nTEST_F(ObjectSignedUrlTest, GeneratePresignedUrlInvalidKeyTest)\n{\n    auto outcome = Client->GeneratePresignedUrl(\"bucket\", \"\");\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n}\n\nTEST_F(ObjectSignedUrlTest, GetObjectByUrlRequestFunctionTest)\n{\n    GetObjectByUrlRequest request(\"http://demo.test/test\");\n    auto paramters = request.Parameters();\n    EXPECT_TRUE(paramters.empty());\n}\n\nTEST_F(ObjectSignedUrlTest, PutObjectByUrlRequestFunctionTest)\n{\n    auto content = TestUtils::GetRandomStream(0);\n    PutObjectByUrlRequest request(\"http://demo.test/test\", content);\n    auto paramters = request.Parameters();\n    EXPECT_TRUE(paramters.empty());\n}\n\nTEST_F(ObjectSignedUrlTest, UnencodedSlashTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"UnencodedSlashTest/123/456%2F/123\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    std::string md5 = ComputeContentMD5(*content.get());\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\n    request.setExpires(GetExpiresDelayS(120));\n    request.setContentMd5(md5);\n    request.setContentType(\"text/rtf\");\n    request.UserMetaData()[\"Author\"] = \"oss\";\n    request.UserMetaData()[\"Test\"] = \"test\";\n    request.addParameter(\"x-param-null\", \"\");\n    request.addParameter(\"x-param-space0\", \" \");\n    request.addParameter(\"x-param-value\", \"value\");\n    request.addParameter(\"x-param-space1\", \" \");\n\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n    EXPECT_TRUE(urlOutcome.result().find(\"UnencodedSlashTest%2F123%2F456%252F%2F123\") != std::string::npos);\n\n    ObjectMetaData meta;\n    meta.setContentMd5(md5);\n    meta.setContentType(\"text/rtf\");\n    meta.UserMetaData()[\"Author\"] = \"oss\";\n    meta.UserMetaData()[\"Test\"] = \"test\";\n\n    auto pOutcome = Client->PutObjectByUrl(urlOutcome.result(), content, meta);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    EXPECT_EQ(TestUtils::ObjectExists(*Client, BucketName, key), true);\n\n    auto metaOutcome = Client->HeadObject(BucketName, key);\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\n    EXPECT_STREQ(metaOutcome.result().ContentType().c_str(), \"text/rtf\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"Author\").c_str(), \"oss\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"author\").c_str(), \"oss\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"Test\").c_str(), \"test\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"tesT\").c_str(), \"test\");\n\n    //\n    request = GeneratePresignedUrlRequest(BucketName, key, Http::Put);\n    request.setExpires(GetExpiresDelayS(120));\n    request.setContentMd5(md5);\n    request.setContentType(\"text/rtf\");\n    request.UserMetaData()[\"Author\"] = \"oss1\";\n    request.UserMetaData()[\"Test\"] = \"test1\";\n    request.addParameter(\"x-param-null\", \"\");\n    request.addParameter(\"x-param-space0\", \" \");\n    request.addParameter(\"x-param-value\", \"value\");\n    request.addParameter(\"x-param-space1\", \" \");\n    request.setUnencodedSlash(true);\n\n    urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n    EXPECT_TRUE(urlOutcome.result().find(\"UnencodedSlashTest/123/456%252F/123\") != std::string::npos);\n\n    meta = ObjectMetaData();\n    meta.setContentMd5(md5);\n    meta.setContentType(\"text/rtf\");\n    meta.UserMetaData()[\"Author\"] = \"oss1\";\n    meta.UserMetaData()[\"Test\"] = \"test1\";\n\n    pOutcome = Client->PutObjectByUrl(urlOutcome.result(), content, meta);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    EXPECT_EQ(TestUtils::ObjectExists(*Client, BucketName, key), true);\n\n    metaOutcome = Client->HeadObject(BucketName, key);\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\n    EXPECT_STREQ(metaOutcome.result().ContentType().c_str(), \"text/rtf\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"Author\").c_str(), \"oss1\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"author\").c_str(), \"oss1\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"Test\").c_str(), \"test1\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"tesT\").c_str(), \"test1\");\n}\n\n\nTEST_F(ObjectSignedUrlTest, VerifyObjctNameStrictTest)\n{\n    std::string key = \"123?\";\n    GeneratePresignedUrlRequest request= GeneratePresignedUrlRequest(BucketName, key, Http::Put);\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n    EXPECT_TRUE(urlOutcome.result().find(\"123%3F?\") != std::string::npos);\n\n    key = \"123?321\";\n    request = GeneratePresignedUrlRequest(BucketName, key, Http::Put);\n    urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n    EXPECT_TRUE(urlOutcome.result().find(\"123%3F321?\") != std::string::npos);\n\n    key = \"?123\";\n    request = GeneratePresignedUrlRequest(BucketName, key, Http::Put);\n    urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), false);\n    EXPECT_TRUE(urlOutcome.error().Message().find(\"The Bucket or Key is invalid.\") != std::string::npos);\n\n    key = \"?\";\n    request = GeneratePresignedUrlRequest(BucketName, key, Http::Put);\n    urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), false);\n    EXPECT_TRUE(urlOutcome.error().Message().find(\"The Bucket or Key is invalid.\") != std::string::npos);\n\n    ClientConfiguration conf;\n    EXPECT_TRUE(conf.isVerifyObjectStrict);\n    conf.isVerifyObjectStrict = false;\n    auto c = std::make_shared<OssClient>(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n\n    key = \"123?321\";\n    request = GeneratePresignedUrlRequest(BucketName, key, Http::Put);\n    urlOutcome = c->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n    EXPECT_TRUE(urlOutcome.result().find(\"/123%3F321?\") != std::string::npos);\n\n    key = \"?123\";\n    request = GeneratePresignedUrlRequest(BucketName, key, Http::Put);\n    urlOutcome = c->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n    EXPECT_TRUE(urlOutcome.result().find(\"/%3F123\") != std::string::npos);\n\n    key = \"?\";\n    request = GeneratePresignedUrlRequest(BucketName, key, Http::Put);\n    urlOutcome = c->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n    EXPECT_TRUE(urlOutcome.result().find(\"/%3F?\") != std::string::npos);\n}\n\nTEST_F(ObjectSignedUrlTest, PutObjectWithPreSignedUriWithHeaderTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"UnencodedSlashTest/123/456%2F/123\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\n\n    std::string md5 = ComputeContentMD5(*content.get());\n\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\n    request.setExpires(GetExpiresDelayS(120));\n    request.setContentMd5(md5);\n    request.setContentType(\"text/rtf\");\n    request.HttpMetaData()[\"x-oss-meta-author\"] = \"oss\";\n    request.HttpMetaData()[\"x-oss-meta-test\"] = \"test\";\n    request.addParameter(\"x-param-null\", \"\");\n    request.addParameter(\"x-param-space0\", \" \");\n    request.addParameter(\"x-param-value\", \"value\");\n    request.addParameter(\"x-param-space1\", \" \");\n\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n    EXPECT_TRUE(urlOutcome.result().find(\"UnencodedSlashTest%2F123%2F456%252F%2F123\") != std::string::npos);\n\n    ObjectMetaData meta;\n    meta.setContentMd5(md5);\n    meta.setContentType(\"text/rtf\");\n    meta.UserMetaData()[\"Author\"] = \"oss\";\n    meta.UserMetaData()[\"Test\"] = \"test\";\n\n    auto pOutcome = Client->PutObjectByUrl(urlOutcome.result(), content, meta);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    EXPECT_EQ(TestUtils::ObjectExists(*Client, BucketName, key), true);\n\n    auto metaOutcome = Client->HeadObject(BucketName, key);\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\n    EXPECT_STREQ(metaOutcome.result().ContentType().c_str(), \"text/rtf\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"Author\").c_str(), \"oss\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"author\").c_str(), \"oss\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"Test\").c_str(), \"test\");\n    EXPECT_STREQ(metaOutcome.result().UserMetaData().at(\"tesT\").c_str(), \"test\");\n}\n\n}\n}"
  },
  {
    "path": "test/src/Object/ObjectSymlinkTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud{ namespace OSS {\nclass ObjectSymlinkTest : public ::testing::Test\n{\nprotected:\n    ObjectSymlinkTest()\n    {\n    }\n\n    ~ObjectSymlinkTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n\t\tClientConfiguration conf;\n\t\tconf.enableCrc64 = false;\n        Client = TestUtils::GetOssClientDefault();\n\t\tBucketName = TestUtils::GetBucketName(\"cpp-sdk-objectsymlink\");\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\n        EXPECT_EQ(outCome.isSuccess(), true);\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n\t\tTestUtils::CleanBucket(*Client, BucketName);\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> ObjectSymlinkTest::Client = nullptr;\nstd::string ObjectSymlinkTest::BucketName = \"\";\n\nTEST_F(ObjectSymlinkTest, SetAndGetObjectSymlinkSuccessTest)\n{\n    std::string objName = TestUtils::GetObjectKey(\"test-cpp-sdk-objectsymlink\");\n\n    // put object\n    std::string text = \"hellowworld\";\n    auto putOutcome = Client->PutObject(PutObjectRequest(BucketName, objName, std::make_shared<std::stringstream>(text)));\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // create symlink success\n    std::string linkName = objName+\"-link\";\n    CreateSymlinkRequest setRequest(BucketName, linkName);\n    setRequest.SetSymlinkTarget(objName);\n    CreateSymlinkOutcome  linkOutcom = Client->CreateSymlink(setRequest);\n    EXPECT_EQ(linkOutcom.isSuccess(), true);\n\n    // read symlink success\n    GetObjectOutcome getOutcome = Client->GetObject(GetObjectRequest(BucketName, linkName));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    std::string strData ;\n    (*getOutcome.result().Content().get())>>strData;\n    EXPECT_EQ(strData, text);\n\n    GetSymlinkOutcome getLinkOutcome = Client->GetSymlink(GetSymlinkRequest(BucketName, linkName));\n    EXPECT_EQ(getLinkOutcome.isSuccess(), true);\n    EXPECT_EQ(getLinkOutcome.result().SymlinkTarget(), objName);\n    \n    TestUtils::WaitForCacheExpire(5);\n\n    // create symlink to symlink success \n    std::string linkNameRepeat = linkName +\"-link\";\n    CreateSymlinkRequest setRequestRepeat(BucketName, linkNameRepeat);\n    setRequestRepeat.SetSymlinkTarget(linkName);\n\tlinkOutcom = Client->CreateSymlink(setRequestRepeat);\n    EXPECT_EQ(linkOutcom.isSuccess(), true);\n\n    getLinkOutcome = Client->GetSymlink(GetSymlinkRequest(BucketName, linkNameRepeat));\n    EXPECT_EQ(getLinkOutcome.isSuccess(), true);\n    EXPECT_EQ(getLinkOutcome.result().SymlinkTarget(), linkName);\n\n\t//but read symlink to symlink error\n\tgetOutcome = Client->GetObject(GetObjectRequest(BucketName, linkNameRepeat));\n\tEXPECT_EQ(getOutcome.isSuccess(), false);\n    \n\t// create symlink to not exist object success, but read error\n\tstd::string linkNameNotExist = \"test-link\";\n\tCreateSymlinkRequest setRequestNotExist(BucketName, linkNameNotExist);\n\tsetRequestNotExist.SetSymlinkTarget(\"not-exist-object-name\");\n\tlinkOutcom = Client->CreateSymlink(setRequestNotExist);\n\tEXPECT_EQ(linkOutcom.isSuccess(), true);\n    \n    getLinkOutcome = Client->GetSymlink(GetSymlinkRequest(BucketName, linkNameNotExist));\n    EXPECT_EQ(getLinkOutcome.isSuccess(), true);\n    EXPECT_EQ(getLinkOutcome.result().SymlinkTarget(), \"not-exist-object-name\");\n\n\tgetOutcome = Client->GetObject(GetObjectRequest(BucketName, linkNameNotExist));\n\tEXPECT_EQ(getOutcome.isSuccess(), false);\n\n\t//change symlink to another exist object success and read success\n\tstd::string objNameOther = TestUtils::GetObjectKey(\"test-cpp-sdk-objectsymlink\");\n\tstd::string textOther = \"hellowworldhellowworld\";\n\tputOutcome = Client->PutObject(PutObjectRequest(BucketName, objNameOther, std::make_shared<std::stringstream>(textOther)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\n\tCreateSymlinkRequest setRequestOther(BucketName, linkName);\n\tsetRequestOther.SetSymlinkTarget(objNameOther);\n\tlinkOutcom = Client->CreateSymlink(setRequestOther);\n\tEXPECT_EQ(linkOutcom.isSuccess(), true);\n\n    getLinkOutcome = Client->GetSymlink(GetSymlinkRequest(BucketName, linkName));\n    EXPECT_EQ(getLinkOutcome.isSuccess(), true);\n    EXPECT_EQ(getLinkOutcome.result().SymlinkTarget(), objNameOther);\n\n\tgetOutcome = Client->GetObject(GetObjectRequest(BucketName, linkName));\n\tEXPECT_EQ(getOutcome.isSuccess(), true);\n\t(*getOutcome.result().Content().get()) >> strData;\n\tEXPECT_EQ(strData, textOther);\n\n\t// create symlink with meta\n\tstd::string linkNameWithMeta = objName +\"-test-link-meta\";\n\tObjectMetaData MetaInfo;\n\tMetaInfo.UserMetaData()[\"author\"] = \"chanju\";\n\n\tCreateSymlinkRequest setRequestWithMeta(BucketName, linkNameWithMeta, MetaInfo);\n\tsetRequestWithMeta.SetSymlinkTarget(objNameOther);\n\tlinkOutcom = Client->CreateSymlink(setRequestWithMeta);\n\tEXPECT_EQ(linkOutcom.isSuccess(), true);\n\n    getLinkOutcome = Client->GetSymlink(GetSymlinkRequest(BucketName, linkNameWithMeta));\n    EXPECT_EQ(getLinkOutcome.isSuccess(), true);\n    EXPECT_EQ(getLinkOutcome.result().SymlinkTarget(), objNameOther);\n\n    // read meta\n\tgetOutcome = Client->GetObject(GetObjectRequest(BucketName, linkNameWithMeta));\n    EXPECT_EQ(getOutcome.isSuccess(), true);\n    (*getOutcome.result().Content().get()) >> strData;\n    EXPECT_EQ(strData, textOther);\n\tstd::string metaValue = getOutcome.result().Metadata().UserMetaData().at(\"author\");\n    EXPECT_EQ(metaValue, \"chanju\");\n\n\t// test Archive bucket\n\tstd::string  archiveBucket = TestUtils::GetBucketName(\"cpp-sdk-arvhive-objectsymlink\");\n\tCreateBucketOutcome bucketOutcome =  Client->CreateBucket(CreateBucketRequest(archiveBucket, Archive));\n\tEXPECT_EQ(bucketOutcome.isSuccess(), true);\n\n\t// put object in archiveBucket\n\tstd::string archiveObjName = TestUtils::GetObjectKey(\"test-cpp-sdk-archive\");\n\tputOutcome = Client->PutObject(PutObjectRequest(archiveBucket, archiveObjName, TestUtils::GetRandomStream(1024 * 1024)));\n\tEXPECT_EQ(putOutcome.isSuccess(), true);\n\n    std::string linkNameArchive = objName + \"-test-link-archive\";\n\tCreateSymlinkRequest setArchiveRequest(archiveBucket, linkNameArchive);\n\tsetArchiveRequest.SetSymlinkTarget(archiveObjName);\n\tlinkOutcom = Client->CreateSymlink(setArchiveRequest);\n\tEXPECT_EQ(linkOutcom.isSuccess(), true);\n\tTestUtils::CleanBucket(*Client, archiveBucket);\n}\n\n\nTEST_F(ObjectSymlinkTest, SetAndGetObjectSymlinkErrorTest)\n{\n    GetSymlinkOutcome getLinkOutcome = Client->GetSymlink(GetSymlinkRequest(BucketName, \"aaa\"));\n    EXPECT_EQ(getLinkOutcome.isSuccess(), false);\n    EXPECT_EQ(getLinkOutcome.error().Code().size()>0, true);\n}\n\nTEST_F(ObjectSymlinkTest, CreateSymlinkResultTest)\n{\n    CreateSymlinkResult reuslt;\n    EXPECT_EQ(reuslt.ETag(), \"\");\n\n    CreateSymlinkResult reuslt1(\"ETag\");\n    reuslt = reuslt1;\n    EXPECT_EQ(reuslt.ETag(), \"ETag\");\n\n    GetSymlinkResult result2(\"symlink\", \"etag\");\n    EXPECT_EQ(result2.ETag(), \"etag\");\n    EXPECT_EQ(result2.SymlinkTarget(), \"symlink\");\n\n    auto headers = HeaderCollection();\n    GetSymlinkResult result3(headers);\n    EXPECT_EQ(result3.ETag(), \"\");\n}\n\nTEST_F(ObjectSymlinkTest, CreateSymlinkNegativeTest)\n{\n    auto name = TestUtils::GetBucketName(\"no-exist-symlink\");\n    CreateSymlinkRequest setRequestRepeat(name, \"test-key\");\n    setRequestRepeat.SetSymlinkTarget(\"test-key-link\");\n    auto outcome = Client->CreateSymlink(setRequestRepeat);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"NoSuchBucket\");\n}\n/*\nTEST_F(ObjectSymlinkTest, CreateSymlinkNegativeTest)\n{\n    auto name = TestUtils::GetBucketName(\"no-exist-symlink\");\n    CreateSymlinkRequest setRequestRepeat(name, \"test-key\");\n    setRequestRepeat.SetSymlinkTarget(\"test-key-link\");\n    auto outcome = Client->CreateSymlink(setRequestRepeat);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().code(), \"NoSuchBucket\");\n}\n*/\n}\n}\n"
  },
  {
    "path": "test/src/Object/ObjectTaggingTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <stdlib.h>\r\n#include <sstream>\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n\r\nnamespace AlibabaCloud\r\n{\r\nnamespace OSS \r\n{\r\n\r\nclass ObjectTaggingTest : public ::testing::Test\r\n{\r\nprotected:\r\n    ObjectTaggingTest()\r\n    {\r\n    }\r\n\r\n    ~ObjectTaggingTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase()\r\n    {\r\n\t\tClientConfiguration conf;\r\n        Client = TestUtils::GetOssClientDefault();\r\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-objecttagging\");\r\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\r\n        EXPECT_EQ(outCome.isSuccess(), true);\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase()\r\n    {\r\n       TestUtils::CleanBucket(*Client, BucketName);\r\n       Client = nullptr;\r\n    }\r\n\r\n    // Sets up the test fixture.\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    // Tears down the test fixture.\r\n    void TearDown() override\r\n    {\r\n    }\r\npublic:\r\n    static std::shared_ptr<OssClient> Client;\r\n    static std::string BucketName;\r\n};\r\n\r\nstd::shared_ptr<OssClient> ObjectTaggingTest::Client = nullptr;\r\nstd::string ObjectTaggingTest::BucketName = \"\";\r\n\r\nTEST_F(ObjectTaggingTest, TagClassTest)\r\n{\r\n    Tag tag1;\r\n    EXPECT_EQ(\"\", tag1.Key());\r\n    EXPECT_EQ(\"\", tag1.Value());\r\n\r\n    tag1.setKey(\"key1\");\r\n    tag1.setValue(\"value1\");\r\n    EXPECT_EQ(\"key1\", tag1.Key());\r\n    EXPECT_EQ(\"value1\", tag1.Value());\r\n\r\n    Tag tag2(\"key2\", \"value2\");\r\n    EXPECT_EQ(\"key2\", tag2.Key());\r\n    EXPECT_EQ(\"value2\", tag2.Value());\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, TaggingClassTest)\r\n{\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    Tag tag(\"key3\", \"value3\");\r\n    tagging.addTag(tag);\r\n    EXPECT_EQ(tagging.Tags().size(), 3U);\r\n    EXPECT_EQ(tagging.Tags()[1].Key(), \"key2\");\r\n    EXPECT_EQ(tagging.Tags()[1].Value(), \"value2\");\r\n\r\n    TagSet tagset;\r\n    tagset.push_back(Tag(\"key4\", \"value4\"));\r\n    tagset.push_back(Tag(\"key5\", \"value5\"));\r\n    Tagging tagging2(tagset);\r\n    EXPECT_EQ(tagging2.Tags().size(), 2U);\r\n    EXPECT_EQ(tagging2.Tags()[1].Key(), \"key5\");\r\n    EXPECT_EQ(tagging2.Tags()[1].Value(), \"value5\");\r\n    EXPECT_EQ(tagging2.toQueryParameters(), \"key4=value4&key5=value5\");\r\n\r\n\r\n    tagset.push_back(Tag(\"key6\", \"value6\"));\r\n    tagset.push_back(Tag(\"key7\", \"value7\"));\r\n    tagging2.setTags(tagset);\r\n    EXPECT_EQ(tagging2.Tags().size(), 4U);\r\n    EXPECT_EQ(tagging2.Tags()[2].Key(), \"key6\");\r\n    EXPECT_EQ(tagging2.Tags()[2].Value(), \"value6\");\r\n    EXPECT_EQ(tagging2.toQueryParameters(), \"key4=value4&key5=value5&key6=value6&key7=value7\");\r\n\r\n    tagset.push_back(Tag(\"key8\", \"\"));\r\n    tagset.push_back(Tag(\"key9\", \"value9\"));\r\n    tagging2.setTags(tagset);\r\n    EXPECT_EQ(tagging2.toQueryParameters(), \"key4=value4&key5=value5&key6=value6&key7=value7&key8&key9=value9\");\r\n\r\n    tagging2.clear();\r\n    EXPECT_EQ(tagging2.Tags().size(), 0U);\r\n    tagset.clear();\r\n    tagset.push_back(Tag(\"key10=\", \"value 10+\"));\r\n    tagset.push_back(Tag(\"key11&\", \"value11.\"));\r\n    tagging2.setTags(tagset);\r\n    EXPECT_EQ(tagging2.Tags().size(), 2U);\r\n    EXPECT_EQ(tagging2.toQueryParameters(), \"key10%3D=value%2010%2B&key11%26=value11.\");\r\n\r\n    tagging2.addTag(Tag(\"\", \"value12.\"));\r\n    EXPECT_EQ(tagging2.Tags().size(), 3U);\r\n    EXPECT_EQ(tagging2.toQueryParameters(), \"key10%3D=value%2010%2B&key11%26=value11.\");\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, GetObjectTaggingResultTest)\r\n{\r\n\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n                        <Tagging>\r\n                          <TagSet/>\r\n                          </TagSet>\r\n                        </Tagging>)\";\r\n\r\n    GetObjectTaggingResult result(xml);\r\n    EXPECT_EQ(result.Tagging().Tags().size(), 0U);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <Tagging>\r\n                <TagSet>\r\n                <Tag>\r\n                    <Key>a</Key>\r\n                    <Value>1</Value>\r\n                </Tag>\r\n                <Tag>\r\n                    <Key>b</Key>\r\n                    <Value>2</Value>\r\n                </Tag>\r\n                </TagSet>\r\n            </Tagging>)\";\r\n\r\n    GetObjectTaggingResult result1(xml);\r\n    EXPECT_EQ(result1.Tagging().Tags().size(), 2U);\r\n    EXPECT_EQ(result1.Tagging().Tags()[0].Key(), \"a\");\r\n    EXPECT_EQ(result1.Tagging().Tags()[0].Value(), \"1\");\r\n    EXPECT_EQ(result1.Tagging().Tags()[1].Key(), \"b\");\r\n    EXPECT_EQ(result1.Tagging().Tags()[1].Value(), \"2\");\r\n\r\n    GetObjectTaggingResult result2;\r\n    result2 = xml;\r\n    EXPECT_EQ(result2.Tagging().Tags().size(), 2U);\r\n    EXPECT_EQ(result2.Tagging().Tags()[0].Key(), \"a\");\r\n    EXPECT_EQ(result2.Tagging().Tags()[0].Value(), \"1\");\r\n    EXPECT_EQ(result2.Tagging().Tags()[1].Key(), \"b\");\r\n    EXPECT_EQ(result2.Tagging().Tags()[1].Value(), \"2\");\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, LifecycleRuleClassTest)\r\n{\r\n    LifecycleRule rule1;\r\n    LifecycleRule rule2;\r\n    TagSet tagset;\r\n    tagset.push_back(Tag(\"key1\", \"value1\"));\r\n    tagset.push_back(Tag(\"key2\", \"value2\"));\r\n\r\n    rule1.setTags(tagset);\r\n    EXPECT_EQ(rule1.Tags().size(), 2U);\r\n    rule1.addTag(Tag(\"key3\", \"value3\"));\r\n    EXPECT_EQ(rule1.Tags().size(), 3U);\r\n    EXPECT_EQ(rule1.Tags()[0].Key(), \"key1\");\r\n    EXPECT_EQ(rule1.Tags()[1].Key(), \"key2\");\r\n    EXPECT_EQ(rule1.Tags()[2].Key(), \"key3\");\r\n\r\n    EXPECT_FALSE(rule1 == rule2);\r\n\r\n    rule2.addTag(Tag(\"key1\", \"value1\"));\r\n    rule2.addTag(Tag(\"key2\", \"value2\"));\r\n    rule2.addTag(Tag(\"key3\", \"value3\"));\r\n    EXPECT_TRUE(rule1 == rule2);\r\n\r\n    rule2.setTags(tagset);\r\n    rule2.addTag(Tag(\"key4\", \"value3\"));\r\n    EXPECT_FALSE(rule1 == rule2);\r\n\r\n    rule2.setTags(tagset);\r\n    rule2.addTag(Tag(\"key3\", \"value4\"));\r\n    EXPECT_FALSE(rule1 == rule2);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, ObjectTaggingBasicTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"ObjectTaggingBasicTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n    auto putTaggingOutcome = Client->SetObjectTagging(SetObjectTaggingRequest(BucketName, key, tagging));\r\n    EXPECT_EQ(putTaggingOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(putTaggingOutcome.result().RequestId().size() > 0U);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 2U);\r\n    EXPECT_TRUE(getTaggingOutcome.result().RequestId().size() > 0U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n\r\n    auto delTaggingOutcome = Client->DeleteObjectTagging(DeleteObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(delTaggingOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(delTaggingOutcome.result().RequestId().size() > 0U);\r\n\r\n\r\n    getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 0U);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, ObjectTaggingNegativeTest)\r\n{\r\n    std::string key = \"invalid-key\";\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n\r\n    auto putTaggingOutcome = Client->SetObjectTagging(SetObjectTaggingRequest(\"cpp-sdk-test-invalid-bucket\", key, tagging));\r\n    EXPECT_EQ(putTaggingOutcome.isSuccess(), false);\r\n    EXPECT_TRUE(putTaggingOutcome.error().RequestId().size() > 0U);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), false);\r\n    EXPECT_TRUE(getTaggingOutcome.error().RequestId().size() > 0U);\r\n\r\n    auto delTaggingOutcome = Client->DeleteObjectTagging(DeleteObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(delTaggingOutcome.isSuccess(), false);\r\n    EXPECT_TRUE(delTaggingOutcome.error().RequestId().size() > 0U);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, SetObjectWithSpecialCharTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"SetObjectWithSpecialCharTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1=\", \"value 1+\"));\r\n    tagging.addTag(Tag(\"key2-\", \"value2.\"));\r\n    tagging.addTag(Tag(\"key3:/\", \"\"));\r\n\r\n    auto putTaggingOutcome = Client->SetObjectTagging(SetObjectTaggingRequest(BucketName, key, tagging));\r\n    EXPECT_EQ(putTaggingOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(putTaggingOutcome.result().RequestId().size() > 0);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 3U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, SetObjectWithGreaterThan10TagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"SetObjectWithGreaterThan10TagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n    tagging.addTag(Tag(\"key3\", \"value3\"));\r\n    tagging.addTag(Tag(\"key4\", \"value4\"));\r\n    tagging.addTag(Tag(\"key5\", \"value5\"));\r\n    tagging.addTag(Tag(\"key6\", \"value6\"));\r\n    tagging.addTag(Tag(\"key7\", \"value7\"));\r\n    tagging.addTag(Tag(\"key8\", \"value8\"));\r\n    tagging.addTag(Tag(\"key9\", \"value9\"));\r\n    tagging.addTag(Tag(\"key10\", \"value10\"));\r\n    tagging.addTag(Tag(\"key11\", \"value11\"));\r\n\r\n    auto putTaggingOutcome = Client->SetObjectTagging(SetObjectTaggingRequest(BucketName, key, tagging));\r\n    EXPECT_EQ(putTaggingOutcome.isSuccess(), false);\r\n    EXPECT_EQ(putTaggingOutcome.error().Code(), \"ValidateError\");\r\n    EXPECT_TRUE(putTaggingOutcome.error().Message().find(\"Object tags cannot be greater than 10\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, SetObjectWithDuplicatedTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"SetObjectWithDuplicatedTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key1\", \"value2\"));\r\n\r\n    auto putTaggingOutcome = Client->SetObjectTagging(SetObjectTaggingRequest(BucketName, key, tagging));\r\n    EXPECT_EQ(putTaggingOutcome.isSuccess(), false);\r\n    EXPECT_EQ(putTaggingOutcome.error().Code(), \"InvalidTag\");\r\n    EXPECT_TRUE(putTaggingOutcome.error().Message().find(\"Cannot provide multiple Tags with the same key\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, SetObjectWithUnsupportTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"SetObjectWithUnsupportTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1&\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    auto putTaggingOutcome = Client->SetObjectTagging(SetObjectTaggingRequest(BucketName, key, tagging));\r\n    EXPECT_EQ(putTaggingOutcome.isSuccess(), false);\r\n    EXPECT_EQ(putTaggingOutcome.error().Code(), \"InvalidTag\");\r\n    EXPECT_TRUE(putTaggingOutcome.error().Message().find(\"The TagKey you have provided is invalid\") != std::string::npos);\r\n}\r\n\r\n\r\nTEST_F(ObjectTaggingTest, PutObjectWithNormalCharTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"PutObjectWithNormalCharTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 2U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, PutObjectWithSpecialCharTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"PutObjectWithSpecialCharTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1=\", \"value 1+\"));\r\n    tagging.addTag(Tag(\"key2-\", \"value2.\"));\r\n    tagging.addTag(Tag(\"key3:/\", \"\"));\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 3U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, PutObjectWithGreaterThan10TagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"PutObjectWithGreaterThan10TagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n    tagging.addTag(Tag(\"key3\", \"value3\"));\r\n    tagging.addTag(Tag(\"key4\", \"value4\"));\r\n    tagging.addTag(Tag(\"key5\", \"value5\"));\r\n    tagging.addTag(Tag(\"key6\", \"value6\"));\r\n    tagging.addTag(Tag(\"key7\", \"value7\"));\r\n    tagging.addTag(Tag(\"key8\", \"value8\"));\r\n    tagging.addTag(Tag(\"key9\", \"value9\"));\r\n    tagging.addTag(Tag(\"key10\", \"value10\"));\r\n    tagging.addTag(Tag(\"key11\", \"value11\"));\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"BadRequest\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"Object tags cannot be greater than 10\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, PutObjectWithDuplicatedTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"PutObjectWithDuplicatedTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key1\", \"value2\"));\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"InvalidArgument\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"query parameters without tag name duplicates\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, PutObjectWithUnsupportTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"PutObjectWithUnsupportTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1&\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"InvalidTag\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"The TagKey you have provided is invalid\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, MultipartUploadWithNormalCharTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"MultipartUploadWithNormalCharTagsTest\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1=\", \"value 1+\"));\r\n    tagging.addTag(Tag(\"key2-\", \"value2.\"));\r\n    tagging.addTag(Tag(\"key3:/\", \"\"));\r\n\r\n    InitiateMultipartUploadRequest request(BucketName, key);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(initOutcome.result().RequestId().empty());\r\n\r\n    PartList partETags;\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    UploadPartRequest uRequest(BucketName, key, content);\r\n    uRequest.setPartNumber(1);\r\n    uRequest.setUploadId(initOutcome.result().UploadId());\r\n    auto uploadPartOutcome = Client->UploadPart(uRequest);\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n    EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\r\n    Part part(1, uploadPartOutcome.result().ETag());\r\n    partETags.push_back(part);\r\n\r\n    CompleteMultipartUploadRequest completeRequest(BucketName, key, partETags);\r\n    completeRequest.setUploadId(initOutcome.result().UploadId());\r\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 3U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, ResumableUploadWithNormalCharTagsByPutObjectTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"ResumableUploadWithNormalCharTagsByPutObjectTest\");\r\n    std::string file = TestUtils::GetTargetFileName(\"ResumableUploadWithNormalCharTagsByPutObjectTest\");\n    TestUtils::WriteRandomDatatoFile(file, 102400);\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    UploadObjectRequest request(BucketName, key, file);\r\n    request.setPartSize(204800U);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 2U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, ResumableUploadWithNormalCharTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"ResumableUploadWithNormalCharTagsTest\");\r\n    std::string file = TestUtils::GetTargetFileName(\"ResumableUploadWithNormalCharTagsTest\");\n    TestUtils::WriteRandomDatatoFile(file, 204800);\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    UploadObjectRequest request(BucketName, key, file);\r\n    request.setPartSize(102400U);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 2U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, ResumableUploadWithSpecialCharTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"ResumableUploadWithSpecialCharTagsTest\");\r\n    std::string file = TestUtils::GetTargetFileName(\"ResumableUploadWithSpecialCharTagsTest\");\n    TestUtils::WriteRandomDatatoFile(file, 204800);\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1=\", \"value 1+\"));\r\n    tagging.addTag(Tag(\"key2-\", \"value2.\"));\r\n    tagging.addTag(Tag(\"key3:/\", \"\"));\r\n\r\n    UploadObjectRequest request(BucketName, key, file);\r\n    request.setPartSize(102400U);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 3U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, ResumableUploadWithGreaterThan10TagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"ResumableUploadWithGreaterThan10TagsTest\");\r\n    std::string file = TestUtils::GetTargetFileName(\"ResumableUploadWithSpecialCharTagsTest\");\n    TestUtils::WriteRandomDatatoFile(file, 204800);\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n    tagging.addTag(Tag(\"key3\", \"value3\"));\r\n    tagging.addTag(Tag(\"key4\", \"value4\"));\r\n    tagging.addTag(Tag(\"key5\", \"value5\"));\r\n    tagging.addTag(Tag(\"key6\", \"value6\"));\r\n    tagging.addTag(Tag(\"key7\", \"value7\"));\r\n    tagging.addTag(Tag(\"key8\", \"value8\"));\r\n    tagging.addTag(Tag(\"key9\", \"value9\"));\r\n    tagging.addTag(Tag(\"key10\", \"value10\"));\r\n    tagging.addTag(Tag(\"key11\", \"value11\"));\r\n\r\n    UploadObjectRequest request(BucketName, key, file);\r\n    request.setPartSize(102400U);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"BadRequest\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"Object tags cannot be greater than 10\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, ResumableUploadWithDuplicatedTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"ResumableUploadWithDuplicatedTagsTest\");\r\n    std::string file = TestUtils::GetTargetFileName(\"ResumableUploadWithDuplicatedTagsTest\");\n    TestUtils::WriteRandomDatatoFile(file, 204800);\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key1\", \"value2\"));\r\n\r\n    UploadObjectRequest request(BucketName, key, file);\r\n    request.setPartSize(102400U);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"InvalidArgument\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"query parameters without tag name duplicates\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, ResumableUploadWithUnsupportTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"ResumableUploadWithUnsupportTagsTest\");\r\n    std::string file = TestUtils::GetTargetFileName(\"ResumableUploadWithUnsupportTagsTest\");\n    TestUtils::WriteRandomDatatoFile(file, 204800);\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1&\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    UploadObjectRequest request(BucketName, key, file);\r\n    request.setPartSize(102400U);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"InvalidTag\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"The TagKey you have provided is invalid\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, AppendObjectWithNormalCharTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"AppendObjectWithNormalCharTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    AppendObjectRequest request(BucketName, key, content);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->AppendObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 2U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, AppendObjectWithSpecialCharTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"AppendObjectWithSpecialCharTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1=\", \"value 1+\"));\r\n    tagging.addTag(Tag(\"key2-\", \"value2.\"));\r\n    tagging.addTag(Tag(\"key3:/\", \"\"));\r\n\r\n    AppendObjectRequest request(BucketName, key, content);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->AppendObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 3U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, AppendObjectWithGreaterThan10TagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"AppendObjectWithGreaterThan10TagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n    tagging.addTag(Tag(\"key3\", \"value3\"));\r\n    tagging.addTag(Tag(\"key4\", \"value4\"));\r\n    tagging.addTag(Tag(\"key5\", \"value5\"));\r\n    tagging.addTag(Tag(\"key6\", \"value6\"));\r\n    tagging.addTag(Tag(\"key7\", \"value7\"));\r\n    tagging.addTag(Tag(\"key8\", \"value8\"));\r\n    tagging.addTag(Tag(\"key9\", \"value9\"));\r\n    tagging.addTag(Tag(\"key10\", \"value10\"));\r\n    tagging.addTag(Tag(\"key11\", \"value11\"));\r\n\r\n    AppendObjectRequest request(BucketName, key, content);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->AppendObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"BadRequest\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"Object tags cannot be greater than 10\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, AppendObjectWithDuplicatedTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"AppendObjectWithDuplicatedTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key1\", \"value2\"));\r\n\r\n    AppendObjectRequest request(BucketName, key, content);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->AppendObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"InvalidArgument\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"query parameters without tag name duplicates\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, AppendObjectWithUnsupportTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"AppendObjectWithUnsupportTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1&\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    AppendObjectRequest request(BucketName, key, content);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->AppendObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"InvalidTag\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"The TagKey you have provided is invalid\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, CopyObjectWithDefaultTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CopyObjectWithDefaultTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto key_cp = TestUtils::GetObjectKey(\"CopyObjectWithDefaultTest-COPY\");\r\n    CopyObjectRequest cpRequest(BucketName, key_cp);\r\n    cpRequest.setCopySource(BucketName, key);\r\n    auto cpOutcome = Client->CopyObject(cpRequest);\r\n    EXPECT_EQ(cpOutcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key_cp));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 2U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n\r\n    EXPECT_EQ(outcome.result().ETag(), Client->HeadObject(BucketName, key_cp).result().ETag());\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, CopyObjectWithNormalCharTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CopyObjectWithNormalCharTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    Tagging tagging2;\r\n    tagging2.addTag(Tag(\"key1-2\", \"value1-2\"));\r\n    tagging2.addTag(Tag(\"key2-2\", \"value2-2\"));\r\n    tagging2.addTag(Tag(\"key3-2\", \"value3-2\"));\r\n\r\n    //replace\r\n    auto key_cp = TestUtils::GetObjectKey(\"CopyObjectWithNormalCharTagsTest-COPY\");\r\n    CopyObjectRequest cpRequest(BucketName, key_cp);\r\n    cpRequest.setCopySource(BucketName, key);\r\n    cpRequest.setTagging(tagging2.toQueryParameters());\r\n    cpRequest.setTaggingDirective(CopyActionList::Replace);\r\n    auto cpOutcome = Client->CopyObject(cpRequest);\r\n    EXPECT_EQ(cpOutcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key_cp));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 3U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging2.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging2.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n    EXPECT_EQ(outcome.result().ETag(), Client->HeadObject(BucketName, key_cp).result().ETag());\r\n\r\n    //copy\r\n    cpRequest.setCopySource(BucketName, key);\r\n    cpRequest.setTagging(tagging2.toQueryParameters());\r\n    cpRequest.setTaggingDirective(CopyActionList::Copy);\r\n    cpOutcome = Client->CopyObject(cpRequest);\r\n    EXPECT_EQ(cpOutcome.isSuccess(), true);\r\n\r\n    getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key_cp));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 2U);\r\n\r\n    i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n    EXPECT_EQ(outcome.result().ETag(), Client->HeadObject(BucketName, key_cp).result().ETag());\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, CopyObjectWithSpecialCharTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CopyObjectWithSpecialCharTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n\r\n    auto outcome = Client->PutObject(PutObjectRequest(BucketName, key, content));\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1=\", \"value 1+\"));\r\n    tagging.addTag(Tag(\"key2-\", \"value2.\"));\r\n    tagging.addTag(Tag(\"key3:/\", \"\"));\r\n\r\n    //replace\r\n    auto key_cp = TestUtils::GetObjectKey(\"CopyObjectWithSpecialCharTagsTest-COPY\");\r\n    CopyObjectRequest cpRequest(BucketName, key_cp);\r\n    cpRequest.setCopySource(BucketName, key);\r\n    cpRequest.setTagging(tagging.toQueryParameters());\r\n    cpRequest.setTaggingDirective(CopyActionList::Replace);\r\n    auto cpOutcome = Client->CopyObject(cpRequest);\r\n    EXPECT_EQ(cpOutcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key_cp));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 3U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n    EXPECT_EQ(outcome.result().ETag(), Client->HeadObject(BucketName, key_cp).result().ETag());\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, CopyObjectWithGreaterThan10TagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CopyObjectWithGreaterThan10TagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n\r\n    auto putOutcome = Client->PutObject(PutObjectRequest(BucketName, key, content));\r\n    EXPECT_EQ(putOutcome.isSuccess(), true);\r\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n    tagging.addTag(Tag(\"key3\", \"value3\"));\r\n    tagging.addTag(Tag(\"key4\", \"value4\"));\r\n    tagging.addTag(Tag(\"key5\", \"value5\"));\r\n    tagging.addTag(Tag(\"key6\", \"value6\"));\r\n    tagging.addTag(Tag(\"key7\", \"value7\"));\r\n    tagging.addTag(Tag(\"key8\", \"value8\"));\r\n    tagging.addTag(Tag(\"key9\", \"value9\"));\r\n    tagging.addTag(Tag(\"key10\", \"value10\"));\r\n    tagging.addTag(Tag(\"key11\", \"value11\"));\r\n\r\n    //replace\r\n    auto key_cp = TestUtils::GetObjectKey(\"CopyObjectWithGreaterThan10TagsTest-COPY\");\r\n    CopyObjectRequest cpRequest(BucketName, key_cp);\r\n    cpRequest.setCopySource(BucketName, key);\r\n    cpRequest.setTagging(tagging.toQueryParameters());\r\n    cpRequest.setTaggingDirective(CopyActionList::Replace);\r\n    auto outcome = Client->CopyObject(cpRequest);    \r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"BadRequest\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"Object tags cannot be greater than 10\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, CopyObjectWithDuplicatedTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CopyObjectWithDuplicatedTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n\r\n    auto putOutcome = Client->PutObject(PutObjectRequest(BucketName, key, content));\r\n    EXPECT_EQ(putOutcome.isSuccess(), true);\r\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key1\", \"value2\"));\r\n\r\n    //replace\r\n    auto key_cp = TestUtils::GetObjectKey(\"CopyObjectWithDuplicatedTagsTest-COPY\");\r\n    CopyObjectRequest cpRequest(BucketName, key_cp);\r\n    cpRequest.setCopySource(BucketName, key);\r\n    cpRequest.setTagging(tagging.toQueryParameters());\r\n    cpRequest.setTaggingDirective(CopyActionList::Replace);\r\n    auto outcome = Client->CopyObject(cpRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"InvalidArgument\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"query parameters without tag name duplicates\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, CopyObjectWithUnsupportTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CopyObjectWithUnsupportTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n\r\n    auto putOutcome = Client->PutObject(PutObjectRequest(BucketName, key, content));\r\n    EXPECT_EQ(putOutcome.isSuccess(), true);\r\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1&\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    //replace\r\n    auto key_cp = TestUtils::GetObjectKey(\"CopyObjectWithUnsupportTagsTest-COPY\");\r\n    CopyObjectRequest cpRequest(BucketName, key_cp);\r\n    cpRequest.setCopySource(BucketName, key);\r\n    cpRequest.setTagging(tagging.toQueryParameters());\r\n    cpRequest.setTaggingDirective(CopyActionList::Replace);\r\n    auto outcome = Client->CopyObject(cpRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"InvalidTag\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"The TagKey you have provided is invalid\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, CreateSymlinkWithDefaultTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CreateSymlinkWithDefaultTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    request.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->PutObject(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto key_ln = TestUtils::GetObjectKey(\"CreateSymlinkWithDefaultTest-LINK\");\r\n    CreateSymlinkRequest csRequest(BucketName, key_ln);\r\n    csRequest.SetSymlinkTarget(key);\r\n    auto csOutcome = Client->CreateSymlink(csRequest);\r\n    EXPECT_EQ(csOutcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key_ln));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 0U);\r\n\r\n    EXPECT_EQ(outcome.result().ETag(), Client->HeadObject(BucketName, key_ln).result().ETag());\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, CreateSymlinkWithNormalCharTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CreateSymlinkWithNormalCharTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n\r\n    auto outcome = Client->PutObject(PutObjectRequest(BucketName, key, content));\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    auto key_ln = TestUtils::GetObjectKey(\"CreateSymlinkWithNormalCharTagsTest-LINK\");\r\n    CreateSymlinkRequest csRequest(BucketName, key_ln);\r\n    csRequest.SetSymlinkTarget(key);\r\n    csRequest.setTagging(tagging.toQueryParameters());\r\n    auto csOutcome = Client->CreateSymlink(csRequest);\r\n    EXPECT_EQ(csOutcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key_ln));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 2U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n    EXPECT_EQ(outcome.result().ETag(), Client->HeadObject(BucketName, key_ln).result().ETag());\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, CreateSymlinkWithSpecialCharTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CreateSymlinkWithSpecialCharTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n\r\n    auto outcome = Client->PutObject(PutObjectRequest(BucketName, key, content));\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1=\", \"value 1+\"));\r\n    tagging.addTag(Tag(\"key2-\", \"value2.\"));\r\n    tagging.addTag(Tag(\"key3:/\", \"\"));\r\n\r\n    auto key_ln = TestUtils::GetObjectKey(\"CreateSymlinkWithSpecialCharTagsTest-LINK\");\r\n    CreateSymlinkRequest csRequest(BucketName, key_ln);\r\n    csRequest.SetSymlinkTarget(key);\r\n    csRequest.setTagging(tagging.toQueryParameters());\r\n    auto csOutcome = Client->CreateSymlink(csRequest);\r\n    EXPECT_EQ(csOutcome.isSuccess(), true);\r\n\r\n    auto getTaggingOutcome = Client->GetObjectTagging(GetObjectTaggingRequest(BucketName, key_ln));\r\n    EXPECT_EQ(getTaggingOutcome.isSuccess(), true);\r\n    EXPECT_EQ(getTaggingOutcome.result().Tagging().Tags().size(), 3U);\r\n\r\n    size_t i = 0;\r\n    for (const auto& tag : getTaggingOutcome.result().Tagging().Tags()) {\r\n        EXPECT_EQ(tagging.Tags()[i].Key(), tag.Key());\r\n        EXPECT_EQ(tagging.Tags()[i].Value(), tag.Value());\r\n        i++;\r\n    }\r\n\r\n    EXPECT_EQ(outcome.result().ETag(), Client->HeadObject(BucketName, key_ln).result().ETag());\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, CreateSymlinkWithGreaterThan10TagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CreateSymlinkWithGreaterThan10TagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n\r\n    auto putOutcome = Client->PutObject(PutObjectRequest(BucketName, key, content));\r\n    EXPECT_EQ(putOutcome.isSuccess(), true);\r\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n    tagging.addTag(Tag(\"key3\", \"value3\"));\r\n    tagging.addTag(Tag(\"key4\", \"value4\"));\r\n    tagging.addTag(Tag(\"key5\", \"value5\"));\r\n    tagging.addTag(Tag(\"key6\", \"value6\"));\r\n    tagging.addTag(Tag(\"key7\", \"value7\"));\r\n    tagging.addTag(Tag(\"key8\", \"value8\"));\r\n    tagging.addTag(Tag(\"key9\", \"value9\"));\r\n    tagging.addTag(Tag(\"key10\", \"value10\"));\r\n    tagging.addTag(Tag(\"key11\", \"value11\"));\r\n\r\n    auto key_ln = TestUtils::GetObjectKey(\"CreateSymlinkWithGreaterThan10TagsTest-LINK\");\r\n    CreateSymlinkRequest csRequest(BucketName, key_ln);\r\n    csRequest.SetSymlinkTarget(key);\r\n    csRequest.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->CreateSymlink(csRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"BadRequest\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"Object tags cannot be greater than 10\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, CreateSymlinkWithDuplicatedTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CreateSymlinkWithDuplicatedTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n\r\n    auto putOutcome = Client->PutObject(PutObjectRequest(BucketName, key, content));\r\n    EXPECT_EQ(putOutcome.isSuccess(), true);\r\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key1\", \"value2\"));\r\n\r\n    auto key_ln = TestUtils::GetObjectKey(\"CreateSymlinkWithDuplicatedTagsTest-LINK\");\r\n    CreateSymlinkRequest csRequest(BucketName, key_ln);\r\n    csRequest.SetSymlinkTarget(key);\r\n    csRequest.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->CreateSymlink(csRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"InvalidArgument\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"query parameters without tag name duplicates\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, CreateSymlinkWithUnsupportTagsTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"CreateSymlinkWithDuplicatedTagsTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"Tagging Test\");\r\n\r\n    auto putOutcome = Client->PutObject(PutObjectRequest(BucketName, key, content));\r\n    EXPECT_EQ(putOutcome.isSuccess(), true);\r\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1&\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    auto key_ln = TestUtils::GetObjectKey(\"CreateSymlinkWithDuplicatedTagsTest-LINK\");\r\n    CreateSymlinkRequest csRequest(BucketName, key_ln);\r\n    csRequest.SetSymlinkTarget(key);\r\n    csRequest.setTagging(tagging.toQueryParameters());\r\n    auto outcome = Client->CreateSymlink(csRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"InvalidTag\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"The TagKey you have provided is invalid\") != std::string::npos);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, LifecycleNormalCharTagsTest)\r\n{\r\n    auto rule = LifecycleRule();\r\n    rule.setID(\"StandardExpireRule-001\");\r\n    rule.setPrefix(\"test\");\r\n    rule.addTag(Tag(\"key1\", \"value1\"));\r\n    rule.addTag(Tag(\"key2\", \"value2\"));\r\n    rule.setStatus(RuleStatus::Enabled);\r\n    rule.Expiration().setDays(200);\r\n\r\n    SetBucketLifecycleRequest request(BucketName);\r\n    request.addLifecycleRule(rule);\r\n    auto outcome = Client->SetBucketLifecycle(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    TestUtils::WaitForCacheExpire(5);\r\n    auto gOutcome = Client->GetBucketLifecycle(BucketName);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(*(gOutcome.result().LifecycleRules().begin()) == rule);\r\n}\r\n\r\n\r\nTEST_F(ObjectTaggingTest, LifecycleWithSpecialCharTagsTest)\r\n{\r\n    TagSet tagSet;\r\n    tagSet.push_back(Tag(\"key1=\", \"value 1+\"));\r\n    tagSet.push_back(Tag(\"key2-\", \"value2.\"));\r\n    tagSet.push_back(Tag(\"key3:/\", \"\"));\r\n\r\n    auto rule = LifecycleRule();\r\n    rule.setID(\"StandardExpireRule-001\");\r\n    rule.setPrefix(\"test\");\r\n    rule.setStatus(RuleStatus::Enabled);\r\n    rule.Expiration().setDays(200);\r\n    rule.setTags(tagSet);\r\n\r\n    SetBucketLifecycleRequest request(BucketName);\r\n    request.addLifecycleRule(rule);\r\n    auto outcome = Client->SetBucketLifecycle(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    TestUtils::WaitForCacheExpire(5);\r\n    auto gOutcome = Client->GetBucketLifecycle(BucketName);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(*(gOutcome.result().LifecycleRules().begin()) == rule);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, LifecycleWithGreaterThan10TagsTest)\r\n{\r\n    TagSet tagSet;\r\n    tagSet.push_back(Tag(\"key1\", \"value1\"));\r\n    tagSet.push_back(Tag(\"key2\", \"value2\"));\r\n    tagSet.push_back(Tag(\"key3\", \"value3\"));\r\n    tagSet.push_back(Tag(\"key4\", \"value4\"));\r\n    tagSet.push_back(Tag(\"key5\", \"value5\"));\r\n    tagSet.push_back(Tag(\"key6\", \"value6\"));\r\n    tagSet.push_back(Tag(\"key7\", \"value7\"));\r\n    tagSet.push_back(Tag(\"key8\", \"value8\"));\r\n    tagSet.push_back(Tag(\"key9\", \"value9\"));\r\n    tagSet.push_back(Tag(\"key10\", \"value10\"));\r\n    tagSet.push_back(Tag(\"key11\", \"value11\"));\r\n\r\n    auto rule = LifecycleRule();\r\n    rule.setID(\"StandardExpireRule-001\");\r\n    rule.setPrefix(\"test\");\r\n    rule.setStatus(RuleStatus::Enabled);\r\n    rule.Expiration().setDays(200);\r\n    rule.setTags(tagSet);\r\n\r\n    SetBucketLifecycleRequest request(BucketName);\r\n    request.addLifecycleRule(rule);\r\n    auto outcome = Client->SetBucketLifecycle(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    TestUtils::WaitForCacheExpire(5);\r\n    auto gOutcome = Client->GetBucketLifecycle(BucketName);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_TRUE(*(gOutcome.result().LifecycleRules().begin()) == rule);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, LifecycleWithDuplicatedTagsTest)\r\n{\r\n    TagSet tagSet;\r\n    tagSet.push_back(Tag(\"key1\", \"value1\"));\r\n    tagSet.push_back(Tag(\"key1\", \"value2\"));\r\n\r\n    auto rule = LifecycleRule();\r\n    rule.setID(\"StandardExpireRule-001\");\r\n    rule.setPrefix(\"test\");\r\n    rule.setStatus(RuleStatus::Enabled);\r\n    rule.Expiration().setDays(200);\r\n    rule.setTags(tagSet);\r\n\r\n    SetBucketLifecycleRequest request(BucketName);\r\n    request.addLifecycleRule(rule);\r\n    auto outcome = Client->SetBucketLifecycle(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"MalformedXML\");\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, LifecycleWithUnsupportTagsTest)\r\n{\r\n    TagSet tagSet;\r\n    tagSet.push_back(Tag(\"key1&\", \"value1\"));\r\n    tagSet.push_back(Tag(\"key2\", \"value2\"));\r\n\r\n    auto rule = LifecycleRule();\r\n    rule.setID(\"StandardExpireRule-001\");\r\n    rule.setPrefix(\"test\");\r\n    rule.setStatus(RuleStatus::Enabled);\r\n    rule.Expiration().setDays(200);\r\n    rule.setTags(tagSet);\r\n\r\n    SetBucketLifecycleRequest request(BucketName);\r\n    request.addLifecycleRule(rule);\r\n    auto outcome = Client->SetBucketLifecycle(request);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"MalformedXML\");\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, SetObjectTaggingRequestFunctionTest)\r\n{\r\n    SetObjectTaggingRequest request(\"INVALIDNAME\", \"test\");\r\n\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    request.setTagging(tagging);\r\n\r\n    auto outcome = Client->SetObjectTagging(request);\r\n\r\n    SetObjectTaggingRequest request2(\"test1\", \"test2\");\r\n\r\n    Tag tag;\r\n    tagging.addTag(tag);\r\n    request2.setTagging(tagging);\r\n\r\n    outcome = Client->SetObjectTagging(request2);\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, GetObjectTaggingWithInvalidResponseBodyTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectTaggingWithInvalidResponseBodyTest\");\r\n    auto putOutcome = Client->PutObject(PutObjectRequest(BucketName, key, std::make_shared<std::stringstream>(\"hellowworld\")));\r\n    EXPECT_EQ(putOutcome.isSuccess(), true);\r\n\r\n    SetObjectTaggingRequest request(BucketName, key);\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n    request.setTagging(tagging);\r\n    auto outcome = Client->SetObjectTagging(request);\r\n\r\n\r\n    GetObjectTaggingRequest gotRequest(BucketName, key);\r\n    gotRequest.setResponseStreamFactory([=]() {\r\n        auto content = std::make_shared<std::stringstream>();\r\n        content->write(\"invlid data\", 11);\r\n        return content;\r\n    });\r\n    auto gotlOutcome = Client->GetObjectTagging(gotRequest);\r\n    EXPECT_EQ(gotlOutcome.isSuccess(), false);\r\n    EXPECT_EQ(gotlOutcome.error().Code(), \"ParseXMLError\");\r\n}\r\n\r\nTEST_F(ObjectTaggingTest, GetObjectTaggingResultBranchTest)\r\n{\r\n    std::string xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <Tagg>\r\n                <TagSet>\r\n                <Tag>\r\n                    <Key>a</Key>\r\n                    <Value>1</Value>\r\n                </Tag>\r\n                <Tag>\r\n                    <Key>b</Key>\r\n                    <Value>2</Value>\r\n                </Tag>\r\n                </TagSet>\r\n            </Tagg>)\";\r\n\r\n    GetObjectTaggingResult result1(std::make_shared<std::stringstream>(xml));\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <Tagging>\r\n                <Tag>\r\n                    <Key>a</Key>\r\n                    <Value>1</Value>\r\n                </Tag>\r\n                <Tag>\r\n                    <Key>b</Key>\r\n                    <Value>2</Value>\r\n                </Tag>\r\n            </Tagging>)\";\r\n\r\n    GetObjectTaggingResult result2(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <Tagging>\r\n                <TagSet>\r\n\r\n                </TagSet>\r\n            </Tagging>)\";\r\n\r\n    GetObjectTaggingResult result3(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <Tagging>\r\n                <TagSet>\r\n                <Tag>\r\n                </Tag>\r\n                </TagSet>\r\n            </Tagging>)\";\r\n\r\n    GetObjectTaggingResult result4(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n            <Tagging>\r\n                <TagSet>\r\n                <Tag>\r\n                    <Key></Key>\r\n                    <Value></Value>\r\n                </Tag>\r\n                </TagSet>\r\n            </Tagging>)\";\r\n\r\n    GetObjectTaggingResult result5(xml);\r\n\r\n    xml = R\"(<?xml version=\"1.0\" encoding=\"UTF-8\"?>)\";\r\n    GetObjectTaggingResult result6(xml);\r\n\r\n}\r\n\r\n}\r\n}\r\n"
  },
  {
    "path": "test/src/Object/ObjectTrafficLimitTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include <fstream>\n#include <src/utils/Utils.h>\n#include <src/utils/FileSystemUtils.h>\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass ObjectTrafficLimitTest : public ::testing::Test {\nprotected:\n    ObjectTrafficLimitTest()\n    {\n    }\n\n    ~ObjectTrafficLimitTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase() \n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-object-traffic-limit\");\n        auto outcome1 = Client->CreateBucket(CreateBucketRequest(BucketName));\n        BucketName1 = TestUtils::GetBucketName(\"cpp-sdk-object-copy-object\");\n        Client->CreateBucket(CreateBucketRequest(BucketName1));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase() \n    {\n        TestUtils::CleanBucket(*Client, BucketName);\n        TestUtils::CleanBucket(*Client, BucketName1);\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\n\n    static int64_t GetExpiresDelayS(int64_t value)\n    {\n        auto tp = std::chrono::time_point_cast<std::chrono::seconds>(std::chrono::system_clock::now());\n        return tp.time_since_epoch().count() + value;\n    }\n\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n    static std::string BucketName1;\n    class Timer\n    {\n    public:\n        Timer() : begin_(std::chrono::high_resolution_clock::now()) {}\n        void reset() { begin_ = std::chrono::high_resolution_clock::now(); }\n        int64_t elapsed() const\n        {\n            return std::chrono::duration_cast<std::chrono::seconds>(std::chrono::high_resolution_clock::now() - begin_).count();\n        }\n    private:\n        std::chrono::time_point<std::chrono::high_resolution_clock> begin_;\n    };\n};\n\nstd::shared_ptr<OssClient> ObjectTrafficLimitTest::Client = nullptr;\nstd::string ObjectTrafficLimitTest::BucketName = \"\";\nstd::string ObjectTrafficLimitTest::BucketName1 = \"\";\n\n\nTEST_F(ObjectTrafficLimitTest, PutAndGetObject)\n{\n    Timer timer;\n    std::string key = TestUtils::GetObjectKey(\"PutAndGetObject\");\n    /*set content 800 KB*/\n    auto content = TestUtils::GetRandomStream(800*1024);\n\n    PutObjectRequest putrequest(BucketName, key, content);\n    /* set upload traffic limit 100KB/s*/\n    putrequest.setTrafficLimit(819200*2);\n    auto theory_time = (800 * 1024 * 8) / (819200*2);\n    timer.reset();\n    auto pOutcome = Client->PutObject(putrequest);\n    auto diff_put = timer.elapsed();\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    EXPECT_NEAR((double)diff_put, (double)theory_time, 1.0);\n\n    GetObjectRequest getrequest(BucketName, key);\n    getrequest.setTrafficLimit(8192000);\n    auto outome = Client->GetObject(getrequest);\n    EXPECT_EQ(outome.isSuccess(), true);\n    auto responseHeader = outome.result().Metadata().HttpMetaData();\n    EXPECT_EQ(responseHeader.find(\"x-oss-qos-delay-time\") != responseHeader.end(), true);\n    DeleteObjectRequest delRequest(BucketName, key);\n    auto delOutcome = Client->DeleteObject(delRequest);\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n}\n\nTEST_F(ObjectTrafficLimitTest, AppendObjectTest)\n{\n    Timer timer;\n    std::string key = TestUtils::GetObjectKey(\"AppendObjectTest\");\n    /*set content 4800 KB*/\n    auto content = TestUtils::GetRandomStream(800 * 1024);\n\n    AppendObjectRequest apprequest(BucketName, key, content);\n    /* set append traffic limit 100KB/s*/\n    apprequest.setTrafficLimit(819200);\n    auto theory_time = (800 * 1024 * 8) / (819200);\n    timer.reset();\n    auto pOutcome = Client->AppendObject(apprequest);\n    auto time = timer.elapsed();\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n    EXPECT_NEAR((double)time, (double)theory_time, 1.0);\n\n    DeleteObjectRequest delRequest(BucketName, key);\n    auto delOutcome = Client->DeleteObject(delRequest);\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n}\n       \nTEST_F(ObjectTrafficLimitTest, CopyObjectTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"CopyObjectTest\");\n    /*set content 4800 KB*/\n    auto content = TestUtils::GetRandomStream(4800 * 1024);\n\n    PutObjectRequest putrequest(BucketName, key, content);\n    auto pOutcome = Client->PutObject(putrequest);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    std::string objName2 = TestUtils::GetObjectKey(\"test-cpp-sdk-objectcopy\");\n    CopyObjectRequest copyRequest(BucketName1, objName2);\n    copyRequest.setCopySource(BucketName, key);\n    /* set copy traffic limit 800KB/s*/\n    copyRequest.setTrafficLimit(819200*8);\n    //auto theory_time = (4800 * 1024 * 8) / (819200 * 8);\n    Timer timer;\n    timer.reset();\n    /*begin copy object*/\n    CopyObjectOutcome copyOutCome = Client->CopyObject(copyRequest);\n    //auto time = timer.elapsed();\n    EXPECT_EQ(copyOutCome.isSuccess(), true);\n\n    DeleteObjectRequest delRequest(BucketName, key);\n    auto delOutcome = Client->DeleteObject(delRequest);\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n\n    DeleteObjectRequest delRequest1(BucketName1, objName2);\n    auto delOutcome1 = Client->DeleteObject(delRequest1);\n    EXPECT_EQ(delOutcome1.isSuccess(), true);\n}\n\nTEST_F(ObjectTrafficLimitTest, UploadPartTest)\n{\n    auto key = TestUtils::GetObjectKey(\"InitiateMultipartUploadTest\");\n    InitiateMultipartUploadRequest request(BucketName, key);\n\n    auto initOutcome = Client->InitiateMultipartUpload(request);\n    EXPECT_EQ(initOutcome.isSuccess(), true);\n    EXPECT_EQ(initOutcome.result().Key(), key);\n\n    /*set content 4800 KB*/\n    auto content = TestUtils::GetRandomStream(4800 * 1024);\n    UploadPartRequest uprequest(BucketName, key, 1, initOutcome.result().UploadId(), content);\n    /* set UploadPart traffic limit 800KB/s*/\n    uprequest.setTrafficLimit(819200*8);\n    auto theory_time = (4800 * 1024 * 8) / (819200 * 8);\n    Timer timer;\n    timer.reset();\n    auto uploadPartOutcome = Client->UploadPart(uprequest);\n    auto time = timer.elapsed();\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\n    EXPECT_NEAR((double)time, (double)theory_time, 1.0);\n\n    auto lOutcome = Client->ListParts(ListPartsRequest(BucketName, key, initOutcome.result().UploadId()));\n    EXPECT_EQ(lOutcome.isSuccess(), true);\n\n    CompleteMultipartUploadRequest cRequest(BucketName, key,\n        lOutcome.result().PartList(), initOutcome.result().UploadId());\n\n    auto outcome = Client->CompleteMultipartUpload(cRequest);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    DeleteObjectRequest delRequest(BucketName, key);\n    auto delOutcome = Client->DeleteObject(delRequest);\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n}\n\nTEST_F(ObjectTrafficLimitTest, UploadPartCopyTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"UploadPartCopyTest\");\n    /*set content 1200 KB*/\n    auto content = TestUtils::GetRandomStream(1200 * 1024);\n\n    PutObjectRequest putrequest(BucketName, key, content);\n    auto pOutcome = Client->PutObject(putrequest);\n    EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    //get target object name*/\n    auto targetObjectKey = TestUtils::GetObjectKey(\"MultipartUploadPartCopyComplexStepTest\");\n\n    InitiateMultipartUploadRequest imuRequest(BucketName, targetObjectKey);\n    auto initOutcome = Client->InitiateMultipartUpload(imuRequest);\n    EXPECT_EQ(initOutcome.isSuccess(), true);\n\n    //Set the part size \n    const int partSize = 600 * 1024;\n    const int64_t fileLength = 1200 * 1024;\n\n    auto partCount = 2;\n    for (auto i = 0; i < partCount; i++)\n    {\n        // Skip to the start position\n        int64_t skipBytes = partSize * i;\n        int64_t position = skipBytes;\n\n        // calculate the part size\n        auto size = partSize < (fileLength - skipBytes) ? partSize : fileLength - skipBytes;\n\n        UploadPartCopyRequest request(BucketName, targetObjectKey, BucketName, key);\n        request.setPartNumber(i + 1);\n        request.setUploadId(initOutcome.result().UploadId());\n        request.setCopySourceRange(position, position + size - 1);\n        request.setTrafficLimit(819200*6);\n        //auto theory_time = (600 * 1024 * 8) / (819200 * 6);\n        Timer timer;\n        timer.reset();\n        auto uploadPartOutcome = Client->UploadPartCopy(request);\n        //auto time = timer.elapsed();\n        //EXPECT_EQ(time, theory_time);\n        EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\n        EXPECT_FALSE(uploadPartOutcome.result().RequestId().empty());\n    }\n\n    auto lmuOutcome = Client->ListMultipartUploads(ListMultipartUploadsRequest(BucketName));\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\n\n    std::string uploadId;\n\n    for (auto const& upload : lmuOutcome.result().MultipartUploadList())\n    {\n        if (upload.UploadId == initOutcome.result().UploadId())\n        {\n            uploadId = upload.UploadId;\n        }\n    }\n    EXPECT_EQ(uploadId.empty(), false);\n\n    ListPartsRequest listRequest(BucketName, targetObjectKey);\n    listRequest.setUploadId(uploadId);\n    auto listOutcome = Client->ListParts(listRequest);\n    EXPECT_EQ(listOutcome.isSuccess(), true);\n\n    CompleteMultipartUploadRequest completeRequest(BucketName, targetObjectKey, listOutcome.result().PartList());\n    completeRequest.setUploadId(uploadId);\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest);\n    EXPECT_EQ(cOutcome.isSuccess(), true);\n\n    DeleteObjectRequest delRequest(BucketName, key);\n    auto delOutcome = Client->DeleteObject(delRequest);\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n\n    DeleteObjectRequest delRequest1(BucketName, targetObjectKey);\n    auto delOutcome1 = Client->DeleteObject(delRequest1);\n    EXPECT_EQ(delOutcome1.isSuccess(), true);\n}\n\nTEST_F(ObjectTrafficLimitTest, ResumableUploadObjectTest)\n{\n\n    std::string key = TestUtils::GetObjectKey(\"ResumableUploadObjectUnderPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableUploadObjectUnderPartSize\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1200 * 1024);\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(1200 * 1024);\n    request.setThreadNum(1);\n    request.setTrafficLimit(819200 * 6);\n    auto theory_time = (1200 * 1024 * 8) / (819200 * 6);\n    Timer timer;\n    timer.reset();\n    auto outcome = Client->ResumableUploadObject(request);\n    auto time = timer.elapsed();\n    EXPECT_NEAR((double)time, (double)theory_time, 1.0);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    auto getObjectOutcome = Client->GetObject(BucketName, key);\n    EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n\n    DeleteObjectRequest delRequest(BucketName, key);\n    auto delOutcome = Client->DeleteObject(delRequest);\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n}\n\nTEST_F(ObjectTrafficLimitTest, ResumableDownloadObjectMultipartTest)\n{\n    // upload object\n    std::string key = TestUtils::GetObjectKey(\"UnnormalResumableDownloadObjectWithDisableRequest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalResumableDownloadObjectWithDisableRequest\").append(\".tmp\");\n    std::string targetKey = TestUtils::GetObjectKey(\"UnnormalResumableDownloadTargetObject\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 4800 * 1024);\n    auto putObjectOutcome = Client->PutObject(BucketName, key, tmpFile);\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n\n    DownloadObjectRequest request(BucketName, key, targetKey);\n    request.setPartSize(1200 * 1024);\n    request.setThreadNum(1);\n    request.setTrafficLimit(819200 * 6);\n    auto theory_time = (4800 * 1024 * 8) / (819200 * 6);\n    Timer timer;\n    timer.reset();\n    auto outcome = Client->ResumableDownloadObject(request);\n    auto time = timer.elapsed();\n    EXPECT_NEAR((double)time, (double)theory_time,1.0);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    DeleteObjectRequest delRequest(BucketName, key);\n    auto delOutcome = Client->DeleteObject(delRequest);\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n\n}\n\nTEST_F(ObjectTrafficLimitTest, ResumableUploadObjectMultipartTest)\n{\n\n    std::string key = TestUtils::GetObjectKey(\"ResumableUploadObjectUnderPartSize\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableUploadObjectUnderPartSize\").append(\".tmp\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1800 * 1024);\n\n    UploadObjectRequest request(BucketName, key, tmpFile);\n    request.setPartSize(1200 * 1024);\n    request.setThreadNum(1);\n    request.setTrafficLimit(819200 * 2);\n    auto theory_time = (1800 * 1024 * 8) / (819200 * 2);\n    Timer timer;\n    timer.reset();\n    auto outcome = Client->ResumableUploadObject(request);\n    auto time = timer.elapsed();\n    EXPECT_NEAR((double)time, (double)theory_time, 2.0);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    auto getObjectOutcome = Client->GetObject(BucketName, key);\n    EXPECT_EQ(getObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(RemoveFile(tmpFile), true);\n\n    DeleteObjectRequest delRequest(BucketName, key);\n    auto delOutcome = Client->DeleteObject(delRequest);\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n}\n\nTEST_F(ObjectTrafficLimitTest, ResumableDownloadObjectTest)\n{\n    // upload object\n    std::string key = TestUtils::GetObjectKey(\"UnnormalResumableDownloadObjectWithDisableRequest\");\n    std::string tmpFile = TestUtils::GetTargetFileName(\"UnnormalResumableDownloadObjectWithDisableRequest\").append(\".tmp\");\n    std::string targetKey = TestUtils::GetObjectKey(\"UnnormalResumableDownloadTargetObject\");\n    TestUtils::WriteRandomDatatoFile(tmpFile, 600 * 1024);\n    auto putObjectOutcome = Client->PutObject(BucketName, key, tmpFile);\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n\n    DownloadObjectRequest request(BucketName, key, targetKey);\n    request.setPartSize(1200 * 1024);\n    request.setThreadNum(1);\n    request.setTrafficLimit(819200);\n    auto theory_time = (600 * 1024 * 8) / (819200);\n    Timer timer;\n    timer.reset();\n    auto outcome = Client->ResumableDownloadObject(request);\n    auto time = timer.elapsed();\n    EXPECT_NEAR((double)time, (double)theory_time, 1.0);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    DeleteObjectRequest delRequest(BucketName, key);\n    auto delOutcome = Client->DeleteObject(delRequest);\n    EXPECT_EQ(delOutcome.isSuccess(), true);\n}\n\nTEST_F(ObjectTrafficLimitTest, PutAndGetObjectWithPreSignedUriTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithPreSignedUriAndCrc\");\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(1024);\n\n    GeneratePresignedUrlRequest putrequest(BucketName, key, Http::Put);\n    putrequest.setExpires(GetExpiresDelayS(120));\n    putrequest.setTrafficLimit(819200);\n    auto urlOutcome = Client->GeneratePresignedUrl(putrequest);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n    EXPECT_TRUE(urlOutcome.result().find(\"x-oss-traffic-limit=819200\") != std::string::npos);\n\n    auto pOutcome = Client->PutObjectByUrl(urlOutcome.result(), content);\n    //EXPECT_EQ(pOutcome.isSuccess(), true);\n\n    GeneratePresignedUrlRequest getrequest(BucketName, key, Http::Get);\n    getrequest.setExpires(GetExpiresDelayS(120));\n    getrequest.setTrafficLimit(819201);\n    urlOutcome = Client->GeneratePresignedUrl(getrequest);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n    EXPECT_TRUE(urlOutcome.result().find(\"x-oss-traffic-limit=819201\") != std::string::npos);\n\n    auto gOutcome = Client->GetObjectByUrl(urlOutcome.result());\n    //EXPECT_EQ(gOutcome.isSuccess(), true);\n}\n\nTEST_F(ObjectTrafficLimitTest, NormalResumableCopyWithSizelessPartSizeTest)\n{\n    std::string sourceKey = TestUtils::GetObjectKey(\"NormalCopySourceObjectOverPartSize\");\n    std::string targetKey = TestUtils::GetObjectKey(\"NormalCopyTargetObjectOverPartSize\");\n    // put object into bucket\n    auto putObjectContent = TestUtils::GetRandomStream(102400 - 2);\n    auto putObjectOutcome = Client->PutObject(PutObjectRequest(BucketName, sourceKey, putObjectContent));\n    EXPECT_EQ(putObjectOutcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, sourceKey), true);\n\n    // Copy Object\n    MultiCopyObjectRequest request(BucketName, targetKey, BucketName, sourceKey);\n    request.setPartSize(100 * 1024);\n    request.setThreadNum(1);\n    request.setTrafficLimit(819201);\n    auto outcome = Client->ResumableCopyObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, targetKey), true);\n}\n}\n}"
  },
  {
    "path": "test/src/Object/ObjectVersioningTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include \"src/utils/FileSystemUtils.h\"\r\n#include <fstream>\r\n\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass ObjectVersioningTest : public ::testing::Test {\r\nprotected:\r\n    ObjectVersioningTest()\r\n    {\r\n    }\r\n\r\n    ~ObjectVersioningTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase() \r\n    {\r\n        Client = TestUtils::GetOssClientDefault();\r\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-objectversioning\");\r\n        Client->CreateBucket(CreateBucketRequest(BucketName));\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase() \r\n    {\r\n        TestUtils::CleanBucketVersioning(*Client, BucketName);\r\n        Client = nullptr;\r\n    }\r\n\r\n    // Sets up the test fixture.\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    // Tears down the test fixture.\r\n    void TearDown() override\r\n    {\r\n    }\r\n\r\npublic:\r\n    static std::shared_ptr<OssClient> Client;\r\n    static std::string BucketName;\r\n};\r\n\r\nstd::shared_ptr<OssClient> ObjectVersioningTest::Client = nullptr;\r\nstd::string ObjectVersioningTest::BucketName = \"\";\r\n\r\nTEST_F(ObjectVersioningTest, ObjectBasicWithVersioningEnableTest)\r\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    //test put, get, head and getmeta \r\n    auto content1 = std::make_shared<std::stringstream>(\"versioning test 1.\");\r\n    auto content2 = std::make_shared<std::stringstream>(\"versioning test 2.\");\r\n    auto etag1 = ComputeContentETag(*content1);\r\n    auto etag2 = ComputeContentETag(*content2);\r\n    auto key = TestUtils::GetObjectKey(\"ObjectBasicWithVersioningEnableTest\");\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content1);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId1 = pOutcome.result().VersionId();\r\n\r\n    pOutcome = Client->PutObject(BucketName, key, content2);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId2 = pOutcome.result().VersionId();\r\n\r\n    EXPECT_NE(versionId1, versionId2);\r\n    EXPECT_NE(etag1, etag2);\r\n\r\n    //head \r\n    HeadObjectRequest request(BucketName, key);\r\n    auto hOutcome = Client->HeadObject(request);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().VersionId(), versionId2);\r\n    EXPECT_EQ(hOutcome.result().ETag(), etag2);\r\n\r\n    request.setVersionId(versionId1);\r\n    hOutcome = Client->HeadObject(request);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().VersionId(), versionId1);\r\n    EXPECT_EQ(hOutcome.result().ETag(), etag1);\r\n\r\n    request.setVersionId(versionId2);\r\n    hOutcome = Client->HeadObject(request);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().VersionId(), versionId2);\r\n    EXPECT_EQ(hOutcome.result().ETag(), etag2);\r\n\r\n    //Get\r\n    GetObjectRequest gRequest(BucketName, key);\r\n    auto gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().VersionId(), versionId2);\r\n    EXPECT_EQ(gOutcome.result().Metadata().ETag(), etag2);\r\n\r\n    gRequest.setVersionId(versionId1);\r\n    gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().VersionId(), versionId1);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag1);\r\n\r\n    gRequest.setVersionId(versionId2);\r\n    gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().VersionId(), versionId2);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag2);\r\n\r\n    auto lOutcome = Client->ListObjects(BucketName, key);\r\n    EXPECT_EQ(lOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lOutcome.result().ObjectSummarys().size(), 1UL);\r\n\r\n    ListObjectVersionsRequest lvRequest(BucketName);\r\n    lvRequest.setPrefix(key);\r\n    auto lvOutcome = Client->ListObjectVersions(lvRequest);\r\n    EXPECT_EQ(lvOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lvOutcome.result().ObjectVersionSummarys().size(), 2UL);\r\n\r\n    //Delete\r\n    DeleteObjectRequest dRequest(BucketName, key);\r\n    auto dOutcome = Client->DeleteObject(dRequest);\r\n    EXPECT_EQ(dOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(dOutcome.result().VersionId().empty(), false);\r\n    EXPECT_EQ(dOutcome.result().DeleteMarker(), true);\r\n    auto dversionId = dOutcome.result().VersionId();\r\n\r\n    //Get simple meta\r\n    GetObjectMetaRequest gmRequest(BucketName, key);\r\n    auto gmOutcome = Client->GetObjectMeta(gmRequest);\r\n    EXPECT_EQ(gmOutcome.isSuccess(), false);\r\n    EXPECT_EQ(gmOutcome.error().Code(), \"NoSuchKey\");\r\n\r\n    gmRequest.setVersionId(versionId1);\r\n    gmOutcome = Client->GetObjectMeta(gmRequest);\r\n    EXPECT_EQ(gmOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gmOutcome.result().VersionId(), versionId1);\r\n    EXPECT_EQ(gmOutcome.result().ETag(), etag1);\r\n\r\n    gmRequest.setVersionId(versionId2);\r\n    gmOutcome = Client->GetObjectMeta(gmRequest);\r\n    EXPECT_EQ(gmOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gmOutcome.result().VersionId(), versionId2);\r\n    EXPECT_EQ(gmOutcome.result().ETag(), etag2);\r\n\r\n    //list agian\r\n    lOutcome = Client->ListObjects(BucketName, key);\r\n    EXPECT_EQ(lOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lOutcome.result().ObjectSummarys().size(), 0UL);\r\n\r\n    lvRequest.setBucket(BucketName);\r\n    lvRequest.setPrefix(key);\r\n    lvOutcome = Client->ListObjectVersions(lvRequest);\r\n    EXPECT_EQ(lvOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lvOutcome.result().ObjectVersionSummarys().size(), 2UL);\r\n    EXPECT_EQ(lvOutcome.result().DeleteMarkerSummarys().size(), 1UL);\r\n\r\n    //Get agian\r\n    gOutcome = Client->GetObject(GetObjectRequest(BucketName, key));\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n\r\n    gRequest.setVersionId(versionId1);\r\n    gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().VersionId(), versionId1);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag1);\r\n\r\n    gRequest.setVersionId(versionId2);\r\n    gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().VersionId(), versionId2);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag2);\r\n\r\n    //delete by version id\r\n    dRequest.setVersionId(dversionId);\r\n    dOutcome = Client->DeleteObject(dRequest);\r\n    EXPECT_EQ(dOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(dOutcome.result().VersionId(), dversionId);\r\n    EXPECT_EQ(dOutcome.result().DeleteMarker(), true);\r\n\r\n    gmOutcome = Client->GetObjectMeta(BucketName, key);\r\n    EXPECT_EQ(gmOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gmOutcome.result().VersionId(), versionId2);\r\n\r\n    dRequest.setVersionId(versionId1);\r\n    EXPECT_EQ(dRequest.VersionId(), versionId1);\r\n    dOutcome = Client->DeleteObject(dRequest);\r\n    EXPECT_EQ(dOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dOutcome.result().VersionId(), versionId1);\r\n    EXPECT_EQ(dOutcome.result().DeleteMarker(), false);\r\n\r\n    dRequest.setVersionId(versionId2);\r\n    dOutcome = Client->DeleteObject(dRequest);\r\n    EXPECT_EQ(dOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dOutcome.result().VersionId(), versionId2);\r\n    EXPECT_EQ(dOutcome.result().DeleteMarker(), false);\r\n\r\n    //list again\r\n    //lvRequest.setBucket(BucketName);\r\n    //lvRequest.setPrefix(key);\r\n    lvOutcome = Client->ListObjectVersions(BucketName, key);\r\n    EXPECT_EQ(lvOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lvOutcome.result().ObjectVersionSummarys().size(), 0UL);\r\n    EXPECT_EQ(lvOutcome.result().DeleteMarkerSummarys().size(), 0UL);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, ObjectAclWithVersioningEnableTest)\r\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    //test date\r\n    auto content1 = std::make_shared<std::stringstream>(\"versioning test 1.\");\r\n    auto content2 = std::make_shared<std::stringstream>(\"versioning test 2.\");\r\n    auto etag1 = ComputeContentETag(*content1);\r\n    auto etag2 = ComputeContentETag(*content2);\r\n    auto key = TestUtils::GetObjectKey(\"ObjectAclWithVersioningEnableTest\");\r\n\r\n    PutObjectRequest pRequest(BucketName, key, content1);\r\n    pRequest.MetaData().addHeader(\"x-oss-object-acl\",\"private\");\r\n    auto pOutcome = Client->PutObject(pRequest);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId1 = pOutcome.result().VersionId();\r\n\r\n    pOutcome = Client->PutObject(BucketName, key, content2);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId2 = pOutcome.result().VersionId();\r\n\r\n    GetObjectAclRequest gaRequest(BucketName, key);\r\n    auto gaOutcome = Client->GetObjectAcl(gaRequest);\r\n    EXPECT_EQ(gaOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gaOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(gaOutcome.result().VersionId(), versionId2);\r\n    EXPECT_EQ(gaOutcome.result().Acl(), CannedAccessControlList::Default);\r\n\r\n    gaRequest.setVersionId(versionId1);\r\n    gaOutcome = Client->GetObjectAcl(gaRequest);\r\n    EXPECT_EQ(gaOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gaOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(gaOutcome.result().VersionId(), versionId1);\r\n    EXPECT_EQ(gaOutcome.result().Acl(), CannedAccessControlList::Private);\r\n\r\n    gaRequest.setVersionId(versionId2);\r\n    gaOutcome = Client->GetObjectAcl(gaRequest);\r\n    EXPECT_EQ(gaOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gaOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(gaOutcome.result().VersionId(), versionId2);\r\n    EXPECT_EQ(gaOutcome.result().Acl(), CannedAccessControlList::Default);\r\n\r\n    //setAcl\r\n    SetObjectAclRequest saRequest(BucketName, key);\r\n    saRequest.setAcl(CannedAccessControlList::PublicRead);\r\n    auto saOutcome = Client->SetObjectAcl(saRequest);\r\n    EXPECT_EQ(saOutcome.isSuccess(), true);\r\n    EXPECT_EQ(saOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(saOutcome.result().VersionId(), versionId2);\r\n\r\n    gaOutcome = Client->GetObjectAcl(GetObjectAclRequest(BucketName, key));\r\n    EXPECT_EQ(gaOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gaOutcome.result().Acl(), CannedAccessControlList::PublicRead);\r\n\r\n    saRequest.setVersionId(versionId1);\r\n    saRequest.setAcl(CannedAccessControlList::PublicReadWrite);\r\n    saOutcome = Client->SetObjectAcl(saRequest);\r\n    EXPECT_EQ(saOutcome.isSuccess(), true);\r\n    EXPECT_EQ(saOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(saOutcome.result().VersionId(), versionId1);\r\n\r\n    gaRequest.setVersionId(versionId1);\r\n    gaOutcome = Client->GetObjectAcl(gaRequest);\r\n    EXPECT_EQ(gaOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gaOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(gaOutcome.result().VersionId(), versionId1);\r\n    EXPECT_EQ(gaOutcome.result().Acl(), CannedAccessControlList::PublicReadWrite);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, ObjectSymlinkWithVersioningEnableTest)\r\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    //test date\r\n    auto content1 = std::make_shared<std::stringstream>(\"versioning test 1.\");\r\n    auto content2 = std::make_shared<std::stringstream>(\"versioning test 2.\");\r\n    auto etag1 = ComputeContentETag(*content1);\r\n    auto etag2 = ComputeContentETag(*content2);\r\n    auto target1 = TestUtils::GetObjectKey(\"ObjectSymlinkWithVersioningEnableTest-1\");\r\n    auto target2 = TestUtils::GetObjectKey(\"ObjectSymlinkWithVersioningEnableTest-2\");\r\n    auto key = target1; key.append(\"-link\");\r\n    \r\n    \r\n    //1\r\n    auto pOutcome = Client->PutObject(BucketName, target1, content1);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId1 = pOutcome.result().VersionId();\r\n\r\n    CreateSymlinkRequest cRequest(BucketName, key);\r\n    cRequest.SetSymlinkTarget(target1);\r\n    auto cOutcome = Client->CreateSymlink(cRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n    EXPECT_EQ(cOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(cOutcome.result().VersionId().empty(), false);\r\n    EXPECT_EQ(cOutcome.result().ETag().empty(), false);\r\n    auto sversionId1 = cOutcome.result().VersionId();\r\n\r\n    //2\r\n    pOutcome = Client->PutObject(BucketName, target2, content2);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId2 = pOutcome.result().VersionId();\r\n\r\n    cRequest.SetSymlinkTarget(target2);\r\n    cOutcome = Client->CreateSymlink(cRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n    EXPECT_EQ(cOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(cOutcome.result().VersionId().empty(), false);\r\n    auto sversionId2 = cOutcome.result().VersionId();\r\n\r\n    EXPECT_NE(versionId1, versionId2);\r\n    EXPECT_NE(sversionId1, sversionId2);\r\n\r\n    //Get\r\n    GetSymlinkRequest gsRequest(BucketName, key);\r\n    auto gsOutcome = Client->GetSymlink(gsRequest);\r\n    EXPECT_EQ(gsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gsOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(gsOutcome.result().VersionId(), sversionId2);\r\n    EXPECT_EQ(gsOutcome.result().SymlinkTarget(), target2);\r\n\r\n    gsRequest.setVersionId(sversionId1);\r\n    gsOutcome = Client->GetSymlink(gsRequest);\r\n    EXPECT_EQ(gsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gsOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(gsOutcome.result().VersionId(), sversionId1);\r\n    EXPECT_EQ(gsOutcome.result().SymlinkTarget(), target1);\r\n\r\n    gsRequest.setVersionId(sversionId2);\r\n    gsOutcome = Client->GetSymlink(gsRequest);\r\n    EXPECT_EQ(gsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gsOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(gsOutcome.result().VersionId(), sversionId2);\r\n    EXPECT_EQ(gsOutcome.result().SymlinkTarget(), target2);\r\n\r\n    GetObjectRequest gRequest(BucketName, key);\r\n    auto gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().VersionId(), sversionId2);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag2);\r\n\r\n    gRequest.setVersionId(sversionId1);\r\n    gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().VersionId(), sversionId1);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag1);\r\n\r\n    gRequest.setVersionId(sversionId2);\r\n    gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().VersionId(), sversionId2);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag2);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, AppendObjectWithVersioningEnableTest)\r\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    //test date\r\n    auto content = std::make_shared<std::stringstream>(\"versioning test.\");\r\n    auto crc1 = ComputeCRC64(0UL, (void *)\"versioning test.\", 16UL);\r\n    auto crc2 = ComputeCRC64(0UL, (void *)\"versioning test.versioning test.\", 32UL);\r\n    auto key = TestUtils::GetObjectKey(\"AppendObjectWithVersioningEnableTest\");\r\n\r\n    AppendObjectRequest aRequest(BucketName, key, content);\r\n    aRequest.setPosition(0UL);\r\n    auto aOutcome = Client->AppendObject(aRequest);\r\n    EXPECT_EQ(aOutcome.isSuccess(), true);\r\n    EXPECT_EQ(aOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_TRUE(aOutcome.result().VersionId().size() > 0);\r\n    EXPECT_NE(aOutcome.result().VersionId(), \"null\");\r\n    EXPECT_EQ(aOutcome.result().Length(), 16UL);\r\n    EXPECT_EQ(aOutcome.result().CRC64(), crc1);\r\n\r\n    aRequest.setPosition(16UL);\r\n    aOutcome = Client->AppendObject(aRequest);\r\n    EXPECT_EQ(aOutcome.isSuccess(), true);\r\n    EXPECT_EQ(aOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_NE(aOutcome.result().VersionId(), \"null\");\r\n    EXPECT_TRUE(aOutcome.result().VersionId().size() > 0);\r\n    EXPECT_EQ(aOutcome.result().Length(), 32UL);\r\n    EXPECT_EQ(aOutcome.result().CRC64(), crc2);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, RestoreObjectWithVersioningEnableTest)\r\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    //test date\r\n    auto content1 = std::make_shared<std::stringstream>(\"versioning test 1.\");\r\n    auto content2 = std::make_shared<std::stringstream>(\"versioning test 2.\");\r\n    auto etag1 = ComputeContentETag(*content1);\r\n    auto etag2 = ComputeContentETag(*content2);\r\n    auto key = TestUtils::GetObjectKey(\"RestoreObjectWithVersioningEnableTest\");\r\n\r\n    PutObjectRequest pRequest1(BucketName, key, content1);\r\n    pRequest1.MetaData().addHeader(\"x-oss-storage-class\", \"Archive\");\r\n    auto pOutcome = Client->PutObject(pRequest1);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId1 = pOutcome.result().VersionId();\r\n\r\n    PutObjectRequest pRequest2(BucketName, key, content2);\r\n    pRequest2.MetaData().addHeader(\"x-oss-storage-class\", \"Archive\");\r\n    pOutcome = Client->PutObject(pRequest2);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId2 = pOutcome.result().VersionId();\r\n\r\n    EXPECT_NE(versionId1, versionId2);\r\n    EXPECT_NE(etag1, etag2);\r\n\r\n    RestoreObjectRequest rRequest(BucketName, key);\r\n    auto rOutcome = Client->RestoreObject(rRequest);\r\n    EXPECT_EQ(rOutcome.isSuccess(), true);\r\n    EXPECT_EQ(rOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(rOutcome.result().VersionId(), versionId2);\r\n\r\n    rRequest.setVersionId(versionId1);\r\n    rOutcome = Client->RestoreObject(rRequest);\r\n    EXPECT_EQ(rOutcome.isSuccess(), true);\r\n    EXPECT_EQ(rOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(rOutcome.result().VersionId(), versionId1);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, CopyObjectWithVersioningEnableTest)\r\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    //test date\r\n    auto content1 = std::make_shared<std::stringstream>(\"versioning test 1.\");\r\n    auto content2 = std::make_shared<std::stringstream>(\"versioning test 2.\");\r\n    auto etag1 = ComputeContentETag(*content1);\r\n    auto etag2 = ComputeContentETag(*content2);\r\n    auto key = TestUtils::GetObjectKey(\"CopyObjectWithVersioningEnableTest\");\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content1);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId1 = pOutcome.result().VersionId();\r\n\r\n    pOutcome = Client->PutObject(BucketName, key, content2);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId2 = pOutcome.result().VersionId();\r\n\r\n    EXPECT_NE(versionId1, versionId2);\r\n    EXPECT_NE(etag1, etag2);\r\n\r\n    CopyObjectRequest cRequest(BucketName, key);\r\n    cRequest.setCopySource(BucketName, key);\r\n    auto cOutcome = Client->CopyObject(cRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n    EXPECT_EQ(cOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(cOutcome.result().SourceVersionId(), versionId2);\r\n    EXPECT_EQ(cOutcome.result().VersionId().empty(), false);\r\n    auto versionId3 = cOutcome.result().VersionId();\r\n\r\n    cRequest.setCopySource(BucketName, key);\r\n    cRequest.setVersionId(versionId1);\r\n    cOutcome = Client->CopyObject(cRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n    EXPECT_EQ(cOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(cOutcome.result().SourceVersionId(), versionId1);\r\n    EXPECT_EQ(cOutcome.result().VersionId().empty(), false);\r\n    auto versionId4 = cOutcome.result().VersionId();\r\n\r\n    GetObjectRequest gRequest(BucketName, key);\r\n    gRequest.setVersionId(versionId3);\r\n    auto gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().VersionId(), versionId3);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag2);\r\n\r\n    gRequest.setVersionId(versionId4);\r\n    gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().VersionId(), versionId4);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag1);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, ObjectTaggingWithVersioningEnableTest)\r\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    //test date\r\n    auto content1 = std::make_shared<std::stringstream>(\"versioning test 1.\");\r\n    auto content2 = std::make_shared<std::stringstream>(\"versioning test 2.\");\r\n    auto etag1 = ComputeContentETag(*content1);\r\n    auto etag2 = ComputeContentETag(*content2);\r\n    auto key = TestUtils::GetObjectKey(\"ObjectTaggingWithVersioningEnableTest\");\r\n    Tagging tagging;\r\n    tagging.addTag(Tag(\"key1\", \"value1\"));\r\n    tagging.addTag(Tag(\"key2\", \"value2\"));\r\n\r\n    PutObjectRequest pRequest(BucketName, key, content1);\r\n    pRequest.setTagging(tagging.toQueryParameters());\r\n    auto pOutcome = Client->PutObject(pRequest);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId1 = pOutcome.result().VersionId();\r\n\r\n    pOutcome = Client->PutObject(BucketName, key, content2);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId2 = pOutcome.result().VersionId();\r\n\r\n    //get\r\n    GetObjectTaggingRequest gotRequest(BucketName, key);\r\n    auto gtOutcome = Client->GetObjectTagging(gotRequest);\r\n    EXPECT_EQ(gtOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gtOutcome.result().Tagging().Tags().size(), 0U);\r\n\r\n    gotRequest.setVersionId(versionId1);\r\n    gtOutcome = Client->GetObjectTagging(gotRequest);\r\n    EXPECT_EQ(gtOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gtOutcome.result().Tagging().Tags().size(), tagging.Tags().size());\r\n\r\n    //set\r\n    Tagging tagging2;\r\n    tagging2.addTag(Tag(\"key2-1\", \"value1\"));\r\n    tagging2.addTag(Tag(\"key2-2\", \"value2\"));\r\n    tagging2.addTag(Tag(\"key2-3\", \"value2\"));\r\n    SetObjectTaggingRequest sotRequst(BucketName, key);\r\n    sotRequst.setVersionId(versionId1);\r\n    sotRequst.setTagging(tagging2);\r\n    auto sotOutcome = Client->SetObjectTagging(sotRequst);\r\n    EXPECT_EQ(sotOutcome.isSuccess(), true);\r\n\r\n    gotRequest.setVersionId(versionId2);\r\n    gtOutcome = Client->GetObjectTagging(gotRequest);\r\n    EXPECT_EQ(gtOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gtOutcome.result().Tagging().Tags().empty(), true);\r\n\r\n    gotRequest.setVersionId(versionId1);\r\n    gtOutcome = Client->GetObjectTagging(gotRequest);\r\n    EXPECT_EQ(gtOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gtOutcome.result().Tagging().Tags().size(), tagging2.Tags().size());\r\n\r\n    //delete\r\n    DeleteObjectTaggingRequest dotRequst(BucketName, key);\r\n    dotRequst.setVersionId(versionId1);\r\n    auto dotOutcome = Client->DeleteObjectTagging(dotRequst);\r\n    EXPECT_EQ(dotOutcome.isSuccess(), true);\r\n\r\n    gotRequest.setVersionId(versionId1);\r\n    gtOutcome = Client->GetObjectTagging(gotRequest);\r\n    EXPECT_EQ(gtOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gtOutcome.result().Tagging().Tags().empty(), true);\r\n}\r\n\r\n\r\nTEST_F(ObjectVersioningTest, MultipartWithVersioningEnableTest)\r\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    //test date\r\n    auto content1 = std::make_shared<std::stringstream>(\"versioning test 1.\");\r\n    auto content2 = std::make_shared<std::stringstream>(\"versioning test 2.\");\r\n    auto etag1 = ComputeContentETag(*content1);\r\n    auto etag2 = ComputeContentETag(*content2);\r\n    auto key = TestUtils::GetObjectKey(\"MultipartWithVersioningEnableTest-basic\");\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content1);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId1 = pOutcome.result().VersionId();\r\n\r\n    pOutcome = Client->PutObject(BucketName, key, content2);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId2 = pOutcome.result().VersionId();\r\n\r\n    EXPECT_NE(versionId1, versionId2);\r\n    EXPECT_NE(etag1, etag2);\r\n\r\n    auto key1 = TestUtils::GetObjectKey(\"MultipartWithVersioningEnableTest-multi-1\");\r\n    auto initOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, key1));\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_EQ(initOutcome.result().RequestId().size(), 24UL);\r\n\r\n    UploadPartCopyRequest request(BucketName, key1, BucketName, key);\r\n    request.setVersionId(versionId1);\r\n    request.setPartNumber(1);\r\n    request.setUploadId(initOutcome.result().UploadId());\r\n    auto uploadPartOutcome = Client->UploadPartCopy(request);\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n    EXPECT_EQ(uploadPartOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(uploadPartOutcome.result().VersionId().empty(), true);\r\n    EXPECT_EQ(uploadPartOutcome.result().SourceVersionId(), versionId1);\r\n\r\n    ListPartsRequest listRequest(BucketName, key1);\r\n    listRequest.setUploadId(initOutcome.result().UploadId());\r\n    auto listOutcome = Client->ListParts(listRequest);\r\n    EXPECT_EQ(listOutcome.isSuccess(), true);\r\n\r\n    CompleteMultipartUploadRequest completeRequest(BucketName, key1, listOutcome.result().PartList());\r\n    completeRequest.setUploadId(initOutcome.result().UploadId());\r\n    auto cOutcome = Client->CompleteMultipartUpload(completeRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n    EXPECT_EQ(cOutcome.result().VersionId().empty(), false);\r\n    auto mversion1 = cOutcome.result().VersionId();\r\n\r\n    auto key2 = TestUtils::GetObjectKey(\"MultipartWithVersioningEnableTest-multi-2\");\r\n    initOutcome = Client->InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, key2));\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n    EXPECT_EQ(initOutcome.result().RequestId().size(), 24UL);\r\n\r\n    request.setKey(key2);\r\n    request.setVersionId(\"\");\r\n    request.setPartNumber(1);\r\n    request.setUploadId(initOutcome.result().UploadId());\r\n    uploadPartOutcome = Client->UploadPartCopy(request);\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n    EXPECT_EQ(uploadPartOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(uploadPartOutcome.result().VersionId().empty(), true);\r\n    EXPECT_EQ(uploadPartOutcome.result().SourceVersionId(), versionId2);\r\n\r\n    listRequest.setKey(key2);\r\n    listRequest.setUploadId(initOutcome.result().UploadId());\r\n    listOutcome = Client->ListParts(listRequest);\r\n    EXPECT_EQ(listOutcome.isSuccess(), true);\r\n\r\n    completeRequest.setKey(key2);\r\n    completeRequest.setPartList(listOutcome.result().PartList());\r\n    completeRequest.setUploadId(initOutcome.result().UploadId());\r\n    cOutcome = Client->CompleteMultipartUpload(completeRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n    EXPECT_EQ(cOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(cOutcome.result().VersionId().empty(), false);\r\n    auto mversion2 = cOutcome.result().VersionId();\r\n    \r\n    auto gOutcome = Client->GetObject(BucketName, key1);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag1);\r\n\r\n    gOutcome = Client->GetObject(BucketName, key2);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag2);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, DeleteObjecsWithVersioningEnableTest)\r\n{\r\n    std::string bucketName = BucketName;\r\n    bucketName.append(\"-deleteobjects\");\r\n\r\n    auto cbOutcome = Client->CreateBucket(CreateBucketRequest(bucketName));\r\n    EXPECT_EQ(cbOutcome.isSuccess(), true);\r\n\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(bucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(bucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n\r\n    //ObjectIdentifier\r\n    ObjectIdentifier objectId;\r\n    objectId.setKey(\"key\");\r\n    objectId.setVersionId(\"version\");\r\n    EXPECT_EQ(objectId.Key(), \"key\");\r\n    EXPECT_EQ(objectId.VersionId(), \"version\");\r\n\r\n    //DeletedObject\r\n    DeletedObject deletedObject;\r\n    EXPECT_EQ(deletedObject.DeleteMarker(), false);\r\n    EXPECT_EQ(deletedObject.Key(), \"\");\r\n    EXPECT_EQ(deletedObject.VersionId(), \"\");\r\n    EXPECT_EQ(deletedObject.DeleteMarkerVersionId(), \"\");\r\n    deletedObject.setDeleteMarker(true);\r\n    deletedObject.setKey(\"key\");\r\n    deletedObject.setVersionId(\"version\");\r\n    deletedObject.setDeleteMarkerVersionId(\"marker\");\r\n    EXPECT_EQ(deletedObject.DeleteMarker(), true);\r\n    EXPECT_EQ(deletedObject.Key(), \"key\");\r\n    EXPECT_EQ(deletedObject.VersionId(), \"version\");\r\n    EXPECT_EQ(deletedObject.DeleteMarkerVersionId(), \"marker\");\r\n\r\n\r\n    auto keyPrefix = TestUtils::GetObjectKey(\"DeleteObjecsWithVersioningEnableTest\");\r\n\r\n    std::vector<std::string> keys;\r\n    std::vector<std::string> versionIds;\r\n    std::vector<std::string> deletedVersionIds;\r\n\r\n    for (size_t i = 0; i < 10U; i++) {\r\n        auto key = keyPrefix; key.append(std::to_string(i));\r\n        auto pOutcome = Client->PutObject(bucketName, key, std::make_shared<std::stringstream>(\"just for test.\"));\r\n        EXPECT_EQ(pOutcome.isSuccess(), true);\r\n        keys.push_back(key);\r\n        versionIds.push_back(pOutcome.result().VersionId());\r\n    }\r\n\r\n    DeleteObjectVersionsRequest dsRequest(bucketName);\r\n    ObjectIdentifierList objectList0_6;\r\n    for (size_t i = 0; i < 7U; i++) {\r\n        objectList0_6.push_back(ObjectIdentifier(keys.at(i)));\r\n    }\r\n    dsRequest.setObjects(objectList0_6);\r\n    dsRequest.addObject(ObjectIdentifier(keys.at(7)));\r\n    dsRequest.addObject(ObjectIdentifier(keys.at(8)));\r\n    dsRequest.addObject(ObjectIdentifier(keys.at(9)));\r\n\r\n    auto dsOutcome = Client->DeleteObjectVersions(dsRequest);\r\n    EXPECT_EQ(dsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dsOutcome.result().DeletedObjects().size(), keys.size());\r\n\r\n    size_t index = 0U;\r\n    for (const auto& object: dsOutcome.result().DeletedObjects()) {\r\n        EXPECT_EQ(object.Key(), keys.at(index));\r\n        EXPECT_EQ(object.DeleteMarker(), true);\r\n        EXPECT_EQ(object.DeleteMarkerVersionId().empty(), false);\r\n        EXPECT_EQ(object.VersionId().empty(), true);\r\n        index++;\r\n        deletedVersionIds.push_back(object.DeleteMarkerVersionId());\r\n    }\r\n\r\n    auto lsOutcome = Client->ListObjects(bucketName);\r\n    EXPECT_EQ(lsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lsOutcome.result().ObjectSummarys().empty(), true);\r\n\r\n    auto lsvOutcome = Client->ListObjectVersions(bucketName);\r\n    EXPECT_EQ(lsvOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lsvOutcome.result().DeleteMarkerSummarys().size(), keys.size());\r\n    EXPECT_EQ(lsvOutcome.result().ObjectVersionSummarys().size(), keys.size());\r\n\r\n    //deletes objects with version id\r\n    dsRequest.clearObjects();\r\n    for (size_t i = 0; i < keys.size(); i++) {\r\n        dsRequest.addObject(ObjectIdentifier(keys.at(i), versionIds.at(i)));\r\n    }\r\n    dsOutcome = Client->DeleteObjectVersions(dsRequest);\r\n    EXPECT_EQ(dsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dsOutcome.result().DeletedObjects().size(), keys.size());\r\n    index = 0U;\r\n    for (const auto& object : dsOutcome.result().DeletedObjects()) {\r\n        EXPECT_EQ(object.Key(), keys.at(index));\r\n        EXPECT_EQ(object.DeleteMarker(), false);\r\n        EXPECT_EQ(object.DeleteMarkerVersionId().empty(), true);\r\n        EXPECT_EQ(object.VersionId(), versionIds.at(index));\r\n        index++;\r\n    }\r\n\r\n    lsvOutcome = Client->ListObjectVersions(ListObjectVersionsRequest(bucketName));\r\n    EXPECT_EQ(lsvOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lsvOutcome.result().DeleteMarkerSummarys().size(), keys.size());\r\n    EXPECT_EQ(lsvOutcome.result().ObjectVersionSummarys().size(), 0UL);\r\n\r\n    //delete deleted marker with version id\r\n    dsRequest.clearObjects();\r\n    for (size_t i = 0; i < keys.size(); i++) {\r\n        dsRequest.addObject(ObjectIdentifier(keys.at(i), deletedVersionIds.at(i)));\r\n    }\r\n    dsOutcome = Client->DeleteObjectVersions(dsRequest);\r\n    EXPECT_EQ(dsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dsOutcome.result().DeletedObjects().size(), keys.size());\r\n    index = 0U;\r\n    for (const auto& object : dsOutcome.result().DeletedObjects()) {\r\n        EXPECT_EQ(object.Key(), keys.at(index));\r\n        EXPECT_EQ(object.DeleteMarker(), true);\r\n        EXPECT_EQ(object.DeleteMarkerVersionId(), deletedVersionIds.at(index));\r\n        EXPECT_EQ(object.VersionId(), deletedVersionIds.at(index));\r\n        index++;\r\n    }\r\n\r\n    lsvOutcome = Client->ListObjectVersions(ListObjectVersionsRequest(bucketName));\r\n    EXPECT_EQ(lsvOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lsvOutcome.result().DeleteMarkerSummarys().size(), 0U);\r\n    EXPECT_EQ(lsvOutcome.result().ObjectVersionSummarys().size(), 0U);\r\n\r\n    auto dbOutcome = Client->DeleteBucket(bucketName);\r\n    EXPECT_EQ(dbOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, DeleteObjecsSpecialCharactersWithVersioningEnableTest)\r\n{\r\n    std::string bucketName = BucketName;\r\n    bucketName.append(\"-deleteobjects-cs\");\r\n\r\n    auto cbOutcome = Client->CreateBucket(CreateBucketRequest(bucketName));\r\n    EXPECT_EQ(cbOutcome.isSuccess(), true);\r\n\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(bucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(bucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    //escape char\r\n    std::string keyPrefix = TestUtils::GetObjectKey(\"DeleteObjecsSpecialCharactersWithVersioningEnableTest-escape\");\r\n    char entities[] = { '\\\"', '&', '\\'', '<', '>' };\r\n\r\n    std::vector<std::string> keys;\r\n    std::vector<std::string> versionIds;\r\n    std::vector<std::string> deletedVersionIds;\r\n\r\n    for (size_t i = 0; i < sizeof(entities) / sizeof(entities[0]); i++) {\r\n        std::string key = keyPrefix;\r\n        key.append(\"-\").append(std::to_string(i));\r\n        key.push_back(entities[i]);\r\n        key.append(\".dat\");\r\n        auto outcome = Client->PutObject(bucketName, key, std::make_shared<std::stringstream>(\"just for test.\"));\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        EXPECT_EQ(outcome.result().VersionId().empty(), false);\r\n        keys.push_back(key);\r\n        versionIds.push_back(outcome.result().VersionId());\r\n    }\r\n    {\r\n        std::string key = keyPrefix;\r\n        key.append(\"-\").append(std::to_string(9));\r\n        key.append(\"\\\"&\\'<>-10.dat\");\r\n        auto outcome = Client->PutObject(bucketName, key, std::make_shared<std::stringstream>(\"just for test.\"));\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        EXPECT_EQ(outcome.result().VersionId().empty(), false);\r\n        keys.push_back(key);\r\n        versionIds.push_back(outcome.result().VersionId());\r\n    }\r\n\r\n    //\r\n    DeleteObjectVersionsRequest dsRequest(bucketName);\r\n    for (size_t i = 0; i < keys.size(); i++) {\r\n        dsRequest.addObject(ObjectIdentifier(keys.at(i)));\r\n    }\r\n    EXPECT_EQ(dsRequest.EncodingType(), \"\");\r\n    EXPECT_EQ(dsRequest.Quiet(), false);\r\n    EXPECT_EQ(dsRequest.Objects().size(), keys.size());\r\n\r\n    auto dsOutcome = Client->DeleteObjectVersions(dsRequest);\r\n    EXPECT_EQ(dsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dsOutcome.result().DeletedObjects().size(), keys.size());\r\n\r\n    for (const auto& object : dsOutcome.result().DeletedObjects()) {\r\n        deletedVersionIds.push_back(object.DeleteMarkerVersionId());\r\n    }\r\n\r\n    auto lsvOutcome = Client->ListObjectVersions(ListObjectVersionsRequest(bucketName));\r\n    EXPECT_EQ(lsvOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lsvOutcome.result().DeleteMarkerSummarys().size(), keys.size());\r\n    EXPECT_EQ(lsvOutcome.result().ObjectVersionSummarys().size(), keys.size());\r\n\r\n    dsRequest.clearObjects();\r\n    for (size_t i = 0; i < keys.size(); i++) {\r\n        dsRequest.addObject(ObjectIdentifier(keys.at(i), versionIds.at(i)));\r\n    }\r\n    dsOutcome = Client->DeleteObjectVersions(dsRequest);\r\n    EXPECT_EQ(dsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dsOutcome.result().DeletedObjects().size(), keys.size());\r\n\r\n    dsRequest.clearObjects();\r\n    for (size_t i = 0; i < keys.size(); i++) {\r\n        dsRequest.addObject(ObjectIdentifier(keys.at(i), deletedVersionIds.at(i)));\r\n    }\r\n    dsOutcome = Client->DeleteObjectVersions(dsRequest);\r\n    EXPECT_EQ(dsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dsOutcome.result().DeletedObjects().size(), keys.size());\r\n\r\n    lsvOutcome = Client->ListObjectVersions(ListObjectVersionsRequest(bucketName));\r\n    EXPECT_EQ(lsvOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lsvOutcome.result().DeleteMarkerSummarys().size(), 0U);\r\n    EXPECT_EQ(lsvOutcome.result().ObjectVersionSummarys().size(), 0U);\r\n\r\n    //url encode test\r\n\r\n    keyPrefix = TestUtils::GetObjectKey(\"DeleteObjecsSpecialCharactersWithVersioningEnableTest-urlencode\");\r\n    std::string newKey;\r\n\r\n    keys.clear();\r\n    versionIds.clear();\r\n    deletedVersionIds.clear();\r\n\r\n    newKey = keyPrefix;\r\n    newKey.append(\"-1-\"); newKey.push_back(0x1c); newKey.push_back(0x1a); newKey.append(\".dat\");\r\n    keys.push_back(newKey);\r\n\r\n    newKey = keyPrefix;\r\n    newKey.append(\"-2-\"); newKey.push_back(0x1c); newKey.push_back(0x1a); newKey.append(\".dat\");\r\n    keys.push_back(newKey);\r\n\r\n    newKey = keyPrefix;\r\n    newKey.append(\"-3-.dat\");\r\n    keys.push_back(newKey);\r\n\r\n    for (const auto& key : keys) {\r\n        auto outcome = Client->PutObject(bucketName, key, std::make_shared<std::stringstream>(\"just for test.\"));\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        EXPECT_EQ(outcome.result().VersionId().empty(), false);\r\n        versionIds.push_back(outcome.result().VersionId());\r\n    }\r\n\r\n    dsRequest.setEncodingType(\"url\");\r\n    dsRequest.clearObjects();\r\n    for (size_t i = 0; i < keys.size(); i++) {\r\n        dsRequest.addObject(ObjectIdentifier(keys.at(i)));\r\n    }\r\n\r\n    dsOutcome = Client->DeleteObjectVersions(dsRequest);\r\n    EXPECT_EQ(dsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dsOutcome.result().DeletedObjects().size(), keys.size());\r\n    for (size_t i = 0; i < keys.size(); i++) {\r\n        EXPECT_EQ(dsOutcome.result().DeletedObjects()[i].Key(), keys[i]);\r\n    }\r\n\r\n    for (const auto& object : dsOutcome.result().DeletedObjects()) {\r\n        deletedVersionIds.push_back(object.DeleteMarkerVersionId());\r\n    }\r\n\r\n    lsvOutcome = Client->ListObjectVersions(ListObjectVersionsRequest(bucketName));\r\n    EXPECT_EQ(lsvOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lsvOutcome.result().DeleteMarkerSummarys().size(), keys.size());\r\n    EXPECT_EQ(lsvOutcome.result().ObjectVersionSummarys().size(), keys.size());\r\n\r\n    dsRequest.clearObjects();\r\n    for (size_t i = 0; i < keys.size(); i++) {\r\n        dsRequest.addObject(ObjectIdentifier(keys.at(i), versionIds.at(i)));\r\n    }\r\n    dsOutcome = Client->DeleteObjectVersions(dsRequest);\r\n    EXPECT_EQ(dsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dsOutcome.result().DeletedObjects().size(), keys.size());\r\n    for (size_t i = 0; i < keys.size(); i++) {\r\n        EXPECT_EQ(dsOutcome.result().DeletedObjects()[i].Key(), keys[i]);\r\n    }\r\n\r\n    ObjectIdentifierList objectList;\r\n    for (size_t i = 0; i < keys.size(); i++) {\r\n        objectList.push_back(ObjectIdentifier(keys.at(i), deletedVersionIds.at(i)));\r\n    }\r\n    dsOutcome = Client->DeleteObjectVersions(bucketName, objectList);\r\n    EXPECT_EQ(dsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dsOutcome.result().DeletedObjects().size(), keys.size());\r\n    for (size_t i = 0; i < keys.size(); i++) {\r\n        EXPECT_EQ(dsOutcome.result().DeletedObjects()[i].Key(), keys[i]);\r\n    }\r\n\r\n    lsvOutcome = Client->ListObjectVersions(ListObjectVersionsRequest(bucketName));\r\n    EXPECT_EQ(lsvOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lsvOutcome.result().DeleteMarkerSummarys().size(), 0U);\r\n    EXPECT_EQ(lsvOutcome.result().ObjectVersionSummarys().size(), 0U);\r\n\r\n    //delete bucket\r\n    auto dbOutcome = Client->DeleteBucket(bucketName);\r\n    EXPECT_EQ(dbOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, ListObjecsWithVersioningEnableTest)\r\n{\r\n    std::string bucketName = BucketName;\r\n    bucketName.append(\"-listobjects\");\r\n\r\n    auto cbOutcome = Client->CreateBucket(CreateBucketRequest(bucketName));\r\n    EXPECT_EQ(cbOutcome.isSuccess(), true);\r\n\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(bucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(bucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    std::string keyPrefix = TestUtils::GetObjectKey(\"ListObjecsWithVersioningEnableTest\");\r\n\r\n    //Build Test Data\r\n    size_t normalCnt = 10UL;\r\n    std::vector<std::string> normalKeys;\r\n    for (size_t i = 0; i < normalCnt; i++) {\r\n        auto key = keyPrefix;\r\n        key.append(\"/normal/\").append(std::to_string(i)).append(\".dat\");\r\n        normalKeys.push_back(key);\r\n\r\n        auto pOutcome = Client->PutObject(bucketName, key, std::make_shared<std::stringstream>(\"just for test 1.\"));\r\n        EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n        auto dOutcome = Client->DeleteObject(bucketName, key);\r\n        EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n        pOutcome = Client->PutObject(bucketName, key, std::make_shared<std::stringstream>(\"just for test 2.\"));\r\n        EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n        pOutcome = Client->PutObject(bucketName, key, std::make_shared<std::stringstream>(\"just for test 3.\"));\r\n        EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    }\r\n\r\n    size_t xmlescapeCnt = 8UL;\r\n    std::vector<std::string> xmlescapeKeys;\r\n    for (size_t i = 0; i < xmlescapeCnt; i++) {\r\n        auto key = keyPrefix;\r\n        key.append(\"/xmlescape/\").append(std::to_string(i)).append(\"\\\"&\\'<>-.dat\");\r\n        xmlescapeKeys.push_back(key);\r\n\r\n        auto pOutcome = Client->PutObject(bucketName, key, std::make_shared<std::stringstream>(\"just for test xmlescape 1.\"));\r\n        EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n        pOutcome = Client->PutObject(bucketName, key, std::make_shared<std::stringstream>(\"just for test xmlescape 2.\"));\r\n        EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    }\r\n\r\n    size_t hiddenCharsCnt = 5UL;\r\n    std::vector<std::string> hiddenCharsKeys;\r\n    for (size_t i = 0; i < hiddenCharsCnt; i++) {\r\n        auto key = keyPrefix;\r\n        key.append(\"/hiddenchar/\");\r\n        key.push_back(0x1c); key.push_back(0x1a);\r\n        key.append(std::to_string(i)).append(\".dat\");\r\n        hiddenCharsKeys.push_back(key);\r\n\r\n        auto pOutcome = Client->PutObject(bucketName, key, std::make_shared<std::stringstream>(\"just for test hiddenchar 1.\"));\r\n    }\r\n\r\n    //Test Marker\r\n    ListObjectVersionsRequest request(bucketName);\r\n    request.setMaxKeys(1);\r\n    bool IsTruncated = false;\r\n    size_t total = 0UL;\r\n    size_t size;\r\n    do {\r\n        auto outcome = Client->ListObjectVersions(request);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        size = outcome.result().DeleteMarkerSummarys().size() + outcome.result().ObjectVersionSummarys().size();\r\n        EXPECT_EQ(size, 1UL);\r\n        EXPECT_EQ(outcome.result().CommonPrefixes().empty(), true);\r\n\r\n        request.setKeyMarker(outcome.result().NextKeyMarker());\r\n        request.setVersionIdMarker(outcome.result().NextVersionIdMarker());\r\n\r\n        IsTruncated = outcome.result().IsTruncated();\r\n        total++;\r\n    } while (IsTruncated);\r\n    EXPECT_EQ(total, (normalCnt*4 + xmlescapeCnt*2 + hiddenCharsCnt));\r\n\r\n    //Test Delimiter\r\n    CommonPrefixeList preflixList;\r\n    std::string prefix = keyPrefix;\r\n    prefix.append(\"/\");\r\n    ListObjectVersionsRequest request2(bucketName);\r\n    request2.setDelimiter(\"/\");\r\n    request2.setMaxKeys(1000);\r\n    request2.setPrefix(prefix);\r\n    auto lsvOutcome = Client->ListObjectVersions(request2);\r\n    EXPECT_EQ(lsvOutcome.isSuccess(), true);\r\n    size = lsvOutcome.result().DeleteMarkerSummarys().size() + lsvOutcome.result().ObjectVersionSummarys().size();\r\n    EXPECT_EQ(size, 0UL);\r\n    preflixList.push_back(std::string(keyPrefix).append(\"/hiddenchar/\"));\r\n    preflixList.push_back(std::string(keyPrefix).append(\"/normal/\"));\r\n    preflixList.push_back(std::string(keyPrefix).append(\"/xmlescape/\"));\r\n    EXPECT_EQ(lsvOutcome.result().CommonPrefixes(), preflixList);\r\n\r\n    //Test UrlEncoding\r\n    prefix = keyPrefix;\r\n    prefix.append(\"/hiddenchar/\");\r\n    ListObjectVersionsRequest request3(bucketName);\r\n    request3.setEncodingType(\"url\");\r\n    request3.setPrefix(prefix);\r\n    lsvOutcome = Client->ListObjectVersions(request3);\r\n    EXPECT_EQ(lsvOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lsvOutcome.result().ObjectVersionSummarys().size(), hiddenCharsCnt);\r\n    for (size_t i = 0; i < hiddenCharsKeys.size(); i++) {\r\n        EXPECT_EQ(lsvOutcome.result().ObjectVersionSummarys().at(i).Key(), hiddenCharsKeys.at(i));\r\n    }\r\n\r\n    TestUtils::CleanBucketVersioning(*Client, bucketName);\r\n    EXPECT_EQ(Client->DoesBucketExist(bucketName), false);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, ResumableUploadWithVersioningEnableTest)\r\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    //multi-part mode\r\n    std::string key = TestUtils::GetObjectKey(\"ResumableUploadWithVersioningEnableTestOverPartSize\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableUploadWithVersioningEnableTestOverPartSize\").append(\".tmp\");\r\n    // limit file size between 800KB and 2000KB\r\n    int num = 8 + rand() % 12;\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num + 10);\r\n\r\n    UploadObjectRequest request(BucketName, key, tmpFile);\r\n    request.setPartSize(100 * 1024);\r\n    request.setThreadNum(3);\r\n    auto ruOutcome = Client->ResumableUploadObject(request);\r\n    EXPECT_EQ(ruOutcome.isSuccess(), true);\r\n    EXPECT_EQ(ruOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(ruOutcome.result().VersionId().empty(), false);\r\n\r\n    GetObjectRequest gRequest(BucketName, key);\r\n    gRequest.setVersionId(ruOutcome.result().VersionId());\r\n    auto gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(TestUtils::GetFileMd5(tmpFile), ComputeContentMD5(*gOutcome.result().Content()));\r\n    RemoveFile(tmpFile);\r\n\r\n    //put object mode\r\n    std::string key1 = TestUtils::GetObjectKey(\"ResumableUploadWithVersioningEnableTestUnderPartSize\");\r\n    std::string tmpFile1 = TestUtils::GetTargetFileName(\"ResumableUploadWithVersioningEnableTestUnderPartSize\").append(\".tmp\");\r\n    num = rand() % 8;\r\n    TestUtils::WriteRandomDatatoFile(tmpFile1, 10240 * num);\r\n\r\n    UploadObjectRequest request1(BucketName, key1, tmpFile1);\r\n    request1.setPartSize(100 * 1024);\r\n    request1.setThreadNum(1);\r\n    auto ruOutcome1 = Client->ResumableUploadObject(request1);\r\n    EXPECT_EQ(ruOutcome1.isSuccess(), true);\r\n    EXPECT_EQ(ruOutcome1.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(ruOutcome1.result().VersionId().empty(), false);\r\n\r\n    GetObjectRequest gRequest1(BucketName, key1);\r\n    gRequest1.setVersionId(ruOutcome1.result().VersionId());\r\n    auto gOutcome1 = Client->GetObject(gRequest1);\r\n    EXPECT_EQ(gOutcome1.isSuccess(), true);\r\n    EXPECT_EQ(TestUtils::GetFileMd5(tmpFile1), ComputeContentMD5(*gOutcome1.result().Content()));\r\n    RemoveFile(tmpFile1);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, ResumableDownloadWithVersioningEnableTest)\r\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    //multi-part mode\r\n    std::string key = TestUtils::GetObjectKey(\"ResumableDownloadWithVersioningEnableTestOverPartSize\");\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"ResumableDownloadWithVersioningEnableTestOverPartSize\").append(\".tmp\");\r\n    std::string tmpFileDonwload = TestUtils::GetTargetFileName(\"ResumableDownloadWithVersioningEnableTestOverPartSize\").append(\".dat\");\r\n    // limit file size between 800KB and 2000KB\r\n    int num = 8 + rand() % 12;\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024 * 100 * num + 10);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, tmpFile);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n\r\n    auto dOutcome = Client->DeleteObject(BucketName, key);\r\n    EXPECT_EQ(dOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dOutcome.result().VersionId().empty(), false);\r\n    EXPECT_EQ(dOutcome.result().DeleteMarker(), true);\r\n\r\n    DownloadObjectRequest rdRequest(BucketName, key, tmpFileDonwload);\r\n    rdRequest.setPartSize(100 * 1024);\r\n    rdRequest.setThreadNum(3);\r\n    auto rdOutcome = Client->ResumableDownloadObject(rdRequest);\r\n    EXPECT_EQ(rdOutcome.isSuccess(), false);\r\n    EXPECT_EQ(rdOutcome.error().Code(), \"NoSuchKey\");\r\n\r\n    rdRequest.setVersionId(pOutcome.result().VersionId());\r\n    rdOutcome = Client->ResumableDownloadObject(rdRequest);\r\n    EXPECT_EQ(rdOutcome.isSuccess(), true);\r\n    EXPECT_EQ(rdOutcome.result().VersionId(), pOutcome.result().VersionId());\r\n    EXPECT_EQ(TestUtils::GetFileMd5(tmpFile), TestUtils::GetFileMd5(tmpFileDonwload));\r\n\r\n    RemoveFile(tmpFileDonwload);\r\n\r\n    //get object mode\r\n    std::string tmpFileDonwload1 = TestUtils::GetTargetFileName(\"ResumableDownloadWithVersioningEnableTestUnderPartSize\").append(\".dat\");\r\n    DownloadObjectRequest rdRequest1(BucketName, key, tmpFileDonwload1);\r\n    rdRequest1.setPartSize(4 * 1024 * 1024);\r\n    rdOutcome = Client->ResumableDownloadObject(rdRequest1);\r\n    EXPECT_EQ(rdOutcome.isSuccess(), false);\r\n    EXPECT_EQ(rdOutcome.error().Code(), \"NoSuchKey\");\r\n\r\n    rdRequest1.setVersionId(pOutcome.result().VersionId());\r\n    rdOutcome = Client->ResumableDownloadObject(rdRequest1);\r\n    EXPECT_EQ(rdOutcome.isSuccess(), true);\r\n    EXPECT_EQ(rdOutcome.result().VersionId(), pOutcome.result().VersionId());\r\n    EXPECT_EQ(TestUtils::GetFileMd5(tmpFile), TestUtils::GetFileMd5(tmpFileDonwload1));\r\n\r\n    RemoveFile(tmpFileDonwload1);\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, ResumableCopyWithVersioningEnableTest)\r\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    //multi-part mode\r\n    std::string srcKey = TestUtils::GetObjectKey(\"ResumableCopyWithVersioningEnableTestOverPartSize\");\r\n    // limit file size between 800KB and 2000KB\r\n    int num = 3 + rand() % 5;\r\n    auto content = TestUtils::GetRandomStream(1024 * 100 * num + 10);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, srcKey, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n\r\n    auto dOutcome = Client->DeleteObject(BucketName, srcKey);\r\n    EXPECT_EQ(dOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dOutcome.result().VersionId().empty(), false);\r\n    EXPECT_EQ(dOutcome.result().DeleteMarker(), true);\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"ResumableCopyWithVersioningEnableTestOverPartSize\");\r\n\r\n    MultiCopyObjectRequest mcRequest(BucketName, key, BucketName, srcKey);\r\n    mcRequest.setPartSize(100 * 1024);\r\n    mcRequest.setThreadNum(3);\r\n    auto rcOutcome = Client->ResumableCopyObject(mcRequest);\r\n    EXPECT_EQ(rcOutcome.isSuccess(), false);\r\n    EXPECT_EQ(rcOutcome.error().Code(), \"NoSuchKey\");\r\n\r\n    mcRequest.setVersionId(pOutcome.result().VersionId());\r\n    rcOutcome = Client->ResumableCopyObject(mcRequest);\r\n    EXPECT_EQ(rcOutcome.isSuccess(), true);\r\n    EXPECT_EQ(rcOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(rcOutcome.result().VersionId().empty(), false);\r\n\r\n    auto gOutcome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(ComputeContentMD5(*gOutcome.result().Content()), ComputeContentMD5(*content));\r\n\r\n    //copyObject mode\r\n    key = TestUtils::GetObjectKey(\"ResumableCopyWithVersioningEnableTestUnderPartSize\");\r\n\r\n    MultiCopyObjectRequest mcRequest1(BucketName, key, BucketName, srcKey);\r\n    mcRequest1.setPartSize(4 * 1024 * 1024);\r\n    mcRequest1.setThreadNum(3);\r\n    auto rcOutcome1 = Client->ResumableCopyObject(mcRequest1);\r\n    EXPECT_EQ(rcOutcome1.isSuccess(), false);\r\n    EXPECT_EQ(rcOutcome1.error().Code(), \"NoSuchKey\");\r\n\r\n    mcRequest1.setVersionId(pOutcome.result().VersionId());\r\n    rcOutcome1 = Client->ResumableCopyObject(mcRequest1);\r\n    EXPECT_EQ(rcOutcome1.isSuccess(), true);\r\n    EXPECT_EQ(rcOutcome1.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(rcOutcome1.result().VersionId().empty(), false);\r\n\r\n    auto gOutcome1 = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(gOutcome1.isSuccess(), true);\r\n    EXPECT_EQ(ComputeContentMD5(*gOutcome1.result().Content()), ComputeContentMD5(*content));\r\n\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, SignUrlWithVersioningEnableTest)\r\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    //test put, get, head and getmeta \r\n    auto content1 = std::make_shared<std::stringstream>(\"versioning test 1.\");\r\n    auto content2 = std::make_shared<std::stringstream>(\"versioning test 2.\");\r\n    auto etag1 = ComputeContentETag(*content1);\r\n    auto etag2 = ComputeContentETag(*content2);\r\n    auto key = TestUtils::GetObjectKey(\"SignUrlWithVersioningEnableTest\");\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content1);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId1 = pOutcome.result().VersionId();\r\n\r\n    pOutcome = Client->PutObject(BucketName, key, content2);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId2 = pOutcome.result().VersionId();\r\n\r\n    GeneratePresignedUrlRequest urlRequest(BucketName, key, Http::Get);\r\n    auto urlOutcome = Client->GeneratePresignedUrl(urlRequest);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n    EXPECT_EQ(urlOutcome.result().find(\"versionId=\"), std::string::npos);\r\n\r\n    auto gOutcome = Client->GetObjectByUrl(urlOutcome.result());\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag2);\r\n\r\n    urlRequest.setVersionId(versionId1);\r\n    urlOutcome = Client->GeneratePresignedUrl(urlRequest);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n    std::string pat = \"versionId=\"; pat.append(UrlEncode(versionId1));\r\n    EXPECT_NE(urlOutcome.result().find(pat), std::string::npos);\r\n\r\n    gOutcome = Client->GetObjectByUrl(urlOutcome.result());\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag1);\r\n\r\n    urlRequest.setVersionId(versionId2);\r\n    urlOutcome = Client->GeneratePresignedUrl(urlRequest);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n    pat = \"versionId=\"; pat.append(UrlEncode(versionId2));\r\n    EXPECT_NE(urlOutcome.result().find(pat), std::string::npos);\r\n\r\n    gOutcome = Client->GetObjectByUrl(urlOutcome.result());\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(ComputeContentETag(*gOutcome.result().Content()), etag2);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, ProcessObjectWithVersioningEnableTest)\r\n{\r\n    auto bsOutcome = Client->SetBucketVersioning(SetBucketVersioningRequest(BucketName, VersioningStatus::Enabled));\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n\r\n    auto bfOutcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(bfOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bfOutcome.result().VersioningStatus(), VersioningStatus::Enabled);\r\n\r\n    if (bfOutcome.result().VersioningStatus() != VersioningStatus::Enabled)\r\n        return;\r\n\r\n    std::string imageFilePath = Config::GetDataPath();\r\n    imageFilePath.append(\"example.jpg\");\r\n    std::string process = \"image/resize,m_fixed,w_100,h_100\";\r\n    std::string imageInfo = \"{\\n    \\\"FileSize\\\": {\\\"value\\\": \\\"3267\\\"},\\n    \\\"Format\\\": {\\\"value\\\": \\\"jpg\\\"},\\n    \\\"FrameCount\\\": {\\\"value\\\": \\\"1\\\"},\\n    \\\"ImageHeight\\\": {\\\"value\\\": \\\"100\\\"},\\n    \\\"ImageWidth\\\": {\\\"value\\\": \\\"100\\\"},\\n    \\\"ResolutionUnit\\\": {\\\"value\\\": \\\"1\\\"},\\n    \\\"XResolution\\\": {\\\"value\\\": \\\"1/1\\\"},\\n    \\\"YResolution\\\": {\\\"value\\\": \\\"1/1\\\"}}\";\r\n    auto key = TestUtils::GetObjectKey(\"ProcessObjectWithVersioningEnableTest\");\r\n    key.append(\"-example.jpg\");\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, imageFilePath);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), false);\r\n    auto versionId1 = pOutcome.result().VersionId();\r\n\r\n    std::string saveAskey = TestUtils::GetObjectKey(\"ProcessObjectWithVersioningEnableTest\");\r\n    saveAskey.append(\"-saveas.jpg\");\r\n\r\n    GetObjectRequest gRequest(BucketName, key, process);\r\n    auto gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n    pOutcome = Client->PutObject(BucketName, saveAskey, gOutcome.result().Content());\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    gOutcome = Client->GetObject(GetObjectRequest(BucketName, saveAskey, \"image/info\"));\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    std::istreambuf_iterator<char> isb(*gOutcome.result().Content().get()), end;\r\n    std::string imageInfo1(isb, end);\r\n\r\n    const char * srcPtr = strstr(imageInfo.c_str(), \"Format\");\r\n    const char * dstPtr = strstr(imageInfo1.c_str(), \"Format\");\r\n    EXPECT_EQ(strcmp(srcPtr, dstPtr), 0);\r\n\r\n    //do not support\r\n    auto dOutcome = Client->DeleteObject(BucketName, key);\r\n    EXPECT_EQ(dOutcome.isSuccess(), true);\r\n\r\n    gRequest.setVersionId(versionId1);\r\n    gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_EQ(gOutcome.error().Code(), \"NoSuchKey\");\r\n\r\n    std::stringstream ss;\r\n    ss << process\r\n        << \"|sys/saveas\"\r\n        << \",o_\" << Base64EncodeUrlSafe(saveAskey)\r\n        << \",b_\" << Base64EncodeUrlSafe(BucketName);\r\n\r\n    ProcessObjectRequest poRequest(BucketName, key, ss.str());\r\n    poRequest.setVersionId(versionId1);\r\n    auto poOutcome = Client->ProcessObject(poRequest);\r\n    EXPECT_EQ(poOutcome.isSuccess(), false);\r\n    EXPECT_EQ(poOutcome.error().Code(), \"NoSuchKey\");\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, ObjectOperationWithoutVersioningTest)\r\n{\r\n    auto client = TestUtils::GetOssClientDefault();\r\n    auto bucketName = BucketName; bucketName.append(\"-no\");\r\n    client->CreateBucket(CreateBucketRequest(bucketName));\r\n\r\n    auto content = std::make_shared<std::stringstream>(\"just for test.\");\r\n    auto key = TestUtils::GetObjectKey(\"ObjectOperationWithoutVersioningTest\");\r\n\r\n    auto pOutcome = client->PutObject(bucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    EXPECT_EQ(pOutcome.result().VersionId().empty(), true);\r\n    EXPECT_EQ(pOutcome.result().RequestId().size(), 24UL);\r\n\r\n    auto gOutcome = client->GetObject(bucketName, key);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().VersionId().empty(), true);\r\n    EXPECT_EQ(gOutcome.result().RequestId().size(), 24UL);\r\n\r\n    auto saOutcome = client->SetObjectAcl(SetObjectAclRequest(bucketName, key, CannedAccessControlList::Private));\r\n    EXPECT_EQ(saOutcome.isSuccess(), true);\r\n    EXPECT_EQ(saOutcome.result().VersionId().empty(), true);\r\n    EXPECT_EQ(saOutcome.result().RequestId().size(), 24UL);\r\n\r\n    auto gaOutcome = client->GetObjectAcl(GetObjectAclRequest(bucketName, key));\r\n    EXPECT_EQ(gaOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gaOutcome.result().VersionId().empty(), true);\r\n    EXPECT_EQ(gaOutcome.result().Acl(), CannedAccessControlList::Private);\r\n    EXPECT_EQ(gaOutcome.result().RequestId().size(), 24UL);\r\n\r\n    auto hOutcome = client->HeadObject(HeadObjectRequest(bucketName, key));\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().VersionId().empty(), true);\r\n\r\n    hOutcome = client->GetObjectMeta(GetObjectMetaRequest(bucketName, key));\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().VersionId().empty(), true);\r\n\r\n    auto key_link = key; key_link.append(\"-link\");\r\n    CreateSymlinkRequest csRequest(bucketName, key_link);\r\n    csRequest.SetSymlinkTarget(key);\r\n    auto csOutcome = client->CreateSymlink(csRequest);\r\n    EXPECT_EQ(csOutcome.isSuccess(), true);\r\n    EXPECT_EQ(csOutcome.result().VersionId().empty(), true);\r\n    EXPECT_EQ(csOutcome.result().RequestId().size(), 24UL);\r\n\r\n    auto gsOutcome = client->GetSymlink(GetSymlinkRequest(bucketName, key_link));\r\n    EXPECT_EQ(gsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gsOutcome.result().VersionId().empty(), true);\r\n    EXPECT_EQ(gsOutcome.result().RequestId().size(), 24UL);\r\n\r\n    auto key_copy = key;  key_copy.append(\"-copy\");\r\n    CopyObjectRequest coRequest(bucketName, key_copy);\r\n    coRequest.setCopySource(bucketName, key);\r\n    auto cOutcome = client->CopyObject(coRequest);\r\n    EXPECT_EQ(cOutcome.isSuccess(), true);\r\n    EXPECT_EQ(cOutcome.result().VersionId().empty(), true);\r\n    EXPECT_EQ(cOutcome.result().RequestId().size(), 24UL);\r\n\r\n    auto key_append = key;  key_append.append(\"-append\");\r\n    content->clear();\r\n    AppendObjectRequest aoRequest(bucketName, key_append, content);\r\n    auto aOutcome = client->AppendObject(aoRequest);\r\n    EXPECT_EQ(aOutcome.isSuccess(), true);\r\n    EXPECT_EQ(aOutcome.result().VersionId().empty(), true);\r\n    EXPECT_EQ(aOutcome.result().RequestId().size(), 24UL);\r\n\r\n    auto dOutcome = client->DeleteObject(bucketName, key);\r\n    EXPECT_EQ(dOutcome.isSuccess(), true);\r\n    EXPECT_EQ(dOutcome.result().VersionId().empty(), true);\r\n    EXPECT_EQ(dOutcome.result().RequestId().size(), 24UL);\r\n    client->DeleteObject(bucketName, key_link);\r\n    client->DeleteObject(bucketName, key_copy);\r\n    client->DeleteObject(bucketName, key_append);\r\n\r\n    client->DeleteBucket(bucketName);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, ObjectVersionsWithInvalidResponseBodyTest)\r\n{\r\n    ListObjectVersionsRequest lsRequest(BucketName);\r\n    lsRequest.setResponseStreamFactory([=]() {\r\n        auto content = std::make_shared<std::stringstream>();\r\n        content->write(\"invlid data\", 11);\r\n        return content;\r\n    });\r\n    auto listOutcome = Client->ListObjectVersions(lsRequest);\r\n    EXPECT_EQ(listOutcome.isSuccess(), false);\r\n    EXPECT_EQ(listOutcome.error().Code(), \"ParseXMLError\");\r\n\r\n    DeleteObjectVersionsRequest dovRequest(BucketName);\r\n    dovRequest.addObject(ObjectIdentifier(\"key\"));\r\n    dovRequest.setResponseStreamFactory([=]() {\r\n        auto content = std::make_shared<std::stringstream>();\r\n        content->write(\"invlid data\", 11);\r\n        return content;\r\n    });\r\n    auto dOutcome = Client->DeleteObjectVersions(dovRequest);\r\n    EXPECT_EQ(dOutcome.isSuccess(), false);\r\n    EXPECT_EQ(dOutcome.error().Code(), \"ParseXMLError\");\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, DeleteObjectVersionsResultTest)\r\n{\r\n    std::string xml = R\"(\r\n        <DeleteResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <Deleted>\r\n               <Key>multipart.data</Key>\r\n               <VersionId>CAEQNRiBgIDyz.6C0BYiIGQ2NWEwNmVhNTA3ZTQ3MzM5ODliYjM1ZTdjYjA4MDE1</VersionId>\r\n            </Deleted>\r\n        </DeleteResult>)\";\r\n\r\n    DeleteObjectVersionsResult result(xml);\r\n    EXPECT_EQ(result.Quiet(), false);\r\n    EXPECT_EQ(result.DeletedObjects().size(), 1U);\r\n    EXPECT_EQ(result.DeletedObjects()[0].Key(), \"multipart.data\");\r\n\r\n    DeleteObjectVersionsResult result1(\"\");\r\n    EXPECT_EQ(result1.Quiet(), true);\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <DeleteResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <Deleted>\r\n               <Key>multipart.data</Key>\r\n               <VersionId>CAEQNRiBgIDyz.6C0BYiIGQ2NWEwNmVhNTA3ZTQ3MzM5ODliYjM1ZTdjYjA4MDE1</VersionId>\r\n            </Deleted>\r\n        <>\r\n        )\";\r\n    result1 = DeleteObjectVersionsResult(xml);\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <DeleteResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <EncodingType></EncodingType>\r\n            <Deleted>\r\n               <Key></Key>\r\n               <VersionId></VersionId>\r\n               <DeleteMarker></DeleteMarker>\r\n               <DeleteMarkerVersionId></DeleteMarkerVersionId>\r\n            </Deleted>\r\n        <DeleteResult>)\";\r\n    result1 = DeleteObjectVersionsResult(xml);\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <DeleteResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <EncodingType></EncodingType>\r\n            <Deleted>\r\n            </Deleted>\r\n        <DeleteResult>)\";\r\n    result1 = DeleteObjectVersionsResult(xml);\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <DeleteResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n        <DeleteResult>)\";\r\n    result1 = DeleteObjectVersionsResult(xml);\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <OtherResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n        <OtherResult>)\";\r\n    result1 = DeleteObjectVersionsResult(xml);\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        )\";\r\n    result1 = DeleteObjectVersionsResult(xml);\r\n\r\n    xml = R\"(\r\n        invalid xml\r\n        )\";\r\n    result1 = DeleteObjectVersionsResult(xml);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, ObjectOperationNGTest)\r\n{\r\n    DeleteObjectVersionsRequest dsRequest(\"Invalid-Bucket\");\r\n    dsRequest.setQuiet(true);\r\n    EXPECT_EQ(dsRequest.Quiet(), true);\r\n    auto dsOutcome = Client->DeleteObjectVersions(dsRequest);\r\n    EXPECT_EQ(dsOutcome.isSuccess(), false);\r\n\r\n\r\n    ListObjectVersionsRequest loRequest(\"Invalid-Bucket\");\r\n    auto lsOutcome = Client->ListObjectVersions(loRequest);\r\n    EXPECT_EQ(lsOutcome.isSuccess(), false);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, ListObjectVersionsResultTest)\r\n{\r\n    std::string xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <ListVersionsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <Name>oss-example</Name>\r\n            <Prefix></Prefix>\r\n            <KeyMarker>example</KeyMarker>\r\n            <VersionIdMarker>CAEQMxiBgICbof2D0BYiIGRhZjgwMzJiMjA3MjQ0ODE5MWYxZDYwMzJlZjU1YmMy</VersionIdMarker>\r\n            <MaxKeys>100</MaxKeys>\r\n            <Delimiter></Delimiter>\r\n            <IsTruncated>false</IsTruncated>\r\n            <DeleteMarker>\r\n                <Key>example</Key>\r\n                <VersionId>CAEQMxiBgICAof2D0BYiIDJhMGE3N2M1YTI1NDQzOGY5NTkyNTI3MGYyMzJmNTI2</VersionId>\r\n                <IsLatest>false</IsLatest>\r\n                <LastModified>2019-04-09T07:27:28.000Z</LastModified>\r\n                <Owner>\r\n                  <ID>12345125285864390</ID>\r\n                  <DisplayName>12345125285864390</DisplayName>\r\n                </Owner>\r\n            </DeleteMarker>\r\n            <Version>\r\n                <Key>example</Key>\r\n                <VersionId>CAEQMxiBgMDNoP2D0BYiIDE3MWUxNzgxZDQxNTRiODI5OGYwZGMwNGY3MzZjNDVm</VersionId>\r\n                <IsLatest>false</IsLatest>\r\n                <LastModified>2019-04-09T07:27:28.000Z</LastModified>\r\n                <ETag>\"250F8A0AE989679A22926A875F0A2B95\"</ETag>\r\n                <Type>Normal</Type>\r\n                <Size>93731</Size>\r\n                <StorageClass>Standard</StorageClass>\r\n                <Owner>\r\n                  <ID>12345125285864390</ID>\r\n                  <DisplayName>12345125285864390</DisplayName>\r\n                </Owner>\r\n            </Version>\r\n        </ListVersionsResult>\r\n        )\";\r\n    auto result = ListObjectVersionsResult(std::make_shared<std::stringstream>(xml));\r\n    EXPECT_EQ(result.ObjectVersionSummarys()[0].StorageClass(), \"Standard\");\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <ListVersionsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <Name></Name>\r\n            <Prefix></Prefix>\r\n            <KeyMarker></KeyMarker>\r\n            <VersionIdMarker></VersionIdMarker>\r\n            <MaxKeys></MaxKeys>\r\n            <Delimiter></Delimiter>\r\n            <IsTruncated></IsTruncated>\r\n            <DeleteMarker>\r\n                <Key></Key>\r\n                <VersionId></VersionId>\r\n                <IsLatest></IsLatest>\r\n                <LastModified></LastModified>\r\n                <Owner>\r\n                  <ID></ID>\r\n                  <DisplayName></DisplayName>\r\n                </Owner>\r\n            </DeleteMarker>\r\n            <Version>\r\n                <Key></Key>\r\n                <VersionId></VersionId>\r\n                <IsLatest></IsLatest>\r\n                <LastModified></LastModified>\r\n                <ETag></ETag>\r\n                <Type></Type>\r\n                <Size></Size>\r\n                <StorageClass></StorageClass>\r\n                <Owner>\r\n                  <ID></ID>\r\n                  <DisplayName></DisplayName>\r\n                </Owner>\r\n            </Version>\r\n        </ListVersionsResult>\r\n        )\";\r\n    result = ListObjectVersionsResult(xml);\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <ListVersionsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <Name></Name>\r\n            <Prefix></Prefix>\r\n            <KeyMarker></KeyMarker>\r\n            <VersionIdMarker></VersionIdMarker>\r\n            <MaxKeys></MaxKeys>\r\n            <Delimiter></Delimiter>\r\n            <IsTruncated></IsTruncated>\r\n            <DeleteMarker>\r\n                <Key></Key>\r\n                <VersionId></VersionId>\r\n                <IsLatest></IsLatest>\r\n                <LastModified></LastModified>\r\n                <Owner>\r\n                </Owner>\r\n            </DeleteMarker>\r\n            <Version>\r\n                <Key></Key>\r\n                <VersionId></VersionId>\r\n                <IsLatest></IsLatest>\r\n                <LastModified></LastModified>\r\n                <ETag></ETag>\r\n                <Type></Type>\r\n                <Size></Size>\r\n                <StorageClass></StorageClass>\r\n                <Owner>\r\n                </Owner>\r\n            </Version>\r\n            <CommonPrefixes>\r\n                <Prefix></Prefix>\r\n            </CommonPrefixes>\r\n        </ListVersionsResult>\r\n        )\";\r\n    result = ListObjectVersionsResult(xml);\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <ListVersionsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <Name></Name>\r\n            <Prefix></Prefix>\r\n            <KeyMarker></KeyMarker>\r\n            <VersionIdMarker></VersionIdMarker>\r\n            <MaxKeys></MaxKeys>\r\n            <Delimiter></Delimiter>\r\n            <IsTruncated></IsTruncated>\r\n            <EncodingType>url</EncodingType>\r\n            <DeleteMarker>\r\n                <Key></Key>\r\n                <VersionId></VersionId>\r\n                <IsLatest></IsLatest>\r\n                <LastModified></LastModified>\r\n                <Owner>\r\n                </Owner>\r\n            </DeleteMarker>\r\n            <Version>\r\n                <Key></Key>\r\n                <VersionId></VersionId>\r\n                <IsLatest></IsLatest>\r\n                <LastModified></LastModified>\r\n                <ETag></ETag>\r\n                <Type></Type>\r\n                <Size></Size>\r\n                <StorageClass></StorageClass>\r\n                <Owner>\r\n                </Owner>\r\n            </Version>\r\n            <CommonPrefixes>\r\n                <Prefix>key</Prefix>\r\n            </CommonPrefixes>\r\n        </ListVersionsResult>\r\n        )\";\r\n    result = ListObjectVersionsResult(xml);\r\n\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <ListVersionsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n            <Name></Name>\r\n            <Prefix></Prefix>\r\n            <KeyMarker></KeyMarker>\r\n            <VersionIdMarker></VersionIdMarker>\r\n            <MaxKeys></MaxKeys>\r\n            <Delimiter></Delimiter>\r\n            <IsTruncated></IsTruncated>\r\n            <NextKeyMarker></NextKeyMarker>\r\n            <NextVersionIdMarker></NextVersionIdMarker>\r\n            <EncodingType></EncodingType>\r\n            <DeleteMarker>\r\n            </DeleteMarker>\r\n            <Version>\r\n            </Version>\r\n            <CommonPrefixes>\r\n            </CommonPrefixes>\r\n        </ListVersionsResult>\r\n        )\";\r\n    result = ListObjectVersionsResult(xml);\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <ListVersionsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n        </ListVersionsResult>\r\n        )\";\r\n    result = ListObjectVersionsResult(xml);\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        <NonListVersionsResult xmlns=\"http://doc.oss-cn-hangzhou.aliyuncs.com\">\r\n        </NonListVersionsResult>\r\n        )\";\r\n    result = ListObjectVersionsResult(xml);\r\n\r\n    xml = R\"(\r\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n        )\";\r\n    result = ListObjectVersionsResult(xml);\r\n\r\n    xml = R\"(\r\n        invalid xml\r\n        )\";\r\n    result = ListObjectVersionsResult(xml);\r\n}\r\n\r\nTEST_F(ObjectVersioningTest, DeleteObjectVersionsRequestTest)\r\n{\r\n    DeleteObjectVersionsRequest request(BucketName);\r\n    request.setRequestPayer(RequestPayer::Requester);\r\n    auto headers = request.Headers();\r\n    EXPECT_EQ(headers.at(\"x-oss-request-payer\"), \"requester\");\r\n}\r\n\r\n}\r\n}"
  },
  {
    "path": "test/src/Object/SelectObjectTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <stdlib.h>\n#include <sstream>\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include \"src/model/InputFormat.cc\"\n\n\nnamespace AlibabaCloud\n{\nnamespace OSS\n{\nclass SelectObjectTest : public ::testing::Test\n{\nprotected:\n    SelectObjectTest()\n    {\n    }\n    ~SelectObjectTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n        ClientConfiguration conf;\n        conf.enableCrc64 = false;\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-selectobject\");\n        CreateBucketOutcome outCome = Client->CreateBucket(CreateBucketRequest(BucketName));\n        EXPECT_EQ(outCome.isSuccess(), true);\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n        TestUtils::CleanBucket(*Client, BucketName);\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n    static std::string sqlMessage;\n    static std::string jsonMessage;\n};\n\nstd::shared_ptr<OssClient> SelectObjectTest::Client = nullptr;\nstd::string SelectObjectTest::BucketName = \"\";\nstd::string SelectObjectTest::sqlMessage = std::string(\"name,school,company,age\\r\\n\")\n    .append(\"Lora Francis,School A,Staples Inc,27\\r\\n\")\n    .append(\"Eleanor Little,School B,\\\"Conectiv, Inc\\\",43\\r\\n\")\n    .append(\"Rosie Hughes,School C,Western Gas Resources Inc,44\\r\\n\")\n    .append(\"Lawrence Ross,School D,MetLife Inc.,24\");\n\nstd::string SelectObjectTest::jsonMessage = std::string(\"{\\n\")\n    .append(\"\\t\\\"name\\\": \\\"Lora Francis\\\",\\n\")\n    .append(\"\\t\\\"age\\\": 27,\\n\")\n    .append(\"\\t\\\"company\\\": \\\"Staples Inc\\\"\\n\")\n    .append(\"}\\n\")\n    .append(\"{\\n\")\n    .append(\"\\t\\\"name\\\": \\\"Eleanor Little\\\",\\n\")\n    .append(\"\\t\\\"age\\\": 43,\\n\")\n    .append(\"\\t\\\"company\\\": \\\"Conectiv, Inc\\\"\\n\")\n    .append(\"}\\n\")\n    .append(\"{\\n\")\n    .append(\"\\t\\\"name\\\": \\\"Rosie Hughes\\\",\\n\")\n    .append(\"\\t\\\"age\\\": 44,\\n\")\n    .append(\"\\t\\\"company\\\": \\\"Western Gas Resources Inc\\\"\\n\")\n    .append(\"}\\n\")\n    .append(\"{\\n\")\n    .append(\"\\t\\\"name\\\": \\\"Lawrence Ross\\\",\\n\")\n    .append(\"\\t\\\"age\\\": 24,\\n\")\n    .append(\"\\t\\\"company\\\": \\\"MetLife Inc.\\\"\\n\")\n    .append(\"}\");\n\nTEST_F(SelectObjectTest, NormalSelectObjectWithCsvDataTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"SqlObjectWithCsvData\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << sqlMessage;\n    PutObjectRequest putRequest(BucketName, key, content);\n    // put object\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // select object\n    SelectObjectRequest selectRequest(BucketName, key);\n    selectRequest.setExpression(\"select * from ossobject\");\n\n    CSVInputFormat csvInputFormat;\n    csvInputFormat.setHeaderInfo(CSVHeader::Use);\n    csvInputFormat.setRecordDelimiter(\"\\r\\n\");\n    csvInputFormat.setFieldDelimiter(\",\");\n    csvInputFormat.setQuoteChar(\"\\\"\");\n    csvInputFormat.setCommentChar(\"#\");\n    selectRequest.setInputFormat(csvInputFormat);\n\n    CSVOutputFormat csvOutputFormat;\n    selectRequest.setOutputFormat(csvOutputFormat);\n\n    auto outcome = Client->SelectObject(selectRequest);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    // createSelectObjectMeta\n    CreateSelectObjectMetaRequest metaRequest(BucketName, key);\n    metaRequest.setInputFormat(csvInputFormat);\n    auto metaOutcome = Client->CreateSelectObjectMeta(metaRequest);\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\n}\n\nTEST_F(SelectObjectTest, NormalSelectObjectWithOutputRawTest)\n{\n    // put object\n    std::string key = TestUtils::GetObjectKey(\"SqlObjectWithoutOutputRaw\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << sqlMessage;\n    PutObjectRequest putRequest(BucketName, key, content);\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // select object\n    SelectObjectRequest selectRequest(BucketName, key);\n    selectRequest.setExpression(\"select * from ossobject\");\n    \n    CSVInputFormat inputCsv(CSVHeader::Use, \"\\r\\n\", \",\", \"\\\"\", \"#\");\n    selectRequest.setInputFormat(inputCsv);\n    CSVOutputFormat outputCsv;\n    outputCsv.setOutputRawData(true);\n    outputCsv.setEnablePayloadCrc(false);\n    selectRequest.setOutputFormat(outputCsv);\n    \n    auto outcome = Client->SelectObject(selectRequest);\n    EXPECT_EQ(outcome.isSuccess(), true);\n}\n\nTEST_F(SelectObjectTest, NormalSelectObjectWithKeepColumnsTest)\n{\n    // put object\n    std::string key = TestUtils::GetObjectKey(\"SqlObjectWithKeepColums\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << sqlMessage;\n    PutObjectRequest putRequest(BucketName, key, content);\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // select object\n    SelectObjectRequest selectRequest(BucketName, key);\n    selectRequest.setExpression(\"select * from ossobject\");\n\n    CSVInputFormat inputCsv(CSVHeader::Use, \"\\r\\n\", \",\", \"\\\"\", \"#\");\n    selectRequest.setInputFormat(inputCsv);\n\n    CSVOutputFormat outputCsv;\n    outputCsv.setKeepAllColumns(true);\n    selectRequest.setOutputFormat(outputCsv);\n\n    auto outcome = Client->SelectObject(selectRequest);\n    EXPECT_EQ(outcome.isSuccess(), true);\n}\n\n\nTEST_F(SelectObjectTest, NormalSelectObjectWithOutputHeaderTest)\n{\n    // put object\n    std::string key = TestUtils::GetObjectKey(\"SqlObjectWithOutputHeader\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << sqlMessage;\n    PutObjectRequest putRequest(BucketName, key, content);\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // select object\n    SelectObjectRequest selectRequest(BucketName, key);\n    selectRequest.setExpression(\"select * from ossobject\");\n\n    CSVInputFormat inputCsv(CSVHeader::Use, \"\\r\\n\", \",\", \"\\\"\", \"#\");\n    selectRequest.setInputFormat(inputCsv);\n\n    CSVOutputFormat outputCsv;\n    outputCsv.setOutputHeader(true);\n    selectRequest.setOutputFormat(outputCsv);\n\n    auto outcome = Client->SelectObject(selectRequest);\n    EXPECT_EQ(outcome.isSuccess(), true);\n}\n\nTEST_F(SelectObjectTest, NormalSelectObjectWithSkipPartialDataTrueTest)\n{\n    // append message\n    std::string errorSqlMessage(sqlMessage);\n    errorSqlMessage.append(\"\\r\\n\").append(\"1,,3\\r\\n\").append(\"4,,6\\r\\n\").append(\"7,8,9\\r\\n\");\n\n    // put object\n    std::string key = TestUtils::GetObjectKey(\"SqlObjectWithSkipPartialData\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << errorSqlMessage;\n    PutObjectRequest putRequest(BucketName, key, content);\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // select object\n    SelectObjectRequest selectRequest(BucketName, key);\n    selectRequest.setExpression(\"select _1,_2,_3,_4 from ossobject\");\n\n    CSVInputFormat inputCsv(CSVHeader::Use, \"\\r\\n\", \",\", \"\\\"\", \"#\");\n    selectRequest.setInputFormat(inputCsv);\n\n    CSVOutputFormat outputCsv;\n    selectRequest.setOutputFormat(outputCsv);\n\n    selectRequest.setSkippedRecords(true, 1);\n    auto outcome = Client->SelectObject(selectRequest);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"InvalidCsvLine\");\n\n    selectRequest.setSkippedRecords(true, 5);\n    auto retryOutcome = Client->SelectObject(selectRequest);\n    EXPECT_EQ(retryOutcome.isSuccess(), true);\n}\n\nTEST_F(SelectObjectTest, NormalSelectObjectWithCrcCheckTest)\n{\n    // put object\n    std::string key = TestUtils::GetObjectKey(\"SqlObjectWithCrcCheck\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << sqlMessage;\n    PutObjectRequest putRequest(BucketName, key, content);\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // select object\n    SelectObjectRequest selectRequest(BucketName, key);\n    selectRequest.setExpression(\"select * from ossobject\");\n\n    CSVInputFormat inputCsv(CSVHeader::Use, \"\\r\\n\", \",\", \"\\\"\", \"#\");\n    selectRequest.setInputFormat(inputCsv);\n\n    CSVOutputFormat outputCsv;\n    outputCsv.setEnablePayloadCrc(true);\n    selectRequest.setOutputFormat(outputCsv);\n\n    auto outcome = Client->SelectObject(selectRequest);\n    EXPECT_EQ(outcome.isSuccess(), true);\n}\n\nTEST_F(SelectObjectTest, NormalSelectObjectWithGzipDataTest)\n{\n    //put object\n    std::string key(\"sample_data.csv.gz\");\n    auto filePath = Config::GetDataPath();\n    filePath.append(\"sample_data.csv.gz\");\n    auto putOutcome = Client->PutObject(BucketName, key, filePath);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // select object\n    SelectObjectRequest selectRequest(BucketName, key);\n    selectRequest.setExpression(\"select * from ossobject\");\n\n    CSVInputFormat inputCsv;\n    inputCsv.setRecordDelimiter(\"\\n\");\n    inputCsv.setHeaderInfo(CSVHeader::Use);\n    inputCsv.setCompressionType(CompressionType::GZIP);\n    selectRequest.setInputFormat(inputCsv);\n\n    CSVOutputFormat outputCsv;\n    selectRequest.setOutputFormat(outputCsv);\n\n    auto outcome = Client->SelectObject(selectRequest);\n    EXPECT_EQ(outcome.isSuccess(), true);\n}\n\nTEST_F(SelectObjectTest, NormalSelectObjectCreateMetaWithDelimitersTest)\n{\n    // put object\n    std::string key = TestUtils::GetObjectKey(\"SelectObjectCreateMetaWithDelimiters\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << \"abc,def123,456|7891334\\n777,888|999,222012345\\n\\n\";\n    auto putOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // create meta\n    CreateSelectObjectMetaRequest metaRequest(BucketName, key);\n    CSVInputFormat csvInput;\n    csvInput.setFieldDelimiter(\",\");\n    csvInput.setRecordDelimiter(\"\\n\");\n    metaRequest.setInputFormat(csvInput);\n    auto metaOutcome = Client->CreateSelectObjectMeta(metaRequest);\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\n    EXPECT_EQ(metaOutcome.result().SplitsCount(), 1U);\n    EXPECT_EQ(metaOutcome.result().RowsCount(), 3U);\n    EXPECT_EQ(metaOutcome.result().ColsCount(), 3U);\n\n    // create meta without overwrite\n    csvInput.setFieldDelimiter(\"|\");\n    csvInput.setRecordDelimiter(\"\\n\\n\");\n    metaRequest.setInputFormat(csvInput);\n    auto withoutOutcome = Client->CreateSelectObjectMeta(metaRequest);\n    EXPECT_EQ(withoutOutcome.isSuccess(), true);\n    EXPECT_EQ(withoutOutcome.result().SplitsCount(), 1U);\n    EXPECT_EQ(withoutOutcome.result().RowsCount(), 3U);\n    EXPECT_EQ(withoutOutcome.result().ColsCount(), 3U);\n\n    // create meta with overwrite\n    metaRequest.setOverWriteIfExists(true);\n    metaRequest.setInputFormat(csvInput);\n    auto withOutcome = Client->CreateSelectObjectMeta(metaRequest);\n    EXPECT_EQ(withOutcome.isSuccess(), true);\n    EXPECT_EQ(withOutcome.result().SplitsCount(), 1U);\n    EXPECT_EQ(withOutcome.result().RowsCount(), 1U);\n    EXPECT_EQ(withOutcome.result().ColsCount(), 3U);\n}\n\n\nTEST_F(SelectObjectTest, NormalSelectObjectCreateMetaWithQuotecharacterTest)\n{\n    // put object\n    std::string key = TestUtils::GetObjectKey(\"SelectObjectCreateMetaWithQuotecharacter\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << \"'abc','def\\n123','456'\\n\";\n    auto putOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // create meta\n    CreateSelectObjectMetaRequest metaRequest(BucketName, key);\n    CSVInputFormat inputCsv;\n    inputCsv.setQuoteChar(\"'\");\n    metaRequest.setInputFormat(inputCsv);\n    auto metaOutcome = Client->CreateSelectObjectMeta(metaRequest);\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\n    EXPECT_EQ(metaOutcome.result().SplitsCount(), 1U);\n    EXPECT_EQ(metaOutcome.result().RowsCount(), 1U);\n    EXPECT_EQ(metaOutcome.result().ColsCount(), 3U);\n\n    // create new object\n    auto anotherObjectOutcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(anotherObjectOutcome.isSuccess(), true);\n    inputCsv.setQuoteChar(\"\\\"\");\n    metaRequest.setInputFormat(inputCsv);\n    auto anotherOutcome = Client->CreateSelectObjectMeta(metaRequest);\n    EXPECT_EQ(anotherOutcome.isSuccess(), true);\n    EXPECT_EQ(anotherOutcome.result().SplitsCount(), 1U);\n    EXPECT_EQ(anotherOutcome.result().RowsCount(), 2U);\n    EXPECT_EQ(anotherOutcome.result().ColsCount(), 2U);\n}\n\nTEST_F(SelectObjectTest, NormalSelectObjectInvalidTest)\n{\n    // put object\n    std::string key = TestUtils::GetObjectKey(\"SelectObjectInvalid\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << \"abc,def|123,456|7891334\\n\\n777,888|999,222|012345\\n\\n\";\n\n    // select object\n    CSVInputFormat inputCSV;\n    CSVOutputFormat outputCSV;\n    SelectObjectRequest request(BucketName, key);\n    request.setInputFormat(inputCSV);\n    request.setOutputFormat(outputCSV);\n    auto outcome = Client->SelectObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"InvalidSqlParameter\");\n}\n\nTEST_F(SelectObjectTest, NormalValidateErrorTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"ValidateErrorObject\");\n    {\n        SelectObjectRequest request(BucketName, key);\n        auto outcome = Client->SelectObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n    {\n        CreateSelectObjectMetaRequest request(BucketName, key);\n        auto outcome = Client->CreateSelectObjectMeta(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n    {\n        SelectObjectRequest request(BucketName, key);\n        CSVInputFormat inputCSV;\n        JSONOutputFormat outputJSON;\n        request.setInputFormat(inputCSV);\n        request.setOutputFormat(outputJSON);\n        auto outcome = Client->SelectObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n    {\n        SelectObjectRequest request(BucketName, key);\n        CSVInputFormat inputCSV;\n        inputCSV.setLineRange(3, 1);\n        request.setInputFormat(inputCSV);\n        CSVOutputFormat outputCSV;\n        request.setOutputFormat(outputCSV);\n        auto outcome = Client->SelectObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n    {\n        SelectObjectRequest request(BucketName, key);\n        CSVInputFormat inputCSV;\n        inputCSV.setSplitRange(3, 1);\n        request.setInputFormat(inputCSV);\n        CSVOutputFormat outputCSV;\n        request.setOutputFormat(outputCSV);\n        auto outcome = Client->SelectObject(request);\n        EXPECT_EQ(outcome.isSuccess(), false);\n        EXPECT_EQ(outcome.error().Code(), \"ValidateError\");\n    }\n}\n\nTEST_F(SelectObjectTest, NormalSelectObjectWithRangeSet)\n{\n    auto key = TestUtils::GetObjectKey(\"SqlObjectWithRangeSet\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << sqlMessage;\n    PutObjectRequest putRequest(BucketName, key, content);\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    CSVInputFormat inputCSV;\n    inputCSV.setHeaderInfo(CSVHeader::Use);\n    inputCSV.setRecordDelimiter(\"\\r\\n\");\n    CSVOutputFormat outputCSV;\n\n    // create select object meta\n    CreateSelectObjectMetaRequest metaRequest(BucketName, key);\n    metaRequest.setInputFormat(inputCSV);\n    auto metaOutcome = Client->CreateSelectObjectMeta(metaRequest);\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\n\n    // set line range\n    SelectObjectRequest lineReauest(BucketName, key);\n    lineReauest.setExpression(\"select * from ossobject\");\n    inputCSV.setLineRange(0, 3);\n    lineReauest.setInputFormat(inputCSV);\n    lineReauest.setOutputFormat(outputCSV);\n\n    auto lineOutcome = Client->SelectObject(lineReauest);\n    EXPECT_EQ(lineOutcome.isSuccess(), true);\n\n    // set split range\n    SelectObjectRequest splitRequest(BucketName, key);\n    splitRequest.setExpression(\"select * from ossobject\");\n    inputCSV.setSplitRange(0, 3);\n    splitRequest.setInputFormat(inputCSV);\n    splitRequest.setOutputFormat(outputCSV);\n\n    auto splitOutcome = Client->SelectObject(splitRequest);\n    EXPECT_EQ(splitOutcome.isSuccess(), true);\n}\n\nTEST_F(SelectObjectTest, NormalSelectObjectWithJsonType)\n{\n    auto key = TestUtils::GetObjectKey(\"SqlObjectWithJsonType\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << jsonMessage;\n    PutObjectRequest putRequest(BucketName, key, content);\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // select object\n    SelectObjectRequest selectRequest(BucketName, key);\n    selectRequest.setExpression(\"select * from ossobject\");\n    \n    JSONInputFormat inputJson;\n    inputJson.setJsonType(JsonType::LINES);\n    inputJson.setCompressionType(CompressionType::NONE);\n    JSONOutputFormat outputJson;\n    outputJson.setEnablePayloadCrc(true);\n\n    selectRequest.setInputFormat(inputJson);\n    selectRequest.setOutputFormat(outputJson);\n    auto outcome = Client->SelectObject(selectRequest);\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    // create select object meta\n    CreateSelectObjectMetaRequest metaRequest(BucketName, key);\n    metaRequest.setInputFormat(inputJson);\n    auto metaOutcome = Client->CreateSelectObjectMeta(metaRequest);\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\n    EXPECT_EQ(metaOutcome.result().SplitsCount(), 1U);\n    EXPECT_EQ(metaOutcome.result().RowsCount(), 4U);\n}\n\nTEST_F(SelectObjectTest, SelectObjectWithPayloadChecksumFailTest) \n{\n    std::string key = TestUtils::GetObjectKey(\"SqlObjectWithCsvData\");\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    *content << sqlMessage;\n    PutObjectRequest putRequest(BucketName, key, content);\n    // put object\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // select object\n    SelectObjectRequest selectRequest(BucketName, key);\n    selectRequest.setExpression(\"select * from ossobject\");\n\n    CSVInputFormat inputCSV;\n    inputCSV.setHeaderInfo(CSVHeader::Use);\n    inputCSV.setRecordDelimiter(\"\\r\\n\");\n    inputCSV.setFieldDelimiter(\",\");\n    inputCSV.setQuoteChar(\"\\\"\");\n    inputCSV.setCommentChar(\"#\");\n    selectRequest.setInputFormat(inputCSV);\n\n    CSVOutputFormat outputCSV;\n    selectRequest.setOutputFormat(outputCSV);\n\n    selectRequest.setFlags(selectRequest.Flags() | (1U << 29));\n    auto outcome = Client->SelectObject(selectRequest);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"SelectObjectError\");\n}\n\nTEST_F(SelectObjectTest, CreateSelectObjectMetaWithPayloadChecksumFailTest) \n{\n    unsigned char data[] = { \n        0x01, 0x80, 0x00, 0x06, 0x00, 0x00, 0x00, 0x25, \n        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n        0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x00,\n        0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xc8,\n        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,\n        0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04,\n        0x2e, 0x78, 0x95, 0x1f, 0x00};\n\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    for (int i = 0; i < 53; i++) {\n        *content << data[i];\n    }\n    CreateSelectObjectMetaResult result(\"BucketName\", \"ObjectName\", \"RequestId\",content);\n}\n\nTEST_F(SelectObjectTest, CreateSelectObjectMetaWithParseIOStreamFailTest) \n{\n    unsigned char data[] = {\n        0x01, 0x80, 0x00, 0x06, 0x00, 0x00, 0x00, 0x25,\n        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n        0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x00,\n        0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xc8,\n        0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00};\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    for (int i = 0; i < 40; i++) {\n        *content << data[i];\n    }\n    CreateSelectObjectMetaResult result(\"BucketName\", \"ObjectName\", \"RequestId\", content);\n}\n\nTEST_F(SelectObjectTest, InvalidObjectKeyTest)\r\n{\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    for (auto const& invalidKeyName : TestUtils::InvalidObjectKeyNamesList()) {\r\n        // select object\n        SelectObjectRequest selectRequest(BucketName, invalidKeyName);\n        selectRequest.setExpression(\"select * from ossobject\");\n\n        CSVInputFormat csvInputFormat;\n        csvInputFormat.setHeaderInfo(CSVHeader::Use);\n        csvInputFormat.setRecordDelimiter(\"\\r\\n\");\n        csvInputFormat.setFieldDelimiter(\",\");\n        csvInputFormat.setQuoteChar(\"\\\"\");\n        csvInputFormat.setCommentChar(\"#\");\n        selectRequest.setInputFormat(csvInputFormat);\n\n        CSVOutputFormat csvOutputFormat;\n        selectRequest.setOutputFormat(csvOutputFormat);\n\n        auto outcome = Client->SelectObject(selectRequest);\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        EXPECT_STREQ(outcome.error().Code().c_str(), \"ValidateError\");\r\n        break;\r\n    }\r\n}\r\n\nTEST_F(SelectObjectTest, CreateSelectObjectMetaRequestValidateTest)\n{\n    CreateSelectObjectMetaRequest request(\"INVALIDNAME\", \"SqlObjectWithCsvData\");\n    auto metaOutcome = Client->CreateSelectObjectMeta(request);\n\n    unsigned char data[] = {\n    0x01, 0x80, 0x00, 0x08, 0x00, 0x00, 0x00, 0x25,\n    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x00,\n    0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xc8,\n    0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 };\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\n    for (int i = 0; i < 40; i++) {\n        *content << data[i];\n    }\n    CreateSelectObjectMetaResult result(\"BucketName\", \"ObjectName\", \"RequestId\", content);\n}\n\nTEST_F(SelectObjectTest, InputFormatFunctionTest)\n{\n    int64_t range1[2] = { 2,1 };\n    Range_Str(\"test\",true, range1);\n\n    int64_t range2[2] = { -1,1 };\n    Range_Str(\"test\", true, range2);\n\n    int64_t range3[2] = { 1,-1 };\n    Range_Str(\"test\", true, range3);\n\n    CSVInputFormat input;\n    input.HeaderInfo();\n    input.RecordDelimiter();\n    input.FieldDelimiter();\n    input.QuoteChar();\n    input.CommentChar();\n\n    JSONInputFormat json(JsonType::DOCUMENT);\n    json.setParseJsonNumberAsString(true);\n    json.JsonInfo();\n    json.ParseJsonNumberAsString();\n}\n\nTEST_F(SelectObjectTest, CSVOutputFormatFunctionTest)\n{\n    CSVOutputFormat csvOutputFormat;\n    csvOutputFormat.setRecordDelimiter(\"test1\");\n    csvOutputFormat.setFieldDelimiter(\"test2\");\n    csvOutputFormat.FieldDelimiter();\n    csvOutputFormat.RecordDelimiter();\n\n    JSONOutputFormat format;\n    format.setRecordDelimiter(\"test1\");\n    format.RecordDelimiter();\n}\n\nTEST_F(SelectObjectTest, SelectObjectRequestTest)\n{\n    CSVOutputFormat csvOutputFormat;\n    CSVInputFormat csvInputFormat;\n    SelectObjectRequest selectRequest(BucketName, \"key\");\n    std::shared_ptr<std::iostream> body;\n    std::string str, input_str, output_str;\n    std::istreambuf_iterator<char> isb, end;\n\n    csvOutputFormat.setFieldDelimiter(\"\");\n    selectRequest.setOutputFormat(csvOutputFormat);\n\n    csvInputFormat.setQuoteChar(\"\");\n    csvInputFormat.setCommentChar(\"\");\n    csvInputFormat.setFieldDelimiter(\"\");\n    selectRequest.setInputFormat(csvInputFormat);\n    body = selectRequest.Body();\n    isb = std::istreambuf_iterator<char>(*body.get());\n    str = std::string(isb, end);\n    input_str = str.substr(0, str.find(\"</InputSerialization>\"));\n    output_str = str.substr(str.find(\"<OutputSerialization>\"));\n    EXPECT_EQ(input_str.find(\"<FieldDelimiter></FieldDelimiter>\") != std::string::npos, true);\n    EXPECT_EQ(input_str.find(\"<CommentCharacter></CommentCharacter>\") != std::string::npos, true);\n    EXPECT_EQ(input_str.find(\"<QuoteCharacter></QuoteCharacter>\") != std::string::npos, true);\n    EXPECT_EQ(output_str.find(\"<FieldDelimiter></FieldDelimiter>\") != std::string::npos, true);\n\n\n    JSONInputFormat inputJson;\n    inputJson.setJsonType(JsonType::LINES);\n    inputJson.setCompressionType(CompressionType::NONE);\n    JSONOutputFormat outputJson;\n    outputJson.setEnablePayloadCrc(false);\n    outputJson.setKeepAllColumns(true);\n    outputJson.setOutputRawData(true);\n    outputJson.setOutputHeader(true);\n    selectRequest.setInputFormat(inputJson);\n    selectRequest.setOutputFormat(outputJson);\n    body = selectRequest.Body();\n    isb = std::istreambuf_iterator<char>(*body.get());\n    str = std::string(isb, end);\n    output_str = str.substr(str.find(\"<OutputSerialization>\"));\n    EXPECT_EQ(output_str.find(\"<KeepAllColumns>true</KeepAllColumns>\") != std::string::npos, true);\n    EXPECT_EQ(output_str.find(\"<OutputRawData>true</OutputRawData>\") != std::string::npos, true);\n    EXPECT_EQ(output_str.find(\"<OutputHeader>true</OutputHeader>\") != std::string::npos, true);\n    EXPECT_EQ(output_str.find(\"<EnablePayloadCrc>false</EnablePayloadCrc>\") != std::string::npos, true);\n}\n\nTEST_F(SelectObjectTest, CreateSelectObjectMetaRequestBranchTest)\n{\n    CreateSelectObjectMetaRequest request(BucketName,\"test\");\n    request.setOverWriteIfExists(false);\n    Client->CreateSelectObjectMeta(request);\n}\n\nTEST_F(SelectObjectTest, CreateSelectObjectMetaWithInvalidResponseBodyTest)\n{\n    std::string key = TestUtils::GetObjectKey(\"CreateSelectObjectMetaWithInvalidResponseBodyTest\");\n\n    // put object\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>(sqlMessage);\n    PutObjectRequest putRequest(BucketName, key, content);\n    auto putOutcome = Client->PutObject(putRequest);\n    EXPECT_EQ(putOutcome.isSuccess(), true);\n\n    // createSelectObjectMeta\n    CreateSelectObjectMetaRequest metaRequest(BucketName, key);\n    CSVInputFormat csvInputFormat;\n    csvInputFormat.setHeaderInfo(CSVHeader::Use);\n    csvInputFormat.setRecordDelimiter(\"\\r\\n\");\n    csvInputFormat.setFieldDelimiter(\",\");\n    csvInputFormat.setQuoteChar(\"\\\"\");\n    csvInputFormat.setCommentChar(\"#\");    \n\n    metaRequest.setInputFormat(csvInputFormat);\n    metaRequest.setResponseStreamFactory([=]() {\n        auto data = std::make_shared<std::stringstream>();\n        unsigned char invalid_pattern[] = {\n            0x01, 0x80, 0x00, 0x06, 0x00, 0x00, 0x00, 0x25,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x2e, 0x78, 0x95, 0x1f, 0x00};\n        data->write((const char*)invalid_pattern, sizeof(invalid_pattern));\n        return data;\n    });\n    auto metaOutcome = Client->CreateSelectObjectMeta(metaRequest);\n    EXPECT_EQ(metaOutcome.isSuccess(), false);\n    EXPECT_EQ(metaOutcome.error().Code(), \"ParseIOStreamError\");\n\n\n    metaRequest.setResponseStreamFactory([=]() {\n        auto data = std::make_shared<std::stringstream>();\n        unsigned char invalid_pattern[] = {\n            0x01, 0x80, 0x00, 0x06, 0x00, 0x00, 0x00, 0x25,\n            0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0xc5, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,\n            0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x2e, 0x00, 0x00, 0x00, 0x00 };\n        data->write((const char*)invalid_pattern, sizeof(invalid_pattern));\n        return data;\n    });\n    metaOutcome = Client->CreateSelectObjectMeta(metaRequest);\n}\n\n}\n}\n"
  },
  {
    "path": "test/src/Other/Crc64Test.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <src/utils/Crc64.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass Crc64Test : public ::testing::Test {\nprotected:\n    Crc64Test()\n    {\n    }\n\n    ~Crc64Test() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-crctest\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n        TestUtils::CleanBucket(*Client, BucketName);\n        Client = nullptr;\n    }\n\n    void SetUp() override\n    {\n    }\n\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> Crc64Test::Client = nullptr;\nstd::string Crc64Test::BucketName = \"\";\n\nTEST_F(Crc64Test, CalcCRCTest)\n{\n    std::string data1(\"123456789\");\n    uint64_t crc1_pat = UINT64_C(0x995dc9bbdf1939fa);\n    uint64_t crc1 = CRC64::CalcCRC(0, (void *)(data1.c_str()), data1.size());\n    EXPECT_EQ(crc1, crc1_pat);\n\n\n    std::string data2(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc2_pat = UINT64_C(0x27db187fc15bbc72);\n    uint64_t crc2 = CRC64::CalcCRC(0, (void *)(data2.c_str()), data2.size());\n    EXPECT_EQ(crc2, crc2_pat);\n}\n\nTEST_F(Crc64Test, CalcCRCWithEndingFlagTest)\n{\n    std::string data1(\"123456789\");\n    std::string data2(\"This is a test of the emergency broadcast system.\");\n\n    //little\n    uint64_t crc1_pat = UINT64_C(0x995dc9bbdf1939fa);\n    uint64_t crc1 = CRC64::CalcCRC(0, (void *)(data1.c_str()), data1.size(), true);\n    EXPECT_EQ(crc1, crc1_pat);\n\n    uint64_t crc2_pat = UINT64_C(0x27db187fc15bbc72);\n    uint64_t crc2 = CRC64::CalcCRC(0, (void *)(data2.c_str()), data2.size(), true);\n    EXPECT_EQ(crc2, crc2_pat);\n\n    //big\n    const char *str1 = \"12345678\";\n    const char *str2 = \"87654321\";\n    crc1 = CRC64::CalcCRC(0, (void *)str1, 8, false);\n    crc2 = CRC64::CalcCRC(0, (void *)str2, 8, true);\n}\n\n\nTEST_F(Crc64Test, CombineCRCTest)\n{\n    std::string data1(\"123456789\");\n    uint64_t crc1_pat = UINT64_C(0x995dc9bbdf1939fa);\n    uint64_t crc1 = CRC64::CalcCRC(0, (void *)(data1.c_str()), data1.size());\n    EXPECT_EQ(crc1, crc1_pat);\n\n    std::string data2(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc2_pat = UINT64_C(0x27db187fc15bbc72);\n    uint64_t crc2 = CRC64::CalcCRC(0, (void *)(data2.c_str()), data2.size());\n    EXPECT_EQ(crc2, crc2_pat);\n\n    std::string data3;\n    data3.append(data1).append(data2);\n    uint64_t crc3 = CRC64::CalcCRC(0, (void *)(data3.c_str()), data3.size());\n    uint64_t crc4 = CRC64::CombineCRC(crc1, crc2, data2.size());\n    EXPECT_EQ(crc3, crc4);\n\n    uint64_t crc5 = CombineCRC64(crc1, crc2, data2.size());\n    EXPECT_EQ(crc3, crc5);\n}\n\nTEST_F(Crc64Test, PubObjectCrc64HeaderTest)\n{\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc = CRC64::CalcCRC(0, (void *)(data.c_str()), data.size());\n    auto key = TestUtils::GetObjectKey(\"PubObjectCrc64HeaderTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n\n    auto outcome = Client->PutObject(BucketName, key, content);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().CRC64(), crc);\n}\n\nTEST_F(Crc64Test, PutObjectCrc64EnablePositiveTest)\n{\n    //default is enable\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc = CRC64::CalcCRC(0, (void *)(data.c_str()), data.size());\n    auto key = TestUtils::GetObjectKey(\"PutObjectCrc64EnablePositiveTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n    auto outcome = client.PutObject(BucketName, key, content);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().CRC64(), crc);\n}\n\nTEST_F(Crc64Test, PutObjectCrc64EnableNegativeTest)\n{\n    //default is enable\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    auto key = TestUtils::GetObjectKey(\"PutObjectCrc64EnableNegativeTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n    PutObjectRequest request(BucketName, key, content);\n    request.setFlags(request.Flags() | 0x80000000);\n    auto outcome = client.PutObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ClientError:100001\");\n}\n\nTEST_F(Crc64Test, PutObjectCrc64DisablePositiveTest)\n{\n    //default is enable\n    ClientConfiguration conf;\n    conf.enableCrc64 = false;\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc = CRC64::CalcCRC(0, (void *)(data.c_str()), data.size());\n    auto key = TestUtils::GetObjectKey(\"PutObjectCrc64DisablePositiveTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n    PutObjectRequest request(BucketName, key, content);\n    request.setFlags(request.Flags() | 0x80000000);\n    auto outcome = client.PutObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().CRC64(), crc);\n}\n\nTEST_F(Crc64Test, UploadPartCrc64EnablePositiveTest)\n{\n    //default is enable\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc = CRC64::CalcCRC(0, (void *)(data.c_str()), data.size());\n    auto key = TestUtils::GetObjectKey(\"UploadPartCrc64EnablePositiveTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n\n    auto initOutcome = client.InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, key));\n    EXPECT_EQ(initOutcome.isSuccess(), true);\n    UploadPartRequest request(BucketName, key, 1, initOutcome.result().UploadId(), content);\n    auto outcome = client.UploadPart(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().CRC64(), crc);\n}\n\nTEST_F(Crc64Test, UploadPartCrc64EnableNegativeTest)\n{\n    //default is enable\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    auto key = TestUtils::GetObjectKey(\"UploadPartCrc64EnableNegativeTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n\n    auto initOutcome = client.InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, key));\n    EXPECT_EQ(initOutcome.isSuccess(), true);\n    UploadPartRequest request(BucketName, key, 1, initOutcome.result().UploadId(), content);\n    request.setFlags(request.Flags() | 0x80000000);\n    auto outcome = client.UploadPart(request);    \n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ClientError:100001\");\n}\n\nTEST_F(Crc64Test, UploadPartCrc64DisablePositiveTest)\n{\n    //default is enable\n    ClientConfiguration conf;\n    conf.enableCrc64 = false;\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc = CRC64::CalcCRC(0, (void *)(data.c_str()), data.size());\n    auto key = TestUtils::GetObjectKey(\"UploadPartCrc64DisablePositiveTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n\n    auto initOutcome = client.InitiateMultipartUpload(InitiateMultipartUploadRequest(BucketName, key));\n    EXPECT_EQ(initOutcome.isSuccess(), true);\n    UploadPartRequest request(BucketName, key, 1, initOutcome.result().UploadId(), content);\n    request.setFlags(request.Flags() | 0x80000000);\n    auto outcome = client.UploadPart(request);    \n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().CRC64(), crc);\n}\n\nTEST_F(Crc64Test, GetObjectCrc64EnablePositiveTest)\n{\n    //default is enable\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc = CRC64::CalcCRC(0, (void *)(data.c_str()), data.size());\n    auto key = TestUtils::GetObjectKey(\"GetObjectCrc64EnablePositiveTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n    client.PutObject(BucketName, key, content);\n    EXPECT_EQ(client.DoesObjectExist(BucketName, key), true);\n\n    GetObjectRequest request(BucketName, key);\n    auto outcome = client.GetObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().CRC64(), crc);\n}\n\nTEST_F(Crc64Test, GetObjectCrc64EnableNegativeTest)\n{\n    //default is enable\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    auto key = TestUtils::GetObjectKey(\"GetObjectCrc64EnableNegativeTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n    client.PutObject(BucketName, key, content);\n    EXPECT_EQ(client.DoesObjectExist(BucketName, key), true);\n\n    GetObjectRequest request(BucketName, key);\n    request.setFlags(request.Flags() | 0x80000000);\n    auto outcome = client.GetObject(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ClientError:100001\");\n}\n\nTEST_F(Crc64Test, GetObjectCrc64DisablePositiveTest)\n{\n    //default is enable\n    ClientConfiguration conf;\n    conf.enableCrc64 = false;\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc = CRC64::CalcCRC(0, (void *)(data.c_str()), data.size());\n    auto key = TestUtils::GetObjectKey(\"GetObjectCrc64DisablePositiveTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n    client.PutObject(BucketName, key, content);\n    EXPECT_EQ(client.DoesObjectExist(BucketName, key), true);\n\n    GetObjectRequest request(BucketName, key);\n    request.setFlags(request.Flags() | 0x80000000);\n    auto outcome = client.GetObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().CRC64(), crc);\n}\n\nTEST_F(Crc64Test, GetObjectCrc64SaveToHeaderTest)\n{\n    //default is enable\n    ClientConfiguration conf;\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc = CRC64::CalcCRC(0, (void *)(data.c_str()), data.size());\n    auto key = TestUtils::GetObjectKey(\"GetObjectCrc64SaveToHeaderPositiveTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n    client.PutObject(BucketName, key, content);\n    EXPECT_EQ(client.DoesObjectExist(BucketName, key), true);\n\n    GetObjectRequest request(BucketName, key);\n    request.setFlags(request.Flags() | REQUEST_FLAG_SAVE_CLIENT_CRC64);\n    auto outcome = client.GetObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    uint64_t clientCRC64 = std::strtoull(outcome.result().Metadata().HttpMetaData().at(\"x-oss-hash-crc64ecma-by-client\").c_str(), nullptr, 10);\n    EXPECT_EQ(crc, clientCRC64);\n\n    //range request\n    request.setRange(0, 1);\n    outcome = client.GetObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    crc = CRC64::CalcCRC(0, (void *)(data.c_str()), 2);\n    clientCRC64 = std::strtoull(outcome.result().Metadata().HttpMetaData().at(\"x-oss-hash-crc64ecma-by-client\").c_str(), nullptr, 10);\n    EXPECT_EQ(crc, clientCRC64);\n\n    //NoSaveCRC\n    request.setFlags(request.Flags() & (~REQUEST_FLAG_SAVE_CLIENT_CRC64));\n    request.setRange(0, 1);\n    outcome = client.GetObject(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_TRUE(outcome.result().Metadata().HttpMetaData().find(\"x-oss-hash-crc64ecma-by-client\") ==\n        outcome.result().Metadata().HttpMetaData().end());\n}\n\n\nTEST_F(Crc64Test, PutObjectByUrlCrc64EnablePositiveTest)\n{\n    //default is enable\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc = CRC64::CalcCRC(0, (void *)(data.c_str()), data.size());\n    auto key = TestUtils::GetObjectKey(\"PutObjectByUrlCrc64EnablePositiveTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n    auto urlOutcome = client.GeneratePresignedUrl(GeneratePresignedUrlRequest(BucketName, key, Http::Put));\n    PutObjectByUrlRequest request(urlOutcome.result(), content);\n    auto outcome = client.PutObjectByUrl(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().CRC64(), crc);\n}\n\nTEST_F(Crc64Test, PutObjectByUrlCrc64EnableNegativeTest)\n{\n    //default is enable\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    auto key = TestUtils::GetObjectKey(\"PutObjectByUrlCrc64EnableNegativeTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n    auto urlOutcome = client.GeneratePresignedUrl(GeneratePresignedUrlRequest(BucketName, key, Http::Put));\n    PutObjectByUrlRequest request(urlOutcome.result(), content);\n    request.setFlags(request.Flags() | 0x80000000);\n    auto outcome = client.PutObjectByUrl(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ClientError:100001\");\n}\n\nTEST_F(Crc64Test, PutObjectByUrlCrc64DisablePositiveTest)\n{\n    //default is enable\n    ClientConfiguration conf;\n    conf.enableCrc64 = false;\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc = CRC64::CalcCRC(0, (void *)(data.c_str()), data.size());\n    auto key = TestUtils::GetObjectKey(\"PutObjectByUrlCrc64DisablePositiveTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n    auto urlOutcome = client.GeneratePresignedUrl(GeneratePresignedUrlRequest(BucketName, key, Http::Put));\n    PutObjectByUrlRequest request(urlOutcome.result(), content);\n    request.setFlags(request.Flags() | 0x80000000);\n    auto outcome = client.PutObjectByUrl(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().CRC64(), crc);\n}\n\nTEST_F(Crc64Test, GetObjectByUrlCrc64EnablePositiveTest)\n{\n    //default is enable\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc = CRC64::CalcCRC(0, (void *)(data.c_str()), data.size());\n    auto key = TestUtils::GetObjectKey(\"GetObjectByUrlCrc64EnablePositiveTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n    client.PutObject(BucketName, key, content);\n    EXPECT_EQ(client.DoesObjectExist(BucketName, key), true);\n\n    auto urlOutcome = client.GeneratePresignedUrl(GeneratePresignedUrlRequest(BucketName, key, Http::Get));\n    GetObjectByUrlRequest request(urlOutcome.result());\n    auto outcome = client.GetObjectByUrl(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().CRC64(), crc);\n}\n\nTEST_F(Crc64Test, GetObjectByUrlCrc64EnableNegativeTest)\n{\n    //default is enable\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    auto key = TestUtils::GetObjectKey(\"GetObjectByUrlCrc64EnableNegativeTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n    client.PutObject(BucketName, key, content);\n    EXPECT_EQ(client.DoesObjectExist(BucketName, key), true);\n\n    auto urlOutcome = client.GeneratePresignedUrl(GeneratePresignedUrlRequest(BucketName, key, Http::Get));\n    GetObjectByUrlRequest request(urlOutcome.result());\n    request.setFlags(request.Flags() | 0x80000000);\n    auto outcome = client.GetObjectByUrl(request);\n    EXPECT_EQ(outcome.isSuccess(), false);\n    EXPECT_EQ(outcome.error().Code(), \"ClientError:100001\");\n}\n\nTEST_F(Crc64Test, GetObjectByUrlCrc64DisablePositiveTest)\n{\n    //default is enable\n    ClientConfiguration conf;\n    conf.enableCrc64 = false;\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    std::string data(\"This is a test of the emergency broadcast system.\");\n    uint64_t crc = CRC64::CalcCRC(0, (void *)(data.c_str()), data.size());\n    auto key = TestUtils::GetObjectKey(\"GetObjectByUrlCrc64DisablePositiveTest\");\n    auto content = std::make_shared<std::stringstream>();\n    *content << data;\n    client.PutObject(BucketName, key, content);\n    EXPECT_EQ(client.DoesObjectExist(BucketName, key), true);\n\n    auto urlOutcome = client.GeneratePresignedUrl(GeneratePresignedUrlRequest(BucketName, key, Http::Get));\n    GetObjectByUrlRequest request(urlOutcome.result());\n    request.setFlags(request.Flags() | 0x80000000);\n    auto outcome = client.GetObjectByUrl(request);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(outcome.result().Metadata().CRC64(), crc);\n}\n\n}\n}\n"
  },
  {
    "path": "test/src/Other/EndpointTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include \"src/utils/Utils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass EndpointTest : public ::testing::Test {\nprotected:\n    EndpointTest()\n    {\n    }\n\n    ~EndpointTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase() \n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-endpoint\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase() \n    {\n        OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\n        TestUtils::CleanBucket(client, BucketName);\n        Client = nullptr;\n    }\n\n    // Sets up the test fixture.\n    void SetUp() override\n    {\n    }\n\n    // Tears down the test fixture.\n    void TearDown() override\n    {\n    }\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n};\n\nstd::shared_ptr<OssClient> EndpointTest::Client = nullptr;\nstd::string EndpointTest::BucketName = \"\";\n\n\nTEST_F(EndpointTest, PathStyleTest)\n{\n    auto conf = ClientConfiguration();\n    conf.isPathStyle = true;\n    auto client = std::make_shared<OssClient>(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n\n    auto gboutcome = client->GetBucketAcl(BucketName);\n    EXPECT_EQ(gboutcome.isSuccess(), false);\n    EXPECT_EQ(gboutcome.error().Code(), \"SecondLevelDomainForbidden\");\n\n    auto hooutcome = client->GetObject(BucketName, \"no-exist-key\");\n    EXPECT_EQ(hooutcome.isSuccess(), false);\n    EXPECT_EQ(hooutcome.error().Code(), \"SecondLevelDomainForbidden\");\n\n    auto looutcome = client->ListObjects(BucketName);\n    EXPECT_EQ(looutcome.isSuccess(), false);\n    EXPECT_EQ(looutcome.error().Code(), \"SecondLevelDomainForbidden\");\n\n    ListBucketsRequest lbrequest;\n    lbrequest.setPrefix(BucketName);\n    lbrequest.setMaxKeys(100);\n    auto lboutcome = client->ListBuckets(lbrequest);\n    EXPECT_EQ(lboutcome.isSuccess(), true);\n    EXPECT_EQ(lboutcome.result().Buckets().size(), 1UL);\n\n    GeneratePresignedUrlRequest request(BucketName, \"no-exist-key\", Http::Get);\n    auto urlOutcome = client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    std::string path = \"/\" + BucketName + \"/no-exist-key\";\n    EXPECT_EQ(urlOutcome.result().find(path.c_str()) != std::string::npos, true);\n}\n\nTEST_F(EndpointTest, CnameTest)\n{\n    Url url(Config::Endpoint);\n\n    auto cnameEndpoint = BucketName + \".\" + url.authority();\n\n    auto conf = ClientConfiguration();\n    conf.isCname = true;\n    auto client = std::make_shared<OssClient>(cnameEndpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n\n    auto gboutcome = client->GetBucketAcl(BucketName);\n    EXPECT_EQ(gboutcome.isSuccess(), true);\n    EXPECT_EQ(gboutcome.result().Acl(), CannedAccessControlList::Private);\n\n    auto hooutcome = client->GetObject(BucketName, \"no-exist-key\");\n    EXPECT_EQ(hooutcome.isSuccess(),  false);\n    EXPECT_EQ(hooutcome.error().Code(), \"NoSuchKey\");\n\n    auto looutcome = client->ListObjects(BucketName);\n    EXPECT_EQ(looutcome.isSuccess(), true);\n\n    ListBucketsRequest lbrequest;\n    lbrequest.setPrefix(BucketName);\n    lbrequest.setMaxKeys(100);\n    auto lboutcome = client->ListBuckets(lbrequest);\n    EXPECT_EQ(lboutcome.isSuccess(), false);\n    EXPECT_EQ(lboutcome.error().Code(), \"SignatureDoesNotMatch\");\n    EXPECT_EQ(lboutcome.error().Host(), cnameEndpoint);\n\n    GeneratePresignedUrlRequest request(BucketName, \"no-exist-key\", Http::Get);\n    auto urlOutcome = client->GeneratePresignedUrl(request);\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\n\n    auto gOutcome = Client->GetObjectByUrl(urlOutcome.result());\n    EXPECT_EQ(gOutcome.isSuccess(), false);\n    EXPECT_EQ(gOutcome.error().Code(), \"NoSuchKey\");\n\n}\n\n}\n}"
  },
  {
    "path": "test/src/Other/FileSystemUtilsFunctionTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include <alibabacloud/oss/Const.h>\n#include <src/utils/Utils.h>\n#include <src/utils/FileSystemUtils.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include <fstream>\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass FileSystemUtilsFunctionTest : public ::testing::Test {\nprotected:\n    FileSystemUtilsFunctionTest()\n    {\n    }\n\n    ~FileSystemUtilsFunctionTest() override\n    {\n    }\n\n    void SetUp() override\n    {\n    }\n\n    void TearDown() override\n    {\n    }\n};\n\n\nTEST_F(FileSystemUtilsFunctionTest, CreateRemoveDirectoryWithoutPathSeparatorTest)\n{\n    std::string testPath = TestUtils::GetExecutableDirectory();\n    EXPECT_FALSE(testPath.empty());\n\n    time_t t;\n    testPath.push_back(PATH_DELIMITER);\n    testPath.append(TestUtils::GetTargetFileName(\"CreateDirectoryTest\"));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n\n    EXPECT_TRUE(CreateDirectory(testPath));\n    EXPECT_TRUE(GetPathLastModifyTime(testPath, t));\n\n    EXPECT_TRUE(RemoveDirectory(testPath));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n}\n\nTEST_F(FileSystemUtilsFunctionTest, CreateRemoveDirectoryWithPathSeparatorTest)\n{\n    std::string testPath = TestUtils::GetExecutableDirectory();\n    EXPECT_FALSE(testPath.empty());\n\n    time_t t;\n    testPath.push_back(PATH_DELIMITER);\n    testPath.append(TestUtils::GetTargetFileName(\"CreateDirectoryTest\"));\n    testPath.push_back(PATH_DELIMITER);\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n\n    EXPECT_TRUE(CreateDirectory(testPath));\n    EXPECT_TRUE(GetPathLastModifyTime(testPath, t));\n\n    EXPECT_TRUE(RemoveDirectory(testPath));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n}\n\nTEST_F(FileSystemUtilsFunctionTest, CreateRemoveDirectoryWithMultiSubTest)\n{\n    std::string testPath = TestUtils::GetExecutableDirectory();\n    EXPECT_FALSE(testPath.empty());\n\n    std::string upperFolder;\n    time_t t;\n    testPath.push_back(PATH_DELIMITER);\n    testPath.append(TestUtils::GetTargetFileName(\"CreateDirectoryTest\"));\n    upperFolder = testPath;\n    testPath.push_back(PATH_DELIMITER);\n    testPath.append(TestUtils::GetTargetFileName(\"CreateDirectoryTest\"));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n\n    EXPECT_TRUE(CreateDirectory(testPath));\n    EXPECT_TRUE(GetPathLastModifyTime(testPath, t));\n\n    EXPECT_FALSE(RemoveDirectory(upperFolder));\n    EXPECT_TRUE(GetPathLastModifyTime(upperFolder, t));\n\n    EXPECT_TRUE(RemoveDirectory(testPath));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n\n    EXPECT_TRUE(RemoveDirectory(upperFolder));\n    EXPECT_FALSE(GetPathLastModifyTime(upperFolder, t));\n\n}\n\n#ifdef _WIN32\nTEST_F(FileSystemUtilsFunctionTest, CreateDirectoryNegativeTest)\n{\n    std::string testPath = TestUtils::GetExecutableDirectory();\n    EXPECT_FALSE(testPath.empty());\n\n    std::string upperFolder;\n    time_t t;\n    testPath.push_back(PATH_DELIMITER);\n    testPath.append(TestUtils::GetTargetFileName(\":\"));\n    upperFolder = testPath;\n    testPath.push_back(PATH_DELIMITER);\n    testPath.append(TestUtils::GetTargetFileName(\"CreateDirectoryNegativeTest\"));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n\n    EXPECT_FALSE(CreateDirectory(testPath));\n}\n#endif\n\nTEST_F(FileSystemUtilsFunctionTest, GetFolderLastModifyTimeTest)\n{\n    std::string testPath = TestUtils::GetExecutableDirectory();\n    EXPECT_FALSE(testPath.empty());\n\n    time_t t;\n    testPath.push_back(PATH_DELIMITER);\n    testPath.append(TestUtils::GetTargetFileName(\"CreateDirectoryTest\"));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n\n    EXPECT_TRUE(CreateDirectory(testPath));\n    EXPECT_TRUE(GetPathLastModifyTime(testPath, t));\n\n    time_t t1;\n    testPath.push_back(PATH_DELIMITER);\n    EXPECT_TRUE(GetPathLastModifyTime(testPath, t1));\n\n    EXPECT_EQ(t, t1);\n\n    EXPECT_TRUE(RemoveDirectory(testPath));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n}\n\nTEST_F(FileSystemUtilsFunctionTest, GetFileLastModifyTimeTest)\n{\n    std::string testPath = TestUtils::GetExecutableDirectory();\n    EXPECT_FALSE(testPath.empty());\n\n    time_t t;\n    testPath.push_back(PATH_DELIMITER);\n    testPath.append(TestUtils::GetTargetFileName(\"CreateDirectoryTest\"));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n\n    std::fstream fs(testPath, std::ios::out | std::ios::binary);\n    fs << \"just for test for\" << __FUNCTION__ << std::endl;\n    fs.close();\n\n    EXPECT_TRUE(GetPathLastModifyTime(testPath, t));\n\n    EXPECT_TRUE(RemoveFile(testPath));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n}\n\nTEST_F(FileSystemUtilsFunctionTest, RemoveFileTest)\n{\n    std::string testPath = TestUtils::GetExecutableDirectory();\n    EXPECT_FALSE(testPath.empty());\n\n    time_t t;\n    testPath.push_back(PATH_DELIMITER);\n    testPath.append(TestUtils::GetTargetFileName(\"CreateDirectoryTest\"));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n\n    std::fstream fs(testPath, std::ios::out | std::ios::binary);\n    fs << \"just for test for\" << __FUNCTION__ <<std::endl;\n    fs.close();\n\n    EXPECT_TRUE(GetPathLastModifyTime(testPath, t));\n\n    EXPECT_TRUE(RemoveFile(testPath));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n}\n\nTEST_F(FileSystemUtilsFunctionTest, RenameFileTest)\n{\n    std::string testPath = TestUtils::GetExecutableDirectory();\n    EXPECT_FALSE(testPath.empty());\n\n    time_t t;\n    testPath.push_back(PATH_DELIMITER);\n    testPath.append(TestUtils::GetTargetFileName(\"CreateDirectoryTest\"));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n\n    std::fstream fs(testPath, std::ios::out | std::ios::binary);\n    fs << \"just for test for\" << __FUNCTION__ << std::endl;\n    fs.close();\n\n    EXPECT_TRUE(GetPathLastModifyTime(testPath, t));\n\n    std::string newTestPath = testPath;\n    newTestPath.append(\".new\");\n\n    EXPECT_TRUE(RenameFile(testPath, newTestPath));\n    EXPECT_TRUE(GetPathLastModifyTime(newTestPath, t));\n    EXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n\n\n    EXPECT_TRUE(RemoveFile(newTestPath));\n    EXPECT_FALSE(GetPathLastModifyTime(newTestPath, t));\n}\n\nTEST_F(FileSystemUtilsFunctionTest, GetFileLastModifyTimeEmptyPathTest)\n{\n\ttime_t t;\n\tstd::string testPath = \"\";\n\tEXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n#if defined(_WIN32) && _MSC_VER < 1900\n\ttestPath.clear();\n\ttestPath.push_back(PATH_DELIMITER);\n\tEXPECT_FALSE(GetPathLastModifyTime(testPath, t));\n#endif\n}\n\n}\n}"
  },
  {
    "path": "test/src/Other/HttpClientTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include <alibabacloud/oss/client/RateLimiter.h>\r\n#include <alibabacloud/oss/http/HttpMessage.h>\r\n#include <src/http/CurlHttpClient.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include <chrono>\r\n#include <future>\r\n#include <fstream>\r\n#include \"src/utils/FileSystemUtils.h\"\r\n#include \"src/utils/Utils.h\"\r\n#include \"src/client/Client.h\"\r\n#include \"src/OssClientImpl.h\"\r\n\r\n\r\n#ifdef GetObject\r\n#undef GetObject\r\n#endif // GetObject\r\n\r\n\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass HttpClientTest : public ::testing::Test {\r\nprotected:\r\n    HttpClientTest()\r\n    {\r\n    }\r\n\r\n    ~HttpClientTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase()\r\n    {\r\n        Client = TestUtils::GetOssClientDefault();\r\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-httpclienttest\");\r\n        Client->CreateBucket(CreateBucketRequest(BucketName));\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase()\r\n    {\r\n        TestUtils::CleanBucket(*Client, BucketName);\r\n        Client = nullptr;\r\n    }\r\n\r\n\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    void TearDown() override\r\n    {\r\n    }\r\n\r\npublic:\r\n    static std::shared_ptr<OssClient> Client;\r\n    static std::string BucketName;\r\n\r\n    class Timer\r\n    {\r\n    public:\r\n        Timer() : begin_(std::chrono::high_resolution_clock::now()) {}\r\n        void reset() { begin_ = std::chrono::high_resolution_clock::now(); }\r\n        int64_t elapsed() const\r\n        {\r\n            return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - begin_).count();\r\n        }\r\n        int64_t elapsed_micro() const\r\n        {\r\n            return std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - begin_).count();\r\n        }\r\n    private:\r\n        std::chrono::time_point<std::chrono::high_resolution_clock> begin_;\r\n    };\r\n};\r\n\r\nstd::shared_ptr<OssClient> HttpClientTest::Client = nullptr;\r\nstd::string HttpClientTest::BucketName = \"\";\r\n\r\nTEST_F(HttpClientTest, WaitForRetryTimeoutTest)\r\n{\r\n    ClientConfiguration conf;\r\n    CurlHttpClient httpClient(conf);\r\n    Timer timer;\r\n    long timeouts[] = { 0, 1000, 2000, 3000, 5500, 10000 };\r\n    for (auto t : timeouts) {\r\n        timer.reset();\r\n        httpClient.waitForRetry(t);\r\n        long elapsed = static_cast<long>(timer.elapsed());\r\n        EXPECT_NEAR(elapsed, t, 100);\r\n        EXPECT_TRUE(httpClient.isEnable());\r\n    }\r\n}\r\n\r\nTEST_F(HttpClientTest, WaitForRetryTimeoutAsyncTest)\r\n{\r\n    ClientConfiguration conf;\r\n    CurlHttpClient httpClient(conf);\r\n    CurlHttpClient *client = &httpClient;\r\n    Timer timer;\r\n    long timeouts[] = { 1000, 2000, 3000, 5500, 10000 };\r\n    for (auto t : timeouts) {\r\n        timer.reset();\r\n        auto f = std::async(std::launch::async, [client, t]()->void { client->waitForRetry(t); });\r\n        f.get();\r\n        long elapsed = static_cast<long>(timer.elapsed());\r\n        EXPECT_NEAR(elapsed, t, 100);\r\n    }\r\n}\r\n\r\nTEST_F(HttpClientTest, WaitForRetryTimeoutDisableTest)\r\n{\r\n    ClientConfiguration conf;\r\n    CurlHttpClient httpClient(conf);\r\n    httpClient.disable();\r\n    Timer timer;\r\n    long timeouts[] = { 1000, 2000, 3000, 5500, 10000 };\r\n    for (auto t : timeouts) {\r\n        timer.reset();\r\n        httpClient.waitForRetry(t);\r\n        long elapsed = static_cast<long>(timer.elapsed());\r\n        EXPECT_NEAR(elapsed, 0, 100);\r\n    }\r\n}\r\n\r\nTEST_F(HttpClientTest, WaitForRetryTimeoutInterruptTest)\r\n{\r\n    ClientConfiguration conf;\r\n    CurlHttpClient httpClient(conf);\r\n    CurlHttpClient *client = &httpClient;\r\n    Timer timer;\r\n    long timeouts[] = { 1000, 2000, 3000, 5500, 10000 };\r\n    for (auto t : timeouts) {\r\n        timer.reset();\r\n        client->enable();\r\n        auto f = std::async(std::launch::async, [client, t]()->void { client->waitForRetry(t); });\r\n        f.wait_for(std::chrono::milliseconds(t / 2));\r\n        client->disable();\r\n        f.get();\r\n        long elapsed = static_cast<long>(timer.elapsed());\r\n        EXPECT_NEAR(elapsed, t/2, 100);\r\n        EXPECT_FALSE(client->isEnable());\r\n    }\r\n}\r\n\r\nTEST_F(HttpClientTest, ResourceManagerWithOneConnnectionTest)\r\n{\r\n    ClientConfiguration conf;\r\n    conf.maxConnections = 1;\r\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n    auto keyPrefix  = TestUtils::GetObjectKey(\"ResourceManagerWithOneConnnectionTest\");\r\n\r\n    std::vector<PutObjectOutcomeCallable> Callables;\r\n\r\n    //SetLogLevel(LogLevel::LogAll);\r\n    //SetLogCallback(TestUtils::LogPrintCallback);\r\n\r\n    for (int i = 0; i < 5; i++) {\r\n        std::string key = keyPrefix;\r\n        key.append(\"-\").append(std::to_string(i));\r\n        auto content = TestUtils::GetRandomStream(1024);\r\n        PutObjectRequest request(BucketName, key, content);\r\n        auto outcomeCallable = client.PutObjectCallable(request);\r\n        Callables.emplace_back(std::move(outcomeCallable));\r\n    }\r\n\r\n    for (size_t i = 0; i < Callables.size(); i++) {\r\n        auto outcome = Callables[i].get();\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        EXPECT_FALSE(outcome.result().ETag().empty());\r\n    }\r\n\r\n    //SetLogLevel(LogLevel::LogOff);\r\n    //SetLogCallback(nullptr);\r\n}\r\n\r\nTEST_F(HttpClientTest, ResourceManagerWithTwoConnnectionTest)\r\n{\r\n    ClientConfiguration conf;\r\n    conf.maxConnections = 2;\r\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n    auto keyPrefix = TestUtils::GetObjectKey(\"ResourceManagerWithTwoConnnectionTest\");\r\n\r\n    std::vector<PutObjectOutcomeCallable> Callables;\r\n\r\n    //SetLogLevel(LogLevel::LogAll);\r\n    //SetLogCallback(TestUtils::LogPrintCallback);\r\n\r\n    for (int i = 0; i < 5; i++) {\r\n        std::string key = keyPrefix;\r\n        key.append(\"-\").append(std::to_string(i));\r\n        auto content = TestUtils::GetRandomStream(1024);\r\n        PutObjectRequest request(BucketName, key, content);\r\n        auto outcomeCallable = client.PutObjectCallable(request);\r\n        Callables.emplace_back(std::move(outcomeCallable));\r\n    }\r\n\r\n    for (size_t i = 0; i < Callables.size(); i++) {\r\n        auto outcome = Callables[i].get();\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        EXPECT_FALSE(outcome.result().ETag().empty());\r\n    }\r\n\r\n    //SetLogLevel(LogLevel::LogOff);\r\n    //SetLogCallback(nullptr);\r\n}\r\n\r\nTEST_F(HttpClientTest, HttpRequestTest)\r\n{\r\n    HttpRequest request(Http::Get);\r\n    EXPECT_EQ(request.method(), Http::Get);\r\n\r\n    request.setMethod(Http::Put);\r\n    EXPECT_EQ(request.method(), Http::Put);\r\n}\r\n\r\nTEST_F(HttpClientTest, HttpResponseTest)\r\n{\r\n    auto request = std::make_shared<HttpRequest>(Http::Get);\r\n    request->setResponseStreamFactory([=]() { return nullptr; });\r\n    HttpResponse response(request);\r\n    const char * msg = \"just for test\";\r\n    response.setStatusMsg(msg);\r\n    EXPECT_STREQ(response.statusMsg().c_str(), msg);\r\n    std::string msgStr(\"just for test\");\r\n    response.setStatusMsg(msgStr);\r\n    EXPECT_EQ(response.statusMsg(), msgStr);\r\n}\r\n\r\nTEST_F(HttpClientTest, DisableEnableRequestTest)\r\n{\r\n    ClientConfiguration conf;\r\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n    client.DisableRequest();\r\n    auto outcome = client.ListBuckets();\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ClientError:100002\");\r\n\r\n    client.EnableRequest();\r\n    outcome = client.ListBuckets();\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(HttpClientTest, DisableRequestWhenDoingTest)\r\n{\r\n    ClientConfiguration conf;\r\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n    auto keyPrefix = TestUtils::GetObjectKey(\"DisableRequestAfterMakeRequestTest\");\r\n    auto tmpFile = TestUtils::GetTargetFileName(\"DisableRequestAfterMakeRequestTest\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 50 * 1024 * 1024);\r\n\r\n    std::vector<PutObjectOutcomeCallable> Callables;\r\n\r\n    SetLogLevel(LogLevel::LogAll);\r\n    SetLogCallback(TestUtils::LogPrintCallback);\r\n\r\n    for (int i = 0; i < 4; i++) {\r\n        std::string key = keyPrefix;\r\n        key.append(\"-\").append(std::to_string(i));\r\n        auto content = std::make_shared<std::fstream>(tmpFile, std::ios::in | std::ios::binary);\r\n        PutObjectRequest request(BucketName, key, content);\r\n        auto outcomeCallable = client.PutObjectCallable(request);\r\n        Callables.emplace_back(std::move(outcomeCallable));\r\n    }\r\n\r\n    std::this_thread::sleep_for(std::chrono::milliseconds(100));\r\n    client.DisableRequest();\r\n\r\n    for (size_t i = 0; i < Callables.size(); i++) {\r\n        auto outcome = Callables[i].get();\r\n        EXPECT_EQ(outcome.isSuccess(), false);\r\n        if (outcome.error().Code() == \"ClientError:100002\" ||\r\n            outcome.error().Code() == \"ClientError:200042\") {\r\n            EXPECT_TRUE(true);\r\n        }\r\n        else {\r\n            EXPECT_TRUE(false);\r\n        }\r\n    }\r\n\r\n    client.EnableRequest();\r\n    SetLogLevel(LogLevel::LogOff);\r\n    SetLogCallback(nullptr);\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(HttpClientTest, PutObjectWithSameContentTest)\r\n{\r\n    //seek to the first position when request done (fail or sucess).\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectWithSameContentTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    auto pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    pOutcome = Client->PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    auto outome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(outome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content);\r\n    std::string memMd5 = ComputeContentMD5(*outome.result().Content());\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nclass  DefaultRateLimiter : public RateLimiter\r\n{\r\npublic:\r\n    DefaultRateLimiter() :rate_(0) {};\r\n    ~DefaultRateLimiter() {};\r\n    virtual void setRate(int rate) { rate_ = rate; };\r\n    virtual int Rate() const { return rate_; };\r\nprivate:\r\n    int rate_;\r\n};\r\n\r\n\r\nTEST_F(HttpClientTest, GetObjectToSameContentTest)\r\n{\r\n    ClientConfiguration conf;\r\n    auto rateLimiter = std::make_shared<DefaultRateLimiter>();\r\n    conf.recvRateLimiter = rateLimiter;\r\n    auto client = OssClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n\r\n    //seek to the first position when get object fail.\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectToSameContentTest\");\r\n    auto content = TestUtils::GetRandomStream(2*1024*1024);\r\n\r\n    PutObjectRequest request(BucketName, key, content);\r\n    auto pOutcome = client.PutObject(request);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n\r\n    //SetLogLevel(LogLevel::LogAll);\r\n    //SetLogCallback(TestUtils::LogPrintCallback);\r\n\r\n    rateLimiter->setRate(256);\r\n    auto tmpFile = TestUtils::GetTargetFileName(\"GetObjectToSameContentTest\");\r\n    auto fcontent = std::make_shared<std::fstream>(tmpFile, std::ios::out| std::ios::binary);\r\n    GetObjectRequest gRequest(BucketName, key);\r\n    gRequest.setResponseStreamFactory([=]() {return fcontent; });\r\n    auto callable = client.GetObjectCallable(gRequest);\r\n\r\n    std::this_thread::sleep_for(std::chrono::milliseconds(1000));\r\n    client.DisableRequest();\r\n    auto outome = callable.get();\r\n    EXPECT_EQ(outome.isSuccess(), false);\r\n    if (!outome.isSuccess()) {\r\n        rateLimiter->setRate(0);\r\n        client.EnableRequest();\r\n        callable = client.GetObjectCallable(gRequest);\r\n        outome = callable.get();\r\n        EXPECT_EQ(outome.isSuccess(), true);\r\n\r\n        std::string oriMd5 = ComputeContentMD5(*content);\r\n        std::string fileMd5 = TestUtils::GetFileMd5(tmpFile);\r\n        EXPECT_EQ(oriMd5, fileMd5);\r\n    }\r\n    client.EnableRequest();\r\n    //SetLogLevel(LogLevel::LogOff);\r\n    //SetLogCallback(nullptr);\r\n    fcontent->close();\r\n    RemoveFile(tmpFile);\r\n}\r\n\r\nTEST_F(HttpClientTest, ResponseBodyToUserContentPasitiveTest)\r\n{\r\n    //don't write error response to user content\r\n    std::string key = TestUtils::GetObjectKey(\"ResponseBodyToUserContentPasitiveTest\");\r\n    auto content = std::make_shared<std::stringstream>();\r\n    GetObjectRequest gRequest(BucketName, key);\r\n    gRequest.setResponseStreamFactory([=]() {return content; });\r\n    auto outcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(content->str().empty(), true);\r\n}\r\n\r\nTEST_F(HttpClientTest, SetNetworkInterfaceTest)\r\n{\r\n    ClientConfiguration conf;\r\n    conf.networkInterface = \"eth100\";\r\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"UseInvalidNetworkInterfaceTest\");\r\n    auto content = std::make_shared<std::stringstream>();\r\n    auto outcome = client.PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ClientError:200045\");\r\n\r\n#ifdef _WIN32\r\n    conf.networkInterface = \"\";\r\n#else\r\n    conf.networkInterface = \"eth0\";\r\n#endif\r\n    OssClient client1(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n    auto content1 = std::make_shared<std::stringstream>();\r\n    outcome = client1.PutObject(BucketName, key, content1);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_TRUE(outcome.result().RequestId().size() > 0);\r\n}\r\n\r\nTEST_F(HttpClientTest, SetInvalidProxyTest)\r\n{\r\n    ClientConfiguration conf;\r\n    conf.connectTimeoutMs = 2000;\r\n    conf.proxyHost = \"127.10.10.10\";\r\n    conf.proxyPort = 10000;\r\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"SetInvalidProxyTest\");\r\n    auto content = std::make_shared<std::stringstream>();\r\n    auto outcome = client.PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ClientError:200007\");\r\n}\r\n\r\nTEST_F(HttpClientTest, ResponseBodyNegativeTest)\r\n{\r\n    //don't write error response to user content\r\n    std::string key = TestUtils::GetObjectKey(\"ResponseBodyToUserContentPasitiveTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"test\");\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    GetObjectRequest gRequest(BucketName, key);\r\n    gRequest.setResponseStreamFactory([=]() {\r\n        return nullptr; \r\n    });\r\n    auto gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_EQ(gOutcome.error().Message(), \"Failed writing received data to disk/application. Caused by content is null.\");\r\n\r\n    gRequest.setResponseStreamFactory([=]() {\r\n        auto ret = std::make_shared<std::stringstream>();\r\n        ret->setstate(std::ios::failbit);\r\n        return ret;\r\n    });\r\n    gOutcome = Client->GetObject(gRequest);\r\n    EXPECT_EQ(gOutcome.isSuccess(), false);\r\n    EXPECT_EQ(gOutcome.error().Message(), \"Failed writing received data to disk/application. Caused by content is in fail state(Logical error on i/o operation).\");\r\n\r\n}\r\n\r\nTEST_F(HttpClientTest, SetDateTimeTest)\r\n{\r\n    //don't write error response to user content\r\n    std::string key = TestUtils::GetObjectKey(\"SetDateTimeTest\");\r\n    auto content = std::make_shared<std::stringstream>(\"test\");\r\n    auto meta = ObjectMetaData();\r\n    auto localTime = std::time(nullptr) - 20*60;\r\n    meta.addHeader(\"x-oss-date\", ToGmtTime(localTime));\r\n    auto outcome = Client->PutObject(BucketName, key, content, meta);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Message(), \"The difference between the request time and the current time is too large.\");\r\n}\r\n\r\nclass Classtest : public Client\r\n{\r\npublic:\r\n\r\n    Classtest(const std::string& servicename, const ClientConfiguration& configuration) : Client(servicename, configuration) {}\r\n\r\n    virtual ~Classtest()\r\n    {\r\n    }\r\n\r\n    void testfunction()\r\n    {\r\n        serviceName();\r\n        hasResponseError(nullptr);\r\n    }\r\nprotected:\r\n    std::shared_ptr<HttpRequest> buildHttpRequest(const std::string& endpoint, const ServiceRequest& msg, Http::Method method) const\r\n    {\r\n        UNUSED_PARAM(endpoint);\r\n        UNUSED_PARAM(msg);\r\n        return std::make_shared<HttpRequest>(method);\r\n    }\r\n};\r\n\r\nTEST_F(HttpClientTest, ClientClassFunctionTest)\r\n{\r\n    ClientConfiguration conf;\r\n\r\n    Classtest client(\"oss\", conf);\r\n\r\n    client.testfunction();\r\n}\r\n\r\nTEST_F(HttpClientTest, HttpMessageClassFunctionTest)\r\n{\r\n    HttpRequest req;\r\n    req.addHeader(\"testname\", \"testvalue\");\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\r\n    *content << \"test\";\r\n    req.addBody(content);\r\n    HttpMessage message1(req);\r\n    HttpMessage message4(static_cast<HttpMessage&&>(message1));\r\n}\r\n}\r\n}"
  },
  {
    "path": "test/src/Other/HttpsTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include \"src/utils/Utils.h\"\r\n\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass HttpsTest : public ::testing::Test {\r\nprotected:\r\n    HttpsTest()\r\n    {\r\n    }\r\n\r\n    ~HttpsTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase() \r\n    {\r\n        std::string endpoint = TestUtils::GetHTTPSEndpoint(Config::Endpoint);\r\n        ClientConfiguration conf;\r\n        conf.verifySSL = false;\r\n        Client = std::make_shared<OssClient>(endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-httpstest\");\r\n        Client->CreateBucket(CreateBucketRequest(BucketName));\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase() \r\n    {\r\n        TestUtils::CleanBucket(*Client, BucketName);\r\n        Client = nullptr;\r\n    }\r\n\r\n    // Sets up the test fixture.\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    // Tears down the test fixture.\r\n    void TearDown() override\r\n    {\r\n    }\r\npublic:\r\n    static std::shared_ptr<OssClient> Client;\r\n    static std::string BucketName;\r\n};\r\n\r\nstd::shared_ptr<OssClient> HttpsTest::Client = nullptr;\r\nstd::string HttpsTest::BucketName = \"\";\r\n\r\n\r\nTEST_F(HttpsTest, CreateAndDeleteBucketTest)\r\n{\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(\"cpp-sdk-httpstest\");\r\n\r\n    //assert bucket does not exist\r\n    EXPECT_EQ(Client->DoesBucketExist(bucketName), false);\r\n\r\n    //create a new bucket\r\n    Client->CreateBucket(CreateBucketRequest(bucketName));\r\n    //TestUtils::WaitForCacheExpire(5);\r\n    EXPECT_EQ(Client->DoesBucketExist(bucketName), true);\r\n\r\n    //delete the bucket\r\n    Client->DeleteBucket(DeleteBucketRequest(bucketName));\r\n    TestUtils::WaitForCacheExpire(5);\r\n    Client->DoesBucketExist(bucketName);\r\n    TestUtils::WaitForCacheExpire(5);\r\n    EXPECT_EQ(Client->DoesBucketExist(bucketName), false);\r\n}\r\n\r\nTEST_F(HttpsTest, GetBucketAclTest)\r\n{\r\n    auto outcome = Client->GetBucketAcl(BucketName);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().Acl(), CannedAccessControlList::Private);\r\n\r\n    Client->SetBucketAcl(BucketName, CannedAccessControlList::PublicRead);\r\n    TestUtils::WaitForCacheExpire(8);\r\n    outcome = Client->GetBucketAcl(BucketName);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().Acl(), CannedAccessControlList::PublicRead);\r\n}\r\n\r\n\r\nTEST_F(HttpsTest, GetBucketInfoTest)\r\n{\r\n    auto outcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto aclOutcome = Client->GetBucketAcl(BucketName);\r\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\r\n\r\n    EXPECT_EQ(outcome.result().Acl(), aclOutcome.result().Acl());\r\n}\r\n\r\nTEST_F(HttpsTest, GetBucketLocationTest)\r\n{\r\n    auto locOutcome = Client->GetBucketLocation(BucketName);\r\n    EXPECT_EQ(locOutcome.isSuccess(), true);\r\n    EXPECT_EQ(locOutcome.result().Location().compare(0,4,\"oss-\", 4), 0);\r\n}\r\n\r\nTEST_F(HttpsTest, GetBucketStatTest)\r\n{\r\n    //put object\r\n    auto objectName = BucketName;\r\n    objectName.append(\"firstobject\");\r\n    Client->PutObject(BucketName, objectName, std::make_shared<std::stringstream>(\"1234\"));\r\n\r\n    auto bsOutcome = Client->GetBucketStat(BucketName);\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bsOutcome.result().Storage(), 4ULL);\r\n    EXPECT_EQ(bsOutcome.result().ObjectCount(), 1ULL);\r\n    EXPECT_EQ(bsOutcome.result().MultipartUploadCount(), 0ULL);\r\n}\r\n\r\n\r\nTEST_F(HttpsTest, ListBucketspagingTest)\r\n{\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(\"cpp-sdk-httpstest\");\r\n\r\n    for (int i = 0; i < 5; i++)\r\n    {\r\n        auto name = bucketName;\r\n        name.append(\"-\").append(std::to_string(i));\r\n        Client->CreateBucket(name);\r\n    }\r\n\r\n    //list all\r\n    ListBucketsRequest request;\r\n    request.setPrefix(bucketName);\r\n    request.setMaxKeys(100);\r\n    auto outcome = Client->ListBuckets(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().Buckets().size(), 5UL);\r\n\r\n\r\n    //list by step\r\n    request.setMaxKeys(2);\r\n    bool IsTruncated = false;\r\n    size_t total = 0;\r\n    do {\r\n        outcome = Client->ListBuckets(request);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        EXPECT_LT(outcome.result().Buckets().size(), 3UL);\r\n        total += outcome.result().Buckets().size();\r\n        request.setMarker(outcome.result().NextMarker());\r\n        IsTruncated = outcome.result().IsTruncated();\r\n    } while (IsTruncated);\r\n    EXPECT_EQ(total, 5UL);\r\n\r\n    //delete all\r\n    TestUtils::CleanBucketsByPrefix(*Client, bucketName);\r\n}\r\n\r\nTEST_F(HttpsTest, PutObjectTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n}\r\n\r\nTEST_F(HttpsTest, GetObjectTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n\r\n    auto gOutcome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content.get());\r\n    std::string memMd5 = ComputeContentMD5(*gOutcome.result().Content().get());\r\n\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nTEST_F(HttpsTest, HeadObjectTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"HeadObjectTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto hOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n\r\n    EXPECT_EQ(outcome.result().ETag(), hOutcome.result().ETag());\r\n}\r\n\r\nTEST_F(HttpsTest, GetObjectMetaTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectMetaTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    ObjectMetaData meta;\r\n    meta.UserMetaData()[\"user\"] = \"test\";\r\n    auto outcome = Client->PutObject(BucketName, key, content, meta);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto gOutcome = Client->GetObjectMeta(BucketName, key);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().UserMetaData().find(\"user\"), gOutcome.result().UserMetaData().end());\r\n\r\n    auto hOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().UserMetaData().at(\"user\"), \"test\");\r\n}\r\n\r\nTEST_F(HttpsTest, ListObjectsTest)\r\n{\r\n    auto outcome = Client->ListObjects(BucketName);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ((outcome.result().ObjectSummarys().size() > 0UL), true);\r\n}\r\n\r\nTEST_F(HttpsTest, DeleteObjectsTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"DeleteObjectsTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    Client->PutObject(BucketName, key, content);\r\n\r\n    auto outcome = Client->ListObjects(BucketName);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ((outcome.result().ObjectSummarys().size() > 0UL), true);\r\n    for (auto const &obj : outcome.result().ObjectSummarys()) {\r\n        Client->DeleteObject(BucketName, obj.Key());\r\n    }\r\n\r\n    outcome = Client->ListObjects(BucketName);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().ObjectSummarys().size(), 0UL);\r\n}\r\n\r\nTEST_F(HttpsTest, GetPreSignedUriTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"GetPreSignedUriTest\");\r\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    std::string actualETag = pOutcome.result().ETag();\r\n\r\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Get);\r\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n\r\n    auto gOutcome = Client->GetObjectByUrl(urlOutcome.result());\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n    if (gOutcome.isSuccess()) {\r\n        EXPECT_STREQ(actualETag.c_str(), gOutcome.result().Metadata().ETag().c_str());\r\n    }\r\n    else {\r\n        EXPECT_TRUE(false);\r\n    }\r\n}\r\n\r\nTEST_F(HttpsTest, PutPreSignedUriTest)\r\n{\r\n    std::string key = TestUtils::GetObjectKey(\"PutPreSignedUriTest\");\r\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\r\n\r\n    std::string md5 = ComputeContentMD5(*content.get());\r\n\r\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\r\n    request.setContentMd5(md5);\r\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n\r\n    ObjectMetaData meta;\r\n    meta.setContentMd5(md5);\r\n\r\n    auto pOutcome = Client->PutObjectByUrl(urlOutcome.result(), content, meta);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    auto metaOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\r\n}\r\n\r\nTEST_F(HttpsTest, MultipartUploadTest)\r\n{\r\n    auto key = TestUtils::GetObjectKey(\"MultipartUploadTest\");\r\n    InitiateMultipartUploadRequest request(BucketName, key);\r\n    auto initOutcome = Client->InitiateMultipartUpload(request);\r\n    EXPECT_EQ(initOutcome.isSuccess(), true);\r\n\r\n    auto content = TestUtils::GetRandomStream(100*1024);\r\n    UploadPartRequest uRequest(BucketName, key, content);\r\n    uRequest.setPartNumber(1);\r\n    uRequest.setUploadId(initOutcome.result().UploadId());\r\n    auto uploadPartOutcome = Client->UploadPart(uRequest);\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n\r\n    content = TestUtils::GetRandomStream(100);\r\n    uRequest.setPartNumber(2);\r\n    uRequest.setConetent(content);\r\n    uRequest.setUploadId(initOutcome.result().UploadId());\r\n    uploadPartOutcome = Client->UploadPart(uRequest);\r\n    EXPECT_EQ(uploadPartOutcome.isSuccess(), true);\r\n\r\n    ListMultipartUploadsRequest lpRequest(BucketName);\r\n    lpRequest.setKeyMarker(\"MultipartUploadTest\");\r\n    auto lmuOutcome = Client->ListMultipartUploads(lpRequest);\r\n    EXPECT_EQ(lmuOutcome.isSuccess(), true);\r\n    EXPECT_EQ(lmuOutcome.result().MultipartUploadList().size(), 1U);\r\n    EXPECT_EQ(lmuOutcome.result().MultipartUploadList().begin()->Key, key);\r\n\r\n    auto lOutcome = Client->ListParts(ListPartsRequest(BucketName, key, initOutcome.result().UploadId()));\r\n    EXPECT_EQ(lOutcome.isSuccess(), true);\r\n\r\n    CompleteMultipartUploadRequest cRequest(BucketName, key,\r\n        lOutcome.result().PartList(), initOutcome.result().UploadId());\r\n\r\n    auto outcome = Client->CompleteMultipartUpload(cRequest);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto hOutcome = Client->GetObjectMeta(BucketName, key);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().ContentLength(), ((100LL * 1024LL) + 100LL));\r\n}\r\n\r\nTEST_F(HttpsTest, CacertPositiveTest)\r\n{\r\n    ClientConfiguration conf;\r\n    std::string caFile = Config::GetDataPath();\r\n    caFile.append(\"ca-certificates.crt\");\r\n    conf.caFile = caFile;\r\n    conf.caPath = Config::GetDataPath();\r\n    conf.verifySSL = true;\r\n    std::string endpoint = TestUtils::GetHTTPSEndpoint(Config::Endpoint);\r\n    OssClient client(endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n    SetLogLevel(LogLevel::LogAll);\r\n    SetLogCallback(TestUtils::LogPrintCallback);\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"CacertPositiveTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    auto outcome = client.PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(client.DoesObjectExist(BucketName, key), true);\r\n\r\n    auto gOutcome = client.GetObject(BucketName, key);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content.get());\r\n    std::string memMd5 = ComputeContentMD5(*gOutcome.result().Content().get());\r\n\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n    SetLogLevel(LogLevel::LogOff);\r\n    SetLogCallback(nullptr);\r\n}\r\n\r\nTEST_F(HttpsTest, CacertNegativeTest)\r\n{\r\n    ClientConfiguration conf;\r\n    conf.verifySSL = true;\r\n    conf.caFile = \"none\";\r\n    conf.caPath = \"none\";\r\n    std::string endpoint = TestUtils::GetHTTPSEndpoint(Config::Endpoint);\r\n    OssClient client(endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n    SetLogLevel(LogLevel::LogAll);\r\n    SetLogCallback(TestUtils::LogPrintCallback);\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"CacertNegativeTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    auto outcome = client.PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), false);\r\n    EXPECT_EQ(outcome.error().Code(), \"ClientError:200077\");\r\n    EXPECT_TRUE(outcome.error().Message().find(\"Problem with the SSL CA cert\") != std::string::npos);\r\n\r\n    SetLogLevel(LogLevel::LogOff);\r\n    SetLogCallback(nullptr);\r\n}\r\n\r\n\r\n}\r\n}"
  },
  {
    "path": "test/src/Other/IpEndpointTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include \"src/utils/Utils.h\"\r\n\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass IpEndpointTest : public ::testing::Test {\r\nprotected:\r\n    IpEndpointTest()\r\n    {\r\n    }\r\n\r\n    ~IpEndpointTest() override\r\n    {\r\n    }\r\n\r\n    // Sets up the stuff shared by all tests in this test case.\r\n    static void SetUpTestCase() \r\n    {\r\n        std::string endpoint = TestUtils::GetIpByEndpoint(Config::Endpoint);\r\n        Client = std::make_shared<OssClient>(endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\r\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-ipendpoint\");\r\n        Client->CreateBucket(CreateBucketRequest(BucketName));\r\n        auto outcome = Client->GetBucketAcl(BucketName);\r\n        if (outcome.isSuccess() == false && outcome.error().Code() == \"SecondLevelDomainForbidden\") {\r\n            SupportSecondLevelDomain = false;\r\n        }\r\n    }\r\n\r\n    // Tears down the stuff shared by all tests in this test case.\r\n    static void TearDownTestCase() \r\n    {\r\n        OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\r\n        TestUtils::CleanBucket(client, BucketName);\r\n        Client = nullptr;\r\n    }\r\n\r\n    // Sets up the test fixture.\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    // Tears down the test fixture.\r\n    void TearDown() override\r\n    {\r\n    }\r\npublic:\r\n    static std::shared_ptr<OssClient> Client;\r\n    static std::string BucketName;\r\n    static bool SupportSecondLevelDomain;\r\n};\r\n\r\nstd::shared_ptr<OssClient> IpEndpointTest::Client = nullptr;\r\nstd::string IpEndpointTest::BucketName = \"\";\r\nbool IpEndpointTest::SupportSecondLevelDomain = true;\r\n\r\n\r\nTEST_F(IpEndpointTest, CreateAndDeleteBucketTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(\"cpp-sdk-ipendpointtest\");\r\n\r\n    //assert bucket does not exist\r\n    EXPECT_EQ(Client->DoesBucketExist(bucketName), false);\r\n\r\n    //create a new bucket\r\n    Client->CreateBucket(CreateBucketRequest(bucketName));\r\n    //TestUtils::WaitForCacheExpire(5);\r\n    EXPECT_EQ(Client->DoesBucketExist(bucketName), true);\r\n\r\n    //delete the bucket\r\n    Client->DeleteBucket(DeleteBucketRequest(bucketName));\r\n    TestUtils::WaitForCacheExpire(5);\r\n    EXPECT_EQ(Client->DoesBucketExist(bucketName), false);\r\n}\r\n\r\nTEST_F(IpEndpointTest, GetBucketAclTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    auto outcome = Client->GetBucketAcl(BucketName);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().Acl(), CannedAccessControlList::Private);\r\n\r\n    Client->SetBucketAcl(BucketName, CannedAccessControlList::PublicRead);\r\n    TestUtils::WaitForCacheExpire(8);\r\n    outcome = Client->GetBucketAcl(BucketName);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().Acl(), CannedAccessControlList::PublicRead);\r\n}\r\n\r\n\r\nTEST_F(IpEndpointTest, GetBucketInfoTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    auto outcome = Client->GetBucketInfo(BucketName);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto aclOutcome = Client->GetBucketAcl(BucketName);\r\n    EXPECT_EQ(aclOutcome.isSuccess(), true);\r\n\r\n    EXPECT_EQ(outcome.result().Acl(), aclOutcome.result().Acl());\r\n}\r\n\r\nTEST_F(IpEndpointTest, GetBucketLocationTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    auto locOutcome = Client->GetBucketLocation(BucketName);\r\n    EXPECT_EQ(locOutcome.isSuccess(), true);\r\n    EXPECT_EQ(locOutcome.result().Location().compare(0,4,\"oss-\", 4), 0);\r\n}\r\n\r\nTEST_F(IpEndpointTest, GetBucketStatTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    //put object\r\n    auto objectName = BucketName;\r\n    objectName.append(\"firstobject\");\r\n    Client->PutObject(BucketName, objectName, std::make_shared<std::stringstream>(\"1234\"));\r\n\r\n    auto bsOutcome = Client->GetBucketStat(BucketName);\r\n    EXPECT_EQ(bsOutcome.isSuccess(), true);\r\n    EXPECT_EQ(bsOutcome.result().Storage(), 4ULL);\r\n    EXPECT_EQ(bsOutcome.result().ObjectCount(), 1ULL);\r\n    EXPECT_EQ(bsOutcome.result().MultipartUploadCount(), 0ULL);\r\n}\r\n\r\n\r\nTEST_F(IpEndpointTest, ListBucketspagingTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    //get a random bucketName\r\n    auto bucketName = TestUtils::GetBucketName(\"cpp-sdk-ipendpointtest\");\r\n\r\n    for (int i = 0; i < 5; i++)\r\n    {\r\n        auto name = bucketName;\r\n        name.append(\"-\").append(std::to_string(i));\r\n        Client->CreateBucket(name);\r\n    }\r\n\r\n    //list all\r\n    ListBucketsRequest request;\r\n    request.setPrefix(bucketName);\r\n    request.setMaxKeys(100);\r\n    auto outcome = Client->ListBuckets(request);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().Buckets().size(), 5UL);\r\n\r\n\r\n    //list by step\r\n    request.setMaxKeys(2);\r\n    bool IsTruncated = false;\r\n    size_t total = 0;\r\n    do {\r\n        outcome = Client->ListBuckets(request);\r\n        EXPECT_EQ(outcome.isSuccess(), true);\r\n        EXPECT_LT(outcome.result().Buckets().size(), 3UL);\r\n        total += outcome.result().Buckets().size();\r\n        request.setMarker(outcome.result().NextMarker());\r\n        IsTruncated = outcome.result().IsTruncated();\r\n    } while (IsTruncated);\r\n    EXPECT_EQ(total, 5UL);\r\n\r\n    //delete all\r\n    OssClient client(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, ClientConfiguration());\r\n    TestUtils::CleanBucketsByPrefix(client, bucketName);\r\n}\r\n\r\nTEST_F(IpEndpointTest, PutObjectTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"PutObjectTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n}\r\n\r\nTEST_F(IpEndpointTest, GetObjectTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n\r\n    auto gOutcome = Client->GetObject(BucketName, key);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n    std::string oriMd5 = ComputeContentMD5(*content.get());\r\n    std::string memMd5 = ComputeContentMD5(*gOutcome.result().Content().get());\r\n\r\n    EXPECT_EQ(oriMd5, memMd5);\r\n}\r\n\r\nTEST_F(IpEndpointTest, HeadObjectTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"HeadObjectTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    auto outcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto hOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n\r\n    EXPECT_EQ(outcome.result().ETag(), hOutcome.result().ETag());\r\n}\r\n\r\nTEST_F(IpEndpointTest, GetObjectMetaTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"GetObjectMetaTest\");\r\n    auto content = TestUtils::GetRandomStream(1024);\r\n    ObjectMetaData meta;\r\n    meta.UserMetaData()[\"user\"] = \"test\";\r\n    auto outcome = Client->PutObject(BucketName, key, content, meta);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n\r\n    auto gOutcome = Client->GetObjectMeta(BucketName, key);\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n    EXPECT_EQ(gOutcome.result().UserMetaData().find(\"user\"), gOutcome.result().UserMetaData().end());\r\n\r\n    auto hOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(hOutcome.isSuccess(), true);\r\n    EXPECT_EQ(hOutcome.result().UserMetaData().at(\"user\"), \"test\");\r\n}\r\n\r\nTEST_F(IpEndpointTest, ListObjectsTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    auto outcome = Client->ListObjects(BucketName);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ((outcome.result().ObjectSummarys().size() > 0UL), true);\r\n}\r\n\r\nTEST_F(IpEndpointTest, DeleteObjectsTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"DeleteObjectsTest\");\r\n    auto content = TestUtils::GetRandomStream(100);\r\n    Client->PutObject(BucketName, key, content);\r\n\r\n    auto outcome = Client->ListObjects(BucketName);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ((outcome.result().ObjectSummarys().size() > 0UL), true);\r\n    for (auto const &obj : outcome.result().ObjectSummarys()) {\r\n        Client->DeleteObject(BucketName, obj.Key());\r\n    }\r\n\r\n    outcome = Client->ListObjects(BucketName);\r\n    EXPECT_EQ(outcome.isSuccess(), true);\r\n    EXPECT_EQ(outcome.result().ObjectSummarys().size(), 0UL);\r\n}\r\n\r\nTEST_F(IpEndpointTest, GetPreSignedUriTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"GetPreSignedUriTest\");\r\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\r\n\r\n    auto pOutcome = Client->PutObject(BucketName, key, content);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    std::string actualETag = pOutcome.result().ETag();\r\n\r\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Get);\r\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n\r\n    auto gOutcome = Client->GetObjectByUrl(urlOutcome.result());\r\n    EXPECT_EQ(gOutcome.isSuccess(), true);\r\n\r\n    if (gOutcome.isSuccess()) {\r\n        EXPECT_STREQ(actualETag.c_str(), gOutcome.result().Metadata().ETag().c_str());\r\n    }\r\n    else {\r\n        EXPECT_TRUE(false);\r\n    }\r\n}\r\n\r\nTEST_F(IpEndpointTest, PutPreSignedUriTest)\r\n{\r\n    if (!SupportSecondLevelDomain)\r\n        return;\r\n\r\n    std::string key = TestUtils::GetObjectKey(\"PutPreSignedUriTest\");\r\n    std::shared_ptr<std::iostream> content = TestUtils::GetRandomStream(2048);\r\n\r\n    std::string md5 = ComputeContentMD5(*content.get());\r\n\r\n    GeneratePresignedUrlRequest request(BucketName, key, Http::Put);\r\n    request.setContentMd5(md5);\r\n    auto urlOutcome = Client->GeneratePresignedUrl(request);\r\n    EXPECT_EQ(urlOutcome.isSuccess(), true);\r\n\r\n    ObjectMetaData meta;\r\n    meta.setContentMd5(md5);\r\n\r\n    auto pOutcome = Client->PutObjectByUrl(urlOutcome.result(), content, meta);\r\n    EXPECT_EQ(pOutcome.isSuccess(), true);\r\n    auto metaOutcome = Client->HeadObject(BucketName, key);\r\n    EXPECT_EQ(metaOutcome.isSuccess(), true);\r\n}\r\n\r\n}\r\n}"
  },
  {
    "path": "test/src/Other/LogTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <src/utils/Crc64.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include <alibabacloud/oss/OssClient.h>\n#include \"src/utils/LogUtils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass LogTest : public ::testing::Test {\nprotected:\n    LogTest()\n    {\n    }\n\n    ~LogTest() override\n    {\n    }\n\n    void SetUp() override\n    {\n    }\n\n    void TearDown() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n        Client = TestUtils::GetOssClientDefault();\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n        Client = nullptr;\n    }\n\npublic:\n    static void LogCallbackFunc(LogLevel level, const std::string &stream);\n    static std::shared_ptr<OssClient> Client;\n    static std::string LogString;\n};\n\nstd::shared_ptr<OssClient> LogTest::Client = nullptr;\nstd::string LogTest::LogString = \"\";\n\nvoid LogTest::LogCallbackFunc(LogLevel level, const std::string &stream)\n{\n    LogString = stream;\n    std::cout << stream;\n    if (level == LogLevel::LogOff) {\n        LogString.append(\"haha\");\n    }\n}\n\nTEST_F(LogTest, DisableLogLevelTest)\n{\n    SetLogLevel(LogLevel::LogOff);\n    LogString = \"\";\n    auto outcome = Client->ListBuckets();\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(LogString.empty(), true);\n}\n\nTEST_F(LogTest, DisableLogCallbackTest)\n{\n    SetLogLevel(LogLevel::LogAll);\n    SetLogCallback(nullptr);\n    LogString = \"\";\n    auto outcome = Client->ListBuckets();\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(LogString.empty(), true);\n    SetLogLevel(LogLevel::LogOff);\n}\n\nTEST_F(LogTest, EnableLogTest)\n{\n    SetLogLevel(LogLevel::LogAll);\n    SetLogCallback(LogCallbackFunc);\n    LogString = \"\";\n    auto outcome = Client->ListBuckets();\n    if (!outcome.isSuccess()) {\n        TestUtils::WaitForCacheExpire(2);\n        outcome = Client->ListBuckets();\n    }\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_EQ(LogString.empty(), false);\n    SetLogLevel(LogLevel::LogOff);\n\n}\n\nTEST_F(LogTest, LogMacroTest)\n{\n    SetLogLevel(LogLevel::LogAll);\n    SetLogCallback(LogCallbackFunc);\n    LogString = \"\";\n\n    OSS_LOG(LogLevel::LogFatal, \"LogTest\", \"LogMacroTest%s\",\"Fatal\");\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[FATAL]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[LogTest]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"LogMacroTestFatal\") != nullptr);\n    std::cout << LogString;\n\n    LogString = \"\";\n    OSS_LOG(LogLevel::LogError, \"LogTest\", \"LogMacroTest%s\", \"Error\");\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[ERROR]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[LogTest]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"LogMacroTestError\") != nullptr);\n    std::cout << LogString;\n\n    LogString = \"\";\n    OSS_LOG(LogLevel::LogWarn, \"LogTest\", \"LogMacroTest%s\", \"Warn\");\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[WARN]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[LogTest]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"LogMacroTestWarn\") != nullptr);\n\n    LogString = \"\";\n    OSS_LOG(LogLevel::LogInfo, \"LogTest\", \"LogMacroTest%s\", \"Info\");\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[INFO]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[LogTest]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"LogMacroTestInfo\") != nullptr);\n\n    LogString = \"\";\n    OSS_LOG(LogLevel::LogDebug, \"LogTest\", \"LogMacroTest%s\", \"Debug\");\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[DEBUG]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[LogTest]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"LogMacroTestDebug\") != nullptr);\n\n    LogString = \"\";\n    OSS_LOG(LogLevel::LogTrace, \"LogTest\", \"LogMacroTest%s\", \"Trace\");\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[TRACE]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[LogTest]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"LogMacroTestTrace\") != nullptr);\n\n    LogString = \"\";\n    OSS_LOG(LogLevel::LogOff, \"LogTest\", \"LogMacroTest%s\", \"Off\");\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[OFF]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[LogTest]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"LogMacroTestOff\") != nullptr);\n\n    LogString = \"\";\n    OSS_LOG(LogLevel::LogAll, \"LogTest\", \"LogMacroTest%s\", \"All\");\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[ALL]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"[LogTest]\") != nullptr);\n    EXPECT_TRUE(strstr(LogString.c_str(), \"LogMacroTestAll\") != nullptr);\n    SetLogLevel(LogLevel::LogOff);\n}\n\nTEST_F(LogTest, EndofLineTest)\n{\n    SetLogLevel(LogLevel::LogAll);\n    SetLogCallback(LogCallbackFunc);\n    LogString = \"\";\n\n    OSS_LOG(LogLevel::LogTrace, \"LogTest\", \"LogMacroTest%s\\n\", \"Trace\");\n    EXPECT_EQ(LogString.c_str()[LogString.size()-1], '\\n');\n    EXPECT_EQ(LogString.c_str()[LogString.size() - 2], 'e');\n    std::cout << LogString;\n\n    LogString = \"\";\n    OSS_LOG(LogLevel::LogTrace, \"LogTest\", \"LogMacroTest%s\\n\\n\\n\", \"Trace\");\n    EXPECT_EQ(LogString.c_str()[LogString.size()-1], '\\n');\n    EXPECT_EQ(LogString.c_str()[LogString.size() - 2], 'e');\n    std::cout << LogString;\n\n    LogString = \"\";\n    OSS_LOG(LogLevel::LogTrace, \"LogTest\", \"LogMacroTest%s\", \"Trace\");\n    EXPECT_EQ(LogString.c_str()[LogString.size() - 1], '\\n');\n    EXPECT_EQ(LogString.c_str()[LogString.size() - 2], 'e');\n    std::cout << LogString;\n\n    LogString = \"\";\n    OSS_LOG(LogLevel::LogTrace, \"LogTest\", \"\");\n    EXPECT_EQ(LogString.c_str()[LogString.size() - 1], '\\n');\n    EXPECT_EQ(LogString.c_str()[LogString.size() - 2], ']');\n    std::cout << LogString;\n    SetLogLevel(LogLevel::LogOff);\n}\n\n}\n}\n"
  },
  {
    "path": "test/src/Other/RateLimiterTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <alibabacloud/oss/OssClient.h>\n#include <alibabacloud/oss/client/RateLimiter.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n#include <chrono>\n#include <future>\n#include <fstream>\n\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass RateLimiterTest : public ::testing::Test {\nprotected:\n    RateLimiterTest()\n    {\n    }\n\n    ~RateLimiterTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n        Client = TestUtils::GetOssClientDefault();\n        BucketName = TestUtils::GetBucketName(\"cpp-sdk-ratelimitertest\");\n        Client->CreateBucket(CreateBucketRequest(BucketName));\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n        TestUtils::CleanBucket(*Client, BucketName);\n        Client = nullptr;\n    }\n\n\n    void SetUp() override\n    {\n    }\n\n    void TearDown() override\n    {\n    }\n\npublic:\n    static std::shared_ptr<OssClient> Client;\n    static std::string BucketName;\n\n    class Timer\n    {\n    public:\n        Timer() : begin_(std::chrono::high_resolution_clock::now()) {}\n        void reset() { begin_ = std::chrono::high_resolution_clock::now(); }\n        int64_t elapsed() const\n        {\n            return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - begin_).count();\n        }\n        int64_t elapsed_micro() const\n        {\n            return std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::high_resolution_clock::now() - begin_).count();\n        }\n    private:\n        std::chrono::time_point<std::chrono::high_resolution_clock> begin_;\n    };\n};\n\nstd::shared_ptr<OssClient> RateLimiterTest::Client = nullptr;\nstd::string RateLimiterTest::BucketName = \"\";\n\nclass  DefaultRateLimiter: public RateLimiter\n{\npublic:\n    DefaultRateLimiter():rate_(0) {};\n    ~DefaultRateLimiter() {};\n    virtual void setRate(int rate) { rate_ = rate; };\n    virtual int Rate() const { return rate_; };\nprivate:\n    int rate_;\n};\n\nTEST_F(RateLimiterTest, NoRateLimiterTest)\n{\n    ClientConfiguration conf;\n    auto client = OssClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    auto content = TestUtils::GetRandomStream(1 * 1024 * 1024);\n    auto key = TestUtils::GetObjectKey(\"NoRateLimiterTest\");\n\n    client.PutObject(BucketName, key, content);\n    EXPECT_TRUE(client.DoesObjectExist(BucketName, key));\n\n    auto outcome = client.GetObject(BucketName, key);\n    EXPECT_EQ(outcome.isSuccess(), true);\n}\n\nTEST_F(RateLimiterTest, DefaultRateLimiterTest)\n{\n    ClientConfiguration conf;\n    auto rateLimiter = std::make_shared<DefaultRateLimiter>();\n    conf.sendRateLimiter = rateLimiter;\n    conf.recvRateLimiter = rateLimiter;\n    auto client = OssClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    auto content = TestUtils::GetRandomStream(2 * 1024 * 1024);\n    auto key = TestUtils::GetObjectKey(\"DefaultRateLimiterTest\");\n    Timer timer;\n\n    //256k\n    rateLimiter->setRate(256);\n\n    timer.reset();\n    client.PutObject(BucketName, key, content);\n    auto diff_put = timer.elapsed();\n    EXPECT_TRUE(client.DoesObjectExist(BucketName, key));\n\n    timer.reset();\n    auto outcome = client.GetObject(BucketName, key);\n    auto diff_get = timer.elapsed();\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    EXPECT_NEAR((double)diff_put, (double)diff_get, 1000.0);\n}\n\nTEST_F(RateLimiterTest, PutObjectRateLimiterTest)\n{\n    ClientConfiguration conf;\n    auto sendRateLimiter = std::make_shared<DefaultRateLimiter>();\n    conf.sendRateLimiter = sendRateLimiter;\n    auto client = OssClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    auto content = TestUtils::GetRandomStream(5 * 1024 * 1024);\n    auto key = TestUtils::GetObjectKey(\"PutObjectRateLimiterTest\");\n    Timer timer;\n\n    timer.reset();\n    auto outcome = client.PutObject(BucketName, key, content);\n    auto diff_no_limit = timer.elapsed();\n    EXPECT_EQ(outcome.isSuccess(),  true);\n\n    sendRateLimiter->setRate(500);\n    timer.reset();\n    outcome = client.PutObject(BucketName, key, content);\n    EXPECT_EQ(outcome.isSuccess(), true);\n    auto diff_500k = timer.elapsed();\n    EXPECT_NEAR((double)diff_500k, (double)10000LL, (double)2000LL);\n\n    std::cout << \"diff_no_limit:\" << diff_no_limit << \" ms, diff_500k:\" << diff_500k << \" ms\" << std::endl;\n}\n\nTEST_F(RateLimiterTest, GetObjectRateLimiterTest)\n{\n    ClientConfiguration conf;\n    auto recvRateLimiter = std::make_shared<DefaultRateLimiter>();\n    conf.recvRateLimiter = recvRateLimiter;\n    auto client = OssClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    auto content = TestUtils::GetRandomStream(10 * 1024 * 1024);\n    auto key = TestUtils::GetObjectKey(\"GetObjectRateLimiterTest\");\n    Timer timer;\n\n    client.PutObject(BucketName, key, content);\n    EXPECT_TRUE(client.DoesObjectExist(BucketName, key));\n\n    timer.reset();\n    auto outcome = client.GetObject(BucketName, key);\n    auto diff_no_limit = timer.elapsed();\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    timer.reset();\n    recvRateLimiter->setRate(1024);\n    outcome = client.GetObject(BucketName, key);\n    auto diff_1024k = timer.elapsed();\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_NEAR((double)diff_1024k, (double)10000LL, (double)2000LL);\n    std::cout << \"diff_no_limit:\" << diff_no_limit << \" ms, diff_1024k:\" << diff_1024k << \" ms\" << std::endl;\n}\n\nTEST_F(RateLimiterTest, SetRateWhenUploadingTest)\n{\n    ClientConfiguration conf;\n    auto sendRateLimiter = std::make_shared<DefaultRateLimiter>();\n    conf.sendRateLimiter = sendRateLimiter;\n    auto client = OssClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    auto content = TestUtils::GetRandomStream(10 * 1024 * 1024);\n    auto key = TestUtils::GetObjectKey(\"SetRateWhenUploadingTest\");\n    Timer timer;\n\n    timer.reset();\n    auto outcome = client.PutObject(BucketName, key, content);\n    auto diff_no_limit = timer.elapsed();\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    sendRateLimiter->setRate(512);\n    timer.reset();\n    PutObjectRequest request(BucketName, key, content);\n    auto callableOutcome = client.PutObjectCallable(request);\n    TestUtils::WaitForCacheExpire(10);\n\n    sendRateLimiter->setRate(1024);\n    outcome = callableOutcome.get();\n    EXPECT_EQ(outcome.isSuccess(), true);\n    auto diff_limit = timer.elapsed();\n    EXPECT_NEAR((double)diff_limit, (double)15000LL, (double)2500LL);\n\n    sendRateLimiter->setRate(0);\n    timer.reset();\n    outcome = client.PutObject(BucketName, key, content);\n    auto diff_no_limit1 = timer.elapsed();\n    EXPECT_EQ(outcome.isSuccess(), true);\n    EXPECT_NEAR((double)diff_no_limit, (double)diff_no_limit1, (double)2000LL);\n\n    std::cout << \"diff_no_limit:\"  << diff_no_limit << \n                \" ms, diff_limit:\" << diff_limit   << \n                \" ms, diff_no_limit1:\" << diff_no_limit1 << \" ms\" << std::endl;\n}\n\n\nTEST_F(RateLimiterTest, SetRateWhenDownloadingTest)\n{\n    ClientConfiguration conf;\n    auto recvRateLimiter = std::make_shared<DefaultRateLimiter>();\n    conf.recvRateLimiter = recvRateLimiter;\n    auto client = OssClient(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\n    auto content = TestUtils::GetRandomStream(10 * 1024 * 1024);\n    auto key = TestUtils::GetObjectKey(\"SetRateWhenUploadingTest\");\n    Timer timer;\n\n    client.PutObject(BucketName, key, content);\n    EXPECT_TRUE(client.DoesObjectExist(BucketName, key));\n\n    timer.reset();\n    auto outcome = client.GetObject(BucketName, key);\n    auto diff_no_limit = timer.elapsed();\n    EXPECT_EQ(outcome.isSuccess(), true);\n\n    recvRateLimiter->setRate(512);\n    timer.reset();\n    GetObjectRequest request(BucketName, key);\n    auto callableOutcome = client.GetObjectCallable(request);\n    TestUtils::WaitForCacheExpire(10);\n\n    recvRateLimiter->setRate(256);\n    outcome = callableOutcome.get();\n    EXPECT_EQ(outcome.isSuccess(), true);\n    auto diff_limit = timer.elapsed();\n    EXPECT_NEAR((double)diff_limit, (double)30000LL, (double)2000LL);\n\n    recvRateLimiter->setRate(0);\n    timer.reset();\n    outcome = client.GetObject(BucketName, key);\n    auto diff_no_limit1 = timer.elapsed();\n    EXPECT_EQ(outcome.isSuccess(), true);\n    if (diff_no_limit1 < diff_no_limit) {\n        EXPECT_TRUE(true);\n    }\n    else {\n        EXPECT_NEAR((double)diff_no_limit, (double)diff_no_limit1, (double)2000LL);\n    }\n\n    std::cout << \"diff_no_limit:\" << diff_no_limit <<\n                 \" ms, diff_limit:\" << diff_limit <<\n                 \" ms, diff_no_limit1 \" << diff_no_limit1 << \" ms\" << std::endl;\n}\n\n}\n}"
  },
  {
    "path": "test/src/Other/SignerTest.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <gtest/gtest.h>\n#include <src/signer/Signer.h>\n#include \"../Config.h\"\n#include \"../Utils.h\"\n\nnamespace AlibabaCloud {\nnamespace OSS {\n\nclass SignerTest : public ::testing::Test {\nprotected:\n    SignerTest()\n    {\n    }\n\n    ~SignerTest() override\n    {\n    }\n\n    // Sets up the stuff shared by all tests in this test case.\n    static void SetUpTestCase()\n    {\n\n    }\n\n    // Tears down the stuff shared by all tests in this test case.\n    static void TearDownTestCase()\n    {\n    }\n\n    void SetUp() override\n    {\n    }\n\n    void TearDown() override\n    {\n    }\npublic:\n\n};\n\nTEST_F(SignerTest, SignerV4)\n{\n    auto signer = Signer::createSigner(SignatureVersionType::V4);\n\n    auto credentialsProvider = std::make_shared<SimpleCredentialsProvider>(\"ak\", \"sk\", \"\");\n\n    auto credentials = credentialsProvider->getCredentials();\n    auto bucket = \"bucket\";\n    auto key = \"1234+-/123/1.txt\";\n    auto region = \"cn-hangzhou\";\n    auto product = \"oss\";\n    auto t = 1702743657LL;\n\n    HeaderCollection headers;\n    ParameterCollection parameters;\n\n    headers[\"x-oss-head1\"] = \"value\";\n    headers[\"abc\"] = \"value\";\n    headers[\"ZAbc\"] = \"value\";\n    headers[\"XYZ\"] = \"value\";\n    headers[\"XYZ\"] = \"value\";\n    headers[\"content-type\"] = \"text/plain\";\n    headers[\"x-oss-content-sha256\"] = \"UNSIGNED-PAYLOAD\";\n\n    parameters[\"param1\"] = \"value1\";\n    parameters[\"|param1\"] = \"value2\";\n    parameters[\"+param1\"] = \"value3\";\n    parameters[\"|param1\"] = \"value4\";\n    parameters[\"+param2\"] = \"\";\n    parameters[\"|param2\"] = \"\";\n    parameters[\"param2\"] = \"\";\n\n    auto httpRequest = std::make_shared<HttpRequest>(Http::Method::Put);\n    for (auto const& header : headers) {\n        httpRequest->addHeader(header.first, header.second);\n    }\n\n    SignerParam signerParam(std::move(region), std::move(product), \n        std::move(bucket), std::move(key), std::move(credentials), t);\n    signer->sign(httpRequest, parameters, signerParam);\n\n    std::string authPat = \"OSS4-HMAC-SHA256 Credential=ak/20231216/cn-hangzhou/oss/aliyun_v4_request,Signature=e21d18daa82167720f9b1047ae7e7f1ce7cb77a31e8203a7d5f4624fa0284afe\";\n\n    EXPECT_EQ(authPat, httpRequest->Header(Http::AUTHORIZATION));\n}\n\nTEST_F(SignerTest, SignerV4Token)\n{\n    auto signer = Signer::createSigner(SignatureVersionType::V4);\n\n    auto credentialsProvider = std::make_shared<SimpleCredentialsProvider>(\"ak\", \"sk\", \"token\");\n\n    auto credentials = credentialsProvider->getCredentials();\n    auto bucket = \"bucket\";\n    auto key = \"1234+-/123/1.txt\";\n    auto region = \"cn-hangzhou\";\n    auto product = \"oss\";\n    auto t = 1702784856LL;\n\n    HeaderCollection headers;\n    ParameterCollection parameters;\n\n    headers[\"x-oss-head1\"] = \"value\";\n    headers[\"abc\"] = \"value\";\n    headers[\"ZAbc\"] = \"value\";\n    headers[\"XYZ\"] = \"value\";\n    headers[\"XYZ\"] = \"value\";\n    headers[\"content-type\"] = \"text/plain\";\n    headers[\"x-oss-content-sha256\"] = \"UNSIGNED-PAYLOAD\";\n\n    parameters[\"param1\"] = \"value1\";\n    parameters[\"|param1\"] = \"value2\";\n    parameters[\"+param1\"] = \"value3\";\n    parameters[\"|param1\"] = \"value4\";\n    parameters[\"+param2\"] = \"\";\n    parameters[\"|param2\"] = \"\";\n    parameters[\"param2\"] = \"\";\n\n    auto httpRequest = std::make_shared<HttpRequest>(Http::Method::Put);\n    for (auto const& header : headers) {\n        httpRequest->addHeader(header.first, header.second);\n    }\n\n    SignerParam signerParam(std::move(region), std::move(product), \n        std::move(bucket), std::move(key), std::move(credentials), t);\n    signer->sign(httpRequest, parameters, signerParam);\n\n    std::string authPat = \"OSS4-HMAC-SHA256 Credential=ak/20231217/cn-hangzhou/oss/aliyun_v4_request,Signature=b94a3f999cf85bcdc00d332fbd3734ba03e48382c36fa4d5af5df817395bd9ea\";\n    EXPECT_EQ(authPat, httpRequest->Header(Http::AUTHORIZATION));\n    EXPECT_EQ(\"token\", httpRequest->Header(\"x-oss-security-token\"));\n}\n\nTEST_F(SignerTest, SignerV4WithAdditionalHeaders)\n{\n    auto signer = Signer::createSigner(SignatureVersionType::V4);\n\n    auto credentialsProvider = std::make_shared<SimpleCredentialsProvider>(\"ak\", \"sk\", \"\");\n\n    auto credentials = credentialsProvider->getCredentials();\n    auto bucket = \"bucket\";\n    auto key = \"1234+-/123/1.txt\";\n    auto region = \"cn-hangzhou\";\n    auto product = \"oss\";\n    auto t = 1702747512LL;\n\n    HeaderCollection headers;\n    ParameterCollection parameters;\n    HeaderSet signHeaders;\n\n    headers[\"x-oss-head1\"] = \"value\";\n    headers[\"abc\"] = \"value\";\n    headers[\"ZAbc\"] = \"value\";\n    headers[\"XYZ\"] = \"value\";\n    headers[\"XYZ\"] = \"value\";\n    headers[\"content-type\"] = \"text/plain\";\n    headers[\"x-oss-content-sha256\"] = \"UNSIGNED-PAYLOAD\";\n\n    signHeaders.emplace(\"abc\");\n    signHeaders.emplace(\"ZAbc\");\n\n    parameters[\"param1\"] = \"value1\";\n    parameters[\"|param1\"] = \"value2\";\n    parameters[\"+param1\"] = \"value3\";\n    parameters[\"|param1\"] = \"value4\";\n    parameters[\"+param2\"] = \"\";\n    parameters[\"|param2\"] = \"\";\n    parameters[\"param2\"] = \"\";\n\n    // 1\n    auto httpRequest = std::make_shared<HttpRequest>(Http::Method::Put);\n    for (auto const& header : headers) {\n        httpRequest->addHeader(header.first, header.second);\n    }\n\n    SignerParam signerParam(std::move(region), std::move(product), \n        std::move(bucket), std::move(key), std::move(credentials), t);\n    signerParam.setAdditionalHeaders(signHeaders);\n\n    signer->sign(httpRequest, parameters, signerParam);\n\n    std::string authPat = \"OSS4-HMAC-SHA256 Credential=ak/20231216/cn-hangzhou/oss/aliyun_v4_request,AdditionalHeaders=abc;zabc,Signature=4a4183c187c07c8947db7620deb0a6b38d9fbdd34187b6dbaccb316fa251212f\";\n\n    // 2\n    HeaderSet signHeaders2;\n    signHeaders2.emplace(\"ZAbc\");\n    signHeaders2.emplace(\"abc\");\n    signHeaders2.emplace(\"x-oss-head1\");\n    signHeaders2.emplace(\"x-oss-no-exist\");\n\n    auto httpRequest2  = std::make_shared<HttpRequest>(Http::Method::Put);\n    for (auto const& header : headers) {\n        httpRequest2->addHeader(header.first, header.second);\n    }\n\n    SignerParam signerParam2(std::move(region), std::move(product), \n        std::move(bucket), std::move(key), std::move(credentials), t);\n    signerParam2.setAdditionalHeaders(signHeaders2);\n\n    signer->sign(httpRequest2, parameters, signerParam2);\n\n    EXPECT_EQ(authPat, httpRequest2->Header(Http::AUTHORIZATION));\n}\n\nTEST_F(SignerTest, SignerV4Presign)\n{\n    auto signer = Signer::createSigner(SignatureVersionType::V4);\n\n    auto credentialsProvider = std::make_shared<SimpleCredentialsProvider>(\"ak\", \"sk\", \"\");\n\n    auto credentials = credentialsProvider->getCredentials();\n    auto bucket = \"bucket\";\n    auto key = \"1234+-/123/1.txt\";\n    auto region = \"cn-hangzhou\";\n    auto product = \"oss\";\n    auto t = 1702781677LL;\n    auto expires = 1702782276LL;\n\n    HeaderCollection headers;\n    ParameterCollection parameters;\n    HeaderSet signHeaders;\n\n    headers[\"x-oss-head1\"] = \"value\";\n    headers[\"abc\"] = \"value\";\n    headers[\"ZAbc\"] = \"value\";\n    headers[\"XYZ\"] = \"value\";\n    headers[\"XYZ\"] = \"value\";\n    headers[\"content-type\"] = \"application/octet-stream\";\n\n    parameters[\"param1\"] = \"value1\";\n    parameters[\"|param1\"] = \"value2\";\n    parameters[\"+param1\"] = \"value3\";\n    parameters[\"|param1\"] = \"value4\";\n    parameters[\"+param2\"] = \"\";\n    parameters[\"|param2\"] = \"\";\n    parameters[\"param2\"] = \"\";\n\n    auto httpRequest = std::make_shared<HttpRequest>(Http::Method::Put);\n    for (auto const& header : headers) {\n        httpRequest->addHeader(header.first, header.second);\n    }\n\n    SignerParam signerParam(std::move(region), std::move(product), \n        std::move(bucket), std::move(key), std::move(credentials), t);\n    signerParam.setExpires(expires);\n    signer->presign(httpRequest, parameters, signerParam);\n\n    EXPECT_EQ(\"OSS4-HMAC-SHA256\", parameters[\"x-oss-signature-version\"]);\n    EXPECT_EQ(\"20231217T025437Z\", parameters[\"x-oss-date\"]);\n    EXPECT_EQ(\"599\", parameters[\"x-oss-expires\"]);\n    EXPECT_EQ(\"ak/20231217/cn-hangzhou/oss/aliyun_v4_request\", parameters[\"x-oss-credential\"]);\n    EXPECT_EQ(\"a39966c61718be0d5b14e668088b3fa07601033f6518ac7b523100014269c0fe\", parameters[\"x-oss-signature\"]);\n    EXPECT_EQ(true, parameters.find(\"x-oss-additional-headers\") == parameters.end());\n}\n\nTEST_F(SignerTest, SignerV4PresignToken)\n{\n    auto signer = Signer::createSigner(SignatureVersionType::V4);\n\n    auto credentialsProvider = std::make_shared<SimpleCredentialsProvider>(\"ak\", \"sk\", \"token\");\n\n    auto credentials = credentialsProvider->getCredentials();\n    auto bucket = \"bucket\";\n    auto key = \"1234+-/123/1.txt\";\n    auto region = \"cn-hangzhou\";\n    auto product = \"oss\";\n    auto t = 1702785388LL;\n    auto expires = 1702785987LL;\n\n    HeaderCollection headers;\n    ParameterCollection parameters;\n    HeaderSet signHeaders;\n\n    headers[\"x-oss-head1\"] = \"value\";\n    headers[\"abc\"] = \"value\";\n    headers[\"ZAbc\"] = \"value\";\n    headers[\"XYZ\"] = \"value\";\n    headers[\"XYZ\"] = \"value\";\n    headers[\"content-type\"] = \"application/octet-stream\";\n\n    parameters[\"param1\"] = \"value1\";\n    parameters[\"|param1\"] = \"value2\";\n    parameters[\"+param1\"] = \"value3\";\n    parameters[\"|param1\"] = \"value4\";\n    parameters[\"+param2\"] = \"\";\n    parameters[\"|param2\"] = \"\";\n    parameters[\"param2\"] = \"\";\n\n    auto httpRequest = std::make_shared<HttpRequest>(Http::Method::Put);\n    for (auto const& header : headers) {\n        httpRequest->addHeader(header.first, header.second);\n    }\n\n    SignerParam signerParam(std::move(region), std::move(product), \n        std::move(bucket), std::move(key), std::move(credentials), t);\n    signerParam.setExpires(expires);\n    signer->presign(httpRequest, parameters, signerParam);\n\n    EXPECT_EQ(\"OSS4-HMAC-SHA256\", parameters[\"x-oss-signature-version\"]);\n    EXPECT_EQ(\"20231217T035628Z\", parameters[\"x-oss-date\"]);\n    EXPECT_EQ(\"599\", parameters[\"x-oss-expires\"]);\n    EXPECT_EQ(\"token\", parameters[\"x-oss-security-token\"]);\n    EXPECT_EQ(\"ak/20231217/cn-hangzhou/oss/aliyun_v4_request\", parameters[\"x-oss-credential\"]);\n    EXPECT_EQ(\"ak/20231217/cn-hangzhou/oss/aliyun_v4_request\", parameters[\"x-oss-credential\"]);\n    EXPECT_EQ(\"3817ac9d206cd6dfc90f1c09c00be45005602e55898f26f5ddb06d7892e1f8b5\", parameters[\"x-oss-signature\"]);\n    EXPECT_EQ(true, parameters.find(\"x-oss-additional-headers\") == parameters.end());\n}\n\nTEST_F(SignerTest, SignerV4PresignWithAdditionalHeaders)\n{\n    auto signer = Signer::createSigner(SignatureVersionType::V4);\n\n    auto credentialsProvider = std::make_shared<SimpleCredentialsProvider>(\"ak\", \"sk\", \"\");\n\n    auto credentials = credentialsProvider->getCredentials();\n    auto bucket = \"bucket\";\n    auto key = \"1234+-/123/1.txt\";\n    auto region = \"cn-hangzhou\";\n    auto product = \"oss\";\n    auto t = 1702783809LL;\n    auto expires = 1702784408LL;\n\n    HeaderCollection headers;\n    ParameterCollection parameters;\n    HeaderSet signHeaders;\n\n    headers[\"x-oss-head1\"] = \"value\";\n    headers[\"abc\"] = \"value\";\n    headers[\"ZAbc\"] = \"value\";\n    headers[\"XYZ\"] = \"value\";\n    headers[\"XYZ\"] = \"value\";\n    headers[\"content-type\"] = \"application/octet-stream\";\n\n    parameters[\"param1\"] = \"value1\";\n    parameters[\"|param1\"] = \"value2\";\n    parameters[\"+param1\"] = \"value3\";\n    parameters[\"|param1\"] = \"value4\";\n    parameters[\"+param2\"] = \"\";\n    parameters[\"|param2\"] = \"\";\n    parameters[\"param2\"] = \"\";\n\n    //1\n    signHeaders.emplace(\"abc\");\n    signHeaders.emplace(\"ZAbc\");\n\n    auto httpRequest = std::make_shared<HttpRequest>(Http::Method::Put);\n    for (auto const& header : headers) {\n        httpRequest->addHeader(header.first, header.second);\n    }\n\n    SignerParam signerParam(std::move(region), std::move(product), \n        std::move(bucket), std::move(key), std::move(credentials), t);\n    signerParam.setExpires(expires);\n    signerParam.setAdditionalHeaders(signHeaders);\n    signer->presign(httpRequest, parameters, signerParam);\n\n    EXPECT_EQ(\"OSS4-HMAC-SHA256\", parameters[\"x-oss-signature-version\"]);\n    EXPECT_EQ(\"20231217T033009Z\", parameters[\"x-oss-date\"]);\n    EXPECT_EQ(\"599\", parameters[\"x-oss-expires\"]);\n    EXPECT_EQ(\"ak/20231217/cn-hangzhou/oss/aliyun_v4_request\", parameters[\"x-oss-credential\"]);\n    EXPECT_EQ(\"6bd984bfe531afb6db1f7550983a741b103a8c58e5e14f83ea474c2322dfa2b7\", parameters[\"x-oss-signature\"]);\n    EXPECT_EQ(\"abc;zabc\", parameters[\"x-oss-additional-headers\"]);\n\n    //2\n    ParameterCollection parameters2;\n    parameters2[\"param1\"] = \"value1\";\n    parameters2[\"|param1\"] = \"value2\";\n    parameters2[\"+param1\"] = \"value3\";\n    parameters2[\"|param1\"] = \"value4\";\n    parameters2[\"+param2\"] = \"\";\n    parameters2[\"|param2\"] = \"\";\n    parameters2[\"param2\"] = \"\";\n\n    auto httpRequest2 = std::make_shared<HttpRequest>(Http::Method::Put);\n    for (auto const& header : headers) {\n        httpRequest2->addHeader(header.first, header.second);\n    }\n    HeaderSet signHeaders2; \n    signHeaders2.emplace(\"abc\");\n    signHeaders2.emplace(\"ZAbc\");\n    signHeaders2.emplace(\"x-oss-head1\");\n\n    SignerParam signerParam2(std::move(region), std::move(product), \n        std::move(bucket), std::move(key), std::move(credentials), t);\n    signerParam2.setExpires(expires);\n    signerParam2.setAdditionalHeaders(signHeaders);\n    EXPECT_EQ(true, parameters2.find(\"x-oss-additional-headers\") == parameters2.end());\n\n    signer->presign(httpRequest2, parameters2, signerParam2);\n\n    EXPECT_EQ(\"OSS4-HMAC-SHA256\", parameters2[\"x-oss-signature-version\"]);\n    EXPECT_EQ(\"20231217T033009Z\", parameters2[\"x-oss-date\"]);\n    EXPECT_EQ(\"599\", parameters2[\"x-oss-expires\"]);\n    EXPECT_EQ(\"ak/20231217/cn-hangzhou/oss/aliyun_v4_request\", parameters2[\"x-oss-credential\"]);\n    EXPECT_EQ(\"6bd984bfe531afb6db1f7550983a741b103a8c58e5e14f83ea474c2322dfa2b7\", parameters2[\"x-oss-signature\"]);\n    EXPECT_EQ(\"abc;zabc\", parameters2[\"x-oss-additional-headers\"]);\n}\n\n}\n}\n"
  },
  {
    "path": "test/src/Other/UtilsFunctionTest.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <gtest/gtest.h>\r\n#include <alibabacloud/oss/OssClient.h>\r\n#include <alibabacloud/oss/http/Url.h>\r\n#include <src/utils/Utils.h>\r\n#include \"../Config.h\"\r\n#include \"../Utils.h\"\r\n#include <fstream>\r\n#include \"src/utils/FileSystemUtils.h\"\r\n#include \"src/utils/StreamBuf.h\"\r\n#include \"src/signer/Signer.h\"\r\n\r\nnamespace AlibabaCloud {\r\nnamespace OSS {\r\n\r\nclass UtilsFunctionTest : public ::testing::Test {\r\nprotected:\r\n    UtilsFunctionTest()\r\n    {\r\n    }\r\n\r\n    ~UtilsFunctionTest() override\r\n    {\r\n    }\r\n\r\n    void SetUp() override\r\n    {\r\n    }\r\n\r\n    void TearDown() override\r\n    {\r\n    }\r\n\r\n    static int64_t GetFileLength(const std::string& file);\r\n};\r\n\r\nint64_t UtilsFunctionTest::GetFileLength(const std::string& file)\r\n{\r\n    std::fstream f(file, std::ios::in | std::ios::binary);\r\n    f.seekg(0, f.end);\r\n    int64_t size = f.tellg();\r\n    f.close();\r\n    return size;\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, Base64EncodeTest)\r\n{\r\n    std::vector<std::string> ori = { \"abc\" , \"abcd\" , \"abcde\", \"\" };\r\n    std::vector<std::string> pat = { \"YWJj\" , \"YWJjZA==\" , \"YWJjZGU=\", \"\"};\r\n\r\n    auto i = ori.size();\r\n    for (i = 0; i < ori.size(); i++) {\r\n        auto result = Base64Encode(ori[i]);\r\n        //std::cout << \"Base64EncodeTest: src:\"<< ori[i] \r\n        //    << \" ,result:\" << result \r\n        //    << \" ,pat:\" << pat[i] << std::endl;\r\n        EXPECT_STREQ(result.c_str(), pat[i].c_str());\r\n    }\r\n    EXPECT_TRUE((i == ori.size()));\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, Base64DecodeTest)\r\n{\r\n    std::vector<std::string> ori = { \"YWJj\" , \"YWJjZA==\" , \"YWJjZGU=\", \"\", \"YWJjZA\" , \"YWJjZGU\" };\r\n    std::vector<std::string> pat = { \"abc\" , \"abcd\" , \"abcde\", \"\", \"abcd\" , \"abcde\" };\r\n\r\n    auto i = ori.size();\r\n    for (i = 0; i < ori.size(); i++) {\r\n        auto result = Base64Decode(ori[i]);\r\n        EXPECT_EQ(result.size(), pat[i].size());\r\n        EXPECT_TRUE(TestUtils::IsByteBufferEQ(reinterpret_cast<const char *>(result.data()), pat[i].data(), (int)result.size()));\r\n    }\r\n    EXPECT_TRUE((i == ori.size()));\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, Base64EncodeAndDecodeTest)\r\n{\r\n    for (int i = 1; i < 256; i++) {\r\n        ByteBuffer data = TestUtils::GetRandomByteBuffer(i);\r\n        EXPECT_EQ(data.size(), static_cast<size_t>(i));\r\n        auto result = Base64Encode(data);\r\n        auto data1 = Base64Decode(result.c_str(), (int)result.size());\r\n        EXPECT_EQ(data1.size(), static_cast<size_t>(i));\r\n        EXPECT_TRUE(TestUtils::IsByteBufferEQ(data.data(), data1.data(), i));\r\n    }\r\n}\r\n\r\nstatic std::vector<std::string> urlOri = \r\n{\r\n    \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_~\",\r\n    \"`!@#$%^&*()+={}[]:;'\\\\|<>,?/ \\\"\",\r\n    \"hello world!\"\r\n};\r\n\r\nstatic std::vector<std::string> urlPat =\r\n{\r\n    \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_~\",\r\n    \"%60%21%40%23%24%25%5E%26%2A%28%29%2B%3D%7B%7D%5B%5D%3A%3B%27%5C%7C%3C%3E%2C%3F%2F%20%22\",\r\n    \"hello%20world%21\"\r\n};\r\n\r\nstatic std::vector<std::string> urlPatIgnoreSlash =\r\n{\r\n    \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_~\",\r\n    \"%60%21%40%23%24%25%5E%26%2A%28%29%2B%3D%7B%7D%5B%5D%3A%3B%27%5C%7C%3C%3E%2C%3F/%20%22\",\r\n    \"hello%20world%21\"\r\n};\r\n\r\nTEST_F(UtilsFunctionTest, UrlEncodeTest)\r\n{\r\n    auto i = urlOri.size();\r\n    for (i = 0; i < urlOri.size(); i++) {\r\n        auto result = UrlEncode(urlOri[i]);\r\n        EXPECT_STREQ(result.c_str(), urlPat[i].c_str());\r\n    }\r\n    EXPECT_TRUE((i == urlOri.size()));\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, UrlEncodePathTest)\r\n{\r\n    auto i = urlOri.size();\r\n    for (i = 0; i < urlOri.size(); i++) {\r\n        auto result = UrlEncodePath(urlOri[i], true);\r\n        EXPECT_STREQ(result.c_str(), urlPatIgnoreSlash[i].c_str());\r\n    }\r\n    EXPECT_TRUE((i == urlOri.size()));\r\n\r\n    for (i = 0; i < urlOri.size(); i++) {\r\n        auto result = UrlEncodePath(urlOri[i], false);\r\n        EXPECT_STREQ(result.c_str(), urlPat[i].c_str());\r\n    }\r\n    EXPECT_TRUE((i == urlOri.size()));\r\n}\r\n\r\n\r\nTEST_F(UtilsFunctionTest, UrlDecodeTest)\r\n{\r\n    auto i = urlOri.size();\r\n    for (i = 0; i < urlOri.size(); i++) {\r\n        auto result = UrlDecode(urlPat[i]);\r\n        EXPECT_STREQ(result.c_str(), urlOri[i].c_str());\r\n    }\r\n    EXPECT_TRUE((i == urlPat.size()));\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToStorageClassNameTest)\r\n{\r\n    EXPECT_STREQ(ToStorageClassName(StorageClass::Standard), \"Standard\");\r\n    EXPECT_STREQ(ToStorageClassName(StorageClass::IA), \"IA\");\r\n    EXPECT_STREQ(ToStorageClassName(StorageClass::Archive), \"Archive\");\r\n    EXPECT_STREQ(ToStorageClassName(StorageClass::ColdArchive), \"ColdArchive\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToStorageClassTypeTest)\r\n{\r\n    EXPECT_EQ(ToStorageClassType(\"Standard\"), StorageClass::Standard);\r\n    EXPECT_EQ(ToStorageClassType(\"standard\"), StorageClass::Standard);\r\n    EXPECT_EQ(ToStorageClassType(\"IA\"), StorageClass::IA);\r\n    EXPECT_EQ(ToStorageClassType(\"ia\"), StorageClass::IA);\r\n    EXPECT_EQ(ToStorageClassType(\"Archive\"), StorageClass::Archive);\r\n    EXPECT_EQ(ToStorageClassType(\"ArChive\"), StorageClass::Archive);\r\n    EXPECT_EQ(ToStorageClassType(nullptr), StorageClass::Standard);\r\n    EXPECT_EQ(ToStorageClassType(\"unknown\"), StorageClass::Standard);\r\n    EXPECT_EQ(ToStorageClassType(\"ColdArchive\"), StorageClass::ColdArchive);\r\n    EXPECT_EQ(ToStorageClassType(\"coldArchive\"), StorageClass::ColdArchive);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToAclNameTest)\r\n{\r\n    EXPECT_STREQ(ToAclName(CannedAccessControlList::Private), \"private\");\r\n    EXPECT_STREQ(ToAclName(CannedAccessControlList::PublicRead), \"public-read\");\r\n    EXPECT_STREQ(ToAclName(CannedAccessControlList::PublicReadWrite), \"public-read-write\");\r\n    EXPECT_STREQ(ToAclName(CannedAccessControlList::Default), \"default\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToAclTypeTest)\r\n{\r\n    EXPECT_EQ(ToAclType(\"private\"), CannedAccessControlList::Private);\r\n    EXPECT_EQ(ToAclType(\"public-read\"), CannedAccessControlList::PublicRead);\r\n    EXPECT_EQ(ToAclType(\"public-read-write\"), CannedAccessControlList::PublicReadWrite);\r\n    EXPECT_EQ(ToAclType(\"Private\"), CannedAccessControlList::Private);\r\n    EXPECT_EQ(ToAclType(\"Public-read\"), CannedAccessControlList::PublicRead);\r\n    EXPECT_EQ(ToAclType(\"Public-read-write\"), CannedAccessControlList::PublicReadWrite);\r\n    EXPECT_EQ(ToAclType(nullptr), CannedAccessControlList::Default);\r\n    EXPECT_EQ(ToAclType(\"unknown\"), CannedAccessControlList::Default);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToCopyActionNameTest)\r\n{\r\n    EXPECT_STREQ(ToCopyActionName(CopyActionList::Copy), \"COPY\");\r\n    EXPECT_STREQ(ToCopyActionName(CopyActionList::Replace), \"REPLACE\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, TrimSpaceChTest)\r\n{\r\n    std::string str = \" ����  \";\r\n    EXPECT_STREQ(Trim(str.c_str()).c_str(), \"����\");\r\n\r\n    str = \" ��  ��  \";\r\n    EXPECT_STREQ(Trim(str.c_str()).c_str(), \"��  ��\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, TrimSpaceTest)\r\n{\r\n    std::vector<std::string> testString = { \" abc \" , \"   abc   \" , \"  abc\" , \"abc  \", \"    abc     \", \"\\r    \\nabc     \\n\\r\"  };\r\n    for (auto const &str : testString) {\r\n        EXPECT_STREQ(Trim(str.c_str()).c_str(), \"abc\");\r\n    }\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, LeftTrimSpaceTest)\r\n{\r\n    std::vector<std::string> testString = { \" abc \" , \"   abc   \" , \"  abc    \" , \"abc  \" };\r\n    for (auto const &str : testString) {\r\n        auto result = LeftTrim(str.c_str());\r\n        EXPECT_EQ(result.compare(0, 3, \"abc\", 3), 0);\r\n        EXPECT_NE(result.compare(\"abc\"), 0);\r\n    }\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, RightTrimSpaceTest)\r\n{\r\n    std::vector<std::string> testString = { \" abc \" , \"   abc   \" , \"  abc    \" , \"abc  \" };\r\n    for (auto const &str : testString) {\r\n        auto result = RightTrim(str.c_str());\r\n        auto pos = result.find('a');\r\n        EXPECT_EQ(strcmp(result.c_str() + pos, \"abc\"), 0);\r\n    }\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, TrimQuotesTest)\r\n{\r\n    std::vector<std::string> testString = { R\"(\"abc\")\" , R\"(\"\"abc\"\")\" , R\"(\"\"abc)\" , R\"(abc\"\"\"\")\" };\r\n    for (auto const &str : testString) {\r\n        EXPECT_STREQ(TrimQuotes(str.c_str()).c_str(), \"abc\");\r\n    }\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, LeftTrimQuotesTest)\r\n{\r\n    std::vector<std::string> testString = { R\"(\"\"abc\"\")\" , R\"(\"\"\"abc \"\")\" , R\"(\"\"\"abc  \"\")\" , R\"(abc  \"\")\" };\r\n    for (auto const &str : testString) {\r\n        auto result = LeftTrimQuotes(str.c_str());\r\n        EXPECT_EQ(result.compare(0, 3, \"abc\", 3), 0);\r\n        EXPECT_NE(result.compare(\"abc\"), 0);\r\n    }\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, RightTrimQuotesTest)\r\n{\r\n    std::vector<std::string> testString = { R\"(\"\"abc\"\")\" , R\"(\"\"\" abc\"\")\" , R\"(\"\"\"abc\")\" , R\"(abc\"\"\"\"\")\" };\r\n    for (auto const &str : testString) {\r\n        auto result = RightTrimQuotes(str.c_str());\r\n        auto pos = result.find('a');\r\n        EXPECT_EQ(strcmp(result.c_str() + pos, \"abc\"), 0);\r\n    }\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToLowerTest)\r\n{\r\n    std::vector<std::string> testString = { \"ABC\" , \"Abc\" , \"AbC\" , \"abc\" };\r\n    for (auto const &str : testString) {\r\n        auto result = ToLower(str.c_str());\r\n        EXPECT_STREQ(result.c_str(), \"abc\");\r\n    }\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToUpperTest)\r\n{\r\n    std::vector<std::string> testString = { \"ABC\" , \"Abc\" , \"AbC\" , \"abc\" };\r\n    for (auto const &str : testString) {\r\n        auto result = ToUpper(str.c_str());\r\n        EXPECT_STREQ(result.c_str(), \"ABC\");\r\n    }\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, IsIpTest)\r\n{\r\n    EXPECT_EQ(IsIp(\"192.168.1.1\"), true);\r\n    EXPECT_EQ(IsIp(\"10.1.1.1\"), true);\r\n    EXPECT_EQ(IsIp(\"127.0.0.0\"), true);\r\n    EXPECT_EQ(IsIp(\"266.168.1.1\"), false);\r\n    EXPECT_EQ(IsIp(\"1192.168.1.1\"), false);\r\n    EXPECT_EQ(IsIp(\"hostname\"), false);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToGmtTimeTest)\r\n{\r\n    std::time_t t = 0;\r\n    std::string timeStr = ToGmtTime(t);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Thu, 01 Jan 1970 00:00:00 GMT\");\r\n\r\n    t = 1520411719;\r\n    timeStr = ToGmtTime(t);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Wed, 07 Mar 2018 08:35:19 GMT\");\r\n\r\n    t = 1554703347;\r\n    timeStr = ToGmtTime(t);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Mon, 08 Apr 2019 06:02:27 GMT\");\r\n\r\n    t = 1554739347;\r\n    timeStr = ToGmtTime(t);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Mon, 08 Apr 2019 16:02:27 GMT\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToGmtTimeWithSetlocaleTest)\r\n{\r\n    auto oldLoc = std::cout.getloc();\r\n    std::locale::global(std::locale(\"\"));\r\n\r\n    std::time_t t = 0;\r\n    std::string timeStr = ToGmtTime(t);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Thu, 01 Jan 1970 00:00:00 GMT\");\r\n\r\n    t = 1520411719;\r\n    timeStr = ToGmtTime(t);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Wed, 07 Mar 2018 08:35:19 GMT\");\r\n\r\n    t = 1554703347;\r\n    timeStr = ToGmtTime(t);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Mon, 08 Apr 2019 06:02:27 GMT\");\r\n\r\n    t = 1554739347;\r\n    timeStr = ToGmtTime(t);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Mon, 08 Apr 2019 16:02:27 GMT\");\r\n\r\n    std::locale::global(oldLoc);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToUtcTimeTest)\r\n{\r\n    std::time_t t = 0;\r\n    std::string timeStr = ToUtcTime(t);\r\n    EXPECT_STREQ(timeStr.c_str(), \"1970-01-01T00:00:00.000Z\");\r\n\r\n    t = 1520411719;\r\n    timeStr = ToUtcTime(t);\r\n    EXPECT_STREQ(timeStr.c_str(), \"2018-03-07T08:35:19.000Z\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToUtcTimeWithSetlocaleTest)\r\n{\r\n    auto oldLoc = std::cout.getloc();\r\n    std::locale::global(std::locale(\"\"));\r\n\r\n    std::time_t t = 0;\r\n    std::string timeStr = ToUtcTime(t);\r\n    EXPECT_STREQ(timeStr.c_str(), \"1970-01-01T00:00:00.000Z\");\r\n\r\n    t = 1520411719;\r\n    timeStr = ToUtcTime(t);\r\n    EXPECT_STREQ(timeStr.c_str(), \"2018-03-07T08:35:19.000Z\");\r\n\r\n    t = 1520433319;\r\n    timeStr = ToUtcTime(t);\r\n    EXPECT_STREQ(timeStr.c_str(), \"2018-03-07T14:35:19.000Z\");\r\n\r\n    std::locale::global(oldLoc);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, UtcToUnixTimeTest)\r\n{\r\n    std::string date = \"1970-01-01T00:00:00.000Z\";\r\n    std::time_t t = UtcToUnixTime(date);\r\n    EXPECT_EQ(t, 0);\r\n\r\n    date = \"2018-03-07T08:35:19.123Z\";\r\n    t = UtcToUnixTime(date);\r\n    EXPECT_EQ(t, 1520411719);\r\n\r\n    //invalid case\r\n    date = \"2018-03-07T08:35:19Z\";\r\n    t = UtcToUnixTime(date);\r\n    EXPECT_EQ(t, -1);\r\n\r\n    date = \"2018-03-07T08:35:19.abcZ\";\r\n    t = UtcToUnixTime(date);\r\n    EXPECT_EQ(t, -1);\r\n\r\n    date = \"18-03-07T08:35:19.000Z\";\r\n    t = UtcToUnixTime(date);\r\n    EXPECT_EQ(t, -1);\r\n\r\n    date = \"\";\r\n    t = UtcToUnixTime(date);\r\n    EXPECT_EQ(t, -1);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, LookupMimeTypeTest)\r\n{\r\n    EXPECT_STREQ(LookupMimeType(\"name.html\").c_str(), \"text/html\");\r\n    EXPECT_STREQ(LookupMimeType(\"test.mp3\").c_str(), \"audio/mpeg\");\r\n    EXPECT_STREQ(LookupMimeType(\"test.mp3.unkonw\").c_str(), \"audio/mpeg\");\r\n    EXPECT_STREQ(LookupMimeType(\"test.mp3.unkonw.unkonw\").c_str(), \"application/octet-stream\");\r\n    EXPECT_STREQ(LookupMimeType(\"unkonw\").c_str(), \"application/octet-stream\");\r\n    EXPECT_STREQ(LookupMimeType(\"name.Html\").c_str(), \"text/html\");\r\n    EXPECT_STREQ(LookupMimeType(\"test.Mp3.unkonw\").c_str(), \"audio/mpeg\");\r\n}\r\n\r\nstruct Md5TestData {\r\n    const char *msg;\r\n    const unsigned char hash[16];\r\n};\r\nstatic Md5TestData tests[] = {\r\n  { \"\",\r\n    { 0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04,\r\n      0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e } },\r\n  { \"a\",\r\n    {0x0c, 0xc1, 0x75, 0xb9, 0xc0, 0xf1, 0xb6, 0xa8,\r\n     0x31, 0xc3, 0x99, 0xe2, 0x69, 0x77, 0x26, 0x61 } },\r\n  { \"abc\",\r\n    { 0x90, 0x01, 0x50, 0x98, 0x3c, 0xd2, 0x4f, 0xb0,\r\n      0xd6, 0x96, 0x3f, 0x7d, 0x28, 0xe1, 0x7f, 0x72 } },\r\n  { \"message digest\",\r\n    { 0xf9, 0x6b, 0x69, 0x7d, 0x7c, 0xb7, 0x93, 0x8d,\r\n      0x52, 0x5a, 0x2f, 0x31, 0xaa, 0xf1, 0x61, 0xd0 } },\r\n  { \"abcdefghijklmnopqrstuvwxyz\",\r\n    { 0xc3, 0xfc, 0xd3, 0xd7, 0x61, 0x92, 0xe4, 0x00,\r\n      0x7d, 0xfb, 0x49, 0x6c, 0xca, 0x67, 0xe1, 0x3b } },\r\n  { \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\",\r\n    { 0xd1, 0x74, 0xab, 0x98, 0xd2, 0x77, 0xd9, 0xf5,\r\n      0xa5, 0x61, 0x1c, 0x2c, 0x9f, 0x41, 0x9d, 0x9f } },\r\n  { \"12345678901234567890123456789012345678901234567890123456789012345678901234567890\",\r\n    { 0x57, 0xed, 0xf4, 0xa2, 0x2b, 0xe3, 0xc9, 0x55,\r\n      0xac, 0x49, 0xda, 0x2e, 0x21, 0x07, 0xb6, 0x7a } }\r\n};\r\n\r\nTEST_F(UtilsFunctionTest, Md5CharArgTest)\r\n{\r\n    for (auto const &item : tests) {\r\n        auto md5_base64_1 = ComputeContentMD5(item.msg, !item.msg? 0: strlen(item.msg));\r\n        auto md5_base64_2 = Base64Encode((const char *)item.hash, 16);\r\n        EXPECT_STREQ(md5_base64_1.c_str(), md5_base64_2.c_str());\r\n    }\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, Md5StringStreamArgTest)\r\n{\r\n    for (auto const &item : tests) {\r\n        std::stringstream ss;\r\n        ss << item.msg;\r\n        auto md5_base64_1 = ComputeContentMD5(ss);\r\n        auto md5_base64_2 = Base64Encode((const char *)item.hash, 16);\r\n        EXPECT_STREQ(md5_base64_1.c_str(), md5_base64_2.c_str());\r\n    }\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, Md5NullptrTest)\r\n{\r\n    auto md5_base64_1 = ComputeContentMD5(nullptr, 0);\r\n    EXPECT_EQ(md5_base64_1, \"\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, Md5ResetContentPositionTest)\r\n{\r\n    std::string fileName = TestUtils::GetTargetFileName(\"Md5ResetContentPositionTest\");\r\n    TestUtils::WriteRandomDatatoFile(fileName, 1024);\r\n    std::fstream of(fileName, std::ios::in | std::ios::binary);\r\n    of.seekg(0, of.end);\r\n    char buff[10];\r\n    of.read(buff, 10);\r\n    auto md5_base64_1 = ComputeContentMD5(of);\r\n    of.close();\r\n    auto md5_file = TestUtils::GetFileMd5(fileName);\r\n    EXPECT_EQ(md5_base64_1, md5_file);\r\n    RemoveFile(fileName);\r\n}\r\n\r\nstruct ETagTestData {\r\n    const char *msg;\r\n    const char *hexHash;\r\n};\r\nstatic ETagTestData eTagTests[] = {\r\n  { \"\",\r\n    \"D41D8CD98F00B204E9800998ECF8427E\"}, \r\n  { \"a\",\r\n    \"0CC175B9C0F1B6A831C399E269772661\"},\r\n  { \"abc\",\r\n    \"900150983CD24FB0D6963F7D28E17F72\"},\r\n  { \"message digest\",\r\n    \"F96B697D7CB7938D525A2F31AAF161D0\"},\r\n  { \"abcdefghijklmnopqrstuvwxyz\",\r\n    \"C3FCD3D76192E4007DFB496CCA67E13B\"},\r\n  { \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\",\r\n    \"D174AB98D277D9F5A5611C2C9F419D9F\"},\r\n  { \"12345678901234567890123456789012345678901234567890123456789012345678901234567890\",\r\n    \"57EDF4A22BE3C955AC49DA2E2107B67A\"}\r\n};\r\n\r\nTEST_F(UtilsFunctionTest, ETagCharArgTest)\r\n{\r\n    for (auto const &item : eTagTests) {\r\n        auto etag = ComputeContentETag(item.msg, !item.msg ? 0 : strlen(item.msg));\r\n        EXPECT_STREQ(etag.c_str(), item.hexHash);\r\n    }\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ETagStringStreamArgTest)\r\n{\r\n    for (auto const &item : eTagTests) {\r\n        std::stringstream ss;\r\n        ss << item.msg;\r\n        auto etag = ComputeContentETag(ss);\r\n        EXPECT_STREQ(etag.c_str(), item.hexHash);\r\n    }\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ETagNullptrTest)\r\n{\r\n    auto etag = ComputeContentETag(nullptr, 0);\r\n    EXPECT_EQ(etag, \"\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ETagResetContentPositionTest)\r\n{\r\n    std::string fileName = TestUtils::GetTargetFileName(\"ETagResetContentPositionTest\");\r\n    TestUtils::WriteRandomDatatoFile(fileName, 1024);\r\n    std::fstream of(fileName, std::ios::in | std::ios::binary);\r\n    of.seekg(0, of.end);\r\n    char buff[10];\r\n    of.read(buff, 10);\r\n    auto etag = ComputeContentETag(of);\r\n    of.close();\r\n    EXPECT_FALSE(etag.empty());\r\n    RemoveFile(fileName);\r\n}\r\n\r\n\r\nTEST_F(UtilsFunctionTest, GetIOStreamLengthResetContentPositionTest)\r\n{\r\n    std::string fileName = TestUtils::GetTargetFileName(\"GetIOStreamLengthResetContentPositionTest\");\r\n    TestUtils::WriteRandomDatatoFile(fileName, 1024);\r\n    std::fstream of(fileName, std::ios::in | std::ios::binary);\r\n    of.seekg(0, of.end);\r\n    char buff[10];\r\n    of.read(buff, 10);\r\n    auto length = GetIOStreamLength(of);\r\n    of.close();\r\n    auto md5_file = TestUtils::GetFileMd5(fileName);\r\n    EXPECT_EQ(length, 1024LL);\r\n    RemoveFile(fileName);\r\n}\r\n\r\n\r\nTEST_F(UtilsFunctionTest, CombineHostStringTest)\r\n{\r\n    EXPECT_STREQ(CombineHostString(\"http://oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", false, false).c_str(),\r\n        \"http://test-bucket.oss-cn-hangzhou.aliyuncs.com\");\r\n    EXPECT_STREQ(CombineHostString(\"oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", false, false).c_str(),\r\n        \"http://test-bucket.oss-cn-hangzhou.aliyuncs.com\");\r\n    EXPECT_STREQ(CombineHostString(\"http://192.168.1.1\", \"test-bucket\", false, false).c_str(),\r\n        \"http://192.168.1.1\");\r\n\r\n    EXPECT_STREQ(CombineHostString(\"http://cname.com\", \"test-bucket\", true, false).c_str(),\r\n        \"http://cname.com\");\r\n    EXPECT_STREQ(CombineHostString(\"cname.com\", \"test-bucket\", true, false).c_str(),\r\n        \"http://cname.com\");\r\n    EXPECT_STREQ(CombineHostString(\"http://192.168.1.1\", \"test-bucket\", true, false).c_str(),\r\n        \"http://192.168.1.1\");\r\n\r\n    //path style\r\n    EXPECT_STREQ(CombineHostString(\"http://oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", false, true).c_str(),\r\n        \"http://oss-cn-hangzhou.aliyuncs.com\");\r\n    EXPECT_STREQ(CombineHostString(\"oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", false, true).c_str(),\r\n        \"http://oss-cn-hangzhou.aliyuncs.com\");\r\n    EXPECT_STREQ(CombineHostString(\"http://cname.com\", \"test-bucket\", true, true).c_str(),\r\n        \"http://cname.com\");\r\n    EXPECT_STREQ(CombineHostString(\"cname.com\", \"test-bucket\", true, true).c_str(),\r\n        \"http://cname.com\");\r\n    EXPECT_STREQ(CombineHostString(\"http://192.168.1.1\", \"test-bucket\", true, true).c_str(),\r\n        \"http://192.168.1.1\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, CombinePathStringTest)\r\n{\r\n    EXPECT_STREQ(CombinePathString(\"http://oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", \"test-key\", false).c_str(),\r\n        \"/test-key\");\r\n    EXPECT_STREQ(CombinePathString(\"http://192.168.1.1\", \"test-bucket\", \"test-key\", false).c_str(),\r\n        \"/test-bucket/test-key\");\r\n\r\n    EXPECT_STREQ(CombinePathString(\"http://oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", \"test-key/123/456+/1.txt\", false).c_str(),\r\n        \"/test-key/123/456%2B/1.txt\");\r\n\r\n    //path style\r\n    EXPECT_STREQ(CombinePathString(\"http://oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", \"test-key\", true).c_str(),\r\n        \"/test-bucket/test-key\");\r\n    EXPECT_STREQ(CombinePathString(\"http://192.168.1.1\", \"test-bucket\", \"test-key\", true).c_str(),\r\n        \"/test-bucket/test-key\");\r\n    EXPECT_STREQ(CombinePathString(\"http://oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", \"test-key/123/456+/1.txt\", true).c_str(),\r\n        \"/test-bucket/test-key/123/456%2B/1.txt\");\r\n\r\n    // encode slash\r\n    EXPECT_STREQ(CombinePathString(\"http://oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", \"test-key/123/456+/1.txt\", false, false).c_str(),\r\n        \"/test-key%2F123%2F456%2B%2F1.txt\");\r\n    EXPECT_STREQ(CombinePathString(\"http://192.168.1.1\", \"test-bucket-ip\", \"test-key/123/456+/1.txt\", true, false).c_str(),\r\n        \"/test-bucket-ip/test-key%2F123%2F456%2B%2F1.txt\");\r\n    EXPECT_STREQ(CombinePathString(\"http://oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", \"test-key/123/456+/1.txt\", true, false).c_str(),\r\n        \"/test-bucket/test-key%2F123%2F456%2B%2F1.txt\");\r\n\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, CombineRTMPStringTest)\r\n{\r\n    EXPECT_STREQ(CombineRTMPString(\"http://oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", false, false).c_str(),\r\n        \"rtmp://test-bucket.oss-cn-hangzhou.aliyuncs.com\");\r\n    EXPECT_STREQ(CombineRTMPString(\"oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", false, false).c_str(),\r\n        \"rtmp://test-bucket.oss-cn-hangzhou.aliyuncs.com\");\r\n    EXPECT_STREQ(CombineRTMPString(\"http://192.168.1.1\", \"test-bucket\", false, false).c_str(),\r\n        \"rtmp://192.168.1.1\");\r\n\r\n    EXPECT_STREQ(CombineRTMPString(\"http://cname.com\", \"test-bucket\", true, false).c_str(),\r\n        \"rtmp://cname.com\");\r\n    EXPECT_STREQ(CombineRTMPString(\"cname.com\", \"test-bucket\", true, false).c_str(),\r\n        \"rtmp://cname.com\");\r\n    EXPECT_STREQ(CombineRTMPString(\"http://192.168.1.1\", \"test-bucket\", true, false).c_str(),\r\n        \"rtmp://192.168.1.1\");\r\n\r\n    //path style\r\n    EXPECT_STREQ(CombineRTMPString(\"http://oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", false, true).c_str(),\r\n        \"rtmp://oss-cn-hangzhou.aliyuncs.com\");\r\n    EXPECT_STREQ(CombineRTMPString(\"oss-cn-hangzhou.aliyuncs.com\", \"test-bucket\", false, true).c_str(),\r\n        \"rtmp://oss-cn-hangzhou.aliyuncs.com\");\r\n    EXPECT_STREQ(CombineRTMPString(\"http://cname.com\", \"test-bucket\", true, true).c_str(),\r\n        \"rtmp://cname.com\");\r\n    EXPECT_STREQ(CombineRTMPString(\"cname.com\", \"test-bucket\", true, true).c_str(),\r\n        \"rtmp://cname.com\");\r\n    EXPECT_STREQ(CombineRTMPString(\"http://192.168.1.1\", \"test-bucket\", true, true).c_str(),\r\n        \"rtmp://192.168.1.1\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, CombineQueryStringTest)\r\n{\r\n    ParameterCollection parameters;\r\n    parameters[\"empty\"] = \"\";\r\n    parameters[\"arg1\"] = \"a\";\r\n    EXPECT_STREQ(CombineQueryString(parameters).c_str(), \"arg1=a&empty\");\r\n\r\n    parameters.clear();\r\n    parameters[\"arg1\"] = \"a\";\r\n    EXPECT_STREQ(CombineQueryString(parameters).c_str(), \"arg1=a\");\r\n\r\n    parameters.clear();\r\n    parameters[\"arg1 arg1\"] = \"a a\";\r\n    EXPECT_STREQ(CombineQueryString(parameters).c_str(), \"arg1%20arg1=a%20a\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, HostToIpTest)\r\n{\r\n    std::string ip = TestUtils::GetIpByEndpoint(\"oss-cn-hangzhou.aliyuncs.com\");\r\n    EXPECT_TRUE(TestUtils::IsValidIp(ip));\r\n    //std::cout << \"ip:\" << ip << std::endl;\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, Base64EncodeUrlSafeTest)\r\n{\r\n    const unsigned char buff[] = { 0x14, 0xFB, 0x9C, 0x03, 0xD9, 0x7E };\r\n    size_t len = sizeof(buff) / sizeof(buff[0]);\r\n    auto value = Base64EncodeUrlSafe((const char *)buff, static_cast<int>(len));\r\n    EXPECT_EQ(value, \"FPucA9l-\");\r\n\r\n    std::vector<std::string> ori = { \"abc\" , \"abcd\" , \"abcde\" };\r\n    std::vector<std::string> pat = { \"YWJj\" , \"YWJjZA\" , \"YWJjZGU\" };\r\n\r\n    auto i = ori.size();\r\n    for (i = 0; i < ori.size(); i++) {\r\n        auto result = Base64EncodeUrlSafe(ori[i]);\r\n        EXPECT_STREQ(result.c_str(), pat[i].c_str());\r\n    }\r\n    EXPECT_TRUE((i == ori.size()));\r\n\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, StringReplaceTest)\r\n{\r\n    std::string test = \"1234abcdABCD1234\";\r\n\r\n    StringReplace(test, \"abcd\", \"A\");\r\n    EXPECT_EQ(test, \"1234AABCD1234\");\r\n\r\n    test = \"12212\";\r\n    StringReplace(test, \"12\", \"21\");\r\n    EXPECT_EQ(test, \"21221\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, UploadAndDownloadObject)\r\n{\r\n    // create client and bucket\r\n    auto BucketName = TestUtils::GetBucketName(\"utils-function-bucket-test\");\r\n    auto key = TestUtils::GetObjectKey(\"utils-function-object-test\");\r\n    std::shared_ptr<OssClient> Client = TestUtils::GetOssClientDefault();\r\n    TestUtils::EnsureBucketExist(*Client, BucketName);\r\n\r\n    // create local file\r\n    std::string tmpFile = TestUtils::GetTargetFileName(\"UtilsFunctionObject\").append(\".tmp\");\r\n    TestUtils::WriteRandomDatatoFile(tmpFile, 1024);\r\n    ObjectMetaData meta;\r\n    // upload obect\r\n    auto uploadObjectOutcome = TestUtils::UploadObject(*Client, BucketName, key, tmpFile, meta);\r\n    EXPECT_EQ(uploadObjectOutcome.isSuccess(), true);\r\n    EXPECT_EQ(Client->DoesObjectExist(BucketName, key), true);\r\n\r\n    // download object\r\n    std::string targetFile = TestUtils::GetTargetFileName(\"TargetFile\").append(\".tmp\");\r\n    TestUtils::DownloadObject(*Client, BucketName, key, targetFile);\r\n\r\n    EXPECT_EQ(GetFileLength(targetFile), GetFileLength(tmpFile));\r\n\r\n    // delete bucket\r\n    TestUtils::CleanBucket(*Client, BucketName);\r\n    Client = nullptr;\r\n    EXPECT_EQ(RemoveFile(tmpFile), true);\r\n    EXPECT_EQ(RemoveFile(targetFile), true);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, IsValidChannelNameTest)\r\n{\r\n    EXPECT_FALSE(IsValidChannelName(\"\"));\r\n    EXPECT_FALSE(IsValidChannelName(\"abc/abc\"));\r\n    std::string value;\r\n    for (int i = 0; i < 1300; i++)\r\n        value.append(\"a\");\r\n    EXPECT_FALSE(IsValidChannelName(value));\r\n\r\n    EXPECT_TRUE(IsValidChannelName(\"channelName\"));\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, IsValidPlayListNameTest)\r\n{\r\n    std::string longName;\r\n    for (int i = 0; i < 130; i++)\r\n        longName.append(\"a\");\r\n    std::string shortName;\r\n    shortName = \"aaa\";\r\n\r\n    EXPECT_FALSE(IsValidPlayListName(\"\"));\r\n    EXPECT_FALSE(IsValidPlayListName(longName));\r\n    EXPECT_FALSE(IsValidPlayListName(shortName));\r\n\r\n    EXPECT_FALSE(IsValidPlayListName(\"aaaa/aaa\"));\r\n    EXPECT_FALSE(IsValidPlayListName(\".aaaaaaa\"));\r\n    EXPECT_FALSE(IsValidPlayListName(\"aaaaaaaa.\"));\r\n    EXPECT_FALSE(IsValidPlayListName(\"aaaaaaaa.m4u8\"));\r\n\r\n    EXPECT_TRUE(IsValidPlayListName(\"aaaaaaaa.m3u8\"));\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToLiveChannelStatusNameTest)\r\n{\r\n    std::string str = ToLiveChannelStatusName(LiveChannelStatus::EnabledStatus);\r\n    EXPECT_EQ(str, \"enabled\");\r\n\r\n    str.clear();\r\n    str = ToLiveChannelStatusName(LiveChannelStatus::DisabledStatus);\r\n    EXPECT_EQ(str, \"disabled\");\r\n\r\n    str.clear();\r\n    str = ToLiveChannelStatusName(LiveChannelStatus::IdleStatus);\r\n    EXPECT_EQ(str, \"idle\");\r\n\r\n    str.clear();\r\n    str = ToLiveChannelStatusName(LiveChannelStatus::LiveStatus);\r\n    EXPECT_EQ(str, \"live\");\r\n\r\n    str.clear();\r\n    str = ToLiveChannelStatusName(LiveChannelStatus::UnknownStatus);\r\n    EXPECT_EQ(str, \"\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToLiveChannelStatusTypeTest)\r\n{\r\n    EXPECT_EQ(ToLiveChannelStatusType(\"enabled\"), LiveChannelStatus::EnabledStatus);\r\n    EXPECT_EQ(ToLiveChannelStatusType(\"EnaBled\"), LiveChannelStatus::EnabledStatus);\r\n    EXPECT_EQ(ToLiveChannelStatusType(\"Enabled\"), LiveChannelStatus::EnabledStatus);\r\n    EXPECT_EQ(ToLiveChannelStatusType(\"Disabled\"), LiveChannelStatus::DisabledStatus);\r\n    EXPECT_EQ(ToLiveChannelStatusType(\"DISabled\"), LiveChannelStatus::DisabledStatus);\r\n    EXPECT_EQ(ToLiveChannelStatusType(\"DISABLED\"), LiveChannelStatus::DisabledStatus);\r\n    EXPECT_EQ(ToLiveChannelStatusType(\"IDLE\"), LiveChannelStatus::IdleStatus);\r\n    EXPECT_EQ(ToLiveChannelStatusType(\"IDLe\"), LiveChannelStatus::IdleStatus);\r\n    EXPECT_EQ(ToLiveChannelStatusType(\"Live\"), LiveChannelStatus::LiveStatus);\r\n    EXPECT_EQ(ToLiveChannelStatusType(\"LIVE\"), LiveChannelStatus::LiveStatus);\r\n    EXPECT_EQ(ToLiveChannelStatusType(\"aaa\"), LiveChannelStatus::UnknownStatus);\r\n    EXPECT_EQ(ToLiveChannelStatusType(\"lived\"), LiveChannelStatus::UnknownStatus);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, TwoHeaderCollectionInsertTest)\r\n{\r\n    HeaderCollection headers1;\r\n    HeaderCollection headers2;\r\n    HeaderCollection headers3;\r\n\r\n    headers1[\"key1\"] = \"value1\";\r\n    headers1[\"key2\"] = \"value2\";\r\n\r\n    headers2[\"key1\"] = \"value1-1\";\r\n    headers2[\"key3\"] = \"value3\";\r\n\r\n\r\n    headers1.insert(headers2.begin(), headers2.end());\r\n    headers1.insert(headers3.begin(), headers3.end());\r\n\r\n    EXPECT_EQ(headers1.size(), 3U);\r\n    EXPECT_EQ(headers1[\"key1\"], \"value1\");\r\n    EXPECT_EQ(headers1[\"key2\"], \"value2\");\r\n    EXPECT_EQ(headers1[\"key3\"], \"value3\");\r\n}\r\n\r\nclass StreamBuftest : public StreamBufProxy\r\n{\r\npublic:\r\n    StreamBuftest(std::iostream& stream) :\r\n        StreamBufProxy(stream)\r\n    {\r\n    }\r\n\r\n    void test()\r\n    {\r\n        overflow();\r\n        pbackfail();\r\n        showmanyc();\r\n        underflow();\r\n        uflow();\r\n        char buf[5] = \"test\";\r\n        int len = 0;\r\n        xsgetn(buf, len);\r\n        setbuf(buf, len);\r\n        imbue(std::locale(\"\"));\r\n    }\r\n};\r\n\r\nTEST_F(UtilsFunctionTest, StreamBufFunctionTest)\r\n{\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::stringstream>();\r\n    *content << \"StreamBufFunctionTest\";\r\n    StreamBuftest buf(*content);\r\n    buf.test();\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, UrlFunctionTest)\r\n{\r\n    Url url1;\r\n    Url url2;\r\n    EXPECT_EQ(url1 == url2, true);\r\n    url1.setHost(\"test.com\");\r\n    EXPECT_EQ(url1 != url2, true);\r\n    url1.fragment();\r\n    url1.authority();\r\n    url1.setPort(1);\r\n    url1.setUserName(\"test\");\r\n    url1.authority();\r\n    url1.fromString(\"#test\");\r\n    std::string str;\r\n    url1.fromString(str);\r\n\r\n    url2.setFragment(\"test\");\r\n    EXPECT_EQ(url2.isEmpty(), false);\r\n\r\n    Url url3;\r\n    url3.isValid();\r\n    url3.setUserName(\"test\");\r\n    url3.isValid();\r\n\r\n    url1.port();\r\n    url1.password();\r\n    url1.path();\r\n    url3.setAuthority(str);\r\n    url3.setAuthority(\"@test:test\");\r\n    url3.setHost(str);\r\n    url3.setPassword(\"test\");\r\n    url3.setUserInfo(\"test\");\r\n    url3.setUserInfo(\":test\");\r\n    url3.setUserName(\"test\");\r\n    url3.userName();\r\n\r\n    url2.toString();\r\n    url2.userInfo();\r\n    url2.setHost(\"test\");\r\n    url2.setUserName(\"test\");\r\n    url2.setPassword(\"test\");\r\n    url2.toString();\r\n    url2.userInfo();\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, SignerFunctionTest)\r\n{\r\n    SignerV1 s;\r\n    s.name();\r\n    s.type();\r\n    std::string str;\r\n    s.generate(str, str);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, UtilBranchTest)\r\n{\r\n    Base64Encode(nullptr, 1);\r\n    ToUpper(nullptr);\r\n\r\n    ToSSEAlgorithm(\"AES256\");\r\n    ToDataRedundancyType(\"ZRS\");\r\n\r\n    ObjectMetaData meta;\r\n    meta.addUserHeader(\"test1\",\"test\");\r\n    meta.removeUserHeader(\"test\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, XmlEscapeTest)\r\n{\r\n    EXPECT_EQ(XmlEscape(\"\"), \"\");\r\n    EXPECT_EQ(XmlEscape(\"\\\"<\"), \"&quot;&lt;\");\r\n    EXPECT_EQ(XmlEscape(\"abdeef\"), \"abdeef\");\r\n    EXPECT_EQ(XmlEscape(\">abc<efj\\\"hij\\'lmn&\"), \"&gt;abc&lt;efj&quot;hij&apos;lmn&amp;\");\r\n\r\n    std::string str;\r\n    str.push_back((char)0xE6);\r\n    str.push_back((char)0xB5);\r\n    str.push_back((char)0x8B);\r\n    str.push_back((char)0xE8);\r\n    str.push_back((char)0xAF);\r\n    str.push_back((char)0x95);\r\n    EXPECT_EQ(XmlEscape(str), str);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToInventoryFormatNameTest)\r\n{\r\n    EXPECT_STREQ(ToInventoryFormatName(InventoryFormat::NotSet), \"NotSet\");\r\n    EXPECT_STREQ(ToInventoryFormatName(InventoryFormat::CSV), \"CSV\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToInventoryFormatTypeTest)\r\n{\r\n    EXPECT_EQ(ToInventoryFormatType(\"NotSet\"), InventoryFormat::NotSet);\r\n    EXPECT_EQ(ToInventoryFormatType(\"notSet\"), InventoryFormat::NotSet);\r\n    EXPECT_EQ(ToInventoryFormatType(\"Invalid\"), InventoryFormat::NotSet);\r\n    EXPECT_EQ(ToInventoryFormatType(\"CSV\"), InventoryFormat::CSV);\r\n    EXPECT_EQ(ToInventoryFormatType(\"csv\"), InventoryFormat::CSV);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToInventoryFrequencyNameTest)\r\n{\r\n    EXPECT_STREQ(ToInventoryFrequencyName(InventoryFrequency::NotSet), \"NotSet\");\r\n    EXPECT_STREQ(ToInventoryFrequencyName(InventoryFrequency::Daily), \"Daily\");\r\n    EXPECT_STREQ(ToInventoryFrequencyName(InventoryFrequency::Weekly), \"Weekly\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToInventoryFrequencyTypeTest)\r\n{\r\n    EXPECT_EQ(ToInventoryFrequencyType(\"NotSet\"), InventoryFrequency::NotSet);\r\n    EXPECT_EQ(ToInventoryFrequencyType(\"notSet\"), InventoryFrequency::NotSet);\r\n    EXPECT_EQ(ToInventoryFrequencyType(\"Invalid\"), InventoryFrequency::NotSet);\r\n    EXPECT_EQ(ToInventoryFrequencyType(\"Daily\"), InventoryFrequency::Daily);\r\n    EXPECT_EQ(ToInventoryFrequencyType(\"daily\"), InventoryFrequency::Daily);\r\n    EXPECT_EQ(ToInventoryFrequencyType(\"Weekly\"), InventoryFrequency::Weekly);\r\n    EXPECT_EQ(ToInventoryFrequencyType(\"weekly\"), InventoryFrequency::Weekly);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToInventoryOptionalFieldNameTest)\r\n{\r\n    EXPECT_STREQ(ToInventoryOptionalFieldName(InventoryOptionalField::NotSet), \"NotSet\");\r\n    EXPECT_STREQ(ToInventoryOptionalFieldName(InventoryOptionalField::Size), \"Size\");\r\n    EXPECT_STREQ(ToInventoryOptionalFieldName(InventoryOptionalField::LastModifiedDate), \"LastModifiedDate\");\r\n    EXPECT_STREQ(ToInventoryOptionalFieldName(InventoryOptionalField::ETag), \"ETag\");\r\n    EXPECT_STREQ(ToInventoryOptionalFieldName(InventoryOptionalField::StorageClass), \"StorageClass\");\r\n    EXPECT_STREQ(ToInventoryOptionalFieldName(InventoryOptionalField::IsMultipartUploaded), \"IsMultipartUploaded\");\r\n    EXPECT_STREQ(ToInventoryOptionalFieldName(InventoryOptionalField::EncryptionStatus), \"EncryptionStatus\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToInventoryOptionalFieldTypeTest)\r\n{\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"NotSet\"), InventoryOptionalField::NotSet);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"notSet\"), InventoryOptionalField::NotSet);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"Invalid\"), InventoryOptionalField::NotSet);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"Size\"), InventoryOptionalField::Size);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"size\"), InventoryOptionalField::Size);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"LastModifiedDate\"), InventoryOptionalField::LastModifiedDate);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"lastModifiedDate\"), InventoryOptionalField::LastModifiedDate);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"ETag\"), InventoryOptionalField::ETag);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"eTag\"), InventoryOptionalField::ETag);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"StorageClass\"), InventoryOptionalField::StorageClass);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"storageClass\"), InventoryOptionalField::StorageClass);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"IsMultipartUploaded\"), InventoryOptionalField::IsMultipartUploaded);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"isMultipartUploaded\"), InventoryOptionalField::IsMultipartUploaded);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"EncryptionStatus\"), InventoryOptionalField::EncryptionStatus);\r\n    EXPECT_EQ(ToInventoryOptionalFieldType(\"encryptionStatus\"), InventoryOptionalField::EncryptionStatus);\r\n}\r\n\r\n\r\nTEST_F(UtilsFunctionTest, ToInventoryIncludedObjectVersionsNameTest)\r\n{\r\n    EXPECT_STREQ(ToInventoryIncludedObjectVersionsName(InventoryIncludedObjectVersions::NotSet), \"NotSet\");\r\n    EXPECT_STREQ(ToInventoryIncludedObjectVersionsName(InventoryIncludedObjectVersions::All), \"All\");\r\n    EXPECT_STREQ(ToInventoryIncludedObjectVersionsName(InventoryIncludedObjectVersions::Current), \"Current\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToInventoryIncludedObjectVersionsTypeTest)\r\n{\r\n    EXPECT_EQ(ToInventoryIncludedObjectVersionsType(\"NotSet\"), InventoryIncludedObjectVersions::NotSet);\r\n    EXPECT_EQ(ToInventoryIncludedObjectVersionsType(\"notSet\"), InventoryIncludedObjectVersions::NotSet);\r\n    EXPECT_EQ(ToInventoryIncludedObjectVersionsType(\"Invalid\"), InventoryIncludedObjectVersions::NotSet);\r\n    EXPECT_EQ(ToInventoryIncludedObjectVersionsType(\"All\"), InventoryIncludedObjectVersions::All);\r\n    EXPECT_EQ(ToInventoryIncludedObjectVersionsType(\"all\"), InventoryIncludedObjectVersions::All);\r\n    EXPECT_EQ(ToInventoryIncludedObjectVersionsType(\"Current\"), InventoryIncludedObjectVersions::Current);\r\n    EXPECT_EQ(ToInventoryIncludedObjectVersionsType(\"current\"), InventoryIncludedObjectVersions::Current);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToInventoryBucketFullNameTest)\r\n{\r\n    EXPECT_EQ(ToInventoryBucketFullName(\"bucket-name\"), \"acs:oss:::bucket-name\");\r\n    EXPECT_EQ(ToInventoryBucketFullName(\"\"), \"acs:oss:::\");\r\n    EXPECT_EQ(ToInventoryBucketFullName(\"test\"), \"acs:oss:::test\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToInventoryBucketShortNameTest)\r\n{\r\n    EXPECT_EQ(ToInventoryBucketShortName(\"acs:oss:::bucket-name\"), \"bucket-name\");\r\n    EXPECT_EQ(ToInventoryBucketShortName(nullptr), \"\");\r\n    EXPECT_EQ(ToInventoryBucketShortName(\"acs:oss:::test\"), \"test\");\r\n    EXPECT_EQ(ToInventoryBucketShortName(\"ACS:OSS:::test\"), \"test\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToTierTypeNameTest)\r\n{\r\n    EXPECT_STREQ(ToTierTypeName(TierType::Standard), \"Standard\");\r\n    EXPECT_STREQ(ToTierTypeName(TierType::Expedited), \"Expedited\");\r\n    EXPECT_STREQ(ToTierTypeName(TierType::Bulk), \"Bulk\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToTierTypeTest)\r\n{\r\n    EXPECT_EQ(ToTierType(\"Standard\"), TierType::Standard);\r\n    EXPECT_EQ(ToTierType(\"standard\"), TierType::Standard);\r\n    EXPECT_EQ(ToTierType(\"Expedited\"), TierType::Expedited);\r\n    EXPECT_EQ(ToTierType(\"expedited\"), TierType::Expedited);\r\n    EXPECT_EQ(ToTierType(\"Bulk\"), TierType::Bulk);\r\n    EXPECT_EQ(ToTierType(\"bulk\"), TierType::Bulk);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, JsonStringToMapTest)\r\n{\r\n    std::string jsonStr1 = R\"({\"comment\":\"rsa test\",\"provider\":\"aliclould\"})\";\r\n    std::string jsonStr2 = R\"({\"provider\":\"aliclould\",\"comment\":\"rsa test\"})\";\r\n    std::string jsonStr3 = R\"({\"comment\":\"kms test\",\"provider\":\"aliclould\"})\";\r\n\r\n    auto map1 = JsonStringToMap(jsonStr1);\r\n    auto map2 = JsonStringToMap(jsonStr2);\r\n    auto map3 = JsonStringToMap(jsonStr3);\r\n\r\n    EXPECT_EQ(map1, map2);\r\n    EXPECT_NE(map1, map3);\r\n\r\n    EXPECT_EQ(map1[\"comment\"], \"rsa test\");\r\n    EXPECT_EQ(map1[\"provider\"], \"aliclould\");\r\n\r\n    EXPECT_EQ(map3[\"comment\"], \"kms test\");\r\n    EXPECT_EQ(map3[\"provider\"], \"aliclould\");\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, MapToJsonStringTest)\r\n{\r\n    std::string jsonStr1 = R\"({\"comment\":\"rsa test\",\"provider\":\"aliclould\"})\";\r\n    std::string jsonStr3 = R\"({\"comment\":\"kms test\",\"provider\":\"aliclould\"})\";\r\n\r\n    std::map<std::string, std::string> map1;\r\n    map1[\"comment\"] = \"rsa test\";\r\n    map1[\"provider\"] = \"aliclould\";\r\n    auto json1 = MapToJsonString(map1);\r\n\r\n    std::map<std::string, std::string> map2;\r\n    map2[\"provider\"] = \"aliclould\";\r\n    map2[\"comment\"] = \"rsa test\";\r\n    auto json2 = MapToJsonString(map2);\r\n\r\n    std::map<std::string, std::string> map3;\r\n    map3[\"provider\"] = \"aliclould\";\r\n    map3[\"comment\"] = \"kms test\";\r\n    auto json3 = MapToJsonString(map3);\r\n       \r\n    EXPECT_EQ(json1, jsonStr1);\r\n    EXPECT_EQ(json3, jsonStr3);\r\n    EXPECT_EQ(json1, json2);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, IsValidEndpointTest)\r\n{\r\n    EXPECT_EQ(IsValidEndpoint(\"192.168.1.1\"), true);\r\n    EXPECT_EQ(IsValidEndpoint(\"192.168.1.1:80\"), true);\r\n    EXPECT_EQ(IsValidEndpoint(\"www.test-inc.com\"), true);\r\n    EXPECT_EQ(IsValidEndpoint(\"WWW.test-inc_CN.com\"), true);\r\n    EXPECT_EQ(IsValidEndpoint(\"http://www.test-inc.com\"), true);\r\n    EXPECT_EQ(IsValidEndpoint(\"http://www.test-inc_test.com:80\"), true);\r\n    EXPECT_EQ(IsValidEndpoint(\"https://www.test-inc_test.com:80/test?123=x\"), true);\r\n    EXPECT_EQ(IsValidEndpoint(\"www.test-inc*test.com\"), false);\r\n    EXPECT_EQ(IsValidEndpoint(\"www.test-inc.com\\\\oss-cn-hangzhou.aliyuncs.com\"), false);\r\n    EXPECT_EQ(IsValidEndpoint(\"\"), false);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, IsValidObjectKeyTest)\r\n{\r\n    EXPECT_EQ(IsValidObjectKey(\"123\"), true);\r\n    EXPECT_EQ(IsValidObjectKey(\"\"), false);\r\n\r\n    EXPECT_EQ(IsValidObjectKey(\"123\", true), true);\r\n    EXPECT_EQ(IsValidObjectKey(\"\", true), false);\r\n\r\n    EXPECT_EQ(IsValidObjectKey(\"?123\", true), false);\r\n    EXPECT_EQ(IsValidObjectKey(\"?\", true), false);\r\n    EXPECT_EQ(IsValidObjectKey(\"1?23\", true), true);\r\n    EXPECT_EQ(IsValidObjectKey(\" ?\", true), true);\r\n\r\n    EXPECT_EQ(IsValidObjectKey(\"?123\", false), true);\r\n    EXPECT_EQ(IsValidObjectKey(\"?\", false), true);\r\n    EXPECT_EQ(IsValidObjectKey(\"123?\", false), true);\r\n    EXPECT_EQ(IsValidObjectKey(\" ?\", false), true);\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, FormatUnixTimeTest)\r\n{\r\n    // GMT\r\n    std::string gmt_foramt = \"%a, %d %b %Y %H:%M:%S GMT\";\r\n    std::time_t t = 0;\r\n    std::string timeStr = FormatUnixTime(t, gmt_foramt);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Thu, 01 Jan 1970 00:00:00 GMT\");\r\n\r\n    t = 1520411719;\r\n    timeStr = FormatUnixTime(t, gmt_foramt);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Wed, 07 Mar 2018 08:35:19 GMT\");\r\n\r\n    t = 1554703347;\r\n    timeStr = FormatUnixTime(t, gmt_foramt);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Mon, 08 Apr 2019 06:02:27 GMT\");\r\n\r\n    t = 1554739347;\r\n    timeStr = FormatUnixTime(t, gmt_foramt);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Mon, 08 Apr 2019 16:02:27 GMT\");\r\n\r\n    auto oldLoc = std::cout.getloc();\r\n    std::locale::global(std::locale(\"\"));\r\n\r\n    t = 0;\r\n    timeStr = FormatUnixTime(t, gmt_foramt);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Thu, 01 Jan 1970 00:00:00 GMT\");\r\n\r\n    t = 1520411719;\r\n    timeStr = FormatUnixTime(t, gmt_foramt);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Wed, 07 Mar 2018 08:35:19 GMT\");\r\n\r\n    t = 1554703347;\r\n    timeStr = FormatUnixTime(t, gmt_foramt);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Mon, 08 Apr 2019 06:02:27 GMT\");\r\n\r\n    t = 1554739347;\r\n    timeStr = FormatUnixTime(t, gmt_foramt);\r\n    EXPECT_STREQ(timeStr.c_str(), \"Mon, 08 Apr 2019 16:02:27 GMT\");\r\n\r\n    std::locale::global(oldLoc);\r\n\r\n    // UTC\r\n    std::string utc_foramt = \"%Y-%m-%dT%H:%M:%S.000Z\";\r\n    t = 0;\r\n    timeStr = FormatUnixTime(t, utc_foramt);\r\n    EXPECT_STREQ(timeStr.c_str(), \"1970-01-01T00:00:00.000Z\");\r\n\r\n    t = 1520411719;\r\n    timeStr = FormatUnixTime(t, utc_foramt);\r\n    EXPECT_STREQ(timeStr.c_str(), \"2018-03-07T08:35:19.000Z\");\r\n\r\n    oldLoc = std::cout.getloc();\r\n    std::locale::global(std::locale(\"\"));\r\n\r\n    t = 0;\r\n    timeStr = FormatUnixTime(t, utc_foramt);\r\n    EXPECT_STREQ(timeStr.c_str(), \"1970-01-01T00:00:00.000Z\");\r\n\r\n    t = 1520411719;\r\n    timeStr = FormatUnixTime(t, utc_foramt);\r\n    EXPECT_STREQ(timeStr.c_str(), \"2018-03-07T08:35:19.000Z\");\r\n\r\n    t = 1520433319;\r\n    timeStr = FormatUnixTime(t, utc_foramt);\r\n    EXPECT_STREQ(timeStr.c_str(), \"2018-03-07T14:35:19.000Z\");\r\n\r\n    std::locale::global(oldLoc);\r\n\r\n\r\n    // V4 TIME FORMAT\r\n\r\n}\r\n\r\nTEST_F(UtilsFunctionTest, ToUnixTimeTest)\r\n{\r\n    std::string utc_foramt = \"%Y-%m-%dT%H:%M:%S\";\r\n    std::string date = \"1970-01-01T00:00:00.000Z\";\r\n    std::time_t t = ToUnixTime(date, utc_foramt);\r\n    EXPECT_EQ(t, 0);\r\n\r\n    date = \"2018-03-07T08:35:19.123Z\";\r\n    t = ToUnixTime(date, utc_foramt);\r\n    EXPECT_EQ(t, 1520411719);\r\n\r\n    date = \"2018-03-07T08:35:19Z\";\r\n    t = ToUnixTime(date, utc_foramt);\r\n    EXPECT_EQ(t, 1520411719);\r\n\r\n    date = \"2018-03-07T08:35:19.abcZ\";\r\n    t = ToUnixTime(date, utc_foramt);\r\n    EXPECT_EQ(t, 1520411719);\r\n\r\n    date = \"18-03-07T08:35:19.000Z\";\r\n    t = ToUnixTime(date, utc_foramt);\r\n    EXPECT_EQ(t, -1);\r\n\r\n    //invalid case\r\n    date = \"ab-03-07T08:35:19.000Z\";\r\n    t = ToUnixTime(date, utc_foramt);\r\n    EXPECT_EQ(t, -1);\r\n\r\n    date = \"\";\r\n    t = ToUnixTime(date, utc_foramt);\r\n    EXPECT_EQ(t, -1);\r\n}\r\n\r\n}\r\n}\r\n"
  },
  {
    "path": "test/src/Program.cc",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <alibabacloud/oss/OssClient.h>\n#include <gtest/gtest.h>\n#include \"Config.h\"\n\nint main(int argc, char **argv)\n{\n    std::cout << \"oss-cpp-sdk test\" << std::endl;\n    Config::ParseArg(argc, argv);\n    if (!Config::InitTestEnv()) {\n        std::cout << \"One of AK,SK or Endpoint is not configured.\" << std::endl;\n        return -1;\n    }\n    testing::InitGoogleTest(&argc, argv);\n    srand((int)time(0));\n    AlibabaCloud::OSS::InitializeSdk();\n    //for code coverage\n    AlibabaCloud::OSS::InitializeSdk();\n    if (!AlibabaCloud::OSS::IsSdkInitialized()) {\n        std::cout << \"oss-cpp-sdk test InitializeSdk fail.\" << std::endl;\n        return -1;\n    }\n    int ret = RUN_ALL_TESTS();\n    AlibabaCloud::OSS::ShutdownSdk();\n    //for code coverage\n    AlibabaCloud::OSS::ShutdownSdk();\n    return ret;\n}\n"
  },
  {
    "path": "test/src/Utils.cc",
    "content": "/*\r\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n#include <string>\r\n#include \"Utils.h\"\r\n#include <time.h>\r\n#include <ctime>\r\n#include <sstream>\r\n#include <memory>\r\n#include <fstream>\r\n#include <thread>\r\n#ifdef _WIN32\r\n#include <codecvt>\r\n#include <ws2tcpip.h>\r\n#pragma comment (lib, \"Ws2_32.lib\")\r\n#else\r\n#include <netdb.h>\r\n#include <unistd.h>\r\n#include <netinet/in.h>\r\n#endif\r\n#include <regex>\r\n#include <iomanip>\r\n#include <src/utils/Utils.h>\r\n#include <src/utils/Crc64.h>\r\n#include <cstring>\r\n#include \"Config.h\"\r\n\r\n#ifdef GetObject\r\n#undef GetObject\r\n#endif \r\nusing namespace AlibabaCloud::OSS;\r\n#ifndef PATH_MAX\r\n#define PATH_MAX 1024\r\n#endif\r\n\r\nconst std::list<std::string>& TestUtils::InvalidBucketNamesList()\r\n{\r\n    const static std::list<std::string> nameList =\r\n    { \"a\", \"1\", \"!\", \"aa\", \"12\", \"a1\",\r\n        \"a!\", \"1!\", \"aAa\", \"1A1\", \"a!a\", \"FengChao@123\", \"-a123\", \"a_123\", \"a123-\",\r\n        \"1234567890123456789012345678901234567890123456789012345678901234\", \"\"\r\n    };\r\n    return nameList;\r\n}\r\n\r\nconst std::list<std::string>& TestUtils::InvalidObjectKeyNamesList()\r\n{\r\n    const static std::list<std::string> nameList =\r\n    {\r\n        \"\\\\123\", \"\"\r\n    };\r\n    return nameList;\r\n}\r\n\r\nconst std::list<std::string>& TestUtils::InvalidLoggingPrefixNamesList()\r\n{\r\n    const static std::list<std::string> nameList =\r\n    {\r\n        \"1\", \"-a\", \"@@\", \"a_\", \"abcdefghijklmnopqrstuvwxyz1234567\"\r\n    };\r\n    return nameList;\r\n}\r\n\r\nconst std::list<std::string>& TestUtils::InvalidPageNamesList()\r\n{\r\n    const static std::list<std::string> nameList =\r\n    {\r\n        \"a\", \".html\", \"\"\r\n    };\r\n    return nameList;\r\n}\r\n\r\nstd::string TestUtils::GetBucketName(const std::string &prefix)\r\n{\r\n    std::stringstream ss;\r\n    auto tp = std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::system_clock::now());\r\n    ss << prefix << \"-bucket-\" << tp.time_since_epoch().count();\r\n    return ss.str();\r\n}\r\n\r\nstd::string TestUtils::GetObjectKey(const std::string &prefix)\r\n{\r\n    std::stringstream ss;\r\n    auto tp = std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::system_clock::now());\r\n    ss << prefix << \"-object-\" << tp.time_since_epoch().count();\r\n    return ss.str();\r\n}\r\n\r\nstd::string TestUtils::GetTargetFileName(const std::string &prefix)\r\n{\r\n    std::stringstream ss;\r\n    auto tp = std::chrono::time_point_cast<std::chrono::milliseconds>(std::chrono::system_clock::now());\r\n    ss << prefix << \"-file-\" << tp.time_since_epoch().count();\r\n    return ss.str();\r\n}\r\n\r\nstd::shared_ptr<OssClient> TestUtils::GetOssClientDefault()\r\n{\r\n    auto conf = ClientConfiguration();\r\n    conf.signatureVersion = SignatureVersionType::V1;\r\n    auto client = std::make_shared<OssClient>(Config::Endpoint, Config::AccessKeyId, Config::AccessKeySecret, conf);\r\n    client->SetRegion(Config::Region);\r\n    return client;\r\n}\r\n\r\nbool TestUtils::BucketExists(const OssClient &client, const std::string &bucketName)\r\n{\r\n    return client.GetBucketAcl(GetBucketAclRequest(bucketName)).isSuccess();\r\n}\r\n\r\nvoid TestUtils::EnsureBucketExist(const OssClient &client, const std::string &bucketName)\r\n{\r\n    if (!BucketExists(client, bucketName)) {\r\n        client.CreateBucket(CreateBucketRequest(bucketName));\r\n    }\r\n}\r\n\r\nbool TestUtils::ObjectExists(const OssClient& client, const std::string& bucketName, const std::string& keyName)\r\n{\r\n    return client.GetObjectMeta(GetObjectMetaRequest(bucketName, keyName)).isSuccess();\r\n}\r\n\r\nvoid TestUtils::CleanBucket(const OssClient &client, const std::string &bucketName)\r\n{\r\n    if (!client.DoesBucketExist(bucketName))\r\n        return;\r\n\r\n    // Clean up multipart uploading object\r\n    auto listOutcome = client.ListMultipartUploads(ListMultipartUploadsRequest(bucketName));\r\n    if (listOutcome.isSuccess()) {\r\n        for (auto const &upload : listOutcome.result().MultipartUploadList())\r\n        {\r\n            client.AbortMultipartUpload(AbortMultipartUploadRequest(bucketName, upload.Key, upload.UploadId));\r\n        }\r\n    }\r\n\r\n    // Clean up objects\r\n    ListObjectsRequest request(bucketName);\r\n    bool IsTruncated = false;\r\n    do {\r\n        auto outcome = client.ListObjects(request);\r\n        if (outcome.isSuccess()) {\r\n            for (auto const &obj : outcome.result().ObjectSummarys()) {\r\n                client.DeleteObject(DeleteObjectRequest(bucketName, obj.Key()));\r\n            }\r\n        }\r\n        else {\r\n            break;\r\n        }\r\n        request.setMarker(outcome.result().NextMarker());\r\n        IsTruncated = outcome.result().IsTruncated();\r\n    } while (IsTruncated);\r\n\r\n    // Clean up LiveChannel\r\n    ListLiveChannelRequest request2(bucketName);\r\n    IsTruncated = false;\r\n    do{\r\n        auto listvOutcome = client.ListLiveChannel(request2);\r\n        if(listvOutcome.isSuccess())\r\n        {\r\n            for(auto const &liveChannel : listvOutcome.result().LiveChannelList())\r\n            {\r\n                client.DeleteLiveChannel(DeleteLiveChannelRequest(bucketName, liveChannel.name));\r\n            }\r\n            IsTruncated = listvOutcome.result().IsTruncated();\r\n            request2.setMarker(listvOutcome.result().NextMarker());\r\n        }else{\r\n            break;\r\n        }\r\n    }while(IsTruncated);\r\n\r\n    // Delete the bucket.\r\n    client.DeleteBucket(DeleteBucketRequest(bucketName));\r\n}\r\n\r\nvoid TestUtils::CleanBucketsByPrefix(const OssClient &client, const std::string &prefix)\r\n{\r\n    ListBucketsRequest request;\r\n    request.setMaxKeys(1);\r\n    request.setPrefix(prefix);\r\n    bool IsTruncated = false;\r\n    do {\r\n        auto outcome = client.ListBuckets(request);\r\n        if (outcome.isSuccess()) {\r\n            CleanBucket(client, outcome.result().Buckets()[0].Name());\r\n        }\r\n        request.setMarker(outcome.result().NextMarker());\r\n        IsTruncated = outcome.result().IsTruncated();\r\n    } while (IsTruncated);\r\n}\r\n\r\nvoid TestUtils::CleanBucketVersioning(const OssClient &client, const std::string &bucketName)\r\n{\r\n    if (!client.DoesBucketExist(bucketName))\r\n        return;\r\n\r\n    auto bfOutcome = client.GetBucketInfo(bucketName);\r\n    if (bfOutcome.isSuccess() && bfOutcome.result().VersioningStatus() != VersioningStatus::NotSet) {\r\n        //list objects by ListObjectVersions  and delete object with versionId\r\n        ListObjectVersionsRequest request(bucketName);\r\n        request.setEncodingType(\"url\");\r\n        bool IsTruncated = false;\r\n        do {\r\n            auto outcome = client.ListObjectVersions(request);\r\n            if (outcome.isSuccess()) {\r\n                for (auto const &marker : outcome.result().DeleteMarkerSummarys()) {\r\n                    client.DeleteObject(DeleteObjectRequest(bucketName, marker.Key(), marker.VersionId()));\r\n                }\r\n\r\n                for (auto const &obj : outcome.result().ObjectVersionSummarys()) {\r\n                    client.DeleteObject(DeleteObjectRequest(bucketName, obj.Key(), obj.VersionId()));\r\n                }\r\n            }\r\n            else {\r\n                break;\r\n            }\r\n            request.setKeyMarker(outcome.result().NextKeyMarker());\r\n            request.setVersionIdMarker(outcome.result().NextVersionIdMarker());\r\n\r\n            IsTruncated = outcome.result().IsTruncated();\r\n        } while (IsTruncated);\r\n    }\r\n\r\n    CleanBucket(client, bucketName);\r\n}\r\n\r\nPutObjectOutcome TestUtils::UploadObject(const OssClient& client, const std::string &bucketName,\r\n    const std::string& keyName, const std::string &filename, const ObjectMetaData &metadata)\r\n{\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(filename, std::ios::in);\r\n    return client.PutObject(PutObjectRequest(bucketName, keyName, content, metadata));\r\n}\r\n\r\nPutObjectOutcome TestUtils::UploadObject(const OssClient& client, const std::string &bucketName,\r\n    const std::string& keyName, const std::string &filename)\r\n{\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(filename, std::ios::in|std::ios::binary);\r\n    return client.PutObject(PutObjectRequest(bucketName, keyName, content));\r\n}\r\n\r\nvoid TestUtils::DownloadObject(const OssClient& client, const std::string &bucketName,\r\n    const std::string& keyName, const std::string& targetFile)\r\n{\r\n    GetObjectRequest request(bucketName, keyName);\r\n    request.setResponseStreamFactory([=]() {return std::make_shared<std::fstream>(targetFile, std::ios::binary|std::ios_base::out|std::ios_base::trunc); });\r\n    client.GetObject(request);\r\n}\r\n\r\nvoid TestUtils::WaitForCacheExpire(int sec)\r\n{\r\n    std::this_thread::sleep_for(std::chrono::seconds(sec));\r\n}\r\n\r\nchar TestUtils::GetRandomChar()\r\n{\r\n    return 'a' + rand() % 32;\r\n}\r\n\r\nstd::string TestUtils::GetRandomString(int length)\r\n{\r\n    std::stringstream ss;\r\n    for (int i = 0; i < length; i++) {\r\n        ss << static_cast<char>('!' + rand() % 90);\r\n    }\r\n    return ss.str();\r\n}\r\n\r\nstd::shared_ptr<std::iostream> TestUtils::GetRandomStream(int length)\r\n{\r\n    std::shared_ptr<std::stringstream> stream = std::make_shared<std::stringstream>();\r\n    std::stringstream ss;\r\n    for (int i = 0; i < length; i++) {\r\n        *stream << static_cast<char>('!' + rand() % 90);\r\n    }\r\n    stream->seekg(0);\r\n    stream->seekp(0, std::ios_base::end);\r\n    return stream;\r\n}\r\n\r\nvoid TestUtils::WriteRandomDatatoFile(const std::string &file, int length)\r\n{\r\n    std::fstream of(file, std::ios::out | std::ios::binary | std::ios::trunc);\r\n    of << GetRandomString(length);\r\n    of.close();\r\n}\r\n\r\n\r\nbool TestUtils::IsValidIp(const std::string &host)\r\n{\r\n    return AlibabaCloud::OSS::IsIp(host);\r\n}\r\n\r\nstd::string TestUtils::GetIpByEndpoint(const std::string &endpoint)\r\n{\r\n    if (IsValidIp(endpoint)) {\r\n        return endpoint;\r\n    }\r\n\r\n    std::string hostname(endpoint);\r\n\r\n    if (!endpoint.compare(0, 7, \"http://\", 7)) {\r\n        hostname = hostname.substr(7);\r\n    }\r\n    else if (!endpoint.compare(0, 8, \"https://\", 8)) {\r\n        hostname = hostname.substr(8);\r\n    }\r\n\r\n    auto it = hostname.find(\"/\");\r\n    if (it != std::string::npos) {\r\n        hostname = hostname.substr(0, it);\r\n    }\r\n\r\n    struct addrinfo *ailist, *aip;\r\n    struct addrinfo hint;\r\n    //struct sockaddr_in *sinp;\r\n    char m_ipaddr[16] = {0};\r\n    int ret;\r\n    memset(&hint, 0, sizeof(struct addrinfo));\r\n    hint.ai_family = AF_INET;\r\n    //hint.ai_socktype = SOCK_DGRAM;\r\n    hint.ai_flags = AI_PASSIVE; \r\n    hint.ai_protocol = 0;\r\n    ret = getaddrinfo(hostname.c_str(), \"http\", &hint, &ailist);\r\n    if (ret == -1) {\r\n        return \"\";\r\n    }\r\n\r\n    for (aip = ailist; aip != NULL; aip = aip->ai_next) {\r\n        struct sockaddr_in *sinp = (struct sockaddr_in *)aip->ai_addr;\r\n#ifdef _WIN32\r\n        sprintf_s(m_ipaddr, \"%d.%d.%d.%d\",\r\n            (*sinp).sin_addr.S_un.S_un_b.s_b1,\r\n            (*sinp).sin_addr.S_un.S_un_b.s_b2,\r\n            (*sinp).sin_addr.S_un.S_un_b.s_b3,\r\n            (*sinp).sin_addr.S_un.S_un_b.s_b4);\r\n#else\r\n        snprintf(m_ipaddr, sizeof(m_ipaddr), \"%d.%d.%d.%d\",\r\n            ((*sinp).sin_addr.s_addr >> 0) & 0xFF,\r\n            ((*sinp).sin_addr.s_addr >> 8) & 0xFF,\r\n            ((*sinp).sin_addr.s_addr >> 16)& 0xFF,\r\n            ((*sinp).sin_addr.s_addr >> 24));\r\n#endif\r\n    }\r\n    freeaddrinfo(ailist);\r\n    return std::string(m_ipaddr);\r\n}\r\n\r\n#ifdef _WIN32\r\n\r\nstatic std::string FromWString(const wchar_t* source)\r\n{\r\n    const auto len = static_cast<int>(std::wcslen(source));\r\n    std::string output;\r\n    if (int requiredSizeInBytes = WideCharToMultiByte(CP_UTF8, 0 ,  source,\r\n        len,  nullptr,  0,  nullptr, nullptr)) {\r\n        output.resize(requiredSizeInBytes);\r\n    }\r\n    const auto result = WideCharToMultiByte(CP_UTF8, 0, source,\r\n        len,  &output[0], static_cast<int>(output.length()),\r\n        nullptr, nullptr);\r\n\r\n    if (result) {\r\n        output.resize(result);\r\n        return output;\r\n    }\r\n\r\n    return \"\";\r\n}\r\n\r\nstd::string TestUtils::GetExecutableDirectory()\r\n{\r\n    WCHAR buffer[PATH_MAX];\r\n    memset(buffer, 0, sizeof(buffer));\r\n\r\n    if (GetModuleFileNameW(nullptr, buffer, static_cast<DWORD>(sizeof(buffer))))\r\n    {\r\n        std::string bufferStr(FromWString(buffer));\r\n        auto fileNameStart = bufferStr.find_last_of('\\\\');\r\n        if (fileNameStart != std::string::npos)\r\n        {\r\n            bufferStr = bufferStr.substr(0, fileNameStart);\r\n        }\r\n\r\n        return bufferStr;\r\n    }\r\n\r\n    return \"\";\r\n}\r\n\r\nstd::wstring TestUtils::GetExecutableDirectoryW()\r\n{\r\n    WCHAR buffer[PATH_MAX];\r\n    memset(buffer, 0, sizeof(buffer));\r\n\r\n    if (GetModuleFileNameW(nullptr, buffer, static_cast<DWORD>(sizeof(buffer))))\r\n    {\r\n        std::wstring bufferStr(buffer);\r\n        auto fileNameStart = bufferStr.find_last_of(L'\\\\');\r\n        if (fileNameStart != std::string::npos)\r\n        {\r\n            bufferStr = bufferStr.substr(0, fileNameStart);\r\n        }\r\n\r\n        return bufferStr;\r\n    }\r\n\r\n    return L\"\";\r\n}\r\n\r\n#else\r\n\r\nstd::string TestUtils::GetExecutableDirectory()\r\n{\r\n    char dest[PATH_MAX];\r\n    size_t destSize = sizeof(dest);\r\n    memset(dest, 0, destSize);\r\n\r\n    if (readlink(\"/proc/self/exe\", dest, destSize))\r\n    {\r\n        std::string executablePath(dest);\r\n        auto lastSlash = executablePath.find_last_of('/');\r\n        if (lastSlash != std::string::npos)\r\n        {\r\n            return executablePath.substr(0, lastSlash);\r\n        }\r\n    }\r\n\r\n    return \"./\";\r\n}\r\n\r\nstd::wstring TestUtils::GetExecutableDirectoryW()\r\n{\r\n    return L\"\";\r\n    //std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;\r\n    //return converter.from_bytes(GetExecutableDirectory());\r\n}\r\n\r\n#endif\r\n\r\nstd::string TestUtils::GetGMTString(int64_t delayS)\r\n{\r\n    std::time_t t = std::time(nullptr);\r\n    t += delayS;\r\n    return ToGmtTime(t);\r\n}\r\n\r\nstd::string TestUtils::GetUTCString(int32_t Days, bool noSec)\r\n{\r\n    const int64_t secPerDay = 24LL * 60LL * 60LL;\r\n    std::time_t t = std::time(nullptr);\r\n    if (noSec) {\r\n        t = t - t % secPerDay;\r\n    }\r\n    t += (int64_t)Days * secPerDay;\r\n    return ToUtcTime(t);\r\n}\r\n\r\nstd::string TestUtils::GetHTTPSEndpoint(const std::string endpoint)\r\n{\r\n    Url url(endpoint);\r\n    std::string result;\r\n    result.append(\"https://\").append(url.authority());\r\n    return result;\r\n}\r\n\r\nstd::string TestUtils::GetFileMd5(const std::string file)\r\n{\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(file, std::ios::in | std::ios::binary);\r\n    return ComputeContentMD5(*content);\r\n}\r\n\r\n\r\nstd::string TestUtils::GetFileETag(const std::string file)\r\n{\r\n    std::shared_ptr<std::iostream> content = std::make_shared<std::fstream>(file, std::ios::in | std::ios::binary);\r\n    return ComputeContentETag(*content);\r\n}\r\n\r\nuint64_t TestUtils::GetFileCRC64(const std::string file)\r\n{\r\n    std::shared_ptr<std::iostream> stream = std::make_shared<std::fstream>(file, std::ios::in | std::ios::binary);\r\n\r\n    uint64_t crc64 = 0;\r\n\r\n    auto currentPos = stream->tellg();\r\n    if (currentPos == static_cast<std::streampos>(-1)) {\r\n        currentPos = 0;\r\n        stream->clear();\r\n    }\r\n    stream->seekg(0, stream->beg);\r\n\r\n    char streamBuffer[2048];\r\n    while (stream->good())\r\n    {\r\n        stream->read(streamBuffer, 2048);\r\n        auto bytesRead = stream->gcount();\r\n\r\n        if (bytesRead > 0)\r\n        {\r\n            crc64 = CRC64::CalcCRC(crc64, streamBuffer, bytesRead);\r\n        }\r\n    }\r\n\r\n    stream->clear();\r\n    stream->seekg(currentPos, stream->beg);\r\n\r\n    return crc64;\r\n}\r\n\r\nvoid TestUtils::LogPrintCallback(LogLevel level, const std::string &stream)\r\n{\r\n    UNUSED_PARAM(level);\r\n    std::cout << stream;\r\n}\r\n\r\nstd::string TestUtils::Base64Decode(std::string const& data)\r\n{\r\n    int in_len = static_cast<int>(data.size());\r\n    int i = 0;\r\n    int in_ = 0;\r\n    unsigned char part4[4];\r\n    std::string ret;\r\n\r\n    while (in_len-- && (data[in_] != '=')) {\r\n        unsigned char ch = data[in_++];\r\n        if ('A' <= ch && ch <= 'Z')  ch = ch - 'A';           // A - Z\r\n        else if ('a' <= ch && ch <= 'z') ch = ch - 'a' + 26;  // a - z\r\n        else if ('0' <= ch && ch <= '9') ch = ch - '0' + 52;  // 0 - 9\r\n        else if ('+' == ch) ch = 62;                          // +\r\n        else if ('/' == ch) ch = 63;                          // /\r\n        else if ('=' == ch) ch = 64;                          // =\r\n        else ch = 0xff;                                       // something wrong\r\n        part4[i++] = ch;\r\n        if (i == 4) {\r\n            ret += (part4[0] << 2) + ((part4[1] & 0x30) >> 4);\r\n            ret += ((part4[1] & 0xf) << 4) + ((part4[2] & 0x3c) >> 2);\r\n            ret += ((part4[2] & 0x3) << 6) + part4[3];\r\n            i = 0;\r\n        }\r\n    }\r\n\r\n    if (i) {\r\n        for (int j = i; j < 4; j++)\r\n            part4[j] = 0xFF;\r\n        ret += (part4[0] << 2) + ((part4[1] & 0x30) >> 4);\r\n        ret += ((part4[1] & 0xf) << 4) + ((part4[2] & 0x3c) >> 2);\r\n        ret += ((part4[2] & 0x3) << 6) + part4[3];\r\n    }\r\n\r\n    return ret;\r\n}\r\n\r\nbool TestUtils::IsByteBufferEQ(const char *src, const char *pat, int len)\r\n{\r\n    for (int i = 0; i < len; i++) {\r\n        if (src[i] != pat[i])\r\n            return false;\r\n    }\r\n    return true;\r\n}\r\n\r\nbool TestUtils::IsByteBufferEQ(const unsigned char *src, const unsigned char *pat, int len)\r\n{\r\n    return TestUtils::IsByteBufferEQ(reinterpret_cast<const char*>(src),\r\n        reinterpret_cast<const char*>(pat), len);\r\n}\r\n\r\nbool TestUtils::IsByteBufferEQ(const ByteBuffer& src, const ByteBuffer& pat)\r\n{\r\n    return (src == pat);\r\n}\r\n\r\nByteBuffer TestUtils::GetRandomByteBuffer(int length)\r\n{\r\n    ByteBuffer buff(length);\r\n    for (int i = 0; i < length; i++) {\r\n        buff[i] = static_cast<char>(rand()%256);\r\n    }\r\n    return buff;\r\n}\r\n"
  },
  {
    "path": "test/src/Utils.h",
    "content": "/*\n * Copyright 2009-2017 Alibaba Cloud All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include <string>\n#include <list>\n#include <alibabacloud/oss/OssClient.h>\n\nnamespace AlibabaCloud {\nnamespace OSS {\nclass TestUtils\n{\npublic:\n    static const std::list<std::string>& InvalidBucketNamesList();\n    static const std::list<std::string>& InvalidObjectKeyNamesList();\n    static const std::list<std::string>& InvalidLoggingPrefixNamesList();\n    static const std::list<std::string>& InvalidPageNamesList();\n\n    static std::string GetBucketName(const std::string& prefix);\n    static std::string GetObjectKey(const std::string& prefix);\n    static std::string GetTargetFileName(const std::string& prefix);\n\n    static std::shared_ptr<OssClient> GetOssClientDefault();\n    static bool BucketExists(const OssClient &client, const std::string &prefix);\n    static void EnsureBucketExist(const OssClient &client, const std::string &bucketName);\n    static bool ObjectExists(const OssClient& client, const std::string& bucketName, const std::string& keyName);\n    static void CleanBucket(const OssClient &client, const std::string &bucketName);\n    static void CleanBucketsByPrefix(const OssClient &client, const std::string &prefix);\n    static void CleanBucketVersioning(const OssClient &client, const std::string &bucketName);\n\n    static PutObjectOutcome UploadObject(const OssClient& client, const std::string &bucketName,\n        const std::string& keyName, const std::string& filename, const ObjectMetaData& metadata);\n    static PutObjectOutcome UploadObject(const OssClient& client, const std::string &bucketName,\n        const std::string& keyName, const std::string& filename);\n    static void DownloadObject(const OssClient& client, const std::string& bucketName, const std::string& keyName, const std::string& targetFile);\n\n    static void WaitForCacheExpire(int sec);\n    static char GetRandomChar();\n    static std::string GetRandomString(int length);\n    static std::shared_ptr<std::iostream> GetRandomStream(int length);\n    static void WriteRandomDatatoFile(const std::string &file, int length);\n\n    static bool IsValidIp(const std::string &host);\n    static std::string GetIpByEndpoint(const std::string &endpoint);\n\n    static std::string GetExecutableDirectory();\n    static std::wstring GetExecutableDirectoryW();\n\n    static std::string GetGMTString(int64_t delayS);\n\n    static std::string GetUTCString(int32_t Days, bool noSec = false);\n\n\n    static std::string GetHTTPSEndpoint(const std::string endpoint);\n\n    static std::string GetFileMd5(const std::string file);\n\n    static std::string GetFileETag(const std::string file);\n\n    static uint64_t GetFileCRC64(const std::string file);\n\n    static void LogPrintCallback(LogLevel level, const std::string &stream);\n\n    static std::string Base64Decode(std::string const& encoded_string);\n\n    static bool IsByteBufferEQ(const char *src, const char *pat, int len);\n    static bool IsByteBufferEQ(const unsigned char *src, const unsigned char *pat, int len);\n    static bool IsByteBufferEQ(const ByteBuffer& src, const ByteBuffer& pat);\n\n    static ByteBuffer GetRandomByteBuffer(int length);\n};\n\n}\n}\n"
  },
  {
    "path": "third_party/include/curl/config-win32.h",
    "content": "#ifndef HEADER_CURL_CONFIG_WIN32_H\n#define HEADER_CURL_CONFIG_WIN32_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* ================================================================ */\n/*               Hand crafted config file for Windows               */\n/* ================================================================ */\n\n/* ---------------------------------------------------------------- */\n/*                          HEADER FILES                            */\n/* ---------------------------------------------------------------- */\n\n/* Define if you have the <arpa/inet.h> header file. */\n/* #define HAVE_ARPA_INET_H 1 */\n\n/* Define if you have the <assert.h> header file. */\n#define HAVE_ASSERT_H 1\n\n/* Define if you have the <crypto.h> header file. */\n/* #define HAVE_CRYPTO_H 1 */\n\n/* Define if you have the <errno.h> header file. */\n#define HAVE_ERRNO_H 1\n\n/* Define if you have the <err.h> header file. */\n/* #define HAVE_ERR_H 1 */\n\n/* Define if you have the <fcntl.h> header file. */\n#define HAVE_FCNTL_H 1\n\n/* Define if you have the <getopt.h> header file. */\n#if defined(__MINGW32__) || defined(__POCC__)\n#define HAVE_GETOPT_H 1\n#endif\n\n/* Define if you have the <io.h> header file. */\n#define HAVE_IO_H 1\n\n/* Define if you have the <limits.h> header file. */\n#define HAVE_LIMITS_H 1\n\n/* Define if you have the <locale.h> header file. */\n#define HAVE_LOCALE_H 1\n\n/* Define if you need <malloc.h> header even with <stdlib.h> header file. */\n#if !defined(__SALFORDC__) && !defined(__POCC__)\n#define NEED_MALLOC_H 1\n#endif\n\n/* Define if you have the <netdb.h> header file. */\n/* #define HAVE_NETDB_H 1 */\n\n/* Define if you have the <netinet/in.h> header file. */\n/* #define HAVE_NETINET_IN_H 1 */\n\n/* Define if you have the <process.h> header file. */\n#ifndef __SALFORDC__\n#define HAVE_PROCESS_H 1\n#endif\n\n/* Define if you have the <signal.h> header file. */\n#define HAVE_SIGNAL_H 1\n\n/* Define if you have the <sgtty.h> header file. */\n/* #define HAVE_SGTTY_H 1 */\n\n/* Define if you have the <ssl.h> header file. */\n/* #define HAVE_SSL_H 1 */\n\n/* Define if you have the <stdlib.h> header file. */\n#define HAVE_STDLIB_H 1\n\n/* Define if you have the <sys/param.h> header file. */\n/* #define HAVE_SYS_PARAM_H 1 */\n\n/* Define if you have the <sys/select.h> header file. */\n/* #define HAVE_SYS_SELECT_H 1 */\n\n/* Define if you have the <sys/socket.h> header file. */\n/* #define HAVE_SYS_SOCKET_H 1 */\n\n/* Define if you have the <sys/sockio.h> header file. */\n/* #define HAVE_SYS_SOCKIO_H 1 */\n\n/* Define if you have the <sys/stat.h> header file. */\n#define HAVE_SYS_STAT_H 1\n\n/* Define if you have the <sys/time.h> header file. */\n/* #define HAVE_SYS_TIME_H 1 */\n\n/* Define if you have the <sys/types.h> header file. */\n#define HAVE_SYS_TYPES_H 1\n\n/* Define if you have the <sys/utime.h> header file. */\n#ifndef __BORLANDC__\n#define HAVE_SYS_UTIME_H 1\n#endif\n\n/* Define if you have the <termio.h> header file. */\n/* #define HAVE_TERMIO_H 1 */\n\n/* Define if you have the <termios.h> header file. */\n/* #define HAVE_TERMIOS_H 1 */\n\n/* Define if you have the <time.h> header file. */\n#define HAVE_TIME_H 1\n\n/* Define if you have the <unistd.h> header file. */\n#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__LCC__) || \\\n    defined(__POCC__)\n#define HAVE_UNISTD_H 1\n#endif\n\n/* Define if you have the <windows.h> header file. */\n#define HAVE_WINDOWS_H 1\n\n/* Define if you have the <winsock.h> header file. */\n#define HAVE_WINSOCK_H 1\n\n/* Define if you have the <winsock2.h> header file. */\n#ifndef __SALFORDC__\n#define HAVE_WINSOCK2_H 1\n#endif\n\n/* Define if you have the <ws2tcpip.h> header file. */\n#ifndef __SALFORDC__\n#define HAVE_WS2TCPIP_H 1\n#endif\n\n/* ---------------------------------------------------------------- */\n/*                        OTHER HEADER INFO                         */\n/* ---------------------------------------------------------------- */\n\n/* Define if sig_atomic_t is an available typedef. */\n#define HAVE_SIG_ATOMIC_T 1\n\n/* Define if you have the ANSI C header files. */\n#define STDC_HEADERS 1\n\n/* Define if you can safely include both <sys/time.h> and <time.h>. */\n/* #define TIME_WITH_SYS_TIME 1 */\n\n/* ---------------------------------------------------------------- */\n/*                             FUNCTIONS                            */\n/* ---------------------------------------------------------------- */\n\n/* Define if you have the closesocket function. */\n#define HAVE_CLOSESOCKET 1\n\n/* Define if you don't have vprintf but do have _doprnt. */\n/* #define HAVE_DOPRNT 1 */\n\n/* Define if you have the ftruncate function. */\n#define HAVE_FTRUNCATE 1\n\n/* Define if you have the gethostbyaddr function. */\n#define HAVE_GETHOSTBYADDR 1\n\n/* Define if you have the gethostname function. */\n#define HAVE_GETHOSTNAME 1\n\n/* Define if you have the getpass function. */\n/* #define HAVE_GETPASS 1 */\n\n/* Define if you have the getservbyname function. */\n#define HAVE_GETSERVBYNAME 1\n\n/* Define if you have the getprotobyname function. */\n#define HAVE_GETPROTOBYNAME\n\n/* Define if you have the gettimeofday function. */\n/* #define HAVE_GETTIMEOFDAY 1 */\n\n/* Define if you have the inet_addr function. */\n#define HAVE_INET_ADDR 1\n\n/* Define if you have the ioctlsocket function. */\n#define HAVE_IOCTLSOCKET 1\n\n/* Define if you have a working ioctlsocket FIONBIO function. */\n#define HAVE_IOCTLSOCKET_FIONBIO 1\n\n/* Define if you have the perror function. */\n#define HAVE_PERROR 1\n\n/* Define if you have the RAND_screen function when using SSL. */\n#define HAVE_RAND_SCREEN 1\n\n/* Define if you have the `RAND_status' function when using SSL. */\n#define HAVE_RAND_STATUS 1\n\n/* Define if you have the `CRYPTO_cleanup_all_ex_data' function.\n   This is present in OpenSSL versions after 0.9.6b */\n#define HAVE_CRYPTO_CLEANUP_ALL_EX_DATA 1\n\n/* Define if you have the select function. */\n#define HAVE_SELECT 1\n\n/* Define if you have the setlocale function. */\n#define HAVE_SETLOCALE 1\n\n/* Define if you have the setmode function. */\n#define HAVE_SETMODE 1\n\n/* Define if you have the setvbuf function. */\n#define HAVE_SETVBUF 1\n\n/* Define if you have the socket function. */\n#define HAVE_SOCKET 1\n\n/* Define if you have the strcasecmp function. */\n/* #define HAVE_STRCASECMP 1 */\n\n/* Define if you have the strdup function. */\n#define HAVE_STRDUP 1\n\n/* Define if you have the strftime function. */\n#define HAVE_STRFTIME 1\n\n/* Define if you have the stricmp function. */\n#define HAVE_STRICMP 1\n\n/* Define if you have the strncasecmp function. */\n/* #define HAVE_STRNCASECMP 1 */\n\n/* Define if you have the strnicmp function. */\n#define HAVE_STRNICMP 1\n\n/* Define if you have the strstr function. */\n#define HAVE_STRSTR 1\n\n/* Define if you have the strtoll function. */\n#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(__POCC__)\n#define HAVE_STRTOLL 1\n#endif\n\n/* Define if you have the tcgetattr function. */\n/* #define HAVE_TCGETATTR 1 */\n\n/* Define if you have the tcsetattr function. */\n/* #define HAVE_TCSETATTR 1 */\n\n/* Define if you have the utime function. */\n#ifndef __BORLANDC__\n#define HAVE_UTIME 1\n#endif\n\n/* Define to the type qualifier of arg 1 for getnameinfo. */\n#define GETNAMEINFO_QUAL_ARG1 const\n\n/* Define to the type of arg 1 for getnameinfo. */\n#define GETNAMEINFO_TYPE_ARG1 struct sockaddr *\n\n/* Define to the type of arg 2 for getnameinfo. */\n#define GETNAMEINFO_TYPE_ARG2 socklen_t\n\n/* Define to the type of args 4 and 6 for getnameinfo. */\n#define GETNAMEINFO_TYPE_ARG46 DWORD\n\n/* Define to the type of arg 7 for getnameinfo. */\n#define GETNAMEINFO_TYPE_ARG7 int\n\n/* Define if you have the recv function. */\n#define HAVE_RECV 1\n\n/* Define to the type of arg 1 for recv. */\n#define RECV_TYPE_ARG1 SOCKET\n\n/* Define to the type of arg 2 for recv. */\n#define RECV_TYPE_ARG2 char *\n\n/* Define to the type of arg 3 for recv. */\n#define RECV_TYPE_ARG3 int\n\n/* Define to the type of arg 4 for recv. */\n#define RECV_TYPE_ARG4 int\n\n/* Define to the function return type for recv. */\n#define RECV_TYPE_RETV int\n\n/* Define if you have the recvfrom function. */\n#define HAVE_RECVFROM 1\n\n/* Define to the type of arg 1 for recvfrom. */\n#define RECVFROM_TYPE_ARG1 SOCKET\n\n/* Define to the type pointed by arg 2 for recvfrom. */\n#define RECVFROM_TYPE_ARG2 char\n\n/* Define to the type of arg 3 for recvfrom. */\n#define RECVFROM_TYPE_ARG3 int\n\n/* Define to the type of arg 4 for recvfrom. */\n#define RECVFROM_TYPE_ARG4 int\n\n/* Define to the type pointed by arg 5 for recvfrom. */\n#define RECVFROM_TYPE_ARG5 struct sockaddr\n\n/* Define to the type pointed by arg 6 for recvfrom. */\n#define RECVFROM_TYPE_ARG6 int\n\n/* Define to the function return type for recvfrom. */\n#define RECVFROM_TYPE_RETV int\n\n/* Define if you have the send function. */\n#define HAVE_SEND 1\n\n/* Define to the type of arg 1 for send. */\n#define SEND_TYPE_ARG1 SOCKET\n\n/* Define to the type qualifier of arg 2 for send. */\n#define SEND_QUAL_ARG2 const\n\n/* Define to the type of arg 2 for send. */\n#define SEND_TYPE_ARG2 char *\n\n/* Define to the type of arg 3 for send. */\n#define SEND_TYPE_ARG3 int\n\n/* Define to the type of arg 4 for send. */\n#define SEND_TYPE_ARG4 int\n\n/* Define to the function return type for send. */\n#define SEND_TYPE_RETV int\n\n/* ---------------------------------------------------------------- */\n/*                       TYPEDEF REPLACEMENTS                       */\n/* ---------------------------------------------------------------- */\n\n/* Define if in_addr_t is not an available 'typedefed' type. */\n#define in_addr_t unsigned long\n\n/* Define to the return type of signal handlers (int or void). */\n#define RETSIGTYPE void\n\n/* Define if ssize_t is not an available 'typedefed' type. */\n#ifndef _SSIZE_T_DEFINED\n#  if (defined(__WATCOMC__) && (__WATCOMC__ >= 1240)) || \\\n      defined(__POCC__) || \\\n      defined(__MINGW32__)\n#  elif defined(_WIN64)\n#    define _SSIZE_T_DEFINED\n#    define ssize_t __int64\n#  else\n#    define _SSIZE_T_DEFINED\n#    define ssize_t int\n#  endif\n#endif\n\n/* ---------------------------------------------------------------- */\n/*                            TYPE SIZES                            */\n/* ---------------------------------------------------------------- */\n\n/* Define to the size of `int', as computed by sizeof. */\n#define SIZEOF_INT 4\n\n/* Define to the size of `long double', as computed by sizeof. */\n#define SIZEOF_LONG_DOUBLE 16\n\n/* Define to the size of `long long', as computed by sizeof. */\n/* #define SIZEOF_LONG_LONG 8 */\n\n/* Define to the size of `short', as computed by sizeof. */\n#define SIZEOF_SHORT 2\n\n/* Define to the size of `size_t', as computed by sizeof. */\n#if defined(_WIN64)\n#  define SIZEOF_SIZE_T 8\n#else\n#  define SIZEOF_SIZE_T 4\n#endif\n\n/* ---------------------------------------------------------------- */\n/*                          STRUCT RELATED                          */\n/* ---------------------------------------------------------------- */\n\n/* Define if you have struct sockaddr_storage. */\n#if !defined(__SALFORDC__) && !defined(__BORLANDC__)\n#define HAVE_STRUCT_SOCKADDR_STORAGE 1\n#endif\n\n/* Define if you have struct timeval. */\n#define HAVE_STRUCT_TIMEVAL 1\n\n/* Define if struct sockaddr_in6 has the sin6_scope_id member. */\n#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1\n\n/* ---------------------------------------------------------------- */\n/*               BSD-style lwIP TCP/IP stack SPECIFIC               */\n/* ---------------------------------------------------------------- */\n\n/* Define to use BSD-style lwIP TCP/IP stack. */\n/* #define USE_LWIPSOCK 1 */\n\n#ifdef USE_LWIPSOCK\n#  undef USE_WINSOCK\n#  undef HAVE_WINSOCK_H\n#  undef HAVE_WINSOCK2_H\n#  undef HAVE_WS2TCPIP_H\n#  undef HAVE_ERRNO_H\n#  undef HAVE_GETHOSTNAME\n#  undef HAVE_GETNAMEINFO\n#  undef LWIP_POSIX_SOCKETS_IO_NAMES\n#  undef RECV_TYPE_ARG1\n#  undef RECV_TYPE_ARG3\n#  undef SEND_TYPE_ARG1\n#  undef SEND_TYPE_ARG3\n#  define HAVE_FREEADDRINFO\n#  define HAVE_GETADDRINFO\n#  define HAVE_GETHOSTBYNAME\n#  define HAVE_GETHOSTBYNAME_R\n#  define HAVE_GETHOSTBYNAME_R_6\n#  define LWIP_POSIX_SOCKETS_IO_NAMES 0\n#  define RECV_TYPE_ARG1 int\n#  define RECV_TYPE_ARG3 size_t\n#  define SEND_TYPE_ARG1 int\n#  define SEND_TYPE_ARG3 size_t\n#endif\n\n/* ---------------------------------------------------------------- */\n/*                        Watt-32 tcp/ip SPECIFIC                   */\n/* ---------------------------------------------------------------- */\n\n#ifdef USE_WATT32\n  #include <tcp.h>\n  #undef byte\n  #undef word\n  #undef USE_WINSOCK\n  #undef HAVE_WINSOCK_H\n  #undef HAVE_WINSOCK2_H\n  #undef HAVE_WS2TCPIP_H\n  #define HAVE_GETADDRINFO\n  #define HAVE_GETNAMEINFO\n  #define HAVE_SYS_IOCTL_H\n  #define HAVE_SYS_SOCKET_H\n  #define HAVE_NETINET_IN_H\n  #define HAVE_NETDB_H\n  #define HAVE_ARPA_INET_H\n  #define HAVE_FREEADDRINFO\n  #define SOCKET int\n#endif\n\n\n/* ---------------------------------------------------------------- */\n/*                        COMPILER SPECIFIC                         */\n/* ---------------------------------------------------------------- */\n\n/* Define to nothing if compiler does not support 'const' qualifier. */\n/* #define const */\n\n/* Define to nothing if compiler does not support 'volatile' qualifier. */\n/* #define volatile */\n\n/* Windows should not have HAVE_GMTIME_R defined */\n/* #undef HAVE_GMTIME_R */\n\n/* Define if the compiler supports C99 variadic macro style. */\n#if defined(_MSC_VER) && (_MSC_VER >= 1400)\n#define HAVE_VARIADIC_MACROS_C99 1\n#endif\n\n/* Define if the compiler supports the 'long long' data type. */\n#if defined(__MINGW32__) || defined(__WATCOMC__)\n#define HAVE_LONGLONG 1\n#endif\n\n/* Define to avoid VS2005 complaining about portable C functions. */\n#if defined(_MSC_VER) && (_MSC_VER >= 1400)\n#define _CRT_SECURE_NO_DEPRECATE 1\n#define _CRT_NONSTDC_NO_DEPRECATE 1\n#endif\n\n/* VS2005 and later dafault size for time_t is 64-bit, unless\n   _USE_32BIT_TIME_T has been defined to get a 32-bit time_t. */\n#if defined(_MSC_VER) && (_MSC_VER >= 1400)\n#  ifndef _USE_32BIT_TIME_T\n#    define SIZEOF_TIME_T 8\n#  else\n#    define SIZEOF_TIME_T 4\n#  endif\n#endif\n\n/* Officially, Microsoft's Windows SDK versions 6.X do not support Windows\n   2000 as a supported build target. VS2008 default installations provide\n   an embedded Windows SDK v6.0A along with the claim that Windows 2000 is\n   a valid build target for VS2008. Popular belief is that binaries built\n   with VS2008 using Windows SDK versions 6.X and Windows 2000 as a build\n   target are functional. */\n#if defined(_MSC_VER) && (_MSC_VER >= 1500)\n#  define VS2008_MIN_TARGET 0x0500\n#endif\n\n/* When no build target is specified VS2008 default build target is Windows\n   Vista, which leaves out even Winsows XP. If no build target has been given\n   for VS2008 we will target the minimum Officially supported build target,\n   which happens to be Windows XP. */\n#if defined(_MSC_VER) && (_MSC_VER >= 1500)\n#  define VS2008_DEF_TARGET  0x0501\n#endif\n\n/* VS2008 default target settings and minimum build target check. */\n#if defined(_MSC_VER) && (_MSC_VER >= 1500)\n#  ifndef _WIN32_WINNT\n#    define _WIN32_WINNT VS2008_DEF_TARGET\n#  endif\n#  ifndef WINVER\n#    define WINVER VS2008_DEF_TARGET\n#  endif\n#  if (_WIN32_WINNT < VS2008_MIN_TARGET) || (WINVER < VS2008_MIN_TARGET)\n#    error VS2008 does not support Windows build targets prior to Windows 2000\n#  endif\n#endif\n\n/* When no build target is specified Pelles C 5.00 and later default build\n   target is Windows Vista. We override default target to be Windows 2000. */\n#if defined(__POCC__) && (__POCC__ >= 500)\n#  ifndef _WIN32_WINNT\n#    define _WIN32_WINNT 0x0500\n#  endif\n#  ifndef WINVER\n#    define WINVER 0x0500\n#  endif\n#endif\n\n/* Availability of freeaddrinfo, getaddrinfo and getnameinfo functions is\n   quite convoluted, compiler dependent and even build target dependent. */\n#if defined(HAVE_WS2TCPIP_H)\n#  if defined(__POCC__)\n#    define HAVE_FREEADDRINFO           1\n#    define HAVE_GETADDRINFO            1\n#    define HAVE_GETADDRINFO_THREADSAFE 1\n#    define HAVE_GETNAMEINFO            1\n#  elif defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501)\n#    define HAVE_FREEADDRINFO           1\n#    define HAVE_GETADDRINFO            1\n#    define HAVE_GETADDRINFO_THREADSAFE 1\n#    define HAVE_GETNAMEINFO            1\n#  elif defined(_MSC_VER) && (_MSC_VER >= 1200)\n#    define HAVE_FREEADDRINFO           1\n#    define HAVE_GETADDRINFO            1\n#    define HAVE_GETADDRINFO_THREADSAFE 1\n#    define HAVE_GETNAMEINFO            1\n#  endif\n#endif\n\n#if defined(__POCC__)\n#  ifndef _MSC_VER\n#    error Microsoft extensions /Ze compiler option is required\n#  endif\n#  ifndef __POCC__OLDNAMES\n#    error Compatibility names /Go compiler option is required\n#  endif\n#endif\n\n/* ---------------------------------------------------------------- */\n/*                        LARGE FILE SUPPORT                        */\n/* ---------------------------------------------------------------- */\n\n#if defined(_MSC_VER) && !defined(_WIN32_WCE)\n#  if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)\n#    define USE_WIN32_LARGE_FILES\n#  else\n#    define USE_WIN32_SMALL_FILES\n#  endif\n#endif\n\n#if defined(__MINGW32__) && !defined(USE_WIN32_LARGE_FILES)\n#  define USE_WIN32_LARGE_FILES\n#endif\n\n#if defined(__WATCOMC__) && !defined(USE_WIN32_LARGE_FILES)\n#  define USE_WIN32_LARGE_FILES\n#endif\n\n#if defined(__POCC__)\n#  undef USE_WIN32_LARGE_FILES\n#endif\n\n#if !defined(USE_WIN32_LARGE_FILES) && !defined(USE_WIN32_SMALL_FILES)\n#  define USE_WIN32_SMALL_FILES\n#endif\n\n/* ---------------------------------------------------------------- */\n/*                       DNS RESOLVER SPECIALTY                     */\n/* ---------------------------------------------------------------- */\n\n/*\n * Undefine both USE_ARES and USE_THREADS_WIN32 for synchronous DNS.\n */\n\n/* Define to enable c-ares asynchronous DNS lookups. */\n/* #define USE_ARES 1 */\n\n/* Default define to enable threaded asynchronous DNS lookups. */\n#if !defined(USE_SYNC_DNS) && !defined(USE_ARES) && \\\n    !defined(USE_THREADS_WIN32)\n#  define USE_THREADS_WIN32 1\n#endif\n\n#if defined(USE_ARES) && defined(USE_THREADS_WIN32)\n#  error \"Only one DNS lookup specialty may be defined at most\"\n#endif\n\n/* ---------------------------------------------------------------- */\n/*                           LDAP SUPPORT                           */\n/* ---------------------------------------------------------------- */\n\n#if defined(CURL_HAS_NOVELL_LDAPSDK) || defined(CURL_HAS_MOZILLA_LDAPSDK)\n#undef CURL_LDAP_WIN\n#define HAVE_LDAP_SSL_H 1\n#define HAVE_LDAP_URL_PARSE 1\n#elif defined(CURL_HAS_OPENLDAP_LDAPSDK)\n#undef CURL_LDAP_WIN\n#define HAVE_LDAP_URL_PARSE 1\n#else\n#undef HAVE_LDAP_URL_PARSE\n#define CURL_LDAP_WIN 1\n#endif\n\n#if defined(__WATCOMC__) && defined(CURL_LDAP_WIN)\n#if __WATCOMC__ < 1280\n#define WINBERAPI  __declspec(cdecl)\n#define WINLDAPAPI __declspec(cdecl)\n#endif\n#endif\n\n#if defined(__POCC__) && defined(CURL_LDAP_WIN)\n#  define CURL_DISABLE_LDAP 1\n#endif\n\n/* ---------------------------------------------------------------- */\n/*                       ADDITIONAL DEFINITIONS                     */\n/* ---------------------------------------------------------------- */\n\n/* Define cpu-machine-OS */\n#undef OS\n#if defined(_M_IX86) || defined(__i386__) /* x86 (MSVC or gcc) */\n#define OS \"i386-pc-win32\"\n#elif defined(_M_X64) || defined(__x86_64__) /* x86_64 (MSVC >=2005 or gcc) */\n#define OS \"x86_64-pc-win32\"\n#elif defined(_M_IA64) /* Itanium */\n#define OS \"ia64-pc-win32\"\n#else\n#define OS \"unknown-pc-win32\"\n#endif\n\n/* Name of package */\n#define PACKAGE \"curl\"\n\n/* If you want to build curl with the built-in manual */\n#define USE_MANUAL 1\n\n#if defined(__POCC__) || (USE_IPV6)\n#  define ENABLE_IPV6 1\n#endif\n\n#endif /* HEADER_CURL_CONFIG_WIN32_H */\n"
  },
  {
    "path": "third_party/include/curl/curl.h",
    "content": "#ifndef __CURL_CURL_H\n#define __CURL_CURL_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/*\n * If you have libcurl problems, all docs and details are found here:\n *   http://curl.haxx.se/libcurl/\n *\n * curl-library mailing list subscription and unsubscription web interface:\n *   http://cool.haxx.se/mailman/listinfo/curl-library/\n */\n\n#include \"curlver.h\"         /* libcurl version defines   */\n#include \"curlbuild.h\"       /* libcurl build definitions */\n#include \"curlrules.h\"       /* libcurl rules enforcement */\n\n/*\n * Define WIN32 when build target is Win32 API\n */\n\n#if (defined(_WIN32) || defined(__WIN32__)) && \\\n     !defined(WIN32) && !defined(__SYMBIAN32__)\n#define WIN32\n#endif\n\n#include <stdio.h>\n#include <limits.h>\n\n#if defined(__FreeBSD__) && (__FreeBSD__ >= 2)\n/* Needed for __FreeBSD_version symbol definition */\n#include <osreldate.h>\n#endif\n\n/* The include stuff here below is mainly for time_t! */\n#include <sys/types.h>\n#include <time.h>\n\n#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)\n#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__))\n/* The check above prevents the winsock2 inclusion if winsock.h already was\n   included, since they can't co-exist without problems */\n#include <winsock2.h>\n#include <ws2tcpip.h>\n#endif\n#endif\n\n/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish\n   libc5-based Linux systems. Only include it on systems that are known to\n   require it! */\n#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \\\n    defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \\\n    defined(ANDROID) || defined(__ANDROID__) || \\\n   (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))\n#include <sys/select.h>\n#endif\n\n#if !defined(WIN32) && !defined(_WIN32_WCE)\n#include <sys/socket.h>\n#endif\n\n#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)\n#include <sys/time.h>\n#endif\n\n#ifdef __BEOS__\n#include <support/SupportDefs.h>\n#endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef void CURL;\n\n/*\n * libcurl external API function linkage decorations.\n */\n\n#ifdef CURL_STATICLIB\n#  define CURL_EXTERN\n#elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)\n#  if defined(BUILDING_LIBCURL)\n#    define CURL_EXTERN  __declspec(dllexport)\n#  else\n#    define CURL_EXTERN  __declspec(dllimport)\n#  endif\n#elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS)\n#  define CURL_EXTERN CURL_EXTERN_SYMBOL\n#else\n#  define CURL_EXTERN\n#endif\n\n#ifndef curl_socket_typedef\n/* socket typedef */\n#if defined(WIN32) && !defined(__LWIP_OPT_H__)\ntypedef SOCKET curl_socket_t;\n#define CURL_SOCKET_BAD INVALID_SOCKET\n#else\ntypedef int curl_socket_t;\n#define CURL_SOCKET_BAD -1\n#endif\n#define curl_socket_typedef\n#endif /* curl_socket_typedef */\n\nstruct curl_httppost {\n  struct curl_httppost *next;       /* next entry in the list */\n  char *name;                       /* pointer to allocated name */\n  long namelength;                  /* length of name length */\n  char *contents;                   /* pointer to allocated data contents */\n  long contentslength;              /* length of contents field */\n  char *buffer;                     /* pointer to allocated buffer contents */\n  long bufferlength;                /* length of buffer field */\n  char *contenttype;                /* Content-Type */\n  struct curl_slist* contentheader; /* list of extra headers for this form */\n  struct curl_httppost *more;       /* if one field name has more than one\n                                       file, this link should link to following\n                                       files */\n  long flags;                       /* as defined below */\n#define HTTPPOST_FILENAME (1<<0)    /* specified content is a file name */\n#define HTTPPOST_READFILE (1<<1)    /* specified content is a file name */\n#define HTTPPOST_PTRNAME (1<<2)     /* name is only stored pointer\n                                       do not free in formfree */\n#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer\n                                       do not free in formfree */\n#define HTTPPOST_BUFFER (1<<4)      /* upload file from buffer */\n#define HTTPPOST_PTRBUFFER (1<<5)   /* upload file from pointer contents */\n#define HTTPPOST_CALLBACK (1<<6)    /* upload file contents by using the\n                                       regular read callback to get the data\n                                       and pass the given pointer as custom\n                                       pointer */\n\n  char *showfilename;               /* The file name to show. If not set, the\n                                       actual file name will be used (if this\n                                       is a file part) */\n  void *userp;                      /* custom pointer used for\n                                       HTTPPOST_CALLBACK posts */\n};\n\ntypedef int (*curl_progress_callback)(void *clientp,\n                                      double dltotal,\n                                      double dlnow,\n                                      double ultotal,\n                                      double ulnow);\n\n#ifndef CURL_MAX_WRITE_SIZE\n  /* Tests have proven that 20K is a very bad buffer size for uploads on\n     Windows, while 16K for some odd reason performed a lot better.\n     We do the ifndef check to allow this value to easier be changed at build\n     time for those who feel adventurous. The practical minimum is about\n     400 bytes since libcurl uses a buffer of this size as a scratch area\n     (unrelated to network send operations). */\n#define CURL_MAX_WRITE_SIZE 16384\n#endif\n\n#ifndef CURL_MAX_HTTP_HEADER\n/* The only reason to have a max limit for this is to avoid the risk of a bad\n   server feeding libcurl with a never-ending header that will cause reallocs\n   infinitely */\n#define CURL_MAX_HTTP_HEADER (100*1024)\n#endif\n\n/* This is a magic return code for the write callback that, when returned,\n   will signal libcurl to pause receiving on the current transfer. */\n#define CURL_WRITEFUNC_PAUSE 0x10000001\n\ntypedef size_t (*curl_write_callback)(char *buffer,\n                                      size_t size,\n                                      size_t nitems,\n                                      void *outstream);\n\n\n\n/* enumeration of file types */\ntypedef enum {\n  CURLFILETYPE_FILE = 0,\n  CURLFILETYPE_DIRECTORY,\n  CURLFILETYPE_SYMLINK,\n  CURLFILETYPE_DEVICE_BLOCK,\n  CURLFILETYPE_DEVICE_CHAR,\n  CURLFILETYPE_NAMEDPIPE,\n  CURLFILETYPE_SOCKET,\n  CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */\n\n  CURLFILETYPE_UNKNOWN /* should never occur */\n} curlfiletype;\n\n#define CURLFINFOFLAG_KNOWN_FILENAME    (1<<0)\n#define CURLFINFOFLAG_KNOWN_FILETYPE    (1<<1)\n#define CURLFINFOFLAG_KNOWN_TIME        (1<<2)\n#define CURLFINFOFLAG_KNOWN_PERM        (1<<3)\n#define CURLFINFOFLAG_KNOWN_UID         (1<<4)\n#define CURLFINFOFLAG_KNOWN_GID         (1<<5)\n#define CURLFINFOFLAG_KNOWN_SIZE        (1<<6)\n#define CURLFINFOFLAG_KNOWN_HLINKCOUNT  (1<<7)\n\n/* Content of this structure depends on information which is known and is\n   achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man\n   page for callbacks returning this structure -- some fields are mandatory,\n   some others are optional. The FLAG field has special meaning. */\nstruct curl_fileinfo {\n  char *filename;\n  curlfiletype filetype;\n  time_t time;\n  unsigned int perm;\n  int uid;\n  int gid;\n  curl_off_t size;\n  long int hardlinks;\n\n  struct {\n    /* If some of these fields is not NULL, it is a pointer to b_data. */\n    char *time;\n    char *perm;\n    char *user;\n    char *group;\n    char *target; /* pointer to the target filename of a symlink */\n  } strings;\n\n  unsigned int flags;\n\n  /* used internally */\n  char * b_data;\n  size_t b_size;\n  size_t b_used;\n};\n\n/* return codes for CURLOPT_CHUNK_BGN_FUNCTION */\n#define CURL_CHUNK_BGN_FUNC_OK      0\n#define CURL_CHUNK_BGN_FUNC_FAIL    1 /* tell the lib to end the task */\n#define CURL_CHUNK_BGN_FUNC_SKIP    2 /* skip this chunk over */\n\n/* if splitting of data transfer is enabled, this callback is called before\n   download of an individual chunk started. Note that parameter \"remains\" works\n   only for FTP wildcard downloading (for now), otherwise is not used */\ntypedef long (*curl_chunk_bgn_callback)(const void *transfer_info,\n                                        void *ptr,\n                                        int remains);\n\n/* return codes for CURLOPT_CHUNK_END_FUNCTION */\n#define CURL_CHUNK_END_FUNC_OK      0\n#define CURL_CHUNK_END_FUNC_FAIL    1 /* tell the lib to end the task */\n\n/* If splitting of data transfer is enabled this callback is called after\n   download of an individual chunk finished.\n   Note! After this callback was set then it have to be called FOR ALL chunks.\n   Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC.\n   This is the reason why we don't need \"transfer_info\" parameter in this\n   callback and we are not interested in \"remains\" parameter too. */\ntypedef long (*curl_chunk_end_callback)(void *ptr);\n\n/* return codes for FNMATCHFUNCTION */\n#define CURL_FNMATCHFUNC_MATCH    0 /* string corresponds to the pattern */\n#define CURL_FNMATCHFUNC_NOMATCH  1 /* pattern doesn't match the string */\n#define CURL_FNMATCHFUNC_FAIL     2 /* an error occurred */\n\n/* callback type for wildcard downloading pattern matching. If the\n   string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */\ntypedef int (*curl_fnmatch_callback)(void *ptr,\n                                     const char *pattern,\n                                     const char *string);\n\n/* These are the return codes for the seek callbacks */\n#define CURL_SEEKFUNC_OK       0\n#define CURL_SEEKFUNC_FAIL     1 /* fail the entire transfer */\n#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so\n                                    libcurl might try other means instead */\ntypedef int (*curl_seek_callback)(void *instream,\n                                  curl_off_t offset,\n                                  int origin); /* 'whence' */\n\n/* This is a return code for the read callback that, when returned, will\n   signal libcurl to immediately abort the current transfer. */\n#define CURL_READFUNC_ABORT 0x10000000\n/* This is a return code for the read callback that, when returned, will\n   signal libcurl to pause sending data on the current transfer. */\n#define CURL_READFUNC_PAUSE 0x10000001\n\ntypedef size_t (*curl_read_callback)(char *buffer,\n                                      size_t size,\n                                      size_t nitems,\n                                      void *instream);\n\ntypedef enum  {\n  CURLSOCKTYPE_IPCXN,  /* socket created for a specific IP connection */\n  CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */\n  CURLSOCKTYPE_LAST    /* never use */\n} curlsocktype;\n\n/* The return code from the sockopt_callback can signal information back\n   to libcurl: */\n#define CURL_SOCKOPT_OK 0\n#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return\n                                CURLE_ABORTED_BY_CALLBACK */\n#define CURL_SOCKOPT_ALREADY_CONNECTED 2\n\ntypedef int (*curl_sockopt_callback)(void *clientp,\n                                     curl_socket_t curlfd,\n                                     curlsocktype purpose);\n\nstruct curl_sockaddr {\n  int family;\n  int socktype;\n  int protocol;\n  unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it\n                           turned really ugly and painful on the systems that\n                           lack this type */\n  struct sockaddr addr;\n};\n\ntypedef curl_socket_t\n(*curl_opensocket_callback)(void *clientp,\n                            curlsocktype purpose,\n                            struct curl_sockaddr *address);\n\ntypedef int\n(*curl_closesocket_callback)(void *clientp, curl_socket_t item);\n\ntypedef enum {\n  CURLIOE_OK,            /* I/O operation successful */\n  CURLIOE_UNKNOWNCMD,    /* command was unknown to callback */\n  CURLIOE_FAILRESTART,   /* failed to restart the read */\n  CURLIOE_LAST           /* never use */\n} curlioerr;\n\ntypedef enum  {\n  CURLIOCMD_NOP,         /* no operation */\n  CURLIOCMD_RESTARTREAD, /* restart the read stream from start */\n  CURLIOCMD_LAST         /* never use */\n} curliocmd;\n\ntypedef curlioerr (*curl_ioctl_callback)(CURL *handle,\n                                         int cmd,\n                                         void *clientp);\n\n/*\n * The following typedef's are signatures of malloc, free, realloc, strdup and\n * calloc respectively.  Function pointers of these types can be passed to the\n * curl_global_init_mem() function to set user defined memory management\n * callback routines.\n */\ntypedef void *(*curl_malloc_callback)(size_t size);\ntypedef void (*curl_free_callback)(void *ptr);\ntypedef void *(*curl_realloc_callback)(void *ptr, size_t size);\ntypedef char *(*curl_strdup_callback)(const char *str);\ntypedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);\n\n/* the kind of data that is passed to information_callback*/\ntypedef enum {\n  CURLINFO_TEXT = 0,\n  CURLINFO_HEADER_IN,    /* 1 */\n  CURLINFO_HEADER_OUT,   /* 2 */\n  CURLINFO_DATA_IN,      /* 3 */\n  CURLINFO_DATA_OUT,     /* 4 */\n  CURLINFO_SSL_DATA_IN,  /* 5 */\n  CURLINFO_SSL_DATA_OUT, /* 6 */\n  CURLINFO_END\n} curl_infotype;\n\ntypedef int (*curl_debug_callback)\n       (CURL *handle,      /* the handle/transfer this concerns */\n        curl_infotype type, /* what kind of data */\n        char *data,        /* points to the data */\n        size_t size,       /* size of the data pointed to */\n        void *userptr);    /* whatever the user please */\n\n/* All possible error codes from all sorts of curl functions. Future versions\n   may return other values, stay prepared.\n\n   Always add new return codes last. Never *EVER* remove any. The return\n   codes must remain the same!\n */\n\ntypedef enum {\n  CURLE_OK = 0,\n  CURLE_UNSUPPORTED_PROTOCOL,    /* 1 */\n  CURLE_FAILED_INIT,             /* 2 */\n  CURLE_URL_MALFORMAT,           /* 3 */\n  CURLE_NOT_BUILT_IN,            /* 4 - [was obsoleted in August 2007 for\n                                    7.17.0, reused in April 2011 for 7.21.5] */\n  CURLE_COULDNT_RESOLVE_PROXY,   /* 5 */\n  CURLE_COULDNT_RESOLVE_HOST,    /* 6 */\n  CURLE_COULDNT_CONNECT,         /* 7 */\n  CURLE_FTP_WEIRD_SERVER_REPLY,  /* 8 */\n  CURLE_REMOTE_ACCESS_DENIED,    /* 9 a service was denied by the server\n                                    due to lack of access - when login fails\n                                    this is not returned. */\n  CURLE_FTP_ACCEPT_FAILED,       /* 10 - [was obsoleted in April 2006 for\n                                    7.15.4, reused in Dec 2011 for 7.24.0]*/\n  CURLE_FTP_WEIRD_PASS_REPLY,    /* 11 */\n  CURLE_FTP_ACCEPT_TIMEOUT,      /* 12 - timeout occurred accepting server\n                                    [was obsoleted in August 2007 for 7.17.0,\n                                    reused in Dec 2011 for 7.24.0]*/\n  CURLE_FTP_WEIRD_PASV_REPLY,    /* 13 */\n  CURLE_FTP_WEIRD_227_FORMAT,    /* 14 */\n  CURLE_FTP_CANT_GET_HOST,       /* 15 */\n  CURLE_OBSOLETE16,              /* 16 - NOT USED */\n  CURLE_FTP_COULDNT_SET_TYPE,    /* 17 */\n  CURLE_PARTIAL_FILE,            /* 18 */\n  CURLE_FTP_COULDNT_RETR_FILE,   /* 19 */\n  CURLE_OBSOLETE20,              /* 20 - NOT USED */\n  CURLE_QUOTE_ERROR,             /* 21 - quote command failure */\n  CURLE_HTTP_RETURNED_ERROR,     /* 22 */\n  CURLE_WRITE_ERROR,             /* 23 */\n  CURLE_OBSOLETE24,              /* 24 - NOT USED */\n  CURLE_UPLOAD_FAILED,           /* 25 - failed upload \"command\" */\n  CURLE_READ_ERROR,              /* 26 - couldn't open/read from file */\n  CURLE_OUT_OF_MEMORY,           /* 27 */\n  /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error\n           instead of a memory allocation error if CURL_DOES_CONVERSIONS\n           is defined\n  */\n  CURLE_OPERATION_TIMEDOUT,      /* 28 - the timeout time was reached */\n  CURLE_OBSOLETE29,              /* 29 - NOT USED */\n  CURLE_FTP_PORT_FAILED,         /* 30 - FTP PORT operation failed */\n  CURLE_FTP_COULDNT_USE_REST,    /* 31 - the REST command failed */\n  CURLE_OBSOLETE32,              /* 32 - NOT USED */\n  CURLE_RANGE_ERROR,             /* 33 - RANGE \"command\" didn't work */\n  CURLE_HTTP_POST_ERROR,         /* 34 */\n  CURLE_SSL_CONNECT_ERROR,       /* 35 - wrong when connecting with SSL */\n  CURLE_BAD_DOWNLOAD_RESUME,     /* 36 - couldn't resume download */\n  CURLE_FILE_COULDNT_READ_FILE,  /* 37 */\n  CURLE_LDAP_CANNOT_BIND,        /* 38 */\n  CURLE_LDAP_SEARCH_FAILED,      /* 39 */\n  CURLE_OBSOLETE40,              /* 40 - NOT USED */\n  CURLE_FUNCTION_NOT_FOUND,      /* 41 */\n  CURLE_ABORTED_BY_CALLBACK,     /* 42 */\n  CURLE_BAD_FUNCTION_ARGUMENT,   /* 43 */\n  CURLE_OBSOLETE44,              /* 44 - NOT USED */\n  CURLE_INTERFACE_FAILED,        /* 45 - CURLOPT_INTERFACE failed */\n  CURLE_OBSOLETE46,              /* 46 - NOT USED */\n  CURLE_TOO_MANY_REDIRECTS ,     /* 47 - catch endless re-direct loops */\n  CURLE_UNKNOWN_OPTION,          /* 48 - User specified an unknown option */\n  CURLE_TELNET_OPTION_SYNTAX ,   /* 49 - Malformed telnet option */\n  CURLE_OBSOLETE50,              /* 50 - NOT USED */\n  CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint\n                                     wasn't verified fine */\n  CURLE_GOT_NOTHING,             /* 52 - when this is a specific error */\n  CURLE_SSL_ENGINE_NOTFOUND,     /* 53 - SSL crypto engine not found */\n  CURLE_SSL_ENGINE_SETFAILED,    /* 54 - can not set SSL crypto engine as\n                                    default */\n  CURLE_SEND_ERROR,              /* 55 - failed sending network data */\n  CURLE_RECV_ERROR,              /* 56 - failure in receiving network data */\n  CURLE_OBSOLETE57,              /* 57 - NOT IN USE */\n  CURLE_SSL_CERTPROBLEM,         /* 58 - problem with the local certificate */\n  CURLE_SSL_CIPHER,              /* 59 - couldn't use specified cipher */\n  CURLE_SSL_CACERT,              /* 60 - problem with the CA cert (path?) */\n  CURLE_BAD_CONTENT_ENCODING,    /* 61 - Unrecognized/bad encoding */\n  CURLE_LDAP_INVALID_URL,        /* 62 - Invalid LDAP URL */\n  CURLE_FILESIZE_EXCEEDED,       /* 63 - Maximum file size exceeded */\n  CURLE_USE_SSL_FAILED,          /* 64 - Requested FTP SSL level failed */\n  CURLE_SEND_FAIL_REWIND,        /* 65 - Sending the data requires a rewind\n                                    that failed */\n  CURLE_SSL_ENGINE_INITFAILED,   /* 66 - failed to initialise ENGINE */\n  CURLE_LOGIN_DENIED,            /* 67 - user, password or similar was not\n                                    accepted and we failed to login */\n  CURLE_TFTP_NOTFOUND,           /* 68 - file not found on server */\n  CURLE_TFTP_PERM,               /* 69 - permission problem on server */\n  CURLE_REMOTE_DISK_FULL,        /* 70 - out of disk space on server */\n  CURLE_TFTP_ILLEGAL,            /* 71 - Illegal TFTP operation */\n  CURLE_TFTP_UNKNOWNID,          /* 72 - Unknown transfer ID */\n  CURLE_REMOTE_FILE_EXISTS,      /* 73 - File already exists */\n  CURLE_TFTP_NOSUCHUSER,         /* 74 - No such user */\n  CURLE_CONV_FAILED,             /* 75 - conversion failed */\n  CURLE_CONV_REQD,               /* 76 - caller must register conversion\n                                    callbacks using curl_easy_setopt options\n                                    CURLOPT_CONV_FROM_NETWORK_FUNCTION,\n                                    CURLOPT_CONV_TO_NETWORK_FUNCTION, and\n                                    CURLOPT_CONV_FROM_UTF8_FUNCTION */\n  CURLE_SSL_CACERT_BADFILE,      /* 77 - could not load CACERT file, missing\n                                    or wrong format */\n  CURLE_REMOTE_FILE_NOT_FOUND,   /* 78 - remote file not found */\n  CURLE_SSH,                     /* 79 - error from the SSH layer, somewhat\n                                    generic so the error message will be of\n                                    interest when this has happened */\n\n  CURLE_SSL_SHUTDOWN_FAILED,     /* 80 - Failed to shut down the SSL\n                                    connection */\n  CURLE_AGAIN,                   /* 81 - socket is not ready for send/recv,\n                                    wait till it's ready and try again (Added\n                                    in 7.18.2) */\n  CURLE_SSL_CRL_BADFILE,         /* 82 - could not load CRL file, missing or\n                                    wrong format (Added in 7.19.0) */\n  CURLE_SSL_ISSUER_ERROR,        /* 83 - Issuer check failed.  (Added in\n                                    7.19.0) */\n  CURLE_FTP_PRET_FAILED,         /* 84 - a PRET command failed */\n  CURLE_RTSP_CSEQ_ERROR,         /* 85 - mismatch of RTSP CSeq numbers */\n  CURLE_RTSP_SESSION_ERROR,      /* 86 - mismatch of RTSP Session Ids */\n  CURLE_FTP_BAD_FILE_LIST,       /* 87 - unable to parse FTP file list */\n  CURLE_CHUNK_FAILED,            /* 88 - chunk callback reported error */\n  CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the\n                                    session will be queued */\n  CURL_LAST /* never use! */\n} CURLcode;\n\n#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all\n                          the obsolete stuff removed! */\n\n/* Previously obsoletes error codes re-used in 7.24.0 */\n#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED\n#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT\n\n/*  compatibility with older names */\n#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING\n\n/* The following were added in 7.21.5, April 2011 */\n#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION\n\n/* The following were added in 7.17.1 */\n/* These are scheduled to disappear by 2009 */\n#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION\n\n/* The following were added in 7.17.0 */\n/* These are scheduled to disappear by 2009 */\n#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */\n#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46\n#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44\n#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10\n#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16\n#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32\n#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29\n#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12\n#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20\n#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40\n#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24\n#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57\n#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN\n\n#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED\n#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE\n#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR\n#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL\n#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS\n#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR\n#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED\n\n/* The following were added earlier */\n\n#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT\n\n#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR\n#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED\n#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED\n\n#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE\n#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME\n\n/* This was the error code 50 in 7.7.3 and a few earlier versions, this\n   is no longer used by libcurl but is instead #defined here only to not\n   make programs break */\n#define CURLE_ALREADY_COMPLETE 99999\n\n#endif /*!CURL_NO_OLDIES*/\n\n/* This prototype applies to all conversion callbacks */\ntypedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);\n\ntypedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl,    /* easy handle */\n                                          void *ssl_ctx, /* actually an\n                                                            OpenSSL SSL_CTX */\n                                          void *userptr);\n\ntypedef enum {\n  CURLPROXY_HTTP = 0,   /* added in 7.10, new in 7.19.4 default is to use\n                           CONNECT HTTP/1.1 */\n  CURLPROXY_HTTP_1_0 = 1,   /* added in 7.19.4, force to use CONNECT\n                               HTTP/1.0  */\n  CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already\n                           in 7.10 */\n  CURLPROXY_SOCKS5 = 5, /* added in 7.10 */\n  CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */\n  CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the\n                                   host name rather than the IP address. added\n                                   in 7.18.0 */\n} curl_proxytype;  /* this enum was added in 7.10 */\n\n/*\n * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:\n *\n * CURLAUTH_NONE         - No HTTP authentication\n * CURLAUTH_BASIC        - HTTP Basic authentication (default)\n * CURLAUTH_DIGEST       - HTTP Digest authentication\n * CURLAUTH_GSSNEGOTIATE - HTTP GSS-Negotiate authentication\n * CURLAUTH_NTLM         - HTTP NTLM authentication\n * CURLAUTH_DIGEST_IE    - HTTP Digest authentication with IE flavour\n * CURLAUTH_NTLM_WB      - HTTP NTLM authentication delegated to winbind helper\n * CURLAUTH_ONLY         - Use together with a single other type to force no\n *                         authentication or just that single type\n * CURLAUTH_ANY          - All fine types set\n * CURLAUTH_ANYSAFE      - All fine types except Basic\n */\n\n#define CURLAUTH_NONE         ((unsigned long)0)\n#define CURLAUTH_BASIC        (((unsigned long)1)<<0)\n#define CURLAUTH_DIGEST       (((unsigned long)1)<<1)\n#define CURLAUTH_GSSNEGOTIATE (((unsigned long)1)<<2)\n#define CURLAUTH_NTLM         (((unsigned long)1)<<3)\n#define CURLAUTH_DIGEST_IE    (((unsigned long)1)<<4)\n#define CURLAUTH_NTLM_WB      (((unsigned long)1)<<5)\n#define CURLAUTH_ONLY         (((unsigned long)1)<<31)\n#define CURLAUTH_ANY          (~CURLAUTH_DIGEST_IE)\n#define CURLAUTH_ANYSAFE      (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))\n\n#define CURLSSH_AUTH_ANY       ~0     /* all types supported by the server */\n#define CURLSSH_AUTH_NONE      0      /* none allowed, silly but complete */\n#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */\n#define CURLSSH_AUTH_PASSWORD  (1<<1) /* password */\n#define CURLSSH_AUTH_HOST      (1<<2) /* host key files */\n#define CURLSSH_AUTH_KEYBOARD  (1<<3) /* keyboard interactive */\n#define CURLSSH_AUTH_AGENT     (1<<4) /* agent (ssh-agent, pageant...) */\n#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY\n\n#define CURLGSSAPI_DELEGATION_NONE        0      /* no delegation (default) */\n#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */\n#define CURLGSSAPI_DELEGATION_FLAG        (1<<1) /* delegate always */\n\n#define CURL_ERROR_SIZE 256\n\nstruct curl_khkey {\n  const char *key; /* points to a zero-terminated string encoded with base64\n                      if len is zero, otherwise to the \"raw\" data */\n  size_t len;\n  enum type {\n    CURLKHTYPE_UNKNOWN,\n    CURLKHTYPE_RSA1,\n    CURLKHTYPE_RSA,\n    CURLKHTYPE_DSS\n  } keytype;\n};\n\n/* this is the set of return values expected from the curl_sshkeycallback\n   callback */\nenum curl_khstat {\n  CURLKHSTAT_FINE_ADD_TO_FILE,\n  CURLKHSTAT_FINE,\n  CURLKHSTAT_REJECT, /* reject the connection, return an error */\n  CURLKHSTAT_DEFER,  /* do not accept it, but we can't answer right now so\n                        this causes a CURLE_DEFER error but otherwise the\n                        connection will be left intact etc */\n  CURLKHSTAT_LAST    /* not for use, only a marker for last-in-list */\n};\n\n/* this is the set of status codes pass in to the callback */\nenum curl_khmatch {\n  CURLKHMATCH_OK,       /* match */\n  CURLKHMATCH_MISMATCH, /* host found, key mismatch! */\n  CURLKHMATCH_MISSING,  /* no matching host/key found */\n  CURLKHMATCH_LAST      /* not for use, only a marker for last-in-list */\n};\n\ntypedef int\n  (*curl_sshkeycallback) (CURL *easy,     /* easy handle */\n                          const struct curl_khkey *knownkey, /* known */\n                          const struct curl_khkey *foundkey, /* found */\n                          enum curl_khmatch, /* libcurl's view on the keys */\n                          void *clientp); /* custom pointer passed from app */\n\n/* parameter for the CURLOPT_USE_SSL option */\ntypedef enum {\n  CURLUSESSL_NONE,    /* do not attempt to use SSL */\n  CURLUSESSL_TRY,     /* try using SSL, proceed anyway otherwise */\n  CURLUSESSL_CONTROL, /* SSL for the control connection or fail */\n  CURLUSESSL_ALL,     /* SSL for all communication or fail */\n  CURLUSESSL_LAST     /* not an option, never use */\n} curl_usessl;\n\n/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */\n\n/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the\n   name of improving interoperability with older servers. Some SSL libraries\n   have introduced work-arounds for this flaw but those work-arounds sometimes\n   make the SSL communication fail. To regain functionality with those broken\n   servers, a user can this way allow the vulnerability back. */\n#define CURLSSLOPT_ALLOW_BEAST (1<<0)\n\n#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all\n                          the obsolete stuff removed! */\n\n/* Backwards compatibility with older names */\n/* These are scheduled to disappear by 2009 */\n\n#define CURLFTPSSL_NONE CURLUSESSL_NONE\n#define CURLFTPSSL_TRY CURLUSESSL_TRY\n#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL\n#define CURLFTPSSL_ALL CURLUSESSL_ALL\n#define CURLFTPSSL_LAST CURLUSESSL_LAST\n#define curl_ftpssl curl_usessl\n#endif /*!CURL_NO_OLDIES*/\n\n/* parameter for the CURLOPT_FTP_SSL_CCC option */\ntypedef enum {\n  CURLFTPSSL_CCC_NONE,    /* do not send CCC */\n  CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */\n  CURLFTPSSL_CCC_ACTIVE,  /* Initiate the shutdown */\n  CURLFTPSSL_CCC_LAST     /* not an option, never use */\n} curl_ftpccc;\n\n/* parameter for the CURLOPT_FTPSSLAUTH option */\ntypedef enum {\n  CURLFTPAUTH_DEFAULT, /* let libcurl decide */\n  CURLFTPAUTH_SSL,     /* use \"AUTH SSL\" */\n  CURLFTPAUTH_TLS,     /* use \"AUTH TLS\" */\n  CURLFTPAUTH_LAST /* not an option, never use */\n} curl_ftpauth;\n\n/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */\ntypedef enum {\n  CURLFTP_CREATE_DIR_NONE,  /* do NOT create missing dirs! */\n  CURLFTP_CREATE_DIR,       /* (FTP/SFTP) if CWD fails, try MKD and then CWD\n                               again if MKD succeeded, for SFTP this does\n                               similar magic */\n  CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD\n                               again even if MKD failed! */\n  CURLFTP_CREATE_DIR_LAST   /* not an option, never use */\n} curl_ftpcreatedir;\n\n/* parameter for the CURLOPT_FTP_FILEMETHOD option */\ntypedef enum {\n  CURLFTPMETHOD_DEFAULT,   /* let libcurl pick */\n  CURLFTPMETHOD_MULTICWD,  /* single CWD operation for each path part */\n  CURLFTPMETHOD_NOCWD,     /* no CWD at all */\n  CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */\n  CURLFTPMETHOD_LAST       /* not an option, never use */\n} curl_ftpmethod;\n\n/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */\n#define CURLPROTO_HTTP   (1<<0)\n#define CURLPROTO_HTTPS  (1<<1)\n#define CURLPROTO_FTP    (1<<2)\n#define CURLPROTO_FTPS   (1<<3)\n#define CURLPROTO_SCP    (1<<4)\n#define CURLPROTO_SFTP   (1<<5)\n#define CURLPROTO_TELNET (1<<6)\n#define CURLPROTO_LDAP   (1<<7)\n#define CURLPROTO_LDAPS  (1<<8)\n#define CURLPROTO_DICT   (1<<9)\n#define CURLPROTO_FILE   (1<<10)\n#define CURLPROTO_TFTP   (1<<11)\n#define CURLPROTO_IMAP   (1<<12)\n#define CURLPROTO_IMAPS  (1<<13)\n#define CURLPROTO_POP3   (1<<14)\n#define CURLPROTO_POP3S  (1<<15)\n#define CURLPROTO_SMTP   (1<<16)\n#define CURLPROTO_SMTPS  (1<<17)\n#define CURLPROTO_RTSP   (1<<18)\n#define CURLPROTO_RTMP   (1<<19)\n#define CURLPROTO_RTMPT  (1<<20)\n#define CURLPROTO_RTMPE  (1<<21)\n#define CURLPROTO_RTMPTE (1<<22)\n#define CURLPROTO_RTMPS  (1<<23)\n#define CURLPROTO_RTMPTS (1<<24)\n#define CURLPROTO_GOPHER (1<<25)\n#define CURLPROTO_ALL    (~0) /* enable everything */\n\n/* long may be 32 or 64 bits, but we should never depend on anything else\n   but 32 */\n#define CURLOPTTYPE_LONG          0\n#define CURLOPTTYPE_OBJECTPOINT   10000\n#define CURLOPTTYPE_FUNCTIONPOINT 20000\n#define CURLOPTTYPE_OFF_T         30000\n\n/* name is uppercase CURLOPT_<name>,\n   type is one of the defined CURLOPTTYPE_<type>\n   number is unique identifier */\n#ifdef CINIT\n#undef CINIT\n#endif\n\n#ifdef CURL_ISOCPP\n#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu\n#else\n/* The macro \"##\" is ISO C, we assume pre-ISO C doesn't support it. */\n#define LONG          CURLOPTTYPE_LONG\n#define OBJECTPOINT   CURLOPTTYPE_OBJECTPOINT\n#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT\n#define OFF_T         CURLOPTTYPE_OFF_T\n#define CINIT(name,type,number) CURLOPT_/**/name = type + number\n#endif\n\n/*\n * This macro-mania below setups the CURLOPT_[what] enum, to be used with\n * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]\n * word.\n */\n\ntypedef enum {\n  /* This is the FILE * or void * the regular output should be written to. */\n  CINIT(FILE, OBJECTPOINT, 1),\n\n  /* The full URL to get/put */\n  CINIT(URL,  OBJECTPOINT, 2),\n\n  /* Port number to connect to, if other than default. */\n  CINIT(PORT, LONG, 3),\n\n  /* Name of proxy to use. */\n  CINIT(PROXY, OBJECTPOINT, 4),\n\n  /* \"name:password\" to use when fetching. */\n  CINIT(USERPWD, OBJECTPOINT, 5),\n\n  /* \"name:password\" to use with proxy. */\n  CINIT(PROXYUSERPWD, OBJECTPOINT, 6),\n\n  /* Range to get, specified as an ASCII string. */\n  CINIT(RANGE, OBJECTPOINT, 7),\n\n  /* not used */\n\n  /* Specified file stream to upload from (use as input): */\n  CINIT(INFILE, OBJECTPOINT, 9),\n\n  /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE\n   * bytes big. If this is not used, error messages go to stderr instead: */\n  CINIT(ERRORBUFFER, OBJECTPOINT, 10),\n\n  /* Function that will be called to store the output (instead of fwrite). The\n   * parameters will use fwrite() syntax, make sure to follow them. */\n  CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),\n\n  /* Function that will be called to read the input (instead of fread). The\n   * parameters will use fread() syntax, make sure to follow them. */\n  CINIT(READFUNCTION, FUNCTIONPOINT, 12),\n\n  /* Time-out the read operation after this amount of seconds */\n  CINIT(TIMEOUT, LONG, 13),\n\n  /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about\n   * how large the file being sent really is. That allows better error\n   * checking and better verifies that the upload was successful. -1 means\n   * unknown size.\n   *\n   * For large file support, there is also a _LARGE version of the key\n   * which takes an off_t type, allowing platforms with larger off_t\n   * sizes to handle larger files.  See below for INFILESIZE_LARGE.\n   */\n  CINIT(INFILESIZE, LONG, 14),\n\n  /* POST static input fields. */\n  CINIT(POSTFIELDS, OBJECTPOINT, 15),\n\n  /* Set the referrer page (needed by some CGIs) */\n  CINIT(REFERER, OBJECTPOINT, 16),\n\n  /* Set the FTP PORT string (interface name, named or numerical IP address)\n     Use i.e '-' to use default address. */\n  CINIT(FTPPORT, OBJECTPOINT, 17),\n\n  /* Set the User-Agent string (examined by some CGIs) */\n  CINIT(USERAGENT, OBJECTPOINT, 18),\n\n  /* If the download receives less than \"low speed limit\" bytes/second\n   * during \"low speed time\" seconds, the operations is aborted.\n   * You could i.e if you have a pretty high speed connection, abort if\n   * it is less than 2000 bytes/sec during 20 seconds.\n   */\n\n  /* Set the \"low speed limit\" */\n  CINIT(LOW_SPEED_LIMIT, LONG, 19),\n\n  /* Set the \"low speed time\" */\n  CINIT(LOW_SPEED_TIME, LONG, 20),\n\n  /* Set the continuation offset.\n   *\n   * Note there is also a _LARGE version of this key which uses\n   * off_t types, allowing for large file offsets on platforms which\n   * use larger-than-32-bit off_t's.  Look below for RESUME_FROM_LARGE.\n   */\n  CINIT(RESUME_FROM, LONG, 21),\n\n  /* Set cookie in request: */\n  CINIT(COOKIE, OBJECTPOINT, 22),\n\n  /* This points to a linked list of headers, struct curl_slist kind */\n  CINIT(HTTPHEADER, OBJECTPOINT, 23),\n\n  /* This points to a linked list of post entries, struct curl_httppost */\n  CINIT(HTTPPOST, OBJECTPOINT, 24),\n\n  /* name of the file keeping your private SSL-certificate */\n  CINIT(SSLCERT, OBJECTPOINT, 25),\n\n  /* password for the SSL or SSH private key */\n  CINIT(KEYPASSWD, OBJECTPOINT, 26),\n\n  /* send TYPE parameter? */\n  CINIT(CRLF, LONG, 27),\n\n  /* send linked-list of QUOTE commands */\n  CINIT(QUOTE, OBJECTPOINT, 28),\n\n  /* send FILE * or void * to store headers to, if you use a callback it\n     is simply passed to the callback unmodified */\n  CINIT(WRITEHEADER, OBJECTPOINT, 29),\n\n  /* point to a file to read the initial cookies from, also enables\n     \"cookie awareness\" */\n  CINIT(COOKIEFILE, OBJECTPOINT, 31),\n\n  /* What version to specifically try to use.\n     See CURL_SSLVERSION defines below. */\n  CINIT(SSLVERSION, LONG, 32),\n\n  /* What kind of HTTP time condition to use, see defines */\n  CINIT(TIMECONDITION, LONG, 33),\n\n  /* Time to use with the above condition. Specified in number of seconds\n     since 1 Jan 1970 */\n  CINIT(TIMEVALUE, LONG, 34),\n\n  /* 35 = OBSOLETE */\n\n  /* Custom request, for customizing the get command like\n     HTTP: DELETE, TRACE and others\n     FTP: to use a different list command\n     */\n  CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),\n\n  /* HTTP request, for odd commands like DELETE, TRACE and others */\n  CINIT(STDERR, OBJECTPOINT, 37),\n\n  /* 38 is not used */\n\n  /* send linked-list of post-transfer QUOTE commands */\n  CINIT(POSTQUOTE, OBJECTPOINT, 39),\n\n  CINIT(WRITEINFO, OBJECTPOINT, 40), /* DEPRECATED, do not use! */\n\n  CINIT(VERBOSE, LONG, 41),      /* talk a lot */\n  CINIT(HEADER, LONG, 42),       /* throw the header out too */\n  CINIT(NOPROGRESS, LONG, 43),   /* shut off the progress meter */\n  CINIT(NOBODY, LONG, 44),       /* use HEAD to get http document */\n  CINIT(FAILONERROR, LONG, 45),  /* no output on http error codes >= 300 */\n  CINIT(UPLOAD, LONG, 46),       /* this is an upload */\n  CINIT(POST, LONG, 47),         /* HTTP POST method */\n  CINIT(DIRLISTONLY, LONG, 48),  /* bare names when listing directories */\n\n  CINIT(APPEND, LONG, 50),       /* Append instead of overwrite on upload! */\n\n  /* Specify whether to read the user+password from the .netrc or the URL.\n   * This must be one of the CURL_NETRC_* enums below. */\n  CINIT(NETRC, LONG, 51),\n\n  CINIT(FOLLOWLOCATION, LONG, 52),  /* use Location: Luke! */\n\n  CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */\n  CINIT(PUT, LONG, 54),          /* HTTP PUT */\n\n  /* 55 = OBSOLETE */\n\n  /* Function that will be called instead of the internal progress display\n   * function. This function should be defined as the curl_progress_callback\n   * prototype defines. */\n  CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),\n\n  /* Data passed to the progress callback */\n  CINIT(PROGRESSDATA, OBJECTPOINT, 57),\n\n  /* We want the referrer field set automatically when following locations */\n  CINIT(AUTOREFERER, LONG, 58),\n\n  /* Port of the proxy, can be set in the proxy string as well with:\n     \"[host]:[port]\" */\n  CINIT(PROXYPORT, LONG, 59),\n\n  /* size of the POST input data, if strlen() is not good to use */\n  CINIT(POSTFIELDSIZE, LONG, 60),\n\n  /* tunnel non-http operations through a HTTP proxy */\n  CINIT(HTTPPROXYTUNNEL, LONG, 61),\n\n  /* Set the interface string to use as outgoing network interface */\n  CINIT(INTERFACE, OBJECTPOINT, 62),\n\n  /* Set the krb4/5 security level, this also enables krb4/5 awareness.  This\n   * is a string, 'clear', 'safe', 'confidential' or 'private'.  If the string\n   * is set but doesn't match one of these, 'private' will be used.  */\n  CINIT(KRBLEVEL, OBJECTPOINT, 63),\n\n  /* Set if we should verify the peer in ssl handshake, set 1 to verify. */\n  CINIT(SSL_VERIFYPEER, LONG, 64),\n\n  /* The CApath or CAfile used to validate the peer certificate\n     this option is used only if SSL_VERIFYPEER is true */\n  CINIT(CAINFO, OBJECTPOINT, 65),\n\n  /* 66 = OBSOLETE */\n  /* 67 = OBSOLETE */\n\n  /* Maximum number of http redirects to follow */\n  CINIT(MAXREDIRS, LONG, 68),\n\n  /* Pass a long set to 1 to get the date of the requested document (if\n     possible)! Pass a zero to shut it off. */\n  CINIT(FILETIME, LONG, 69),\n\n  /* This points to a linked list of telnet options */\n  CINIT(TELNETOPTIONS, OBJECTPOINT, 70),\n\n  /* Max amount of cached alive connections */\n  CINIT(MAXCONNECTS, LONG, 71),\n\n  CINIT(CLOSEPOLICY, LONG, 72), /* DEPRECATED, do not use! */\n\n  /* 73 = OBSOLETE */\n\n  /* Set to explicitly use a new connection for the upcoming transfer.\n     Do not use this unless you're absolutely sure of this, as it makes the\n     operation slower and is less friendly for the network. */\n  CINIT(FRESH_CONNECT, LONG, 74),\n\n  /* Set to explicitly forbid the upcoming transfer's connection to be re-used\n     when done. Do not use this unless you're absolutely sure of this, as it\n     makes the operation slower and is less friendly for the network. */\n  CINIT(FORBID_REUSE, LONG, 75),\n\n  /* Set to a file name that contains random data for libcurl to use to\n     seed the random engine when doing SSL connects. */\n  CINIT(RANDOM_FILE, OBJECTPOINT, 76),\n\n  /* Set to the Entropy Gathering Daemon socket pathname */\n  CINIT(EGDSOCKET, OBJECTPOINT, 77),\n\n  /* Time-out connect operations after this amount of seconds, if connects are\n     OK within this time, then fine... This only aborts the connect phase. */\n  CINIT(CONNECTTIMEOUT, LONG, 78),\n\n  /* Function that will be called to store headers (instead of fwrite). The\n   * parameters will use fwrite() syntax, make sure to follow them. */\n  CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),\n\n  /* Set this to force the HTTP request to get back to GET. Only really usable\n     if POST, PUT or a custom request have been used first.\n   */\n  CINIT(HTTPGET, LONG, 80),\n\n  /* Set if we should verify the Common name from the peer certificate in ssl\n   * handshake, set 1 to check existence, 2 to ensure that it matches the\n   * provided hostname. */\n  CINIT(SSL_VERIFYHOST, LONG, 81),\n\n  /* Specify which file name to write all known cookies in after completed\n     operation. Set file name to \"-\" (dash) to make it go to stdout. */\n  CINIT(COOKIEJAR, OBJECTPOINT, 82),\n\n  /* Specify which SSL ciphers to use */\n  CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),\n\n  /* Specify which HTTP version to use! This must be set to one of the\n     CURL_HTTP_VERSION* enums set below. */\n  CINIT(HTTP_VERSION, LONG, 84),\n\n  /* Specifically switch on or off the FTP engine's use of the EPSV command. By\n     default, that one will always be attempted before the more traditional\n     PASV command. */\n  CINIT(FTP_USE_EPSV, LONG, 85),\n\n  /* type of the file keeping your SSL-certificate (\"DER\", \"PEM\", \"ENG\") */\n  CINIT(SSLCERTTYPE, OBJECTPOINT, 86),\n\n  /* name of the file keeping your private SSL-key */\n  CINIT(SSLKEY, OBJECTPOINT, 87),\n\n  /* type of the file keeping your private SSL-key (\"DER\", \"PEM\", \"ENG\") */\n  CINIT(SSLKEYTYPE, OBJECTPOINT, 88),\n\n  /* crypto engine for the SSL-sub system */\n  CINIT(SSLENGINE, OBJECTPOINT, 89),\n\n  /* set the crypto engine for the SSL-sub system as default\n     the param has no meaning...\n   */\n  CINIT(SSLENGINE_DEFAULT, LONG, 90),\n\n  /* Non-zero value means to use the global dns cache */\n  CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */\n\n  /* DNS cache timeout */\n  CINIT(DNS_CACHE_TIMEOUT, LONG, 92),\n\n  /* send linked-list of pre-transfer QUOTE commands */\n  CINIT(PREQUOTE, OBJECTPOINT, 93),\n\n  /* set the debug function */\n  CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),\n\n  /* set the data for the debug function */\n  CINIT(DEBUGDATA, OBJECTPOINT, 95),\n\n  /* mark this as start of a cookie session */\n  CINIT(COOKIESESSION, LONG, 96),\n\n  /* The CApath directory used to validate the peer certificate\n     this option is used only if SSL_VERIFYPEER is true */\n  CINIT(CAPATH, OBJECTPOINT, 97),\n\n  /* Instruct libcurl to use a smaller receive buffer */\n  CINIT(BUFFERSIZE, LONG, 98),\n\n  /* Instruct libcurl to not use any signal/alarm handlers, even when using\n     timeouts. This option is useful for multi-threaded applications.\n     See libcurl-the-guide for more background information. */\n  CINIT(NOSIGNAL, LONG, 99),\n\n  /* Provide a CURLShare for mutexing non-ts data */\n  CINIT(SHARE, OBJECTPOINT, 100),\n\n  /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),\n     CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */\n  CINIT(PROXYTYPE, LONG, 101),\n\n  /* Set the Accept-Encoding string. Use this to tell a server you would like\n     the response to be compressed. Before 7.21.6, this was known as\n     CURLOPT_ENCODING */\n  CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102),\n\n  /* Set pointer to private data */\n  CINIT(PRIVATE, OBJECTPOINT, 103),\n\n  /* Set aliases for HTTP 200 in the HTTP Response header */\n  CINIT(HTTP200ALIASES, OBJECTPOINT, 104),\n\n  /* Continue to send authentication (user+password) when following locations,\n     even when hostname changed. This can potentially send off the name\n     and password to whatever host the server decides. */\n  CINIT(UNRESTRICTED_AUTH, LONG, 105),\n\n  /* Specifically switch on or off the FTP engine's use of the EPRT command (\n     it also disables the LPRT attempt). By default, those ones will always be\n     attempted before the good old traditional PORT command. */\n  CINIT(FTP_USE_EPRT, LONG, 106),\n\n  /* Set this to a bitmask value to enable the particular authentications\n     methods you like. Use this in combination with CURLOPT_USERPWD.\n     Note that setting multiple bits may cause extra network round-trips. */\n  CINIT(HTTPAUTH, LONG, 107),\n\n  /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx\n     in second argument. The function must be matching the\n     curl_ssl_ctx_callback proto. */\n  CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),\n\n  /* Set the userdata for the ssl context callback function's third\n     argument */\n  CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),\n\n  /* FTP Option that causes missing dirs to be created on the remote server.\n     In 7.19.4 we introduced the convenience enums for this option using the\n     CURLFTP_CREATE_DIR prefix.\n  */\n  CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),\n\n  /* Set this to a bitmask value to enable the particular authentications\n     methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.\n     Note that setting multiple bits may cause extra network round-trips. */\n  CINIT(PROXYAUTH, LONG, 111),\n\n  /* FTP option that changes the timeout, in seconds, associated with\n     getting a response.  This is different from transfer timeout time and\n     essentially places a demand on the FTP server to acknowledge commands\n     in a timely manner. */\n  CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),\n#define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT\n\n  /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to\n     tell libcurl to resolve names to those IP versions only. This only has\n     affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */\n  CINIT(IPRESOLVE, LONG, 113),\n\n  /* Set this option to limit the size of a file that will be downloaded from\n     an HTTP or FTP server.\n\n     Note there is also _LARGE version which adds large file support for\n     platforms which have larger off_t sizes.  See MAXFILESIZE_LARGE below. */\n  CINIT(MAXFILESIZE, LONG, 114),\n\n  /* See the comment for INFILESIZE above, but in short, specifies\n   * the size of the file being uploaded.  -1 means unknown.\n   */\n  CINIT(INFILESIZE_LARGE, OFF_T, 115),\n\n  /* Sets the continuation offset.  There is also a LONG version of this;\n   * look above for RESUME_FROM.\n   */\n  CINIT(RESUME_FROM_LARGE, OFF_T, 116),\n\n  /* Sets the maximum size of data that will be downloaded from\n   * an HTTP or FTP server.  See MAXFILESIZE above for the LONG version.\n   */\n  CINIT(MAXFILESIZE_LARGE, OFF_T, 117),\n\n  /* Set this option to the file name of your .netrc file you want libcurl\n     to parse (using the CURLOPT_NETRC option). If not set, libcurl will do\n     a poor attempt to find the user's home directory and check for a .netrc\n     file in there. */\n  CINIT(NETRC_FILE, OBJECTPOINT, 118),\n\n  /* Enable SSL/TLS for FTP, pick one of:\n     CURLUSESSL_TRY     - try using SSL, proceed anyway otherwise\n     CURLUSESSL_CONTROL - SSL for the control connection or fail\n     CURLUSESSL_ALL     - SSL for all communication or fail\n  */\n  CINIT(USE_SSL, LONG, 119),\n\n  /* The _LARGE version of the standard POSTFIELDSIZE option */\n  CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),\n\n  /* Enable/disable the TCP Nagle algorithm */\n  CINIT(TCP_NODELAY, LONG, 121),\n\n  /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 123 OBSOLETE. Gone in 7.16.0 */\n  /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */\n  /* 127 OBSOLETE. Gone in 7.16.0 */\n  /* 128 OBSOLETE. Gone in 7.16.0 */\n\n  /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option\n     can be used to change libcurl's default action which is to first try\n     \"AUTH SSL\" and then \"AUTH TLS\" in this order, and proceed when a OK\n     response has been received.\n\n     Available parameters are:\n     CURLFTPAUTH_DEFAULT - let libcurl decide\n     CURLFTPAUTH_SSL     - try \"AUTH SSL\" first, then TLS\n     CURLFTPAUTH_TLS     - try \"AUTH TLS\" first, then SSL\n  */\n  CINIT(FTPSSLAUTH, LONG, 129),\n\n  CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),\n  CINIT(IOCTLDATA, OBJECTPOINT, 131),\n\n  /* 132 OBSOLETE. Gone in 7.16.0 */\n  /* 133 OBSOLETE. Gone in 7.16.0 */\n\n  /* zero terminated string for pass on to the FTP server when asked for\n     \"account\" info */\n  CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),\n\n  /* feed cookies into cookie engine */\n  CINIT(COOKIELIST, OBJECTPOINT, 135),\n\n  /* ignore Content-Length */\n  CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),\n\n  /* Set to non-zero to skip the IP address received in a 227 PASV FTP server\n     response. Typically used for FTP-SSL purposes but is not restricted to\n     that. libcurl will then instead use the same IP address it used for the\n     control connection. */\n  CINIT(FTP_SKIP_PASV_IP, LONG, 137),\n\n  /* Select \"file method\" to use when doing FTP, see the curl_ftpmethod\n     above. */\n  CINIT(FTP_FILEMETHOD, LONG, 138),\n\n  /* Local port number to bind the socket to */\n  CINIT(LOCALPORT, LONG, 139),\n\n  /* Number of ports to try, including the first one set with LOCALPORT.\n     Thus, setting it to 1 will make no additional attempts but the first.\n  */\n  CINIT(LOCALPORTRANGE, LONG, 140),\n\n  /* no transfer, set up connection and let application use the socket by\n     extracting it with CURLINFO_LASTSOCKET */\n  CINIT(CONNECT_ONLY, LONG, 141),\n\n  /* Function that will be called to convert from the\n     network encoding (instead of using the iconv calls in libcurl) */\n  CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),\n\n  /* Function that will be called to convert to the\n     network encoding (instead of using the iconv calls in libcurl) */\n  CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),\n\n  /* Function that will be called to convert from UTF8\n     (instead of using the iconv calls in libcurl)\n     Note that this is used only for SSL certificate processing */\n  CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),\n\n  /* if the connection proceeds too quickly then need to slow it down */\n  /* limit-rate: maximum number of bytes per second to send or receive */\n  CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),\n  CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),\n\n  /* Pointer to command string to send if USER/PASS fails. */\n  CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),\n\n  /* callback function for setting socket options */\n  CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),\n  CINIT(SOCKOPTDATA, OBJECTPOINT, 149),\n\n  /* set to 0 to disable session ID re-use for this transfer, default is\n     enabled (== 1) */\n  CINIT(SSL_SESSIONID_CACHE, LONG, 150),\n\n  /* allowed SSH authentication methods */\n  CINIT(SSH_AUTH_TYPES, LONG, 151),\n\n  /* Used by scp/sftp to do public/private key authentication */\n  CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),\n  CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),\n\n  /* Send CCC (Clear Command Channel) after authentication */\n  CINIT(FTP_SSL_CCC, LONG, 154),\n\n  /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */\n  CINIT(TIMEOUT_MS, LONG, 155),\n  CINIT(CONNECTTIMEOUT_MS, LONG, 156),\n\n  /* set to zero to disable the libcurl's decoding and thus pass the raw body\n     data to the application even when it is encoded/compressed */\n  CINIT(HTTP_TRANSFER_DECODING, LONG, 157),\n  CINIT(HTTP_CONTENT_DECODING, LONG, 158),\n\n  /* Permission used when creating new files and directories on the remote\n     server for protocols that support it, SFTP/SCP/FILE */\n  CINIT(NEW_FILE_PERMS, LONG, 159),\n  CINIT(NEW_DIRECTORY_PERMS, LONG, 160),\n\n  /* Set the behaviour of POST when redirecting. Values must be set to one\n     of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */\n  CINIT(POSTREDIR, LONG, 161),\n\n  /* used by scp/sftp to verify the host's public key */\n  CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),\n\n  /* Callback function for opening socket (instead of socket(2)). Optionally,\n     callback is able change the address or refuse to connect returning\n     CURL_SOCKET_BAD.  The callback should have type\n     curl_opensocket_callback */\n  CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),\n  CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),\n\n  /* POST volatile input fields. */\n  CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),\n\n  /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */\n  CINIT(PROXY_TRANSFER_MODE, LONG, 166),\n\n  /* Callback function for seeking in the input stream */\n  CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),\n  CINIT(SEEKDATA, OBJECTPOINT, 168),\n\n  /* CRL file */\n  CINIT(CRLFILE, OBJECTPOINT, 169),\n\n  /* Issuer certificate */\n  CINIT(ISSUERCERT, OBJECTPOINT, 170),\n\n  /* (IPv6) Address scope */\n  CINIT(ADDRESS_SCOPE, LONG, 171),\n\n  /* Collect certificate chain info and allow it to get retrievable with\n     CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only\n     working with OpenSSL-powered builds. */\n  CINIT(CERTINFO, LONG, 172),\n\n  /* \"name\" and \"pwd\" to use when fetching. */\n  CINIT(USERNAME, OBJECTPOINT, 173),\n  CINIT(PASSWORD, OBJECTPOINT, 174),\n\n    /* \"name\" and \"pwd\" to use with Proxy when fetching. */\n  CINIT(PROXYUSERNAME, OBJECTPOINT, 175),\n  CINIT(PROXYPASSWORD, OBJECTPOINT, 176),\n\n  /* Comma separated list of hostnames defining no-proxy zones. These should\n     match both hostnames directly, and hostnames within a domain. For\n     example, local.com will match local.com and www.local.com, but NOT\n     notlocal.com or www.notlocal.com. For compatibility with other\n     implementations of this, .local.com will be considered to be the same as\n     local.com. A single * is the only valid wildcard, and effectively\n     disables the use of proxy. */\n  CINIT(NOPROXY, OBJECTPOINT, 177),\n\n  /* block size for TFTP transfers */\n  CINIT(TFTP_BLKSIZE, LONG, 178),\n\n  /* Socks Service */\n  CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),\n\n  /* Socks Service */\n  CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),\n\n  /* set the bitmask for the protocols that are allowed to be used for the\n     transfer, which thus helps the app which takes URLs from users or other\n     external inputs and want to restrict what protocol(s) to deal\n     with. Defaults to CURLPROTO_ALL. */\n  CINIT(PROTOCOLS, LONG, 181),\n\n  /* set the bitmask for the protocols that libcurl is allowed to follow to,\n     as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs\n     to be set in both bitmasks to be allowed to get redirected to. Defaults\n     to all protocols except FILE and SCP. */\n  CINIT(REDIR_PROTOCOLS, LONG, 182),\n\n  /* set the SSH knownhost file name to use */\n  CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),\n\n  /* set the SSH host key callback, must point to a curl_sshkeycallback\n     function */\n  CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),\n\n  /* set the SSH host key callback custom pointer */\n  CINIT(SSH_KEYDATA, OBJECTPOINT, 185),\n\n  /* set the SMTP mail originator */\n  CINIT(MAIL_FROM, OBJECTPOINT, 186),\n\n  /* set the SMTP mail receiver(s) */\n  CINIT(MAIL_RCPT, OBJECTPOINT, 187),\n\n  /* FTP: send PRET before PASV */\n  CINIT(FTP_USE_PRET, LONG, 188),\n\n  /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */\n  CINIT(RTSP_REQUEST, LONG, 189),\n\n  /* The RTSP session identifier */\n  CINIT(RTSP_SESSION_ID, OBJECTPOINT, 190),\n\n  /* The RTSP stream URI */\n  CINIT(RTSP_STREAM_URI, OBJECTPOINT, 191),\n\n  /* The Transport: header to use in RTSP requests */\n  CINIT(RTSP_TRANSPORT, OBJECTPOINT, 192),\n\n  /* Manually initialize the client RTSP CSeq for this handle */\n  CINIT(RTSP_CLIENT_CSEQ, LONG, 193),\n\n  /* Manually initialize the server RTSP CSeq for this handle */\n  CINIT(RTSP_SERVER_CSEQ, LONG, 194),\n\n  /* The stream to pass to INTERLEAVEFUNCTION. */\n  CINIT(INTERLEAVEDATA, OBJECTPOINT, 195),\n\n  /* Let the application define a custom write method for RTP data */\n  CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196),\n\n  /* Turn on wildcard matching */\n  CINIT(WILDCARDMATCH, LONG, 197),\n\n  /* Directory matching callback called before downloading of an\n     individual file (chunk) started */\n  CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198),\n\n  /* Directory matching callback called after the file (chunk)\n     was downloaded, or skipped */\n  CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199),\n\n  /* Change match (fnmatch-like) callback for wildcard matching */\n  CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200),\n\n  /* Let the application define custom chunk data pointer */\n  CINIT(CHUNK_DATA, OBJECTPOINT, 201),\n\n  /* FNMATCH_FUNCTION user pointer */\n  CINIT(FNMATCH_DATA, OBJECTPOINT, 202),\n\n  /* send linked-list of name:port:address sets */\n  CINIT(RESOLVE, OBJECTPOINT, 203),\n\n  /* Set a username for authenticated TLS */\n  CINIT(TLSAUTH_USERNAME, OBJECTPOINT, 204),\n\n  /* Set a password for authenticated TLS */\n  CINIT(TLSAUTH_PASSWORD, OBJECTPOINT, 205),\n\n  /* Set authentication type for authenticated TLS */\n  CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206),\n\n  /* Set to 1 to enable the \"TE:\" header in HTTP requests to ask for\n     compressed transfer-encoded responses. Set to 0 to disable the use of TE:\n     in outgoing requests. The current default is 0, but it might change in a\n     future libcurl release.\n\n     libcurl will ask for the compressed methods it knows of, and if that\n     isn't any, it will not ask for transfer-encoding at all even if this\n     option is set to 1.\n\n  */\n  CINIT(TRANSFER_ENCODING, LONG, 207),\n\n  /* Callback function for closing socket (instead of close(2)). The callback\n     should have type curl_closesocket_callback */\n  CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208),\n  CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209),\n\n  /* allow GSSAPI credential delegation */\n  CINIT(GSSAPI_DELEGATION, LONG, 210),\n\n  /* Set the name servers to use for DNS resolution */\n  CINIT(DNS_SERVERS, OBJECTPOINT, 211),\n\n  /* Time-out accept operations (currently for FTP only) after this amount\n     of miliseconds. */\n  CINIT(ACCEPTTIMEOUT_MS, LONG, 212),\n\n  /* Set TCP keepalive */\n  CINIT(TCP_KEEPALIVE, LONG, 213),\n\n  /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */\n  CINIT(TCP_KEEPIDLE, LONG, 214),\n  CINIT(TCP_KEEPINTVL, LONG, 215),\n\n  /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */\n  CINIT(SSL_OPTIONS, LONG, 216),\n\n  /* set the SMTP auth originator */\n  CINIT(MAIL_AUTH, OBJECTPOINT, 217),\n\n  CURLOPT_LASTENTRY /* the last unused */\n} CURLoption;\n\n#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all\n                          the obsolete stuff removed! */\n\n/* Backwards compatibility with older names */\n/* These are scheduled to disappear by 2011 */\n\n/* This was added in version 7.19.1 */\n#define CURLOPT_POST301 CURLOPT_POSTREDIR\n\n/* These are scheduled to disappear by 2009 */\n\n/* The following were added in 7.17.0 */\n#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD\n#define CURLOPT_FTPAPPEND CURLOPT_APPEND\n#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY\n#define CURLOPT_FTP_SSL CURLOPT_USE_SSL\n\n/* The following were added earlier */\n\n#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD\n#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL\n\n#else\n/* This is set if CURL_NO_OLDIES is defined at compile-time */\n#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */\n#endif\n\n\n  /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host\n     name resolves addresses using more than one IP protocol version, this\n     option might be handy to force libcurl to use a specific IP version. */\n#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP\n                                     versions that your system allows */\n#define CURL_IPRESOLVE_V4       1 /* resolve to ipv4 addresses */\n#define CURL_IPRESOLVE_V6       2 /* resolve to ipv6 addresses */\n\n  /* three convenient \"aliases\" that follow the name scheme better */\n#define CURLOPT_WRITEDATA CURLOPT_FILE\n#define CURLOPT_READDATA  CURLOPT_INFILE\n#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER\n#define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER\n\n  /* These enums are for use with the CURLOPT_HTTP_VERSION option. */\nenum {\n  CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd\n                             like the library to choose the best possible\n                             for us! */\n  CURL_HTTP_VERSION_1_0,  /* please use HTTP 1.0 in the request */\n  CURL_HTTP_VERSION_1_1,  /* please use HTTP 1.1 in the request */\n\n  CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */\n};\n\n/*\n * Public API enums for RTSP requests\n */\nenum {\n    CURL_RTSPREQ_NONE, /* first in list */\n    CURL_RTSPREQ_OPTIONS,\n    CURL_RTSPREQ_DESCRIBE,\n    CURL_RTSPREQ_ANNOUNCE,\n    CURL_RTSPREQ_SETUP,\n    CURL_RTSPREQ_PLAY,\n    CURL_RTSPREQ_PAUSE,\n    CURL_RTSPREQ_TEARDOWN,\n    CURL_RTSPREQ_GET_PARAMETER,\n    CURL_RTSPREQ_SET_PARAMETER,\n    CURL_RTSPREQ_RECORD,\n    CURL_RTSPREQ_RECEIVE,\n    CURL_RTSPREQ_LAST /* last in list */\n};\n\n  /* These enums are for use with the CURLOPT_NETRC option. */\nenum CURL_NETRC_OPTION {\n  CURL_NETRC_IGNORED,     /* The .netrc will never be read.\n                           * This is the default. */\n  CURL_NETRC_OPTIONAL,    /* A user:password in the URL will be preferred\n                           * to one in the .netrc. */\n  CURL_NETRC_REQUIRED,    /* A user:password in the URL will be ignored.\n                           * Unless one is set programmatically, the .netrc\n                           * will be queried. */\n  CURL_NETRC_LAST\n};\n\nenum {\n  CURL_SSLVERSION_DEFAULT,\n  CURL_SSLVERSION_TLSv1,\n  CURL_SSLVERSION_SSLv2,\n  CURL_SSLVERSION_SSLv3,\n\n  CURL_SSLVERSION_LAST /* never use, keep last */\n};\n\nenum CURL_TLSAUTH {\n  CURL_TLSAUTH_NONE,\n  CURL_TLSAUTH_SRP,\n  CURL_TLSAUTH_LAST /* never use, keep last */\n};\n\n/* symbols to use with CURLOPT_POSTREDIR.\n   CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303\n   can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302\n   | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */\n\n#define CURL_REDIR_GET_ALL  0\n#define CURL_REDIR_POST_301 1\n#define CURL_REDIR_POST_302 2\n#define CURL_REDIR_POST_303 4\n#define CURL_REDIR_POST_ALL \\\n    (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)\n\ntypedef enum {\n  CURL_TIMECOND_NONE,\n\n  CURL_TIMECOND_IFMODSINCE,\n  CURL_TIMECOND_IFUNMODSINCE,\n  CURL_TIMECOND_LASTMOD,\n\n  CURL_TIMECOND_LAST\n} curl_TimeCond;\n\n\n/* curl_strequal() and curl_strnequal() are subject for removal in a future\n   libcurl, see lib/README.curlx for details */\nCURL_EXTERN int (curl_strequal)(const char *s1, const char *s2);\nCURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);\n\n/* name is uppercase CURLFORM_<name> */\n#ifdef CFINIT\n#undef CFINIT\n#endif\n\n#ifdef CURL_ISOCPP\n#define CFINIT(name) CURLFORM_ ## name\n#else\n/* The macro \"##\" is ISO C, we assume pre-ISO C doesn't support it. */\n#define CFINIT(name) CURLFORM_/**/name\n#endif\n\ntypedef enum {\n  CFINIT(NOTHING),        /********* the first one is unused ************/\n\n  /*  */\n  CFINIT(COPYNAME),\n  CFINIT(PTRNAME),\n  CFINIT(NAMELENGTH),\n  CFINIT(COPYCONTENTS),\n  CFINIT(PTRCONTENTS),\n  CFINIT(CONTENTSLENGTH),\n  CFINIT(FILECONTENT),\n  CFINIT(ARRAY),\n  CFINIT(OBSOLETE),\n  CFINIT(FILE),\n\n  CFINIT(BUFFER),\n  CFINIT(BUFFERPTR),\n  CFINIT(BUFFERLENGTH),\n\n  CFINIT(CONTENTTYPE),\n  CFINIT(CONTENTHEADER),\n  CFINIT(FILENAME),\n  CFINIT(END),\n  CFINIT(OBSOLETE2),\n\n  CFINIT(STREAM),\n\n  CURLFORM_LASTENTRY /* the last unused */\n} CURLformoption;\n\n#undef CFINIT /* done */\n\n/* structure to be used as parameter for CURLFORM_ARRAY */\nstruct curl_forms {\n  CURLformoption option;\n  const char     *value;\n};\n\n/* use this for multipart formpost building */\n/* Returns code for curl_formadd()\n *\n * Returns:\n * CURL_FORMADD_OK             on success\n * CURL_FORMADD_MEMORY         if the FormInfo allocation fails\n * CURL_FORMADD_OPTION_TWICE   if one option is given twice for one Form\n * CURL_FORMADD_NULL           if a null pointer was given for a char\n * CURL_FORMADD_MEMORY         if the allocation of a FormInfo struct failed\n * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used\n * CURL_FORMADD_INCOMPLETE     if the some FormInfo is not complete (or error)\n * CURL_FORMADD_MEMORY         if a curl_httppost struct cannot be allocated\n * CURL_FORMADD_MEMORY         if some allocation for string copying failed.\n * CURL_FORMADD_ILLEGAL_ARRAY  if an illegal option is used in an array\n *\n ***************************************************************************/\ntypedef enum {\n  CURL_FORMADD_OK, /* first, no error */\n\n  CURL_FORMADD_MEMORY,\n  CURL_FORMADD_OPTION_TWICE,\n  CURL_FORMADD_NULL,\n  CURL_FORMADD_UNKNOWN_OPTION,\n  CURL_FORMADD_INCOMPLETE,\n  CURL_FORMADD_ILLEGAL_ARRAY,\n  CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */\n\n  CURL_FORMADD_LAST /* last */\n} CURLFORMcode;\n\n/*\n * NAME curl_formadd()\n *\n * DESCRIPTION\n *\n * Pretty advanced function for building multi-part formposts. Each invoke\n * adds one part that together construct a full post. Then use\n * CURLOPT_HTTPPOST to send it off to libcurl.\n */\nCURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,\n                                      struct curl_httppost **last_post,\n                                      ...);\n\n/*\n * callback function for curl_formget()\n * The void *arg pointer will be the one passed as second argument to\n *   curl_formget().\n * The character buffer passed to it must not be freed.\n * Should return the buffer length passed to it as the argument \"len\" on\n *   success.\n */\ntypedef size_t (*curl_formget_callback)(void *arg, const char *buf,\n                                        size_t len);\n\n/*\n * NAME curl_formget()\n *\n * DESCRIPTION\n *\n * Serialize a curl_httppost struct built with curl_formadd().\n * Accepts a void pointer as second argument which will be passed to\n * the curl_formget_callback function.\n * Returns 0 on success.\n */\nCURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,\n                             curl_formget_callback append);\n/*\n * NAME curl_formfree()\n *\n * DESCRIPTION\n *\n * Free a multipart formpost previously built with curl_formadd().\n */\nCURL_EXTERN void curl_formfree(struct curl_httppost *form);\n\n/*\n * NAME curl_getenv()\n *\n * DESCRIPTION\n *\n * Returns a malloc()'ed string that MUST be curl_free()ed after usage is\n * complete. DEPRECATED - see lib/README.curlx\n */\nCURL_EXTERN char *curl_getenv(const char *variable);\n\n/*\n * NAME curl_version()\n *\n * DESCRIPTION\n *\n * Returns a static ascii string of the libcurl version.\n */\nCURL_EXTERN char *curl_version(void);\n\n/*\n * NAME curl_easy_escape()\n *\n * DESCRIPTION\n *\n * Escapes URL strings (converts all letters consider illegal in URLs to their\n * %XX versions). This function returns a new allocated string or NULL if an\n * error occurred.\n */\nCURL_EXTERN char *curl_easy_escape(CURL *handle,\n                                   const char *string,\n                                   int length);\n\n/* the previous version: */\nCURL_EXTERN char *curl_escape(const char *string,\n                              int length);\n\n\n/*\n * NAME curl_easy_unescape()\n *\n * DESCRIPTION\n *\n * Unescapes URL encoding in strings (converts all %XX codes to their 8bit\n * versions). This function returns a new allocated string or NULL if an error\n * occurred.\n * Conversion Note: On non-ASCII platforms the ASCII %XX codes are\n * converted into the host encoding.\n */\nCURL_EXTERN char *curl_easy_unescape(CURL *handle,\n                                     const char *string,\n                                     int length,\n                                     int *outlength);\n\n/* the previous version */\nCURL_EXTERN char *curl_unescape(const char *string,\n                                int length);\n\n/*\n * NAME curl_free()\n *\n * DESCRIPTION\n *\n * Provided for de-allocation in the same translation unit that did the\n * allocation. Added in libcurl 7.10\n */\nCURL_EXTERN void curl_free(void *p);\n\n/*\n * NAME curl_global_init()\n *\n * DESCRIPTION\n *\n * curl_global_init() should be invoked exactly once for each application that\n * uses libcurl and before any call of other libcurl functions.\n *\n * This function is not thread-safe!\n */\nCURL_EXTERN CURLcode curl_global_init(long flags);\n\n/*\n * NAME curl_global_init_mem()\n *\n * DESCRIPTION\n *\n * curl_global_init() or curl_global_init_mem() should be invoked exactly once\n * for each application that uses libcurl.  This function can be used to\n * initialize libcurl and set user defined memory management callback\n * functions.  Users can implement memory management routines to check for\n * memory leaks, check for mis-use of the curl library etc.  User registered\n * callback routines with be invoked by this library instead of the system\n * memory management routines like malloc, free etc.\n */\nCURL_EXTERN CURLcode curl_global_init_mem(long flags,\n                                          curl_malloc_callback m,\n                                          curl_free_callback f,\n                                          curl_realloc_callback r,\n                                          curl_strdup_callback s,\n                                          curl_calloc_callback c);\n\n/*\n * NAME curl_global_cleanup()\n *\n * DESCRIPTION\n *\n * curl_global_cleanup() should be invoked exactly once for each application\n * that uses libcurl\n */\nCURL_EXTERN void curl_global_cleanup(void);\n\n/* linked-list structure for the CURLOPT_QUOTE option (and other) */\nstruct curl_slist {\n  char *data;\n  struct curl_slist *next;\n};\n\n/*\n * NAME curl_slist_append()\n *\n * DESCRIPTION\n *\n * Appends a string to a linked list. If no list exists, it will be created\n * first. Returns the new list, after appending.\n */\nCURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,\n                                                 const char *);\n\n/*\n * NAME curl_slist_free_all()\n *\n * DESCRIPTION\n *\n * free a previously built curl_slist.\n */\nCURL_EXTERN void curl_slist_free_all(struct curl_slist *);\n\n/*\n * NAME curl_getdate()\n *\n * DESCRIPTION\n *\n * Returns the time, in seconds since 1 Jan 1970 of the time string given in\n * the first argument. The time argument in the second parameter is unused\n * and should be set to NULL.\n */\nCURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);\n\n/* info about the certificate chain, only for OpenSSL builds. Asked\n   for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */\nstruct curl_certinfo {\n  int num_of_certs;             /* number of certificates with information */\n  struct curl_slist **certinfo; /* for each index in this array, there's a\n                                   linked list with textual information in the\n                                   format \"name: value\" */\n};\n\n#define CURLINFO_STRING   0x100000\n#define CURLINFO_LONG     0x200000\n#define CURLINFO_DOUBLE   0x300000\n#define CURLINFO_SLIST    0x400000\n#define CURLINFO_MASK     0x0fffff\n#define CURLINFO_TYPEMASK 0xf00000\n\ntypedef enum {\n  CURLINFO_NONE, /* first, never use this */\n  CURLINFO_EFFECTIVE_URL    = CURLINFO_STRING + 1,\n  CURLINFO_RESPONSE_CODE    = CURLINFO_LONG   + 2,\n  CURLINFO_TOTAL_TIME       = CURLINFO_DOUBLE + 3,\n  CURLINFO_NAMELOOKUP_TIME  = CURLINFO_DOUBLE + 4,\n  CURLINFO_CONNECT_TIME     = CURLINFO_DOUBLE + 5,\n  CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,\n  CURLINFO_SIZE_UPLOAD      = CURLINFO_DOUBLE + 7,\n  CURLINFO_SIZE_DOWNLOAD    = CURLINFO_DOUBLE + 8,\n  CURLINFO_SPEED_DOWNLOAD   = CURLINFO_DOUBLE + 9,\n  CURLINFO_SPEED_UPLOAD     = CURLINFO_DOUBLE + 10,\n  CURLINFO_HEADER_SIZE      = CURLINFO_LONG   + 11,\n  CURLINFO_REQUEST_SIZE     = CURLINFO_LONG   + 12,\n  CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG   + 13,\n  CURLINFO_FILETIME         = CURLINFO_LONG   + 14,\n  CURLINFO_CONTENT_LENGTH_DOWNLOAD   = CURLINFO_DOUBLE + 15,\n  CURLINFO_CONTENT_LENGTH_UPLOAD     = CURLINFO_DOUBLE + 16,\n  CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,\n  CURLINFO_CONTENT_TYPE     = CURLINFO_STRING + 18,\n  CURLINFO_REDIRECT_TIME    = CURLINFO_DOUBLE + 19,\n  CURLINFO_REDIRECT_COUNT   = CURLINFO_LONG   + 20,\n  CURLINFO_PRIVATE          = CURLINFO_STRING + 21,\n  CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG   + 22,\n  CURLINFO_HTTPAUTH_AVAIL   = CURLINFO_LONG   + 23,\n  CURLINFO_PROXYAUTH_AVAIL  = CURLINFO_LONG   + 24,\n  CURLINFO_OS_ERRNO         = CURLINFO_LONG   + 25,\n  CURLINFO_NUM_CONNECTS     = CURLINFO_LONG   + 26,\n  CURLINFO_SSL_ENGINES      = CURLINFO_SLIST  + 27,\n  CURLINFO_COOKIELIST       = CURLINFO_SLIST  + 28,\n  CURLINFO_LASTSOCKET       = CURLINFO_LONG   + 29,\n  CURLINFO_FTP_ENTRY_PATH   = CURLINFO_STRING + 30,\n  CURLINFO_REDIRECT_URL     = CURLINFO_STRING + 31,\n  CURLINFO_PRIMARY_IP       = CURLINFO_STRING + 32,\n  CURLINFO_APPCONNECT_TIME  = CURLINFO_DOUBLE + 33,\n  CURLINFO_CERTINFO         = CURLINFO_SLIST  + 34,\n  CURLINFO_CONDITION_UNMET  = CURLINFO_LONG   + 35,\n  CURLINFO_RTSP_SESSION_ID  = CURLINFO_STRING + 36,\n  CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG   + 37,\n  CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG   + 38,\n  CURLINFO_RTSP_CSEQ_RECV   = CURLINFO_LONG   + 39,\n  CURLINFO_PRIMARY_PORT     = CURLINFO_LONG   + 40,\n  CURLINFO_LOCAL_IP         = CURLINFO_STRING + 41,\n  CURLINFO_LOCAL_PORT       = CURLINFO_LONG   + 42,\n  /* Fill in new entries below here! */\n\n  CURLINFO_LASTONE          = 42\n} CURLINFO;\n\n/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as\n   CURLINFO_HTTP_CODE */\n#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE\n\ntypedef enum {\n  CURLCLOSEPOLICY_NONE, /* first, never use this */\n\n  CURLCLOSEPOLICY_OLDEST,\n  CURLCLOSEPOLICY_LEAST_RECENTLY_USED,\n  CURLCLOSEPOLICY_LEAST_TRAFFIC,\n  CURLCLOSEPOLICY_SLOWEST,\n  CURLCLOSEPOLICY_CALLBACK,\n\n  CURLCLOSEPOLICY_LAST /* last, never use this */\n} curl_closepolicy;\n\n#define CURL_GLOBAL_SSL (1<<0)\n#define CURL_GLOBAL_WIN32 (1<<1)\n#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)\n#define CURL_GLOBAL_NOTHING 0\n#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL\n#define CURL_GLOBAL_ACK_EINTR (1<<2)\n\n\n/*****************************************************************************\n * Setup defines, protos etc for the sharing stuff.\n */\n\n/* Different data locks for a single share */\ntypedef enum {\n  CURL_LOCK_DATA_NONE = 0,\n  /*  CURL_LOCK_DATA_SHARE is used internally to say that\n   *  the locking is just made to change the internal state of the share\n   *  itself.\n   */\n  CURL_LOCK_DATA_SHARE,\n  CURL_LOCK_DATA_COOKIE,\n  CURL_LOCK_DATA_DNS,\n  CURL_LOCK_DATA_SSL_SESSION,\n  CURL_LOCK_DATA_CONNECT,\n  CURL_LOCK_DATA_LAST\n} curl_lock_data;\n\n/* Different lock access types */\ntypedef enum {\n  CURL_LOCK_ACCESS_NONE = 0,   /* unspecified action */\n  CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */\n  CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */\n  CURL_LOCK_ACCESS_LAST        /* never use */\n} curl_lock_access;\n\ntypedef void (*curl_lock_function)(CURL *handle,\n                                   curl_lock_data data,\n                                   curl_lock_access locktype,\n                                   void *userptr);\ntypedef void (*curl_unlock_function)(CURL *handle,\n                                     curl_lock_data data,\n                                     void *userptr);\n\ntypedef void CURLSH;\n\ntypedef enum {\n  CURLSHE_OK,  /* all is fine */\n  CURLSHE_BAD_OPTION, /* 1 */\n  CURLSHE_IN_USE,     /* 2 */\n  CURLSHE_INVALID,    /* 3 */\n  CURLSHE_NOMEM,      /* 4 out of memory */\n  CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */\n  CURLSHE_LAST        /* never use */\n} CURLSHcode;\n\ntypedef enum {\n  CURLSHOPT_NONE,  /* don't use */\n  CURLSHOPT_SHARE,   /* specify a data type to share */\n  CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */\n  CURLSHOPT_LOCKFUNC,   /* pass in a 'curl_lock_function' pointer */\n  CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */\n  CURLSHOPT_USERDATA,   /* pass in a user data pointer used in the lock/unlock\n                           callback functions */\n  CURLSHOPT_LAST  /* never use */\n} CURLSHoption;\n\nCURL_EXTERN CURLSH *curl_share_init(void);\nCURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);\nCURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);\n\n/****************************************************************************\n * Structures for querying information about the curl library at runtime.\n */\n\ntypedef enum {\n  CURLVERSION_FIRST,\n  CURLVERSION_SECOND,\n  CURLVERSION_THIRD,\n  CURLVERSION_FOURTH,\n  CURLVERSION_LAST /* never actually use this */\n} CURLversion;\n\n/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by\n   basically all programs ever that want to get version information. It is\n   meant to be a built-in version number for what kind of struct the caller\n   expects. If the struct ever changes, we redefine the NOW to another enum\n   from above. */\n#define CURLVERSION_NOW CURLVERSION_FOURTH\n\ntypedef struct {\n  CURLversion age;          /* age of the returned struct */\n  const char *version;      /* LIBCURL_VERSION */\n  unsigned int version_num; /* LIBCURL_VERSION_NUM */\n  const char *host;         /* OS/host/cpu/machine when configured */\n  int features;             /* bitmask, see defines below */\n  const char *ssl_version;  /* human readable string */\n  long ssl_version_num;     /* not used anymore, always 0 */\n  const char *libz_version; /* human readable string */\n  /* protocols is terminated by an entry with a NULL protoname */\n  const char * const *protocols;\n\n  /* The fields below this were added in CURLVERSION_SECOND */\n  const char *ares;\n  int ares_num;\n\n  /* This field was added in CURLVERSION_THIRD */\n  const char *libidn;\n\n  /* These field were added in CURLVERSION_FOURTH */\n\n  /* Same as '_libiconv_version' if built with HAVE_ICONV */\n  int iconv_ver_num;\n\n  const char *libssh_version; /* human readable string */\n\n} curl_version_info_data;\n\n#define CURL_VERSION_IPV6      (1<<0)  /* IPv6-enabled */\n#define CURL_VERSION_KERBEROS4 (1<<1)  /* kerberos auth is supported */\n#define CURL_VERSION_SSL       (1<<2)  /* SSL options are present */\n#define CURL_VERSION_LIBZ      (1<<3)  /* libz features are present */\n#define CURL_VERSION_NTLM      (1<<4)  /* NTLM auth is supported */\n#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */\n#define CURL_VERSION_DEBUG     (1<<6)  /* built with debug capabilities */\n#define CURL_VERSION_ASYNCHDNS (1<<7)  /* asynchronous dns resolves */\n#define CURL_VERSION_SPNEGO    (1<<8)  /* SPNEGO auth */\n#define CURL_VERSION_LARGEFILE (1<<9)  /* supports files bigger than 2GB */\n#define CURL_VERSION_IDN       (1<<10) /* International Domain Names support */\n#define CURL_VERSION_SSPI      (1<<11) /* SSPI is supported */\n#define CURL_VERSION_CONV      (1<<12) /* character conversions supported */\n#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */\n#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */\n#define CURL_VERSION_NTLM_WB   (1<<15) /* NTLM delegating to winbind helper */\n\n /*\n * NAME curl_version_info()\n *\n * DESCRIPTION\n *\n * This function returns a pointer to a static copy of the version info\n * struct. See above.\n */\nCURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);\n\n/*\n * NAME curl_easy_strerror()\n *\n * DESCRIPTION\n *\n * The curl_easy_strerror function may be used to turn a CURLcode value\n * into the equivalent human readable error string.  This is useful\n * for printing meaningful error messages.\n */\nCURL_EXTERN const char *curl_easy_strerror(CURLcode);\n\n/*\n * NAME curl_share_strerror()\n *\n * DESCRIPTION\n *\n * The curl_share_strerror function may be used to turn a CURLSHcode value\n * into the equivalent human readable error string.  This is useful\n * for printing meaningful error messages.\n */\nCURL_EXTERN const char *curl_share_strerror(CURLSHcode);\n\n/*\n * NAME curl_easy_pause()\n *\n * DESCRIPTION\n *\n * The curl_easy_pause function pauses or unpauses transfers. Select the new\n * state by setting the bitmask, use the convenience defines below.\n *\n */\nCURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);\n\n#define CURLPAUSE_RECV      (1<<0)\n#define CURLPAUSE_RECV_CONT (0)\n\n#define CURLPAUSE_SEND      (1<<2)\n#define CURLPAUSE_SEND_CONT (0)\n\n#define CURLPAUSE_ALL       (CURLPAUSE_RECV|CURLPAUSE_SEND)\n#define CURLPAUSE_CONT      (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)\n\n#ifdef  __cplusplus\n}\n#endif\n\n/* unfortunately, the easy.h and multi.h include files need options and info\n  stuff before they can be included! */\n#include \"easy.h\" /* nothing in curl is fun without the easy stuff */\n#include \"multi.h\"\n\n/* the typechecker doesn't work in C++ (yet) */\n#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \\\n    ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \\\n    !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)\n#include \"typecheck-gcc.h\"\n#else\n#if defined(__STDC__) && (__STDC__ >= 1)\n/* This preprocessor magic that replaces a call with the exact same call is\n   only done to make sure application authors pass exactly three arguments\n   to these functions. */\n#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)\n#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)\n#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)\n#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)\n#endif /* __STDC__ >= 1 */\n#endif /* gcc >= 4.3 && !__cplusplus */\n\n#endif /* __CURL_CURL_H */\n"
  },
  {
    "path": "third_party/include/curl/curlbuild.h",
    "content": "#ifndef __CURL_CURLBUILD_H\n#define __CURL_CURLBUILD_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* ================================================================ */\n/*               NOTES FOR CONFIGURE CAPABLE SYSTEMS                */\n/* ================================================================ */\n\n/*\n * NOTE 1:\n * -------\n *\n * See file include/curl/curlbuild.h.in, run configure, and forget\n * that this file exists it is only used for non-configure systems.\n * But you can keep reading if you want ;-)\n *\n */\n\n/* ================================================================ */\n/*                 NOTES FOR NON-CONFIGURE SYSTEMS                  */\n/* ================================================================ */\n\n/*\n * NOTE 1:\n * -------\n *\n * Nothing in this file is intended to be modified or adjusted by the\n * curl library user nor by the curl library builder.\n *\n * If you think that something actually needs to be changed, adjusted\n * or fixed in this file, then, report it on the libcurl development\n * mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/\n *\n * Try to keep one section per platform, compiler and architecture,\n * otherwise, if an existing section is reused for a different one and\n * later on the original is adjusted, probably the piggybacking one can\n * be adversely changed.\n *\n * In order to differentiate between platforms/compilers/architectures\n * use only compiler built in predefined preprocessor symbols.\n *\n * This header file shall only export symbols which are 'curl' or 'CURL'\n * prefixed, otherwise public name space would be polluted.\n *\n * NOTE 2:\n * -------\n *\n * For any given platform/compiler curl_off_t must be typedef'ed to a\n * 64-bit wide signed integral data type. The width of this data type\n * must remain constant and independent of any possible large file\n * support settings.\n *\n * As an exception to the above, curl_off_t shall be typedef'ed to a\n * 32-bit wide signed integral data type if there is no 64-bit type.\n *\n * As a general rule, curl_off_t shall not be mapped to off_t. This\n * rule shall only be violated if off_t is the only 64-bit data type\n * available and the size of off_t is independent of large file support\n * settings. Keep your build on the safe side avoiding an off_t gating.\n * If you have a 64-bit off_t then take for sure that another 64-bit\n * data type exists, dig deeper and you will find it.\n *\n * NOTE 3:\n * -------\n *\n * Right now you might be staring at file include/curl/curlbuild.h.dist or\n * at file include/curl/curlbuild.h, this is due to the following reason:\n * file include/curl/curlbuild.h.dist is renamed to include/curl/curlbuild.h\n * when the libcurl source code distribution archive file is created.\n *\n * File include/curl/curlbuild.h.dist is not included in the distribution\n * archive. File include/curl/curlbuild.h is not present in the git tree.\n *\n * The distributed include/curl/curlbuild.h file is only intended to be used\n * on systems which can not run the also distributed configure script.\n *\n * On systems capable of running the configure script, the configure process\n * will overwrite the distributed include/curl/curlbuild.h file with one that\n * is suitable and specific to the library being configured and built, which\n * is generated from the include/curl/curlbuild.h.in template file.\n *\n * If you check out from git on a non-configure platform, you must run the\n * appropriate buildconf* script to set up curlbuild.h and other local files.\n *\n */\n\n/* ================================================================ */\n/*  DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE  */\n/* ================================================================ */\n\n#ifdef CURL_SIZEOF_LONG\n#  error \"CURL_SIZEOF_LONG shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined\n#endif\n\n#ifdef CURL_TYPEOF_CURL_SOCKLEN_T\n#  error \"CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined\n#endif\n\n#ifdef CURL_SIZEOF_CURL_SOCKLEN_T\n#  error \"CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined\n#endif\n\n#ifdef CURL_TYPEOF_CURL_OFF_T\n#  error \"CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_FORMAT_CURL_OFF_T\n#  error \"CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_FORMAT_CURL_OFF_TU\n#  error \"CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined\n#endif\n\n#ifdef CURL_FORMAT_OFF_T\n#  error \"CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined\n#endif\n\n#ifdef CURL_SIZEOF_CURL_OFF_T\n#  error \"CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_SUFFIX_CURL_OFF_T\n#  error \"CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined\n#endif\n\n#ifdef CURL_SUFFIX_CURL_OFF_TU\n#  error \"CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined\n#endif\n\n/* ================================================================ */\n/*    EXTERNAL INTERFACE SETTINGS FOR NON-CONFIGURE SYSTEMS ONLY    */\n/* ================================================================ */\n\n#if defined(__DJGPP__) || defined(__GO32__)\n#  if defined(__DJGPP__) && (__DJGPP__ > 1)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  else\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     4\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__SALFORDC__)\n#  define CURL_SIZEOF_LONG           4\n#  define CURL_TYPEOF_CURL_OFF_T     long\n#  define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#  define CURL_FORMAT_OFF_T          \"%ld\"\n#  define CURL_SIZEOF_CURL_OFF_T     4\n#  define CURL_SUFFIX_CURL_OFF_T     L\n#  define CURL_SUFFIX_CURL_OFF_TU    UL\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__BORLANDC__)\n#  if (__BORLANDC__ < 0x520)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     4\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  else\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     __int64\n#    define CURL_FORMAT_CURL_OFF_T     \"I64d\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"I64u\"\n#    define CURL_FORMAT_OFF_T          \"%I64d\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     i64\n#    define CURL_SUFFIX_CURL_OFF_TU    ui64\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__TURBOC__)\n#  define CURL_SIZEOF_LONG           4\n#  define CURL_TYPEOF_CURL_OFF_T     long\n#  define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#  define CURL_FORMAT_OFF_T          \"%ld\"\n#  define CURL_SIZEOF_CURL_OFF_T     4\n#  define CURL_SUFFIX_CURL_OFF_T     L\n#  define CURL_SUFFIX_CURL_OFF_TU    UL\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__WATCOMC__)\n#  if defined(__386__)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     __int64\n#    define CURL_FORMAT_CURL_OFF_T     \"I64d\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"I64u\"\n#    define CURL_FORMAT_OFF_T          \"%I64d\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     i64\n#    define CURL_SUFFIX_CURL_OFF_TU    ui64\n#  else\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     4\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__POCC__)\n#  if (__POCC__ < 280)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     4\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  elif defined(_MSC_VER)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     __int64\n#    define CURL_FORMAT_CURL_OFF_T     \"I64d\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"I64u\"\n#    define CURL_FORMAT_OFF_T          \"%I64d\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     i64\n#    define CURL_SUFFIX_CURL_OFF_TU    ui64\n#  else\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__LCC__)\n#  define CURL_SIZEOF_LONG           4\n#  define CURL_TYPEOF_CURL_OFF_T     long\n#  define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#  define CURL_FORMAT_OFF_T          \"%ld\"\n#  define CURL_SIZEOF_CURL_OFF_T     4\n#  define CURL_SUFFIX_CURL_OFF_T     L\n#  define CURL_SUFFIX_CURL_OFF_TU    UL\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__SYMBIAN32__)\n#  if defined(__EABI__)  /* Treat all ARM compilers equally */\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  elif defined(__CW32__)\n#    pragma longlong on\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  elif defined(__VC32__)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     __int64\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__MWERKS__)\n#  define CURL_SIZEOF_LONG           4\n#  define CURL_TYPEOF_CURL_OFF_T     long long\n#  define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#  define CURL_FORMAT_OFF_T          \"%lld\"\n#  define CURL_SIZEOF_CURL_OFF_T     8\n#  define CURL_SUFFIX_CURL_OFF_T     LL\n#  define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(_WIN32_WCE)\n#  define CURL_SIZEOF_LONG           4\n#  define CURL_TYPEOF_CURL_OFF_T     __int64\n#  define CURL_FORMAT_CURL_OFF_T     \"I64d\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"I64u\"\n#  define CURL_FORMAT_OFF_T          \"%I64d\"\n#  define CURL_SIZEOF_CURL_OFF_T     8\n#  define CURL_SUFFIX_CURL_OFF_T     i64\n#  define CURL_SUFFIX_CURL_OFF_TU    ui64\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__MINGW32__)\n#  define CURL_SIZEOF_LONG           4\n#  define CURL_TYPEOF_CURL_OFF_T     long long\n#  define CURL_FORMAT_CURL_OFF_T     \"I64d\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"I64u\"\n#  define CURL_FORMAT_OFF_T          \"%I64d\"\n#  define CURL_SIZEOF_CURL_OFF_T     8\n#  define CURL_SUFFIX_CURL_OFF_T     LL\n#  define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__VMS)\n#  if defined(__VAX)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     4\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  else\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T unsigned int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n#elif defined(__OS400__)\n#  if defined(__ILEC400__)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#    define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t\n#    define CURL_SIZEOF_CURL_SOCKLEN_T 4\n#    define CURL_PULL_SYS_TYPES_H      1\n#    define CURL_PULL_SYS_SOCKET_H     1\n#  endif\n\n#elif defined(__MVS__)\n#  if defined(__IBMC__) || defined(__IBMCPP__)\n#    if defined(_ILP32)\n#      define CURL_SIZEOF_LONG           4\n#    elif defined(_LP64)\n#      define CURL_SIZEOF_LONG           8\n#    endif\n#    if defined(_LONG_LONG)\n#      define CURL_TYPEOF_CURL_OFF_T     long long\n#      define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#      define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#      define CURL_FORMAT_OFF_T          \"%lld\"\n#      define CURL_SIZEOF_CURL_OFF_T     8\n#      define CURL_SUFFIX_CURL_OFF_T     LL\n#      define CURL_SUFFIX_CURL_OFF_TU    ULL\n#    elif defined(_LP64)\n#      define CURL_TYPEOF_CURL_OFF_T     long\n#      define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#      define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#      define CURL_FORMAT_OFF_T          \"%ld\"\n#      define CURL_SIZEOF_CURL_OFF_T     8\n#      define CURL_SUFFIX_CURL_OFF_T     L\n#      define CURL_SUFFIX_CURL_OFF_TU    UL\n#    else\n#      define CURL_TYPEOF_CURL_OFF_T     long\n#      define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#      define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#      define CURL_FORMAT_OFF_T          \"%ld\"\n#      define CURL_SIZEOF_CURL_OFF_T     4\n#      define CURL_SUFFIX_CURL_OFF_T     L\n#      define CURL_SUFFIX_CURL_OFF_TU    UL\n#    endif\n#    define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t\n#    define CURL_SIZEOF_CURL_SOCKLEN_T 4\n#    define CURL_PULL_SYS_TYPES_H      1\n#    define CURL_PULL_SYS_SOCKET_H     1\n#  endif\n\n#elif defined(__370__)\n#  if defined(__IBMC__) || defined(__IBMCPP__)\n#    if defined(_ILP32)\n#      define CURL_SIZEOF_LONG           4\n#    elif defined(_LP64)\n#      define CURL_SIZEOF_LONG           8\n#    endif\n#    if defined(_LONG_LONG)\n#      define CURL_TYPEOF_CURL_OFF_T     long long\n#      define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#      define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#      define CURL_FORMAT_OFF_T          \"%lld\"\n#      define CURL_SIZEOF_CURL_OFF_T     8\n#      define CURL_SUFFIX_CURL_OFF_T     LL\n#      define CURL_SUFFIX_CURL_OFF_TU    ULL\n#    elif defined(_LP64)\n#      define CURL_TYPEOF_CURL_OFF_T     long\n#      define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#      define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#      define CURL_FORMAT_OFF_T          \"%ld\"\n#      define CURL_SIZEOF_CURL_OFF_T     8\n#      define CURL_SUFFIX_CURL_OFF_T     L\n#      define CURL_SUFFIX_CURL_OFF_TU    UL\n#    else\n#      define CURL_TYPEOF_CURL_OFF_T     long\n#      define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#      define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#      define CURL_FORMAT_OFF_T          \"%ld\"\n#      define CURL_SIZEOF_CURL_OFF_T     4\n#      define CURL_SUFFIX_CURL_OFF_T     L\n#      define CURL_SUFFIX_CURL_OFF_TU    UL\n#    endif\n#    define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t\n#    define CURL_SIZEOF_CURL_SOCKLEN_T 4\n#    define CURL_PULL_SYS_TYPES_H      1\n#    define CURL_PULL_SYS_SOCKET_H     1\n#  endif\n\n#elif defined(TPF)\n#  define CURL_SIZEOF_LONG           8\n#  define CURL_TYPEOF_CURL_OFF_T     long\n#  define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#  define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#  define CURL_FORMAT_OFF_T          \"%ld\"\n#  define CURL_SIZEOF_CURL_OFF_T     8\n#  define CURL_SUFFIX_CURL_OFF_T     L\n#  define CURL_SUFFIX_CURL_OFF_TU    UL\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n/* ===================================== */\n/*    KEEP MSVC THE PENULTIMATE ENTRY    */\n/* ===================================== */\n\n#elif defined(_MSC_VER)\n#  if (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     __int64\n#    define CURL_FORMAT_CURL_OFF_T     \"I64d\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"I64u\"\n#    define CURL_FORMAT_OFF_T          \"%I64d\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     i64\n#    define CURL_SUFFIX_CURL_OFF_TU    ui64\n#  else\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     4\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T int\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n\n/* ===================================== */\n/*    KEEP GENERIC GCC THE LAST ENTRY    */\n/* ===================================== */\n\n#elif defined(__GNUC__)\n#  if defined(__ILP32__) || \\\n      defined(__i386__) || defined(__ppc__) || defined(__arm__)\n#    define CURL_SIZEOF_LONG           4\n#    define CURL_TYPEOF_CURL_OFF_T     long long\n#    define CURL_FORMAT_CURL_OFF_T     \"lld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"llu\"\n#    define CURL_FORMAT_OFF_T          \"%lld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     LL\n#    define CURL_SUFFIX_CURL_OFF_TU    ULL\n#  elif defined(__LP64__) || \\\n        defined(__x86_64__) || defined(__ppc64__)\n#    define CURL_SIZEOF_LONG           8\n#    define CURL_TYPEOF_CURL_OFF_T     long\n#    define CURL_FORMAT_CURL_OFF_T     \"ld\"\n#    define CURL_FORMAT_CURL_OFF_TU    \"lu\"\n#    define CURL_FORMAT_OFF_T          \"%ld\"\n#    define CURL_SIZEOF_CURL_OFF_T     8\n#    define CURL_SUFFIX_CURL_OFF_T     L\n#    define CURL_SUFFIX_CURL_OFF_TU    UL\n#  endif\n#  define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t\n#  define CURL_SIZEOF_CURL_SOCKLEN_T 4\n#  define CURL_PULL_SYS_TYPES_H      1\n#  define CURL_PULL_SYS_SOCKET_H     1\n\n#else\n#  error \"Unknown non-configure build target!\"\n   Error Compilation_aborted_Unknown_non_configure_build_target\n#endif\n\n/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file  */\n/* sys/types.h is required here to properly make type definitions below. */\n#ifdef CURL_PULL_SYS_TYPES_H\n#  include <sys/types.h>\n#endif\n\n/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file  */\n/* sys/socket.h is required here to properly make type definitions below. */\n#ifdef CURL_PULL_SYS_SOCKET_H\n#  include <sys/socket.h>\n#endif\n\n/* Data type definition of curl_socklen_t. */\n\n#ifdef CURL_TYPEOF_CURL_SOCKLEN_T\n  typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;\n#endif\n\n/* Data type definition of curl_off_t. */\n\n#ifdef CURL_TYPEOF_CURL_OFF_T\n  typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;\n#endif\n\n#endif /* __CURL_CURLBUILD_H */\n"
  },
  {
    "path": "third_party/include/curl/curlrules.h",
    "content": "#ifndef __CURL_CURLRULES_H\n#define __CURL_CURLRULES_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* ================================================================ */\n/*                    COMPILE TIME SANITY CHECKS                    */\n/* ================================================================ */\n\n/*\n * NOTE 1:\n * -------\n *\n * All checks done in this file are intentionally placed in a public\n * header file which is pulled by curl/curl.h when an application is\n * being built using an already built libcurl library. Additionally\n * this file is also included and used when building the library.\n *\n * If compilation fails on this file it is certainly sure that the\n * problem is elsewhere. It could be a problem in the curlbuild.h\n * header file, or simply that you are using different compilation\n * settings than those used to build the library.\n *\n * Nothing in this file is intended to be modified or adjusted by the\n * curl library user nor by the curl library builder.\n *\n * Do not deactivate any check, these are done to make sure that the\n * library is properly built and used.\n *\n * You can find further help on the libcurl development mailing list:\n * http://cool.haxx.se/mailman/listinfo/curl-library/\n *\n * NOTE 2\n * ------\n *\n * Some of the following compile time checks are based on the fact\n * that the dimension of a constant array can not be a negative one.\n * In this way if the compile time verification fails, the compilation\n * will fail issuing an error. The error description wording is compiler\n * dependent but it will be quite similar to one of the following:\n *\n *   \"negative subscript or subscript is too large\"\n *   \"array must have at least one element\"\n *   \"-1 is an illegal array size\"\n *   \"size of array is negative\"\n *\n * If you are building an application which tries to use an already\n * built libcurl library and you are getting this kind of errors on\n * this file, it is a clear indication that there is a mismatch between\n * how the library was built and how you are trying to use it for your\n * application. Your already compiled or binary library provider is the\n * only one who can give you the details you need to properly use it.\n */\n\n/*\n * Verify that some macros are actually defined.\n */\n\n#ifndef CURL_SIZEOF_LONG\n#  error \"CURL_SIZEOF_LONG definition is missing!\"\n   Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing\n#endif\n\n#ifndef CURL_TYPEOF_CURL_SOCKLEN_T\n#  error \"CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing\n#endif\n\n#ifndef CURL_SIZEOF_CURL_SOCKLEN_T\n#  error \"CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing\n#endif\n\n#ifndef CURL_TYPEOF_CURL_OFF_T\n#  error \"CURL_TYPEOF_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_FORMAT_CURL_OFF_T\n#  error \"CURL_FORMAT_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_FORMAT_CURL_OFF_TU\n#  error \"CURL_FORMAT_CURL_OFF_TU definition is missing!\"\n   Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing\n#endif\n\n#ifndef CURL_FORMAT_OFF_T\n#  error \"CURL_FORMAT_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing\n#endif\n\n#ifndef CURL_SIZEOF_CURL_OFF_T\n#  error \"CURL_SIZEOF_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_SUFFIX_CURL_OFF_T\n#  error \"CURL_SUFFIX_CURL_OFF_T definition is missing!\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing\n#endif\n\n#ifndef CURL_SUFFIX_CURL_OFF_TU\n#  error \"CURL_SUFFIX_CURL_OFF_TU definition is missing!\"\n   Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing\n#endif\n\n/*\n * Macros private to this header file.\n */\n\n#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1\n\n#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1\n\n/*\n * Verify that the size previously defined and expected for long\n * is the same as the one reported by sizeof() at compile time.\n */\n\ntypedef char\n  __curl_rule_01__\n    [CurlchkszEQ(long, CURL_SIZEOF_LONG)];\n\n/*\n * Verify that the size previously defined and expected for\n * curl_off_t is actually the the same as the one reported\n * by sizeof() at compile time.\n */\n\ntypedef char\n  __curl_rule_02__\n    [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];\n\n/*\n * Verify at compile time that the size of curl_off_t as reported\n * by sizeof() is greater or equal than the one reported for long\n * for the current compilation.\n */\n\ntypedef char\n  __curl_rule_03__\n    [CurlchkszGE(curl_off_t, long)];\n\n/*\n * Verify that the size previously defined and expected for\n * curl_socklen_t is actually the the same as the one reported\n * by sizeof() at compile time.\n */\n\ntypedef char\n  __curl_rule_04__\n    [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];\n\n/*\n * Verify at compile time that the size of curl_socklen_t as reported\n * by sizeof() is greater or equal than the one reported for int for\n * the current compilation.\n */\n\ntypedef char\n  __curl_rule_05__\n    [CurlchkszGE(curl_socklen_t, int)];\n\n/* ================================================================ */\n/*          EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS           */\n/* ================================================================ */\n\n/*\n * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow\n * these to be visible and exported by the external libcurl interface API,\n * while also making them visible to the library internals, simply including\n * curl_setup.h, without actually needing to include curl.h internally.\n * If some day this section would grow big enough, all this should be moved\n * to its own header file.\n */\n\n/*\n * Figure out if we can use the ## preprocessor operator, which is supported\n * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__\n * or  __cplusplus so we need to carefully check for them too.\n */\n\n#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \\\n  defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \\\n  defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \\\n  defined(__ILEC400__)\n  /* This compiler is believed to have an ISO compatible preprocessor */\n#define CURL_ISOCPP\n#else\n  /* This compiler is believed NOT to have an ISO compatible preprocessor */\n#undef CURL_ISOCPP\n#endif\n\n/*\n * Macros for minimum-width signed and unsigned curl_off_t integer constants.\n */\n\n#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)\n#  define __CURL_OFF_T_C_HLPR2(x) x\n#  define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)\n#  define CURL_OFF_T_C(Val)  __CURL_OFF_T_C_HLPR1(Val) ## \\\n                             __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)\n#  define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \\\n                             __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)\n#else\n#  ifdef CURL_ISOCPP\n#    define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix\n#  else\n#    define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix\n#  endif\n#  define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)\n#  define CURL_OFF_T_C(Val)  __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)\n#  define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)\n#endif\n\n/*\n * Get rid of macros private to this header file.\n */\n\n#undef CurlchkszEQ\n#undef CurlchkszGE\n\n/*\n * Get rid of macros not intended to exist beyond this point.\n */\n\n#undef CURL_PULL_WS2TCPIP_H\n#undef CURL_PULL_SYS_TYPES_H\n#undef CURL_PULL_SYS_SOCKET_H\n#undef CURL_PULL_SYS_POLL_H\n#undef CURL_PULL_STDINT_H\n#undef CURL_PULL_INTTYPES_H\n\n#undef CURL_TYPEOF_CURL_SOCKLEN_T\n#undef CURL_TYPEOF_CURL_OFF_T\n\n#ifdef CURL_NO_OLDIES\n#undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */\n#endif\n\n#endif /* __CURL_CURLRULES_H */\n"
  },
  {
    "path": "third_party/include/curl/curlver.h",
    "content": "#ifndef __CURL_CURLVER_H\n#define __CURL_CURLVER_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* This header file contains nothing but libcurl version info, generated by\n   a script at release-time. This was made its own header file in 7.11.2 */\n\n/* This is the global package copyright */\n#define LIBCURL_COPYRIGHT \"1996 - 2013 Daniel Stenberg, <daniel@haxx.se>.\"\n\n/* This is the version number of the libcurl package from which this header\n   file origins: */\n#define LIBCURL_VERSION \"7.30.0-DEV\"\n\n/* The numeric version number is also available \"in parts\" by using these\n   defines: */\n#define LIBCURL_VERSION_MAJOR 7\n#define LIBCURL_VERSION_MINOR 30\n#define LIBCURL_VERSION_PATCH 0\n\n/* This is the numeric version of the libcurl version number, meant for easier\n   parsing and comparions by programs. The LIBCURL_VERSION_NUM define will\n   always follow this syntax:\n\n         0xXXYYZZ\n\n   Where XX, YY and ZZ are the main version, release and patch numbers in\n   hexadecimal (using 8 bits each). All three numbers are always represented\n   using two digits.  1.2 would appear as \"0x010200\" while version 9.11.7\n   appears as \"0x090b07\".\n\n   This 6-digit (24 bits) hexadecimal number does not show pre-release number,\n   and it is always a greater number in a more recent release. It makes\n   comparisons with greater than and less than work.\n*/\n#define LIBCURL_VERSION_NUM 0x071e00\n\n/*\n * This is the date and time when the full source package was created. The\n * timestamp is not stored in git, as the timestamp is properly set in the\n * tarballs by the maketgz script.\n *\n * The format of the date should follow this template:\n *\n * \"Mon Feb 12 11:35:33 UTC 2007\"\n */\n#define LIBCURL_TIMESTAMP \"DEV\"\n\n#endif /* __CURL_CURLVER_H */\n"
  },
  {
    "path": "third_party/include/curl/easy.h",
    "content": "#ifndef __CURL_EASY_H\n#define __CURL_EASY_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\nCURL_EXTERN CURL *curl_easy_init(void);\nCURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);\nCURL_EXTERN CURLcode curl_easy_perform(CURL *curl);\nCURL_EXTERN void curl_easy_cleanup(CURL *curl);\n\n/*\n * NAME curl_easy_getinfo()\n *\n * DESCRIPTION\n *\n * Request internal information from the curl session with this function.  The\n * third argument MUST be a pointer to a long, a pointer to a char * or a\n * pointer to a double (as the documentation describes elsewhere).  The data\n * pointed to will be filled in accordingly and can be relied upon only if the\n * function returns CURLE_OK.  This function is intended to get used *AFTER* a\n * performed transfer, all results from this function are undefined until the\n * transfer is completed.\n */\nCURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);\n\n\n/*\n * NAME curl_easy_duphandle()\n *\n * DESCRIPTION\n *\n * Creates a new curl session handle with the same options set for the handle\n * passed in. Duplicating a handle could only be a matter of cloning data and\n * options, internal state info and things like persistent connections cannot\n * be transferred. It is useful in multithreaded applications when you can run\n * curl_easy_duphandle() for each new thread to avoid a series of identical\n * curl_easy_setopt() invokes in every thread.\n */\nCURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);\n\n/*\n * NAME curl_easy_reset()\n *\n * DESCRIPTION\n *\n * Re-initializes a CURL handle to the default values. This puts back the\n * handle to the same state as it was in when it was just created.\n *\n * It does keep: live connections, the Session ID cache, the DNS cache and the\n * cookies.\n */\nCURL_EXTERN void curl_easy_reset(CURL *curl);\n\n/*\n * NAME curl_easy_recv()\n *\n * DESCRIPTION\n *\n * Receives data from the connected socket. Use after successful\n * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.\n */\nCURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,\n                                    size_t *n);\n\n/*\n * NAME curl_easy_send()\n *\n * DESCRIPTION\n *\n * Sends data over the connected socket. Use after successful\n * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.\n */\nCURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,\n                                    size_t buflen, size_t *n);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/curl/mprintf.h",
    "content": "#ifndef __CURL_MPRINTF_H\n#define __CURL_MPRINTF_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n#include <stdarg.h>\n#include <stdio.h> /* needed for FILE */\n\n#include \"curl.h\"\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\nCURL_EXTERN int curl_mprintf(const char *format, ...);\nCURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);\nCURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);\nCURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,\n                               const char *format, ...);\nCURL_EXTERN int curl_mvprintf(const char *format, va_list args);\nCURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);\nCURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);\nCURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,\n                                const char *format, va_list args);\nCURL_EXTERN char *curl_maprintf(const char *format, ...);\nCURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);\n\n#ifdef _MPRINTF_REPLACE\n# undef printf\n# undef fprintf\n# undef sprintf\n# undef vsprintf\n# undef snprintf\n# undef vprintf\n# undef vfprintf\n# undef vsnprintf\n# undef aprintf\n# undef vaprintf\n# define printf curl_mprintf\n# define fprintf curl_mfprintf\n#ifdef CURLDEBUG\n/* When built with CURLDEBUG we define away the sprintf functions since we\n   don't want internal code to be using them */\n# define sprintf sprintf_was_used\n# define vsprintf vsprintf_was_used\n#else\n# define sprintf curl_msprintf\n# define vsprintf curl_mvsprintf\n#endif\n# define snprintf curl_msnprintf\n# define vprintf curl_mvprintf\n# define vfprintf curl_mvfprintf\n# define vsnprintf curl_mvsnprintf\n# define aprintf curl_maprintf\n# define vaprintf curl_mvaprintf\n#endif\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif /* __CURL_MPRINTF_H */\n"
  },
  {
    "path": "third_party/include/curl/multi.h",
    "content": "#ifndef __CURL_MULTI_H\n#define __CURL_MULTI_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n/*\n  This is an \"external\" header file. Don't give away any internals here!\n\n  GOALS\n\n  o Enable a \"pull\" interface. The application that uses libcurl decides where\n    and when to ask libcurl to get/send data.\n\n  o Enable multiple simultaneous transfers in the same thread without making it\n    complicated for the application.\n\n  o Enable the application to select() on its own file descriptors and curl's\n    file descriptors simultaneous easily.\n\n*/\n\n/*\n * This header file should not really need to include \"curl.h\" since curl.h\n * itself includes this file and we expect user applications to do #include\n * <curl/curl.h> without the need for especially including multi.h.\n *\n * For some reason we added this include here at one point, and rather than to\n * break existing (wrongly written) libcurl applications, we leave it as-is\n * but with this warning attached.\n */\n#include \"curl.h\"\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef void CURLM;\n\ntypedef enum {\n  CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or\n                                    curl_multi_socket*() soon */\n  CURLM_OK,\n  CURLM_BAD_HANDLE,      /* the passed-in handle is not a valid CURLM handle */\n  CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */\n  CURLM_OUT_OF_MEMORY,   /* if you ever get this, you're in deep sh*t */\n  CURLM_INTERNAL_ERROR,  /* this is a libcurl bug */\n  CURLM_BAD_SOCKET,      /* the passed in socket argument did not match */\n  CURLM_UNKNOWN_OPTION,  /* curl_multi_setopt() with unsupported option */\n  CURLM_LAST\n} CURLMcode;\n\n/* just to make code nicer when using curl_multi_socket() you can now check\n   for CURLM_CALL_MULTI_SOCKET too in the same style it works for\n   curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */\n#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM\n\ntypedef enum {\n  CURLMSG_NONE, /* first, not used */\n  CURLMSG_DONE, /* This easy handle has completed. 'result' contains\n                   the CURLcode of the transfer */\n  CURLMSG_LAST /* last, not used */\n} CURLMSG;\n\nstruct CURLMsg {\n  CURLMSG msg;       /* what this message means */\n  CURL *easy_handle; /* the handle it concerns */\n  union {\n    void *whatever;    /* message-specific data */\n    CURLcode result;   /* return code for transfer */\n  } data;\n};\ntypedef struct CURLMsg CURLMsg;\n\n/* Based on poll(2) structure and values.\n * We don't use pollfd and POLL* constants explicitly\n * to cover platforms without poll(). */\n#define CURL_WAIT_POLLIN    0x0001\n#define CURL_WAIT_POLLPRI   0x0002\n#define CURL_WAIT_POLLOUT   0x0004\n\nstruct curl_waitfd {\n  curl_socket_t fd;\n  short events;\n  short revents; /* not supported yet */\n};\n\n/*\n * Name:    curl_multi_init()\n *\n * Desc:    inititalize multi-style curl usage\n *\n * Returns: a new CURLM handle to use in all 'curl_multi' functions.\n */\nCURL_EXTERN CURLM *curl_multi_init(void);\n\n/*\n * Name:    curl_multi_add_handle()\n *\n * Desc:    add a standard curl handle to the multi stack\n *\n * Returns: CURLMcode type, general multi error code.\n */\nCURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,\n                                            CURL *curl_handle);\n\n /*\n  * Name:    curl_multi_remove_handle()\n  *\n  * Desc:    removes a curl handle from the multi stack again\n  *\n  * Returns: CURLMcode type, general multi error code.\n  */\nCURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,\n                                               CURL *curl_handle);\n\n /*\n  * Name:    curl_multi_fdset()\n  *\n  * Desc:    Ask curl for its fd_set sets. The app can use these to select() or\n  *          poll() on. We want curl_multi_perform() called as soon as one of\n  *          them are ready.\n  *\n  * Returns: CURLMcode type, general multi error code.\n  */\nCURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,\n                                       fd_set *read_fd_set,\n                                       fd_set *write_fd_set,\n                                       fd_set *exc_fd_set,\n                                       int *max_fd);\n\n/*\n * Name:     curl_multi_wait()\n *\n * Desc:     Poll on all fds within a CURLM set as well as any\n *           additional fds passed to the function.\n *\n * Returns:  CURLMcode type, general multi error code.\n */\nCURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle,\n                                      struct curl_waitfd extra_fds[],\n                                      unsigned int extra_nfds,\n                                      int timeout_ms,\n                                      int *ret);\n\n /*\n  * Name:    curl_multi_perform()\n  *\n  * Desc:    When the app thinks there's data available for curl it calls this\n  *          function to read/write whatever there is right now. This returns\n  *          as soon as the reads and writes are done. This function does not\n  *          require that there actually is data available for reading or that\n  *          data can be written, it can be called just in case. It returns\n  *          the number of handles that still transfer data in the second\n  *          argument's integer-pointer.\n  *\n  * Returns: CURLMcode type, general multi error code. *NOTE* that this only\n  *          returns errors etc regarding the whole multi stack. There might\n  *          still have occurred problems on invidual transfers even when this\n  *          returns OK.\n  */\nCURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,\n                                         int *running_handles);\n\n /*\n  * Name:    curl_multi_cleanup()\n  *\n  * Desc:    Cleans up and removes a whole multi stack. It does not free or\n  *          touch any individual easy handles in any way. We need to define\n  *          in what state those handles will be if this function is called\n  *          in the middle of a transfer.\n  *\n  * Returns: CURLMcode type, general multi error code.\n  */\nCURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);\n\n/*\n * Name:    curl_multi_info_read()\n *\n * Desc:    Ask the multi handle if there's any messages/informationals from\n *          the individual transfers. Messages include informationals such as\n *          error code from the transfer or just the fact that a transfer is\n *          completed. More details on these should be written down as well.\n *\n *          Repeated calls to this function will return a new struct each\n *          time, until a special \"end of msgs\" struct is returned as a signal\n *          that there is no more to get at this point.\n *\n *          The data the returned pointer points to will not survive calling\n *          curl_multi_cleanup().\n *\n *          The 'CURLMsg' struct is meant to be very simple and only contain\n *          very basic informations. If more involved information is wanted,\n *          we will provide the particular \"transfer handle\" in that struct\n *          and that should/could/would be used in subsequent\n *          curl_easy_getinfo() calls (or similar). The point being that we\n *          must never expose complex structs to applications, as then we'll\n *          undoubtably get backwards compatibility problems in the future.\n *\n * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out\n *          of structs. It also writes the number of messages left in the\n *          queue (after this read) in the integer the second argument points\n *          to.\n */\nCURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,\n                                          int *msgs_in_queue);\n\n/*\n * Name:    curl_multi_strerror()\n *\n * Desc:    The curl_multi_strerror function may be used to turn a CURLMcode\n *          value into the equivalent human readable error string.  This is\n *          useful for printing meaningful error messages.\n *\n * Returns: A pointer to a zero-terminated error message.\n */\nCURL_EXTERN const char *curl_multi_strerror(CURLMcode);\n\n/*\n * Name:    curl_multi_socket() and\n *          curl_multi_socket_all()\n *\n * Desc:    An alternative version of curl_multi_perform() that allows the\n *          application to pass in one of the file descriptors that have been\n *          detected to have \"action\" on them and let libcurl perform.\n *          See man page for details.\n */\n#define CURL_POLL_NONE   0\n#define CURL_POLL_IN     1\n#define CURL_POLL_OUT    2\n#define CURL_POLL_INOUT  3\n#define CURL_POLL_REMOVE 4\n\n#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD\n\n#define CURL_CSELECT_IN   0x01\n#define CURL_CSELECT_OUT  0x02\n#define CURL_CSELECT_ERR  0x04\n\ntypedef int (*curl_socket_callback)(CURL *easy,      /* easy handle */\n                                    curl_socket_t s, /* socket */\n                                    int what,        /* see above */\n                                    void *userp,     /* private callback\n                                                        pointer */\n                                    void *socketp);  /* private socket\n                                                        pointer */\n/*\n * Name:    curl_multi_timer_callback\n *\n * Desc:    Called by libcurl whenever the library detects a change in the\n *          maximum number of milliseconds the app is allowed to wait before\n *          curl_multi_socket() or curl_multi_perform() must be called\n *          (to allow libcurl's timed events to take place).\n *\n * Returns: The callback should return zero.\n */\ntypedef int (*curl_multi_timer_callback)(CURLM *multi,    /* multi handle */\n                                         long timeout_ms, /* see above */\n                                         void *userp);    /* private callback\n                                                             pointer */\n\nCURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,\n                                        int *running_handles);\n\nCURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,\n                                               curl_socket_t s,\n                                               int ev_bitmask,\n                                               int *running_handles);\n\nCURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,\n                                            int *running_handles);\n\n#ifndef CURL_ALLOW_OLD_MULTI_SOCKET\n/* This macro below was added in 7.16.3 to push users who recompile to use\n   the new curl_multi_socket_action() instead of the old curl_multi_socket()\n*/\n#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)\n#endif\n\n/*\n * Name:    curl_multi_timeout()\n *\n * Desc:    Returns the maximum number of milliseconds the app is allowed to\n *          wait before curl_multi_socket() or curl_multi_perform() must be\n *          called (to allow libcurl's timed events to take place).\n *\n * Returns: CURLM error code.\n */\nCURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,\n                                         long *milliseconds);\n\n#undef CINIT /* re-using the same name as in curl.h */\n\n#ifdef CURL_ISOCPP\n#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num\n#else\n/* The macro \"##\" is ISO C, we assume pre-ISO C doesn't support it. */\n#define LONG          CURLOPTTYPE_LONG\n#define OBJECTPOINT   CURLOPTTYPE_OBJECTPOINT\n#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT\n#define OFF_T         CURLOPTTYPE_OFF_T\n#define CINIT(name,type,number) CURLMOPT_/**/name = type + number\n#endif\n\ntypedef enum {\n  /* This is the socket callback function pointer */\n  CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),\n\n  /* This is the argument passed to the socket callback */\n  CINIT(SOCKETDATA, OBJECTPOINT, 2),\n\n    /* set to 1 to enable pipelining for this multi handle */\n  CINIT(PIPELINING, LONG, 3),\n\n   /* This is the timer callback function pointer */\n  CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),\n\n  /* This is the argument passed to the timer callback */\n  CINIT(TIMERDATA, OBJECTPOINT, 5),\n\n  /* maximum number of entries in the connection cache */\n  CINIT(MAXCONNECTS, LONG, 6),\n\n  /* maximum number of (pipelining) connections to one host */\n  CINIT(MAX_HOST_CONNECTIONS, LONG, 7),\n\n  /* maximum number of requests in a pipeline */\n  CINIT(MAX_PIPELINE_LENGTH, LONG, 8),\n\n  /* a connection with a content-length longer than this\n     will not be considered for pipelining */\n  CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9),\n\n  /* a connection with a chunk length longer than this\n     will not be considered for pipelining */\n  CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10),\n\n  /* a list of site names(+port) that are blacklisted from\n     pipelining */\n  CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11),\n\n  /* a list of server types that are blacklisted from\n     pipelining */\n  CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12),\n\n  /* maximum number of open connections in total */\n  CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13),\n\n  CURLMOPT_LASTENTRY /* the last unused */\n} CURLMoption;\n\n\n/*\n * Name:    curl_multi_setopt()\n *\n * Desc:    Sets options for the multi handle.\n *\n * Returns: CURLM error code.\n */\nCURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,\n                                        CURLMoption option, ...);\n\n\n/*\n * Name:    curl_multi_assign()\n *\n * Desc:    This function sets an association in the multi handle between the\n *          given socket and a private pointer of the application. This is\n *          (only) useful for curl_multi_socket uses.\n *\n * Returns: CURLM error code.\n */\nCURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,\n                                        curl_socket_t sockfd, void *sockp);\n\n#ifdef __cplusplus\n} /* end of extern \"C\" */\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/curl/stdcheaders.h",
    "content": "#ifndef __STDC_HEADERS_H\n#define __STDC_HEADERS_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n#include <sys/types.h>\n\nsize_t fread (void *, size_t, size_t, FILE *);\nsize_t fwrite (const void *, size_t, size_t, FILE *);\n\nint strcasecmp(const char *, const char *);\nint strncasecmp(const char *, const char *, size_t);\n\n#endif /* __STDC_HEADERS_H */\n"
  },
  {
    "path": "third_party/include/curl/typecheck-gcc.h",
    "content": "#ifndef __CURL_TYPECHECK_GCC_H\n#define __CURL_TYPECHECK_GCC_H\n/***************************************************************************\n *                                  _   _ ____  _\n *  Project                     ___| | | |  _ \\| |\n *                             / __| | | | |_) | |\n *                            | (__| |_| |  _ <| |___\n *                             \\___|\\___/|_| \\_\\_____|\n *\n * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.\n *\n * This software is licensed as described in the file COPYING, which\n * you should have received as part of this distribution. The terms\n * are also available at http://curl.haxx.se/docs/copyright.html.\n *\n * You may opt to use, copy, modify, merge, publish, distribute and/or sell\n * copies of the Software, and permit persons to whom the Software is\n * furnished to do so, under the terms of the COPYING file.\n *\n * This software is distributed on an \"AS IS\" basis, WITHOUT WARRANTY OF ANY\n * KIND, either express or implied.\n *\n ***************************************************************************/\n\n/* wraps curl_easy_setopt() with typechecking */\n\n/* To add a new kind of warning, add an\n *   if(_curl_is_sometype_option(_curl_opt))\n *     if(!_curl_is_sometype(value))\n *       _curl_easy_setopt_err_sometype();\n * block and define _curl_is_sometype_option, _curl_is_sometype and\n * _curl_easy_setopt_err_sometype below\n *\n * NOTE: We use two nested 'if' statements here instead of the && operator, in\n *       order to work around gcc bug #32061.  It affects only gcc 4.3.x/4.4.x\n *       when compiling with -Wlogical-op.\n *\n * To add an option that uses the same type as an existing option, you'll just\n * need to extend the appropriate _curl_*_option macro\n */\n#define curl_easy_setopt(handle, option, value)                               \\\n__extension__ ({                                                              \\\n  __typeof__ (option) _curl_opt = option;                                     \\\n  if(__builtin_constant_p(_curl_opt)) {                                       \\\n    if(_curl_is_long_option(_curl_opt))                                       \\\n      if(!_curl_is_long(value))                                               \\\n        _curl_easy_setopt_err_long();                                         \\\n    if(_curl_is_off_t_option(_curl_opt))                                      \\\n      if(!_curl_is_off_t(value))                                              \\\n        _curl_easy_setopt_err_curl_off_t();                                   \\\n    if(_curl_is_string_option(_curl_opt))                                     \\\n      if(!_curl_is_string(value))                                             \\\n        _curl_easy_setopt_err_string();                                       \\\n    if(_curl_is_write_cb_option(_curl_opt))                                   \\\n      if(!_curl_is_write_cb(value))                                           \\\n        _curl_easy_setopt_err_write_callback();                               \\\n    if((_curl_opt) == CURLOPT_READFUNCTION)                                   \\\n      if(!_curl_is_read_cb(value))                                            \\\n        _curl_easy_setopt_err_read_cb();                                      \\\n    if((_curl_opt) == CURLOPT_IOCTLFUNCTION)                                  \\\n      if(!_curl_is_ioctl_cb(value))                                           \\\n        _curl_easy_setopt_err_ioctl_cb();                                     \\\n    if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION)                                \\\n      if(!_curl_is_sockopt_cb(value))                                         \\\n        _curl_easy_setopt_err_sockopt_cb();                                   \\\n    if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION)                             \\\n      if(!_curl_is_opensocket_cb(value))                                      \\\n        _curl_easy_setopt_err_opensocket_cb();                                \\\n    if((_curl_opt) == CURLOPT_PROGRESSFUNCTION)                               \\\n      if(!_curl_is_progress_cb(value))                                        \\\n        _curl_easy_setopt_err_progress_cb();                                  \\\n    if((_curl_opt) == CURLOPT_DEBUGFUNCTION)                                  \\\n      if(!_curl_is_debug_cb(value))                                           \\\n        _curl_easy_setopt_err_debug_cb();                                     \\\n    if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION)                               \\\n      if(!_curl_is_ssl_ctx_cb(value))                                         \\\n        _curl_easy_setopt_err_ssl_ctx_cb();                                   \\\n    if(_curl_is_conv_cb_option(_curl_opt))                                    \\\n      if(!_curl_is_conv_cb(value))                                            \\\n        _curl_easy_setopt_err_conv_cb();                                      \\\n    if((_curl_opt) == CURLOPT_SEEKFUNCTION)                                   \\\n      if(!_curl_is_seek_cb(value))                                            \\\n        _curl_easy_setopt_err_seek_cb();                                      \\\n    if(_curl_is_cb_data_option(_curl_opt))                                    \\\n      if(!_curl_is_cb_data(value))                                            \\\n        _curl_easy_setopt_err_cb_data();                                      \\\n    if((_curl_opt) == CURLOPT_ERRORBUFFER)                                    \\\n      if(!_curl_is_error_buffer(value))                                       \\\n        _curl_easy_setopt_err_error_buffer();                                 \\\n    if((_curl_opt) == CURLOPT_STDERR)                                         \\\n      if(!_curl_is_FILE(value))                                               \\\n        _curl_easy_setopt_err_FILE();                                         \\\n    if(_curl_is_postfields_option(_curl_opt))                                 \\\n      if(!_curl_is_postfields(value))                                         \\\n        _curl_easy_setopt_err_postfields();                                   \\\n    if((_curl_opt) == CURLOPT_HTTPPOST)                                       \\\n      if(!_curl_is_arr((value), struct curl_httppost))                        \\\n        _curl_easy_setopt_err_curl_httpost();                                 \\\n    if(_curl_is_slist_option(_curl_opt))                                      \\\n      if(!_curl_is_arr((value), struct curl_slist))                           \\\n        _curl_easy_setopt_err_curl_slist();                                   \\\n    if((_curl_opt) == CURLOPT_SHARE)                                          \\\n      if(!_curl_is_ptr((value), CURLSH))                                      \\\n        _curl_easy_setopt_err_CURLSH();                                       \\\n  }                                                                           \\\n  curl_easy_setopt(handle, _curl_opt, value);                                 \\\n})\n\n/* wraps curl_easy_getinfo() with typechecking */\n/* FIXME: don't allow const pointers */\n#define curl_easy_getinfo(handle, info, arg)                                  \\\n__extension__ ({                                                              \\\n  __typeof__ (info) _curl_info = info;                                        \\\n  if(__builtin_constant_p(_curl_info)) {                                      \\\n    if(_curl_is_string_info(_curl_info))                                      \\\n      if(!_curl_is_arr((arg), char *))                                        \\\n        _curl_easy_getinfo_err_string();                                      \\\n    if(_curl_is_long_info(_curl_info))                                        \\\n      if(!_curl_is_arr((arg), long))                                          \\\n        _curl_easy_getinfo_err_long();                                        \\\n    if(_curl_is_double_info(_curl_info))                                      \\\n      if(!_curl_is_arr((arg), double))                                        \\\n        _curl_easy_getinfo_err_double();                                      \\\n    if(_curl_is_slist_info(_curl_info))                                       \\\n      if(!_curl_is_arr((arg), struct curl_slist *))                           \\\n        _curl_easy_getinfo_err_curl_slist();                                  \\\n  }                                                                           \\\n  curl_easy_getinfo(handle, _curl_info, arg);                                 \\\n})\n\n/* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(),\n * for now just make sure that the functions are called with three\n * arguments\n */\n#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)\n#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)\n\n\n/* the actual warnings, triggered by calling the _curl_easy_setopt_err*\n * functions */\n\n/* To define a new warning, use _CURL_WARNING(identifier, \"message\") */\n#define _CURL_WARNING(id, message)                                            \\\n  static void __attribute__((__warning__(message)))                           \\\n  __attribute__((__unused__)) __attribute__((__noinline__))                   \\\n  id(void) { __asm__(\"\"); }\n\n_CURL_WARNING(_curl_easy_setopt_err_long,\n  \"curl_easy_setopt expects a long argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,\n  \"curl_easy_setopt expects a curl_off_t argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_string,\n              \"curl_easy_setopt expects a \"\n              \"string (char* or char[]) argument for this option\"\n  )\n_CURL_WARNING(_curl_easy_setopt_err_write_callback,\n  \"curl_easy_setopt expects a curl_write_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_read_cb,\n  \"curl_easy_setopt expects a curl_read_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,\n  \"curl_easy_setopt expects a curl_ioctl_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,\n  \"curl_easy_setopt expects a curl_sockopt_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,\n              \"curl_easy_setopt expects a \"\n              \"curl_opensocket_callback argument for this option\"\n  )\n_CURL_WARNING(_curl_easy_setopt_err_progress_cb,\n  \"curl_easy_setopt expects a curl_progress_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_debug_cb,\n  \"curl_easy_setopt expects a curl_debug_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,\n  \"curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_conv_cb,\n  \"curl_easy_setopt expects a curl_conv_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_seek_cb,\n  \"curl_easy_setopt expects a curl_seek_callback argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_cb_data,\n              \"curl_easy_setopt expects a \"\n              \"private data pointer as argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_error_buffer,\n              \"curl_easy_setopt expects a \"\n              \"char buffer of CURL_ERROR_SIZE as argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_FILE,\n  \"curl_easy_setopt expects a FILE* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_postfields,\n  \"curl_easy_setopt expects a void* or char* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,\n  \"curl_easy_setopt expects a struct curl_httppost* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_curl_slist,\n  \"curl_easy_setopt expects a struct curl_slist* argument for this option\")\n_CURL_WARNING(_curl_easy_setopt_err_CURLSH,\n  \"curl_easy_setopt expects a CURLSH* argument for this option\")\n\n_CURL_WARNING(_curl_easy_getinfo_err_string,\n  \"curl_easy_getinfo expects a pointer to char * for this info\")\n_CURL_WARNING(_curl_easy_getinfo_err_long,\n  \"curl_easy_getinfo expects a pointer to long for this info\")\n_CURL_WARNING(_curl_easy_getinfo_err_double,\n  \"curl_easy_getinfo expects a pointer to double for this info\")\n_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,\n  \"curl_easy_getinfo expects a pointer to struct curl_slist * for this info\")\n\n/* groups of curl_easy_setops options that take the same type of argument */\n\n/* To add a new option to one of the groups, just add\n *   (option) == CURLOPT_SOMETHING\n * to the or-expression. If the option takes a long or curl_off_t, you don't\n * have to do anything\n */\n\n/* evaluates to true if option takes a long argument */\n#define _curl_is_long_option(option)                                          \\\n  (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)\n\n#define _curl_is_off_t_option(option)                                         \\\n  ((option) > CURLOPTTYPE_OFF_T)\n\n/* evaluates to true if option takes a char* argument */\n#define _curl_is_string_option(option)                                        \\\n  ((option) == CURLOPT_URL ||                                                 \\\n   (option) == CURLOPT_PROXY ||                                               \\\n   (option) == CURLOPT_INTERFACE ||                                           \\\n   (option) == CURLOPT_NETRC_FILE ||                                          \\\n   (option) == CURLOPT_USERPWD ||                                             \\\n   (option) == CURLOPT_USERNAME ||                                            \\\n   (option) == CURLOPT_PASSWORD ||                                            \\\n   (option) == CURLOPT_PROXYUSERPWD ||                                        \\\n   (option) == CURLOPT_PROXYUSERNAME ||                                       \\\n   (option) == CURLOPT_PROXYPASSWORD ||                                       \\\n   (option) == CURLOPT_NOPROXY ||                                             \\\n   (option) == CURLOPT_ACCEPT_ENCODING ||                                     \\\n   (option) == CURLOPT_REFERER ||                                             \\\n   (option) == CURLOPT_USERAGENT ||                                           \\\n   (option) == CURLOPT_COOKIE ||                                              \\\n   (option) == CURLOPT_COOKIEFILE ||                                          \\\n   (option) == CURLOPT_COOKIEJAR ||                                           \\\n   (option) == CURLOPT_COOKIELIST ||                                          \\\n   (option) == CURLOPT_FTPPORT ||                                             \\\n   (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER ||                             \\\n   (option) == CURLOPT_FTP_ACCOUNT ||                                         \\\n   (option) == CURLOPT_RANGE ||                                               \\\n   (option) == CURLOPT_CUSTOMREQUEST ||                                       \\\n   (option) == CURLOPT_SSLCERT ||                                             \\\n   (option) == CURLOPT_SSLCERTTYPE ||                                         \\\n   (option) == CURLOPT_SSLKEY ||                                              \\\n   (option) == CURLOPT_SSLKEYTYPE ||                                          \\\n   (option) == CURLOPT_KEYPASSWD ||                                           \\\n   (option) == CURLOPT_SSLENGINE ||                                           \\\n   (option) == CURLOPT_CAINFO ||                                              \\\n   (option) == CURLOPT_CAPATH ||                                              \\\n   (option) == CURLOPT_RANDOM_FILE ||                                         \\\n   (option) == CURLOPT_EGDSOCKET ||                                           \\\n   (option) == CURLOPT_SSL_CIPHER_LIST ||                                     \\\n   (option) == CURLOPT_KRBLEVEL ||                                            \\\n   (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 ||                             \\\n   (option) == CURLOPT_SSH_PUBLIC_KEYFILE ||                                  \\\n   (option) == CURLOPT_SSH_PRIVATE_KEYFILE ||                                 \\\n   (option) == CURLOPT_CRLFILE ||                                             \\\n   (option) == CURLOPT_ISSUERCERT ||                                          \\\n   (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE ||                               \\\n   (option) == CURLOPT_SSH_KNOWNHOSTS ||                                      \\\n   (option) == CURLOPT_MAIL_FROM ||                                           \\\n   (option) == CURLOPT_RTSP_SESSION_ID ||                                     \\\n   (option) == CURLOPT_RTSP_STREAM_URI ||                                     \\\n   (option) == CURLOPT_RTSP_TRANSPORT ||                                      \\\n   0)\n\n/* evaluates to true if option takes a curl_write_callback argument */\n#define _curl_is_write_cb_option(option)                                      \\\n  ((option) == CURLOPT_HEADERFUNCTION ||                                      \\\n   (option) == CURLOPT_WRITEFUNCTION)\n\n/* evaluates to true if option takes a curl_conv_callback argument */\n#define _curl_is_conv_cb_option(option)                                       \\\n  ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION ||                            \\\n   (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION ||                          \\\n   (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)\n\n/* evaluates to true if option takes a data argument to pass to a callback */\n#define _curl_is_cb_data_option(option)                                       \\\n  ((option) == CURLOPT_WRITEDATA ||                                           \\\n   (option) == CURLOPT_READDATA ||                                            \\\n   (option) == CURLOPT_IOCTLDATA ||                                           \\\n   (option) == CURLOPT_SOCKOPTDATA ||                                         \\\n   (option) == CURLOPT_OPENSOCKETDATA ||                                      \\\n   (option) == CURLOPT_PROGRESSDATA ||                                        \\\n   (option) == CURLOPT_WRITEHEADER ||                                         \\\n   (option) == CURLOPT_DEBUGDATA ||                                           \\\n   (option) == CURLOPT_SSL_CTX_DATA ||                                        \\\n   (option) == CURLOPT_SEEKDATA ||                                            \\\n   (option) == CURLOPT_PRIVATE ||                                             \\\n   (option) == CURLOPT_SSH_KEYDATA ||                                         \\\n   (option) == CURLOPT_INTERLEAVEDATA ||                                      \\\n   (option) == CURLOPT_CHUNK_DATA ||                                          \\\n   (option) == CURLOPT_FNMATCH_DATA ||                                        \\\n   0)\n\n/* evaluates to true if option takes a POST data argument (void* or char*) */\n#define _curl_is_postfields_option(option)                                    \\\n  ((option) == CURLOPT_POSTFIELDS ||                                          \\\n   (option) == CURLOPT_COPYPOSTFIELDS ||                                      \\\n   0)\n\n/* evaluates to true if option takes a struct curl_slist * argument */\n#define _curl_is_slist_option(option)                                         \\\n  ((option) == CURLOPT_HTTPHEADER ||                                          \\\n   (option) == CURLOPT_HTTP200ALIASES ||                                      \\\n   (option) == CURLOPT_QUOTE ||                                               \\\n   (option) == CURLOPT_POSTQUOTE ||                                           \\\n   (option) == CURLOPT_PREQUOTE ||                                            \\\n   (option) == CURLOPT_TELNETOPTIONS ||                                       \\\n   (option) == CURLOPT_MAIL_RCPT ||                                           \\\n   0)\n\n/* groups of curl_easy_getinfo infos that take the same type of argument */\n\n/* evaluates to true if info expects a pointer to char * argument */\n#define _curl_is_string_info(info)                                            \\\n  (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)\n\n/* evaluates to true if info expects a pointer to long argument */\n#define _curl_is_long_info(info)                                              \\\n  (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)\n\n/* evaluates to true if info expects a pointer to double argument */\n#define _curl_is_double_info(info)                                            \\\n  (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)\n\n/* true if info expects a pointer to struct curl_slist * argument */\n#define _curl_is_slist_info(info)                                             \\\n  (CURLINFO_SLIST < (info))\n\n\n/* typecheck helpers -- check whether given expression has requested type*/\n\n/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,\n * otherwise define a new macro. Search for __builtin_types_compatible_p\n * in the GCC manual.\n * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is\n * the actual expression passed to the curl_easy_setopt macro. This\n * means that you can only apply the sizeof and __typeof__ operators, no\n * == or whatsoever.\n */\n\n/* XXX: should evaluate to true iff expr is a pointer */\n#define _curl_is_any_ptr(expr)                                                \\\n  (sizeof(expr) == sizeof(void*))\n\n/* evaluates to true if expr is NULL */\n/* XXX: must not evaluate expr, so this check is not accurate */\n#define _curl_is_NULL(expr)                                                   \\\n  (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))\n\n/* evaluates to true if expr is type*, const type* or NULL */\n#define _curl_is_ptr(expr, type)                                              \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), type *) ||                  \\\n   __builtin_types_compatible_p(__typeof__(expr), const type *))\n\n/* evaluates to true if expr is one of type[], type*, NULL or const type* */\n#define _curl_is_arr(expr, type)                                              \\\n  (_curl_is_ptr((expr), type) ||                                              \\\n   __builtin_types_compatible_p(__typeof__(expr), type []))\n\n/* evaluates to true if expr is a string */\n#define _curl_is_string(expr)                                                 \\\n  (_curl_is_arr((expr), char) ||                                              \\\n   _curl_is_arr((expr), signed char) ||                                       \\\n   _curl_is_arr((expr), unsigned char))\n\n/* evaluates to true if expr is a long (no matter the signedness)\n * XXX: for now, int is also accepted (and therefore short and char, which\n * are promoted to int when passed to a variadic function) */\n#define _curl_is_long(expr)                                                   \\\n  (__builtin_types_compatible_p(__typeof__(expr), long) ||                    \\\n   __builtin_types_compatible_p(__typeof__(expr), signed long) ||             \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned long) ||           \\\n   __builtin_types_compatible_p(__typeof__(expr), int) ||                     \\\n   __builtin_types_compatible_p(__typeof__(expr), signed int) ||              \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned int) ||            \\\n   __builtin_types_compatible_p(__typeof__(expr), short) ||                   \\\n   __builtin_types_compatible_p(__typeof__(expr), signed short) ||            \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned short) ||          \\\n   __builtin_types_compatible_p(__typeof__(expr), char) ||                    \\\n   __builtin_types_compatible_p(__typeof__(expr), signed char) ||             \\\n   __builtin_types_compatible_p(__typeof__(expr), unsigned char))\n\n/* evaluates to true if expr is of type curl_off_t */\n#define _curl_is_off_t(expr)                                                  \\\n  (__builtin_types_compatible_p(__typeof__(expr), curl_off_t))\n\n/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */\n/* XXX: also check size of an char[] array? */\n#define _curl_is_error_buffer(expr)                                           \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), char *) ||                  \\\n   __builtin_types_compatible_p(__typeof__(expr), char[]))\n\n/* evaluates to true if expr is of type (const) void* or (const) FILE* */\n#if 0\n#define _curl_is_cb_data(expr)                                                \\\n  (_curl_is_ptr((expr), void) ||                                              \\\n   _curl_is_ptr((expr), FILE))\n#else /* be less strict */\n#define _curl_is_cb_data(expr)                                                \\\n  _curl_is_any_ptr(expr)\n#endif\n\n/* evaluates to true if expr is of type FILE* */\n#define _curl_is_FILE(expr)                                                   \\\n  (__builtin_types_compatible_p(__typeof__(expr), FILE *))\n\n/* evaluates to true if expr can be passed as POST data (void* or char*) */\n#define _curl_is_postfields(expr)                                             \\\n  (_curl_is_ptr((expr), void) ||                                              \\\n   _curl_is_arr((expr), char))\n\n/* FIXME: the whole callback checking is messy...\n * The idea is to tolerate char vs. void and const vs. not const\n * pointers in arguments at least\n */\n/* helper: __builtin_types_compatible_p distinguishes between functions and\n * function pointers, hide it */\n#define _curl_callback_compatible(func, type)                                 \\\n  (__builtin_types_compatible_p(__typeof__(func), type) ||                    \\\n   __builtin_types_compatible_p(__typeof__(func), type*))\n\n/* evaluates to true if expr is of type curl_read_callback or \"similar\" */\n#define _curl_is_read_cb(expr)                                          \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) ||       \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_read_callback) ||      \\\n   _curl_callback_compatible((expr), _curl_read_callback1) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback2) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback3) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback4) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback5) ||                 \\\n   _curl_callback_compatible((expr), _curl_read_callback6))\ntypedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*);\ntypedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*);\ntypedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*);\ntypedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*);\ntypedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*);\ntypedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*);\n\n/* evaluates to true if expr is of type curl_write_callback or \"similar\" */\n#define _curl_is_write_cb(expr)                                               \\\n  (_curl_is_read_cb(expr) ||                                            \\\n   __builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) ||      \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_write_callback) ||     \\\n   _curl_callback_compatible((expr), _curl_write_callback1) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback2) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback3) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback4) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback5) ||                \\\n   _curl_callback_compatible((expr), _curl_write_callback6))\ntypedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*);\ntypedef size_t (_curl_write_callback2)(const char *, size_t, size_t,\n                                       const void*);\ntypedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*);\ntypedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*);\ntypedef size_t (_curl_write_callback5)(const void *, size_t, size_t,\n                                       const void*);\ntypedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*);\n\n/* evaluates to true if expr is of type curl_ioctl_callback or \"similar\" */\n#define _curl_is_ioctl_cb(expr)                                         \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) ||     \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback1) ||                \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback2) ||                \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback3) ||                \\\n   _curl_callback_compatible((expr), _curl_ioctl_callback4))\ntypedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*);\ntypedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*);\ntypedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*);\ntypedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*);\n\n/* evaluates to true if expr is of type curl_sockopt_callback or \"similar\" */\n#define _curl_is_sockopt_cb(expr)                                       \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) ||   \\\n   _curl_callback_compatible((expr), _curl_sockopt_callback1) ||              \\\n   _curl_callback_compatible((expr), _curl_sockopt_callback2))\ntypedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);\ntypedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,\n                                      curlsocktype);\n\n/* evaluates to true if expr is of type curl_opensocket_callback or\n   \"similar\" */\n#define _curl_is_opensocket_cb(expr)                                    \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\\\n   _curl_callback_compatible((expr), _curl_opensocket_callback1) ||           \\\n   _curl_callback_compatible((expr), _curl_opensocket_callback2) ||           \\\n   _curl_callback_compatible((expr), _curl_opensocket_callback3) ||           \\\n   _curl_callback_compatible((expr), _curl_opensocket_callback4))\ntypedef curl_socket_t (_curl_opensocket_callback1)\n  (void *, curlsocktype, struct curl_sockaddr *);\ntypedef curl_socket_t (_curl_opensocket_callback2)\n  (void *, curlsocktype, const struct curl_sockaddr *);\ntypedef curl_socket_t (_curl_opensocket_callback3)\n  (const void *, curlsocktype, struct curl_sockaddr *);\ntypedef curl_socket_t (_curl_opensocket_callback4)\n  (const void *, curlsocktype, const struct curl_sockaddr *);\n\n/* evaluates to true if expr is of type curl_progress_callback or \"similar\" */\n#define _curl_is_progress_cb(expr)                                      \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) ||  \\\n   _curl_callback_compatible((expr), _curl_progress_callback1) ||             \\\n   _curl_callback_compatible((expr), _curl_progress_callback2))\ntypedef int (_curl_progress_callback1)(void *,\n    double, double, double, double);\ntypedef int (_curl_progress_callback2)(const void *,\n    double, double, double, double);\n\n/* evaluates to true if expr is of type curl_debug_callback or \"similar\" */\n#define _curl_is_debug_cb(expr)                                         \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) ||     \\\n   _curl_callback_compatible((expr), _curl_debug_callback1) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback2) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback3) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback4) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback5) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback6) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback7) ||                \\\n   _curl_callback_compatible((expr), _curl_debug_callback8))\ntypedef int (_curl_debug_callback1) (CURL *,\n    curl_infotype, char *, size_t, void *);\ntypedef int (_curl_debug_callback2) (CURL *,\n    curl_infotype, char *, size_t, const void *);\ntypedef int (_curl_debug_callback3) (CURL *,\n    curl_infotype, const char *, size_t, void *);\ntypedef int (_curl_debug_callback4) (CURL *,\n    curl_infotype, const char *, size_t, const void *);\ntypedef int (_curl_debug_callback5) (CURL *,\n    curl_infotype, unsigned char *, size_t, void *);\ntypedef int (_curl_debug_callback6) (CURL *,\n    curl_infotype, unsigned char *, size_t, const void *);\ntypedef int (_curl_debug_callback7) (CURL *,\n    curl_infotype, const unsigned char *, size_t, void *);\ntypedef int (_curl_debug_callback8) (CURL *,\n    curl_infotype, const unsigned char *, size_t, const void *);\n\n/* evaluates to true if expr is of type curl_ssl_ctx_callback or \"similar\" */\n/* this is getting even messier... */\n#define _curl_is_ssl_ctx_cb(expr)                                       \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) ||   \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) ||              \\\n   _curl_callback_compatible((expr), _curl_ssl_ctx_callback8))\ntypedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *);\ntypedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);\n#ifdef HEADER_SSL_H\n/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX\n * this will of course break if we're included before OpenSSL headers...\n */\ntypedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);\ntypedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);\ntypedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,\n                                           const void *);\n#else\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;\ntypedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;\n#endif\n\n/* evaluates to true if expr is of type curl_conv_callback or \"similar\" */\n#define _curl_is_conv_cb(expr)                                          \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) ||      \\\n   _curl_callback_compatible((expr), _curl_conv_callback1) ||                 \\\n   _curl_callback_compatible((expr), _curl_conv_callback2) ||                 \\\n   _curl_callback_compatible((expr), _curl_conv_callback3) ||                 \\\n   _curl_callback_compatible((expr), _curl_conv_callback4))\ntypedef CURLcode (*_curl_conv_callback1)(char *, size_t length);\ntypedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);\ntypedef CURLcode (*_curl_conv_callback3)(void *, size_t length);\ntypedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);\n\n/* evaluates to true if expr is of type curl_seek_callback or \"similar\" */\n#define _curl_is_seek_cb(expr)                                          \\\n  (_curl_is_NULL(expr) ||                                                     \\\n   __builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) ||      \\\n   _curl_callback_compatible((expr), _curl_seek_callback1) ||                 \\\n   _curl_callback_compatible((expr), _curl_seek_callback2))\ntypedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);\ntypedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);\n\n\n#endif /* __CURL_TYPECHECK_GCC_H */\n"
  },
  {
    "path": "third_party/include/openssl/aes.h",
    "content": "/* crypto/aes/aes.h */\n/* ====================================================================\n * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n */\n\n#ifndef HEADER_AES_H\n# define HEADER_AES_H\n\n# include <openssl/opensslconf.h>\n\n# ifdef OPENSSL_NO_AES\n#  error AES is disabled.\n# endif\n\n# include <stddef.h>\n\n# define AES_ENCRYPT     1\n# define AES_DECRYPT     0\n\n/*\n * Because array size can't be a const in C, the following two are macros.\n * Both sizes are in bytes.\n */\n# define AES_MAXNR 14\n# define AES_BLOCK_SIZE 16\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* This should be a hidden type, but EVP requires that the size be known */\nstruct aes_key_st {\n# ifdef AES_LONG\n    unsigned long rd_key[4 * (AES_MAXNR + 1)];\n# else\n    unsigned int rd_key[4 * (AES_MAXNR + 1)];\n# endif\n    int rounds;\n};\ntypedef struct aes_key_st AES_KEY;\n\nconst char *AES_options(void);\n\nint AES_set_encrypt_key(const unsigned char *userKey, const int bits,\n                        AES_KEY *key);\nint AES_set_decrypt_key(const unsigned char *userKey, const int bits,\n                        AES_KEY *key);\n\nint private_AES_set_encrypt_key(const unsigned char *userKey, const int bits,\n                                AES_KEY *key);\nint private_AES_set_decrypt_key(const unsigned char *userKey, const int bits,\n                                AES_KEY *key);\n\nvoid AES_encrypt(const unsigned char *in, unsigned char *out,\n                 const AES_KEY *key);\nvoid AES_decrypt(const unsigned char *in, unsigned char *out,\n                 const AES_KEY *key);\n\nvoid AES_ecb_encrypt(const unsigned char *in, unsigned char *out,\n                     const AES_KEY *key, const int enc);\nvoid AES_cbc_encrypt(const unsigned char *in, unsigned char *out,\n                     size_t length, const AES_KEY *key,\n                     unsigned char *ivec, const int enc);\nvoid AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,\n                        size_t length, const AES_KEY *key,\n                        unsigned char *ivec, int *num, const int enc);\nvoid AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,\n                      size_t length, const AES_KEY *key,\n                      unsigned char *ivec, int *num, const int enc);\nvoid AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,\n                      size_t length, const AES_KEY *key,\n                      unsigned char *ivec, int *num, const int enc);\nvoid AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,\n                        size_t length, const AES_KEY *key,\n                        unsigned char *ivec, int *num);\nvoid AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,\n                        size_t length, const AES_KEY *key,\n                        unsigned char ivec[AES_BLOCK_SIZE],\n                        unsigned char ecount_buf[AES_BLOCK_SIZE],\n                        unsigned int *num);\n/* NB: the IV is _two_ blocks long */\nvoid AES_ige_encrypt(const unsigned char *in, unsigned char *out,\n                     size_t length, const AES_KEY *key,\n                     unsigned char *ivec, const int enc);\n/* NB: the IV is _four_ blocks long */\nvoid AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,\n                        size_t length, const AES_KEY *key,\n                        const AES_KEY *key2, const unsigned char *ivec,\n                        const int enc);\n\nint AES_wrap_key(AES_KEY *key, const unsigned char *iv,\n                 unsigned char *out,\n                 const unsigned char *in, unsigned int inlen);\nint AES_unwrap_key(AES_KEY *key, const unsigned char *iv,\n                   unsigned char *out,\n                   const unsigned char *in, unsigned int inlen);\n\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif                          /* !HEADER_AES_H */\n"
  },
  {
    "path": "third_party/include/openssl/applink.c",
    "content": "#define APPLINK_STDIN   1\n#define APPLINK_STDOUT  2\n#define APPLINK_STDERR  3\n#define APPLINK_FPRINTF 4\n#define APPLINK_FGETS   5\n#define APPLINK_FREAD   6\n#define APPLINK_FWRITE  7\n#define APPLINK_FSETMOD 8\n#define APPLINK_FEOF    9\n#define APPLINK_FCLOSE  10      /* should not be used */\n\n#define APPLINK_FOPEN   11      /* solely for completeness */\n#define APPLINK_FSEEK   12\n#define APPLINK_FTELL   13\n#define APPLINK_FFLUSH  14\n#define APPLINK_FERROR  15\n#define APPLINK_CLEARERR 16\n#define APPLINK_FILENO  17      /* to be used with below */\n\n#define APPLINK_OPEN    18      /* formally can't be used, as flags can vary */\n#define APPLINK_READ    19\n#define APPLINK_WRITE   20\n#define APPLINK_LSEEK   21\n#define APPLINK_CLOSE   22\n#define APPLINK_MAX     22      /* always same as last macro */\n\n#ifndef APPMACROS_ONLY\n# include <stdio.h>\n# include <io.h>\n# include <fcntl.h>\n\nstatic void *app_stdin(void)\n{\n    return stdin;\n}\n\nstatic void *app_stdout(void)\n{\n    return stdout;\n}\n\nstatic void *app_stderr(void)\n{\n    return stderr;\n}\n\nstatic int app_feof(FILE *fp)\n{\n    return feof(fp);\n}\n\nstatic int app_ferror(FILE *fp)\n{\n    return ferror(fp);\n}\n\nstatic void app_clearerr(FILE *fp)\n{\n    clearerr(fp);\n}\n\nstatic int app_fileno(FILE *fp)\n{\n    return _fileno(fp);\n}\n\nstatic int app_fsetmod(FILE *fp, char mod)\n{\n    return _setmode(_fileno(fp), mod == 'b' ? _O_BINARY : _O_TEXT);\n}\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n__declspec(dllexport)\nvoid **\n# if defined(__BORLANDC__)\n/*\n * __stdcall appears to be the only way to get the name\n * decoration right with Borland C. Otherwise it works\n * purely incidentally, as we pass no parameters.\n */\n __stdcall\n# else\n __cdecl\n# endif\nOPENSSL_Applink(void)\n{\n    static int once = 1;\n    static void *OPENSSL_ApplinkTable[APPLINK_MAX + 1] =\n        { (void *)APPLINK_MAX };\n\n    if (once) {\n        OPENSSL_ApplinkTable[APPLINK_STDIN] = app_stdin;\n        OPENSSL_ApplinkTable[APPLINK_STDOUT] = app_stdout;\n        OPENSSL_ApplinkTable[APPLINK_STDERR] = app_stderr;\n        OPENSSL_ApplinkTable[APPLINK_FPRINTF] = fprintf;\n        OPENSSL_ApplinkTable[APPLINK_FGETS] = fgets;\n        OPENSSL_ApplinkTable[APPLINK_FREAD] = fread;\n        OPENSSL_ApplinkTable[APPLINK_FWRITE] = fwrite;\n        OPENSSL_ApplinkTable[APPLINK_FSETMOD] = app_fsetmod;\n        OPENSSL_ApplinkTable[APPLINK_FEOF] = app_feof;\n        OPENSSL_ApplinkTable[APPLINK_FCLOSE] = fclose;\n\n        OPENSSL_ApplinkTable[APPLINK_FOPEN] = fopen;\n        OPENSSL_ApplinkTable[APPLINK_FSEEK] = fseek;\n        OPENSSL_ApplinkTable[APPLINK_FTELL] = ftell;\n        OPENSSL_ApplinkTable[APPLINK_FFLUSH] = fflush;\n        OPENSSL_ApplinkTable[APPLINK_FERROR] = app_ferror;\n        OPENSSL_ApplinkTable[APPLINK_CLEARERR] = app_clearerr;\n        OPENSSL_ApplinkTable[APPLINK_FILENO] = app_fileno;\n\n        OPENSSL_ApplinkTable[APPLINK_OPEN] = _open;\n        OPENSSL_ApplinkTable[APPLINK_READ] = _read;\n        OPENSSL_ApplinkTable[APPLINK_WRITE] = _write;\n        OPENSSL_ApplinkTable[APPLINK_LSEEK] = _lseek;\n        OPENSSL_ApplinkTable[APPLINK_CLOSE] = _close;\n\n        once = 0;\n    }\n\n    return OPENSSL_ApplinkTable;\n}\n\n#ifdef __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/asn1.h",
    "content": "/* crypto/asn1/asn1.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_ASN1_H\n# define HEADER_ASN1_H\n\n# include <time.h>\n# include <openssl/e_os2.h>\n# ifndef OPENSSL_NO_BIO\n#  include <openssl/bio.h>\n# endif\n# include <openssl/stack.h>\n# include <openssl/safestack.h>\n\n# include <openssl/symhacks.h>\n\n# include <openssl/ossl_typ.h>\n# ifndef OPENSSL_NO_DEPRECATED\n#  include <openssl/bn.h>\n# endif\n\n# ifdef OPENSSL_BUILD_SHLIBCRYPTO\n#  undef OPENSSL_EXTERN\n#  define OPENSSL_EXTERN OPENSSL_EXPORT\n# endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# define V_ASN1_UNIVERSAL                0x00\n# define V_ASN1_APPLICATION              0x40\n# define V_ASN1_CONTEXT_SPECIFIC         0x80\n# define V_ASN1_PRIVATE                  0xc0\n\n# define V_ASN1_CONSTRUCTED              0x20\n# define V_ASN1_PRIMITIVE_TAG            0x1f\n# define V_ASN1_PRIMATIVE_TAG            0x1f\n\n# define V_ASN1_APP_CHOOSE               -2/* let the recipient choose */\n# define V_ASN1_OTHER                    -3/* used in ASN1_TYPE */\n# define V_ASN1_ANY                      -4/* used in ASN1 template code */\n\n# define V_ASN1_NEG                      0x100/* negative flag */\n\n# define V_ASN1_UNDEF                    -1\n# define V_ASN1_EOC                      0\n# define V_ASN1_BOOLEAN                  1 /**/\n# define V_ASN1_INTEGER                  2\n# define V_ASN1_NEG_INTEGER              (2 | V_ASN1_NEG)\n# define V_ASN1_BIT_STRING               3\n# define V_ASN1_OCTET_STRING             4\n# define V_ASN1_NULL                     5\n# define V_ASN1_OBJECT                   6\n# define V_ASN1_OBJECT_DESCRIPTOR        7\n# define V_ASN1_EXTERNAL                 8\n# define V_ASN1_REAL                     9\n# define V_ASN1_ENUMERATED               10\n# define V_ASN1_NEG_ENUMERATED           (10 | V_ASN1_NEG)\n# define V_ASN1_UTF8STRING               12\n# define V_ASN1_SEQUENCE                 16\n# define V_ASN1_SET                      17\n# define V_ASN1_NUMERICSTRING            18 /**/\n# define V_ASN1_PRINTABLESTRING          19\n# define V_ASN1_T61STRING                20\n# define V_ASN1_TELETEXSTRING            20/* alias */\n# define V_ASN1_VIDEOTEXSTRING           21 /**/\n# define V_ASN1_IA5STRING                22\n# define V_ASN1_UTCTIME                  23\n# define V_ASN1_GENERALIZEDTIME          24 /**/\n# define V_ASN1_GRAPHICSTRING            25 /**/\n# define V_ASN1_ISO64STRING              26 /**/\n# define V_ASN1_VISIBLESTRING            26/* alias */\n# define V_ASN1_GENERALSTRING            27 /**/\n# define V_ASN1_UNIVERSALSTRING          28 /**/\n# define V_ASN1_BMPSTRING                30\n/* For use with d2i_ASN1_type_bytes() */\n# define B_ASN1_NUMERICSTRING    0x0001\n# define B_ASN1_PRINTABLESTRING  0x0002\n# define B_ASN1_T61STRING        0x0004\n# define B_ASN1_TELETEXSTRING    0x0004\n# define B_ASN1_VIDEOTEXSTRING   0x0008\n# define B_ASN1_IA5STRING        0x0010\n# define B_ASN1_GRAPHICSTRING    0x0020\n# define B_ASN1_ISO64STRING      0x0040\n# define B_ASN1_VISIBLESTRING    0x0040\n# define B_ASN1_GENERALSTRING    0x0080\n# define B_ASN1_UNIVERSALSTRING  0x0100\n# define B_ASN1_OCTET_STRING     0x0200\n# define B_ASN1_BIT_STRING       0x0400\n# define B_ASN1_BMPSTRING        0x0800\n# define B_ASN1_UNKNOWN          0x1000\n# define B_ASN1_UTF8STRING       0x2000\n# define B_ASN1_UTCTIME          0x4000\n# define B_ASN1_GENERALIZEDTIME  0x8000\n# define B_ASN1_SEQUENCE         0x10000\n/* For use with ASN1_mbstring_copy() */\n# define MBSTRING_FLAG           0x1000\n# define MBSTRING_UTF8           (MBSTRING_FLAG)\n# define MBSTRING_ASC            (MBSTRING_FLAG|1)\n# define MBSTRING_BMP            (MBSTRING_FLAG|2)\n# define MBSTRING_UNIV           (MBSTRING_FLAG|4)\n# define SMIME_OLDMIME           0x400\n# define SMIME_CRLFEOL           0x800\n# define SMIME_STREAM            0x1000\n    struct X509_algor_st;\nDECLARE_STACK_OF(X509_ALGOR)\n\n# define DECLARE_ASN1_SET_OF(type)/* filled in by mkstack.pl */\n# define IMPLEMENT_ASN1_SET_OF(type)/* nothing, no longer needed */\n\n/*\n * We MUST make sure that, except for constness, asn1_ctx_st and\n * asn1_const_ctx are exactly the same.  Fortunately, as soon as the old ASN1\n * parsing macros are gone, we can throw this away as well...\n */\ntypedef struct asn1_ctx_st {\n    unsigned char *p;           /* work char pointer */\n    int eos;                    /* end of sequence read for indefinite\n                                 * encoding */\n    int error;                  /* error code to use when returning an error */\n    int inf;                    /* constructed if 0x20, indefinite is 0x21 */\n    int tag;                    /* tag from last 'get object' */\n    int xclass;                 /* class from last 'get object' */\n    long slen;                  /* length of last 'get object' */\n    unsigned char *max;         /* largest value of p allowed */\n    unsigned char *q;           /* temporary variable */\n    unsigned char **pp;         /* variable */\n    int line;                   /* used in error processing */\n} ASN1_CTX;\n\ntypedef struct asn1_const_ctx_st {\n    const unsigned char *p;     /* work char pointer */\n    int eos;                    /* end of sequence read for indefinite\n                                 * encoding */\n    int error;                  /* error code to use when returning an error */\n    int inf;                    /* constructed if 0x20, indefinite is 0x21 */\n    int tag;                    /* tag from last 'get object' */\n    int xclass;                 /* class from last 'get object' */\n    long slen;                  /* length of last 'get object' */\n    const unsigned char *max;   /* largest value of p allowed */\n    const unsigned char *q;     /* temporary variable */\n    const unsigned char **pp;   /* variable */\n    int line;                   /* used in error processing */\n} ASN1_const_CTX;\n\n/*\n * These are used internally in the ASN1_OBJECT to keep track of whether the\n * names and data need to be free()ed\n */\n# define ASN1_OBJECT_FLAG_DYNAMIC         0x01/* internal use */\n# define ASN1_OBJECT_FLAG_CRITICAL        0x02/* critical x509v3 object id */\n# define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04/* internal use */\n# define ASN1_OBJECT_FLAG_DYNAMIC_DATA    0x08/* internal use */\nstruct asn1_object_st {\n    const char *sn, *ln;\n    int nid;\n    int length;\n    const unsigned char *data;  /* data remains const after init */\n    int flags;                  /* Should we free this one */\n};\n\n# define ASN1_STRING_FLAG_BITS_LEFT 0x08/* Set if 0x07 has bits left value */\n/*\n * This indicates that the ASN1_STRING is not a real value but just a place\n * holder for the location where indefinite length constructed data should be\n * inserted in the memory buffer\n */\n# define ASN1_STRING_FLAG_NDEF 0x010\n\n/*\n * This flag is used by the CMS code to indicate that a string is not\n * complete and is a place holder for content when it had all been accessed.\n * The flag will be reset when content has been written to it.\n */\n\n# define ASN1_STRING_FLAG_CONT 0x020\n/*\n * This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING\n * type.\n */\n# define ASN1_STRING_FLAG_MSTRING 0x040\n/* This is the base type that holds just about everything :-) */\nstruct asn1_string_st {\n    int length;\n    int type;\n    unsigned char *data;\n    /*\n     * The value of the following field depends on the type being held.  It\n     * is mostly being used for BIT_STRING so if the input data has a\n     * non-zero 'unused bits' value, it will be handled correctly\n     */\n    long flags;\n};\n\n/*\n * ASN1_ENCODING structure: this is used to save the received encoding of an\n * ASN1 type. This is useful to get round problems with invalid encodings\n * which can break signatures.\n */\n\ntypedef struct ASN1_ENCODING_st {\n    unsigned char *enc;         /* DER encoding */\n    long len;                   /* Length of encoding */\n    int modified;               /* set to 1 if 'enc' is invalid */\n} ASN1_ENCODING;\n\n/* Used with ASN1 LONG type: if a long is set to this it is omitted */\n# define ASN1_LONG_UNDEF 0x7fffffffL\n\n# define STABLE_FLAGS_MALLOC     0x01\n# define STABLE_NO_MASK          0x02\n# define DIRSTRING_TYPE  \\\n (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)\n# define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)\n\ntypedef struct asn1_string_table_st {\n    int nid;\n    long minsize;\n    long maxsize;\n    unsigned long mask;\n    unsigned long flags;\n} ASN1_STRING_TABLE;\n\nDECLARE_STACK_OF(ASN1_STRING_TABLE)\n\n/* size limits: this stuff is taken straight from RFC2459 */\n\n# define ub_name                         32768\n# define ub_common_name                  64\n# define ub_locality_name                128\n# define ub_state_name                   128\n# define ub_organization_name            64\n# define ub_organization_unit_name       64\n# define ub_title                        64\n# define ub_email_address                128\n\n/*\n * Declarations for template structures: for full definitions see asn1t.h\n */\ntypedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;\ntypedef struct ASN1_TLC_st ASN1_TLC;\n/* This is just an opaque pointer */\ntypedef struct ASN1_VALUE_st ASN1_VALUE;\n\n/* Declare ASN1 functions: the implement macro in in asn1t.h */\n\n# define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type)\n\n# define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \\\n        DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type)\n\n# define DECLARE_ASN1_FUNCTIONS_name(type, name) \\\n        DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \\\n        DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)\n\n# define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \\\n        DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \\\n        DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)\n\n# define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \\\n        type *d2i_##name(type **a, const unsigned char **in, long len); \\\n        int i2d_##name(type *a, unsigned char **out); \\\n        DECLARE_ASN1_ITEM(itname)\n\n# define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \\\n        type *d2i_##name(type **a, const unsigned char **in, long len); \\\n        int i2d_##name(const type *a, unsigned char **out); \\\n        DECLARE_ASN1_ITEM(name)\n\n# define DECLARE_ASN1_NDEF_FUNCTION(name) \\\n        int i2d_##name##_NDEF(name *a, unsigned char **out);\n\n# define DECLARE_ASN1_FUNCTIONS_const(name) \\\n        DECLARE_ASN1_ALLOC_FUNCTIONS(name) \\\n        DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name)\n\n# define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \\\n        type *name##_new(void); \\\n        void name##_free(type *a);\n\n# define DECLARE_ASN1_PRINT_FUNCTION(stname) \\\n        DECLARE_ASN1_PRINT_FUNCTION_fname(stname, stname)\n\n# define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \\\n        int fname##_print_ctx(BIO *out, stname *x, int indent, \\\n                                         const ASN1_PCTX *pctx);\n\n# define D2I_OF(type) type *(*)(type **,const unsigned char **,long)\n# define I2D_OF(type) int (*)(type *,unsigned char **)\n# define I2D_OF_const(type) int (*)(const type *,unsigned char **)\n\n# define CHECKED_D2I_OF(type, d2i) \\\n    ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0)))\n# define CHECKED_I2D_OF(type, i2d) \\\n    ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0)))\n# define CHECKED_NEW_OF(type, xnew) \\\n    ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0)))\n# define CHECKED_PTR_OF(type, p) \\\n    ((void*) (1 ? p : (type*)0))\n# define CHECKED_PPTR_OF(type, p) \\\n    ((void**) (1 ? p : (type**)0))\n\n# define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)\n# define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **)\n# define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)\n\nTYPEDEF_D2I2D_OF(void);\n\n/*-\n * The following macros and typedefs allow an ASN1_ITEM\n * to be embedded in a structure and referenced. Since\n * the ASN1_ITEM pointers need to be globally accessible\n * (possibly from shared libraries) they may exist in\n * different forms. On platforms that support it the\n * ASN1_ITEM structure itself will be globally exported.\n * Other platforms will export a function that returns\n * an ASN1_ITEM pointer.\n *\n * To handle both cases transparently the macros below\n * should be used instead of hard coding an ASN1_ITEM\n * pointer in a structure.\n *\n * The structure will look like this:\n *\n * typedef struct SOMETHING_st {\n *      ...\n *      ASN1_ITEM_EXP *iptr;\n *      ...\n * } SOMETHING;\n *\n * It would be initialised as e.g.:\n *\n * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...};\n *\n * and the actual pointer extracted with:\n *\n * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr);\n *\n * Finally an ASN1_ITEM pointer can be extracted from an\n * appropriate reference with: ASN1_ITEM_rptr(X509). This\n * would be used when a function takes an ASN1_ITEM * argument.\n *\n */\n\n# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION\n\n/* ASN1_ITEM pointer exported type */\ntypedef const ASN1_ITEM ASN1_ITEM_EXP;\n\n/* Macro to obtain ASN1_ITEM pointer from exported type */\n#  define ASN1_ITEM_ptr(iptr) (iptr)\n\n/* Macro to include ASN1_ITEM pointer from base type */\n#  define ASN1_ITEM_ref(iptr) (&(iptr##_it))\n\n#  define ASN1_ITEM_rptr(ref) (&(ref##_it))\n\n#  define DECLARE_ASN1_ITEM(name) \\\n        OPENSSL_EXTERN const ASN1_ITEM name##_it;\n\n# else\n\n/*\n * Platforms that can't easily handle shared global variables are declared as\n * functions returning ASN1_ITEM pointers.\n */\n\n/* ASN1_ITEM pointer exported type */\ntypedef const ASN1_ITEM *ASN1_ITEM_EXP (void);\n\n/* Macro to obtain ASN1_ITEM pointer from exported type */\n#  define ASN1_ITEM_ptr(iptr) (iptr())\n\n/* Macro to include ASN1_ITEM pointer from base type */\n#  define ASN1_ITEM_ref(iptr) (iptr##_it)\n\n#  define ASN1_ITEM_rptr(ref) (ref##_it())\n\n#  define DECLARE_ASN1_ITEM(name) \\\n        const ASN1_ITEM * name##_it(void);\n\n# endif\n\n/* Parameters used by ASN1_STRING_print_ex() */\n\n/*\n * These determine which characters to escape: RFC2253 special characters,\n * control characters and MSB set characters\n */\n\n# define ASN1_STRFLGS_ESC_2253           1\n# define ASN1_STRFLGS_ESC_CTRL           2\n# define ASN1_STRFLGS_ESC_MSB            4\n\n/*\n * This flag determines how we do escaping: normally RC2253 backslash only,\n * set this to use backslash and quote.\n */\n\n# define ASN1_STRFLGS_ESC_QUOTE          8\n\n/* These three flags are internal use only. */\n\n/* Character is a valid PrintableString character */\n# define CHARTYPE_PRINTABLESTRING        0x10\n/* Character needs escaping if it is the first character */\n# define CHARTYPE_FIRST_ESC_2253         0x20\n/* Character needs escaping if it is the last character */\n# define CHARTYPE_LAST_ESC_2253          0x40\n\n/*\n * NB the internal flags are safely reused below by flags handled at the top\n * level.\n */\n\n/*\n * If this is set we convert all character strings to UTF8 first\n */\n\n# define ASN1_STRFLGS_UTF8_CONVERT       0x10\n\n/*\n * If this is set we don't attempt to interpret content: just assume all\n * strings are 1 byte per character. This will produce some pretty odd\n * looking output!\n */\n\n# define ASN1_STRFLGS_IGNORE_TYPE        0x20\n\n/* If this is set we include the string type in the output */\n# define ASN1_STRFLGS_SHOW_TYPE          0x40\n\n/*\n * This determines which strings to display and which to 'dump' (hex dump of\n * content octets or DER encoding). We can only dump non character strings or\n * everything. If we don't dump 'unknown' they are interpreted as character\n * strings with 1 octet per character and are subject to the usual escaping\n * options.\n */\n\n# define ASN1_STRFLGS_DUMP_ALL           0x80\n# define ASN1_STRFLGS_DUMP_UNKNOWN       0x100\n\n/*\n * These determine what 'dumping' does, we can dump the content octets or the\n * DER encoding: both use the RFC2253 #XXXXX notation.\n */\n\n# define ASN1_STRFLGS_DUMP_DER           0x200\n\n/*\n * All the string flags consistent with RFC2253, escaping control characters\n * isn't essential in RFC2253 but it is advisable anyway.\n */\n\n# define ASN1_STRFLGS_RFC2253    (ASN1_STRFLGS_ESC_2253 | \\\n                                ASN1_STRFLGS_ESC_CTRL | \\\n                                ASN1_STRFLGS_ESC_MSB | \\\n                                ASN1_STRFLGS_UTF8_CONVERT | \\\n                                ASN1_STRFLGS_DUMP_UNKNOWN | \\\n                                ASN1_STRFLGS_DUMP_DER)\n\nDECLARE_STACK_OF(ASN1_INTEGER)\nDECLARE_ASN1_SET_OF(ASN1_INTEGER)\n\nDECLARE_STACK_OF(ASN1_GENERALSTRING)\n\ntypedef struct asn1_type_st {\n    int type;\n    union {\n        char *ptr;\n        ASN1_BOOLEAN boolean;\n        ASN1_STRING *asn1_string;\n        ASN1_OBJECT *object;\n        ASN1_INTEGER *integer;\n        ASN1_ENUMERATED *enumerated;\n        ASN1_BIT_STRING *bit_string;\n        ASN1_OCTET_STRING *octet_string;\n        ASN1_PRINTABLESTRING *printablestring;\n        ASN1_T61STRING *t61string;\n        ASN1_IA5STRING *ia5string;\n        ASN1_GENERALSTRING *generalstring;\n        ASN1_BMPSTRING *bmpstring;\n        ASN1_UNIVERSALSTRING *universalstring;\n        ASN1_UTCTIME *utctime;\n        ASN1_GENERALIZEDTIME *generalizedtime;\n        ASN1_VISIBLESTRING *visiblestring;\n        ASN1_UTF8STRING *utf8string;\n        /*\n         * set and sequence are left complete and still contain the set or\n         * sequence bytes\n         */\n        ASN1_STRING *set;\n        ASN1_STRING *sequence;\n        ASN1_VALUE *asn1_value;\n    } value;\n} ASN1_TYPE;\n\nDECLARE_STACK_OF(ASN1_TYPE)\nDECLARE_ASN1_SET_OF(ASN1_TYPE)\n\ntypedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;\n\nDECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY)\nDECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY)\n\ntypedef struct NETSCAPE_X509_st {\n    ASN1_OCTET_STRING *header;\n    X509 *cert;\n} NETSCAPE_X509;\n\n/* This is used to contain a list of bit names */\ntypedef struct BIT_STRING_BITNAME_st {\n    int bitnum;\n    const char *lname;\n    const char *sname;\n} BIT_STRING_BITNAME;\n\n# define M_ASN1_STRING_length(x) ((x)->length)\n# define M_ASN1_STRING_length_set(x, n)  ((x)->length = (n))\n# define M_ASN1_STRING_type(x)   ((x)->type)\n# define M_ASN1_STRING_data(x)   ((x)->data)\n\n/* Macros for string operations */\n# define M_ASN1_BIT_STRING_new() (ASN1_BIT_STRING *)\\\n                ASN1_STRING_type_new(V_ASN1_BIT_STRING)\n# define M_ASN1_BIT_STRING_free(a)       ASN1_STRING_free((ASN1_STRING *)a)\n# define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\\\n                ASN1_STRING_dup((const ASN1_STRING *)a)\n# define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\\\n                (const ASN1_STRING *)a,(const ASN1_STRING *)b)\n# define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)\n\n# define M_ASN1_INTEGER_new()    (ASN1_INTEGER *)\\\n                ASN1_STRING_type_new(V_ASN1_INTEGER)\n# define M_ASN1_INTEGER_free(a)          ASN1_STRING_free((ASN1_STRING *)a)\n# define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)\\\n                ASN1_STRING_dup((const ASN1_STRING *)a)\n# define M_ASN1_INTEGER_cmp(a,b) ASN1_STRING_cmp(\\\n                (const ASN1_STRING *)a,(const ASN1_STRING *)b)\n\n# define M_ASN1_ENUMERATED_new() (ASN1_ENUMERATED *)\\\n                ASN1_STRING_type_new(V_ASN1_ENUMERATED)\n# define M_ASN1_ENUMERATED_free(a)       ASN1_STRING_free((ASN1_STRING *)a)\n# define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)\\\n                ASN1_STRING_dup((const ASN1_STRING *)a)\n# define M_ASN1_ENUMERATED_cmp(a,b)      ASN1_STRING_cmp(\\\n                (const ASN1_STRING *)a,(const ASN1_STRING *)b)\n\n# define M_ASN1_OCTET_STRING_new()       (ASN1_OCTET_STRING *)\\\n                ASN1_STRING_type_new(V_ASN1_OCTET_STRING)\n# define M_ASN1_OCTET_STRING_free(a)     ASN1_STRING_free((ASN1_STRING *)a)\n# define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\\\n                ASN1_STRING_dup((const ASN1_STRING *)a)\n# define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\\\n                (const ASN1_STRING *)a,(const ASN1_STRING *)b)\n# define M_ASN1_OCTET_STRING_set(a,b,c)  ASN1_STRING_set((ASN1_STRING *)a,b,c)\n# define M_ASN1_OCTET_STRING_print(a,b)  ASN1_STRING_print(a,(ASN1_STRING *)b)\n# define M_i2d_ASN1_OCTET_STRING(a,pp) \\\n                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\\\n                V_ASN1_UNIVERSAL)\n\n# define B_ASN1_TIME \\\n                        B_ASN1_UTCTIME | \\\n                        B_ASN1_GENERALIZEDTIME\n\n# define B_ASN1_PRINTABLE \\\n                        B_ASN1_NUMERICSTRING| \\\n                        B_ASN1_PRINTABLESTRING| \\\n                        B_ASN1_T61STRING| \\\n                        B_ASN1_IA5STRING| \\\n                        B_ASN1_BIT_STRING| \\\n                        B_ASN1_UNIVERSALSTRING|\\\n                        B_ASN1_BMPSTRING|\\\n                        B_ASN1_UTF8STRING|\\\n                        B_ASN1_SEQUENCE|\\\n                        B_ASN1_UNKNOWN\n\n# define B_ASN1_DIRECTORYSTRING \\\n                        B_ASN1_PRINTABLESTRING| \\\n                        B_ASN1_TELETEXSTRING|\\\n                        B_ASN1_BMPSTRING|\\\n                        B_ASN1_UNIVERSALSTRING|\\\n                        B_ASN1_UTF8STRING\n\n# define B_ASN1_DISPLAYTEXT \\\n                        B_ASN1_IA5STRING| \\\n                        B_ASN1_VISIBLESTRING| \\\n                        B_ASN1_BMPSTRING|\\\n                        B_ASN1_UTF8STRING\n\n# define M_ASN1_PRINTABLE_new()  ASN1_STRING_type_new(V_ASN1_T61STRING)\n# define M_ASN1_PRINTABLE_free(a)        ASN1_STRING_free((ASN1_STRING *)a)\n# define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\\\n                pp,a->type,V_ASN1_UNIVERSAL)\n# define M_d2i_ASN1_PRINTABLE(a,pp,l) \\\n                d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \\\n                        B_ASN1_PRINTABLE)\n\n# define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)\n# define M_DIRECTORYSTRING_free(a)       ASN1_STRING_free((ASN1_STRING *)a)\n# define M_i2d_DIRECTORYSTRING(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\\\n                                                pp,a->type,V_ASN1_UNIVERSAL)\n# define M_d2i_DIRECTORYSTRING(a,pp,l) \\\n                d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \\\n                        B_ASN1_DIRECTORYSTRING)\n\n# define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)\n# define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a)\n# define M_i2d_DISPLAYTEXT(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\\\n                                                pp,a->type,V_ASN1_UNIVERSAL)\n# define M_d2i_DISPLAYTEXT(a,pp,l) \\\n                d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \\\n                        B_ASN1_DISPLAYTEXT)\n\n# define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\\\n                ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)\n# define M_ASN1_PRINTABLESTRING_free(a)  ASN1_STRING_free((ASN1_STRING *)a)\n# define M_i2d_ASN1_PRINTABLESTRING(a,pp) \\\n                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_PRINTABLESTRING,\\\n                V_ASN1_UNIVERSAL)\n# define M_d2i_ASN1_PRINTABLESTRING(a,pp,l) \\\n                (ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\\\n                ((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING)\n\n# define M_ASN1_T61STRING_new()  (ASN1_T61STRING *)\\\n                ASN1_STRING_type_new(V_ASN1_T61STRING)\n# define M_ASN1_T61STRING_free(a)        ASN1_STRING_free((ASN1_STRING *)a)\n# define M_i2d_ASN1_T61STRING(a,pp) \\\n                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_T61STRING,\\\n                V_ASN1_UNIVERSAL)\n# define M_d2i_ASN1_T61STRING(a,pp,l) \\\n                (ASN1_T61STRING *)d2i_ASN1_type_bytes\\\n                ((ASN1_STRING **)a,pp,l,B_ASN1_T61STRING)\n\n# define M_ASN1_IA5STRING_new()  (ASN1_IA5STRING *)\\\n                ASN1_STRING_type_new(V_ASN1_IA5STRING)\n# define M_ASN1_IA5STRING_free(a)        ASN1_STRING_free((ASN1_STRING *)a)\n# define M_ASN1_IA5STRING_dup(a) \\\n                (ASN1_IA5STRING *)ASN1_STRING_dup((const ASN1_STRING *)a)\n# define M_i2d_ASN1_IA5STRING(a,pp) \\\n                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_IA5STRING,\\\n                        V_ASN1_UNIVERSAL)\n# define M_d2i_ASN1_IA5STRING(a,pp,l) \\\n                (ASN1_IA5STRING *)d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l,\\\n                        B_ASN1_IA5STRING)\n\n# define M_ASN1_UTCTIME_new()    (ASN1_UTCTIME *)\\\n                ASN1_STRING_type_new(V_ASN1_UTCTIME)\n# define M_ASN1_UTCTIME_free(a)  ASN1_STRING_free((ASN1_STRING *)a)\n# define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)\\\n                ASN1_STRING_dup((const ASN1_STRING *)a)\n\n# define M_ASN1_GENERALIZEDTIME_new()    (ASN1_GENERALIZEDTIME *)\\\n                ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME)\n# define M_ASN1_GENERALIZEDTIME_free(a)  ASN1_STRING_free((ASN1_STRING *)a)\n# define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\\\n        (const ASN1_STRING *)a)\n\n# define M_ASN1_TIME_new()       (ASN1_TIME *)\\\n                ASN1_STRING_type_new(V_ASN1_UTCTIME)\n# define M_ASN1_TIME_free(a)     ASN1_STRING_free((ASN1_STRING *)a)\n# define M_ASN1_TIME_dup(a) (ASN1_TIME *)\\\n        ASN1_STRING_dup((const ASN1_STRING *)a)\n\n# define M_ASN1_GENERALSTRING_new()      (ASN1_GENERALSTRING *)\\\n                ASN1_STRING_type_new(V_ASN1_GENERALSTRING)\n# define M_ASN1_GENERALSTRING_free(a)    ASN1_STRING_free((ASN1_STRING *)a)\n# define M_i2d_ASN1_GENERALSTRING(a,pp) \\\n                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_GENERALSTRING,\\\n                        V_ASN1_UNIVERSAL)\n# define M_d2i_ASN1_GENERALSTRING(a,pp,l) \\\n                (ASN1_GENERALSTRING *)d2i_ASN1_type_bytes\\\n                ((ASN1_STRING **)a,pp,l,B_ASN1_GENERALSTRING)\n\n# define M_ASN1_UNIVERSALSTRING_new()    (ASN1_UNIVERSALSTRING *)\\\n                ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING)\n# define M_ASN1_UNIVERSALSTRING_free(a)  ASN1_STRING_free((ASN1_STRING *)a)\n# define M_i2d_ASN1_UNIVERSALSTRING(a,pp) \\\n                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UNIVERSALSTRING,\\\n                        V_ASN1_UNIVERSAL)\n# define M_d2i_ASN1_UNIVERSALSTRING(a,pp,l) \\\n                (ASN1_UNIVERSALSTRING *)d2i_ASN1_type_bytes\\\n                ((ASN1_STRING **)a,pp,l,B_ASN1_UNIVERSALSTRING)\n\n# define M_ASN1_BMPSTRING_new()  (ASN1_BMPSTRING *)\\\n                ASN1_STRING_type_new(V_ASN1_BMPSTRING)\n# define M_ASN1_BMPSTRING_free(a)        ASN1_STRING_free((ASN1_STRING *)a)\n# define M_i2d_ASN1_BMPSTRING(a,pp) \\\n                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_BMPSTRING,\\\n                        V_ASN1_UNIVERSAL)\n# define M_d2i_ASN1_BMPSTRING(a,pp,l) \\\n                (ASN1_BMPSTRING *)d2i_ASN1_type_bytes\\\n                ((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING)\n\n# define M_ASN1_VISIBLESTRING_new()      (ASN1_VISIBLESTRING *)\\\n                ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)\n# define M_ASN1_VISIBLESTRING_free(a)    ASN1_STRING_free((ASN1_STRING *)a)\n# define M_i2d_ASN1_VISIBLESTRING(a,pp) \\\n                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\\\n                        V_ASN1_UNIVERSAL)\n# define M_d2i_ASN1_VISIBLESTRING(a,pp,l) \\\n                (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\\\n                ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING)\n\n# define M_ASN1_UTF8STRING_new() (ASN1_UTF8STRING *)\\\n                ASN1_STRING_type_new(V_ASN1_UTF8STRING)\n# define M_ASN1_UTF8STRING_free(a)       ASN1_STRING_free((ASN1_STRING *)a)\n# define M_i2d_ASN1_UTF8STRING(a,pp) \\\n                i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\\\n                        V_ASN1_UNIVERSAL)\n# define M_d2i_ASN1_UTF8STRING(a,pp,l) \\\n                (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\\\n                ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING)\n\n  /* for the is_set parameter to i2d_ASN1_SET */\n# define IS_SEQUENCE     0\n# define IS_SET          1\n\nDECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)\n\nint ASN1_TYPE_get(ASN1_TYPE *a);\nvoid ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);\nint ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value);\nint ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);\n\nASN1_OBJECT *ASN1_OBJECT_new(void);\nvoid ASN1_OBJECT_free(ASN1_OBJECT *a);\nint i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp);\nASN1_OBJECT *c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,\n                             long length);\nASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,\n                             long length);\n\nDECLARE_ASN1_ITEM(ASN1_OBJECT)\n\nDECLARE_STACK_OF(ASN1_OBJECT)\nDECLARE_ASN1_SET_OF(ASN1_OBJECT)\n\nASN1_STRING *ASN1_STRING_new(void);\nvoid ASN1_STRING_free(ASN1_STRING *a);\nvoid ASN1_STRING_clear_free(ASN1_STRING *a);\nint ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);\nASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a);\nASN1_STRING *ASN1_STRING_type_new(int type);\nint ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b);\n  /*\n   * Since this is used to store all sorts of things, via macros, for now,\n   * make its data void *\n   */\nint ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);\nvoid ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);\nint ASN1_STRING_length(const ASN1_STRING *x);\nvoid ASN1_STRING_length_set(ASN1_STRING *x, int n);\nint ASN1_STRING_type(ASN1_STRING *x);\nunsigned char *ASN1_STRING_data(ASN1_STRING *x);\n\nDECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING)\nint i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp);\nASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,\n                                     const unsigned char **pp, long length);\nint ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length);\nint ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);\nint ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n);\nint ASN1_BIT_STRING_check(ASN1_BIT_STRING *a,\n                          unsigned char *flags, int flags_len);\n\n# ifndef OPENSSL_NO_BIO\nint ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,\n                               BIT_STRING_BITNAME *tbl, int indent);\n# endif\nint ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl);\nint ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value,\n                            BIT_STRING_BITNAME *tbl);\n\nint i2d_ASN1_BOOLEAN(int a, unsigned char **pp);\nint d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length);\n\nDECLARE_ASN1_FUNCTIONS(ASN1_INTEGER)\nint i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp);\nASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp,\n                               long length);\nASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,\n                                long length);\nASN1_INTEGER *ASN1_INTEGER_dup(const ASN1_INTEGER *x);\nint ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y);\n\nDECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED)\n\nint ASN1_UTCTIME_check(const ASN1_UTCTIME *a);\nASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t);\nASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,\n                               int offset_day, long offset_sec);\nint ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str);\nint ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);\n# if 0\ntime_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s);\n# endif\n\nint ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a);\nASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,\n                                               time_t t);\nASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,\n                                               time_t t, int offset_day,\n                                               long offset_sec);\nint ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);\nint ASN1_TIME_diff(int *pday, int *psec,\n                   const ASN1_TIME *from, const ASN1_TIME *to);\n\nDECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING)\nASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a);\nint ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a,\n                          const ASN1_OCTET_STRING *b);\nint ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data,\n                          int len);\n\nDECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)\nDECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)\nDECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING)\nDECLARE_ASN1_FUNCTIONS(ASN1_NULL)\nDECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING)\n\nint UTF8_getc(const unsigned char *str, int len, unsigned long *val);\nint UTF8_putc(unsigned char *str, int len, unsigned long value);\n\nDECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE)\n\nDECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING)\nDECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT)\nDECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING)\nDECLARE_ASN1_FUNCTIONS(ASN1_T61STRING)\nDECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING)\nDECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING)\nDECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME)\nDECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME)\nDECLARE_ASN1_FUNCTIONS(ASN1_TIME)\n\nDECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF)\n\nASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t);\nASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t,\n                         int offset_day, long offset_sec);\nint ASN1_TIME_check(ASN1_TIME *t);\nASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME\n                                                   **out);\nint ASN1_TIME_set_string(ASN1_TIME *s, const char *str);\n\nint i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp,\n                 i2d_of_void *i2d, int ex_tag, int ex_class, int is_set);\nSTACK_OF(OPENSSL_BLOCK) *d2i_ASN1_SET(STACK_OF(OPENSSL_BLOCK) **a,\n                                      const unsigned char **pp,\n                                      long length, d2i_of_void *d2i,\n                                      void (*free_func) (OPENSSL_BLOCK),\n                                      int ex_tag, int ex_class);\n\n# ifndef OPENSSL_NO_BIO\nint i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a);\nint a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size);\nint i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a);\nint a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size);\nint i2a_ASN1_OBJECT(BIO *bp, ASN1_OBJECT *a);\nint a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size);\nint i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type);\n# endif\nint i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a);\n\nint a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num);\nASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,\n                                const char *sn, const char *ln);\n\nint ASN1_INTEGER_set(ASN1_INTEGER *a, long v);\nlong ASN1_INTEGER_get(const ASN1_INTEGER *a);\nASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai);\nBIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn);\n\nint ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);\nlong ASN1_ENUMERATED_get(ASN1_ENUMERATED *a);\nASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai);\nBIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai, BIGNUM *bn);\n\n/* General */\n/* given a string, return the correct type, max is the maximum length */\nint ASN1_PRINTABLE_type(const unsigned char *s, int max);\n\nint i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass);\nASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,\n                            long length, int Ptag, int Pclass);\nunsigned long ASN1_tag2bit(int tag);\n/* type is one or more of the B_ASN1_ values. */\nASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp,\n                                 long length, int type);\n\n/* PARSING */\nint asn1_Finish(ASN1_CTX *c);\nint asn1_const_Finish(ASN1_const_CTX *c);\n\n/* SPECIALS */\nint ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,\n                    int *pclass, long omax);\nint ASN1_check_infinite_end(unsigned char **p, long len);\nint ASN1_const_check_infinite_end(const unsigned char **p, long len);\nvoid ASN1_put_object(unsigned char **pp, int constructed, int length,\n                     int tag, int xclass);\nint ASN1_put_eoc(unsigned char **pp);\nint ASN1_object_size(int constructed, int length, int tag);\n\n/* Used to implement other functions */\nvoid *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x);\n\n# define ASN1_dup_of(type,i2d,d2i,x) \\\n    ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \\\n                     CHECKED_D2I_OF(type, d2i), \\\n                     CHECKED_PTR_OF(type, x)))\n\n# define ASN1_dup_of_const(type,i2d,d2i,x) \\\n    ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \\\n                     CHECKED_D2I_OF(type, d2i), \\\n                     CHECKED_PTR_OF(const type, x)))\n\nvoid *ASN1_item_dup(const ASN1_ITEM *it, void *x);\n\n/* ASN1 alloc/free macros for when a type is only used internally */\n\n# define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type))\n# define M_ASN1_free_of(x, type) \\\n                ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type))\n\n# ifndef OPENSSL_NO_FP_API\nvoid *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x);\n\n#  define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \\\n    ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \\\n                        CHECKED_D2I_OF(type, d2i), \\\n                        in, \\\n                        CHECKED_PPTR_OF(type, x)))\n\nvoid *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x);\nint ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x);\n\n#  define ASN1_i2d_fp_of(type,i2d,out,x) \\\n    (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \\\n                 out, \\\n                 CHECKED_PTR_OF(type, x)))\n\n#  define ASN1_i2d_fp_of_const(type,i2d,out,x) \\\n    (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \\\n                 out, \\\n                 CHECKED_PTR_OF(const type, x)))\n\nint ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x);\nint ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags);\n# endif\n\nint ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in);\n\n# ifndef OPENSSL_NO_BIO\nvoid *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x);\n\n#  define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \\\n    ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \\\n                          CHECKED_D2I_OF(type, d2i), \\\n                          in, \\\n                          CHECKED_PPTR_OF(type, x)))\n\nvoid *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x);\nint ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x);\n\n#  define ASN1_i2d_bio_of(type,i2d,out,x) \\\n    (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \\\n                  out, \\\n                  CHECKED_PTR_OF(type, x)))\n\n#  define ASN1_i2d_bio_of_const(type,i2d,out,x) \\\n    (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \\\n                  out, \\\n                  CHECKED_PTR_OF(const type, x)))\n\nint ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);\nint ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a);\nint ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a);\nint ASN1_TIME_print(BIO *fp, const ASN1_TIME *a);\nint ASN1_STRING_print(BIO *bp, const ASN1_STRING *v);\nint ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags);\nint ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num,\n                  unsigned char *buf, int off);\nint ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent);\nint ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent,\n                    int dump);\n# endif\nconst char *ASN1_tag2str(int tag);\n\n/* Used to load and write netscape format cert */\n\nDECLARE_ASN1_FUNCTIONS(NETSCAPE_X509)\n\nint ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);\n\nint ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len);\nint ASN1_TYPE_get_octetstring(ASN1_TYPE *a, unsigned char *data, int max_len);\nint ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num,\n                                  unsigned char *data, int len);\nint ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num,\n                                  unsigned char *data, int max_len);\n\nSTACK_OF(OPENSSL_BLOCK) *ASN1_seq_unpack(const unsigned char *buf, int len,\n                                         d2i_of_void *d2i,\n                                         void (*free_func) (OPENSSL_BLOCK));\nunsigned char *ASN1_seq_pack(STACK_OF(OPENSSL_BLOCK) *safes, i2d_of_void *i2d,\n                             unsigned char **buf, int *len);\nvoid *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i);\nvoid *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it);\nASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d,\n                              ASN1_OCTET_STRING **oct);\n\n# define ASN1_pack_string_of(type,obj,i2d,oct) \\\n    (ASN1_pack_string(CHECKED_PTR_OF(type, obj), \\\n                      CHECKED_I2D_OF(type, i2d), \\\n                      oct))\n\nASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it,\n                            ASN1_OCTET_STRING **oct);\n\nvoid ASN1_STRING_set_default_mask(unsigned long mask);\nint ASN1_STRING_set_default_mask_asc(const char *p);\nunsigned long ASN1_STRING_get_default_mask(void);\nint ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,\n                       int inform, unsigned long mask);\nint ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,\n                        int inform, unsigned long mask,\n                        long minsize, long maxsize);\n\nASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out,\n                                    const unsigned char *in, int inlen,\n                                    int inform, int nid);\nASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid);\nint ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long);\nvoid ASN1_STRING_TABLE_cleanup(void);\n\n/* ASN1 template functions */\n\n/* Old API compatible functions */\nASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it);\nvoid ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it);\nASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in,\n                          long len, const ASN1_ITEM *it);\nint ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);\nint ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out,\n                       const ASN1_ITEM *it);\n\nvoid ASN1_add_oid_module(void);\n\nASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf);\nASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf);\n\n/* ASN1 Print flags */\n\n/* Indicate missing OPTIONAL fields */\n# define ASN1_PCTX_FLAGS_SHOW_ABSENT             0x001\n/* Mark start and end of SEQUENCE */\n# define ASN1_PCTX_FLAGS_SHOW_SEQUENCE           0x002\n/* Mark start and end of SEQUENCE/SET OF */\n# define ASN1_PCTX_FLAGS_SHOW_SSOF               0x004\n/* Show the ASN1 type of primitives */\n# define ASN1_PCTX_FLAGS_SHOW_TYPE               0x008\n/* Don't show ASN1 type of ANY */\n# define ASN1_PCTX_FLAGS_NO_ANY_TYPE             0x010\n/* Don't show ASN1 type of MSTRINGs */\n# define ASN1_PCTX_FLAGS_NO_MSTRING_TYPE         0x020\n/* Don't show field names in SEQUENCE */\n# define ASN1_PCTX_FLAGS_NO_FIELD_NAME           0x040\n/* Show structure names of each SEQUENCE field */\n# define ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME  0x080\n/* Don't show structure name even at top level */\n# define ASN1_PCTX_FLAGS_NO_STRUCT_NAME          0x100\n\nint ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent,\n                    const ASN1_ITEM *it, const ASN1_PCTX *pctx);\nASN1_PCTX *ASN1_PCTX_new(void);\nvoid ASN1_PCTX_free(ASN1_PCTX *p);\nunsigned long ASN1_PCTX_get_flags(ASN1_PCTX *p);\nvoid ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags);\nunsigned long ASN1_PCTX_get_nm_flags(ASN1_PCTX *p);\nvoid ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags);\nunsigned long ASN1_PCTX_get_cert_flags(ASN1_PCTX *p);\nvoid ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags);\nunsigned long ASN1_PCTX_get_oid_flags(ASN1_PCTX *p);\nvoid ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags);\nunsigned long ASN1_PCTX_get_str_flags(ASN1_PCTX *p);\nvoid ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags);\n\nBIO_METHOD *BIO_f_asn1(void);\n\nBIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it);\n\nint i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,\n                        const ASN1_ITEM *it);\nint PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,\n                              const char *hdr, const ASN1_ITEM *it);\nint SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,\n                     int ctype_nid, int econt_nid,\n                     STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it);\nASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it);\nint SMIME_crlf_copy(BIO *in, BIO *out, int flags);\nint SMIME_text(BIO *in, BIO *out);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_ASN1_strings(void);\n\n/* Error codes for the ASN1 functions. */\n\n/* Function codes. */\n# define ASN1_F_A2D_ASN1_OBJECT                           100\n# define ASN1_F_A2I_ASN1_ENUMERATED                       101\n# define ASN1_F_A2I_ASN1_INTEGER                          102\n# define ASN1_F_A2I_ASN1_STRING                           103\n# define ASN1_F_APPEND_EXP                                176\n# define ASN1_F_ASN1_BIT_STRING_SET_BIT                   183\n# define ASN1_F_ASN1_CB                                   177\n# define ASN1_F_ASN1_CHECK_TLEN                           104\n# define ASN1_F_ASN1_COLLATE_PRIMITIVE                    105\n# define ASN1_F_ASN1_COLLECT                              106\n# define ASN1_F_ASN1_D2I_EX_PRIMITIVE                     108\n# define ASN1_F_ASN1_D2I_FP                               109\n# define ASN1_F_ASN1_D2I_READ_BIO                         107\n# define ASN1_F_ASN1_DIGEST                               184\n# define ASN1_F_ASN1_DO_ADB                               110\n# define ASN1_F_ASN1_DUP                                  111\n# define ASN1_F_ASN1_ENUMERATED_SET                       112\n# define ASN1_F_ASN1_ENUMERATED_TO_BN                     113\n# define ASN1_F_ASN1_EX_C2I                               204\n# define ASN1_F_ASN1_FIND_END                             190\n# define ASN1_F_ASN1_GENERALIZEDTIME_ADJ                  216\n# define ASN1_F_ASN1_GENERALIZEDTIME_SET                  185\n# define ASN1_F_ASN1_GENERATE_V3                          178\n# define ASN1_F_ASN1_GET_OBJECT                           114\n# define ASN1_F_ASN1_HEADER_NEW                           115\n# define ASN1_F_ASN1_I2D_BIO                              116\n# define ASN1_F_ASN1_I2D_FP                               117\n# define ASN1_F_ASN1_INTEGER_SET                          118\n# define ASN1_F_ASN1_INTEGER_TO_BN                        119\n# define ASN1_F_ASN1_ITEM_D2I_FP                          206\n# define ASN1_F_ASN1_ITEM_DUP                             191\n# define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW                  121\n# define ASN1_F_ASN1_ITEM_EX_D2I                          120\n# define ASN1_F_ASN1_ITEM_I2D_BIO                         192\n# define ASN1_F_ASN1_ITEM_I2D_FP                          193\n# define ASN1_F_ASN1_ITEM_PACK                            198\n# define ASN1_F_ASN1_ITEM_SIGN                            195\n# define ASN1_F_ASN1_ITEM_SIGN_CTX                        220\n# define ASN1_F_ASN1_ITEM_UNPACK                          199\n# define ASN1_F_ASN1_ITEM_VERIFY                          197\n# define ASN1_F_ASN1_MBSTRING_NCOPY                       122\n# define ASN1_F_ASN1_OBJECT_NEW                           123\n# define ASN1_F_ASN1_OUTPUT_DATA                          214\n# define ASN1_F_ASN1_PACK_STRING                          124\n# define ASN1_F_ASN1_PCTX_NEW                             205\n# define ASN1_F_ASN1_PKCS5_PBE_SET                        125\n# define ASN1_F_ASN1_SEQ_PACK                             126\n# define ASN1_F_ASN1_SEQ_UNPACK                           127\n# define ASN1_F_ASN1_SIGN                                 128\n# define ASN1_F_ASN1_STR2TYPE                             179\n# define ASN1_F_ASN1_STRING_SET                           186\n# define ASN1_F_ASN1_STRING_TABLE_ADD                     129\n# define ASN1_F_ASN1_STRING_TYPE_NEW                      130\n# define ASN1_F_ASN1_TEMPLATE_EX_D2I                      132\n# define ASN1_F_ASN1_TEMPLATE_NEW                         133\n# define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I                   131\n# define ASN1_F_ASN1_TIME_ADJ                             217\n# define ASN1_F_ASN1_TIME_SET                             175\n# define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING             134\n# define ASN1_F_ASN1_TYPE_GET_OCTETSTRING                 135\n# define ASN1_F_ASN1_UNPACK_STRING                        136\n# define ASN1_F_ASN1_UTCTIME_ADJ                          218\n# define ASN1_F_ASN1_UTCTIME_SET                          187\n# define ASN1_F_ASN1_VERIFY                               137\n# define ASN1_F_B64_READ_ASN1                             209\n# define ASN1_F_B64_WRITE_ASN1                            210\n# define ASN1_F_BIO_NEW_NDEF                              208\n# define ASN1_F_BITSTR_CB                                 180\n# define ASN1_F_BN_TO_ASN1_ENUMERATED                     138\n# define ASN1_F_BN_TO_ASN1_INTEGER                        139\n# define ASN1_F_C2I_ASN1_BIT_STRING                       189\n# define ASN1_F_C2I_ASN1_INTEGER                          194\n# define ASN1_F_C2I_ASN1_OBJECT                           196\n# define ASN1_F_COLLECT_DATA                              140\n# define ASN1_F_D2I_ASN1_BIT_STRING                       141\n# define ASN1_F_D2I_ASN1_BOOLEAN                          142\n# define ASN1_F_D2I_ASN1_BYTES                            143\n# define ASN1_F_D2I_ASN1_GENERALIZEDTIME                  144\n# define ASN1_F_D2I_ASN1_HEADER                           145\n# define ASN1_F_D2I_ASN1_INTEGER                          146\n# define ASN1_F_D2I_ASN1_OBJECT                           147\n# define ASN1_F_D2I_ASN1_SET                              148\n# define ASN1_F_D2I_ASN1_TYPE_BYTES                       149\n# define ASN1_F_D2I_ASN1_UINTEGER                         150\n# define ASN1_F_D2I_ASN1_UTCTIME                          151\n# define ASN1_F_D2I_AUTOPRIVATEKEY                        207\n# define ASN1_F_D2I_NETSCAPE_RSA                          152\n# define ASN1_F_D2I_NETSCAPE_RSA_2                        153\n# define ASN1_F_D2I_PRIVATEKEY                            154\n# define ASN1_F_D2I_PUBLICKEY                             155\n# define ASN1_F_D2I_RSA_NET                               200\n# define ASN1_F_D2I_RSA_NET_2                             201\n# define ASN1_F_D2I_X509                                  156\n# define ASN1_F_D2I_X509_CINF                             157\n# define ASN1_F_D2I_X509_PKEY                             159\n# define ASN1_F_I2D_ASN1_BIO_STREAM                       211\n# define ASN1_F_I2D_ASN1_SET                              188\n# define ASN1_F_I2D_ASN1_TIME                             160\n# define ASN1_F_I2D_DSA_PUBKEY                            161\n# define ASN1_F_I2D_EC_PUBKEY                             181\n# define ASN1_F_I2D_PRIVATEKEY                            163\n# define ASN1_F_I2D_PUBLICKEY                             164\n# define ASN1_F_I2D_RSA_NET                               162\n# define ASN1_F_I2D_RSA_PUBKEY                            165\n# define ASN1_F_LONG_C2I                                  166\n# define ASN1_F_OID_MODULE_INIT                           174\n# define ASN1_F_PARSE_TAGGING                             182\n# define ASN1_F_PKCS5_PBE2_SET_IV                         167\n# define ASN1_F_PKCS5_PBE_SET                             202\n# define ASN1_F_PKCS5_PBE_SET0_ALGOR                      215\n# define ASN1_F_PKCS5_PBKDF2_SET                          219\n# define ASN1_F_SMIME_READ_ASN1                           212\n# define ASN1_F_SMIME_TEXT                                213\n# define ASN1_F_X509_CINF_NEW                             168\n# define ASN1_F_X509_CRL_ADD0_REVOKED                     169\n# define ASN1_F_X509_INFO_NEW                             170\n# define ASN1_F_X509_NAME_ENCODE                          203\n# define ASN1_F_X509_NAME_EX_D2I                          158\n# define ASN1_F_X509_NAME_EX_NEW                          171\n# define ASN1_F_X509_NEW                                  172\n# define ASN1_F_X509_PKEY_NEW                             173\n\n/* Reason codes. */\n# define ASN1_R_ADDING_OBJECT                             171\n# define ASN1_R_ASN1_PARSE_ERROR                          203\n# define ASN1_R_ASN1_SIG_PARSE_ERROR                      204\n# define ASN1_R_AUX_ERROR                                 100\n# define ASN1_R_BAD_CLASS                                 101\n# define ASN1_R_BAD_OBJECT_HEADER                         102\n# define ASN1_R_BAD_PASSWORD_READ                         103\n# define ASN1_R_BAD_TAG                                   104\n# define ASN1_R_BMPSTRING_IS_WRONG_LENGTH                 214\n# define ASN1_R_BN_LIB                                    105\n# define ASN1_R_BOOLEAN_IS_WRONG_LENGTH                   106\n# define ASN1_R_BUFFER_TOO_SMALL                          107\n# define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER           108\n# define ASN1_R_CONTEXT_NOT_INITIALISED                   217\n# define ASN1_R_DATA_IS_WRONG                             109\n# define ASN1_R_DECODE_ERROR                              110\n# define ASN1_R_DECODING_ERROR                            111\n# define ASN1_R_DEPTH_EXCEEDED                            174\n# define ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED         198\n# define ASN1_R_ENCODE_ERROR                              112\n# define ASN1_R_ERROR_GETTING_TIME                        173\n# define ASN1_R_ERROR_LOADING_SECTION                     172\n# define ASN1_R_ERROR_PARSING_SET_ELEMENT                 113\n# define ASN1_R_ERROR_SETTING_CIPHER_PARAMS               114\n# define ASN1_R_EXPECTING_AN_INTEGER                      115\n# define ASN1_R_EXPECTING_AN_OBJECT                       116\n# define ASN1_R_EXPECTING_A_BOOLEAN                       117\n# define ASN1_R_EXPECTING_A_TIME                          118\n# define ASN1_R_EXPLICIT_LENGTH_MISMATCH                  119\n# define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED              120\n# define ASN1_R_FIELD_MISSING                             121\n# define ASN1_R_FIRST_NUM_TOO_LARGE                       122\n# define ASN1_R_HEADER_TOO_LONG                           123\n# define ASN1_R_ILLEGAL_BITSTRING_FORMAT                  175\n# define ASN1_R_ILLEGAL_BOOLEAN                           176\n# define ASN1_R_ILLEGAL_CHARACTERS                        124\n# define ASN1_R_ILLEGAL_FORMAT                            177\n# define ASN1_R_ILLEGAL_HEX                               178\n# define ASN1_R_ILLEGAL_IMPLICIT_TAG                      179\n# define ASN1_R_ILLEGAL_INTEGER                           180\n# define ASN1_R_ILLEGAL_NESTED_TAGGING                    181\n# define ASN1_R_ILLEGAL_NULL                              125\n# define ASN1_R_ILLEGAL_NULL_VALUE                        182\n# define ASN1_R_ILLEGAL_OBJECT                            183\n# define ASN1_R_ILLEGAL_OPTIONAL_ANY                      126\n# define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE          170\n# define ASN1_R_ILLEGAL_TAGGED_ANY                        127\n# define ASN1_R_ILLEGAL_TIME_VALUE                        184\n# define ASN1_R_INTEGER_NOT_ASCII_FORMAT                  185\n# define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG                128\n# define ASN1_R_INVALID_BIT_STRING_BITS_LEFT              220\n# define ASN1_R_INVALID_BMPSTRING_LENGTH                  129\n# define ASN1_R_INVALID_DIGIT                             130\n# define ASN1_R_INVALID_MIME_TYPE                         205\n# define ASN1_R_INVALID_MODIFIER                          186\n# define ASN1_R_INVALID_NUMBER                            187\n# define ASN1_R_INVALID_OBJECT_ENCODING                   216\n# define ASN1_R_INVALID_SEPARATOR                         131\n# define ASN1_R_INVALID_TIME_FORMAT                       132\n# define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH            133\n# define ASN1_R_INVALID_UTF8STRING                        134\n# define ASN1_R_IV_TOO_LARGE                              135\n# define ASN1_R_LENGTH_ERROR                              136\n# define ASN1_R_LIST_ERROR                                188\n# define ASN1_R_MIME_NO_CONTENT_TYPE                      206\n# define ASN1_R_MIME_PARSE_ERROR                          207\n# define ASN1_R_MIME_SIG_PARSE_ERROR                      208\n# define ASN1_R_MISSING_EOC                               137\n# define ASN1_R_MISSING_SECOND_NUMBER                     138\n# define ASN1_R_MISSING_VALUE                             189\n# define ASN1_R_MSTRING_NOT_UNIVERSAL                     139\n# define ASN1_R_MSTRING_WRONG_TAG                         140\n# define ASN1_R_NESTED_ASN1_STRING                        197\n# define ASN1_R_NESTED_TOO_DEEP                           219\n# define ASN1_R_NON_HEX_CHARACTERS                        141\n# define ASN1_R_NOT_ASCII_FORMAT                          190\n# define ASN1_R_NOT_ENOUGH_DATA                           142\n# define ASN1_R_NO_CONTENT_TYPE                           209\n# define ASN1_R_NO_DEFAULT_DIGEST                         201\n# define ASN1_R_NO_MATCHING_CHOICE_TYPE                   143\n# define ASN1_R_NO_MULTIPART_BODY_FAILURE                 210\n# define ASN1_R_NO_MULTIPART_BOUNDARY                     211\n# define ASN1_R_NO_SIG_CONTENT_TYPE                       212\n# define ASN1_R_NULL_IS_WRONG_LENGTH                      144\n# define ASN1_R_OBJECT_NOT_ASCII_FORMAT                   191\n# define ASN1_R_ODD_NUMBER_OF_CHARS                       145\n# define ASN1_R_PRIVATE_KEY_HEADER_MISSING                146\n# define ASN1_R_SECOND_NUMBER_TOO_LARGE                   147\n# define ASN1_R_SEQUENCE_LENGTH_MISMATCH                  148\n# define ASN1_R_SEQUENCE_NOT_CONSTRUCTED                  149\n# define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG              192\n# define ASN1_R_SHORT_LINE                                150\n# define ASN1_R_SIG_INVALID_MIME_TYPE                     213\n# define ASN1_R_STREAMING_NOT_SUPPORTED                   202\n# define ASN1_R_STRING_TOO_LONG                           151\n# define ASN1_R_STRING_TOO_SHORT                          152\n# define ASN1_R_TAG_VALUE_TOO_HIGH                        153\n# define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154\n# define ASN1_R_TIME_NOT_ASCII_FORMAT                     193\n# define ASN1_R_TOO_LONG                                  155\n# define ASN1_R_TYPE_NOT_CONSTRUCTED                      156\n# define ASN1_R_TYPE_NOT_PRIMITIVE                        218\n# define ASN1_R_UNABLE_TO_DECODE_RSA_KEY                  157\n# define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY          158\n# define ASN1_R_UNEXPECTED_EOC                            159\n# define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH           215\n# define ASN1_R_UNKNOWN_FORMAT                            160\n# define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM          161\n# define ASN1_R_UNKNOWN_OBJECT_TYPE                       162\n# define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE                   163\n# define ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM               199\n# define ASN1_R_UNKNOWN_TAG                               194\n# define ASN1_R_UNKOWN_FORMAT                             195\n# define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE           164\n# define ASN1_R_UNSUPPORTED_CIPHER                        165\n# define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM          166\n# define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE               167\n# define ASN1_R_UNSUPPORTED_TYPE                          196\n# define ASN1_R_WRONG_PUBLIC_KEY_TYPE                     200\n# define ASN1_R_WRONG_TAG                                 168\n# define ASN1_R_WRONG_TYPE                                169\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/asn1_mac.h",
    "content": "/* crypto/asn1/asn1_mac.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_ASN1_MAC_H\n# define HEADER_ASN1_MAC_H\n\n# include <openssl/asn1.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# ifndef ASN1_MAC_ERR_LIB\n#  define ASN1_MAC_ERR_LIB        ERR_LIB_ASN1\n# endif\n\n# define ASN1_MAC_H_err(f,r,line) \\\n        ERR_PUT_error(ASN1_MAC_ERR_LIB,(f),(r),__FILE__,(line))\n\n# define M_ASN1_D2I_vars(a,type,func) \\\n        ASN1_const_CTX c; \\\n        type ret=NULL; \\\n        \\\n        c.pp=(const unsigned char **)pp; \\\n        c.q= *(const unsigned char **)pp; \\\n        c.error=ERR_R_NESTED_ASN1_ERROR; \\\n        if ((a == NULL) || ((*a) == NULL)) \\\n                { if ((ret=(type)func()) == NULL) \\\n                        { c.line=__LINE__; goto err; } } \\\n        else    ret=(*a);\n\n# define M_ASN1_D2I_Init() \\\n        c.p= *(const unsigned char **)pp; \\\n        c.max=(length == 0)?0:(c.p+length);\n\n# define M_ASN1_D2I_Finish_2(a) \\\n        if (!asn1_const_Finish(&c)) \\\n                { c.line=__LINE__; goto err; } \\\n        *(const unsigned char **)pp=c.p; \\\n        if (a != NULL) (*a)=ret; \\\n        return(ret);\n\n# define M_ASN1_D2I_Finish(a,func,e) \\\n        M_ASN1_D2I_Finish_2(a); \\\nerr:\\\n        ASN1_MAC_H_err((e),c.error,c.line); \\\n        asn1_add_error(*(const unsigned char **)pp,(int)(c.q- *pp)); \\\n        if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \\\n        return(NULL)\n\n# define M_ASN1_D2I_start_sequence() \\\n        if (!asn1_GetSequence(&c,&length)) \\\n                { c.line=__LINE__; goto err; }\n/* Begin reading ASN1 without a surrounding sequence */\n# define M_ASN1_D2I_begin() \\\n        c.slen = length;\n\n/* End reading ASN1 with no check on length */\n# define M_ASN1_D2I_Finish_nolen(a, func, e) \\\n        *pp=c.p; \\\n        if (a != NULL) (*a)=ret; \\\n        return(ret); \\\nerr:\\\n        ASN1_MAC_H_err((e),c.error,c.line); \\\n        asn1_add_error(*pp,(int)(c.q- *pp)); \\\n        if ((ret != NULL) && ((a == NULL) || (*a != ret))) func(ret); \\\n        return(NULL)\n\n# define M_ASN1_D2I_end_sequence() \\\n        (((c.inf&1) == 0)?(c.slen <= 0): \\\n                (c.eos=ASN1_const_check_infinite_end(&c.p,c.slen)))\n\n/* Don't use this with d2i_ASN1_BOOLEAN() */\n# define M_ASN1_D2I_get(b, func) \\\n        c.q=c.p; \\\n        if (func(&(b),&c.p,c.slen) == NULL) \\\n                {c.line=__LINE__; goto err; } \\\n        c.slen-=(c.p-c.q);\n\n/* Don't use this with d2i_ASN1_BOOLEAN() */\n# define M_ASN1_D2I_get_x(type,b,func) \\\n        c.q=c.p; \\\n        if (((D2I_OF(type))func)(&(b),&c.p,c.slen) == NULL) \\\n                {c.line=__LINE__; goto err; } \\\n        c.slen-=(c.p-c.q);\n\n/* use this instead () */\n# define M_ASN1_D2I_get_int(b,func) \\\n        c.q=c.p; \\\n        if (func(&(b),&c.p,c.slen) < 0) \\\n                {c.line=__LINE__; goto err; } \\\n        c.slen-=(c.p-c.q);\n\n# define M_ASN1_D2I_get_opt(b,func,type) \\\n        if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \\\n                == (V_ASN1_UNIVERSAL|(type)))) \\\n                { \\\n                M_ASN1_D2I_get(b,func); \\\n                }\n\n# define M_ASN1_D2I_get_int_opt(b,func,type) \\\n        if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) \\\n                == (V_ASN1_UNIVERSAL|(type)))) \\\n                { \\\n                M_ASN1_D2I_get_int(b,func); \\\n                }\n\n# define M_ASN1_D2I_get_imp(b,func, type) \\\n        M_ASN1_next=(_tmp& V_ASN1_CONSTRUCTED)|type; \\\n        c.q=c.p; \\\n        if (func(&(b),&c.p,c.slen) == NULL) \\\n                {c.line=__LINE__; M_ASN1_next_prev = _tmp; goto err; } \\\n        c.slen-=(c.p-c.q);\\\n        M_ASN1_next_prev=_tmp;\n\n# define M_ASN1_D2I_get_IMP_opt(b,func,tag,type) \\\n        if ((c.slen != 0) && ((M_ASN1_next & (~V_ASN1_CONSTRUCTED)) == \\\n                (V_ASN1_CONTEXT_SPECIFIC|(tag)))) \\\n                { \\\n                unsigned char _tmp = M_ASN1_next; \\\n                M_ASN1_D2I_get_imp(b,func, type);\\\n                }\n\n# define M_ASN1_D2I_get_set(r,func,free_func) \\\n                M_ASN1_D2I_get_imp_set(r,func,free_func, \\\n                        V_ASN1_SET,V_ASN1_UNIVERSAL);\n\n# define M_ASN1_D2I_get_set_type(type,r,func,free_func) \\\n                M_ASN1_D2I_get_imp_set_type(type,r,func,free_func, \\\n                        V_ASN1_SET,V_ASN1_UNIVERSAL);\n\n# define M_ASN1_D2I_get_set_opt(r,func,free_func) \\\n        if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \\\n                V_ASN1_CONSTRUCTED|V_ASN1_SET)))\\\n                { M_ASN1_D2I_get_set(r,func,free_func); }\n\n# define M_ASN1_D2I_get_set_opt_type(type,r,func,free_func) \\\n        if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \\\n                V_ASN1_CONSTRUCTED|V_ASN1_SET)))\\\n                { M_ASN1_D2I_get_set_type(type,r,func,free_func); }\n\n# define M_ASN1_I2D_len_SET_opt(a,f) \\\n        if ((a != NULL) && (sk_num(a) != 0)) \\\n                M_ASN1_I2D_len_SET(a,f);\n\n# define M_ASN1_I2D_put_SET_opt(a,f) \\\n        if ((a != NULL) && (sk_num(a) != 0)) \\\n                M_ASN1_I2D_put_SET(a,f);\n\n# define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \\\n        if ((a != NULL) && (sk_num(a) != 0)) \\\n                M_ASN1_I2D_put_SEQUENCE(a,f);\n\n# define M_ASN1_I2D_put_SEQUENCE_opt_type(type,a,f) \\\n        if ((a != NULL) && (sk_##type##_num(a) != 0)) \\\n                M_ASN1_I2D_put_SEQUENCE_type(type,a,f);\n\n# define M_ASN1_D2I_get_IMP_set_opt(b,func,free_func,tag) \\\n        if ((c.slen != 0) && \\\n                (M_ASN1_next == \\\n                (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\\\n                { \\\n                M_ASN1_D2I_get_imp_set(b,func,free_func,\\\n                        tag,V_ASN1_CONTEXT_SPECIFIC); \\\n                }\n\n# define M_ASN1_D2I_get_IMP_set_opt_type(type,b,func,free_func,tag) \\\n        if ((c.slen != 0) && \\\n                (M_ASN1_next == \\\n                (V_ASN1_CONTEXT_SPECIFIC|V_ASN1_CONSTRUCTED|(tag))))\\\n                { \\\n                M_ASN1_D2I_get_imp_set_type(type,b,func,free_func,\\\n                        tag,V_ASN1_CONTEXT_SPECIFIC); \\\n                }\n\n# define M_ASN1_D2I_get_seq(r,func,free_func) \\\n                M_ASN1_D2I_get_imp_set(r,func,free_func,\\\n                        V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL);\n\n# define M_ASN1_D2I_get_seq_type(type,r,func,free_func) \\\n                M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\\\n                                            V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL)\n\n# define M_ASN1_D2I_get_seq_opt(r,func,free_func) \\\n        if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \\\n                V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\\\n                { M_ASN1_D2I_get_seq(r,func,free_func); }\n\n# define M_ASN1_D2I_get_seq_opt_type(type,r,func,free_func) \\\n        if ((c.slen != 0) && (M_ASN1_next == (V_ASN1_UNIVERSAL| \\\n                V_ASN1_CONSTRUCTED|V_ASN1_SEQUENCE)))\\\n                { M_ASN1_D2I_get_seq_type(type,r,func,free_func); }\n\n# define M_ASN1_D2I_get_IMP_set(r,func,free_func,x) \\\n                M_ASN1_D2I_get_imp_set(r,func,free_func,\\\n                        x,V_ASN1_CONTEXT_SPECIFIC);\n\n# define M_ASN1_D2I_get_IMP_set_type(type,r,func,free_func,x) \\\n                M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,\\\n                        x,V_ASN1_CONTEXT_SPECIFIC);\n\n# define M_ASN1_D2I_get_imp_set(r,func,free_func,a,b) \\\n        c.q=c.p; \\\n        if (d2i_ASN1_SET(&(r),&c.p,c.slen,(char *(*)())func,\\\n                (void (*)())free_func,a,b) == NULL) \\\n                { c.line=__LINE__; goto err; } \\\n        c.slen-=(c.p-c.q);\n\n# define M_ASN1_D2I_get_imp_set_type(type,r,func,free_func,a,b) \\\n        c.q=c.p; \\\n        if (d2i_ASN1_SET_OF_##type(&(r),&c.p,c.slen,func,\\\n                                   free_func,a,b) == NULL) \\\n                { c.line=__LINE__; goto err; } \\\n        c.slen-=(c.p-c.q);\n\n# define M_ASN1_D2I_get_set_strings(r,func,a,b) \\\n        c.q=c.p; \\\n        if (d2i_ASN1_STRING_SET(&(r),&c.p,c.slen,a,b) == NULL) \\\n                { c.line=__LINE__; goto err; } \\\n        c.slen-=(c.p-c.q);\n\n# define M_ASN1_D2I_get_EXP_opt(r,func,tag) \\\n        if ((c.slen != 0L) && (M_ASN1_next == \\\n                (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \\\n                { \\\n                int Tinf,Ttag,Tclass; \\\n                long Tlen; \\\n                \\\n                c.q=c.p; \\\n                Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \\\n                if (Tinf & 0x80) \\\n                        { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \\\n                        c.line=__LINE__; goto err; } \\\n                if (Tinf == (V_ASN1_CONSTRUCTED+1)) \\\n                                        Tlen = c.slen - (c.p - c.q) - 2; \\\n                if (func(&(r),&c.p,Tlen) == NULL) \\\n                        { c.line=__LINE__; goto err; } \\\n                if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \\\n                        Tlen = c.slen - (c.p - c.q); \\\n                        if(!ASN1_const_check_infinite_end(&c.p, Tlen)) \\\n                                { c.error=ERR_R_MISSING_ASN1_EOS; \\\n                                c.line=__LINE__; goto err; } \\\n                }\\\n                c.slen-=(c.p-c.q); \\\n                }\n\n# define M_ASN1_D2I_get_EXP_set_opt(r,func,free_func,tag,b) \\\n        if ((c.slen != 0) && (M_ASN1_next == \\\n                (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \\\n                { \\\n                int Tinf,Ttag,Tclass; \\\n                long Tlen; \\\n                \\\n                c.q=c.p; \\\n                Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \\\n                if (Tinf & 0x80) \\\n                        { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \\\n                        c.line=__LINE__; goto err; } \\\n                if (Tinf == (V_ASN1_CONSTRUCTED+1)) \\\n                                        Tlen = c.slen - (c.p - c.q) - 2; \\\n                if (d2i_ASN1_SET(&(r),&c.p,Tlen,(char *(*)())func, \\\n                        (void (*)())free_func, \\\n                        b,V_ASN1_UNIVERSAL) == NULL) \\\n                        { c.line=__LINE__; goto err; } \\\n                if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \\\n                        Tlen = c.slen - (c.p - c.q); \\\n                        if(!ASN1_check_infinite_end(&c.p, Tlen)) \\\n                                { c.error=ERR_R_MISSING_ASN1_EOS; \\\n                                c.line=__LINE__; goto err; } \\\n                }\\\n                c.slen-=(c.p-c.q); \\\n                }\n\n# define M_ASN1_D2I_get_EXP_set_opt_type(type,r,func,free_func,tag,b) \\\n        if ((c.slen != 0) && (M_ASN1_next == \\\n                (V_ASN1_CONSTRUCTED|V_ASN1_CONTEXT_SPECIFIC|tag))) \\\n                { \\\n                int Tinf,Ttag,Tclass; \\\n                long Tlen; \\\n                \\\n                c.q=c.p; \\\n                Tinf=ASN1_get_object(&c.p,&Tlen,&Ttag,&Tclass,c.slen); \\\n                if (Tinf & 0x80) \\\n                        { c.error=ERR_R_BAD_ASN1_OBJECT_HEADER; \\\n                        c.line=__LINE__; goto err; } \\\n                if (Tinf == (V_ASN1_CONSTRUCTED+1)) \\\n                                        Tlen = c.slen - (c.p - c.q) - 2; \\\n                if (d2i_ASN1_SET_OF_##type(&(r),&c.p,Tlen,func, \\\n                        free_func,b,V_ASN1_UNIVERSAL) == NULL) \\\n                        { c.line=__LINE__; goto err; } \\\n                if (Tinf == (V_ASN1_CONSTRUCTED+1)) { \\\n                        Tlen = c.slen - (c.p - c.q); \\\n                        if(!ASN1_check_infinite_end(&c.p, Tlen)) \\\n                                { c.error=ERR_R_MISSING_ASN1_EOS; \\\n                                c.line=__LINE__; goto err; } \\\n                }\\\n                c.slen-=(c.p-c.q); \\\n                }\n\n/* New macros */\n# define M_ASN1_New_Malloc(ret,type) \\\n        if ((ret=(type *)OPENSSL_malloc(sizeof(type))) == NULL) \\\n                { c.line=__LINE__; goto err2; }\n\n# define M_ASN1_New(arg,func) \\\n        if (((arg)=func()) == NULL) return(NULL)\n\n# define M_ASN1_New_Error(a) \\\n/*-     err:    ASN1_MAC_H_err((a),ERR_R_NESTED_ASN1_ERROR,c.line); \\\n                return(NULL);*/ \\\n        err2:   ASN1_MAC_H_err((a),ERR_R_MALLOC_FAILURE,c.line); \\\n                return(NULL)\n\n/*\n * BIG UGLY WARNING! This is so damn ugly I wanna puke.  Unfortunately, some\n * macros that use ASN1_const_CTX still insist on writing in the input\n * stream.  ARGH! ARGH! ARGH! Let's get rid of this macro package. Please? --\n * Richard Levitte\n */\n# define M_ASN1_next             (*((unsigned char *)(c.p)))\n# define M_ASN1_next_prev        (*((unsigned char *)(c.q)))\n\n/*************************************************/\n\n# define M_ASN1_I2D_vars(a)      int r=0,ret=0; \\\n                                unsigned char *p; \\\n                                if (a == NULL) return(0)\n\n/* Length Macros */\n# define M_ASN1_I2D_len(a,f)     ret+=f(a,NULL)\n# define M_ASN1_I2D_len_IMP_opt(a,f)     if (a != NULL) M_ASN1_I2D_len(a,f)\n\n# define M_ASN1_I2D_len_SET(a,f) \\\n                ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET);\n\n# define M_ASN1_I2D_len_SET_type(type,a,f) \\\n                ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SET, \\\n                                            V_ASN1_UNIVERSAL,IS_SET);\n\n# define M_ASN1_I2D_len_SEQUENCE(a,f) \\\n                ret+=i2d_ASN1_SET(a,NULL,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \\\n                                  IS_SEQUENCE);\n\n# define M_ASN1_I2D_len_SEQUENCE_type(type,a,f) \\\n                ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,V_ASN1_SEQUENCE, \\\n                                            V_ASN1_UNIVERSAL,IS_SEQUENCE)\n\n# define M_ASN1_I2D_len_SEQUENCE_opt(a,f) \\\n                if ((a != NULL) && (sk_num(a) != 0)) \\\n                        M_ASN1_I2D_len_SEQUENCE(a,f);\n\n# define M_ASN1_I2D_len_SEQUENCE_opt_type(type,a,f) \\\n                if ((a != NULL) && (sk_##type##_num(a) != 0)) \\\n                        M_ASN1_I2D_len_SEQUENCE_type(type,a,f);\n\n# define M_ASN1_I2D_len_IMP_SET(a,f,x) \\\n                ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET);\n\n# define M_ASN1_I2D_len_IMP_SET_type(type,a,f,x) \\\n                ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \\\n                                            V_ASN1_CONTEXT_SPECIFIC,IS_SET);\n\n# define M_ASN1_I2D_len_IMP_SET_opt(a,f,x) \\\n                if ((a != NULL) && (sk_num(a) != 0)) \\\n                        ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \\\n                                          IS_SET);\n\n# define M_ASN1_I2D_len_IMP_SET_opt_type(type,a,f,x) \\\n                if ((a != NULL) && (sk_##type##_num(a) != 0)) \\\n                        ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \\\n                                               V_ASN1_CONTEXT_SPECIFIC,IS_SET);\n\n# define M_ASN1_I2D_len_IMP_SEQUENCE(a,f,x) \\\n                ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \\\n                                  IS_SEQUENCE);\n\n# define M_ASN1_I2D_len_IMP_SEQUENCE_opt(a,f,x) \\\n                if ((a != NULL) && (sk_num(a) != 0)) \\\n                        ret+=i2d_ASN1_SET(a,NULL,f,x,V_ASN1_CONTEXT_SPECIFIC, \\\n                                          IS_SEQUENCE);\n\n# define M_ASN1_I2D_len_IMP_SEQUENCE_opt_type(type,a,f,x) \\\n                if ((a != NULL) && (sk_##type##_num(a) != 0)) \\\n                        ret+=i2d_ASN1_SET_OF_##type(a,NULL,f,x, \\\n                                                    V_ASN1_CONTEXT_SPECIFIC, \\\n                                                    IS_SEQUENCE);\n\n# define M_ASN1_I2D_len_EXP_opt(a,f,mtag,v) \\\n                if (a != NULL)\\\n                        { \\\n                        v=f(a,NULL); \\\n                        ret+=ASN1_object_size(1,v,mtag); \\\n                        }\n\n# define M_ASN1_I2D_len_EXP_SET_opt(a,f,mtag,tag,v) \\\n                if ((a != NULL) && (sk_num(a) != 0))\\\n                        { \\\n                        v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL,IS_SET); \\\n                        ret+=ASN1_object_size(1,v,mtag); \\\n                        }\n\n# define M_ASN1_I2D_len_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \\\n                if ((a != NULL) && (sk_num(a) != 0))\\\n                        { \\\n                        v=i2d_ASN1_SET(a,NULL,f,tag,V_ASN1_UNIVERSAL, \\\n                                       IS_SEQUENCE); \\\n                        ret+=ASN1_object_size(1,v,mtag); \\\n                        }\n\n# define M_ASN1_I2D_len_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \\\n                if ((a != NULL) && (sk_##type##_num(a) != 0))\\\n                        { \\\n                        v=i2d_ASN1_SET_OF_##type(a,NULL,f,tag, \\\n                                                 V_ASN1_UNIVERSAL, \\\n                                                 IS_SEQUENCE); \\\n                        ret+=ASN1_object_size(1,v,mtag); \\\n                        }\n\n/* Put Macros */\n# define M_ASN1_I2D_put(a,f)     f(a,&p)\n\n# define M_ASN1_I2D_put_IMP_opt(a,f,t)   \\\n                if (a != NULL) \\\n                        { \\\n                        unsigned char *q=p; \\\n                        f(a,&p); \\\n                        *q=(V_ASN1_CONTEXT_SPECIFIC|t|(*q&V_ASN1_CONSTRUCTED));\\\n                        }\n\n# define M_ASN1_I2D_put_SET(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SET,\\\n                        V_ASN1_UNIVERSAL,IS_SET)\n# define M_ASN1_I2D_put_SET_type(type,a,f) \\\n     i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SET,V_ASN1_UNIVERSAL,IS_SET)\n# define M_ASN1_I2D_put_IMP_SET(a,f,x) i2d_ASN1_SET(a,&p,f,x,\\\n                        V_ASN1_CONTEXT_SPECIFIC,IS_SET)\n# define M_ASN1_I2D_put_IMP_SET_type(type,a,f,x) \\\n     i2d_ASN1_SET_OF_##type(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC,IS_SET)\n# define M_ASN1_I2D_put_IMP_SEQUENCE(a,f,x) i2d_ASN1_SET(a,&p,f,x,\\\n                        V_ASN1_CONTEXT_SPECIFIC,IS_SEQUENCE)\n\n# define M_ASN1_I2D_put_SEQUENCE(a,f) i2d_ASN1_SET(a,&p,f,V_ASN1_SEQUENCE,\\\n                                             V_ASN1_UNIVERSAL,IS_SEQUENCE)\n\n# define M_ASN1_I2D_put_SEQUENCE_type(type,a,f) \\\n     i2d_ASN1_SET_OF_##type(a,&p,f,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL, \\\n                            IS_SEQUENCE)\n\n# define M_ASN1_I2D_put_SEQUENCE_opt(a,f) \\\n                if ((a != NULL) && (sk_num(a) != 0)) \\\n                        M_ASN1_I2D_put_SEQUENCE(a,f);\n\n# define M_ASN1_I2D_put_IMP_SET_opt(a,f,x) \\\n                if ((a != NULL) && (sk_num(a) != 0)) \\\n                        { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \\\n                                       IS_SET); }\n\n# define M_ASN1_I2D_put_IMP_SET_opt_type(type,a,f,x) \\\n                if ((a != NULL) && (sk_##type##_num(a) != 0)) \\\n                        { i2d_ASN1_SET_OF_##type(a,&p,f,x, \\\n                                                 V_ASN1_CONTEXT_SPECIFIC, \\\n                                                 IS_SET); }\n\n# define M_ASN1_I2D_put_IMP_SEQUENCE_opt(a,f,x) \\\n                if ((a != NULL) && (sk_num(a) != 0)) \\\n                        { i2d_ASN1_SET(a,&p,f,x,V_ASN1_CONTEXT_SPECIFIC, \\\n                                       IS_SEQUENCE); }\n\n# define M_ASN1_I2D_put_IMP_SEQUENCE_opt_type(type,a,f,x) \\\n                if ((a != NULL) && (sk_##type##_num(a) != 0)) \\\n                        { i2d_ASN1_SET_OF_##type(a,&p,f,x, \\\n                                                 V_ASN1_CONTEXT_SPECIFIC, \\\n                                                 IS_SEQUENCE); }\n\n# define M_ASN1_I2D_put_EXP_opt(a,f,tag,v) \\\n                if (a != NULL) \\\n                        { \\\n                        ASN1_put_object(&p,1,v,tag,V_ASN1_CONTEXT_SPECIFIC); \\\n                        f(a,&p); \\\n                        }\n\n# define M_ASN1_I2D_put_EXP_SET_opt(a,f,mtag,tag,v) \\\n                if ((a != NULL) && (sk_num(a) != 0)) \\\n                        { \\\n                        ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \\\n                        i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SET); \\\n                        }\n\n# define M_ASN1_I2D_put_EXP_SEQUENCE_opt(a,f,mtag,tag,v) \\\n                if ((a != NULL) && (sk_num(a) != 0)) \\\n                        { \\\n                        ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \\\n                        i2d_ASN1_SET(a,&p,f,tag,V_ASN1_UNIVERSAL,IS_SEQUENCE); \\\n                        }\n\n# define M_ASN1_I2D_put_EXP_SEQUENCE_opt_type(type,a,f,mtag,tag,v) \\\n                if ((a != NULL) && (sk_##type##_num(a) != 0)) \\\n                        { \\\n                        ASN1_put_object(&p,1,v,mtag,V_ASN1_CONTEXT_SPECIFIC); \\\n                        i2d_ASN1_SET_OF_##type(a,&p,f,tag,V_ASN1_UNIVERSAL, \\\n                                               IS_SEQUENCE); \\\n                        }\n\n# define M_ASN1_I2D_seq_total() \\\n                r=ASN1_object_size(1,ret,V_ASN1_SEQUENCE); \\\n                if (pp == NULL) return(r); \\\n                p= *pp; \\\n                ASN1_put_object(&p,1,ret,V_ASN1_SEQUENCE,V_ASN1_UNIVERSAL)\n\n# define M_ASN1_I2D_INF_seq_start(tag,ctx) \\\n                *(p++)=(V_ASN1_CONSTRUCTED|(tag)|(ctx)); \\\n                *(p++)=0x80\n\n# define M_ASN1_I2D_INF_seq_end() *(p++)=0x00; *(p++)=0x00\n\n# define M_ASN1_I2D_finish()     *pp=p; \\\n                                return(r);\n\nint asn1_GetSequence(ASN1_const_CTX *c, long *length);\nvoid asn1_add_error(const unsigned char *address, int offset);\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/asn1t.h",
    "content": "/* asn1t.h */\n/*\n * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project\n * 2000.\n */\n/* ====================================================================\n * Copyright (c) 2000-2005 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n#ifndef HEADER_ASN1T_H\n# define HEADER_ASN1T_H\n\n# include <stddef.h>\n# include <openssl/e_os2.h>\n# include <openssl/asn1.h>\n\n# ifdef OPENSSL_BUILD_SHLIBCRYPTO\n#  undef OPENSSL_EXTERN\n#  define OPENSSL_EXTERN OPENSSL_EXPORT\n# endif\n\n/* ASN1 template defines, structures and functions */\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION\n\n/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */\n#  define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr))\n\n/* Macros for start and end of ASN1_ITEM definition */\n\n#  define ASN1_ITEM_start(itname) \\\n        OPENSSL_GLOBAL const ASN1_ITEM itname##_it = {\n\n#  define ASN1_ITEM_end(itname) \\\n                };\n\n# else\n\n/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */\n#  define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr()))\n\n/* Macros for start and end of ASN1_ITEM definition */\n\n#  define ASN1_ITEM_start(itname) \\\n        const ASN1_ITEM * itname##_it(void) \\\n        { \\\n                static const ASN1_ITEM local_it = {\n\n#  define ASN1_ITEM_end(itname) \\\n                }; \\\n        return &local_it; \\\n        }\n\n# endif\n\n/* Macros to aid ASN1 template writing */\n\n# define ASN1_ITEM_TEMPLATE(tname) \\\n        static const ASN1_TEMPLATE tname##_item_tt\n\n# define ASN1_ITEM_TEMPLATE_END(tname) \\\n        ;\\\n        ASN1_ITEM_start(tname) \\\n                ASN1_ITYPE_PRIMITIVE,\\\n                -1,\\\n                &tname##_item_tt,\\\n                0,\\\n                NULL,\\\n                0,\\\n                #tname \\\n        ASN1_ITEM_end(tname)\n\n/* This is a ASN1 type which just embeds a template */\n\n/*-\n * This pair helps declare a SEQUENCE. We can do:\n *\n *      ASN1_SEQUENCE(stname) = {\n *              ... SEQUENCE components ...\n *      } ASN1_SEQUENCE_END(stname)\n *\n *      This will produce an ASN1_ITEM called stname_it\n *      for a structure called stname.\n *\n *      If you want the same structure but a different\n *      name then use:\n *\n *      ASN1_SEQUENCE(itname) = {\n *              ... SEQUENCE components ...\n *      } ASN1_SEQUENCE_END_name(stname, itname)\n *\n *      This will create an item called itname_it using\n *      a structure called stname.\n */\n\n# define ASN1_SEQUENCE(tname) \\\n        static const ASN1_TEMPLATE tname##_seq_tt[]\n\n# define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)\n\n# define ASN1_SEQUENCE_END_name(stname, tname) \\\n        ;\\\n        ASN1_ITEM_start(tname) \\\n                ASN1_ITYPE_SEQUENCE,\\\n                V_ASN1_SEQUENCE,\\\n                tname##_seq_tt,\\\n                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\\\n                NULL,\\\n                sizeof(stname),\\\n                #stname \\\n        ASN1_ITEM_end(tname)\n\n# define ASN1_NDEF_SEQUENCE(tname) \\\n        ASN1_SEQUENCE(tname)\n\n# define ASN1_NDEF_SEQUENCE_cb(tname, cb) \\\n        ASN1_SEQUENCE_cb(tname, cb)\n\n# define ASN1_SEQUENCE_cb(tname, cb) \\\n        static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \\\n        ASN1_SEQUENCE(tname)\n\n# define ASN1_BROKEN_SEQUENCE(tname) \\\n        static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \\\n        ASN1_SEQUENCE(tname)\n\n# define ASN1_SEQUENCE_ref(tname, cb, lck) \\\n        static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), lck, cb, 0}; \\\n        ASN1_SEQUENCE(tname)\n\n# define ASN1_SEQUENCE_enc(tname, enc, cb) \\\n        static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \\\n        ASN1_SEQUENCE(tname)\n\n# define ASN1_NDEF_SEQUENCE_END(tname) \\\n        ;\\\n        ASN1_ITEM_start(tname) \\\n                ASN1_ITYPE_NDEF_SEQUENCE,\\\n                V_ASN1_SEQUENCE,\\\n                tname##_seq_tt,\\\n                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\\\n                NULL,\\\n                sizeof(tname),\\\n                #tname \\\n        ASN1_ITEM_end(tname)\n\n# define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname)\n\n# define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)\n\n# define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)\n\n# define ASN1_SEQUENCE_END_ref(stname, tname) \\\n        ;\\\n        ASN1_ITEM_start(tname) \\\n                ASN1_ITYPE_SEQUENCE,\\\n                V_ASN1_SEQUENCE,\\\n                tname##_seq_tt,\\\n                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\\\n                &tname##_aux,\\\n                sizeof(stname),\\\n                #stname \\\n        ASN1_ITEM_end(tname)\n\n# define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \\\n        ;\\\n        ASN1_ITEM_start(tname) \\\n                ASN1_ITYPE_NDEF_SEQUENCE,\\\n                V_ASN1_SEQUENCE,\\\n                tname##_seq_tt,\\\n                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\\\n                &tname##_aux,\\\n                sizeof(stname),\\\n                #stname \\\n        ASN1_ITEM_end(tname)\n\n/*-\n * This pair helps declare a CHOICE type. We can do:\n *\n *      ASN1_CHOICE(chname) = {\n *              ... CHOICE options ...\n *      ASN1_CHOICE_END(chname)\n *\n *      This will produce an ASN1_ITEM called chname_it\n *      for a structure called chname. The structure\n *      definition must look like this:\n *      typedef struct {\n *              int type;\n *              union {\n *                      ASN1_SOMETHING *opt1;\n *                      ASN1_SOMEOTHER *opt2;\n *              } value;\n *      } chname;\n *\n *      the name of the selector must be 'type'.\n *      to use an alternative selector name use the\n *      ASN1_CHOICE_END_selector() version.\n */\n\n# define ASN1_CHOICE(tname) \\\n        static const ASN1_TEMPLATE tname##_ch_tt[]\n\n# define ASN1_CHOICE_cb(tname, cb) \\\n        static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \\\n        ASN1_CHOICE(tname)\n\n# define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname)\n\n# define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type)\n\n# define ASN1_CHOICE_END_selector(stname, tname, selname) \\\n        ;\\\n        ASN1_ITEM_start(tname) \\\n                ASN1_ITYPE_CHOICE,\\\n                offsetof(stname,selname) ,\\\n                tname##_ch_tt,\\\n                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\\\n                NULL,\\\n                sizeof(stname),\\\n                #stname \\\n        ASN1_ITEM_end(tname)\n\n# define ASN1_CHOICE_END_cb(stname, tname, selname) \\\n        ;\\\n        ASN1_ITEM_start(tname) \\\n                ASN1_ITYPE_CHOICE,\\\n                offsetof(stname,selname) ,\\\n                tname##_ch_tt,\\\n                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\\\n                &tname##_aux,\\\n                sizeof(stname),\\\n                #stname \\\n        ASN1_ITEM_end(tname)\n\n/* This helps with the template wrapper form of ASN1_ITEM */\n\n# define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \\\n        (flags), (tag), 0,\\\n        #name, ASN1_ITEM_ref(type) }\n\n/* These help with SEQUENCE or CHOICE components */\n\n/* used to declare other types */\n\n# define ASN1_EX_TYPE(flags, tag, stname, field, type) { \\\n        (flags), (tag), offsetof(stname, field),\\\n        #field, ASN1_ITEM_ref(type) }\n\n/* used when the structure is combined with the parent */\n\n# define ASN1_EX_COMBINE(flags, tag, type) { \\\n        (flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) }\n\n/* implicit and explicit helper macros */\n\n# define ASN1_IMP_EX(stname, field, type, tag, ex) \\\n                ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type)\n\n# define ASN1_EXP_EX(stname, field, type, tag, ex) \\\n                ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type)\n\n/* Any defined by macros: the field used is in the table itself */\n\n# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION\n#  define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }\n#  define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }\n# else\n#  define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }\n#  define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }\n# endif\n/* Plain simple type */\n# define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)\n\n/* OPTIONAL simple type */\n# define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type)\n\n/* IMPLICIT tagged simple type */\n# define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0)\n\n/* IMPLICIT tagged OPTIONAL simple type */\n# define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)\n\n/* Same as above but EXPLICIT */\n\n# define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)\n# define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)\n\n/* SEQUENCE OF type */\n# define ASN1_SEQUENCE_OF(stname, field, type) \\\n                ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)\n\n/* OPTIONAL SEQUENCE OF */\n# define ASN1_SEQUENCE_OF_OPT(stname, field, type) \\\n                ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)\n\n/* Same as above but for SET OF */\n\n# define ASN1_SET_OF(stname, field, type) \\\n                ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)\n\n# define ASN1_SET_OF_OPT(stname, field, type) \\\n                ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)\n\n/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */\n\n# define ASN1_IMP_SET_OF(stname, field, type, tag) \\\n                        ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)\n\n# define ASN1_EXP_SET_OF(stname, field, type, tag) \\\n                        ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)\n\n# define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \\\n                        ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)\n\n# define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \\\n                        ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)\n\n# define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \\\n                        ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)\n\n# define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \\\n                        ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)\n\n# define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \\\n                        ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)\n\n# define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \\\n                        ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)\n\n/* EXPLICIT using indefinite length constructed form */\n# define ASN1_NDEF_EXP(stname, field, type, tag) \\\n                        ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF)\n\n/* EXPLICIT OPTIONAL using indefinite length constructed form */\n# define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \\\n                        ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)\n\n/* Macros for the ASN1_ADB structure */\n\n# define ASN1_ADB(name) \\\n        static const ASN1_ADB_TABLE name##_adbtbl[]\n\n# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION\n\n#  define ASN1_ADB_END(name, flags, field, app_table, def, none) \\\n        ;\\\n        static const ASN1_ADB name##_adb = {\\\n                flags,\\\n                offsetof(name, field),\\\n                app_table,\\\n                name##_adbtbl,\\\n                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\\\n                def,\\\n                none\\\n        }\n\n# else\n\n#  define ASN1_ADB_END(name, flags, field, app_table, def, none) \\\n        ;\\\n        static const ASN1_ITEM *name##_adb(void) \\\n        { \\\n        static const ASN1_ADB internal_adb = \\\n                {\\\n                flags,\\\n                offsetof(name, field),\\\n                app_table,\\\n                name##_adbtbl,\\\n                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\\\n                def,\\\n                none\\\n                }; \\\n                return (const ASN1_ITEM *) &internal_adb; \\\n        } \\\n        void dummy_function(void)\n\n# endif\n\n# define ADB_ENTRY(val, template) {val, template}\n\n# define ASN1_ADB_TEMPLATE(name) \\\n        static const ASN1_TEMPLATE name##_tt\n\n/*\n * This is the ASN1 template structure that defines a wrapper round the\n * actual type. It determines the actual position of the field in the value\n * structure, various flags such as OPTIONAL and the field name.\n */\n\nstruct ASN1_TEMPLATE_st {\n    unsigned long flags;        /* Various flags */\n    long tag;                   /* tag, not used if no tagging */\n    unsigned long offset;       /* Offset of this field in structure */\n# ifndef NO_ASN1_FIELD_NAMES\n    const char *field_name;     /* Field name */\n# endif\n    ASN1_ITEM_EXP *item;        /* Relevant ASN1_ITEM or ASN1_ADB */\n};\n\n/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */\n\n# define ASN1_TEMPLATE_item(t) (t->item_ptr)\n# define ASN1_TEMPLATE_adb(t) (t->item_ptr)\n\ntypedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE;\ntypedef struct ASN1_ADB_st ASN1_ADB;\n\nstruct ASN1_ADB_st {\n    unsigned long flags;        /* Various flags */\n    unsigned long offset;       /* Offset of selector field */\n    STACK_OF(ASN1_ADB_TABLE) **app_items; /* Application defined items */\n    const ASN1_ADB_TABLE *tbl;  /* Table of possible types */\n    long tblcount;              /* Number of entries in tbl */\n    const ASN1_TEMPLATE *default_tt; /* Type to use if no match */\n    const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */\n};\n\nstruct ASN1_ADB_TABLE_st {\n    long value;                 /* NID for an object or value for an int */\n    const ASN1_TEMPLATE tt;     /* item for this value */\n};\n\n/* template flags */\n\n/* Field is optional */\n# define ASN1_TFLG_OPTIONAL      (0x1)\n\n/* Field is a SET OF */\n# define ASN1_TFLG_SET_OF        (0x1 << 1)\n\n/* Field is a SEQUENCE OF */\n# define ASN1_TFLG_SEQUENCE_OF   (0x2 << 1)\n\n/*\n * Special case: this refers to a SET OF that will be sorted into DER order\n * when encoded *and* the corresponding STACK will be modified to match the\n * new order.\n */\n# define ASN1_TFLG_SET_ORDER     (0x3 << 1)\n\n/* Mask for SET OF or SEQUENCE OF */\n# define ASN1_TFLG_SK_MASK       (0x3 << 1)\n\n/*\n * These flags mean the tag should be taken from the tag field. If EXPLICIT\n * then the underlying type is used for the inner tag.\n */\n\n/* IMPLICIT tagging */\n# define ASN1_TFLG_IMPTAG        (0x1 << 3)\n\n/* EXPLICIT tagging, inner tag from underlying type */\n# define ASN1_TFLG_EXPTAG        (0x2 << 3)\n\n# define ASN1_TFLG_TAG_MASK      (0x3 << 3)\n\n/* context specific IMPLICIT */\n# define ASN1_TFLG_IMPLICIT      ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT\n\n/* context specific EXPLICIT */\n# define ASN1_TFLG_EXPLICIT      ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT\n\n/*\n * If tagging is in force these determine the type of tag to use. Otherwise\n * the tag is determined by the underlying type. These values reflect the\n * actual octet format.\n */\n\n/* Universal tag */\n# define ASN1_TFLG_UNIVERSAL     (0x0<<6)\n/* Application tag */\n# define ASN1_TFLG_APPLICATION   (0x1<<6)\n/* Context specific tag */\n# define ASN1_TFLG_CONTEXT       (0x2<<6)\n/* Private tag */\n# define ASN1_TFLG_PRIVATE       (0x3<<6)\n\n# define ASN1_TFLG_TAG_CLASS     (0x3<<6)\n\n/*\n * These are for ANY DEFINED BY type. In this case the 'item' field points to\n * an ASN1_ADB structure which contains a table of values to decode the\n * relevant type\n */\n\n# define ASN1_TFLG_ADB_MASK      (0x3<<8)\n\n# define ASN1_TFLG_ADB_OID       (0x1<<8)\n\n# define ASN1_TFLG_ADB_INT       (0x1<<9)\n\n/*\n * This flag means a parent structure is passed instead of the field: this is\n * useful is a SEQUENCE is being combined with a CHOICE for example. Since\n * this means the structure and item name will differ we need to use the\n * ASN1_CHOICE_END_name() macro for example.\n */\n\n# define ASN1_TFLG_COMBINE       (0x1<<10)\n\n/*\n * This flag when present in a SEQUENCE OF, SET OF or EXPLICIT causes\n * indefinite length constructed encoding to be used if required.\n */\n\n# define ASN1_TFLG_NDEF          (0x1<<11)\n\n/* This is the actual ASN1 item itself */\n\nstruct ASN1_ITEM_st {\n    char itype;                 /* The item type, primitive, SEQUENCE, CHOICE\n                                 * or extern */\n    long utype;                 /* underlying type */\n    const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains\n                                     * the contents */\n    long tcount;                /* Number of templates if SEQUENCE or CHOICE */\n    const void *funcs;          /* functions that handle this type */\n    long size;                  /* Structure size (usually) */\n# ifndef NO_ASN1_FIELD_NAMES\n    const char *sname;          /* Structure name */\n# endif\n};\n\n/*-\n * These are values for the itype field and\n * determine how the type is interpreted.\n *\n * For PRIMITIVE types the underlying type\n * determines the behaviour if items is NULL.\n *\n * Otherwise templates must contain a single\n * template and the type is treated in the\n * same way as the type specified in the template.\n *\n * For SEQUENCE types the templates field points\n * to the members, the size field is the\n * structure size.\n *\n * For CHOICE types the templates field points\n * to each possible member (typically a union)\n * and the 'size' field is the offset of the\n * selector.\n *\n * The 'funcs' field is used for application\n * specific functions.\n *\n * For COMPAT types the funcs field gives a\n * set of functions that handle this type, this\n * supports the old d2i, i2d convention.\n *\n * The EXTERN type uses a new style d2i/i2d.\n * The new style should be used where possible\n * because it avoids things like the d2i IMPLICIT\n * hack.\n *\n * MSTRING is a multiple string type, it is used\n * for a CHOICE of character strings where the\n * actual strings all occupy an ASN1_STRING\n * structure. In this case the 'utype' field\n * has a special meaning, it is used as a mask\n * of acceptable types using the B_ASN1 constants.\n *\n * NDEF_SEQUENCE is the same as SEQUENCE except\n * that it will use indefinite length constructed\n * encoding if requested.\n *\n */\n\n# define ASN1_ITYPE_PRIMITIVE            0x0\n\n# define ASN1_ITYPE_SEQUENCE             0x1\n\n# define ASN1_ITYPE_CHOICE               0x2\n\n# define ASN1_ITYPE_COMPAT               0x3\n\n# define ASN1_ITYPE_EXTERN               0x4\n\n# define ASN1_ITYPE_MSTRING              0x5\n\n# define ASN1_ITYPE_NDEF_SEQUENCE        0x6\n\n/*\n * Cache for ASN1 tag and length, so we don't keep re-reading it for things\n * like CHOICE\n */\n\nstruct ASN1_TLC_st {\n    char valid;                 /* Values below are valid */\n    int ret;                    /* return value */\n    long plen;                  /* length */\n    int ptag;                   /* class value */\n    int pclass;                 /* class value */\n    int hdrlen;                 /* header length */\n};\n\n/* Typedefs for ASN1 function pointers */\n\ntypedef ASN1_VALUE *ASN1_new_func(void);\ntypedef void ASN1_free_func(ASN1_VALUE *a);\ntypedef ASN1_VALUE *ASN1_d2i_func(ASN1_VALUE **a, const unsigned char **in,\n                                  long length);\ntypedef int ASN1_i2d_func(ASN1_VALUE *a, unsigned char **in);\n\ntypedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,\n                        const ASN1_ITEM *it, int tag, int aclass, char opt,\n                        ASN1_TLC *ctx);\n\ntypedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out,\n                        const ASN1_ITEM *it, int tag, int aclass);\ntypedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it);\ntypedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it);\n\ntypedef int ASN1_ex_print_func(BIO *out, ASN1_VALUE **pval,\n                               int indent, const char *fname,\n                               const ASN1_PCTX *pctx);\n\ntypedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont,\n                               int *putype, const ASN1_ITEM *it);\ntypedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont,\n                               int len, int utype, char *free_cont,\n                               const ASN1_ITEM *it);\ntypedef int ASN1_primitive_print(BIO *out, ASN1_VALUE **pval,\n                                 const ASN1_ITEM *it, int indent,\n                                 const ASN1_PCTX *pctx);\n\ntypedef struct ASN1_COMPAT_FUNCS_st {\n    ASN1_new_func *asn1_new;\n    ASN1_free_func *asn1_free;\n    ASN1_d2i_func *asn1_d2i;\n    ASN1_i2d_func *asn1_i2d;\n} ASN1_COMPAT_FUNCS;\n\ntypedef struct ASN1_EXTERN_FUNCS_st {\n    void *app_data;\n    ASN1_ex_new_func *asn1_ex_new;\n    ASN1_ex_free_func *asn1_ex_free;\n    ASN1_ex_free_func *asn1_ex_clear;\n    ASN1_ex_d2i *asn1_ex_d2i;\n    ASN1_ex_i2d *asn1_ex_i2d;\n    ASN1_ex_print_func *asn1_ex_print;\n} ASN1_EXTERN_FUNCS;\n\ntypedef struct ASN1_PRIMITIVE_FUNCS_st {\n    void *app_data;\n    unsigned long flags;\n    ASN1_ex_new_func *prim_new;\n    ASN1_ex_free_func *prim_free;\n    ASN1_ex_free_func *prim_clear;\n    ASN1_primitive_c2i *prim_c2i;\n    ASN1_primitive_i2c *prim_i2c;\n    ASN1_primitive_print *prim_print;\n} ASN1_PRIMITIVE_FUNCS;\n\n/*\n * This is the ASN1_AUX structure: it handles various miscellaneous\n * requirements. For example the use of reference counts and an informational\n * callback. The \"informational callback\" is called at various points during\n * the ASN1 encoding and decoding. It can be used to provide minor\n * customisation of the structures used. This is most useful where the\n * supplied routines *almost* do the right thing but need some extra help at\n * a few points. If the callback returns zero then it is assumed a fatal\n * error has occurred and the main operation should be abandoned. If major\n * changes in the default behaviour are required then an external type is\n * more appropriate.\n */\n\ntypedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it,\n                        void *exarg);\n\ntypedef struct ASN1_AUX_st {\n    void *app_data;\n    int flags;\n    int ref_offset;             /* Offset of reference value */\n    int ref_lock;               /* Lock type to use */\n    ASN1_aux_cb *asn1_cb;\n    int enc_offset;             /* Offset of ASN1_ENCODING structure */\n} ASN1_AUX;\n\n/* For print related callbacks exarg points to this structure */\ntypedef struct ASN1_PRINT_ARG_st {\n    BIO *out;\n    int indent;\n    const ASN1_PCTX *pctx;\n} ASN1_PRINT_ARG;\n\n/* For streaming related callbacks exarg points to this structure */\ntypedef struct ASN1_STREAM_ARG_st {\n    /* BIO to stream through */\n    BIO *out;\n    /* BIO with filters appended */\n    BIO *ndef_bio;\n    /* Streaming I/O boundary */\n    unsigned char **boundary;\n} ASN1_STREAM_ARG;\n\n/* Flags in ASN1_AUX */\n\n/* Use a reference count */\n# define ASN1_AFLG_REFCOUNT      1\n/* Save the encoding of structure (useful for signatures) */\n# define ASN1_AFLG_ENCODING      2\n/* The Sequence length is invalid */\n# define ASN1_AFLG_BROKEN        4\n\n/* operation values for asn1_cb */\n\n# define ASN1_OP_NEW_PRE         0\n# define ASN1_OP_NEW_POST        1\n# define ASN1_OP_FREE_PRE        2\n# define ASN1_OP_FREE_POST       3\n# define ASN1_OP_D2I_PRE         4\n# define ASN1_OP_D2I_POST        5\n# define ASN1_OP_I2D_PRE         6\n# define ASN1_OP_I2D_POST        7\n# define ASN1_OP_PRINT_PRE       8\n# define ASN1_OP_PRINT_POST      9\n# define ASN1_OP_STREAM_PRE      10\n# define ASN1_OP_STREAM_POST     11\n# define ASN1_OP_DETACHED_PRE    12\n# define ASN1_OP_DETACHED_POST   13\n\n/* Macro to implement a primitive type */\n# define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)\n# define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \\\n                                ASN1_ITEM_start(itname) \\\n                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \\\n                                ASN1_ITEM_end(itname)\n\n/* Macro to implement a multi string type */\n# define IMPLEMENT_ASN1_MSTRING(itname, mask) \\\n                                ASN1_ITEM_start(itname) \\\n                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \\\n                                ASN1_ITEM_end(itname)\n\n/* Macro to implement an ASN1_ITEM in terms of old style funcs */\n\n# define IMPLEMENT_COMPAT_ASN1(sname) IMPLEMENT_COMPAT_ASN1_type(sname, V_ASN1_SEQUENCE)\n\n# define IMPLEMENT_COMPAT_ASN1_type(sname, tag) \\\n        static const ASN1_COMPAT_FUNCS sname##_ff = { \\\n                (ASN1_new_func *)sname##_new, \\\n                (ASN1_free_func *)sname##_free, \\\n                (ASN1_d2i_func *)d2i_##sname, \\\n                (ASN1_i2d_func *)i2d_##sname, \\\n        }; \\\n        ASN1_ITEM_start(sname) \\\n                ASN1_ITYPE_COMPAT, \\\n                tag, \\\n                NULL, \\\n                0, \\\n                &sname##_ff, \\\n                0, \\\n                #sname \\\n        ASN1_ITEM_end(sname)\n\n# define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \\\n        ASN1_ITEM_start(sname) \\\n                ASN1_ITYPE_EXTERN, \\\n                tag, \\\n                NULL, \\\n                0, \\\n                &fptrs, \\\n                0, \\\n                #sname \\\n        ASN1_ITEM_end(sname)\n\n/* Macro to implement standard functions in terms of ASN1_ITEM structures */\n\n# define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname)\n\n# define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname)\n\n# define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \\\n                        IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname)\n\n# define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \\\n                IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname)\n\n# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \\\n                IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname)\n\n# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \\\n        pre stname *fname##_new(void) \\\n        { \\\n                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \\\n        } \\\n        pre void fname##_free(stname *a) \\\n        { \\\n                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \\\n        }\n\n# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \\\n        stname *fname##_new(void) \\\n        { \\\n                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \\\n        } \\\n        void fname##_free(stname *a) \\\n        { \\\n                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \\\n        }\n\n# define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \\\n        IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \\\n        IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)\n\n# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \\\n        stname *d2i_##fname(stname **a, const unsigned char **in, long len) \\\n        { \\\n                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\\\n        } \\\n        int i2d_##fname(stname *a, unsigned char **out) \\\n        { \\\n                return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\\\n        }\n\n# define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \\\n        int i2d_##stname##_NDEF(stname *a, unsigned char **out) \\\n        { \\\n                return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\\\n        }\n\n/*\n * This includes evil casts to remove const: they will go away when full ASN1\n * constification is done.\n */\n# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \\\n        stname *d2i_##fname(stname **a, const unsigned char **in, long len) \\\n        { \\\n                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\\\n        } \\\n        int i2d_##fname(const stname *a, unsigned char **out) \\\n        { \\\n                return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\\\n        }\n\n# define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \\\n        stname * stname##_dup(stname *x) \\\n        { \\\n        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \\\n        }\n\n# define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \\\n        IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname)\n\n# define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \\\n        int fname##_print_ctx(BIO *out, stname *x, int indent, \\\n                                                const ASN1_PCTX *pctx) \\\n        { \\\n                return ASN1_item_print(out, (ASN1_VALUE *)x, indent, \\\n                        ASN1_ITEM_rptr(itname), pctx); \\\n        }\n\n# define IMPLEMENT_ASN1_FUNCTIONS_const(name) \\\n                IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name)\n\n# define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \\\n        IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \\\n        IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)\n\n/* external definitions for primitive types */\n\nDECLARE_ASN1_ITEM(ASN1_BOOLEAN)\nDECLARE_ASN1_ITEM(ASN1_TBOOLEAN)\nDECLARE_ASN1_ITEM(ASN1_FBOOLEAN)\nDECLARE_ASN1_ITEM(ASN1_SEQUENCE)\nDECLARE_ASN1_ITEM(CBIGNUM)\nDECLARE_ASN1_ITEM(BIGNUM)\nDECLARE_ASN1_ITEM(LONG)\nDECLARE_ASN1_ITEM(ZLONG)\n\nDECLARE_STACK_OF(ASN1_VALUE)\n\n/* Functions used internally by the ASN1 code */\n\nint ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it);\nvoid ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it);\nint ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);\nint ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it);\n\nvoid ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);\nint ASN1_template_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,\n                      const ASN1_TEMPLATE *tt);\nint ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,\n                     const ASN1_ITEM *it, int tag, int aclass, char opt,\n                     ASN1_TLC *ctx);\n\nint ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,\n                     const ASN1_ITEM *it, int tag, int aclass);\nint ASN1_template_i2d(ASN1_VALUE **pval, unsigned char **out,\n                      const ASN1_TEMPLATE *tt);\nvoid ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it);\n\nint asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype,\n                const ASN1_ITEM *it);\nint asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,\n                int utype, char *free_cont, const ASN1_ITEM *it);\n\nint asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it);\nint asn1_set_choice_selector(ASN1_VALUE **pval, int value,\n                             const ASN1_ITEM *it);\n\nASN1_VALUE **asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt);\n\nconst ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt,\n                                 int nullerr);\n\nint asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it);\n\nvoid asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it);\nvoid asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it);\nint asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval,\n                     const ASN1_ITEM *it);\nint asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen,\n                  const ASN1_ITEM *it);\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/bio.h",
    "content": "/* crypto/bio/bio.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_BIO_H\n# define HEADER_BIO_H\n\n# include <openssl/e_os2.h>\n\n# ifndef OPENSSL_NO_FP_API\n#  include <stdio.h>\n# endif\n# include <stdarg.h>\n\n# include <openssl/crypto.h>\n\n# ifndef OPENSSL_NO_SCTP\n#  ifndef OPENSSL_SYS_VMS\n#   include <stdint.h>\n#  else\n#   include <inttypes.h>\n#  endif\n# endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* These are the 'types' of BIOs */\n# define BIO_TYPE_NONE           0\n# define BIO_TYPE_MEM            (1|0x0400)\n# define BIO_TYPE_FILE           (2|0x0400)\n\n# define BIO_TYPE_FD             (4|0x0400|0x0100)\n# define BIO_TYPE_SOCKET         (5|0x0400|0x0100)\n# define BIO_TYPE_NULL           (6|0x0400)\n# define BIO_TYPE_SSL            (7|0x0200)\n# define BIO_TYPE_MD             (8|0x0200)/* passive filter */\n# define BIO_TYPE_BUFFER         (9|0x0200)/* filter */\n# define BIO_TYPE_CIPHER         (10|0x0200)/* filter */\n# define BIO_TYPE_BASE64         (11|0x0200)/* filter */\n# define BIO_TYPE_CONNECT        (12|0x0400|0x0100)/* socket - connect */\n# define BIO_TYPE_ACCEPT         (13|0x0400|0x0100)/* socket for accept */\n# define BIO_TYPE_PROXY_CLIENT   (14|0x0200)/* client proxy BIO */\n# define BIO_TYPE_PROXY_SERVER   (15|0x0200)/* server proxy BIO */\n# define BIO_TYPE_NBIO_TEST      (16|0x0200)/* server proxy BIO */\n# define BIO_TYPE_NULL_FILTER    (17|0x0200)\n# define BIO_TYPE_BER            (18|0x0200)/* BER -> bin filter */\n# define BIO_TYPE_BIO            (19|0x0400)/* (half a) BIO pair */\n# define BIO_TYPE_LINEBUFFER     (20|0x0200)/* filter */\n# define BIO_TYPE_DGRAM          (21|0x0400|0x0100)\n# ifndef OPENSSL_NO_SCTP\n#  define BIO_TYPE_DGRAM_SCTP     (24|0x0400|0x0100)\n# endif\n# define BIO_TYPE_ASN1           (22|0x0200)/* filter */\n# define BIO_TYPE_COMP           (23|0x0200)/* filter */\n\n# define BIO_TYPE_DESCRIPTOR     0x0100/* socket, fd, connect or accept */\n# define BIO_TYPE_FILTER         0x0200\n# define BIO_TYPE_SOURCE_SINK    0x0400\n\n/*\n * BIO_FILENAME_READ|BIO_CLOSE to open or close on free.\n * BIO_set_fp(in,stdin,BIO_NOCLOSE);\n */\n# define BIO_NOCLOSE             0x00\n# define BIO_CLOSE               0x01\n\n/*\n * These are used in the following macros and are passed to BIO_ctrl()\n */\n# define BIO_CTRL_RESET          1/* opt - rewind/zero etc */\n# define BIO_CTRL_EOF            2/* opt - are we at the eof */\n# define BIO_CTRL_INFO           3/* opt - extra tit-bits */\n# define BIO_CTRL_SET            4/* man - set the 'IO' type */\n# define BIO_CTRL_GET            5/* man - get the 'IO' type */\n# define BIO_CTRL_PUSH           6/* opt - internal, used to signify change */\n# define BIO_CTRL_POP            7/* opt - internal, used to signify change */\n# define BIO_CTRL_GET_CLOSE      8/* man - set the 'close' on free */\n# define BIO_CTRL_SET_CLOSE      9/* man - set the 'close' on free */\n# define BIO_CTRL_PENDING        10/* opt - is their more data buffered */\n# define BIO_CTRL_FLUSH          11/* opt - 'flush' buffered output */\n# define BIO_CTRL_DUP            12/* man - extra stuff for 'duped' BIO */\n# define BIO_CTRL_WPENDING       13/* opt - number of bytes still to write */\n/* callback is int cb(BIO *bio,state,ret); */\n# define BIO_CTRL_SET_CALLBACK   14/* opt - set callback function */\n# define BIO_CTRL_GET_CALLBACK   15/* opt - set callback function */\n\n# define BIO_CTRL_SET_FILENAME   30/* BIO_s_file special */\n\n/* dgram BIO stuff */\n# define BIO_CTRL_DGRAM_CONNECT       31/* BIO dgram special */\n# define BIO_CTRL_DGRAM_SET_CONNECTED 32/* allow for an externally connected\n                                         * socket to be passed in */\n# define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33/* setsockopt, essentially */\n# define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34/* getsockopt, essentially */\n# define BIO_CTRL_DGRAM_SET_SEND_TIMEOUT 35/* setsockopt, essentially */\n# define BIO_CTRL_DGRAM_GET_SEND_TIMEOUT 36/* getsockopt, essentially */\n\n# define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37/* flag whether the last */\n# define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38/* I/O operation tiemd out */\n\n/* #ifdef IP_MTU_DISCOVER */\n# define BIO_CTRL_DGRAM_MTU_DISCOVER       39/* set DF bit on egress packets */\n/* #endif */\n\n# define BIO_CTRL_DGRAM_QUERY_MTU          40/* as kernel for current MTU */\n# define BIO_CTRL_DGRAM_GET_FALLBACK_MTU   47\n# define BIO_CTRL_DGRAM_GET_MTU            41/* get cached value for MTU */\n# define BIO_CTRL_DGRAM_SET_MTU            42/* set cached value for MTU.\n                                              * want to use this if asking\n                                              * the kernel fails */\n\n# define BIO_CTRL_DGRAM_MTU_EXCEEDED       43/* check whether the MTU was\n                                              * exceed in the previous write\n                                              * operation */\n\n# define BIO_CTRL_DGRAM_GET_PEER           46\n# define BIO_CTRL_DGRAM_SET_PEER           44/* Destination for the data */\n\n# define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT   45/* Next DTLS handshake timeout\n                                              * to adjust socket timeouts */\n# define BIO_CTRL_DGRAM_SET_DONT_FRAG      48\n\n# define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD   49\n\n# ifndef OPENSSL_NO_SCTP\n/* SCTP stuff */\n#  define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE    50\n#  define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY                51\n#  define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY               52\n#  define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD               53\n#  define BIO_CTRL_DGRAM_SCTP_GET_SNDINFO         60\n#  define BIO_CTRL_DGRAM_SCTP_SET_SNDINFO         61\n#  define BIO_CTRL_DGRAM_SCTP_GET_RCVINFO         62\n#  define BIO_CTRL_DGRAM_SCTP_SET_RCVINFO         63\n#  define BIO_CTRL_DGRAM_SCTP_GET_PRINFO                  64\n#  define BIO_CTRL_DGRAM_SCTP_SET_PRINFO                  65\n#  define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN               70\n# endif\n\n/* modifiers */\n# define BIO_FP_READ             0x02\n# define BIO_FP_WRITE            0x04\n# define BIO_FP_APPEND           0x08\n# define BIO_FP_TEXT             0x10\n\n# define BIO_FLAGS_READ          0x01\n# define BIO_FLAGS_WRITE         0x02\n# define BIO_FLAGS_IO_SPECIAL    0x04\n# define BIO_FLAGS_RWS (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)\n# define BIO_FLAGS_SHOULD_RETRY  0x08\n# ifndef BIO_FLAGS_UPLINK\n/*\n * \"UPLINK\" flag denotes file descriptors provided by application. It\n * defaults to 0, as most platforms don't require UPLINK interface.\n */\n#  define BIO_FLAGS_UPLINK        0\n# endif\n\n/* Used in BIO_gethostbyname() */\n# define BIO_GHBN_CTRL_HITS              1\n# define BIO_GHBN_CTRL_MISSES            2\n# define BIO_GHBN_CTRL_CACHE_SIZE        3\n# define BIO_GHBN_CTRL_GET_ENTRY         4\n# define BIO_GHBN_CTRL_FLUSH             5\n\n/* Mostly used in the SSL BIO */\n/*-\n * Not used anymore\n * #define BIO_FLAGS_PROTOCOL_DELAYED_READ 0x10\n * #define BIO_FLAGS_PROTOCOL_DELAYED_WRITE 0x20\n * #define BIO_FLAGS_PROTOCOL_STARTUP   0x40\n */\n\n# define BIO_FLAGS_BASE64_NO_NL  0x100\n\n/*\n * This is used with memory BIOs: it means we shouldn't free up or change the\n * data in any way.\n */\n# define BIO_FLAGS_MEM_RDONLY    0x200\n\ntypedef struct bio_st BIO;\n\nvoid BIO_set_flags(BIO *b, int flags);\nint BIO_test_flags(const BIO *b, int flags);\nvoid BIO_clear_flags(BIO *b, int flags);\n\n# define BIO_get_flags(b) BIO_test_flags(b, ~(0x0))\n# define BIO_set_retry_special(b) \\\n                BIO_set_flags(b, (BIO_FLAGS_IO_SPECIAL|BIO_FLAGS_SHOULD_RETRY))\n# define BIO_set_retry_read(b) \\\n                BIO_set_flags(b, (BIO_FLAGS_READ|BIO_FLAGS_SHOULD_RETRY))\n# define BIO_set_retry_write(b) \\\n                BIO_set_flags(b, (BIO_FLAGS_WRITE|BIO_FLAGS_SHOULD_RETRY))\n\n/* These are normally used internally in BIOs */\n# define BIO_clear_retry_flags(b) \\\n                BIO_clear_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))\n# define BIO_get_retry_flags(b) \\\n                BIO_test_flags(b, (BIO_FLAGS_RWS|BIO_FLAGS_SHOULD_RETRY))\n\n/* These should be used by the application to tell why we should retry */\n# define BIO_should_read(a)              BIO_test_flags(a, BIO_FLAGS_READ)\n# define BIO_should_write(a)             BIO_test_flags(a, BIO_FLAGS_WRITE)\n# define BIO_should_io_special(a)        BIO_test_flags(a, BIO_FLAGS_IO_SPECIAL)\n# define BIO_retry_type(a)               BIO_test_flags(a, BIO_FLAGS_RWS)\n# define BIO_should_retry(a)             BIO_test_flags(a, BIO_FLAGS_SHOULD_RETRY)\n\n/*\n * The next three are used in conjunction with the BIO_should_io_special()\n * condition.  After this returns true, BIO *BIO_get_retry_BIO(BIO *bio, int\n * *reason); will walk the BIO stack and return the 'reason' for the special\n * and the offending BIO. Given a BIO, BIO_get_retry_reason(bio) will return\n * the code.\n */\n/*\n * Returned from the SSL bio when the certificate retrieval code had an error\n */\n# define BIO_RR_SSL_X509_LOOKUP          0x01\n/* Returned from the connect BIO when a connect would have blocked */\n# define BIO_RR_CONNECT                  0x02\n/* Returned from the accept BIO when an accept would have blocked */\n# define BIO_RR_ACCEPT                   0x03\n\n/* These are passed by the BIO callback */\n# define BIO_CB_FREE     0x01\n# define BIO_CB_READ     0x02\n# define BIO_CB_WRITE    0x03\n# define BIO_CB_PUTS     0x04\n# define BIO_CB_GETS     0x05\n# define BIO_CB_CTRL     0x06\n\n/*\n * The callback is called before and after the underling operation, The\n * BIO_CB_RETURN flag indicates if it is after the call\n */\n# define BIO_CB_RETURN   0x80\n# define BIO_CB_return(a) ((a)|BIO_CB_RETURN)\n# define BIO_cb_pre(a)   (!((a)&BIO_CB_RETURN))\n# define BIO_cb_post(a)  ((a)&BIO_CB_RETURN)\n\nlong (*BIO_get_callback(const BIO *b)) (struct bio_st *, int, const char *,\n                                        int, long, long);\nvoid BIO_set_callback(BIO *b,\n                      long (*callback) (struct bio_st *, int, const char *,\n                                        int, long, long));\nchar *BIO_get_callback_arg(const BIO *b);\nvoid BIO_set_callback_arg(BIO *b, char *arg);\n\nconst char *BIO_method_name(const BIO *b);\nint BIO_method_type(const BIO *b);\n\ntypedef void bio_info_cb (struct bio_st *, int, const char *, int, long,\n                          long);\n\ntypedef struct bio_method_st {\n    int type;\n    const char *name;\n    int (*bwrite) (BIO *, const char *, int);\n    int (*bread) (BIO *, char *, int);\n    int (*bputs) (BIO *, const char *);\n    int (*bgets) (BIO *, char *, int);\n    long (*ctrl) (BIO *, int, long, void *);\n    int (*create) (BIO *);\n    int (*destroy) (BIO *);\n    long (*callback_ctrl) (BIO *, int, bio_info_cb *);\n} BIO_METHOD;\n\nstruct bio_st {\n    BIO_METHOD *method;\n    /* bio, mode, argp, argi, argl, ret */\n    long (*callback) (struct bio_st *, int, const char *, int, long, long);\n    char *cb_arg;               /* first argument for the callback */\n    int init;\n    int shutdown;\n    int flags;                  /* extra storage */\n    int retry_reason;\n    int num;\n    void *ptr;\n    struct bio_st *next_bio;    /* used by filter BIOs */\n    struct bio_st *prev_bio;    /* used by filter BIOs */\n    int references;\n    unsigned long num_read;\n    unsigned long num_write;\n    CRYPTO_EX_DATA ex_data;\n};\n\nDECLARE_STACK_OF(BIO)\n\ntypedef struct bio_f_buffer_ctx_struct {\n    /*-\n     * Buffers are setup like this:\n     *\n     * <---------------------- size ----------------------->\n     * +---------------------------------------------------+\n     * | consumed | remaining          | free space        |\n     * +---------------------------------------------------+\n     * <-- off --><------- len ------->\n     */\n    /*- BIO *bio; *//*\n     * this is now in the BIO struct\n     */\n    int ibuf_size;              /* how big is the input buffer */\n    int obuf_size;              /* how big is the output buffer */\n    char *ibuf;                 /* the char array */\n    int ibuf_len;               /* how many bytes are in it */\n    int ibuf_off;               /* write/read offset */\n    char *obuf;                 /* the char array */\n    int obuf_len;               /* how many bytes are in it */\n    int obuf_off;               /* write/read offset */\n} BIO_F_BUFFER_CTX;\n\n/* Prefix and suffix callback in ASN1 BIO */\ntypedef int asn1_ps_func (BIO *b, unsigned char **pbuf, int *plen,\n                          void *parg);\n\n# ifndef OPENSSL_NO_SCTP\n/* SCTP parameter structs */\nstruct bio_dgram_sctp_sndinfo {\n    uint16_t snd_sid;\n    uint16_t snd_flags;\n    uint32_t snd_ppid;\n    uint32_t snd_context;\n};\n\nstruct bio_dgram_sctp_rcvinfo {\n    uint16_t rcv_sid;\n    uint16_t rcv_ssn;\n    uint16_t rcv_flags;\n    uint32_t rcv_ppid;\n    uint32_t rcv_tsn;\n    uint32_t rcv_cumtsn;\n    uint32_t rcv_context;\n};\n\nstruct bio_dgram_sctp_prinfo {\n    uint16_t pr_policy;\n    uint32_t pr_value;\n};\n# endif\n\n/* connect BIO stuff */\n# define BIO_CONN_S_BEFORE               1\n# define BIO_CONN_S_GET_IP               2\n# define BIO_CONN_S_GET_PORT             3\n# define BIO_CONN_S_CREATE_SOCKET        4\n# define BIO_CONN_S_CONNECT              5\n# define BIO_CONN_S_OK                   6\n# define BIO_CONN_S_BLOCKED_CONNECT      7\n# define BIO_CONN_S_NBIO                 8\n/*\n * #define BIO_CONN_get_param_hostname BIO_ctrl\n */\n\n# define BIO_C_SET_CONNECT                       100\n# define BIO_C_DO_STATE_MACHINE                  101\n# define BIO_C_SET_NBIO                          102\n# define BIO_C_SET_PROXY_PARAM                   103\n# define BIO_C_SET_FD                            104\n# define BIO_C_GET_FD                            105\n# define BIO_C_SET_FILE_PTR                      106\n# define BIO_C_GET_FILE_PTR                      107\n# define BIO_C_SET_FILENAME                      108\n# define BIO_C_SET_SSL                           109\n# define BIO_C_GET_SSL                           110\n# define BIO_C_SET_MD                            111\n# define BIO_C_GET_MD                            112\n# define BIO_C_GET_CIPHER_STATUS                 113\n# define BIO_C_SET_BUF_MEM                       114\n# define BIO_C_GET_BUF_MEM_PTR                   115\n# define BIO_C_GET_BUFF_NUM_LINES                116\n# define BIO_C_SET_BUFF_SIZE                     117\n# define BIO_C_SET_ACCEPT                        118\n# define BIO_C_SSL_MODE                          119\n# define BIO_C_GET_MD_CTX                        120\n# define BIO_C_GET_PROXY_PARAM                   121\n# define BIO_C_SET_BUFF_READ_DATA                122/* data to read first */\n# define BIO_C_GET_CONNECT                       123\n# define BIO_C_GET_ACCEPT                        124\n# define BIO_C_SET_SSL_RENEGOTIATE_BYTES         125\n# define BIO_C_GET_SSL_NUM_RENEGOTIATES          126\n# define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT       127\n# define BIO_C_FILE_SEEK                         128\n# define BIO_C_GET_CIPHER_CTX                    129\n# define BIO_C_SET_BUF_MEM_EOF_RETURN            130/* return end of input\n                                                     * value */\n# define BIO_C_SET_BIND_MODE                     131\n# define BIO_C_GET_BIND_MODE                     132\n# define BIO_C_FILE_TELL                         133\n# define BIO_C_GET_SOCKS                         134\n# define BIO_C_SET_SOCKS                         135\n\n# define BIO_C_SET_WRITE_BUF_SIZE                136/* for BIO_s_bio */\n# define BIO_C_GET_WRITE_BUF_SIZE                137\n# define BIO_C_MAKE_BIO_PAIR                     138\n# define BIO_C_DESTROY_BIO_PAIR                  139\n# define BIO_C_GET_WRITE_GUARANTEE               140\n# define BIO_C_GET_READ_REQUEST                  141\n# define BIO_C_SHUTDOWN_WR                       142\n# define BIO_C_NREAD0                            143\n# define BIO_C_NREAD                             144\n# define BIO_C_NWRITE0                           145\n# define BIO_C_NWRITE                            146\n# define BIO_C_RESET_READ_REQUEST                147\n# define BIO_C_SET_MD_CTX                        148\n\n# define BIO_C_SET_PREFIX                        149\n# define BIO_C_GET_PREFIX                        150\n# define BIO_C_SET_SUFFIX                        151\n# define BIO_C_GET_SUFFIX                        152\n\n# define BIO_C_SET_EX_ARG                        153\n# define BIO_C_GET_EX_ARG                        154\n\n# define BIO_set_app_data(s,arg)         BIO_set_ex_data(s,0,arg)\n# define BIO_get_app_data(s)             BIO_get_ex_data(s,0)\n\n/* BIO_s_connect() and BIO_s_socks4a_connect() */\n# define BIO_set_conn_hostname(b,name) BIO_ctrl(b,BIO_C_SET_CONNECT,0,(char *)name)\n# define BIO_set_conn_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,1,(char *)port)\n# define BIO_set_conn_ip(b,ip)     BIO_ctrl(b,BIO_C_SET_CONNECT,2,(char *)ip)\n# define BIO_set_conn_int_port(b,port) BIO_ctrl(b,BIO_C_SET_CONNECT,3,(char *)port)\n# define BIO_get_conn_hostname(b)  BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,0)\n# define BIO_get_conn_port(b)      BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,1)\n# define BIO_get_conn_ip(b)               BIO_ptr_ctrl(b,BIO_C_GET_CONNECT,2)\n# define BIO_get_conn_int_port(b) BIO_ctrl(b,BIO_C_GET_CONNECT,3,NULL)\n\n# define BIO_set_nbio(b,n)       BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL)\n\n/* BIO_s_accept() */\n# define BIO_set_accept_port(b,name) BIO_ctrl(b,BIO_C_SET_ACCEPT,0,(char *)name)\n# define BIO_get_accept_port(b)  BIO_ptr_ctrl(b,BIO_C_GET_ACCEPT,0)\n/* #define BIO_set_nbio(b,n)    BIO_ctrl(b,BIO_C_SET_NBIO,(n),NULL) */\n# define BIO_set_nbio_accept(b,n) BIO_ctrl(b,BIO_C_SET_ACCEPT,1,(n)?(void *)\"a\":NULL)\n# define BIO_set_accept_bios(b,bio) BIO_ctrl(b,BIO_C_SET_ACCEPT,2,(char *)bio)\n\n# define BIO_BIND_NORMAL                 0\n# define BIO_BIND_REUSEADDR_IF_UNUSED    1\n# define BIO_BIND_REUSEADDR              2\n# define BIO_set_bind_mode(b,mode) BIO_ctrl(b,BIO_C_SET_BIND_MODE,mode,NULL)\n# define BIO_get_bind_mode(b,mode) BIO_ctrl(b,BIO_C_GET_BIND_MODE,0,NULL)\n\n/* BIO_s_accept() and BIO_s_connect() */\n# define BIO_do_connect(b)       BIO_do_handshake(b)\n# define BIO_do_accept(b)        BIO_do_handshake(b)\n# define BIO_do_handshake(b)     BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)\n\n/* BIO_s_proxy_client() */\n# define BIO_set_url(b,url)      BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,0,(char *)(url))\n# define BIO_set_proxies(b,p)    BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,1,(char *)(p))\n/* BIO_set_nbio(b,n) */\n# define BIO_set_filter_bio(b,s) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,2,(char *)(s))\n/* BIO *BIO_get_filter_bio(BIO *bio); */\n# define BIO_set_proxy_cb(b,cb) BIO_callback_ctrl(b,BIO_C_SET_PROXY_PARAM,3,(void *(*cb)()))\n# define BIO_set_proxy_header(b,sk) BIO_ctrl(b,BIO_C_SET_PROXY_PARAM,4,(char *)sk)\n# define BIO_set_no_connect_return(b,bool) BIO_int_ctrl(b,BIO_C_SET_PROXY_PARAM,5,bool)\n\n# define BIO_get_proxy_header(b,skp) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,0,(char *)skp)\n# define BIO_get_proxies(b,pxy_p) BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,1,(char *)(pxy_p))\n# define BIO_get_url(b,url)      BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,2,(char *)(url))\n# define BIO_get_no_connect_return(b)    BIO_ctrl(b,BIO_C_GET_PROXY_PARAM,5,NULL)\n\n/* BIO_s_datagram(), BIO_s_fd(), BIO_s_socket(), BIO_s_accept() and BIO_s_connect() */\n# define BIO_set_fd(b,fd,c)      BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)\n# define BIO_get_fd(b,c)         BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c)\n\n/* BIO_s_file() */\n# define BIO_set_fp(b,fp,c)      BIO_ctrl(b,BIO_C_SET_FILE_PTR,c,(char *)fp)\n# define BIO_get_fp(b,fpp)       BIO_ctrl(b,BIO_C_GET_FILE_PTR,0,(char *)fpp)\n\n/* BIO_s_fd() and BIO_s_file() */\n# define BIO_seek(b,ofs) (int)BIO_ctrl(b,BIO_C_FILE_SEEK,ofs,NULL)\n# define BIO_tell(b)     (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)\n\n/*\n * name is cast to lose const, but might be better to route through a\n * function so we can do it safely\n */\n# ifdef CONST_STRICT\n/*\n * If you are wondering why this isn't defined, its because CONST_STRICT is\n * purely a compile-time kludge to allow const to be checked.\n */\nint BIO_read_filename(BIO *b, const char *name);\n# else\n#  define BIO_read_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \\\n                BIO_CLOSE|BIO_FP_READ,(char *)name)\n# endif\n# define BIO_write_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \\\n                BIO_CLOSE|BIO_FP_WRITE,name)\n# define BIO_append_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \\\n                BIO_CLOSE|BIO_FP_APPEND,name)\n# define BIO_rw_filename(b,name) BIO_ctrl(b,BIO_C_SET_FILENAME, \\\n                BIO_CLOSE|BIO_FP_READ|BIO_FP_WRITE,name)\n\n/*\n * WARNING WARNING, this ups the reference count on the read bio of the SSL\n * structure.  This is because the ssl read BIO is now pointed to by the\n * next_bio field in the bio.  So when you free the BIO, make sure you are\n * doing a BIO_free_all() to catch the underlying BIO.\n */\n# define BIO_set_ssl(b,ssl,c)    BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl)\n# define BIO_get_ssl(b,sslp)     BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp)\n# define BIO_set_ssl_mode(b,client)      BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL)\n# define BIO_set_ssl_renegotiate_bytes(b,num) \\\n        BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL)\n# define BIO_get_num_renegotiates(b) \\\n        BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL)\n# define BIO_set_ssl_renegotiate_timeout(b,seconds) \\\n        BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL)\n\n/* defined in evp.h */\n/* #define BIO_set_md(b,md)     BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */\n\n# define BIO_get_mem_data(b,pp)  BIO_ctrl(b,BIO_CTRL_INFO,0,(char *)pp)\n# define BIO_set_mem_buf(b,bm,c) BIO_ctrl(b,BIO_C_SET_BUF_MEM,c,(char *)bm)\n# define BIO_get_mem_ptr(b,pp)   BIO_ctrl(b,BIO_C_GET_BUF_MEM_PTR,0,(char *)pp)\n# define BIO_set_mem_eof_return(b,v) \\\n                                BIO_ctrl(b,BIO_C_SET_BUF_MEM_EOF_RETURN,v,NULL)\n\n/* For the BIO_f_buffer() type */\n# define BIO_get_buffer_num_lines(b)     BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)\n# define BIO_set_buffer_size(b,size)     BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)\n# define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)\n# define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)\n# define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)\n\n/* Don't use the next one unless you know what you are doing :-) */\n# define BIO_dup_state(b,ret)    BIO_ctrl(b,BIO_CTRL_DUP,0,(char *)(ret))\n\n# define BIO_reset(b)            (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL)\n# define BIO_eof(b)              (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)\n# define BIO_set_close(b,c)      (int)BIO_ctrl(b,BIO_CTRL_SET_CLOSE,(c),NULL)\n# define BIO_get_close(b)        (int)BIO_ctrl(b,BIO_CTRL_GET_CLOSE,0,NULL)\n# define BIO_pending(b)          (int)BIO_ctrl(b,BIO_CTRL_PENDING,0,NULL)\n# define BIO_wpending(b)         (int)BIO_ctrl(b,BIO_CTRL_WPENDING,0,NULL)\n/* ...pending macros have inappropriate return type */\nsize_t BIO_ctrl_pending(BIO *b);\nsize_t BIO_ctrl_wpending(BIO *b);\n# define BIO_flush(b)            (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL)\n# define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0, \\\n                                                   cbp)\n# define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,cb)\n\n/* For the BIO_f_buffer() type */\n# define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL)\n\n/* For BIO_s_bio() */\n# define BIO_set_write_buf_size(b,size) (int)BIO_ctrl(b,BIO_C_SET_WRITE_BUF_SIZE,size,NULL)\n# define BIO_get_write_buf_size(b,size) (size_t)BIO_ctrl(b,BIO_C_GET_WRITE_BUF_SIZE,size,NULL)\n# define BIO_make_bio_pair(b1,b2)   (int)BIO_ctrl(b1,BIO_C_MAKE_BIO_PAIR,0,b2)\n# define BIO_destroy_bio_pair(b)    (int)BIO_ctrl(b,BIO_C_DESTROY_BIO_PAIR,0,NULL)\n# define BIO_shutdown_wr(b) (int)BIO_ctrl(b, BIO_C_SHUTDOWN_WR, 0, NULL)\n/* macros with inappropriate type -- but ...pending macros use int too: */\n# define BIO_get_write_guarantee(b) (int)BIO_ctrl(b,BIO_C_GET_WRITE_GUARANTEE,0,NULL)\n# define BIO_get_read_request(b)    (int)BIO_ctrl(b,BIO_C_GET_READ_REQUEST,0,NULL)\nsize_t BIO_ctrl_get_write_guarantee(BIO *b);\nsize_t BIO_ctrl_get_read_request(BIO *b);\nint BIO_ctrl_reset_read_request(BIO *b);\n\n/* ctrl macros for dgram */\n# define BIO_ctrl_dgram_connect(b,peer)  \\\n                     (int)BIO_ctrl(b,BIO_CTRL_DGRAM_CONNECT,0, (char *)peer)\n# define BIO_ctrl_set_connected(b, state, peer) \\\n         (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_CONNECTED, state, (char *)peer)\n# define BIO_dgram_recv_timedout(b) \\\n         (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP, 0, NULL)\n# define BIO_dgram_send_timedout(b) \\\n         (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP, 0, NULL)\n# define BIO_dgram_get_peer(b,peer) \\\n         (int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)peer)\n# define BIO_dgram_set_peer(b,peer) \\\n         (int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)peer)\n# define BIO_dgram_get_mtu_overhead(b) \\\n         (unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL)\n\n/* These two aren't currently implemented */\n/* int BIO_get_ex_num(BIO *bio); */\n/* void BIO_set_ex_free_func(BIO *bio,int idx,void (*cb)()); */\nint BIO_set_ex_data(BIO *bio, int idx, void *data);\nvoid *BIO_get_ex_data(BIO *bio, int idx);\nint BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,\n                         CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);\nunsigned long BIO_number_read(BIO *bio);\nunsigned long BIO_number_written(BIO *bio);\n\n/* For BIO_f_asn1() */\nint BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix,\n                        asn1_ps_func *prefix_free);\nint BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix,\n                        asn1_ps_func **pprefix_free);\nint BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix,\n                        asn1_ps_func *suffix_free);\nint BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,\n                        asn1_ps_func **psuffix_free);\n\n# ifndef OPENSSL_NO_FP_API\nBIO_METHOD *BIO_s_file(void);\nBIO *BIO_new_file(const char *filename, const char *mode);\nBIO *BIO_new_fp(FILE *stream, int close_flag);\n#  define BIO_s_file_internal    BIO_s_file\n# endif\nBIO *BIO_new(BIO_METHOD *type);\nint BIO_set(BIO *a, BIO_METHOD *type);\nint BIO_free(BIO *a);\nvoid BIO_vfree(BIO *a);\nint BIO_read(BIO *b, void *data, int len);\nint BIO_gets(BIO *bp, char *buf, int size);\nint BIO_write(BIO *b, const void *data, int len);\nint BIO_puts(BIO *bp, const char *buf);\nint BIO_indent(BIO *b, int indent, int max);\nlong BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);\nlong BIO_callback_ctrl(BIO *b, int cmd,\n                       void (*fp) (struct bio_st *, int, const char *, int,\n                                   long, long));\nchar *BIO_ptr_ctrl(BIO *bp, int cmd, long larg);\nlong BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);\nBIO *BIO_push(BIO *b, BIO *append);\nBIO *BIO_pop(BIO *b);\nvoid BIO_free_all(BIO *a);\nBIO *BIO_find_type(BIO *b, int bio_type);\nBIO *BIO_next(BIO *b);\nBIO *BIO_get_retry_BIO(BIO *bio, int *reason);\nint BIO_get_retry_reason(BIO *bio);\nBIO *BIO_dup_chain(BIO *in);\n\nint BIO_nread0(BIO *bio, char **buf);\nint BIO_nread(BIO *bio, char **buf, int num);\nint BIO_nwrite0(BIO *bio, char **buf);\nint BIO_nwrite(BIO *bio, char **buf, int num);\n\nlong BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi,\n                        long argl, long ret);\n\nBIO_METHOD *BIO_s_mem(void);\nBIO *BIO_new_mem_buf(const void *buf, int len);\nBIO_METHOD *BIO_s_socket(void);\nBIO_METHOD *BIO_s_connect(void);\nBIO_METHOD *BIO_s_accept(void);\nBIO_METHOD *BIO_s_fd(void);\n# ifndef OPENSSL_SYS_OS2\nBIO_METHOD *BIO_s_log(void);\n# endif\nBIO_METHOD *BIO_s_bio(void);\nBIO_METHOD *BIO_s_null(void);\nBIO_METHOD *BIO_f_null(void);\nBIO_METHOD *BIO_f_buffer(void);\n# ifdef OPENSSL_SYS_VMS\nBIO_METHOD *BIO_f_linebuffer(void);\n# endif\nBIO_METHOD *BIO_f_nbio_test(void);\n# ifndef OPENSSL_NO_DGRAM\nBIO_METHOD *BIO_s_datagram(void);\n#  ifndef OPENSSL_NO_SCTP\nBIO_METHOD *BIO_s_datagram_sctp(void);\n#  endif\n# endif\n\n/* BIO_METHOD *BIO_f_ber(void); */\n\nint BIO_sock_should_retry(int i);\nint BIO_sock_non_fatal_error(int error);\nint BIO_dgram_non_fatal_error(int error);\n\nint BIO_fd_should_retry(int i);\nint BIO_fd_non_fatal_error(int error);\nint BIO_dump_cb(int (*cb) (const void *data, size_t len, void *u),\n                void *u, const char *s, int len);\nint BIO_dump_indent_cb(int (*cb) (const void *data, size_t len, void *u),\n                       void *u, const char *s, int len, int indent);\nint BIO_dump(BIO *b, const char *bytes, int len);\nint BIO_dump_indent(BIO *b, const char *bytes, int len, int indent);\n# ifndef OPENSSL_NO_FP_API\nint BIO_dump_fp(FILE *fp, const char *s, int len);\nint BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent);\n# endif\nint BIO_hex_string(BIO *out, int indent, int width, unsigned char *data,\n                   int datalen);\n\nstruct hostent *BIO_gethostbyname(const char *name);\n/*-\n * We might want a thread-safe interface too:\n * struct hostent *BIO_gethostbyname_r(const char *name,\n *     struct hostent *result, void *buffer, size_t buflen);\n * or something similar (caller allocates a struct hostent,\n * pointed to by \"result\", and additional buffer space for the various\n * substructures; if the buffer does not suffice, NULL is returned\n * and an appropriate error code is set).\n */\nint BIO_sock_error(int sock);\nint BIO_socket_ioctl(int fd, long type, void *arg);\nint BIO_socket_nbio(int fd, int mode);\nint BIO_get_port(const char *str, unsigned short *port_ptr);\nint BIO_get_host_ip(const char *str, unsigned char *ip);\nint BIO_get_accept_socket(char *host_port, int mode);\nint BIO_accept(int sock, char **ip_port);\nint BIO_sock_init(void);\nvoid BIO_sock_cleanup(void);\nint BIO_set_tcp_ndelay(int sock, int turn_on);\n\nBIO *BIO_new_socket(int sock, int close_flag);\nBIO *BIO_new_dgram(int fd, int close_flag);\n# ifndef OPENSSL_NO_SCTP\nBIO *BIO_new_dgram_sctp(int fd, int close_flag);\nint BIO_dgram_is_sctp(BIO *bio);\nint BIO_dgram_sctp_notification_cb(BIO *b,\n                                   void (*handle_notifications) (BIO *bio,\n                                                                 void\n                                                                 *context,\n                                                                 void *buf),\n                                   void *context);\nint BIO_dgram_sctp_wait_for_dry(BIO *b);\nint BIO_dgram_sctp_msg_waiting(BIO *b);\n# endif\nBIO *BIO_new_fd(int fd, int close_flag);\nBIO *BIO_new_connect(const char *host_port);\nBIO *BIO_new_accept(const char *host_port);\n\nint BIO_new_bio_pair(BIO **bio1, size_t writebuf1,\n                     BIO **bio2, size_t writebuf2);\n/*\n * If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints.\n * Otherwise returns 0 and sets *bio1 and *bio2 to NULL. Size 0 uses default\n * value.\n */\n\nvoid BIO_copy_next_retry(BIO *b);\n\n/*\n * long BIO_ghbn_ctrl(int cmd,int iarg,char *parg);\n */\n\n# ifdef __GNUC__\n#  define __bio_h__attr__ __attribute__\n# else\n#  define __bio_h__attr__(x)\n# endif\nint BIO_printf(BIO *bio, const char *format, ...)\n__bio_h__attr__((__format__(__printf__, 2, 3)));\nint BIO_vprintf(BIO *bio, const char *format, va_list args)\n__bio_h__attr__((__format__(__printf__, 2, 0)));\nint BIO_snprintf(char *buf, size_t n, const char *format, ...)\n__bio_h__attr__((__format__(__printf__, 3, 4)));\nint BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)\n__bio_h__attr__((__format__(__printf__, 3, 0)));\n# undef __bio_h__attr__\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_BIO_strings(void);\n\n/* Error codes for the BIO functions. */\n\n/* Function codes. */\n# define BIO_F_ACPT_STATE                                 100\n# define BIO_F_BIO_ACCEPT                                 101\n# define BIO_F_BIO_BER_GET_HEADER                         102\n# define BIO_F_BIO_CALLBACK_CTRL                          131\n# define BIO_F_BIO_CTRL                                   103\n# define BIO_F_BIO_GETHOSTBYNAME                          120\n# define BIO_F_BIO_GETS                                   104\n# define BIO_F_BIO_GET_ACCEPT_SOCKET                      105\n# define BIO_F_BIO_GET_HOST_IP                            106\n# define BIO_F_BIO_GET_PORT                               107\n# define BIO_F_BIO_MAKE_PAIR                              121\n# define BIO_F_BIO_NEW                                    108\n# define BIO_F_BIO_NEW_FILE                               109\n# define BIO_F_BIO_NEW_MEM_BUF                            126\n# define BIO_F_BIO_NREAD                                  123\n# define BIO_F_BIO_NREAD0                                 124\n# define BIO_F_BIO_NWRITE                                 125\n# define BIO_F_BIO_NWRITE0                                122\n# define BIO_F_BIO_PUTS                                   110\n# define BIO_F_BIO_READ                                   111\n# define BIO_F_BIO_SOCK_INIT                              112\n# define BIO_F_BIO_WRITE                                  113\n# define BIO_F_BUFFER_CTRL                                114\n# define BIO_F_CONN_CTRL                                  127\n# define BIO_F_CONN_STATE                                 115\n# define BIO_F_DGRAM_SCTP_READ                            132\n# define BIO_F_DGRAM_SCTP_WRITE                           133\n# define BIO_F_FILE_CTRL                                  116\n# define BIO_F_FILE_READ                                  130\n# define BIO_F_LINEBUFFER_CTRL                            129\n# define BIO_F_MEM_READ                                   128\n# define BIO_F_MEM_WRITE                                  117\n# define BIO_F_SSL_NEW                                    118\n# define BIO_F_WSASTARTUP                                 119\n\n/* Reason codes. */\n# define BIO_R_ACCEPT_ERROR                               100\n# define BIO_R_BAD_FOPEN_MODE                             101\n# define BIO_R_BAD_HOSTNAME_LOOKUP                        102\n# define BIO_R_BROKEN_PIPE                                124\n# define BIO_R_CONNECT_ERROR                              103\n# define BIO_R_EOF_ON_MEMORY_BIO                          127\n# define BIO_R_ERROR_SETTING_NBIO                         104\n# define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPTED_SOCKET      105\n# define BIO_R_ERROR_SETTING_NBIO_ON_ACCEPT_SOCKET        106\n# define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET          107\n# define BIO_R_INVALID_ARGUMENT                           125\n# define BIO_R_INVALID_IP_ADDRESS                         108\n# define BIO_R_IN_USE                                     123\n# define BIO_R_KEEPALIVE                                  109\n# define BIO_R_NBIO_CONNECT_ERROR                         110\n# define BIO_R_NO_ACCEPT_PORT_SPECIFIED                   111\n# define BIO_R_NO_HOSTNAME_SPECIFIED                      112\n# define BIO_R_NO_PORT_DEFINED                            113\n# define BIO_R_NO_PORT_SPECIFIED                          114\n# define BIO_R_NO_SUCH_FILE                               128\n# define BIO_R_NULL_PARAMETER                             115\n# define BIO_R_TAG_MISMATCH                               116\n# define BIO_R_UNABLE_TO_BIND_SOCKET                      117\n# define BIO_R_UNABLE_TO_CREATE_SOCKET                    118\n# define BIO_R_UNABLE_TO_LISTEN_SOCKET                    119\n# define BIO_R_UNINITIALIZED                              120\n# define BIO_R_UNSUPPORTED_METHOD                         121\n# define BIO_R_WRITE_TO_READ_ONLY_BIO                     126\n# define BIO_R_WSASTARTUP                                 122\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/blowfish.h",
    "content": "/* crypto/bf/blowfish.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_BLOWFISH_H\n# define HEADER_BLOWFISH_H\n\n# include <openssl/e_os2.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# ifdef OPENSSL_NO_BF\n#  error BF is disabled.\n# endif\n\n# define BF_ENCRYPT      1\n# define BF_DECRYPT      0\n\n/*-\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n * ! BF_LONG has to be at least 32 bits wide. If it's wider, then !\n * ! BF_LONG_LOG2 has to be defined along.                        !\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n */\n\n# if defined(__LP32__)\n#  define BF_LONG unsigned long\n# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)\n#  define BF_LONG unsigned long\n#  define BF_LONG_LOG2 3\n/*\n * _CRAY note. I could declare short, but I have no idea what impact\n * does it have on performance on none-T3E machines. I could declare\n * int, but at least on C90 sizeof(int) can be chosen at compile time.\n * So I've chosen long...\n *                                      <appro@fy.chalmers.se>\n */\n# else\n#  define BF_LONG unsigned int\n# endif\n\n# define BF_ROUNDS       16\n# define BF_BLOCK        8\n\ntypedef struct bf_key_st {\n    BF_LONG P[BF_ROUNDS + 2];\n    BF_LONG S[4 * 256];\n} BF_KEY;\n\n# ifdef OPENSSL_FIPS\nvoid private_BF_set_key(BF_KEY *key, int len, const unsigned char *data);\n# endif\nvoid BF_set_key(BF_KEY *key, int len, const unsigned char *data);\n\nvoid BF_encrypt(BF_LONG *data, const BF_KEY *key);\nvoid BF_decrypt(BF_LONG *data, const BF_KEY *key);\n\nvoid BF_ecb_encrypt(const unsigned char *in, unsigned char *out,\n                    const BF_KEY *key, int enc);\nvoid BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,\n                    const BF_KEY *schedule, unsigned char *ivec, int enc);\nvoid BF_cfb64_encrypt(const unsigned char *in, unsigned char *out,\n                      long length, const BF_KEY *schedule,\n                      unsigned char *ivec, int *num, int enc);\nvoid BF_ofb64_encrypt(const unsigned char *in, unsigned char *out,\n                      long length, const BF_KEY *schedule,\n                      unsigned char *ivec, int *num);\nconst char *BF_options(void);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/bn.h",
    "content": "/* crypto/bn/bn.h */\n/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n/* ====================================================================\n * Copyright (c) 1998-2006 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n/* ====================================================================\n * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.\n *\n * Portions of the attached software (\"Contribution\") are developed by\n * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.\n *\n * The Contribution is licensed pursuant to the Eric Young open source\n * license provided above.\n *\n * The binary polynomial arithmetic software is originally written by\n * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.\n *\n */\n\n#ifndef HEADER_BN_H\n# define HEADER_BN_H\n\n# include <limits.h>\n# include <openssl/e_os2.h>\n# ifndef OPENSSL_NO_FP_API\n#  include <stdio.h>            /* FILE */\n# endif\n# include <openssl/ossl_typ.h>\n# include <openssl/crypto.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * These preprocessor symbols control various aspects of the bignum headers\n * and library code. They're not defined by any \"normal\" configuration, as\n * they are intended for development and testing purposes. NB: defining all\n * three can be useful for debugging application code as well as openssl\n * itself. BN_DEBUG - turn on various debugging alterations to the bignum\n * code BN_DEBUG_RAND - uses random poisoning of unused words to trip up\n * mismanagement of bignum internals. You must also define BN_DEBUG.\n */\n/* #define BN_DEBUG */\n/* #define BN_DEBUG_RAND */\n\n# ifndef OPENSSL_SMALL_FOOTPRINT\n#  define BN_MUL_COMBA\n#  define BN_SQR_COMBA\n#  define BN_RECURSION\n# endif\n\n/*\n * This next option uses the C libraries (2 word)/(1 word) function. If it is\n * not defined, I use my C version (which is slower). The reason for this\n * flag is that when the particular C compiler library routine is used, and\n * the library is linked with a different compiler, the library is missing.\n * This mostly happens when the library is built with gcc and then linked\n * using normal cc.  This would be a common occurrence because gcc normally\n * produces code that is 2 times faster than system compilers for the big\n * number stuff. For machines with only one compiler (or shared libraries),\n * this should be on.  Again this in only really a problem on machines using\n * \"long long's\", are 32bit, and are not using my assembler code.\n */\n# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) || \\\n    defined(OPENSSL_SYS_WIN32) || defined(linux)\n#  ifndef BN_DIV2W\n#   define BN_DIV2W\n#  endif\n# endif\n\n/*\n * assuming long is 64bit - this is the DEC Alpha unsigned long long is only\n * 64 bits :-(, don't define BN_LLONG for the DEC Alpha\n */\n# ifdef SIXTY_FOUR_BIT_LONG\n#  define BN_ULLONG       unsigned long long\n#  define BN_ULONG        unsigned long\n#  define BN_LONG         long\n#  define BN_BITS         128\n#  define BN_BYTES        8\n#  define BN_BITS2        64\n#  define BN_BITS4        32\n#  define BN_MASK         (0xffffffffffffffffffffffffffffffffLL)\n#  define BN_MASK2        (0xffffffffffffffffL)\n#  define BN_MASK2l       (0xffffffffL)\n#  define BN_MASK2h       (0xffffffff00000000L)\n#  define BN_MASK2h1      (0xffffffff80000000L)\n#  define BN_TBIT         (0x8000000000000000L)\n#  define BN_DEC_CONV     (10000000000000000000UL)\n#  define BN_DEC_FMT1     \"%lu\"\n#  define BN_DEC_FMT2     \"%019lu\"\n#  define BN_DEC_NUM      19\n#  define BN_HEX_FMT1     \"%lX\"\n#  define BN_HEX_FMT2     \"%016lX\"\n# endif\n\n/*\n * This is where the long long data type is 64 bits, but long is 32. For\n * machines where there are 64bit registers, this is the mode to use. IRIX,\n * on R4000 and above should use this mode, along with the relevant assembler\n * code :-).  Do NOT define BN_LLONG.\n */\n# ifdef SIXTY_FOUR_BIT\n#  undef BN_LLONG\n#  undef BN_ULLONG\n#  define BN_ULONG        unsigned long long\n#  define BN_LONG         long long\n#  define BN_BITS         128\n#  define BN_BYTES        8\n#  define BN_BITS2        64\n#  define BN_BITS4        32\n#  define BN_MASK2        (0xffffffffffffffffLL)\n#  define BN_MASK2l       (0xffffffffL)\n#  define BN_MASK2h       (0xffffffff00000000LL)\n#  define BN_MASK2h1      (0xffffffff80000000LL)\n#  define BN_TBIT         (0x8000000000000000LL)\n#  define BN_DEC_CONV     (10000000000000000000ULL)\n#  define BN_DEC_FMT1     \"%llu\"\n#  define BN_DEC_FMT2     \"%019llu\"\n#  define BN_DEC_NUM      19\n#  define BN_HEX_FMT1     \"%llX\"\n#  define BN_HEX_FMT2     \"%016llX\"\n# endif\n\n# ifdef THIRTY_TWO_BIT\n#  ifdef BN_LLONG\n#   if defined(_WIN32) && !defined(__GNUC__)\n#    define BN_ULLONG     unsigned __int64\n#    define BN_MASK       (0xffffffffffffffffI64)\n#   else\n#    define BN_ULLONG     unsigned long long\n#    define BN_MASK       (0xffffffffffffffffLL)\n#   endif\n#  endif\n#  define BN_ULONG        unsigned int\n#  define BN_LONG         int\n#  define BN_BITS         64\n#  define BN_BYTES        4\n#  define BN_BITS2        32\n#  define BN_BITS4        16\n#  define BN_MASK2        (0xffffffffL)\n#  define BN_MASK2l       (0xffff)\n#  define BN_MASK2h1      (0xffff8000L)\n#  define BN_MASK2h       (0xffff0000L)\n#  define BN_TBIT         (0x80000000L)\n#  define BN_DEC_CONV     (1000000000L)\n#  define BN_DEC_FMT1     \"%u\"\n#  define BN_DEC_FMT2     \"%09u\"\n#  define BN_DEC_NUM      9\n#  define BN_HEX_FMT1     \"%X\"\n#  define BN_HEX_FMT2     \"%08X\"\n# endif\n\n# define BN_DEFAULT_BITS 1280\n\n# define BN_FLG_MALLOCED         0x01\n# define BN_FLG_STATIC_DATA      0x02\n\n/*\n * avoid leaking exponent information through timing,\n * BN_mod_exp_mont() will call BN_mod_exp_mont_consttime,\n * BN_div() will call BN_div_no_branch,\n * BN_mod_inverse() will call BN_mod_inverse_no_branch.\n */\n# define BN_FLG_CONSTTIME        0x04\n\n# ifdef OPENSSL_NO_DEPRECATED\n/* deprecated name for the flag */\n#  define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME\n/*\n * avoid leaking exponent information through timings\n * (BN_mod_exp_mont() will call BN_mod_exp_mont_consttime)\n */\n# endif\n\n# ifndef OPENSSL_NO_DEPRECATED\n#  define BN_FLG_FREE             0x8000\n                                       /* used for debuging */\n# endif\n# define BN_set_flags(b,n)       ((b)->flags|=(n))\n# define BN_get_flags(b,n)       ((b)->flags&(n))\n\n/*\n * get a clone of a BIGNUM with changed flags, for *temporary* use only (the\n * two BIGNUMs cannot not be used in parallel!)\n */\n# define BN_with_flags(dest,b,n)  ((dest)->d=(b)->d, \\\n                                  (dest)->top=(b)->top, \\\n                                  (dest)->dmax=(b)->dmax, \\\n                                  (dest)->neg=(b)->neg, \\\n                                  (dest)->flags=(((dest)->flags & BN_FLG_MALLOCED) \\\n                                                 |  ((b)->flags & ~BN_FLG_MALLOCED) \\\n                                                 |  BN_FLG_STATIC_DATA \\\n                                                 |  (n)))\n\n/* Already declared in ossl_typ.h */\n# if 0\ntypedef struct bignum_st BIGNUM;\n/* Used for temp variables (declaration hidden in bn_lcl.h) */\ntypedef struct bignum_ctx BN_CTX;\ntypedef struct bn_blinding_st BN_BLINDING;\ntypedef struct bn_mont_ctx_st BN_MONT_CTX;\ntypedef struct bn_recp_ctx_st BN_RECP_CTX;\ntypedef struct bn_gencb_st BN_GENCB;\n# endif\n\nstruct bignum_st {\n    BN_ULONG *d;                /* Pointer to an array of 'BN_BITS2' bit\n                                 * chunks. */\n    int top;                    /* Index of last used d +1. */\n    /* The next are internal book keeping for bn_expand. */\n    int dmax;                   /* Size of the d array. */\n    int neg;                    /* one if the number is negative */\n    int flags;\n};\n\n/* Used for montgomery multiplication */\nstruct bn_mont_ctx_st {\n    int ri;                     /* number of bits in R */\n    BIGNUM RR;                  /* used to convert to montgomery form */\n    BIGNUM N;                   /* The modulus */\n    BIGNUM Ni;                  /* R*(1/R mod N) - N*Ni = 1 (Ni is only\n                                 * stored for bignum algorithm) */\n    BN_ULONG n0[2];             /* least significant word(s) of Ni; (type\n                                 * changed with 0.9.9, was \"BN_ULONG n0;\"\n                                 * before) */\n    int flags;\n};\n\n/*\n * Used for reciprocal division/mod functions It cannot be shared between\n * threads\n */\nstruct bn_recp_ctx_st {\n    BIGNUM N;                   /* the divisor */\n    BIGNUM Nr;                  /* the reciprocal */\n    int num_bits;\n    int shift;\n    int flags;\n};\n\n/* Used for slow \"generation\" functions. */\nstruct bn_gencb_st {\n    unsigned int ver;           /* To handle binary (in)compatibility */\n    void *arg;                  /* callback-specific data */\n    union {\n        /* if(ver==1) - handles old style callbacks */\n        void (*cb_1) (int, int, void *);\n        /* if(ver==2) - new callback style */\n        int (*cb_2) (int, int, BN_GENCB *);\n    } cb;\n};\n/* Wrapper function to make using BN_GENCB easier,  */\nint BN_GENCB_call(BN_GENCB *cb, int a, int b);\n/* Macro to populate a BN_GENCB structure with an \"old\"-style callback */\n# define BN_GENCB_set_old(gencb, callback, cb_arg) { \\\n                BN_GENCB *tmp_gencb = (gencb); \\\n                tmp_gencb->ver = 1; \\\n                tmp_gencb->arg = (cb_arg); \\\n                tmp_gencb->cb.cb_1 = (callback); }\n/* Macro to populate a BN_GENCB structure with a \"new\"-style callback */\n# define BN_GENCB_set(gencb, callback, cb_arg) { \\\n                BN_GENCB *tmp_gencb = (gencb); \\\n                tmp_gencb->ver = 2; \\\n                tmp_gencb->arg = (cb_arg); \\\n                tmp_gencb->cb.cb_2 = (callback); }\n\n# define BN_prime_checks 0      /* default: select number of iterations based\n                                 * on the size of the number */\n\n/*\n * number of Miller-Rabin iterations for an error rate of less than 2^-80 for\n * random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook of\n * Applied Cryptography [Menezes, van Oorschot, Vanstone; CRC Press 1996];\n * original paper: Damgaard, Landrock, Pomerance: Average case error\n * estimates for the strong probable prime test. -- Math. Comp. 61 (1993)\n * 177-194)\n */\n# define BN_prime_checks_for_size(b) ((b) >= 1300 ?  2 : \\\n                                (b) >=  850 ?  3 : \\\n                                (b) >=  650 ?  4 : \\\n                                (b) >=  550 ?  5 : \\\n                                (b) >=  450 ?  6 : \\\n                                (b) >=  400 ?  7 : \\\n                                (b) >=  350 ?  8 : \\\n                                (b) >=  300 ?  9 : \\\n                                (b) >=  250 ? 12 : \\\n                                (b) >=  200 ? 15 : \\\n                                (b) >=  150 ? 18 : \\\n                                /* b >= 100 */ 27)\n\n# define BN_num_bytes(a) ((BN_num_bits(a)+7)/8)\n\n/* Note that BN_abs_is_word didn't work reliably for w == 0 until 0.9.8 */\n# define BN_abs_is_word(a,w) ((((a)->top == 1) && ((a)->d[0] == (BN_ULONG)(w))) || \\\n                                (((w) == 0) && ((a)->top == 0)))\n# define BN_is_zero(a)       ((a)->top == 0)\n# define BN_is_one(a)        (BN_abs_is_word((a),1) && !(a)->neg)\n# define BN_is_word(a,w)     (BN_abs_is_word((a),(w)) && (!(w) || !(a)->neg))\n# define BN_is_odd(a)        (((a)->top > 0) && ((a)->d[0] & 1))\n\n# define BN_one(a)       (BN_set_word((a),1))\n# define BN_zero_ex(a) \\\n        do { \\\n                BIGNUM *_tmp_bn = (a); \\\n                _tmp_bn->top = 0; \\\n                _tmp_bn->neg = 0; \\\n        } while(0)\n# ifdef OPENSSL_NO_DEPRECATED\n#  define BN_zero(a)      BN_zero_ex(a)\n# else\n#  define BN_zero(a)      (BN_set_word((a),0))\n# endif\n\nconst BIGNUM *BN_value_one(void);\nchar *BN_options(void);\nBN_CTX *BN_CTX_new(void);\n# ifndef OPENSSL_NO_DEPRECATED\nvoid BN_CTX_init(BN_CTX *c);\n# endif\nvoid BN_CTX_free(BN_CTX *c);\nvoid BN_CTX_start(BN_CTX *ctx);\nBIGNUM *BN_CTX_get(BN_CTX *ctx);\nvoid BN_CTX_end(BN_CTX *ctx);\nint BN_rand(BIGNUM *rnd, int bits, int top, int bottom);\nint BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom);\nint BN_rand_range(BIGNUM *rnd, const BIGNUM *range);\nint BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range);\nint BN_num_bits(const BIGNUM *a);\nint BN_num_bits_word(BN_ULONG);\nBIGNUM *BN_new(void);\nvoid BN_init(BIGNUM *);\nvoid BN_clear_free(BIGNUM *a);\nBIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);\nvoid BN_swap(BIGNUM *a, BIGNUM *b);\nBIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret);\nint BN_bn2bin(const BIGNUM *a, unsigned char *to);\nBIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret);\nint BN_bn2mpi(const BIGNUM *a, unsigned char *to);\nint BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);\nint BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);\nint BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);\nint BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);\nint BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);\nint BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx);\n/** BN_set_negative sets sign of a BIGNUM\n * \\param  b  pointer to the BIGNUM object\n * \\param  n  0 if the BIGNUM b should be positive and a value != 0 otherwise\n */\nvoid BN_set_negative(BIGNUM *b, int n);\n/** BN_is_negative returns 1 if the BIGNUM is negative\n * \\param  a  pointer to the BIGNUM object\n * \\return 1 if a < 0 and 0 otherwise\n */\n# define BN_is_negative(a) ((a)->neg != 0)\n\nint BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,\n           BN_CTX *ctx);\n# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))\nint BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);\nint BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,\n               BN_CTX *ctx);\nint BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,\n                     const BIGNUM *m);\nint BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,\n               BN_CTX *ctx);\nint BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,\n                     const BIGNUM *m);\nint BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,\n               BN_CTX *ctx);\nint BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);\nint BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);\nint BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *m);\nint BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m,\n                  BN_CTX *ctx);\nint BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m);\n\nBN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);\nBN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);\nint BN_mul_word(BIGNUM *a, BN_ULONG w);\nint BN_add_word(BIGNUM *a, BN_ULONG w);\nint BN_sub_word(BIGNUM *a, BN_ULONG w);\nint BN_set_word(BIGNUM *a, BN_ULONG w);\nBN_ULONG BN_get_word(const BIGNUM *a);\n\nint BN_cmp(const BIGNUM *a, const BIGNUM *b);\nvoid BN_free(BIGNUM *a);\nint BN_is_bit_set(const BIGNUM *a, int n);\nint BN_lshift(BIGNUM *r, const BIGNUM *a, int n);\nint BN_lshift1(BIGNUM *r, const BIGNUM *a);\nint BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);\n\nint BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,\n               const BIGNUM *m, BN_CTX *ctx);\nint BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,\n                    const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);\nint BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,\n                              const BIGNUM *m, BN_CTX *ctx,\n                              BN_MONT_CTX *in_mont);\nint BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,\n                         const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);\nint BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,\n                     const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m,\n                     BN_CTX *ctx, BN_MONT_CTX *m_ctx);\nint BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,\n                      const BIGNUM *m, BN_CTX *ctx);\n\nint BN_mask_bits(BIGNUM *a, int n);\n# ifndef OPENSSL_NO_FP_API\nint BN_print_fp(FILE *fp, const BIGNUM *a);\n# endif\n# ifdef HEADER_BIO_H\nint BN_print(BIO *fp, const BIGNUM *a);\n# else\nint BN_print(void *fp, const BIGNUM *a);\n# endif\nint BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx);\nint BN_rshift(BIGNUM *r, const BIGNUM *a, int n);\nint BN_rshift1(BIGNUM *r, const BIGNUM *a);\nvoid BN_clear(BIGNUM *a);\nBIGNUM *BN_dup(const BIGNUM *a);\nint BN_ucmp(const BIGNUM *a, const BIGNUM *b);\nint BN_set_bit(BIGNUM *a, int n);\nint BN_clear_bit(BIGNUM *a, int n);\nchar *BN_bn2hex(const BIGNUM *a);\nchar *BN_bn2dec(const BIGNUM *a);\nint BN_hex2bn(BIGNUM **a, const char *str);\nint BN_dec2bn(BIGNUM **a, const char *str);\nint BN_asc2bn(BIGNUM **a, const char *str);\nint BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);\nint BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); /* returns\n                                                                  * -2 for\n                                                                  * error */\nBIGNUM *BN_mod_inverse(BIGNUM *ret,\n                       const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);\nBIGNUM *BN_mod_sqrt(BIGNUM *ret,\n                    const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);\n\nvoid BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);\n\n/* Deprecated versions */\n# ifndef OPENSSL_NO_DEPRECATED\nBIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,\n                          const BIGNUM *add, const BIGNUM *rem,\n                          void (*callback) (int, int, void *), void *cb_arg);\nint BN_is_prime(const BIGNUM *p, int nchecks,\n                void (*callback) (int, int, void *),\n                BN_CTX *ctx, void *cb_arg);\nint BN_is_prime_fasttest(const BIGNUM *p, int nchecks,\n                         void (*callback) (int, int, void *), BN_CTX *ctx,\n                         void *cb_arg, int do_trial_division);\n# endif                         /* !defined(OPENSSL_NO_DEPRECATED) */\n\n/* Newer versions */\nint BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add,\n                         const BIGNUM *rem, BN_GENCB *cb);\nint BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb);\nint BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx,\n                            int do_trial_division, BN_GENCB *cb);\n\nint BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx);\n\nint BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,\n                            const BIGNUM *Xp, const BIGNUM *Xp1,\n                            const BIGNUM *Xp2, const BIGNUM *e, BN_CTX *ctx,\n                            BN_GENCB *cb);\nint BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, BIGNUM *Xp1,\n                              BIGNUM *Xp2, const BIGNUM *Xp, const BIGNUM *e,\n                              BN_CTX *ctx, BN_GENCB *cb);\n\nBN_MONT_CTX *BN_MONT_CTX_new(void);\nvoid BN_MONT_CTX_init(BN_MONT_CTX *ctx);\nint BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,\n                          BN_MONT_CTX *mont, BN_CTX *ctx);\n# define BN_to_montgomery(r,a,mont,ctx)  BN_mod_mul_montgomery(\\\n        (r),(a),&((mont)->RR),(mont),(ctx))\nint BN_from_montgomery(BIGNUM *r, const BIGNUM *a,\n                       BN_MONT_CTX *mont, BN_CTX *ctx);\nvoid BN_MONT_CTX_free(BN_MONT_CTX *mont);\nint BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx);\nBN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from);\nBN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, int lock,\n                                    const BIGNUM *mod, BN_CTX *ctx);\n\n/* BN_BLINDING flags */\n# define BN_BLINDING_NO_UPDATE   0x00000001\n# define BN_BLINDING_NO_RECREATE 0x00000002\n\nBN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod);\nvoid BN_BLINDING_free(BN_BLINDING *b);\nint BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx);\nint BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);\nint BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx);\nint BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, BN_CTX *);\nint BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b,\n                          BN_CTX *);\n# ifndef OPENSSL_NO_DEPRECATED\nunsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *);\nvoid BN_BLINDING_set_thread_id(BN_BLINDING *, unsigned long);\n# endif\nCRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *);\nunsigned long BN_BLINDING_get_flags(const BN_BLINDING *);\nvoid BN_BLINDING_set_flags(BN_BLINDING *, unsigned long);\nBN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,\n                                      const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,\n                                      int (*bn_mod_exp) (BIGNUM *r,\n                                                         const BIGNUM *a,\n                                                         const BIGNUM *p,\n                                                         const BIGNUM *m,\n                                                         BN_CTX *ctx,\n                                                         BN_MONT_CTX *m_ctx),\n                                      BN_MONT_CTX *m_ctx);\n\n# ifndef OPENSSL_NO_DEPRECATED\nvoid BN_set_params(int mul, int high, int low, int mont);\nint BN_get_params(int which);   /* 0, mul, 1 high, 2 low, 3 mont */\n# endif\n\nvoid BN_RECP_CTX_init(BN_RECP_CTX *recp);\nBN_RECP_CTX *BN_RECP_CTX_new(void);\nvoid BN_RECP_CTX_free(BN_RECP_CTX *recp);\nint BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *rdiv, BN_CTX *ctx);\nint BN_mod_mul_reciprocal(BIGNUM *r, const BIGNUM *x, const BIGNUM *y,\n                          BN_RECP_CTX *recp, BN_CTX *ctx);\nint BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,\n                    const BIGNUM *m, BN_CTX *ctx);\nint BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,\n                BN_RECP_CTX *recp, BN_CTX *ctx);\n\n# ifndef OPENSSL_NO_EC2M\n\n/*\n * Functions for arithmetic over binary polynomials represented by BIGNUMs.\n * The BIGNUM::neg property of BIGNUMs representing binary polynomials is\n * ignored. Note that input arguments are not const so that their bit arrays\n * can be expanded to the appropriate size if needed.\n */\n\n/*\n * r = a + b\n */\nint BN_GF2m_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);\n#  define BN_GF2m_sub(r, a, b) BN_GF2m_add(r, a, b)\n/*\n * r=a mod p\n */\nint BN_GF2m_mod(BIGNUM *r, const BIGNUM *a, const BIGNUM *p);\n/* r = (a * b) mod p */\nint BN_GF2m_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,\n                    const BIGNUM *p, BN_CTX *ctx);\n/* r = (a * a) mod p */\nint BN_GF2m_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);\n/* r = (1 / b) mod p */\nint BN_GF2m_mod_inv(BIGNUM *r, const BIGNUM *b, const BIGNUM *p, BN_CTX *ctx);\n/* r = (a / b) mod p */\nint BN_GF2m_mod_div(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,\n                    const BIGNUM *p, BN_CTX *ctx);\n/* r = (a ^ b) mod p */\nint BN_GF2m_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,\n                    const BIGNUM *p, BN_CTX *ctx);\n/* r = sqrt(a) mod p */\nint BN_GF2m_mod_sqrt(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,\n                     BN_CTX *ctx);\n/* r^2 + r = a mod p */\nint BN_GF2m_mod_solve_quad(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,\n                           BN_CTX *ctx);\n#  define BN_GF2m_cmp(a, b) BN_ucmp((a), (b))\n/*-\n * Some functions allow for representation of the irreducible polynomials\n * as an unsigned int[], say p.  The irreducible f(t) is then of the form:\n *     t^p[0] + t^p[1] + ... + t^p[k]\n * where m = p[0] > p[1] > ... > p[k] = 0.\n */\n/* r = a mod p */\nint BN_GF2m_mod_arr(BIGNUM *r, const BIGNUM *a, const int p[]);\n/* r = (a * b) mod p */\nint BN_GF2m_mod_mul_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,\n                        const int p[], BN_CTX *ctx);\n/* r = (a * a) mod p */\nint BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],\n                        BN_CTX *ctx);\n/* r = (1 / b) mod p */\nint BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *b, const int p[],\n                        BN_CTX *ctx);\n/* r = (a / b) mod p */\nint BN_GF2m_mod_div_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,\n                        const int p[], BN_CTX *ctx);\n/* r = (a ^ b) mod p */\nint BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,\n                        const int p[], BN_CTX *ctx);\n/* r = sqrt(a) mod p */\nint BN_GF2m_mod_sqrt_arr(BIGNUM *r, const BIGNUM *a,\n                         const int p[], BN_CTX *ctx);\n/* r^2 + r = a mod p */\nint BN_GF2m_mod_solve_quad_arr(BIGNUM *r, const BIGNUM *a,\n                               const int p[], BN_CTX *ctx);\nint BN_GF2m_poly2arr(const BIGNUM *a, int p[], int max);\nint BN_GF2m_arr2poly(const int p[], BIGNUM *a);\n\n# endif\n\n/*\n * faster mod functions for the 'NIST primes' 0 <= a < p^2\n */\nint BN_nist_mod_192(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);\nint BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);\nint BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);\nint BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);\nint BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);\n\nconst BIGNUM *BN_get0_nist_prime_192(void);\nconst BIGNUM *BN_get0_nist_prime_224(void);\nconst BIGNUM *BN_get0_nist_prime_256(void);\nconst BIGNUM *BN_get0_nist_prime_384(void);\nconst BIGNUM *BN_get0_nist_prime_521(void);\n\n/* library internal functions */\n\n# define bn_expand(a,bits) \\\n    ( \\\n        bits > (INT_MAX - BN_BITS2 + 1) ? \\\n            NULL \\\n        : \\\n            (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax) ? \\\n                (a) \\\n            : \\\n                bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2) \\\n    )\n\n# define bn_wexpand(a,words) (((words) <= (a)->dmax)?(a):bn_expand2((a),(words)))\nBIGNUM *bn_expand2(BIGNUM *a, int words);\n# ifndef OPENSSL_NO_DEPRECATED\nBIGNUM *bn_dup_expand(const BIGNUM *a, int words); /* unused */\n# endif\n\n/*-\n * Bignum consistency macros\n * There is one \"API\" macro, bn_fix_top(), for stripping leading zeroes from\n * bignum data after direct manipulations on the data. There is also an\n * \"internal\" macro, bn_check_top(), for verifying that there are no leading\n * zeroes. Unfortunately, some auditing is required due to the fact that\n * bn_fix_top() has become an overabused duct-tape because bignum data is\n * occasionally passed around in an inconsistent state. So the following\n * changes have been made to sort this out;\n * - bn_fix_top()s implementation has been moved to bn_correct_top()\n * - if BN_DEBUG isn't defined, bn_fix_top() maps to bn_correct_top(), and\n *   bn_check_top() is as before.\n * - if BN_DEBUG *is* defined;\n *   - bn_check_top() tries to pollute unused words even if the bignum 'top' is\n *     consistent. (ed: only if BN_DEBUG_RAND is defined)\n *   - bn_fix_top() maps to bn_check_top() rather than \"fixing\" anything.\n * The idea is to have debug builds flag up inconsistent bignums when they\n * occur. If that occurs in a bn_fix_top(), we examine the code in question; if\n * the use of bn_fix_top() was appropriate (ie. it follows directly after code\n * that manipulates the bignum) it is converted to bn_correct_top(), and if it\n * was not appropriate, we convert it permanently to bn_check_top() and track\n * down the cause of the bug. Eventually, no internal code should be using the\n * bn_fix_top() macro. External applications and libraries should try this with\n * their own code too, both in terms of building against the openssl headers\n * with BN_DEBUG defined *and* linking with a version of OpenSSL built with it\n * defined. This not only improves external code, it provides more test\n * coverage for openssl's own code.\n */\n\n# ifdef BN_DEBUG\n\n/* We only need assert() when debugging */\n#  include <assert.h>\n\n#  ifdef BN_DEBUG_RAND\n/* To avoid \"make update\" cvs wars due to BN_DEBUG, use some tricks */\n#   ifndef RAND_pseudo_bytes\nint RAND_pseudo_bytes(unsigned char *buf, int num);\n#    define BN_DEBUG_TRIX\n#   endif\n#   define bn_pollute(a) \\\n        do { \\\n                const BIGNUM *_bnum1 = (a); \\\n                if(_bnum1->top < _bnum1->dmax) { \\\n                        unsigned char _tmp_char; \\\n                        /* We cast away const without the compiler knowing, any \\\n                         * *genuinely* constant variables that aren't mutable \\\n                         * wouldn't be constructed with top!=dmax. */ \\\n                        BN_ULONG *_not_const; \\\n                        memcpy(&_not_const, &_bnum1->d, sizeof(BN_ULONG*)); \\\n                        /* Debug only - safe to ignore error return */ \\\n                        RAND_pseudo_bytes(&_tmp_char, 1); \\\n                        memset((unsigned char *)(_not_const + _bnum1->top), _tmp_char, \\\n                                (_bnum1->dmax - _bnum1->top) * sizeof(BN_ULONG)); \\\n                } \\\n        } while(0)\n#   ifdef BN_DEBUG_TRIX\n#    undef RAND_pseudo_bytes\n#   endif\n#  else\n#   define bn_pollute(a)\n#  endif\n#  define bn_check_top(a) \\\n        do { \\\n                const BIGNUM *_bnum2 = (a); \\\n                if (_bnum2 != NULL) { \\\n                        assert((_bnum2->top == 0) || \\\n                                (_bnum2->d[_bnum2->top - 1] != 0)); \\\n                        bn_pollute(_bnum2); \\\n                } \\\n        } while(0)\n\n#  define bn_fix_top(a)           bn_check_top(a)\n\n#  define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2)\n#  define bn_wcheck_size(bn, words) \\\n        do { \\\n                const BIGNUM *_bnum2 = (bn); \\\n                assert((words) <= (_bnum2)->dmax && (words) >= (_bnum2)->top); \\\n                /* avoid unused variable warning with NDEBUG */ \\\n                (void)(_bnum2); \\\n        } while(0)\n\n# else                          /* !BN_DEBUG */\n\n#  define bn_pollute(a)\n#  define bn_check_top(a)\n#  define bn_fix_top(a)           bn_correct_top(a)\n#  define bn_check_size(bn, bits)\n#  define bn_wcheck_size(bn, words)\n\n# endif\n\n# define bn_correct_top(a) \\\n        { \\\n        BN_ULONG *ftl; \\\n        int tmp_top = (a)->top; \\\n        if (tmp_top > 0) \\\n                { \\\n                for (ftl= &((a)->d[tmp_top-1]); tmp_top > 0; tmp_top--) \\\n                        if (*(ftl--)) break; \\\n                (a)->top = tmp_top; \\\n                } \\\n        if ((a)->top == 0) \\\n            (a)->neg = 0; \\\n        bn_pollute(a); \\\n        }\n\nBN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,\n                          BN_ULONG w);\nBN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w);\nvoid bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, int num);\nBN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d);\nBN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,\n                      int num);\nBN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,\n                      int num);\n\n/* Primes from RFC 2409 */\nBIGNUM *get_rfc2409_prime_768(BIGNUM *bn);\nBIGNUM *get_rfc2409_prime_1024(BIGNUM *bn);\n\n/* Primes from RFC 3526 */\nBIGNUM *get_rfc3526_prime_1536(BIGNUM *bn);\nBIGNUM *get_rfc3526_prime_2048(BIGNUM *bn);\nBIGNUM *get_rfc3526_prime_3072(BIGNUM *bn);\nBIGNUM *get_rfc3526_prime_4096(BIGNUM *bn);\nBIGNUM *get_rfc3526_prime_6144(BIGNUM *bn);\nBIGNUM *get_rfc3526_prime_8192(BIGNUM *bn);\n\nint BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_BN_strings(void);\n\n/* Error codes for the BN functions. */\n\n/* Function codes. */\n# define BN_F_BNRAND                                      127\n# define BN_F_BN_BLINDING_CONVERT_EX                      100\n# define BN_F_BN_BLINDING_CREATE_PARAM                    128\n# define BN_F_BN_BLINDING_INVERT_EX                       101\n# define BN_F_BN_BLINDING_NEW                             102\n# define BN_F_BN_BLINDING_UPDATE                          103\n# define BN_F_BN_BN2DEC                                   104\n# define BN_F_BN_BN2HEX                                   105\n# define BN_F_BN_CTX_GET                                  116\n# define BN_F_BN_CTX_NEW                                  106\n# define BN_F_BN_CTX_START                                129\n# define BN_F_BN_DIV                                      107\n# define BN_F_BN_DIV_NO_BRANCH                            138\n# define BN_F_BN_DIV_RECP                                 130\n# define BN_F_BN_EXP                                      123\n# define BN_F_BN_EXPAND2                                  108\n# define BN_F_BN_EXPAND_INTERNAL                          120\n# define BN_F_BN_GF2M_MOD                                 131\n# define BN_F_BN_GF2M_MOD_EXP                             132\n# define BN_F_BN_GF2M_MOD_MUL                             133\n# define BN_F_BN_GF2M_MOD_SOLVE_QUAD                      134\n# define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR                  135\n# define BN_F_BN_GF2M_MOD_SQR                             136\n# define BN_F_BN_GF2M_MOD_SQRT                            137\n# define BN_F_BN_LSHIFT                                   145\n# define BN_F_BN_MOD_EXP2_MONT                            118\n# define BN_F_BN_MOD_EXP_MONT                             109\n# define BN_F_BN_MOD_EXP_MONT_CONSTTIME                   124\n# define BN_F_BN_MOD_EXP_MONT_WORD                        117\n# define BN_F_BN_MOD_EXP_RECP                             125\n# define BN_F_BN_MOD_EXP_SIMPLE                           126\n# define BN_F_BN_MOD_INVERSE                              110\n# define BN_F_BN_MOD_INVERSE_NO_BRANCH                    139\n# define BN_F_BN_MOD_LSHIFT_QUICK                         119\n# define BN_F_BN_MOD_MUL_RECIPROCAL                       111\n# define BN_F_BN_MOD_SQRT                                 121\n# define BN_F_BN_MPI2BN                                   112\n# define BN_F_BN_NEW                                      113\n# define BN_F_BN_RAND                                     114\n# define BN_F_BN_RAND_RANGE                               122\n# define BN_F_BN_RSHIFT                                   146\n# define BN_F_BN_USUB                                     115\n\n/* Reason codes. */\n# define BN_R_ARG2_LT_ARG3                                100\n# define BN_R_BAD_RECIPROCAL                              101\n# define BN_R_BIGNUM_TOO_LONG                             114\n# define BN_R_BITS_TOO_SMALL                              118\n# define BN_R_CALLED_WITH_EVEN_MODULUS                    102\n# define BN_R_DIV_BY_ZERO                                 103\n# define BN_R_ENCODING_ERROR                              104\n# define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA                105\n# define BN_R_INPUT_NOT_REDUCED                           110\n# define BN_R_INVALID_LENGTH                              106\n# define BN_R_INVALID_RANGE                               115\n# define BN_R_INVALID_SHIFT                               119\n# define BN_R_NOT_A_SQUARE                                111\n# define BN_R_NOT_INITIALIZED                             107\n# define BN_R_NO_INVERSE                                  108\n# define BN_R_NO_SOLUTION                                 116\n# define BN_R_P_IS_NOT_PRIME                              112\n# define BN_R_TOO_MANY_ITERATIONS                         113\n# define BN_R_TOO_MANY_TEMPORARY_VARIABLES                109\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/buffer.h",
    "content": "/* crypto/buffer/buffer.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_BUFFER_H\n# define HEADER_BUFFER_H\n\n# include <openssl/ossl_typ.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# include <stddef.h>\n\n# if !defined(NO_SYS_TYPES_H)\n#  include <sys/types.h>\n# endif\n\n/* Already declared in ossl_typ.h */\n/* typedef struct buf_mem_st BUF_MEM; */\n\nstruct buf_mem_st {\n    size_t length;              /* current number of bytes */\n    char *data;\n    size_t max;                 /* size of buffer */\n};\n\nBUF_MEM *BUF_MEM_new(void);\nvoid BUF_MEM_free(BUF_MEM *a);\nint BUF_MEM_grow(BUF_MEM *str, size_t len);\nint BUF_MEM_grow_clean(BUF_MEM *str, size_t len);\nsize_t BUF_strnlen(const char *str, size_t maxlen);\nchar *BUF_strdup(const char *str);\n\n/*\n * Like strndup, but in addition, explicitly guarantees to never read past the\n * first |siz| bytes of |str|.\n */\nchar *BUF_strndup(const char *str, size_t siz);\n\nvoid *BUF_memdup(const void *data, size_t siz);\nvoid BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);\n\n/* safe string functions */\nsize_t BUF_strlcpy(char *dst, const char *src, size_t siz);\nsize_t BUF_strlcat(char *dst, const char *src, size_t siz);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_BUF_strings(void);\n\n/* Error codes for the BUF functions. */\n\n/* Function codes. */\n# define BUF_F_BUF_MEMDUP                                 103\n# define BUF_F_BUF_MEM_GROW                               100\n# define BUF_F_BUF_MEM_GROW_CLEAN                         105\n# define BUF_F_BUF_MEM_NEW                                101\n# define BUF_F_BUF_STRDUP                                 102\n# define BUF_F_BUF_STRNDUP                                104\n\n/* Reason codes. */\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/camellia.h",
    "content": "/* crypto/camellia/camellia.h */\n/* ====================================================================\n * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n */\n\n#ifndef HEADER_CAMELLIA_H\n# define HEADER_CAMELLIA_H\n\n# include <openssl/opensslconf.h>\n\n# ifdef OPENSSL_NO_CAMELLIA\n#  error CAMELLIA is disabled.\n# endif\n\n# include <stddef.h>\n\n# define CAMELLIA_ENCRYPT        1\n# define CAMELLIA_DECRYPT        0\n\n/*\n * Because array size can't be a const in C, the following two are macros.\n * Both sizes are in bytes.\n */\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* This should be a hidden type, but EVP requires that the size be known */\n\n# define CAMELLIA_BLOCK_SIZE 16\n# define CAMELLIA_TABLE_BYTE_LEN 272\n# define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4)\n\ntypedef unsigned int KEY_TABLE_TYPE[CAMELLIA_TABLE_WORD_LEN]; /* to match\n                                                               * with WORD */\n\nstruct camellia_key_st {\n    union {\n        double d;               /* ensures 64-bit align */\n        KEY_TABLE_TYPE rd_key;\n    } u;\n    int grand_rounds;\n};\ntypedef struct camellia_key_st CAMELLIA_KEY;\n\n# ifdef OPENSSL_FIPS\nint private_Camellia_set_key(const unsigned char *userKey, const int bits,\n                             CAMELLIA_KEY *key);\n# endif\nint Camellia_set_key(const unsigned char *userKey, const int bits,\n                     CAMELLIA_KEY *key);\n\nvoid Camellia_encrypt(const unsigned char *in, unsigned char *out,\n                      const CAMELLIA_KEY *key);\nvoid Camellia_decrypt(const unsigned char *in, unsigned char *out,\n                      const CAMELLIA_KEY *key);\n\nvoid Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out,\n                          const CAMELLIA_KEY *key, const int enc);\nvoid Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,\n                          size_t length, const CAMELLIA_KEY *key,\n                          unsigned char *ivec, const int enc);\nvoid Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out,\n                             size_t length, const CAMELLIA_KEY *key,\n                             unsigned char *ivec, int *num, const int enc);\nvoid Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out,\n                           size_t length, const CAMELLIA_KEY *key,\n                           unsigned char *ivec, int *num, const int enc);\nvoid Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out,\n                           size_t length, const CAMELLIA_KEY *key,\n                           unsigned char *ivec, int *num, const int enc);\nvoid Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out,\n                             size_t length, const CAMELLIA_KEY *key,\n                             unsigned char *ivec, int *num);\nvoid Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out,\n                             size_t length, const CAMELLIA_KEY *key,\n                             unsigned char ivec[CAMELLIA_BLOCK_SIZE],\n                             unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE],\n                             unsigned int *num);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif                          /* !HEADER_Camellia_H */\n"
  },
  {
    "path": "third_party/include/openssl/cast.h",
    "content": "/* crypto/cast/cast.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_CAST_H\n# define HEADER_CAST_H\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# include <openssl/opensslconf.h>\n\n# ifdef OPENSSL_NO_CAST\n#  error CAST is disabled.\n# endif\n\n# define CAST_ENCRYPT    1\n# define CAST_DECRYPT    0\n\n# define CAST_LONG unsigned int\n\n# define CAST_BLOCK      8\n# define CAST_KEY_LENGTH 16\n\ntypedef struct cast_key_st {\n    CAST_LONG data[32];\n    int short_key;              /* Use reduced rounds for short key */\n} CAST_KEY;\n\n# ifdef OPENSSL_FIPS\nvoid private_CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);\n# endif\nvoid CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);\nvoid CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,\n                      const CAST_KEY *key, int enc);\nvoid CAST_encrypt(CAST_LONG *data, const CAST_KEY *key);\nvoid CAST_decrypt(CAST_LONG *data, const CAST_KEY *key);\nvoid CAST_cbc_encrypt(const unsigned char *in, unsigned char *out,\n                      long length, const CAST_KEY *ks, unsigned char *iv,\n                      int enc);\nvoid CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,\n                        long length, const CAST_KEY *schedule,\n                        unsigned char *ivec, int *num, int enc);\nvoid CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,\n                        long length, const CAST_KEY *schedule,\n                        unsigned char *ivec, int *num);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/cmac.h",
    "content": "/* crypto/cmac/cmac.h */\n/*\n * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL\n * project.\n */\n/* ====================================================================\n * Copyright (c) 2010 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n */\n\n#ifndef HEADER_CMAC_H\n# define HEADER_CMAC_H\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n# include <openssl/evp.h>\n\n/* Opaque */\ntypedef struct CMAC_CTX_st CMAC_CTX;\n\nCMAC_CTX *CMAC_CTX_new(void);\nvoid CMAC_CTX_cleanup(CMAC_CTX *ctx);\nvoid CMAC_CTX_free(CMAC_CTX *ctx);\nEVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx);\nint CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in);\n\nint CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,\n              const EVP_CIPHER *cipher, ENGINE *impl);\nint CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen);\nint CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen);\nint CMAC_resume(CMAC_CTX *ctx);\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/cms.h",
    "content": "/* crypto/cms/cms.h */\n/*\n * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL\n * project.\n */\n/* ====================================================================\n * Copyright (c) 2008 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n */\n\n#ifndef HEADER_CMS_H\n# define HEADER_CMS_H\n\n# include <openssl/x509.h>\n\n# ifdef OPENSSL_NO_CMS\n#  error CMS is disabled.\n# endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct CMS_ContentInfo_st CMS_ContentInfo;\ntypedef struct CMS_SignerInfo_st CMS_SignerInfo;\ntypedef struct CMS_CertificateChoices CMS_CertificateChoices;\ntypedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;\ntypedef struct CMS_RecipientInfo_st CMS_RecipientInfo;\ntypedef struct CMS_ReceiptRequest_st CMS_ReceiptRequest;\ntypedef struct CMS_Receipt_st CMS_Receipt;\ntypedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;\ntypedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;\n\nDECLARE_STACK_OF(CMS_SignerInfo)\nDECLARE_STACK_OF(GENERAL_NAMES)\nDECLARE_STACK_OF(CMS_RecipientEncryptedKey)\nDECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)\nDECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)\nDECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)\n\n# define CMS_SIGNERINFO_ISSUER_SERIAL    0\n# define CMS_SIGNERINFO_KEYIDENTIFIER    1\n\n# define CMS_RECIPINFO_NONE              -1\n# define CMS_RECIPINFO_TRANS             0\n# define CMS_RECIPINFO_AGREE             1\n# define CMS_RECIPINFO_KEK               2\n# define CMS_RECIPINFO_PASS              3\n# define CMS_RECIPINFO_OTHER             4\n\n/* S/MIME related flags */\n\n# define CMS_TEXT                        0x1\n# define CMS_NOCERTS                     0x2\n# define CMS_NO_CONTENT_VERIFY           0x4\n# define CMS_NO_ATTR_VERIFY              0x8\n# define CMS_NOSIGS                      \\\n                        (CMS_NO_CONTENT_VERIFY|CMS_NO_ATTR_VERIFY)\n# define CMS_NOINTERN                    0x10\n# define CMS_NO_SIGNER_CERT_VERIFY       0x20\n# define CMS_NOVERIFY                    0x20\n# define CMS_DETACHED                    0x40\n# define CMS_BINARY                      0x80\n# define CMS_NOATTR                      0x100\n# define CMS_NOSMIMECAP                  0x200\n# define CMS_NOOLDMIMETYPE               0x400\n# define CMS_CRLFEOL                     0x800\n# define CMS_STREAM                      0x1000\n# define CMS_NOCRL                       0x2000\n# define CMS_PARTIAL                     0x4000\n# define CMS_REUSE_DIGEST                0x8000\n# define CMS_USE_KEYID                   0x10000\n# define CMS_DEBUG_DECRYPT               0x20000\n# define CMS_KEY_PARAM                   0x40000\n\nconst ASN1_OBJECT *CMS_get0_type(CMS_ContentInfo *cms);\n\nBIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);\nint CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);\n\nASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);\nint CMS_is_detached(CMS_ContentInfo *cms);\nint CMS_set_detached(CMS_ContentInfo *cms, int detached);\n\n# ifdef HEADER_PEM_H\nDECLARE_PEM_rw_const(CMS, CMS_ContentInfo)\n# endif\nint CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);\nCMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);\nint i2d_CMS_bio(BIO *bp, CMS_ContentInfo *cms);\n\nBIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);\nint i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);\nint PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in,\n                             int flags);\nCMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont);\nint SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);\n\nint CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont,\n              unsigned int flags);\n\nCMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,\n                          STACK_OF(X509) *certs, BIO *data,\n                          unsigned int flags);\n\nCMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,\n                                  X509 *signcert, EVP_PKEY *pkey,\n                                  STACK_OF(X509) *certs, unsigned int flags);\n\nint CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);\nCMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);\n\nint CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,\n                      unsigned int flags);\nCMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,\n                                   unsigned int flags);\n\nint CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,\n                              const unsigned char *key, size_t keylen,\n                              BIO *dcont, BIO *out, unsigned int flags);\n\nCMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,\n                                           const unsigned char *key,\n                                           size_t keylen, unsigned int flags);\n\nint CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,\n                               const unsigned char *key, size_t keylen);\n\nint CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,\n               X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);\n\nint CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,\n                       STACK_OF(X509) *certs,\n                       X509_STORE *store, unsigned int flags);\n\nSTACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);\n\nCMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,\n                             const EVP_CIPHER *cipher, unsigned int flags);\n\nint CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,\n                BIO *dcont, BIO *out, unsigned int flags);\n\nint CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);\nint CMS_decrypt_set1_key(CMS_ContentInfo *cms,\n                         unsigned char *key, size_t keylen,\n                         unsigned char *id, size_t idlen);\nint CMS_decrypt_set1_password(CMS_ContentInfo *cms,\n                              unsigned char *pass, ossl_ssize_t passlen);\n\nSTACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);\nint CMS_RecipientInfo_type(CMS_RecipientInfo *ri);\nEVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);\nCMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);\nCMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,\n                                           X509 *recip, unsigned int flags);\nint CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);\nint CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);\nint CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri,\n                                     EVP_PKEY **pk, X509 **recip,\n                                     X509_ALGOR **palg);\nint CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri,\n                                          ASN1_OCTET_STRING **keyid,\n                                          X509_NAME **issuer,\n                                          ASN1_INTEGER **sno);\n\nCMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,\n                                          unsigned char *key, size_t keylen,\n                                          unsigned char *id, size_t idlen,\n                                          ASN1_GENERALIZEDTIME *date,\n                                          ASN1_OBJECT *otherTypeId,\n                                          ASN1_TYPE *otherType);\n\nint CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri,\n                                    X509_ALGOR **palg,\n                                    ASN1_OCTET_STRING **pid,\n                                    ASN1_GENERALIZEDTIME **pdate,\n                                    ASN1_OBJECT **potherid,\n                                    ASN1_TYPE **pothertype);\n\nint CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri,\n                               unsigned char *key, size_t keylen);\n\nint CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri,\n                                   const unsigned char *id, size_t idlen);\n\nint CMS_RecipientInfo_set0_password(CMS_RecipientInfo *ri,\n                                    unsigned char *pass,\n                                    ossl_ssize_t passlen);\n\nCMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,\n                                               int iter, int wrap_nid,\n                                               int pbe_nid,\n                                               unsigned char *pass,\n                                               ossl_ssize_t passlen,\n                                               const EVP_CIPHER *kekciph);\n\nint CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);\nint CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);\n\nint CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,\n                   unsigned int flags);\nCMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags);\n\nint CMS_set1_eContentType(CMS_ContentInfo *cms, const ASN1_OBJECT *oid);\nconst ASN1_OBJECT *CMS_get0_eContentType(CMS_ContentInfo *cms);\n\nCMS_CertificateChoices *CMS_add0_CertificateChoices(CMS_ContentInfo *cms);\nint CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);\nint CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);\nSTACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);\n\nCMS_RevocationInfoChoice *CMS_add0_RevocationInfoChoice(CMS_ContentInfo *cms);\nint CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);\nint CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);\nSTACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);\n\nint CMS_SignedData_init(CMS_ContentInfo *cms);\nCMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,\n                                X509 *signer, EVP_PKEY *pk, const EVP_MD *md,\n                                unsigned int flags);\nEVP_PKEY_CTX *CMS_SignerInfo_get0_pkey_ctx(CMS_SignerInfo *si);\nEVP_MD_CTX *CMS_SignerInfo_get0_md_ctx(CMS_SignerInfo *si);\nSTACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms);\n\nvoid CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer);\nint CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,\n                                  ASN1_OCTET_STRING **keyid,\n                                  X509_NAME **issuer, ASN1_INTEGER **sno);\nint CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);\nint CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,\n                           unsigned int flags);\nvoid CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk,\n                              X509 **signer, X509_ALGOR **pdig,\n                              X509_ALGOR **psig);\nASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);\nint CMS_SignerInfo_sign(CMS_SignerInfo *si);\nint CMS_SignerInfo_verify(CMS_SignerInfo *si);\nint CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);\n\nint CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);\nint CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,\n                            int algnid, int keysize);\nint CMS_add_standard_smimecap(STACK_OF(X509_ALGOR) **smcap);\n\nint CMS_signed_get_attr_count(const CMS_SignerInfo *si);\nint CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid,\n                               int lastpos);\nint CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj,\n                               int lastpos);\nX509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc);\nX509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc);\nint CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);\nint CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si,\n                                const ASN1_OBJECT *obj, int type,\n                                const void *bytes, int len);\nint CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si,\n                                int nid, int type,\n                                const void *bytes, int len);\nint CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,\n                                const char *attrname, int type,\n                                const void *bytes, int len);\nvoid *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,\n                                  int lastpos, int type);\n\nint CMS_unsigned_get_attr_count(const CMS_SignerInfo *si);\nint CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid,\n                                 int lastpos);\nint CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si, ASN1_OBJECT *obj,\n                                 int lastpos);\nX509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc);\nX509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc);\nint CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr);\nint CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si,\n                                  const ASN1_OBJECT *obj, int type,\n                                  const void *bytes, int len);\nint CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si,\n                                  int nid, int type,\n                                  const void *bytes, int len);\nint CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,\n                                  const char *attrname, int type,\n                                  const void *bytes, int len);\nvoid *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,\n                                    int lastpos, int type);\n\n# ifdef HEADER_X509V3_H\n\nint CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);\nCMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen,\n                                               int allorfirst,\n                                               STACK_OF(GENERAL_NAMES)\n                                               *receiptList, STACK_OF(GENERAL_NAMES)\n                                               *receiptsTo);\nint CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);\nvoid CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,\n                                    ASN1_STRING **pcid,\n                                    int *pallorfirst,\n                                    STACK_OF(GENERAL_NAMES) **plist,\n                                    STACK_OF(GENERAL_NAMES) **prto);\n# endif\nint CMS_RecipientInfo_kari_get0_alg(CMS_RecipientInfo *ri,\n                                    X509_ALGOR **palg,\n                                    ASN1_OCTET_STRING **pukm);\nSTACK_OF(CMS_RecipientEncryptedKey)\n*CMS_RecipientInfo_kari_get0_reks(CMS_RecipientInfo *ri);\n\nint CMS_RecipientInfo_kari_get0_orig_id(CMS_RecipientInfo *ri,\n                                        X509_ALGOR **pubalg,\n                                        ASN1_BIT_STRING **pubkey,\n                                        ASN1_OCTET_STRING **keyid,\n                                        X509_NAME **issuer,\n                                        ASN1_INTEGER **sno);\n\nint CMS_RecipientInfo_kari_orig_id_cmp(CMS_RecipientInfo *ri, X509 *cert);\n\nint CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,\n                                      ASN1_OCTET_STRING **keyid,\n                                      ASN1_GENERALIZEDTIME **tm,\n                                      CMS_OtherKeyAttribute **other,\n                                      X509_NAME **issuer, ASN1_INTEGER **sno);\nint CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,\n                                       X509 *cert);\nint CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);\nEVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);\nint CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,\n                                   CMS_RecipientInfo *ri,\n                                   CMS_RecipientEncryptedKey *rek);\n\nint CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,\n                          ASN1_OCTET_STRING *ukm, int keylen);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_CMS_strings(void);\n\n/* Error codes for the CMS functions. */\n\n/* Function codes. */\n# define CMS_F_CHECK_CONTENT                              99\n# define CMS_F_CMS_ADD0_CERT                              164\n# define CMS_F_CMS_ADD0_RECIPIENT_KEY                     100\n# define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD                165\n# define CMS_F_CMS_ADD1_RECEIPTREQUEST                    158\n# define CMS_F_CMS_ADD1_RECIPIENT_CERT                    101\n# define CMS_F_CMS_ADD1_SIGNER                            102\n# define CMS_F_CMS_ADD1_SIGNINGTIME                       103\n# define CMS_F_CMS_COMPRESS                               104\n# define CMS_F_CMS_COMPRESSEDDATA_CREATE                  105\n# define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO                106\n# define CMS_F_CMS_COPY_CONTENT                           107\n# define CMS_F_CMS_COPY_MESSAGEDIGEST                     108\n# define CMS_F_CMS_DATA                                   109\n# define CMS_F_CMS_DATAFINAL                              110\n# define CMS_F_CMS_DATAINIT                               111\n# define CMS_F_CMS_DECRYPT                                112\n# define CMS_F_CMS_DECRYPT_SET1_KEY                       113\n# define CMS_F_CMS_DECRYPT_SET1_PASSWORD                  166\n# define CMS_F_CMS_DECRYPT_SET1_PKEY                      114\n# define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX               115\n# define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO               116\n# define CMS_F_CMS_DIGESTEDDATA_DO_FINAL                  117\n# define CMS_F_CMS_DIGEST_VERIFY                          118\n# define CMS_F_CMS_ENCODE_RECEIPT                         161\n# define CMS_F_CMS_ENCRYPT                                119\n# define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO              120\n# define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT                  121\n# define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT                  122\n# define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY                 123\n# define CMS_F_CMS_ENVELOPEDDATA_CREATE                   124\n# define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO                 125\n# define CMS_F_CMS_ENVELOPED_DATA_INIT                    126\n# define CMS_F_CMS_ENV_ASN1_CTRL                          171\n# define CMS_F_CMS_FINAL                                  127\n# define CMS_F_CMS_GET0_CERTIFICATE_CHOICES               128\n# define CMS_F_CMS_GET0_CONTENT                           129\n# define CMS_F_CMS_GET0_ECONTENT_TYPE                     130\n# define CMS_F_CMS_GET0_ENVELOPED                         131\n# define CMS_F_CMS_GET0_REVOCATION_CHOICES                132\n# define CMS_F_CMS_GET0_SIGNED                            133\n# define CMS_F_CMS_MSGSIGDIGEST_ADD1                      162\n# define CMS_F_CMS_RECEIPTREQUEST_CREATE0                 159\n# define CMS_F_CMS_RECEIPT_VERIFY                         160\n# define CMS_F_CMS_RECIPIENTINFO_DECRYPT                  134\n# define CMS_F_CMS_RECIPIENTINFO_ENCRYPT                  169\n# define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT             178\n# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG            175\n# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID        173\n# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS           172\n# define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP         174\n# define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT            135\n# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT            136\n# define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID            137\n# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP             138\n# define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP            139\n# define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT             140\n# define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT             141\n# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS           142\n# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID      143\n# define CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT               167\n# define CMS_F_CMS_RECIPIENTINFO_SET0_KEY                 144\n# define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD            168\n# define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY                145\n# define CMS_F_CMS_SD_ASN1_CTRL                           170\n# define CMS_F_CMS_SET1_IAS                               176\n# define CMS_F_CMS_SET1_KEYID                             177\n# define CMS_F_CMS_SET1_SIGNERIDENTIFIER                  146\n# define CMS_F_CMS_SET_DETACHED                           147\n# define CMS_F_CMS_SIGN                                   148\n# define CMS_F_CMS_SIGNED_DATA_INIT                       149\n# define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN                150\n# define CMS_F_CMS_SIGNERINFO_SIGN                        151\n# define CMS_F_CMS_SIGNERINFO_VERIFY                      152\n# define CMS_F_CMS_SIGNERINFO_VERIFY_CERT                 153\n# define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT              154\n# define CMS_F_CMS_SIGN_RECEIPT                           163\n# define CMS_F_CMS_STREAM                                 155\n# define CMS_F_CMS_UNCOMPRESS                             156\n# define CMS_F_CMS_VERIFY                                 157\n\n/* Reason codes. */\n# define CMS_R_ADD_SIGNER_ERROR                           99\n# define CMS_R_CERTIFICATE_ALREADY_PRESENT                175\n# define CMS_R_CERTIFICATE_HAS_NO_KEYID                   160\n# define CMS_R_CERTIFICATE_VERIFY_ERROR                   100\n# define CMS_R_CIPHER_INITIALISATION_ERROR                101\n# define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR      102\n# define CMS_R_CMS_DATAFINAL_ERROR                        103\n# define CMS_R_CMS_LIB                                    104\n# define CMS_R_CONTENTIDENTIFIER_MISMATCH                 170\n# define CMS_R_CONTENT_NOT_FOUND                          105\n# define CMS_R_CONTENT_TYPE_MISMATCH                      171\n# define CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA           106\n# define CMS_R_CONTENT_TYPE_NOT_ENVELOPED_DATA            107\n# define CMS_R_CONTENT_TYPE_NOT_SIGNED_DATA               108\n# define CMS_R_CONTENT_VERIFY_ERROR                       109\n# define CMS_R_CTRL_ERROR                                 110\n# define CMS_R_CTRL_FAILURE                               111\n# define CMS_R_DECRYPT_ERROR                              112\n# define CMS_R_DIGEST_ERROR                               161\n# define CMS_R_ERROR_GETTING_PUBLIC_KEY                   113\n# define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE      114\n# define CMS_R_ERROR_SETTING_KEY                          115\n# define CMS_R_ERROR_SETTING_RECIPIENTINFO                116\n# define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH               117\n# define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER           176\n# define CMS_R_INVALID_KEY_LENGTH                         118\n# define CMS_R_MD_BIO_INIT_ERROR                          119\n# define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH       120\n# define CMS_R_MESSAGEDIGEST_WRONG_LENGTH                 121\n# define CMS_R_MSGSIGDIGEST_ERROR                         172\n# define CMS_R_MSGSIGDIGEST_VERIFICATION_FAILURE          162\n# define CMS_R_MSGSIGDIGEST_WRONG_LENGTH                  163\n# define CMS_R_NEED_ONE_SIGNER                            164\n# define CMS_R_NOT_A_SIGNED_RECEIPT                       165\n# define CMS_R_NOT_ENCRYPTED_DATA                         122\n# define CMS_R_NOT_KEK                                    123\n# define CMS_R_NOT_KEY_AGREEMENT                          181\n# define CMS_R_NOT_KEY_TRANSPORT                          124\n# define CMS_R_NOT_PWRI                                   177\n# define CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE            125\n# define CMS_R_NO_CIPHER                                  126\n# define CMS_R_NO_CONTENT                                 127\n# define CMS_R_NO_CONTENT_TYPE                            173\n# define CMS_R_NO_DEFAULT_DIGEST                          128\n# define CMS_R_NO_DIGEST_SET                              129\n# define CMS_R_NO_KEY                                     130\n# define CMS_R_NO_KEY_OR_CERT                             174\n# define CMS_R_NO_MATCHING_DIGEST                         131\n# define CMS_R_NO_MATCHING_RECIPIENT                      132\n# define CMS_R_NO_MATCHING_SIGNATURE                      166\n# define CMS_R_NO_MSGSIGDIGEST                            167\n# define CMS_R_NO_PASSWORD                                178\n# define CMS_R_NO_PRIVATE_KEY                             133\n# define CMS_R_NO_PUBLIC_KEY                              134\n# define CMS_R_NO_RECEIPT_REQUEST                         168\n# define CMS_R_NO_SIGNERS                                 135\n# define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE     136\n# define CMS_R_RECEIPT_DECODE_ERROR                       169\n# define CMS_R_RECIPIENT_ERROR                            137\n# define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND               138\n# define CMS_R_SIGNFINAL_ERROR                            139\n# define CMS_R_SMIME_TEXT_ERROR                           140\n# define CMS_R_STORE_INIT_ERROR                           141\n# define CMS_R_TYPE_NOT_COMPRESSED_DATA                   142\n# define CMS_R_TYPE_NOT_DATA                              143\n# define CMS_R_TYPE_NOT_DIGESTED_DATA                     144\n# define CMS_R_TYPE_NOT_ENCRYPTED_DATA                    145\n# define CMS_R_TYPE_NOT_ENVELOPED_DATA                    146\n# define CMS_R_UNABLE_TO_FINALIZE_CONTEXT                 147\n# define CMS_R_UNKNOWN_CIPHER                             148\n# define CMS_R_UNKNOWN_DIGEST_ALGORIHM                    149\n# define CMS_R_UNKNOWN_ID                                 150\n# define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM          151\n# define CMS_R_UNSUPPORTED_CONTENT_TYPE                   152\n# define CMS_R_UNSUPPORTED_KEK_ALGORITHM                  153\n# define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM       179\n# define CMS_R_UNSUPPORTED_RECIPIENT_TYPE                 154\n# define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE              155\n# define CMS_R_UNSUPPORTED_TYPE                           156\n# define CMS_R_UNWRAP_ERROR                               157\n# define CMS_R_UNWRAP_FAILURE                             180\n# define CMS_R_VERIFICATION_FAILURE                       158\n# define CMS_R_WRAP_ERROR                                 159\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/comp.h",
    "content": "\n#ifndef HEADER_COMP_H\n# define HEADER_COMP_H\n\n# include <openssl/crypto.h>\n\n# ifdef OPENSSL_NO_COMP\n#  error COMP is disabled.\n# endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct comp_ctx_st COMP_CTX;\n\nstruct comp_method_st {\n    int type;                   /* NID for compression library */\n    const char *name;           /* A text string to identify the library */\n    int (*init) (COMP_CTX *ctx);\n    void (*finish) (COMP_CTX *ctx);\n    int (*compress) (COMP_CTX *ctx,\n                     unsigned char *out, unsigned int olen,\n                     unsigned char *in, unsigned int ilen);\n    int (*expand) (COMP_CTX *ctx,\n                   unsigned char *out, unsigned int olen,\n                   unsigned char *in, unsigned int ilen);\n    /*\n     * The following two do NOTHING, but are kept for backward compatibility\n     */\n    long (*ctrl) (void);\n    long (*callback_ctrl) (void);\n};\n\nstruct comp_ctx_st {\n    COMP_METHOD *meth;\n    unsigned long compress_in;\n    unsigned long compress_out;\n    unsigned long expand_in;\n    unsigned long expand_out;\n    CRYPTO_EX_DATA ex_data;\n};\n\nCOMP_CTX *COMP_CTX_new(COMP_METHOD *meth);\nvoid COMP_CTX_free(COMP_CTX *ctx);\nint COMP_compress_block(COMP_CTX *ctx, unsigned char *out, int olen,\n                        unsigned char *in, int ilen);\nint COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,\n                      unsigned char *in, int ilen);\nCOMP_METHOD *COMP_rle(void);\nCOMP_METHOD *COMP_zlib(void);\nvoid COMP_zlib_cleanup(void);\n\n# ifdef HEADER_BIO_H\n#  ifdef ZLIB\nBIO_METHOD *BIO_f_zlib(void);\n#  endif\n# endif\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_COMP_strings(void);\n\n/* Error codes for the COMP functions. */\n\n/* Function codes. */\n# define COMP_F_BIO_ZLIB_FLUSH                            99\n# define COMP_F_BIO_ZLIB_NEW                              100\n# define COMP_F_BIO_ZLIB_READ                             101\n# define COMP_F_BIO_ZLIB_WRITE                            102\n\n/* Reason codes. */\n# define COMP_R_ZLIB_DEFLATE_ERROR                        99\n# define COMP_R_ZLIB_INFLATE_ERROR                        100\n# define COMP_R_ZLIB_NOT_SUPPORTED                        101\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/conf.h",
    "content": "/* crypto/conf/conf.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef  HEADER_CONF_H\n# define HEADER_CONF_H\n\n# include <openssl/bio.h>\n# include <openssl/lhash.h>\n# include <openssl/stack.h>\n# include <openssl/safestack.h>\n# include <openssl/e_os2.h>\n\n# include <openssl/ossl_typ.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct {\n    char *section;\n    char *name;\n    char *value;\n} CONF_VALUE;\n\nDECLARE_STACK_OF(CONF_VALUE)\nDECLARE_LHASH_OF(CONF_VALUE);\n\nstruct conf_st;\nstruct conf_method_st;\ntypedef struct conf_method_st CONF_METHOD;\n\nstruct conf_method_st {\n    const char *name;\n    CONF *(*create) (CONF_METHOD *meth);\n    int (*init) (CONF *conf);\n    int (*destroy) (CONF *conf);\n    int (*destroy_data) (CONF *conf);\n    int (*load_bio) (CONF *conf, BIO *bp, long *eline);\n    int (*dump) (const CONF *conf, BIO *bp);\n    int (*is_number) (const CONF *conf, char c);\n    int (*to_int) (const CONF *conf, char c);\n    int (*load) (CONF *conf, const char *name, long *eline);\n};\n\n/* Module definitions */\n\ntypedef struct conf_imodule_st CONF_IMODULE;\ntypedef struct conf_module_st CONF_MODULE;\n\nDECLARE_STACK_OF(CONF_MODULE)\nDECLARE_STACK_OF(CONF_IMODULE)\n\n/* DSO module function typedefs */\ntypedef int conf_init_func (CONF_IMODULE *md, const CONF *cnf);\ntypedef void conf_finish_func (CONF_IMODULE *md);\n\n# define CONF_MFLAGS_IGNORE_ERRORS       0x1\n# define CONF_MFLAGS_IGNORE_RETURN_CODES 0x2\n# define CONF_MFLAGS_SILENT              0x4\n# define CONF_MFLAGS_NO_DSO              0x8\n# define CONF_MFLAGS_IGNORE_MISSING_FILE 0x10\n# define CONF_MFLAGS_DEFAULT_SECTION     0x20\n\nint CONF_set_default_method(CONF_METHOD *meth);\nvoid CONF_set_nconf(CONF *conf, LHASH_OF(CONF_VALUE) *hash);\nLHASH_OF(CONF_VALUE) *CONF_load(LHASH_OF(CONF_VALUE) *conf, const char *file,\n                                long *eline);\n# ifndef OPENSSL_NO_FP_API\nLHASH_OF(CONF_VALUE) *CONF_load_fp(LHASH_OF(CONF_VALUE) *conf, FILE *fp,\n                                   long *eline);\n# endif\nLHASH_OF(CONF_VALUE) *CONF_load_bio(LHASH_OF(CONF_VALUE) *conf, BIO *bp,\n                                    long *eline);\nSTACK_OF(CONF_VALUE) *CONF_get_section(LHASH_OF(CONF_VALUE) *conf,\n                                       const char *section);\nchar *CONF_get_string(LHASH_OF(CONF_VALUE) *conf, const char *group,\n                      const char *name);\nlong CONF_get_number(LHASH_OF(CONF_VALUE) *conf, const char *group,\n                     const char *name);\nvoid CONF_free(LHASH_OF(CONF_VALUE) *conf);\nint CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);\nint CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);\n\nvoid OPENSSL_config(const char *config_name);\nvoid OPENSSL_no_config(void);\n\n/*\n * New conf code.  The semantics are different from the functions above. If\n * that wasn't the case, the above functions would have been replaced\n */\n\nstruct conf_st {\n    CONF_METHOD *meth;\n    void *meth_data;\n    LHASH_OF(CONF_VALUE) *data;\n};\n\nCONF *NCONF_new(CONF_METHOD *meth);\nCONF_METHOD *NCONF_default(void);\nCONF_METHOD *NCONF_WIN32(void);\n# if 0                          /* Just to give you an idea of what I have in\n                                 * mind */\nCONF_METHOD *NCONF_XML(void);\n# endif\nvoid NCONF_free(CONF *conf);\nvoid NCONF_free_data(CONF *conf);\n\nint NCONF_load(CONF *conf, const char *file, long *eline);\n# ifndef OPENSSL_NO_FP_API\nint NCONF_load_fp(CONF *conf, FILE *fp, long *eline);\n# endif\nint NCONF_load_bio(CONF *conf, BIO *bp, long *eline);\nSTACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,\n                                        const char *section);\nchar *NCONF_get_string(const CONF *conf, const char *group, const char *name);\nint NCONF_get_number_e(const CONF *conf, const char *group, const char *name,\n                       long *result);\nint NCONF_dump_fp(const CONF *conf, FILE *out);\nint NCONF_dump_bio(const CONF *conf, BIO *out);\n\n# if 0                          /* The following function has no error\n                                 * checking, and should therefore be avoided */\nlong NCONF_get_number(CONF *conf, char *group, char *name);\n# else\n#  define NCONF_get_number(c,g,n,r) NCONF_get_number_e(c,g,n,r)\n# endif\n\n/* Module functions */\n\nint CONF_modules_load(const CONF *cnf, const char *appname,\n                      unsigned long flags);\nint CONF_modules_load_file(const char *filename, const char *appname,\n                           unsigned long flags);\nvoid CONF_modules_unload(int all);\nvoid CONF_modules_finish(void);\nvoid CONF_modules_free(void);\nint CONF_module_add(const char *name, conf_init_func *ifunc,\n                    conf_finish_func *ffunc);\n\nconst char *CONF_imodule_get_name(const CONF_IMODULE *md);\nconst char *CONF_imodule_get_value(const CONF_IMODULE *md);\nvoid *CONF_imodule_get_usr_data(const CONF_IMODULE *md);\nvoid CONF_imodule_set_usr_data(CONF_IMODULE *md, void *usr_data);\nCONF_MODULE *CONF_imodule_get_module(const CONF_IMODULE *md);\nunsigned long CONF_imodule_get_flags(const CONF_IMODULE *md);\nvoid CONF_imodule_set_flags(CONF_IMODULE *md, unsigned long flags);\nvoid *CONF_module_get_usr_data(CONF_MODULE *pmod);\nvoid CONF_module_set_usr_data(CONF_MODULE *pmod, void *usr_data);\n\nchar *CONF_get1_default_config_file(void);\n\nint CONF_parse_list(const char *list, int sep, int nospc,\n                    int (*list_cb) (const char *elem, int len, void *usr),\n                    void *arg);\n\nvoid OPENSSL_load_builtin_modules(void);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_CONF_strings(void);\n\n/* Error codes for the CONF functions. */\n\n/* Function codes. */\n# define CONF_F_CONF_DUMP_FP                              104\n# define CONF_F_CONF_LOAD                                 100\n# define CONF_F_CONF_LOAD_BIO                             102\n# define CONF_F_CONF_LOAD_FP                              103\n# define CONF_F_CONF_MODULES_LOAD                         116\n# define CONF_F_CONF_PARSE_LIST                           119\n# define CONF_F_DEF_LOAD                                  120\n# define CONF_F_DEF_LOAD_BIO                              121\n# define CONF_F_MODULE_INIT                               115\n# define CONF_F_MODULE_LOAD_DSO                           117\n# define CONF_F_MODULE_RUN                                118\n# define CONF_F_NCONF_DUMP_BIO                            105\n# define CONF_F_NCONF_DUMP_FP                             106\n# define CONF_F_NCONF_GET_NUMBER                          107\n# define CONF_F_NCONF_GET_NUMBER_E                        112\n# define CONF_F_NCONF_GET_SECTION                         108\n# define CONF_F_NCONF_GET_STRING                          109\n# define CONF_F_NCONF_LOAD                                113\n# define CONF_F_NCONF_LOAD_BIO                            110\n# define CONF_F_NCONF_LOAD_FP                             114\n# define CONF_F_NCONF_NEW                                 111\n# define CONF_F_STR_COPY                                  101\n\n/* Reason codes. */\n# define CONF_R_ERROR_LOADING_DSO                         110\n# define CONF_R_LIST_CANNOT_BE_NULL                       115\n# define CONF_R_MISSING_CLOSE_SQUARE_BRACKET              100\n# define CONF_R_MISSING_EQUAL_SIGN                        101\n# define CONF_R_MISSING_FINISH_FUNCTION                   111\n# define CONF_R_MISSING_INIT_FUNCTION                     112\n# define CONF_R_MODULE_INITIALIZATION_ERROR               109\n# define CONF_R_NO_CLOSE_BRACE                            102\n# define CONF_R_NO_CONF                                   105\n# define CONF_R_NO_CONF_OR_ENVIRONMENT_VARIABLE           106\n# define CONF_R_NO_SECTION                                107\n# define CONF_R_NO_SUCH_FILE                              114\n# define CONF_R_NO_VALUE                                  108\n# define CONF_R_UNABLE_TO_CREATE_NEW_SECTION              103\n# define CONF_R_UNKNOWN_MODULE_NAME                       113\n# define CONF_R_VARIABLE_EXPANSION_TOO_LONG               116\n# define CONF_R_VARIABLE_HAS_NO_VALUE                     104\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/conf_api.h",
    "content": "/* conf_api.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef  HEADER_CONF_API_H\n# define HEADER_CONF_API_H\n\n# include <openssl/lhash.h>\n# include <openssl/conf.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* Up until OpenSSL 0.9.5a, this was new_section */\nCONF_VALUE *_CONF_new_section(CONF *conf, const char *section);\n/* Up until OpenSSL 0.9.5a, this was get_section */\nCONF_VALUE *_CONF_get_section(const CONF *conf, const char *section);\n/* Up until OpenSSL 0.9.5a, this was CONF_get_section */\nSTACK_OF(CONF_VALUE) *_CONF_get_section_values(const CONF *conf,\n                                               const char *section);\n\nint _CONF_add_string(CONF *conf, CONF_VALUE *section, CONF_VALUE *value);\nchar *_CONF_get_string(const CONF *conf, const char *section,\n                       const char *name);\nlong _CONF_get_number(const CONF *conf, const char *section,\n                      const char *name);\n\nint _CONF_new_data(CONF *conf);\nvoid _CONF_free_data(CONF *conf);\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/crypto.h",
    "content": "/* crypto/crypto.h */\n/* ====================================================================\n * Copyright (c) 1998-2006 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n/* ====================================================================\n * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.\n * ECDH support in OpenSSL originally developed by\n * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.\n */\n\n#ifndef HEADER_CRYPTO_H\n# define HEADER_CRYPTO_H\n\n# include <stdlib.h>\n\n# include <openssl/e_os2.h>\n\n# ifndef OPENSSL_NO_FP_API\n#  include <stdio.h>\n# endif\n\n# include <openssl/stack.h>\n# include <openssl/safestack.h>\n# include <openssl/opensslv.h>\n# include <openssl/ossl_typ.h>\n\n# ifdef CHARSET_EBCDIC\n#  include <openssl/ebcdic.h>\n# endif\n\n/*\n * Resolve problems on some operating systems with symbol names that clash\n * one way or another\n */\n# include <openssl/symhacks.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* Backward compatibility to SSLeay */\n/*\n * This is more to be used to check the correct DLL is being used in the MS\n * world.\n */\n# define SSLEAY_VERSION_NUMBER   OPENSSL_VERSION_NUMBER\n# define SSLEAY_VERSION          0\n/* #define SSLEAY_OPTIONS       1 no longer supported */\n# define SSLEAY_CFLAGS           2\n# define SSLEAY_BUILT_ON         3\n# define SSLEAY_PLATFORM         4\n# define SSLEAY_DIR              5\n\n/* Already declared in ossl_typ.h */\n# if 0\ntypedef struct crypto_ex_data_st CRYPTO_EX_DATA;\n/* Called when a new object is created */\ntypedef int CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad,\n                           int idx, long argl, void *argp);\n/* Called when an object is free()ed */\ntypedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad,\n                             int idx, long argl, void *argp);\n/* Called when we need to dup an object */\ntypedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from,\n                           void *from_d, int idx, long argl, void *argp);\n# endif\n\n/* A generic structure to pass assorted data in a expandable way */\ntypedef struct openssl_item_st {\n    int code;\n    void *value;                /* Not used for flag attributes */\n    size_t value_size;          /* Max size of value for output, length for\n                                 * input */\n    size_t *value_length;       /* Returned length of value for output */\n} OPENSSL_ITEM;\n\n/*\n * When changing the CRYPTO_LOCK_* list, be sure to maintin the text lock\n * names in cryptlib.c\n */\n\n# define CRYPTO_LOCK_ERR                 1\n# define CRYPTO_LOCK_EX_DATA             2\n# define CRYPTO_LOCK_X509                3\n# define CRYPTO_LOCK_X509_INFO           4\n# define CRYPTO_LOCK_X509_PKEY           5\n# define CRYPTO_LOCK_X509_CRL            6\n# define CRYPTO_LOCK_X509_REQ            7\n# define CRYPTO_LOCK_DSA                 8\n# define CRYPTO_LOCK_RSA                 9\n# define CRYPTO_LOCK_EVP_PKEY            10\n# define CRYPTO_LOCK_X509_STORE          11\n# define CRYPTO_LOCK_SSL_CTX             12\n# define CRYPTO_LOCK_SSL_CERT            13\n# define CRYPTO_LOCK_SSL_SESSION         14\n# define CRYPTO_LOCK_SSL_SESS_CERT       15\n# define CRYPTO_LOCK_SSL                 16\n# define CRYPTO_LOCK_SSL_METHOD          17\n# define CRYPTO_LOCK_RAND                18\n# define CRYPTO_LOCK_RAND2               19\n# define CRYPTO_LOCK_MALLOC              20\n# define CRYPTO_LOCK_BIO                 21\n# define CRYPTO_LOCK_GETHOSTBYNAME       22\n# define CRYPTO_LOCK_GETSERVBYNAME       23\n# define CRYPTO_LOCK_READDIR             24\n# define CRYPTO_LOCK_RSA_BLINDING        25\n# define CRYPTO_LOCK_DH                  26\n# define CRYPTO_LOCK_MALLOC2             27\n# define CRYPTO_LOCK_DSO                 28\n# define CRYPTO_LOCK_DYNLOCK             29\n# define CRYPTO_LOCK_ENGINE              30\n# define CRYPTO_LOCK_UI                  31\n# define CRYPTO_LOCK_ECDSA               32\n# define CRYPTO_LOCK_EC                  33\n# define CRYPTO_LOCK_ECDH                34\n# define CRYPTO_LOCK_BN                  35\n# define CRYPTO_LOCK_EC_PRE_COMP         36\n# define CRYPTO_LOCK_STORE               37\n# define CRYPTO_LOCK_COMP                38\n# define CRYPTO_LOCK_FIPS                39\n# define CRYPTO_LOCK_FIPS2               40\n# define CRYPTO_NUM_LOCKS                41\n\n# define CRYPTO_LOCK             1\n# define CRYPTO_UNLOCK           2\n# define CRYPTO_READ             4\n# define CRYPTO_WRITE            8\n\n# ifndef OPENSSL_NO_LOCKING\n#  ifndef CRYPTO_w_lock\n#   define CRYPTO_w_lock(type)     \\\n        CRYPTO_lock(CRYPTO_LOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)\n#   define CRYPTO_w_unlock(type)   \\\n        CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_WRITE,type,__FILE__,__LINE__)\n#   define CRYPTO_r_lock(type)     \\\n        CRYPTO_lock(CRYPTO_LOCK|CRYPTO_READ,type,__FILE__,__LINE__)\n#   define CRYPTO_r_unlock(type)   \\\n        CRYPTO_lock(CRYPTO_UNLOCK|CRYPTO_READ,type,__FILE__,__LINE__)\n#   define CRYPTO_add(addr,amount,type)    \\\n        CRYPTO_add_lock(addr,amount,type,__FILE__,__LINE__)\n#  endif\n# else\n#  define CRYPTO_w_lock(a)\n#  define CRYPTO_w_unlock(a)\n#  define CRYPTO_r_lock(a)\n#  define CRYPTO_r_unlock(a)\n#  define CRYPTO_add(a,b,c)       ((*(a))+=(b))\n# endif\n\n/*\n * Some applications as well as some parts of OpenSSL need to allocate and\n * deallocate locks in a dynamic fashion.  The following typedef makes this\n * possible in a type-safe manner.\n */\n/* struct CRYPTO_dynlock_value has to be defined by the application. */\ntypedef struct {\n    int references;\n    struct CRYPTO_dynlock_value *data;\n} CRYPTO_dynlock;\n\n/*\n * The following can be used to detect memory leaks in the SSLeay library. It\n * used, it turns on malloc checking\n */\n\n# define CRYPTO_MEM_CHECK_OFF    0x0/* an enume */\n# define CRYPTO_MEM_CHECK_ON     0x1/* a bit */\n# define CRYPTO_MEM_CHECK_ENABLE 0x2/* a bit */\n# define CRYPTO_MEM_CHECK_DISABLE 0x3/* an enume */\n\n/*\n * The following are bit values to turn on or off options connected to the\n * malloc checking functionality\n */\n\n/* Adds time to the memory checking information */\n# define V_CRYPTO_MDEBUG_TIME    0x1/* a bit */\n/* Adds thread number to the memory checking information */\n# define V_CRYPTO_MDEBUG_THREAD  0x2/* a bit */\n\n# define V_CRYPTO_MDEBUG_ALL (V_CRYPTO_MDEBUG_TIME | V_CRYPTO_MDEBUG_THREAD)\n\n/* predec of the BIO type */\ntypedef struct bio_st BIO_dummy;\n\nstruct crypto_ex_data_st {\n    STACK_OF(void) *sk;\n    /* gcc is screwing up this data structure :-( */\n    int dummy;\n};\nDECLARE_STACK_OF(void)\n\n/*\n * This stuff is basically class callback functions The current classes are\n * SSL_CTX, SSL, SSL_SESSION, and a few more\n */\n\ntypedef struct crypto_ex_data_func_st {\n    long argl;                  /* Arbitary long */\n    void *argp;                 /* Arbitary void * */\n    CRYPTO_EX_new *new_func;\n    CRYPTO_EX_free *free_func;\n    CRYPTO_EX_dup *dup_func;\n} CRYPTO_EX_DATA_FUNCS;\n\nDECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS)\n\n/*\n * Per class, we have a STACK of CRYPTO_EX_DATA_FUNCS for each CRYPTO_EX_DATA\n * entry.\n */\n\n# define CRYPTO_EX_INDEX_BIO             0\n# define CRYPTO_EX_INDEX_SSL             1\n# define CRYPTO_EX_INDEX_SSL_CTX         2\n# define CRYPTO_EX_INDEX_SSL_SESSION     3\n# define CRYPTO_EX_INDEX_X509_STORE      4\n# define CRYPTO_EX_INDEX_X509_STORE_CTX  5\n# define CRYPTO_EX_INDEX_RSA             6\n# define CRYPTO_EX_INDEX_DSA             7\n# define CRYPTO_EX_INDEX_DH              8\n# define CRYPTO_EX_INDEX_ENGINE          9\n# define CRYPTO_EX_INDEX_X509            10\n# define CRYPTO_EX_INDEX_UI              11\n# define CRYPTO_EX_INDEX_ECDSA           12\n# define CRYPTO_EX_INDEX_ECDH            13\n# define CRYPTO_EX_INDEX_COMP            14\n# define CRYPTO_EX_INDEX_STORE           15\n\n/*\n * Dynamically assigned indexes start from this value (don't use directly,\n * use via CRYPTO_ex_data_new_class).\n */\n# define CRYPTO_EX_INDEX_USER            100\n\n/*\n * This is the default callbacks, but we can have others as well: this is\n * needed in Win32 where the application malloc and the library malloc may\n * not be the same.\n */\n# define CRYPTO_malloc_init()    CRYPTO_set_mem_functions(\\\n        malloc, realloc, free)\n\n# if defined CRYPTO_MDEBUG_ALL || defined CRYPTO_MDEBUG_TIME || defined CRYPTO_MDEBUG_THREAD\n#  ifndef CRYPTO_MDEBUG         /* avoid duplicate #define */\n#   define CRYPTO_MDEBUG\n#  endif\n# endif\n\n/*\n * Set standard debugging functions (not done by default unless CRYPTO_MDEBUG\n * is defined)\n */\n# define CRYPTO_malloc_debug_init()      do {\\\n        CRYPTO_set_mem_debug_functions(\\\n                CRYPTO_dbg_malloc,\\\n                CRYPTO_dbg_realloc,\\\n                CRYPTO_dbg_free,\\\n                CRYPTO_dbg_set_options,\\\n                CRYPTO_dbg_get_options);\\\n        } while(0)\n\nint CRYPTO_mem_ctrl(int mode);\nint CRYPTO_is_mem_check_on(void);\n\n/* for applications */\n# define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON)\n# define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF)\n\n/* for library-internal use */\n# define MemCheck_on()   CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE)\n# define MemCheck_off()  CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE)\n# define is_MemCheck_on() CRYPTO_is_mem_check_on()\n\n# define OPENSSL_malloc(num)     CRYPTO_malloc((int)num,__FILE__,__LINE__)\n# define OPENSSL_strdup(str)     CRYPTO_strdup((str),__FILE__,__LINE__)\n# define OPENSSL_realloc(addr,num) \\\n        CRYPTO_realloc((char *)addr,(int)num,__FILE__,__LINE__)\n# define OPENSSL_realloc_clean(addr,old_num,num) \\\n        CRYPTO_realloc_clean(addr,old_num,num,__FILE__,__LINE__)\n# define OPENSSL_remalloc(addr,num) \\\n        CRYPTO_remalloc((char **)addr,(int)num,__FILE__,__LINE__)\n# define OPENSSL_freeFunc        CRYPTO_free\n# define OPENSSL_free(addr)      CRYPTO_free(addr)\n\n# define OPENSSL_malloc_locked(num) \\\n        CRYPTO_malloc_locked((int)num,__FILE__,__LINE__)\n# define OPENSSL_free_locked(addr) CRYPTO_free_locked(addr)\n\nconst char *SSLeay_version(int type);\nunsigned long SSLeay(void);\n\nint OPENSSL_issetugid(void);\n\n/* An opaque type representing an implementation of \"ex_data\" support */\ntypedef struct st_CRYPTO_EX_DATA_IMPL CRYPTO_EX_DATA_IMPL;\n/* Return an opaque pointer to the current \"ex_data\" implementation */\nconst CRYPTO_EX_DATA_IMPL *CRYPTO_get_ex_data_implementation(void);\n/* Sets the \"ex_data\" implementation to be used (if it's not too late) */\nint CRYPTO_set_ex_data_implementation(const CRYPTO_EX_DATA_IMPL *i);\n/* Get a new \"ex_data\" class, and return the corresponding \"class_index\" */\nint CRYPTO_ex_data_new_class(void);\n/* Within a given class, get/register a new index */\nint CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,\n                            CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,\n                            CRYPTO_EX_free *free_func);\n/*\n * Initialise/duplicate/free CRYPTO_EX_DATA variables corresponding to a\n * given class (invokes whatever per-class callbacks are applicable)\n */\nint CRYPTO_new_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);\nint CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,\n                       CRYPTO_EX_DATA *from);\nvoid CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);\n/*\n * Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular\n * index (relative to the class type involved)\n */\nint CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val);\nvoid *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx);\n/*\n * This function cleans up all \"ex_data\" state. It mustn't be called under\n * potential race-conditions.\n */\nvoid CRYPTO_cleanup_all_ex_data(void);\n\nint CRYPTO_get_new_lockid(char *name);\n\nint CRYPTO_num_locks(void);     /* return CRYPTO_NUM_LOCKS (shared libs!) */\nvoid CRYPTO_lock(int mode, int type, const char *file, int line);\nvoid CRYPTO_set_locking_callback(void (*func) (int mode, int type,\n                                               const char *file, int line));\nvoid (*CRYPTO_get_locking_callback(void)) (int mode, int type,\n                                           const char *file, int line);\nvoid CRYPTO_set_add_lock_callback(int (*func)\n                                   (int *num, int mount, int type,\n                                    const char *file, int line));\nint (*CRYPTO_get_add_lock_callback(void)) (int *num, int mount, int type,\n                                           const char *file, int line);\n\n/* Don't use this structure directly. */\ntypedef struct crypto_threadid_st {\n    void *ptr;\n    unsigned long val;\n} CRYPTO_THREADID;\n/* Only use CRYPTO_THREADID_set_[numeric|pointer]() within callbacks */\nvoid CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val);\nvoid CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr);\nint CRYPTO_THREADID_set_callback(void (*threadid_func) (CRYPTO_THREADID *));\nvoid (*CRYPTO_THREADID_get_callback(void)) (CRYPTO_THREADID *);\nvoid CRYPTO_THREADID_current(CRYPTO_THREADID *id);\nint CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID *b);\nvoid CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const CRYPTO_THREADID *src);\nunsigned long CRYPTO_THREADID_hash(const CRYPTO_THREADID *id);\n# ifndef OPENSSL_NO_DEPRECATED\nvoid CRYPTO_set_id_callback(unsigned long (*func) (void));\nunsigned long (*CRYPTO_get_id_callback(void)) (void);\nunsigned long CRYPTO_thread_id(void);\n# endif\n\nconst char *CRYPTO_get_lock_name(int type);\nint CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,\n                    int line);\n\nint CRYPTO_get_new_dynlockid(void);\nvoid CRYPTO_destroy_dynlockid(int i);\nstruct CRYPTO_dynlock_value *CRYPTO_get_dynlock_value(int i);\nvoid CRYPTO_set_dynlock_create_callback(struct CRYPTO_dynlock_value\n                                        *(*dyn_create_function) (const char\n                                                                 *file,\n                                                                 int line));\nvoid CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)\n                                       (int mode,\n                                        struct CRYPTO_dynlock_value *l,\n                                        const char *file, int line));\nvoid CRYPTO_set_dynlock_destroy_callback(void (*dyn_destroy_function)\n                                          (struct CRYPTO_dynlock_value *l,\n                                           const char *file, int line));\nstruct CRYPTO_dynlock_value\n*(*CRYPTO_get_dynlock_create_callback(void)) (const char *file, int line);\nvoid (*CRYPTO_get_dynlock_lock_callback(void)) (int mode,\n                                                struct CRYPTO_dynlock_value\n                                                *l, const char *file,\n                                                int line);\nvoid (*CRYPTO_get_dynlock_destroy_callback(void)) (struct CRYPTO_dynlock_value\n                                                   *l, const char *file,\n                                                   int line);\n\n/*\n * CRYPTO_set_mem_functions includes CRYPTO_set_locked_mem_functions -- call\n * the latter last if you need different functions\n */\nint CRYPTO_set_mem_functions(void *(*m) (size_t), void *(*r) (void *, size_t),\n                             void (*f) (void *));\nint CRYPTO_set_locked_mem_functions(void *(*m) (size_t),\n                                    void (*free_func) (void *));\nint CRYPTO_set_mem_ex_functions(void *(*m) (size_t, const char *, int),\n                                void *(*r) (void *, size_t, const char *,\n                                            int), void (*f) (void *));\nint CRYPTO_set_locked_mem_ex_functions(void *(*m) (size_t, const char *, int),\n                                       void (*free_func) (void *));\nint CRYPTO_set_mem_debug_functions(void (*m)\n                                    (void *, int, const char *, int, int),\n                                   void (*r) (void *, void *, int,\n                                              const char *, int, int),\n                                   void (*f) (void *, int), void (*so) (long),\n                                   long (*go) (void));\nvoid CRYPTO_get_mem_functions(void *(**m) (size_t),\n                              void *(**r) (void *, size_t),\n                              void (**f) (void *));\nvoid CRYPTO_get_locked_mem_functions(void *(**m) (size_t),\n                                     void (**f) (void *));\nvoid CRYPTO_get_mem_ex_functions(void *(**m) (size_t, const char *, int),\n                                 void *(**r) (void *, size_t, const char *,\n                                              int), void (**f) (void *));\nvoid CRYPTO_get_locked_mem_ex_functions(void\n                                        *(**m) (size_t, const char *, int),\n                                        void (**f) (void *));\nvoid CRYPTO_get_mem_debug_functions(void (**m)\n                                     (void *, int, const char *, int, int),\n                                    void (**r) (void *, void *, int,\n                                                const char *, int, int),\n                                    void (**f) (void *, int),\n                                    void (**so) (long), long (**go) (void));\n\nvoid *CRYPTO_malloc_locked(int num, const char *file, int line);\nvoid CRYPTO_free_locked(void *ptr);\nvoid *CRYPTO_malloc(int num, const char *file, int line);\nchar *CRYPTO_strdup(const char *str, const char *file, int line);\nvoid CRYPTO_free(void *ptr);\nvoid *CRYPTO_realloc(void *addr, int num, const char *file, int line);\nvoid *CRYPTO_realloc_clean(void *addr, int old_num, int num, const char *file,\n                           int line);\nvoid *CRYPTO_remalloc(void *addr, int num, const char *file, int line);\n\nvoid OPENSSL_cleanse(void *ptr, size_t len);\n\nvoid CRYPTO_set_mem_debug_options(long bits);\nlong CRYPTO_get_mem_debug_options(void);\n\n# define CRYPTO_push_info(info) \\\n        CRYPTO_push_info_(info, __FILE__, __LINE__);\nint CRYPTO_push_info_(const char *info, const char *file, int line);\nint CRYPTO_pop_info(void);\nint CRYPTO_remove_all_info(void);\n\n/*\n * Default debugging functions (enabled by CRYPTO_malloc_debug_init() macro;\n * used as default in CRYPTO_MDEBUG compilations):\n */\n/*-\n * The last argument has the following significance:\n *\n * 0:   called before the actual memory allocation has taken place\n * 1:   called after the actual memory allocation has taken place\n */\nvoid CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line,\n                       int before_p);\nvoid CRYPTO_dbg_realloc(void *addr1, void *addr2, int num, const char *file,\n                        int line, int before_p);\nvoid CRYPTO_dbg_free(void *addr, int before_p);\n/*-\n * Tell the debugging code about options.  By default, the following values\n * apply:\n *\n * 0:                           Clear all options.\n * V_CRYPTO_MDEBUG_TIME (1):    Set the \"Show Time\" option.\n * V_CRYPTO_MDEBUG_THREAD (2):  Set the \"Show Thread Number\" option.\n * V_CRYPTO_MDEBUG_ALL (3):     1 + 2\n */\nvoid CRYPTO_dbg_set_options(long bits);\nlong CRYPTO_dbg_get_options(void);\n\n# ifndef OPENSSL_NO_FP_API\nvoid CRYPTO_mem_leaks_fp(FILE *);\n# endif\nvoid CRYPTO_mem_leaks(struct bio_st *bio);\n/* unsigned long order, char *file, int line, int num_bytes, char *addr */\ntypedef void *CRYPTO_MEM_LEAK_CB (unsigned long, const char *, int, int,\n                                  void *);\nvoid CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb);\n\n/* die if we have to */\nvoid OpenSSLDie(const char *file, int line, const char *assertion);\n# define OPENSSL_assert(e)       (void)((e) ? 0 : (OpenSSLDie(__FILE__, __LINE__, #e),1))\n\nunsigned long *OPENSSL_ia32cap_loc(void);\n# define OPENSSL_ia32cap (*(OPENSSL_ia32cap_loc()))\nint OPENSSL_isservice(void);\n\nint FIPS_mode(void);\nint FIPS_mode_set(int r);\n\nvoid OPENSSL_init(void);\n\n# define fips_md_init(alg) fips_md_init_ctx(alg, alg)\n\n# ifdef OPENSSL_FIPS\n#  define fips_md_init_ctx(alg, cx) \\\n        int alg##_Init(cx##_CTX *c) \\\n        { \\\n        if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \\\n                \"Low level API call to digest \" #alg \" forbidden in FIPS mode!\"); \\\n        return private_##alg##_Init(c); \\\n        } \\\n        int private_##alg##_Init(cx##_CTX *c)\n\n#  define fips_cipher_abort(alg) \\\n        if (FIPS_mode()) OpenSSLDie(__FILE__, __LINE__, \\\n                \"Low level API call to cipher \" #alg \" forbidden in FIPS mode!\")\n\n# else\n#  define fips_md_init_ctx(alg, cx) \\\n        int alg##_Init(cx##_CTX *c)\n#  define fips_cipher_abort(alg) while(0)\n# endif\n\n/*\n * CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal.\n * It takes an amount of time dependent on |len|, but independent of the\n * contents of |a| and |b|. Unlike memcmp, it cannot be used to put elements\n * into a defined order as the return value when a != b is undefined, other\n * than to be non-zero.\n */\nint CRYPTO_memcmp(const volatile void *a, const volatile void *b, size_t len);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_CRYPTO_strings(void);\n\n/* Error codes for the CRYPTO functions. */\n\n/* Function codes. */\n# define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX                 100\n# define CRYPTO_F_CRYPTO_GET_NEW_DYNLOCKID                103\n# define CRYPTO_F_CRYPTO_GET_NEW_LOCKID                   101\n# define CRYPTO_F_CRYPTO_SET_EX_DATA                      102\n# define CRYPTO_F_DEF_ADD_INDEX                           104\n# define CRYPTO_F_DEF_GET_CLASS                           105\n# define CRYPTO_F_FIPS_MODE_SET                           109\n# define CRYPTO_F_INT_DUP_EX_DATA                         106\n# define CRYPTO_F_INT_FREE_EX_DATA                        107\n# define CRYPTO_F_INT_NEW_EX_DATA                         108\n\n/* Reason codes. */\n# define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED                 101\n# define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK              100\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/des.h",
    "content": "/* crypto/des/des.h */\n/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_NEW_DES_H\n# define HEADER_NEW_DES_H\n\n# include <openssl/e_os2.h>     /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG\n                                 * (via openssl/opensslconf.h */\n\n# ifdef OPENSSL_NO_DES\n#  error DES is disabled.\n# endif\n\n# ifdef OPENSSL_BUILD_SHLIBCRYPTO\n#  undef OPENSSL_EXTERN\n#  define OPENSSL_EXTERN OPENSSL_EXPORT\n# endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef unsigned char DES_cblock[8];\ntypedef /* const */ unsigned char const_DES_cblock[8];\n/*\n * With \"const\", gcc 2.8.1 on Solaris thinks that DES_cblock * and\n * const_DES_cblock * are incompatible pointer types.\n */\n\ntypedef struct DES_ks {\n    union {\n        DES_cblock cblock;\n        /*\n         * make sure things are correct size on machines with 8 byte longs\n         */\n        DES_LONG deslong[2];\n    } ks[16];\n} DES_key_schedule;\n\n# ifndef OPENSSL_DISABLE_OLD_DES_SUPPORT\n#  ifndef OPENSSL_ENABLE_OLD_DES_SUPPORT\n#   define OPENSSL_ENABLE_OLD_DES_SUPPORT\n#  endif\n# endif\n\n# ifdef OPENSSL_ENABLE_OLD_DES_SUPPORT\n#  include <openssl/des_old.h>\n# endif\n\n# define DES_KEY_SZ      (sizeof(DES_cblock))\n# define DES_SCHEDULE_SZ (sizeof(DES_key_schedule))\n\n# define DES_ENCRYPT     1\n# define DES_DECRYPT     0\n\n# define DES_CBC_MODE    0\n# define DES_PCBC_MODE   1\n\n# define DES_ecb2_encrypt(i,o,k1,k2,e) \\\n        DES_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))\n\n# define DES_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \\\n        DES_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))\n\n# define DES_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \\\n        DES_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))\n\n# define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \\\n        DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))\n\nOPENSSL_DECLARE_GLOBAL(int, DES_check_key); /* defaults to false */\n# define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key)\nOPENSSL_DECLARE_GLOBAL(int, DES_rw_mode); /* defaults to DES_PCBC_MODE */\n# define DES_rw_mode OPENSSL_GLOBAL_REF(DES_rw_mode)\n\nconst char *DES_options(void);\nvoid DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,\n                      DES_key_schedule *ks1, DES_key_schedule *ks2,\n                      DES_key_schedule *ks3, int enc);\nDES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output,\n                       long length, DES_key_schedule *schedule,\n                       const_DES_cblock *ivec);\n/* DES_cbc_encrypt does not update the IV!  Use DES_ncbc_encrypt instead. */\nvoid DES_cbc_encrypt(const unsigned char *input, unsigned char *output,\n                     long length, DES_key_schedule *schedule,\n                     DES_cblock *ivec, int enc);\nvoid DES_ncbc_encrypt(const unsigned char *input, unsigned char *output,\n                      long length, DES_key_schedule *schedule,\n                      DES_cblock *ivec, int enc);\nvoid DES_xcbc_encrypt(const unsigned char *input, unsigned char *output,\n                      long length, DES_key_schedule *schedule,\n                      DES_cblock *ivec, const_DES_cblock *inw,\n                      const_DES_cblock *outw, int enc);\nvoid DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits,\n                     long length, DES_key_schedule *schedule,\n                     DES_cblock *ivec, int enc);\nvoid DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output,\n                     DES_key_schedule *ks, int enc);\n\n/*\n * This is the DES encryption function that gets called by just about every\n * other DES routine in the library.  You should not use this function except\n * to implement 'modes' of DES.  I say this because the functions that call\n * this routine do the conversion from 'char *' to long, and this needs to be\n * done to make sure 'non-aligned' memory access do not occur.  The\n * characters are loaded 'little endian'. Data is a pointer to 2 unsigned\n * long's and ks is the DES_key_schedule to use.  enc, is non zero specifies\n * encryption, zero if decryption.\n */\nvoid DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc);\n\n/*\n * This functions is the same as DES_encrypt1() except that the DES initial\n * permutation (IP) and final permutation (FP) have been left out.  As for\n * DES_encrypt1(), you should not use this function. It is used by the\n * routines in the library that implement triple DES. IP() DES_encrypt2()\n * DES_encrypt2() DES_encrypt2() FP() is the same as DES_encrypt1()\n * DES_encrypt1() DES_encrypt1() except faster :-).\n */\nvoid DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc);\n\nvoid DES_encrypt3(DES_LONG *data, DES_key_schedule *ks1,\n                  DES_key_schedule *ks2, DES_key_schedule *ks3);\nvoid DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,\n                  DES_key_schedule *ks2, DES_key_schedule *ks3);\nvoid DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,\n                          long length,\n                          DES_key_schedule *ks1, DES_key_schedule *ks2,\n                          DES_key_schedule *ks3, DES_cblock *ivec, int enc);\nvoid DES_ede3_cbcm_encrypt(const unsigned char *in, unsigned char *out,\n                           long length,\n                           DES_key_schedule *ks1, DES_key_schedule *ks2,\n                           DES_key_schedule *ks3,\n                           DES_cblock *ivec1, DES_cblock *ivec2, int enc);\nvoid DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out,\n                            long length, DES_key_schedule *ks1,\n                            DES_key_schedule *ks2, DES_key_schedule *ks3,\n                            DES_cblock *ivec, int *num, int enc);\nvoid DES_ede3_cfb_encrypt(const unsigned char *in, unsigned char *out,\n                          int numbits, long length, DES_key_schedule *ks1,\n                          DES_key_schedule *ks2, DES_key_schedule *ks3,\n                          DES_cblock *ivec, int enc);\nvoid DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out,\n                            long length, DES_key_schedule *ks1,\n                            DES_key_schedule *ks2, DES_key_schedule *ks3,\n                            DES_cblock *ivec, int *num);\n# if 0\nvoid DES_xwhite_in2out(const_DES_cblock *DES_key, const_DES_cblock *in_white,\n                       DES_cblock *out_white);\n# endif\n\nint DES_enc_read(int fd, void *buf, int len, DES_key_schedule *sched,\n                 DES_cblock *iv);\nint DES_enc_write(int fd, const void *buf, int len, DES_key_schedule *sched,\n                  DES_cblock *iv);\nchar *DES_fcrypt(const char *buf, const char *salt, char *ret);\nchar *DES_crypt(const char *buf, const char *salt);\nvoid DES_ofb_encrypt(const unsigned char *in, unsigned char *out, int numbits,\n                     long length, DES_key_schedule *schedule,\n                     DES_cblock *ivec);\nvoid DES_pcbc_encrypt(const unsigned char *input, unsigned char *output,\n                      long length, DES_key_schedule *schedule,\n                      DES_cblock *ivec, int enc);\nDES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[],\n                        long length, int out_count, DES_cblock *seed);\nint DES_random_key(DES_cblock *ret);\nvoid DES_set_odd_parity(DES_cblock *key);\nint DES_check_key_parity(const_DES_cblock *key);\nint DES_is_weak_key(const_DES_cblock *key);\n/*\n * DES_set_key (= set_key = DES_key_sched = key_sched) calls\n * DES_set_key_checked if global variable DES_check_key is set,\n * DES_set_key_unchecked otherwise.\n */\nint DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule);\nint DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule);\nint DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule);\nvoid DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule);\n# ifdef OPENSSL_FIPS\nvoid private_DES_set_key_unchecked(const_DES_cblock *key,\n                                   DES_key_schedule *schedule);\n# endif\nvoid DES_string_to_key(const char *str, DES_cblock *key);\nvoid DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2);\nvoid DES_cfb64_encrypt(const unsigned char *in, unsigned char *out,\n                       long length, DES_key_schedule *schedule,\n                       DES_cblock *ivec, int *num, int enc);\nvoid DES_ofb64_encrypt(const unsigned char *in, unsigned char *out,\n                       long length, DES_key_schedule *schedule,\n                       DES_cblock *ivec, int *num);\n\nint DES_read_password(DES_cblock *key, const char *prompt, int verify);\nint DES_read_2passwords(DES_cblock *key1, DES_cblock *key2,\n                        const char *prompt, int verify);\n\n# define DES_fixup_key_parity DES_set_odd_parity\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/des_old.h",
    "content": "/* crypto/des/des_old.h */\n\n/*-\n * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING\n *\n * The function names in here are deprecated and are only present to\n * provide an interface compatible with openssl 0.9.6 and older as\n * well as libdes.  OpenSSL now provides functions where \"des_\" has\n * been replaced with \"DES_\" in the names, to make it possible to\n * make incompatible changes that are needed for C type security and\n * other stuff.\n *\n * This include files has two compatibility modes:\n *\n *   - If OPENSSL_DES_LIBDES_COMPATIBILITY is defined, you get an API\n *     that is compatible with libdes and SSLeay.\n *   - If OPENSSL_DES_LIBDES_COMPATIBILITY isn't defined, you get an\n *     API that is compatible with OpenSSL 0.9.5x to 0.9.6x.\n *\n * Note that these modes break earlier snapshots of OpenSSL, where\n * libdes compatibility was the only available mode or (later on) the\n * prefered compatibility mode.  However, after much consideration\n * (and more or less violent discussions with external parties), it\n * was concluded that OpenSSL should be compatible with earlier versions\n * of itself before anything else.  Also, in all honesty, libdes is\n * an old beast that shouldn't really be used any more.\n *\n * Please consider starting to use the DES_ functions rather than the\n * des_ ones.  The des_ functions will disappear completely before\n * OpenSSL 1.0!\n *\n * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING\n */\n\n/*\n * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project\n * 2001.\n */\n/* ====================================================================\n * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_DES_H\n# define HEADER_DES_H\n\n# include <openssl/e_os2.h>     /* OPENSSL_EXTERN, OPENSSL_NO_DES, DES_LONG */\n\n# ifdef OPENSSL_NO_DES\n#  error DES is disabled.\n# endif\n\n# ifndef HEADER_NEW_DES_H\n#  error You must include des.h, not des_old.h directly.\n# endif\n\n# ifdef _KERBEROS_DES_H\n#  error <openssl/des_old.h> replaces <kerberos/des.h>.\n# endif\n\n# include <openssl/symhacks.h>\n\n# ifdef OPENSSL_BUILD_SHLIBCRYPTO\n#  undef OPENSSL_EXTERN\n#  define OPENSSL_EXTERN OPENSSL_EXPORT\n# endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# ifdef _\n#  undef _\n# endif\n\ntypedef unsigned char _ossl_old_des_cblock[8];\ntypedef struct _ossl_old_des_ks_struct {\n    union {\n        _ossl_old_des_cblock _;\n        /*\n         * make sure things are correct size on machines with 8 byte longs\n         */\n        DES_LONG pad[2];\n    } ks;\n} _ossl_old_des_key_schedule[16];\n\n# ifndef OPENSSL_DES_LIBDES_COMPATIBILITY\n#  define des_cblock DES_cblock\n#  define const_des_cblock const_DES_cblock\n#  define des_key_schedule DES_key_schedule\n#  define des_ecb3_encrypt(i,o,k1,k2,k3,e)\\\n        DES_ecb3_encrypt((i),(o),&(k1),&(k2),&(k3),(e))\n#  define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\\\n        DES_ede3_cbc_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(e))\n#  define des_ede3_cbcm_encrypt(i,o,l,k1,k2,k3,iv1,iv2,e)\\\n        DES_ede3_cbcm_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv1),(iv2),(e))\n#  define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\\\n        DES_ede3_cfb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n),(e))\n#  define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\\\n        DES_ede3_ofb64_encrypt((i),(o),(l),&(k1),&(k2),&(k3),(iv),(n))\n#  define des_options()\\\n        DES_options()\n#  define des_cbc_cksum(i,o,l,k,iv)\\\n        DES_cbc_cksum((i),(o),(l),&(k),(iv))\n#  define des_cbc_encrypt(i,o,l,k,iv,e)\\\n        DES_cbc_encrypt((i),(o),(l),&(k),(iv),(e))\n#  define des_ncbc_encrypt(i,o,l,k,iv,e)\\\n        DES_ncbc_encrypt((i),(o),(l),&(k),(iv),(e))\n#  define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\\\n        DES_xcbc_encrypt((i),(o),(l),&(k),(iv),(inw),(outw),(e))\n#  define des_cfb_encrypt(i,o,n,l,k,iv,e)\\\n        DES_cfb_encrypt((i),(o),(n),(l),&(k),(iv),(e))\n#  define des_ecb_encrypt(i,o,k,e)\\\n        DES_ecb_encrypt((i),(o),&(k),(e))\n#  define des_encrypt1(d,k,e)\\\n        DES_encrypt1((d),&(k),(e))\n#  define des_encrypt2(d,k,e)\\\n        DES_encrypt2((d),&(k),(e))\n#  define des_encrypt3(d,k1,k2,k3)\\\n        DES_encrypt3((d),&(k1),&(k2),&(k3))\n#  define des_decrypt3(d,k1,k2,k3)\\\n        DES_decrypt3((d),&(k1),&(k2),&(k3))\n#  define des_xwhite_in2out(k,i,o)\\\n        DES_xwhite_in2out((k),(i),(o))\n#  define des_enc_read(f,b,l,k,iv)\\\n        DES_enc_read((f),(b),(l),&(k),(iv))\n#  define des_enc_write(f,b,l,k,iv)\\\n        DES_enc_write((f),(b),(l),&(k),(iv))\n#  define des_fcrypt(b,s,r)\\\n        DES_fcrypt((b),(s),(r))\n#  if 0\n#   define des_crypt(b,s)\\\n        DES_crypt((b),(s))\n#   if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(__OpenBSD__)\n#    define crypt(b,s)\\\n        DES_crypt((b),(s))\n#   endif\n#  endif\n#  define des_ofb_encrypt(i,o,n,l,k,iv)\\\n        DES_ofb_encrypt((i),(o),(n),(l),&(k),(iv))\n#  define des_pcbc_encrypt(i,o,l,k,iv,e)\\\n        DES_pcbc_encrypt((i),(o),(l),&(k),(iv),(e))\n#  define des_quad_cksum(i,o,l,c,s)\\\n        DES_quad_cksum((i),(o),(l),(c),(s))\n#  define des_random_seed(k)\\\n        _ossl_096_des_random_seed((k))\n#  define des_random_key(r)\\\n        DES_random_key((r))\n#  define des_read_password(k,p,v) \\\n        DES_read_password((k),(p),(v))\n#  define des_read_2passwords(k1,k2,p,v) \\\n        DES_read_2passwords((k1),(k2),(p),(v))\n#  define des_set_odd_parity(k)\\\n        DES_set_odd_parity((k))\n#  define des_check_key_parity(k)\\\n        DES_check_key_parity((k))\n#  define des_is_weak_key(k)\\\n        DES_is_weak_key((k))\n#  define des_set_key(k,ks)\\\n        DES_set_key((k),&(ks))\n#  define des_key_sched(k,ks)\\\n        DES_key_sched((k),&(ks))\n#  define des_set_key_checked(k,ks)\\\n        DES_set_key_checked((k),&(ks))\n#  define des_set_key_unchecked(k,ks)\\\n        DES_set_key_unchecked((k),&(ks))\n#  define des_string_to_key(s,k)\\\n        DES_string_to_key((s),(k))\n#  define des_string_to_2keys(s,k1,k2)\\\n        DES_string_to_2keys((s),(k1),(k2))\n#  define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\\\n        DES_cfb64_encrypt((i),(o),(l),&(ks),(iv),(n),(e))\n#  define des_ofb64_encrypt(i,o,l,ks,iv,n)\\\n        DES_ofb64_encrypt((i),(o),(l),&(ks),(iv),(n))\n\n#  define des_ecb2_encrypt(i,o,k1,k2,e) \\\n        des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))\n\n#  define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \\\n        des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))\n\n#  define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \\\n        des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))\n\n#  define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \\\n        des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))\n\n#  define des_check_key DES_check_key\n#  define des_rw_mode DES_rw_mode\n# else                          /* libdes compatibility */\n/*\n * Map all symbol names to _ossl_old_des_* form, so we avoid all clashes with\n * libdes\n */\n#  define des_cblock _ossl_old_des_cblock\n#  define des_key_schedule _ossl_old_des_key_schedule\n#  define des_ecb3_encrypt(i,o,k1,k2,k3,e)\\\n        _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e))\n#  define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\\\n        _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e))\n#  define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\\\n        _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n),(e))\n#  define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\\\n        _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n))\n#  define des_options()\\\n        _ossl_old_des_options()\n#  define des_cbc_cksum(i,o,l,k,iv)\\\n        _ossl_old_des_cbc_cksum((i),(o),(l),(k),(iv))\n#  define des_cbc_encrypt(i,o,l,k,iv,e)\\\n        _ossl_old_des_cbc_encrypt((i),(o),(l),(k),(iv),(e))\n#  define des_ncbc_encrypt(i,o,l,k,iv,e)\\\n        _ossl_old_des_ncbc_encrypt((i),(o),(l),(k),(iv),(e))\n#  define des_xcbc_encrypt(i,o,l,k,iv,inw,outw,e)\\\n        _ossl_old_des_xcbc_encrypt((i),(o),(l),(k),(iv),(inw),(outw),(e))\n#  define des_cfb_encrypt(i,o,n,l,k,iv,e)\\\n        _ossl_old_des_cfb_encrypt((i),(o),(n),(l),(k),(iv),(e))\n#  define des_ecb_encrypt(i,o,k,e)\\\n        _ossl_old_des_ecb_encrypt((i),(o),(k),(e))\n#  define des_encrypt(d,k,e)\\\n        _ossl_old_des_encrypt((d),(k),(e))\n#  define des_encrypt2(d,k,e)\\\n        _ossl_old_des_encrypt2((d),(k),(e))\n#  define des_encrypt3(d,k1,k2,k3)\\\n        _ossl_old_des_encrypt3((d),(k1),(k2),(k3))\n#  define des_decrypt3(d,k1,k2,k3)\\\n        _ossl_old_des_decrypt3((d),(k1),(k2),(k3))\n#  define des_xwhite_in2out(k,i,o)\\\n        _ossl_old_des_xwhite_in2out((k),(i),(o))\n#  define des_enc_read(f,b,l,k,iv)\\\n        _ossl_old_des_enc_read((f),(b),(l),(k),(iv))\n#  define des_enc_write(f,b,l,k,iv)\\\n        _ossl_old_des_enc_write((f),(b),(l),(k),(iv))\n#  define des_fcrypt(b,s,r)\\\n        _ossl_old_des_fcrypt((b),(s),(r))\n#  define des_crypt(b,s)\\\n        _ossl_old_des_crypt((b),(s))\n#  if 0\n#   define crypt(b,s)\\\n        _ossl_old_crypt((b),(s))\n#  endif\n#  define des_ofb_encrypt(i,o,n,l,k,iv)\\\n        _ossl_old_des_ofb_encrypt((i),(o),(n),(l),(k),(iv))\n#  define des_pcbc_encrypt(i,o,l,k,iv,e)\\\n        _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e))\n#  define des_quad_cksum(i,o,l,c,s)\\\n        _ossl_old_des_quad_cksum((i),(o),(l),(c),(s))\n#  define des_random_seed(k)\\\n        _ossl_old_des_random_seed((k))\n#  define des_random_key(r)\\\n        _ossl_old_des_random_key((r))\n#  define des_read_password(k,p,v) \\\n        _ossl_old_des_read_password((k),(p),(v))\n#  define des_read_2passwords(k1,k2,p,v) \\\n        _ossl_old_des_read_2passwords((k1),(k2),(p),(v))\n#  define des_set_odd_parity(k)\\\n        _ossl_old_des_set_odd_parity((k))\n#  define des_is_weak_key(k)\\\n        _ossl_old_des_is_weak_key((k))\n#  define des_set_key(k,ks)\\\n        _ossl_old_des_set_key((k),(ks))\n#  define des_key_sched(k,ks)\\\n        _ossl_old_des_key_sched((k),(ks))\n#  define des_string_to_key(s,k)\\\n        _ossl_old_des_string_to_key((s),(k))\n#  define des_string_to_2keys(s,k1,k2)\\\n        _ossl_old_des_string_to_2keys((s),(k1),(k2))\n#  define des_cfb64_encrypt(i,o,l,ks,iv,n,e)\\\n        _ossl_old_des_cfb64_encrypt((i),(o),(l),(ks),(iv),(n),(e))\n#  define des_ofb64_encrypt(i,o,l,ks,iv,n)\\\n        _ossl_old_des_ofb64_encrypt((i),(o),(l),(ks),(iv),(n))\n\n#  define des_ecb2_encrypt(i,o,k1,k2,e) \\\n        des_ecb3_encrypt((i),(o),(k1),(k2),(k1),(e))\n\n#  define des_ede2_cbc_encrypt(i,o,l,k1,k2,iv,e) \\\n        des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(e))\n\n#  define des_ede2_cfb64_encrypt(i,o,l,k1,k2,iv,n,e) \\\n        des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n),(e))\n\n#  define des_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \\\n        des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n))\n\n#  define des_check_key DES_check_key\n#  define des_rw_mode DES_rw_mode\n# endif\n\nconst char *_ossl_old_des_options(void);\nvoid _ossl_old_des_ecb3_encrypt(_ossl_old_des_cblock *input,\n                                _ossl_old_des_cblock *output,\n                                _ossl_old_des_key_schedule ks1,\n                                _ossl_old_des_key_schedule ks2,\n                                _ossl_old_des_key_schedule ks3, int enc);\nDES_LONG _ossl_old_des_cbc_cksum(_ossl_old_des_cblock *input,\n                                 _ossl_old_des_cblock *output, long length,\n                                 _ossl_old_des_key_schedule schedule,\n                                 _ossl_old_des_cblock *ivec);\nvoid _ossl_old_des_cbc_encrypt(_ossl_old_des_cblock *input,\n                               _ossl_old_des_cblock *output, long length,\n                               _ossl_old_des_key_schedule schedule,\n                               _ossl_old_des_cblock *ivec, int enc);\nvoid _ossl_old_des_ncbc_encrypt(_ossl_old_des_cblock *input,\n                                _ossl_old_des_cblock *output, long length,\n                                _ossl_old_des_key_schedule schedule,\n                                _ossl_old_des_cblock *ivec, int enc);\nvoid _ossl_old_des_xcbc_encrypt(_ossl_old_des_cblock *input,\n                                _ossl_old_des_cblock *output, long length,\n                                _ossl_old_des_key_schedule schedule,\n                                _ossl_old_des_cblock *ivec,\n                                _ossl_old_des_cblock *inw,\n                                _ossl_old_des_cblock *outw, int enc);\nvoid _ossl_old_des_cfb_encrypt(unsigned char *in, unsigned char *out,\n                               int numbits, long length,\n                               _ossl_old_des_key_schedule schedule,\n                               _ossl_old_des_cblock *ivec, int enc);\nvoid _ossl_old_des_ecb_encrypt(_ossl_old_des_cblock *input,\n                               _ossl_old_des_cblock *output,\n                               _ossl_old_des_key_schedule ks, int enc);\nvoid _ossl_old_des_encrypt(DES_LONG *data, _ossl_old_des_key_schedule ks,\n                           int enc);\nvoid _ossl_old_des_encrypt2(DES_LONG *data, _ossl_old_des_key_schedule ks,\n                            int enc);\nvoid _ossl_old_des_encrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,\n                            _ossl_old_des_key_schedule ks2,\n                            _ossl_old_des_key_schedule ks3);\nvoid _ossl_old_des_decrypt3(DES_LONG *data, _ossl_old_des_key_schedule ks1,\n                            _ossl_old_des_key_schedule ks2,\n                            _ossl_old_des_key_schedule ks3);\nvoid _ossl_old_des_ede3_cbc_encrypt(_ossl_old_des_cblock *input,\n                                    _ossl_old_des_cblock *output, long length,\n                                    _ossl_old_des_key_schedule ks1,\n                                    _ossl_old_des_key_schedule ks2,\n                                    _ossl_old_des_key_schedule ks3,\n                                    _ossl_old_des_cblock *ivec, int enc);\nvoid _ossl_old_des_ede3_cfb64_encrypt(unsigned char *in, unsigned char *out,\n                                      long length,\n                                      _ossl_old_des_key_schedule ks1,\n                                      _ossl_old_des_key_schedule ks2,\n                                      _ossl_old_des_key_schedule ks3,\n                                      _ossl_old_des_cblock *ivec, int *num,\n                                      int enc);\nvoid _ossl_old_des_ede3_ofb64_encrypt(unsigned char *in, unsigned char *out,\n                                      long length,\n                                      _ossl_old_des_key_schedule ks1,\n                                      _ossl_old_des_key_schedule ks2,\n                                      _ossl_old_des_key_schedule ks3,\n                                      _ossl_old_des_cblock *ivec, int *num);\n# if 0\nvoid _ossl_old_des_xwhite_in2out(_ossl_old_des_cblock (*des_key),\n                                 _ossl_old_des_cblock (*in_white),\n                                 _ossl_old_des_cblock (*out_white));\n# endif\n\nint _ossl_old_des_enc_read(int fd, char *buf, int len,\n                           _ossl_old_des_key_schedule sched,\n                           _ossl_old_des_cblock *iv);\nint _ossl_old_des_enc_write(int fd, char *buf, int len,\n                            _ossl_old_des_key_schedule sched,\n                            _ossl_old_des_cblock *iv);\nchar *_ossl_old_des_fcrypt(const char *buf, const char *salt, char *ret);\nchar *_ossl_old_des_crypt(const char *buf, const char *salt);\n# if !defined(PERL5) && !defined(NeXT)\nchar *_ossl_old_crypt(const char *buf, const char *salt);\n# endif\nvoid _ossl_old_des_ofb_encrypt(unsigned char *in, unsigned char *out,\n                               int numbits, long length,\n                               _ossl_old_des_key_schedule schedule,\n                               _ossl_old_des_cblock *ivec);\nvoid _ossl_old_des_pcbc_encrypt(_ossl_old_des_cblock *input,\n                                _ossl_old_des_cblock *output, long length,\n                                _ossl_old_des_key_schedule schedule,\n                                _ossl_old_des_cblock *ivec, int enc);\nDES_LONG _ossl_old_des_quad_cksum(_ossl_old_des_cblock *input,\n                                  _ossl_old_des_cblock *output, long length,\n                                  int out_count, _ossl_old_des_cblock *seed);\nvoid _ossl_old_des_random_seed(_ossl_old_des_cblock key);\nvoid _ossl_old_des_random_key(_ossl_old_des_cblock ret);\nint _ossl_old_des_read_password(_ossl_old_des_cblock *key, const char *prompt,\n                                int verify);\nint _ossl_old_des_read_2passwords(_ossl_old_des_cblock *key1,\n                                  _ossl_old_des_cblock *key2,\n                                  const char *prompt, int verify);\nvoid _ossl_old_des_set_odd_parity(_ossl_old_des_cblock *key);\nint _ossl_old_des_is_weak_key(_ossl_old_des_cblock *key);\nint _ossl_old_des_set_key(_ossl_old_des_cblock *key,\n                          _ossl_old_des_key_schedule schedule);\nint _ossl_old_des_key_sched(_ossl_old_des_cblock *key,\n                            _ossl_old_des_key_schedule schedule);\nvoid _ossl_old_des_string_to_key(char *str, _ossl_old_des_cblock *key);\nvoid _ossl_old_des_string_to_2keys(char *str, _ossl_old_des_cblock *key1,\n                                   _ossl_old_des_cblock *key2);\nvoid _ossl_old_des_cfb64_encrypt(unsigned char *in, unsigned char *out,\n                                 long length,\n                                 _ossl_old_des_key_schedule schedule,\n                                 _ossl_old_des_cblock *ivec, int *num,\n                                 int enc);\nvoid _ossl_old_des_ofb64_encrypt(unsigned char *in, unsigned char *out,\n                                 long length,\n                                 _ossl_old_des_key_schedule schedule,\n                                 _ossl_old_des_cblock *ivec, int *num);\n\nvoid _ossl_096_des_random_seed(des_cblock *key);\n\n/*\n * The following definitions provide compatibility with the MIT Kerberos\n * library. The _ossl_old_des_key_schedule structure is not binary\n * compatible.\n */\n\n# define _KERBEROS_DES_H\n\n# define KRBDES_ENCRYPT DES_ENCRYPT\n# define KRBDES_DECRYPT DES_DECRYPT\n\n# ifdef KERBEROS\n#  define ENCRYPT DES_ENCRYPT\n#  define DECRYPT DES_DECRYPT\n# endif\n\n# ifndef NCOMPAT\n#  define C_Block des_cblock\n#  define Key_schedule des_key_schedule\n#  define KEY_SZ DES_KEY_SZ\n#  define string_to_key des_string_to_key\n#  define read_pw_string des_read_pw_string\n#  define random_key des_random_key\n#  define pcbc_encrypt des_pcbc_encrypt\n#  define set_key des_set_key\n#  define key_sched des_key_sched\n#  define ecb_encrypt des_ecb_encrypt\n#  define cbc_encrypt des_cbc_encrypt\n#  define ncbc_encrypt des_ncbc_encrypt\n#  define xcbc_encrypt des_xcbc_encrypt\n#  define cbc_cksum des_cbc_cksum\n#  define quad_cksum des_quad_cksum\n#  define check_parity des_check_key_parity\n# endif\n\n# define des_fixup_key_parity DES_fixup_key_parity\n\n#ifdef  __cplusplus\n}\n#endif\n\n/* for DES_read_pw_string et al */\n# include <openssl/ui_compat.h>\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/dh.h",
    "content": "/* crypto/dh/dh.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_DH_H\n# define HEADER_DH_H\n\n# include <openssl/e_os2.h>\n\n# ifdef OPENSSL_NO_DH\n#  error DH is disabled.\n# endif\n\n# ifndef OPENSSL_NO_BIO\n#  include <openssl/bio.h>\n# endif\n# include <openssl/ossl_typ.h>\n# ifndef OPENSSL_NO_DEPRECATED\n#  include <openssl/bn.h>\n# endif\n\n# ifndef OPENSSL_DH_MAX_MODULUS_BITS\n#  define OPENSSL_DH_MAX_MODULUS_BITS    10000\n# endif\n\n# define DH_FLAG_CACHE_MONT_P     0x01\n\n/*\n * new with 0.9.7h; the built-in DH\n * implementation now uses constant time\n * modular exponentiation for secret exponents\n * by default. This flag causes the\n * faster variable sliding window method to\n * be used for all exponents.\n */\n# define DH_FLAG_NO_EXP_CONSTTIME 0x02\n\n/*\n * If this flag is set the DH method is FIPS compliant and can be used in\n * FIPS mode. This is set in the validated module method. If an application\n * sets this flag in its own methods it is its reposibility to ensure the\n * result is compliant.\n */\n\n# define DH_FLAG_FIPS_METHOD                     0x0400\n\n/*\n * If this flag is set the operations normally disabled in FIPS mode are\n * permitted it is then the applications responsibility to ensure that the\n * usage is compliant.\n */\n\n# define DH_FLAG_NON_FIPS_ALLOW                  0x0400\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* Already defined in ossl_typ.h */\n/* typedef struct dh_st DH; */\n/* typedef struct dh_method DH_METHOD; */\n\nstruct dh_method {\n    const char *name;\n    /* Methods here */\n    int (*generate_key) (DH *dh);\n    int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh);\n    /* Can be null */\n    int (*bn_mod_exp) (const DH *dh, BIGNUM *r, const BIGNUM *a,\n                       const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,\n                       BN_MONT_CTX *m_ctx);\n    int (*init) (DH *dh);\n    int (*finish) (DH *dh);\n    int flags;\n    char *app_data;\n    /* If this is non-NULL, it will be used to generate parameters */\n    int (*generate_params) (DH *dh, int prime_len, int generator,\n                            BN_GENCB *cb);\n};\n\nstruct dh_st {\n    /*\n     * This first argument is used to pick up errors when a DH is passed\n     * instead of a EVP_PKEY\n     */\n    int pad;\n    int version;\n    BIGNUM *p;\n    BIGNUM *g;\n    long length;                /* optional */\n    BIGNUM *pub_key;            /* g^x % p */\n    BIGNUM *priv_key;           /* x */\n    int flags;\n    BN_MONT_CTX *method_mont_p;\n    /* Place holders if we want to do X9.42 DH */\n    BIGNUM *q;\n    BIGNUM *j;\n    unsigned char *seed;\n    int seedlen;\n    BIGNUM *counter;\n    int references;\n    CRYPTO_EX_DATA ex_data;\n    const DH_METHOD *meth;\n    ENGINE *engine;\n};\n\n# define DH_GENERATOR_2          2\n/* #define DH_GENERATOR_3       3 */\n# define DH_GENERATOR_5          5\n\n/* DH_check error codes */\n# define DH_CHECK_P_NOT_PRIME            0x01\n# define DH_CHECK_P_NOT_SAFE_PRIME       0x02\n# define DH_UNABLE_TO_CHECK_GENERATOR    0x04\n# define DH_NOT_SUITABLE_GENERATOR       0x08\n# define DH_CHECK_Q_NOT_PRIME            0x10\n# define DH_CHECK_INVALID_Q_VALUE        0x20\n# define DH_CHECK_INVALID_J_VALUE        0x40\n\n/* DH_check_pub_key error codes */\n# define DH_CHECK_PUBKEY_TOO_SMALL       0x01\n# define DH_CHECK_PUBKEY_TOO_LARGE       0x02\n# define DH_CHECK_PUBKEY_INVALID         0x04\n\n/*\n * primes p where (p-1)/2 is prime too are called \"safe\"; we define this for\n * backward compatibility:\n */\n# define DH_CHECK_P_NOT_STRONG_PRIME     DH_CHECK_P_NOT_SAFE_PRIME\n\n# define d2i_DHparams_fp(fp,x) \\\n    (DH *)ASN1_d2i_fp((char *(*)())DH_new, \\\n                      (char *(*)())d2i_DHparams, \\\n                      (fp), \\\n                      (unsigned char **)(x))\n# define i2d_DHparams_fp(fp,x) \\\n    ASN1_i2d_fp(i2d_DHparams,(fp), (unsigned char *)(x))\n# define d2i_DHparams_bio(bp,x) \\\n    ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, x)\n# define i2d_DHparams_bio(bp,x) \\\n    ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x)\n\n# define d2i_DHxparams_fp(fp,x) \\\n    (DH *)ASN1_d2i_fp((char *(*)())DH_new, \\\n                      (char *(*)())d2i_DHxparams, \\\n                      (fp), \\\n                      (unsigned char **)(x))\n# define i2d_DHxparams_fp(fp,x) \\\n    ASN1_i2d_fp(i2d_DHxparams,(fp), (unsigned char *)(x))\n# define d2i_DHxparams_bio(bp,x) \\\n    ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x)\n# define i2d_DHxparams_bio(bp,x) \\\n    ASN1_i2d_bio_of_const(DH, i2d_DHxparams, bp, x)\n\nDH *DHparams_dup(DH *);\n\nconst DH_METHOD *DH_OpenSSL(void);\n\nvoid DH_set_default_method(const DH_METHOD *meth);\nconst DH_METHOD *DH_get_default_method(void);\nint DH_set_method(DH *dh, const DH_METHOD *meth);\nDH *DH_new_method(ENGINE *engine);\n\nDH *DH_new(void);\nvoid DH_free(DH *dh);\nint DH_up_ref(DH *dh);\nint DH_size(const DH *dh);\nint DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,\n                        CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);\nint DH_set_ex_data(DH *d, int idx, void *arg);\nvoid *DH_get_ex_data(DH *d, int idx);\n\n/* Deprecated version */\n# ifndef OPENSSL_NO_DEPRECATED\nDH *DH_generate_parameters(int prime_len, int generator,\n                           void (*callback) (int, int, void *), void *cb_arg);\n# endif                         /* !defined(OPENSSL_NO_DEPRECATED) */\n\n/* New version */\nint DH_generate_parameters_ex(DH *dh, int prime_len, int generator,\n                              BN_GENCB *cb);\n\nint DH_check(const DH *dh, int *codes);\nint DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes);\nint DH_generate_key(DH *dh);\nint DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);\nint DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh);\nDH *d2i_DHparams(DH **a, const unsigned char **pp, long length);\nint i2d_DHparams(const DH *a, unsigned char **pp);\nDH *d2i_DHxparams(DH **a, const unsigned char **pp, long length);\nint i2d_DHxparams(const DH *a, unsigned char **pp);\n# ifndef OPENSSL_NO_FP_API\nint DHparams_print_fp(FILE *fp, const DH *x);\n# endif\n# ifndef OPENSSL_NO_BIO\nint DHparams_print(BIO *bp, const DH *x);\n# else\nint DHparams_print(char *bp, const DH *x);\n# endif\n\n/* RFC 5114 parameters */\nDH *DH_get_1024_160(void);\nDH *DH_get_2048_224(void);\nDH *DH_get_2048_256(void);\n\n# ifndef OPENSSL_NO_CMS\n/* RFC2631 KDF */\nint DH_KDF_X9_42(unsigned char *out, size_t outlen,\n                 const unsigned char *Z, size_t Zlen,\n                 ASN1_OBJECT *key_oid,\n                 const unsigned char *ukm, size_t ukmlen, const EVP_MD *md);\n# endif\n\n# define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \\\n                        EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL)\n\n# define EVP_PKEY_CTX_set_dh_paramgen_subprime_len(ctx, len) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \\\n                        EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN, len, NULL)\n\n# define EVP_PKEY_CTX_set_dh_paramgen_type(ctx, typ) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \\\n                        EVP_PKEY_CTRL_DH_PARAMGEN_TYPE, typ, NULL)\n\n# define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \\\n                        EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL)\n\n# define EVP_PKEY_CTX_set_dh_rfc5114(ctx, gen) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \\\n                        EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)\n\n# define EVP_PKEY_CTX_set_dhx_rfc5114(ctx, gen) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, EVP_PKEY_OP_PARAMGEN, \\\n                        EVP_PKEY_CTRL_DH_RFC5114, gen, NULL)\n\n# define EVP_PKEY_CTX_set_dh_kdf_type(ctx, kdf) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_DH_KDF_TYPE, kdf, NULL)\n\n# define EVP_PKEY_CTX_get_dh_kdf_type(ctx) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_DH_KDF_TYPE, -2, NULL)\n\n# define EVP_PKEY_CTX_set0_dh_kdf_oid(ctx, oid) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_DH_KDF_OID, 0, (void *)oid)\n\n# define EVP_PKEY_CTX_get0_dh_kdf_oid(ctx, poid) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_GET_DH_KDF_OID, 0, (void *)poid)\n\n# define EVP_PKEY_CTX_set_dh_kdf_md(ctx, md) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_DH_KDF_MD, 0, (void *)md)\n\n# define EVP_PKEY_CTX_get_dh_kdf_md(ctx, pmd) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_GET_DH_KDF_MD, 0, (void *)pmd)\n\n# define EVP_PKEY_CTX_set_dh_kdf_outlen(ctx, len) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_DH_KDF_OUTLEN, len, NULL)\n\n# define EVP_PKEY_CTX_get_dh_kdf_outlen(ctx, plen) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                        EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN, 0, (void *)plen)\n\n# define EVP_PKEY_CTX_set0_dh_kdf_ukm(ctx, p, plen) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_DH_KDF_UKM, plen, (void *)p)\n\n# define EVP_PKEY_CTX_get0_dh_kdf_ukm(ctx, p) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DHX, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_GET_DH_KDF_UKM, 0, (void *)p)\n\n# define EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN     (EVP_PKEY_ALG_CTRL + 1)\n# define EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR     (EVP_PKEY_ALG_CTRL + 2)\n# define EVP_PKEY_CTRL_DH_RFC5114                (EVP_PKEY_ALG_CTRL + 3)\n# define EVP_PKEY_CTRL_DH_PARAMGEN_SUBPRIME_LEN  (EVP_PKEY_ALG_CTRL + 4)\n# define EVP_PKEY_CTRL_DH_PARAMGEN_TYPE          (EVP_PKEY_ALG_CTRL + 5)\n# define EVP_PKEY_CTRL_DH_KDF_TYPE               (EVP_PKEY_ALG_CTRL + 6)\n# define EVP_PKEY_CTRL_DH_KDF_MD                 (EVP_PKEY_ALG_CTRL + 7)\n# define EVP_PKEY_CTRL_GET_DH_KDF_MD             (EVP_PKEY_ALG_CTRL + 8)\n# define EVP_PKEY_CTRL_DH_KDF_OUTLEN             (EVP_PKEY_ALG_CTRL + 9)\n# define EVP_PKEY_CTRL_GET_DH_KDF_OUTLEN         (EVP_PKEY_ALG_CTRL + 10)\n# define EVP_PKEY_CTRL_DH_KDF_UKM                (EVP_PKEY_ALG_CTRL + 11)\n# define EVP_PKEY_CTRL_GET_DH_KDF_UKM            (EVP_PKEY_ALG_CTRL + 12)\n# define EVP_PKEY_CTRL_DH_KDF_OID                (EVP_PKEY_ALG_CTRL + 13)\n# define EVP_PKEY_CTRL_GET_DH_KDF_OID            (EVP_PKEY_ALG_CTRL + 14)\n\n/* KDF types */\n# define EVP_PKEY_DH_KDF_NONE                            1\n# define EVP_PKEY_DH_KDF_X9_42                           2\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_DH_strings(void);\n\n/* Error codes for the DH functions. */\n\n/* Function codes. */\n# define DH_F_COMPUTE_KEY                                 102\n# define DH_F_DHPARAMS_PRINT_FP                           101\n# define DH_F_DH_BUILTIN_GENPARAMS                        106\n# define DH_F_DH_CMS_DECRYPT                              117\n# define DH_F_DH_CMS_SET_PEERKEY                          118\n# define DH_F_DH_CMS_SET_SHARED_INFO                      119\n# define DH_F_DH_COMPUTE_KEY                              114\n# define DH_F_DH_GENERATE_KEY                             115\n# define DH_F_DH_GENERATE_PARAMETERS_EX                   116\n# define DH_F_DH_NEW_METHOD                               105\n# define DH_F_DH_PARAM_DECODE                             107\n# define DH_F_DH_PRIV_DECODE                              110\n# define DH_F_DH_PRIV_ENCODE                              111\n# define DH_F_DH_PUB_DECODE                               108\n# define DH_F_DH_PUB_ENCODE                               109\n# define DH_F_DO_DH_PRINT                                 100\n# define DH_F_GENERATE_KEY                                103\n# define DH_F_GENERATE_PARAMETERS                         104\n# define DH_F_PKEY_DH_DERIVE                              112\n# define DH_F_PKEY_DH_KEYGEN                              113\n\n/* Reason codes. */\n# define DH_R_BAD_GENERATOR                               101\n# define DH_R_BN_DECODE_ERROR                             109\n# define DH_R_BN_ERROR                                    106\n# define DH_R_DECODE_ERROR                                104\n# define DH_R_INVALID_PUBKEY                              102\n# define DH_R_KDF_PARAMETER_ERROR                         112\n# define DH_R_KEYS_NOT_SET                                108\n# define DH_R_KEY_SIZE_TOO_SMALL                          110\n# define DH_R_MODULUS_TOO_LARGE                           103\n# define DH_R_NON_FIPS_METHOD                             111\n# define DH_R_NO_PARAMETERS_SET                           107\n# define DH_R_NO_PRIVATE_VALUE                            100\n# define DH_R_PARAMETER_ENCODING_ERROR                    105\n# define DH_R_PEER_KEY_ERROR                              113\n# define DH_R_SHARED_INFO_ERROR                           114\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/dsa.h",
    "content": "/* crypto/dsa/dsa.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n/*\n * The DSS routines are based on patches supplied by\n * Steven Schoch <schoch@sheba.arc.nasa.gov>.  He basically did the\n * work and I have just tweaked them a little to fit into my\n * stylistic vision for SSLeay :-) */\n\n#ifndef HEADER_DSA_H\n# define HEADER_DSA_H\n\n# include <openssl/e_os2.h>\n\n# ifdef OPENSSL_NO_DSA\n#  error DSA is disabled.\n# endif\n\n# ifndef OPENSSL_NO_BIO\n#  include <openssl/bio.h>\n# endif\n# include <openssl/crypto.h>\n# include <openssl/ossl_typ.h>\n\n# ifndef OPENSSL_NO_DEPRECATED\n#  include <openssl/bn.h>\n#  ifndef OPENSSL_NO_DH\n#   include <openssl/dh.h>\n#  endif\n# endif\n\n# ifndef OPENSSL_DSA_MAX_MODULUS_BITS\n#  define OPENSSL_DSA_MAX_MODULUS_BITS   10000\n# endif\n\n# define DSA_FLAG_CACHE_MONT_P   0x01\n/*\n * new with 0.9.7h; the built-in DSA implementation now uses constant time\n * modular exponentiation for secret exponents by default. This flag causes\n * the faster variable sliding window method to be used for all exponents.\n */\n# define DSA_FLAG_NO_EXP_CONSTTIME       0x02\n\n/*\n * If this flag is set the DSA method is FIPS compliant and can be used in\n * FIPS mode. This is set in the validated module method. If an application\n * sets this flag in its own methods it is its reposibility to ensure the\n * result is compliant.\n */\n\n# define DSA_FLAG_FIPS_METHOD                    0x0400\n\n/*\n * If this flag is set the operations normally disabled in FIPS mode are\n * permitted it is then the applications responsibility to ensure that the\n * usage is compliant.\n */\n\n# define DSA_FLAG_NON_FIPS_ALLOW                 0x0400\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* Already defined in ossl_typ.h */\n/* typedef struct dsa_st DSA; */\n/* typedef struct dsa_method DSA_METHOD; */\n\ntypedef struct DSA_SIG_st {\n    BIGNUM *r;\n    BIGNUM *s;\n} DSA_SIG;\n\nstruct dsa_method {\n    const char *name;\n    DSA_SIG *(*dsa_do_sign) (const unsigned char *dgst, int dlen, DSA *dsa);\n    int (*dsa_sign_setup) (DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,\n                           BIGNUM **rp);\n    int (*dsa_do_verify) (const unsigned char *dgst, int dgst_len,\n                          DSA_SIG *sig, DSA *dsa);\n    int (*dsa_mod_exp) (DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1,\n                        BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx,\n                        BN_MONT_CTX *in_mont);\n    /* Can be null */\n    int (*bn_mod_exp) (DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p,\n                       const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);\n    int (*init) (DSA *dsa);\n    int (*finish) (DSA *dsa);\n    int flags;\n    char *app_data;\n    /* If this is non-NULL, it is used to generate DSA parameters */\n    int (*dsa_paramgen) (DSA *dsa, int bits,\n                         const unsigned char *seed, int seed_len,\n                         int *counter_ret, unsigned long *h_ret,\n                         BN_GENCB *cb);\n    /* If this is non-NULL, it is used to generate DSA keys */\n    int (*dsa_keygen) (DSA *dsa);\n};\n\nstruct dsa_st {\n    /*\n     * This first variable is used to pick up errors where a DSA is passed\n     * instead of of a EVP_PKEY\n     */\n    int pad;\n    long version;\n    int write_params;\n    BIGNUM *p;\n    BIGNUM *q;                  /* == 20 */\n    BIGNUM *g;\n    BIGNUM *pub_key;            /* y public key */\n    BIGNUM *priv_key;           /* x private key */\n    BIGNUM *kinv;               /* Signing pre-calc */\n    BIGNUM *r;                  /* Signing pre-calc */\n    int flags;\n    /* Normally used to cache montgomery values */\n    BN_MONT_CTX *method_mont_p;\n    int references;\n    CRYPTO_EX_DATA ex_data;\n    const DSA_METHOD *meth;\n    /* functional reference if 'meth' is ENGINE-provided */\n    ENGINE *engine;\n};\n\n# define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \\\n                (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x))\n# define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \\\n                (unsigned char *)(x))\n# define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x)\n# define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x)\n\nDSA *DSAparams_dup(DSA *x);\nDSA_SIG *DSA_SIG_new(void);\nvoid DSA_SIG_free(DSA_SIG *a);\nint i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp);\nDSA_SIG *d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length);\n\nDSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa);\nint DSA_do_verify(const unsigned char *dgst, int dgst_len,\n                  DSA_SIG *sig, DSA *dsa);\n\nconst DSA_METHOD *DSA_OpenSSL(void);\n\nvoid DSA_set_default_method(const DSA_METHOD *);\nconst DSA_METHOD *DSA_get_default_method(void);\nint DSA_set_method(DSA *dsa, const DSA_METHOD *);\n\nDSA *DSA_new(void);\nDSA *DSA_new_method(ENGINE *engine);\nvoid DSA_free(DSA *r);\n/* \"up\" the DSA object's reference count */\nint DSA_up_ref(DSA *r);\nint DSA_size(const DSA *);\n        /* next 4 return -1 on error */\nint DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);\nint DSA_sign(int type, const unsigned char *dgst, int dlen,\n             unsigned char *sig, unsigned int *siglen, DSA *dsa);\nint DSA_verify(int type, const unsigned char *dgst, int dgst_len,\n               const unsigned char *sigbuf, int siglen, DSA *dsa);\nint DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,\n                         CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);\nint DSA_set_ex_data(DSA *d, int idx, void *arg);\nvoid *DSA_get_ex_data(DSA *d, int idx);\n\nDSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);\nDSA *d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length);\nDSA *d2i_DSAparams(DSA **a, const unsigned char **pp, long length);\n\n/* Deprecated version */\n# ifndef OPENSSL_NO_DEPRECATED\nDSA *DSA_generate_parameters(int bits,\n                             unsigned char *seed, int seed_len,\n                             int *counter_ret, unsigned long *h_ret, void\n                              (*callback) (int, int, void *), void *cb_arg);\n# endif                         /* !defined(OPENSSL_NO_DEPRECATED) */\n\n/* New version */\nint DSA_generate_parameters_ex(DSA *dsa, int bits,\n                               const unsigned char *seed, int seed_len,\n                               int *counter_ret, unsigned long *h_ret,\n                               BN_GENCB *cb);\n\nint DSA_generate_key(DSA *a);\nint i2d_DSAPublicKey(const DSA *a, unsigned char **pp);\nint i2d_DSAPrivateKey(const DSA *a, unsigned char **pp);\nint i2d_DSAparams(const DSA *a, unsigned char **pp);\n\n# ifndef OPENSSL_NO_BIO\nint DSAparams_print(BIO *bp, const DSA *x);\nint DSA_print(BIO *bp, const DSA *x, int off);\n# endif\n# ifndef OPENSSL_NO_FP_API\nint DSAparams_print_fp(FILE *fp, const DSA *x);\nint DSA_print_fp(FILE *bp, const DSA *x, int off);\n# endif\n\n# define DSS_prime_checks 50\n/*\n * Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of\n * Rabin-Miller\n */\n# define DSA_is_prime(n, callback, cb_arg) \\\n        BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg)\n\n# ifndef OPENSSL_NO_DH\n/*\n * Convert DSA structure (key or just parameters) into DH structure (be\n * careful to avoid small subgroup attacks when using this!)\n */\nDH *DSA_dup_DH(const DSA *r);\n# endif\n\n# define EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, nbits) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, \\\n                                EVP_PKEY_CTRL_DSA_PARAMGEN_BITS, nbits, NULL)\n\n# define EVP_PKEY_CTRL_DSA_PARAMGEN_BITS         (EVP_PKEY_ALG_CTRL + 1)\n# define EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS       (EVP_PKEY_ALG_CTRL + 2)\n# define EVP_PKEY_CTRL_DSA_PARAMGEN_MD           (EVP_PKEY_ALG_CTRL + 3)\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_DSA_strings(void);\n\n/* Error codes for the DSA functions. */\n\n/* Function codes. */\n# define DSA_F_D2I_DSA_SIG                                110\n# define DSA_F_DO_DSA_PRINT                               104\n# define DSA_F_DSAPARAMS_PRINT                            100\n# define DSA_F_DSAPARAMS_PRINT_FP                         101\n# define DSA_F_DSA_BUILTIN_PARAMGEN2                      126\n# define DSA_F_DSA_DO_SIGN                                112\n# define DSA_F_DSA_DO_VERIFY                              113\n# define DSA_F_DSA_GENERATE_KEY                           124\n# define DSA_F_DSA_GENERATE_PARAMETERS_EX                 123\n# define DSA_F_DSA_NEW_METHOD                             103\n# define DSA_F_DSA_PARAM_DECODE                           119\n# define DSA_F_DSA_PRINT_FP                               105\n# define DSA_F_DSA_PRIV_DECODE                            115\n# define DSA_F_DSA_PRIV_ENCODE                            116\n# define DSA_F_DSA_PUB_DECODE                             117\n# define DSA_F_DSA_PUB_ENCODE                             118\n# define DSA_F_DSA_SIGN                                   106\n# define DSA_F_DSA_SIGN_SETUP                             107\n# define DSA_F_DSA_SIG_NEW                                109\n# define DSA_F_DSA_SIG_PRINT                              125\n# define DSA_F_DSA_VERIFY                                 108\n# define DSA_F_I2D_DSA_SIG                                111\n# define DSA_F_OLD_DSA_PRIV_DECODE                        122\n# define DSA_F_PKEY_DSA_CTRL                              120\n# define DSA_F_PKEY_DSA_KEYGEN                            121\n# define DSA_F_SIG_CB                                     114\n\n/* Reason codes. */\n# define DSA_R_BAD_Q_VALUE                                102\n# define DSA_R_BN_DECODE_ERROR                            108\n# define DSA_R_BN_ERROR                                   109\n# define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE                100\n# define DSA_R_DECODE_ERROR                               104\n# define DSA_R_INVALID_DIGEST_TYPE                        106\n# define DSA_R_INVALID_PARAMETERS                         112\n# define DSA_R_MISSING_PARAMETERS                         101\n# define DSA_R_MODULUS_TOO_LARGE                          103\n# define DSA_R_NEED_NEW_SETUP_VALUES                      110\n# define DSA_R_NON_FIPS_DSA_METHOD                        111\n# define DSA_R_NO_PARAMETERS_SET                          107\n# define DSA_R_PARAMETER_ENCODING_ERROR                   105\n# define DSA_R_Q_NOT_PRIME                                113\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/dso.h",
    "content": "/* dso.h */\n/*\n * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project\n * 2000.\n */\n/* ====================================================================\n * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_DSO_H\n# define HEADER_DSO_H\n\n# include <openssl/crypto.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/* These values are used as commands to DSO_ctrl() */\n# define DSO_CTRL_GET_FLAGS      1\n# define DSO_CTRL_SET_FLAGS      2\n# define DSO_CTRL_OR_FLAGS       3\n\n/*\n * By default, DSO_load() will translate the provided filename into a form\n * typical for the platform (more specifically the DSO_METHOD) using the\n * dso_name_converter function of the method. Eg. win32 will transform \"blah\"\n * into \"blah.dll\", and dlfcn will transform it into \"libblah.so\". The\n * behaviour can be overriden by setting the name_converter callback in the\n * DSO object (using DSO_set_name_converter()). This callback could even\n * utilise the DSO_METHOD's converter too if it only wants to override\n * behaviour for one or two possible DSO methods. However, the following flag\n * can be set in a DSO to prevent *any* native name-translation at all - eg.\n * if the caller has prompted the user for a path to a driver library so the\n * filename should be interpreted as-is.\n */\n# define DSO_FLAG_NO_NAME_TRANSLATION            0x01\n/*\n * An extra flag to give if only the extension should be added as\n * translation.  This is obviously only of importance on Unix and other\n * operating systems where the translation also may prefix the name with\n * something, like 'lib', and ignored everywhere else. This flag is also\n * ignored if DSO_FLAG_NO_NAME_TRANSLATION is used at the same time.\n */\n# define DSO_FLAG_NAME_TRANSLATION_EXT_ONLY      0x02\n\n/*\n * The following flag controls the translation of symbol names to upper case.\n * This is currently only being implemented for OpenVMS.\n */\n# define DSO_FLAG_UPCASE_SYMBOL                  0x10\n\n/*\n * This flag loads the library with public symbols. Meaning: The exported\n * symbols of this library are public to all libraries loaded after this\n * library. At the moment only implemented in unix.\n */\n# define DSO_FLAG_GLOBAL_SYMBOLS                 0x20\n\ntypedef void (*DSO_FUNC_TYPE) (void);\n\ntypedef struct dso_st DSO;\n\n/*\n * The function prototype used for method functions (or caller-provided\n * callbacks) that transform filenames. They are passed a DSO structure\n * pointer (or NULL if they are to be used independantly of a DSO object) and\n * a filename to transform. They should either return NULL (if there is an\n * error condition) or a newly allocated string containing the transformed\n * form that the caller will need to free with OPENSSL_free() when done.\n */\ntypedef char *(*DSO_NAME_CONVERTER_FUNC)(DSO *, const char *);\n/*\n * The function prototype used for method functions (or caller-provided\n * callbacks) that merge two file specifications. They are passed a DSO\n * structure pointer (or NULL if they are to be used independantly of a DSO\n * object) and two file specifications to merge. They should either return\n * NULL (if there is an error condition) or a newly allocated string\n * containing the result of merging that the caller will need to free with\n * OPENSSL_free() when done. Here, merging means that bits and pieces are\n * taken from each of the file specifications and added together in whatever\n * fashion that is sensible for the DSO method in question.  The only rule\n * that really applies is that if the two specification contain pieces of the\n * same type, the copy from the first string takes priority.  One could see\n * it as the first specification is the one given by the user and the second\n * being a bunch of defaults to add on if they're missing in the first.\n */\ntypedef char *(*DSO_MERGER_FUNC)(DSO *, const char *, const char *);\n\ntypedef struct dso_meth_st {\n    const char *name;\n    /*\n     * Loads a shared library, NB: new DSO_METHODs must ensure that a\n     * successful load populates the loaded_filename field, and likewise a\n     * successful unload OPENSSL_frees and NULLs it out.\n     */\n    int (*dso_load) (DSO *dso);\n    /* Unloads a shared library */\n    int (*dso_unload) (DSO *dso);\n    /* Binds a variable */\n    void *(*dso_bind_var) (DSO *dso, const char *symname);\n    /*\n     * Binds a function - assumes a return type of DSO_FUNC_TYPE. This should\n     * be cast to the real function prototype by the caller. Platforms that\n     * don't have compatible representations for different prototypes (this\n     * is possible within ANSI C) are highly unlikely to have shared\n     * libraries at all, let alone a DSO_METHOD implemented for them.\n     */\n    DSO_FUNC_TYPE (*dso_bind_func) (DSO *dso, const char *symname);\n/* I don't think this would actually be used in any circumstances. */\n# if 0\n    /* Unbinds a variable */\n    int (*dso_unbind_var) (DSO *dso, char *symname, void *symptr);\n    /* Unbinds a function */\n    int (*dso_unbind_func) (DSO *dso, char *symname, DSO_FUNC_TYPE symptr);\n# endif\n    /*\n     * The generic (yuck) \"ctrl()\" function. NB: Negative return values\n     * (rather than zero) indicate errors.\n     */\n    long (*dso_ctrl) (DSO *dso, int cmd, long larg, void *parg);\n    /*\n     * The default DSO_METHOD-specific function for converting filenames to a\n     * canonical native form.\n     */\n    DSO_NAME_CONVERTER_FUNC dso_name_converter;\n    /*\n     * The default DSO_METHOD-specific function for converting filenames to a\n     * canonical native form.\n     */\n    DSO_MERGER_FUNC dso_merger;\n    /* [De]Initialisation handlers. */\n    int (*init) (DSO *dso);\n    int (*finish) (DSO *dso);\n    /* Return pathname of the module containing location */\n    int (*pathbyaddr) (void *addr, char *path, int sz);\n    /* Perform global symbol lookup, i.e. among *all* modules */\n    void *(*globallookup) (const char *symname);\n} DSO_METHOD;\n\n/**********************************************************************/\n/* The low-level handle type used to refer to a loaded shared library */\n\nstruct dso_st {\n    DSO_METHOD *meth;\n    /*\n     * Standard dlopen uses a (void *). Win32 uses a HANDLE. VMS doesn't use\n     * anything but will need to cache the filename for use in the dso_bind\n     * handler. All in all, let each method control its own destiny.\n     * \"Handles\" and such go in a STACK.\n     */\n    STACK_OF(void) *meth_data;\n    int references;\n    int flags;\n    /*\n     * For use by applications etc ... use this for your bits'n'pieces, don't\n     * touch meth_data!\n     */\n    CRYPTO_EX_DATA ex_data;\n    /*\n     * If this callback function pointer is set to non-NULL, then it will be\n     * used in DSO_load() in place of meth->dso_name_converter. NB: This\n     * should normally set using DSO_set_name_converter().\n     */\n    DSO_NAME_CONVERTER_FUNC name_converter;\n    /*\n     * If this callback function pointer is set to non-NULL, then it will be\n     * used in DSO_load() in place of meth->dso_merger. NB: This should\n     * normally set using DSO_set_merger().\n     */\n    DSO_MERGER_FUNC merger;\n    /*\n     * This is populated with (a copy of) the platform-independant filename\n     * used for this DSO.\n     */\n    char *filename;\n    /*\n     * This is populated with (a copy of) the translated filename by which\n     * the DSO was actually loaded. It is NULL iff the DSO is not currently\n     * loaded. NB: This is here because the filename translation process may\n     * involve a callback being invoked more than once not only to convert to\n     * a platform-specific form, but also to try different filenames in the\n     * process of trying to perform a load. As such, this variable can be\n     * used to indicate (a) whether this DSO structure corresponds to a\n     * loaded library or not, and (b) the filename with which it was actually\n     * loaded.\n     */\n    char *loaded_filename;\n};\n\nDSO *DSO_new(void);\nDSO *DSO_new_method(DSO_METHOD *method);\nint DSO_free(DSO *dso);\nint DSO_flags(DSO *dso);\nint DSO_up_ref(DSO *dso);\nlong DSO_ctrl(DSO *dso, int cmd, long larg, void *parg);\n\n/*\n * This function sets the DSO's name_converter callback. If it is non-NULL,\n * then it will be used instead of the associated DSO_METHOD's function. If\n * oldcb is non-NULL then it is set to the function pointer value being\n * replaced. Return value is non-zero for success.\n */\nint DSO_set_name_converter(DSO *dso, DSO_NAME_CONVERTER_FUNC cb,\n                           DSO_NAME_CONVERTER_FUNC *oldcb);\n/*\n * These functions can be used to get/set the platform-independant filename\n * used for a DSO. NB: set will fail if the DSO is already loaded.\n */\nconst char *DSO_get_filename(DSO *dso);\nint DSO_set_filename(DSO *dso, const char *filename);\n/*\n * This function will invoke the DSO's name_converter callback to translate a\n * filename, or if the callback isn't set it will instead use the DSO_METHOD's\n * converter. If \"filename\" is NULL, the \"filename\" in the DSO itself will be\n * used. If the DSO_FLAG_NO_NAME_TRANSLATION flag is set, then the filename is\n * simply duplicated. NB: This function is usually called from within a\n * DSO_METHOD during the processing of a DSO_load() call, and is exposed so\n * that caller-created DSO_METHODs can do the same thing. A non-NULL return\n * value will need to be OPENSSL_free()'d.\n */\nchar *DSO_convert_filename(DSO *dso, const char *filename);\n/*\n * This function will invoke the DSO's merger callback to merge two file\n * specifications, or if the callback isn't set it will instead use the\n * DSO_METHOD's merger.  A non-NULL return value will need to be\n * OPENSSL_free()'d.\n */\nchar *DSO_merge(DSO *dso, const char *filespec1, const char *filespec2);\n/*\n * If the DSO is currently loaded, this returns the filename that it was\n * loaded under, otherwise it returns NULL. So it is also useful as a test as\n * to whether the DSO is currently loaded. NB: This will not necessarily\n * return the same value as DSO_convert_filename(dso, dso->filename), because\n * the DSO_METHOD's load function may have tried a variety of filenames (with\n * and/or without the aid of the converters) before settling on the one it\n * actually loaded.\n */\nconst char *DSO_get_loaded_filename(DSO *dso);\n\nvoid DSO_set_default_method(DSO_METHOD *meth);\nDSO_METHOD *DSO_get_default_method(void);\nDSO_METHOD *DSO_get_method(DSO *dso);\nDSO_METHOD *DSO_set_method(DSO *dso, DSO_METHOD *meth);\n\n/*\n * The all-singing all-dancing load function, you normally pass NULL for the\n * first and third parameters. Use DSO_up and DSO_free for subsequent\n * reference count handling. Any flags passed in will be set in the\n * constructed DSO after its init() function but before the load operation.\n * If 'dso' is non-NULL, 'flags' is ignored.\n */\nDSO *DSO_load(DSO *dso, const char *filename, DSO_METHOD *meth, int flags);\n\n/* This function binds to a variable inside a shared library. */\nvoid *DSO_bind_var(DSO *dso, const char *symname);\n\n/* This function binds to a function inside a shared library. */\nDSO_FUNC_TYPE DSO_bind_func(DSO *dso, const char *symname);\n\n/*\n * This method is the default, but will beg, borrow, or steal whatever method\n * should be the default on any particular platform (including\n * DSO_METH_null() if necessary).\n */\nDSO_METHOD *DSO_METHOD_openssl(void);\n\n/*\n * This method is defined for all platforms - if a platform has no DSO\n * support then this will be the only method!\n */\nDSO_METHOD *DSO_METHOD_null(void);\n\n/*\n * If DSO_DLFCN is defined, the standard dlfcn.h-style functions (dlopen,\n * dlclose, dlsym, etc) will be used and incorporated into this method. If\n * not, this method will return NULL.\n */\nDSO_METHOD *DSO_METHOD_dlfcn(void);\n\n/*\n * If DSO_DL is defined, the standard dl.h-style functions (shl_load,\n * shl_unload, shl_findsym, etc) will be used and incorporated into this\n * method. If not, this method will return NULL.\n */\nDSO_METHOD *DSO_METHOD_dl(void);\n\n/* If WIN32 is defined, use DLLs. If not, return NULL. */\nDSO_METHOD *DSO_METHOD_win32(void);\n\n/* If VMS is defined, use shared images. If not, return NULL. */\nDSO_METHOD *DSO_METHOD_vms(void);\n\n/*\n * This function writes null-terminated pathname of DSO module containing\n * 'addr' into 'sz' large caller-provided 'path' and returns the number of\n * characters [including trailing zero] written to it. If 'sz' is 0 or\n * negative, 'path' is ignored and required amount of charachers [including\n * trailing zero] to accomodate pathname is returned. If 'addr' is NULL, then\n * pathname of cryptolib itself is returned. Negative or zero return value\n * denotes error.\n */\nint DSO_pathbyaddr(void *addr, char *path, int sz);\n\n/*\n * This function should be used with caution! It looks up symbols in *all*\n * loaded modules and if module gets unloaded by somebody else attempt to\n * dereference the pointer is doomed to have fatal consequences. Primary\n * usage for this function is to probe *core* system functionality, e.g.\n * check if getnameinfo(3) is available at run-time without bothering about\n * OS-specific details such as libc.so.versioning or where does it actually\n * reside: in libc itself or libsocket.\n */\nvoid *DSO_global_lookup(const char *name);\n\n/* If BeOS is defined, use shared images. If not, return NULL. */\nDSO_METHOD *DSO_METHOD_beos(void);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_DSO_strings(void);\n\n/* Error codes for the DSO functions. */\n\n/* Function codes. */\n# define DSO_F_BEOS_BIND_FUNC                             144\n# define DSO_F_BEOS_BIND_VAR                              145\n# define DSO_F_BEOS_LOAD                                  146\n# define DSO_F_BEOS_NAME_CONVERTER                        147\n# define DSO_F_BEOS_UNLOAD                                148\n# define DSO_F_DLFCN_BIND_FUNC                            100\n# define DSO_F_DLFCN_BIND_VAR                             101\n# define DSO_F_DLFCN_LOAD                                 102\n# define DSO_F_DLFCN_MERGER                               130\n# define DSO_F_DLFCN_NAME_CONVERTER                       123\n# define DSO_F_DLFCN_UNLOAD                               103\n# define DSO_F_DL_BIND_FUNC                               104\n# define DSO_F_DL_BIND_VAR                                105\n# define DSO_F_DL_LOAD                                    106\n# define DSO_F_DL_MERGER                                  131\n# define DSO_F_DL_NAME_CONVERTER                          124\n# define DSO_F_DL_UNLOAD                                  107\n# define DSO_F_DSO_BIND_FUNC                              108\n# define DSO_F_DSO_BIND_VAR                               109\n# define DSO_F_DSO_CONVERT_FILENAME                       126\n# define DSO_F_DSO_CTRL                                   110\n# define DSO_F_DSO_FREE                                   111\n# define DSO_F_DSO_GET_FILENAME                           127\n# define DSO_F_DSO_GET_LOADED_FILENAME                    128\n# define DSO_F_DSO_GLOBAL_LOOKUP                          139\n# define DSO_F_DSO_LOAD                                   112\n# define DSO_F_DSO_MERGE                                  132\n# define DSO_F_DSO_NEW_METHOD                             113\n# define DSO_F_DSO_PATHBYADDR                             140\n# define DSO_F_DSO_SET_FILENAME                           129\n# define DSO_F_DSO_SET_NAME_CONVERTER                     122\n# define DSO_F_DSO_UP_REF                                 114\n# define DSO_F_GLOBAL_LOOKUP_FUNC                         138\n# define DSO_F_PATHBYADDR                                 137\n# define DSO_F_VMS_BIND_SYM                               115\n# define DSO_F_VMS_LOAD                                   116\n# define DSO_F_VMS_MERGER                                 133\n# define DSO_F_VMS_UNLOAD                                 117\n# define DSO_F_WIN32_BIND_FUNC                            118\n# define DSO_F_WIN32_BIND_VAR                             119\n# define DSO_F_WIN32_GLOBALLOOKUP                         142\n# define DSO_F_WIN32_GLOBALLOOKUP_FUNC                    143\n# define DSO_F_WIN32_JOINER                               135\n# define DSO_F_WIN32_LOAD                                 120\n# define DSO_F_WIN32_MERGER                               134\n# define DSO_F_WIN32_NAME_CONVERTER                       125\n# define DSO_F_WIN32_PATHBYADDR                           141\n# define DSO_F_WIN32_SPLITTER                             136\n# define DSO_F_WIN32_UNLOAD                               121\n\n/* Reason codes. */\n# define DSO_R_CTRL_FAILED                                100\n# define DSO_R_DSO_ALREADY_LOADED                         110\n# define DSO_R_EMPTY_FILE_STRUCTURE                       113\n# define DSO_R_FAILURE                                    114\n# define DSO_R_FILENAME_TOO_BIG                           101\n# define DSO_R_FINISH_FAILED                              102\n# define DSO_R_INCORRECT_FILE_SYNTAX                      115\n# define DSO_R_LOAD_FAILED                                103\n# define DSO_R_NAME_TRANSLATION_FAILED                    109\n# define DSO_R_NO_FILENAME                                111\n# define DSO_R_NO_FILE_SPECIFICATION                      116\n# define DSO_R_NULL_HANDLE                                104\n# define DSO_R_SET_FILENAME_FAILED                        112\n# define DSO_R_STACK_ERROR                                105\n# define DSO_R_SYM_FAILURE                                106\n# define DSO_R_UNLOAD_FAILED                              107\n# define DSO_R_UNSUPPORTED                                108\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/dtls1.h",
    "content": "/* ssl/dtls1.h */\n/*\n * DTLS implementation written by Nagendra Modadugu\n * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.\n */\n/* ====================================================================\n * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_DTLS1_H\n# define HEADER_DTLS1_H\n\n# include <openssl/buffer.h>\n# include <openssl/pqueue.h>\n# ifdef OPENSSL_SYS_VMS\n#  include <resource.h>\n#  include <sys/timeb.h>\n# endif\n# ifdef OPENSSL_SYS_WIN32\n/* Needed for struct timeval */\n#  include <winsock.h>\n# elif defined(OPENSSL_SYS_NETWARE) && !defined(_WINSOCK2API_)\n#  include <sys/timeval.h>\n# else\n#  if defined(OPENSSL_SYS_VXWORKS)\n#   include <sys/times.h>\n#  else\n#   include <sys/time.h>\n#  endif\n# endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# define DTLS1_VERSION                   0xFEFF\n# define DTLS1_2_VERSION                 0xFEFD\n# define DTLS_MAX_VERSION                DTLS1_2_VERSION\n# define DTLS1_VERSION_MAJOR             0xFE\n\n# define DTLS1_BAD_VER                   0x0100\n\n/* Special value for method supporting multiple versions */\n# define DTLS_ANY_VERSION                0x1FFFF\n\n# if 0\n/* this alert description is not specified anywhere... */\n#  define DTLS1_AD_MISSING_HANDSHAKE_MESSAGE    110\n# endif\n\n/* lengths of messages */\n# define DTLS1_COOKIE_LENGTH                     256\n\n# define DTLS1_RT_HEADER_LENGTH                  13\n\n# define DTLS1_HM_HEADER_LENGTH                  12\n\n# define DTLS1_HM_BAD_FRAGMENT                   -2\n# define DTLS1_HM_FRAGMENT_RETRY                 -3\n\n# define DTLS1_CCS_HEADER_LENGTH                  1\n\n# ifdef DTLS1_AD_MISSING_HANDSHAKE_MESSAGE\n#  define DTLS1_AL_HEADER_LENGTH                   7\n# else\n#  define DTLS1_AL_HEADER_LENGTH                   2\n# endif\n\n# ifndef OPENSSL_NO_SSL_INTERN\n\n#  ifndef OPENSSL_NO_SCTP\n#   define DTLS1_SCTP_AUTH_LABEL   \"EXPORTER_DTLS_OVER_SCTP\"\n#  endif\n\n/* Max MTU overhead we know about so far is 40 for IPv6 + 8 for UDP */\n#  define DTLS1_MAX_MTU_OVERHEAD                   48\n\ntypedef struct dtls1_bitmap_st {\n    unsigned long map;          /* track 32 packets on 32-bit systems and 64\n                                 * - on 64-bit systems */\n    unsigned char max_seq_num[8]; /* max record number seen so far, 64-bit\n                                   * value in big-endian encoding */\n} DTLS1_BITMAP;\n\nstruct dtls1_retransmit_state {\n    EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */\n    EVP_MD_CTX *write_hash;     /* used for mac generation */\n#  ifndef OPENSSL_NO_COMP\n    COMP_CTX *compress;         /* compression */\n#  else\n    char *compress;\n#  endif\n    SSL_SESSION *session;\n    unsigned short epoch;\n};\n\nstruct hm_header_st {\n    unsigned char type;\n    unsigned long msg_len;\n    unsigned short seq;\n    unsigned long frag_off;\n    unsigned long frag_len;\n    unsigned int is_ccs;\n    struct dtls1_retransmit_state saved_retransmit_state;\n};\n\nstruct ccs_header_st {\n    unsigned char type;\n    unsigned short seq;\n};\n\nstruct dtls1_timeout_st {\n    /* Number of read timeouts so far */\n    unsigned int read_timeouts;\n    /* Number of write timeouts so far */\n    unsigned int write_timeouts;\n    /* Number of alerts received so far */\n    unsigned int num_alerts;\n};\n\ntypedef struct record_pqueue_st {\n    unsigned short epoch;\n    pqueue q;\n} record_pqueue;\n\ntypedef struct hm_fragment_st {\n    struct hm_header_st msg_header;\n    unsigned char *fragment;\n    unsigned char *reassembly;\n} hm_fragment;\n\ntypedef struct dtls1_state_st {\n    unsigned int send_cookie;\n    unsigned char cookie[DTLS1_COOKIE_LENGTH];\n    unsigned char rcvd_cookie[DTLS1_COOKIE_LENGTH];\n    unsigned int cookie_len;\n    /*\n     * The current data and handshake epoch.  This is initially\n     * undefined, and starts at zero once the initial handshake is\n     * completed\n     */\n    unsigned short r_epoch;\n    unsigned short w_epoch;\n    /* records being received in the current epoch */\n    DTLS1_BITMAP bitmap;\n    /* renegotiation starts a new set of sequence numbers */\n    DTLS1_BITMAP next_bitmap;\n    /* handshake message numbers */\n    unsigned short handshake_write_seq;\n    unsigned short next_handshake_write_seq;\n    unsigned short handshake_read_seq;\n    /* save last sequence number for retransmissions */\n    unsigned char last_write_sequence[8];\n    /* Received handshake records (processed and unprocessed) */\n    record_pqueue unprocessed_rcds;\n    record_pqueue processed_rcds;\n    /* Buffered handshake messages */\n    pqueue buffered_messages;\n    /* Buffered (sent) handshake records */\n    pqueue sent_messages;\n    /*\n     * Buffered application records. Only for records between CCS and\n     * Finished to prevent either protocol violation or unnecessary message\n     * loss.\n     */\n    record_pqueue buffered_app_data;\n    /* Is set when listening for new connections with dtls1_listen() */\n    unsigned int listen;\n    unsigned int link_mtu;      /* max on-the-wire DTLS packet size */\n    unsigned int mtu;           /* max DTLS packet size */\n    struct hm_header_st w_msg_hdr;\n    struct hm_header_st r_msg_hdr;\n    struct dtls1_timeout_st timeout;\n    /*\n     * Indicates when the last handshake msg or heartbeat sent will timeout\n     */\n    struct timeval next_timeout;\n    /* Timeout duration */\n    unsigned short timeout_duration;\n    /*\n     * storage for Alert/Handshake protocol data received but not yet\n     * processed by ssl3_read_bytes:\n     */\n    unsigned char alert_fragment[DTLS1_AL_HEADER_LENGTH];\n    unsigned int alert_fragment_len;\n    unsigned char handshake_fragment[DTLS1_HM_HEADER_LENGTH];\n    unsigned int handshake_fragment_len;\n    unsigned int retransmitting;\n    /*\n     * Set when the handshake is ready to process peer's ChangeCipherSpec message.\n     * Cleared after the message has been processed.\n     */\n    unsigned int change_cipher_spec_ok;\n#  ifndef OPENSSL_NO_SCTP\n    /* used when SSL_ST_XX_FLUSH is entered */\n    int next_state;\n    int shutdown_received;\n#  endif\n} DTLS1_STATE;\n\ntypedef struct dtls1_record_data_st {\n    unsigned char *packet;\n    unsigned int packet_length;\n    SSL3_BUFFER rbuf;\n    SSL3_RECORD rrec;\n#  ifndef OPENSSL_NO_SCTP\n    struct bio_dgram_sctp_rcvinfo recordinfo;\n#  endif\n} DTLS1_RECORD_DATA;\n\n# endif\n\n/* Timeout multipliers (timeout slice is defined in apps/timeouts.h */\n# define DTLS1_TMO_READ_COUNT                      2\n# define DTLS1_TMO_WRITE_COUNT                     2\n\n# define DTLS1_TMO_ALERT_COUNT                     12\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/e_os2.h",
    "content": "/* e_os2.h */\n/* ====================================================================\n * Copyright (c) 1998-2000 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#include <openssl/opensslconf.h>\n\n#ifndef HEADER_E_OS2_H\n# define HEADER_E_OS2_H\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/******************************************************************************\n * Detect operating systems.  This probably needs completing.\n * The result is that at least one OPENSSL_SYS_os macro should be defined.\n * However, if none is defined, Unix is assumed.\n **/\n\n# define OPENSSL_SYS_UNIX\n\n/* ---------------------- Macintosh, before MacOS X ----------------------- */\n# if defined(__MWERKS__) && defined(macintosh) || defined(OPENSSL_SYSNAME_MAC)\n#  undef OPENSSL_SYS_UNIX\n#  define OPENSSL_SYS_MACINTOSH_CLASSIC\n# endif\n\n/* ---------------------- NetWare ----------------------------------------- */\n# if defined(NETWARE) || defined(OPENSSL_SYSNAME_NETWARE)\n#  undef OPENSSL_SYS_UNIX\n#  define OPENSSL_SYS_NETWARE\n# endif\n\n/* --------------------- Microsoft operating systems ---------------------- */\n\n/*\n * Note that MSDOS actually denotes 32-bit environments running on top of\n * MS-DOS, such as DJGPP one.\n */\n# if defined(OPENSSL_SYSNAME_MSDOS)\n#  undef OPENSSL_SYS_UNIX\n#  define OPENSSL_SYS_MSDOS\n# endif\n\n/*\n * For 32 bit environment, there seems to be the CygWin environment and then\n * all the others that try to do the same thing Microsoft does...\n */\n# if defined(OPENSSL_SYSNAME_UWIN)\n#  undef OPENSSL_SYS_UNIX\n#  define OPENSSL_SYS_WIN32_UWIN\n# else\n#  if defined(__CYGWIN__) || defined(OPENSSL_SYSNAME_CYGWIN)\n#   undef OPENSSL_SYS_UNIX\n#   define OPENSSL_SYS_WIN32_CYGWIN\n#  else\n#   if defined(_WIN32) || defined(OPENSSL_SYSNAME_WIN32)\n#    undef OPENSSL_SYS_UNIX\n#    define OPENSSL_SYS_WIN32\n#   endif\n#   if defined(_WIN64) || defined(OPENSSL_SYSNAME_WIN64)\n#    undef OPENSSL_SYS_UNIX\n#    if !defined(OPENSSL_SYS_WIN64)\n#     define OPENSSL_SYS_WIN64\n#    endif\n#   endif\n#   if defined(OPENSSL_SYSNAME_WINNT)\n#    undef OPENSSL_SYS_UNIX\n#    define OPENSSL_SYS_WINNT\n#   endif\n#   if defined(OPENSSL_SYSNAME_WINCE)\n#    undef OPENSSL_SYS_UNIX\n#    define OPENSSL_SYS_WINCE\n#   endif\n#  endif\n# endif\n\n/* Anything that tries to look like Microsoft is \"Windows\" */\n# if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN64) || defined(OPENSSL_SYS_WINNT) || defined(OPENSSL_SYS_WINCE)\n#  undef OPENSSL_SYS_UNIX\n#  define OPENSSL_SYS_WINDOWS\n#  ifndef OPENSSL_SYS_MSDOS\n#   define OPENSSL_SYS_MSDOS\n#  endif\n# endif\n\n/*\n * DLL settings.  This part is a bit tough, because it's up to the\n * application implementor how he or she will link the application, so it\n * requires some macro to be used.\n */\n# ifdef OPENSSL_SYS_WINDOWS\n#  ifndef OPENSSL_OPT_WINDLL\n#   if defined(_WINDLL)         /* This is used when building OpenSSL to\n                                 * indicate that DLL linkage should be used */\n#    define OPENSSL_OPT_WINDLL\n#   endif\n#  endif\n# endif\n\n/* ------------------------------- OpenVMS -------------------------------- */\n# if defined(__VMS) || defined(VMS) || defined(OPENSSL_SYSNAME_VMS)\n#  undef OPENSSL_SYS_UNIX\n#  define OPENSSL_SYS_VMS\n#  if defined(__DECC)\n#   define OPENSSL_SYS_VMS_DECC\n#  elif defined(__DECCXX)\n#   define OPENSSL_SYS_VMS_DECC\n#   define OPENSSL_SYS_VMS_DECCXX\n#  else\n#   define OPENSSL_SYS_VMS_NODECC\n#  endif\n# endif\n\n/* -------------------------------- OS/2 ---------------------------------- */\n# if defined(__EMX__) || defined(__OS2__)\n#  undef OPENSSL_SYS_UNIX\n#  define OPENSSL_SYS_OS2\n# endif\n\n/* -------------------------------- Unix ---------------------------------- */\n# ifdef OPENSSL_SYS_UNIX\n#  if defined(linux) || defined(__linux__) || defined(OPENSSL_SYSNAME_LINUX)\n#   define OPENSSL_SYS_LINUX\n#  endif\n#  ifdef OPENSSL_SYSNAME_MPE\n#   define OPENSSL_SYS_MPE\n#  endif\n#  ifdef OPENSSL_SYSNAME_SNI\n#   define OPENSSL_SYS_SNI\n#  endif\n#  ifdef OPENSSL_SYSNAME_ULTRASPARC\n#   define OPENSSL_SYS_ULTRASPARC\n#  endif\n#  ifdef OPENSSL_SYSNAME_NEWS4\n#   define OPENSSL_SYS_NEWS4\n#  endif\n#  ifdef OPENSSL_SYSNAME_MACOSX\n#   define OPENSSL_SYS_MACOSX\n#  endif\n#  ifdef OPENSSL_SYSNAME_MACOSX_RHAPSODY\n#   define OPENSSL_SYS_MACOSX_RHAPSODY\n#   define OPENSSL_SYS_MACOSX\n#  endif\n#  ifdef OPENSSL_SYSNAME_SUNOS\n#   define OPENSSL_SYS_SUNOS\n#  endif\n#  if defined(_CRAY) || defined(OPENSSL_SYSNAME_CRAY)\n#   define OPENSSL_SYS_CRAY\n#  endif\n#  if defined(_AIX) || defined(OPENSSL_SYSNAME_AIX)\n#   define OPENSSL_SYS_AIX\n#  endif\n# endif\n\n/* -------------------------------- VOS ----------------------------------- */\n# if defined(__VOS__) || defined(OPENSSL_SYSNAME_VOS)\n#  define OPENSSL_SYS_VOS\n#  ifdef __HPPA__\n#   define OPENSSL_SYS_VOS_HPPA\n#  endif\n#  ifdef __IA32__\n#   define OPENSSL_SYS_VOS_IA32\n#  endif\n# endif\n\n/* ------------------------------ VxWorks --------------------------------- */\n# ifdef OPENSSL_SYSNAME_VXWORKS\n#  define OPENSSL_SYS_VXWORKS\n# endif\n\n/* -------------------------------- BeOS ---------------------------------- */\n# if defined(__BEOS__)\n#  define OPENSSL_SYS_BEOS\n#  include <sys/socket.h>\n#  if defined(BONE_VERSION)\n#   define OPENSSL_SYS_BEOS_BONE\n#  else\n#   define OPENSSL_SYS_BEOS_R5\n#  endif\n# endif\n\n/**\n * That's it for OS-specific stuff\n *****************************************************************************/\n\n/* Specials for I/O an exit */\n# ifdef OPENSSL_SYS_MSDOS\n#  define OPENSSL_UNISTD_IO <io.h>\n#  define OPENSSL_DECLARE_EXIT extern void exit(int);\n# else\n#  define OPENSSL_UNISTD_IO OPENSSL_UNISTD\n#  define OPENSSL_DECLARE_EXIT  /* declared in unistd.h */\n# endif\n\n/*-\n * Definitions of OPENSSL_GLOBAL and OPENSSL_EXTERN, to define and declare\n * certain global symbols that, with some compilers under VMS, have to be\n * defined and declared explicitely with globaldef and globalref.\n * Definitions of OPENSSL_EXPORT and OPENSSL_IMPORT, to define and declare\n * DLL exports and imports for compilers under Win32.  These are a little\n * more complicated to use.  Basically, for any library that exports some\n * global variables, the following code must be present in the header file\n * that declares them, before OPENSSL_EXTERN is used:\n *\n * #ifdef SOME_BUILD_FLAG_MACRO\n * # undef OPENSSL_EXTERN\n * # define OPENSSL_EXTERN OPENSSL_EXPORT\n * #endif\n *\n * The default is to have OPENSSL_EXPORT, OPENSSL_IMPORT and OPENSSL_GLOBAL\n * have some generally sensible values, and for OPENSSL_EXTERN to have the\n * value OPENSSL_IMPORT.\n */\n\n# if defined(OPENSSL_SYS_VMS_NODECC)\n#  define OPENSSL_EXPORT globalref\n#  define OPENSSL_IMPORT globalref\n#  define OPENSSL_GLOBAL globaldef\n# elif defined(OPENSSL_SYS_WINDOWS) && defined(OPENSSL_OPT_WINDLL)\n#  define OPENSSL_EXPORT extern __declspec(dllexport)\n#  define OPENSSL_IMPORT extern __declspec(dllimport)\n#  define OPENSSL_GLOBAL\n# else\n#  define OPENSSL_EXPORT extern\n#  define OPENSSL_IMPORT extern\n#  define OPENSSL_GLOBAL\n# endif\n# define OPENSSL_EXTERN OPENSSL_IMPORT\n\n/*-\n * Macros to allow global variables to be reached through function calls when\n * required (if a shared library version requires it, for example.\n * The way it's done allows definitions like this:\n *\n *      // in foobar.c\n *      OPENSSL_IMPLEMENT_GLOBAL(int,foobar,0)\n *      // in foobar.h\n *      OPENSSL_DECLARE_GLOBAL(int,foobar);\n *      #define foobar OPENSSL_GLOBAL_REF(foobar)\n */\n# ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION\n#  define OPENSSL_IMPLEMENT_GLOBAL(type,name,value)                      \\\n        type *_shadow_##name(void)                                      \\\n        { static type _hide_##name=value; return &_hide_##name; }\n#  define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void)\n#  define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name()))\n# else\n#  define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) OPENSSL_GLOBAL type _shadow_##name=value;\n#  define OPENSSL_DECLARE_GLOBAL(type,name) OPENSSL_EXPORT type _shadow_##name\n#  define OPENSSL_GLOBAL_REF(name) _shadow_##name\n# endif\n\n# if defined(OPENSSL_SYS_MACINTOSH_CLASSIC) && macintosh==1 && !defined(MAC_OS_GUSI_SOURCE)\n#  define ossl_ssize_t long\n# endif\n\n# ifdef OPENSSL_SYS_MSDOS\n#  define ossl_ssize_t long\n# endif\n\n# if defined(NeXT) || defined(OPENSSL_SYS_NEWS4) || defined(OPENSSL_SYS_SUNOS)\n#  define ssize_t int\n# endif\n\n# if defined(__ultrix) && !defined(ssize_t)\n#  define ossl_ssize_t int\n# endif\n\n# ifndef ossl_ssize_t\n#  define ossl_ssize_t ssize_t\n# endif\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/ebcdic.h",
    "content": "/* crypto/ebcdic.h */\n\n#ifndef HEADER_EBCDIC_H\n# define HEADER_EBCDIC_H\n\n# include <sys/types.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* Avoid name clashes with other applications */\n# define os_toascii   _openssl_os_toascii\n# define os_toebcdic  _openssl_os_toebcdic\n# define ebcdic2ascii _openssl_ebcdic2ascii\n# define ascii2ebcdic _openssl_ascii2ebcdic\n\nextern const unsigned char os_toascii[256];\nextern const unsigned char os_toebcdic[256];\nvoid *ebcdic2ascii(void *dest, const void *srce, size_t count);\nvoid *ascii2ebcdic(void *dest, const void *srce, size_t count);\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/ec.h",
    "content": "/* crypto/ec/ec.h */\n/*\n * Originally written by Bodo Moeller for the OpenSSL project.\n */\n/**\n * \\file crypto/ec/ec.h Include file for the OpenSSL EC functions\n * \\author Originally written by Bodo Moeller for the OpenSSL project\n */\n/* ====================================================================\n * Copyright (c) 1998-2005 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n/* ====================================================================\n * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.\n *\n * Portions of the attached software (\"Contribution\") are developed by\n * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.\n *\n * The Contribution is licensed pursuant to the OpenSSL open source\n * license provided above.\n *\n * The elliptic curve binary polynomial software is originally written by\n * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems Laboratories.\n *\n */\n\n#ifndef HEADER_EC_H\n# define HEADER_EC_H\n\n# include <openssl/opensslconf.h>\n\n# ifdef OPENSSL_NO_EC\n#  error EC is disabled.\n# endif\n\n# include <openssl/asn1.h>\n# include <openssl/symhacks.h>\n# ifndef OPENSSL_NO_DEPRECATED\n#  include <openssl/bn.h>\n# endif\n\n# ifdef  __cplusplus\nextern \"C\" {\n# elif defined(__SUNPRO_C)\n#  if __SUNPRO_C >= 0x520\n#   pragma error_messages (off,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE)\n#  endif\n# endif\n\n# ifndef OPENSSL_ECC_MAX_FIELD_BITS\n#  define OPENSSL_ECC_MAX_FIELD_BITS 661\n# endif\n\n/** Enum for the point conversion form as defined in X9.62 (ECDSA)\n *  for the encoding of a elliptic curve point (x,y) */\ntypedef enum {\n        /** the point is encoded as z||x, where the octet z specifies\n         *  which solution of the quadratic equation y is  */\n    POINT_CONVERSION_COMPRESSED = 2,\n        /** the point is encoded as z||x||y, where z is the octet 0x04  */\n    POINT_CONVERSION_UNCOMPRESSED = 4,\n        /** the point is encoded as z||x||y, where the octet z specifies\n         *  which solution of the quadratic equation y is  */\n    POINT_CONVERSION_HYBRID = 6\n} point_conversion_form_t;\n\ntypedef struct ec_method_st EC_METHOD;\n\ntypedef struct ec_group_st\n    /*-\n     EC_METHOD *meth;\n     -- field definition\n     -- curve coefficients\n     -- optional generator with associated information (order, cofactor)\n     -- optional extra data (precomputed table for fast computation of multiples of generator)\n     -- ASN1 stuff\n    */\n    EC_GROUP;\n\ntypedef struct ec_point_st EC_POINT;\n\n/********************************************************************/\n/*               EC_METHODs for curves over GF(p)                   */\n/********************************************************************/\n\n/** Returns the basic GFp ec methods which provides the basis for the\n *  optimized methods.\n *  \\return  EC_METHOD object\n */\nconst EC_METHOD *EC_GFp_simple_method(void);\n\n/** Returns GFp methods using montgomery multiplication.\n *  \\return  EC_METHOD object\n */\nconst EC_METHOD *EC_GFp_mont_method(void);\n\n/** Returns GFp methods using optimized methods for NIST recommended curves\n *  \\return  EC_METHOD object\n */\nconst EC_METHOD *EC_GFp_nist_method(void);\n\n# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128\n/** Returns 64-bit optimized methods for nistp224\n *  \\return  EC_METHOD object\n */\nconst EC_METHOD *EC_GFp_nistp224_method(void);\n\n/** Returns 64-bit optimized methods for nistp256\n *  \\return  EC_METHOD object\n */\nconst EC_METHOD *EC_GFp_nistp256_method(void);\n\n/** Returns 64-bit optimized methods for nistp521\n *  \\return  EC_METHOD object\n */\nconst EC_METHOD *EC_GFp_nistp521_method(void);\n# endif\n\n# ifndef OPENSSL_NO_EC2M\n/********************************************************************/\n/*           EC_METHOD for curves over GF(2^m)                      */\n/********************************************************************/\n\n/** Returns the basic GF2m ec method\n *  \\return  EC_METHOD object\n */\nconst EC_METHOD *EC_GF2m_simple_method(void);\n\n# endif\n\n/********************************************************************/\n/*                   EC_GROUP functions                             */\n/********************************************************************/\n\n/** Creates a new EC_GROUP object\n *  \\param   meth  EC_METHOD to use\n *  \\return  newly created EC_GROUP object or NULL in case of an error.\n */\nEC_GROUP *EC_GROUP_new(const EC_METHOD *meth);\n\n/** Frees a EC_GROUP object\n *  \\param  group  EC_GROUP object to be freed.\n */\nvoid EC_GROUP_free(EC_GROUP *group);\n\n/** Clears and frees a EC_GROUP object\n *  \\param  group  EC_GROUP object to be cleared and freed.\n */\nvoid EC_GROUP_clear_free(EC_GROUP *group);\n\n/** Copies EC_GROUP objects. Note: both EC_GROUPs must use the same EC_METHOD.\n *  \\param  dst  destination EC_GROUP object\n *  \\param  src  source EC_GROUP object\n *  \\return 1 on success and 0 if an error occurred.\n */\nint EC_GROUP_copy(EC_GROUP *dst, const EC_GROUP *src);\n\n/** Creates a new EC_GROUP object and copies the copies the content\n *  form src to the newly created EC_KEY object\n *  \\param  src  source EC_GROUP object\n *  \\return newly created EC_GROUP object or NULL in case of an error.\n */\nEC_GROUP *EC_GROUP_dup(const EC_GROUP *src);\n\n/** Returns the EC_METHOD of the EC_GROUP object.\n *  \\param  group  EC_GROUP object\n *  \\return EC_METHOD used in this EC_GROUP object.\n */\nconst EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group);\n\n/** Returns the field type of the EC_METHOD.\n *  \\param  meth  EC_METHOD object\n *  \\return NID of the underlying field type OID.\n */\nint EC_METHOD_get_field_type(const EC_METHOD *meth);\n\n/** Sets the generator and it's order/cofactor of a EC_GROUP object.\n *  \\param  group      EC_GROUP object\n *  \\param  generator  EC_POINT object with the generator.\n *  \\param  order      the order of the group generated by the generator.\n *  \\param  cofactor   the index of the sub-group generated by the generator\n *                     in the group of all points on the elliptic curve.\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator,\n                           const BIGNUM *order, const BIGNUM *cofactor);\n\n/** Returns the generator of a EC_GROUP object.\n *  \\param  group  EC_GROUP object\n *  \\return the currently used generator (possibly NULL).\n */\nconst EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group);\n\n/** Returns the montgomery data for order(Generator)\n *  \\param  group  EC_GROUP object\n *  \\return the currently used generator (possibly NULL).\n*/\nBN_MONT_CTX *EC_GROUP_get_mont_data(const EC_GROUP *group);\n\n/** Gets the order of a EC_GROUP\n *  \\param  group  EC_GROUP object\n *  \\param  order  BIGNUM to which the order is copied\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx);\n\n/** Gets the cofactor of a EC_GROUP\n *  \\param  group     EC_GROUP object\n *  \\param  cofactor  BIGNUM to which the cofactor is copied\n *  \\param  ctx       BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,\n                          BN_CTX *ctx);\n\n/** Sets the name of a EC_GROUP object\n *  \\param  group  EC_GROUP object\n *  \\param  nid    NID of the curve name OID\n */\nvoid EC_GROUP_set_curve_name(EC_GROUP *group, int nid);\n\n/** Returns the curve name of a EC_GROUP object\n *  \\param  group  EC_GROUP object\n *  \\return NID of the curve name OID or 0 if not set.\n */\nint EC_GROUP_get_curve_name(const EC_GROUP *group);\n\nvoid EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag);\nint EC_GROUP_get_asn1_flag(const EC_GROUP *group);\n\nvoid EC_GROUP_set_point_conversion_form(EC_GROUP *group,\n                                        point_conversion_form_t form);\npoint_conversion_form_t EC_GROUP_get_point_conversion_form(const EC_GROUP *);\n\nunsigned char *EC_GROUP_get0_seed(const EC_GROUP *x);\nsize_t EC_GROUP_get_seed_len(const EC_GROUP *);\nsize_t EC_GROUP_set_seed(EC_GROUP *, const unsigned char *, size_t len);\n\n/** Sets the parameter of a ec over GFp defined by y^2 = x^3 + a*x + b\n *  \\param  group  EC_GROUP object\n *  \\param  p      BIGNUM with the prime number\n *  \\param  a      BIGNUM with parameter a of the equation\n *  \\param  b      BIGNUM with parameter b of the equation\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,\n                           const BIGNUM *b, BN_CTX *ctx);\n\n/** Gets the parameter of the ec over GFp defined by y^2 = x^3 + a*x + b\n *  \\param  group  EC_GROUP object\n *  \\param  p      BIGNUM for the prime number\n *  \\param  a      BIGNUM for parameter a of the equation\n *  \\param  b      BIGNUM for parameter b of the equation\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a,\n                           BIGNUM *b, BN_CTX *ctx);\n\n# ifndef OPENSSL_NO_EC2M\n/** Sets the parameter of a ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b\n *  \\param  group  EC_GROUP object\n *  \\param  p      BIGNUM with the polynomial defining the underlying field\n *  \\param  a      BIGNUM with parameter a of the equation\n *  \\param  b      BIGNUM with parameter b of the equation\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,\n                            const BIGNUM *b, BN_CTX *ctx);\n\n/** Gets the parameter of the ec over GF2m defined by y^2 + x*y = x^3 + a*x^2 + b\n *  \\param  group  EC_GROUP object\n *  \\param  p      BIGNUM for the polynomial defining the underlying field\n *  \\param  a      BIGNUM for parameter a of the equation\n *  \\param  b      BIGNUM for parameter b of the equation\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a,\n                            BIGNUM *b, BN_CTX *ctx);\n# endif\n/** Returns the number of bits needed to represent a field element\n *  \\param  group  EC_GROUP object\n *  \\return number of bits needed to represent a field element\n */\nint EC_GROUP_get_degree(const EC_GROUP *group);\n\n/** Checks whether the parameter in the EC_GROUP define a valid ec group\n *  \\param  group  EC_GROUP object\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 if group is a valid ec group and 0 otherwise\n */\nint EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx);\n\n/** Checks whether the discriminant of the elliptic curve is zero or not\n *  \\param  group  EC_GROUP object\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 if the discriminant is not zero and 0 otherwise\n */\nint EC_GROUP_check_discriminant(const EC_GROUP *group, BN_CTX *ctx);\n\n/** Compares two EC_GROUP objects\n *  \\param  a    first EC_GROUP object\n *  \\param  b    second EC_GROUP object\n *  \\param  ctx  BN_CTX object (optional)\n *  \\return 0 if both groups are equal and 1 otherwise\n */\nint EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx);\n\n/*\n * EC_GROUP_new_GF*() calls EC_GROUP_new() and EC_GROUP_set_GF*() after\n * choosing an appropriate EC_METHOD\n */\n\n/** Creates a new EC_GROUP object with the specified parameters defined\n *  over GFp (defined by the equation y^2 = x^3 + a*x + b)\n *  \\param  p    BIGNUM with the prime number\n *  \\param  a    BIGNUM with the parameter a of the equation\n *  \\param  b    BIGNUM with the parameter b of the equation\n *  \\param  ctx  BN_CTX object (optional)\n *  \\return newly created EC_GROUP object with the specified parameters\n */\nEC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a,\n                                 const BIGNUM *b, BN_CTX *ctx);\n# ifndef OPENSSL_NO_EC2M\n/** Creates a new EC_GROUP object with the specified parameters defined\n *  over GF2m (defined by the equation y^2 + x*y = x^3 + a*x^2 + b)\n *  \\param  p    BIGNUM with the polynomial defining the underlying field\n *  \\param  a    BIGNUM with the parameter a of the equation\n *  \\param  b    BIGNUM with the parameter b of the equation\n *  \\param  ctx  BN_CTX object (optional)\n *  \\return newly created EC_GROUP object with the specified parameters\n */\nEC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a,\n                                  const BIGNUM *b, BN_CTX *ctx);\n# endif\n/** Creates a EC_GROUP object with a curve specified by a NID\n *  \\param  nid  NID of the OID of the curve name\n *  \\return newly created EC_GROUP object with specified curve or NULL\n *          if an error occurred\n */\nEC_GROUP *EC_GROUP_new_by_curve_name(int nid);\n\n/********************************************************************/\n/*               handling of internal curves                        */\n/********************************************************************/\n\ntypedef struct {\n    int nid;\n    const char *comment;\n} EC_builtin_curve;\n\n/*\n * EC_builtin_curves(EC_builtin_curve *r, size_t size) returns number of all\n * available curves or zero if a error occurred. In case r ist not zero\n * nitems EC_builtin_curve structures are filled with the data of the first\n * nitems internal groups\n */\nsize_t EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);\n\nconst char *EC_curve_nid2nist(int nid);\nint EC_curve_nist2nid(const char *name);\n\n/********************************************************************/\n/*                    EC_POINT functions                            */\n/********************************************************************/\n\n/** Creates a new EC_POINT object for the specified EC_GROUP\n *  \\param  group  EC_GROUP the underlying EC_GROUP object\n *  \\return newly created EC_POINT object or NULL if an error occurred\n */\nEC_POINT *EC_POINT_new(const EC_GROUP *group);\n\n/** Frees a EC_POINT object\n *  \\param  point  EC_POINT object to be freed\n */\nvoid EC_POINT_free(EC_POINT *point);\n\n/** Clears and frees a EC_POINT object\n *  \\param  point  EC_POINT object to be cleared and freed\n */\nvoid EC_POINT_clear_free(EC_POINT *point);\n\n/** Copies EC_POINT object\n *  \\param  dst  destination EC_POINT object\n *  \\param  src  source EC_POINT object\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);\n\n/** Creates a new EC_POINT object and copies the content of the supplied\n *  EC_POINT\n *  \\param  src    source EC_POINT object\n *  \\param  group  underlying the EC_GROUP object\n *  \\return newly created EC_POINT object or NULL if an error occurred\n */\nEC_POINT *EC_POINT_dup(const EC_POINT *src, const EC_GROUP *group);\n\n/** Returns the EC_METHOD used in EC_POINT object\n *  \\param  point  EC_POINT object\n *  \\return the EC_METHOD used\n */\nconst EC_METHOD *EC_POINT_method_of(const EC_POINT *point);\n\n/** Sets a point to infinity (neutral element)\n *  \\param  group  underlying EC_GROUP object\n *  \\param  point  EC_POINT to set to infinity\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point);\n\n/** Sets the jacobian projective coordinates of a EC_POINT over GFp\n *  \\param  group  underlying EC_GROUP object\n *  \\param  p      EC_POINT object\n *  \\param  x      BIGNUM with the x-coordinate\n *  \\param  y      BIGNUM with the y-coordinate\n *  \\param  z      BIGNUM with the z-coordinate\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_set_Jprojective_coordinates_GFp(const EC_GROUP *group,\n                                             EC_POINT *p, const BIGNUM *x,\n                                             const BIGNUM *y, const BIGNUM *z,\n                                             BN_CTX *ctx);\n\n/** Gets the jacobian projective coordinates of a EC_POINT over GFp\n *  \\param  group  underlying EC_GROUP object\n *  \\param  p      EC_POINT object\n *  \\param  x      BIGNUM for the x-coordinate\n *  \\param  y      BIGNUM for the y-coordinate\n *  \\param  z      BIGNUM for the z-coordinate\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_get_Jprojective_coordinates_GFp(const EC_GROUP *group,\n                                             const EC_POINT *p, BIGNUM *x,\n                                             BIGNUM *y, BIGNUM *z,\n                                             BN_CTX *ctx);\n\n/** Sets the affine coordinates of a EC_POINT over GFp\n *  \\param  group  underlying EC_GROUP object\n *  \\param  p      EC_POINT object\n *  \\param  x      BIGNUM with the x-coordinate\n *  \\param  y      BIGNUM with the y-coordinate\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *p,\n                                        const BIGNUM *x, const BIGNUM *y,\n                                        BN_CTX *ctx);\n\n/** Gets the affine coordinates of a EC_POINT over GFp\n *  \\param  group  underlying EC_GROUP object\n *  \\param  p      EC_POINT object\n *  \\param  x      BIGNUM for the x-coordinate\n *  \\param  y      BIGNUM for the y-coordinate\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group,\n                                        const EC_POINT *p, BIGNUM *x,\n                                        BIGNUM *y, BN_CTX *ctx);\n\n/** Sets the x9.62 compressed coordinates of a EC_POINT over GFp\n *  \\param  group  underlying EC_GROUP object\n *  \\param  p      EC_POINT object\n *  \\param  x      BIGNUM with x-coordinate\n *  \\param  y_bit  integer with the y-Bit (either 0 or 1)\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group,\n                                            EC_POINT *p, const BIGNUM *x,\n                                            int y_bit, BN_CTX *ctx);\n# ifndef OPENSSL_NO_EC2M\n/** Sets the affine coordinates of a EC_POINT over GF2m\n *  \\param  group  underlying EC_GROUP object\n *  \\param  p      EC_POINT object\n *  \\param  x      BIGNUM with the x-coordinate\n *  \\param  y      BIGNUM with the y-coordinate\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_set_affine_coordinates_GF2m(const EC_GROUP *group, EC_POINT *p,\n                                         const BIGNUM *x, const BIGNUM *y,\n                                         BN_CTX *ctx);\n\n/** Gets the affine coordinates of a EC_POINT over GF2m\n *  \\param  group  underlying EC_GROUP object\n *  \\param  p      EC_POINT object\n *  \\param  x      BIGNUM for the x-coordinate\n *  \\param  y      BIGNUM for the y-coordinate\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_get_affine_coordinates_GF2m(const EC_GROUP *group,\n                                         const EC_POINT *p, BIGNUM *x,\n                                         BIGNUM *y, BN_CTX *ctx);\n\n/** Sets the x9.62 compressed coordinates of a EC_POINT over GF2m\n *  \\param  group  underlying EC_GROUP object\n *  \\param  p      EC_POINT object\n *  \\param  x      BIGNUM with x-coordinate\n *  \\param  y_bit  integer with the y-Bit (either 0 or 1)\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP *group,\n                                             EC_POINT *p, const BIGNUM *x,\n                                             int y_bit, BN_CTX *ctx);\n# endif\n/** Encodes a EC_POINT object to a octet string\n *  \\param  group  underlying EC_GROUP object\n *  \\param  p      EC_POINT object\n *  \\param  form   point conversion form\n *  \\param  buf    memory buffer for the result. If NULL the function returns\n *                 required buffer size.\n *  \\param  len    length of the memory buffer\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return the length of the encoded octet string or 0 if an error occurred\n */\nsize_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *p,\n                          point_conversion_form_t form,\n                          unsigned char *buf, size_t len, BN_CTX *ctx);\n\n/** Decodes a EC_POINT from a octet string\n *  \\param  group  underlying EC_GROUP object\n *  \\param  p      EC_POINT object\n *  \\param  buf    memory buffer with the encoded ec point\n *  \\param  len    length of the encoded ec point\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p,\n                       const unsigned char *buf, size_t len, BN_CTX *ctx);\n\n/* other interfaces to point2oct/oct2point: */\nBIGNUM *EC_POINT_point2bn(const EC_GROUP *, const EC_POINT *,\n                          point_conversion_form_t form, BIGNUM *, BN_CTX *);\nEC_POINT *EC_POINT_bn2point(const EC_GROUP *, const BIGNUM *,\n                            EC_POINT *, BN_CTX *);\nchar *EC_POINT_point2hex(const EC_GROUP *, const EC_POINT *,\n                         point_conversion_form_t form, BN_CTX *);\nEC_POINT *EC_POINT_hex2point(const EC_GROUP *, const char *,\n                             EC_POINT *, BN_CTX *);\n\n/********************************************************************/\n/*         functions for doing EC_POINT arithmetic                  */\n/********************************************************************/\n\n/** Computes the sum of two EC_POINT\n *  \\param  group  underlying EC_GROUP object\n *  \\param  r      EC_POINT object for the result (r = a + b)\n *  \\param  a      EC_POINT object with the first summand\n *  \\param  b      EC_POINT object with the second summand\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,\n                 const EC_POINT *b, BN_CTX *ctx);\n\n/** Computes the double of a EC_POINT\n *  \\param  group  underlying EC_GROUP object\n *  \\param  r      EC_POINT object for the result (r = 2 * a)\n *  \\param  a      EC_POINT object\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,\n                 BN_CTX *ctx);\n\n/** Computes the inverse of a EC_POINT\n *  \\param  group  underlying EC_GROUP object\n *  \\param  a      EC_POINT object to be inverted (it's used for the result as well)\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx);\n\n/** Checks whether the point is the neutral element of the group\n *  \\param  group  the underlying EC_GROUP object\n *  \\param  p      EC_POINT object\n *  \\return 1 if the point is the neutral element and 0 otherwise\n */\nint EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p);\n\n/** Checks whether the point is on the curve\n *  \\param  group  underlying EC_GROUP object\n *  \\param  point  EC_POINT object to check\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 if point if on the curve and 0 otherwise\n */\nint EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point,\n                         BN_CTX *ctx);\n\n/** Compares two EC_POINTs\n *  \\param  group  underlying EC_GROUP object\n *  \\param  a      first EC_POINT object\n *  \\param  b      second EC_POINT object\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 0 if both points are equal and a value != 0 otherwise\n */\nint EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b,\n                 BN_CTX *ctx);\n\nint EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx);\nint EC_POINTs_make_affine(const EC_GROUP *group, size_t num,\n                          EC_POINT *points[], BN_CTX *ctx);\n\n/** Computes r = generator * n sum_{i=0}^{num-1} p[i] * m[i]\n *  \\param  group  underlying EC_GROUP object\n *  \\param  r      EC_POINT object for the result\n *  \\param  n      BIGNUM with the multiplier for the group generator (optional)\n *  \\param  num    number futher summands\n *  \\param  p      array of size num of EC_POINT objects\n *  \\param  m      array of size num of BIGNUM objects\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n,\n                  size_t num, const EC_POINT *p[], const BIGNUM *m[],\n                  BN_CTX *ctx);\n\n/** Computes r = generator * n + q * m\n *  \\param  group  underlying EC_GROUP object\n *  \\param  r      EC_POINT object for the result\n *  \\param  n      BIGNUM with the multiplier for the group generator (optional)\n *  \\param  q      EC_POINT object with the first factor of the second summand\n *  \\param  m      BIGNUM with the second factor of the second summand\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n,\n                 const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);\n\n/** Stores multiples of generator for faster point multiplication\n *  \\param  group  EC_GROUP object\n *  \\param  ctx    BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occured\n */\nint EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx);\n\n/** Reports whether a precomputation has been done\n *  \\param  group  EC_GROUP object\n *  \\return 1 if a pre-computation has been done and 0 otherwise\n */\nint EC_GROUP_have_precompute_mult(const EC_GROUP *group);\n\n/********************************************************************/\n/*                       ASN1 stuff                                 */\n/********************************************************************/\n\n/*\n * EC_GROUP_get_basis_type() returns the NID of the basis type used to\n * represent the field elements\n */\nint EC_GROUP_get_basis_type(const EC_GROUP *);\n# ifndef OPENSSL_NO_EC2M\nint EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k);\nint EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,\n                                   unsigned int *k2, unsigned int *k3);\n# endif\n\n# define OPENSSL_EC_NAMED_CURVE  0x001\n\ntypedef struct ecpk_parameters_st ECPKPARAMETERS;\n\nEC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);\nint i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);\n\n# define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)\n# define i2d_ECPKParameters_bio(bp,x) ASN1_i2d_bio_of_const(EC_GROUP,i2d_ECPKParameters,bp,x)\n# define d2i_ECPKParameters_fp(fp,x) (EC_GROUP *)ASN1_d2i_fp(NULL, \\\n                (char *(*)())d2i_ECPKParameters,(fp),(unsigned char **)(x))\n# define i2d_ECPKParameters_fp(fp,x) ASN1_i2d_fp(i2d_ECPKParameters,(fp), \\\n                (unsigned char *)(x))\n\n# ifndef OPENSSL_NO_BIO\nint ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off);\n# endif\n# ifndef OPENSSL_NO_FP_API\nint ECPKParameters_print_fp(FILE *fp, const EC_GROUP *x, int off);\n# endif\n\n/********************************************************************/\n/*                      EC_KEY functions                            */\n/********************************************************************/\n\ntypedef struct ec_key_st EC_KEY;\n\n/* some values for the encoding_flag */\n# define EC_PKEY_NO_PARAMETERS   0x001\n# define EC_PKEY_NO_PUBKEY       0x002\n\n/* some values for the flags field */\n# define EC_FLAG_NON_FIPS_ALLOW  0x1\n# define EC_FLAG_FIPS_CHECKED    0x2\n\n/** Creates a new EC_KEY object.\n *  \\return EC_KEY object or NULL if an error occurred.\n */\nEC_KEY *EC_KEY_new(void);\n\nint EC_KEY_get_flags(const EC_KEY *key);\n\nvoid EC_KEY_set_flags(EC_KEY *key, int flags);\n\nvoid EC_KEY_clear_flags(EC_KEY *key, int flags);\n\n/** Creates a new EC_KEY object using a named curve as underlying\n *  EC_GROUP object.\n *  \\param  nid  NID of the named curve.\n *  \\return EC_KEY object or NULL if an error occurred.\n */\nEC_KEY *EC_KEY_new_by_curve_name(int nid);\n\n/** Frees a EC_KEY object.\n *  \\param  key  EC_KEY object to be freed.\n */\nvoid EC_KEY_free(EC_KEY *key);\n\n/** Copies a EC_KEY object.\n *  \\param  dst  destination EC_KEY object\n *  \\param  src  src EC_KEY object\n *  \\return dst or NULL if an error occurred.\n */\nEC_KEY *EC_KEY_copy(EC_KEY *dst, const EC_KEY *src);\n\n/** Creates a new EC_KEY object and copies the content from src to it.\n *  \\param  src  the source EC_KEY object\n *  \\return newly created EC_KEY object or NULL if an error occurred.\n */\nEC_KEY *EC_KEY_dup(const EC_KEY *src);\n\n/** Increases the internal reference count of a EC_KEY object.\n *  \\param  key  EC_KEY object\n *  \\return 1 on success and 0 if an error occurred.\n */\nint EC_KEY_up_ref(EC_KEY *key);\n\n/** Returns the EC_GROUP object of a EC_KEY object\n *  \\param  key  EC_KEY object\n *  \\return the EC_GROUP object (possibly NULL).\n */\nconst EC_GROUP *EC_KEY_get0_group(const EC_KEY *key);\n\n/** Sets the EC_GROUP of a EC_KEY object.\n *  \\param  key    EC_KEY object\n *  \\param  group  EC_GROUP to use in the EC_KEY object (note: the EC_KEY\n *                 object will use an own copy of the EC_GROUP).\n *  \\return 1 on success and 0 if an error occurred.\n */\nint EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group);\n\n/** Returns the private key of a EC_KEY object.\n *  \\param  key  EC_KEY object\n *  \\return a BIGNUM with the private key (possibly NULL).\n */\nconst BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key);\n\n/** Sets the private key of a EC_KEY object.\n *  \\param  key  EC_KEY object\n *  \\param  prv  BIGNUM with the private key (note: the EC_KEY object\n *               will use an own copy of the BIGNUM).\n *  \\return 1 on success and 0 if an error occurred.\n */\nint EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv);\n\n/** Returns the public key of a EC_KEY object.\n *  \\param  key  the EC_KEY object\n *  \\return a EC_POINT object with the public key (possibly NULL)\n */\nconst EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key);\n\n/** Sets the public key of a EC_KEY object.\n *  \\param  key  EC_KEY object\n *  \\param  pub  EC_POINT object with the public key (note: the EC_KEY object\n *               will use an own copy of the EC_POINT object).\n *  \\return 1 on success and 0 if an error occurred.\n */\nint EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub);\n\nunsigned EC_KEY_get_enc_flags(const EC_KEY *key);\nvoid EC_KEY_set_enc_flags(EC_KEY *eckey, unsigned int flags);\npoint_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);\nvoid EC_KEY_set_conv_form(EC_KEY *eckey, point_conversion_form_t cform);\n/* functions to set/get method specific data  */\nvoid *EC_KEY_get_key_method_data(EC_KEY *key,\n                                 void *(*dup_func) (void *),\n                                 void (*free_func) (void *),\n                                 void (*clear_free_func) (void *));\n/** Sets the key method data of an EC_KEY object, if none has yet been set.\n *  \\param  key              EC_KEY object\n *  \\param  data             opaque data to install.\n *  \\param  dup_func         a function that duplicates |data|.\n *  \\param  free_func        a function that frees |data|.\n *  \\param  clear_free_func  a function that wipes and frees |data|.\n *  \\return the previously set data pointer, or NULL if |data| was inserted.\n */\nvoid *EC_KEY_insert_key_method_data(EC_KEY *key, void *data,\n                                    void *(*dup_func) (void *),\n                                    void (*free_func) (void *),\n                                    void (*clear_free_func) (void *));\n/* wrapper functions for the underlying EC_GROUP object */\nvoid EC_KEY_set_asn1_flag(EC_KEY *eckey, int asn1_flag);\n\n/** Creates a table of pre-computed multiples of the generator to\n *  accelerate further EC_KEY operations.\n *  \\param  key  EC_KEY object\n *  \\param  ctx  BN_CTX object (optional)\n *  \\return 1 on success and 0 if an error occurred.\n */\nint EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx);\n\n/** Creates a new ec private (and optional a new public) key.\n *  \\param  key  EC_KEY object\n *  \\return 1 on success and 0 if an error occurred.\n */\nint EC_KEY_generate_key(EC_KEY *key);\n\n/** Verifies that a private and/or public key is valid.\n *  \\param  key  the EC_KEY object\n *  \\return 1 on success and 0 otherwise.\n */\nint EC_KEY_check_key(const EC_KEY *key);\n\n/** Sets a public key from affine coordindates performing\n *  neccessary NIST PKV tests.\n *  \\param  key  the EC_KEY object\n *  \\param  x    public key x coordinate\n *  \\param  y    public key y coordinate\n *  \\return 1 on success and 0 otherwise.\n */\nint EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x,\n                                             BIGNUM *y);\n\n/********************************************************************/\n/*        de- and encoding functions for SEC1 ECPrivateKey          */\n/********************************************************************/\n\n/** Decodes a private key from a memory buffer.\n *  \\param  key  a pointer to a EC_KEY object which should be used (or NULL)\n *  \\param  in   pointer to memory with the DER encoded private key\n *  \\param  len  length of the DER encoded private key\n *  \\return the decoded private key or NULL if an error occurred.\n */\nEC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len);\n\n/** Encodes a private key object and stores the result in a buffer.\n *  \\param  key  the EC_KEY object to encode\n *  \\param  out  the buffer for the result (if NULL the function returns number\n *               of bytes needed).\n *  \\return 1 on success and 0 if an error occurred.\n */\nint i2d_ECPrivateKey(EC_KEY *key, unsigned char **out);\n\n/********************************************************************/\n/*        de- and encoding functions for EC parameters              */\n/********************************************************************/\n\n/** Decodes ec parameter from a memory buffer.\n *  \\param  key  a pointer to a EC_KEY object which should be used (or NULL)\n *  \\param  in   pointer to memory with the DER encoded ec parameters\n *  \\param  len  length of the DER encoded ec parameters\n *  \\return a EC_KEY object with the decoded parameters or NULL if an error\n *          occurred.\n */\nEC_KEY *d2i_ECParameters(EC_KEY **key, const unsigned char **in, long len);\n\n/** Encodes ec parameter and stores the result in a buffer.\n *  \\param  key  the EC_KEY object with ec paramters to encode\n *  \\param  out  the buffer for the result (if NULL the function returns number\n *               of bytes needed).\n *  \\return 1 on success and 0 if an error occurred.\n */\nint i2d_ECParameters(EC_KEY *key, unsigned char **out);\n\n/********************************************************************/\n/*         de- and encoding functions for EC public key             */\n/*         (octet string, not DER -- hence 'o2i' and 'i2o')         */\n/********************************************************************/\n\n/** Decodes a ec public key from a octet string.\n *  \\param  key  a pointer to a EC_KEY object which should be used\n *  \\param  in   memory buffer with the encoded public key\n *  \\param  len  length of the encoded public key\n *  \\return EC_KEY object with decoded public key or NULL if an error\n *          occurred.\n */\nEC_KEY *o2i_ECPublicKey(EC_KEY **key, const unsigned char **in, long len);\n\n/** Encodes a ec public key in an octet string.\n *  \\param  key  the EC_KEY object with the public key\n *  \\param  out  the buffer for the result (if NULL the function returns number\n *               of bytes needed).\n *  \\return 1 on success and 0 if an error occurred\n */\nint i2o_ECPublicKey(EC_KEY *key, unsigned char **out);\n\n# ifndef OPENSSL_NO_BIO\n/** Prints out the ec parameters on human readable form.\n *  \\param  bp   BIO object to which the information is printed\n *  \\param  key  EC_KEY object\n *  \\return 1 on success and 0 if an error occurred\n */\nint ECParameters_print(BIO *bp, const EC_KEY *key);\n\n/** Prints out the contents of a EC_KEY object\n *  \\param  bp   BIO object to which the information is printed\n *  \\param  key  EC_KEY object\n *  \\param  off  line offset\n *  \\return 1 on success and 0 if an error occurred\n */\nint EC_KEY_print(BIO *bp, const EC_KEY *key, int off);\n\n# endif\n# ifndef OPENSSL_NO_FP_API\n/** Prints out the ec parameters on human readable form.\n *  \\param  fp   file descriptor to which the information is printed\n *  \\param  key  EC_KEY object\n *  \\return 1 on success and 0 if an error occurred\n */\nint ECParameters_print_fp(FILE *fp, const EC_KEY *key);\n\n/** Prints out the contents of a EC_KEY object\n *  \\param  fp   file descriptor to which the information is printed\n *  \\param  key  EC_KEY object\n *  \\param  off  line offset\n *  \\return 1 on success and 0 if an error occurred\n */\nint EC_KEY_print_fp(FILE *fp, const EC_KEY *key, int off);\n\n# endif\n\n# define ECParameters_dup(x) ASN1_dup_of(EC_KEY,i2d_ECParameters,d2i_ECParameters,x)\n\n# ifndef __cplusplus\n#  if defined(__SUNPRO_C)\n#   if __SUNPRO_C >= 0x520\n#    pragma error_messages (default,E_ARRAY_OF_INCOMPLETE_NONAME,E_ARRAY_OF_INCOMPLETE)\n#   endif\n#  endif\n# endif\n\n# define EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \\\n                                EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, \\\n                                EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID, nid, NULL)\n\n# define EVP_PKEY_CTX_set_ec_param_enc(ctx, flag) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \\\n                                EVP_PKEY_OP_PARAMGEN|EVP_PKEY_OP_KEYGEN, \\\n                                EVP_PKEY_CTRL_EC_PARAM_ENC, flag, NULL)\n\n# define EVP_PKEY_CTX_set_ecdh_cofactor_mode(ctx, flag) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_EC_ECDH_COFACTOR, flag, NULL)\n\n# define EVP_PKEY_CTX_get_ecdh_cofactor_mode(ctx) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_EC_ECDH_COFACTOR, -2, NULL)\n\n# define EVP_PKEY_CTX_set_ecdh_kdf_type(ctx, kdf) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_EC_KDF_TYPE, kdf, NULL)\n\n# define EVP_PKEY_CTX_get_ecdh_kdf_type(ctx) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_EC_KDF_TYPE, -2, NULL)\n\n# define EVP_PKEY_CTX_set_ecdh_kdf_md(ctx, md) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_EC_KDF_MD, 0, (void *)md)\n\n# define EVP_PKEY_CTX_get_ecdh_kdf_md(ctx, pmd) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_GET_EC_KDF_MD, 0, (void *)pmd)\n\n# define EVP_PKEY_CTX_set_ecdh_kdf_outlen(ctx, len) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_EC_KDF_OUTLEN, len, NULL)\n\n# define EVP_PKEY_CTX_get_ecdh_kdf_outlen(ctx, plen) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                        EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN, 0, (void *)plen)\n\n# define EVP_PKEY_CTX_set0_ecdh_kdf_ukm(ctx, p, plen) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_EC_KDF_UKM, plen, (void *)p)\n\n# define EVP_PKEY_CTX_get0_ecdh_kdf_ukm(ctx, p) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, \\\n                                EVP_PKEY_OP_DERIVE, \\\n                                EVP_PKEY_CTRL_GET_EC_KDF_UKM, 0, (void *)p)\n\n# define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID             (EVP_PKEY_ALG_CTRL + 1)\n# define EVP_PKEY_CTRL_EC_PARAM_ENC                      (EVP_PKEY_ALG_CTRL + 2)\n# define EVP_PKEY_CTRL_EC_ECDH_COFACTOR                  (EVP_PKEY_ALG_CTRL + 3)\n# define EVP_PKEY_CTRL_EC_KDF_TYPE                       (EVP_PKEY_ALG_CTRL + 4)\n# define EVP_PKEY_CTRL_EC_KDF_MD                         (EVP_PKEY_ALG_CTRL + 5)\n# define EVP_PKEY_CTRL_GET_EC_KDF_MD                     (EVP_PKEY_ALG_CTRL + 6)\n# define EVP_PKEY_CTRL_EC_KDF_OUTLEN                     (EVP_PKEY_ALG_CTRL + 7)\n# define EVP_PKEY_CTRL_GET_EC_KDF_OUTLEN                 (EVP_PKEY_ALG_CTRL + 8)\n# define EVP_PKEY_CTRL_EC_KDF_UKM                        (EVP_PKEY_ALG_CTRL + 9)\n# define EVP_PKEY_CTRL_GET_EC_KDF_UKM                    (EVP_PKEY_ALG_CTRL + 10)\n/* KDF types */\n# define EVP_PKEY_ECDH_KDF_NONE                          1\n# define EVP_PKEY_ECDH_KDF_X9_62                         2\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_EC_strings(void);\n\n/* Error codes for the EC functions. */\n\n/* Function codes. */\n# define EC_F_BN_TO_FELEM                                 224\n# define EC_F_COMPUTE_WNAF                                143\n# define EC_F_D2I_ECPARAMETERS                            144\n# define EC_F_D2I_ECPKPARAMETERS                          145\n# define EC_F_D2I_ECPRIVATEKEY                            146\n# define EC_F_DO_EC_KEY_PRINT                             221\n# define EC_F_ECDH_CMS_DECRYPT                            238\n# define EC_F_ECDH_CMS_SET_SHARED_INFO                    239\n# define EC_F_ECKEY_PARAM2TYPE                            223\n# define EC_F_ECKEY_PARAM_DECODE                          212\n# define EC_F_ECKEY_PRIV_DECODE                           213\n# define EC_F_ECKEY_PRIV_ENCODE                           214\n# define EC_F_ECKEY_PUB_DECODE                            215\n# define EC_F_ECKEY_PUB_ENCODE                            216\n# define EC_F_ECKEY_TYPE2PARAM                            220\n# define EC_F_ECPARAMETERS_PRINT                          147\n# define EC_F_ECPARAMETERS_PRINT_FP                       148\n# define EC_F_ECPKPARAMETERS_PRINT                        149\n# define EC_F_ECPKPARAMETERS_PRINT_FP                     150\n# define EC_F_ECP_NISTZ256_GET_AFFINE                     240\n# define EC_F_ECP_NISTZ256_MULT_PRECOMPUTE                243\n# define EC_F_ECP_NISTZ256_POINTS_MUL                     241\n# define EC_F_ECP_NISTZ256_PRE_COMP_NEW                   244\n# define EC_F_ECP_NISTZ256_SET_WORDS                      245\n# define EC_F_ECP_NISTZ256_WINDOWED_MUL                   242\n# define EC_F_ECP_NIST_MOD_192                            203\n# define EC_F_ECP_NIST_MOD_224                            204\n# define EC_F_ECP_NIST_MOD_256                            205\n# define EC_F_ECP_NIST_MOD_521                            206\n# define EC_F_EC_ASN1_GROUP2CURVE                         153\n# define EC_F_EC_ASN1_GROUP2FIELDID                       154\n# define EC_F_EC_ASN1_GROUP2PARAMETERS                    155\n# define EC_F_EC_ASN1_GROUP2PKPARAMETERS                  156\n# define EC_F_EC_ASN1_PARAMETERS2GROUP                    157\n# define EC_F_EC_ASN1_PKPARAMETERS2GROUP                  158\n# define EC_F_EC_EX_DATA_SET_DATA                         211\n# define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY           208\n# define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT     159\n# define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE              195\n# define EC_F_EC_GF2M_SIMPLE_OCT2POINT                    160\n# define EC_F_EC_GF2M_SIMPLE_POINT2OCT                    161\n# define EC_F_EC_GF2M_SIMPLE_POINT_GET_AFFINE_COORDINATES 162\n# define EC_F_EC_GF2M_SIMPLE_POINT_SET_AFFINE_COORDINATES 163\n# define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES   164\n# define EC_F_EC_GFP_MONT_FIELD_DECODE                    133\n# define EC_F_EC_GFP_MONT_FIELD_ENCODE                    134\n# define EC_F_EC_GFP_MONT_FIELD_MUL                       131\n# define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE                209\n# define EC_F_EC_GFP_MONT_FIELD_SQR                       132\n# define EC_F_EC_GFP_MONT_GROUP_SET_CURVE                 189\n# define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP             135\n# define EC_F_EC_GFP_NISTP224_GROUP_SET_CURVE             225\n# define EC_F_EC_GFP_NISTP224_POINTS_MUL                  228\n# define EC_F_EC_GFP_NISTP224_POINT_GET_AFFINE_COORDINATES 226\n# define EC_F_EC_GFP_NISTP256_GROUP_SET_CURVE             230\n# define EC_F_EC_GFP_NISTP256_POINTS_MUL                  231\n# define EC_F_EC_GFP_NISTP256_POINT_GET_AFFINE_COORDINATES 232\n# define EC_F_EC_GFP_NISTP521_GROUP_SET_CURVE             233\n# define EC_F_EC_GFP_NISTP521_POINTS_MUL                  234\n# define EC_F_EC_GFP_NISTP521_POINT_GET_AFFINE_COORDINATES 235\n# define EC_F_EC_GFP_NIST_FIELD_MUL                       200\n# define EC_F_EC_GFP_NIST_FIELD_SQR                       201\n# define EC_F_EC_GFP_NIST_GROUP_SET_CURVE                 202\n# define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT      165\n# define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE               166\n# define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP           100\n# define EC_F_EC_GFP_SIMPLE_GROUP_SET_GENERATOR           101\n# define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE                   102\n# define EC_F_EC_GFP_SIMPLE_OCT2POINT                     103\n# define EC_F_EC_GFP_SIMPLE_POINT2OCT                     104\n# define EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE            137\n# define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES  167\n# define EC_F_EC_GFP_SIMPLE_POINT_GET_AFFINE_COORDINATES_GFP 105\n# define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES  168\n# define EC_F_EC_GFP_SIMPLE_POINT_SET_AFFINE_COORDINATES_GFP 128\n# define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES    169\n# define EC_F_EC_GFP_SIMPLE_SET_COMPRESSED_COORDINATES_GFP 129\n# define EC_F_EC_GROUP_CHECK                              170\n# define EC_F_EC_GROUP_CHECK_DISCRIMINANT                 171\n# define EC_F_EC_GROUP_COPY                               106\n# define EC_F_EC_GROUP_GET0_GENERATOR                     139\n# define EC_F_EC_GROUP_GET_COFACTOR                       140\n# define EC_F_EC_GROUP_GET_CURVE_GF2M                     172\n# define EC_F_EC_GROUP_GET_CURVE_GFP                      130\n# define EC_F_EC_GROUP_GET_DEGREE                         173\n# define EC_F_EC_GROUP_GET_ORDER                          141\n# define EC_F_EC_GROUP_GET_PENTANOMIAL_BASIS              193\n# define EC_F_EC_GROUP_GET_TRINOMIAL_BASIS                194\n# define EC_F_EC_GROUP_NEW                                108\n# define EC_F_EC_GROUP_NEW_BY_CURVE_NAME                  174\n# define EC_F_EC_GROUP_NEW_FROM_DATA                      175\n# define EC_F_EC_GROUP_PRECOMPUTE_MULT                    142\n# define EC_F_EC_GROUP_SET_CURVE_GF2M                     176\n# define EC_F_EC_GROUP_SET_CURVE_GFP                      109\n# define EC_F_EC_GROUP_SET_EXTRA_DATA                     110\n# define EC_F_EC_GROUP_SET_GENERATOR                      111\n# define EC_F_EC_KEY_CHECK_KEY                            177\n# define EC_F_EC_KEY_COPY                                 178\n# define EC_F_EC_KEY_GENERATE_KEY                         179\n# define EC_F_EC_KEY_NEW                                  182\n# define EC_F_EC_KEY_PRINT                                180\n# define EC_F_EC_KEY_PRINT_FP                             181\n# define EC_F_EC_KEY_SET_PUBLIC_KEY_AFFINE_COORDINATES    229\n# define EC_F_EC_POINTS_MAKE_AFFINE                       136\n# define EC_F_EC_POINT_ADD                                112\n# define EC_F_EC_POINT_CMP                                113\n# define EC_F_EC_POINT_COPY                               114\n# define EC_F_EC_POINT_DBL                                115\n# define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M        183\n# define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP         116\n# define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP    117\n# define EC_F_EC_POINT_INVERT                             210\n# define EC_F_EC_POINT_IS_AT_INFINITY                     118\n# define EC_F_EC_POINT_IS_ON_CURVE                        119\n# define EC_F_EC_POINT_MAKE_AFFINE                        120\n# define EC_F_EC_POINT_MUL                                184\n# define EC_F_EC_POINT_NEW                                121\n# define EC_F_EC_POINT_OCT2POINT                          122\n# define EC_F_EC_POINT_POINT2OCT                          123\n# define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GF2M        185\n# define EC_F_EC_POINT_SET_AFFINE_COORDINATES_GFP         124\n# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GF2M    186\n# define EC_F_EC_POINT_SET_COMPRESSED_COORDINATES_GFP     125\n# define EC_F_EC_POINT_SET_JPROJECTIVE_COORDINATES_GFP    126\n# define EC_F_EC_POINT_SET_TO_INFINITY                    127\n# define EC_F_EC_PRE_COMP_DUP                             207\n# define EC_F_EC_PRE_COMP_NEW                             196\n# define EC_F_EC_WNAF_MUL                                 187\n# define EC_F_EC_WNAF_PRECOMPUTE_MULT                     188\n# define EC_F_I2D_ECPARAMETERS                            190\n# define EC_F_I2D_ECPKPARAMETERS                          191\n# define EC_F_I2D_ECPRIVATEKEY                            192\n# define EC_F_I2O_ECPUBLICKEY                             151\n# define EC_F_NISTP224_PRE_COMP_NEW                       227\n# define EC_F_NISTP256_PRE_COMP_NEW                       236\n# define EC_F_NISTP521_PRE_COMP_NEW                       237\n# define EC_F_O2I_ECPUBLICKEY                             152\n# define EC_F_OLD_EC_PRIV_DECODE                          222\n# define EC_F_PKEY_EC_CTRL                                197\n# define EC_F_PKEY_EC_CTRL_STR                            198\n# define EC_F_PKEY_EC_DERIVE                              217\n# define EC_F_PKEY_EC_KEYGEN                              199\n# define EC_F_PKEY_EC_PARAMGEN                            219\n# define EC_F_PKEY_EC_SIGN                                218\n\n/* Reason codes. */\n# define EC_R_ASN1_ERROR                                  115\n# define EC_R_ASN1_UNKNOWN_FIELD                          116\n# define EC_R_BIGNUM_OUT_OF_RANGE                         144\n# define EC_R_BUFFER_TOO_SMALL                            100\n# define EC_R_COORDINATES_OUT_OF_RANGE                    146\n# define EC_R_D2I_ECPKPARAMETERS_FAILURE                  117\n# define EC_R_DECODE_ERROR                                142\n# define EC_R_DISCRIMINANT_IS_ZERO                        118\n# define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE                119\n# define EC_R_FIELD_TOO_LARGE                             143\n# define EC_R_GF2M_NOT_SUPPORTED                          147\n# define EC_R_GROUP2PKPARAMETERS_FAILURE                  120\n# define EC_R_I2D_ECPKPARAMETERS_FAILURE                  121\n# define EC_R_INCOMPATIBLE_OBJECTS                        101\n# define EC_R_INVALID_ARGUMENT                            112\n# define EC_R_INVALID_COMPRESSED_POINT                    110\n# define EC_R_INVALID_COMPRESSION_BIT                     109\n# define EC_R_INVALID_CURVE                               141\n# define EC_R_INVALID_DIGEST                              151\n# define EC_R_INVALID_DIGEST_TYPE                         138\n# define EC_R_INVALID_ENCODING                            102\n# define EC_R_INVALID_FIELD                               103\n# define EC_R_INVALID_FORM                                104\n# define EC_R_INVALID_GROUP_ORDER                         122\n# define EC_R_INVALID_PENTANOMIAL_BASIS                   132\n# define EC_R_INVALID_PRIVATE_KEY                         123\n# define EC_R_INVALID_TRINOMIAL_BASIS                     137\n# define EC_R_KDF_PARAMETER_ERROR                         148\n# define EC_R_KEYS_NOT_SET                                140\n# define EC_R_MISSING_PARAMETERS                          124\n# define EC_R_MISSING_PRIVATE_KEY                         125\n# define EC_R_NOT_A_NIST_PRIME                            135\n# define EC_R_NOT_A_SUPPORTED_NIST_PRIME                  136\n# define EC_R_NOT_IMPLEMENTED                             126\n# define EC_R_NOT_INITIALIZED                             111\n# define EC_R_NO_FIELD_MOD                                133\n# define EC_R_NO_PARAMETERS_SET                           139\n# define EC_R_PASSED_NULL_PARAMETER                       134\n# define EC_R_PEER_KEY_ERROR                              149\n# define EC_R_PKPARAMETERS2GROUP_FAILURE                  127\n# define EC_R_POINT_AT_INFINITY                           106\n# define EC_R_POINT_IS_NOT_ON_CURVE                       107\n# define EC_R_SHARED_INFO_ERROR                           150\n# define EC_R_SLOT_FULL                                   108\n# define EC_R_UNDEFINED_GENERATOR                         113\n# define EC_R_UNDEFINED_ORDER                             128\n# define EC_R_UNKNOWN_GROUP                               129\n# define EC_R_UNKNOWN_ORDER                               114\n# define EC_R_UNSUPPORTED_FIELD                           131\n# define EC_R_WRONG_CURVE_PARAMETERS                      145\n# define EC_R_WRONG_ORDER                                 130\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/ecdh.h",
    "content": "/* crypto/ecdh/ecdh.h */\n/* ====================================================================\n * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.\n *\n * The Elliptic Curve Public-Key Crypto Library (ECC Code) included\n * herein is developed by SUN MICROSYSTEMS, INC., and is contributed\n * to the OpenSSL project.\n *\n * The ECC Code is licensed pursuant to the OpenSSL open source\n * license provided below.\n *\n * The ECDH software is originally written by Douglas Stebila of\n * Sun Microsystems Laboratories.\n *\n */\n/* ====================================================================\n * Copyright (c) 2000-2002 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n#ifndef HEADER_ECDH_H\n# define HEADER_ECDH_H\n\n# include <openssl/opensslconf.h>\n\n# ifdef OPENSSL_NO_ECDH\n#  error ECDH is disabled.\n# endif\n\n# include <openssl/ec.h>\n# include <openssl/ossl_typ.h>\n# ifndef OPENSSL_NO_DEPRECATED\n#  include <openssl/bn.h>\n# endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n# define EC_FLAG_COFACTOR_ECDH   0x1000\n\nconst ECDH_METHOD *ECDH_OpenSSL(void);\n\nvoid ECDH_set_default_method(const ECDH_METHOD *);\nconst ECDH_METHOD *ECDH_get_default_method(void);\nint ECDH_set_method(EC_KEY *, const ECDH_METHOD *);\n\nint ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key,\n                     EC_KEY *ecdh, void *(*KDF) (const void *in, size_t inlen,\n                                                 void *out, size_t *outlen));\n\nint ECDH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new\n                          *new_func, CRYPTO_EX_dup *dup_func,\n                          CRYPTO_EX_free *free_func);\nint ECDH_set_ex_data(EC_KEY *d, int idx, void *arg);\nvoid *ECDH_get_ex_data(EC_KEY *d, int idx);\n\nint ECDH_KDF_X9_62(unsigned char *out, size_t outlen,\n                   const unsigned char *Z, size_t Zlen,\n                   const unsigned char *sinfo, size_t sinfolen,\n                   const EVP_MD *md);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_ECDH_strings(void);\n\n/* Error codes for the ECDH functions. */\n\n/* Function codes. */\n# define ECDH_F_ECDH_CHECK                                102\n# define ECDH_F_ECDH_COMPUTE_KEY                          100\n# define ECDH_F_ECDH_DATA_NEW_METHOD                      101\n\n/* Reason codes. */\n# define ECDH_R_KDF_FAILED                                102\n# define ECDH_R_NON_FIPS_METHOD                           103\n# define ECDH_R_NO_PRIVATE_VALUE                          100\n# define ECDH_R_POINT_ARITHMETIC_FAILURE                  101\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/ecdsa.h",
    "content": "/* crypto/ecdsa/ecdsa.h */\n/**\n * \\file   crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions\n * \\author Written by Nils Larsch for the OpenSSL project\n */\n/* ====================================================================\n * Copyright (c) 2000-2005 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n#ifndef HEADER_ECDSA_H\n# define HEADER_ECDSA_H\n\n# include <openssl/opensslconf.h>\n\n# ifdef OPENSSL_NO_ECDSA\n#  error ECDSA is disabled.\n# endif\n\n# include <openssl/ec.h>\n# include <openssl/ossl_typ.h>\n# ifndef OPENSSL_NO_DEPRECATED\n#  include <openssl/bn.h>\n# endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct ECDSA_SIG_st {\n    BIGNUM *r;\n    BIGNUM *s;\n} ECDSA_SIG;\n\n/** Allocates and initialize a ECDSA_SIG structure\n *  \\return pointer to a ECDSA_SIG structure or NULL if an error occurred\n */\nECDSA_SIG *ECDSA_SIG_new(void);\n\n/** frees a ECDSA_SIG structure\n *  \\param  sig  pointer to the ECDSA_SIG structure\n */\nvoid ECDSA_SIG_free(ECDSA_SIG *sig);\n\n/** DER encode content of ECDSA_SIG object (note: this function modifies *pp\n *  (*pp += length of the DER encoded signature)).\n *  \\param  sig  pointer to the ECDSA_SIG object\n *  \\param  pp   pointer to a unsigned char pointer for the output or NULL\n *  \\return the length of the DER encoded ECDSA_SIG object or 0\n */\nint i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp);\n\n/** Decodes a DER encoded ECDSA signature (note: this function changes *pp\n *  (*pp += len)).\n *  \\param  sig  pointer to ECDSA_SIG pointer (may be NULL)\n *  \\param  pp   memory buffer with the DER encoded signature\n *  \\param  len  length of the buffer\n *  \\return pointer to the decoded ECDSA_SIG structure (or NULL)\n */\nECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len);\n\n/** Computes the ECDSA signature of the given hash value using\n *  the supplied private key and returns the created signature.\n *  \\param  dgst      pointer to the hash value\n *  \\param  dgst_len  length of the hash value\n *  \\param  eckey     EC_KEY object containing a private EC key\n *  \\return pointer to a ECDSA_SIG structure or NULL if an error occurred\n */\nECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dgst_len,\n                         EC_KEY *eckey);\n\n/** Computes ECDSA signature of a given hash value using the supplied\n *  private key (note: sig must point to ECDSA_size(eckey) bytes of memory).\n *  \\param  dgst     pointer to the hash value to sign\n *  \\param  dgstlen  length of the hash value\n *  \\param  kinv     BIGNUM with a pre-computed inverse k (optional)\n *  \\param  rp       BIGNUM with a pre-computed rp value (optioanl),\n *                   see ECDSA_sign_setup\n *  \\param  eckey    EC_KEY object containing a private EC key\n *  \\return pointer to a ECDSA_SIG structure or NULL if an error occurred\n */\nECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst, int dgstlen,\n                            const BIGNUM *kinv, const BIGNUM *rp,\n                            EC_KEY *eckey);\n\n/** Verifies that the supplied signature is a valid ECDSA\n *  signature of the supplied hash value using the supplied public key.\n *  \\param  dgst      pointer to the hash value\n *  \\param  dgst_len  length of the hash value\n *  \\param  sig       ECDSA_SIG structure\n *  \\param  eckey     EC_KEY object containing a public EC key\n *  \\return 1 if the signature is valid, 0 if the signature is invalid\n *          and -1 on error\n */\nint ECDSA_do_verify(const unsigned char *dgst, int dgst_len,\n                    const ECDSA_SIG *sig, EC_KEY *eckey);\n\nconst ECDSA_METHOD *ECDSA_OpenSSL(void);\n\n/** Sets the default ECDSA method\n *  \\param  meth  new default ECDSA_METHOD\n */\nvoid ECDSA_set_default_method(const ECDSA_METHOD *meth);\n\n/** Returns the default ECDSA method\n *  \\return pointer to ECDSA_METHOD structure containing the default method\n */\nconst ECDSA_METHOD *ECDSA_get_default_method(void);\n\n/** Sets method to be used for the ECDSA operations\n *  \\param  eckey  EC_KEY object\n *  \\param  meth   new method\n *  \\return 1 on success and 0 otherwise\n */\nint ECDSA_set_method(EC_KEY *eckey, const ECDSA_METHOD *meth);\n\n/** Returns the maximum length of the DER encoded signature\n *  \\param  eckey  EC_KEY object\n *  \\return numbers of bytes required for the DER encoded signature\n */\nint ECDSA_size(const EC_KEY *eckey);\n\n/** Precompute parts of the signing operation\n *  \\param  eckey  EC_KEY object containing a private EC key\n *  \\param  ctx    BN_CTX object (optional)\n *  \\param  kinv   BIGNUM pointer for the inverse of k\n *  \\param  rp     BIGNUM pointer for x coordinate of k * generator\n *  \\return 1 on success and 0 otherwise\n */\nint ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx, BIGNUM **kinv, BIGNUM **rp);\n\n/** Computes ECDSA signature of a given hash value using the supplied\n *  private key (note: sig must point to ECDSA_size(eckey) bytes of memory).\n *  \\param  type     this parameter is ignored\n *  \\param  dgst     pointer to the hash value to sign\n *  \\param  dgstlen  length of the hash value\n *  \\param  sig      memory for the DER encoded created signature\n *  \\param  siglen   pointer to the length of the returned signature\n *  \\param  eckey    EC_KEY object containing a private EC key\n *  \\return 1 on success and 0 otherwise\n */\nint ECDSA_sign(int type, const unsigned char *dgst, int dgstlen,\n               unsigned char *sig, unsigned int *siglen, EC_KEY *eckey);\n\n/** Computes ECDSA signature of a given hash value using the supplied\n *  private key (note: sig must point to ECDSA_size(eckey) bytes of memory).\n *  \\param  type     this parameter is ignored\n *  \\param  dgst     pointer to the hash value to sign\n *  \\param  dgstlen  length of the hash value\n *  \\param  sig      buffer to hold the DER encoded signature\n *  \\param  siglen   pointer to the length of the returned signature\n *  \\param  kinv     BIGNUM with a pre-computed inverse k (optional)\n *  \\param  rp       BIGNUM with a pre-computed rp value (optioanl),\n *                   see ECDSA_sign_setup\n *  \\param  eckey    EC_KEY object containing a private EC key\n *  \\return 1 on success and 0 otherwise\n */\nint ECDSA_sign_ex(int type, const unsigned char *dgst, int dgstlen,\n                  unsigned char *sig, unsigned int *siglen,\n                  const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey);\n\n/** Verifies that the given signature is valid ECDSA signature\n *  of the supplied hash value using the specified public key.\n *  \\param  type     this parameter is ignored\n *  \\param  dgst     pointer to the hash value\n *  \\param  dgstlen  length of the hash value\n *  \\param  sig      pointer to the DER encoded signature\n *  \\param  siglen   length of the DER encoded signature\n *  \\param  eckey    EC_KEY object containing a public EC key\n *  \\return 1 if the signature is valid, 0 if the signature is invalid\n *          and -1 on error\n */\nint ECDSA_verify(int type, const unsigned char *dgst, int dgstlen,\n                 const unsigned char *sig, int siglen, EC_KEY *eckey);\n\n/* the standard ex_data functions */\nint ECDSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new\n                           *new_func, CRYPTO_EX_dup *dup_func,\n                           CRYPTO_EX_free *free_func);\nint ECDSA_set_ex_data(EC_KEY *d, int idx, void *arg);\nvoid *ECDSA_get_ex_data(EC_KEY *d, int idx);\n\n/** Allocates and initialize a ECDSA_METHOD structure\n *  \\param ecdsa_method pointer to ECDSA_METHOD to copy.  (May be NULL)\n *  \\return pointer to a ECDSA_METHOD structure or NULL if an error occurred\n */\n\nECDSA_METHOD *ECDSA_METHOD_new(const ECDSA_METHOD *ecdsa_method);\n\n/** frees a ECDSA_METHOD structure\n *  \\param  ecdsa_method  pointer to the ECDSA_METHOD structure\n */\nvoid ECDSA_METHOD_free(ECDSA_METHOD *ecdsa_method);\n\n/**  Sets application specific data in the ECDSA_METHOD\n *   \\param  ecdsa_method pointer to existing ECDSA_METHOD\n *   \\param  app application specific data to set\n */\n\nvoid ECDSA_METHOD_set_app_data(ECDSA_METHOD *ecdsa_method, void *app);\n\n/** Returns application specific data from a ECDSA_METHOD structure\n *  \\param ecdsa_method pointer to ECDSA_METHOD structure\n *  \\return pointer to application specific data.\n */\n\nvoid *ECDSA_METHOD_get_app_data(ECDSA_METHOD *ecdsa_method);\n\n/**  Set the ECDSA_do_sign function in the ECDSA_METHOD\n *   \\param  ecdsa_method  pointer to existing ECDSA_METHOD\n *   \\param  ecdsa_do_sign a funtion of type ECDSA_do_sign\n */\n\nvoid ECDSA_METHOD_set_sign(ECDSA_METHOD *ecdsa_method,\n                           ECDSA_SIG *(*ecdsa_do_sign) (const unsigned char\n                                                        *dgst, int dgst_len,\n                                                        const BIGNUM *inv,\n                                                        const BIGNUM *rp,\n                                                        EC_KEY *eckey));\n\n/**  Set the  ECDSA_sign_setup function in the ECDSA_METHOD\n *   \\param  ecdsa_method  pointer to existing ECDSA_METHOD\n *   \\param  ecdsa_sign_setup a funtion of type ECDSA_sign_setup\n */\n\nvoid ECDSA_METHOD_set_sign_setup(ECDSA_METHOD *ecdsa_method,\n                                 int (*ecdsa_sign_setup) (EC_KEY *eckey,\n                                                          BN_CTX *ctx,\n                                                          BIGNUM **kinv,\n                                                          BIGNUM **r));\n\n/**  Set the ECDSA_do_verify function in the ECDSA_METHOD\n *   \\param  ecdsa_method  pointer to existing ECDSA_METHOD\n *   \\param  ecdsa_do_verify a funtion of type ECDSA_do_verify\n */\n\nvoid ECDSA_METHOD_set_verify(ECDSA_METHOD *ecdsa_method,\n                             int (*ecdsa_do_verify) (const unsigned char\n                                                     *dgst, int dgst_len,\n                                                     const ECDSA_SIG *sig,\n                                                     EC_KEY *eckey));\n\nvoid ECDSA_METHOD_set_flags(ECDSA_METHOD *ecdsa_method, int flags);\n\n/**  Set the flags field in the ECDSA_METHOD\n *   \\param  ecdsa_method  pointer to existing ECDSA_METHOD\n *   \\param  flags flags value to set\n */\n\nvoid ECDSA_METHOD_set_name(ECDSA_METHOD *ecdsa_method, char *name);\n\n/**  Set the name field in the ECDSA_METHOD\n *   \\param  ecdsa_method  pointer to existing ECDSA_METHOD\n *   \\param  name name to set\n */\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_ECDSA_strings(void);\n\n/* Error codes for the ECDSA functions. */\n\n/* Function codes. */\n# define ECDSA_F_ECDSA_CHECK                              104\n# define ECDSA_F_ECDSA_DATA_NEW_METHOD                    100\n# define ECDSA_F_ECDSA_DO_SIGN                            101\n# define ECDSA_F_ECDSA_DO_VERIFY                          102\n# define ECDSA_F_ECDSA_METHOD_NEW                         105\n# define ECDSA_F_ECDSA_SIGN_SETUP                         103\n\n/* Reason codes. */\n# define ECDSA_R_BAD_SIGNATURE                            100\n# define ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE              101\n# define ECDSA_R_ERR_EC_LIB                               102\n# define ECDSA_R_MISSING_PARAMETERS                       103\n# define ECDSA_R_NEED_NEW_SETUP_VALUES                    106\n# define ECDSA_R_NON_FIPS_METHOD                          107\n# define ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED          104\n# define ECDSA_R_SIGNATURE_MALLOC_FAILED                  105\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/engine.h",
    "content": "/* openssl/engine.h */\n/*\n * Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL project\n * 2000.\n */\n/* ====================================================================\n * Copyright (c) 1999-2004 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n/* ====================================================================\n * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.\n * ECDH support in OpenSSL originally developed by\n * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.\n */\n\n#ifndef HEADER_ENGINE_H\n# define HEADER_ENGINE_H\n\n# include <openssl/opensslconf.h>\n\n# ifdef OPENSSL_NO_ENGINE\n#  error ENGINE is disabled.\n# endif\n\n# ifndef OPENSSL_NO_DEPRECATED\n#  include <openssl/bn.h>\n#  ifndef OPENSSL_NO_RSA\n#   include <openssl/rsa.h>\n#  endif\n#  ifndef OPENSSL_NO_DSA\n#   include <openssl/dsa.h>\n#  endif\n#  ifndef OPENSSL_NO_DH\n#   include <openssl/dh.h>\n#  endif\n#  ifndef OPENSSL_NO_ECDH\n#   include <openssl/ecdh.h>\n#  endif\n#  ifndef OPENSSL_NO_ECDSA\n#   include <openssl/ecdsa.h>\n#  endif\n#  include <openssl/rand.h>\n#  include <openssl/ui.h>\n#  include <openssl/err.h>\n# endif\n\n# include <openssl/ossl_typ.h>\n# include <openssl/symhacks.h>\n\n# include <openssl/x509.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * These flags are used to control combinations of algorithm (methods) by\n * bitwise \"OR\"ing.\n */\n# define ENGINE_METHOD_RSA               (unsigned int)0x0001\n# define ENGINE_METHOD_DSA               (unsigned int)0x0002\n# define ENGINE_METHOD_DH                (unsigned int)0x0004\n# define ENGINE_METHOD_RAND              (unsigned int)0x0008\n# define ENGINE_METHOD_ECDH              (unsigned int)0x0010\n# define ENGINE_METHOD_ECDSA             (unsigned int)0x0020\n# define ENGINE_METHOD_CIPHERS           (unsigned int)0x0040\n# define ENGINE_METHOD_DIGESTS           (unsigned int)0x0080\n# define ENGINE_METHOD_STORE             (unsigned int)0x0100\n# define ENGINE_METHOD_PKEY_METHS        (unsigned int)0x0200\n# define ENGINE_METHOD_PKEY_ASN1_METHS   (unsigned int)0x0400\n/* Obvious all-or-nothing cases. */\n# define ENGINE_METHOD_ALL               (unsigned int)0xFFFF\n# define ENGINE_METHOD_NONE              (unsigned int)0x0000\n\n/*\n * This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used\n * internally to control registration of ENGINE implementations, and can be\n * set by ENGINE_set_table_flags(). The \"NOINIT\" flag prevents attempts to\n * initialise registered ENGINEs if they are not already initialised.\n */\n# define ENGINE_TABLE_FLAG_NOINIT        (unsigned int)0x0001\n\n/* ENGINE flags that can be set by ENGINE_set_flags(). */\n/* Not used */\n/* #define ENGINE_FLAGS_MALLOCED        0x0001 */\n\n/*\n * This flag is for ENGINEs that wish to handle the various 'CMD'-related\n * control commands on their own. Without this flag, ENGINE_ctrl() handles\n * these control commands on behalf of the ENGINE using their \"cmd_defns\"\n * data.\n */\n# define ENGINE_FLAGS_MANUAL_CMD_CTRL    (int)0x0002\n\n/*\n * This flag is for ENGINEs who return new duplicate structures when found\n * via \"ENGINE_by_id()\". When an ENGINE must store state (eg. if\n * ENGINE_ctrl() commands are called in sequence as part of some stateful\n * process like key-generation setup and execution), it can set this flag -\n * then each attempt to obtain the ENGINE will result in it being copied into\n * a new structure. Normally, ENGINEs don't declare this flag so\n * ENGINE_by_id() just increments the existing ENGINE's structural reference\n * count.\n */\n# define ENGINE_FLAGS_BY_ID_COPY         (int)0x0004\n\n/*\n * This flag if for an ENGINE that does not want its methods registered as\n * part of ENGINE_register_all_complete() for example if the methods are not\n * usable as default methods.\n */\n\n# define ENGINE_FLAGS_NO_REGISTER_ALL    (int)0x0008\n\n/*\n * ENGINEs can support their own command types, and these flags are used in\n * ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input\n * each command expects. Currently only numeric and string input is\n * supported. If a control command supports none of the _NUMERIC, _STRING, or\n * _NO_INPUT options, then it is regarded as an \"internal\" control command -\n * and not for use in config setting situations. As such, they're not\n * available to the ENGINE_ctrl_cmd_string() function, only raw ENGINE_ctrl()\n * access. Changes to this list of 'command types' should be reflected\n * carefully in ENGINE_cmd_is_executable() and ENGINE_ctrl_cmd_string().\n */\n\n/* accepts a 'long' input value (3rd parameter to ENGINE_ctrl) */\n# define ENGINE_CMD_FLAG_NUMERIC         (unsigned int)0x0001\n/*\n * accepts string input (cast from 'void*' to 'const char *', 4th parameter\n * to ENGINE_ctrl)\n */\n# define ENGINE_CMD_FLAG_STRING          (unsigned int)0x0002\n/*\n * Indicates that the control command takes *no* input. Ie. the control\n * command is unparameterised.\n */\n# define ENGINE_CMD_FLAG_NO_INPUT        (unsigned int)0x0004\n/*\n * Indicates that the control command is internal. This control command won't\n * be shown in any output, and is only usable through the ENGINE_ctrl_cmd()\n * function.\n */\n# define ENGINE_CMD_FLAG_INTERNAL        (unsigned int)0x0008\n\n/*\n * NB: These 3 control commands are deprecated and should not be used.\n * ENGINEs relying on these commands should compile conditional support for\n * compatibility (eg. if these symbols are defined) but should also migrate\n * the same functionality to their own ENGINE-specific control functions that\n * can be \"discovered\" by calling applications. The fact these control\n * commands wouldn't be \"executable\" (ie. usable by text-based config)\n * doesn't change the fact that application code can find and use them\n * without requiring per-ENGINE hacking.\n */\n\n/*\n * These flags are used to tell the ctrl function what should be done. All\n * command numbers are shared between all engines, even if some don't make\n * sense to some engines.  In such a case, they do nothing but return the\n * error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED.\n */\n# define ENGINE_CTRL_SET_LOGSTREAM               1\n# define ENGINE_CTRL_SET_PASSWORD_CALLBACK       2\n# define ENGINE_CTRL_HUP                         3/* Close and reinitialise\n                                                   * any handles/connections\n                                                   * etc. */\n# define ENGINE_CTRL_SET_USER_INTERFACE          4/* Alternative to callback */\n# define ENGINE_CTRL_SET_CALLBACK_DATA           5/* User-specific data, used\n                                                   * when calling the password\n                                                   * callback and the user\n                                                   * interface */\n# define ENGINE_CTRL_LOAD_CONFIGURATION          6/* Load a configuration,\n                                                   * given a string that\n                                                   * represents a file name\n                                                   * or so */\n# define ENGINE_CTRL_LOAD_SECTION                7/* Load data from a given\n                                                   * section in the already\n                                                   * loaded configuration */\n\n/*\n * These control commands allow an application to deal with an arbitrary\n * engine in a dynamic way. Warn: Negative return values indicate errors FOR\n * THESE COMMANDS because zero is used to indicate 'end-of-list'. Other\n * commands, including ENGINE-specific command types, return zero for an\n * error. An ENGINE can choose to implement these ctrl functions, and can\n * internally manage things however it chooses - it does so by setting the\n * ENGINE_FLAGS_MANUAL_CMD_CTRL flag (using ENGINE_set_flags()). Otherwise\n * the ENGINE_ctrl() code handles this on the ENGINE's behalf using the\n * cmd_defns data (set using ENGINE_set_cmd_defns()). This means an ENGINE's\n * ctrl() handler need only implement its own commands - the above \"meta\"\n * commands will be taken care of.\n */\n\n/*\n * Returns non-zero if the supplied ENGINE has a ctrl() handler. If \"not\",\n * then all the remaining control commands will return failure, so it is\n * worth checking this first if the caller is trying to \"discover\" the\n * engine's capabilities and doesn't want errors generated unnecessarily.\n */\n# define ENGINE_CTRL_HAS_CTRL_FUNCTION           10\n/*\n * Returns a positive command number for the first command supported by the\n * engine. Returns zero if no ctrl commands are supported.\n */\n# define ENGINE_CTRL_GET_FIRST_CMD_TYPE          11\n/*\n * The 'long' argument specifies a command implemented by the engine, and the\n * return value is the next command supported, or zero if there are no more.\n */\n# define ENGINE_CTRL_GET_NEXT_CMD_TYPE           12\n/*\n * The 'void*' argument is a command name (cast from 'const char *'), and the\n * return value is the command that corresponds to it.\n */\n# define ENGINE_CTRL_GET_CMD_FROM_NAME           13\n/*\n * The next two allow a command to be converted into its corresponding string\n * form. In each case, the 'long' argument supplies the command. In the\n * NAME_LEN case, the return value is the length of the command name (not\n * counting a trailing EOL). In the NAME case, the 'void*' argument must be a\n * string buffer large enough, and it will be populated with the name of the\n * command (WITH a trailing EOL).\n */\n# define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD       14\n# define ENGINE_CTRL_GET_NAME_FROM_CMD           15\n/* The next two are similar but give a \"short description\" of a command. */\n# define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD       16\n# define ENGINE_CTRL_GET_DESC_FROM_CMD           17\n/*\n * With this command, the return value is the OR'd combination of\n * ENGINE_CMD_FLAG_*** values that indicate what kind of input a given\n * engine-specific ctrl command expects.\n */\n# define ENGINE_CTRL_GET_CMD_FLAGS               18\n\n/*\n * ENGINE implementations should start the numbering of their own control\n * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc).\n */\n# define ENGINE_CMD_BASE                         200\n\n/*\n * NB: These 2 nCipher \"chil\" control commands are deprecated, and their\n * functionality is now available through ENGINE-specific control commands\n * (exposed through the above-mentioned 'CMD'-handling). Code using these 2\n * commands should be migrated to the more general command handling before\n * these are removed.\n */\n\n/* Flags specific to the nCipher \"chil\" engine */\n# define ENGINE_CTRL_CHIL_SET_FORKCHECK          100\n        /*\n         * Depending on the value of the (long)i argument, this sets or\n         * unsets the SimpleForkCheck flag in the CHIL API to enable or\n         * disable checking and workarounds for applications that fork().\n         */\n# define ENGINE_CTRL_CHIL_NO_LOCKING             101\n        /*\n         * This prevents the initialisation function from providing mutex\n         * callbacks to the nCipher library.\n         */\n\n/*\n * If an ENGINE supports its own specific control commands and wishes the\n * framework to handle the above 'ENGINE_CMD_***'-manipulation commands on\n * its behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN\n * entries to ENGINE_set_cmd_defns(). It should also implement a ctrl()\n * handler that supports the stated commands (ie. the \"cmd_num\" entries as\n * described by the array). NB: The array must be ordered in increasing order\n * of cmd_num. \"null-terminated\" means that the last ENGINE_CMD_DEFN element\n * has cmd_num set to zero and/or cmd_name set to NULL.\n */\ntypedef struct ENGINE_CMD_DEFN_st {\n    unsigned int cmd_num;       /* The command number */\n    const char *cmd_name;       /* The command name itself */\n    const char *cmd_desc;       /* A short description of the command */\n    unsigned int cmd_flags;     /* The input the command expects */\n} ENGINE_CMD_DEFN;\n\n/* Generic function pointer */\ntypedef int (*ENGINE_GEN_FUNC_PTR) (void);\n/* Generic function pointer taking no arguments */\ntypedef int (*ENGINE_GEN_INT_FUNC_PTR) (ENGINE *);\n/* Specific control function pointer */\ntypedef int (*ENGINE_CTRL_FUNC_PTR) (ENGINE *, int, long, void *,\n                                     void (*f) (void));\n/* Generic load_key function pointer */\ntypedef EVP_PKEY *(*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,\n                                         UI_METHOD *ui_method,\n                                         void *callback_data);\ntypedef int (*ENGINE_SSL_CLIENT_CERT_PTR) (ENGINE *, SSL *ssl,\n                                           STACK_OF(X509_NAME) *ca_dn,\n                                           X509 **pcert, EVP_PKEY **pkey,\n                                           STACK_OF(X509) **pother,\n                                           UI_METHOD *ui_method,\n                                           void *callback_data);\n/*-\n * These callback types are for an ENGINE's handler for cipher and digest logic.\n * These handlers have these prototypes;\n *   int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid);\n *   int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid);\n * Looking at how to implement these handlers in the case of cipher support, if\n * the framework wants the EVP_CIPHER for 'nid', it will call;\n *   foo(e, &p_evp_cipher, NULL, nid);    (return zero for failure)\n * If the framework wants a list of supported 'nid's, it will call;\n *   foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error)\n */\n/*\n * Returns to a pointer to the array of supported cipher 'nid's. If the\n * second parameter is non-NULL it is set to the size of the returned array.\n */\ntypedef int (*ENGINE_CIPHERS_PTR) (ENGINE *, const EVP_CIPHER **,\n                                   const int **, int);\ntypedef int (*ENGINE_DIGESTS_PTR) (ENGINE *, const EVP_MD **, const int **,\n                                   int);\ntypedef int (*ENGINE_PKEY_METHS_PTR) (ENGINE *, EVP_PKEY_METHOD **,\n                                      const int **, int);\ntypedef int (*ENGINE_PKEY_ASN1_METHS_PTR) (ENGINE *, EVP_PKEY_ASN1_METHOD **,\n                                           const int **, int);\n/*\n * STRUCTURE functions ... all of these functions deal with pointers to\n * ENGINE structures where the pointers have a \"structural reference\". This\n * means that their reference is to allowed access to the structure but it\n * does not imply that the structure is functional. To simply increment or\n * decrement the structural reference count, use ENGINE_by_id and\n * ENGINE_free. NB: This is not required when iterating using ENGINE_get_next\n * as it will automatically decrement the structural reference count of the\n * \"current\" ENGINE and increment the structural reference count of the\n * ENGINE it returns (unless it is NULL).\n */\n\n/* Get the first/last \"ENGINE\" type available. */\nENGINE *ENGINE_get_first(void);\nENGINE *ENGINE_get_last(void);\n/* Iterate to the next/previous \"ENGINE\" type (NULL = end of the list). */\nENGINE *ENGINE_get_next(ENGINE *e);\nENGINE *ENGINE_get_prev(ENGINE *e);\n/* Add another \"ENGINE\" type into the array. */\nint ENGINE_add(ENGINE *e);\n/* Remove an existing \"ENGINE\" type from the array. */\nint ENGINE_remove(ENGINE *e);\n/* Retrieve an engine from the list by its unique \"id\" value. */\nENGINE *ENGINE_by_id(const char *id);\n/* Add all the built-in engines. */\nvoid ENGINE_load_openssl(void);\nvoid ENGINE_load_dynamic(void);\n# ifndef OPENSSL_NO_STATIC_ENGINE\nvoid ENGINE_load_4758cca(void);\nvoid ENGINE_load_aep(void);\nvoid ENGINE_load_atalla(void);\nvoid ENGINE_load_chil(void);\nvoid ENGINE_load_cswift(void);\nvoid ENGINE_load_nuron(void);\nvoid ENGINE_load_sureware(void);\nvoid ENGINE_load_ubsec(void);\nvoid ENGINE_load_padlock(void);\nvoid ENGINE_load_capi(void);\n#  ifndef OPENSSL_NO_GMP\nvoid ENGINE_load_gmp(void);\n#  endif\n#  ifndef OPENSSL_NO_GOST\nvoid ENGINE_load_gost(void);\n#  endif\n# endif\nvoid ENGINE_load_cryptodev(void);\nvoid ENGINE_load_rdrand(void);\nvoid ENGINE_load_builtin_engines(void);\n\n/*\n * Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation\n * \"registry\" handling.\n */\nunsigned int ENGINE_get_table_flags(void);\nvoid ENGINE_set_table_flags(unsigned int flags);\n\n/*- Manage registration of ENGINEs per \"table\". For each type, there are 3\n * functions;\n *   ENGINE_register_***(e) - registers the implementation from 'e' (if it has one)\n *   ENGINE_unregister_***(e) - unregister the implementation from 'e'\n *   ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list\n * Cleanup is automatically registered from each table when required, so\n * ENGINE_cleanup() will reverse any \"register\" operations.\n */\n\nint ENGINE_register_RSA(ENGINE *e);\nvoid ENGINE_unregister_RSA(ENGINE *e);\nvoid ENGINE_register_all_RSA(void);\n\nint ENGINE_register_DSA(ENGINE *e);\nvoid ENGINE_unregister_DSA(ENGINE *e);\nvoid ENGINE_register_all_DSA(void);\n\nint ENGINE_register_ECDH(ENGINE *e);\nvoid ENGINE_unregister_ECDH(ENGINE *e);\nvoid ENGINE_register_all_ECDH(void);\n\nint ENGINE_register_ECDSA(ENGINE *e);\nvoid ENGINE_unregister_ECDSA(ENGINE *e);\nvoid ENGINE_register_all_ECDSA(void);\n\nint ENGINE_register_DH(ENGINE *e);\nvoid ENGINE_unregister_DH(ENGINE *e);\nvoid ENGINE_register_all_DH(void);\n\nint ENGINE_register_RAND(ENGINE *e);\nvoid ENGINE_unregister_RAND(ENGINE *e);\nvoid ENGINE_register_all_RAND(void);\n\nint ENGINE_register_STORE(ENGINE *e);\nvoid ENGINE_unregister_STORE(ENGINE *e);\nvoid ENGINE_register_all_STORE(void);\n\nint ENGINE_register_ciphers(ENGINE *e);\nvoid ENGINE_unregister_ciphers(ENGINE *e);\nvoid ENGINE_register_all_ciphers(void);\n\nint ENGINE_register_digests(ENGINE *e);\nvoid ENGINE_unregister_digests(ENGINE *e);\nvoid ENGINE_register_all_digests(void);\n\nint ENGINE_register_pkey_meths(ENGINE *e);\nvoid ENGINE_unregister_pkey_meths(ENGINE *e);\nvoid ENGINE_register_all_pkey_meths(void);\n\nint ENGINE_register_pkey_asn1_meths(ENGINE *e);\nvoid ENGINE_unregister_pkey_asn1_meths(ENGINE *e);\nvoid ENGINE_register_all_pkey_asn1_meths(void);\n\n/*\n * These functions register all support from the above categories. Note, use\n * of these functions can result in static linkage of code your application\n * may not need. If you only need a subset of functionality, consider using\n * more selective initialisation.\n */\nint ENGINE_register_complete(ENGINE *e);\nint ENGINE_register_all_complete(void);\n\n/*\n * Send parametrised control commands to the engine. The possibilities to\n * send down an integer, a pointer to data or a function pointer are\n * provided. Any of the parameters may or may not be NULL, depending on the\n * command number. In actuality, this function only requires a structural\n * (rather than functional) reference to an engine, but many control commands\n * may require the engine be functional. The caller should be aware of trying\n * commands that require an operational ENGINE, and only use functional\n * references in such situations.\n */\nint ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void));\n\n/*\n * This function tests if an ENGINE-specific command is usable as a\n * \"setting\". Eg. in an application's config file that gets processed through\n * ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to\n * ENGINE_ctrl_cmd_string(), only ENGINE_ctrl().\n */\nint ENGINE_cmd_is_executable(ENGINE *e, int cmd);\n\n/*\n * This function works like ENGINE_ctrl() with the exception of taking a\n * command name instead of a command number, and can handle optional\n * commands. See the comment on ENGINE_ctrl_cmd_string() for an explanation\n * on how to use the cmd_name and cmd_optional.\n */\nint ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,\n                    long i, void *p, void (*f) (void), int cmd_optional);\n\n/*\n * This function passes a command-name and argument to an ENGINE. The\n * cmd_name is converted to a command number and the control command is\n * called using 'arg' as an argument (unless the ENGINE doesn't support such\n * a command, in which case no control command is called). The command is\n * checked for input flags, and if necessary the argument will be converted\n * to a numeric value. If cmd_optional is non-zero, then if the ENGINE\n * doesn't support the given cmd_name the return value will be success\n * anyway. This function is intended for applications to use so that users\n * (or config files) can supply engine-specific config data to the ENGINE at\n * run-time to control behaviour of specific engines. As such, it shouldn't\n * be used for calling ENGINE_ctrl() functions that return data, deal with\n * binary data, or that are otherwise supposed to be used directly through\n * ENGINE_ctrl() in application code. Any \"return\" data from an ENGINE_ctrl()\n * operation in this function will be lost - the return value is interpreted\n * as failure if the return value is zero, success otherwise, and this\n * function returns a boolean value as a result. In other words, vendors of\n * 'ENGINE'-enabled devices should write ENGINE implementations with\n * parameterisations that work in this scheme, so that compliant ENGINE-based\n * applications can work consistently with the same configuration for the\n * same ENGINE-enabled devices, across applications.\n */\nint ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,\n                           int cmd_optional);\n\n/*\n * These functions are useful for manufacturing new ENGINE structures. They\n * don't address reference counting at all - one uses them to populate an\n * ENGINE structure with personalised implementations of things prior to\n * using it directly or adding it to the builtin ENGINE list in OpenSSL.\n * These are also here so that the ENGINE structure doesn't have to be\n * exposed and break binary compatibility!\n */\nENGINE *ENGINE_new(void);\nint ENGINE_free(ENGINE *e);\nint ENGINE_up_ref(ENGINE *e);\nint ENGINE_set_id(ENGINE *e, const char *id);\nint ENGINE_set_name(ENGINE *e, const char *name);\nint ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);\nint ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);\nint ENGINE_set_ECDH(ENGINE *e, const ECDH_METHOD *ecdh_meth);\nint ENGINE_set_ECDSA(ENGINE *e, const ECDSA_METHOD *ecdsa_meth);\nint ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);\nint ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);\nint ENGINE_set_STORE(ENGINE *e, const STORE_METHOD *store_meth);\nint ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f);\nint ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);\nint ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);\nint ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);\nint ENGINE_set_load_privkey_function(ENGINE *e,\n                                     ENGINE_LOAD_KEY_PTR loadpriv_f);\nint ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);\nint ENGINE_set_load_ssl_client_cert_function(ENGINE *e,\n                                             ENGINE_SSL_CLIENT_CERT_PTR\n                                             loadssl_f);\nint ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);\nint ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);\nint ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);\nint ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);\nint ENGINE_set_flags(ENGINE *e, int flags);\nint ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns);\n/* These functions allow control over any per-structure ENGINE data. */\nint ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,\n                            CRYPTO_EX_dup *dup_func,\n                            CRYPTO_EX_free *free_func);\nint ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);\nvoid *ENGINE_get_ex_data(const ENGINE *e, int idx);\n\n/*\n * This function cleans up anything that needs it. Eg. the ENGINE_add()\n * function automatically ensures the list cleanup function is registered to\n * be called from ENGINE_cleanup(). Similarly, all ENGINE_register_***\n * functions ensure ENGINE_cleanup() will clean up after them.\n */\nvoid ENGINE_cleanup(void);\n\n/*\n * These return values from within the ENGINE structure. These can be useful\n * with functional references as well as structural references - it depends\n * which you obtained. Using the result for functional purposes if you only\n * obtained a structural reference may be problematic!\n */\nconst char *ENGINE_get_id(const ENGINE *e);\nconst char *ENGINE_get_name(const ENGINE *e);\nconst RSA_METHOD *ENGINE_get_RSA(const ENGINE *e);\nconst DSA_METHOD *ENGINE_get_DSA(const ENGINE *e);\nconst ECDH_METHOD *ENGINE_get_ECDH(const ENGINE *e);\nconst ECDSA_METHOD *ENGINE_get_ECDSA(const ENGINE *e);\nconst DH_METHOD *ENGINE_get_DH(const ENGINE *e);\nconst RAND_METHOD *ENGINE_get_RAND(const ENGINE *e);\nconst STORE_METHOD *ENGINE_get_STORE(const ENGINE *e);\nENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);\nENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);\nENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);\nENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);\nENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);\nENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);\nENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE\n                                                               *e);\nENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);\nENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);\nENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);\nENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);\nconst EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);\nconst EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);\nconst EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);\nconst EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);\nconst EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,\n                                                          const char *str,\n                                                          int len);\nconst EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,\n                                                      const char *str,\n                                                      int len);\nconst ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);\nint ENGINE_get_flags(const ENGINE *e);\n\n/*\n * FUNCTIONAL functions. These functions deal with ENGINE structures that\n * have (or will) be initialised for use. Broadly speaking, the structural\n * functions are useful for iterating the list of available engine types,\n * creating new engine types, and other \"list\" operations. These functions\n * actually deal with ENGINEs that are to be used. As such these functions\n * can fail (if applicable) when particular engines are unavailable - eg. if\n * a hardware accelerator is not attached or not functioning correctly. Each\n * ENGINE has 2 reference counts; structural and functional. Every time a\n * functional reference is obtained or released, a corresponding structural\n * reference is automatically obtained or released too.\n */\n\n/*\n * Initialise a engine type for use (or up its reference count if it's\n * already in use). This will fail if the engine is not currently operational\n * and cannot initialise.\n */\nint ENGINE_init(ENGINE *e);\n/*\n * Free a functional reference to a engine type. This does not require a\n * corresponding call to ENGINE_free as it also releases a structural\n * reference.\n */\nint ENGINE_finish(ENGINE *e);\n\n/*\n * The following functions handle keys that are stored in some secondary\n * location, handled by the engine.  The storage may be on a card or\n * whatever.\n */\nEVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,\n                                  UI_METHOD *ui_method, void *callback_data);\nEVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,\n                                 UI_METHOD *ui_method, void *callback_data);\nint ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s,\n                                STACK_OF(X509_NAME) *ca_dn, X509 **pcert,\n                                EVP_PKEY **ppkey, STACK_OF(X509) **pother,\n                                UI_METHOD *ui_method, void *callback_data);\n\n/*\n * This returns a pointer for the current ENGINE structure that is (by\n * default) performing any RSA operations. The value returned is an\n * incremented reference, so it should be free'd (ENGINE_finish) before it is\n * discarded.\n */\nENGINE *ENGINE_get_default_RSA(void);\n/* Same for the other \"methods\" */\nENGINE *ENGINE_get_default_DSA(void);\nENGINE *ENGINE_get_default_ECDH(void);\nENGINE *ENGINE_get_default_ECDSA(void);\nENGINE *ENGINE_get_default_DH(void);\nENGINE *ENGINE_get_default_RAND(void);\n/*\n * These functions can be used to get a functional reference to perform\n * ciphering or digesting corresponding to \"nid\".\n */\nENGINE *ENGINE_get_cipher_engine(int nid);\nENGINE *ENGINE_get_digest_engine(int nid);\nENGINE *ENGINE_get_pkey_meth_engine(int nid);\nENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);\n\n/*\n * This sets a new default ENGINE structure for performing RSA operations. If\n * the result is non-zero (success) then the ENGINE structure will have had\n * its reference count up'd so the caller should still free their own\n * reference 'e'.\n */\nint ENGINE_set_default_RSA(ENGINE *e);\nint ENGINE_set_default_string(ENGINE *e, const char *def_list);\n/* Same for the other \"methods\" */\nint ENGINE_set_default_DSA(ENGINE *e);\nint ENGINE_set_default_ECDH(ENGINE *e);\nint ENGINE_set_default_ECDSA(ENGINE *e);\nint ENGINE_set_default_DH(ENGINE *e);\nint ENGINE_set_default_RAND(ENGINE *e);\nint ENGINE_set_default_ciphers(ENGINE *e);\nint ENGINE_set_default_digests(ENGINE *e);\nint ENGINE_set_default_pkey_meths(ENGINE *e);\nint ENGINE_set_default_pkey_asn1_meths(ENGINE *e);\n\n/*\n * The combination \"set\" - the flags are bitwise \"OR\"d from the\n * ENGINE_METHOD_*** defines above. As with the \"ENGINE_register_complete()\"\n * function, this function can result in unnecessary static linkage. If your\n * application requires only specific functionality, consider using more\n * selective functions.\n */\nint ENGINE_set_default(ENGINE *e, unsigned int flags);\n\nvoid ENGINE_add_conf_module(void);\n\n/* Deprecated functions ... */\n/* int ENGINE_clear_defaults(void); */\n\n/**************************/\n/* DYNAMIC ENGINE SUPPORT */\n/**************************/\n\n/* Binary/behaviour compatibility levels */\n# define OSSL_DYNAMIC_VERSION            (unsigned long)0x00020000\n/*\n * Binary versions older than this are too old for us (whether we're a loader\n * or a loadee)\n */\n# define OSSL_DYNAMIC_OLDEST             (unsigned long)0x00020000\n\n/*\n * When compiling an ENGINE entirely as an external shared library, loadable\n * by the \"dynamic\" ENGINE, these types are needed. The 'dynamic_fns'\n * structure type provides the calling application's (or library's) error\n * functionality and memory management function pointers to the loaded\n * library. These should be used/set in the loaded library code so that the\n * loading application's 'state' will be used/changed in all operations. The\n * 'static_state' pointer allows the loaded library to know if it shares the\n * same static data as the calling application (or library), and thus whether\n * these callbacks need to be set or not.\n */\ntypedef void *(*dyn_MEM_malloc_cb) (size_t);\ntypedef void *(*dyn_MEM_realloc_cb) (void *, size_t);\ntypedef void (*dyn_MEM_free_cb) (void *);\ntypedef struct st_dynamic_MEM_fns {\n    dyn_MEM_malloc_cb malloc_cb;\n    dyn_MEM_realloc_cb realloc_cb;\n    dyn_MEM_free_cb free_cb;\n} dynamic_MEM_fns;\n/*\n * FIXME: Perhaps the memory and locking code (crypto.h) should declare and\n * use these types so we (and any other dependant code) can simplify a bit??\n */\ntypedef void (*dyn_lock_locking_cb) (int, int, const char *, int);\ntypedef int (*dyn_lock_add_lock_cb) (int *, int, int, const char *, int);\ntypedef struct CRYPTO_dynlock_value *(*dyn_dynlock_create_cb) (const char *,\n                                                               int);\ntypedef void (*dyn_dynlock_lock_cb) (int, struct CRYPTO_dynlock_value *,\n                                     const char *, int);\ntypedef void (*dyn_dynlock_destroy_cb) (struct CRYPTO_dynlock_value *,\n                                        const char *, int);\ntypedef struct st_dynamic_LOCK_fns {\n    dyn_lock_locking_cb lock_locking_cb;\n    dyn_lock_add_lock_cb lock_add_lock_cb;\n    dyn_dynlock_create_cb dynlock_create_cb;\n    dyn_dynlock_lock_cb dynlock_lock_cb;\n    dyn_dynlock_destroy_cb dynlock_destroy_cb;\n} dynamic_LOCK_fns;\n/* The top-level structure */\ntypedef struct st_dynamic_fns {\n    void *static_state;\n    const ERR_FNS *err_fns;\n    const CRYPTO_EX_DATA_IMPL *ex_data_fns;\n    dynamic_MEM_fns mem_fns;\n    dynamic_LOCK_fns lock_fns;\n} dynamic_fns;\n\n/*\n * The version checking function should be of this prototype. NB: The\n * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading\n * code. If this function returns zero, it indicates a (potential) version\n * incompatibility and the loaded library doesn't believe it can proceed.\n * Otherwise, the returned value is the (latest) version supported by the\n * loading library. The loader may still decide that the loaded code's\n * version is unsatisfactory and could veto the load. The function is\n * expected to be implemented with the symbol name \"v_check\", and a default\n * implementation can be fully instantiated with\n * IMPLEMENT_DYNAMIC_CHECK_FN().\n */\ntypedef unsigned long (*dynamic_v_check_fn) (unsigned long ossl_version);\n# define IMPLEMENT_DYNAMIC_CHECK_FN() \\\n        OPENSSL_EXPORT unsigned long v_check(unsigned long v); \\\n        OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \\\n                if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \\\n                return 0; }\n\n/*\n * This function is passed the ENGINE structure to initialise with its own\n * function and command settings. It should not adjust the structural or\n * functional reference counts. If this function returns zero, (a) the load\n * will be aborted, (b) the previous ENGINE state will be memcpy'd back onto\n * the structure, and (c) the shared library will be unloaded. So\n * implementations should do their own internal cleanup in failure\n * circumstances otherwise they could leak. The 'id' parameter, if non-NULL,\n * represents the ENGINE id that the loader is looking for. If this is NULL,\n * the shared library can choose to return failure or to initialise a\n * 'default' ENGINE. If non-NULL, the shared library must initialise only an\n * ENGINE matching the passed 'id'. The function is expected to be\n * implemented with the symbol name \"bind_engine\". A standard implementation\n * can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where the parameter\n * 'fn' is a callback function that populates the ENGINE structure and\n * returns an int value (zero for failure). 'fn' should have prototype;\n * [static] int fn(ENGINE *e, const char *id);\n */\ntypedef int (*dynamic_bind_engine) (ENGINE *e, const char *id,\n                                    const dynamic_fns *fns);\n# define IMPLEMENT_DYNAMIC_BIND_FN(fn) \\\n        OPENSSL_EXPORT \\\n        int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \\\n        OPENSSL_EXPORT \\\n        int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \\\n                if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \\\n                if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \\\n                        fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \\\n                        return 0; \\\n                CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \\\n                CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \\\n                CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_cb); \\\n                CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \\\n                CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destroy_cb); \\\n                if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \\\n                        return 0; \\\n                if(!ERR_set_implementation(fns->err_fns)) return 0; \\\n        skip_cbs: \\\n                if(!fn(e,id)) return 0; \\\n                return 1; }\n\n/*\n * If the loading application (or library) and the loaded ENGINE library\n * share the same static data (eg. they're both dynamically linked to the\n * same libcrypto.so) we need a way to avoid trying to set system callbacks -\n * this would fail, and for the same reason that it's unnecessary to try. If\n * the loaded ENGINE has (or gets from through the loader) its own copy of\n * the libcrypto static data, we will need to set the callbacks. The easiest\n * way to detect this is to have a function that returns a pointer to some\n * static data and let the loading application and loaded ENGINE compare\n * their respective values.\n */\nvoid *ENGINE_get_static_state(void);\n\n# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)\nvoid ENGINE_setup_bsd_cryptodev(void);\n# endif\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_ENGINE_strings(void);\n\n/* Error codes for the ENGINE functions. */\n\n/* Function codes. */\n# define ENGINE_F_DYNAMIC_CTRL                            180\n# define ENGINE_F_DYNAMIC_GET_DATA_CTX                    181\n# define ENGINE_F_DYNAMIC_LOAD                            182\n# define ENGINE_F_DYNAMIC_SET_DATA_CTX                    183\n# define ENGINE_F_ENGINE_ADD                              105\n# define ENGINE_F_ENGINE_BY_ID                            106\n# define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE                170\n# define ENGINE_F_ENGINE_CTRL                             142\n# define ENGINE_F_ENGINE_CTRL_CMD                         178\n# define ENGINE_F_ENGINE_CTRL_CMD_STRING                  171\n# define ENGINE_F_ENGINE_FINISH                           107\n# define ENGINE_F_ENGINE_FREE_UTIL                        108\n# define ENGINE_F_ENGINE_GET_CIPHER                       185\n# define ENGINE_F_ENGINE_GET_DEFAULT_TYPE                 177\n# define ENGINE_F_ENGINE_GET_DIGEST                       186\n# define ENGINE_F_ENGINE_GET_NEXT                         115\n# define ENGINE_F_ENGINE_GET_PKEY_ASN1_METH               193\n# define ENGINE_F_ENGINE_GET_PKEY_METH                    192\n# define ENGINE_F_ENGINE_GET_PREV                         116\n# define ENGINE_F_ENGINE_INIT                             119\n# define ENGINE_F_ENGINE_LIST_ADD                         120\n# define ENGINE_F_ENGINE_LIST_REMOVE                      121\n# define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY                 150\n# define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY                  151\n# define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT             194\n# define ENGINE_F_ENGINE_NEW                              122\n# define ENGINE_F_ENGINE_REMOVE                           123\n# define ENGINE_F_ENGINE_SET_DEFAULT_STRING               189\n# define ENGINE_F_ENGINE_SET_DEFAULT_TYPE                 126\n# define ENGINE_F_ENGINE_SET_ID                           129\n# define ENGINE_F_ENGINE_SET_NAME                         130\n# define ENGINE_F_ENGINE_TABLE_REGISTER                   184\n# define ENGINE_F_ENGINE_UNLOAD_KEY                       152\n# define ENGINE_F_ENGINE_UNLOCKED_FINISH                  191\n# define ENGINE_F_ENGINE_UP_REF                           190\n# define ENGINE_F_INT_CTRL_HELPER                         172\n# define ENGINE_F_INT_ENGINE_CONFIGURE                    188\n# define ENGINE_F_INT_ENGINE_MODULE_INIT                  187\n# define ENGINE_F_LOG_MESSAGE                             141\n\n/* Reason codes. */\n# define ENGINE_R_ALREADY_LOADED                          100\n# define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER                133\n# define ENGINE_R_CMD_NOT_EXECUTABLE                      134\n# define ENGINE_R_COMMAND_TAKES_INPUT                     135\n# define ENGINE_R_COMMAND_TAKES_NO_INPUT                  136\n# define ENGINE_R_CONFLICTING_ENGINE_ID                   103\n# define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED            119\n# define ENGINE_R_DH_NOT_IMPLEMENTED                      139\n# define ENGINE_R_DSA_NOT_IMPLEMENTED                     140\n# define ENGINE_R_DSO_FAILURE                             104\n# define ENGINE_R_DSO_NOT_FOUND                           132\n# define ENGINE_R_ENGINES_SECTION_ERROR                   148\n# define ENGINE_R_ENGINE_CONFIGURATION_ERROR              102\n# define ENGINE_R_ENGINE_IS_NOT_IN_LIST                   105\n# define ENGINE_R_ENGINE_SECTION_ERROR                    149\n# define ENGINE_R_FAILED_LOADING_PRIVATE_KEY              128\n# define ENGINE_R_FAILED_LOADING_PUBLIC_KEY               129\n# define ENGINE_R_FINISH_FAILED                           106\n# define ENGINE_R_GET_HANDLE_FAILED                       107\n# define ENGINE_R_ID_OR_NAME_MISSING                      108\n# define ENGINE_R_INIT_FAILED                             109\n# define ENGINE_R_INTERNAL_LIST_ERROR                     110\n# define ENGINE_R_INVALID_ARGUMENT                        143\n# define ENGINE_R_INVALID_CMD_NAME                        137\n# define ENGINE_R_INVALID_CMD_NUMBER                      138\n# define ENGINE_R_INVALID_INIT_VALUE                      151\n# define ENGINE_R_INVALID_STRING                          150\n# define ENGINE_R_NOT_INITIALISED                         117\n# define ENGINE_R_NOT_LOADED                              112\n# define ENGINE_R_NO_CONTROL_FUNCTION                     120\n# define ENGINE_R_NO_INDEX                                144\n# define ENGINE_R_NO_LOAD_FUNCTION                        125\n# define ENGINE_R_NO_REFERENCE                            130\n# define ENGINE_R_NO_SUCH_ENGINE                          116\n# define ENGINE_R_NO_UNLOAD_FUNCTION                      126\n# define ENGINE_R_PROVIDE_PARAMETERS                      113\n# define ENGINE_R_RSA_NOT_IMPLEMENTED                     141\n# define ENGINE_R_UNIMPLEMENTED_CIPHER                    146\n# define ENGINE_R_UNIMPLEMENTED_DIGEST                    147\n# define ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD         101\n# define ENGINE_R_VERSION_INCOMPATIBILITY                 145\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/err.h",
    "content": "/* crypto/err/err.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n/* ====================================================================\n * Copyright (c) 1998-2006 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_ERR_H\n# define HEADER_ERR_H\n\n# include <openssl/e_os2.h>\n\n# ifndef OPENSSL_NO_FP_API\n#  include <stdio.h>\n#  include <stdlib.h>\n# endif\n\n# include <openssl/ossl_typ.h>\n# ifndef OPENSSL_NO_BIO\n#  include <openssl/bio.h>\n# endif\n# ifndef OPENSSL_NO_LHASH\n#  include <openssl/lhash.h>\n# endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# ifndef OPENSSL_NO_ERR\n#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)\n# else\n#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,NULL,0)\n# endif\n\n# include <errno.h>\n\n# define ERR_TXT_MALLOCED        0x01\n# define ERR_TXT_STRING          0x02\n\n# define ERR_FLAG_MARK           0x01\n\n# define ERR_NUM_ERRORS  16\ntypedef struct err_state_st {\n    CRYPTO_THREADID tid;\n    int err_flags[ERR_NUM_ERRORS];\n    unsigned long err_buffer[ERR_NUM_ERRORS];\n    char *err_data[ERR_NUM_ERRORS];\n    int err_data_flags[ERR_NUM_ERRORS];\n    const char *err_file[ERR_NUM_ERRORS];\n    int err_line[ERR_NUM_ERRORS];\n    int top, bottom;\n} ERR_STATE;\n\n/* library */\n# define ERR_LIB_NONE            1\n# define ERR_LIB_SYS             2\n# define ERR_LIB_BN              3\n# define ERR_LIB_RSA             4\n# define ERR_LIB_DH              5\n# define ERR_LIB_EVP             6\n# define ERR_LIB_BUF             7\n# define ERR_LIB_OBJ             8\n# define ERR_LIB_PEM             9\n# define ERR_LIB_DSA             10\n# define ERR_LIB_X509            11\n/* #define ERR_LIB_METH         12 */\n# define ERR_LIB_ASN1            13\n# define ERR_LIB_CONF            14\n# define ERR_LIB_CRYPTO          15\n# define ERR_LIB_EC              16\n# define ERR_LIB_SSL             20\n/* #define ERR_LIB_SSL23        21 */\n/* #define ERR_LIB_SSL2         22 */\n/* #define ERR_LIB_SSL3         23 */\n/* #define ERR_LIB_RSAREF       30 */\n/* #define ERR_LIB_PROXY        31 */\n# define ERR_LIB_BIO             32\n# define ERR_LIB_PKCS7           33\n# define ERR_LIB_X509V3          34\n# define ERR_LIB_PKCS12          35\n# define ERR_LIB_RAND            36\n# define ERR_LIB_DSO             37\n# define ERR_LIB_ENGINE          38\n# define ERR_LIB_OCSP            39\n# define ERR_LIB_UI              40\n# define ERR_LIB_COMP            41\n# define ERR_LIB_ECDSA           42\n# define ERR_LIB_ECDH            43\n# define ERR_LIB_STORE           44\n# define ERR_LIB_FIPS            45\n# define ERR_LIB_CMS             46\n# define ERR_LIB_TS              47\n# define ERR_LIB_HMAC            48\n# define ERR_LIB_JPAKE           49\n\n# define ERR_LIB_USER            128\n\n# define SYSerr(f,r)  ERR_PUT_error(ERR_LIB_SYS,(f),(r),__FILE__,__LINE__)\n# define BNerr(f,r)   ERR_PUT_error(ERR_LIB_BN,(f),(r),__FILE__,__LINE__)\n# define RSAerr(f,r)  ERR_PUT_error(ERR_LIB_RSA,(f),(r),__FILE__,__LINE__)\n# define DHerr(f,r)   ERR_PUT_error(ERR_LIB_DH,(f),(r),__FILE__,__LINE__)\n# define EVPerr(f,r)  ERR_PUT_error(ERR_LIB_EVP,(f),(r),__FILE__,__LINE__)\n# define BUFerr(f,r)  ERR_PUT_error(ERR_LIB_BUF,(f),(r),__FILE__,__LINE__)\n# define OBJerr(f,r)  ERR_PUT_error(ERR_LIB_OBJ,(f),(r),__FILE__,__LINE__)\n# define PEMerr(f,r)  ERR_PUT_error(ERR_LIB_PEM,(f),(r),__FILE__,__LINE__)\n# define DSAerr(f,r)  ERR_PUT_error(ERR_LIB_DSA,(f),(r),__FILE__,__LINE__)\n# define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),__FILE__,__LINE__)\n# define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),__FILE__,__LINE__)\n# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),__FILE__,__LINE__)\n# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),__FILE__,__LINE__)\n# define ECerr(f,r)   ERR_PUT_error(ERR_LIB_EC,(f),(r),__FILE__,__LINE__)\n# define SSLerr(f,r)  ERR_PUT_error(ERR_LIB_SSL,(f),(r),__FILE__,__LINE__)\n# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),__FILE__,__LINE__)\n# define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),__FILE__,__LINE__)\n# define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),__FILE__,__LINE__)\n# define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),__FILE__,__LINE__)\n# define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),__FILE__,__LINE__)\n# define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),__FILE__,__LINE__)\n# define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),__FILE__,__LINE__)\n# define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__)\n# define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__)\n# define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__)\n# define ECDSAerr(f,r)  ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__)\n# define ECDHerr(f,r)  ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__)\n# define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__)\n# define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__)\n# define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__)\n# define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),__FILE__,__LINE__)\n# define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),__FILE__,__LINE__)\n# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__)\n\n/*\n * Borland C seems too stupid to be able to shift and do longs in the\n * pre-processor :-(\n */\n# define ERR_PACK(l,f,r)         (((((unsigned long)l)&0xffL)*0x1000000)| \\\n                                ((((unsigned long)f)&0xfffL)*0x1000)| \\\n                                ((((unsigned long)r)&0xfffL)))\n# define ERR_GET_LIB(l)          (int)((((unsigned long)l)>>24L)&0xffL)\n# define ERR_GET_FUNC(l)         (int)((((unsigned long)l)>>12L)&0xfffL)\n# define ERR_GET_REASON(l)       (int)((l)&0xfffL)\n# define ERR_FATAL_ERROR(l)      (int)((l)&ERR_R_FATAL)\n\n/* OS functions */\n# define SYS_F_FOPEN             1\n# define SYS_F_CONNECT           2\n# define SYS_F_GETSERVBYNAME     3\n# define SYS_F_SOCKET            4\n# define SYS_F_IOCTLSOCKET       5\n# define SYS_F_BIND              6\n# define SYS_F_LISTEN            7\n# define SYS_F_ACCEPT            8\n# define SYS_F_WSASTARTUP        9/* Winsock stuff */\n# define SYS_F_OPENDIR           10\n# define SYS_F_FREAD             11\n# define SYS_F_FFLUSH            18\n\n/* reasons */\n# define ERR_R_SYS_LIB   ERR_LIB_SYS/* 2 */\n# define ERR_R_BN_LIB    ERR_LIB_BN/* 3 */\n# define ERR_R_RSA_LIB   ERR_LIB_RSA/* 4 */\n# define ERR_R_DH_LIB    ERR_LIB_DH/* 5 */\n# define ERR_R_EVP_LIB   ERR_LIB_EVP/* 6 */\n# define ERR_R_BUF_LIB   ERR_LIB_BUF/* 7 */\n# define ERR_R_OBJ_LIB   ERR_LIB_OBJ/* 8 */\n# define ERR_R_PEM_LIB   ERR_LIB_PEM/* 9 */\n# define ERR_R_DSA_LIB   ERR_LIB_DSA/* 10 */\n# define ERR_R_X509_LIB  ERR_LIB_X509/* 11 */\n# define ERR_R_ASN1_LIB  ERR_LIB_ASN1/* 13 */\n# define ERR_R_CONF_LIB  ERR_LIB_CONF/* 14 */\n# define ERR_R_CRYPTO_LIB ERR_LIB_CRYPTO/* 15 */\n# define ERR_R_EC_LIB    ERR_LIB_EC/* 16 */\n# define ERR_R_SSL_LIB   ERR_LIB_SSL/* 20 */\n# define ERR_R_BIO_LIB   ERR_LIB_BIO/* 32 */\n# define ERR_R_PKCS7_LIB ERR_LIB_PKCS7/* 33 */\n# define ERR_R_X509V3_LIB ERR_LIB_X509V3/* 34 */\n# define ERR_R_PKCS12_LIB ERR_LIB_PKCS12/* 35 */\n# define ERR_R_RAND_LIB  ERR_LIB_RAND/* 36 */\n# define ERR_R_DSO_LIB   ERR_LIB_DSO/* 37 */\n# define ERR_R_ENGINE_LIB ERR_LIB_ENGINE/* 38 */\n# define ERR_R_OCSP_LIB  ERR_LIB_OCSP/* 39 */\n# define ERR_R_UI_LIB    ERR_LIB_UI/* 40 */\n# define ERR_R_COMP_LIB  ERR_LIB_COMP/* 41 */\n# define ERR_R_ECDSA_LIB ERR_LIB_ECDSA/* 42 */\n# define ERR_R_ECDH_LIB  ERR_LIB_ECDH/* 43 */\n# define ERR_R_STORE_LIB ERR_LIB_STORE/* 44 */\n# define ERR_R_TS_LIB    ERR_LIB_TS/* 45 */\n\n# define ERR_R_NESTED_ASN1_ERROR                 58\n# define ERR_R_BAD_ASN1_OBJECT_HEADER            59\n# define ERR_R_BAD_GET_ASN1_OBJECT_CALL          60\n# define ERR_R_EXPECTING_AN_ASN1_SEQUENCE        61\n# define ERR_R_ASN1_LENGTH_MISMATCH              62\n# define ERR_R_MISSING_ASN1_EOS                  63\n\n/* fatal error */\n# define ERR_R_FATAL                             64\n# define ERR_R_MALLOC_FAILURE                    (1|ERR_R_FATAL)\n# define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED       (2|ERR_R_FATAL)\n# define ERR_R_PASSED_NULL_PARAMETER             (3|ERR_R_FATAL)\n# define ERR_R_INTERNAL_ERROR                    (4|ERR_R_FATAL)\n# define ERR_R_DISABLED                          (5|ERR_R_FATAL)\n\n/*\n * 99 is the maximum possible ERR_R_... code, higher values are reserved for\n * the individual libraries\n */\n\ntypedef struct ERR_string_data_st {\n    unsigned long error;\n    const char *string;\n} ERR_STRING_DATA;\n\nvoid ERR_put_error(int lib, int func, int reason, const char *file, int line);\nvoid ERR_set_error_data(char *data, int flags);\n\nunsigned long ERR_get_error(void);\nunsigned long ERR_get_error_line(const char **file, int *line);\nunsigned long ERR_get_error_line_data(const char **file, int *line,\n                                      const char **data, int *flags);\nunsigned long ERR_peek_error(void);\nunsigned long ERR_peek_error_line(const char **file, int *line);\nunsigned long ERR_peek_error_line_data(const char **file, int *line,\n                                       const char **data, int *flags);\nunsigned long ERR_peek_last_error(void);\nunsigned long ERR_peek_last_error_line(const char **file, int *line);\nunsigned long ERR_peek_last_error_line_data(const char **file, int *line,\n                                            const char **data, int *flags);\nvoid ERR_clear_error(void);\nchar *ERR_error_string(unsigned long e, char *buf);\nvoid ERR_error_string_n(unsigned long e, char *buf, size_t len);\nconst char *ERR_lib_error_string(unsigned long e);\nconst char *ERR_func_error_string(unsigned long e);\nconst char *ERR_reason_error_string(unsigned long e);\nvoid ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),\n                         void *u);\n# ifndef OPENSSL_NO_FP_API\nvoid ERR_print_errors_fp(FILE *fp);\n# endif\n# ifndef OPENSSL_NO_BIO\nvoid ERR_print_errors(BIO *bp);\n# endif\nvoid ERR_add_error_data(int num, ...);\nvoid ERR_add_error_vdata(int num, va_list args);\nvoid ERR_load_strings(int lib, ERR_STRING_DATA str[]);\nvoid ERR_unload_strings(int lib, ERR_STRING_DATA str[]);\nvoid ERR_load_ERR_strings(void);\nvoid ERR_load_crypto_strings(void);\nvoid ERR_free_strings(void);\n\nvoid ERR_remove_thread_state(const CRYPTO_THREADID *tid);\n# ifndef OPENSSL_NO_DEPRECATED\nvoid ERR_remove_state(unsigned long pid); /* if zero we look it up */\n# endif\nERR_STATE *ERR_get_state(void);\n\n# ifndef OPENSSL_NO_LHASH\nLHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void);\nLHASH_OF(ERR_STATE) *ERR_get_err_state_table(void);\nvoid ERR_release_err_state_table(LHASH_OF(ERR_STATE) **hash);\n# endif\n\nint ERR_get_next_error_library(void);\n\nint ERR_set_mark(void);\nint ERR_pop_to_mark(void);\n\n/* Already defined in ossl_typ.h */\n/* typedef struct st_ERR_FNS ERR_FNS; */\n/*\n * An application can use this function and provide the return value to\n * loaded modules that should use the application's ERR state/functionality\n */\nconst ERR_FNS *ERR_get_implementation(void);\n/*\n * A loaded module should call this function prior to any ERR operations\n * using the application's \"ERR_FNS\".\n */\nint ERR_set_implementation(const ERR_FNS *fns);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/evp.h",
    "content": "/* crypto/evp/evp.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_ENVELOPE_H\n# define HEADER_ENVELOPE_H\n\n# ifdef OPENSSL_ALGORITHM_DEFINES\n#  include <openssl/opensslconf.h>\n# else\n#  define OPENSSL_ALGORITHM_DEFINES\n#  include <openssl/opensslconf.h>\n#  undef OPENSSL_ALGORITHM_DEFINES\n# endif\n\n# include <openssl/ossl_typ.h>\n\n# include <openssl/symhacks.h>\n\n# ifndef OPENSSL_NO_BIO\n#  include <openssl/bio.h>\n# endif\n\n/*-\n#define EVP_RC2_KEY_SIZE                16\n#define EVP_RC4_KEY_SIZE                16\n#define EVP_BLOWFISH_KEY_SIZE           16\n#define EVP_CAST5_KEY_SIZE              16\n#define EVP_RC5_32_12_16_KEY_SIZE       16\n*/\n# define EVP_MAX_MD_SIZE                 64/* longest known is SHA512 */\n# define EVP_MAX_KEY_LENGTH              64\n# define EVP_MAX_IV_LENGTH               16\n# define EVP_MAX_BLOCK_LENGTH            32\n\n# define PKCS5_SALT_LEN                  8\n/* Default PKCS#5 iteration count */\n# define PKCS5_DEFAULT_ITER              2048\n\n# include <openssl/objects.h>\n\n# define EVP_PK_RSA      0x0001\n# define EVP_PK_DSA      0x0002\n# define EVP_PK_DH       0x0004\n# define EVP_PK_EC       0x0008\n# define EVP_PKT_SIGN    0x0010\n# define EVP_PKT_ENC     0x0020\n# define EVP_PKT_EXCH    0x0040\n# define EVP_PKS_RSA     0x0100\n# define EVP_PKS_DSA     0x0200\n# define EVP_PKS_EC      0x0400\n\n# define EVP_PKEY_NONE   NID_undef\n# define EVP_PKEY_RSA    NID_rsaEncryption\n# define EVP_PKEY_RSA2   NID_rsa\n# define EVP_PKEY_DSA    NID_dsa\n# define EVP_PKEY_DSA1   NID_dsa_2\n# define EVP_PKEY_DSA2   NID_dsaWithSHA\n# define EVP_PKEY_DSA3   NID_dsaWithSHA1\n# define EVP_PKEY_DSA4   NID_dsaWithSHA1_2\n# define EVP_PKEY_DH     NID_dhKeyAgreement\n# define EVP_PKEY_DHX    NID_dhpublicnumber\n# define EVP_PKEY_EC     NID_X9_62_id_ecPublicKey\n# define EVP_PKEY_HMAC   NID_hmac\n# define EVP_PKEY_CMAC   NID_cmac\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * Type needs to be a bit field Sub-type needs to be for variations on the\n * method, as in, can it do arbitrary encryption....\n */\nstruct evp_pkey_st {\n    int type;\n    int save_type;\n    int references;\n    const EVP_PKEY_ASN1_METHOD *ameth;\n    ENGINE *engine;\n    union {\n        char *ptr;\n# ifndef OPENSSL_NO_RSA\n        struct rsa_st *rsa;     /* RSA */\n# endif\n# ifndef OPENSSL_NO_DSA\n        struct dsa_st *dsa;     /* DSA */\n# endif\n# ifndef OPENSSL_NO_DH\n        struct dh_st *dh;       /* DH */\n# endif\n# ifndef OPENSSL_NO_EC\n        struct ec_key_st *ec;   /* ECC */\n# endif\n    } pkey;\n    int save_parameters;\n    STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */\n} /* EVP_PKEY */ ;\n\n# define EVP_PKEY_MO_SIGN        0x0001\n# define EVP_PKEY_MO_VERIFY      0x0002\n# define EVP_PKEY_MO_ENCRYPT     0x0004\n# define EVP_PKEY_MO_DECRYPT     0x0008\n\n# ifndef EVP_MD\nstruct env_md_st {\n    int type;\n    int pkey_type;\n    int md_size;\n    unsigned long flags;\n    int (*init) (EVP_MD_CTX *ctx);\n    int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count);\n    int (*final) (EVP_MD_CTX *ctx, unsigned char *md);\n    int (*copy) (EVP_MD_CTX *to, const EVP_MD_CTX *from);\n    int (*cleanup) (EVP_MD_CTX *ctx);\n    /* FIXME: prototype these some day */\n    int (*sign) (int type, const unsigned char *m, unsigned int m_length,\n                 unsigned char *sigret, unsigned int *siglen, void *key);\n    int (*verify) (int type, const unsigned char *m, unsigned int m_length,\n                   const unsigned char *sigbuf, unsigned int siglen,\n                   void *key);\n    int required_pkey_type[5];  /* EVP_PKEY_xxx */\n    int block_size;\n    int ctx_size;               /* how big does the ctx->md_data need to be */\n    /* control function */\n    int (*md_ctrl) (EVP_MD_CTX *ctx, int cmd, int p1, void *p2);\n} /* EVP_MD */ ;\n\ntypedef int evp_sign_method(int type, const unsigned char *m,\n                            unsigned int m_length, unsigned char *sigret,\n                            unsigned int *siglen, void *key);\ntypedef int evp_verify_method(int type, const unsigned char *m,\n                              unsigned int m_length,\n                              const unsigned char *sigbuf,\n                              unsigned int siglen, void *key);\n\n/* digest can only handle a single block */\n#  define EVP_MD_FLAG_ONESHOT     0x0001\n\n/*\n * digest is a \"clone\" digest used\n * which is a copy of an existing\n * one for a specific public key type.\n * EVP_dss1() etc\n */\n#  define EVP_MD_FLAG_PKEY_DIGEST 0x0002\n\n/* Digest uses EVP_PKEY_METHOD for signing instead of MD specific signing */\n\n#  define EVP_MD_FLAG_PKEY_METHOD_SIGNATURE       0x0004\n\n/* DigestAlgorithmIdentifier flags... */\n\n#  define EVP_MD_FLAG_DIGALGID_MASK               0x0018\n\n/* NULL or absent parameter accepted. Use NULL */\n\n#  define EVP_MD_FLAG_DIGALGID_NULL               0x0000\n\n/* NULL or absent parameter accepted. Use NULL for PKCS#1 otherwise absent */\n\n#  define EVP_MD_FLAG_DIGALGID_ABSENT             0x0008\n\n/* Custom handling via ctrl */\n\n#  define EVP_MD_FLAG_DIGALGID_CUSTOM             0x0018\n\n/* Note if suitable for use in FIPS mode */\n#  define EVP_MD_FLAG_FIPS        0x0400\n\n/* Digest ctrls */\n\n#  define EVP_MD_CTRL_DIGALGID                    0x1\n#  define EVP_MD_CTRL_MICALG                      0x2\n\n/* Minimum Algorithm specific ctrl value */\n\n#  define EVP_MD_CTRL_ALG_CTRL                    0x1000\n\n#  define EVP_PKEY_NULL_method    NULL,NULL,{0,0,0,0}\n\n#  ifndef OPENSSL_NO_DSA\n#   define EVP_PKEY_DSA_method     (evp_sign_method *)DSA_sign, \\\n                                (evp_verify_method *)DSA_verify, \\\n                                {EVP_PKEY_DSA,EVP_PKEY_DSA2,EVP_PKEY_DSA3, \\\n                                        EVP_PKEY_DSA4,0}\n#  else\n#   define EVP_PKEY_DSA_method     EVP_PKEY_NULL_method\n#  endif\n\n#  ifndef OPENSSL_NO_ECDSA\n#   define EVP_PKEY_ECDSA_method   (evp_sign_method *)ECDSA_sign, \\\n                                (evp_verify_method *)ECDSA_verify, \\\n                                 {EVP_PKEY_EC,0,0,0}\n#  else\n#   define EVP_PKEY_ECDSA_method   EVP_PKEY_NULL_method\n#  endif\n\n#  ifndef OPENSSL_NO_RSA\n#   define EVP_PKEY_RSA_method     (evp_sign_method *)RSA_sign, \\\n                                (evp_verify_method *)RSA_verify, \\\n                                {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}\n#   define EVP_PKEY_RSA_ASN1_OCTET_STRING_method \\\n                                (evp_sign_method *)RSA_sign_ASN1_OCTET_STRING, \\\n                                (evp_verify_method *)RSA_verify_ASN1_OCTET_STRING, \\\n                                {EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}\n#  else\n#   define EVP_PKEY_RSA_method     EVP_PKEY_NULL_method\n#   define EVP_PKEY_RSA_ASN1_OCTET_STRING_method EVP_PKEY_NULL_method\n#  endif\n\n# endif                         /* !EVP_MD */\n\nstruct env_md_ctx_st {\n    const EVP_MD *digest;\n    ENGINE *engine;             /* functional reference if 'digest' is\n                                 * ENGINE-provided */\n    unsigned long flags;\n    void *md_data;\n    /* Public key context for sign/verify */\n    EVP_PKEY_CTX *pctx;\n    /* Update function: usually copied from EVP_MD */\n    int (*update) (EVP_MD_CTX *ctx, const void *data, size_t count);\n} /* EVP_MD_CTX */ ;\n\n/* values for EVP_MD_CTX flags */\n\n# define EVP_MD_CTX_FLAG_ONESHOT         0x0001/* digest update will be\n                                                * called once only */\n# define EVP_MD_CTX_FLAG_CLEANED         0x0002/* context has already been\n                                                * cleaned */\n# define EVP_MD_CTX_FLAG_REUSE           0x0004/* Don't free up ctx->md_data\n                                                * in EVP_MD_CTX_cleanup */\n/*\n * FIPS and pad options are ignored in 1.0.0, definitions are here so we\n * don't accidentally reuse the values for other purposes.\n */\n\n# define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW  0x0008/* Allow use of non FIPS\n                                                * digest in FIPS mode */\n\n/*\n * The following PAD options are also currently ignored in 1.0.0, digest\n * parameters are handled through EVP_DigestSign*() and EVP_DigestVerify*()\n * instead.\n */\n# define EVP_MD_CTX_FLAG_PAD_MASK        0xF0/* RSA mode to use */\n# define EVP_MD_CTX_FLAG_PAD_PKCS1       0x00/* PKCS#1 v1.5 mode */\n# define EVP_MD_CTX_FLAG_PAD_X931        0x10/* X9.31 mode */\n# define EVP_MD_CTX_FLAG_PAD_PSS         0x20/* PSS mode */\n\n# define EVP_MD_CTX_FLAG_NO_INIT         0x0100/* Don't initialize md_data */\n\nstruct evp_cipher_st {\n    int nid;\n    int block_size;\n    /* Default value for variable length ciphers */\n    int key_len;\n    int iv_len;\n    /* Various flags */\n    unsigned long flags;\n    /* init key */\n    int (*init) (EVP_CIPHER_CTX *ctx, const unsigned char *key,\n                 const unsigned char *iv, int enc);\n    /* encrypt/decrypt data */\n    int (*do_cipher) (EVP_CIPHER_CTX *ctx, unsigned char *out,\n                      const unsigned char *in, size_t inl);\n    /* cleanup ctx */\n    int (*cleanup) (EVP_CIPHER_CTX *);\n    /* how big ctx->cipher_data needs to be */\n    int ctx_size;\n    /* Populate a ASN1_TYPE with parameters */\n    int (*set_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *);\n    /* Get parameters from a ASN1_TYPE */\n    int (*get_asn1_parameters) (EVP_CIPHER_CTX *, ASN1_TYPE *);\n    /* Miscellaneous operations */\n    int (*ctrl) (EVP_CIPHER_CTX *, int type, int arg, void *ptr);\n    /* Application data */\n    void *app_data;\n} /* EVP_CIPHER */ ;\n\n/* Values for cipher flags */\n\n/* Modes for ciphers */\n\n# define         EVP_CIPH_STREAM_CIPHER          0x0\n# define         EVP_CIPH_ECB_MODE               0x1\n# define         EVP_CIPH_CBC_MODE               0x2\n# define         EVP_CIPH_CFB_MODE               0x3\n# define         EVP_CIPH_OFB_MODE               0x4\n# define         EVP_CIPH_CTR_MODE               0x5\n# define         EVP_CIPH_GCM_MODE               0x6\n# define         EVP_CIPH_CCM_MODE               0x7\n# define         EVP_CIPH_XTS_MODE               0x10001\n# define         EVP_CIPH_WRAP_MODE              0x10002\n# define         EVP_CIPH_MODE                   0xF0007\n/* Set if variable length cipher */\n# define         EVP_CIPH_VARIABLE_LENGTH        0x8\n/* Set if the iv handling should be done by the cipher itself */\n# define         EVP_CIPH_CUSTOM_IV              0x10\n/* Set if the cipher's init() function should be called if key is NULL */\n# define         EVP_CIPH_ALWAYS_CALL_INIT       0x20\n/* Call ctrl() to init cipher parameters */\n# define         EVP_CIPH_CTRL_INIT              0x40\n/* Don't use standard key length function */\n# define         EVP_CIPH_CUSTOM_KEY_LENGTH      0x80\n/* Don't use standard block padding */\n# define         EVP_CIPH_NO_PADDING             0x100\n/* cipher handles random key generation */\n# define         EVP_CIPH_RAND_KEY               0x200\n/* cipher has its own additional copying logic */\n# define         EVP_CIPH_CUSTOM_COPY            0x400\n/* Allow use default ASN1 get/set iv */\n# define         EVP_CIPH_FLAG_DEFAULT_ASN1      0x1000\n/* Buffer length in bits not bytes: CFB1 mode only */\n# define         EVP_CIPH_FLAG_LENGTH_BITS       0x2000\n/* Note if suitable for use in FIPS mode */\n# define         EVP_CIPH_FLAG_FIPS              0x4000\n/* Allow non FIPS cipher in FIPS mode */\n# define         EVP_CIPH_FLAG_NON_FIPS_ALLOW    0x8000\n/*\n * Cipher handles any and all padding logic as well as finalisation.\n */\n# define         EVP_CIPH_FLAG_CUSTOM_CIPHER     0x100000\n# define         EVP_CIPH_FLAG_AEAD_CIPHER       0x200000\n# define         EVP_CIPH_FLAG_TLS1_1_MULTIBLOCK 0x400000\n\n/*\n * Cipher context flag to indicate we can handle wrap mode: if allowed in\n * older applications it could overflow buffers.\n */\n\n# define         EVP_CIPHER_CTX_FLAG_WRAP_ALLOW  0x1\n\n/* ctrl() values */\n\n# define         EVP_CTRL_INIT                   0x0\n# define         EVP_CTRL_SET_KEY_LENGTH         0x1\n# define         EVP_CTRL_GET_RC2_KEY_BITS       0x2\n# define         EVP_CTRL_SET_RC2_KEY_BITS       0x3\n# define         EVP_CTRL_GET_RC5_ROUNDS         0x4\n# define         EVP_CTRL_SET_RC5_ROUNDS         0x5\n# define         EVP_CTRL_RAND_KEY               0x6\n# define         EVP_CTRL_PBE_PRF_NID            0x7\n# define         EVP_CTRL_COPY                   0x8\n# define         EVP_CTRL_GCM_SET_IVLEN          0x9\n# define         EVP_CTRL_GCM_GET_TAG            0x10\n# define         EVP_CTRL_GCM_SET_TAG            0x11\n# define         EVP_CTRL_GCM_SET_IV_FIXED       0x12\n# define         EVP_CTRL_GCM_IV_GEN             0x13\n# define         EVP_CTRL_CCM_SET_IVLEN          EVP_CTRL_GCM_SET_IVLEN\n# define         EVP_CTRL_CCM_GET_TAG            EVP_CTRL_GCM_GET_TAG\n# define         EVP_CTRL_CCM_SET_TAG            EVP_CTRL_GCM_SET_TAG\n# define         EVP_CTRL_CCM_SET_L              0x14\n# define         EVP_CTRL_CCM_SET_MSGLEN         0x15\n/*\n * AEAD cipher deduces payload length and returns number of bytes required to\n * store MAC and eventual padding. Subsequent call to EVP_Cipher even\n * appends/verifies MAC.\n */\n# define         EVP_CTRL_AEAD_TLS1_AAD          0x16\n/* Used by composite AEAD ciphers, no-op in GCM, CCM... */\n# define         EVP_CTRL_AEAD_SET_MAC_KEY       0x17\n/* Set the GCM invocation field, decrypt only */\n# define         EVP_CTRL_GCM_SET_IV_INV         0x18\n\n# define         EVP_CTRL_TLS1_1_MULTIBLOCK_AAD  0x19\n# define         EVP_CTRL_TLS1_1_MULTIBLOCK_ENCRYPT      0x1a\n# define         EVP_CTRL_TLS1_1_MULTIBLOCK_DECRYPT      0x1b\n# define         EVP_CTRL_TLS1_1_MULTIBLOCK_MAX_BUFSIZE  0x1c\n\n/* RFC 5246 defines additional data to be 13 bytes in length */\n# define         EVP_AEAD_TLS1_AAD_LEN           13\n\ntypedef struct {\n    unsigned char *out;\n    const unsigned char *inp;\n    size_t len;\n    unsigned int interleave;\n} EVP_CTRL_TLS1_1_MULTIBLOCK_PARAM;\n\n/* GCM TLS constants */\n/* Length of fixed part of IV derived from PRF */\n# define EVP_GCM_TLS_FIXED_IV_LEN                        4\n/* Length of explicit part of IV part of TLS records */\n# define EVP_GCM_TLS_EXPLICIT_IV_LEN                     8\n/* Length of tag for TLS */\n# define EVP_GCM_TLS_TAG_LEN                             16\n\ntypedef struct evp_cipher_info_st {\n    const EVP_CIPHER *cipher;\n    unsigned char iv[EVP_MAX_IV_LENGTH];\n} EVP_CIPHER_INFO;\n\nstruct evp_cipher_ctx_st {\n    const EVP_CIPHER *cipher;\n    ENGINE *engine;             /* functional reference if 'cipher' is\n                                 * ENGINE-provided */\n    int encrypt;                /* encrypt or decrypt */\n    int buf_len;                /* number we have left */\n    unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */\n    unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */\n    unsigned char buf[EVP_MAX_BLOCK_LENGTH]; /* saved partial block */\n    int num;                    /* used by cfb/ofb/ctr mode */\n    void *app_data;             /* application stuff */\n    int key_len;                /* May change for variable length cipher */\n    unsigned long flags;        /* Various flags */\n    void *cipher_data;          /* per EVP data */\n    int final_used;\n    int block_mask;\n    unsigned char final[EVP_MAX_BLOCK_LENGTH]; /* possible final block */\n} /* EVP_CIPHER_CTX */ ;\n\ntypedef struct evp_Encode_Ctx_st {\n    /* number saved in a partial encode/decode */\n    int num;\n    /*\n     * The length is either the output line length (in input bytes) or the\n     * shortest input line length that is ok.  Once decoding begins, the\n     * length is adjusted up each time a longer line is decoded\n     */\n    int length;\n    /* data to encode */\n    unsigned char enc_data[80];\n    /* number read on current line */\n    int line_num;\n    int expect_nl;\n} EVP_ENCODE_CTX;\n\n/* Password based encryption function */\ntypedef int (EVP_PBE_KEYGEN) (EVP_CIPHER_CTX *ctx, const char *pass,\n                              int passlen, ASN1_TYPE *param,\n                              const EVP_CIPHER *cipher, const EVP_MD *md,\n                              int en_de);\n\n# ifndef OPENSSL_NO_RSA\n#  define EVP_PKEY_assign_RSA(pkey,rsa) EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\\\n                                        (char *)(rsa))\n# endif\n\n# ifndef OPENSSL_NO_DSA\n#  define EVP_PKEY_assign_DSA(pkey,dsa) EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\\\n                                        (char *)(dsa))\n# endif\n\n# ifndef OPENSSL_NO_DH\n#  define EVP_PKEY_assign_DH(pkey,dh) EVP_PKEY_assign((pkey),EVP_PKEY_DH,\\\n                                        (char *)(dh))\n# endif\n\n# ifndef OPENSSL_NO_EC\n#  define EVP_PKEY_assign_EC_KEY(pkey,eckey) EVP_PKEY_assign((pkey),EVP_PKEY_EC,\\\n                                        (char *)(eckey))\n# endif\n\n/* Add some extra combinations */\n# define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a))\n# define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a))\n# define EVP_get_cipherbynid(a) EVP_get_cipherbyname(OBJ_nid2sn(a))\n# define EVP_get_cipherbyobj(a) EVP_get_cipherbynid(OBJ_obj2nid(a))\n\nint EVP_MD_type(const EVP_MD *md);\n# define EVP_MD_nid(e)                   EVP_MD_type(e)\n# define EVP_MD_name(e)                  OBJ_nid2sn(EVP_MD_nid(e))\nint EVP_MD_pkey_type(const EVP_MD *md);\nint EVP_MD_size(const EVP_MD *md);\nint EVP_MD_block_size(const EVP_MD *md);\nunsigned long EVP_MD_flags(const EVP_MD *md);\n\nconst EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx);\n# define EVP_MD_CTX_size(e)              EVP_MD_size(EVP_MD_CTX_md(e))\n# define EVP_MD_CTX_block_size(e)        EVP_MD_block_size(EVP_MD_CTX_md(e))\n# define EVP_MD_CTX_type(e)              EVP_MD_type(EVP_MD_CTX_md(e))\n\nint EVP_CIPHER_nid(const EVP_CIPHER *cipher);\n# define EVP_CIPHER_name(e)              OBJ_nid2sn(EVP_CIPHER_nid(e))\nint EVP_CIPHER_block_size(const EVP_CIPHER *cipher);\nint EVP_CIPHER_key_length(const EVP_CIPHER *cipher);\nint EVP_CIPHER_iv_length(const EVP_CIPHER *cipher);\nunsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher);\n# define EVP_CIPHER_mode(e)              (EVP_CIPHER_flags(e) & EVP_CIPH_MODE)\n\nconst EVP_CIPHER *EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx);\nint EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx);\nint EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx);\nint EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx);\nint EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx);\nint EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in);\nvoid *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx);\nvoid EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data);\n# define EVP_CIPHER_CTX_type(c)         EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c))\nunsigned long EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx);\n# define EVP_CIPHER_CTX_mode(e)          (EVP_CIPHER_CTX_flags(e) & EVP_CIPH_MODE)\n\n# define EVP_ENCODE_LENGTH(l)    (((l+2)/3*4)+(l/48+1)*2+80)\n# define EVP_DECODE_LENGTH(l)    ((l+3)/4*3+80)\n\n# define EVP_SignInit_ex(a,b,c)          EVP_DigestInit_ex(a,b,c)\n# define EVP_SignInit(a,b)               EVP_DigestInit(a,b)\n# define EVP_SignUpdate(a,b,c)           EVP_DigestUpdate(a,b,c)\n# define EVP_VerifyInit_ex(a,b,c)        EVP_DigestInit_ex(a,b,c)\n# define EVP_VerifyInit(a,b)             EVP_DigestInit(a,b)\n# define EVP_VerifyUpdate(a,b,c)         EVP_DigestUpdate(a,b,c)\n# define EVP_OpenUpdate(a,b,c,d,e)       EVP_DecryptUpdate(a,b,c,d,e)\n# define EVP_SealUpdate(a,b,c,d,e)       EVP_EncryptUpdate(a,b,c,d,e)\n# define EVP_DigestSignUpdate(a,b,c)     EVP_DigestUpdate(a,b,c)\n# define EVP_DigestVerifyUpdate(a,b,c)   EVP_DigestUpdate(a,b,c)\n\n# ifdef CONST_STRICT\nvoid BIO_set_md(BIO *, const EVP_MD *md);\n# else\n#  define BIO_set_md(b,md)               BIO_ctrl(b,BIO_C_SET_MD,0,(char *)md)\n# endif\n# define BIO_get_md(b,mdp)               BIO_ctrl(b,BIO_C_GET_MD,0,(char *)mdp)\n# define BIO_get_md_ctx(b,mdcp)     BIO_ctrl(b,BIO_C_GET_MD_CTX,0,(char *)mdcp)\n# define BIO_set_md_ctx(b,mdcp)     BIO_ctrl(b,BIO_C_SET_MD_CTX,0,(char *)mdcp)\n# define BIO_get_cipher_status(b)        BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL)\n# define BIO_get_cipher_ctx(b,c_pp)      BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp)\n\nint EVP_Cipher(EVP_CIPHER_CTX *c,\n               unsigned char *out, const unsigned char *in, unsigned int inl);\n\n# define EVP_add_cipher_alias(n,alias) \\\n        OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n))\n# define EVP_add_digest_alias(n,alias) \\\n        OBJ_NAME_add((alias),OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS,(n))\n# define EVP_delete_cipher_alias(alias) \\\n        OBJ_NAME_remove(alias,OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS);\n# define EVP_delete_digest_alias(alias) \\\n        OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS);\n\nvoid EVP_MD_CTX_init(EVP_MD_CTX *ctx);\nint EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx);\nEVP_MD_CTX *EVP_MD_CTX_create(void);\nvoid EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);\nint EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in);\nvoid EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags);\nvoid EVP_MD_CTX_clear_flags(EVP_MD_CTX *ctx, int flags);\nint EVP_MD_CTX_test_flags(const EVP_MD_CTX *ctx, int flags);\nint EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);\nint EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt);\nint EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s);\nint EVP_Digest(const void *data, size_t count,\n               unsigned char *md, unsigned int *size, const EVP_MD *type,\n               ENGINE *impl);\n\nint EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in);\nint EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type);\nint EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s);\n\nint EVP_read_pw_string(char *buf, int length, const char *prompt, int verify);\nint EVP_read_pw_string_min(char *buf, int minlen, int maxlen,\n                           const char *prompt, int verify);\nvoid EVP_set_pw_prompt(const char *prompt);\nchar *EVP_get_pw_prompt(void);\n\nint EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md,\n                   const unsigned char *salt, const unsigned char *data,\n                   int datal, int count, unsigned char *key,\n                   unsigned char *iv);\n\nvoid EVP_CIPHER_CTX_set_flags(EVP_CIPHER_CTX *ctx, int flags);\nvoid EVP_CIPHER_CTX_clear_flags(EVP_CIPHER_CTX *ctx, int flags);\nint EVP_CIPHER_CTX_test_flags(const EVP_CIPHER_CTX *ctx, int flags);\n\nint EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,\n                    const unsigned char *key, const unsigned char *iv);\nint EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,\n                       ENGINE *impl, const unsigned char *key,\n                       const unsigned char *iv);\nint EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,\n                      const unsigned char *in, int inl);\nint EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);\nint EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);\n\nint EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,\n                    const unsigned char *key, const unsigned char *iv);\nint EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,\n                       ENGINE *impl, const unsigned char *key,\n                       const unsigned char *iv);\nint EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,\n                      const unsigned char *in, int inl);\nint EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);\nint EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);\n\nint EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,\n                   const unsigned char *key, const unsigned char *iv,\n                   int enc);\nint EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,\n                      ENGINE *impl, const unsigned char *key,\n                      const unsigned char *iv, int enc);\nint EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl,\n                     const unsigned char *in, int inl);\nint EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);\nint EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl);\n\nint EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s,\n                  EVP_PKEY *pkey);\n\nint EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,\n                    unsigned int siglen, EVP_PKEY *pkey);\n\nint EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,\n                       const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);\nint EVP_DigestSignFinal(EVP_MD_CTX *ctx,\n                        unsigned char *sigret, size_t *siglen);\n\nint EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx,\n                         const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);\nint EVP_DigestVerifyFinal(EVP_MD_CTX *ctx,\n                          const unsigned char *sig, size_t siglen);\n\nint EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,\n                 const unsigned char *ek, int ekl, const unsigned char *iv,\n                 EVP_PKEY *priv);\nint EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);\n\nint EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,\n                 unsigned char **ek, int *ekl, unsigned char *iv,\n                 EVP_PKEY **pubk, int npubk);\nint EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);\n\nvoid EVP_EncodeInit(EVP_ENCODE_CTX *ctx);\nvoid EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,\n                      const unsigned char *in, int inl);\nvoid EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl);\nint EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n);\n\nvoid EVP_DecodeInit(EVP_ENCODE_CTX *ctx);\nint EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,\n                     const unsigned char *in, int inl);\nint EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned\n                    char *out, int *outl);\nint EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n);\n\nvoid EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a);\nint EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a);\nEVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void);\nvoid EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a);\nint EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);\nint EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad);\nint EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);\nint EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key);\n\n# ifndef OPENSSL_NO_BIO\nBIO_METHOD *BIO_f_md(void);\nBIO_METHOD *BIO_f_base64(void);\nBIO_METHOD *BIO_f_cipher(void);\nBIO_METHOD *BIO_f_reliable(void);\nvoid BIO_set_cipher(BIO *b, const EVP_CIPHER *c, const unsigned char *k,\n                    const unsigned char *i, int enc);\n# endif\n\nconst EVP_MD *EVP_md_null(void);\n# ifndef OPENSSL_NO_MD2\nconst EVP_MD *EVP_md2(void);\n# endif\n# ifndef OPENSSL_NO_MD4\nconst EVP_MD *EVP_md4(void);\n# endif\n# ifndef OPENSSL_NO_MD5\nconst EVP_MD *EVP_md5(void);\n# endif\n# ifndef OPENSSL_NO_SHA\nconst EVP_MD *EVP_sha(void);\nconst EVP_MD *EVP_sha1(void);\nconst EVP_MD *EVP_dss(void);\nconst EVP_MD *EVP_dss1(void);\nconst EVP_MD *EVP_ecdsa(void);\n# endif\n# ifndef OPENSSL_NO_SHA256\nconst EVP_MD *EVP_sha224(void);\nconst EVP_MD *EVP_sha256(void);\n# endif\n# ifndef OPENSSL_NO_SHA512\nconst EVP_MD *EVP_sha384(void);\nconst EVP_MD *EVP_sha512(void);\n# endif\n# ifndef OPENSSL_NO_MDC2\nconst EVP_MD *EVP_mdc2(void);\n# endif\n# ifndef OPENSSL_NO_RIPEMD\nconst EVP_MD *EVP_ripemd160(void);\n# endif\n# ifndef OPENSSL_NO_WHIRLPOOL\nconst EVP_MD *EVP_whirlpool(void);\n# endif\nconst EVP_CIPHER *EVP_enc_null(void); /* does nothing :-) */\n# ifndef OPENSSL_NO_DES\nconst EVP_CIPHER *EVP_des_ecb(void);\nconst EVP_CIPHER *EVP_des_ede(void);\nconst EVP_CIPHER *EVP_des_ede3(void);\nconst EVP_CIPHER *EVP_des_ede_ecb(void);\nconst EVP_CIPHER *EVP_des_ede3_ecb(void);\nconst EVP_CIPHER *EVP_des_cfb64(void);\n#  define EVP_des_cfb EVP_des_cfb64\nconst EVP_CIPHER *EVP_des_cfb1(void);\nconst EVP_CIPHER *EVP_des_cfb8(void);\nconst EVP_CIPHER *EVP_des_ede_cfb64(void);\n#  define EVP_des_ede_cfb EVP_des_ede_cfb64\n#  if 0\nconst EVP_CIPHER *EVP_des_ede_cfb1(void);\nconst EVP_CIPHER *EVP_des_ede_cfb8(void);\n#  endif\nconst EVP_CIPHER *EVP_des_ede3_cfb64(void);\n#  define EVP_des_ede3_cfb EVP_des_ede3_cfb64\nconst EVP_CIPHER *EVP_des_ede3_cfb1(void);\nconst EVP_CIPHER *EVP_des_ede3_cfb8(void);\nconst EVP_CIPHER *EVP_des_ofb(void);\nconst EVP_CIPHER *EVP_des_ede_ofb(void);\nconst EVP_CIPHER *EVP_des_ede3_ofb(void);\nconst EVP_CIPHER *EVP_des_cbc(void);\nconst EVP_CIPHER *EVP_des_ede_cbc(void);\nconst EVP_CIPHER *EVP_des_ede3_cbc(void);\nconst EVP_CIPHER *EVP_desx_cbc(void);\nconst EVP_CIPHER *EVP_des_ede3_wrap(void);\n/*\n * This should now be supported through the dev_crypto ENGINE. But also, why\n * are rc4 and md5 declarations made here inside a \"NO_DES\" precompiler\n * branch?\n */\n#  if 0\n#   ifdef OPENSSL_OPENBSD_DEV_CRYPTO\nconst EVP_CIPHER *EVP_dev_crypto_des_ede3_cbc(void);\nconst EVP_CIPHER *EVP_dev_crypto_rc4(void);\nconst EVP_MD *EVP_dev_crypto_md5(void);\n#   endif\n#  endif\n# endif\n# ifndef OPENSSL_NO_RC4\nconst EVP_CIPHER *EVP_rc4(void);\nconst EVP_CIPHER *EVP_rc4_40(void);\n#  ifndef OPENSSL_NO_MD5\nconst EVP_CIPHER *EVP_rc4_hmac_md5(void);\n#  endif\n# endif\n# ifndef OPENSSL_NO_IDEA\nconst EVP_CIPHER *EVP_idea_ecb(void);\nconst EVP_CIPHER *EVP_idea_cfb64(void);\n#  define EVP_idea_cfb EVP_idea_cfb64\nconst EVP_CIPHER *EVP_idea_ofb(void);\nconst EVP_CIPHER *EVP_idea_cbc(void);\n# endif\n# ifndef OPENSSL_NO_RC2\nconst EVP_CIPHER *EVP_rc2_ecb(void);\nconst EVP_CIPHER *EVP_rc2_cbc(void);\nconst EVP_CIPHER *EVP_rc2_40_cbc(void);\nconst EVP_CIPHER *EVP_rc2_64_cbc(void);\nconst EVP_CIPHER *EVP_rc2_cfb64(void);\n#  define EVP_rc2_cfb EVP_rc2_cfb64\nconst EVP_CIPHER *EVP_rc2_ofb(void);\n# endif\n# ifndef OPENSSL_NO_BF\nconst EVP_CIPHER *EVP_bf_ecb(void);\nconst EVP_CIPHER *EVP_bf_cbc(void);\nconst EVP_CIPHER *EVP_bf_cfb64(void);\n#  define EVP_bf_cfb EVP_bf_cfb64\nconst EVP_CIPHER *EVP_bf_ofb(void);\n# endif\n# ifndef OPENSSL_NO_CAST\nconst EVP_CIPHER *EVP_cast5_ecb(void);\nconst EVP_CIPHER *EVP_cast5_cbc(void);\nconst EVP_CIPHER *EVP_cast5_cfb64(void);\n#  define EVP_cast5_cfb EVP_cast5_cfb64\nconst EVP_CIPHER *EVP_cast5_ofb(void);\n# endif\n# ifndef OPENSSL_NO_RC5\nconst EVP_CIPHER *EVP_rc5_32_12_16_cbc(void);\nconst EVP_CIPHER *EVP_rc5_32_12_16_ecb(void);\nconst EVP_CIPHER *EVP_rc5_32_12_16_cfb64(void);\n#  define EVP_rc5_32_12_16_cfb EVP_rc5_32_12_16_cfb64\nconst EVP_CIPHER *EVP_rc5_32_12_16_ofb(void);\n# endif\n# ifndef OPENSSL_NO_AES\nconst EVP_CIPHER *EVP_aes_128_ecb(void);\nconst EVP_CIPHER *EVP_aes_128_cbc(void);\nconst EVP_CIPHER *EVP_aes_128_cfb1(void);\nconst EVP_CIPHER *EVP_aes_128_cfb8(void);\nconst EVP_CIPHER *EVP_aes_128_cfb128(void);\n#  define EVP_aes_128_cfb EVP_aes_128_cfb128\nconst EVP_CIPHER *EVP_aes_128_ofb(void);\nconst EVP_CIPHER *EVP_aes_128_ctr(void);\nconst EVP_CIPHER *EVP_aes_128_ccm(void);\nconst EVP_CIPHER *EVP_aes_128_gcm(void);\nconst EVP_CIPHER *EVP_aes_128_xts(void);\nconst EVP_CIPHER *EVP_aes_128_wrap(void);\nconst EVP_CIPHER *EVP_aes_192_ecb(void);\nconst EVP_CIPHER *EVP_aes_192_cbc(void);\nconst EVP_CIPHER *EVP_aes_192_cfb1(void);\nconst EVP_CIPHER *EVP_aes_192_cfb8(void);\nconst EVP_CIPHER *EVP_aes_192_cfb128(void);\n#  define EVP_aes_192_cfb EVP_aes_192_cfb128\nconst EVP_CIPHER *EVP_aes_192_ofb(void);\nconst EVP_CIPHER *EVP_aes_192_ctr(void);\nconst EVP_CIPHER *EVP_aes_192_ccm(void);\nconst EVP_CIPHER *EVP_aes_192_gcm(void);\nconst EVP_CIPHER *EVP_aes_192_wrap(void);\nconst EVP_CIPHER *EVP_aes_256_ecb(void);\nconst EVP_CIPHER *EVP_aes_256_cbc(void);\nconst EVP_CIPHER *EVP_aes_256_cfb1(void);\nconst EVP_CIPHER *EVP_aes_256_cfb8(void);\nconst EVP_CIPHER *EVP_aes_256_cfb128(void);\n#  define EVP_aes_256_cfb EVP_aes_256_cfb128\nconst EVP_CIPHER *EVP_aes_256_ofb(void);\nconst EVP_CIPHER *EVP_aes_256_ctr(void);\nconst EVP_CIPHER *EVP_aes_256_ccm(void);\nconst EVP_CIPHER *EVP_aes_256_gcm(void);\nconst EVP_CIPHER *EVP_aes_256_xts(void);\nconst EVP_CIPHER *EVP_aes_256_wrap(void);\n#  if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA1)\nconst EVP_CIPHER *EVP_aes_128_cbc_hmac_sha1(void);\nconst EVP_CIPHER *EVP_aes_256_cbc_hmac_sha1(void);\n#  endif\n#  ifndef OPENSSL_NO_SHA256\nconst EVP_CIPHER *EVP_aes_128_cbc_hmac_sha256(void);\nconst EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void);\n#  endif\n# endif\n# ifndef OPENSSL_NO_CAMELLIA\nconst EVP_CIPHER *EVP_camellia_128_ecb(void);\nconst EVP_CIPHER *EVP_camellia_128_cbc(void);\nconst EVP_CIPHER *EVP_camellia_128_cfb1(void);\nconst EVP_CIPHER *EVP_camellia_128_cfb8(void);\nconst EVP_CIPHER *EVP_camellia_128_cfb128(void);\n#  define EVP_camellia_128_cfb EVP_camellia_128_cfb128\nconst EVP_CIPHER *EVP_camellia_128_ofb(void);\nconst EVP_CIPHER *EVP_camellia_192_ecb(void);\nconst EVP_CIPHER *EVP_camellia_192_cbc(void);\nconst EVP_CIPHER *EVP_camellia_192_cfb1(void);\nconst EVP_CIPHER *EVP_camellia_192_cfb8(void);\nconst EVP_CIPHER *EVP_camellia_192_cfb128(void);\n#  define EVP_camellia_192_cfb EVP_camellia_192_cfb128\nconst EVP_CIPHER *EVP_camellia_192_ofb(void);\nconst EVP_CIPHER *EVP_camellia_256_ecb(void);\nconst EVP_CIPHER *EVP_camellia_256_cbc(void);\nconst EVP_CIPHER *EVP_camellia_256_cfb1(void);\nconst EVP_CIPHER *EVP_camellia_256_cfb8(void);\nconst EVP_CIPHER *EVP_camellia_256_cfb128(void);\n#  define EVP_camellia_256_cfb EVP_camellia_256_cfb128\nconst EVP_CIPHER *EVP_camellia_256_ofb(void);\n# endif\n\n# ifndef OPENSSL_NO_SEED\nconst EVP_CIPHER *EVP_seed_ecb(void);\nconst EVP_CIPHER *EVP_seed_cbc(void);\nconst EVP_CIPHER *EVP_seed_cfb128(void);\n#  define EVP_seed_cfb EVP_seed_cfb128\nconst EVP_CIPHER *EVP_seed_ofb(void);\n# endif\n\nvoid OPENSSL_add_all_algorithms_noconf(void);\nvoid OPENSSL_add_all_algorithms_conf(void);\n\n# ifdef OPENSSL_LOAD_CONF\n#  define OpenSSL_add_all_algorithms() \\\n                OPENSSL_add_all_algorithms_conf()\n# else\n#  define OpenSSL_add_all_algorithms() \\\n                OPENSSL_add_all_algorithms_noconf()\n# endif\n\nvoid OpenSSL_add_all_ciphers(void);\nvoid OpenSSL_add_all_digests(void);\n# define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms()\n# define SSLeay_add_all_ciphers() OpenSSL_add_all_ciphers()\n# define SSLeay_add_all_digests() OpenSSL_add_all_digests()\n\nint EVP_add_cipher(const EVP_CIPHER *cipher);\nint EVP_add_digest(const EVP_MD *digest);\n\nconst EVP_CIPHER *EVP_get_cipherbyname(const char *name);\nconst EVP_MD *EVP_get_digestbyname(const char *name);\nvoid EVP_cleanup(void);\n\nvoid EVP_CIPHER_do_all(void (*fn) (const EVP_CIPHER *ciph,\n                                   const char *from, const char *to, void *x),\n                       void *arg);\nvoid EVP_CIPHER_do_all_sorted(void (*fn)\n                               (const EVP_CIPHER *ciph, const char *from,\n                                const char *to, void *x), void *arg);\n\nvoid EVP_MD_do_all(void (*fn) (const EVP_MD *ciph,\n                               const char *from, const char *to, void *x),\n                   void *arg);\nvoid EVP_MD_do_all_sorted(void (*fn)\n                           (const EVP_MD *ciph, const char *from,\n                            const char *to, void *x), void *arg);\n\nint EVP_PKEY_decrypt_old(unsigned char *dec_key,\n                         const unsigned char *enc_key, int enc_key_len,\n                         EVP_PKEY *private_key);\nint EVP_PKEY_encrypt_old(unsigned char *enc_key,\n                         const unsigned char *key, int key_len,\n                         EVP_PKEY *pub_key);\nint EVP_PKEY_type(int type);\nint EVP_PKEY_id(const EVP_PKEY *pkey);\nint EVP_PKEY_base_id(const EVP_PKEY *pkey);\nint EVP_PKEY_bits(EVP_PKEY *pkey);\nint EVP_PKEY_size(EVP_PKEY *pkey);\nint EVP_PKEY_set_type(EVP_PKEY *pkey, int type);\nint EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len);\nint EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key);\nvoid *EVP_PKEY_get0(EVP_PKEY *pkey);\n\n# ifndef OPENSSL_NO_RSA\nstruct rsa_st;\nint EVP_PKEY_set1_RSA(EVP_PKEY *pkey, struct rsa_st *key);\nstruct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey);\n# endif\n# ifndef OPENSSL_NO_DSA\nstruct dsa_st;\nint EVP_PKEY_set1_DSA(EVP_PKEY *pkey, struct dsa_st *key);\nstruct dsa_st *EVP_PKEY_get1_DSA(EVP_PKEY *pkey);\n# endif\n# ifndef OPENSSL_NO_DH\nstruct dh_st;\nint EVP_PKEY_set1_DH(EVP_PKEY *pkey, struct dh_st *key);\nstruct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey);\n# endif\n# ifndef OPENSSL_NO_EC\nstruct ec_key_st;\nint EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, struct ec_key_st *key);\nstruct ec_key_st *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey);\n# endif\n\nEVP_PKEY *EVP_PKEY_new(void);\nvoid EVP_PKEY_free(EVP_PKEY *pkey);\n\nEVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,\n                        long length);\nint i2d_PublicKey(EVP_PKEY *a, unsigned char **pp);\n\nEVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp,\n                         long length);\nEVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,\n                             long length);\nint i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp);\n\nint EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from);\nint EVP_PKEY_missing_parameters(const EVP_PKEY *pkey);\nint EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode);\nint EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b);\n\nint EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);\n\nint EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey,\n                          int indent, ASN1_PCTX *pctx);\nint EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey,\n                           int indent, ASN1_PCTX *pctx);\nint EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey,\n                          int indent, ASN1_PCTX *pctx);\n\nint EVP_PKEY_get_default_digest_nid(EVP_PKEY *pkey, int *pnid);\n\nint EVP_CIPHER_type(const EVP_CIPHER *ctx);\n\n/* calls methods */\nint EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type);\nint EVP_CIPHER_asn1_to_param(EVP_CIPHER_CTX *c, ASN1_TYPE *type);\n\n/* These are used by EVP_CIPHER methods */\nint EVP_CIPHER_set_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);\nint EVP_CIPHER_get_asn1_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type);\n\n/* PKCS5 password based encryption */\nint PKCS5_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,\n                       ASN1_TYPE *param, const EVP_CIPHER *cipher,\n                       const EVP_MD *md, int en_de);\nint PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,\n                           const unsigned char *salt, int saltlen, int iter,\n                           int keylen, unsigned char *out);\nint PKCS5_PBKDF2_HMAC(const char *pass, int passlen,\n                      const unsigned char *salt, int saltlen, int iter,\n                      const EVP_MD *digest, int keylen, unsigned char *out);\nint PKCS5_v2_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,\n                          ASN1_TYPE *param, const EVP_CIPHER *cipher,\n                          const EVP_MD *md, int en_de);\n\nvoid PKCS5_PBE_add(void);\n\nint EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen,\n                       ASN1_TYPE *param, EVP_CIPHER_CTX *ctx, int en_de);\n\n/* PBE type */\n\n/* Can appear as the outermost AlgorithmIdentifier */\n# define EVP_PBE_TYPE_OUTER      0x0\n/* Is an PRF type OID */\n# define EVP_PBE_TYPE_PRF        0x1\n\nint EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid,\n                         int md_nid, EVP_PBE_KEYGEN *keygen);\nint EVP_PBE_alg_add(int nid, const EVP_CIPHER *cipher, const EVP_MD *md,\n                    EVP_PBE_KEYGEN *keygen);\nint EVP_PBE_find(int type, int pbe_nid, int *pcnid, int *pmnid,\n                 EVP_PBE_KEYGEN **pkeygen);\nvoid EVP_PBE_cleanup(void);\n\n# define ASN1_PKEY_ALIAS         0x1\n# define ASN1_PKEY_DYNAMIC       0x2\n# define ASN1_PKEY_SIGPARAM_NULL 0x4\n\n# define ASN1_PKEY_CTRL_PKCS7_SIGN       0x1\n# define ASN1_PKEY_CTRL_PKCS7_ENCRYPT    0x2\n# define ASN1_PKEY_CTRL_DEFAULT_MD_NID   0x3\n# define ASN1_PKEY_CTRL_CMS_SIGN         0x5\n# define ASN1_PKEY_CTRL_CMS_ENVELOPE     0x7\n# define ASN1_PKEY_CTRL_CMS_RI_TYPE      0x8\n\nint EVP_PKEY_asn1_get_count(void);\nconst EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_get0(int idx);\nconst EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find(ENGINE **pe, int type);\nconst EVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_find_str(ENGINE **pe,\n                                                   const char *str, int len);\nint EVP_PKEY_asn1_add0(const EVP_PKEY_ASN1_METHOD *ameth);\nint EVP_PKEY_asn1_add_alias(int to, int from);\nint EVP_PKEY_asn1_get0_info(int *ppkey_id, int *pkey_base_id,\n                            int *ppkey_flags, const char **pinfo,\n                            const char **ppem_str,\n                            const EVP_PKEY_ASN1_METHOD *ameth);\n\nconst EVP_PKEY_ASN1_METHOD *EVP_PKEY_get0_asn1(EVP_PKEY *pkey);\nEVP_PKEY_ASN1_METHOD *EVP_PKEY_asn1_new(int id, int flags,\n                                        const char *pem_str,\n                                        const char *info);\nvoid EVP_PKEY_asn1_copy(EVP_PKEY_ASN1_METHOD *dst,\n                        const EVP_PKEY_ASN1_METHOD *src);\nvoid EVP_PKEY_asn1_free(EVP_PKEY_ASN1_METHOD *ameth);\nvoid EVP_PKEY_asn1_set_public(EVP_PKEY_ASN1_METHOD *ameth,\n                              int (*pub_decode) (EVP_PKEY *pk,\n                                                 X509_PUBKEY *pub),\n                              int (*pub_encode) (X509_PUBKEY *pub,\n                                                 const EVP_PKEY *pk),\n                              int (*pub_cmp) (const EVP_PKEY *a,\n                                              const EVP_PKEY *b),\n                              int (*pub_print) (BIO *out,\n                                                const EVP_PKEY *pkey,\n                                                int indent, ASN1_PCTX *pctx),\n                              int (*pkey_size) (const EVP_PKEY *pk),\n                              int (*pkey_bits) (const EVP_PKEY *pk));\nvoid EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,\n                               int (*priv_decode) (EVP_PKEY *pk,\n                                                   PKCS8_PRIV_KEY_INFO\n                                                   *p8inf),\n                               int (*priv_encode) (PKCS8_PRIV_KEY_INFO *p8,\n                                                   const EVP_PKEY *pk),\n                               int (*priv_print) (BIO *out,\n                                                  const EVP_PKEY *pkey,\n                                                  int indent,\n                                                  ASN1_PCTX *pctx));\nvoid EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,\n                             int (*param_decode) (EVP_PKEY *pkey,\n                                                  const unsigned char **pder,\n                                                  int derlen),\n                             int (*param_encode) (const EVP_PKEY *pkey,\n                                                  unsigned char **pder),\n                             int (*param_missing) (const EVP_PKEY *pk),\n                             int (*param_copy) (EVP_PKEY *to,\n                                                const EVP_PKEY *from),\n                             int (*param_cmp) (const EVP_PKEY *a,\n                                               const EVP_PKEY *b),\n                             int (*param_print) (BIO *out,\n                                                 const EVP_PKEY *pkey,\n                                                 int indent,\n                                                 ASN1_PCTX *pctx));\n\nvoid EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth,\n                            void (*pkey_free) (EVP_PKEY *pkey));\nvoid EVP_PKEY_asn1_set_ctrl(EVP_PKEY_ASN1_METHOD *ameth,\n                            int (*pkey_ctrl) (EVP_PKEY *pkey, int op,\n                                              long arg1, void *arg2));\nvoid EVP_PKEY_asn1_set_item(EVP_PKEY_ASN1_METHOD *ameth,\n                            int (*item_verify) (EVP_MD_CTX *ctx,\n                                                const ASN1_ITEM *it,\n                                                void *asn,\n                                                X509_ALGOR *a,\n                                                ASN1_BIT_STRING *sig,\n                                                EVP_PKEY *pkey),\n                            int (*item_sign) (EVP_MD_CTX *ctx,\n                                              const ASN1_ITEM *it,\n                                              void *asn,\n                                              X509_ALGOR *alg1,\n                                              X509_ALGOR *alg2,\n                                              ASN1_BIT_STRING *sig));\n\n# define EVP_PKEY_OP_UNDEFINED           0\n# define EVP_PKEY_OP_PARAMGEN            (1<<1)\n# define EVP_PKEY_OP_KEYGEN              (1<<2)\n# define EVP_PKEY_OP_SIGN                (1<<3)\n# define EVP_PKEY_OP_VERIFY              (1<<4)\n# define EVP_PKEY_OP_VERIFYRECOVER       (1<<5)\n# define EVP_PKEY_OP_SIGNCTX             (1<<6)\n# define EVP_PKEY_OP_VERIFYCTX           (1<<7)\n# define EVP_PKEY_OP_ENCRYPT             (1<<8)\n# define EVP_PKEY_OP_DECRYPT             (1<<9)\n# define EVP_PKEY_OP_DERIVE              (1<<10)\n\n# define EVP_PKEY_OP_TYPE_SIG    \\\n        (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER \\\n                | EVP_PKEY_OP_SIGNCTX | EVP_PKEY_OP_VERIFYCTX)\n\n# define EVP_PKEY_OP_TYPE_CRYPT \\\n        (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT)\n\n# define EVP_PKEY_OP_TYPE_NOGEN \\\n        (EVP_PKEY_OP_SIG | EVP_PKEY_OP_CRYPT | EVP_PKEY_OP_DERIVE)\n\n# define EVP_PKEY_OP_TYPE_GEN \\\n                (EVP_PKEY_OP_PARAMGEN | EVP_PKEY_OP_KEYGEN)\n\n# define  EVP_PKEY_CTX_set_signature_md(ctx, md) \\\n                EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG,  \\\n                                        EVP_PKEY_CTRL_MD, 0, (void *)md)\n\n# define  EVP_PKEY_CTX_get_signature_md(ctx, pmd)        \\\n                EVP_PKEY_CTX_ctrl(ctx, -1, EVP_PKEY_OP_TYPE_SIG,  \\\n                                        EVP_PKEY_CTRL_GET_MD, 0, (void *)pmd)\n\n# define EVP_PKEY_CTRL_MD                1\n# define EVP_PKEY_CTRL_PEER_KEY          2\n\n# define EVP_PKEY_CTRL_PKCS7_ENCRYPT     3\n# define EVP_PKEY_CTRL_PKCS7_DECRYPT     4\n\n# define EVP_PKEY_CTRL_PKCS7_SIGN        5\n\n# define EVP_PKEY_CTRL_SET_MAC_KEY       6\n\n# define EVP_PKEY_CTRL_DIGESTINIT        7\n\n/* Used by GOST key encryption in TLS */\n# define EVP_PKEY_CTRL_SET_IV            8\n\n# define EVP_PKEY_CTRL_CMS_ENCRYPT       9\n# define EVP_PKEY_CTRL_CMS_DECRYPT       10\n# define EVP_PKEY_CTRL_CMS_SIGN          11\n\n# define EVP_PKEY_CTRL_CIPHER            12\n\n# define EVP_PKEY_CTRL_GET_MD            13\n\n# define EVP_PKEY_ALG_CTRL               0x1000\n\n# define EVP_PKEY_FLAG_AUTOARGLEN        2\n/*\n * Method handles all operations: don't assume any digest related defaults.\n */\n# define EVP_PKEY_FLAG_SIGCTX_CUSTOM     4\n\nconst EVP_PKEY_METHOD *EVP_PKEY_meth_find(int type);\nEVP_PKEY_METHOD *EVP_PKEY_meth_new(int id, int flags);\nvoid EVP_PKEY_meth_get0_info(int *ppkey_id, int *pflags,\n                             const EVP_PKEY_METHOD *meth);\nvoid EVP_PKEY_meth_copy(EVP_PKEY_METHOD *dst, const EVP_PKEY_METHOD *src);\nvoid EVP_PKEY_meth_free(EVP_PKEY_METHOD *pmeth);\nint EVP_PKEY_meth_add0(const EVP_PKEY_METHOD *pmeth);\n\nEVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);\nEVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);\nEVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx);\nvoid EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx);\n\nint EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype,\n                      int cmd, int p1, void *p2);\nint EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type,\n                          const char *value);\n\nint EVP_PKEY_CTX_get_operation(EVP_PKEY_CTX *ctx);\nvoid EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen);\n\nEVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e,\n                               const unsigned char *key, int keylen);\n\nvoid EVP_PKEY_CTX_set_data(EVP_PKEY_CTX *ctx, void *data);\nvoid *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx);\nEVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx);\n\nEVP_PKEY *EVP_PKEY_CTX_get0_peerkey(EVP_PKEY_CTX *ctx);\n\nvoid EVP_PKEY_CTX_set_app_data(EVP_PKEY_CTX *ctx, void *data);\nvoid *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx);\n\nint EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx);\nint EVP_PKEY_sign(EVP_PKEY_CTX *ctx,\n                  unsigned char *sig, size_t *siglen,\n                  const unsigned char *tbs, size_t tbslen);\nint EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx);\nint EVP_PKEY_verify(EVP_PKEY_CTX *ctx,\n                    const unsigned char *sig, size_t siglen,\n                    const unsigned char *tbs, size_t tbslen);\nint EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx);\nint EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx,\n                            unsigned char *rout, size_t *routlen,\n                            const unsigned char *sig, size_t siglen);\nint EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx);\nint EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx,\n                     unsigned char *out, size_t *outlen,\n                     const unsigned char *in, size_t inlen);\nint EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx);\nint EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx,\n                     unsigned char *out, size_t *outlen,\n                     const unsigned char *in, size_t inlen);\n\nint EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx);\nint EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer);\nint EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen);\n\ntypedef int EVP_PKEY_gen_cb (EVP_PKEY_CTX *ctx);\n\nint EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx);\nint EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey);\nint EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx);\nint EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey);\n\nvoid EVP_PKEY_CTX_set_cb(EVP_PKEY_CTX *ctx, EVP_PKEY_gen_cb *cb);\nEVP_PKEY_gen_cb *EVP_PKEY_CTX_get_cb(EVP_PKEY_CTX *ctx);\n\nint EVP_PKEY_CTX_get_keygen_info(EVP_PKEY_CTX *ctx, int idx);\n\nvoid EVP_PKEY_meth_set_init(EVP_PKEY_METHOD *pmeth,\n                            int (*init) (EVP_PKEY_CTX *ctx));\n\nvoid EVP_PKEY_meth_set_copy(EVP_PKEY_METHOD *pmeth,\n                            int (*copy) (EVP_PKEY_CTX *dst,\n                                         EVP_PKEY_CTX *src));\n\nvoid EVP_PKEY_meth_set_cleanup(EVP_PKEY_METHOD *pmeth,\n                               void (*cleanup) (EVP_PKEY_CTX *ctx));\n\nvoid EVP_PKEY_meth_set_paramgen(EVP_PKEY_METHOD *pmeth,\n                                int (*paramgen_init) (EVP_PKEY_CTX *ctx),\n                                int (*paramgen) (EVP_PKEY_CTX *ctx,\n                                                 EVP_PKEY *pkey));\n\nvoid EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth,\n                              int (*keygen_init) (EVP_PKEY_CTX *ctx),\n                              int (*keygen) (EVP_PKEY_CTX *ctx,\n                                             EVP_PKEY *pkey));\n\nvoid EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth,\n                            int (*sign_init) (EVP_PKEY_CTX *ctx),\n                            int (*sign) (EVP_PKEY_CTX *ctx,\n                                         unsigned char *sig, size_t *siglen,\n                                         const unsigned char *tbs,\n                                         size_t tbslen));\n\nvoid EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth,\n                              int (*verify_init) (EVP_PKEY_CTX *ctx),\n                              int (*verify) (EVP_PKEY_CTX *ctx,\n                                             const unsigned char *sig,\n                                             size_t siglen,\n                                             const unsigned char *tbs,\n                                             size_t tbslen));\n\nvoid EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth,\n                                      int (*verify_recover_init) (EVP_PKEY_CTX\n                                                                  *ctx),\n                                      int (*verify_recover) (EVP_PKEY_CTX\n                                                             *ctx,\n                                                             unsigned char\n                                                             *sig,\n                                                             size_t *siglen,\n                                                             const unsigned\n                                                             char *tbs,\n                                                             size_t tbslen));\n\nvoid EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth,\n                               int (*signctx_init) (EVP_PKEY_CTX *ctx,\n                                                    EVP_MD_CTX *mctx),\n                               int (*signctx) (EVP_PKEY_CTX *ctx,\n                                               unsigned char *sig,\n                                               size_t *siglen,\n                                               EVP_MD_CTX *mctx));\n\nvoid EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth,\n                                 int (*verifyctx_init) (EVP_PKEY_CTX *ctx,\n                                                        EVP_MD_CTX *mctx),\n                                 int (*verifyctx) (EVP_PKEY_CTX *ctx,\n                                                   const unsigned char *sig,\n                                                   int siglen,\n                                                   EVP_MD_CTX *mctx));\n\nvoid EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth,\n                               int (*encrypt_init) (EVP_PKEY_CTX *ctx),\n                               int (*encryptfn) (EVP_PKEY_CTX *ctx,\n                                                 unsigned char *out,\n                                                 size_t *outlen,\n                                                 const unsigned char *in,\n                                                 size_t inlen));\n\nvoid EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth,\n                               int (*decrypt_init) (EVP_PKEY_CTX *ctx),\n                               int (*decrypt) (EVP_PKEY_CTX *ctx,\n                                               unsigned char *out,\n                                               size_t *outlen,\n                                               const unsigned char *in,\n                                               size_t inlen));\n\nvoid EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth,\n                              int (*derive_init) (EVP_PKEY_CTX *ctx),\n                              int (*derive) (EVP_PKEY_CTX *ctx,\n                                             unsigned char *key,\n                                             size_t *keylen));\n\nvoid EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth,\n                            int (*ctrl) (EVP_PKEY_CTX *ctx, int type, int p1,\n                                         void *p2),\n                            int (*ctrl_str) (EVP_PKEY_CTX *ctx,\n                                             const char *type,\n                                             const char *value));\n\nvoid EVP_PKEY_meth_get_init(EVP_PKEY_METHOD *pmeth,\n                            int (**pinit) (EVP_PKEY_CTX *ctx));\n\nvoid EVP_PKEY_meth_get_copy(EVP_PKEY_METHOD *pmeth,\n                            int (**pcopy) (EVP_PKEY_CTX *dst,\n                                           EVP_PKEY_CTX *src));\n\nvoid EVP_PKEY_meth_get_cleanup(EVP_PKEY_METHOD *pmeth,\n                               void (**pcleanup) (EVP_PKEY_CTX *ctx));\n\nvoid EVP_PKEY_meth_get_paramgen(EVP_PKEY_METHOD *pmeth,\n                                int (**pparamgen_init) (EVP_PKEY_CTX *ctx),\n                                int (**pparamgen) (EVP_PKEY_CTX *ctx,\n                                                   EVP_PKEY *pkey));\n\nvoid EVP_PKEY_meth_get_keygen(EVP_PKEY_METHOD *pmeth,\n                              int (**pkeygen_init) (EVP_PKEY_CTX *ctx),\n                              int (**pkeygen) (EVP_PKEY_CTX *ctx,\n                                               EVP_PKEY *pkey));\n\nvoid EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth,\n                            int (**psign_init) (EVP_PKEY_CTX *ctx),\n                            int (**psign) (EVP_PKEY_CTX *ctx,\n                                           unsigned char *sig, size_t *siglen,\n                                           const unsigned char *tbs,\n                                           size_t tbslen));\n\nvoid EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth,\n                              int (**pverify_init) (EVP_PKEY_CTX *ctx),\n                              int (**pverify) (EVP_PKEY_CTX *ctx,\n                                               const unsigned char *sig,\n                                               size_t siglen,\n                                               const unsigned char *tbs,\n                                               size_t tbslen));\n\nvoid EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth,\n                                      int (**pverify_recover_init) (EVP_PKEY_CTX\n                                                                    *ctx),\n                                      int (**pverify_recover) (EVP_PKEY_CTX\n                                                               *ctx,\n                                                               unsigned char\n                                                               *sig,\n                                                               size_t *siglen,\n                                                               const unsigned\n                                                               char *tbs,\n                                                               size_t tbslen));\n\nvoid EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth,\n                               int (**psignctx_init) (EVP_PKEY_CTX *ctx,\n                                                      EVP_MD_CTX *mctx),\n                               int (**psignctx) (EVP_PKEY_CTX *ctx,\n                                                 unsigned char *sig,\n                                                 size_t *siglen,\n                                                 EVP_MD_CTX *mctx));\n\nvoid EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth,\n                                 int (**pverifyctx_init) (EVP_PKEY_CTX *ctx,\n                                                          EVP_MD_CTX *mctx),\n                                 int (**pverifyctx) (EVP_PKEY_CTX *ctx,\n                                                     const unsigned char *sig,\n                                                     int siglen,\n                                                     EVP_MD_CTX *mctx));\n\nvoid EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth,\n                               int (**pencrypt_init) (EVP_PKEY_CTX *ctx),\n                               int (**pencryptfn) (EVP_PKEY_CTX *ctx,\n                                                   unsigned char *out,\n                                                   size_t *outlen,\n                                                   const unsigned char *in,\n                                                   size_t inlen));\n\nvoid EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth,\n                               int (**pdecrypt_init) (EVP_PKEY_CTX *ctx),\n                               int (**pdecrypt) (EVP_PKEY_CTX *ctx,\n                                                 unsigned char *out,\n                                                 size_t *outlen,\n                                                 const unsigned char *in,\n                                                 size_t inlen));\n\nvoid EVP_PKEY_meth_get_derive(EVP_PKEY_METHOD *pmeth,\n                              int (**pderive_init) (EVP_PKEY_CTX *ctx),\n                              int (**pderive) (EVP_PKEY_CTX *ctx,\n                                               unsigned char *key,\n                                               size_t *keylen));\n\nvoid EVP_PKEY_meth_get_ctrl(EVP_PKEY_METHOD *pmeth,\n                            int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1,\n                                           void *p2),\n                            int (**pctrl_str) (EVP_PKEY_CTX *ctx,\n                                               const char *type,\n                                               const char *value));\n\nvoid EVP_add_alg_module(void);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\n\nvoid ERR_load_EVP_strings(void);\n\n/* Error codes for the EVP functions. */\n\n/* Function codes. */\n# define EVP_F_AESNI_INIT_KEY                             165\n# define EVP_F_AESNI_XTS_CIPHER                           176\n# define EVP_F_AES_INIT_KEY                               133\n# define EVP_F_AES_T4_INIT_KEY                            178\n# define EVP_F_AES_XTS                                    172\n# define EVP_F_AES_XTS_CIPHER                             175\n# define EVP_F_ALG_MODULE_INIT                            177\n# define EVP_F_CAMELLIA_INIT_KEY                          159\n# define EVP_F_CMAC_INIT                                  173\n# define EVP_F_CMLL_T4_INIT_KEY                           179\n# define EVP_F_D2I_PKEY                                   100\n# define EVP_F_DO_SIGVER_INIT                             161\n# define EVP_F_DSAPKEY2PKCS8                              134\n# define EVP_F_DSA_PKEY2PKCS8                             135\n# define EVP_F_ECDSA_PKEY2PKCS8                           129\n# define EVP_F_ECKEY_PKEY2PKCS8                           132\n# define EVP_F_EVP_CIPHERINIT_EX                          123\n# define EVP_F_EVP_CIPHER_CTX_COPY                        163\n# define EVP_F_EVP_CIPHER_CTX_CTRL                        124\n# define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH              122\n# define EVP_F_EVP_DECRYPTFINAL_EX                        101\n# define EVP_F_EVP_DIGESTINIT_EX                          128\n# define EVP_F_EVP_ENCRYPTFINAL_EX                        127\n# define EVP_F_EVP_MD_CTX_COPY_EX                         110\n# define EVP_F_EVP_MD_SIZE                                162\n# define EVP_F_EVP_OPENINIT                               102\n# define EVP_F_EVP_PBE_ALG_ADD                            115\n# define EVP_F_EVP_PBE_ALG_ADD_TYPE                       160\n# define EVP_F_EVP_PBE_CIPHERINIT                         116\n# define EVP_F_EVP_PKCS82PKEY                             111\n# define EVP_F_EVP_PKCS82PKEY_BROKEN                      136\n# define EVP_F_EVP_PKEY2PKCS8_BROKEN                      113\n# define EVP_F_EVP_PKEY_COPY_PARAMETERS                   103\n# define EVP_F_EVP_PKEY_CTX_CTRL                          137\n# define EVP_F_EVP_PKEY_CTX_CTRL_STR                      150\n# define EVP_F_EVP_PKEY_CTX_DUP                           156\n# define EVP_F_EVP_PKEY_DECRYPT                           104\n# define EVP_F_EVP_PKEY_DECRYPT_INIT                      138\n# define EVP_F_EVP_PKEY_DECRYPT_OLD                       151\n# define EVP_F_EVP_PKEY_DERIVE                            153\n# define EVP_F_EVP_PKEY_DERIVE_INIT                       154\n# define EVP_F_EVP_PKEY_DERIVE_SET_PEER                   155\n# define EVP_F_EVP_PKEY_ENCRYPT                           105\n# define EVP_F_EVP_PKEY_ENCRYPT_INIT                      139\n# define EVP_F_EVP_PKEY_ENCRYPT_OLD                       152\n# define EVP_F_EVP_PKEY_GET1_DH                           119\n# define EVP_F_EVP_PKEY_GET1_DSA                          120\n# define EVP_F_EVP_PKEY_GET1_ECDSA                        130\n# define EVP_F_EVP_PKEY_GET1_EC_KEY                       131\n# define EVP_F_EVP_PKEY_GET1_RSA                          121\n# define EVP_F_EVP_PKEY_KEYGEN                            146\n# define EVP_F_EVP_PKEY_KEYGEN_INIT                       147\n# define EVP_F_EVP_PKEY_NEW                               106\n# define EVP_F_EVP_PKEY_PARAMGEN                          148\n# define EVP_F_EVP_PKEY_PARAMGEN_INIT                     149\n# define EVP_F_EVP_PKEY_SIGN                              140\n# define EVP_F_EVP_PKEY_SIGN_INIT                         141\n# define EVP_F_EVP_PKEY_VERIFY                            142\n# define EVP_F_EVP_PKEY_VERIFY_INIT                       143\n# define EVP_F_EVP_PKEY_VERIFY_RECOVER                    144\n# define EVP_F_EVP_PKEY_VERIFY_RECOVER_INIT               145\n# define EVP_F_EVP_RIJNDAEL                               126\n# define EVP_F_EVP_SIGNFINAL                              107\n# define EVP_F_EVP_VERIFYFINAL                            108\n# define EVP_F_FIPS_CIPHERINIT                            166\n# define EVP_F_FIPS_CIPHER_CTX_COPY                       170\n# define EVP_F_FIPS_CIPHER_CTX_CTRL                       167\n# define EVP_F_FIPS_CIPHER_CTX_SET_KEY_LENGTH             171\n# define EVP_F_FIPS_DIGESTINIT                            168\n# define EVP_F_FIPS_MD_CTX_COPY                           169\n# define EVP_F_HMAC_INIT_EX                               174\n# define EVP_F_INT_CTX_NEW                                157\n# define EVP_F_PKCS5_PBE_KEYIVGEN                         117\n# define EVP_F_PKCS5_V2_PBE_KEYIVGEN                      118\n# define EVP_F_PKCS5_V2_PBKDF2_KEYIVGEN                   164\n# define EVP_F_PKCS8_SET_BROKEN                           112\n# define EVP_F_PKEY_SET_TYPE                              158\n# define EVP_F_RC2_MAGIC_TO_METH                          109\n# define EVP_F_RC5_CTRL                                   125\n\n/* Reason codes. */\n# define EVP_R_AES_IV_SETUP_FAILED                        162\n# define EVP_R_AES_KEY_SETUP_FAILED                       143\n# define EVP_R_ASN1_LIB                                   140\n# define EVP_R_BAD_BLOCK_LENGTH                           136\n# define EVP_R_BAD_DECRYPT                                100\n# define EVP_R_BAD_KEY_LENGTH                             137\n# define EVP_R_BN_DECODE_ERROR                            112\n# define EVP_R_BN_PUBKEY_ERROR                            113\n# define EVP_R_BUFFER_TOO_SMALL                           155\n# define EVP_R_CAMELLIA_KEY_SETUP_FAILED                  157\n# define EVP_R_CIPHER_PARAMETER_ERROR                     122\n# define EVP_R_COMMAND_NOT_SUPPORTED                      147\n# define EVP_R_CTRL_NOT_IMPLEMENTED                       132\n# define EVP_R_CTRL_OPERATION_NOT_IMPLEMENTED             133\n# define EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH          138\n# define EVP_R_DECODE_ERROR                               114\n# define EVP_R_DIFFERENT_KEY_TYPES                        101\n# define EVP_R_DIFFERENT_PARAMETERS                       153\n# define EVP_R_DISABLED_FOR_FIPS                          163\n# define EVP_R_ENCODE_ERROR                               115\n# define EVP_R_ERROR_LOADING_SECTION                      165\n# define EVP_R_ERROR_SETTING_FIPS_MODE                    166\n# define EVP_R_EVP_PBE_CIPHERINIT_ERROR                   119\n# define EVP_R_EXPECTING_AN_RSA_KEY                       127\n# define EVP_R_EXPECTING_A_DH_KEY                         128\n# define EVP_R_EXPECTING_A_DSA_KEY                        129\n# define EVP_R_EXPECTING_A_ECDSA_KEY                      141\n# define EVP_R_EXPECTING_A_EC_KEY                         142\n# define EVP_R_FIPS_MODE_NOT_SUPPORTED                    167\n# define EVP_R_INITIALIZATION_ERROR                       134\n# define EVP_R_INPUT_NOT_INITIALIZED                      111\n# define EVP_R_INVALID_DIGEST                             152\n# define EVP_R_INVALID_FIPS_MODE                          168\n# define EVP_R_INVALID_KEY                                171\n# define EVP_R_INVALID_KEY_LENGTH                         130\n# define EVP_R_INVALID_OPERATION                          148\n# define EVP_R_IV_TOO_LARGE                               102\n# define EVP_R_KEYGEN_FAILURE                             120\n# define EVP_R_MESSAGE_DIGEST_IS_NULL                     159\n# define EVP_R_METHOD_NOT_SUPPORTED                       144\n# define EVP_R_MISSING_PARAMETERS                         103\n# define EVP_R_NO_CIPHER_SET                              131\n# define EVP_R_NO_DEFAULT_DIGEST                          158\n# define EVP_R_NO_DIGEST_SET                              139\n# define EVP_R_NO_DSA_PARAMETERS                          116\n# define EVP_R_NO_KEY_SET                                 154\n# define EVP_R_NO_OPERATION_SET                           149\n# define EVP_R_NO_SIGN_FUNCTION_CONFIGURED                104\n# define EVP_R_NO_VERIFY_FUNCTION_CONFIGURED              105\n# define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE   150\n# define EVP_R_OPERATON_NOT_INITIALIZED                   151\n# define EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE                  117\n# define EVP_R_PRIVATE_KEY_DECODE_ERROR                   145\n# define EVP_R_PRIVATE_KEY_ENCODE_ERROR                   146\n# define EVP_R_PUBLIC_KEY_NOT_RSA                         106\n# define EVP_R_TOO_LARGE                                  164\n# define EVP_R_UNKNOWN_CIPHER                             160\n# define EVP_R_UNKNOWN_DIGEST                             161\n# define EVP_R_UNKNOWN_OPTION                             169\n# define EVP_R_UNKNOWN_PBE_ALGORITHM                      121\n# define EVP_R_UNSUPORTED_NUMBER_OF_ROUNDS                135\n# define EVP_R_UNSUPPORTED_ALGORITHM                      156\n# define EVP_R_UNSUPPORTED_CIPHER                         107\n# define EVP_R_UNSUPPORTED_KEYLENGTH                      123\n# define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION        124\n# define EVP_R_UNSUPPORTED_KEY_SIZE                       108\n# define EVP_R_UNSUPPORTED_PRF                            125\n# define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM          118\n# define EVP_R_UNSUPPORTED_SALT_TYPE                      126\n# define EVP_R_WRAP_MODE_NOT_ALLOWED                      170\n# define EVP_R_WRONG_FINAL_BLOCK_LENGTH                   109\n# define EVP_R_WRONG_PUBLIC_KEY_TYPE                      110\n\n# ifdef  __cplusplus\n}\n# endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/hmac.h",
    "content": "/* crypto/hmac/hmac.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n#ifndef HEADER_HMAC_H\n# define HEADER_HMAC_H\n\n# include <openssl/opensslconf.h>\n\n# ifdef OPENSSL_NO_HMAC\n#  error HMAC is disabled.\n# endif\n\n# include <openssl/evp.h>\n\n# define HMAC_MAX_MD_CBLOCK      128/* largest known is SHA512 */\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct hmac_ctx_st {\n    const EVP_MD *md;\n    EVP_MD_CTX md_ctx;\n    EVP_MD_CTX i_ctx;\n    EVP_MD_CTX o_ctx;\n    unsigned int key_length;\n    unsigned char key[HMAC_MAX_MD_CBLOCK];\n} HMAC_CTX;\n\n# define HMAC_size(e)    (EVP_MD_size((e)->md))\n\nvoid HMAC_CTX_init(HMAC_CTX *ctx);\nvoid HMAC_CTX_cleanup(HMAC_CTX *ctx);\n\n/* deprecated */\n# define HMAC_cleanup(ctx) HMAC_CTX_cleanup(ctx)\n\n/* deprecated */\nint HMAC_Init(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md);\nint HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,\n                 const EVP_MD *md, ENGINE *impl);\nint HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len);\nint HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);\nunsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,\n                    const unsigned char *d, size_t n, unsigned char *md,\n                    unsigned int *md_len);\nint HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);\n\nvoid HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/idea.h",
    "content": "/* crypto/idea/idea.h */\n/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_IDEA_H\n# define HEADER_IDEA_H\n\n# include <openssl/opensslconf.h>/* IDEA_INT, OPENSSL_NO_IDEA */\n\n# ifdef OPENSSL_NO_IDEA\n#  error IDEA is disabled.\n# endif\n\n# define IDEA_ENCRYPT    1\n# define IDEA_DECRYPT    0\n\n# define IDEA_BLOCK      8\n# define IDEA_KEY_LENGTH 16\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct idea_key_st {\n    IDEA_INT data[9][6];\n} IDEA_KEY_SCHEDULE;\n\nconst char *idea_options(void);\nvoid idea_ecb_encrypt(const unsigned char *in, unsigned char *out,\n                      IDEA_KEY_SCHEDULE *ks);\n# ifdef OPENSSL_FIPS\nvoid private_idea_set_encrypt_key(const unsigned char *key,\n                                  IDEA_KEY_SCHEDULE *ks);\n# endif\nvoid idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);\nvoid idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);\nvoid idea_cbc_encrypt(const unsigned char *in, unsigned char *out,\n                      long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,\n                      int enc);\nvoid idea_cfb64_encrypt(const unsigned char *in, unsigned char *out,\n                        long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,\n                        int *num, int enc);\nvoid idea_ofb64_encrypt(const unsigned char *in, unsigned char *out,\n                        long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,\n                        int *num);\nvoid idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/krb5_asn.h",
    "content": "/* krb5_asn.h */\n/*\n * Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project, **\n * using ocsp/{*.h,*asn*.c} as a starting point\n */\n\n/* ====================================================================\n * Copyright (c) 1998-2000 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_KRB5_ASN_H\n# define HEADER_KRB5_ASN_H\n\n/*\n * #include <krb5.h>\n */\n# include <openssl/safestack.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * ASN.1 from Kerberos RFC 1510\n */\n\n/*-     EncryptedData ::=   SEQUENCE {\n *              etype[0]                      INTEGER, -- EncryptionType\n *              kvno[1]                       INTEGER OPTIONAL,\n *              cipher[2]                     OCTET STRING -- ciphertext\n *      }\n */\ntypedef struct krb5_encdata_st {\n    ASN1_INTEGER *etype;\n    ASN1_INTEGER *kvno;\n    ASN1_OCTET_STRING *cipher;\n} KRB5_ENCDATA;\n\nDECLARE_STACK_OF(KRB5_ENCDATA)\n\n/*-     PrincipalName ::=   SEQUENCE {\n *              name-type[0]                  INTEGER,\n *              name-string[1]                SEQUENCE OF GeneralString\n *      }\n */\ntypedef struct krb5_princname_st {\n    ASN1_INTEGER *nametype;\n    STACK_OF(ASN1_GENERALSTRING) *namestring;\n} KRB5_PRINCNAME;\n\nDECLARE_STACK_OF(KRB5_PRINCNAME)\n\n/*-     Ticket ::=      [APPLICATION 1] SEQUENCE {\n *              tkt-vno[0]                    INTEGER,\n *              realm[1]                      Realm,\n *              sname[2]                      PrincipalName,\n *              enc-part[3]                   EncryptedData\n *      }\n */\ntypedef struct krb5_tktbody_st {\n    ASN1_INTEGER *tktvno;\n    ASN1_GENERALSTRING *realm;\n    KRB5_PRINCNAME *sname;\n    KRB5_ENCDATA *encdata;\n} KRB5_TKTBODY;\n\ntypedef STACK_OF(KRB5_TKTBODY) KRB5_TICKET;\nDECLARE_STACK_OF(KRB5_TKTBODY)\n\n/*-     AP-REQ ::=      [APPLICATION 14] SEQUENCE {\n *              pvno[0]                       INTEGER,\n *              msg-type[1]                   INTEGER,\n *              ap-options[2]                 APOptions,\n *              ticket[3]                     Ticket,\n *              authenticator[4]              EncryptedData\n *      }\n *\n *      APOptions ::=   BIT STRING {\n *              reserved(0), use-session-key(1), mutual-required(2) }\n */\ntypedef struct krb5_ap_req_st {\n    ASN1_INTEGER *pvno;\n    ASN1_INTEGER *msgtype;\n    ASN1_BIT_STRING *apoptions;\n    KRB5_TICKET *ticket;\n    KRB5_ENCDATA *authenticator;\n} KRB5_APREQBODY;\n\ntypedef STACK_OF(KRB5_APREQBODY) KRB5_APREQ;\nDECLARE_STACK_OF(KRB5_APREQBODY)\n\n/*      Authenticator Stuff     */\n\n/*-     Checksum ::=   SEQUENCE {\n *              cksumtype[0]                  INTEGER,\n *              checksum[1]                   OCTET STRING\n *      }\n */\ntypedef struct krb5_checksum_st {\n    ASN1_INTEGER *ctype;\n    ASN1_OCTET_STRING *checksum;\n} KRB5_CHECKSUM;\n\nDECLARE_STACK_OF(KRB5_CHECKSUM)\n\n/*-     EncryptionKey ::=   SEQUENCE {\n *              keytype[0]                    INTEGER,\n *              keyvalue[1]                   OCTET STRING\n *      }\n */\ntypedef struct krb5_encryptionkey_st {\n    ASN1_INTEGER *ktype;\n    ASN1_OCTET_STRING *keyvalue;\n} KRB5_ENCKEY;\n\nDECLARE_STACK_OF(KRB5_ENCKEY)\n\n/*-     AuthorizationData ::=   SEQUENCE OF SEQUENCE {\n *              ad-type[0]                    INTEGER,\n *              ad-data[1]                    OCTET STRING\n *      }\n */\ntypedef struct krb5_authorization_st {\n    ASN1_INTEGER *adtype;\n    ASN1_OCTET_STRING *addata;\n} KRB5_AUTHDATA;\n\nDECLARE_STACK_OF(KRB5_AUTHDATA)\n\n/*-     -- Unencrypted authenticator\n *      Authenticator ::=    [APPLICATION 2] SEQUENCE    {\n *              authenticator-vno[0]          INTEGER,\n *              crealm[1]                     Realm,\n *              cname[2]                      PrincipalName,\n *              cksum[3]                      Checksum OPTIONAL,\n *              cusec[4]                      INTEGER,\n *              ctime[5]                      KerberosTime,\n *              subkey[6]                     EncryptionKey OPTIONAL,\n *              seq-number[7]                 INTEGER OPTIONAL,\n *              authorization-data[8]         AuthorizationData OPTIONAL\n *      }\n */\ntypedef struct krb5_authenticator_st {\n    ASN1_INTEGER *avno;\n    ASN1_GENERALSTRING *crealm;\n    KRB5_PRINCNAME *cname;\n    KRB5_CHECKSUM *cksum;\n    ASN1_INTEGER *cusec;\n    ASN1_GENERALIZEDTIME *ctime;\n    KRB5_ENCKEY *subkey;\n    ASN1_INTEGER *seqnum;\n    KRB5_AUTHDATA *authorization;\n} KRB5_AUTHENTBODY;\n\ntypedef STACK_OF(KRB5_AUTHENTBODY) KRB5_AUTHENT;\nDECLARE_STACK_OF(KRB5_AUTHENTBODY)\n\n/*-  DECLARE_ASN1_FUNCTIONS(type) = DECLARE_ASN1_FUNCTIONS_name(type, type) =\n *      type *name##_new(void);\n *      void name##_free(type *a);\n *      DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) =\n *       DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) =\n *        type *d2i_##name(type **a, const unsigned char **in, long len);\n *        int i2d_##name(type *a, unsigned char **out);\n *        DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it\n */\n\nDECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA)\nDECLARE_ASN1_FUNCTIONS(KRB5_PRINCNAME)\nDECLARE_ASN1_FUNCTIONS(KRB5_TKTBODY)\nDECLARE_ASN1_FUNCTIONS(KRB5_APREQBODY)\nDECLARE_ASN1_FUNCTIONS(KRB5_TICKET)\nDECLARE_ASN1_FUNCTIONS(KRB5_APREQ)\n\nDECLARE_ASN1_FUNCTIONS(KRB5_CHECKSUM)\nDECLARE_ASN1_FUNCTIONS(KRB5_ENCKEY)\nDECLARE_ASN1_FUNCTIONS(KRB5_AUTHDATA)\nDECLARE_ASN1_FUNCTIONS(KRB5_AUTHENTBODY)\nDECLARE_ASN1_FUNCTIONS(KRB5_AUTHENT)\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/kssl.h",
    "content": "/* ssl/kssl.h */\n/*\n * Written by Vern Staats <staatsvr@asc.hpc.mil> for the OpenSSL project\n * 2000. project 2000.\n */\n/* ====================================================================\n * Copyright (c) 2000 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n/*\n **      19990701        VRS     Started.\n */\n\n#ifndef KSSL_H\n# define KSSL_H\n\n# include <openssl/opensslconf.h>\n\n# ifndef OPENSSL_NO_KRB5\n\n#  include <stdio.h>\n#  include <ctype.h>\n#  include <krb5.h>\n#  ifdef OPENSSL_SYS_WIN32\n/*\n * These can sometimes get redefined indirectly by krb5 header files after\n * they get undefed in ossl_typ.h\n */\n#   undef X509_NAME\n#   undef X509_EXTENSIONS\n#   undef OCSP_REQUEST\n#   undef OCSP_RESPONSE\n#  endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/*\n *      Depending on which KRB5 implementation used, some types from\n *      the other may be missing.  Resolve that here and now\n */\n#  ifdef KRB5_HEIMDAL\ntypedef unsigned char krb5_octet;\n#   define FAR\n#  else\n\n#   ifndef FAR\n#    define FAR\n#   endif\n\n#  endif\n\n/*-\n *      Uncomment this to debug kssl problems or\n *      to trace usage of the Kerberos session key\n *\n *      #define         KSSL_DEBUG\n */\n\n#  ifndef KRB5SVC\n#   define KRB5SVC \"host\"\n#  endif\n\n#  ifndef KRB5KEYTAB\n#   define KRB5KEYTAB      \"/etc/krb5.keytab\"\n#  endif\n\n#  ifndef KRB5SENDAUTH\n#   define KRB5SENDAUTH    1\n#  endif\n\n#  ifndef KRB5CHECKAUTH\n#   define KRB5CHECKAUTH   1\n#  endif\n\n#  ifndef KSSL_CLOCKSKEW\n#   define KSSL_CLOCKSKEW  300;\n#  endif\n\n#  define KSSL_ERR_MAX    255\ntypedef struct kssl_err_st {\n    int reason;\n    char text[KSSL_ERR_MAX + 1];\n} KSSL_ERR;\n\n/*-     Context for passing\n *              (1) Kerberos session key to SSL, and\n *              (2)     Config data between application and SSL lib\n */\ntypedef struct kssl_ctx_st {\n    /*      used by:    disposition:            */\n    char *service_name;         /* C,S default ok (kssl) */\n    char *service_host;         /* C input, REQUIRED */\n    char *client_princ;         /* S output from krb5 ticket */\n    char *keytab_file;          /* S NULL (/etc/krb5.keytab) */\n    char *cred_cache;           /* C NULL (default) */\n    krb5_enctype enctype;\n    int length;\n    krb5_octet FAR *key;\n} KSSL_CTX;\n\n#  define KSSL_CLIENT     1\n#  define KSSL_SERVER     2\n#  define KSSL_SERVICE    3\n#  define KSSL_KEYTAB     4\n\n#  define KSSL_CTX_OK     0\n#  define KSSL_CTX_ERR    1\n#  define KSSL_NOMEM      2\n\n/* Public (for use by applications that use OpenSSL with Kerberos 5 support */\nkrb5_error_code kssl_ctx_setstring(KSSL_CTX *kssl_ctx, int which, char *text);\nKSSL_CTX *kssl_ctx_new(void);\nKSSL_CTX *kssl_ctx_free(KSSL_CTX *kssl_ctx);\nvoid kssl_ctx_show(KSSL_CTX *kssl_ctx);\nkrb5_error_code kssl_ctx_setprinc(KSSL_CTX *kssl_ctx, int which,\n                                  krb5_data *realm, krb5_data *entity,\n                                  int nentities);\nkrb5_error_code kssl_cget_tkt(KSSL_CTX *kssl_ctx, krb5_data **enc_tktp,\n                              krb5_data *authenp, KSSL_ERR *kssl_err);\nkrb5_error_code kssl_sget_tkt(KSSL_CTX *kssl_ctx, krb5_data *indata,\n                              krb5_ticket_times *ttimes, KSSL_ERR *kssl_err);\nkrb5_error_code kssl_ctx_setkey(KSSL_CTX *kssl_ctx, krb5_keyblock *session);\nvoid kssl_err_set(KSSL_ERR *kssl_err, int reason, char *text);\nvoid kssl_krb5_free_data_contents(krb5_context context, krb5_data *data);\nkrb5_error_code kssl_build_principal_2(krb5_context context,\n                                       krb5_principal *princ, int rlen,\n                                       const char *realm, int slen,\n                                       const char *svc, int hlen,\n                                       const char *host);\nkrb5_error_code kssl_validate_times(krb5_timestamp atime,\n                                    krb5_ticket_times *ttimes);\nkrb5_error_code kssl_check_authent(KSSL_CTX *kssl_ctx, krb5_data *authentp,\n                                   krb5_timestamp *atimep,\n                                   KSSL_ERR *kssl_err);\nunsigned char *kssl_skip_confound(krb5_enctype enctype, unsigned char *authn);\n\nvoid SSL_set0_kssl_ctx(SSL *s, KSSL_CTX *kctx);\nKSSL_CTX *SSL_get0_kssl_ctx(SSL *s);\nchar *kssl_ctx_get0_client_princ(KSSL_CTX *kctx);\n\n#ifdef  __cplusplus\n}\n#endif\n# endif                         /* OPENSSL_NO_KRB5 */\n#endif                          /* KSSL_H */\n"
  },
  {
    "path": "third_party/include/openssl/lhash.h",
    "content": "/* crypto/lhash/lhash.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n/*\n * Header for dynamic hash table routines Author - Eric Young\n */\n\n#ifndef HEADER_LHASH_H\n# define HEADER_LHASH_H\n\n# include <openssl/e_os2.h>\n# ifndef OPENSSL_NO_FP_API\n#  include <stdio.h>\n# endif\n\n# ifndef OPENSSL_NO_BIO\n#  include <openssl/bio.h>\n# endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct lhash_node_st {\n    void *data;\n    struct lhash_node_st *next;\n# ifndef OPENSSL_NO_HASH_COMP\n    unsigned long hash;\n# endif\n} LHASH_NODE;\n\ntypedef int (*LHASH_COMP_FN_TYPE) (const void *, const void *);\ntypedef unsigned long (*LHASH_HASH_FN_TYPE) (const void *);\ntypedef void (*LHASH_DOALL_FN_TYPE) (void *);\ntypedef void (*LHASH_DOALL_ARG_FN_TYPE) (void *, void *);\n\n/*\n * Macros for declaring and implementing type-safe wrappers for LHASH\n * callbacks. This way, callbacks can be provided to LHASH structures without\n * function pointer casting and the macro-defined callbacks provide\n * per-variable casting before deferring to the underlying type-specific\n * callbacks. NB: It is possible to place a \"static\" in front of both the\n * DECLARE and IMPLEMENT macros if the functions are strictly internal.\n */\n\n/* First: \"hash\" functions */\n# define DECLARE_LHASH_HASH_FN(name, o_type) \\\n        unsigned long name##_LHASH_HASH(const void *);\n# define IMPLEMENT_LHASH_HASH_FN(name, o_type) \\\n        unsigned long name##_LHASH_HASH(const void *arg) { \\\n                const o_type *a = arg; \\\n                return name##_hash(a); }\n# define LHASH_HASH_FN(name) name##_LHASH_HASH\n\n/* Second: \"compare\" functions */\n# define DECLARE_LHASH_COMP_FN(name, o_type) \\\n        int name##_LHASH_COMP(const void *, const void *);\n# define IMPLEMENT_LHASH_COMP_FN(name, o_type) \\\n        int name##_LHASH_COMP(const void *arg1, const void *arg2) { \\\n                const o_type *a = arg1;             \\\n                const o_type *b = arg2; \\\n                return name##_cmp(a,b); }\n# define LHASH_COMP_FN(name) name##_LHASH_COMP\n\n/* Third: \"doall\" functions */\n# define DECLARE_LHASH_DOALL_FN(name, o_type) \\\n        void name##_LHASH_DOALL(void *);\n# define IMPLEMENT_LHASH_DOALL_FN(name, o_type) \\\n        void name##_LHASH_DOALL(void *arg) { \\\n                o_type *a = arg; \\\n                name##_doall(a); }\n# define LHASH_DOALL_FN(name) name##_LHASH_DOALL\n\n/* Fourth: \"doall_arg\" functions */\n# define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \\\n        void name##_LHASH_DOALL_ARG(void *, void *);\n# define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \\\n        void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \\\n                o_type *a = arg1; \\\n                a_type *b = arg2; \\\n                name##_doall_arg(a, b); }\n# define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG\n\ntypedef struct lhash_st {\n    LHASH_NODE **b;\n    LHASH_COMP_FN_TYPE comp;\n    LHASH_HASH_FN_TYPE hash;\n    unsigned int num_nodes;\n    unsigned int num_alloc_nodes;\n    unsigned int p;\n    unsigned int pmax;\n    unsigned long up_load;      /* load times 256 */\n    unsigned long down_load;    /* load times 256 */\n    unsigned long num_items;\n    unsigned long num_expands;\n    unsigned long num_expand_reallocs;\n    unsigned long num_contracts;\n    unsigned long num_contract_reallocs;\n    unsigned long num_hash_calls;\n    unsigned long num_comp_calls;\n    unsigned long num_insert;\n    unsigned long num_replace;\n    unsigned long num_delete;\n    unsigned long num_no_delete;\n    unsigned long num_retrieve;\n    unsigned long num_retrieve_miss;\n    unsigned long num_hash_comps;\n    int error;\n} _LHASH;                       /* Do not use _LHASH directly, use LHASH_OF\n                                 * and friends */\n\n# define LH_LOAD_MULT    256\n\n/*\n * Indicates a malloc() error in the last call, this is only bad in\n * lh_insert().\n */\n# define lh_error(lh)    ((lh)->error)\n\n_LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c);\nvoid lh_free(_LHASH *lh);\nvoid *lh_insert(_LHASH *lh, void *data);\nvoid *lh_delete(_LHASH *lh, const void *data);\nvoid *lh_retrieve(_LHASH *lh, const void *data);\nvoid lh_doall(_LHASH *lh, LHASH_DOALL_FN_TYPE func);\nvoid lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg);\nunsigned long lh_strhash(const char *c);\nunsigned long lh_num_items(const _LHASH *lh);\n\n# ifndef OPENSSL_NO_FP_API\nvoid lh_stats(const _LHASH *lh, FILE *out);\nvoid lh_node_stats(const _LHASH *lh, FILE *out);\nvoid lh_node_usage_stats(const _LHASH *lh, FILE *out);\n# endif\n\n# ifndef OPENSSL_NO_BIO\nvoid lh_stats_bio(const _LHASH *lh, BIO *out);\nvoid lh_node_stats_bio(const _LHASH *lh, BIO *out);\nvoid lh_node_usage_stats_bio(const _LHASH *lh, BIO *out);\n# endif\n\n/* Type checking... */\n\n# define LHASH_OF(type) struct lhash_st_##type\n\n# define DECLARE_LHASH_OF(type) LHASH_OF(type) { int dummy; }\n\n# define CHECKED_LHASH_OF(type,lh) \\\n  ((_LHASH *)CHECKED_PTR_OF(LHASH_OF(type),lh))\n\n/* Define wrapper functions. */\n# define LHM_lh_new(type, name) \\\n  ((LHASH_OF(type) *)lh_new(LHASH_HASH_FN(name), LHASH_COMP_FN(name)))\n# define LHM_lh_error(type, lh) \\\n  lh_error(CHECKED_LHASH_OF(type,lh))\n# define LHM_lh_insert(type, lh, inst) \\\n  ((type *)lh_insert(CHECKED_LHASH_OF(type, lh), \\\n                     CHECKED_PTR_OF(type, inst)))\n# define LHM_lh_retrieve(type, lh, inst) \\\n  ((type *)lh_retrieve(CHECKED_LHASH_OF(type, lh), \\\n                       CHECKED_PTR_OF(type, inst)))\n# define LHM_lh_delete(type, lh, inst) \\\n  ((type *)lh_delete(CHECKED_LHASH_OF(type, lh),                        \\\n                     CHECKED_PTR_OF(type, inst)))\n# define LHM_lh_doall(type, lh,fn) lh_doall(CHECKED_LHASH_OF(type, lh), fn)\n# define LHM_lh_doall_arg(type, lh, fn, arg_type, arg) \\\n  lh_doall_arg(CHECKED_LHASH_OF(type, lh), fn, CHECKED_PTR_OF(arg_type, arg))\n# define LHM_lh_num_items(type, lh) lh_num_items(CHECKED_LHASH_OF(type, lh))\n# define LHM_lh_down_load(type, lh) (CHECKED_LHASH_OF(type, lh)->down_load)\n# define LHM_lh_node_stats_bio(type, lh, out) \\\n  lh_node_stats_bio(CHECKED_LHASH_OF(type, lh), out)\n# define LHM_lh_node_usage_stats_bio(type, lh, out) \\\n  lh_node_usage_stats_bio(CHECKED_LHASH_OF(type, lh), out)\n# define LHM_lh_stats_bio(type, lh, out) \\\n  lh_stats_bio(CHECKED_LHASH_OF(type, lh), out)\n# define LHM_lh_free(type, lh) lh_free(CHECKED_LHASH_OF(type, lh))\n\nDECLARE_LHASH_OF(OPENSSL_STRING);\nDECLARE_LHASH_OF(OPENSSL_CSTRING);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/md4.h",
    "content": "/* crypto/md4/md4.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_MD4_H\n# define HEADER_MD4_H\n\n# include <openssl/e_os2.h>\n# include <stddef.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# ifdef OPENSSL_NO_MD4\n#  error MD4 is disabled.\n# endif\n\n/*-\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n * ! MD4_LONG has to be at least 32 bits wide. If it's wider, then !\n * ! MD4_LONG_LOG2 has to be defined along.                        !\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n */\n\n# if defined(__LP32__)\n#  define MD4_LONG unsigned long\n# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)\n#  define MD4_LONG unsigned long\n#  define MD4_LONG_LOG2 3\n/*\n * _CRAY note. I could declare short, but I have no idea what impact\n * does it have on performance on none-T3E machines. I could declare\n * int, but at least on C90 sizeof(int) can be chosen at compile time.\n * So I've chosen long...\n *                                      <appro@fy.chalmers.se>\n */\n# else\n#  define MD4_LONG unsigned int\n# endif\n\n# define MD4_CBLOCK      64\n# define MD4_LBLOCK      (MD4_CBLOCK/4)\n# define MD4_DIGEST_LENGTH 16\n\ntypedef struct MD4state_st {\n    MD4_LONG A, B, C, D;\n    MD4_LONG Nl, Nh;\n    MD4_LONG data[MD4_LBLOCK];\n    unsigned int num;\n} MD4_CTX;\n\n# ifdef OPENSSL_FIPS\nint private_MD4_Init(MD4_CTX *c);\n# endif\nint MD4_Init(MD4_CTX *c);\nint MD4_Update(MD4_CTX *c, const void *data, size_t len);\nint MD4_Final(unsigned char *md, MD4_CTX *c);\nunsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md);\nvoid MD4_Transform(MD4_CTX *c, const unsigned char *b);\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/md5.h",
    "content": "/* crypto/md5/md5.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_MD5_H\n# define HEADER_MD5_H\n\n# include <openssl/e_os2.h>\n# include <stddef.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# ifdef OPENSSL_NO_MD5\n#  error MD5 is disabled.\n# endif\n\n/*\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n * ! MD5_LONG has to be at least 32 bits wide. If it's wider, then !\n * ! MD5_LONG_LOG2 has to be defined along.                        !\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n */\n\n# if defined(__LP32__)\n#  define MD5_LONG unsigned long\n# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)\n#  define MD5_LONG unsigned long\n#  define MD5_LONG_LOG2 3\n/*\n * _CRAY note. I could declare short, but I have no idea what impact\n * does it have on performance on none-T3E machines. I could declare\n * int, but at least on C90 sizeof(int) can be chosen at compile time.\n * So I've chosen long...\n *                                      <appro@fy.chalmers.se>\n */\n# else\n#  define MD5_LONG unsigned int\n# endif\n\n# define MD5_CBLOCK      64\n# define MD5_LBLOCK      (MD5_CBLOCK/4)\n# define MD5_DIGEST_LENGTH 16\n\ntypedef struct MD5state_st {\n    MD5_LONG A, B, C, D;\n    MD5_LONG Nl, Nh;\n    MD5_LONG data[MD5_LBLOCK];\n    unsigned int num;\n} MD5_CTX;\n\n# ifdef OPENSSL_FIPS\nint private_MD5_Init(MD5_CTX *c);\n# endif\nint MD5_Init(MD5_CTX *c);\nint MD5_Update(MD5_CTX *c, const void *data, size_t len);\nint MD5_Final(unsigned char *md, MD5_CTX *c);\nunsigned char *MD5(const unsigned char *d, size_t n, unsigned char *md);\nvoid MD5_Transform(MD5_CTX *c, const unsigned char *b);\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/mdc2.h",
    "content": "/* crypto/mdc2/mdc2.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_MDC2_H\n# define HEADER_MDC2_H\n\n# include <openssl/des.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# ifdef OPENSSL_NO_MDC2\n#  error MDC2 is disabled.\n# endif\n\n# define MDC2_BLOCK              8\n# define MDC2_DIGEST_LENGTH      16\n\ntypedef struct mdc2_ctx_st {\n    unsigned int num;\n    unsigned char data[MDC2_BLOCK];\n    DES_cblock h, hh;\n    int pad_type;               /* either 1 or 2, default 1 */\n} MDC2_CTX;\n\n# ifdef OPENSSL_FIPS\nint private_MDC2_Init(MDC2_CTX *c);\n# endif\nint MDC2_Init(MDC2_CTX *c);\nint MDC2_Update(MDC2_CTX *c, const unsigned char *data, size_t len);\nint MDC2_Final(unsigned char *md, MDC2_CTX *c);\nunsigned char *MDC2(const unsigned char *d, size_t n, unsigned char *md);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/modes.h",
    "content": "/* ====================================================================\n * Copyright (c) 2008 The OpenSSL Project. All rights reserved.\n *\n * Rights for redistribution and usage in source and binary\n * forms are granted according to the OpenSSL license.\n */\n\n#include <stddef.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\ntypedef void (*block128_f) (const unsigned char in[16],\n                            unsigned char out[16], const void *key);\n\ntypedef void (*cbc128_f) (const unsigned char *in, unsigned char *out,\n                          size_t len, const void *key,\n                          unsigned char ivec[16], int enc);\n\ntypedef void (*ctr128_f) (const unsigned char *in, unsigned char *out,\n                          size_t blocks, const void *key,\n                          const unsigned char ivec[16]);\n\ntypedef void (*ccm128_f) (const unsigned char *in, unsigned char *out,\n                          size_t blocks, const void *key,\n                          const unsigned char ivec[16],\n                          unsigned char cmac[16]);\n\nvoid CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,\n                           size_t len, const void *key,\n                           unsigned char ivec[16], block128_f block);\nvoid CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,\n                           size_t len, const void *key,\n                           unsigned char ivec[16], block128_f block);\n\nvoid CRYPTO_ctr128_encrypt(const unsigned char *in, unsigned char *out,\n                           size_t len, const void *key,\n                           unsigned char ivec[16],\n                           unsigned char ecount_buf[16], unsigned int *num,\n                           block128_f block);\n\nvoid CRYPTO_ctr128_encrypt_ctr32(const unsigned char *in, unsigned char *out,\n                                 size_t len, const void *key,\n                                 unsigned char ivec[16],\n                                 unsigned char ecount_buf[16],\n                                 unsigned int *num, ctr128_f ctr);\n\nvoid CRYPTO_ofb128_encrypt(const unsigned char *in, unsigned char *out,\n                           size_t len, const void *key,\n                           unsigned char ivec[16], int *num,\n                           block128_f block);\n\nvoid CRYPTO_cfb128_encrypt(const unsigned char *in, unsigned char *out,\n                           size_t len, const void *key,\n                           unsigned char ivec[16], int *num,\n                           int enc, block128_f block);\nvoid CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out,\n                             size_t length, const void *key,\n                             unsigned char ivec[16], int *num,\n                             int enc, block128_f block);\nvoid CRYPTO_cfb128_1_encrypt(const unsigned char *in, unsigned char *out,\n                             size_t bits, const void *key,\n                             unsigned char ivec[16], int *num,\n                             int enc, block128_f block);\n\nsize_t CRYPTO_cts128_encrypt_block(const unsigned char *in,\n                                   unsigned char *out, size_t len,\n                                   const void *key, unsigned char ivec[16],\n                                   block128_f block);\nsize_t CRYPTO_cts128_encrypt(const unsigned char *in, unsigned char *out,\n                             size_t len, const void *key,\n                             unsigned char ivec[16], cbc128_f cbc);\nsize_t CRYPTO_cts128_decrypt_block(const unsigned char *in,\n                                   unsigned char *out, size_t len,\n                                   const void *key, unsigned char ivec[16],\n                                   block128_f block);\nsize_t CRYPTO_cts128_decrypt(const unsigned char *in, unsigned char *out,\n                             size_t len, const void *key,\n                             unsigned char ivec[16], cbc128_f cbc);\n\nsize_t CRYPTO_nistcts128_encrypt_block(const unsigned char *in,\n                                       unsigned char *out, size_t len,\n                                       const void *key,\n                                       unsigned char ivec[16],\n                                       block128_f block);\nsize_t CRYPTO_nistcts128_encrypt(const unsigned char *in, unsigned char *out,\n                                 size_t len, const void *key,\n                                 unsigned char ivec[16], cbc128_f cbc);\nsize_t CRYPTO_nistcts128_decrypt_block(const unsigned char *in,\n                                       unsigned char *out, size_t len,\n                                       const void *key,\n                                       unsigned char ivec[16],\n                                       block128_f block);\nsize_t CRYPTO_nistcts128_decrypt(const unsigned char *in, unsigned char *out,\n                                 size_t len, const void *key,\n                                 unsigned char ivec[16], cbc128_f cbc);\n\ntypedef struct gcm128_context GCM128_CONTEXT;\n\nGCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block);\nvoid CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block);\nvoid CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const unsigned char *iv,\n                         size_t len);\nint CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const unsigned char *aad,\n                      size_t len);\nint CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx,\n                          const unsigned char *in, unsigned char *out,\n                          size_t len);\nint CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx,\n                          const unsigned char *in, unsigned char *out,\n                          size_t len);\nint CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx,\n                                const unsigned char *in, unsigned char *out,\n                                size_t len, ctr128_f stream);\nint CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx,\n                                const unsigned char *in, unsigned char *out,\n                                size_t len, ctr128_f stream);\nint CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const unsigned char *tag,\n                         size_t len);\nvoid CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len);\nvoid CRYPTO_gcm128_release(GCM128_CONTEXT *ctx);\n\ntypedef struct ccm128_context CCM128_CONTEXT;\n\nvoid CRYPTO_ccm128_init(CCM128_CONTEXT *ctx,\n                        unsigned int M, unsigned int L, void *key,\n                        block128_f block);\nint CRYPTO_ccm128_setiv(CCM128_CONTEXT *ctx, const unsigned char *nonce,\n                        size_t nlen, size_t mlen);\nvoid CRYPTO_ccm128_aad(CCM128_CONTEXT *ctx, const unsigned char *aad,\n                       size_t alen);\nint CRYPTO_ccm128_encrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,\n                          unsigned char *out, size_t len);\nint CRYPTO_ccm128_decrypt(CCM128_CONTEXT *ctx, const unsigned char *inp,\n                          unsigned char *out, size_t len);\nint CRYPTO_ccm128_encrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,\n                                unsigned char *out, size_t len,\n                                ccm128_f stream);\nint CRYPTO_ccm128_decrypt_ccm64(CCM128_CONTEXT *ctx, const unsigned char *inp,\n                                unsigned char *out, size_t len,\n                                ccm128_f stream);\nsize_t CRYPTO_ccm128_tag(CCM128_CONTEXT *ctx, unsigned char *tag, size_t len);\n\ntypedef struct xts128_context XTS128_CONTEXT;\n\nint CRYPTO_xts128_encrypt(const XTS128_CONTEXT *ctx,\n                          const unsigned char iv[16],\n                          const unsigned char *inp, unsigned char *out,\n                          size_t len, int enc);\n\nsize_t CRYPTO_128_wrap(void *key, const unsigned char *iv,\n                       unsigned char *out,\n                       const unsigned char *in, size_t inlen,\n                       block128_f block);\n\nsize_t CRYPTO_128_unwrap(void *key, const unsigned char *iv,\n                         unsigned char *out,\n                         const unsigned char *in, size_t inlen,\n                         block128_f block);\n\n#ifdef  __cplusplus\n}\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/obj_mac.h",
    "content": "/* crypto/objects/obj_mac.h */\n\n/*\n * THIS FILE IS GENERATED FROM objects.txt by objects.pl via the following\n * command: perl objects.pl objects.txt obj_mac.num obj_mac.h\n */\n\n/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#define SN_undef                        \"UNDEF\"\n#define LN_undef                        \"undefined\"\n#define NID_undef                       0\n#define OBJ_undef                       0L\n\n#define SN_itu_t                \"ITU-T\"\n#define LN_itu_t                \"itu-t\"\n#define NID_itu_t               645\n#define OBJ_itu_t               0L\n\n#define NID_ccitt               404\n#define OBJ_ccitt               OBJ_itu_t\n\n#define SN_iso          \"ISO\"\n#define LN_iso          \"iso\"\n#define NID_iso         181\n#define OBJ_iso         1L\n\n#define SN_joint_iso_itu_t              \"JOINT-ISO-ITU-T\"\n#define LN_joint_iso_itu_t              \"joint-iso-itu-t\"\n#define NID_joint_iso_itu_t             646\n#define OBJ_joint_iso_itu_t             2L\n\n#define NID_joint_iso_ccitt             393\n#define OBJ_joint_iso_ccitt             OBJ_joint_iso_itu_t\n\n#define SN_member_body          \"member-body\"\n#define LN_member_body          \"ISO Member Body\"\n#define NID_member_body         182\n#define OBJ_member_body         OBJ_iso,2L\n\n#define SN_identified_organization              \"identified-organization\"\n#define NID_identified_organization             676\n#define OBJ_identified_organization             OBJ_iso,3L\n\n#define SN_hmac_md5             \"HMAC-MD5\"\n#define LN_hmac_md5             \"hmac-md5\"\n#define NID_hmac_md5            780\n#define OBJ_hmac_md5            OBJ_identified_organization,6L,1L,5L,5L,8L,1L,1L\n\n#define SN_hmac_sha1            \"HMAC-SHA1\"\n#define LN_hmac_sha1            \"hmac-sha1\"\n#define NID_hmac_sha1           781\n#define OBJ_hmac_sha1           OBJ_identified_organization,6L,1L,5L,5L,8L,1L,2L\n\n#define SN_certicom_arc         \"certicom-arc\"\n#define NID_certicom_arc                677\n#define OBJ_certicom_arc                OBJ_identified_organization,132L\n\n#define SN_international_organizations          \"international-organizations\"\n#define LN_international_organizations          \"International Organizations\"\n#define NID_international_organizations         647\n#define OBJ_international_organizations         OBJ_joint_iso_itu_t,23L\n\n#define SN_wap          \"wap\"\n#define NID_wap         678\n#define OBJ_wap         OBJ_international_organizations,43L\n\n#define SN_wap_wsg              \"wap-wsg\"\n#define NID_wap_wsg             679\n#define OBJ_wap_wsg             OBJ_wap,1L\n\n#define SN_selected_attribute_types             \"selected-attribute-types\"\n#define LN_selected_attribute_types             \"Selected Attribute Types\"\n#define NID_selected_attribute_types            394\n#define OBJ_selected_attribute_types            OBJ_joint_iso_itu_t,5L,1L,5L\n\n#define SN_clearance            \"clearance\"\n#define NID_clearance           395\n#define OBJ_clearance           OBJ_selected_attribute_types,55L\n\n#define SN_ISO_US               \"ISO-US\"\n#define LN_ISO_US               \"ISO US Member Body\"\n#define NID_ISO_US              183\n#define OBJ_ISO_US              OBJ_member_body,840L\n\n#define SN_X9_57                \"X9-57\"\n#define LN_X9_57                \"X9.57\"\n#define NID_X9_57               184\n#define OBJ_X9_57               OBJ_ISO_US,10040L\n\n#define SN_X9cm         \"X9cm\"\n#define LN_X9cm         \"X9.57 CM ?\"\n#define NID_X9cm                185\n#define OBJ_X9cm                OBJ_X9_57,4L\n\n#define SN_dsa          \"DSA\"\n#define LN_dsa          \"dsaEncryption\"\n#define NID_dsa         116\n#define OBJ_dsa         OBJ_X9cm,1L\n\n#define SN_dsaWithSHA1          \"DSA-SHA1\"\n#define LN_dsaWithSHA1          \"dsaWithSHA1\"\n#define NID_dsaWithSHA1         113\n#define OBJ_dsaWithSHA1         OBJ_X9cm,3L\n\n#define SN_ansi_X9_62           \"ansi-X9-62\"\n#define LN_ansi_X9_62           \"ANSI X9.62\"\n#define NID_ansi_X9_62          405\n#define OBJ_ansi_X9_62          OBJ_ISO_US,10045L\n\n#define OBJ_X9_62_id_fieldType          OBJ_ansi_X9_62,1L\n\n#define SN_X9_62_prime_field            \"prime-field\"\n#define NID_X9_62_prime_field           406\n#define OBJ_X9_62_prime_field           OBJ_X9_62_id_fieldType,1L\n\n#define SN_X9_62_characteristic_two_field               \"characteristic-two-field\"\n#define NID_X9_62_characteristic_two_field              407\n#define OBJ_X9_62_characteristic_two_field              OBJ_X9_62_id_fieldType,2L\n\n#define SN_X9_62_id_characteristic_two_basis            \"id-characteristic-two-basis\"\n#define NID_X9_62_id_characteristic_two_basis           680\n#define OBJ_X9_62_id_characteristic_two_basis           OBJ_X9_62_characteristic_two_field,3L\n\n#define SN_X9_62_onBasis                \"onBasis\"\n#define NID_X9_62_onBasis               681\n#define OBJ_X9_62_onBasis               OBJ_X9_62_id_characteristic_two_basis,1L\n\n#define SN_X9_62_tpBasis                \"tpBasis\"\n#define NID_X9_62_tpBasis               682\n#define OBJ_X9_62_tpBasis               OBJ_X9_62_id_characteristic_two_basis,2L\n\n#define SN_X9_62_ppBasis                \"ppBasis\"\n#define NID_X9_62_ppBasis               683\n#define OBJ_X9_62_ppBasis               OBJ_X9_62_id_characteristic_two_basis,3L\n\n#define OBJ_X9_62_id_publicKeyType              OBJ_ansi_X9_62,2L\n\n#define SN_X9_62_id_ecPublicKey         \"id-ecPublicKey\"\n#define NID_X9_62_id_ecPublicKey                408\n#define OBJ_X9_62_id_ecPublicKey                OBJ_X9_62_id_publicKeyType,1L\n\n#define OBJ_X9_62_ellipticCurve         OBJ_ansi_X9_62,3L\n\n#define OBJ_X9_62_c_TwoCurve            OBJ_X9_62_ellipticCurve,0L\n\n#define SN_X9_62_c2pnb163v1             \"c2pnb163v1\"\n#define NID_X9_62_c2pnb163v1            684\n#define OBJ_X9_62_c2pnb163v1            OBJ_X9_62_c_TwoCurve,1L\n\n#define SN_X9_62_c2pnb163v2             \"c2pnb163v2\"\n#define NID_X9_62_c2pnb163v2            685\n#define OBJ_X9_62_c2pnb163v2            OBJ_X9_62_c_TwoCurve,2L\n\n#define SN_X9_62_c2pnb163v3             \"c2pnb163v3\"\n#define NID_X9_62_c2pnb163v3            686\n#define OBJ_X9_62_c2pnb163v3            OBJ_X9_62_c_TwoCurve,3L\n\n#define SN_X9_62_c2pnb176v1             \"c2pnb176v1\"\n#define NID_X9_62_c2pnb176v1            687\n#define OBJ_X9_62_c2pnb176v1            OBJ_X9_62_c_TwoCurve,4L\n\n#define SN_X9_62_c2tnb191v1             \"c2tnb191v1\"\n#define NID_X9_62_c2tnb191v1            688\n#define OBJ_X9_62_c2tnb191v1            OBJ_X9_62_c_TwoCurve,5L\n\n#define SN_X9_62_c2tnb191v2             \"c2tnb191v2\"\n#define NID_X9_62_c2tnb191v2            689\n#define OBJ_X9_62_c2tnb191v2            OBJ_X9_62_c_TwoCurve,6L\n\n#define SN_X9_62_c2tnb191v3             \"c2tnb191v3\"\n#define NID_X9_62_c2tnb191v3            690\n#define OBJ_X9_62_c2tnb191v3            OBJ_X9_62_c_TwoCurve,7L\n\n#define SN_X9_62_c2onb191v4             \"c2onb191v4\"\n#define NID_X9_62_c2onb191v4            691\n#define OBJ_X9_62_c2onb191v4            OBJ_X9_62_c_TwoCurve,8L\n\n#define SN_X9_62_c2onb191v5             \"c2onb191v5\"\n#define NID_X9_62_c2onb191v5            692\n#define OBJ_X9_62_c2onb191v5            OBJ_X9_62_c_TwoCurve,9L\n\n#define SN_X9_62_c2pnb208w1             \"c2pnb208w1\"\n#define NID_X9_62_c2pnb208w1            693\n#define OBJ_X9_62_c2pnb208w1            OBJ_X9_62_c_TwoCurve,10L\n\n#define SN_X9_62_c2tnb239v1             \"c2tnb239v1\"\n#define NID_X9_62_c2tnb239v1            694\n#define OBJ_X9_62_c2tnb239v1            OBJ_X9_62_c_TwoCurve,11L\n\n#define SN_X9_62_c2tnb239v2             \"c2tnb239v2\"\n#define NID_X9_62_c2tnb239v2            695\n#define OBJ_X9_62_c2tnb239v2            OBJ_X9_62_c_TwoCurve,12L\n\n#define SN_X9_62_c2tnb239v3             \"c2tnb239v3\"\n#define NID_X9_62_c2tnb239v3            696\n#define OBJ_X9_62_c2tnb239v3            OBJ_X9_62_c_TwoCurve,13L\n\n#define SN_X9_62_c2onb239v4             \"c2onb239v4\"\n#define NID_X9_62_c2onb239v4            697\n#define OBJ_X9_62_c2onb239v4            OBJ_X9_62_c_TwoCurve,14L\n\n#define SN_X9_62_c2onb239v5             \"c2onb239v5\"\n#define NID_X9_62_c2onb239v5            698\n#define OBJ_X9_62_c2onb239v5            OBJ_X9_62_c_TwoCurve,15L\n\n#define SN_X9_62_c2pnb272w1             \"c2pnb272w1\"\n#define NID_X9_62_c2pnb272w1            699\n#define OBJ_X9_62_c2pnb272w1            OBJ_X9_62_c_TwoCurve,16L\n\n#define SN_X9_62_c2pnb304w1             \"c2pnb304w1\"\n#define NID_X9_62_c2pnb304w1            700\n#define OBJ_X9_62_c2pnb304w1            OBJ_X9_62_c_TwoCurve,17L\n\n#define SN_X9_62_c2tnb359v1             \"c2tnb359v1\"\n#define NID_X9_62_c2tnb359v1            701\n#define OBJ_X9_62_c2tnb359v1            OBJ_X9_62_c_TwoCurve,18L\n\n#define SN_X9_62_c2pnb368w1             \"c2pnb368w1\"\n#define NID_X9_62_c2pnb368w1            702\n#define OBJ_X9_62_c2pnb368w1            OBJ_X9_62_c_TwoCurve,19L\n\n#define SN_X9_62_c2tnb431r1             \"c2tnb431r1\"\n#define NID_X9_62_c2tnb431r1            703\n#define OBJ_X9_62_c2tnb431r1            OBJ_X9_62_c_TwoCurve,20L\n\n#define OBJ_X9_62_primeCurve            OBJ_X9_62_ellipticCurve,1L\n\n#define SN_X9_62_prime192v1             \"prime192v1\"\n#define NID_X9_62_prime192v1            409\n#define OBJ_X9_62_prime192v1            OBJ_X9_62_primeCurve,1L\n\n#define SN_X9_62_prime192v2             \"prime192v2\"\n#define NID_X9_62_prime192v2            410\n#define OBJ_X9_62_prime192v2            OBJ_X9_62_primeCurve,2L\n\n#define SN_X9_62_prime192v3             \"prime192v3\"\n#define NID_X9_62_prime192v3            411\n#define OBJ_X9_62_prime192v3            OBJ_X9_62_primeCurve,3L\n\n#define SN_X9_62_prime239v1             \"prime239v1\"\n#define NID_X9_62_prime239v1            412\n#define OBJ_X9_62_prime239v1            OBJ_X9_62_primeCurve,4L\n\n#define SN_X9_62_prime239v2             \"prime239v2\"\n#define NID_X9_62_prime239v2            413\n#define OBJ_X9_62_prime239v2            OBJ_X9_62_primeCurve,5L\n\n#define SN_X9_62_prime239v3             \"prime239v3\"\n#define NID_X9_62_prime239v3            414\n#define OBJ_X9_62_prime239v3            OBJ_X9_62_primeCurve,6L\n\n#define SN_X9_62_prime256v1             \"prime256v1\"\n#define NID_X9_62_prime256v1            415\n#define OBJ_X9_62_prime256v1            OBJ_X9_62_primeCurve,7L\n\n#define OBJ_X9_62_id_ecSigType          OBJ_ansi_X9_62,4L\n\n#define SN_ecdsa_with_SHA1              \"ecdsa-with-SHA1\"\n#define NID_ecdsa_with_SHA1             416\n#define OBJ_ecdsa_with_SHA1             OBJ_X9_62_id_ecSigType,1L\n\n#define SN_ecdsa_with_Recommended               \"ecdsa-with-Recommended\"\n#define NID_ecdsa_with_Recommended              791\n#define OBJ_ecdsa_with_Recommended              OBJ_X9_62_id_ecSigType,2L\n\n#define SN_ecdsa_with_Specified         \"ecdsa-with-Specified\"\n#define NID_ecdsa_with_Specified                792\n#define OBJ_ecdsa_with_Specified                OBJ_X9_62_id_ecSigType,3L\n\n#define SN_ecdsa_with_SHA224            \"ecdsa-with-SHA224\"\n#define NID_ecdsa_with_SHA224           793\n#define OBJ_ecdsa_with_SHA224           OBJ_ecdsa_with_Specified,1L\n\n#define SN_ecdsa_with_SHA256            \"ecdsa-with-SHA256\"\n#define NID_ecdsa_with_SHA256           794\n#define OBJ_ecdsa_with_SHA256           OBJ_ecdsa_with_Specified,2L\n\n#define SN_ecdsa_with_SHA384            \"ecdsa-with-SHA384\"\n#define NID_ecdsa_with_SHA384           795\n#define OBJ_ecdsa_with_SHA384           OBJ_ecdsa_with_Specified,3L\n\n#define SN_ecdsa_with_SHA512            \"ecdsa-with-SHA512\"\n#define NID_ecdsa_with_SHA512           796\n#define OBJ_ecdsa_with_SHA512           OBJ_ecdsa_with_Specified,4L\n\n#define OBJ_secg_ellipticCurve          OBJ_certicom_arc,0L\n\n#define SN_secp112r1            \"secp112r1\"\n#define NID_secp112r1           704\n#define OBJ_secp112r1           OBJ_secg_ellipticCurve,6L\n\n#define SN_secp112r2            \"secp112r2\"\n#define NID_secp112r2           705\n#define OBJ_secp112r2           OBJ_secg_ellipticCurve,7L\n\n#define SN_secp128r1            \"secp128r1\"\n#define NID_secp128r1           706\n#define OBJ_secp128r1           OBJ_secg_ellipticCurve,28L\n\n#define SN_secp128r2            \"secp128r2\"\n#define NID_secp128r2           707\n#define OBJ_secp128r2           OBJ_secg_ellipticCurve,29L\n\n#define SN_secp160k1            \"secp160k1\"\n#define NID_secp160k1           708\n#define OBJ_secp160k1           OBJ_secg_ellipticCurve,9L\n\n#define SN_secp160r1            \"secp160r1\"\n#define NID_secp160r1           709\n#define OBJ_secp160r1           OBJ_secg_ellipticCurve,8L\n\n#define SN_secp160r2            \"secp160r2\"\n#define NID_secp160r2           710\n#define OBJ_secp160r2           OBJ_secg_ellipticCurve,30L\n\n#define SN_secp192k1            \"secp192k1\"\n#define NID_secp192k1           711\n#define OBJ_secp192k1           OBJ_secg_ellipticCurve,31L\n\n#define SN_secp224k1            \"secp224k1\"\n#define NID_secp224k1           712\n#define OBJ_secp224k1           OBJ_secg_ellipticCurve,32L\n\n#define SN_secp224r1            \"secp224r1\"\n#define NID_secp224r1           713\n#define OBJ_secp224r1           OBJ_secg_ellipticCurve,33L\n\n#define SN_secp256k1            \"secp256k1\"\n#define NID_secp256k1           714\n#define OBJ_secp256k1           OBJ_secg_ellipticCurve,10L\n\n#define SN_secp384r1            \"secp384r1\"\n#define NID_secp384r1           715\n#define OBJ_secp384r1           OBJ_secg_ellipticCurve,34L\n\n#define SN_secp521r1            \"secp521r1\"\n#define NID_secp521r1           716\n#define OBJ_secp521r1           OBJ_secg_ellipticCurve,35L\n\n#define SN_sect113r1            \"sect113r1\"\n#define NID_sect113r1           717\n#define OBJ_sect113r1           OBJ_secg_ellipticCurve,4L\n\n#define SN_sect113r2            \"sect113r2\"\n#define NID_sect113r2           718\n#define OBJ_sect113r2           OBJ_secg_ellipticCurve,5L\n\n#define SN_sect131r1            \"sect131r1\"\n#define NID_sect131r1           719\n#define OBJ_sect131r1           OBJ_secg_ellipticCurve,22L\n\n#define SN_sect131r2            \"sect131r2\"\n#define NID_sect131r2           720\n#define OBJ_sect131r2           OBJ_secg_ellipticCurve,23L\n\n#define SN_sect163k1            \"sect163k1\"\n#define NID_sect163k1           721\n#define OBJ_sect163k1           OBJ_secg_ellipticCurve,1L\n\n#define SN_sect163r1            \"sect163r1\"\n#define NID_sect163r1           722\n#define OBJ_sect163r1           OBJ_secg_ellipticCurve,2L\n\n#define SN_sect163r2            \"sect163r2\"\n#define NID_sect163r2           723\n#define OBJ_sect163r2           OBJ_secg_ellipticCurve,15L\n\n#define SN_sect193r1            \"sect193r1\"\n#define NID_sect193r1           724\n#define OBJ_sect193r1           OBJ_secg_ellipticCurve,24L\n\n#define SN_sect193r2            \"sect193r2\"\n#define NID_sect193r2           725\n#define OBJ_sect193r2           OBJ_secg_ellipticCurve,25L\n\n#define SN_sect233k1            \"sect233k1\"\n#define NID_sect233k1           726\n#define OBJ_sect233k1           OBJ_secg_ellipticCurve,26L\n\n#define SN_sect233r1            \"sect233r1\"\n#define NID_sect233r1           727\n#define OBJ_sect233r1           OBJ_secg_ellipticCurve,27L\n\n#define SN_sect239k1            \"sect239k1\"\n#define NID_sect239k1           728\n#define OBJ_sect239k1           OBJ_secg_ellipticCurve,3L\n\n#define SN_sect283k1            \"sect283k1\"\n#define NID_sect283k1           729\n#define OBJ_sect283k1           OBJ_secg_ellipticCurve,16L\n\n#define SN_sect283r1            \"sect283r1\"\n#define NID_sect283r1           730\n#define OBJ_sect283r1           OBJ_secg_ellipticCurve,17L\n\n#define SN_sect409k1            \"sect409k1\"\n#define NID_sect409k1           731\n#define OBJ_sect409k1           OBJ_secg_ellipticCurve,36L\n\n#define SN_sect409r1            \"sect409r1\"\n#define NID_sect409r1           732\n#define OBJ_sect409r1           OBJ_secg_ellipticCurve,37L\n\n#define SN_sect571k1            \"sect571k1\"\n#define NID_sect571k1           733\n#define OBJ_sect571k1           OBJ_secg_ellipticCurve,38L\n\n#define SN_sect571r1            \"sect571r1\"\n#define NID_sect571r1           734\n#define OBJ_sect571r1           OBJ_secg_ellipticCurve,39L\n\n#define OBJ_wap_wsg_idm_ecid            OBJ_wap_wsg,4L\n\n#define SN_wap_wsg_idm_ecid_wtls1               \"wap-wsg-idm-ecid-wtls1\"\n#define NID_wap_wsg_idm_ecid_wtls1              735\n#define OBJ_wap_wsg_idm_ecid_wtls1              OBJ_wap_wsg_idm_ecid,1L\n\n#define SN_wap_wsg_idm_ecid_wtls3               \"wap-wsg-idm-ecid-wtls3\"\n#define NID_wap_wsg_idm_ecid_wtls3              736\n#define OBJ_wap_wsg_idm_ecid_wtls3              OBJ_wap_wsg_idm_ecid,3L\n\n#define SN_wap_wsg_idm_ecid_wtls4               \"wap-wsg-idm-ecid-wtls4\"\n#define NID_wap_wsg_idm_ecid_wtls4              737\n#define OBJ_wap_wsg_idm_ecid_wtls4              OBJ_wap_wsg_idm_ecid,4L\n\n#define SN_wap_wsg_idm_ecid_wtls5               \"wap-wsg-idm-ecid-wtls5\"\n#define NID_wap_wsg_idm_ecid_wtls5              738\n#define OBJ_wap_wsg_idm_ecid_wtls5              OBJ_wap_wsg_idm_ecid,5L\n\n#define SN_wap_wsg_idm_ecid_wtls6               \"wap-wsg-idm-ecid-wtls6\"\n#define NID_wap_wsg_idm_ecid_wtls6              739\n#define OBJ_wap_wsg_idm_ecid_wtls6              OBJ_wap_wsg_idm_ecid,6L\n\n#define SN_wap_wsg_idm_ecid_wtls7               \"wap-wsg-idm-ecid-wtls7\"\n#define NID_wap_wsg_idm_ecid_wtls7              740\n#define OBJ_wap_wsg_idm_ecid_wtls7              OBJ_wap_wsg_idm_ecid,7L\n\n#define SN_wap_wsg_idm_ecid_wtls8               \"wap-wsg-idm-ecid-wtls8\"\n#define NID_wap_wsg_idm_ecid_wtls8              741\n#define OBJ_wap_wsg_idm_ecid_wtls8              OBJ_wap_wsg_idm_ecid,8L\n\n#define SN_wap_wsg_idm_ecid_wtls9               \"wap-wsg-idm-ecid-wtls9\"\n#define NID_wap_wsg_idm_ecid_wtls9              742\n#define OBJ_wap_wsg_idm_ecid_wtls9              OBJ_wap_wsg_idm_ecid,9L\n\n#define SN_wap_wsg_idm_ecid_wtls10              \"wap-wsg-idm-ecid-wtls10\"\n#define NID_wap_wsg_idm_ecid_wtls10             743\n#define OBJ_wap_wsg_idm_ecid_wtls10             OBJ_wap_wsg_idm_ecid,10L\n\n#define SN_wap_wsg_idm_ecid_wtls11              \"wap-wsg-idm-ecid-wtls11\"\n#define NID_wap_wsg_idm_ecid_wtls11             744\n#define OBJ_wap_wsg_idm_ecid_wtls11             OBJ_wap_wsg_idm_ecid,11L\n\n#define SN_wap_wsg_idm_ecid_wtls12              \"wap-wsg-idm-ecid-wtls12\"\n#define NID_wap_wsg_idm_ecid_wtls12             745\n#define OBJ_wap_wsg_idm_ecid_wtls12             OBJ_wap_wsg_idm_ecid,12L\n\n#define SN_cast5_cbc            \"CAST5-CBC\"\n#define LN_cast5_cbc            \"cast5-cbc\"\n#define NID_cast5_cbc           108\n#define OBJ_cast5_cbc           OBJ_ISO_US,113533L,7L,66L,10L\n\n#define SN_cast5_ecb            \"CAST5-ECB\"\n#define LN_cast5_ecb            \"cast5-ecb\"\n#define NID_cast5_ecb           109\n\n#define SN_cast5_cfb64          \"CAST5-CFB\"\n#define LN_cast5_cfb64          \"cast5-cfb\"\n#define NID_cast5_cfb64         110\n\n#define SN_cast5_ofb64          \"CAST5-OFB\"\n#define LN_cast5_ofb64          \"cast5-ofb\"\n#define NID_cast5_ofb64         111\n\n#define LN_pbeWithMD5AndCast5_CBC               \"pbeWithMD5AndCast5CBC\"\n#define NID_pbeWithMD5AndCast5_CBC              112\n#define OBJ_pbeWithMD5AndCast5_CBC              OBJ_ISO_US,113533L,7L,66L,12L\n\n#define SN_id_PasswordBasedMAC          \"id-PasswordBasedMAC\"\n#define LN_id_PasswordBasedMAC          \"password based MAC\"\n#define NID_id_PasswordBasedMAC         782\n#define OBJ_id_PasswordBasedMAC         OBJ_ISO_US,113533L,7L,66L,13L\n\n#define SN_id_DHBasedMac                \"id-DHBasedMac\"\n#define LN_id_DHBasedMac                \"Diffie-Hellman based MAC\"\n#define NID_id_DHBasedMac               783\n#define OBJ_id_DHBasedMac               OBJ_ISO_US,113533L,7L,66L,30L\n\n#define SN_rsadsi               \"rsadsi\"\n#define LN_rsadsi               \"RSA Data Security, Inc.\"\n#define NID_rsadsi              1\n#define OBJ_rsadsi              OBJ_ISO_US,113549L\n\n#define SN_pkcs         \"pkcs\"\n#define LN_pkcs         \"RSA Data Security, Inc. PKCS\"\n#define NID_pkcs                2\n#define OBJ_pkcs                OBJ_rsadsi,1L\n\n#define SN_pkcs1                \"pkcs1\"\n#define NID_pkcs1               186\n#define OBJ_pkcs1               OBJ_pkcs,1L\n\n#define LN_rsaEncryption                \"rsaEncryption\"\n#define NID_rsaEncryption               6\n#define OBJ_rsaEncryption               OBJ_pkcs1,1L\n\n#define SN_md2WithRSAEncryption         \"RSA-MD2\"\n#define LN_md2WithRSAEncryption         \"md2WithRSAEncryption\"\n#define NID_md2WithRSAEncryption                7\n#define OBJ_md2WithRSAEncryption                OBJ_pkcs1,2L\n\n#define SN_md4WithRSAEncryption         \"RSA-MD4\"\n#define LN_md4WithRSAEncryption         \"md4WithRSAEncryption\"\n#define NID_md4WithRSAEncryption                396\n#define OBJ_md4WithRSAEncryption                OBJ_pkcs1,3L\n\n#define SN_md5WithRSAEncryption         \"RSA-MD5\"\n#define LN_md5WithRSAEncryption         \"md5WithRSAEncryption\"\n#define NID_md5WithRSAEncryption                8\n#define OBJ_md5WithRSAEncryption                OBJ_pkcs1,4L\n\n#define SN_sha1WithRSAEncryption                \"RSA-SHA1\"\n#define LN_sha1WithRSAEncryption                \"sha1WithRSAEncryption\"\n#define NID_sha1WithRSAEncryption               65\n#define OBJ_sha1WithRSAEncryption               OBJ_pkcs1,5L\n\n#define SN_rsaesOaep            \"RSAES-OAEP\"\n#define LN_rsaesOaep            \"rsaesOaep\"\n#define NID_rsaesOaep           919\n#define OBJ_rsaesOaep           OBJ_pkcs1,7L\n\n#define SN_mgf1         \"MGF1\"\n#define LN_mgf1         \"mgf1\"\n#define NID_mgf1                911\n#define OBJ_mgf1                OBJ_pkcs1,8L\n\n#define SN_pSpecified           \"PSPECIFIED\"\n#define LN_pSpecified           \"pSpecified\"\n#define NID_pSpecified          935\n#define OBJ_pSpecified          OBJ_pkcs1,9L\n\n#define SN_rsassaPss            \"RSASSA-PSS\"\n#define LN_rsassaPss            \"rsassaPss\"\n#define NID_rsassaPss           912\n#define OBJ_rsassaPss           OBJ_pkcs1,10L\n\n#define SN_sha256WithRSAEncryption              \"RSA-SHA256\"\n#define LN_sha256WithRSAEncryption              \"sha256WithRSAEncryption\"\n#define NID_sha256WithRSAEncryption             668\n#define OBJ_sha256WithRSAEncryption             OBJ_pkcs1,11L\n\n#define SN_sha384WithRSAEncryption              \"RSA-SHA384\"\n#define LN_sha384WithRSAEncryption              \"sha384WithRSAEncryption\"\n#define NID_sha384WithRSAEncryption             669\n#define OBJ_sha384WithRSAEncryption             OBJ_pkcs1,12L\n\n#define SN_sha512WithRSAEncryption              \"RSA-SHA512\"\n#define LN_sha512WithRSAEncryption              \"sha512WithRSAEncryption\"\n#define NID_sha512WithRSAEncryption             670\n#define OBJ_sha512WithRSAEncryption             OBJ_pkcs1,13L\n\n#define SN_sha224WithRSAEncryption              \"RSA-SHA224\"\n#define LN_sha224WithRSAEncryption              \"sha224WithRSAEncryption\"\n#define NID_sha224WithRSAEncryption             671\n#define OBJ_sha224WithRSAEncryption             OBJ_pkcs1,14L\n\n#define SN_pkcs3                \"pkcs3\"\n#define NID_pkcs3               27\n#define OBJ_pkcs3               OBJ_pkcs,3L\n\n#define LN_dhKeyAgreement               \"dhKeyAgreement\"\n#define NID_dhKeyAgreement              28\n#define OBJ_dhKeyAgreement              OBJ_pkcs3,1L\n\n#define SN_pkcs5                \"pkcs5\"\n#define NID_pkcs5               187\n#define OBJ_pkcs5               OBJ_pkcs,5L\n\n#define SN_pbeWithMD2AndDES_CBC         \"PBE-MD2-DES\"\n#define LN_pbeWithMD2AndDES_CBC         \"pbeWithMD2AndDES-CBC\"\n#define NID_pbeWithMD2AndDES_CBC                9\n#define OBJ_pbeWithMD2AndDES_CBC                OBJ_pkcs5,1L\n\n#define SN_pbeWithMD5AndDES_CBC         \"PBE-MD5-DES\"\n#define LN_pbeWithMD5AndDES_CBC         \"pbeWithMD5AndDES-CBC\"\n#define NID_pbeWithMD5AndDES_CBC                10\n#define OBJ_pbeWithMD5AndDES_CBC                OBJ_pkcs5,3L\n\n#define SN_pbeWithMD2AndRC2_CBC         \"PBE-MD2-RC2-64\"\n#define LN_pbeWithMD2AndRC2_CBC         \"pbeWithMD2AndRC2-CBC\"\n#define NID_pbeWithMD2AndRC2_CBC                168\n#define OBJ_pbeWithMD2AndRC2_CBC                OBJ_pkcs5,4L\n\n#define SN_pbeWithMD5AndRC2_CBC         \"PBE-MD5-RC2-64\"\n#define LN_pbeWithMD5AndRC2_CBC         \"pbeWithMD5AndRC2-CBC\"\n#define NID_pbeWithMD5AndRC2_CBC                169\n#define OBJ_pbeWithMD5AndRC2_CBC                OBJ_pkcs5,6L\n\n#define SN_pbeWithSHA1AndDES_CBC                \"PBE-SHA1-DES\"\n#define LN_pbeWithSHA1AndDES_CBC                \"pbeWithSHA1AndDES-CBC\"\n#define NID_pbeWithSHA1AndDES_CBC               170\n#define OBJ_pbeWithSHA1AndDES_CBC               OBJ_pkcs5,10L\n\n#define SN_pbeWithSHA1AndRC2_CBC                \"PBE-SHA1-RC2-64\"\n#define LN_pbeWithSHA1AndRC2_CBC                \"pbeWithSHA1AndRC2-CBC\"\n#define NID_pbeWithSHA1AndRC2_CBC               68\n#define OBJ_pbeWithSHA1AndRC2_CBC               OBJ_pkcs5,11L\n\n#define LN_id_pbkdf2            \"PBKDF2\"\n#define NID_id_pbkdf2           69\n#define OBJ_id_pbkdf2           OBJ_pkcs5,12L\n\n#define LN_pbes2                \"PBES2\"\n#define NID_pbes2               161\n#define OBJ_pbes2               OBJ_pkcs5,13L\n\n#define LN_pbmac1               \"PBMAC1\"\n#define NID_pbmac1              162\n#define OBJ_pbmac1              OBJ_pkcs5,14L\n\n#define SN_pkcs7                \"pkcs7\"\n#define NID_pkcs7               20\n#define OBJ_pkcs7               OBJ_pkcs,7L\n\n#define LN_pkcs7_data           \"pkcs7-data\"\n#define NID_pkcs7_data          21\n#define OBJ_pkcs7_data          OBJ_pkcs7,1L\n\n#define LN_pkcs7_signed         \"pkcs7-signedData\"\n#define NID_pkcs7_signed                22\n#define OBJ_pkcs7_signed                OBJ_pkcs7,2L\n\n#define LN_pkcs7_enveloped              \"pkcs7-envelopedData\"\n#define NID_pkcs7_enveloped             23\n#define OBJ_pkcs7_enveloped             OBJ_pkcs7,3L\n\n#define LN_pkcs7_signedAndEnveloped             \"pkcs7-signedAndEnvelopedData\"\n#define NID_pkcs7_signedAndEnveloped            24\n#define OBJ_pkcs7_signedAndEnveloped            OBJ_pkcs7,4L\n\n#define LN_pkcs7_digest         \"pkcs7-digestData\"\n#define NID_pkcs7_digest                25\n#define OBJ_pkcs7_digest                OBJ_pkcs7,5L\n\n#define LN_pkcs7_encrypted              \"pkcs7-encryptedData\"\n#define NID_pkcs7_encrypted             26\n#define OBJ_pkcs7_encrypted             OBJ_pkcs7,6L\n\n#define SN_pkcs9                \"pkcs9\"\n#define NID_pkcs9               47\n#define OBJ_pkcs9               OBJ_pkcs,9L\n\n#define LN_pkcs9_emailAddress           \"emailAddress\"\n#define NID_pkcs9_emailAddress          48\n#define OBJ_pkcs9_emailAddress          OBJ_pkcs9,1L\n\n#define LN_pkcs9_unstructuredName               \"unstructuredName\"\n#define NID_pkcs9_unstructuredName              49\n#define OBJ_pkcs9_unstructuredName              OBJ_pkcs9,2L\n\n#define LN_pkcs9_contentType            \"contentType\"\n#define NID_pkcs9_contentType           50\n#define OBJ_pkcs9_contentType           OBJ_pkcs9,3L\n\n#define LN_pkcs9_messageDigest          \"messageDigest\"\n#define NID_pkcs9_messageDigest         51\n#define OBJ_pkcs9_messageDigest         OBJ_pkcs9,4L\n\n#define LN_pkcs9_signingTime            \"signingTime\"\n#define NID_pkcs9_signingTime           52\n#define OBJ_pkcs9_signingTime           OBJ_pkcs9,5L\n\n#define LN_pkcs9_countersignature               \"countersignature\"\n#define NID_pkcs9_countersignature              53\n#define OBJ_pkcs9_countersignature              OBJ_pkcs9,6L\n\n#define LN_pkcs9_challengePassword              \"challengePassword\"\n#define NID_pkcs9_challengePassword             54\n#define OBJ_pkcs9_challengePassword             OBJ_pkcs9,7L\n\n#define LN_pkcs9_unstructuredAddress            \"unstructuredAddress\"\n#define NID_pkcs9_unstructuredAddress           55\n#define OBJ_pkcs9_unstructuredAddress           OBJ_pkcs9,8L\n\n#define LN_pkcs9_extCertAttributes              \"extendedCertificateAttributes\"\n#define NID_pkcs9_extCertAttributes             56\n#define OBJ_pkcs9_extCertAttributes             OBJ_pkcs9,9L\n\n#define SN_ext_req              \"extReq\"\n#define LN_ext_req              \"Extension Request\"\n#define NID_ext_req             172\n#define OBJ_ext_req             OBJ_pkcs9,14L\n\n#define SN_SMIMECapabilities            \"SMIME-CAPS\"\n#define LN_SMIMECapabilities            \"S/MIME Capabilities\"\n#define NID_SMIMECapabilities           167\n#define OBJ_SMIMECapabilities           OBJ_pkcs9,15L\n\n#define SN_SMIME                \"SMIME\"\n#define LN_SMIME                \"S/MIME\"\n#define NID_SMIME               188\n#define OBJ_SMIME               OBJ_pkcs9,16L\n\n#define SN_id_smime_mod         \"id-smime-mod\"\n#define NID_id_smime_mod                189\n#define OBJ_id_smime_mod                OBJ_SMIME,0L\n\n#define SN_id_smime_ct          \"id-smime-ct\"\n#define NID_id_smime_ct         190\n#define OBJ_id_smime_ct         OBJ_SMIME,1L\n\n#define SN_id_smime_aa          \"id-smime-aa\"\n#define NID_id_smime_aa         191\n#define OBJ_id_smime_aa         OBJ_SMIME,2L\n\n#define SN_id_smime_alg         \"id-smime-alg\"\n#define NID_id_smime_alg                192\n#define OBJ_id_smime_alg                OBJ_SMIME,3L\n\n#define SN_id_smime_cd          \"id-smime-cd\"\n#define NID_id_smime_cd         193\n#define OBJ_id_smime_cd         OBJ_SMIME,4L\n\n#define SN_id_smime_spq         \"id-smime-spq\"\n#define NID_id_smime_spq                194\n#define OBJ_id_smime_spq                OBJ_SMIME,5L\n\n#define SN_id_smime_cti         \"id-smime-cti\"\n#define NID_id_smime_cti                195\n#define OBJ_id_smime_cti                OBJ_SMIME,6L\n\n#define SN_id_smime_mod_cms             \"id-smime-mod-cms\"\n#define NID_id_smime_mod_cms            196\n#define OBJ_id_smime_mod_cms            OBJ_id_smime_mod,1L\n\n#define SN_id_smime_mod_ess             \"id-smime-mod-ess\"\n#define NID_id_smime_mod_ess            197\n#define OBJ_id_smime_mod_ess            OBJ_id_smime_mod,2L\n\n#define SN_id_smime_mod_oid             \"id-smime-mod-oid\"\n#define NID_id_smime_mod_oid            198\n#define OBJ_id_smime_mod_oid            OBJ_id_smime_mod,3L\n\n#define SN_id_smime_mod_msg_v3          \"id-smime-mod-msg-v3\"\n#define NID_id_smime_mod_msg_v3         199\n#define OBJ_id_smime_mod_msg_v3         OBJ_id_smime_mod,4L\n\n#define SN_id_smime_mod_ets_eSignature_88               \"id-smime-mod-ets-eSignature-88\"\n#define NID_id_smime_mod_ets_eSignature_88              200\n#define OBJ_id_smime_mod_ets_eSignature_88              OBJ_id_smime_mod,5L\n\n#define SN_id_smime_mod_ets_eSignature_97               \"id-smime-mod-ets-eSignature-97\"\n#define NID_id_smime_mod_ets_eSignature_97              201\n#define OBJ_id_smime_mod_ets_eSignature_97              OBJ_id_smime_mod,6L\n\n#define SN_id_smime_mod_ets_eSigPolicy_88               \"id-smime-mod-ets-eSigPolicy-88\"\n#define NID_id_smime_mod_ets_eSigPolicy_88              202\n#define OBJ_id_smime_mod_ets_eSigPolicy_88              OBJ_id_smime_mod,7L\n\n#define SN_id_smime_mod_ets_eSigPolicy_97               \"id-smime-mod-ets-eSigPolicy-97\"\n#define NID_id_smime_mod_ets_eSigPolicy_97              203\n#define OBJ_id_smime_mod_ets_eSigPolicy_97              OBJ_id_smime_mod,8L\n\n#define SN_id_smime_ct_receipt          \"id-smime-ct-receipt\"\n#define NID_id_smime_ct_receipt         204\n#define OBJ_id_smime_ct_receipt         OBJ_id_smime_ct,1L\n\n#define SN_id_smime_ct_authData         \"id-smime-ct-authData\"\n#define NID_id_smime_ct_authData                205\n#define OBJ_id_smime_ct_authData                OBJ_id_smime_ct,2L\n\n#define SN_id_smime_ct_publishCert              \"id-smime-ct-publishCert\"\n#define NID_id_smime_ct_publishCert             206\n#define OBJ_id_smime_ct_publishCert             OBJ_id_smime_ct,3L\n\n#define SN_id_smime_ct_TSTInfo          \"id-smime-ct-TSTInfo\"\n#define NID_id_smime_ct_TSTInfo         207\n#define OBJ_id_smime_ct_TSTInfo         OBJ_id_smime_ct,4L\n\n#define SN_id_smime_ct_TDTInfo          \"id-smime-ct-TDTInfo\"\n#define NID_id_smime_ct_TDTInfo         208\n#define OBJ_id_smime_ct_TDTInfo         OBJ_id_smime_ct,5L\n\n#define SN_id_smime_ct_contentInfo              \"id-smime-ct-contentInfo\"\n#define NID_id_smime_ct_contentInfo             209\n#define OBJ_id_smime_ct_contentInfo             OBJ_id_smime_ct,6L\n\n#define SN_id_smime_ct_DVCSRequestData          \"id-smime-ct-DVCSRequestData\"\n#define NID_id_smime_ct_DVCSRequestData         210\n#define OBJ_id_smime_ct_DVCSRequestData         OBJ_id_smime_ct,7L\n\n#define SN_id_smime_ct_DVCSResponseData         \"id-smime-ct-DVCSResponseData\"\n#define NID_id_smime_ct_DVCSResponseData                211\n#define OBJ_id_smime_ct_DVCSResponseData                OBJ_id_smime_ct,8L\n\n#define SN_id_smime_ct_compressedData           \"id-smime-ct-compressedData\"\n#define NID_id_smime_ct_compressedData          786\n#define OBJ_id_smime_ct_compressedData          OBJ_id_smime_ct,9L\n\n#define SN_id_ct_asciiTextWithCRLF              \"id-ct-asciiTextWithCRLF\"\n#define NID_id_ct_asciiTextWithCRLF             787\n#define OBJ_id_ct_asciiTextWithCRLF             OBJ_id_smime_ct,27L\n\n#define SN_id_smime_aa_receiptRequest           \"id-smime-aa-receiptRequest\"\n#define NID_id_smime_aa_receiptRequest          212\n#define OBJ_id_smime_aa_receiptRequest          OBJ_id_smime_aa,1L\n\n#define SN_id_smime_aa_securityLabel            \"id-smime-aa-securityLabel\"\n#define NID_id_smime_aa_securityLabel           213\n#define OBJ_id_smime_aa_securityLabel           OBJ_id_smime_aa,2L\n\n#define SN_id_smime_aa_mlExpandHistory          \"id-smime-aa-mlExpandHistory\"\n#define NID_id_smime_aa_mlExpandHistory         214\n#define OBJ_id_smime_aa_mlExpandHistory         OBJ_id_smime_aa,3L\n\n#define SN_id_smime_aa_contentHint              \"id-smime-aa-contentHint\"\n#define NID_id_smime_aa_contentHint             215\n#define OBJ_id_smime_aa_contentHint             OBJ_id_smime_aa,4L\n\n#define SN_id_smime_aa_msgSigDigest             \"id-smime-aa-msgSigDigest\"\n#define NID_id_smime_aa_msgSigDigest            216\n#define OBJ_id_smime_aa_msgSigDigest            OBJ_id_smime_aa,5L\n\n#define SN_id_smime_aa_encapContentType         \"id-smime-aa-encapContentType\"\n#define NID_id_smime_aa_encapContentType                217\n#define OBJ_id_smime_aa_encapContentType                OBJ_id_smime_aa,6L\n\n#define SN_id_smime_aa_contentIdentifier                \"id-smime-aa-contentIdentifier\"\n#define NID_id_smime_aa_contentIdentifier               218\n#define OBJ_id_smime_aa_contentIdentifier               OBJ_id_smime_aa,7L\n\n#define SN_id_smime_aa_macValue         \"id-smime-aa-macValue\"\n#define NID_id_smime_aa_macValue                219\n#define OBJ_id_smime_aa_macValue                OBJ_id_smime_aa,8L\n\n#define SN_id_smime_aa_equivalentLabels         \"id-smime-aa-equivalentLabels\"\n#define NID_id_smime_aa_equivalentLabels                220\n#define OBJ_id_smime_aa_equivalentLabels                OBJ_id_smime_aa,9L\n\n#define SN_id_smime_aa_contentReference         \"id-smime-aa-contentReference\"\n#define NID_id_smime_aa_contentReference                221\n#define OBJ_id_smime_aa_contentReference                OBJ_id_smime_aa,10L\n\n#define SN_id_smime_aa_encrypKeyPref            \"id-smime-aa-encrypKeyPref\"\n#define NID_id_smime_aa_encrypKeyPref           222\n#define OBJ_id_smime_aa_encrypKeyPref           OBJ_id_smime_aa,11L\n\n#define SN_id_smime_aa_signingCertificate               \"id-smime-aa-signingCertificate\"\n#define NID_id_smime_aa_signingCertificate              223\n#define OBJ_id_smime_aa_signingCertificate              OBJ_id_smime_aa,12L\n\n#define SN_id_smime_aa_smimeEncryptCerts                \"id-smime-aa-smimeEncryptCerts\"\n#define NID_id_smime_aa_smimeEncryptCerts               224\n#define OBJ_id_smime_aa_smimeEncryptCerts               OBJ_id_smime_aa,13L\n\n#define SN_id_smime_aa_timeStampToken           \"id-smime-aa-timeStampToken\"\n#define NID_id_smime_aa_timeStampToken          225\n#define OBJ_id_smime_aa_timeStampToken          OBJ_id_smime_aa,14L\n\n#define SN_id_smime_aa_ets_sigPolicyId          \"id-smime-aa-ets-sigPolicyId\"\n#define NID_id_smime_aa_ets_sigPolicyId         226\n#define OBJ_id_smime_aa_ets_sigPolicyId         OBJ_id_smime_aa,15L\n\n#define SN_id_smime_aa_ets_commitmentType               \"id-smime-aa-ets-commitmentType\"\n#define NID_id_smime_aa_ets_commitmentType              227\n#define OBJ_id_smime_aa_ets_commitmentType              OBJ_id_smime_aa,16L\n\n#define SN_id_smime_aa_ets_signerLocation               \"id-smime-aa-ets-signerLocation\"\n#define NID_id_smime_aa_ets_signerLocation              228\n#define OBJ_id_smime_aa_ets_signerLocation              OBJ_id_smime_aa,17L\n\n#define SN_id_smime_aa_ets_signerAttr           \"id-smime-aa-ets-signerAttr\"\n#define NID_id_smime_aa_ets_signerAttr          229\n#define OBJ_id_smime_aa_ets_signerAttr          OBJ_id_smime_aa,18L\n\n#define SN_id_smime_aa_ets_otherSigCert         \"id-smime-aa-ets-otherSigCert\"\n#define NID_id_smime_aa_ets_otherSigCert                230\n#define OBJ_id_smime_aa_ets_otherSigCert                OBJ_id_smime_aa,19L\n\n#define SN_id_smime_aa_ets_contentTimestamp             \"id-smime-aa-ets-contentTimestamp\"\n#define NID_id_smime_aa_ets_contentTimestamp            231\n#define OBJ_id_smime_aa_ets_contentTimestamp            OBJ_id_smime_aa,20L\n\n#define SN_id_smime_aa_ets_CertificateRefs              \"id-smime-aa-ets-CertificateRefs\"\n#define NID_id_smime_aa_ets_CertificateRefs             232\n#define OBJ_id_smime_aa_ets_CertificateRefs             OBJ_id_smime_aa,21L\n\n#define SN_id_smime_aa_ets_RevocationRefs               \"id-smime-aa-ets-RevocationRefs\"\n#define NID_id_smime_aa_ets_RevocationRefs              233\n#define OBJ_id_smime_aa_ets_RevocationRefs              OBJ_id_smime_aa,22L\n\n#define SN_id_smime_aa_ets_certValues           \"id-smime-aa-ets-certValues\"\n#define NID_id_smime_aa_ets_certValues          234\n#define OBJ_id_smime_aa_ets_certValues          OBJ_id_smime_aa,23L\n\n#define SN_id_smime_aa_ets_revocationValues             \"id-smime-aa-ets-revocationValues\"\n#define NID_id_smime_aa_ets_revocationValues            235\n#define OBJ_id_smime_aa_ets_revocationValues            OBJ_id_smime_aa,24L\n\n#define SN_id_smime_aa_ets_escTimeStamp         \"id-smime-aa-ets-escTimeStamp\"\n#define NID_id_smime_aa_ets_escTimeStamp                236\n#define OBJ_id_smime_aa_ets_escTimeStamp                OBJ_id_smime_aa,25L\n\n#define SN_id_smime_aa_ets_certCRLTimestamp             \"id-smime-aa-ets-certCRLTimestamp\"\n#define NID_id_smime_aa_ets_certCRLTimestamp            237\n#define OBJ_id_smime_aa_ets_certCRLTimestamp            OBJ_id_smime_aa,26L\n\n#define SN_id_smime_aa_ets_archiveTimeStamp             \"id-smime-aa-ets-archiveTimeStamp\"\n#define NID_id_smime_aa_ets_archiveTimeStamp            238\n#define OBJ_id_smime_aa_ets_archiveTimeStamp            OBJ_id_smime_aa,27L\n\n#define SN_id_smime_aa_signatureType            \"id-smime-aa-signatureType\"\n#define NID_id_smime_aa_signatureType           239\n#define OBJ_id_smime_aa_signatureType           OBJ_id_smime_aa,28L\n\n#define SN_id_smime_aa_dvcs_dvc         \"id-smime-aa-dvcs-dvc\"\n#define NID_id_smime_aa_dvcs_dvc                240\n#define OBJ_id_smime_aa_dvcs_dvc                OBJ_id_smime_aa,29L\n\n#define SN_id_smime_alg_ESDHwith3DES            \"id-smime-alg-ESDHwith3DES\"\n#define NID_id_smime_alg_ESDHwith3DES           241\n#define OBJ_id_smime_alg_ESDHwith3DES           OBJ_id_smime_alg,1L\n\n#define SN_id_smime_alg_ESDHwithRC2             \"id-smime-alg-ESDHwithRC2\"\n#define NID_id_smime_alg_ESDHwithRC2            242\n#define OBJ_id_smime_alg_ESDHwithRC2            OBJ_id_smime_alg,2L\n\n#define SN_id_smime_alg_3DESwrap                \"id-smime-alg-3DESwrap\"\n#define NID_id_smime_alg_3DESwrap               243\n#define OBJ_id_smime_alg_3DESwrap               OBJ_id_smime_alg,3L\n\n#define SN_id_smime_alg_RC2wrap         \"id-smime-alg-RC2wrap\"\n#define NID_id_smime_alg_RC2wrap                244\n#define OBJ_id_smime_alg_RC2wrap                OBJ_id_smime_alg,4L\n\n#define SN_id_smime_alg_ESDH            \"id-smime-alg-ESDH\"\n#define NID_id_smime_alg_ESDH           245\n#define OBJ_id_smime_alg_ESDH           OBJ_id_smime_alg,5L\n\n#define SN_id_smime_alg_CMS3DESwrap             \"id-smime-alg-CMS3DESwrap\"\n#define NID_id_smime_alg_CMS3DESwrap            246\n#define OBJ_id_smime_alg_CMS3DESwrap            OBJ_id_smime_alg,6L\n\n#define SN_id_smime_alg_CMSRC2wrap              \"id-smime-alg-CMSRC2wrap\"\n#define NID_id_smime_alg_CMSRC2wrap             247\n#define OBJ_id_smime_alg_CMSRC2wrap             OBJ_id_smime_alg,7L\n\n#define SN_id_alg_PWRI_KEK              \"id-alg-PWRI-KEK\"\n#define NID_id_alg_PWRI_KEK             893\n#define OBJ_id_alg_PWRI_KEK             OBJ_id_smime_alg,9L\n\n#define SN_id_smime_cd_ldap             \"id-smime-cd-ldap\"\n#define NID_id_smime_cd_ldap            248\n#define OBJ_id_smime_cd_ldap            OBJ_id_smime_cd,1L\n\n#define SN_id_smime_spq_ets_sqt_uri             \"id-smime-spq-ets-sqt-uri\"\n#define NID_id_smime_spq_ets_sqt_uri            249\n#define OBJ_id_smime_spq_ets_sqt_uri            OBJ_id_smime_spq,1L\n\n#define SN_id_smime_spq_ets_sqt_unotice         \"id-smime-spq-ets-sqt-unotice\"\n#define NID_id_smime_spq_ets_sqt_unotice                250\n#define OBJ_id_smime_spq_ets_sqt_unotice                OBJ_id_smime_spq,2L\n\n#define SN_id_smime_cti_ets_proofOfOrigin               \"id-smime-cti-ets-proofOfOrigin\"\n#define NID_id_smime_cti_ets_proofOfOrigin              251\n#define OBJ_id_smime_cti_ets_proofOfOrigin              OBJ_id_smime_cti,1L\n\n#define SN_id_smime_cti_ets_proofOfReceipt              \"id-smime-cti-ets-proofOfReceipt\"\n#define NID_id_smime_cti_ets_proofOfReceipt             252\n#define OBJ_id_smime_cti_ets_proofOfReceipt             OBJ_id_smime_cti,2L\n\n#define SN_id_smime_cti_ets_proofOfDelivery             \"id-smime-cti-ets-proofOfDelivery\"\n#define NID_id_smime_cti_ets_proofOfDelivery            253\n#define OBJ_id_smime_cti_ets_proofOfDelivery            OBJ_id_smime_cti,3L\n\n#define SN_id_smime_cti_ets_proofOfSender               \"id-smime-cti-ets-proofOfSender\"\n#define NID_id_smime_cti_ets_proofOfSender              254\n#define OBJ_id_smime_cti_ets_proofOfSender              OBJ_id_smime_cti,4L\n\n#define SN_id_smime_cti_ets_proofOfApproval             \"id-smime-cti-ets-proofOfApproval\"\n#define NID_id_smime_cti_ets_proofOfApproval            255\n#define OBJ_id_smime_cti_ets_proofOfApproval            OBJ_id_smime_cti,5L\n\n#define SN_id_smime_cti_ets_proofOfCreation             \"id-smime-cti-ets-proofOfCreation\"\n#define NID_id_smime_cti_ets_proofOfCreation            256\n#define OBJ_id_smime_cti_ets_proofOfCreation            OBJ_id_smime_cti,6L\n\n#define LN_friendlyName         \"friendlyName\"\n#define NID_friendlyName                156\n#define OBJ_friendlyName                OBJ_pkcs9,20L\n\n#define LN_localKeyID           \"localKeyID\"\n#define NID_localKeyID          157\n#define OBJ_localKeyID          OBJ_pkcs9,21L\n\n#define SN_ms_csp_name          \"CSPName\"\n#define LN_ms_csp_name          \"Microsoft CSP Name\"\n#define NID_ms_csp_name         417\n#define OBJ_ms_csp_name         1L,3L,6L,1L,4L,1L,311L,17L,1L\n\n#define SN_LocalKeySet          \"LocalKeySet\"\n#define LN_LocalKeySet          \"Microsoft Local Key set\"\n#define NID_LocalKeySet         856\n#define OBJ_LocalKeySet         1L,3L,6L,1L,4L,1L,311L,17L,2L\n\n#define OBJ_certTypes           OBJ_pkcs9,22L\n\n#define LN_x509Certificate              \"x509Certificate\"\n#define NID_x509Certificate             158\n#define OBJ_x509Certificate             OBJ_certTypes,1L\n\n#define LN_sdsiCertificate              \"sdsiCertificate\"\n#define NID_sdsiCertificate             159\n#define OBJ_sdsiCertificate             OBJ_certTypes,2L\n\n#define OBJ_crlTypes            OBJ_pkcs9,23L\n\n#define LN_x509Crl              \"x509Crl\"\n#define NID_x509Crl             160\n#define OBJ_x509Crl             OBJ_crlTypes,1L\n\n#define OBJ_pkcs12              OBJ_pkcs,12L\n\n#define OBJ_pkcs12_pbeids               OBJ_pkcs12,1L\n\n#define SN_pbe_WithSHA1And128BitRC4             \"PBE-SHA1-RC4-128\"\n#define LN_pbe_WithSHA1And128BitRC4             \"pbeWithSHA1And128BitRC4\"\n#define NID_pbe_WithSHA1And128BitRC4            144\n#define OBJ_pbe_WithSHA1And128BitRC4            OBJ_pkcs12_pbeids,1L\n\n#define SN_pbe_WithSHA1And40BitRC4              \"PBE-SHA1-RC4-40\"\n#define LN_pbe_WithSHA1And40BitRC4              \"pbeWithSHA1And40BitRC4\"\n#define NID_pbe_WithSHA1And40BitRC4             145\n#define OBJ_pbe_WithSHA1And40BitRC4             OBJ_pkcs12_pbeids,2L\n\n#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC           \"PBE-SHA1-3DES\"\n#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC           \"pbeWithSHA1And3-KeyTripleDES-CBC\"\n#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC          146\n#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC          OBJ_pkcs12_pbeids,3L\n\n#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC           \"PBE-SHA1-2DES\"\n#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC           \"pbeWithSHA1And2-KeyTripleDES-CBC\"\n#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC          147\n#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC          OBJ_pkcs12_pbeids,4L\n\n#define SN_pbe_WithSHA1And128BitRC2_CBC         \"PBE-SHA1-RC2-128\"\n#define LN_pbe_WithSHA1And128BitRC2_CBC         \"pbeWithSHA1And128BitRC2-CBC\"\n#define NID_pbe_WithSHA1And128BitRC2_CBC                148\n#define OBJ_pbe_WithSHA1And128BitRC2_CBC                OBJ_pkcs12_pbeids,5L\n\n#define SN_pbe_WithSHA1And40BitRC2_CBC          \"PBE-SHA1-RC2-40\"\n#define LN_pbe_WithSHA1And40BitRC2_CBC          \"pbeWithSHA1And40BitRC2-CBC\"\n#define NID_pbe_WithSHA1And40BitRC2_CBC         149\n#define OBJ_pbe_WithSHA1And40BitRC2_CBC         OBJ_pkcs12_pbeids,6L\n\n#define OBJ_pkcs12_Version1             OBJ_pkcs12,10L\n\n#define OBJ_pkcs12_BagIds               OBJ_pkcs12_Version1,1L\n\n#define LN_keyBag               \"keyBag\"\n#define NID_keyBag              150\n#define OBJ_keyBag              OBJ_pkcs12_BagIds,1L\n\n#define LN_pkcs8ShroudedKeyBag          \"pkcs8ShroudedKeyBag\"\n#define NID_pkcs8ShroudedKeyBag         151\n#define OBJ_pkcs8ShroudedKeyBag         OBJ_pkcs12_BagIds,2L\n\n#define LN_certBag              \"certBag\"\n#define NID_certBag             152\n#define OBJ_certBag             OBJ_pkcs12_BagIds,3L\n\n#define LN_crlBag               \"crlBag\"\n#define NID_crlBag              153\n#define OBJ_crlBag              OBJ_pkcs12_BagIds,4L\n\n#define LN_secretBag            \"secretBag\"\n#define NID_secretBag           154\n#define OBJ_secretBag           OBJ_pkcs12_BagIds,5L\n\n#define LN_safeContentsBag              \"safeContentsBag\"\n#define NID_safeContentsBag             155\n#define OBJ_safeContentsBag             OBJ_pkcs12_BagIds,6L\n\n#define SN_md2          \"MD2\"\n#define LN_md2          \"md2\"\n#define NID_md2         3\n#define OBJ_md2         OBJ_rsadsi,2L,2L\n\n#define SN_md4          \"MD4\"\n#define LN_md4          \"md4\"\n#define NID_md4         257\n#define OBJ_md4         OBJ_rsadsi,2L,4L\n\n#define SN_md5          \"MD5\"\n#define LN_md5          \"md5\"\n#define NID_md5         4\n#define OBJ_md5         OBJ_rsadsi,2L,5L\n\n#define SN_md5_sha1             \"MD5-SHA1\"\n#define LN_md5_sha1             \"md5-sha1\"\n#define NID_md5_sha1            114\n\n#define LN_hmacWithMD5          \"hmacWithMD5\"\n#define NID_hmacWithMD5         797\n#define OBJ_hmacWithMD5         OBJ_rsadsi,2L,6L\n\n#define LN_hmacWithSHA1         \"hmacWithSHA1\"\n#define NID_hmacWithSHA1                163\n#define OBJ_hmacWithSHA1                OBJ_rsadsi,2L,7L\n\n#define LN_hmacWithSHA224               \"hmacWithSHA224\"\n#define NID_hmacWithSHA224              798\n#define OBJ_hmacWithSHA224              OBJ_rsadsi,2L,8L\n\n#define LN_hmacWithSHA256               \"hmacWithSHA256\"\n#define NID_hmacWithSHA256              799\n#define OBJ_hmacWithSHA256              OBJ_rsadsi,2L,9L\n\n#define LN_hmacWithSHA384               \"hmacWithSHA384\"\n#define NID_hmacWithSHA384              800\n#define OBJ_hmacWithSHA384              OBJ_rsadsi,2L,10L\n\n#define LN_hmacWithSHA512               \"hmacWithSHA512\"\n#define NID_hmacWithSHA512              801\n#define OBJ_hmacWithSHA512              OBJ_rsadsi,2L,11L\n\n#define SN_rc2_cbc              \"RC2-CBC\"\n#define LN_rc2_cbc              \"rc2-cbc\"\n#define NID_rc2_cbc             37\n#define OBJ_rc2_cbc             OBJ_rsadsi,3L,2L\n\n#define SN_rc2_ecb              \"RC2-ECB\"\n#define LN_rc2_ecb              \"rc2-ecb\"\n#define NID_rc2_ecb             38\n\n#define SN_rc2_cfb64            \"RC2-CFB\"\n#define LN_rc2_cfb64            \"rc2-cfb\"\n#define NID_rc2_cfb64           39\n\n#define SN_rc2_ofb64            \"RC2-OFB\"\n#define LN_rc2_ofb64            \"rc2-ofb\"\n#define NID_rc2_ofb64           40\n\n#define SN_rc2_40_cbc           \"RC2-40-CBC\"\n#define LN_rc2_40_cbc           \"rc2-40-cbc\"\n#define NID_rc2_40_cbc          98\n\n#define SN_rc2_64_cbc           \"RC2-64-CBC\"\n#define LN_rc2_64_cbc           \"rc2-64-cbc\"\n#define NID_rc2_64_cbc          166\n\n#define SN_rc4          \"RC4\"\n#define LN_rc4          \"rc4\"\n#define NID_rc4         5\n#define OBJ_rc4         OBJ_rsadsi,3L,4L\n\n#define SN_rc4_40               \"RC4-40\"\n#define LN_rc4_40               \"rc4-40\"\n#define NID_rc4_40              97\n\n#define SN_des_ede3_cbc         \"DES-EDE3-CBC\"\n#define LN_des_ede3_cbc         \"des-ede3-cbc\"\n#define NID_des_ede3_cbc                44\n#define OBJ_des_ede3_cbc                OBJ_rsadsi,3L,7L\n\n#define SN_rc5_cbc              \"RC5-CBC\"\n#define LN_rc5_cbc              \"rc5-cbc\"\n#define NID_rc5_cbc             120\n#define OBJ_rc5_cbc             OBJ_rsadsi,3L,8L\n\n#define SN_rc5_ecb              \"RC5-ECB\"\n#define LN_rc5_ecb              \"rc5-ecb\"\n#define NID_rc5_ecb             121\n\n#define SN_rc5_cfb64            \"RC5-CFB\"\n#define LN_rc5_cfb64            \"rc5-cfb\"\n#define NID_rc5_cfb64           122\n\n#define SN_rc5_ofb64            \"RC5-OFB\"\n#define LN_rc5_ofb64            \"rc5-ofb\"\n#define NID_rc5_ofb64           123\n\n#define SN_ms_ext_req           \"msExtReq\"\n#define LN_ms_ext_req           \"Microsoft Extension Request\"\n#define NID_ms_ext_req          171\n#define OBJ_ms_ext_req          1L,3L,6L,1L,4L,1L,311L,2L,1L,14L\n\n#define SN_ms_code_ind          \"msCodeInd\"\n#define LN_ms_code_ind          \"Microsoft Individual Code Signing\"\n#define NID_ms_code_ind         134\n#define OBJ_ms_code_ind         1L,3L,6L,1L,4L,1L,311L,2L,1L,21L\n\n#define SN_ms_code_com          \"msCodeCom\"\n#define LN_ms_code_com          \"Microsoft Commercial Code Signing\"\n#define NID_ms_code_com         135\n#define OBJ_ms_code_com         1L,3L,6L,1L,4L,1L,311L,2L,1L,22L\n\n#define SN_ms_ctl_sign          \"msCTLSign\"\n#define LN_ms_ctl_sign          \"Microsoft Trust List Signing\"\n#define NID_ms_ctl_sign         136\n#define OBJ_ms_ctl_sign         1L,3L,6L,1L,4L,1L,311L,10L,3L,1L\n\n#define SN_ms_sgc               \"msSGC\"\n#define LN_ms_sgc               \"Microsoft Server Gated Crypto\"\n#define NID_ms_sgc              137\n#define OBJ_ms_sgc              1L,3L,6L,1L,4L,1L,311L,10L,3L,3L\n\n#define SN_ms_efs               \"msEFS\"\n#define LN_ms_efs               \"Microsoft Encrypted File System\"\n#define NID_ms_efs              138\n#define OBJ_ms_efs              1L,3L,6L,1L,4L,1L,311L,10L,3L,4L\n\n#define SN_ms_smartcard_login           \"msSmartcardLogin\"\n#define LN_ms_smartcard_login           \"Microsoft Smartcardlogin\"\n#define NID_ms_smartcard_login          648\n#define OBJ_ms_smartcard_login          1L,3L,6L,1L,4L,1L,311L,20L,2L,2L\n\n#define SN_ms_upn               \"msUPN\"\n#define LN_ms_upn               \"Microsoft Universal Principal Name\"\n#define NID_ms_upn              649\n#define OBJ_ms_upn              1L,3L,6L,1L,4L,1L,311L,20L,2L,3L\n\n#define SN_idea_cbc             \"IDEA-CBC\"\n#define LN_idea_cbc             \"idea-cbc\"\n#define NID_idea_cbc            34\n#define OBJ_idea_cbc            1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L\n\n#define SN_idea_ecb             \"IDEA-ECB\"\n#define LN_idea_ecb             \"idea-ecb\"\n#define NID_idea_ecb            36\n\n#define SN_idea_cfb64           \"IDEA-CFB\"\n#define LN_idea_cfb64           \"idea-cfb\"\n#define NID_idea_cfb64          35\n\n#define SN_idea_ofb64           \"IDEA-OFB\"\n#define LN_idea_ofb64           \"idea-ofb\"\n#define NID_idea_ofb64          46\n\n#define SN_bf_cbc               \"BF-CBC\"\n#define LN_bf_cbc               \"bf-cbc\"\n#define NID_bf_cbc              91\n#define OBJ_bf_cbc              1L,3L,6L,1L,4L,1L,3029L,1L,2L\n\n#define SN_bf_ecb               \"BF-ECB\"\n#define LN_bf_ecb               \"bf-ecb\"\n#define NID_bf_ecb              92\n\n#define SN_bf_cfb64             \"BF-CFB\"\n#define LN_bf_cfb64             \"bf-cfb\"\n#define NID_bf_cfb64            93\n\n#define SN_bf_ofb64             \"BF-OFB\"\n#define LN_bf_ofb64             \"bf-ofb\"\n#define NID_bf_ofb64            94\n\n#define SN_id_pkix              \"PKIX\"\n#define NID_id_pkix             127\n#define OBJ_id_pkix             1L,3L,6L,1L,5L,5L,7L\n\n#define SN_id_pkix_mod          \"id-pkix-mod\"\n#define NID_id_pkix_mod         258\n#define OBJ_id_pkix_mod         OBJ_id_pkix,0L\n\n#define SN_id_pe                \"id-pe\"\n#define NID_id_pe               175\n#define OBJ_id_pe               OBJ_id_pkix,1L\n\n#define SN_id_qt                \"id-qt\"\n#define NID_id_qt               259\n#define OBJ_id_qt               OBJ_id_pkix,2L\n\n#define SN_id_kp                \"id-kp\"\n#define NID_id_kp               128\n#define OBJ_id_kp               OBJ_id_pkix,3L\n\n#define SN_id_it                \"id-it\"\n#define NID_id_it               260\n#define OBJ_id_it               OBJ_id_pkix,4L\n\n#define SN_id_pkip              \"id-pkip\"\n#define NID_id_pkip             261\n#define OBJ_id_pkip             OBJ_id_pkix,5L\n\n#define SN_id_alg               \"id-alg\"\n#define NID_id_alg              262\n#define OBJ_id_alg              OBJ_id_pkix,6L\n\n#define SN_id_cmc               \"id-cmc\"\n#define NID_id_cmc              263\n#define OBJ_id_cmc              OBJ_id_pkix,7L\n\n#define SN_id_on                \"id-on\"\n#define NID_id_on               264\n#define OBJ_id_on               OBJ_id_pkix,8L\n\n#define SN_id_pda               \"id-pda\"\n#define NID_id_pda              265\n#define OBJ_id_pda              OBJ_id_pkix,9L\n\n#define SN_id_aca               \"id-aca\"\n#define NID_id_aca              266\n#define OBJ_id_aca              OBJ_id_pkix,10L\n\n#define SN_id_qcs               \"id-qcs\"\n#define NID_id_qcs              267\n#define OBJ_id_qcs              OBJ_id_pkix,11L\n\n#define SN_id_cct               \"id-cct\"\n#define NID_id_cct              268\n#define OBJ_id_cct              OBJ_id_pkix,12L\n\n#define SN_id_ppl               \"id-ppl\"\n#define NID_id_ppl              662\n#define OBJ_id_ppl              OBJ_id_pkix,21L\n\n#define SN_id_ad                \"id-ad\"\n#define NID_id_ad               176\n#define OBJ_id_ad               OBJ_id_pkix,48L\n\n#define SN_id_pkix1_explicit_88         \"id-pkix1-explicit-88\"\n#define NID_id_pkix1_explicit_88                269\n#define OBJ_id_pkix1_explicit_88                OBJ_id_pkix_mod,1L\n\n#define SN_id_pkix1_implicit_88         \"id-pkix1-implicit-88\"\n#define NID_id_pkix1_implicit_88                270\n#define OBJ_id_pkix1_implicit_88                OBJ_id_pkix_mod,2L\n\n#define SN_id_pkix1_explicit_93         \"id-pkix1-explicit-93\"\n#define NID_id_pkix1_explicit_93                271\n#define OBJ_id_pkix1_explicit_93                OBJ_id_pkix_mod,3L\n\n#define SN_id_pkix1_implicit_93         \"id-pkix1-implicit-93\"\n#define NID_id_pkix1_implicit_93                272\n#define OBJ_id_pkix1_implicit_93                OBJ_id_pkix_mod,4L\n\n#define SN_id_mod_crmf          \"id-mod-crmf\"\n#define NID_id_mod_crmf         273\n#define OBJ_id_mod_crmf         OBJ_id_pkix_mod,5L\n\n#define SN_id_mod_cmc           \"id-mod-cmc\"\n#define NID_id_mod_cmc          274\n#define OBJ_id_mod_cmc          OBJ_id_pkix_mod,6L\n\n#define SN_id_mod_kea_profile_88                \"id-mod-kea-profile-88\"\n#define NID_id_mod_kea_profile_88               275\n#define OBJ_id_mod_kea_profile_88               OBJ_id_pkix_mod,7L\n\n#define SN_id_mod_kea_profile_93                \"id-mod-kea-profile-93\"\n#define NID_id_mod_kea_profile_93               276\n#define OBJ_id_mod_kea_profile_93               OBJ_id_pkix_mod,8L\n\n#define SN_id_mod_cmp           \"id-mod-cmp\"\n#define NID_id_mod_cmp          277\n#define OBJ_id_mod_cmp          OBJ_id_pkix_mod,9L\n\n#define SN_id_mod_qualified_cert_88             \"id-mod-qualified-cert-88\"\n#define NID_id_mod_qualified_cert_88            278\n#define OBJ_id_mod_qualified_cert_88            OBJ_id_pkix_mod,10L\n\n#define SN_id_mod_qualified_cert_93             \"id-mod-qualified-cert-93\"\n#define NID_id_mod_qualified_cert_93            279\n#define OBJ_id_mod_qualified_cert_93            OBJ_id_pkix_mod,11L\n\n#define SN_id_mod_attribute_cert                \"id-mod-attribute-cert\"\n#define NID_id_mod_attribute_cert               280\n#define OBJ_id_mod_attribute_cert               OBJ_id_pkix_mod,12L\n\n#define SN_id_mod_timestamp_protocol            \"id-mod-timestamp-protocol\"\n#define NID_id_mod_timestamp_protocol           281\n#define OBJ_id_mod_timestamp_protocol           OBJ_id_pkix_mod,13L\n\n#define SN_id_mod_ocsp          \"id-mod-ocsp\"\n#define NID_id_mod_ocsp         282\n#define OBJ_id_mod_ocsp         OBJ_id_pkix_mod,14L\n\n#define SN_id_mod_dvcs          \"id-mod-dvcs\"\n#define NID_id_mod_dvcs         283\n#define OBJ_id_mod_dvcs         OBJ_id_pkix_mod,15L\n\n#define SN_id_mod_cmp2000               \"id-mod-cmp2000\"\n#define NID_id_mod_cmp2000              284\n#define OBJ_id_mod_cmp2000              OBJ_id_pkix_mod,16L\n\n#define SN_info_access          \"authorityInfoAccess\"\n#define LN_info_access          \"Authority Information Access\"\n#define NID_info_access         177\n#define OBJ_info_access         OBJ_id_pe,1L\n\n#define SN_biometricInfo                \"biometricInfo\"\n#define LN_biometricInfo                \"Biometric Info\"\n#define NID_biometricInfo               285\n#define OBJ_biometricInfo               OBJ_id_pe,2L\n\n#define SN_qcStatements         \"qcStatements\"\n#define NID_qcStatements                286\n#define OBJ_qcStatements                OBJ_id_pe,3L\n\n#define SN_ac_auditEntity               \"ac-auditEntity\"\n#define NID_ac_auditEntity              287\n#define OBJ_ac_auditEntity              OBJ_id_pe,4L\n\n#define SN_ac_targeting         \"ac-targeting\"\n#define NID_ac_targeting                288\n#define OBJ_ac_targeting                OBJ_id_pe,5L\n\n#define SN_aaControls           \"aaControls\"\n#define NID_aaControls          289\n#define OBJ_aaControls          OBJ_id_pe,6L\n\n#define SN_sbgp_ipAddrBlock             \"sbgp-ipAddrBlock\"\n#define NID_sbgp_ipAddrBlock            290\n#define OBJ_sbgp_ipAddrBlock            OBJ_id_pe,7L\n\n#define SN_sbgp_autonomousSysNum                \"sbgp-autonomousSysNum\"\n#define NID_sbgp_autonomousSysNum               291\n#define OBJ_sbgp_autonomousSysNum               OBJ_id_pe,8L\n\n#define SN_sbgp_routerIdentifier                \"sbgp-routerIdentifier\"\n#define NID_sbgp_routerIdentifier               292\n#define OBJ_sbgp_routerIdentifier               OBJ_id_pe,9L\n\n#define SN_ac_proxying          \"ac-proxying\"\n#define NID_ac_proxying         397\n#define OBJ_ac_proxying         OBJ_id_pe,10L\n\n#define SN_sinfo_access         \"subjectInfoAccess\"\n#define LN_sinfo_access         \"Subject Information Access\"\n#define NID_sinfo_access                398\n#define OBJ_sinfo_access                OBJ_id_pe,11L\n\n#define SN_proxyCertInfo                \"proxyCertInfo\"\n#define LN_proxyCertInfo                \"Proxy Certificate Information\"\n#define NID_proxyCertInfo               663\n#define OBJ_proxyCertInfo               OBJ_id_pe,14L\n\n#define SN_id_qt_cps            \"id-qt-cps\"\n#define LN_id_qt_cps            \"Policy Qualifier CPS\"\n#define NID_id_qt_cps           164\n#define OBJ_id_qt_cps           OBJ_id_qt,1L\n\n#define SN_id_qt_unotice                \"id-qt-unotice\"\n#define LN_id_qt_unotice                \"Policy Qualifier User Notice\"\n#define NID_id_qt_unotice               165\n#define OBJ_id_qt_unotice               OBJ_id_qt,2L\n\n#define SN_textNotice           \"textNotice\"\n#define NID_textNotice          293\n#define OBJ_textNotice          OBJ_id_qt,3L\n\n#define SN_server_auth          \"serverAuth\"\n#define LN_server_auth          \"TLS Web Server Authentication\"\n#define NID_server_auth         129\n#define OBJ_server_auth         OBJ_id_kp,1L\n\n#define SN_client_auth          \"clientAuth\"\n#define LN_client_auth          \"TLS Web Client Authentication\"\n#define NID_client_auth         130\n#define OBJ_client_auth         OBJ_id_kp,2L\n\n#define SN_code_sign            \"codeSigning\"\n#define LN_code_sign            \"Code Signing\"\n#define NID_code_sign           131\n#define OBJ_code_sign           OBJ_id_kp,3L\n\n#define SN_email_protect                \"emailProtection\"\n#define LN_email_protect                \"E-mail Protection\"\n#define NID_email_protect               132\n#define OBJ_email_protect               OBJ_id_kp,4L\n\n#define SN_ipsecEndSystem               \"ipsecEndSystem\"\n#define LN_ipsecEndSystem               \"IPSec End System\"\n#define NID_ipsecEndSystem              294\n#define OBJ_ipsecEndSystem              OBJ_id_kp,5L\n\n#define SN_ipsecTunnel          \"ipsecTunnel\"\n#define LN_ipsecTunnel          \"IPSec Tunnel\"\n#define NID_ipsecTunnel         295\n#define OBJ_ipsecTunnel         OBJ_id_kp,6L\n\n#define SN_ipsecUser            \"ipsecUser\"\n#define LN_ipsecUser            \"IPSec User\"\n#define NID_ipsecUser           296\n#define OBJ_ipsecUser           OBJ_id_kp,7L\n\n#define SN_time_stamp           \"timeStamping\"\n#define LN_time_stamp           \"Time Stamping\"\n#define NID_time_stamp          133\n#define OBJ_time_stamp          OBJ_id_kp,8L\n\n#define SN_OCSP_sign            \"OCSPSigning\"\n#define LN_OCSP_sign            \"OCSP Signing\"\n#define NID_OCSP_sign           180\n#define OBJ_OCSP_sign           OBJ_id_kp,9L\n\n#define SN_dvcs         \"DVCS\"\n#define LN_dvcs         \"dvcs\"\n#define NID_dvcs                297\n#define OBJ_dvcs                OBJ_id_kp,10L\n\n#define SN_id_it_caProtEncCert          \"id-it-caProtEncCert\"\n#define NID_id_it_caProtEncCert         298\n#define OBJ_id_it_caProtEncCert         OBJ_id_it,1L\n\n#define SN_id_it_signKeyPairTypes               \"id-it-signKeyPairTypes\"\n#define NID_id_it_signKeyPairTypes              299\n#define OBJ_id_it_signKeyPairTypes              OBJ_id_it,2L\n\n#define SN_id_it_encKeyPairTypes                \"id-it-encKeyPairTypes\"\n#define NID_id_it_encKeyPairTypes               300\n#define OBJ_id_it_encKeyPairTypes               OBJ_id_it,3L\n\n#define SN_id_it_preferredSymmAlg               \"id-it-preferredSymmAlg\"\n#define NID_id_it_preferredSymmAlg              301\n#define OBJ_id_it_preferredSymmAlg              OBJ_id_it,4L\n\n#define SN_id_it_caKeyUpdateInfo                \"id-it-caKeyUpdateInfo\"\n#define NID_id_it_caKeyUpdateInfo               302\n#define OBJ_id_it_caKeyUpdateInfo               OBJ_id_it,5L\n\n#define SN_id_it_currentCRL             \"id-it-currentCRL\"\n#define NID_id_it_currentCRL            303\n#define OBJ_id_it_currentCRL            OBJ_id_it,6L\n\n#define SN_id_it_unsupportedOIDs                \"id-it-unsupportedOIDs\"\n#define NID_id_it_unsupportedOIDs               304\n#define OBJ_id_it_unsupportedOIDs               OBJ_id_it,7L\n\n#define SN_id_it_subscriptionRequest            \"id-it-subscriptionRequest\"\n#define NID_id_it_subscriptionRequest           305\n#define OBJ_id_it_subscriptionRequest           OBJ_id_it,8L\n\n#define SN_id_it_subscriptionResponse           \"id-it-subscriptionResponse\"\n#define NID_id_it_subscriptionResponse          306\n#define OBJ_id_it_subscriptionResponse          OBJ_id_it,9L\n\n#define SN_id_it_keyPairParamReq                \"id-it-keyPairParamReq\"\n#define NID_id_it_keyPairParamReq               307\n#define OBJ_id_it_keyPairParamReq               OBJ_id_it,10L\n\n#define SN_id_it_keyPairParamRep                \"id-it-keyPairParamRep\"\n#define NID_id_it_keyPairParamRep               308\n#define OBJ_id_it_keyPairParamRep               OBJ_id_it,11L\n\n#define SN_id_it_revPassphrase          \"id-it-revPassphrase\"\n#define NID_id_it_revPassphrase         309\n#define OBJ_id_it_revPassphrase         OBJ_id_it,12L\n\n#define SN_id_it_implicitConfirm                \"id-it-implicitConfirm\"\n#define NID_id_it_implicitConfirm               310\n#define OBJ_id_it_implicitConfirm               OBJ_id_it,13L\n\n#define SN_id_it_confirmWaitTime                \"id-it-confirmWaitTime\"\n#define NID_id_it_confirmWaitTime               311\n#define OBJ_id_it_confirmWaitTime               OBJ_id_it,14L\n\n#define SN_id_it_origPKIMessage         \"id-it-origPKIMessage\"\n#define NID_id_it_origPKIMessage                312\n#define OBJ_id_it_origPKIMessage                OBJ_id_it,15L\n\n#define SN_id_it_suppLangTags           \"id-it-suppLangTags\"\n#define NID_id_it_suppLangTags          784\n#define OBJ_id_it_suppLangTags          OBJ_id_it,16L\n\n#define SN_id_regCtrl           \"id-regCtrl\"\n#define NID_id_regCtrl          313\n#define OBJ_id_regCtrl          OBJ_id_pkip,1L\n\n#define SN_id_regInfo           \"id-regInfo\"\n#define NID_id_regInfo          314\n#define OBJ_id_regInfo          OBJ_id_pkip,2L\n\n#define SN_id_regCtrl_regToken          \"id-regCtrl-regToken\"\n#define NID_id_regCtrl_regToken         315\n#define OBJ_id_regCtrl_regToken         OBJ_id_regCtrl,1L\n\n#define SN_id_regCtrl_authenticator             \"id-regCtrl-authenticator\"\n#define NID_id_regCtrl_authenticator            316\n#define OBJ_id_regCtrl_authenticator            OBJ_id_regCtrl,2L\n\n#define SN_id_regCtrl_pkiPublicationInfo                \"id-regCtrl-pkiPublicationInfo\"\n#define NID_id_regCtrl_pkiPublicationInfo               317\n#define OBJ_id_regCtrl_pkiPublicationInfo               OBJ_id_regCtrl,3L\n\n#define SN_id_regCtrl_pkiArchiveOptions         \"id-regCtrl-pkiArchiveOptions\"\n#define NID_id_regCtrl_pkiArchiveOptions                318\n#define OBJ_id_regCtrl_pkiArchiveOptions                OBJ_id_regCtrl,4L\n\n#define SN_id_regCtrl_oldCertID         \"id-regCtrl-oldCertID\"\n#define NID_id_regCtrl_oldCertID                319\n#define OBJ_id_regCtrl_oldCertID                OBJ_id_regCtrl,5L\n\n#define SN_id_regCtrl_protocolEncrKey           \"id-regCtrl-protocolEncrKey\"\n#define NID_id_regCtrl_protocolEncrKey          320\n#define OBJ_id_regCtrl_protocolEncrKey          OBJ_id_regCtrl,6L\n\n#define SN_id_regInfo_utf8Pairs         \"id-regInfo-utf8Pairs\"\n#define NID_id_regInfo_utf8Pairs                321\n#define OBJ_id_regInfo_utf8Pairs                OBJ_id_regInfo,1L\n\n#define SN_id_regInfo_certReq           \"id-regInfo-certReq\"\n#define NID_id_regInfo_certReq          322\n#define OBJ_id_regInfo_certReq          OBJ_id_regInfo,2L\n\n#define SN_id_alg_des40         \"id-alg-des40\"\n#define NID_id_alg_des40                323\n#define OBJ_id_alg_des40                OBJ_id_alg,1L\n\n#define SN_id_alg_noSignature           \"id-alg-noSignature\"\n#define NID_id_alg_noSignature          324\n#define OBJ_id_alg_noSignature          OBJ_id_alg,2L\n\n#define SN_id_alg_dh_sig_hmac_sha1              \"id-alg-dh-sig-hmac-sha1\"\n#define NID_id_alg_dh_sig_hmac_sha1             325\n#define OBJ_id_alg_dh_sig_hmac_sha1             OBJ_id_alg,3L\n\n#define SN_id_alg_dh_pop                \"id-alg-dh-pop\"\n#define NID_id_alg_dh_pop               326\n#define OBJ_id_alg_dh_pop               OBJ_id_alg,4L\n\n#define SN_id_cmc_statusInfo            \"id-cmc-statusInfo\"\n#define NID_id_cmc_statusInfo           327\n#define OBJ_id_cmc_statusInfo           OBJ_id_cmc,1L\n\n#define SN_id_cmc_identification                \"id-cmc-identification\"\n#define NID_id_cmc_identification               328\n#define OBJ_id_cmc_identification               OBJ_id_cmc,2L\n\n#define SN_id_cmc_identityProof         \"id-cmc-identityProof\"\n#define NID_id_cmc_identityProof                329\n#define OBJ_id_cmc_identityProof                OBJ_id_cmc,3L\n\n#define SN_id_cmc_dataReturn            \"id-cmc-dataReturn\"\n#define NID_id_cmc_dataReturn           330\n#define OBJ_id_cmc_dataReturn           OBJ_id_cmc,4L\n\n#define SN_id_cmc_transactionId         \"id-cmc-transactionId\"\n#define NID_id_cmc_transactionId                331\n#define OBJ_id_cmc_transactionId                OBJ_id_cmc,5L\n\n#define SN_id_cmc_senderNonce           \"id-cmc-senderNonce\"\n#define NID_id_cmc_senderNonce          332\n#define OBJ_id_cmc_senderNonce          OBJ_id_cmc,6L\n\n#define SN_id_cmc_recipientNonce                \"id-cmc-recipientNonce\"\n#define NID_id_cmc_recipientNonce               333\n#define OBJ_id_cmc_recipientNonce               OBJ_id_cmc,7L\n\n#define SN_id_cmc_addExtensions         \"id-cmc-addExtensions\"\n#define NID_id_cmc_addExtensions                334\n#define OBJ_id_cmc_addExtensions                OBJ_id_cmc,8L\n\n#define SN_id_cmc_encryptedPOP          \"id-cmc-encryptedPOP\"\n#define NID_id_cmc_encryptedPOP         335\n#define OBJ_id_cmc_encryptedPOP         OBJ_id_cmc,9L\n\n#define SN_id_cmc_decryptedPOP          \"id-cmc-decryptedPOP\"\n#define NID_id_cmc_decryptedPOP         336\n#define OBJ_id_cmc_decryptedPOP         OBJ_id_cmc,10L\n\n#define SN_id_cmc_lraPOPWitness         \"id-cmc-lraPOPWitness\"\n#define NID_id_cmc_lraPOPWitness                337\n#define OBJ_id_cmc_lraPOPWitness                OBJ_id_cmc,11L\n\n#define SN_id_cmc_getCert               \"id-cmc-getCert\"\n#define NID_id_cmc_getCert              338\n#define OBJ_id_cmc_getCert              OBJ_id_cmc,15L\n\n#define SN_id_cmc_getCRL                \"id-cmc-getCRL\"\n#define NID_id_cmc_getCRL               339\n#define OBJ_id_cmc_getCRL               OBJ_id_cmc,16L\n\n#define SN_id_cmc_revokeRequest         \"id-cmc-revokeRequest\"\n#define NID_id_cmc_revokeRequest                340\n#define OBJ_id_cmc_revokeRequest                OBJ_id_cmc,17L\n\n#define SN_id_cmc_regInfo               \"id-cmc-regInfo\"\n#define NID_id_cmc_regInfo              341\n#define OBJ_id_cmc_regInfo              OBJ_id_cmc,18L\n\n#define SN_id_cmc_responseInfo          \"id-cmc-responseInfo\"\n#define NID_id_cmc_responseInfo         342\n#define OBJ_id_cmc_responseInfo         OBJ_id_cmc,19L\n\n#define SN_id_cmc_queryPending          \"id-cmc-queryPending\"\n#define NID_id_cmc_queryPending         343\n#define OBJ_id_cmc_queryPending         OBJ_id_cmc,21L\n\n#define SN_id_cmc_popLinkRandom         \"id-cmc-popLinkRandom\"\n#define NID_id_cmc_popLinkRandom                344\n#define OBJ_id_cmc_popLinkRandom                OBJ_id_cmc,22L\n\n#define SN_id_cmc_popLinkWitness                \"id-cmc-popLinkWitness\"\n#define NID_id_cmc_popLinkWitness               345\n#define OBJ_id_cmc_popLinkWitness               OBJ_id_cmc,23L\n\n#define SN_id_cmc_confirmCertAcceptance         \"id-cmc-confirmCertAcceptance\"\n#define NID_id_cmc_confirmCertAcceptance                346\n#define OBJ_id_cmc_confirmCertAcceptance                OBJ_id_cmc,24L\n\n#define SN_id_on_personalData           \"id-on-personalData\"\n#define NID_id_on_personalData          347\n#define OBJ_id_on_personalData          OBJ_id_on,1L\n\n#define SN_id_on_permanentIdentifier            \"id-on-permanentIdentifier\"\n#define LN_id_on_permanentIdentifier            \"Permanent Identifier\"\n#define NID_id_on_permanentIdentifier           858\n#define OBJ_id_on_permanentIdentifier           OBJ_id_on,3L\n\n#define SN_id_pda_dateOfBirth           \"id-pda-dateOfBirth\"\n#define NID_id_pda_dateOfBirth          348\n#define OBJ_id_pda_dateOfBirth          OBJ_id_pda,1L\n\n#define SN_id_pda_placeOfBirth          \"id-pda-placeOfBirth\"\n#define NID_id_pda_placeOfBirth         349\n#define OBJ_id_pda_placeOfBirth         OBJ_id_pda,2L\n\n#define SN_id_pda_gender                \"id-pda-gender\"\n#define NID_id_pda_gender               351\n#define OBJ_id_pda_gender               OBJ_id_pda,3L\n\n#define SN_id_pda_countryOfCitizenship          \"id-pda-countryOfCitizenship\"\n#define NID_id_pda_countryOfCitizenship         352\n#define OBJ_id_pda_countryOfCitizenship         OBJ_id_pda,4L\n\n#define SN_id_pda_countryOfResidence            \"id-pda-countryOfResidence\"\n#define NID_id_pda_countryOfResidence           353\n#define OBJ_id_pda_countryOfResidence           OBJ_id_pda,5L\n\n#define SN_id_aca_authenticationInfo            \"id-aca-authenticationInfo\"\n#define NID_id_aca_authenticationInfo           354\n#define OBJ_id_aca_authenticationInfo           OBJ_id_aca,1L\n\n#define SN_id_aca_accessIdentity                \"id-aca-accessIdentity\"\n#define NID_id_aca_accessIdentity               355\n#define OBJ_id_aca_accessIdentity               OBJ_id_aca,2L\n\n#define SN_id_aca_chargingIdentity              \"id-aca-chargingIdentity\"\n#define NID_id_aca_chargingIdentity             356\n#define OBJ_id_aca_chargingIdentity             OBJ_id_aca,3L\n\n#define SN_id_aca_group         \"id-aca-group\"\n#define NID_id_aca_group                357\n#define OBJ_id_aca_group                OBJ_id_aca,4L\n\n#define SN_id_aca_role          \"id-aca-role\"\n#define NID_id_aca_role         358\n#define OBJ_id_aca_role         OBJ_id_aca,5L\n\n#define SN_id_aca_encAttrs              \"id-aca-encAttrs\"\n#define NID_id_aca_encAttrs             399\n#define OBJ_id_aca_encAttrs             OBJ_id_aca,6L\n\n#define SN_id_qcs_pkixQCSyntax_v1               \"id-qcs-pkixQCSyntax-v1\"\n#define NID_id_qcs_pkixQCSyntax_v1              359\n#define OBJ_id_qcs_pkixQCSyntax_v1              OBJ_id_qcs,1L\n\n#define SN_id_cct_crs           \"id-cct-crs\"\n#define NID_id_cct_crs          360\n#define OBJ_id_cct_crs          OBJ_id_cct,1L\n\n#define SN_id_cct_PKIData               \"id-cct-PKIData\"\n#define NID_id_cct_PKIData              361\n#define OBJ_id_cct_PKIData              OBJ_id_cct,2L\n\n#define SN_id_cct_PKIResponse           \"id-cct-PKIResponse\"\n#define NID_id_cct_PKIResponse          362\n#define OBJ_id_cct_PKIResponse          OBJ_id_cct,3L\n\n#define SN_id_ppl_anyLanguage           \"id-ppl-anyLanguage\"\n#define LN_id_ppl_anyLanguage           \"Any language\"\n#define NID_id_ppl_anyLanguage          664\n#define OBJ_id_ppl_anyLanguage          OBJ_id_ppl,0L\n\n#define SN_id_ppl_inheritAll            \"id-ppl-inheritAll\"\n#define LN_id_ppl_inheritAll            \"Inherit all\"\n#define NID_id_ppl_inheritAll           665\n#define OBJ_id_ppl_inheritAll           OBJ_id_ppl,1L\n\n#define SN_Independent          \"id-ppl-independent\"\n#define LN_Independent          \"Independent\"\n#define NID_Independent         667\n#define OBJ_Independent         OBJ_id_ppl,2L\n\n#define SN_ad_OCSP              \"OCSP\"\n#define LN_ad_OCSP              \"OCSP\"\n#define NID_ad_OCSP             178\n#define OBJ_ad_OCSP             OBJ_id_ad,1L\n\n#define SN_ad_ca_issuers                \"caIssuers\"\n#define LN_ad_ca_issuers                \"CA Issuers\"\n#define NID_ad_ca_issuers               179\n#define OBJ_ad_ca_issuers               OBJ_id_ad,2L\n\n#define SN_ad_timeStamping              \"ad_timestamping\"\n#define LN_ad_timeStamping              \"AD Time Stamping\"\n#define NID_ad_timeStamping             363\n#define OBJ_ad_timeStamping             OBJ_id_ad,3L\n\n#define SN_ad_dvcs              \"AD_DVCS\"\n#define LN_ad_dvcs              \"ad dvcs\"\n#define NID_ad_dvcs             364\n#define OBJ_ad_dvcs             OBJ_id_ad,4L\n\n#define SN_caRepository         \"caRepository\"\n#define LN_caRepository         \"CA Repository\"\n#define NID_caRepository                785\n#define OBJ_caRepository                OBJ_id_ad,5L\n\n#define OBJ_id_pkix_OCSP                OBJ_ad_OCSP\n\n#define SN_id_pkix_OCSP_basic           \"basicOCSPResponse\"\n#define LN_id_pkix_OCSP_basic           \"Basic OCSP Response\"\n#define NID_id_pkix_OCSP_basic          365\n#define OBJ_id_pkix_OCSP_basic          OBJ_id_pkix_OCSP,1L\n\n#define SN_id_pkix_OCSP_Nonce           \"Nonce\"\n#define LN_id_pkix_OCSP_Nonce           \"OCSP Nonce\"\n#define NID_id_pkix_OCSP_Nonce          366\n#define OBJ_id_pkix_OCSP_Nonce          OBJ_id_pkix_OCSP,2L\n\n#define SN_id_pkix_OCSP_CrlID           \"CrlID\"\n#define LN_id_pkix_OCSP_CrlID           \"OCSP CRL ID\"\n#define NID_id_pkix_OCSP_CrlID          367\n#define OBJ_id_pkix_OCSP_CrlID          OBJ_id_pkix_OCSP,3L\n\n#define SN_id_pkix_OCSP_acceptableResponses             \"acceptableResponses\"\n#define LN_id_pkix_OCSP_acceptableResponses             \"Acceptable OCSP Responses\"\n#define NID_id_pkix_OCSP_acceptableResponses            368\n#define OBJ_id_pkix_OCSP_acceptableResponses            OBJ_id_pkix_OCSP,4L\n\n#define SN_id_pkix_OCSP_noCheck         \"noCheck\"\n#define LN_id_pkix_OCSP_noCheck         \"OCSP No Check\"\n#define NID_id_pkix_OCSP_noCheck                369\n#define OBJ_id_pkix_OCSP_noCheck                OBJ_id_pkix_OCSP,5L\n\n#define SN_id_pkix_OCSP_archiveCutoff           \"archiveCutoff\"\n#define LN_id_pkix_OCSP_archiveCutoff           \"OCSP Archive Cutoff\"\n#define NID_id_pkix_OCSP_archiveCutoff          370\n#define OBJ_id_pkix_OCSP_archiveCutoff          OBJ_id_pkix_OCSP,6L\n\n#define SN_id_pkix_OCSP_serviceLocator          \"serviceLocator\"\n#define LN_id_pkix_OCSP_serviceLocator          \"OCSP Service Locator\"\n#define NID_id_pkix_OCSP_serviceLocator         371\n#define OBJ_id_pkix_OCSP_serviceLocator         OBJ_id_pkix_OCSP,7L\n\n#define SN_id_pkix_OCSP_extendedStatus          \"extendedStatus\"\n#define LN_id_pkix_OCSP_extendedStatus          \"Extended OCSP Status\"\n#define NID_id_pkix_OCSP_extendedStatus         372\n#define OBJ_id_pkix_OCSP_extendedStatus         OBJ_id_pkix_OCSP,8L\n\n#define SN_id_pkix_OCSP_valid           \"valid\"\n#define NID_id_pkix_OCSP_valid          373\n#define OBJ_id_pkix_OCSP_valid          OBJ_id_pkix_OCSP,9L\n\n#define SN_id_pkix_OCSP_path            \"path\"\n#define NID_id_pkix_OCSP_path           374\n#define OBJ_id_pkix_OCSP_path           OBJ_id_pkix_OCSP,10L\n\n#define SN_id_pkix_OCSP_trustRoot               \"trustRoot\"\n#define LN_id_pkix_OCSP_trustRoot               \"Trust Root\"\n#define NID_id_pkix_OCSP_trustRoot              375\n#define OBJ_id_pkix_OCSP_trustRoot              OBJ_id_pkix_OCSP,11L\n\n#define SN_algorithm            \"algorithm\"\n#define LN_algorithm            \"algorithm\"\n#define NID_algorithm           376\n#define OBJ_algorithm           1L,3L,14L,3L,2L\n\n#define SN_md5WithRSA           \"RSA-NP-MD5\"\n#define LN_md5WithRSA           \"md5WithRSA\"\n#define NID_md5WithRSA          104\n#define OBJ_md5WithRSA          OBJ_algorithm,3L\n\n#define SN_des_ecb              \"DES-ECB\"\n#define LN_des_ecb              \"des-ecb\"\n#define NID_des_ecb             29\n#define OBJ_des_ecb             OBJ_algorithm,6L\n\n#define SN_des_cbc              \"DES-CBC\"\n#define LN_des_cbc              \"des-cbc\"\n#define NID_des_cbc             31\n#define OBJ_des_cbc             OBJ_algorithm,7L\n\n#define SN_des_ofb64            \"DES-OFB\"\n#define LN_des_ofb64            \"des-ofb\"\n#define NID_des_ofb64           45\n#define OBJ_des_ofb64           OBJ_algorithm,8L\n\n#define SN_des_cfb64            \"DES-CFB\"\n#define LN_des_cfb64            \"des-cfb\"\n#define NID_des_cfb64           30\n#define OBJ_des_cfb64           OBJ_algorithm,9L\n\n#define SN_rsaSignature         \"rsaSignature\"\n#define NID_rsaSignature                377\n#define OBJ_rsaSignature                OBJ_algorithm,11L\n\n#define SN_dsa_2                \"DSA-old\"\n#define LN_dsa_2                \"dsaEncryption-old\"\n#define NID_dsa_2               67\n#define OBJ_dsa_2               OBJ_algorithm,12L\n\n#define SN_dsaWithSHA           \"DSA-SHA\"\n#define LN_dsaWithSHA           \"dsaWithSHA\"\n#define NID_dsaWithSHA          66\n#define OBJ_dsaWithSHA          OBJ_algorithm,13L\n\n#define SN_shaWithRSAEncryption         \"RSA-SHA\"\n#define LN_shaWithRSAEncryption         \"shaWithRSAEncryption\"\n#define NID_shaWithRSAEncryption                42\n#define OBJ_shaWithRSAEncryption                OBJ_algorithm,15L\n\n#define SN_des_ede_ecb          \"DES-EDE\"\n#define LN_des_ede_ecb          \"des-ede\"\n#define NID_des_ede_ecb         32\n#define OBJ_des_ede_ecb         OBJ_algorithm,17L\n\n#define SN_des_ede3_ecb         \"DES-EDE3\"\n#define LN_des_ede3_ecb         \"des-ede3\"\n#define NID_des_ede3_ecb                33\n\n#define SN_des_ede_cbc          \"DES-EDE-CBC\"\n#define LN_des_ede_cbc          \"des-ede-cbc\"\n#define NID_des_ede_cbc         43\n\n#define SN_des_ede_cfb64                \"DES-EDE-CFB\"\n#define LN_des_ede_cfb64                \"des-ede-cfb\"\n#define NID_des_ede_cfb64               60\n\n#define SN_des_ede3_cfb64               \"DES-EDE3-CFB\"\n#define LN_des_ede3_cfb64               \"des-ede3-cfb\"\n#define NID_des_ede3_cfb64              61\n\n#define SN_des_ede_ofb64                \"DES-EDE-OFB\"\n#define LN_des_ede_ofb64                \"des-ede-ofb\"\n#define NID_des_ede_ofb64               62\n\n#define SN_des_ede3_ofb64               \"DES-EDE3-OFB\"\n#define LN_des_ede3_ofb64               \"des-ede3-ofb\"\n#define NID_des_ede3_ofb64              63\n\n#define SN_desx_cbc             \"DESX-CBC\"\n#define LN_desx_cbc             \"desx-cbc\"\n#define NID_desx_cbc            80\n\n#define SN_sha          \"SHA\"\n#define LN_sha          \"sha\"\n#define NID_sha         41\n#define OBJ_sha         OBJ_algorithm,18L\n\n#define SN_sha1         \"SHA1\"\n#define LN_sha1         \"sha1\"\n#define NID_sha1                64\n#define OBJ_sha1                OBJ_algorithm,26L\n\n#define SN_dsaWithSHA1_2                \"DSA-SHA1-old\"\n#define LN_dsaWithSHA1_2                \"dsaWithSHA1-old\"\n#define NID_dsaWithSHA1_2               70\n#define OBJ_dsaWithSHA1_2               OBJ_algorithm,27L\n\n#define SN_sha1WithRSA          \"RSA-SHA1-2\"\n#define LN_sha1WithRSA          \"sha1WithRSA\"\n#define NID_sha1WithRSA         115\n#define OBJ_sha1WithRSA         OBJ_algorithm,29L\n\n#define SN_ripemd160            \"RIPEMD160\"\n#define LN_ripemd160            \"ripemd160\"\n#define NID_ripemd160           117\n#define OBJ_ripemd160           1L,3L,36L,3L,2L,1L\n\n#define SN_ripemd160WithRSA             \"RSA-RIPEMD160\"\n#define LN_ripemd160WithRSA             \"ripemd160WithRSA\"\n#define NID_ripemd160WithRSA            119\n#define OBJ_ripemd160WithRSA            1L,3L,36L,3L,3L,1L,2L\n\n#define SN_sxnet                \"SXNetID\"\n#define LN_sxnet                \"Strong Extranet ID\"\n#define NID_sxnet               143\n#define OBJ_sxnet               1L,3L,101L,1L,4L,1L\n\n#define SN_X500         \"X500\"\n#define LN_X500         \"directory services (X.500)\"\n#define NID_X500                11\n#define OBJ_X500                2L,5L\n\n#define SN_X509         \"X509\"\n#define NID_X509                12\n#define OBJ_X509                OBJ_X500,4L\n\n#define SN_commonName           \"CN\"\n#define LN_commonName           \"commonName\"\n#define NID_commonName          13\n#define OBJ_commonName          OBJ_X509,3L\n\n#define SN_surname              \"SN\"\n#define LN_surname              \"surname\"\n#define NID_surname             100\n#define OBJ_surname             OBJ_X509,4L\n\n#define LN_serialNumber         \"serialNumber\"\n#define NID_serialNumber                105\n#define OBJ_serialNumber                OBJ_X509,5L\n\n#define SN_countryName          \"C\"\n#define LN_countryName          \"countryName\"\n#define NID_countryName         14\n#define OBJ_countryName         OBJ_X509,6L\n\n#define SN_localityName         \"L\"\n#define LN_localityName         \"localityName\"\n#define NID_localityName                15\n#define OBJ_localityName                OBJ_X509,7L\n\n#define SN_stateOrProvinceName          \"ST\"\n#define LN_stateOrProvinceName          \"stateOrProvinceName\"\n#define NID_stateOrProvinceName         16\n#define OBJ_stateOrProvinceName         OBJ_X509,8L\n\n#define SN_streetAddress                \"street\"\n#define LN_streetAddress                \"streetAddress\"\n#define NID_streetAddress               660\n#define OBJ_streetAddress               OBJ_X509,9L\n\n#define SN_organizationName             \"O\"\n#define LN_organizationName             \"organizationName\"\n#define NID_organizationName            17\n#define OBJ_organizationName            OBJ_X509,10L\n\n#define SN_organizationalUnitName               \"OU\"\n#define LN_organizationalUnitName               \"organizationalUnitName\"\n#define NID_organizationalUnitName              18\n#define OBJ_organizationalUnitName              OBJ_X509,11L\n\n#define SN_title                \"title\"\n#define LN_title                \"title\"\n#define NID_title               106\n#define OBJ_title               OBJ_X509,12L\n\n#define LN_description          \"description\"\n#define NID_description         107\n#define OBJ_description         OBJ_X509,13L\n\n#define LN_searchGuide          \"searchGuide\"\n#define NID_searchGuide         859\n#define OBJ_searchGuide         OBJ_X509,14L\n\n#define LN_businessCategory             \"businessCategory\"\n#define NID_businessCategory            860\n#define OBJ_businessCategory            OBJ_X509,15L\n\n#define LN_postalAddress                \"postalAddress\"\n#define NID_postalAddress               861\n#define OBJ_postalAddress               OBJ_X509,16L\n\n#define LN_postalCode           \"postalCode\"\n#define NID_postalCode          661\n#define OBJ_postalCode          OBJ_X509,17L\n\n#define LN_postOfficeBox                \"postOfficeBox\"\n#define NID_postOfficeBox               862\n#define OBJ_postOfficeBox               OBJ_X509,18L\n\n#define LN_physicalDeliveryOfficeName           \"physicalDeliveryOfficeName\"\n#define NID_physicalDeliveryOfficeName          863\n#define OBJ_physicalDeliveryOfficeName          OBJ_X509,19L\n\n#define LN_telephoneNumber              \"telephoneNumber\"\n#define NID_telephoneNumber             864\n#define OBJ_telephoneNumber             OBJ_X509,20L\n\n#define LN_telexNumber          \"telexNumber\"\n#define NID_telexNumber         865\n#define OBJ_telexNumber         OBJ_X509,21L\n\n#define LN_teletexTerminalIdentifier            \"teletexTerminalIdentifier\"\n#define NID_teletexTerminalIdentifier           866\n#define OBJ_teletexTerminalIdentifier           OBJ_X509,22L\n\n#define LN_facsimileTelephoneNumber             \"facsimileTelephoneNumber\"\n#define NID_facsimileTelephoneNumber            867\n#define OBJ_facsimileTelephoneNumber            OBJ_X509,23L\n\n#define LN_x121Address          \"x121Address\"\n#define NID_x121Address         868\n#define OBJ_x121Address         OBJ_X509,24L\n\n#define LN_internationaliSDNNumber              \"internationaliSDNNumber\"\n#define NID_internationaliSDNNumber             869\n#define OBJ_internationaliSDNNumber             OBJ_X509,25L\n\n#define LN_registeredAddress            \"registeredAddress\"\n#define NID_registeredAddress           870\n#define OBJ_registeredAddress           OBJ_X509,26L\n\n#define LN_destinationIndicator         \"destinationIndicator\"\n#define NID_destinationIndicator                871\n#define OBJ_destinationIndicator                OBJ_X509,27L\n\n#define LN_preferredDeliveryMethod              \"preferredDeliveryMethod\"\n#define NID_preferredDeliveryMethod             872\n#define OBJ_preferredDeliveryMethod             OBJ_X509,28L\n\n#define LN_presentationAddress          \"presentationAddress\"\n#define NID_presentationAddress         873\n#define OBJ_presentationAddress         OBJ_X509,29L\n\n#define LN_supportedApplicationContext          \"supportedApplicationContext\"\n#define NID_supportedApplicationContext         874\n#define OBJ_supportedApplicationContext         OBJ_X509,30L\n\n#define SN_member               \"member\"\n#define NID_member              875\n#define OBJ_member              OBJ_X509,31L\n\n#define SN_owner                \"owner\"\n#define NID_owner               876\n#define OBJ_owner               OBJ_X509,32L\n\n#define LN_roleOccupant         \"roleOccupant\"\n#define NID_roleOccupant                877\n#define OBJ_roleOccupant                OBJ_X509,33L\n\n#define SN_seeAlso              \"seeAlso\"\n#define NID_seeAlso             878\n#define OBJ_seeAlso             OBJ_X509,34L\n\n#define LN_userPassword         \"userPassword\"\n#define NID_userPassword                879\n#define OBJ_userPassword                OBJ_X509,35L\n\n#define LN_userCertificate              \"userCertificate\"\n#define NID_userCertificate             880\n#define OBJ_userCertificate             OBJ_X509,36L\n\n#define LN_cACertificate                \"cACertificate\"\n#define NID_cACertificate               881\n#define OBJ_cACertificate               OBJ_X509,37L\n\n#define LN_authorityRevocationList              \"authorityRevocationList\"\n#define NID_authorityRevocationList             882\n#define OBJ_authorityRevocationList             OBJ_X509,38L\n\n#define LN_certificateRevocationList            \"certificateRevocationList\"\n#define NID_certificateRevocationList           883\n#define OBJ_certificateRevocationList           OBJ_X509,39L\n\n#define LN_crossCertificatePair         \"crossCertificatePair\"\n#define NID_crossCertificatePair                884\n#define OBJ_crossCertificatePair                OBJ_X509,40L\n\n#define SN_name         \"name\"\n#define LN_name         \"name\"\n#define NID_name                173\n#define OBJ_name                OBJ_X509,41L\n\n#define SN_givenName            \"GN\"\n#define LN_givenName            \"givenName\"\n#define NID_givenName           99\n#define OBJ_givenName           OBJ_X509,42L\n\n#define SN_initials             \"initials\"\n#define LN_initials             \"initials\"\n#define NID_initials            101\n#define OBJ_initials            OBJ_X509,43L\n\n#define LN_generationQualifier          \"generationQualifier\"\n#define NID_generationQualifier         509\n#define OBJ_generationQualifier         OBJ_X509,44L\n\n#define LN_x500UniqueIdentifier         \"x500UniqueIdentifier\"\n#define NID_x500UniqueIdentifier                503\n#define OBJ_x500UniqueIdentifier                OBJ_X509,45L\n\n#define SN_dnQualifier          \"dnQualifier\"\n#define LN_dnQualifier          \"dnQualifier\"\n#define NID_dnQualifier         174\n#define OBJ_dnQualifier         OBJ_X509,46L\n\n#define LN_enhancedSearchGuide          \"enhancedSearchGuide\"\n#define NID_enhancedSearchGuide         885\n#define OBJ_enhancedSearchGuide         OBJ_X509,47L\n\n#define LN_protocolInformation          \"protocolInformation\"\n#define NID_protocolInformation         886\n#define OBJ_protocolInformation         OBJ_X509,48L\n\n#define LN_distinguishedName            \"distinguishedName\"\n#define NID_distinguishedName           887\n#define OBJ_distinguishedName           OBJ_X509,49L\n\n#define LN_uniqueMember         \"uniqueMember\"\n#define NID_uniqueMember                888\n#define OBJ_uniqueMember                OBJ_X509,50L\n\n#define LN_houseIdentifier              \"houseIdentifier\"\n#define NID_houseIdentifier             889\n#define OBJ_houseIdentifier             OBJ_X509,51L\n\n#define LN_supportedAlgorithms          \"supportedAlgorithms\"\n#define NID_supportedAlgorithms         890\n#define OBJ_supportedAlgorithms         OBJ_X509,52L\n\n#define LN_deltaRevocationList          \"deltaRevocationList\"\n#define NID_deltaRevocationList         891\n#define OBJ_deltaRevocationList         OBJ_X509,53L\n\n#define SN_dmdName              \"dmdName\"\n#define NID_dmdName             892\n#define OBJ_dmdName             OBJ_X509,54L\n\n#define LN_pseudonym            \"pseudonym\"\n#define NID_pseudonym           510\n#define OBJ_pseudonym           OBJ_X509,65L\n\n#define SN_role         \"role\"\n#define LN_role         \"role\"\n#define NID_role                400\n#define OBJ_role                OBJ_X509,72L\n\n#define SN_X500algorithms               \"X500algorithms\"\n#define LN_X500algorithms               \"directory services - algorithms\"\n#define NID_X500algorithms              378\n#define OBJ_X500algorithms              OBJ_X500,8L\n\n#define SN_rsa          \"RSA\"\n#define LN_rsa          \"rsa\"\n#define NID_rsa         19\n#define OBJ_rsa         OBJ_X500algorithms,1L,1L\n\n#define SN_mdc2WithRSA          \"RSA-MDC2\"\n#define LN_mdc2WithRSA          \"mdc2WithRSA\"\n#define NID_mdc2WithRSA         96\n#define OBJ_mdc2WithRSA         OBJ_X500algorithms,3L,100L\n\n#define SN_mdc2         \"MDC2\"\n#define LN_mdc2         \"mdc2\"\n#define NID_mdc2                95\n#define OBJ_mdc2                OBJ_X500algorithms,3L,101L\n\n#define SN_id_ce                \"id-ce\"\n#define NID_id_ce               81\n#define OBJ_id_ce               OBJ_X500,29L\n\n#define SN_subject_directory_attributes         \"subjectDirectoryAttributes\"\n#define LN_subject_directory_attributes         \"X509v3 Subject Directory Attributes\"\n#define NID_subject_directory_attributes                769\n#define OBJ_subject_directory_attributes                OBJ_id_ce,9L\n\n#define SN_subject_key_identifier               \"subjectKeyIdentifier\"\n#define LN_subject_key_identifier               \"X509v3 Subject Key Identifier\"\n#define NID_subject_key_identifier              82\n#define OBJ_subject_key_identifier              OBJ_id_ce,14L\n\n#define SN_key_usage            \"keyUsage\"\n#define LN_key_usage            \"X509v3 Key Usage\"\n#define NID_key_usage           83\n#define OBJ_key_usage           OBJ_id_ce,15L\n\n#define SN_private_key_usage_period             \"privateKeyUsagePeriod\"\n#define LN_private_key_usage_period             \"X509v3 Private Key Usage Period\"\n#define NID_private_key_usage_period            84\n#define OBJ_private_key_usage_period            OBJ_id_ce,16L\n\n#define SN_subject_alt_name             \"subjectAltName\"\n#define LN_subject_alt_name             \"X509v3 Subject Alternative Name\"\n#define NID_subject_alt_name            85\n#define OBJ_subject_alt_name            OBJ_id_ce,17L\n\n#define SN_issuer_alt_name              \"issuerAltName\"\n#define LN_issuer_alt_name              \"X509v3 Issuer Alternative Name\"\n#define NID_issuer_alt_name             86\n#define OBJ_issuer_alt_name             OBJ_id_ce,18L\n\n#define SN_basic_constraints            \"basicConstraints\"\n#define LN_basic_constraints            \"X509v3 Basic Constraints\"\n#define NID_basic_constraints           87\n#define OBJ_basic_constraints           OBJ_id_ce,19L\n\n#define SN_crl_number           \"crlNumber\"\n#define LN_crl_number           \"X509v3 CRL Number\"\n#define NID_crl_number          88\n#define OBJ_crl_number          OBJ_id_ce,20L\n\n#define SN_crl_reason           \"CRLReason\"\n#define LN_crl_reason           \"X509v3 CRL Reason Code\"\n#define NID_crl_reason          141\n#define OBJ_crl_reason          OBJ_id_ce,21L\n\n#define SN_invalidity_date              \"invalidityDate\"\n#define LN_invalidity_date              \"Invalidity Date\"\n#define NID_invalidity_date             142\n#define OBJ_invalidity_date             OBJ_id_ce,24L\n\n#define SN_delta_crl            \"deltaCRL\"\n#define LN_delta_crl            \"X509v3 Delta CRL Indicator\"\n#define NID_delta_crl           140\n#define OBJ_delta_crl           OBJ_id_ce,27L\n\n#define SN_issuing_distribution_point           \"issuingDistributionPoint\"\n#define LN_issuing_distribution_point           \"X509v3 Issuing Distrubution Point\"\n#define NID_issuing_distribution_point          770\n#define OBJ_issuing_distribution_point          OBJ_id_ce,28L\n\n#define SN_certificate_issuer           \"certificateIssuer\"\n#define LN_certificate_issuer           \"X509v3 Certificate Issuer\"\n#define NID_certificate_issuer          771\n#define OBJ_certificate_issuer          OBJ_id_ce,29L\n\n#define SN_name_constraints             \"nameConstraints\"\n#define LN_name_constraints             \"X509v3 Name Constraints\"\n#define NID_name_constraints            666\n#define OBJ_name_constraints            OBJ_id_ce,30L\n\n#define SN_crl_distribution_points              \"crlDistributionPoints\"\n#define LN_crl_distribution_points              \"X509v3 CRL Distribution Points\"\n#define NID_crl_distribution_points             103\n#define OBJ_crl_distribution_points             OBJ_id_ce,31L\n\n#define SN_certificate_policies         \"certificatePolicies\"\n#define LN_certificate_policies         \"X509v3 Certificate Policies\"\n#define NID_certificate_policies                89\n#define OBJ_certificate_policies                OBJ_id_ce,32L\n\n#define SN_any_policy           \"anyPolicy\"\n#define LN_any_policy           \"X509v3 Any Policy\"\n#define NID_any_policy          746\n#define OBJ_any_policy          OBJ_certificate_policies,0L\n\n#define SN_policy_mappings              \"policyMappings\"\n#define LN_policy_mappings              \"X509v3 Policy Mappings\"\n#define NID_policy_mappings             747\n#define OBJ_policy_mappings             OBJ_id_ce,33L\n\n#define SN_authority_key_identifier             \"authorityKeyIdentifier\"\n#define LN_authority_key_identifier             \"X509v3 Authority Key Identifier\"\n#define NID_authority_key_identifier            90\n#define OBJ_authority_key_identifier            OBJ_id_ce,35L\n\n#define SN_policy_constraints           \"policyConstraints\"\n#define LN_policy_constraints           \"X509v3 Policy Constraints\"\n#define NID_policy_constraints          401\n#define OBJ_policy_constraints          OBJ_id_ce,36L\n\n#define SN_ext_key_usage                \"extendedKeyUsage\"\n#define LN_ext_key_usage                \"X509v3 Extended Key Usage\"\n#define NID_ext_key_usage               126\n#define OBJ_ext_key_usage               OBJ_id_ce,37L\n\n#define SN_freshest_crl         \"freshestCRL\"\n#define LN_freshest_crl         \"X509v3 Freshest CRL\"\n#define NID_freshest_crl                857\n#define OBJ_freshest_crl                OBJ_id_ce,46L\n\n#define SN_inhibit_any_policy           \"inhibitAnyPolicy\"\n#define LN_inhibit_any_policy           \"X509v3 Inhibit Any Policy\"\n#define NID_inhibit_any_policy          748\n#define OBJ_inhibit_any_policy          OBJ_id_ce,54L\n\n#define SN_target_information           \"targetInformation\"\n#define LN_target_information           \"X509v3 AC Targeting\"\n#define NID_target_information          402\n#define OBJ_target_information          OBJ_id_ce,55L\n\n#define SN_no_rev_avail         \"noRevAvail\"\n#define LN_no_rev_avail         \"X509v3 No Revocation Available\"\n#define NID_no_rev_avail                403\n#define OBJ_no_rev_avail                OBJ_id_ce,56L\n\n#define SN_anyExtendedKeyUsage          \"anyExtendedKeyUsage\"\n#define LN_anyExtendedKeyUsage          \"Any Extended Key Usage\"\n#define NID_anyExtendedKeyUsage         910\n#define OBJ_anyExtendedKeyUsage         OBJ_ext_key_usage,0L\n\n#define SN_netscape             \"Netscape\"\n#define LN_netscape             \"Netscape Communications Corp.\"\n#define NID_netscape            57\n#define OBJ_netscape            2L,16L,840L,1L,113730L\n\n#define SN_netscape_cert_extension              \"nsCertExt\"\n#define LN_netscape_cert_extension              \"Netscape Certificate Extension\"\n#define NID_netscape_cert_extension             58\n#define OBJ_netscape_cert_extension             OBJ_netscape,1L\n\n#define SN_netscape_data_type           \"nsDataType\"\n#define LN_netscape_data_type           \"Netscape Data Type\"\n#define NID_netscape_data_type          59\n#define OBJ_netscape_data_type          OBJ_netscape,2L\n\n#define SN_netscape_cert_type           \"nsCertType\"\n#define LN_netscape_cert_type           \"Netscape Cert Type\"\n#define NID_netscape_cert_type          71\n#define OBJ_netscape_cert_type          OBJ_netscape_cert_extension,1L\n\n#define SN_netscape_base_url            \"nsBaseUrl\"\n#define LN_netscape_base_url            \"Netscape Base Url\"\n#define NID_netscape_base_url           72\n#define OBJ_netscape_base_url           OBJ_netscape_cert_extension,2L\n\n#define SN_netscape_revocation_url              \"nsRevocationUrl\"\n#define LN_netscape_revocation_url              \"Netscape Revocation Url\"\n#define NID_netscape_revocation_url             73\n#define OBJ_netscape_revocation_url             OBJ_netscape_cert_extension,3L\n\n#define SN_netscape_ca_revocation_url           \"nsCaRevocationUrl\"\n#define LN_netscape_ca_revocation_url           \"Netscape CA Revocation Url\"\n#define NID_netscape_ca_revocation_url          74\n#define OBJ_netscape_ca_revocation_url          OBJ_netscape_cert_extension,4L\n\n#define SN_netscape_renewal_url         \"nsRenewalUrl\"\n#define LN_netscape_renewal_url         \"Netscape Renewal Url\"\n#define NID_netscape_renewal_url                75\n#define OBJ_netscape_renewal_url                OBJ_netscape_cert_extension,7L\n\n#define SN_netscape_ca_policy_url               \"nsCaPolicyUrl\"\n#define LN_netscape_ca_policy_url               \"Netscape CA Policy Url\"\n#define NID_netscape_ca_policy_url              76\n#define OBJ_netscape_ca_policy_url              OBJ_netscape_cert_extension,8L\n\n#define SN_netscape_ssl_server_name             \"nsSslServerName\"\n#define LN_netscape_ssl_server_name             \"Netscape SSL Server Name\"\n#define NID_netscape_ssl_server_name            77\n#define OBJ_netscape_ssl_server_name            OBJ_netscape_cert_extension,12L\n\n#define SN_netscape_comment             \"nsComment\"\n#define LN_netscape_comment             \"Netscape Comment\"\n#define NID_netscape_comment            78\n#define OBJ_netscape_comment            OBJ_netscape_cert_extension,13L\n\n#define SN_netscape_cert_sequence               \"nsCertSequence\"\n#define LN_netscape_cert_sequence               \"Netscape Certificate Sequence\"\n#define NID_netscape_cert_sequence              79\n#define OBJ_netscape_cert_sequence              OBJ_netscape_data_type,5L\n\n#define SN_ns_sgc               \"nsSGC\"\n#define LN_ns_sgc               \"Netscape Server Gated Crypto\"\n#define NID_ns_sgc              139\n#define OBJ_ns_sgc              OBJ_netscape,4L,1L\n\n#define SN_org          \"ORG\"\n#define LN_org          \"org\"\n#define NID_org         379\n#define OBJ_org         OBJ_iso,3L\n\n#define SN_dod          \"DOD\"\n#define LN_dod          \"dod\"\n#define NID_dod         380\n#define OBJ_dod         OBJ_org,6L\n\n#define SN_iana         \"IANA\"\n#define LN_iana         \"iana\"\n#define NID_iana                381\n#define OBJ_iana                OBJ_dod,1L\n\n#define OBJ_internet            OBJ_iana\n\n#define SN_Directory            \"directory\"\n#define LN_Directory            \"Directory\"\n#define NID_Directory           382\n#define OBJ_Directory           OBJ_internet,1L\n\n#define SN_Management           \"mgmt\"\n#define LN_Management           \"Management\"\n#define NID_Management          383\n#define OBJ_Management          OBJ_internet,2L\n\n#define SN_Experimental         \"experimental\"\n#define LN_Experimental         \"Experimental\"\n#define NID_Experimental                384\n#define OBJ_Experimental                OBJ_internet,3L\n\n#define SN_Private              \"private\"\n#define LN_Private              \"Private\"\n#define NID_Private             385\n#define OBJ_Private             OBJ_internet,4L\n\n#define SN_Security             \"security\"\n#define LN_Security             \"Security\"\n#define NID_Security            386\n#define OBJ_Security            OBJ_internet,5L\n\n#define SN_SNMPv2               \"snmpv2\"\n#define LN_SNMPv2               \"SNMPv2\"\n#define NID_SNMPv2              387\n#define OBJ_SNMPv2              OBJ_internet,6L\n\n#define LN_Mail         \"Mail\"\n#define NID_Mail                388\n#define OBJ_Mail                OBJ_internet,7L\n\n#define SN_Enterprises          \"enterprises\"\n#define LN_Enterprises          \"Enterprises\"\n#define NID_Enterprises         389\n#define OBJ_Enterprises         OBJ_Private,1L\n\n#define SN_dcObject             \"dcobject\"\n#define LN_dcObject             \"dcObject\"\n#define NID_dcObject            390\n#define OBJ_dcObject            OBJ_Enterprises,1466L,344L\n\n#define SN_mime_mhs             \"mime-mhs\"\n#define LN_mime_mhs             \"MIME MHS\"\n#define NID_mime_mhs            504\n#define OBJ_mime_mhs            OBJ_Mail,1L\n\n#define SN_mime_mhs_headings            \"mime-mhs-headings\"\n#define LN_mime_mhs_headings            \"mime-mhs-headings\"\n#define NID_mime_mhs_headings           505\n#define OBJ_mime_mhs_headings           OBJ_mime_mhs,1L\n\n#define SN_mime_mhs_bodies              \"mime-mhs-bodies\"\n#define LN_mime_mhs_bodies              \"mime-mhs-bodies\"\n#define NID_mime_mhs_bodies             506\n#define OBJ_mime_mhs_bodies             OBJ_mime_mhs,2L\n\n#define SN_id_hex_partial_message               \"id-hex-partial-message\"\n#define LN_id_hex_partial_message               \"id-hex-partial-message\"\n#define NID_id_hex_partial_message              507\n#define OBJ_id_hex_partial_message              OBJ_mime_mhs_headings,1L\n\n#define SN_id_hex_multipart_message             \"id-hex-multipart-message\"\n#define LN_id_hex_multipart_message             \"id-hex-multipart-message\"\n#define NID_id_hex_multipart_message            508\n#define OBJ_id_hex_multipart_message            OBJ_mime_mhs_headings,2L\n\n#define SN_rle_compression              \"RLE\"\n#define LN_rle_compression              \"run length compression\"\n#define NID_rle_compression             124\n#define OBJ_rle_compression             1L,1L,1L,1L,666L,1L\n\n#define SN_zlib_compression             \"ZLIB\"\n#define LN_zlib_compression             \"zlib compression\"\n#define NID_zlib_compression            125\n#define OBJ_zlib_compression            OBJ_id_smime_alg,8L\n\n#define OBJ_csor                2L,16L,840L,1L,101L,3L\n\n#define OBJ_nistAlgorithms              OBJ_csor,4L\n\n#define OBJ_aes         OBJ_nistAlgorithms,1L\n\n#define SN_aes_128_ecb          \"AES-128-ECB\"\n#define LN_aes_128_ecb          \"aes-128-ecb\"\n#define NID_aes_128_ecb         418\n#define OBJ_aes_128_ecb         OBJ_aes,1L\n\n#define SN_aes_128_cbc          \"AES-128-CBC\"\n#define LN_aes_128_cbc          \"aes-128-cbc\"\n#define NID_aes_128_cbc         419\n#define OBJ_aes_128_cbc         OBJ_aes,2L\n\n#define SN_aes_128_ofb128               \"AES-128-OFB\"\n#define LN_aes_128_ofb128               \"aes-128-ofb\"\n#define NID_aes_128_ofb128              420\n#define OBJ_aes_128_ofb128              OBJ_aes,3L\n\n#define SN_aes_128_cfb128               \"AES-128-CFB\"\n#define LN_aes_128_cfb128               \"aes-128-cfb\"\n#define NID_aes_128_cfb128              421\n#define OBJ_aes_128_cfb128              OBJ_aes,4L\n\n#define SN_id_aes128_wrap               \"id-aes128-wrap\"\n#define NID_id_aes128_wrap              788\n#define OBJ_id_aes128_wrap              OBJ_aes,5L\n\n#define SN_aes_128_gcm          \"id-aes128-GCM\"\n#define LN_aes_128_gcm          \"aes-128-gcm\"\n#define NID_aes_128_gcm         895\n#define OBJ_aes_128_gcm         OBJ_aes,6L\n\n#define SN_aes_128_ccm          \"id-aes128-CCM\"\n#define LN_aes_128_ccm          \"aes-128-ccm\"\n#define NID_aes_128_ccm         896\n#define OBJ_aes_128_ccm         OBJ_aes,7L\n\n#define SN_id_aes128_wrap_pad           \"id-aes128-wrap-pad\"\n#define NID_id_aes128_wrap_pad          897\n#define OBJ_id_aes128_wrap_pad          OBJ_aes,8L\n\n#define SN_aes_192_ecb          \"AES-192-ECB\"\n#define LN_aes_192_ecb          \"aes-192-ecb\"\n#define NID_aes_192_ecb         422\n#define OBJ_aes_192_ecb         OBJ_aes,21L\n\n#define SN_aes_192_cbc          \"AES-192-CBC\"\n#define LN_aes_192_cbc          \"aes-192-cbc\"\n#define NID_aes_192_cbc         423\n#define OBJ_aes_192_cbc         OBJ_aes,22L\n\n#define SN_aes_192_ofb128               \"AES-192-OFB\"\n#define LN_aes_192_ofb128               \"aes-192-ofb\"\n#define NID_aes_192_ofb128              424\n#define OBJ_aes_192_ofb128              OBJ_aes,23L\n\n#define SN_aes_192_cfb128               \"AES-192-CFB\"\n#define LN_aes_192_cfb128               \"aes-192-cfb\"\n#define NID_aes_192_cfb128              425\n#define OBJ_aes_192_cfb128              OBJ_aes,24L\n\n#define SN_id_aes192_wrap               \"id-aes192-wrap\"\n#define NID_id_aes192_wrap              789\n#define OBJ_id_aes192_wrap              OBJ_aes,25L\n\n#define SN_aes_192_gcm          \"id-aes192-GCM\"\n#define LN_aes_192_gcm          \"aes-192-gcm\"\n#define NID_aes_192_gcm         898\n#define OBJ_aes_192_gcm         OBJ_aes,26L\n\n#define SN_aes_192_ccm          \"id-aes192-CCM\"\n#define LN_aes_192_ccm          \"aes-192-ccm\"\n#define NID_aes_192_ccm         899\n#define OBJ_aes_192_ccm         OBJ_aes,27L\n\n#define SN_id_aes192_wrap_pad           \"id-aes192-wrap-pad\"\n#define NID_id_aes192_wrap_pad          900\n#define OBJ_id_aes192_wrap_pad          OBJ_aes,28L\n\n#define SN_aes_256_ecb          \"AES-256-ECB\"\n#define LN_aes_256_ecb          \"aes-256-ecb\"\n#define NID_aes_256_ecb         426\n#define OBJ_aes_256_ecb         OBJ_aes,41L\n\n#define SN_aes_256_cbc          \"AES-256-CBC\"\n#define LN_aes_256_cbc          \"aes-256-cbc\"\n#define NID_aes_256_cbc         427\n#define OBJ_aes_256_cbc         OBJ_aes,42L\n\n#define SN_aes_256_ofb128               \"AES-256-OFB\"\n#define LN_aes_256_ofb128               \"aes-256-ofb\"\n#define NID_aes_256_ofb128              428\n#define OBJ_aes_256_ofb128              OBJ_aes,43L\n\n#define SN_aes_256_cfb128               \"AES-256-CFB\"\n#define LN_aes_256_cfb128               \"aes-256-cfb\"\n#define NID_aes_256_cfb128              429\n#define OBJ_aes_256_cfb128              OBJ_aes,44L\n\n#define SN_id_aes256_wrap               \"id-aes256-wrap\"\n#define NID_id_aes256_wrap              790\n#define OBJ_id_aes256_wrap              OBJ_aes,45L\n\n#define SN_aes_256_gcm          \"id-aes256-GCM\"\n#define LN_aes_256_gcm          \"aes-256-gcm\"\n#define NID_aes_256_gcm         901\n#define OBJ_aes_256_gcm         OBJ_aes,46L\n\n#define SN_aes_256_ccm          \"id-aes256-CCM\"\n#define LN_aes_256_ccm          \"aes-256-ccm\"\n#define NID_aes_256_ccm         902\n#define OBJ_aes_256_ccm         OBJ_aes,47L\n\n#define SN_id_aes256_wrap_pad           \"id-aes256-wrap-pad\"\n#define NID_id_aes256_wrap_pad          903\n#define OBJ_id_aes256_wrap_pad          OBJ_aes,48L\n\n#define SN_aes_128_cfb1         \"AES-128-CFB1\"\n#define LN_aes_128_cfb1         \"aes-128-cfb1\"\n#define NID_aes_128_cfb1                650\n\n#define SN_aes_192_cfb1         \"AES-192-CFB1\"\n#define LN_aes_192_cfb1         \"aes-192-cfb1\"\n#define NID_aes_192_cfb1                651\n\n#define SN_aes_256_cfb1         \"AES-256-CFB1\"\n#define LN_aes_256_cfb1         \"aes-256-cfb1\"\n#define NID_aes_256_cfb1                652\n\n#define SN_aes_128_cfb8         \"AES-128-CFB8\"\n#define LN_aes_128_cfb8         \"aes-128-cfb8\"\n#define NID_aes_128_cfb8                653\n\n#define SN_aes_192_cfb8         \"AES-192-CFB8\"\n#define LN_aes_192_cfb8         \"aes-192-cfb8\"\n#define NID_aes_192_cfb8                654\n\n#define SN_aes_256_cfb8         \"AES-256-CFB8\"\n#define LN_aes_256_cfb8         \"aes-256-cfb8\"\n#define NID_aes_256_cfb8                655\n\n#define SN_aes_128_ctr          \"AES-128-CTR\"\n#define LN_aes_128_ctr          \"aes-128-ctr\"\n#define NID_aes_128_ctr         904\n\n#define SN_aes_192_ctr          \"AES-192-CTR\"\n#define LN_aes_192_ctr          \"aes-192-ctr\"\n#define NID_aes_192_ctr         905\n\n#define SN_aes_256_ctr          \"AES-256-CTR\"\n#define LN_aes_256_ctr          \"aes-256-ctr\"\n#define NID_aes_256_ctr         906\n\n#define SN_aes_128_xts          \"AES-128-XTS\"\n#define LN_aes_128_xts          \"aes-128-xts\"\n#define NID_aes_128_xts         913\n\n#define SN_aes_256_xts          \"AES-256-XTS\"\n#define LN_aes_256_xts          \"aes-256-xts\"\n#define NID_aes_256_xts         914\n\n#define SN_des_cfb1             \"DES-CFB1\"\n#define LN_des_cfb1             \"des-cfb1\"\n#define NID_des_cfb1            656\n\n#define SN_des_cfb8             \"DES-CFB8\"\n#define LN_des_cfb8             \"des-cfb8\"\n#define NID_des_cfb8            657\n\n#define SN_des_ede3_cfb1                \"DES-EDE3-CFB1\"\n#define LN_des_ede3_cfb1                \"des-ede3-cfb1\"\n#define NID_des_ede3_cfb1               658\n\n#define SN_des_ede3_cfb8                \"DES-EDE3-CFB8\"\n#define LN_des_ede3_cfb8                \"des-ede3-cfb8\"\n#define NID_des_ede3_cfb8               659\n\n#define OBJ_nist_hashalgs               OBJ_nistAlgorithms,2L\n\n#define SN_sha256               \"SHA256\"\n#define LN_sha256               \"sha256\"\n#define NID_sha256              672\n#define OBJ_sha256              OBJ_nist_hashalgs,1L\n\n#define SN_sha384               \"SHA384\"\n#define LN_sha384               \"sha384\"\n#define NID_sha384              673\n#define OBJ_sha384              OBJ_nist_hashalgs,2L\n\n#define SN_sha512               \"SHA512\"\n#define LN_sha512               \"sha512\"\n#define NID_sha512              674\n#define OBJ_sha512              OBJ_nist_hashalgs,3L\n\n#define SN_sha224               \"SHA224\"\n#define LN_sha224               \"sha224\"\n#define NID_sha224              675\n#define OBJ_sha224              OBJ_nist_hashalgs,4L\n\n#define OBJ_dsa_with_sha2               OBJ_nistAlgorithms,3L\n\n#define SN_dsa_with_SHA224              \"dsa_with_SHA224\"\n#define NID_dsa_with_SHA224             802\n#define OBJ_dsa_with_SHA224             OBJ_dsa_with_sha2,1L\n\n#define SN_dsa_with_SHA256              \"dsa_with_SHA256\"\n#define NID_dsa_with_SHA256             803\n#define OBJ_dsa_with_SHA256             OBJ_dsa_with_sha2,2L\n\n#define SN_hold_instruction_code                \"holdInstructionCode\"\n#define LN_hold_instruction_code                \"Hold Instruction Code\"\n#define NID_hold_instruction_code               430\n#define OBJ_hold_instruction_code               OBJ_id_ce,23L\n\n#define OBJ_holdInstruction             OBJ_X9_57,2L\n\n#define SN_hold_instruction_none                \"holdInstructionNone\"\n#define LN_hold_instruction_none                \"Hold Instruction None\"\n#define NID_hold_instruction_none               431\n#define OBJ_hold_instruction_none               OBJ_holdInstruction,1L\n\n#define SN_hold_instruction_call_issuer         \"holdInstructionCallIssuer\"\n#define LN_hold_instruction_call_issuer         \"Hold Instruction Call Issuer\"\n#define NID_hold_instruction_call_issuer                432\n#define OBJ_hold_instruction_call_issuer                OBJ_holdInstruction,2L\n\n#define SN_hold_instruction_reject              \"holdInstructionReject\"\n#define LN_hold_instruction_reject              \"Hold Instruction Reject\"\n#define NID_hold_instruction_reject             433\n#define OBJ_hold_instruction_reject             OBJ_holdInstruction,3L\n\n#define SN_data         \"data\"\n#define NID_data                434\n#define OBJ_data                OBJ_itu_t,9L\n\n#define SN_pss          \"pss\"\n#define NID_pss         435\n#define OBJ_pss         OBJ_data,2342L\n\n#define SN_ucl          \"ucl\"\n#define NID_ucl         436\n#define OBJ_ucl         OBJ_pss,19200300L\n\n#define SN_pilot                \"pilot\"\n#define NID_pilot               437\n#define OBJ_pilot               OBJ_ucl,100L\n\n#define LN_pilotAttributeType           \"pilotAttributeType\"\n#define NID_pilotAttributeType          438\n#define OBJ_pilotAttributeType          OBJ_pilot,1L\n\n#define LN_pilotAttributeSyntax         \"pilotAttributeSyntax\"\n#define NID_pilotAttributeSyntax                439\n#define OBJ_pilotAttributeSyntax                OBJ_pilot,3L\n\n#define LN_pilotObjectClass             \"pilotObjectClass\"\n#define NID_pilotObjectClass            440\n#define OBJ_pilotObjectClass            OBJ_pilot,4L\n\n#define LN_pilotGroups          \"pilotGroups\"\n#define NID_pilotGroups         441\n#define OBJ_pilotGroups         OBJ_pilot,10L\n\n#define LN_iA5StringSyntax              \"iA5StringSyntax\"\n#define NID_iA5StringSyntax             442\n#define OBJ_iA5StringSyntax             OBJ_pilotAttributeSyntax,4L\n\n#define LN_caseIgnoreIA5StringSyntax            \"caseIgnoreIA5StringSyntax\"\n#define NID_caseIgnoreIA5StringSyntax           443\n#define OBJ_caseIgnoreIA5StringSyntax           OBJ_pilotAttributeSyntax,5L\n\n#define LN_pilotObject          \"pilotObject\"\n#define NID_pilotObject         444\n#define OBJ_pilotObject         OBJ_pilotObjectClass,3L\n\n#define LN_pilotPerson          \"pilotPerson\"\n#define NID_pilotPerson         445\n#define OBJ_pilotPerson         OBJ_pilotObjectClass,4L\n\n#define SN_account              \"account\"\n#define NID_account             446\n#define OBJ_account             OBJ_pilotObjectClass,5L\n\n#define SN_document             \"document\"\n#define NID_document            447\n#define OBJ_document            OBJ_pilotObjectClass,6L\n\n#define SN_room         \"room\"\n#define NID_room                448\n#define OBJ_room                OBJ_pilotObjectClass,7L\n\n#define LN_documentSeries               \"documentSeries\"\n#define NID_documentSeries              449\n#define OBJ_documentSeries              OBJ_pilotObjectClass,9L\n\n#define SN_Domain               \"domain\"\n#define LN_Domain               \"Domain\"\n#define NID_Domain              392\n#define OBJ_Domain              OBJ_pilotObjectClass,13L\n\n#define LN_rFC822localPart              \"rFC822localPart\"\n#define NID_rFC822localPart             450\n#define OBJ_rFC822localPart             OBJ_pilotObjectClass,14L\n\n#define LN_dNSDomain            \"dNSDomain\"\n#define NID_dNSDomain           451\n#define OBJ_dNSDomain           OBJ_pilotObjectClass,15L\n\n#define LN_domainRelatedObject          \"domainRelatedObject\"\n#define NID_domainRelatedObject         452\n#define OBJ_domainRelatedObject         OBJ_pilotObjectClass,17L\n\n#define LN_friendlyCountry              \"friendlyCountry\"\n#define NID_friendlyCountry             453\n#define OBJ_friendlyCountry             OBJ_pilotObjectClass,18L\n\n#define LN_simpleSecurityObject         \"simpleSecurityObject\"\n#define NID_simpleSecurityObject                454\n#define OBJ_simpleSecurityObject                OBJ_pilotObjectClass,19L\n\n#define LN_pilotOrganization            \"pilotOrganization\"\n#define NID_pilotOrganization           455\n#define OBJ_pilotOrganization           OBJ_pilotObjectClass,20L\n\n#define LN_pilotDSA             \"pilotDSA\"\n#define NID_pilotDSA            456\n#define OBJ_pilotDSA            OBJ_pilotObjectClass,21L\n\n#define LN_qualityLabelledData          \"qualityLabelledData\"\n#define NID_qualityLabelledData         457\n#define OBJ_qualityLabelledData         OBJ_pilotObjectClass,22L\n\n#define SN_userId               \"UID\"\n#define LN_userId               \"userId\"\n#define NID_userId              458\n#define OBJ_userId              OBJ_pilotAttributeType,1L\n\n#define LN_textEncodedORAddress         \"textEncodedORAddress\"\n#define NID_textEncodedORAddress                459\n#define OBJ_textEncodedORAddress                OBJ_pilotAttributeType,2L\n\n#define SN_rfc822Mailbox                \"mail\"\n#define LN_rfc822Mailbox                \"rfc822Mailbox\"\n#define NID_rfc822Mailbox               460\n#define OBJ_rfc822Mailbox               OBJ_pilotAttributeType,3L\n\n#define SN_info         \"info\"\n#define NID_info                461\n#define OBJ_info                OBJ_pilotAttributeType,4L\n\n#define LN_favouriteDrink               \"favouriteDrink\"\n#define NID_favouriteDrink              462\n#define OBJ_favouriteDrink              OBJ_pilotAttributeType,5L\n\n#define LN_roomNumber           \"roomNumber\"\n#define NID_roomNumber          463\n#define OBJ_roomNumber          OBJ_pilotAttributeType,6L\n\n#define SN_photo                \"photo\"\n#define NID_photo               464\n#define OBJ_photo               OBJ_pilotAttributeType,7L\n\n#define LN_userClass            \"userClass\"\n#define NID_userClass           465\n#define OBJ_userClass           OBJ_pilotAttributeType,8L\n\n#define SN_host         \"host\"\n#define NID_host                466\n#define OBJ_host                OBJ_pilotAttributeType,9L\n\n#define SN_manager              \"manager\"\n#define NID_manager             467\n#define OBJ_manager             OBJ_pilotAttributeType,10L\n\n#define LN_documentIdentifier           \"documentIdentifier\"\n#define NID_documentIdentifier          468\n#define OBJ_documentIdentifier          OBJ_pilotAttributeType,11L\n\n#define LN_documentTitle                \"documentTitle\"\n#define NID_documentTitle               469\n#define OBJ_documentTitle               OBJ_pilotAttributeType,12L\n\n#define LN_documentVersion              \"documentVersion\"\n#define NID_documentVersion             470\n#define OBJ_documentVersion             OBJ_pilotAttributeType,13L\n\n#define LN_documentAuthor               \"documentAuthor\"\n#define NID_documentAuthor              471\n#define OBJ_documentAuthor              OBJ_pilotAttributeType,14L\n\n#define LN_documentLocation             \"documentLocation\"\n#define NID_documentLocation            472\n#define OBJ_documentLocation            OBJ_pilotAttributeType,15L\n\n#define LN_homeTelephoneNumber          \"homeTelephoneNumber\"\n#define NID_homeTelephoneNumber         473\n#define OBJ_homeTelephoneNumber         OBJ_pilotAttributeType,20L\n\n#define SN_secretary            \"secretary\"\n#define NID_secretary           474\n#define OBJ_secretary           OBJ_pilotAttributeType,21L\n\n#define LN_otherMailbox         \"otherMailbox\"\n#define NID_otherMailbox                475\n#define OBJ_otherMailbox                OBJ_pilotAttributeType,22L\n\n#define LN_lastModifiedTime             \"lastModifiedTime\"\n#define NID_lastModifiedTime            476\n#define OBJ_lastModifiedTime            OBJ_pilotAttributeType,23L\n\n#define LN_lastModifiedBy               \"lastModifiedBy\"\n#define NID_lastModifiedBy              477\n#define OBJ_lastModifiedBy              OBJ_pilotAttributeType,24L\n\n#define SN_domainComponent              \"DC\"\n#define LN_domainComponent              \"domainComponent\"\n#define NID_domainComponent             391\n#define OBJ_domainComponent             OBJ_pilotAttributeType,25L\n\n#define LN_aRecord              \"aRecord\"\n#define NID_aRecord             478\n#define OBJ_aRecord             OBJ_pilotAttributeType,26L\n\n#define LN_pilotAttributeType27         \"pilotAttributeType27\"\n#define NID_pilotAttributeType27                479\n#define OBJ_pilotAttributeType27                OBJ_pilotAttributeType,27L\n\n#define LN_mXRecord             \"mXRecord\"\n#define NID_mXRecord            480\n#define OBJ_mXRecord            OBJ_pilotAttributeType,28L\n\n#define LN_nSRecord             \"nSRecord\"\n#define NID_nSRecord            481\n#define OBJ_nSRecord            OBJ_pilotAttributeType,29L\n\n#define LN_sOARecord            \"sOARecord\"\n#define NID_sOARecord           482\n#define OBJ_sOARecord           OBJ_pilotAttributeType,30L\n\n#define LN_cNAMERecord          \"cNAMERecord\"\n#define NID_cNAMERecord         483\n#define OBJ_cNAMERecord         OBJ_pilotAttributeType,31L\n\n#define LN_associatedDomain             \"associatedDomain\"\n#define NID_associatedDomain            484\n#define OBJ_associatedDomain            OBJ_pilotAttributeType,37L\n\n#define LN_associatedName               \"associatedName\"\n#define NID_associatedName              485\n#define OBJ_associatedName              OBJ_pilotAttributeType,38L\n\n#define LN_homePostalAddress            \"homePostalAddress\"\n#define NID_homePostalAddress           486\n#define OBJ_homePostalAddress           OBJ_pilotAttributeType,39L\n\n#define LN_personalTitle                \"personalTitle\"\n#define NID_personalTitle               487\n#define OBJ_personalTitle               OBJ_pilotAttributeType,40L\n\n#define LN_mobileTelephoneNumber                \"mobileTelephoneNumber\"\n#define NID_mobileTelephoneNumber               488\n#define OBJ_mobileTelephoneNumber               OBJ_pilotAttributeType,41L\n\n#define LN_pagerTelephoneNumber         \"pagerTelephoneNumber\"\n#define NID_pagerTelephoneNumber                489\n#define OBJ_pagerTelephoneNumber                OBJ_pilotAttributeType,42L\n\n#define LN_friendlyCountryName          \"friendlyCountryName\"\n#define NID_friendlyCountryName         490\n#define OBJ_friendlyCountryName         OBJ_pilotAttributeType,43L\n\n#define LN_organizationalStatus         \"organizationalStatus\"\n#define NID_organizationalStatus                491\n#define OBJ_organizationalStatus                OBJ_pilotAttributeType,45L\n\n#define LN_janetMailbox         \"janetMailbox\"\n#define NID_janetMailbox                492\n#define OBJ_janetMailbox                OBJ_pilotAttributeType,46L\n\n#define LN_mailPreferenceOption         \"mailPreferenceOption\"\n#define NID_mailPreferenceOption                493\n#define OBJ_mailPreferenceOption                OBJ_pilotAttributeType,47L\n\n#define LN_buildingName         \"buildingName\"\n#define NID_buildingName                494\n#define OBJ_buildingName                OBJ_pilotAttributeType,48L\n\n#define LN_dSAQuality           \"dSAQuality\"\n#define NID_dSAQuality          495\n#define OBJ_dSAQuality          OBJ_pilotAttributeType,49L\n\n#define LN_singleLevelQuality           \"singleLevelQuality\"\n#define NID_singleLevelQuality          496\n#define OBJ_singleLevelQuality          OBJ_pilotAttributeType,50L\n\n#define LN_subtreeMinimumQuality                \"subtreeMinimumQuality\"\n#define NID_subtreeMinimumQuality               497\n#define OBJ_subtreeMinimumQuality               OBJ_pilotAttributeType,51L\n\n#define LN_subtreeMaximumQuality                \"subtreeMaximumQuality\"\n#define NID_subtreeMaximumQuality               498\n#define OBJ_subtreeMaximumQuality               OBJ_pilotAttributeType,52L\n\n#define LN_personalSignature            \"personalSignature\"\n#define NID_personalSignature           499\n#define OBJ_personalSignature           OBJ_pilotAttributeType,53L\n\n#define LN_dITRedirect          \"dITRedirect\"\n#define NID_dITRedirect         500\n#define OBJ_dITRedirect         OBJ_pilotAttributeType,54L\n\n#define SN_audio                \"audio\"\n#define NID_audio               501\n#define OBJ_audio               OBJ_pilotAttributeType,55L\n\n#define LN_documentPublisher            \"documentPublisher\"\n#define NID_documentPublisher           502\n#define OBJ_documentPublisher           OBJ_pilotAttributeType,56L\n\n#define SN_id_set               \"id-set\"\n#define LN_id_set               \"Secure Electronic Transactions\"\n#define NID_id_set              512\n#define OBJ_id_set              OBJ_international_organizations,42L\n\n#define SN_set_ctype            \"set-ctype\"\n#define LN_set_ctype            \"content types\"\n#define NID_set_ctype           513\n#define OBJ_set_ctype           OBJ_id_set,0L\n\n#define SN_set_msgExt           \"set-msgExt\"\n#define LN_set_msgExt           \"message extensions\"\n#define NID_set_msgExt          514\n#define OBJ_set_msgExt          OBJ_id_set,1L\n\n#define SN_set_attr             \"set-attr\"\n#define NID_set_attr            515\n#define OBJ_set_attr            OBJ_id_set,3L\n\n#define SN_set_policy           \"set-policy\"\n#define NID_set_policy          516\n#define OBJ_set_policy          OBJ_id_set,5L\n\n#define SN_set_certExt          \"set-certExt\"\n#define LN_set_certExt          \"certificate extensions\"\n#define NID_set_certExt         517\n#define OBJ_set_certExt         OBJ_id_set,7L\n\n#define SN_set_brand            \"set-brand\"\n#define NID_set_brand           518\n#define OBJ_set_brand           OBJ_id_set,8L\n\n#define SN_setct_PANData                \"setct-PANData\"\n#define NID_setct_PANData               519\n#define OBJ_setct_PANData               OBJ_set_ctype,0L\n\n#define SN_setct_PANToken               \"setct-PANToken\"\n#define NID_setct_PANToken              520\n#define OBJ_setct_PANToken              OBJ_set_ctype,1L\n\n#define SN_setct_PANOnly                \"setct-PANOnly\"\n#define NID_setct_PANOnly               521\n#define OBJ_setct_PANOnly               OBJ_set_ctype,2L\n\n#define SN_setct_OIData         \"setct-OIData\"\n#define NID_setct_OIData                522\n#define OBJ_setct_OIData                OBJ_set_ctype,3L\n\n#define SN_setct_PI             \"setct-PI\"\n#define NID_setct_PI            523\n#define OBJ_setct_PI            OBJ_set_ctype,4L\n\n#define SN_setct_PIData         \"setct-PIData\"\n#define NID_setct_PIData                524\n#define OBJ_setct_PIData                OBJ_set_ctype,5L\n\n#define SN_setct_PIDataUnsigned         \"setct-PIDataUnsigned\"\n#define NID_setct_PIDataUnsigned                525\n#define OBJ_setct_PIDataUnsigned                OBJ_set_ctype,6L\n\n#define SN_setct_HODInput               \"setct-HODInput\"\n#define NID_setct_HODInput              526\n#define OBJ_setct_HODInput              OBJ_set_ctype,7L\n\n#define SN_setct_AuthResBaggage         \"setct-AuthResBaggage\"\n#define NID_setct_AuthResBaggage                527\n#define OBJ_setct_AuthResBaggage                OBJ_set_ctype,8L\n\n#define SN_setct_AuthRevReqBaggage              \"setct-AuthRevReqBaggage\"\n#define NID_setct_AuthRevReqBaggage             528\n#define OBJ_setct_AuthRevReqBaggage             OBJ_set_ctype,9L\n\n#define SN_setct_AuthRevResBaggage              \"setct-AuthRevResBaggage\"\n#define NID_setct_AuthRevResBaggage             529\n#define OBJ_setct_AuthRevResBaggage             OBJ_set_ctype,10L\n\n#define SN_setct_CapTokenSeq            \"setct-CapTokenSeq\"\n#define NID_setct_CapTokenSeq           530\n#define OBJ_setct_CapTokenSeq           OBJ_set_ctype,11L\n\n#define SN_setct_PInitResData           \"setct-PInitResData\"\n#define NID_setct_PInitResData          531\n#define OBJ_setct_PInitResData          OBJ_set_ctype,12L\n\n#define SN_setct_PI_TBS         \"setct-PI-TBS\"\n#define NID_setct_PI_TBS                532\n#define OBJ_setct_PI_TBS                OBJ_set_ctype,13L\n\n#define SN_setct_PResData               \"setct-PResData\"\n#define NID_setct_PResData              533\n#define OBJ_setct_PResData              OBJ_set_ctype,14L\n\n#define SN_setct_AuthReqTBS             \"setct-AuthReqTBS\"\n#define NID_setct_AuthReqTBS            534\n#define OBJ_setct_AuthReqTBS            OBJ_set_ctype,16L\n\n#define SN_setct_AuthResTBS             \"setct-AuthResTBS\"\n#define NID_setct_AuthResTBS            535\n#define OBJ_setct_AuthResTBS            OBJ_set_ctype,17L\n\n#define SN_setct_AuthResTBSX            \"setct-AuthResTBSX\"\n#define NID_setct_AuthResTBSX           536\n#define OBJ_setct_AuthResTBSX           OBJ_set_ctype,18L\n\n#define SN_setct_AuthTokenTBS           \"setct-AuthTokenTBS\"\n#define NID_setct_AuthTokenTBS          537\n#define OBJ_setct_AuthTokenTBS          OBJ_set_ctype,19L\n\n#define SN_setct_CapTokenData           \"setct-CapTokenData\"\n#define NID_setct_CapTokenData          538\n#define OBJ_setct_CapTokenData          OBJ_set_ctype,20L\n\n#define SN_setct_CapTokenTBS            \"setct-CapTokenTBS\"\n#define NID_setct_CapTokenTBS           539\n#define OBJ_setct_CapTokenTBS           OBJ_set_ctype,21L\n\n#define SN_setct_AcqCardCodeMsg         \"setct-AcqCardCodeMsg\"\n#define NID_setct_AcqCardCodeMsg                540\n#define OBJ_setct_AcqCardCodeMsg                OBJ_set_ctype,22L\n\n#define SN_setct_AuthRevReqTBS          \"setct-AuthRevReqTBS\"\n#define NID_setct_AuthRevReqTBS         541\n#define OBJ_setct_AuthRevReqTBS         OBJ_set_ctype,23L\n\n#define SN_setct_AuthRevResData         \"setct-AuthRevResData\"\n#define NID_setct_AuthRevResData                542\n#define OBJ_setct_AuthRevResData                OBJ_set_ctype,24L\n\n#define SN_setct_AuthRevResTBS          \"setct-AuthRevResTBS\"\n#define NID_setct_AuthRevResTBS         543\n#define OBJ_setct_AuthRevResTBS         OBJ_set_ctype,25L\n\n#define SN_setct_CapReqTBS              \"setct-CapReqTBS\"\n#define NID_setct_CapReqTBS             544\n#define OBJ_setct_CapReqTBS             OBJ_set_ctype,26L\n\n#define SN_setct_CapReqTBSX             \"setct-CapReqTBSX\"\n#define NID_setct_CapReqTBSX            545\n#define OBJ_setct_CapReqTBSX            OBJ_set_ctype,27L\n\n#define SN_setct_CapResData             \"setct-CapResData\"\n#define NID_setct_CapResData            546\n#define OBJ_setct_CapResData            OBJ_set_ctype,28L\n\n#define SN_setct_CapRevReqTBS           \"setct-CapRevReqTBS\"\n#define NID_setct_CapRevReqTBS          547\n#define OBJ_setct_CapRevReqTBS          OBJ_set_ctype,29L\n\n#define SN_setct_CapRevReqTBSX          \"setct-CapRevReqTBSX\"\n#define NID_setct_CapRevReqTBSX         548\n#define OBJ_setct_CapRevReqTBSX         OBJ_set_ctype,30L\n\n#define SN_setct_CapRevResData          \"setct-CapRevResData\"\n#define NID_setct_CapRevResData         549\n#define OBJ_setct_CapRevResData         OBJ_set_ctype,31L\n\n#define SN_setct_CredReqTBS             \"setct-CredReqTBS\"\n#define NID_setct_CredReqTBS            550\n#define OBJ_setct_CredReqTBS            OBJ_set_ctype,32L\n\n#define SN_setct_CredReqTBSX            \"setct-CredReqTBSX\"\n#define NID_setct_CredReqTBSX           551\n#define OBJ_setct_CredReqTBSX           OBJ_set_ctype,33L\n\n#define SN_setct_CredResData            \"setct-CredResData\"\n#define NID_setct_CredResData           552\n#define OBJ_setct_CredResData           OBJ_set_ctype,34L\n\n#define SN_setct_CredRevReqTBS          \"setct-CredRevReqTBS\"\n#define NID_setct_CredRevReqTBS         553\n#define OBJ_setct_CredRevReqTBS         OBJ_set_ctype,35L\n\n#define SN_setct_CredRevReqTBSX         \"setct-CredRevReqTBSX\"\n#define NID_setct_CredRevReqTBSX                554\n#define OBJ_setct_CredRevReqTBSX                OBJ_set_ctype,36L\n\n#define SN_setct_CredRevResData         \"setct-CredRevResData\"\n#define NID_setct_CredRevResData                555\n#define OBJ_setct_CredRevResData                OBJ_set_ctype,37L\n\n#define SN_setct_PCertReqData           \"setct-PCertReqData\"\n#define NID_setct_PCertReqData          556\n#define OBJ_setct_PCertReqData          OBJ_set_ctype,38L\n\n#define SN_setct_PCertResTBS            \"setct-PCertResTBS\"\n#define NID_setct_PCertResTBS           557\n#define OBJ_setct_PCertResTBS           OBJ_set_ctype,39L\n\n#define SN_setct_BatchAdminReqData              \"setct-BatchAdminReqData\"\n#define NID_setct_BatchAdminReqData             558\n#define OBJ_setct_BatchAdminReqData             OBJ_set_ctype,40L\n\n#define SN_setct_BatchAdminResData              \"setct-BatchAdminResData\"\n#define NID_setct_BatchAdminResData             559\n#define OBJ_setct_BatchAdminResData             OBJ_set_ctype,41L\n\n#define SN_setct_CardCInitResTBS                \"setct-CardCInitResTBS\"\n#define NID_setct_CardCInitResTBS               560\n#define OBJ_setct_CardCInitResTBS               OBJ_set_ctype,42L\n\n#define SN_setct_MeAqCInitResTBS                \"setct-MeAqCInitResTBS\"\n#define NID_setct_MeAqCInitResTBS               561\n#define OBJ_setct_MeAqCInitResTBS               OBJ_set_ctype,43L\n\n#define SN_setct_RegFormResTBS          \"setct-RegFormResTBS\"\n#define NID_setct_RegFormResTBS         562\n#define OBJ_setct_RegFormResTBS         OBJ_set_ctype,44L\n\n#define SN_setct_CertReqData            \"setct-CertReqData\"\n#define NID_setct_CertReqData           563\n#define OBJ_setct_CertReqData           OBJ_set_ctype,45L\n\n#define SN_setct_CertReqTBS             \"setct-CertReqTBS\"\n#define NID_setct_CertReqTBS            564\n#define OBJ_setct_CertReqTBS            OBJ_set_ctype,46L\n\n#define SN_setct_CertResData            \"setct-CertResData\"\n#define NID_setct_CertResData           565\n#define OBJ_setct_CertResData           OBJ_set_ctype,47L\n\n#define SN_setct_CertInqReqTBS          \"setct-CertInqReqTBS\"\n#define NID_setct_CertInqReqTBS         566\n#define OBJ_setct_CertInqReqTBS         OBJ_set_ctype,48L\n\n#define SN_setct_ErrorTBS               \"setct-ErrorTBS\"\n#define NID_setct_ErrorTBS              567\n#define OBJ_setct_ErrorTBS              OBJ_set_ctype,49L\n\n#define SN_setct_PIDualSignedTBE                \"setct-PIDualSignedTBE\"\n#define NID_setct_PIDualSignedTBE               568\n#define OBJ_setct_PIDualSignedTBE               OBJ_set_ctype,50L\n\n#define SN_setct_PIUnsignedTBE          \"setct-PIUnsignedTBE\"\n#define NID_setct_PIUnsignedTBE         569\n#define OBJ_setct_PIUnsignedTBE         OBJ_set_ctype,51L\n\n#define SN_setct_AuthReqTBE             \"setct-AuthReqTBE\"\n#define NID_setct_AuthReqTBE            570\n#define OBJ_setct_AuthReqTBE            OBJ_set_ctype,52L\n\n#define SN_setct_AuthResTBE             \"setct-AuthResTBE\"\n#define NID_setct_AuthResTBE            571\n#define OBJ_setct_AuthResTBE            OBJ_set_ctype,53L\n\n#define SN_setct_AuthResTBEX            \"setct-AuthResTBEX\"\n#define NID_setct_AuthResTBEX           572\n#define OBJ_setct_AuthResTBEX           OBJ_set_ctype,54L\n\n#define SN_setct_AuthTokenTBE           \"setct-AuthTokenTBE\"\n#define NID_setct_AuthTokenTBE          573\n#define OBJ_setct_AuthTokenTBE          OBJ_set_ctype,55L\n\n#define SN_setct_CapTokenTBE            \"setct-CapTokenTBE\"\n#define NID_setct_CapTokenTBE           574\n#define OBJ_setct_CapTokenTBE           OBJ_set_ctype,56L\n\n#define SN_setct_CapTokenTBEX           \"setct-CapTokenTBEX\"\n#define NID_setct_CapTokenTBEX          575\n#define OBJ_setct_CapTokenTBEX          OBJ_set_ctype,57L\n\n#define SN_setct_AcqCardCodeMsgTBE              \"setct-AcqCardCodeMsgTBE\"\n#define NID_setct_AcqCardCodeMsgTBE             576\n#define OBJ_setct_AcqCardCodeMsgTBE             OBJ_set_ctype,58L\n\n#define SN_setct_AuthRevReqTBE          \"setct-AuthRevReqTBE\"\n#define NID_setct_AuthRevReqTBE         577\n#define OBJ_setct_AuthRevReqTBE         OBJ_set_ctype,59L\n\n#define SN_setct_AuthRevResTBE          \"setct-AuthRevResTBE\"\n#define NID_setct_AuthRevResTBE         578\n#define OBJ_setct_AuthRevResTBE         OBJ_set_ctype,60L\n\n#define SN_setct_AuthRevResTBEB         \"setct-AuthRevResTBEB\"\n#define NID_setct_AuthRevResTBEB                579\n#define OBJ_setct_AuthRevResTBEB                OBJ_set_ctype,61L\n\n#define SN_setct_CapReqTBE              \"setct-CapReqTBE\"\n#define NID_setct_CapReqTBE             580\n#define OBJ_setct_CapReqTBE             OBJ_set_ctype,62L\n\n#define SN_setct_CapReqTBEX             \"setct-CapReqTBEX\"\n#define NID_setct_CapReqTBEX            581\n#define OBJ_setct_CapReqTBEX            OBJ_set_ctype,63L\n\n#define SN_setct_CapResTBE              \"setct-CapResTBE\"\n#define NID_setct_CapResTBE             582\n#define OBJ_setct_CapResTBE             OBJ_set_ctype,64L\n\n#define SN_setct_CapRevReqTBE           \"setct-CapRevReqTBE\"\n#define NID_setct_CapRevReqTBE          583\n#define OBJ_setct_CapRevReqTBE          OBJ_set_ctype,65L\n\n#define SN_setct_CapRevReqTBEX          \"setct-CapRevReqTBEX\"\n#define NID_setct_CapRevReqTBEX         584\n#define OBJ_setct_CapRevReqTBEX         OBJ_set_ctype,66L\n\n#define SN_setct_CapRevResTBE           \"setct-CapRevResTBE\"\n#define NID_setct_CapRevResTBE          585\n#define OBJ_setct_CapRevResTBE          OBJ_set_ctype,67L\n\n#define SN_setct_CredReqTBE             \"setct-CredReqTBE\"\n#define NID_setct_CredReqTBE            586\n#define OBJ_setct_CredReqTBE            OBJ_set_ctype,68L\n\n#define SN_setct_CredReqTBEX            \"setct-CredReqTBEX\"\n#define NID_setct_CredReqTBEX           587\n#define OBJ_setct_CredReqTBEX           OBJ_set_ctype,69L\n\n#define SN_setct_CredResTBE             \"setct-CredResTBE\"\n#define NID_setct_CredResTBE            588\n#define OBJ_setct_CredResTBE            OBJ_set_ctype,70L\n\n#define SN_setct_CredRevReqTBE          \"setct-CredRevReqTBE\"\n#define NID_setct_CredRevReqTBE         589\n#define OBJ_setct_CredRevReqTBE         OBJ_set_ctype,71L\n\n#define SN_setct_CredRevReqTBEX         \"setct-CredRevReqTBEX\"\n#define NID_setct_CredRevReqTBEX                590\n#define OBJ_setct_CredRevReqTBEX                OBJ_set_ctype,72L\n\n#define SN_setct_CredRevResTBE          \"setct-CredRevResTBE\"\n#define NID_setct_CredRevResTBE         591\n#define OBJ_setct_CredRevResTBE         OBJ_set_ctype,73L\n\n#define SN_setct_BatchAdminReqTBE               \"setct-BatchAdminReqTBE\"\n#define NID_setct_BatchAdminReqTBE              592\n#define OBJ_setct_BatchAdminReqTBE              OBJ_set_ctype,74L\n\n#define SN_setct_BatchAdminResTBE               \"setct-BatchAdminResTBE\"\n#define NID_setct_BatchAdminResTBE              593\n#define OBJ_setct_BatchAdminResTBE              OBJ_set_ctype,75L\n\n#define SN_setct_RegFormReqTBE          \"setct-RegFormReqTBE\"\n#define NID_setct_RegFormReqTBE         594\n#define OBJ_setct_RegFormReqTBE         OBJ_set_ctype,76L\n\n#define SN_setct_CertReqTBE             \"setct-CertReqTBE\"\n#define NID_setct_CertReqTBE            595\n#define OBJ_setct_CertReqTBE            OBJ_set_ctype,77L\n\n#define SN_setct_CertReqTBEX            \"setct-CertReqTBEX\"\n#define NID_setct_CertReqTBEX           596\n#define OBJ_setct_CertReqTBEX           OBJ_set_ctype,78L\n\n#define SN_setct_CertResTBE             \"setct-CertResTBE\"\n#define NID_setct_CertResTBE            597\n#define OBJ_setct_CertResTBE            OBJ_set_ctype,79L\n\n#define SN_setct_CRLNotificationTBS             \"setct-CRLNotificationTBS\"\n#define NID_setct_CRLNotificationTBS            598\n#define OBJ_setct_CRLNotificationTBS            OBJ_set_ctype,80L\n\n#define SN_setct_CRLNotificationResTBS          \"setct-CRLNotificationResTBS\"\n#define NID_setct_CRLNotificationResTBS         599\n#define OBJ_setct_CRLNotificationResTBS         OBJ_set_ctype,81L\n\n#define SN_setct_BCIDistributionTBS             \"setct-BCIDistributionTBS\"\n#define NID_setct_BCIDistributionTBS            600\n#define OBJ_setct_BCIDistributionTBS            OBJ_set_ctype,82L\n\n#define SN_setext_genCrypt              \"setext-genCrypt\"\n#define LN_setext_genCrypt              \"generic cryptogram\"\n#define NID_setext_genCrypt             601\n#define OBJ_setext_genCrypt             OBJ_set_msgExt,1L\n\n#define SN_setext_miAuth                \"setext-miAuth\"\n#define LN_setext_miAuth                \"merchant initiated auth\"\n#define NID_setext_miAuth               602\n#define OBJ_setext_miAuth               OBJ_set_msgExt,3L\n\n#define SN_setext_pinSecure             \"setext-pinSecure\"\n#define NID_setext_pinSecure            603\n#define OBJ_setext_pinSecure            OBJ_set_msgExt,4L\n\n#define SN_setext_pinAny                \"setext-pinAny\"\n#define NID_setext_pinAny               604\n#define OBJ_setext_pinAny               OBJ_set_msgExt,5L\n\n#define SN_setext_track2                \"setext-track2\"\n#define NID_setext_track2               605\n#define OBJ_setext_track2               OBJ_set_msgExt,7L\n\n#define SN_setext_cv            \"setext-cv\"\n#define LN_setext_cv            \"additional verification\"\n#define NID_setext_cv           606\n#define OBJ_setext_cv           OBJ_set_msgExt,8L\n\n#define SN_set_policy_root              \"set-policy-root\"\n#define NID_set_policy_root             607\n#define OBJ_set_policy_root             OBJ_set_policy,0L\n\n#define SN_setCext_hashedRoot           \"setCext-hashedRoot\"\n#define NID_setCext_hashedRoot          608\n#define OBJ_setCext_hashedRoot          OBJ_set_certExt,0L\n\n#define SN_setCext_certType             \"setCext-certType\"\n#define NID_setCext_certType            609\n#define OBJ_setCext_certType            OBJ_set_certExt,1L\n\n#define SN_setCext_merchData            \"setCext-merchData\"\n#define NID_setCext_merchData           610\n#define OBJ_setCext_merchData           OBJ_set_certExt,2L\n\n#define SN_setCext_cCertRequired                \"setCext-cCertRequired\"\n#define NID_setCext_cCertRequired               611\n#define OBJ_setCext_cCertRequired               OBJ_set_certExt,3L\n\n#define SN_setCext_tunneling            \"setCext-tunneling\"\n#define NID_setCext_tunneling           612\n#define OBJ_setCext_tunneling           OBJ_set_certExt,4L\n\n#define SN_setCext_setExt               \"setCext-setExt\"\n#define NID_setCext_setExt              613\n#define OBJ_setCext_setExt              OBJ_set_certExt,5L\n\n#define SN_setCext_setQualf             \"setCext-setQualf\"\n#define NID_setCext_setQualf            614\n#define OBJ_setCext_setQualf            OBJ_set_certExt,6L\n\n#define SN_setCext_PGWYcapabilities             \"setCext-PGWYcapabilities\"\n#define NID_setCext_PGWYcapabilities            615\n#define OBJ_setCext_PGWYcapabilities            OBJ_set_certExt,7L\n\n#define SN_setCext_TokenIdentifier              \"setCext-TokenIdentifier\"\n#define NID_setCext_TokenIdentifier             616\n#define OBJ_setCext_TokenIdentifier             OBJ_set_certExt,8L\n\n#define SN_setCext_Track2Data           \"setCext-Track2Data\"\n#define NID_setCext_Track2Data          617\n#define OBJ_setCext_Track2Data          OBJ_set_certExt,9L\n\n#define SN_setCext_TokenType            \"setCext-TokenType\"\n#define NID_setCext_TokenType           618\n#define OBJ_setCext_TokenType           OBJ_set_certExt,10L\n\n#define SN_setCext_IssuerCapabilities           \"setCext-IssuerCapabilities\"\n#define NID_setCext_IssuerCapabilities          619\n#define OBJ_setCext_IssuerCapabilities          OBJ_set_certExt,11L\n\n#define SN_setAttr_Cert         \"setAttr-Cert\"\n#define NID_setAttr_Cert                620\n#define OBJ_setAttr_Cert                OBJ_set_attr,0L\n\n#define SN_setAttr_PGWYcap              \"setAttr-PGWYcap\"\n#define LN_setAttr_PGWYcap              \"payment gateway capabilities\"\n#define NID_setAttr_PGWYcap             621\n#define OBJ_setAttr_PGWYcap             OBJ_set_attr,1L\n\n#define SN_setAttr_TokenType            \"setAttr-TokenType\"\n#define NID_setAttr_TokenType           622\n#define OBJ_setAttr_TokenType           OBJ_set_attr,2L\n\n#define SN_setAttr_IssCap               \"setAttr-IssCap\"\n#define LN_setAttr_IssCap               \"issuer capabilities\"\n#define NID_setAttr_IssCap              623\n#define OBJ_setAttr_IssCap              OBJ_set_attr,3L\n\n#define SN_set_rootKeyThumb             \"set-rootKeyThumb\"\n#define NID_set_rootKeyThumb            624\n#define OBJ_set_rootKeyThumb            OBJ_setAttr_Cert,0L\n\n#define SN_set_addPolicy                \"set-addPolicy\"\n#define NID_set_addPolicy               625\n#define OBJ_set_addPolicy               OBJ_setAttr_Cert,1L\n\n#define SN_setAttr_Token_EMV            \"setAttr-Token-EMV\"\n#define NID_setAttr_Token_EMV           626\n#define OBJ_setAttr_Token_EMV           OBJ_setAttr_TokenType,1L\n\n#define SN_setAttr_Token_B0Prime                \"setAttr-Token-B0Prime\"\n#define NID_setAttr_Token_B0Prime               627\n#define OBJ_setAttr_Token_B0Prime               OBJ_setAttr_TokenType,2L\n\n#define SN_setAttr_IssCap_CVM           \"setAttr-IssCap-CVM\"\n#define NID_setAttr_IssCap_CVM          628\n#define OBJ_setAttr_IssCap_CVM          OBJ_setAttr_IssCap,3L\n\n#define SN_setAttr_IssCap_T2            \"setAttr-IssCap-T2\"\n#define NID_setAttr_IssCap_T2           629\n#define OBJ_setAttr_IssCap_T2           OBJ_setAttr_IssCap,4L\n\n#define SN_setAttr_IssCap_Sig           \"setAttr-IssCap-Sig\"\n#define NID_setAttr_IssCap_Sig          630\n#define OBJ_setAttr_IssCap_Sig          OBJ_setAttr_IssCap,5L\n\n#define SN_setAttr_GenCryptgrm          \"setAttr-GenCryptgrm\"\n#define LN_setAttr_GenCryptgrm          \"generate cryptogram\"\n#define NID_setAttr_GenCryptgrm         631\n#define OBJ_setAttr_GenCryptgrm         OBJ_setAttr_IssCap_CVM,1L\n\n#define SN_setAttr_T2Enc                \"setAttr-T2Enc\"\n#define LN_setAttr_T2Enc                \"encrypted track 2\"\n#define NID_setAttr_T2Enc               632\n#define OBJ_setAttr_T2Enc               OBJ_setAttr_IssCap_T2,1L\n\n#define SN_setAttr_T2cleartxt           \"setAttr-T2cleartxt\"\n#define LN_setAttr_T2cleartxt           \"cleartext track 2\"\n#define NID_setAttr_T2cleartxt          633\n#define OBJ_setAttr_T2cleartxt          OBJ_setAttr_IssCap_T2,2L\n\n#define SN_setAttr_TokICCsig            \"setAttr-TokICCsig\"\n#define LN_setAttr_TokICCsig            \"ICC or token signature\"\n#define NID_setAttr_TokICCsig           634\n#define OBJ_setAttr_TokICCsig           OBJ_setAttr_IssCap_Sig,1L\n\n#define SN_setAttr_SecDevSig            \"setAttr-SecDevSig\"\n#define LN_setAttr_SecDevSig            \"secure device signature\"\n#define NID_setAttr_SecDevSig           635\n#define OBJ_setAttr_SecDevSig           OBJ_setAttr_IssCap_Sig,2L\n\n#define SN_set_brand_IATA_ATA           \"set-brand-IATA-ATA\"\n#define NID_set_brand_IATA_ATA          636\n#define OBJ_set_brand_IATA_ATA          OBJ_set_brand,1L\n\n#define SN_set_brand_Diners             \"set-brand-Diners\"\n#define NID_set_brand_Diners            637\n#define OBJ_set_brand_Diners            OBJ_set_brand,30L\n\n#define SN_set_brand_AmericanExpress            \"set-brand-AmericanExpress\"\n#define NID_set_brand_AmericanExpress           638\n#define OBJ_set_brand_AmericanExpress           OBJ_set_brand,34L\n\n#define SN_set_brand_JCB                \"set-brand-JCB\"\n#define NID_set_brand_JCB               639\n#define OBJ_set_brand_JCB               OBJ_set_brand,35L\n\n#define SN_set_brand_Visa               \"set-brand-Visa\"\n#define NID_set_brand_Visa              640\n#define OBJ_set_brand_Visa              OBJ_set_brand,4L\n\n#define SN_set_brand_MasterCard         \"set-brand-MasterCard\"\n#define NID_set_brand_MasterCard                641\n#define OBJ_set_brand_MasterCard                OBJ_set_brand,5L\n\n#define SN_set_brand_Novus              \"set-brand-Novus\"\n#define NID_set_brand_Novus             642\n#define OBJ_set_brand_Novus             OBJ_set_brand,6011L\n\n#define SN_des_cdmf             \"DES-CDMF\"\n#define LN_des_cdmf             \"des-cdmf\"\n#define NID_des_cdmf            643\n#define OBJ_des_cdmf            OBJ_rsadsi,3L,10L\n\n#define SN_rsaOAEPEncryptionSET         \"rsaOAEPEncryptionSET\"\n#define NID_rsaOAEPEncryptionSET                644\n#define OBJ_rsaOAEPEncryptionSET                OBJ_rsadsi,1L,1L,6L\n\n#define SN_ipsec3               \"Oakley-EC2N-3\"\n#define LN_ipsec3               \"ipsec3\"\n#define NID_ipsec3              749\n\n#define SN_ipsec4               \"Oakley-EC2N-4\"\n#define LN_ipsec4               \"ipsec4\"\n#define NID_ipsec4              750\n\n#define SN_whirlpool            \"whirlpool\"\n#define NID_whirlpool           804\n#define OBJ_whirlpool           OBJ_iso,0L,10118L,3L,0L,55L\n\n#define SN_cryptopro            \"cryptopro\"\n#define NID_cryptopro           805\n#define OBJ_cryptopro           OBJ_member_body,643L,2L,2L\n\n#define SN_cryptocom            \"cryptocom\"\n#define NID_cryptocom           806\n#define OBJ_cryptocom           OBJ_member_body,643L,2L,9L\n\n#define SN_id_GostR3411_94_with_GostR3410_2001          \"id-GostR3411-94-with-GostR3410-2001\"\n#define LN_id_GostR3411_94_with_GostR3410_2001          \"GOST R 34.11-94 with GOST R 34.10-2001\"\n#define NID_id_GostR3411_94_with_GostR3410_2001         807\n#define OBJ_id_GostR3411_94_with_GostR3410_2001         OBJ_cryptopro,3L\n\n#define SN_id_GostR3411_94_with_GostR3410_94            \"id-GostR3411-94-with-GostR3410-94\"\n#define LN_id_GostR3411_94_with_GostR3410_94            \"GOST R 34.11-94 with GOST R 34.10-94\"\n#define NID_id_GostR3411_94_with_GostR3410_94           808\n#define OBJ_id_GostR3411_94_with_GostR3410_94           OBJ_cryptopro,4L\n\n#define SN_id_GostR3411_94              \"md_gost94\"\n#define LN_id_GostR3411_94              \"GOST R 34.11-94\"\n#define NID_id_GostR3411_94             809\n#define OBJ_id_GostR3411_94             OBJ_cryptopro,9L\n\n#define SN_id_HMACGostR3411_94          \"id-HMACGostR3411-94\"\n#define LN_id_HMACGostR3411_94          \"HMAC GOST 34.11-94\"\n#define NID_id_HMACGostR3411_94         810\n#define OBJ_id_HMACGostR3411_94         OBJ_cryptopro,10L\n\n#define SN_id_GostR3410_2001            \"gost2001\"\n#define LN_id_GostR3410_2001            \"GOST R 34.10-2001\"\n#define NID_id_GostR3410_2001           811\n#define OBJ_id_GostR3410_2001           OBJ_cryptopro,19L\n\n#define SN_id_GostR3410_94              \"gost94\"\n#define LN_id_GostR3410_94              \"GOST R 34.10-94\"\n#define NID_id_GostR3410_94             812\n#define OBJ_id_GostR3410_94             OBJ_cryptopro,20L\n\n#define SN_id_Gost28147_89              \"gost89\"\n#define LN_id_Gost28147_89              \"GOST 28147-89\"\n#define NID_id_Gost28147_89             813\n#define OBJ_id_Gost28147_89             OBJ_cryptopro,21L\n\n#define SN_gost89_cnt           \"gost89-cnt\"\n#define NID_gost89_cnt          814\n\n#define SN_id_Gost28147_89_MAC          \"gost-mac\"\n#define LN_id_Gost28147_89_MAC          \"GOST 28147-89 MAC\"\n#define NID_id_Gost28147_89_MAC         815\n#define OBJ_id_Gost28147_89_MAC         OBJ_cryptopro,22L\n\n#define SN_id_GostR3411_94_prf          \"prf-gostr3411-94\"\n#define LN_id_GostR3411_94_prf          \"GOST R 34.11-94 PRF\"\n#define NID_id_GostR3411_94_prf         816\n#define OBJ_id_GostR3411_94_prf         OBJ_cryptopro,23L\n\n#define SN_id_GostR3410_2001DH          \"id-GostR3410-2001DH\"\n#define LN_id_GostR3410_2001DH          \"GOST R 34.10-2001 DH\"\n#define NID_id_GostR3410_2001DH         817\n#define OBJ_id_GostR3410_2001DH         OBJ_cryptopro,98L\n\n#define SN_id_GostR3410_94DH            \"id-GostR3410-94DH\"\n#define LN_id_GostR3410_94DH            \"GOST R 34.10-94 DH\"\n#define NID_id_GostR3410_94DH           818\n#define OBJ_id_GostR3410_94DH           OBJ_cryptopro,99L\n\n#define SN_id_Gost28147_89_CryptoPro_KeyMeshing         \"id-Gost28147-89-CryptoPro-KeyMeshing\"\n#define NID_id_Gost28147_89_CryptoPro_KeyMeshing                819\n#define OBJ_id_Gost28147_89_CryptoPro_KeyMeshing                OBJ_cryptopro,14L,1L\n\n#define SN_id_Gost28147_89_None_KeyMeshing              \"id-Gost28147-89-None-KeyMeshing\"\n#define NID_id_Gost28147_89_None_KeyMeshing             820\n#define OBJ_id_Gost28147_89_None_KeyMeshing             OBJ_cryptopro,14L,0L\n\n#define SN_id_GostR3411_94_TestParamSet         \"id-GostR3411-94-TestParamSet\"\n#define NID_id_GostR3411_94_TestParamSet                821\n#define OBJ_id_GostR3411_94_TestParamSet                OBJ_cryptopro,30L,0L\n\n#define SN_id_GostR3411_94_CryptoProParamSet            \"id-GostR3411-94-CryptoProParamSet\"\n#define NID_id_GostR3411_94_CryptoProParamSet           822\n#define OBJ_id_GostR3411_94_CryptoProParamSet           OBJ_cryptopro,30L,1L\n\n#define SN_id_Gost28147_89_TestParamSet         \"id-Gost28147-89-TestParamSet\"\n#define NID_id_Gost28147_89_TestParamSet                823\n#define OBJ_id_Gost28147_89_TestParamSet                OBJ_cryptopro,31L,0L\n\n#define SN_id_Gost28147_89_CryptoPro_A_ParamSet         \"id-Gost28147-89-CryptoPro-A-ParamSet\"\n#define NID_id_Gost28147_89_CryptoPro_A_ParamSet                824\n#define OBJ_id_Gost28147_89_CryptoPro_A_ParamSet                OBJ_cryptopro,31L,1L\n\n#define SN_id_Gost28147_89_CryptoPro_B_ParamSet         \"id-Gost28147-89-CryptoPro-B-ParamSet\"\n#define NID_id_Gost28147_89_CryptoPro_B_ParamSet                825\n#define OBJ_id_Gost28147_89_CryptoPro_B_ParamSet                OBJ_cryptopro,31L,2L\n\n#define SN_id_Gost28147_89_CryptoPro_C_ParamSet         \"id-Gost28147-89-CryptoPro-C-ParamSet\"\n#define NID_id_Gost28147_89_CryptoPro_C_ParamSet                826\n#define OBJ_id_Gost28147_89_CryptoPro_C_ParamSet                OBJ_cryptopro,31L,3L\n\n#define SN_id_Gost28147_89_CryptoPro_D_ParamSet         \"id-Gost28147-89-CryptoPro-D-ParamSet\"\n#define NID_id_Gost28147_89_CryptoPro_D_ParamSet                827\n#define OBJ_id_Gost28147_89_CryptoPro_D_ParamSet                OBJ_cryptopro,31L,4L\n\n#define SN_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet         \"id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet\"\n#define NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet                828\n#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet                OBJ_cryptopro,31L,5L\n\n#define SN_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet         \"id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet\"\n#define NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet                829\n#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet                OBJ_cryptopro,31L,6L\n\n#define SN_id_Gost28147_89_CryptoPro_RIC_1_ParamSet             \"id-Gost28147-89-CryptoPro-RIC-1-ParamSet\"\n#define NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet            830\n#define OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet            OBJ_cryptopro,31L,7L\n\n#define SN_id_GostR3410_94_TestParamSet         \"id-GostR3410-94-TestParamSet\"\n#define NID_id_GostR3410_94_TestParamSet                831\n#define OBJ_id_GostR3410_94_TestParamSet                OBJ_cryptopro,32L,0L\n\n#define SN_id_GostR3410_94_CryptoPro_A_ParamSet         \"id-GostR3410-94-CryptoPro-A-ParamSet\"\n#define NID_id_GostR3410_94_CryptoPro_A_ParamSet                832\n#define OBJ_id_GostR3410_94_CryptoPro_A_ParamSet                OBJ_cryptopro,32L,2L\n\n#define SN_id_GostR3410_94_CryptoPro_B_ParamSet         \"id-GostR3410-94-CryptoPro-B-ParamSet\"\n#define NID_id_GostR3410_94_CryptoPro_B_ParamSet                833\n#define OBJ_id_GostR3410_94_CryptoPro_B_ParamSet                OBJ_cryptopro,32L,3L\n\n#define SN_id_GostR3410_94_CryptoPro_C_ParamSet         \"id-GostR3410-94-CryptoPro-C-ParamSet\"\n#define NID_id_GostR3410_94_CryptoPro_C_ParamSet                834\n#define OBJ_id_GostR3410_94_CryptoPro_C_ParamSet                OBJ_cryptopro,32L,4L\n\n#define SN_id_GostR3410_94_CryptoPro_D_ParamSet         \"id-GostR3410-94-CryptoPro-D-ParamSet\"\n#define NID_id_GostR3410_94_CryptoPro_D_ParamSet                835\n#define OBJ_id_GostR3410_94_CryptoPro_D_ParamSet                OBJ_cryptopro,32L,5L\n\n#define SN_id_GostR3410_94_CryptoPro_XchA_ParamSet              \"id-GostR3410-94-CryptoPro-XchA-ParamSet\"\n#define NID_id_GostR3410_94_CryptoPro_XchA_ParamSet             836\n#define OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet             OBJ_cryptopro,33L,1L\n\n#define SN_id_GostR3410_94_CryptoPro_XchB_ParamSet              \"id-GostR3410-94-CryptoPro-XchB-ParamSet\"\n#define NID_id_GostR3410_94_CryptoPro_XchB_ParamSet             837\n#define OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet             OBJ_cryptopro,33L,2L\n\n#define SN_id_GostR3410_94_CryptoPro_XchC_ParamSet              \"id-GostR3410-94-CryptoPro-XchC-ParamSet\"\n#define NID_id_GostR3410_94_CryptoPro_XchC_ParamSet             838\n#define OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet             OBJ_cryptopro,33L,3L\n\n#define SN_id_GostR3410_2001_TestParamSet               \"id-GostR3410-2001-TestParamSet\"\n#define NID_id_GostR3410_2001_TestParamSet              839\n#define OBJ_id_GostR3410_2001_TestParamSet              OBJ_cryptopro,35L,0L\n\n#define SN_id_GostR3410_2001_CryptoPro_A_ParamSet               \"id-GostR3410-2001-CryptoPro-A-ParamSet\"\n#define NID_id_GostR3410_2001_CryptoPro_A_ParamSet              840\n#define OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet              OBJ_cryptopro,35L,1L\n\n#define SN_id_GostR3410_2001_CryptoPro_B_ParamSet               \"id-GostR3410-2001-CryptoPro-B-ParamSet\"\n#define NID_id_GostR3410_2001_CryptoPro_B_ParamSet              841\n#define OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet              OBJ_cryptopro,35L,2L\n\n#define SN_id_GostR3410_2001_CryptoPro_C_ParamSet               \"id-GostR3410-2001-CryptoPro-C-ParamSet\"\n#define NID_id_GostR3410_2001_CryptoPro_C_ParamSet              842\n#define OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet              OBJ_cryptopro,35L,3L\n\n#define SN_id_GostR3410_2001_CryptoPro_XchA_ParamSet            \"id-GostR3410-2001-CryptoPro-XchA-ParamSet\"\n#define NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet           843\n#define OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet           OBJ_cryptopro,36L,0L\n\n#define SN_id_GostR3410_2001_CryptoPro_XchB_ParamSet            \"id-GostR3410-2001-CryptoPro-XchB-ParamSet\"\n#define NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet           844\n#define OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet           OBJ_cryptopro,36L,1L\n\n#define SN_id_GostR3410_94_a            \"id-GostR3410-94-a\"\n#define NID_id_GostR3410_94_a           845\n#define OBJ_id_GostR3410_94_a           OBJ_id_GostR3410_94,1L\n\n#define SN_id_GostR3410_94_aBis         \"id-GostR3410-94-aBis\"\n#define NID_id_GostR3410_94_aBis                846\n#define OBJ_id_GostR3410_94_aBis                OBJ_id_GostR3410_94,2L\n\n#define SN_id_GostR3410_94_b            \"id-GostR3410-94-b\"\n#define NID_id_GostR3410_94_b           847\n#define OBJ_id_GostR3410_94_b           OBJ_id_GostR3410_94,3L\n\n#define SN_id_GostR3410_94_bBis         \"id-GostR3410-94-bBis\"\n#define NID_id_GostR3410_94_bBis                848\n#define OBJ_id_GostR3410_94_bBis                OBJ_id_GostR3410_94,4L\n\n#define SN_id_Gost28147_89_cc           \"id-Gost28147-89-cc\"\n#define LN_id_Gost28147_89_cc           \"GOST 28147-89 Cryptocom ParamSet\"\n#define NID_id_Gost28147_89_cc          849\n#define OBJ_id_Gost28147_89_cc          OBJ_cryptocom,1L,6L,1L\n\n#define SN_id_GostR3410_94_cc           \"gost94cc\"\n#define LN_id_GostR3410_94_cc           \"GOST 34.10-94 Cryptocom\"\n#define NID_id_GostR3410_94_cc          850\n#define OBJ_id_GostR3410_94_cc          OBJ_cryptocom,1L,5L,3L\n\n#define SN_id_GostR3410_2001_cc         \"gost2001cc\"\n#define LN_id_GostR3410_2001_cc         \"GOST 34.10-2001 Cryptocom\"\n#define NID_id_GostR3410_2001_cc                851\n#define OBJ_id_GostR3410_2001_cc                OBJ_cryptocom,1L,5L,4L\n\n#define SN_id_GostR3411_94_with_GostR3410_94_cc         \"id-GostR3411-94-with-GostR3410-94-cc\"\n#define LN_id_GostR3411_94_with_GostR3410_94_cc         \"GOST R 34.11-94 with GOST R 34.10-94 Cryptocom\"\n#define NID_id_GostR3411_94_with_GostR3410_94_cc                852\n#define OBJ_id_GostR3411_94_with_GostR3410_94_cc                OBJ_cryptocom,1L,3L,3L\n\n#define SN_id_GostR3411_94_with_GostR3410_2001_cc               \"id-GostR3411-94-with-GostR3410-2001-cc\"\n#define LN_id_GostR3411_94_with_GostR3410_2001_cc               \"GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom\"\n#define NID_id_GostR3411_94_with_GostR3410_2001_cc              853\n#define OBJ_id_GostR3411_94_with_GostR3410_2001_cc              OBJ_cryptocom,1L,3L,4L\n\n#define SN_id_GostR3410_2001_ParamSet_cc                \"id-GostR3410-2001-ParamSet-cc\"\n#define LN_id_GostR3410_2001_ParamSet_cc                \"GOST R 3410-2001 Parameter Set Cryptocom\"\n#define NID_id_GostR3410_2001_ParamSet_cc               854\n#define OBJ_id_GostR3410_2001_ParamSet_cc               OBJ_cryptocom,1L,8L,1L\n\n#define SN_camellia_128_cbc             \"CAMELLIA-128-CBC\"\n#define LN_camellia_128_cbc             \"camellia-128-cbc\"\n#define NID_camellia_128_cbc            751\n#define OBJ_camellia_128_cbc            1L,2L,392L,200011L,61L,1L,1L,1L,2L\n\n#define SN_camellia_192_cbc             \"CAMELLIA-192-CBC\"\n#define LN_camellia_192_cbc             \"camellia-192-cbc\"\n#define NID_camellia_192_cbc            752\n#define OBJ_camellia_192_cbc            1L,2L,392L,200011L,61L,1L,1L,1L,3L\n\n#define SN_camellia_256_cbc             \"CAMELLIA-256-CBC\"\n#define LN_camellia_256_cbc             \"camellia-256-cbc\"\n#define NID_camellia_256_cbc            753\n#define OBJ_camellia_256_cbc            1L,2L,392L,200011L,61L,1L,1L,1L,4L\n\n#define SN_id_camellia128_wrap          \"id-camellia128-wrap\"\n#define NID_id_camellia128_wrap         907\n#define OBJ_id_camellia128_wrap         1L,2L,392L,200011L,61L,1L,1L,3L,2L\n\n#define SN_id_camellia192_wrap          \"id-camellia192-wrap\"\n#define NID_id_camellia192_wrap         908\n#define OBJ_id_camellia192_wrap         1L,2L,392L,200011L,61L,1L,1L,3L,3L\n\n#define SN_id_camellia256_wrap          \"id-camellia256-wrap\"\n#define NID_id_camellia256_wrap         909\n#define OBJ_id_camellia256_wrap         1L,2L,392L,200011L,61L,1L,1L,3L,4L\n\n#define OBJ_ntt_ds              0L,3L,4401L,5L\n\n#define OBJ_camellia            OBJ_ntt_ds,3L,1L,9L\n\n#define SN_camellia_128_ecb             \"CAMELLIA-128-ECB\"\n#define LN_camellia_128_ecb             \"camellia-128-ecb\"\n#define NID_camellia_128_ecb            754\n#define OBJ_camellia_128_ecb            OBJ_camellia,1L\n\n#define SN_camellia_128_ofb128          \"CAMELLIA-128-OFB\"\n#define LN_camellia_128_ofb128          \"camellia-128-ofb\"\n#define NID_camellia_128_ofb128         766\n#define OBJ_camellia_128_ofb128         OBJ_camellia,3L\n\n#define SN_camellia_128_cfb128          \"CAMELLIA-128-CFB\"\n#define LN_camellia_128_cfb128          \"camellia-128-cfb\"\n#define NID_camellia_128_cfb128         757\n#define OBJ_camellia_128_cfb128         OBJ_camellia,4L\n\n#define SN_camellia_192_ecb             \"CAMELLIA-192-ECB\"\n#define LN_camellia_192_ecb             \"camellia-192-ecb\"\n#define NID_camellia_192_ecb            755\n#define OBJ_camellia_192_ecb            OBJ_camellia,21L\n\n#define SN_camellia_192_ofb128          \"CAMELLIA-192-OFB\"\n#define LN_camellia_192_ofb128          \"camellia-192-ofb\"\n#define NID_camellia_192_ofb128         767\n#define OBJ_camellia_192_ofb128         OBJ_camellia,23L\n\n#define SN_camellia_192_cfb128          \"CAMELLIA-192-CFB\"\n#define LN_camellia_192_cfb128          \"camellia-192-cfb\"\n#define NID_camellia_192_cfb128         758\n#define OBJ_camellia_192_cfb128         OBJ_camellia,24L\n\n#define SN_camellia_256_ecb             \"CAMELLIA-256-ECB\"\n#define LN_camellia_256_ecb             \"camellia-256-ecb\"\n#define NID_camellia_256_ecb            756\n#define OBJ_camellia_256_ecb            OBJ_camellia,41L\n\n#define SN_camellia_256_ofb128          \"CAMELLIA-256-OFB\"\n#define LN_camellia_256_ofb128          \"camellia-256-ofb\"\n#define NID_camellia_256_ofb128         768\n#define OBJ_camellia_256_ofb128         OBJ_camellia,43L\n\n#define SN_camellia_256_cfb128          \"CAMELLIA-256-CFB\"\n#define LN_camellia_256_cfb128          \"camellia-256-cfb\"\n#define NID_camellia_256_cfb128         759\n#define OBJ_camellia_256_cfb128         OBJ_camellia,44L\n\n#define SN_camellia_128_cfb1            \"CAMELLIA-128-CFB1\"\n#define LN_camellia_128_cfb1            \"camellia-128-cfb1\"\n#define NID_camellia_128_cfb1           760\n\n#define SN_camellia_192_cfb1            \"CAMELLIA-192-CFB1\"\n#define LN_camellia_192_cfb1            \"camellia-192-cfb1\"\n#define NID_camellia_192_cfb1           761\n\n#define SN_camellia_256_cfb1            \"CAMELLIA-256-CFB1\"\n#define LN_camellia_256_cfb1            \"camellia-256-cfb1\"\n#define NID_camellia_256_cfb1           762\n\n#define SN_camellia_128_cfb8            \"CAMELLIA-128-CFB8\"\n#define LN_camellia_128_cfb8            \"camellia-128-cfb8\"\n#define NID_camellia_128_cfb8           763\n\n#define SN_camellia_192_cfb8            \"CAMELLIA-192-CFB8\"\n#define LN_camellia_192_cfb8            \"camellia-192-cfb8\"\n#define NID_camellia_192_cfb8           764\n\n#define SN_camellia_256_cfb8            \"CAMELLIA-256-CFB8\"\n#define LN_camellia_256_cfb8            \"camellia-256-cfb8\"\n#define NID_camellia_256_cfb8           765\n\n#define SN_kisa         \"KISA\"\n#define LN_kisa         \"kisa\"\n#define NID_kisa                773\n#define OBJ_kisa                OBJ_member_body,410L,200004L\n\n#define SN_seed_ecb             \"SEED-ECB\"\n#define LN_seed_ecb             \"seed-ecb\"\n#define NID_seed_ecb            776\n#define OBJ_seed_ecb            OBJ_kisa,1L,3L\n\n#define SN_seed_cbc             \"SEED-CBC\"\n#define LN_seed_cbc             \"seed-cbc\"\n#define NID_seed_cbc            777\n#define OBJ_seed_cbc            OBJ_kisa,1L,4L\n\n#define SN_seed_cfb128          \"SEED-CFB\"\n#define LN_seed_cfb128          \"seed-cfb\"\n#define NID_seed_cfb128         779\n#define OBJ_seed_cfb128         OBJ_kisa,1L,5L\n\n#define SN_seed_ofb128          \"SEED-OFB\"\n#define LN_seed_ofb128          \"seed-ofb\"\n#define NID_seed_ofb128         778\n#define OBJ_seed_ofb128         OBJ_kisa,1L,6L\n\n#define SN_hmac         \"HMAC\"\n#define LN_hmac         \"hmac\"\n#define NID_hmac                855\n\n#define SN_cmac         \"CMAC\"\n#define LN_cmac         \"cmac\"\n#define NID_cmac                894\n\n#define SN_rc4_hmac_md5         \"RC4-HMAC-MD5\"\n#define LN_rc4_hmac_md5         \"rc4-hmac-md5\"\n#define NID_rc4_hmac_md5                915\n\n#define SN_aes_128_cbc_hmac_sha1                \"AES-128-CBC-HMAC-SHA1\"\n#define LN_aes_128_cbc_hmac_sha1                \"aes-128-cbc-hmac-sha1\"\n#define NID_aes_128_cbc_hmac_sha1               916\n\n#define SN_aes_192_cbc_hmac_sha1                \"AES-192-CBC-HMAC-SHA1\"\n#define LN_aes_192_cbc_hmac_sha1                \"aes-192-cbc-hmac-sha1\"\n#define NID_aes_192_cbc_hmac_sha1               917\n\n#define SN_aes_256_cbc_hmac_sha1                \"AES-256-CBC-HMAC-SHA1\"\n#define LN_aes_256_cbc_hmac_sha1                \"aes-256-cbc-hmac-sha1\"\n#define NID_aes_256_cbc_hmac_sha1               918\n\n#define SN_aes_128_cbc_hmac_sha256              \"AES-128-CBC-HMAC-SHA256\"\n#define LN_aes_128_cbc_hmac_sha256              \"aes-128-cbc-hmac-sha256\"\n#define NID_aes_128_cbc_hmac_sha256             948\n\n#define SN_aes_192_cbc_hmac_sha256              \"AES-192-CBC-HMAC-SHA256\"\n#define LN_aes_192_cbc_hmac_sha256              \"aes-192-cbc-hmac-sha256\"\n#define NID_aes_192_cbc_hmac_sha256             949\n\n#define SN_aes_256_cbc_hmac_sha256              \"AES-256-CBC-HMAC-SHA256\"\n#define LN_aes_256_cbc_hmac_sha256              \"aes-256-cbc-hmac-sha256\"\n#define NID_aes_256_cbc_hmac_sha256             950\n\n#define SN_dhpublicnumber               \"dhpublicnumber\"\n#define LN_dhpublicnumber               \"X9.42 DH\"\n#define NID_dhpublicnumber              920\n#define OBJ_dhpublicnumber              OBJ_ISO_US,10046L,2L,1L\n\n#define SN_brainpoolP160r1              \"brainpoolP160r1\"\n#define NID_brainpoolP160r1             921\n#define OBJ_brainpoolP160r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,1L\n\n#define SN_brainpoolP160t1              \"brainpoolP160t1\"\n#define NID_brainpoolP160t1             922\n#define OBJ_brainpoolP160t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,2L\n\n#define SN_brainpoolP192r1              \"brainpoolP192r1\"\n#define NID_brainpoolP192r1             923\n#define OBJ_brainpoolP192r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,3L\n\n#define SN_brainpoolP192t1              \"brainpoolP192t1\"\n#define NID_brainpoolP192t1             924\n#define OBJ_brainpoolP192t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,4L\n\n#define SN_brainpoolP224r1              \"brainpoolP224r1\"\n#define NID_brainpoolP224r1             925\n#define OBJ_brainpoolP224r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,5L\n\n#define SN_brainpoolP224t1              \"brainpoolP224t1\"\n#define NID_brainpoolP224t1             926\n#define OBJ_brainpoolP224t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,6L\n\n#define SN_brainpoolP256r1              \"brainpoolP256r1\"\n#define NID_brainpoolP256r1             927\n#define OBJ_brainpoolP256r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,7L\n\n#define SN_brainpoolP256t1              \"brainpoolP256t1\"\n#define NID_brainpoolP256t1             928\n#define OBJ_brainpoolP256t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,8L\n\n#define SN_brainpoolP320r1              \"brainpoolP320r1\"\n#define NID_brainpoolP320r1             929\n#define OBJ_brainpoolP320r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,9L\n\n#define SN_brainpoolP320t1              \"brainpoolP320t1\"\n#define NID_brainpoolP320t1             930\n#define OBJ_brainpoolP320t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,10L\n\n#define SN_brainpoolP384r1              \"brainpoolP384r1\"\n#define NID_brainpoolP384r1             931\n#define OBJ_brainpoolP384r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,11L\n\n#define SN_brainpoolP384t1              \"brainpoolP384t1\"\n#define NID_brainpoolP384t1             932\n#define OBJ_brainpoolP384t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,12L\n\n#define SN_brainpoolP512r1              \"brainpoolP512r1\"\n#define NID_brainpoolP512r1             933\n#define OBJ_brainpoolP512r1             1L,3L,36L,3L,3L,2L,8L,1L,1L,13L\n\n#define SN_brainpoolP512t1              \"brainpoolP512t1\"\n#define NID_brainpoolP512t1             934\n#define OBJ_brainpoolP512t1             1L,3L,36L,3L,3L,2L,8L,1L,1L,14L\n\n#define OBJ_x9_63_scheme                1L,3L,133L,16L,840L,63L,0L\n\n#define OBJ_secg_scheme         OBJ_certicom_arc,1L\n\n#define SN_dhSinglePass_stdDH_sha1kdf_scheme            \"dhSinglePass-stdDH-sha1kdf-scheme\"\n#define NID_dhSinglePass_stdDH_sha1kdf_scheme           936\n#define OBJ_dhSinglePass_stdDH_sha1kdf_scheme           OBJ_x9_63_scheme,2L\n\n#define SN_dhSinglePass_stdDH_sha224kdf_scheme          \"dhSinglePass-stdDH-sha224kdf-scheme\"\n#define NID_dhSinglePass_stdDH_sha224kdf_scheme         937\n#define OBJ_dhSinglePass_stdDH_sha224kdf_scheme         OBJ_secg_scheme,11L,0L\n\n#define SN_dhSinglePass_stdDH_sha256kdf_scheme          \"dhSinglePass-stdDH-sha256kdf-scheme\"\n#define NID_dhSinglePass_stdDH_sha256kdf_scheme         938\n#define OBJ_dhSinglePass_stdDH_sha256kdf_scheme         OBJ_secg_scheme,11L,1L\n\n#define SN_dhSinglePass_stdDH_sha384kdf_scheme          \"dhSinglePass-stdDH-sha384kdf-scheme\"\n#define NID_dhSinglePass_stdDH_sha384kdf_scheme         939\n#define OBJ_dhSinglePass_stdDH_sha384kdf_scheme         OBJ_secg_scheme,11L,2L\n\n#define SN_dhSinglePass_stdDH_sha512kdf_scheme          \"dhSinglePass-stdDH-sha512kdf-scheme\"\n#define NID_dhSinglePass_stdDH_sha512kdf_scheme         940\n#define OBJ_dhSinglePass_stdDH_sha512kdf_scheme         OBJ_secg_scheme,11L,3L\n\n#define SN_dhSinglePass_cofactorDH_sha1kdf_scheme               \"dhSinglePass-cofactorDH-sha1kdf-scheme\"\n#define NID_dhSinglePass_cofactorDH_sha1kdf_scheme              941\n#define OBJ_dhSinglePass_cofactorDH_sha1kdf_scheme              OBJ_x9_63_scheme,3L\n\n#define SN_dhSinglePass_cofactorDH_sha224kdf_scheme             \"dhSinglePass-cofactorDH-sha224kdf-scheme\"\n#define NID_dhSinglePass_cofactorDH_sha224kdf_scheme            942\n#define OBJ_dhSinglePass_cofactorDH_sha224kdf_scheme            OBJ_secg_scheme,14L,0L\n\n#define SN_dhSinglePass_cofactorDH_sha256kdf_scheme             \"dhSinglePass-cofactorDH-sha256kdf-scheme\"\n#define NID_dhSinglePass_cofactorDH_sha256kdf_scheme            943\n#define OBJ_dhSinglePass_cofactorDH_sha256kdf_scheme            OBJ_secg_scheme,14L,1L\n\n#define SN_dhSinglePass_cofactorDH_sha384kdf_scheme             \"dhSinglePass-cofactorDH-sha384kdf-scheme\"\n#define NID_dhSinglePass_cofactorDH_sha384kdf_scheme            944\n#define OBJ_dhSinglePass_cofactorDH_sha384kdf_scheme            OBJ_secg_scheme,14L,2L\n\n#define SN_dhSinglePass_cofactorDH_sha512kdf_scheme             \"dhSinglePass-cofactorDH-sha512kdf-scheme\"\n#define NID_dhSinglePass_cofactorDH_sha512kdf_scheme            945\n#define OBJ_dhSinglePass_cofactorDH_sha512kdf_scheme            OBJ_secg_scheme,14L,3L\n\n#define SN_dh_std_kdf           \"dh-std-kdf\"\n#define NID_dh_std_kdf          946\n\n#define SN_dh_cofactor_kdf              \"dh-cofactor-kdf\"\n#define NID_dh_cofactor_kdf             947\n\n#define SN_ct_precert_scts              \"ct_precert_scts\"\n#define LN_ct_precert_scts              \"CT Precertificate SCTs\"\n#define NID_ct_precert_scts             951\n#define OBJ_ct_precert_scts             1L,3L,6L,1L,4L,1L,11129L,2L,4L,2L\n\n#define SN_ct_precert_poison            \"ct_precert_poison\"\n#define LN_ct_precert_poison            \"CT Precertificate Poison\"\n#define NID_ct_precert_poison           952\n#define OBJ_ct_precert_poison           1L,3L,6L,1L,4L,1L,11129L,2L,4L,3L\n\n#define SN_ct_precert_signer            \"ct_precert_signer\"\n#define LN_ct_precert_signer            \"CT Precertificate Signer\"\n#define NID_ct_precert_signer           953\n#define OBJ_ct_precert_signer           1L,3L,6L,1L,4L,1L,11129L,2L,4L,4L\n\n#define SN_ct_cert_scts         \"ct_cert_scts\"\n#define LN_ct_cert_scts         \"CT Certificate SCTs\"\n#define NID_ct_cert_scts                954\n#define OBJ_ct_cert_scts                1L,3L,6L,1L,4L,1L,11129L,2L,4L,5L\n\n#define SN_jurisdictionLocalityName             \"jurisdictionL\"\n#define LN_jurisdictionLocalityName             \"jurisdictionLocalityName\"\n#define NID_jurisdictionLocalityName            955\n#define OBJ_jurisdictionLocalityName            1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,1L\n\n#define SN_jurisdictionStateOrProvinceName              \"jurisdictionST\"\n#define LN_jurisdictionStateOrProvinceName              \"jurisdictionStateOrProvinceName\"\n#define NID_jurisdictionStateOrProvinceName             956\n#define OBJ_jurisdictionStateOrProvinceName             1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,2L\n\n#define SN_jurisdictionCountryName              \"jurisdictionC\"\n#define LN_jurisdictionCountryName              \"jurisdictionCountryName\"\n#define NID_jurisdictionCountryName             957\n#define OBJ_jurisdictionCountryName             1L,3L,6L,1L,4L,1L,311L,60L,2L,1L,3L\n"
  },
  {
    "path": "third_party/include/openssl/objects.h",
    "content": "/* crypto/objects/objects.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_OBJECTS_H\n# define HEADER_OBJECTS_H\n\n# define USE_OBJ_MAC\n\n# ifdef USE_OBJ_MAC\n#  include <openssl/obj_mac.h>\n# else\n#  define SN_undef                        \"UNDEF\"\n#  define LN_undef                        \"undefined\"\n#  define NID_undef                       0\n#  define OBJ_undef                       0L\n\n#  define SN_Algorithm                    \"Algorithm\"\n#  define LN_algorithm                    \"algorithm\"\n#  define NID_algorithm                   38\n#  define OBJ_algorithm                   1L,3L,14L,3L,2L\n\n#  define LN_rsadsi                       \"rsadsi\"\n#  define NID_rsadsi                      1\n#  define OBJ_rsadsi                      1L,2L,840L,113549L\n\n#  define LN_pkcs                         \"pkcs\"\n#  define NID_pkcs                        2\n#  define OBJ_pkcs                        OBJ_rsadsi,1L\n\n#  define SN_md2                          \"MD2\"\n#  define LN_md2                          \"md2\"\n#  define NID_md2                         3\n#  define OBJ_md2                         OBJ_rsadsi,2L,2L\n\n#  define SN_md5                          \"MD5\"\n#  define LN_md5                          \"md5\"\n#  define NID_md5                         4\n#  define OBJ_md5                         OBJ_rsadsi,2L,5L\n\n#  define SN_rc4                          \"RC4\"\n#  define LN_rc4                          \"rc4\"\n#  define NID_rc4                         5\n#  define OBJ_rc4                         OBJ_rsadsi,3L,4L\n\n#  define LN_rsaEncryption                \"rsaEncryption\"\n#  define NID_rsaEncryption               6\n#  define OBJ_rsaEncryption               OBJ_pkcs,1L,1L\n\n#  define SN_md2WithRSAEncryption         \"RSA-MD2\"\n#  define LN_md2WithRSAEncryption         \"md2WithRSAEncryption\"\n#  define NID_md2WithRSAEncryption        7\n#  define OBJ_md2WithRSAEncryption        OBJ_pkcs,1L,2L\n\n#  define SN_md5WithRSAEncryption         \"RSA-MD5\"\n#  define LN_md5WithRSAEncryption         \"md5WithRSAEncryption\"\n#  define NID_md5WithRSAEncryption        8\n#  define OBJ_md5WithRSAEncryption        OBJ_pkcs,1L,4L\n\n#  define SN_pbeWithMD2AndDES_CBC         \"PBE-MD2-DES\"\n#  define LN_pbeWithMD2AndDES_CBC         \"pbeWithMD2AndDES-CBC\"\n#  define NID_pbeWithMD2AndDES_CBC        9\n#  define OBJ_pbeWithMD2AndDES_CBC        OBJ_pkcs,5L,1L\n\n#  define SN_pbeWithMD5AndDES_CBC         \"PBE-MD5-DES\"\n#  define LN_pbeWithMD5AndDES_CBC         \"pbeWithMD5AndDES-CBC\"\n#  define NID_pbeWithMD5AndDES_CBC        10\n#  define OBJ_pbeWithMD5AndDES_CBC        OBJ_pkcs,5L,3L\n\n#  define LN_X500                         \"X500\"\n#  define NID_X500                        11\n#  define OBJ_X500                        2L,5L\n\n#  define LN_X509                         \"X509\"\n#  define NID_X509                        12\n#  define OBJ_X509                        OBJ_X500,4L\n\n#  define SN_commonName                   \"CN\"\n#  define LN_commonName                   \"commonName\"\n#  define NID_commonName                  13\n#  define OBJ_commonName                  OBJ_X509,3L\n\n#  define SN_countryName                  \"C\"\n#  define LN_countryName                  \"countryName\"\n#  define NID_countryName                 14\n#  define OBJ_countryName                 OBJ_X509,6L\n\n#  define SN_localityName                 \"L\"\n#  define LN_localityName                 \"localityName\"\n#  define NID_localityName                15\n#  define OBJ_localityName                OBJ_X509,7L\n\n/* Postal Address? PA */\n\n/* should be \"ST\" (rfc1327) but MS uses 'S' */\n#  define SN_stateOrProvinceName          \"ST\"\n#  define LN_stateOrProvinceName          \"stateOrProvinceName\"\n#  define NID_stateOrProvinceName         16\n#  define OBJ_stateOrProvinceName         OBJ_X509,8L\n\n#  define SN_organizationName             \"O\"\n#  define LN_organizationName             \"organizationName\"\n#  define NID_organizationName            17\n#  define OBJ_organizationName            OBJ_X509,10L\n\n#  define SN_organizationalUnitName       \"OU\"\n#  define LN_organizationalUnitName       \"organizationalUnitName\"\n#  define NID_organizationalUnitName      18\n#  define OBJ_organizationalUnitName      OBJ_X509,11L\n\n#  define SN_rsa                          \"RSA\"\n#  define LN_rsa                          \"rsa\"\n#  define NID_rsa                         19\n#  define OBJ_rsa                         OBJ_X500,8L,1L,1L\n\n#  define LN_pkcs7                        \"pkcs7\"\n#  define NID_pkcs7                       20\n#  define OBJ_pkcs7                       OBJ_pkcs,7L\n\n#  define LN_pkcs7_data                   \"pkcs7-data\"\n#  define NID_pkcs7_data                  21\n#  define OBJ_pkcs7_data                  OBJ_pkcs7,1L\n\n#  define LN_pkcs7_signed                 \"pkcs7-signedData\"\n#  define NID_pkcs7_signed                22\n#  define OBJ_pkcs7_signed                OBJ_pkcs7,2L\n\n#  define LN_pkcs7_enveloped              \"pkcs7-envelopedData\"\n#  define NID_pkcs7_enveloped             23\n#  define OBJ_pkcs7_enveloped             OBJ_pkcs7,3L\n\n#  define LN_pkcs7_signedAndEnveloped     \"pkcs7-signedAndEnvelopedData\"\n#  define NID_pkcs7_signedAndEnveloped    24\n#  define OBJ_pkcs7_signedAndEnveloped    OBJ_pkcs7,4L\n\n#  define LN_pkcs7_digest                 \"pkcs7-digestData\"\n#  define NID_pkcs7_digest                25\n#  define OBJ_pkcs7_digest                OBJ_pkcs7,5L\n\n#  define LN_pkcs7_encrypted              \"pkcs7-encryptedData\"\n#  define NID_pkcs7_encrypted             26\n#  define OBJ_pkcs7_encrypted             OBJ_pkcs7,6L\n\n#  define LN_pkcs3                        \"pkcs3\"\n#  define NID_pkcs3                       27\n#  define OBJ_pkcs3                       OBJ_pkcs,3L\n\n#  define LN_dhKeyAgreement               \"dhKeyAgreement\"\n#  define NID_dhKeyAgreement              28\n#  define OBJ_dhKeyAgreement              OBJ_pkcs3,1L\n\n#  define SN_des_ecb                      \"DES-ECB\"\n#  define LN_des_ecb                      \"des-ecb\"\n#  define NID_des_ecb                     29\n#  define OBJ_des_ecb                     OBJ_algorithm,6L\n\n#  define SN_des_cfb64                    \"DES-CFB\"\n#  define LN_des_cfb64                    \"des-cfb\"\n#  define NID_des_cfb64                   30\n/* IV + num */\n#  define OBJ_des_cfb64                   OBJ_algorithm,9L\n\n#  define SN_des_cbc                      \"DES-CBC\"\n#  define LN_des_cbc                      \"des-cbc\"\n#  define NID_des_cbc                     31\n/* IV */\n#  define OBJ_des_cbc                     OBJ_algorithm,7L\n\n#  define SN_des_ede                      \"DES-EDE\"\n#  define LN_des_ede                      \"des-ede\"\n#  define NID_des_ede                     32\n/* ?? */\n#  define OBJ_des_ede                     OBJ_algorithm,17L\n\n#  define SN_des_ede3                     \"DES-EDE3\"\n#  define LN_des_ede3                     \"des-ede3\"\n#  define NID_des_ede3                    33\n\n#  define SN_idea_cbc                     \"IDEA-CBC\"\n#  define LN_idea_cbc                     \"idea-cbc\"\n#  define NID_idea_cbc                    34\n#  define OBJ_idea_cbc                    1L,3L,6L,1L,4L,1L,188L,7L,1L,1L,2L\n\n#  define SN_idea_cfb64                   \"IDEA-CFB\"\n#  define LN_idea_cfb64                   \"idea-cfb\"\n#  define NID_idea_cfb64                  35\n\n#  define SN_idea_ecb                     \"IDEA-ECB\"\n#  define LN_idea_ecb                     \"idea-ecb\"\n#  define NID_idea_ecb                    36\n\n#  define SN_rc2_cbc                      \"RC2-CBC\"\n#  define LN_rc2_cbc                      \"rc2-cbc\"\n#  define NID_rc2_cbc                     37\n#  define OBJ_rc2_cbc                     OBJ_rsadsi,3L,2L\n\n#  define SN_rc2_ecb                      \"RC2-ECB\"\n#  define LN_rc2_ecb                      \"rc2-ecb\"\n#  define NID_rc2_ecb                     38\n\n#  define SN_rc2_cfb64                    \"RC2-CFB\"\n#  define LN_rc2_cfb64                    \"rc2-cfb\"\n#  define NID_rc2_cfb64                   39\n\n#  define SN_rc2_ofb64                    \"RC2-OFB\"\n#  define LN_rc2_ofb64                    \"rc2-ofb\"\n#  define NID_rc2_ofb64                   40\n\n#  define SN_sha                          \"SHA\"\n#  define LN_sha                          \"sha\"\n#  define NID_sha                         41\n#  define OBJ_sha                         OBJ_algorithm,18L\n\n#  define SN_shaWithRSAEncryption         \"RSA-SHA\"\n#  define LN_shaWithRSAEncryption         \"shaWithRSAEncryption\"\n#  define NID_shaWithRSAEncryption        42\n#  define OBJ_shaWithRSAEncryption        OBJ_algorithm,15L\n\n#  define SN_des_ede_cbc                  \"DES-EDE-CBC\"\n#  define LN_des_ede_cbc                  \"des-ede-cbc\"\n#  define NID_des_ede_cbc                 43\n\n#  define SN_des_ede3_cbc                 \"DES-EDE3-CBC\"\n#  define LN_des_ede3_cbc                 \"des-ede3-cbc\"\n#  define NID_des_ede3_cbc                44\n#  define OBJ_des_ede3_cbc                OBJ_rsadsi,3L,7L\n\n#  define SN_des_ofb64                    \"DES-OFB\"\n#  define LN_des_ofb64                    \"des-ofb\"\n#  define NID_des_ofb64                   45\n#  define OBJ_des_ofb64                   OBJ_algorithm,8L\n\n#  define SN_idea_ofb64                   \"IDEA-OFB\"\n#  define LN_idea_ofb64                   \"idea-ofb\"\n#  define NID_idea_ofb64                  46\n\n#  define LN_pkcs9                        \"pkcs9\"\n#  define NID_pkcs9                       47\n#  define OBJ_pkcs9                       OBJ_pkcs,9L\n\n#  define SN_pkcs9_emailAddress           \"Email\"\n#  define LN_pkcs9_emailAddress           \"emailAddress\"\n#  define NID_pkcs9_emailAddress          48\n#  define OBJ_pkcs9_emailAddress          OBJ_pkcs9,1L\n\n#  define LN_pkcs9_unstructuredName       \"unstructuredName\"\n#  define NID_pkcs9_unstructuredName      49\n#  define OBJ_pkcs9_unstructuredName      OBJ_pkcs9,2L\n\n#  define LN_pkcs9_contentType            \"contentType\"\n#  define NID_pkcs9_contentType           50\n#  define OBJ_pkcs9_contentType           OBJ_pkcs9,3L\n\n#  define LN_pkcs9_messageDigest          \"messageDigest\"\n#  define NID_pkcs9_messageDigest         51\n#  define OBJ_pkcs9_messageDigest         OBJ_pkcs9,4L\n\n#  define LN_pkcs9_signingTime            \"signingTime\"\n#  define NID_pkcs9_signingTime           52\n#  define OBJ_pkcs9_signingTime           OBJ_pkcs9,5L\n\n#  define LN_pkcs9_countersignature       \"countersignature\"\n#  define NID_pkcs9_countersignature      53\n#  define OBJ_pkcs9_countersignature      OBJ_pkcs9,6L\n\n#  define LN_pkcs9_challengePassword      \"challengePassword\"\n#  define NID_pkcs9_challengePassword     54\n#  define OBJ_pkcs9_challengePassword     OBJ_pkcs9,7L\n\n#  define LN_pkcs9_unstructuredAddress    \"unstructuredAddress\"\n#  define NID_pkcs9_unstructuredAddress   55\n#  define OBJ_pkcs9_unstructuredAddress   OBJ_pkcs9,8L\n\n#  define LN_pkcs9_extCertAttributes      \"extendedCertificateAttributes\"\n#  define NID_pkcs9_extCertAttributes     56\n#  define OBJ_pkcs9_extCertAttributes     OBJ_pkcs9,9L\n\n#  define SN_netscape                     \"Netscape\"\n#  define LN_netscape                     \"Netscape Communications Corp.\"\n#  define NID_netscape                    57\n#  define OBJ_netscape                    2L,16L,840L,1L,113730L\n\n#  define SN_netscape_cert_extension      \"nsCertExt\"\n#  define LN_netscape_cert_extension      \"Netscape Certificate Extension\"\n#  define NID_netscape_cert_extension     58\n#  define OBJ_netscape_cert_extension     OBJ_netscape,1L\n\n#  define SN_netscape_data_type           \"nsDataType\"\n#  define LN_netscape_data_type           \"Netscape Data Type\"\n#  define NID_netscape_data_type          59\n#  define OBJ_netscape_data_type          OBJ_netscape,2L\n\n#  define SN_des_ede_cfb64                \"DES-EDE-CFB\"\n#  define LN_des_ede_cfb64                \"des-ede-cfb\"\n#  define NID_des_ede_cfb64               60\n\n#  define SN_des_ede3_cfb64               \"DES-EDE3-CFB\"\n#  define LN_des_ede3_cfb64               \"des-ede3-cfb\"\n#  define NID_des_ede3_cfb64              61\n\n#  define SN_des_ede_ofb64                \"DES-EDE-OFB\"\n#  define LN_des_ede_ofb64                \"des-ede-ofb\"\n#  define NID_des_ede_ofb64               62\n\n#  define SN_des_ede3_ofb64               \"DES-EDE3-OFB\"\n#  define LN_des_ede3_ofb64               \"des-ede3-ofb\"\n#  define NID_des_ede3_ofb64              63\n\n/* I'm not sure about the object ID */\n#  define SN_sha1                         \"SHA1\"\n#  define LN_sha1                         \"sha1\"\n#  define NID_sha1                        64\n#  define OBJ_sha1                        OBJ_algorithm,26L\n/* 28 Jun 1996 - eay */\n/* #define OBJ_sha1                     1L,3L,14L,2L,26L,05L <- wrong */\n\n#  define SN_sha1WithRSAEncryption        \"RSA-SHA1\"\n#  define LN_sha1WithRSAEncryption        \"sha1WithRSAEncryption\"\n#  define NID_sha1WithRSAEncryption       65\n#  define OBJ_sha1WithRSAEncryption       OBJ_pkcs,1L,5L\n\n#  define SN_dsaWithSHA                   \"DSA-SHA\"\n#  define LN_dsaWithSHA                   \"dsaWithSHA\"\n#  define NID_dsaWithSHA                  66\n#  define OBJ_dsaWithSHA                  OBJ_algorithm,13L\n\n#  define SN_dsa_2                        \"DSA-old\"\n#  define LN_dsa_2                        \"dsaEncryption-old\"\n#  define NID_dsa_2                       67\n#  define OBJ_dsa_2                       OBJ_algorithm,12L\n\n/* proposed by microsoft to RSA */\n#  define SN_pbeWithSHA1AndRC2_CBC        \"PBE-SHA1-RC2-64\"\n#  define LN_pbeWithSHA1AndRC2_CBC        \"pbeWithSHA1AndRC2-CBC\"\n#  define NID_pbeWithSHA1AndRC2_CBC       68\n#  define OBJ_pbeWithSHA1AndRC2_CBC       OBJ_pkcs,5L,11L\n\n/*\n * proposed by microsoft to RSA as pbeWithSHA1AndRC4: it is now defined\n * explicitly in PKCS#5 v2.0 as id-PBKDF2 which is something completely\n * different.\n */\n#  define LN_id_pbkdf2                    \"PBKDF2\"\n#  define NID_id_pbkdf2                   69\n#  define OBJ_id_pbkdf2                   OBJ_pkcs,5L,12L\n\n#  define SN_dsaWithSHA1_2                \"DSA-SHA1-old\"\n#  define LN_dsaWithSHA1_2                \"dsaWithSHA1-old\"\n#  define NID_dsaWithSHA1_2               70\n/* Got this one from 'sdn706r20.pdf' which is actually an NSA document :-) */\n#  define OBJ_dsaWithSHA1_2               OBJ_algorithm,27L\n\n#  define SN_netscape_cert_type           \"nsCertType\"\n#  define LN_netscape_cert_type           \"Netscape Cert Type\"\n#  define NID_netscape_cert_type          71\n#  define OBJ_netscape_cert_type          OBJ_netscape_cert_extension,1L\n\n#  define SN_netscape_base_url            \"nsBaseUrl\"\n#  define LN_netscape_base_url            \"Netscape Base Url\"\n#  define NID_netscape_base_url           72\n#  define OBJ_netscape_base_url           OBJ_netscape_cert_extension,2L\n\n#  define SN_netscape_revocation_url      \"nsRevocationUrl\"\n#  define LN_netscape_revocation_url      \"Netscape Revocation Url\"\n#  define NID_netscape_revocation_url     73\n#  define OBJ_netscape_revocation_url     OBJ_netscape_cert_extension,3L\n\n#  define SN_netscape_ca_revocation_url   \"nsCaRevocationUrl\"\n#  define LN_netscape_ca_revocation_url   \"Netscape CA Revocation Url\"\n#  define NID_netscape_ca_revocation_url  74\n#  define OBJ_netscape_ca_revocation_url  OBJ_netscape_cert_extension,4L\n\n#  define SN_netscape_renewal_url         \"nsRenewalUrl\"\n#  define LN_netscape_renewal_url         \"Netscape Renewal Url\"\n#  define NID_netscape_renewal_url        75\n#  define OBJ_netscape_renewal_url        OBJ_netscape_cert_extension,7L\n\n#  define SN_netscape_ca_policy_url       \"nsCaPolicyUrl\"\n#  define LN_netscape_ca_policy_url       \"Netscape CA Policy Url\"\n#  define NID_netscape_ca_policy_url      76\n#  define OBJ_netscape_ca_policy_url      OBJ_netscape_cert_extension,8L\n\n#  define SN_netscape_ssl_server_name     \"nsSslServerName\"\n#  define LN_netscape_ssl_server_name     \"Netscape SSL Server Name\"\n#  define NID_netscape_ssl_server_name    77\n#  define OBJ_netscape_ssl_server_name    OBJ_netscape_cert_extension,12L\n\n#  define SN_netscape_comment             \"nsComment\"\n#  define LN_netscape_comment             \"Netscape Comment\"\n#  define NID_netscape_comment            78\n#  define OBJ_netscape_comment            OBJ_netscape_cert_extension,13L\n\n#  define SN_netscape_cert_sequence       \"nsCertSequence\"\n#  define LN_netscape_cert_sequence       \"Netscape Certificate Sequence\"\n#  define NID_netscape_cert_sequence      79\n#  define OBJ_netscape_cert_sequence      OBJ_netscape_data_type,5L\n\n#  define SN_desx_cbc                     \"DESX-CBC\"\n#  define LN_desx_cbc                     \"desx-cbc\"\n#  define NID_desx_cbc                    80\n\n#  define SN_id_ce                        \"id-ce\"\n#  define NID_id_ce                       81\n#  define OBJ_id_ce                       2L,5L,29L\n\n#  define SN_subject_key_identifier       \"subjectKeyIdentifier\"\n#  define LN_subject_key_identifier       \"X509v3 Subject Key Identifier\"\n#  define NID_subject_key_identifier      82\n#  define OBJ_subject_key_identifier      OBJ_id_ce,14L\n\n#  define SN_key_usage                    \"keyUsage\"\n#  define LN_key_usage                    \"X509v3 Key Usage\"\n#  define NID_key_usage                   83\n#  define OBJ_key_usage                   OBJ_id_ce,15L\n\n#  define SN_private_key_usage_period     \"privateKeyUsagePeriod\"\n#  define LN_private_key_usage_period     \"X509v3 Private Key Usage Period\"\n#  define NID_private_key_usage_period    84\n#  define OBJ_private_key_usage_period    OBJ_id_ce,16L\n\n#  define SN_subject_alt_name             \"subjectAltName\"\n#  define LN_subject_alt_name             \"X509v3 Subject Alternative Name\"\n#  define NID_subject_alt_name            85\n#  define OBJ_subject_alt_name            OBJ_id_ce,17L\n\n#  define SN_issuer_alt_name              \"issuerAltName\"\n#  define LN_issuer_alt_name              \"X509v3 Issuer Alternative Name\"\n#  define NID_issuer_alt_name             86\n#  define OBJ_issuer_alt_name             OBJ_id_ce,18L\n\n#  define SN_basic_constraints            \"basicConstraints\"\n#  define LN_basic_constraints            \"X509v3 Basic Constraints\"\n#  define NID_basic_constraints           87\n#  define OBJ_basic_constraints           OBJ_id_ce,19L\n\n#  define SN_crl_number                   \"crlNumber\"\n#  define LN_crl_number                   \"X509v3 CRL Number\"\n#  define NID_crl_number                  88\n#  define OBJ_crl_number                  OBJ_id_ce,20L\n\n#  define SN_certificate_policies         \"certificatePolicies\"\n#  define LN_certificate_policies         \"X509v3 Certificate Policies\"\n#  define NID_certificate_policies        89\n#  define OBJ_certificate_policies        OBJ_id_ce,32L\n\n#  define SN_authority_key_identifier     \"authorityKeyIdentifier\"\n#  define LN_authority_key_identifier     \"X509v3 Authority Key Identifier\"\n#  define NID_authority_key_identifier    90\n#  define OBJ_authority_key_identifier    OBJ_id_ce,35L\n\n#  define SN_bf_cbc                       \"BF-CBC\"\n#  define LN_bf_cbc                       \"bf-cbc\"\n#  define NID_bf_cbc                      91\n#  define OBJ_bf_cbc                      1L,3L,6L,1L,4L,1L,3029L,1L,2L\n\n#  define SN_bf_ecb                       \"BF-ECB\"\n#  define LN_bf_ecb                       \"bf-ecb\"\n#  define NID_bf_ecb                      92\n\n#  define SN_bf_cfb64                     \"BF-CFB\"\n#  define LN_bf_cfb64                     \"bf-cfb\"\n#  define NID_bf_cfb64                    93\n\n#  define SN_bf_ofb64                     \"BF-OFB\"\n#  define LN_bf_ofb64                     \"bf-ofb\"\n#  define NID_bf_ofb64                    94\n\n#  define SN_mdc2                         \"MDC2\"\n#  define LN_mdc2                         \"mdc2\"\n#  define NID_mdc2                        95\n#  define OBJ_mdc2                        2L,5L,8L,3L,101L\n/* An alternative?                      1L,3L,14L,3L,2L,19L */\n\n#  define SN_mdc2WithRSA                  \"RSA-MDC2\"\n#  define LN_mdc2WithRSA                  \"mdc2withRSA\"\n#  define NID_mdc2WithRSA                 96\n#  define OBJ_mdc2WithRSA                 2L,5L,8L,3L,100L\n\n#  define SN_rc4_40                       \"RC4-40\"\n#  define LN_rc4_40                       \"rc4-40\"\n#  define NID_rc4_40                      97\n\n#  define SN_rc2_40_cbc                   \"RC2-40-CBC\"\n#  define LN_rc2_40_cbc                   \"rc2-40-cbc\"\n#  define NID_rc2_40_cbc                  98\n\n#  define SN_givenName                    \"G\"\n#  define LN_givenName                    \"givenName\"\n#  define NID_givenName                   99\n#  define OBJ_givenName                   OBJ_X509,42L\n\n#  define SN_surname                      \"S\"\n#  define LN_surname                      \"surname\"\n#  define NID_surname                     100\n#  define OBJ_surname                     OBJ_X509,4L\n\n#  define SN_initials                     \"I\"\n#  define LN_initials                     \"initials\"\n#  define NID_initials                    101\n#  define OBJ_initials                    OBJ_X509,43L\n\n#  define SN_uniqueIdentifier             \"UID\"\n#  define LN_uniqueIdentifier             \"uniqueIdentifier\"\n#  define NID_uniqueIdentifier            102\n#  define OBJ_uniqueIdentifier            OBJ_X509,45L\n\n#  define SN_crl_distribution_points      \"crlDistributionPoints\"\n#  define LN_crl_distribution_points      \"X509v3 CRL Distribution Points\"\n#  define NID_crl_distribution_points     103\n#  define OBJ_crl_distribution_points     OBJ_id_ce,31L\n\n#  define SN_md5WithRSA                   \"RSA-NP-MD5\"\n#  define LN_md5WithRSA                   \"md5WithRSA\"\n#  define NID_md5WithRSA                  104\n#  define OBJ_md5WithRSA                  OBJ_algorithm,3L\n\n#  define SN_serialNumber                 \"SN\"\n#  define LN_serialNumber                 \"serialNumber\"\n#  define NID_serialNumber                105\n#  define OBJ_serialNumber                OBJ_X509,5L\n\n#  define SN_title                        \"T\"\n#  define LN_title                        \"title\"\n#  define NID_title                       106\n#  define OBJ_title                       OBJ_X509,12L\n\n#  define SN_description                  \"D\"\n#  define LN_description                  \"description\"\n#  define NID_description                 107\n#  define OBJ_description                 OBJ_X509,13L\n\n/* CAST5 is CAST-128, I'm just sticking with the documentation */\n#  define SN_cast5_cbc                    \"CAST5-CBC\"\n#  define LN_cast5_cbc                    \"cast5-cbc\"\n#  define NID_cast5_cbc                   108\n#  define OBJ_cast5_cbc                   1L,2L,840L,113533L,7L,66L,10L\n\n#  define SN_cast5_ecb                    \"CAST5-ECB\"\n#  define LN_cast5_ecb                    \"cast5-ecb\"\n#  define NID_cast5_ecb                   109\n\n#  define SN_cast5_cfb64                  \"CAST5-CFB\"\n#  define LN_cast5_cfb64                  \"cast5-cfb\"\n#  define NID_cast5_cfb64                 110\n\n#  define SN_cast5_ofb64                  \"CAST5-OFB\"\n#  define LN_cast5_ofb64                  \"cast5-ofb\"\n#  define NID_cast5_ofb64                 111\n\n#  define LN_pbeWithMD5AndCast5_CBC       \"pbeWithMD5AndCast5CBC\"\n#  define NID_pbeWithMD5AndCast5_CBC      112\n#  define OBJ_pbeWithMD5AndCast5_CBC      1L,2L,840L,113533L,7L,66L,12L\n\n/*-\n * This is one sun will soon be using :-(\n * id-dsa-with-sha1 ID  ::= {\n *   iso(1) member-body(2) us(840) x9-57 (10040) x9cm(4) 3 }\n */\n#  define SN_dsaWithSHA1                  \"DSA-SHA1\"\n#  define LN_dsaWithSHA1                  \"dsaWithSHA1\"\n#  define NID_dsaWithSHA1                 113\n#  define OBJ_dsaWithSHA1                 1L,2L,840L,10040L,4L,3L\n\n#  define NID_md5_sha1                    114\n#  define SN_md5_sha1                     \"MD5-SHA1\"\n#  define LN_md5_sha1                     \"md5-sha1\"\n\n#  define SN_sha1WithRSA                  \"RSA-SHA1-2\"\n#  define LN_sha1WithRSA                  \"sha1WithRSA\"\n#  define NID_sha1WithRSA                 115\n#  define OBJ_sha1WithRSA                 OBJ_algorithm,29L\n\n#  define SN_dsa                          \"DSA\"\n#  define LN_dsa                          \"dsaEncryption\"\n#  define NID_dsa                         116\n#  define OBJ_dsa                         1L,2L,840L,10040L,4L,1L\n\n#  define SN_ripemd160                    \"RIPEMD160\"\n#  define LN_ripemd160                    \"ripemd160\"\n#  define NID_ripemd160                   117\n#  define OBJ_ripemd160                   1L,3L,36L,3L,2L,1L\n\n/*\n * The name should actually be rsaSignatureWithripemd160, but I'm going to\n * continue using the convention I'm using with the other ciphers\n */\n#  define SN_ripemd160WithRSA             \"RSA-RIPEMD160\"\n#  define LN_ripemd160WithRSA             \"ripemd160WithRSA\"\n#  define NID_ripemd160WithRSA            119\n#  define OBJ_ripemd160WithRSA            1L,3L,36L,3L,3L,1L,2L\n\n/*-\n * Taken from rfc2040\n *  RC5_CBC_Parameters ::= SEQUENCE {\n *      version           INTEGER (v1_0(16)),\n *      rounds            INTEGER (8..127),\n *      blockSizeInBits   INTEGER (64, 128),\n *      iv                OCTET STRING OPTIONAL\n *      }\n */\n#  define SN_rc5_cbc                      \"RC5-CBC\"\n#  define LN_rc5_cbc                      \"rc5-cbc\"\n#  define NID_rc5_cbc                     120\n#  define OBJ_rc5_cbc                     OBJ_rsadsi,3L,8L\n\n#  define SN_rc5_ecb                      \"RC5-ECB\"\n#  define LN_rc5_ecb                      \"rc5-ecb\"\n#  define NID_rc5_ecb                     121\n\n#  define SN_rc5_cfb64                    \"RC5-CFB\"\n#  define LN_rc5_cfb64                    \"rc5-cfb\"\n#  define NID_rc5_cfb64                   122\n\n#  define SN_rc5_ofb64                    \"RC5-OFB\"\n#  define LN_rc5_ofb64                    \"rc5-ofb\"\n#  define NID_rc5_ofb64                   123\n\n#  define SN_rle_compression              \"RLE\"\n#  define LN_rle_compression              \"run length compression\"\n#  define NID_rle_compression             124\n#  define OBJ_rle_compression             1L,1L,1L,1L,666L,1L\n\n#  define SN_zlib_compression             \"ZLIB\"\n#  define LN_zlib_compression             \"zlib compression\"\n#  define NID_zlib_compression            125\n#  define OBJ_zlib_compression            1L,1L,1L,1L,666L,2L\n\n#  define SN_ext_key_usage                \"extendedKeyUsage\"\n#  define LN_ext_key_usage                \"X509v3 Extended Key Usage\"\n#  define NID_ext_key_usage               126\n#  define OBJ_ext_key_usage               OBJ_id_ce,37\n\n#  define SN_id_pkix                      \"PKIX\"\n#  define NID_id_pkix                     127\n#  define OBJ_id_pkix                     1L,3L,6L,1L,5L,5L,7L\n\n#  define SN_id_kp                        \"id-kp\"\n#  define NID_id_kp                       128\n#  define OBJ_id_kp                       OBJ_id_pkix,3L\n\n/* PKIX extended key usage OIDs */\n\n#  define SN_server_auth                  \"serverAuth\"\n#  define LN_server_auth                  \"TLS Web Server Authentication\"\n#  define NID_server_auth                 129\n#  define OBJ_server_auth                 OBJ_id_kp,1L\n\n#  define SN_client_auth                  \"clientAuth\"\n#  define LN_client_auth                  \"TLS Web Client Authentication\"\n#  define NID_client_auth                 130\n#  define OBJ_client_auth                 OBJ_id_kp,2L\n\n#  define SN_code_sign                    \"codeSigning\"\n#  define LN_code_sign                    \"Code Signing\"\n#  define NID_code_sign                   131\n#  define OBJ_code_sign                   OBJ_id_kp,3L\n\n#  define SN_email_protect                \"emailProtection\"\n#  define LN_email_protect                \"E-mail Protection\"\n#  define NID_email_protect               132\n#  define OBJ_email_protect               OBJ_id_kp,4L\n\n#  define SN_time_stamp                   \"timeStamping\"\n#  define LN_time_stamp                   \"Time Stamping\"\n#  define NID_time_stamp                  133\n#  define OBJ_time_stamp                  OBJ_id_kp,8L\n\n/* Additional extended key usage OIDs: Microsoft */\n\n#  define SN_ms_code_ind                  \"msCodeInd\"\n#  define LN_ms_code_ind                  \"Microsoft Individual Code Signing\"\n#  define NID_ms_code_ind                 134\n#  define OBJ_ms_code_ind                 1L,3L,6L,1L,4L,1L,311L,2L,1L,21L\n\n#  define SN_ms_code_com                  \"msCodeCom\"\n#  define LN_ms_code_com                  \"Microsoft Commercial Code Signing\"\n#  define NID_ms_code_com                 135\n#  define OBJ_ms_code_com                 1L,3L,6L,1L,4L,1L,311L,2L,1L,22L\n\n#  define SN_ms_ctl_sign                  \"msCTLSign\"\n#  define LN_ms_ctl_sign                  \"Microsoft Trust List Signing\"\n#  define NID_ms_ctl_sign                 136\n#  define OBJ_ms_ctl_sign                 1L,3L,6L,1L,4L,1L,311L,10L,3L,1L\n\n#  define SN_ms_sgc                       \"msSGC\"\n#  define LN_ms_sgc                       \"Microsoft Server Gated Crypto\"\n#  define NID_ms_sgc                      137\n#  define OBJ_ms_sgc                      1L,3L,6L,1L,4L,1L,311L,10L,3L,3L\n\n#  define SN_ms_efs                       \"msEFS\"\n#  define LN_ms_efs                       \"Microsoft Encrypted File System\"\n#  define NID_ms_efs                      138\n#  define OBJ_ms_efs                      1L,3L,6L,1L,4L,1L,311L,10L,3L,4L\n\n/* Additional usage: Netscape */\n\n#  define SN_ns_sgc                       \"nsSGC\"\n#  define LN_ns_sgc                       \"Netscape Server Gated Crypto\"\n#  define NID_ns_sgc                      139\n#  define OBJ_ns_sgc                      OBJ_netscape,4L,1L\n\n#  define SN_delta_crl                    \"deltaCRL\"\n#  define LN_delta_crl                    \"X509v3 Delta CRL Indicator\"\n#  define NID_delta_crl                   140\n#  define OBJ_delta_crl                   OBJ_id_ce,27L\n\n#  define SN_crl_reason                   \"CRLReason\"\n#  define LN_crl_reason                   \"CRL Reason Code\"\n#  define NID_crl_reason                  141\n#  define OBJ_crl_reason                  OBJ_id_ce,21L\n\n#  define SN_invalidity_date              \"invalidityDate\"\n#  define LN_invalidity_date              \"Invalidity Date\"\n#  define NID_invalidity_date             142\n#  define OBJ_invalidity_date             OBJ_id_ce,24L\n\n#  define SN_sxnet                        \"SXNetID\"\n#  define LN_sxnet                        \"Strong Extranet ID\"\n#  define NID_sxnet                       143\n#  define OBJ_sxnet                       1L,3L,101L,1L,4L,1L\n\n/* PKCS12 and related OBJECT IDENTIFIERS */\n\n#  define OBJ_pkcs12                      OBJ_pkcs,12L\n#  define OBJ_pkcs12_pbeids               OBJ_pkcs12, 1\n\n#  define SN_pbe_WithSHA1And128BitRC4     \"PBE-SHA1-RC4-128\"\n#  define LN_pbe_WithSHA1And128BitRC4     \"pbeWithSHA1And128BitRC4\"\n#  define NID_pbe_WithSHA1And128BitRC4    144\n#  define OBJ_pbe_WithSHA1And128BitRC4    OBJ_pkcs12_pbeids, 1L\n\n#  define SN_pbe_WithSHA1And40BitRC4      \"PBE-SHA1-RC4-40\"\n#  define LN_pbe_WithSHA1And40BitRC4      \"pbeWithSHA1And40BitRC4\"\n#  define NID_pbe_WithSHA1And40BitRC4     145\n#  define OBJ_pbe_WithSHA1And40BitRC4     OBJ_pkcs12_pbeids, 2L\n\n#  define SN_pbe_WithSHA1And3_Key_TripleDES_CBC   \"PBE-SHA1-3DES\"\n#  define LN_pbe_WithSHA1And3_Key_TripleDES_CBC   \"pbeWithSHA1And3-KeyTripleDES-CBC\"\n#  define NID_pbe_WithSHA1And3_Key_TripleDES_CBC  146\n#  define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC  OBJ_pkcs12_pbeids, 3L\n\n#  define SN_pbe_WithSHA1And2_Key_TripleDES_CBC   \"PBE-SHA1-2DES\"\n#  define LN_pbe_WithSHA1And2_Key_TripleDES_CBC   \"pbeWithSHA1And2-KeyTripleDES-CBC\"\n#  define NID_pbe_WithSHA1And2_Key_TripleDES_CBC  147\n#  define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC  OBJ_pkcs12_pbeids, 4L\n\n#  define SN_pbe_WithSHA1And128BitRC2_CBC         \"PBE-SHA1-RC2-128\"\n#  define LN_pbe_WithSHA1And128BitRC2_CBC         \"pbeWithSHA1And128BitRC2-CBC\"\n#  define NID_pbe_WithSHA1And128BitRC2_CBC        148\n#  define OBJ_pbe_WithSHA1And128BitRC2_CBC        OBJ_pkcs12_pbeids, 5L\n\n#  define SN_pbe_WithSHA1And40BitRC2_CBC  \"PBE-SHA1-RC2-40\"\n#  define LN_pbe_WithSHA1And40BitRC2_CBC  \"pbeWithSHA1And40BitRC2-CBC\"\n#  define NID_pbe_WithSHA1And40BitRC2_CBC 149\n#  define OBJ_pbe_WithSHA1And40BitRC2_CBC OBJ_pkcs12_pbeids, 6L\n\n#  define OBJ_pkcs12_Version1     OBJ_pkcs12, 10L\n\n#  define OBJ_pkcs12_BagIds       OBJ_pkcs12_Version1, 1L\n\n#  define LN_keyBag               \"keyBag\"\n#  define NID_keyBag              150\n#  define OBJ_keyBag              OBJ_pkcs12_BagIds, 1L\n\n#  define LN_pkcs8ShroudedKeyBag  \"pkcs8ShroudedKeyBag\"\n#  define NID_pkcs8ShroudedKeyBag 151\n#  define OBJ_pkcs8ShroudedKeyBag OBJ_pkcs12_BagIds, 2L\n\n#  define LN_certBag              \"certBag\"\n#  define NID_certBag             152\n#  define OBJ_certBag             OBJ_pkcs12_BagIds, 3L\n\n#  define LN_crlBag               \"crlBag\"\n#  define NID_crlBag              153\n#  define OBJ_crlBag              OBJ_pkcs12_BagIds, 4L\n\n#  define LN_secretBag            \"secretBag\"\n#  define NID_secretBag           154\n#  define OBJ_secretBag           OBJ_pkcs12_BagIds, 5L\n\n#  define LN_safeContentsBag      \"safeContentsBag\"\n#  define NID_safeContentsBag     155\n#  define OBJ_safeContentsBag     OBJ_pkcs12_BagIds, 6L\n\n#  define LN_friendlyName         \"friendlyName\"\n#  define NID_friendlyName        156\n#  define OBJ_friendlyName        OBJ_pkcs9, 20L\n\n#  define LN_localKeyID           \"localKeyID\"\n#  define NID_localKeyID          157\n#  define OBJ_localKeyID          OBJ_pkcs9, 21L\n\n#  define OBJ_certTypes           OBJ_pkcs9, 22L\n\n#  define LN_x509Certificate      \"x509Certificate\"\n#  define NID_x509Certificate     158\n#  define OBJ_x509Certificate     OBJ_certTypes, 1L\n\n#  define LN_sdsiCertificate      \"sdsiCertificate\"\n#  define NID_sdsiCertificate     159\n#  define OBJ_sdsiCertificate     OBJ_certTypes, 2L\n\n#  define OBJ_crlTypes            OBJ_pkcs9, 23L\n\n#  define LN_x509Crl              \"x509Crl\"\n#  define NID_x509Crl             160\n#  define OBJ_x509Crl             OBJ_crlTypes, 1L\n\n/* PKCS#5 v2 OIDs */\n\n#  define LN_pbes2                \"PBES2\"\n#  define NID_pbes2               161\n#  define OBJ_pbes2               OBJ_pkcs,5L,13L\n\n#  define LN_pbmac1               \"PBMAC1\"\n#  define NID_pbmac1              162\n#  define OBJ_pbmac1              OBJ_pkcs,5L,14L\n\n#  define LN_hmacWithSHA1         \"hmacWithSHA1\"\n#  define NID_hmacWithSHA1        163\n#  define OBJ_hmacWithSHA1        OBJ_rsadsi,2L,7L\n\n/* Policy Qualifier Ids */\n\n#  define LN_id_qt_cps            \"Policy Qualifier CPS\"\n#  define SN_id_qt_cps            \"id-qt-cps\"\n#  define NID_id_qt_cps           164\n#  define OBJ_id_qt_cps           OBJ_id_pkix,2L,1L\n\n#  define LN_id_qt_unotice        \"Policy Qualifier User Notice\"\n#  define SN_id_qt_unotice        \"id-qt-unotice\"\n#  define NID_id_qt_unotice       165\n#  define OBJ_id_qt_unotice       OBJ_id_pkix,2L,2L\n\n#  define SN_rc2_64_cbc                   \"RC2-64-CBC\"\n#  define LN_rc2_64_cbc                   \"rc2-64-cbc\"\n#  define NID_rc2_64_cbc                  166\n\n#  define SN_SMIMECapabilities            \"SMIME-CAPS\"\n#  define LN_SMIMECapabilities            \"S/MIME Capabilities\"\n#  define NID_SMIMECapabilities           167\n#  define OBJ_SMIMECapabilities           OBJ_pkcs9,15L\n\n#  define SN_pbeWithMD2AndRC2_CBC         \"PBE-MD2-RC2-64\"\n#  define LN_pbeWithMD2AndRC2_CBC         \"pbeWithMD2AndRC2-CBC\"\n#  define NID_pbeWithMD2AndRC2_CBC        168\n#  define OBJ_pbeWithMD2AndRC2_CBC        OBJ_pkcs,5L,4L\n\n#  define SN_pbeWithMD5AndRC2_CBC         \"PBE-MD5-RC2-64\"\n#  define LN_pbeWithMD5AndRC2_CBC         \"pbeWithMD5AndRC2-CBC\"\n#  define NID_pbeWithMD5AndRC2_CBC        169\n#  define OBJ_pbeWithMD5AndRC2_CBC        OBJ_pkcs,5L,6L\n\n#  define SN_pbeWithSHA1AndDES_CBC        \"PBE-SHA1-DES\"\n#  define LN_pbeWithSHA1AndDES_CBC        \"pbeWithSHA1AndDES-CBC\"\n#  define NID_pbeWithSHA1AndDES_CBC       170\n#  define OBJ_pbeWithSHA1AndDES_CBC       OBJ_pkcs,5L,10L\n\n/* Extension request OIDs */\n\n#  define LN_ms_ext_req                   \"Microsoft Extension Request\"\n#  define SN_ms_ext_req                   \"msExtReq\"\n#  define NID_ms_ext_req                  171\n#  define OBJ_ms_ext_req                  1L,3L,6L,1L,4L,1L,311L,2L,1L,14L\n\n#  define LN_ext_req                      \"Extension Request\"\n#  define SN_ext_req                      \"extReq\"\n#  define NID_ext_req                     172\n#  define OBJ_ext_req                     OBJ_pkcs9,14L\n\n#  define SN_name                         \"name\"\n#  define LN_name                         \"name\"\n#  define NID_name                        173\n#  define OBJ_name                        OBJ_X509,41L\n\n#  define SN_dnQualifier                  \"dnQualifier\"\n#  define LN_dnQualifier                  \"dnQualifier\"\n#  define NID_dnQualifier                 174\n#  define OBJ_dnQualifier                 OBJ_X509,46L\n\n#  define SN_id_pe                        \"id-pe\"\n#  define NID_id_pe                       175\n#  define OBJ_id_pe                       OBJ_id_pkix,1L\n\n#  define SN_id_ad                        \"id-ad\"\n#  define NID_id_ad                       176\n#  define OBJ_id_ad                       OBJ_id_pkix,48L\n\n#  define SN_info_access                  \"authorityInfoAccess\"\n#  define LN_info_access                  \"Authority Information Access\"\n#  define NID_info_access                 177\n#  define OBJ_info_access                 OBJ_id_pe,1L\n\n#  define SN_ad_OCSP                      \"OCSP\"\n#  define LN_ad_OCSP                      \"OCSP\"\n#  define NID_ad_OCSP                     178\n#  define OBJ_ad_OCSP                     OBJ_id_ad,1L\n\n#  define SN_ad_ca_issuers                \"caIssuers\"\n#  define LN_ad_ca_issuers                \"CA Issuers\"\n#  define NID_ad_ca_issuers               179\n#  define OBJ_ad_ca_issuers               OBJ_id_ad,2L\n\n#  define SN_OCSP_sign                    \"OCSPSigning\"\n#  define LN_OCSP_sign                    \"OCSP Signing\"\n#  define NID_OCSP_sign                   180\n#  define OBJ_OCSP_sign                   OBJ_id_kp,9L\n# endif                         /* USE_OBJ_MAC */\n\n# include <openssl/bio.h>\n# include <openssl/asn1.h>\n\n# define OBJ_NAME_TYPE_UNDEF             0x00\n# define OBJ_NAME_TYPE_MD_METH           0x01\n# define OBJ_NAME_TYPE_CIPHER_METH       0x02\n# define OBJ_NAME_TYPE_PKEY_METH         0x03\n# define OBJ_NAME_TYPE_COMP_METH         0x04\n# define OBJ_NAME_TYPE_NUM               0x05\n\n# define OBJ_NAME_ALIAS                  0x8000\n\n# define OBJ_BSEARCH_VALUE_ON_NOMATCH            0x01\n# define OBJ_BSEARCH_FIRST_VALUE_ON_MATCH        0x02\n\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct obj_name_st {\n    int type;\n    int alias;\n    const char *name;\n    const char *data;\n} OBJ_NAME;\n\n# define         OBJ_create_and_add_object(a,b,c) OBJ_create(a,b,c)\n\nint OBJ_NAME_init(void);\nint OBJ_NAME_new_index(unsigned long (*hash_func) (const char *),\n                       int (*cmp_func) (const char *, const char *),\n                       void (*free_func) (const char *, int, const char *));\nconst char *OBJ_NAME_get(const char *name, int type);\nint OBJ_NAME_add(const char *name, int type, const char *data);\nint OBJ_NAME_remove(const char *name, int type);\nvoid OBJ_NAME_cleanup(int type); /* -1 for everything */\nvoid OBJ_NAME_do_all(int type, void (*fn) (const OBJ_NAME *, void *arg),\n                     void *arg);\nvoid OBJ_NAME_do_all_sorted(int type,\n                            void (*fn) (const OBJ_NAME *, void *arg),\n                            void *arg);\n\nASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o);\nASN1_OBJECT *OBJ_nid2obj(int n);\nconst char *OBJ_nid2ln(int n);\nconst char *OBJ_nid2sn(int n);\nint OBJ_obj2nid(const ASN1_OBJECT *o);\nASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name);\nint OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name);\nint OBJ_txt2nid(const char *s);\nint OBJ_ln2nid(const char *s);\nint OBJ_sn2nid(const char *s);\nint OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b);\nconst void *OBJ_bsearch_(const void *key, const void *base, int num, int size,\n                         int (*cmp) (const void *, const void *));\nconst void *OBJ_bsearch_ex_(const void *key, const void *base, int num,\n                            int size,\n                            int (*cmp) (const void *, const void *),\n                            int flags);\n\n# define _DECLARE_OBJ_BSEARCH_CMP_FN(scope, type1, type2, nm)    \\\n  static int nm##_cmp_BSEARCH_CMP_FN(const void *, const void *); \\\n  static int nm##_cmp(type1 const *, type2 const *); \\\n  scope type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)\n\n# define DECLARE_OBJ_BSEARCH_CMP_FN(type1, type2, cmp)   \\\n  _DECLARE_OBJ_BSEARCH_CMP_FN(static, type1, type2, cmp)\n# define DECLARE_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm)     \\\n  type2 * OBJ_bsearch_##nm(type1 *key, type2 const *base, int num)\n\n/*-\n * Unsolved problem: if a type is actually a pointer type, like\n * nid_triple is, then its impossible to get a const where you need\n * it. Consider:\n *\n * typedef int nid_triple[3];\n * const void *a_;\n * const nid_triple const *a = a_;\n *\n * The assignement discards a const because what you really want is:\n *\n * const int const * const *a = a_;\n *\n * But if you do that, you lose the fact that a is an array of 3 ints,\n * which breaks comparison functions.\n *\n * Thus we end up having to cast, sadly, or unpack the\n * declarations. Or, as I finally did in this case, delcare nid_triple\n * to be a struct, which it should have been in the first place.\n *\n * Ben, August 2008.\n *\n * Also, strictly speaking not all types need be const, but handling\n * the non-constness means a lot of complication, and in practice\n * comparison routines do always not touch their arguments.\n */\n\n# define IMPLEMENT_OBJ_BSEARCH_CMP_FN(type1, type2, nm)  \\\n  static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_)    \\\n      { \\\n      type1 const *a = a_; \\\n      type2 const *b = b_; \\\n      return nm##_cmp(a,b); \\\n      } \\\n  static type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \\\n      { \\\n      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \\\n                                        nm##_cmp_BSEARCH_CMP_FN); \\\n      } \\\n      extern void dummy_prototype(void)\n\n# define IMPLEMENT_OBJ_BSEARCH_GLOBAL_CMP_FN(type1, type2, nm)   \\\n  static int nm##_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_)    \\\n      { \\\n      type1 const *a = a_; \\\n      type2 const *b = b_; \\\n      return nm##_cmp(a,b); \\\n      } \\\n  type2 *OBJ_bsearch_##nm(type1 *key, type2 const *base, int num) \\\n      { \\\n      return (type2 *)OBJ_bsearch_(key, base, num, sizeof(type2), \\\n                                        nm##_cmp_BSEARCH_CMP_FN); \\\n      } \\\n      extern void dummy_prototype(void)\n\n# define OBJ_bsearch(type1,key,type2,base,num,cmp)                              \\\n  ((type2 *)OBJ_bsearch_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \\\n                         num,sizeof(type2),                             \\\n                         ((void)CHECKED_PTR_OF(type1,cmp##_type_1),     \\\n                          (void)CHECKED_PTR_OF(type2,cmp##_type_2),     \\\n                          cmp##_BSEARCH_CMP_FN)))\n\n# define OBJ_bsearch_ex(type1,key,type2,base,num,cmp,flags)                      \\\n  ((type2 *)OBJ_bsearch_ex_(CHECKED_PTR_OF(type1,key),CHECKED_PTR_OF(type2,base), \\\n                         num,sizeof(type2),                             \\\n                         ((void)CHECKED_PTR_OF(type1,cmp##_type_1),     \\\n                          (void)type_2=CHECKED_PTR_OF(type2,cmp##_type_2), \\\n                          cmp##_BSEARCH_CMP_FN)),flags)\n\nint OBJ_new_nid(int num);\nint OBJ_add_object(const ASN1_OBJECT *obj);\nint OBJ_create(const char *oid, const char *sn, const char *ln);\nvoid OBJ_cleanup(void);\nint OBJ_create_objects(BIO *in);\n\nint OBJ_find_sigid_algs(int signid, int *pdig_nid, int *ppkey_nid);\nint OBJ_find_sigid_by_algs(int *psignid, int dig_nid, int pkey_nid);\nint OBJ_add_sigid(int signid, int dig_id, int pkey_id);\nvoid OBJ_sigid_free(void);\n\nextern int obj_cleanup_defer;\nvoid check_defer(int nid);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_OBJ_strings(void);\n\n/* Error codes for the OBJ functions. */\n\n/* Function codes. */\n# define OBJ_F_OBJ_ADD_OBJECT                             105\n# define OBJ_F_OBJ_CREATE                                 100\n# define OBJ_F_OBJ_DUP                                    101\n# define OBJ_F_OBJ_NAME_NEW_INDEX                         106\n# define OBJ_F_OBJ_NID2LN                                 102\n# define OBJ_F_OBJ_NID2OBJ                                103\n# define OBJ_F_OBJ_NID2SN                                 104\n\n/* Reason codes. */\n# define OBJ_R_MALLOC_FAILURE                             100\n# define OBJ_R_UNKNOWN_NID                                101\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/ocsp.h",
    "content": "/* ocsp.h */\n/*\n * Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL\n * project.\n */\n\n/*\n * History: This file was transfered to Richard Levitte from CertCo by Kathy\n * Weinhold in mid-spring 2000 to be included in OpenSSL or released as a\n * patch kit.\n */\n\n/* ====================================================================\n * Copyright (c) 1998-2000 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_OCSP_H\n# define HEADER_OCSP_H\n\n# include <openssl/ossl_typ.h>\n# include <openssl/x509.h>\n# include <openssl/x509v3.h>\n# include <openssl/safestack.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* Various flags and values */\n\n# define OCSP_DEFAULT_NONCE_LENGTH       16\n\n# define OCSP_NOCERTS                    0x1\n# define OCSP_NOINTERN                   0x2\n# define OCSP_NOSIGS                     0x4\n# define OCSP_NOCHAIN                    0x8\n# define OCSP_NOVERIFY                   0x10\n# define OCSP_NOEXPLICIT                 0x20\n# define OCSP_NOCASIGN                   0x40\n# define OCSP_NODELEGATED                0x80\n# define OCSP_NOCHECKS                   0x100\n# define OCSP_TRUSTOTHER                 0x200\n# define OCSP_RESPID_KEY                 0x400\n# define OCSP_NOTIME                     0x800\n\n/*-  CertID ::= SEQUENCE {\n *       hashAlgorithm            AlgorithmIdentifier,\n *       issuerNameHash     OCTET STRING, -- Hash of Issuer's DN\n *       issuerKeyHash      OCTET STRING, -- Hash of Issuers public key (excluding the tag & length fields)\n *       serialNumber       CertificateSerialNumber }\n */\ntypedef struct ocsp_cert_id_st {\n    X509_ALGOR *hashAlgorithm;\n    ASN1_OCTET_STRING *issuerNameHash;\n    ASN1_OCTET_STRING *issuerKeyHash;\n    ASN1_INTEGER *serialNumber;\n} OCSP_CERTID;\n\nDECLARE_STACK_OF(OCSP_CERTID)\n\n/*-  Request ::=     SEQUENCE {\n *       reqCert                    CertID,\n *       singleRequestExtensions    [0] EXPLICIT Extensions OPTIONAL }\n */\ntypedef struct ocsp_one_request_st {\n    OCSP_CERTID *reqCert;\n    STACK_OF(X509_EXTENSION) *singleRequestExtensions;\n} OCSP_ONEREQ;\n\nDECLARE_STACK_OF(OCSP_ONEREQ)\nDECLARE_ASN1_SET_OF(OCSP_ONEREQ)\n\n/*-  TBSRequest      ::=     SEQUENCE {\n *       version             [0] EXPLICIT Version DEFAULT v1,\n *       requestorName       [1] EXPLICIT GeneralName OPTIONAL,\n *       requestList             SEQUENCE OF Request,\n *       requestExtensions   [2] EXPLICIT Extensions OPTIONAL }\n */\ntypedef struct ocsp_req_info_st {\n    ASN1_INTEGER *version;\n    GENERAL_NAME *requestorName;\n    STACK_OF(OCSP_ONEREQ) *requestList;\n    STACK_OF(X509_EXTENSION) *requestExtensions;\n} OCSP_REQINFO;\n\n/*-  Signature       ::=     SEQUENCE {\n *       signatureAlgorithm   AlgorithmIdentifier,\n *       signature            BIT STRING,\n *       certs                [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }\n */\ntypedef struct ocsp_signature_st {\n    X509_ALGOR *signatureAlgorithm;\n    ASN1_BIT_STRING *signature;\n    STACK_OF(X509) *certs;\n} OCSP_SIGNATURE;\n\n/*-  OCSPRequest     ::=     SEQUENCE {\n *       tbsRequest                  TBSRequest,\n *       optionalSignature   [0]     EXPLICIT Signature OPTIONAL }\n */\ntypedef struct ocsp_request_st {\n    OCSP_REQINFO *tbsRequest;\n    OCSP_SIGNATURE *optionalSignature; /* OPTIONAL */\n} OCSP_REQUEST;\n\n/*-  OCSPResponseStatus ::= ENUMERATED {\n *       successful            (0),      --Response has valid confirmations\n *       malformedRequest      (1),      --Illegal confirmation request\n *       internalError         (2),      --Internal error in issuer\n *       tryLater              (3),      --Try again later\n *                                       --(4) is not used\n *       sigRequired           (5),      --Must sign the request\n *       unauthorized          (6)       --Request unauthorized\n *   }\n */\n# define OCSP_RESPONSE_STATUS_SUCCESSFUL          0\n# define OCSP_RESPONSE_STATUS_MALFORMEDREQUEST     1\n# define OCSP_RESPONSE_STATUS_INTERNALERROR        2\n# define OCSP_RESPONSE_STATUS_TRYLATER             3\n# define OCSP_RESPONSE_STATUS_SIGREQUIRED          5\n# define OCSP_RESPONSE_STATUS_UNAUTHORIZED         6\n\n/*-  ResponseBytes ::=       SEQUENCE {\n *       responseType   OBJECT IDENTIFIER,\n *       response       OCTET STRING }\n */\ntypedef struct ocsp_resp_bytes_st {\n    ASN1_OBJECT *responseType;\n    ASN1_OCTET_STRING *response;\n} OCSP_RESPBYTES;\n\n/*-  OCSPResponse ::= SEQUENCE {\n *      responseStatus         OCSPResponseStatus,\n *      responseBytes          [0] EXPLICIT ResponseBytes OPTIONAL }\n */\nstruct ocsp_response_st {\n    ASN1_ENUMERATED *responseStatus;\n    OCSP_RESPBYTES *responseBytes;\n};\n\n/*-  ResponderID ::= CHOICE {\n *      byName   [1] Name,\n *      byKey    [2] KeyHash }\n */\n# define V_OCSP_RESPID_NAME 0\n# define V_OCSP_RESPID_KEY  1\nstruct ocsp_responder_id_st {\n    int type;\n    union {\n        X509_NAME *byName;\n        ASN1_OCTET_STRING *byKey;\n    } value;\n};\n\nDECLARE_STACK_OF(OCSP_RESPID)\nDECLARE_ASN1_FUNCTIONS(OCSP_RESPID)\n\n/*-  KeyHash ::= OCTET STRING --SHA-1 hash of responder's public key\n *                            --(excluding the tag and length fields)\n */\n\n/*-  RevokedInfo ::= SEQUENCE {\n *       revocationTime              GeneralizedTime,\n *       revocationReason    [0]     EXPLICIT CRLReason OPTIONAL }\n */\ntypedef struct ocsp_revoked_info_st {\n    ASN1_GENERALIZEDTIME *revocationTime;\n    ASN1_ENUMERATED *revocationReason;\n} OCSP_REVOKEDINFO;\n\n/*-  CertStatus ::= CHOICE {\n *       good                [0]     IMPLICIT NULL,\n *       revoked             [1]     IMPLICIT RevokedInfo,\n *       unknown             [2]     IMPLICIT UnknownInfo }\n */\n# define V_OCSP_CERTSTATUS_GOOD    0\n# define V_OCSP_CERTSTATUS_REVOKED 1\n# define V_OCSP_CERTSTATUS_UNKNOWN 2\ntypedef struct ocsp_cert_status_st {\n    int type;\n    union {\n        ASN1_NULL *good;\n        OCSP_REVOKEDINFO *revoked;\n        ASN1_NULL *unknown;\n    } value;\n} OCSP_CERTSTATUS;\n\n/*-  SingleResponse ::= SEQUENCE {\n *      certID                       CertID,\n *      certStatus                   CertStatus,\n *      thisUpdate                   GeneralizedTime,\n *      nextUpdate           [0]     EXPLICIT GeneralizedTime OPTIONAL,\n *      singleExtensions     [1]     EXPLICIT Extensions OPTIONAL }\n */\ntypedef struct ocsp_single_response_st {\n    OCSP_CERTID *certId;\n    OCSP_CERTSTATUS *certStatus;\n    ASN1_GENERALIZEDTIME *thisUpdate;\n    ASN1_GENERALIZEDTIME *nextUpdate;\n    STACK_OF(X509_EXTENSION) *singleExtensions;\n} OCSP_SINGLERESP;\n\nDECLARE_STACK_OF(OCSP_SINGLERESP)\nDECLARE_ASN1_SET_OF(OCSP_SINGLERESP)\n\n/*-  ResponseData ::= SEQUENCE {\n *      version              [0] EXPLICIT Version DEFAULT v1,\n *      responderID              ResponderID,\n *      producedAt               GeneralizedTime,\n *      responses                SEQUENCE OF SingleResponse,\n *      responseExtensions   [1] EXPLICIT Extensions OPTIONAL }\n */\ntypedef struct ocsp_response_data_st {\n    ASN1_INTEGER *version;\n    OCSP_RESPID *responderId;\n    ASN1_GENERALIZEDTIME *producedAt;\n    STACK_OF(OCSP_SINGLERESP) *responses;\n    STACK_OF(X509_EXTENSION) *responseExtensions;\n} OCSP_RESPDATA;\n\n/*-  BasicOCSPResponse       ::= SEQUENCE {\n *      tbsResponseData      ResponseData,\n *      signatureAlgorithm   AlgorithmIdentifier,\n *      signature            BIT STRING,\n *      certs                [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }\n */\n  /*\n   * Note 1: The value for \"signature\" is specified in the OCSP rfc2560 as\n   * follows: \"The value for the signature SHALL be computed on the hash of\n   * the DER encoding ResponseData.\" This means that you must hash the\n   * DER-encoded tbsResponseData, and then run it through a crypto-signing\n   * function, which will (at least w/RSA) do a hash-'n'-private-encrypt\n   * operation.  This seems a bit odd, but that's the spec.  Also note that\n   * the data structures do not leave anywhere to independently specify the\n   * algorithm used for the initial hash. So, we look at the\n   * signature-specification algorithm, and try to do something intelligent.\n   * -- Kathy Weinhold, CertCo\n   */\n  /*\n   * Note 2: It seems that the mentioned passage from RFC 2560 (section\n   * 4.2.1) is open for interpretation.  I've done tests against another\n   * responder, and found that it doesn't do the double hashing that the RFC\n   * seems to say one should.  Therefore, all relevant functions take a flag\n   * saying which variant should be used.  -- Richard Levitte, OpenSSL team\n   * and CeloCom\n   */\ntypedef struct ocsp_basic_response_st {\n    OCSP_RESPDATA *tbsResponseData;\n    X509_ALGOR *signatureAlgorithm;\n    ASN1_BIT_STRING *signature;\n    STACK_OF(X509) *certs;\n} OCSP_BASICRESP;\n\n/*-\n *   CRLReason ::= ENUMERATED {\n *        unspecified             (0),\n *        keyCompromise           (1),\n *        cACompromise            (2),\n *        affiliationChanged      (3),\n *        superseded              (4),\n *        cessationOfOperation    (5),\n *        certificateHold         (6),\n *        removeFromCRL           (8) }\n */\n# define OCSP_REVOKED_STATUS_NOSTATUS               -1\n# define OCSP_REVOKED_STATUS_UNSPECIFIED             0\n# define OCSP_REVOKED_STATUS_KEYCOMPROMISE           1\n# define OCSP_REVOKED_STATUS_CACOMPROMISE            2\n# define OCSP_REVOKED_STATUS_AFFILIATIONCHANGED      3\n# define OCSP_REVOKED_STATUS_SUPERSEDED              4\n# define OCSP_REVOKED_STATUS_CESSATIONOFOPERATION    5\n# define OCSP_REVOKED_STATUS_CERTIFICATEHOLD         6\n# define OCSP_REVOKED_STATUS_REMOVEFROMCRL           8\n\n/*-\n * CrlID ::= SEQUENCE {\n *     crlUrl               [0]     EXPLICIT IA5String OPTIONAL,\n *     crlNum               [1]     EXPLICIT INTEGER OPTIONAL,\n *     crlTime              [2]     EXPLICIT GeneralizedTime OPTIONAL }\n */\ntypedef struct ocsp_crl_id_st {\n    ASN1_IA5STRING *crlUrl;\n    ASN1_INTEGER *crlNum;\n    ASN1_GENERALIZEDTIME *crlTime;\n} OCSP_CRLID;\n\n/*-\n * ServiceLocator ::= SEQUENCE {\n *      issuer    Name,\n *      locator   AuthorityInfoAccessSyntax OPTIONAL }\n */\ntypedef struct ocsp_service_locator_st {\n    X509_NAME *issuer;\n    STACK_OF(ACCESS_DESCRIPTION) *locator;\n} OCSP_SERVICELOC;\n\n# define PEM_STRING_OCSP_REQUEST \"OCSP REQUEST\"\n# define PEM_STRING_OCSP_RESPONSE \"OCSP RESPONSE\"\n\n# define d2i_OCSP_REQUEST_bio(bp,p) ASN1_d2i_bio_of(OCSP_REQUEST,OCSP_REQUEST_new,d2i_OCSP_REQUEST,bp,p)\n\n# define d2i_OCSP_RESPONSE_bio(bp,p) ASN1_d2i_bio_of(OCSP_RESPONSE,OCSP_RESPONSE_new,d2i_OCSP_RESPONSE,bp,p)\n\n# define PEM_read_bio_OCSP_REQUEST(bp,x,cb) (OCSP_REQUEST *)PEM_ASN1_read_bio( \\\n     (char *(*)())d2i_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,bp,(char **)x,cb,NULL)\n\n# define PEM_read_bio_OCSP_RESPONSE(bp,x,cb)(OCSP_RESPONSE *)PEM_ASN1_read_bio(\\\n     (char *(*)())d2i_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,bp,(char **)x,cb,NULL)\n\n# define PEM_write_bio_OCSP_REQUEST(bp,o) \\\n    PEM_ASN1_write_bio((int (*)())i2d_OCSP_REQUEST,PEM_STRING_OCSP_REQUEST,\\\n                        bp,(char *)o, NULL,NULL,0,NULL,NULL)\n\n# define PEM_write_bio_OCSP_RESPONSE(bp,o) \\\n    PEM_ASN1_write_bio((int (*)())i2d_OCSP_RESPONSE,PEM_STRING_OCSP_RESPONSE,\\\n                        bp,(char *)o, NULL,NULL,0,NULL,NULL)\n\n# define i2d_OCSP_RESPONSE_bio(bp,o) ASN1_i2d_bio_of(OCSP_RESPONSE,i2d_OCSP_RESPONSE,bp,o)\n\n# define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o)\n\n# define OCSP_REQUEST_sign(o,pkey,md) \\\n        ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\\\n                o->optionalSignature->signatureAlgorithm,NULL,\\\n                o->optionalSignature->signature,o->tbsRequest,pkey,md)\n\n# define OCSP_BASICRESP_sign(o,pkey,md,d) \\\n        ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),o->signatureAlgorithm,NULL,\\\n                o->signature,o->tbsResponseData,pkey,md)\n\n# define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\\\n        a->optionalSignature->signatureAlgorithm,\\\n        a->optionalSignature->signature,a->tbsRequest,r)\n\n# define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\\\n        a->signatureAlgorithm,a->signature,a->tbsResponseData,r)\n\n# define ASN1_BIT_STRING_digest(data,type,md,len) \\\n        ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len)\n\n# define OCSP_CERTSTATUS_dup(cs)\\\n                (OCSP_CERTSTATUS*)ASN1_dup((int(*)())i2d_OCSP_CERTSTATUS,\\\n                (char *(*)())d2i_OCSP_CERTSTATUS,(char *)(cs))\n\nOCSP_CERTID *OCSP_CERTID_dup(OCSP_CERTID *id);\n\nOCSP_RESPONSE *OCSP_sendreq_bio(BIO *b, const char *path, OCSP_REQUEST *req);\nOCSP_REQ_CTX *OCSP_sendreq_new(BIO *io, const char *path, OCSP_REQUEST *req,\n                               int maxline);\nint OCSP_REQ_CTX_nbio(OCSP_REQ_CTX *rctx);\nint OCSP_sendreq_nbio(OCSP_RESPONSE **presp, OCSP_REQ_CTX *rctx);\nOCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline);\nvoid OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx);\nvoid OCSP_set_max_response_length(OCSP_REQ_CTX *rctx, unsigned long len);\nint OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,\n                     ASN1_VALUE *val);\nint OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval,\n                          const ASN1_ITEM *it);\nBIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx);\nint OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it,\n                     ASN1_VALUE *val);\nint OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path);\nint OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req);\nint OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx,\n                             const char *name, const char *value);\n\nOCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst, X509 *subject, X509 *issuer);\n\nOCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,\n                              X509_NAME *issuerName,\n                              ASN1_BIT_STRING *issuerKey,\n                              ASN1_INTEGER *serialNumber);\n\nOCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid);\n\nint OCSP_request_add1_nonce(OCSP_REQUEST *req, unsigned char *val, int len);\nint OCSP_basic_add1_nonce(OCSP_BASICRESP *resp, unsigned char *val, int len);\nint OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs);\nint OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req);\n\nint OCSP_request_set1_name(OCSP_REQUEST *req, X509_NAME *nm);\nint OCSP_request_add1_cert(OCSP_REQUEST *req, X509 *cert);\n\nint OCSP_request_sign(OCSP_REQUEST *req,\n                      X509 *signer,\n                      EVP_PKEY *key,\n                      const EVP_MD *dgst,\n                      STACK_OF(X509) *certs, unsigned long flags);\n\nint OCSP_response_status(OCSP_RESPONSE *resp);\nOCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp);\n\nint OCSP_resp_count(OCSP_BASICRESP *bs);\nOCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx);\nint OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last);\nint OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason,\n                            ASN1_GENERALIZEDTIME **revtime,\n                            ASN1_GENERALIZEDTIME **thisupd,\n                            ASN1_GENERALIZEDTIME **nextupd);\nint OCSP_resp_find_status(OCSP_BASICRESP *bs, OCSP_CERTID *id, int *status,\n                          int *reason,\n                          ASN1_GENERALIZEDTIME **revtime,\n                          ASN1_GENERALIZEDTIME **thisupd,\n                          ASN1_GENERALIZEDTIME **nextupd);\nint OCSP_check_validity(ASN1_GENERALIZEDTIME *thisupd,\n                        ASN1_GENERALIZEDTIME *nextupd, long sec, long maxsec);\n\nint OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,\n                        X509_STORE *store, unsigned long flags);\n\nint OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath,\n                   int *pssl);\n\nint OCSP_id_issuer_cmp(OCSP_CERTID *a, OCSP_CERTID *b);\nint OCSP_id_cmp(OCSP_CERTID *a, OCSP_CERTID *b);\n\nint OCSP_request_onereq_count(OCSP_REQUEST *req);\nOCSP_ONEREQ *OCSP_request_onereq_get0(OCSP_REQUEST *req, int i);\nOCSP_CERTID *OCSP_onereq_get0_id(OCSP_ONEREQ *one);\nint OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,\n                      ASN1_OCTET_STRING **pikeyHash,\n                      ASN1_INTEGER **pserial, OCSP_CERTID *cid);\nint OCSP_request_is_signed(OCSP_REQUEST *req);\nOCSP_RESPONSE *OCSP_response_create(int status, OCSP_BASICRESP *bs);\nOCSP_SINGLERESP *OCSP_basic_add1_status(OCSP_BASICRESP *rsp,\n                                        OCSP_CERTID *cid,\n                                        int status, int reason,\n                                        ASN1_TIME *revtime,\n                                        ASN1_TIME *thisupd,\n                                        ASN1_TIME *nextupd);\nint OCSP_basic_add1_cert(OCSP_BASICRESP *resp, X509 *cert);\nint OCSP_basic_sign(OCSP_BASICRESP *brsp,\n                    X509 *signer, EVP_PKEY *key, const EVP_MD *dgst,\n                    STACK_OF(X509) *certs, unsigned long flags);\n\nX509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim);\n\nX509_EXTENSION *OCSP_accept_responses_new(char **oids);\n\nX509_EXTENSION *OCSP_archive_cutoff_new(char *tim);\n\nX509_EXTENSION *OCSP_url_svcloc_new(X509_NAME *issuer, char **urls);\n\nint OCSP_REQUEST_get_ext_count(OCSP_REQUEST *x);\nint OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos);\nint OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj,\n                                int lastpos);\nint OCSP_REQUEST_get_ext_by_critical(OCSP_REQUEST *x, int crit, int lastpos);\nX509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc);\nX509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc);\nvoid *OCSP_REQUEST_get1_ext_d2i(OCSP_REQUEST *x, int nid, int *crit,\n                                int *idx);\nint OCSP_REQUEST_add1_ext_i2d(OCSP_REQUEST *x, int nid, void *value, int crit,\n                              unsigned long flags);\nint OCSP_REQUEST_add_ext(OCSP_REQUEST *x, X509_EXTENSION *ex, int loc);\n\nint OCSP_ONEREQ_get_ext_count(OCSP_ONEREQ *x);\nint OCSP_ONEREQ_get_ext_by_NID(OCSP_ONEREQ *x, int nid, int lastpos);\nint OCSP_ONEREQ_get_ext_by_OBJ(OCSP_ONEREQ *x, ASN1_OBJECT *obj, int lastpos);\nint OCSP_ONEREQ_get_ext_by_critical(OCSP_ONEREQ *x, int crit, int lastpos);\nX509_EXTENSION *OCSP_ONEREQ_get_ext(OCSP_ONEREQ *x, int loc);\nX509_EXTENSION *OCSP_ONEREQ_delete_ext(OCSP_ONEREQ *x, int loc);\nvoid *OCSP_ONEREQ_get1_ext_d2i(OCSP_ONEREQ *x, int nid, int *crit, int *idx);\nint OCSP_ONEREQ_add1_ext_i2d(OCSP_ONEREQ *x, int nid, void *value, int crit,\n                             unsigned long flags);\nint OCSP_ONEREQ_add_ext(OCSP_ONEREQ *x, X509_EXTENSION *ex, int loc);\n\nint OCSP_BASICRESP_get_ext_count(OCSP_BASICRESP *x);\nint OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos);\nint OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj,\n                                  int lastpos);\nint OCSP_BASICRESP_get_ext_by_critical(OCSP_BASICRESP *x, int crit,\n                                       int lastpos);\nX509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc);\nX509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc);\nvoid *OCSP_BASICRESP_get1_ext_d2i(OCSP_BASICRESP *x, int nid, int *crit,\n                                  int *idx);\nint OCSP_BASICRESP_add1_ext_i2d(OCSP_BASICRESP *x, int nid, void *value,\n                                int crit, unsigned long flags);\nint OCSP_BASICRESP_add_ext(OCSP_BASICRESP *x, X509_EXTENSION *ex, int loc);\n\nint OCSP_SINGLERESP_get_ext_count(OCSP_SINGLERESP *x);\nint OCSP_SINGLERESP_get_ext_by_NID(OCSP_SINGLERESP *x, int nid, int lastpos);\nint OCSP_SINGLERESP_get_ext_by_OBJ(OCSP_SINGLERESP *x, ASN1_OBJECT *obj,\n                                   int lastpos);\nint OCSP_SINGLERESP_get_ext_by_critical(OCSP_SINGLERESP *x, int crit,\n                                        int lastpos);\nX509_EXTENSION *OCSP_SINGLERESP_get_ext(OCSP_SINGLERESP *x, int loc);\nX509_EXTENSION *OCSP_SINGLERESP_delete_ext(OCSP_SINGLERESP *x, int loc);\nvoid *OCSP_SINGLERESP_get1_ext_d2i(OCSP_SINGLERESP *x, int nid, int *crit,\n                                   int *idx);\nint OCSP_SINGLERESP_add1_ext_i2d(OCSP_SINGLERESP *x, int nid, void *value,\n                                 int crit, unsigned long flags);\nint OCSP_SINGLERESP_add_ext(OCSP_SINGLERESP *x, X509_EXTENSION *ex, int loc);\n\nDECLARE_ASN1_FUNCTIONS(OCSP_SINGLERESP)\nDECLARE_ASN1_FUNCTIONS(OCSP_CERTSTATUS)\nDECLARE_ASN1_FUNCTIONS(OCSP_REVOKEDINFO)\nDECLARE_ASN1_FUNCTIONS(OCSP_BASICRESP)\nDECLARE_ASN1_FUNCTIONS(OCSP_RESPDATA)\nDECLARE_ASN1_FUNCTIONS(OCSP_RESPID)\nDECLARE_ASN1_FUNCTIONS(OCSP_RESPONSE)\nDECLARE_ASN1_FUNCTIONS(OCSP_RESPBYTES)\nDECLARE_ASN1_FUNCTIONS(OCSP_ONEREQ)\nDECLARE_ASN1_FUNCTIONS(OCSP_CERTID)\nDECLARE_ASN1_FUNCTIONS(OCSP_REQUEST)\nDECLARE_ASN1_FUNCTIONS(OCSP_SIGNATURE)\nDECLARE_ASN1_FUNCTIONS(OCSP_REQINFO)\nDECLARE_ASN1_FUNCTIONS(OCSP_CRLID)\nDECLARE_ASN1_FUNCTIONS(OCSP_SERVICELOC)\n\nconst char *OCSP_response_status_str(long s);\nconst char *OCSP_cert_status_str(long s);\nconst char *OCSP_crl_reason_str(long s);\n\nint OCSP_REQUEST_print(BIO *bp, OCSP_REQUEST *a, unsigned long flags);\nint OCSP_RESPONSE_print(BIO *bp, OCSP_RESPONSE *o, unsigned long flags);\n\nint OCSP_basic_verify(OCSP_BASICRESP *bs, STACK_OF(X509) *certs,\n                      X509_STORE *st, unsigned long flags);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_OCSP_strings(void);\n\n/* Error codes for the OCSP functions. */\n\n/* Function codes. */\n# define OCSP_F_ASN1_STRING_ENCODE                        100\n# define OCSP_F_D2I_OCSP_NONCE                            102\n# define OCSP_F_OCSP_BASIC_ADD1_STATUS                    103\n# define OCSP_F_OCSP_BASIC_SIGN                           104\n# define OCSP_F_OCSP_BASIC_VERIFY                         105\n# define OCSP_F_OCSP_CERT_ID_NEW                          101\n# define OCSP_F_OCSP_CHECK_DELEGATED                      106\n# define OCSP_F_OCSP_CHECK_IDS                            107\n# define OCSP_F_OCSP_CHECK_ISSUER                         108\n# define OCSP_F_OCSP_CHECK_VALIDITY                       115\n# define OCSP_F_OCSP_MATCH_ISSUERID                       109\n# define OCSP_F_OCSP_PARSE_URL                            114\n# define OCSP_F_OCSP_REQUEST_SIGN                         110\n# define OCSP_F_OCSP_REQUEST_VERIFY                       116\n# define OCSP_F_OCSP_RESPONSE_GET1_BASIC                  111\n# define OCSP_F_OCSP_SENDREQ_BIO                          112\n# define OCSP_F_OCSP_SENDREQ_NBIO                         117\n# define OCSP_F_PARSE_HTTP_LINE1                          118\n# define OCSP_F_REQUEST_VERIFY                            113\n\n/* Reason codes. */\n# define OCSP_R_BAD_DATA                                  100\n# define OCSP_R_CERTIFICATE_VERIFY_ERROR                  101\n# define OCSP_R_DIGEST_ERR                                102\n# define OCSP_R_ERROR_IN_NEXTUPDATE_FIELD                 122\n# define OCSP_R_ERROR_IN_THISUPDATE_FIELD                 123\n# define OCSP_R_ERROR_PARSING_URL                         121\n# define OCSP_R_MISSING_OCSPSIGNING_USAGE                 103\n# define OCSP_R_NEXTUPDATE_BEFORE_THISUPDATE              124\n# define OCSP_R_NOT_BASIC_RESPONSE                        104\n# define OCSP_R_NO_CERTIFICATES_IN_CHAIN                  105\n# define OCSP_R_NO_CONTENT                                106\n# define OCSP_R_NO_PUBLIC_KEY                             107\n# define OCSP_R_NO_RESPONSE_DATA                          108\n# define OCSP_R_NO_REVOKED_TIME                           109\n# define OCSP_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE    110\n# define OCSP_R_REQUEST_NOT_SIGNED                        128\n# define OCSP_R_RESPONSE_CONTAINS_NO_REVOCATION_DATA      111\n# define OCSP_R_ROOT_CA_NOT_TRUSTED                       112\n# define OCSP_R_SERVER_READ_ERROR                         113\n# define OCSP_R_SERVER_RESPONSE_ERROR                     114\n# define OCSP_R_SERVER_RESPONSE_PARSE_ERROR               115\n# define OCSP_R_SERVER_WRITE_ERROR                        116\n# define OCSP_R_SIGNATURE_FAILURE                         117\n# define OCSP_R_SIGNER_CERTIFICATE_NOT_FOUND              118\n# define OCSP_R_STATUS_EXPIRED                            125\n# define OCSP_R_STATUS_NOT_YET_VALID                      126\n# define OCSP_R_STATUS_TOO_OLD                            127\n# define OCSP_R_UNKNOWN_MESSAGE_DIGEST                    119\n# define OCSP_R_UNKNOWN_NID                               120\n# define OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE            129\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/opensslconf.h",
    "content": "/* opensslconf.h */\n/* WARNING: Generated automatically from opensslconf.h.in by Configure. */\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n/* OpenSSL was configured with the following options: */\n#ifndef OPENSSL_SYSNAME_WIN32\n# define OPENSSL_SYSNAME_WIN32\n#endif\n#ifndef OPENSSL_DOING_MAKEDEPEND\n\n\n#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128\n# define OPENSSL_NO_EC_NISTP_64_GCC_128\n#endif\n#ifndef OPENSSL_NO_GMP\n# define OPENSSL_NO_GMP\n#endif\n#ifndef OPENSSL_NO_JPAKE\n# define OPENSSL_NO_JPAKE\n#endif\n#ifndef OPENSSL_NO_KRB5\n# define OPENSSL_NO_KRB5\n#endif\n#ifndef OPENSSL_NO_LIBUNBOUND\n# define OPENSSL_NO_LIBUNBOUND\n#endif\n#ifndef OPENSSL_NO_MD2\n# define OPENSSL_NO_MD2\n#endif\n#ifndef OPENSSL_NO_RC5\n# define OPENSSL_NO_RC5\n#endif\n#ifndef OPENSSL_NO_RFC3779\n# define OPENSSL_NO_RFC3779\n#endif\n#ifndef OPENSSL_NO_SCTP\n# define OPENSSL_NO_SCTP\n#endif\n#ifndef OPENSSL_NO_SSL_TRACE\n# define OPENSSL_NO_SSL_TRACE\n#endif\n#ifndef OPENSSL_NO_SSL2\n# define OPENSSL_NO_SSL2\n#endif\n#ifndef OPENSSL_NO_STORE\n# define OPENSSL_NO_STORE\n#endif\n#ifndef OPENSSL_NO_UNIT_TEST\n# define OPENSSL_NO_UNIT_TEST\n#endif\n#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS\n# define OPENSSL_NO_WEAK_SSL_CIPHERS\n#endif\n\n#endif /* OPENSSL_DOING_MAKEDEPEND */\n\n#ifndef OPENSSL_THREADS\n# define OPENSSL_THREADS\n#endif\n\n/* The OPENSSL_NO_* macros are also defined as NO_* if the application\n   asks for it.  This is a transient feature that is provided for those\n   who haven't had the time to do the appropriate changes in their\n   applications.  */\n#ifdef OPENSSL_ALGORITHM_DEFINES\n# if defined(OPENSSL_NO_EC_NISTP_64_GCC_128) && !defined(NO_EC_NISTP_64_GCC_128)\n#  define NO_EC_NISTP_64_GCC_128\n# endif\n# if defined(OPENSSL_NO_GMP) && !defined(NO_GMP)\n#  define NO_GMP\n# endif\n# if defined(OPENSSL_NO_JPAKE) && !defined(NO_JPAKE)\n#  define NO_JPAKE\n# endif\n# if defined(OPENSSL_NO_KRB5) && !defined(NO_KRB5)\n#  define NO_KRB5\n# endif\n# if defined(OPENSSL_NO_LIBUNBOUND) && !defined(NO_LIBUNBOUND)\n#  define NO_LIBUNBOUND\n# endif\n# if defined(OPENSSL_NO_MD2) && !defined(NO_MD2)\n#  define NO_MD2\n# endif\n# if defined(OPENSSL_NO_RC5) && !defined(NO_RC5)\n#  define NO_RC5\n# endif\n# if defined(OPENSSL_NO_RFC3779) && !defined(NO_RFC3779)\n#  define NO_RFC3779\n# endif\n# if defined(OPENSSL_NO_SCTP) && !defined(NO_SCTP)\n#  define NO_SCTP\n# endif\n# if defined(OPENSSL_NO_SSL_TRACE) && !defined(NO_SSL_TRACE)\n#  define NO_SSL_TRACE\n# endif\n# if defined(OPENSSL_NO_SSL2) && !defined(NO_SSL2)\n#  define NO_SSL2\n# endif\n# if defined(OPENSSL_NO_STORE) && !defined(NO_STORE)\n#  define NO_STORE\n# endif\n# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST)\n#  define NO_UNIT_TEST\n# endif\n# if defined(OPENSSL_NO_WEAK_SSL_CIPHERS) && !defined(NO_WEAK_SSL_CIPHERS)\n#  define NO_WEAK_SSL_CIPHERS\n# endif\n#endif\n\n#define OPENSSL_CPUID_OBJ\n\n/* crypto/opensslconf.h.in */\n\n/* Generate 80386 code? */\n#undef I386_ONLY\n\n#if !(defined(VMS) || defined(__VMS)) /* VMS uses logical names instead */\n#if defined(HEADER_CRYPTLIB_H) && !defined(OPENSSLDIR)\n#define ENGINESDIR \"/usr/local/ssl/lib/engines\"\n#define OPENSSLDIR \"/usr/local/ssl\"\n#endif\n#endif\n\n#undef OPENSSL_UNISTD\n#define OPENSSL_UNISTD <unistd.h>\n\n#undef OPENSSL_EXPORT_VAR_AS_FUNCTION\n#define OPENSSL_EXPORT_VAR_AS_FUNCTION\n\n#if defined(HEADER_IDEA_H) && !defined(IDEA_INT)\n#define IDEA_INT unsigned int\n#endif\n\n#if defined(HEADER_MD2_H) && !defined(MD2_INT)\n#define MD2_INT unsigned int\n#endif\n\n#if defined(HEADER_RC2_H) && !defined(RC2_INT)\n/* I need to put in a mod for the alpha - eay */\n#define RC2_INT unsigned int\n#endif\n\n#if defined(HEADER_RC4_H)\n#if !defined(RC4_INT)\n/* using int types make the structure larger but make the code faster\n * on most boxes I have tested - up to %20 faster. */\n/*\n * I don't know what does \"most\" mean, but declaring \"int\" is a must on:\n * - Intel P6 because partial register stalls are very expensive;\n * - elder Alpha because it lacks byte load/store instructions;\n */\n#define RC4_INT unsigned int\n#endif\n#if !defined(RC4_CHUNK)\n/*\n * This enables code handling data aligned at natural CPU word\n * boundary. See crypto/rc4/rc4_enc.c for further details.\n */\n#undef RC4_CHUNK\n#endif\n#endif\n\n#if (defined(HEADER_NEW_DES_H) || defined(HEADER_DES_H)) && !defined(DES_LONG)\n/* If this is set to 'unsigned int' on a DEC Alpha, this gives about a\n * %20 speed up (longs are 8 bytes, int's are 4). */\n#ifndef DES_LONG\n#define DES_LONG unsigned long\n#endif\n#endif\n\n#if defined(HEADER_BN_H) && !defined(CONFIG_HEADER_BN_H)\n#define CONFIG_HEADER_BN_H\n#define BN_LLONG\n\n/* Should we define BN_DIV2W here? */\n\n/* Only one for the following should be defined */\n#undef SIXTY_FOUR_BIT_LONG\n#undef SIXTY_FOUR_BIT\n#define THIRTY_TWO_BIT\n#endif\n\n#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)\n#define CONFIG_HEADER_RC4_LOCL_H\n/* if this is defined data[i] is used instead of *data, this is a %20\n * speedup on x86 */\n#define RC4_INDEX\n#endif\n\n#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)\n#define CONFIG_HEADER_BF_LOCL_H\n#undef BF_PTR\n#endif /* HEADER_BF_LOCL_H */\n\n#if defined(HEADER_DES_LOCL_H) && !defined(CONFIG_HEADER_DES_LOCL_H)\n#define CONFIG_HEADER_DES_LOCL_H\n#ifndef DES_DEFAULT_OPTIONS\n/* the following is tweaked from a config script, that is why it is a\n * protected undef/define */\n#ifndef DES_PTR\n#undef DES_PTR\n#endif\n\n/* This helps C compiler generate the correct code for multiple functional\n * units.  It reduces register dependancies at the expense of 2 more\n * registers */\n#ifndef DES_RISC1\n#undef DES_RISC1\n#endif\n\n#ifndef DES_RISC2\n#undef DES_RISC2\n#endif\n\n#if defined(DES_RISC1) && defined(DES_RISC2)\n#error YOU SHOULD NOT HAVE BOTH DES_RISC1 AND DES_RISC2 DEFINED!!!!!\n#endif\n\n/* Unroll the inner loop, this sometimes helps, sometimes hinders.\n * Very mucy CPU dependant */\n#ifndef DES_UNROLL\n#undef DES_UNROLL\n#endif\n\n/* These default values were supplied by\n * Peter Gutman <pgut001@cs.auckland.ac.nz>\n * They are only used if nothing else has been defined */\n#if !defined(DES_PTR) && !defined(DES_RISC1) && !defined(DES_RISC2) && !defined(DES_UNROLL)\n/* Special defines which change the way the code is built depending on the\n   CPU and OS.  For SGI machines you can use _MIPS_SZLONG (32 or 64) to find\n   even newer MIPS CPU's, but at the moment one size fits all for\n   optimization options.  Older Sparc's work better with only UNROLL, but\n   there's no way to tell at compile time what it is you're running on */\n\n#if defined( __sun ) || defined ( sun )\t\t/* Newer Sparc's */\n#  define DES_PTR\n#  define DES_RISC1\n#  define DES_UNROLL\n#elif defined( __ultrix )\t/* Older MIPS */\n#  define DES_PTR\n#  define DES_RISC2\n#  define DES_UNROLL\n#elif defined( __osf1__ )\t/* Alpha */\n#  define DES_PTR\n#  define DES_RISC2\n#elif defined ( _AIX )\t\t/* RS6000 */\n  /* Unknown */\n#elif defined( __hpux )\t\t/* HP-PA */\n  /* Unknown */\n#elif defined( __aux )\t\t/* 68K */\n  /* Unknown */\n#elif defined( __dgux )\t\t/* 88K (but P6 in latest boxes) */\n#  define DES_UNROLL\n#elif defined( __sgi )\t\t/* Newer MIPS */\n#  define DES_PTR\n#  define DES_RISC2\n#  define DES_UNROLL\n#elif defined(i386) || defined(__i386__)\t/* x86 boxes, should be gcc */\n#  define DES_PTR\n#  define DES_RISC1\n#  define DES_UNROLL\n#endif /* Systems-specific speed defines */\n#endif\n\n#endif /* DES_DEFAULT_OPTIONS */\n#endif /* HEADER_DES_LOCL_H */\n#ifdef  __cplusplus\n}\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/opensslv.h",
    "content": "#ifndef HEADER_OPENSSLV_H\n# define HEADER_OPENSSLV_H\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/*-\n * Numeric release version identifier:\n * MNNFFPPS: major minor fix patch status\n * The status nibble has one of the values 0 for development, 1 to e for betas\n * 1 to 14, and f for release.  The patch level is exactly that.\n * For example:\n * 0.9.3-dev      0x00903000\n * 0.9.3-beta1    0x00903001\n * 0.9.3-beta2-dev 0x00903002\n * 0.9.3-beta2    0x00903002 (same as ...beta2-dev)\n * 0.9.3          0x0090300f\n * 0.9.3a         0x0090301f\n * 0.9.4          0x0090400f\n * 1.2.3z         0x102031af\n *\n * For continuity reasons (because 0.9.5 is already out, and is coded\n * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level\n * part is slightly different, by setting the highest bit.  This means\n * that 0.9.5a looks like this: 0x0090581f.  At 0.9.6, we can start\n * with 0x0090600S...\n *\n * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.)\n * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for\n *  major minor fix final patch/beta)\n */\n# define OPENSSL_VERSION_NUMBER  0x100020ffL\n# ifdef OPENSSL_FIPS\n#  define OPENSSL_VERSION_TEXT    \"OpenSSL 1.0.2o-fips  27 Mar 2018\"\n# else\n#  define OPENSSL_VERSION_TEXT    \"OpenSSL 1.0.2o  27 Mar 2018\"\n# endif\n# define OPENSSL_VERSION_PTEXT   \" part of \" OPENSSL_VERSION_TEXT\n\n/*-\n * The macros below are to be used for shared library (.so, .dll, ...)\n * versioning.  That kind of versioning works a bit differently between\n * operating systems.  The most usual scheme is to set a major and a minor\n * number, and have the runtime loader check that the major number is equal\n * to what it was at application link time, while the minor number has to\n * be greater or equal to what it was at application link time.  With this\n * scheme, the version number is usually part of the file name, like this:\n *\n *      libcrypto.so.0.9\n *\n * Some unixen also make a softlink with the major verson number only:\n *\n *      libcrypto.so.0\n *\n * On Tru64 and IRIX 6.x it works a little bit differently.  There, the\n * shared library version is stored in the file, and is actually a series\n * of versions, separated by colons.  The rightmost version present in the\n * library when linking an application is stored in the application to be\n * matched at run time.  When the application is run, a check is done to\n * see if the library version stored in the application matches any of the\n * versions in the version string of the library itself.\n * This version string can be constructed in any way, depending on what\n * kind of matching is desired.  However, to implement the same scheme as\n * the one used in the other unixen, all compatible versions, from lowest\n * to highest, should be part of the string.  Consecutive builds would\n * give the following versions strings:\n *\n *      3.0\n *      3.0:3.1\n *      3.0:3.1:3.2\n *      4.0\n *      4.0:4.1\n *\n * Notice how version 4 is completely incompatible with version, and\n * therefore give the breach you can see.\n *\n * There may be other schemes as well that I haven't yet discovered.\n *\n * So, here's the way it works here: first of all, the library version\n * number doesn't need at all to match the overall OpenSSL version.\n * However, it's nice and more understandable if it actually does.\n * The current library version is stored in the macro SHLIB_VERSION_NUMBER,\n * which is just a piece of text in the format \"M.m.e\" (Major, minor, edit).\n * For the sake of Tru64, IRIX, and any other OS that behaves in similar ways,\n * we need to keep a history of version numbers, which is done in the\n * macro SHLIB_VERSION_HISTORY.  The numbers are separated by colons and\n * should only keep the versions that are binary compatible with the current.\n */\n# define SHLIB_VERSION_HISTORY \"\"\n# define SHLIB_VERSION_NUMBER \"1.0.0\"\n\n\n#ifdef  __cplusplus\n}\n#endif\n#endif                          /* HEADER_OPENSSLV_H */\n"
  },
  {
    "path": "third_party/include/openssl/ossl_typ.h",
    "content": "/* ====================================================================\n * Copyright (c) 1998-2001 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_OPENSSL_TYPES_H\n# define HEADER_OPENSSL_TYPES_H\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# include <openssl/e_os2.h>\n\n# ifdef NO_ASN1_TYPEDEFS\n#  define ASN1_INTEGER            ASN1_STRING\n#  define ASN1_ENUMERATED         ASN1_STRING\n#  define ASN1_BIT_STRING         ASN1_STRING\n#  define ASN1_OCTET_STRING       ASN1_STRING\n#  define ASN1_PRINTABLESTRING    ASN1_STRING\n#  define ASN1_T61STRING          ASN1_STRING\n#  define ASN1_IA5STRING          ASN1_STRING\n#  define ASN1_UTCTIME            ASN1_STRING\n#  define ASN1_GENERALIZEDTIME    ASN1_STRING\n#  define ASN1_TIME               ASN1_STRING\n#  define ASN1_GENERALSTRING      ASN1_STRING\n#  define ASN1_UNIVERSALSTRING    ASN1_STRING\n#  define ASN1_BMPSTRING          ASN1_STRING\n#  define ASN1_VISIBLESTRING      ASN1_STRING\n#  define ASN1_UTF8STRING         ASN1_STRING\n#  define ASN1_BOOLEAN            int\n#  define ASN1_NULL               int\n# else\ntypedef struct asn1_string_st ASN1_INTEGER;\ntypedef struct asn1_string_st ASN1_ENUMERATED;\ntypedef struct asn1_string_st ASN1_BIT_STRING;\ntypedef struct asn1_string_st ASN1_OCTET_STRING;\ntypedef struct asn1_string_st ASN1_PRINTABLESTRING;\ntypedef struct asn1_string_st ASN1_T61STRING;\ntypedef struct asn1_string_st ASN1_IA5STRING;\ntypedef struct asn1_string_st ASN1_GENERALSTRING;\ntypedef struct asn1_string_st ASN1_UNIVERSALSTRING;\ntypedef struct asn1_string_st ASN1_BMPSTRING;\ntypedef struct asn1_string_st ASN1_UTCTIME;\ntypedef struct asn1_string_st ASN1_TIME;\ntypedef struct asn1_string_st ASN1_GENERALIZEDTIME;\ntypedef struct asn1_string_st ASN1_VISIBLESTRING;\ntypedef struct asn1_string_st ASN1_UTF8STRING;\ntypedef struct asn1_string_st ASN1_STRING;\ntypedef int ASN1_BOOLEAN;\ntypedef int ASN1_NULL;\n# endif\n\ntypedef struct asn1_object_st ASN1_OBJECT;\n\ntypedef struct ASN1_ITEM_st ASN1_ITEM;\ntypedef struct asn1_pctx_st ASN1_PCTX;\n\n# ifdef OPENSSL_SYS_WIN32\n#  undef X509_NAME\n#  undef X509_EXTENSIONS\n#  undef X509_CERT_PAIR\n#  undef PKCS7_ISSUER_AND_SERIAL\n#  undef OCSP_REQUEST\n#  undef OCSP_RESPONSE\n# endif\n\n# ifdef BIGNUM\n#  undef BIGNUM\n# endif\ntypedef struct bignum_st BIGNUM;\ntypedef struct bignum_ctx BN_CTX;\ntypedef struct bn_blinding_st BN_BLINDING;\ntypedef struct bn_mont_ctx_st BN_MONT_CTX;\ntypedef struct bn_recp_ctx_st BN_RECP_CTX;\ntypedef struct bn_gencb_st BN_GENCB;\n\ntypedef struct buf_mem_st BUF_MEM;\n\ntypedef struct evp_cipher_st EVP_CIPHER;\ntypedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;\ntypedef struct env_md_st EVP_MD;\ntypedef struct env_md_ctx_st EVP_MD_CTX;\ntypedef struct evp_pkey_st EVP_PKEY;\n\ntypedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD;\n\ntypedef struct evp_pkey_method_st EVP_PKEY_METHOD;\ntypedef struct evp_pkey_ctx_st EVP_PKEY_CTX;\n\ntypedef struct dh_st DH;\ntypedef struct dh_method DH_METHOD;\n\ntypedef struct dsa_st DSA;\ntypedef struct dsa_method DSA_METHOD;\n\ntypedef struct rsa_st RSA;\ntypedef struct rsa_meth_st RSA_METHOD;\n\ntypedef struct rand_meth_st RAND_METHOD;\n\ntypedef struct ecdh_method ECDH_METHOD;\ntypedef struct ecdsa_method ECDSA_METHOD;\n\ntypedef struct x509_st X509;\ntypedef struct X509_algor_st X509_ALGOR;\ntypedef struct X509_crl_st X509_CRL;\ntypedef struct x509_crl_method_st X509_CRL_METHOD;\ntypedef struct x509_revoked_st X509_REVOKED;\ntypedef struct X509_name_st X509_NAME;\ntypedef struct X509_pubkey_st X509_PUBKEY;\ntypedef struct x509_store_st X509_STORE;\ntypedef struct x509_store_ctx_st X509_STORE_CTX;\n\ntypedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;\n\ntypedef struct v3_ext_ctx X509V3_CTX;\ntypedef struct conf_st CONF;\n\ntypedef struct store_st STORE;\ntypedef struct store_method_st STORE_METHOD;\n\ntypedef struct ui_st UI;\ntypedef struct ui_method_st UI_METHOD;\n\ntypedef struct st_ERR_FNS ERR_FNS;\n\ntypedef struct engine_st ENGINE;\ntypedef struct ssl_st SSL;\ntypedef struct ssl_ctx_st SSL_CTX;\n\ntypedef struct comp_method_st COMP_METHOD;\n\ntypedef struct X509_POLICY_NODE_st X509_POLICY_NODE;\ntypedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;\ntypedef struct X509_POLICY_TREE_st X509_POLICY_TREE;\ntypedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;\n\ntypedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID;\ntypedef struct DIST_POINT_st DIST_POINT;\ntypedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;\ntypedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;\n\n  /* If placed in pkcs12.h, we end up with a circular depency with pkcs7.h */\n# define DECLARE_PKCS12_STACK_OF(type)/* Nothing */\n# define IMPLEMENT_PKCS12_STACK_OF(type)/* Nothing */\n\ntypedef struct crypto_ex_data_st CRYPTO_EX_DATA;\n/* Callback types for crypto.h */\ntypedef int CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad,\n                           int idx, long argl, void *argp);\ntypedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad,\n                             int idx, long argl, void *argp);\ntypedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from,\n                           void *from_d, int idx, long argl, void *argp);\n\ntypedef struct ocsp_req_ctx_st OCSP_REQ_CTX;\ntypedef struct ocsp_response_st OCSP_RESPONSE;\ntypedef struct ocsp_responder_id_st OCSP_RESPID;\n\n#ifdef  __cplusplus\n}\n#endif\n#endif                          /* def HEADER_OPENSSL_TYPES_H */\n"
  },
  {
    "path": "third_party/include/openssl/pem.h",
    "content": "/* crypto/pem/pem.h */\n/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_PEM_H\n# define HEADER_PEM_H\n\n# include <openssl/e_os2.h>\n# ifndef OPENSSL_NO_BIO\n#  include <openssl/bio.h>\n# endif\n# ifndef OPENSSL_NO_STACK\n#  include <openssl/stack.h>\n# endif\n# include <openssl/evp.h>\n# include <openssl/x509.h>\n# include <openssl/pem2.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# define PEM_BUFSIZE             1024\n\n# define PEM_OBJ_UNDEF           0\n# define PEM_OBJ_X509            1\n# define PEM_OBJ_X509_REQ        2\n# define PEM_OBJ_CRL             3\n# define PEM_OBJ_SSL_SESSION     4\n# define PEM_OBJ_PRIV_KEY        10\n# define PEM_OBJ_PRIV_RSA        11\n# define PEM_OBJ_PRIV_DSA        12\n# define PEM_OBJ_PRIV_DH         13\n# define PEM_OBJ_PUB_RSA         14\n# define PEM_OBJ_PUB_DSA         15\n# define PEM_OBJ_PUB_DH          16\n# define PEM_OBJ_DHPARAMS        17\n# define PEM_OBJ_DSAPARAMS       18\n# define PEM_OBJ_PRIV_RSA_PUBLIC 19\n# define PEM_OBJ_PRIV_ECDSA      20\n# define PEM_OBJ_PUB_ECDSA       21\n# define PEM_OBJ_ECPARAMETERS    22\n\n# define PEM_ERROR               30\n# define PEM_DEK_DES_CBC         40\n# define PEM_DEK_IDEA_CBC        45\n# define PEM_DEK_DES_EDE         50\n# define PEM_DEK_DES_ECB         60\n# define PEM_DEK_RSA             70\n# define PEM_DEK_RSA_MD2         80\n# define PEM_DEK_RSA_MD5         90\n\n# define PEM_MD_MD2              NID_md2\n# define PEM_MD_MD5              NID_md5\n# define PEM_MD_SHA              NID_sha\n# define PEM_MD_MD2_RSA          NID_md2WithRSAEncryption\n# define PEM_MD_MD5_RSA          NID_md5WithRSAEncryption\n# define PEM_MD_SHA_RSA          NID_sha1WithRSAEncryption\n\n# define PEM_STRING_X509_OLD     \"X509 CERTIFICATE\"\n# define PEM_STRING_X509         \"CERTIFICATE\"\n# define PEM_STRING_X509_PAIR    \"CERTIFICATE PAIR\"\n# define PEM_STRING_X509_TRUSTED \"TRUSTED CERTIFICATE\"\n# define PEM_STRING_X509_REQ_OLD \"NEW CERTIFICATE REQUEST\"\n# define PEM_STRING_X509_REQ     \"CERTIFICATE REQUEST\"\n# define PEM_STRING_X509_CRL     \"X509 CRL\"\n# define PEM_STRING_EVP_PKEY     \"ANY PRIVATE KEY\"\n# define PEM_STRING_PUBLIC       \"PUBLIC KEY\"\n# define PEM_STRING_RSA          \"RSA PRIVATE KEY\"\n# define PEM_STRING_RSA_PUBLIC   \"RSA PUBLIC KEY\"\n# define PEM_STRING_DSA          \"DSA PRIVATE KEY\"\n# define PEM_STRING_DSA_PUBLIC   \"DSA PUBLIC KEY\"\n# define PEM_STRING_PKCS7        \"PKCS7\"\n# define PEM_STRING_PKCS7_SIGNED \"PKCS #7 SIGNED DATA\"\n# define PEM_STRING_PKCS8        \"ENCRYPTED PRIVATE KEY\"\n# define PEM_STRING_PKCS8INF     \"PRIVATE KEY\"\n# define PEM_STRING_DHPARAMS     \"DH PARAMETERS\"\n# define PEM_STRING_DHXPARAMS    \"X9.42 DH PARAMETERS\"\n# define PEM_STRING_SSL_SESSION  \"SSL SESSION PARAMETERS\"\n# define PEM_STRING_DSAPARAMS    \"DSA PARAMETERS\"\n# define PEM_STRING_ECDSA_PUBLIC \"ECDSA PUBLIC KEY\"\n# define PEM_STRING_ECPARAMETERS \"EC PARAMETERS\"\n# define PEM_STRING_ECPRIVATEKEY \"EC PRIVATE KEY\"\n# define PEM_STRING_PARAMETERS   \"PARAMETERS\"\n# define PEM_STRING_CMS          \"CMS\"\n\n  /*\n   * Note that this structure is initialised by PEM_SealInit and cleaned up\n   * by PEM_SealFinal (at least for now)\n   */\ntypedef struct PEM_Encode_Seal_st {\n    EVP_ENCODE_CTX encode;\n    EVP_MD_CTX md;\n    EVP_CIPHER_CTX cipher;\n} PEM_ENCODE_SEAL_CTX;\n\n/* enc_type is one off */\n# define PEM_TYPE_ENCRYPTED      10\n# define PEM_TYPE_MIC_ONLY       20\n# define PEM_TYPE_MIC_CLEAR      30\n# define PEM_TYPE_CLEAR          40\n\ntypedef struct pem_recip_st {\n    char *name;\n    X509_NAME *dn;\n    int cipher;\n    int key_enc;\n    /*      char iv[8]; unused and wrong size */\n} PEM_USER;\n\ntypedef struct pem_ctx_st {\n    int type;                   /* what type of object */\n    struct {\n        int version;\n        int mode;\n    } proc_type;\n\n    char *domain;\n\n    struct {\n        int cipher;\n        /*-\n        unused, and wrong size\n        unsigned char iv[8]; */\n    } DEK_info;\n\n    PEM_USER *originator;\n\n    int num_recipient;\n    PEM_USER **recipient;\n/*-\n    XXX(ben): don#t think this is used!\n        STACK *x509_chain;      / * certificate chain */\n    EVP_MD *md;                 /* signature type */\n\n    int md_enc;                 /* is the md encrypted or not? */\n    int md_len;                 /* length of md_data */\n    char *md_data;              /* message digest, could be pkey encrypted */\n\n    EVP_CIPHER *dec;            /* date encryption cipher */\n    int key_len;                /* key length */\n    unsigned char *key;         /* key */\n  /*-\n    unused, and wrong size\n    unsigned char iv[8]; */\n\n    int data_enc;               /* is the data encrypted */\n    int data_len;\n    unsigned char *data;\n} PEM_CTX;\n\n/*\n * These macros make the PEM_read/PEM_write functions easier to maintain and\n * write. Now they are all implemented with either: IMPLEMENT_PEM_rw(...) or\n * IMPLEMENT_PEM_rw_cb(...)\n */\n\n# ifdef OPENSSL_NO_FP_API\n\n#  define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/\n#  define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/\n#  define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/\n#  define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/\n#  define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/\n# else\n\n#  define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \\\ntype *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\\\n{ \\\nreturn PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str,fp,(void **)x,cb,u); \\\n}\n\n#  define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \\\nint PEM_write_##name(FILE *fp, type *x) \\\n{ \\\nreturn PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL); \\\n}\n\n#  define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \\\nint PEM_write_##name(FILE *fp, const type *x) \\\n{ \\\nreturn PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(void *)x,NULL,NULL,0,NULL,NULL); \\\n}\n\n#  define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \\\nint PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \\\n             unsigned char *kstr, int klen, pem_password_cb *cb, \\\n                  void *u) \\\n        { \\\n        return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \\\n        }\n\n#  define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \\\nint PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \\\n             unsigned char *kstr, int klen, pem_password_cb *cb, \\\n                  void *u) \\\n        { \\\n        return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \\\n        }\n\n# endif\n\n# define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \\\ntype *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\\\n{ \\\nreturn PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str,bp,(void **)x,cb,u); \\\n}\n\n# define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \\\nint PEM_write_bio_##name(BIO *bp, type *x) \\\n{ \\\nreturn PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NULL); \\\n}\n\n# define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \\\nint PEM_write_bio_##name(BIO *bp, const type *x) \\\n{ \\\nreturn PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,NULL,NULL,0,NULL,NULL); \\\n}\n\n# define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \\\nint PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \\\n             unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \\\n        { \\\n        return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,enc,kstr,klen,cb,u); \\\n        }\n\n# define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \\\nint PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \\\n             unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \\\n        { \\\n        return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,enc,kstr,klen,cb,u); \\\n        }\n\n# define IMPLEMENT_PEM_write(name, type, str, asn1) \\\n        IMPLEMENT_PEM_write_bio(name, type, str, asn1) \\\n        IMPLEMENT_PEM_write_fp(name, type, str, asn1)\n\n# define IMPLEMENT_PEM_write_const(name, type, str, asn1) \\\n        IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \\\n        IMPLEMENT_PEM_write_fp_const(name, type, str, asn1)\n\n# define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \\\n        IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \\\n        IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1)\n\n# define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \\\n        IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \\\n        IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1)\n\n# define IMPLEMENT_PEM_read(name, type, str, asn1) \\\n        IMPLEMENT_PEM_read_bio(name, type, str, asn1) \\\n        IMPLEMENT_PEM_read_fp(name, type, str, asn1)\n\n# define IMPLEMENT_PEM_rw(name, type, str, asn1) \\\n        IMPLEMENT_PEM_read(name, type, str, asn1) \\\n        IMPLEMENT_PEM_write(name, type, str, asn1)\n\n# define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \\\n        IMPLEMENT_PEM_read(name, type, str, asn1) \\\n        IMPLEMENT_PEM_write_const(name, type, str, asn1)\n\n# define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \\\n        IMPLEMENT_PEM_read(name, type, str, asn1) \\\n        IMPLEMENT_PEM_write_cb(name, type, str, asn1)\n\n/* These are the same except they are for the declarations */\n\n# if defined(OPENSSL_NO_FP_API)\n\n#  define DECLARE_PEM_read_fp(name, type) /**/\n#  define DECLARE_PEM_write_fp(name, type) /**/\n#  define DECLARE_PEM_write_cb_fp(name, type) /**/\n# else\n\n#  define DECLARE_PEM_read_fp(name, type) \\\n        type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u);\n\n#  define DECLARE_PEM_write_fp(name, type) \\\n        int PEM_write_##name(FILE *fp, type *x);\n\n#  define DECLARE_PEM_write_fp_const(name, type) \\\n        int PEM_write_##name(FILE *fp, const type *x);\n\n#  define DECLARE_PEM_write_cb_fp(name, type) \\\n        int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \\\n             unsigned char *kstr, int klen, pem_password_cb *cb, void *u);\n\n# endif\n\n# ifndef OPENSSL_NO_BIO\n#  define DECLARE_PEM_read_bio(name, type) \\\n        type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u);\n\n#  define DECLARE_PEM_write_bio(name, type) \\\n        int PEM_write_bio_##name(BIO *bp, type *x);\n\n#  define DECLARE_PEM_write_bio_const(name, type) \\\n        int PEM_write_bio_##name(BIO *bp, const type *x);\n\n#  define DECLARE_PEM_write_cb_bio(name, type) \\\n        int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \\\n             unsigned char *kstr, int klen, pem_password_cb *cb, void *u);\n\n# else\n\n#  define DECLARE_PEM_read_bio(name, type) /**/\n#  define DECLARE_PEM_write_bio(name, type) /**/\n#  define DECLARE_PEM_write_bio_const(name, type) /**/\n#  define DECLARE_PEM_write_cb_bio(name, type) /**/\n# endif\n# define DECLARE_PEM_write(name, type) \\\n        DECLARE_PEM_write_bio(name, type) \\\n        DECLARE_PEM_write_fp(name, type)\n# define DECLARE_PEM_write_const(name, type) \\\n        DECLARE_PEM_write_bio_const(name, type) \\\n        DECLARE_PEM_write_fp_const(name, type)\n# define DECLARE_PEM_write_cb(name, type) \\\n        DECLARE_PEM_write_cb_bio(name, type) \\\n        DECLARE_PEM_write_cb_fp(name, type)\n# define DECLARE_PEM_read(name, type) \\\n        DECLARE_PEM_read_bio(name, type) \\\n        DECLARE_PEM_read_fp(name, type)\n# define DECLARE_PEM_rw(name, type) \\\n        DECLARE_PEM_read(name, type) \\\n        DECLARE_PEM_write(name, type)\n# define DECLARE_PEM_rw_const(name, type) \\\n        DECLARE_PEM_read(name, type) \\\n        DECLARE_PEM_write_const(name, type)\n# define DECLARE_PEM_rw_cb(name, type) \\\n        DECLARE_PEM_read(name, type) \\\n        DECLARE_PEM_write_cb(name, type)\n# if 1\n/* \"userdata\": new with OpenSSL 0.9.4 */\ntypedef int pem_password_cb (char *buf, int size, int rwflag, void *userdata);\n# else\n/* OpenSSL 0.9.3, 0.9.3a */\ntypedef int pem_password_cb (char *buf, int size, int rwflag);\n# endif\n\nint PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher);\nint PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *len,\n                  pem_password_cb *callback, void *u);\n\n# ifndef OPENSSL_NO_BIO\nint PEM_read_bio(BIO *bp, char **name, char **header,\n                 unsigned char **data, long *len);\nint PEM_write_bio(BIO *bp, const char *name, const char *hdr,\n                  const unsigned char *data, long len);\nint PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm,\n                       const char *name, BIO *bp, pem_password_cb *cb,\n                       void *u);\nvoid *PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x,\n                        pem_password_cb *cb, void *u);\nint PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x,\n                       const EVP_CIPHER *enc, unsigned char *kstr, int klen,\n                       pem_password_cb *cb, void *u);\n\nSTACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,\n                                            pem_password_cb *cb, void *u);\nint PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc,\n                            unsigned char *kstr, int klen,\n                            pem_password_cb *cd, void *u);\n# endif\n\nint PEM_read(FILE *fp, char **name, char **header,\n             unsigned char **data, long *len);\nint PEM_write(FILE *fp, const char *name, const char *hdr,\n              const unsigned char *data, long len);\nvoid *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x,\n                    pem_password_cb *cb, void *u);\nint PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp,\n                   void *x, const EVP_CIPHER *enc, unsigned char *kstr,\n                   int klen, pem_password_cb *callback, void *u);\nSTACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk,\n                                        pem_password_cb *cb, void *u);\n\nint PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type,\n                 EVP_MD *md_type, unsigned char **ek, int *ekl,\n                 unsigned char *iv, EVP_PKEY **pubk, int npubk);\nvoid PEM_SealUpdate(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *out, int *outl,\n                    unsigned char *in, int inl);\nint PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl,\n                  unsigned char *out, int *outl, EVP_PKEY *priv);\n\nvoid PEM_SignInit(EVP_MD_CTX *ctx, EVP_MD *type);\nvoid PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt);\nint PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret,\n                  unsigned int *siglen, EVP_PKEY *pkey);\n\nint PEM_def_callback(char *buf, int num, int w, void *key);\nvoid PEM_proc_type(char *buf, int type);\nvoid PEM_dek_info(char *buf, const char *type, int len, char *str);\n\n# include <openssl/symhacks.h>\n\nDECLARE_PEM_rw(X509, X509)\nDECLARE_PEM_rw(X509_AUX, X509)\nDECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR)\nDECLARE_PEM_rw(X509_REQ, X509_REQ)\nDECLARE_PEM_write(X509_REQ_NEW, X509_REQ)\nDECLARE_PEM_rw(X509_CRL, X509_CRL)\nDECLARE_PEM_rw(PKCS7, PKCS7)\nDECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE, NETSCAPE_CERT_SEQUENCE)\nDECLARE_PEM_rw(PKCS8, X509_SIG)\nDECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO)\n# ifndef OPENSSL_NO_RSA\nDECLARE_PEM_rw_cb(RSAPrivateKey, RSA)\nDECLARE_PEM_rw_const(RSAPublicKey, RSA)\nDECLARE_PEM_rw(RSA_PUBKEY, RSA)\n# endif\n# ifndef OPENSSL_NO_DSA\nDECLARE_PEM_rw_cb(DSAPrivateKey, DSA)\nDECLARE_PEM_rw(DSA_PUBKEY, DSA)\nDECLARE_PEM_rw_const(DSAparams, DSA)\n# endif\n# ifndef OPENSSL_NO_EC\nDECLARE_PEM_rw_const(ECPKParameters, EC_GROUP)\nDECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY)\nDECLARE_PEM_rw(EC_PUBKEY, EC_KEY)\n# endif\n# ifndef OPENSSL_NO_DH\nDECLARE_PEM_rw_const(DHparams, DH)\nDECLARE_PEM_write_const(DHxparams, DH)\n# endif\nDECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY)\nDECLARE_PEM_rw(PUBKEY, EVP_PKEY)\n\nint PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid,\n                                      char *kstr, int klen,\n                                      pem_password_cb *cb, void *u);\nint PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *,\n                                  char *, int, pem_password_cb *, void *);\nint i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,\n                            char *kstr, int klen,\n                            pem_password_cb *cb, void *u);\nint i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid,\n                                char *kstr, int klen,\n                                pem_password_cb *cb, void *u);\nEVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb,\n                                  void *u);\n\nint i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,\n                           char *kstr, int klen,\n                           pem_password_cb *cb, void *u);\nint i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid,\n                               char *kstr, int klen,\n                               pem_password_cb *cb, void *u);\nint PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid,\n                                  char *kstr, int klen,\n                                  pem_password_cb *cb, void *u);\n\nEVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb,\n                                 void *u);\n\nint PEM_write_PKCS8PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc,\n                              char *kstr, int klen, pem_password_cb *cd,\n                              void *u);\n\nEVP_PKEY *PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x);\nint PEM_write_bio_Parameters(BIO *bp, EVP_PKEY *x);\n\nEVP_PKEY *b2i_PrivateKey(const unsigned char **in, long length);\nEVP_PKEY *b2i_PublicKey(const unsigned char **in, long length);\nEVP_PKEY *b2i_PrivateKey_bio(BIO *in);\nEVP_PKEY *b2i_PublicKey_bio(BIO *in);\nint i2b_PrivateKey_bio(BIO *out, EVP_PKEY *pk);\nint i2b_PublicKey_bio(BIO *out, EVP_PKEY *pk);\n# ifndef OPENSSL_NO_RC4\nEVP_PKEY *b2i_PVK_bio(BIO *in, pem_password_cb *cb, void *u);\nint i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel,\n                pem_password_cb *cb, void *u);\n# endif\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\n\nvoid ERR_load_PEM_strings(void);\n\n/* Error codes for the PEM functions. */\n\n/* Function codes. */\n# define PEM_F_B2I_DSS                                    127\n# define PEM_F_B2I_PVK_BIO                                128\n# define PEM_F_B2I_RSA                                    129\n# define PEM_F_CHECK_BITLEN_DSA                           130\n# define PEM_F_CHECK_BITLEN_RSA                           131\n# define PEM_F_D2I_PKCS8PRIVATEKEY_BIO                    120\n# define PEM_F_D2I_PKCS8PRIVATEKEY_FP                     121\n# define PEM_F_DO_B2I                                     132\n# define PEM_F_DO_B2I_BIO                                 133\n# define PEM_F_DO_BLOB_HEADER                             134\n# define PEM_F_DO_PK8PKEY                                 126\n# define PEM_F_DO_PK8PKEY_FP                              125\n# define PEM_F_DO_PVK_BODY                                135\n# define PEM_F_DO_PVK_HEADER                              136\n# define PEM_F_I2B_PVK                                    137\n# define PEM_F_I2B_PVK_BIO                                138\n# define PEM_F_LOAD_IV                                    101\n# define PEM_F_PEM_ASN1_READ                              102\n# define PEM_F_PEM_ASN1_READ_BIO                          103\n# define PEM_F_PEM_ASN1_WRITE                             104\n# define PEM_F_PEM_ASN1_WRITE_BIO                         105\n# define PEM_F_PEM_DEF_CALLBACK                           100\n# define PEM_F_PEM_DO_HEADER                              106\n# define PEM_F_PEM_F_PEM_WRITE_PKCS8PRIVATEKEY            118\n# define PEM_F_PEM_GET_EVP_CIPHER_INFO                    107\n# define PEM_F_PEM_PK8PKEY                                119\n# define PEM_F_PEM_READ                                   108\n# define PEM_F_PEM_READ_BIO                               109\n# define PEM_F_PEM_READ_BIO_DHPARAMS                      141\n# define PEM_F_PEM_READ_BIO_PARAMETERS                    140\n# define PEM_F_PEM_READ_BIO_PRIVATEKEY                    123\n# define PEM_F_PEM_READ_DHPARAMS                          142\n# define PEM_F_PEM_READ_PRIVATEKEY                        124\n# define PEM_F_PEM_SEALFINAL                              110\n# define PEM_F_PEM_SEALINIT                               111\n# define PEM_F_PEM_SIGNFINAL                              112\n# define PEM_F_PEM_WRITE                                  113\n# define PEM_F_PEM_WRITE_BIO                              114\n# define PEM_F_PEM_WRITE_PRIVATEKEY                       139\n# define PEM_F_PEM_X509_INFO_READ                         115\n# define PEM_F_PEM_X509_INFO_READ_BIO                     116\n# define PEM_F_PEM_X509_INFO_WRITE_BIO                    117\n\n/* Reason codes. */\n# define PEM_R_BAD_BASE64_DECODE                          100\n# define PEM_R_BAD_DECRYPT                                101\n# define PEM_R_BAD_END_LINE                               102\n# define PEM_R_BAD_IV_CHARS                               103\n# define PEM_R_BAD_MAGIC_NUMBER                           116\n# define PEM_R_BAD_PASSWORD_READ                          104\n# define PEM_R_BAD_VERSION_NUMBER                         117\n# define PEM_R_BIO_WRITE_FAILURE                          118\n# define PEM_R_CIPHER_IS_NULL                             127\n# define PEM_R_ERROR_CONVERTING_PRIVATE_KEY               115\n# define PEM_R_EXPECTING_PRIVATE_KEY_BLOB                 119\n# define PEM_R_EXPECTING_PUBLIC_KEY_BLOB                  120\n# define PEM_R_HEADER_TOO_LONG                            128\n# define PEM_R_INCONSISTENT_HEADER                        121\n# define PEM_R_KEYBLOB_HEADER_PARSE_ERROR                 122\n# define PEM_R_KEYBLOB_TOO_SHORT                          123\n# define PEM_R_NOT_DEK_INFO                               105\n# define PEM_R_NOT_ENCRYPTED                              106\n# define PEM_R_NOT_PROC_TYPE                              107\n# define PEM_R_NO_START_LINE                              108\n# define PEM_R_PROBLEMS_GETTING_PASSWORD                  109\n# define PEM_R_PUBLIC_KEY_NO_RSA                          110\n# define PEM_R_PVK_DATA_TOO_SHORT                         124\n# define PEM_R_PVK_TOO_SHORT                              125\n# define PEM_R_READ_KEY                                   111\n# define PEM_R_SHORT_HEADER                               112\n# define PEM_R_UNSUPPORTED_CIPHER                         113\n# define PEM_R_UNSUPPORTED_ENCRYPTION                     114\n# define PEM_R_UNSUPPORTED_KEY_COMPONENTS                 126\n\n# ifdef  __cplusplus\n}\n# endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/pem2.h",
    "content": "/* ====================================================================\n * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n/*\n * This header only exists to break a circular dependency between pem and err\n * Ben 30 Jan 1999.\n */\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#ifndef HEADER_PEM_H\nvoid ERR_load_PEM_strings(void);\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/pkcs12.h",
    "content": "/* pkcs12.h */\n/*\n * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project\n * 1999.\n */\n/* ====================================================================\n * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_PKCS12_H\n# define HEADER_PKCS12_H\n\n# include <openssl/bio.h>\n# include <openssl/x509.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n# define PKCS12_KEY_ID   1\n# define PKCS12_IV_ID    2\n# define PKCS12_MAC_ID   3\n\n/* Default iteration count */\n# ifndef PKCS12_DEFAULT_ITER\n#  define PKCS12_DEFAULT_ITER     PKCS5_DEFAULT_ITER\n# endif\n\n# define PKCS12_MAC_KEY_LENGTH 20\n\n# define PKCS12_SALT_LEN 8\n\n/* Uncomment out next line for unicode password and names, otherwise ASCII */\n\n/*\n * #define PBE_UNICODE\n */\n\n# ifdef PBE_UNICODE\n#  define PKCS12_key_gen PKCS12_key_gen_uni\n#  define PKCS12_add_friendlyname PKCS12_add_friendlyname_uni\n# else\n#  define PKCS12_key_gen PKCS12_key_gen_asc\n#  define PKCS12_add_friendlyname PKCS12_add_friendlyname_asc\n# endif\n\n/* MS key usage constants */\n\n# define KEY_EX  0x10\n# define KEY_SIG 0x80\n\ntypedef struct {\n    X509_SIG *dinfo;\n    ASN1_OCTET_STRING *salt;\n    ASN1_INTEGER *iter;         /* defaults to 1 */\n} PKCS12_MAC_DATA;\n\ntypedef struct {\n    ASN1_INTEGER *version;\n    PKCS12_MAC_DATA *mac;\n    PKCS7 *authsafes;\n} PKCS12;\n\ntypedef struct {\n    ASN1_OBJECT *type;\n    union {\n        struct pkcs12_bag_st *bag; /* secret, crl and certbag */\n        struct pkcs8_priv_key_info_st *keybag; /* keybag */\n        X509_SIG *shkeybag;     /* shrouded key bag */\n        STACK_OF(PKCS12_SAFEBAG) *safes;\n        ASN1_TYPE *other;\n    } value;\n    STACK_OF(X509_ATTRIBUTE) *attrib;\n} PKCS12_SAFEBAG;\n\nDECLARE_STACK_OF(PKCS12_SAFEBAG)\nDECLARE_ASN1_SET_OF(PKCS12_SAFEBAG)\nDECLARE_PKCS12_STACK_OF(PKCS12_SAFEBAG)\n\ntypedef struct pkcs12_bag_st {\n    ASN1_OBJECT *type;\n    union {\n        ASN1_OCTET_STRING *x509cert;\n        ASN1_OCTET_STRING *x509crl;\n        ASN1_OCTET_STRING *octet;\n        ASN1_IA5STRING *sdsicert;\n        ASN1_TYPE *other;       /* Secret or other bag */\n    } value;\n} PKCS12_BAGS;\n\n# define PKCS12_ERROR    0\n# define PKCS12_OK       1\n\n/* Compatibility macros */\n\n# define M_PKCS12_x5092certbag PKCS12_x5092certbag\n# define M_PKCS12_x509crl2certbag PKCS12_x509crl2certbag\n\n# define M_PKCS12_certbag2x509 PKCS12_certbag2x509\n# define M_PKCS12_certbag2x509crl PKCS12_certbag2x509crl\n\n# define M_PKCS12_unpack_p7data PKCS12_unpack_p7data\n# define M_PKCS12_pack_authsafes PKCS12_pack_authsafes\n# define M_PKCS12_unpack_authsafes PKCS12_unpack_authsafes\n# define M_PKCS12_unpack_p7encdata PKCS12_unpack_p7encdata\n\n# define M_PKCS12_decrypt_skey PKCS12_decrypt_skey\n# define M_PKCS8_decrypt PKCS8_decrypt\n\n# define M_PKCS12_bag_type(bg) OBJ_obj2nid((bg)->type)\n# define M_PKCS12_cert_bag_type(bg) OBJ_obj2nid((bg)->value.bag->type)\n# define M_PKCS12_crl_bag_type M_PKCS12_cert_bag_type\n\n# define PKCS12_get_attr(bag, attr_nid) \\\n                         PKCS12_get_attr_gen(bag->attrib, attr_nid)\n\n# define PKCS8_get_attr(p8, attr_nid) \\\n                PKCS12_get_attr_gen(p8->attributes, attr_nid)\n\n# define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0)\n\nPKCS12_SAFEBAG *PKCS12_x5092certbag(X509 *x509);\nPKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl);\nX509 *PKCS12_certbag2x509(PKCS12_SAFEBAG *bag);\nX509_CRL *PKCS12_certbag2x509crl(PKCS12_SAFEBAG *bag);\n\nPKCS12_SAFEBAG *PKCS12_item_pack_safebag(void *obj, const ASN1_ITEM *it,\n                                         int nid1, int nid2);\nPKCS12_SAFEBAG *PKCS12_MAKE_KEYBAG(PKCS8_PRIV_KEY_INFO *p8);\nPKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *p8, const char *pass,\n                                   int passlen);\nPKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(PKCS12_SAFEBAG *bag,\n                                         const char *pass, int passlen);\nX509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher,\n                        const char *pass, int passlen, unsigned char *salt,\n                        int saltlen, int iter, PKCS8_PRIV_KEY_INFO *p8);\nPKCS12_SAFEBAG *PKCS12_MAKE_SHKEYBAG(int pbe_nid, const char *pass,\n                                     int passlen, unsigned char *salt,\n                                     int saltlen, int iter,\n                                     PKCS8_PRIV_KEY_INFO *p8);\nPKCS7 *PKCS12_pack_p7data(STACK_OF(PKCS12_SAFEBAG) *sk);\nSTACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7data(PKCS7 *p7);\nPKCS7 *PKCS12_pack_p7encdata(int pbe_nid, const char *pass, int passlen,\n                             unsigned char *salt, int saltlen, int iter,\n                             STACK_OF(PKCS12_SAFEBAG) *bags);\nSTACK_OF(PKCS12_SAFEBAG) *PKCS12_unpack_p7encdata(PKCS7 *p7, const char *pass,\n                                                  int passlen);\n\nint PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes);\nSTACK_OF(PKCS7) *PKCS12_unpack_authsafes(PKCS12 *p12);\n\nint PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,\n                          int namelen);\nint PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,\n                                int namelen);\nint PKCS12_add_CSPName_asc(PKCS12_SAFEBAG *bag, const char *name,\n                           int namelen);\nint PKCS12_add_friendlyname_uni(PKCS12_SAFEBAG *bag,\n                                const unsigned char *name, int namelen);\nint PKCS8_add_keyusage(PKCS8_PRIV_KEY_INFO *p8, int usage);\nASN1_TYPE *PKCS12_get_attr_gen(STACK_OF(X509_ATTRIBUTE) *attrs, int attr_nid);\nchar *PKCS12_get_friendlyname(PKCS12_SAFEBAG *bag);\nunsigned char *PKCS12_pbe_crypt(X509_ALGOR *algor, const char *pass,\n                                int passlen, unsigned char *in, int inlen,\n                                unsigned char **data, int *datalen,\n                                int en_de);\nvoid *PKCS12_item_decrypt_d2i(X509_ALGOR *algor, const ASN1_ITEM *it,\n                              const char *pass, int passlen,\n                              ASN1_OCTET_STRING *oct, int zbuf);\nASN1_OCTET_STRING *PKCS12_item_i2d_encrypt(X509_ALGOR *algor,\n                                           const ASN1_ITEM *it,\n                                           const char *pass, int passlen,\n                                           void *obj, int zbuf);\nPKCS12 *PKCS12_init(int mode);\nint PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt,\n                       int saltlen, int id, int iter, int n,\n                       unsigned char *out, const EVP_MD *md_type);\nint PKCS12_key_gen_uni(unsigned char *pass, int passlen, unsigned char *salt,\n                       int saltlen, int id, int iter, int n,\n                       unsigned char *out, const EVP_MD *md_type);\nint PKCS12_PBE_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,\n                        ASN1_TYPE *param, const EVP_CIPHER *cipher,\n                        const EVP_MD *md_type, int en_de);\nint PKCS12_gen_mac(PKCS12 *p12, const char *pass, int passlen,\n                   unsigned char *mac, unsigned int *maclen);\nint PKCS12_verify_mac(PKCS12 *p12, const char *pass, int passlen);\nint PKCS12_set_mac(PKCS12 *p12, const char *pass, int passlen,\n                   unsigned char *salt, int saltlen, int iter,\n                   const EVP_MD *md_type);\nint PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt,\n                     int saltlen, const EVP_MD *md_type);\nunsigned char *OPENSSL_asc2uni(const char *asc, int asclen,\n                               unsigned char **uni, int *unilen);\nchar *OPENSSL_uni2asc(unsigned char *uni, int unilen);\n\nDECLARE_ASN1_FUNCTIONS(PKCS12)\nDECLARE_ASN1_FUNCTIONS(PKCS12_MAC_DATA)\nDECLARE_ASN1_FUNCTIONS(PKCS12_SAFEBAG)\nDECLARE_ASN1_FUNCTIONS(PKCS12_BAGS)\n\nDECLARE_ASN1_ITEM(PKCS12_SAFEBAGS)\nDECLARE_ASN1_ITEM(PKCS12_AUTHSAFES)\n\nvoid PKCS12_PBE_add(void);\nint PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert,\n                 STACK_OF(X509) **ca);\nPKCS12 *PKCS12_create(char *pass, char *name, EVP_PKEY *pkey, X509 *cert,\n                      STACK_OF(X509) *ca, int nid_key, int nid_cert, int iter,\n                      int mac_iter, int keytype);\n\nPKCS12_SAFEBAG *PKCS12_add_cert(STACK_OF(PKCS12_SAFEBAG) **pbags, X509 *cert);\nPKCS12_SAFEBAG *PKCS12_add_key(STACK_OF(PKCS12_SAFEBAG) **pbags,\n                               EVP_PKEY *key, int key_usage, int iter,\n                               int key_nid, char *pass);\nint PKCS12_add_safe(STACK_OF(PKCS7) **psafes, STACK_OF(PKCS12_SAFEBAG) *bags,\n                    int safe_nid, int iter, char *pass);\nPKCS12 *PKCS12_add_safes(STACK_OF(PKCS7) *safes, int p7_nid);\n\nint i2d_PKCS12_bio(BIO *bp, PKCS12 *p12);\nint i2d_PKCS12_fp(FILE *fp, PKCS12 *p12);\nPKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12);\nPKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12);\nint PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_PKCS12_strings(void);\n\n/* Error codes for the PKCS12 functions. */\n\n/* Function codes. */\n# define PKCS12_F_PARSE_BAG                               129\n# define PKCS12_F_PARSE_BAGS                              103\n# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME                 100\n# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_ASC             127\n# define PKCS12_F_PKCS12_ADD_FRIENDLYNAME_UNI             102\n# define PKCS12_F_PKCS12_ADD_LOCALKEYID                   104\n# define PKCS12_F_PKCS12_CREATE                           105\n# define PKCS12_F_PKCS12_GEN_MAC                          107\n# define PKCS12_F_PKCS12_INIT                             109\n# define PKCS12_F_PKCS12_ITEM_DECRYPT_D2I                 106\n# define PKCS12_F_PKCS12_ITEM_I2D_ENCRYPT                 108\n# define PKCS12_F_PKCS12_ITEM_PACK_SAFEBAG                117\n# define PKCS12_F_PKCS12_KEY_GEN_ASC                      110\n# define PKCS12_F_PKCS12_KEY_GEN_UNI                      111\n# define PKCS12_F_PKCS12_MAKE_KEYBAG                      112\n# define PKCS12_F_PKCS12_MAKE_SHKEYBAG                    113\n# define PKCS12_F_PKCS12_NEWPASS                          128\n# define PKCS12_F_PKCS12_PACK_P7DATA                      114\n# define PKCS12_F_PKCS12_PACK_P7ENCDATA                   115\n# define PKCS12_F_PKCS12_PARSE                            118\n# define PKCS12_F_PKCS12_PBE_CRYPT                        119\n# define PKCS12_F_PKCS12_PBE_KEYIVGEN                     120\n# define PKCS12_F_PKCS12_SETUP_MAC                        122\n# define PKCS12_F_PKCS12_SET_MAC                          123\n# define PKCS12_F_PKCS12_UNPACK_AUTHSAFES                 130\n# define PKCS12_F_PKCS12_UNPACK_P7DATA                    131\n# define PKCS12_F_PKCS12_VERIFY_MAC                       126\n# define PKCS12_F_PKCS8_ADD_KEYUSAGE                      124\n# define PKCS12_F_PKCS8_ENCRYPT                           125\n\n/* Reason codes. */\n# define PKCS12_R_CANT_PACK_STRUCTURE                     100\n# define PKCS12_R_CONTENT_TYPE_NOT_DATA                   121\n# define PKCS12_R_DECODE_ERROR                            101\n# define PKCS12_R_ENCODE_ERROR                            102\n# define PKCS12_R_ENCRYPT_ERROR                           103\n# define PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE       120\n# define PKCS12_R_INVALID_NULL_ARGUMENT                   104\n# define PKCS12_R_INVALID_NULL_PKCS12_POINTER             105\n# define PKCS12_R_IV_GEN_ERROR                            106\n# define PKCS12_R_KEY_GEN_ERROR                           107\n# define PKCS12_R_MAC_ABSENT                              108\n# define PKCS12_R_MAC_GENERATION_ERROR                    109\n# define PKCS12_R_MAC_SETUP_ERROR                         110\n# define PKCS12_R_MAC_STRING_SET_ERROR                    111\n# define PKCS12_R_MAC_VERIFY_ERROR                        112\n# define PKCS12_R_MAC_VERIFY_FAILURE                      113\n# define PKCS12_R_PARSE_ERROR                             114\n# define PKCS12_R_PKCS12_ALGOR_CIPHERINIT_ERROR           115\n# define PKCS12_R_PKCS12_CIPHERFINAL_ERROR                116\n# define PKCS12_R_PKCS12_PBE_CRYPT_ERROR                  117\n# define PKCS12_R_UNKNOWN_DIGEST_ALGORITHM                118\n# define PKCS12_R_UNSUPPORTED_PKCS12_MODE                 119\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/pkcs7.h",
    "content": "/* crypto/pkcs7/pkcs7.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_PKCS7_H\n# define HEADER_PKCS7_H\n\n# include <openssl/asn1.h>\n# include <openssl/bio.h>\n# include <openssl/e_os2.h>\n\n# include <openssl/symhacks.h>\n# include <openssl/ossl_typ.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# ifdef OPENSSL_SYS_WIN32\n/* Under Win32 thes are defined in wincrypt.h */\n#  undef PKCS7_ISSUER_AND_SERIAL\n#  undef PKCS7_SIGNER_INFO\n# endif\n\n/*-\nEncryption_ID           DES-CBC\nDigest_ID               MD5\nDigest_Encryption_ID    rsaEncryption\nKey_Encryption_ID       rsaEncryption\n*/\n\ntypedef struct pkcs7_issuer_and_serial_st {\n    X509_NAME *issuer;\n    ASN1_INTEGER *serial;\n} PKCS7_ISSUER_AND_SERIAL;\n\ntypedef struct pkcs7_signer_info_st {\n    ASN1_INTEGER *version;      /* version 1 */\n    PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;\n    X509_ALGOR *digest_alg;\n    STACK_OF(X509_ATTRIBUTE) *auth_attr; /* [ 0 ] */\n    X509_ALGOR *digest_enc_alg;\n    ASN1_OCTET_STRING *enc_digest;\n    STACK_OF(X509_ATTRIBUTE) *unauth_attr; /* [ 1 ] */\n    /* The private key to sign with */\n    EVP_PKEY *pkey;\n} PKCS7_SIGNER_INFO;\n\nDECLARE_STACK_OF(PKCS7_SIGNER_INFO)\nDECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO)\n\ntypedef struct pkcs7_recip_info_st {\n    ASN1_INTEGER *version;      /* version 0 */\n    PKCS7_ISSUER_AND_SERIAL *issuer_and_serial;\n    X509_ALGOR *key_enc_algor;\n    ASN1_OCTET_STRING *enc_key;\n    X509 *cert;                 /* get the pub-key from this */\n} PKCS7_RECIP_INFO;\n\nDECLARE_STACK_OF(PKCS7_RECIP_INFO)\nDECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO)\n\ntypedef struct pkcs7_signed_st {\n    ASN1_INTEGER *version;      /* version 1 */\n    STACK_OF(X509_ALGOR) *md_algs; /* md used */\n    STACK_OF(X509) *cert;       /* [ 0 ] */\n    STACK_OF(X509_CRL) *crl;    /* [ 1 ] */\n    STACK_OF(PKCS7_SIGNER_INFO) *signer_info;\n    struct pkcs7_st *contents;\n} PKCS7_SIGNED;\n/*\n * The above structure is very very similar to PKCS7_SIGN_ENVELOPE. How about\n * merging the two\n */\n\ntypedef struct pkcs7_enc_content_st {\n    ASN1_OBJECT *content_type;\n    X509_ALGOR *algorithm;\n    ASN1_OCTET_STRING *enc_data; /* [ 0 ] */\n    const EVP_CIPHER *cipher;\n} PKCS7_ENC_CONTENT;\n\ntypedef struct pkcs7_enveloped_st {\n    ASN1_INTEGER *version;      /* version 0 */\n    STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;\n    PKCS7_ENC_CONTENT *enc_data;\n} PKCS7_ENVELOPE;\n\ntypedef struct pkcs7_signedandenveloped_st {\n    ASN1_INTEGER *version;      /* version 1 */\n    STACK_OF(X509_ALGOR) *md_algs; /* md used */\n    STACK_OF(X509) *cert;       /* [ 0 ] */\n    STACK_OF(X509_CRL) *crl;    /* [ 1 ] */\n    STACK_OF(PKCS7_SIGNER_INFO) *signer_info;\n    PKCS7_ENC_CONTENT *enc_data;\n    STACK_OF(PKCS7_RECIP_INFO) *recipientinfo;\n} PKCS7_SIGN_ENVELOPE;\n\ntypedef struct pkcs7_digest_st {\n    ASN1_INTEGER *version;      /* version 0 */\n    X509_ALGOR *md;             /* md used */\n    struct pkcs7_st *contents;\n    ASN1_OCTET_STRING *digest;\n} PKCS7_DIGEST;\n\ntypedef struct pkcs7_encrypted_st {\n    ASN1_INTEGER *version;      /* version 0 */\n    PKCS7_ENC_CONTENT *enc_data;\n} PKCS7_ENCRYPT;\n\ntypedef struct pkcs7_st {\n    /*\n     * The following is non NULL if it contains ASN1 encoding of this\n     * structure\n     */\n    unsigned char *asn1;\n    long length;\n# define PKCS7_S_HEADER  0\n# define PKCS7_S_BODY    1\n# define PKCS7_S_TAIL    2\n    int state;                  /* used during processing */\n    int detached;\n    ASN1_OBJECT *type;\n    /* content as defined by the type */\n    /*\n     * all encryption/message digests are applied to the 'contents', leaving\n     * out the 'type' field.\n     */\n    union {\n        char *ptr;\n        /* NID_pkcs7_data */\n        ASN1_OCTET_STRING *data;\n        /* NID_pkcs7_signed */\n        PKCS7_SIGNED *sign;\n        /* NID_pkcs7_enveloped */\n        PKCS7_ENVELOPE *enveloped;\n        /* NID_pkcs7_signedAndEnveloped */\n        PKCS7_SIGN_ENVELOPE *signed_and_enveloped;\n        /* NID_pkcs7_digest */\n        PKCS7_DIGEST *digest;\n        /* NID_pkcs7_encrypted */\n        PKCS7_ENCRYPT *encrypted;\n        /* Anything else */\n        ASN1_TYPE *other;\n    } d;\n} PKCS7;\n\nDECLARE_STACK_OF(PKCS7)\nDECLARE_ASN1_SET_OF(PKCS7)\nDECLARE_PKCS12_STACK_OF(PKCS7)\n\n# define PKCS7_OP_SET_DETACHED_SIGNATURE 1\n# define PKCS7_OP_GET_DETACHED_SIGNATURE 2\n\n# define PKCS7_get_signed_attributes(si) ((si)->auth_attr)\n# define PKCS7_get_attributes(si)        ((si)->unauth_attr)\n\n# define PKCS7_type_is_signed(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_signed)\n# define PKCS7_type_is_encrypted(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_encrypted)\n# define PKCS7_type_is_enveloped(a) (OBJ_obj2nid((a)->type) == NID_pkcs7_enveloped)\n# define PKCS7_type_is_signedAndEnveloped(a) \\\n                (OBJ_obj2nid((a)->type) == NID_pkcs7_signedAndEnveloped)\n# define PKCS7_type_is_data(a)   (OBJ_obj2nid((a)->type) == NID_pkcs7_data)\n# define PKCS7_type_is_digest(a)   (OBJ_obj2nid((a)->type) == NID_pkcs7_digest)\n\n# define PKCS7_set_detached(p,v) \\\n                PKCS7_ctrl(p,PKCS7_OP_SET_DETACHED_SIGNATURE,v,NULL)\n# define PKCS7_get_detached(p) \\\n                PKCS7_ctrl(p,PKCS7_OP_GET_DETACHED_SIGNATURE,0,NULL)\n\n# define PKCS7_is_detached(p7) (PKCS7_type_is_signed(p7) && PKCS7_get_detached(p7))\n\n/* S/MIME related flags */\n\n# define PKCS7_TEXT              0x1\n# define PKCS7_NOCERTS           0x2\n# define PKCS7_NOSIGS            0x4\n# define PKCS7_NOCHAIN           0x8\n# define PKCS7_NOINTERN          0x10\n# define PKCS7_NOVERIFY          0x20\n# define PKCS7_DETACHED          0x40\n# define PKCS7_BINARY            0x80\n# define PKCS7_NOATTR            0x100\n# define PKCS7_NOSMIMECAP        0x200\n# define PKCS7_NOOLDMIMETYPE     0x400\n# define PKCS7_CRLFEOL           0x800\n# define PKCS7_STREAM            0x1000\n# define PKCS7_NOCRL             0x2000\n# define PKCS7_PARTIAL           0x4000\n# define PKCS7_REUSE_DIGEST      0x8000\n\n/* Flags: for compatibility with older code */\n\n# define SMIME_TEXT      PKCS7_TEXT\n# define SMIME_NOCERTS   PKCS7_NOCERTS\n# define SMIME_NOSIGS    PKCS7_NOSIGS\n# define SMIME_NOCHAIN   PKCS7_NOCHAIN\n# define SMIME_NOINTERN  PKCS7_NOINTERN\n# define SMIME_NOVERIFY  PKCS7_NOVERIFY\n# define SMIME_DETACHED  PKCS7_DETACHED\n# define SMIME_BINARY    PKCS7_BINARY\n# define SMIME_NOATTR    PKCS7_NOATTR\n\nDECLARE_ASN1_FUNCTIONS(PKCS7_ISSUER_AND_SERIAL)\n\nint PKCS7_ISSUER_AND_SERIAL_digest(PKCS7_ISSUER_AND_SERIAL *data,\n                                   const EVP_MD *type, unsigned char *md,\n                                   unsigned int *len);\n# ifndef OPENSSL_NO_FP_API\nPKCS7 *d2i_PKCS7_fp(FILE *fp, PKCS7 **p7);\nint i2d_PKCS7_fp(FILE *fp, PKCS7 *p7);\n# endif\nPKCS7 *PKCS7_dup(PKCS7 *p7);\nPKCS7 *d2i_PKCS7_bio(BIO *bp, PKCS7 **p7);\nint i2d_PKCS7_bio(BIO *bp, PKCS7 *p7);\nint i2d_PKCS7_bio_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);\nint PEM_write_bio_PKCS7_stream(BIO *out, PKCS7 *p7, BIO *in, int flags);\n\nDECLARE_ASN1_FUNCTIONS(PKCS7_SIGNER_INFO)\nDECLARE_ASN1_FUNCTIONS(PKCS7_RECIP_INFO)\nDECLARE_ASN1_FUNCTIONS(PKCS7_SIGNED)\nDECLARE_ASN1_FUNCTIONS(PKCS7_ENC_CONTENT)\nDECLARE_ASN1_FUNCTIONS(PKCS7_ENVELOPE)\nDECLARE_ASN1_FUNCTIONS(PKCS7_SIGN_ENVELOPE)\nDECLARE_ASN1_FUNCTIONS(PKCS7_DIGEST)\nDECLARE_ASN1_FUNCTIONS(PKCS7_ENCRYPT)\nDECLARE_ASN1_FUNCTIONS(PKCS7)\n\nDECLARE_ASN1_ITEM(PKCS7_ATTR_SIGN)\nDECLARE_ASN1_ITEM(PKCS7_ATTR_VERIFY)\n\nDECLARE_ASN1_NDEF_FUNCTION(PKCS7)\nDECLARE_ASN1_PRINT_FUNCTION(PKCS7)\n\nlong PKCS7_ctrl(PKCS7 *p7, int cmd, long larg, char *parg);\n\nint PKCS7_set_type(PKCS7 *p7, int type);\nint PKCS7_set0_type_other(PKCS7 *p7, int type, ASN1_TYPE *other);\nint PKCS7_set_content(PKCS7 *p7, PKCS7 *p7_data);\nint PKCS7_SIGNER_INFO_set(PKCS7_SIGNER_INFO *p7i, X509 *x509, EVP_PKEY *pkey,\n                          const EVP_MD *dgst);\nint PKCS7_SIGNER_INFO_sign(PKCS7_SIGNER_INFO *si);\nint PKCS7_add_signer(PKCS7 *p7, PKCS7_SIGNER_INFO *p7i);\nint PKCS7_add_certificate(PKCS7 *p7, X509 *x509);\nint PKCS7_add_crl(PKCS7 *p7, X509_CRL *x509);\nint PKCS7_content_new(PKCS7 *p7, int nid);\nint PKCS7_dataVerify(X509_STORE *cert_store, X509_STORE_CTX *ctx,\n                     BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si);\nint PKCS7_signatureVerify(BIO *bio, PKCS7 *p7, PKCS7_SIGNER_INFO *si,\n                          X509 *x509);\n\nBIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio);\nint PKCS7_dataFinal(PKCS7 *p7, BIO *bio);\nBIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert);\n\nPKCS7_SIGNER_INFO *PKCS7_add_signature(PKCS7 *p7, X509 *x509,\n                                       EVP_PKEY *pkey, const EVP_MD *dgst);\nX509 *PKCS7_cert_from_signer_info(PKCS7 *p7, PKCS7_SIGNER_INFO *si);\nint PKCS7_set_digest(PKCS7 *p7, const EVP_MD *md);\nSTACK_OF(PKCS7_SIGNER_INFO) *PKCS7_get_signer_info(PKCS7 *p7);\n\nPKCS7_RECIP_INFO *PKCS7_add_recipient(PKCS7 *p7, X509 *x509);\nvoid PKCS7_SIGNER_INFO_get0_algs(PKCS7_SIGNER_INFO *si, EVP_PKEY **pk,\n                                 X509_ALGOR **pdig, X509_ALGOR **psig);\nvoid PKCS7_RECIP_INFO_get0_alg(PKCS7_RECIP_INFO *ri, X509_ALGOR **penc);\nint PKCS7_add_recipient_info(PKCS7 *p7, PKCS7_RECIP_INFO *ri);\nint PKCS7_RECIP_INFO_set(PKCS7_RECIP_INFO *p7i, X509 *x509);\nint PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher);\nint PKCS7_stream(unsigned char ***boundary, PKCS7 *p7);\n\nPKCS7_ISSUER_AND_SERIAL *PKCS7_get_issuer_and_serial(PKCS7 *p7, int idx);\nASN1_OCTET_STRING *PKCS7_digest_from_attributes(STACK_OF(X509_ATTRIBUTE) *sk);\nint PKCS7_add_signed_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int type,\n                               void *data);\nint PKCS7_add_attribute(PKCS7_SIGNER_INFO *p7si, int nid, int atrtype,\n                        void *value);\nASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid);\nASN1_TYPE *PKCS7_get_signed_attribute(PKCS7_SIGNER_INFO *si, int nid);\nint PKCS7_set_signed_attributes(PKCS7_SIGNER_INFO *p7si,\n                                STACK_OF(X509_ATTRIBUTE) *sk);\nint PKCS7_set_attributes(PKCS7_SIGNER_INFO *p7si,\n                         STACK_OF(X509_ATTRIBUTE) *sk);\n\nPKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs,\n                  BIO *data, int flags);\n\nPKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7,\n                                         X509 *signcert, EVP_PKEY *pkey,\n                                         const EVP_MD *md, int flags);\n\nint PKCS7_final(PKCS7 *p7, BIO *data, int flags);\nint PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store,\n                 BIO *indata, BIO *out, int flags);\nSTACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs,\n                                   int flags);\nPKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher,\n                     int flags);\nint PKCS7_decrypt(PKCS7 *p7, EVP_PKEY *pkey, X509 *cert, BIO *data,\n                  int flags);\n\nint PKCS7_add_attrib_smimecap(PKCS7_SIGNER_INFO *si,\n                              STACK_OF(X509_ALGOR) *cap);\nSTACK_OF(X509_ALGOR) *PKCS7_get_smimecap(PKCS7_SIGNER_INFO *si);\nint PKCS7_simple_smimecap(STACK_OF(X509_ALGOR) *sk, int nid, int arg);\n\nint PKCS7_add_attrib_content_type(PKCS7_SIGNER_INFO *si, ASN1_OBJECT *coid);\nint PKCS7_add0_attrib_signing_time(PKCS7_SIGNER_INFO *si, ASN1_TIME *t);\nint PKCS7_add1_attrib_digest(PKCS7_SIGNER_INFO *si,\n                             const unsigned char *md, int mdlen);\n\nint SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags);\nPKCS7 *SMIME_read_PKCS7(BIO *bio, BIO **bcont);\n\nBIO *BIO_new_PKCS7(BIO *out, PKCS7 *p7);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_PKCS7_strings(void);\n\n/* Error codes for the PKCS7 functions. */\n\n/* Function codes. */\n# define PKCS7_F_B64_READ_PKCS7                           120\n# define PKCS7_F_B64_WRITE_PKCS7                          121\n# define PKCS7_F_DO_PKCS7_SIGNED_ATTRIB                   136\n# define PKCS7_F_I2D_PKCS7_BIO_STREAM                     140\n# define PKCS7_F_PKCS7_ADD0_ATTRIB_SIGNING_TIME           135\n# define PKCS7_F_PKCS7_ADD_ATTRIB_SMIMECAP                118\n# define PKCS7_F_PKCS7_ADD_CERTIFICATE                    100\n# define PKCS7_F_PKCS7_ADD_CRL                            101\n# define PKCS7_F_PKCS7_ADD_RECIPIENT_INFO                 102\n# define PKCS7_F_PKCS7_ADD_SIGNATURE                      131\n# define PKCS7_F_PKCS7_ADD_SIGNER                         103\n# define PKCS7_F_PKCS7_BIO_ADD_DIGEST                     125\n# define PKCS7_F_PKCS7_COPY_EXISTING_DIGEST               138\n# define PKCS7_F_PKCS7_CTRL                               104\n# define PKCS7_F_PKCS7_DATADECODE                         112\n# define PKCS7_F_PKCS7_DATAFINAL                          128\n# define PKCS7_F_PKCS7_DATAINIT                           105\n# define PKCS7_F_PKCS7_DATASIGN                           106\n# define PKCS7_F_PKCS7_DATAVERIFY                         107\n# define PKCS7_F_PKCS7_DECRYPT                            114\n# define PKCS7_F_PKCS7_DECRYPT_RINFO                      133\n# define PKCS7_F_PKCS7_ENCODE_RINFO                       132\n# define PKCS7_F_PKCS7_ENCRYPT                            115\n# define PKCS7_F_PKCS7_FINAL                              134\n# define PKCS7_F_PKCS7_FIND_DIGEST                        127\n# define PKCS7_F_PKCS7_GET0_SIGNERS                       124\n# define PKCS7_F_PKCS7_RECIP_INFO_SET                     130\n# define PKCS7_F_PKCS7_SET_CIPHER                         108\n# define PKCS7_F_PKCS7_SET_CONTENT                        109\n# define PKCS7_F_PKCS7_SET_DIGEST                         126\n# define PKCS7_F_PKCS7_SET_TYPE                           110\n# define PKCS7_F_PKCS7_SIGN                               116\n# define PKCS7_F_PKCS7_SIGNATUREVERIFY                    113\n# define PKCS7_F_PKCS7_SIGNER_INFO_SET                    129\n# define PKCS7_F_PKCS7_SIGNER_INFO_SIGN                   139\n# define PKCS7_F_PKCS7_SIGN_ADD_SIGNER                    137\n# define PKCS7_F_PKCS7_SIMPLE_SMIMECAP                    119\n# define PKCS7_F_PKCS7_VERIFY                             117\n# define PKCS7_F_SMIME_READ_PKCS7                         122\n# define PKCS7_F_SMIME_TEXT                               123\n\n/* Reason codes. */\n# define PKCS7_R_CERTIFICATE_VERIFY_ERROR                 117\n# define PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER          144\n# define PKCS7_R_CIPHER_NOT_INITIALIZED                   116\n# define PKCS7_R_CONTENT_AND_DATA_PRESENT                 118\n# define PKCS7_R_CTRL_ERROR                               152\n# define PKCS7_R_DECODE_ERROR                             130\n# define PKCS7_R_DECRYPTED_KEY_IS_WRONG_LENGTH            100\n# define PKCS7_R_DECRYPT_ERROR                            119\n# define PKCS7_R_DIGEST_FAILURE                           101\n# define PKCS7_R_ENCRYPTION_CTRL_FAILURE                  149\n# define PKCS7_R_ENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPE 150\n# define PKCS7_R_ERROR_ADDING_RECIPIENT                   120\n# define PKCS7_R_ERROR_SETTING_CIPHER                     121\n# define PKCS7_R_INVALID_MIME_TYPE                        131\n# define PKCS7_R_INVALID_NULL_POINTER                     143\n# define PKCS7_R_INVALID_SIGNED_DATA_TYPE                 155\n# define PKCS7_R_MIME_NO_CONTENT_TYPE                     132\n# define PKCS7_R_MIME_PARSE_ERROR                         133\n# define PKCS7_R_MIME_SIG_PARSE_ERROR                     134\n# define PKCS7_R_MISSING_CERIPEND_INFO                    103\n# define PKCS7_R_NO_CONTENT                               122\n# define PKCS7_R_NO_CONTENT_TYPE                          135\n# define PKCS7_R_NO_DEFAULT_DIGEST                        151\n# define PKCS7_R_NO_MATCHING_DIGEST_TYPE_FOUND            154\n# define PKCS7_R_NO_MULTIPART_BODY_FAILURE                136\n# define PKCS7_R_NO_MULTIPART_BOUNDARY                    137\n# define PKCS7_R_NO_RECIPIENT_MATCHES_CERTIFICATE         115\n# define PKCS7_R_NO_RECIPIENT_MATCHES_KEY                 146\n# define PKCS7_R_NO_SIGNATURES_ON_DATA                    123\n# define PKCS7_R_NO_SIGNERS                               142\n# define PKCS7_R_NO_SIG_CONTENT_TYPE                      138\n# define PKCS7_R_OPERATION_NOT_SUPPORTED_ON_THIS_TYPE     104\n# define PKCS7_R_PKCS7_ADD_SIGNATURE_ERROR                124\n# define PKCS7_R_PKCS7_ADD_SIGNER_ERROR                   153\n# define PKCS7_R_PKCS7_DATAFINAL                          126\n# define PKCS7_R_PKCS7_DATAFINAL_ERROR                    125\n# define PKCS7_R_PKCS7_DATASIGN                           145\n# define PKCS7_R_PKCS7_PARSE_ERROR                        139\n# define PKCS7_R_PKCS7_SIG_PARSE_ERROR                    140\n# define PKCS7_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE   127\n# define PKCS7_R_SIGNATURE_FAILURE                        105\n# define PKCS7_R_SIGNER_CERTIFICATE_NOT_FOUND             128\n# define PKCS7_R_SIGNING_CTRL_FAILURE                     147\n# define PKCS7_R_SIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPE  148\n# define PKCS7_R_SIG_INVALID_MIME_TYPE                    141\n# define PKCS7_R_SMIME_TEXT_ERROR                         129\n# define PKCS7_R_UNABLE_TO_FIND_CERTIFICATE               106\n# define PKCS7_R_UNABLE_TO_FIND_MEM_BIO                   107\n# define PKCS7_R_UNABLE_TO_FIND_MESSAGE_DIGEST            108\n# define PKCS7_R_UNKNOWN_DIGEST_TYPE                      109\n# define PKCS7_R_UNKNOWN_OPERATION                        110\n# define PKCS7_R_UNSUPPORTED_CIPHER_TYPE                  111\n# define PKCS7_R_UNSUPPORTED_CONTENT_TYPE                 112\n# define PKCS7_R_WRONG_CONTENT_TYPE                       113\n# define PKCS7_R_WRONG_PKCS7_TYPE                         114\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/pqueue.h",
    "content": "/* crypto/pqueue/pqueue.h */\n/*\n * DTLS implementation written by Nagendra Modadugu\n * (nagendra@cs.stanford.edu) for the OpenSSL project 2005.\n */\n/* ====================================================================\n * Copyright (c) 1999-2005 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_PQUEUE_H\n# define HEADER_PQUEUE_H\n\n# include <stdio.h>\n# include <stdlib.h>\n# include <string.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\ntypedef struct _pqueue *pqueue;\n\ntypedef struct _pitem {\n    unsigned char priority[8];  /* 64-bit value in big-endian encoding */\n    void *data;\n    struct _pitem *next;\n} pitem;\n\ntypedef struct _pitem *piterator;\n\npitem *pitem_new(unsigned char *prio64be, void *data);\nvoid pitem_free(pitem *item);\n\npqueue pqueue_new(void);\nvoid pqueue_free(pqueue pq);\n\npitem *pqueue_insert(pqueue pq, pitem *item);\npitem *pqueue_peek(pqueue pq);\npitem *pqueue_pop(pqueue pq);\npitem *pqueue_find(pqueue pq, unsigned char *prio64be);\npitem *pqueue_iterator(pqueue pq);\npitem *pqueue_next(piterator *iter);\n\nvoid pqueue_print(pqueue pq);\nint pqueue_size(pqueue pq);\n\n#ifdef  __cplusplus\n}\n#endif\n#endif                          /* ! HEADER_PQUEUE_H */\n"
  },
  {
    "path": "third_party/include/openssl/rand.h",
    "content": "/* crypto/rand/rand.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_RAND_H\n# define HEADER_RAND_H\n\n# include <stdlib.h>\n# include <openssl/ossl_typ.h>\n# include <openssl/e_os2.h>\n\n# if defined(OPENSSL_SYS_WINDOWS)\n#  include <windows.h>\n# endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# if defined(OPENSSL_FIPS)\n#  define FIPS_RAND_SIZE_T size_t\n# endif\n\n/* Already defined in ossl_typ.h */\n/* typedef struct rand_meth_st RAND_METHOD; */\n\nstruct rand_meth_st {\n    void (*seed) (const void *buf, int num);\n    int (*bytes) (unsigned char *buf, int num);\n    void (*cleanup) (void);\n    void (*add) (const void *buf, int num, double entropy);\n    int (*pseudorand) (unsigned char *buf, int num);\n    int (*status) (void);\n};\n\n# ifdef BN_DEBUG\nextern int rand_predictable;\n# endif\n\nint RAND_set_rand_method(const RAND_METHOD *meth);\nconst RAND_METHOD *RAND_get_rand_method(void);\n# ifndef OPENSSL_NO_ENGINE\nint RAND_set_rand_engine(ENGINE *engine);\n# endif\nRAND_METHOD *RAND_SSLeay(void);\nvoid RAND_cleanup(void);\nint RAND_bytes(unsigned char *buf, int num);\nint RAND_pseudo_bytes(unsigned char *buf, int num);\nvoid RAND_seed(const void *buf, int num);\nvoid RAND_add(const void *buf, int num, double entropy);\nint RAND_load_file(const char *file, long max_bytes);\nint RAND_write_file(const char *file);\nconst char *RAND_file_name(char *file, size_t num);\nint RAND_status(void);\nint RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes);\nint RAND_egd(const char *path);\nint RAND_egd_bytes(const char *path, int bytes);\nint RAND_poll(void);\n\n# if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)\n\nvoid RAND_screen(void);\nint RAND_event(UINT, WPARAM, LPARAM);\n\n# endif\n\n# ifdef OPENSSL_FIPS\nvoid RAND_set_fips_drbg_type(int type, int flags);\nint RAND_init_fips(void);\n# endif\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_RAND_strings(void);\n\n/* Error codes for the RAND functions. */\n\n/* Function codes. */\n# define RAND_F_RAND_GET_RAND_METHOD                      101\n# define RAND_F_RAND_INIT_FIPS                            102\n# define RAND_F_SSLEAY_RAND_BYTES                         100\n\n/* Reason codes. */\n# define RAND_R_DUAL_EC_DRBG_DISABLED                     104\n# define RAND_R_ERROR_INITIALISING_DRBG                   102\n# define RAND_R_ERROR_INSTANTIATING_DRBG                  103\n# define RAND_R_NO_FIPS_RANDOM_METHOD_SET                 101\n# define RAND_R_PRNG_NOT_SEEDED                           100\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/rc2.h",
    "content": "/* crypto/rc2/rc2.h */\n/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_RC2_H\n# define HEADER_RC2_H\n\n# include <openssl/opensslconf.h>/* OPENSSL_NO_RC2, RC2_INT */\n# ifdef OPENSSL_NO_RC2\n#  error RC2 is disabled.\n# endif\n\n# define RC2_ENCRYPT     1\n# define RC2_DECRYPT     0\n\n# define RC2_BLOCK       8\n# define RC2_KEY_LENGTH  16\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct rc2_key_st {\n    RC2_INT data[64];\n} RC2_KEY;\n\n# ifdef OPENSSL_FIPS\nvoid private_RC2_set_key(RC2_KEY *key, int len, const unsigned char *data,\n                         int bits);\n# endif\nvoid RC2_set_key(RC2_KEY *key, int len, const unsigned char *data, int bits);\nvoid RC2_ecb_encrypt(const unsigned char *in, unsigned char *out,\n                     RC2_KEY *key, int enc);\nvoid RC2_encrypt(unsigned long *data, RC2_KEY *key);\nvoid RC2_decrypt(unsigned long *data, RC2_KEY *key);\nvoid RC2_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,\n                     RC2_KEY *ks, unsigned char *iv, int enc);\nvoid RC2_cfb64_encrypt(const unsigned char *in, unsigned char *out,\n                       long length, RC2_KEY *schedule, unsigned char *ivec,\n                       int *num, int enc);\nvoid RC2_ofb64_encrypt(const unsigned char *in, unsigned char *out,\n                       long length, RC2_KEY *schedule, unsigned char *ivec,\n                       int *num);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/rc4.h",
    "content": "/* crypto/rc4/rc4.h */\n/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_RC4_H\n# define HEADER_RC4_H\n\n# include <openssl/opensslconf.h>/* OPENSSL_NO_RC4, RC4_INT */\n# ifdef OPENSSL_NO_RC4\n#  error RC4 is disabled.\n# endif\n\n# include <stddef.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct rc4_key_st {\n    RC4_INT x, y;\n    RC4_INT data[256];\n} RC4_KEY;\n\nconst char *RC4_options(void);\nvoid RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);\nvoid private_RC4_set_key(RC4_KEY *key, int len, const unsigned char *data);\nvoid RC4(RC4_KEY *key, size_t len, const unsigned char *indata,\n         unsigned char *outdata);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/ripemd.h",
    "content": "/* crypto/ripemd/ripemd.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_RIPEMD_H\n# define HEADER_RIPEMD_H\n\n# include <openssl/e_os2.h>\n# include <stddef.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# ifdef OPENSSL_NO_RIPEMD\n#  error RIPEMD is disabled.\n# endif\n\n# if defined(__LP32__)\n#  define RIPEMD160_LONG unsigned long\n# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)\n#  define RIPEMD160_LONG unsigned long\n#  define RIPEMD160_LONG_LOG2 3\n# else\n#  define RIPEMD160_LONG unsigned int\n# endif\n\n# define RIPEMD160_CBLOCK        64\n# define RIPEMD160_LBLOCK        (RIPEMD160_CBLOCK/4)\n# define RIPEMD160_DIGEST_LENGTH 20\n\ntypedef struct RIPEMD160state_st {\n    RIPEMD160_LONG A, B, C, D, E;\n    RIPEMD160_LONG Nl, Nh;\n    RIPEMD160_LONG data[RIPEMD160_LBLOCK];\n    unsigned int num;\n} RIPEMD160_CTX;\n\n# ifdef OPENSSL_FIPS\nint private_RIPEMD160_Init(RIPEMD160_CTX *c);\n# endif\nint RIPEMD160_Init(RIPEMD160_CTX *c);\nint RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, size_t len);\nint RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c);\nunsigned char *RIPEMD160(const unsigned char *d, size_t n, unsigned char *md);\nvoid RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b);\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/rsa.h",
    "content": "/* crypto/rsa/rsa.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_RSA_H\n# define HEADER_RSA_H\n\n# include <openssl/asn1.h>\n\n# ifndef OPENSSL_NO_BIO\n#  include <openssl/bio.h>\n# endif\n# include <openssl/crypto.h>\n# include <openssl/ossl_typ.h>\n# ifndef OPENSSL_NO_DEPRECATED\n#  include <openssl/bn.h>\n# endif\n\n# ifdef OPENSSL_NO_RSA\n#  error RSA is disabled.\n# endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* Declared already in ossl_typ.h */\n/* typedef struct rsa_st RSA; */\n/* typedef struct rsa_meth_st RSA_METHOD; */\n\nstruct rsa_meth_st {\n    const char *name;\n    int (*rsa_pub_enc) (int flen, const unsigned char *from,\n                        unsigned char *to, RSA *rsa, int padding);\n    int (*rsa_pub_dec) (int flen, const unsigned char *from,\n                        unsigned char *to, RSA *rsa, int padding);\n    int (*rsa_priv_enc) (int flen, const unsigned char *from,\n                         unsigned char *to, RSA *rsa, int padding);\n    int (*rsa_priv_dec) (int flen, const unsigned char *from,\n                         unsigned char *to, RSA *rsa, int padding);\n    /* Can be null */\n    int (*rsa_mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);\n    /* Can be null */\n    int (*bn_mod_exp) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p,\n                       const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx);\n    /* called at new */\n    int (*init) (RSA *rsa);\n    /* called at free */\n    int (*finish) (RSA *rsa);\n    /* RSA_METHOD_FLAG_* things */\n    int flags;\n    /* may be needed! */\n    char *app_data;\n    /*\n     * New sign and verify functions: some libraries don't allow arbitrary\n     * data to be signed/verified: this allows them to be used. Note: for\n     * this to work the RSA_public_decrypt() and RSA_private_encrypt() should\n     * *NOT* be used RSA_sign(), RSA_verify() should be used instead. Note:\n     * for backwards compatibility this functionality is only enabled if the\n     * RSA_FLAG_SIGN_VER option is set in 'flags'.\n     */\n    int (*rsa_sign) (int type,\n                     const unsigned char *m, unsigned int m_length,\n                     unsigned char *sigret, unsigned int *siglen,\n                     const RSA *rsa);\n    int (*rsa_verify) (int dtype, const unsigned char *m,\n                       unsigned int m_length, const unsigned char *sigbuf,\n                       unsigned int siglen, const RSA *rsa);\n    /*\n     * If this callback is NULL, the builtin software RSA key-gen will be\n     * used. This is for behavioural compatibility whilst the code gets\n     * rewired, but one day it would be nice to assume there are no such\n     * things as \"builtin software\" implementations.\n     */\n    int (*rsa_keygen) (RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);\n};\n\nstruct rsa_st {\n    /*\n     * The first parameter is used to pickup errors where this is passed\n     * instead of aEVP_PKEY, it is set to 0\n     */\n    int pad;\n    long version;\n    const RSA_METHOD *meth;\n    /* functional reference if 'meth' is ENGINE-provided */\n    ENGINE *engine;\n    BIGNUM *n;\n    BIGNUM *e;\n    BIGNUM *d;\n    BIGNUM *p;\n    BIGNUM *q;\n    BIGNUM *dmp1;\n    BIGNUM *dmq1;\n    BIGNUM *iqmp;\n    /* be careful using this if the RSA structure is shared */\n    CRYPTO_EX_DATA ex_data;\n    int references;\n    int flags;\n    /* Used to cache montgomery values */\n    BN_MONT_CTX *_method_mod_n;\n    BN_MONT_CTX *_method_mod_p;\n    BN_MONT_CTX *_method_mod_q;\n    /*\n     * all BIGNUM values are actually in the following data, if it is not\n     * NULL\n     */\n    char *bignum_data;\n    BN_BLINDING *blinding;\n    BN_BLINDING *mt_blinding;\n};\n\n# ifndef OPENSSL_RSA_MAX_MODULUS_BITS\n#  define OPENSSL_RSA_MAX_MODULUS_BITS   16384\n# endif\n\n# ifndef OPENSSL_RSA_SMALL_MODULUS_BITS\n#  define OPENSSL_RSA_SMALL_MODULUS_BITS 3072\n# endif\n# ifndef OPENSSL_RSA_MAX_PUBEXP_BITS\n\n/* exponent limit enforced for \"large\" modulus only */\n#  define OPENSSL_RSA_MAX_PUBEXP_BITS    64\n# endif\n\n# define RSA_3   0x3L\n# define RSA_F4  0x10001L\n\n# define RSA_METHOD_FLAG_NO_CHECK        0x0001/* don't check pub/private\n                                                * match */\n\n# define RSA_FLAG_CACHE_PUBLIC           0x0002\n# define RSA_FLAG_CACHE_PRIVATE          0x0004\n# define RSA_FLAG_BLINDING               0x0008\n# define RSA_FLAG_THREAD_SAFE            0x0010\n/*\n * This flag means the private key operations will be handled by rsa_mod_exp\n * and that they do not depend on the private key components being present:\n * for example a key stored in external hardware. Without this flag\n * bn_mod_exp gets called when private key components are absent.\n */\n# define RSA_FLAG_EXT_PKEY               0x0020\n\n/*\n * This flag in the RSA_METHOD enables the new rsa_sign, rsa_verify\n * functions.\n */\n# define RSA_FLAG_SIGN_VER               0x0040\n\n/*\n * new with 0.9.6j and 0.9.7b; the built-in\n * RSA implementation now uses blinding by\n * default (ignoring RSA_FLAG_BLINDING),\n * but other engines might not need it\n */\n# define RSA_FLAG_NO_BLINDING            0x0080\n/*\n * new with 0.9.8f; the built-in RSA\n * implementation now uses constant time\n * operations by default in private key operations,\n * e.g., constant time modular exponentiation,\n * modular inverse without leaking branches,\n * division without leaking branches. This\n * flag disables these constant time\n * operations and results in faster RSA\n * private key operations.\n */\n# define RSA_FLAG_NO_CONSTTIME           0x0100\n# ifdef OPENSSL_USE_DEPRECATED\n/* deprecated name for the flag*/\n/*\n * new with 0.9.7h; the built-in RSA\n * implementation now uses constant time\n * modular exponentiation for secret exponents\n * by default. This flag causes the\n * faster variable sliding window method to\n * be used for all exponents.\n */\n#  define RSA_FLAG_NO_EXP_CONSTTIME RSA_FLAG_NO_CONSTTIME\n# endif\n\n# define EVP_PKEY_CTX_set_rsa_padding(ctx, pad) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, EVP_PKEY_CTRL_RSA_PADDING, \\\n                                pad, NULL)\n\n# define EVP_PKEY_CTX_get_rsa_padding(ctx, ppad) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, -1, \\\n                                EVP_PKEY_CTRL_GET_RSA_PADDING, 0, ppad)\n\n# define EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, len) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \\\n                                (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \\\n                                EVP_PKEY_CTRL_RSA_PSS_SALTLEN, \\\n                                len, NULL)\n\n# define EVP_PKEY_CTX_get_rsa_pss_saltlen(ctx, plen) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \\\n                                (EVP_PKEY_OP_SIGN|EVP_PKEY_OP_VERIFY), \\\n                                EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN, \\\n                                0, plen)\n\n# define EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, bits) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \\\n                                EVP_PKEY_CTRL_RSA_KEYGEN_BITS, bits, NULL)\n\n# define EVP_PKEY_CTX_set_rsa_keygen_pubexp(ctx, pubexp) \\\n        EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_KEYGEN, \\\n                                EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP, 0, pubexp)\n\n# define  EVP_PKEY_CTX_set_rsa_mgf1_md(ctx, md)  \\\n                EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \\\n                        EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \\\n                                EVP_PKEY_CTRL_RSA_MGF1_MD, 0, (void *)md)\n\n# define  EVP_PKEY_CTX_set_rsa_oaep_md(ctx, md)  \\\n                EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT,  \\\n                                EVP_PKEY_CTRL_RSA_OAEP_MD, 0, (void *)md)\n\n# define  EVP_PKEY_CTX_get_rsa_mgf1_md(ctx, pmd) \\\n                EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, \\\n                        EVP_PKEY_OP_TYPE_SIG | EVP_PKEY_OP_TYPE_CRYPT, \\\n                                EVP_PKEY_CTRL_GET_RSA_MGF1_MD, 0, (void *)pmd)\n\n# define  EVP_PKEY_CTX_get_rsa_oaep_md(ctx, pmd) \\\n                EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT,  \\\n                                EVP_PKEY_CTRL_GET_RSA_OAEP_MD, 0, (void *)pmd)\n\n# define  EVP_PKEY_CTX_set0_rsa_oaep_label(ctx, l, llen) \\\n                EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT,  \\\n                                EVP_PKEY_CTRL_RSA_OAEP_LABEL, llen, (void *)l)\n\n# define  EVP_PKEY_CTX_get0_rsa_oaep_label(ctx, l)       \\\n                EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, EVP_PKEY_OP_TYPE_CRYPT,  \\\n                                EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL, 0, (void *)l)\n\n# define EVP_PKEY_CTRL_RSA_PADDING       (EVP_PKEY_ALG_CTRL + 1)\n# define EVP_PKEY_CTRL_RSA_PSS_SALTLEN   (EVP_PKEY_ALG_CTRL + 2)\n\n# define EVP_PKEY_CTRL_RSA_KEYGEN_BITS   (EVP_PKEY_ALG_CTRL + 3)\n# define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 4)\n# define EVP_PKEY_CTRL_RSA_MGF1_MD       (EVP_PKEY_ALG_CTRL + 5)\n\n# define EVP_PKEY_CTRL_GET_RSA_PADDING           (EVP_PKEY_ALG_CTRL + 6)\n# define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN       (EVP_PKEY_ALG_CTRL + 7)\n# define EVP_PKEY_CTRL_GET_RSA_MGF1_MD           (EVP_PKEY_ALG_CTRL + 8)\n\n# define EVP_PKEY_CTRL_RSA_OAEP_MD       (EVP_PKEY_ALG_CTRL + 9)\n# define EVP_PKEY_CTRL_RSA_OAEP_LABEL    (EVP_PKEY_ALG_CTRL + 10)\n\n# define EVP_PKEY_CTRL_GET_RSA_OAEP_MD   (EVP_PKEY_ALG_CTRL + 11)\n# define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12)\n\n# define RSA_PKCS1_PADDING       1\n# define RSA_SSLV23_PADDING      2\n# define RSA_NO_PADDING          3\n# define RSA_PKCS1_OAEP_PADDING  4\n# define RSA_X931_PADDING        5\n/* EVP_PKEY_ only */\n# define RSA_PKCS1_PSS_PADDING   6\n\n# define RSA_PKCS1_PADDING_SIZE  11\n\n# define RSA_set_app_data(s,arg)         RSA_set_ex_data(s,0,arg)\n# define RSA_get_app_data(s)             RSA_get_ex_data(s,0)\n\nRSA *RSA_new(void);\nRSA *RSA_new_method(ENGINE *engine);\nint RSA_size(const RSA *rsa);\n\n/* Deprecated version */\n# ifndef OPENSSL_NO_DEPRECATED\nRSA *RSA_generate_key(int bits, unsigned long e, void\n                       (*callback) (int, int, void *), void *cb_arg);\n# endif                         /* !defined(OPENSSL_NO_DEPRECATED) */\n\n/* New version */\nint RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);\n\nint RSA_check_key(const RSA *);\n        /* next 4 return -1 on error */\nint RSA_public_encrypt(int flen, const unsigned char *from,\n                       unsigned char *to, RSA *rsa, int padding);\nint RSA_private_encrypt(int flen, const unsigned char *from,\n                        unsigned char *to, RSA *rsa, int padding);\nint RSA_public_decrypt(int flen, const unsigned char *from,\n                       unsigned char *to, RSA *rsa, int padding);\nint RSA_private_decrypt(int flen, const unsigned char *from,\n                        unsigned char *to, RSA *rsa, int padding);\nvoid RSA_free(RSA *r);\n/* \"up\" the RSA object's reference count */\nint RSA_up_ref(RSA *r);\n\nint RSA_flags(const RSA *r);\n\nvoid RSA_set_default_method(const RSA_METHOD *meth);\nconst RSA_METHOD *RSA_get_default_method(void);\nconst RSA_METHOD *RSA_get_method(const RSA *rsa);\nint RSA_set_method(RSA *rsa, const RSA_METHOD *meth);\n\n/* This function needs the memory locking malloc callbacks to be installed */\nint RSA_memory_lock(RSA *r);\n\n/* these are the actual SSLeay RSA functions */\nconst RSA_METHOD *RSA_PKCS1_SSLeay(void);\n\nconst RSA_METHOD *RSA_null_method(void);\n\nDECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPublicKey)\nDECLARE_ASN1_ENCODE_FUNCTIONS_const(RSA, RSAPrivateKey)\n\ntypedef struct rsa_pss_params_st {\n    X509_ALGOR *hashAlgorithm;\n    X509_ALGOR *maskGenAlgorithm;\n    ASN1_INTEGER *saltLength;\n    ASN1_INTEGER *trailerField;\n} RSA_PSS_PARAMS;\n\nDECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS)\n\ntypedef struct rsa_oaep_params_st {\n    X509_ALGOR *hashFunc;\n    X509_ALGOR *maskGenFunc;\n    X509_ALGOR *pSourceFunc;\n} RSA_OAEP_PARAMS;\n\nDECLARE_ASN1_FUNCTIONS(RSA_OAEP_PARAMS)\n\n# ifndef OPENSSL_NO_FP_API\nint RSA_print_fp(FILE *fp, const RSA *r, int offset);\n# endif\n\n# ifndef OPENSSL_NO_BIO\nint RSA_print(BIO *bp, const RSA *r, int offset);\n# endif\n\n# ifndef OPENSSL_NO_RC4\nint i2d_RSA_NET(const RSA *a, unsigned char **pp,\n                int (*cb) (char *buf, int len, const char *prompt,\n                           int verify), int sgckey);\nRSA *d2i_RSA_NET(RSA **a, const unsigned char **pp, long length,\n                 int (*cb) (char *buf, int len, const char *prompt,\n                            int verify), int sgckey);\n\nint i2d_Netscape_RSA(const RSA *a, unsigned char **pp,\n                     int (*cb) (char *buf, int len, const char *prompt,\n                                int verify));\nRSA *d2i_Netscape_RSA(RSA **a, const unsigned char **pp, long length,\n                      int (*cb) (char *buf, int len, const char *prompt,\n                                 int verify));\n# endif\n\n/*\n * The following 2 functions sign and verify a X509_SIG ASN1 object inside\n * PKCS#1 padded RSA encryption\n */\nint RSA_sign(int type, const unsigned char *m, unsigned int m_length,\n             unsigned char *sigret, unsigned int *siglen, RSA *rsa);\nint RSA_verify(int type, const unsigned char *m, unsigned int m_length,\n               const unsigned char *sigbuf, unsigned int siglen, RSA *rsa);\n\n/*\n * The following 2 function sign and verify a ASN1_OCTET_STRING object inside\n * PKCS#1 padded RSA encryption\n */\nint RSA_sign_ASN1_OCTET_STRING(int type,\n                               const unsigned char *m, unsigned int m_length,\n                               unsigned char *sigret, unsigned int *siglen,\n                               RSA *rsa);\nint RSA_verify_ASN1_OCTET_STRING(int type, const unsigned char *m,\n                                 unsigned int m_length, unsigned char *sigbuf,\n                                 unsigned int siglen, RSA *rsa);\n\nint RSA_blinding_on(RSA *rsa, BN_CTX *ctx);\nvoid RSA_blinding_off(RSA *rsa);\nBN_BLINDING *RSA_setup_blinding(RSA *rsa, BN_CTX *ctx);\n\nint RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,\n                                 const unsigned char *f, int fl);\nint RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen,\n                                   const unsigned char *f, int fl,\n                                   int rsa_len);\nint RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,\n                                 const unsigned char *f, int fl);\nint RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,\n                                   const unsigned char *f, int fl,\n                                   int rsa_len);\nint PKCS1_MGF1(unsigned char *mask, long len, const unsigned char *seed,\n               long seedlen, const EVP_MD *dgst);\nint RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,\n                               const unsigned char *f, int fl,\n                               const unsigned char *p, int pl);\nint RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen,\n                                 const unsigned char *f, int fl, int rsa_len,\n                                 const unsigned char *p, int pl);\nint RSA_padding_add_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,\n                                    const unsigned char *from, int flen,\n                                    const unsigned char *param, int plen,\n                                    const EVP_MD *md, const EVP_MD *mgf1md);\nint RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,\n                                      const unsigned char *from, int flen,\n                                      int num, const unsigned char *param,\n                                      int plen, const EVP_MD *md,\n                                      const EVP_MD *mgf1md);\nint RSA_padding_add_SSLv23(unsigned char *to, int tlen,\n                           const unsigned char *f, int fl);\nint RSA_padding_check_SSLv23(unsigned char *to, int tlen,\n                             const unsigned char *f, int fl, int rsa_len);\nint RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *f,\n                         int fl);\nint RSA_padding_check_none(unsigned char *to, int tlen,\n                           const unsigned char *f, int fl, int rsa_len);\nint RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *f,\n                         int fl);\nint RSA_padding_check_X931(unsigned char *to, int tlen,\n                           const unsigned char *f, int fl, int rsa_len);\nint RSA_X931_hash_id(int nid);\n\nint RSA_verify_PKCS1_PSS(RSA *rsa, const unsigned char *mHash,\n                         const EVP_MD *Hash, const unsigned char *EM,\n                         int sLen);\nint RSA_padding_add_PKCS1_PSS(RSA *rsa, unsigned char *EM,\n                              const unsigned char *mHash, const EVP_MD *Hash,\n                              int sLen);\n\nint RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const unsigned char *mHash,\n                              const EVP_MD *Hash, const EVP_MD *mgf1Hash,\n                              const unsigned char *EM, int sLen);\n\nint RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM,\n                                   const unsigned char *mHash,\n                                   const EVP_MD *Hash, const EVP_MD *mgf1Hash,\n                                   int sLen);\n\nint RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,\n                         CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);\nint RSA_set_ex_data(RSA *r, int idx, void *arg);\nvoid *RSA_get_ex_data(const RSA *r, int idx);\n\nRSA *RSAPublicKey_dup(RSA *rsa);\nRSA *RSAPrivateKey_dup(RSA *rsa);\n\n/*\n * If this flag is set the RSA method is FIPS compliant and can be used in\n * FIPS mode. This is set in the validated module method. If an application\n * sets this flag in its own methods it is its responsibility to ensure the\n * result is compliant.\n */\n\n# define RSA_FLAG_FIPS_METHOD                    0x0400\n\n/*\n * If this flag is set the operations normally disabled in FIPS mode are\n * permitted it is then the applications responsibility to ensure that the\n * usage is compliant.\n */\n\n# define RSA_FLAG_NON_FIPS_ALLOW                 0x0400\n/*\n * Application has decided PRNG is good enough to generate a key: don't\n * check.\n */\n# define RSA_FLAG_CHECKED                        0x0800\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_RSA_strings(void);\n\n/* Error codes for the RSA functions. */\n\n/* Function codes. */\n# define RSA_F_CHECK_PADDING_MD                           140\n# define RSA_F_DO_RSA_PRINT                               146\n# define RSA_F_INT_RSA_VERIFY                             145\n# define RSA_F_MEMORY_LOCK                                100\n# define RSA_F_OLD_RSA_PRIV_DECODE                        147\n# define RSA_F_PKEY_RSA_CTRL                              143\n# define RSA_F_PKEY_RSA_CTRL_STR                          144\n# define RSA_F_PKEY_RSA_SIGN                              142\n# define RSA_F_PKEY_RSA_VERIFY                            154\n# define RSA_F_PKEY_RSA_VERIFYRECOVER                     141\n# define RSA_F_RSA_ALGOR_TO_MD                            157\n# define RSA_F_RSA_BUILTIN_KEYGEN                         129\n# define RSA_F_RSA_CHECK_KEY                              123\n# define RSA_F_RSA_CMS_DECRYPT                            158\n# define RSA_F_RSA_EAY_PRIVATE_DECRYPT                    101\n# define RSA_F_RSA_EAY_PRIVATE_ENCRYPT                    102\n# define RSA_F_RSA_EAY_PUBLIC_DECRYPT                     103\n# define RSA_F_RSA_EAY_PUBLIC_ENCRYPT                     104\n# define RSA_F_RSA_GENERATE_KEY                           105\n# define RSA_F_RSA_GENERATE_KEY_EX                        155\n# define RSA_F_RSA_ITEM_VERIFY                            156\n# define RSA_F_RSA_MEMORY_LOCK                            130\n# define RSA_F_RSA_MGF1_TO_MD                             159\n# define RSA_F_RSA_NEW_METHOD                             106\n# define RSA_F_RSA_NULL                                   124\n# define RSA_F_RSA_NULL_MOD_EXP                           131\n# define RSA_F_RSA_NULL_PRIVATE_DECRYPT                   132\n# define RSA_F_RSA_NULL_PRIVATE_ENCRYPT                   133\n# define RSA_F_RSA_NULL_PUBLIC_DECRYPT                    134\n# define RSA_F_RSA_NULL_PUBLIC_ENCRYPT                    135\n# define RSA_F_RSA_PADDING_ADD_NONE                       107\n# define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP                 121\n# define RSA_F_RSA_PADDING_ADD_PKCS1_OAEP_MGF1            160\n# define RSA_F_RSA_PADDING_ADD_PKCS1_PSS                  125\n# define RSA_F_RSA_PADDING_ADD_PKCS1_PSS_MGF1             148\n# define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_1               108\n# define RSA_F_RSA_PADDING_ADD_PKCS1_TYPE_2               109\n# define RSA_F_RSA_PADDING_ADD_SSLV23                     110\n# define RSA_F_RSA_PADDING_ADD_X931                       127\n# define RSA_F_RSA_PADDING_CHECK_NONE                     111\n# define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP               122\n# define RSA_F_RSA_PADDING_CHECK_PKCS1_OAEP_MGF1          161\n# define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_1             112\n# define RSA_F_RSA_PADDING_CHECK_PKCS1_TYPE_2             113\n# define RSA_F_RSA_PADDING_CHECK_SSLV23                   114\n# define RSA_F_RSA_PADDING_CHECK_X931                     128\n# define RSA_F_RSA_PRINT                                  115\n# define RSA_F_RSA_PRINT_FP                               116\n# define RSA_F_RSA_PRIVATE_DECRYPT                        150\n# define RSA_F_RSA_PRIVATE_ENCRYPT                        151\n# define RSA_F_RSA_PRIV_DECODE                            137\n# define RSA_F_RSA_PRIV_ENCODE                            138\n# define RSA_F_RSA_PSS_TO_CTX                             162\n# define RSA_F_RSA_PUBLIC_DECRYPT                         152\n# define RSA_F_RSA_PUBLIC_ENCRYPT                         153\n# define RSA_F_RSA_PUB_DECODE                             139\n# define RSA_F_RSA_SETUP_BLINDING                         136\n# define RSA_F_RSA_SIGN                                   117\n# define RSA_F_RSA_SIGN_ASN1_OCTET_STRING                 118\n# define RSA_F_RSA_VERIFY                                 119\n# define RSA_F_RSA_VERIFY_ASN1_OCTET_STRING               120\n# define RSA_F_RSA_VERIFY_PKCS1_PSS                       126\n# define RSA_F_RSA_VERIFY_PKCS1_PSS_MGF1                  149\n\n/* Reason codes. */\n# define RSA_R_ALGORITHM_MISMATCH                         100\n# define RSA_R_BAD_E_VALUE                                101\n# define RSA_R_BAD_FIXED_HEADER_DECRYPT                   102\n# define RSA_R_BAD_PAD_BYTE_COUNT                         103\n# define RSA_R_BAD_SIGNATURE                              104\n# define RSA_R_BLOCK_TYPE_IS_NOT_01                       106\n# define RSA_R_BLOCK_TYPE_IS_NOT_02                       107\n# define RSA_R_DATA_GREATER_THAN_MOD_LEN                  108\n# define RSA_R_DATA_TOO_LARGE                             109\n# define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE                110\n# define RSA_R_DATA_TOO_LARGE_FOR_MODULUS                 132\n# define RSA_R_DATA_TOO_SMALL                             111\n# define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE                122\n# define RSA_R_DIGEST_DOES_NOT_MATCH                      166\n# define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY                 112\n# define RSA_R_DMP1_NOT_CONGRUENT_TO_D                    124\n# define RSA_R_DMQ1_NOT_CONGRUENT_TO_D                    125\n# define RSA_R_D_E_NOT_CONGRUENT_TO_1                     123\n# define RSA_R_FIRST_OCTET_INVALID                        133\n# define RSA_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE        144\n# define RSA_R_INVALID_DIGEST                             160\n# define RSA_R_INVALID_DIGEST_LENGTH                      143\n# define RSA_R_INVALID_HEADER                             137\n# define RSA_R_INVALID_KEYBITS                            145\n# define RSA_R_INVALID_LABEL                              161\n# define RSA_R_INVALID_MESSAGE_LENGTH                     131\n# define RSA_R_INVALID_MGF1_MD                            156\n# define RSA_R_INVALID_OAEP_PARAMETERS                    162\n# define RSA_R_INVALID_PADDING                            138\n# define RSA_R_INVALID_PADDING_MODE                       141\n# define RSA_R_INVALID_PSS_PARAMETERS                     149\n# define RSA_R_INVALID_PSS_SALTLEN                        146\n# define RSA_R_INVALID_SALT_LENGTH                        150\n# define RSA_R_INVALID_TRAILER                            139\n# define RSA_R_INVALID_X931_DIGEST                        142\n# define RSA_R_IQMP_NOT_INVERSE_OF_Q                      126\n# define RSA_R_KEY_SIZE_TOO_SMALL                         120\n# define RSA_R_LAST_OCTET_INVALID                         134\n# define RSA_R_MODULUS_TOO_LARGE                          105\n# define RSA_R_NON_FIPS_RSA_METHOD                        157\n# define RSA_R_NO_PUBLIC_EXPONENT                         140\n# define RSA_R_NULL_BEFORE_BLOCK_MISSING                  113\n# define RSA_R_N_DOES_NOT_EQUAL_P_Q                       127\n# define RSA_R_OAEP_DECODING_ERROR                        121\n# define RSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE         158\n# define RSA_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE   148\n# define RSA_R_PADDING_CHECK_FAILED                       114\n# define RSA_R_PKCS_DECODING_ERROR                        159\n# define RSA_R_P_NOT_PRIME                                128\n# define RSA_R_Q_NOT_PRIME                                129\n# define RSA_R_RSA_OPERATIONS_NOT_SUPPORTED               130\n# define RSA_R_SLEN_CHECK_FAILED                          136\n# define RSA_R_SLEN_RECOVERY_FAILED                       135\n# define RSA_R_SSLV3_ROLLBACK_ATTACK                      115\n# define RSA_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 116\n# define RSA_R_UNKNOWN_ALGORITHM_TYPE                     117\n# define RSA_R_UNKNOWN_DIGEST                             163\n# define RSA_R_UNKNOWN_MASK_DIGEST                        151\n# define RSA_R_UNKNOWN_PADDING_TYPE                       118\n# define RSA_R_UNKNOWN_PSS_DIGEST                         152\n# define RSA_R_UNSUPPORTED_ENCRYPTION_TYPE                164\n# define RSA_R_UNSUPPORTED_LABEL_SOURCE                   165\n# define RSA_R_UNSUPPORTED_MASK_ALGORITHM                 153\n# define RSA_R_UNSUPPORTED_MASK_PARAMETER                 154\n# define RSA_R_UNSUPPORTED_SIGNATURE_TYPE                 155\n# define RSA_R_VALUE_MISSING                              147\n# define RSA_R_WRONG_SIGNATURE_LENGTH                     119\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/safestack.h",
    "content": "/* ====================================================================\n * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_SAFESTACK_H\n# define HEADER_SAFESTACK_H\n\n# include <openssl/stack.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n# ifndef CHECKED_PTR_OF\n#  define CHECKED_PTR_OF(type, p) \\\n    ((void*) (1 ? p : (type*)0))\n# endif\n\n/*\n * In C++ we get problems because an explicit cast is needed from (void *) we\n * use CHECKED_STACK_OF to ensure the correct type is passed in the macros\n * below.\n */\n\n# define CHECKED_STACK_OF(type, p) \\\n    ((_STACK*) (1 ? p : (STACK_OF(type)*)0))\n\n# define CHECKED_SK_COPY_FUNC(type, p) \\\n    ((void *(*)(void *)) ((1 ? p : (type *(*)(const type *))0)))\n\n# define CHECKED_SK_FREE_FUNC(type, p) \\\n    ((void (*)(void *)) ((1 ? p : (void (*)(type *))0)))\n\n# define CHECKED_SK_CMP_FUNC(type, p) \\\n    ((int (*)(const void *, const void *)) \\\n        ((1 ? p : (int (*)(const type * const *, const type * const *))0)))\n\n# define STACK_OF(type) struct stack_st_##type\n# define PREDECLARE_STACK_OF(type) STACK_OF(type);\n\n# define DECLARE_STACK_OF(type) \\\nSTACK_OF(type) \\\n    { \\\n    _STACK stack; \\\n    };\n# define DECLARE_SPECIAL_STACK_OF(type, type2) \\\nSTACK_OF(type) \\\n    { \\\n    _STACK stack; \\\n    };\n\n/* nada (obsolete in new safestack approach)*/\n# define IMPLEMENT_STACK_OF(type)\n\n/*-\n * Strings are special: normally an lhash entry will point to a single\n * (somewhat) mutable object. In the case of strings:\n *\n * a) Instead of a single char, there is an array of chars, NUL-terminated.\n * b) The string may have be immutable.\n *\n * So, they need their own declarations. Especially important for\n * type-checking tools, such as Deputy.\n *\n * In practice, however, it appears to be hard to have a const\n * string. For now, I'm settling for dealing with the fact it is a\n * string at all.\n */\ntypedef char *OPENSSL_STRING;\n\ntypedef const char *OPENSSL_CSTRING;\n\n/*\n * Confusingly, LHASH_OF(STRING) deals with char ** throughout, but\n * STACK_OF(STRING) is really more like STACK_OF(char), only, as mentioned\n * above, instead of a single char each entry is a NUL-terminated array of\n * chars. So, we have to implement STRING specially for STACK_OF. This is\n * dealt with in the autogenerated macros below.\n */\n\nDECLARE_SPECIAL_STACK_OF(OPENSSL_STRING, char)\n\n/*\n * Similarly, we sometimes use a block of characters, NOT nul-terminated.\n * These should also be distinguished from \"normal\" stacks.\n */\ntypedef void *OPENSSL_BLOCK;\nDECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)\n\n/*\n * SKM_sk_... stack macros are internal to safestack.h: never use them\n * directly, use sk_<type>_... instead\n */\n# define SKM_sk_new(type, cmp) \\\n        ((STACK_OF(type) *)sk_new(CHECKED_SK_CMP_FUNC(type, cmp)))\n# define SKM_sk_new_null(type) \\\n        ((STACK_OF(type) *)sk_new_null())\n# define SKM_sk_free(type, st) \\\n        sk_free(CHECKED_STACK_OF(type, st))\n# define SKM_sk_num(type, st) \\\n        sk_num(CHECKED_STACK_OF(type, st))\n# define SKM_sk_value(type, st,i) \\\n        ((type *)sk_value(CHECKED_STACK_OF(type, st), i))\n# define SKM_sk_set(type, st,i,val) \\\n        sk_set(CHECKED_STACK_OF(type, st), i, CHECKED_PTR_OF(type, val))\n# define SKM_sk_zero(type, st) \\\n        sk_zero(CHECKED_STACK_OF(type, st))\n# define SKM_sk_push(type, st, val) \\\n        sk_push(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val))\n# define SKM_sk_unshift(type, st, val) \\\n        sk_unshift(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val))\n# define SKM_sk_find(type, st, val) \\\n        sk_find(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val))\n# define SKM_sk_find_ex(type, st, val) \\\n        sk_find_ex(CHECKED_STACK_OF(type, st), \\\n                   CHECKED_PTR_OF(type, val))\n# define SKM_sk_delete(type, st, i) \\\n        (type *)sk_delete(CHECKED_STACK_OF(type, st), i)\n# define SKM_sk_delete_ptr(type, st, ptr) \\\n        (type *)sk_delete_ptr(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, ptr))\n# define SKM_sk_insert(type, st,val, i) \\\n        sk_insert(CHECKED_STACK_OF(type, st), CHECKED_PTR_OF(type, val), i)\n# define SKM_sk_set_cmp_func(type, st, cmp) \\\n        ((int (*)(const type * const *,const type * const *)) \\\n        sk_set_cmp_func(CHECKED_STACK_OF(type, st), CHECKED_SK_CMP_FUNC(type, cmp)))\n# define SKM_sk_dup(type, st) \\\n        (STACK_OF(type) *)sk_dup(CHECKED_STACK_OF(type, st))\n# define SKM_sk_pop_free(type, st, free_func) \\\n        sk_pop_free(CHECKED_STACK_OF(type, st), CHECKED_SK_FREE_FUNC(type, free_func))\n# define SKM_sk_deep_copy(type, st, copy_func, free_func) \\\n        (STACK_OF(type) *)sk_deep_copy(CHECKED_STACK_OF(type, st), CHECKED_SK_COPY_FUNC(type, copy_func), CHECKED_SK_FREE_FUNC(type, free_func))\n# define SKM_sk_shift(type, st) \\\n        (type *)sk_shift(CHECKED_STACK_OF(type, st))\n# define SKM_sk_pop(type, st) \\\n        (type *)sk_pop(CHECKED_STACK_OF(type, st))\n# define SKM_sk_sort(type, st) \\\n        sk_sort(CHECKED_STACK_OF(type, st))\n# define SKM_sk_is_sorted(type, st) \\\n        sk_is_sorted(CHECKED_STACK_OF(type, st))\n# define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n  (STACK_OF(type) *)d2i_ASN1_SET( \\\n                                (STACK_OF(OPENSSL_BLOCK) **)CHECKED_PTR_OF(STACK_OF(type)*, st), \\\n                                pp, length, \\\n                                CHECKED_D2I_OF(type, d2i_func), \\\n                                CHECKED_SK_FREE_FUNC(type, free_func), \\\n                                ex_tag, ex_class)\n# define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n  i2d_ASN1_SET((STACK_OF(OPENSSL_BLOCK) *)CHECKED_STACK_OF(type, st), pp, \\\n                                CHECKED_I2D_OF(type, i2d_func), \\\n                                ex_tag, ex_class, is_set)\n# define SKM_ASN1_seq_pack(type, st, i2d_func, buf, len) \\\n        ASN1_seq_pack(CHECKED_PTR_OF(STACK_OF(type), st), \\\n                        CHECKED_I2D_OF(type, i2d_func), buf, len)\n# define SKM_ASN1_seq_unpack(type, buf, len, d2i_func, free_func) \\\n        (STACK_OF(type) *)ASN1_seq_unpack(buf, len, CHECKED_D2I_OF(type, d2i_func), CHECKED_SK_FREE_FUNC(type, free_func))\n# define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \\\n        (STACK_OF(type) *)PKCS12_decrypt_d2i(algor, \\\n                                CHECKED_D2I_OF(type, d2i_func), \\\n                                CHECKED_SK_FREE_FUNC(type, free_func), \\\n                                pass, passlen, oct, seq)\n/*\n * This block of defines is updated by util/mkstack.pl, please do not touch!\n */\n# define sk_ACCESS_DESCRIPTION_new(cmp) SKM_sk_new(ACCESS_DESCRIPTION, (cmp))\n# define sk_ACCESS_DESCRIPTION_new_null() SKM_sk_new_null(ACCESS_DESCRIPTION)\n# define sk_ACCESS_DESCRIPTION_free(st) SKM_sk_free(ACCESS_DESCRIPTION, (st))\n# define sk_ACCESS_DESCRIPTION_num(st) SKM_sk_num(ACCESS_DESCRIPTION, (st))\n# define sk_ACCESS_DESCRIPTION_value(st, i) SKM_sk_value(ACCESS_DESCRIPTION, (st), (i))\n# define sk_ACCESS_DESCRIPTION_set(st, i, val) SKM_sk_set(ACCESS_DESCRIPTION, (st), (i), (val))\n# define sk_ACCESS_DESCRIPTION_zero(st) SKM_sk_zero(ACCESS_DESCRIPTION, (st))\n# define sk_ACCESS_DESCRIPTION_push(st, val) SKM_sk_push(ACCESS_DESCRIPTION, (st), (val))\n# define sk_ACCESS_DESCRIPTION_unshift(st, val) SKM_sk_unshift(ACCESS_DESCRIPTION, (st), (val))\n# define sk_ACCESS_DESCRIPTION_find(st, val) SKM_sk_find(ACCESS_DESCRIPTION, (st), (val))\n# define sk_ACCESS_DESCRIPTION_find_ex(st, val) SKM_sk_find_ex(ACCESS_DESCRIPTION, (st), (val))\n# define sk_ACCESS_DESCRIPTION_delete(st, i) SKM_sk_delete(ACCESS_DESCRIPTION, (st), (i))\n# define sk_ACCESS_DESCRIPTION_delete_ptr(st, ptr) SKM_sk_delete_ptr(ACCESS_DESCRIPTION, (st), (ptr))\n# define sk_ACCESS_DESCRIPTION_insert(st, val, i) SKM_sk_insert(ACCESS_DESCRIPTION, (st), (val), (i))\n# define sk_ACCESS_DESCRIPTION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ACCESS_DESCRIPTION, (st), (cmp))\n# define sk_ACCESS_DESCRIPTION_dup(st) SKM_sk_dup(ACCESS_DESCRIPTION, st)\n# define sk_ACCESS_DESCRIPTION_pop_free(st, free_func) SKM_sk_pop_free(ACCESS_DESCRIPTION, (st), (free_func))\n# define sk_ACCESS_DESCRIPTION_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ACCESS_DESCRIPTION, (st), (copy_func), (free_func))\n# define sk_ACCESS_DESCRIPTION_shift(st) SKM_sk_shift(ACCESS_DESCRIPTION, (st))\n# define sk_ACCESS_DESCRIPTION_pop(st) SKM_sk_pop(ACCESS_DESCRIPTION, (st))\n# define sk_ACCESS_DESCRIPTION_sort(st) SKM_sk_sort(ACCESS_DESCRIPTION, (st))\n# define sk_ACCESS_DESCRIPTION_is_sorted(st) SKM_sk_is_sorted(ACCESS_DESCRIPTION, (st))\n# define sk_ASIdOrRange_new(cmp) SKM_sk_new(ASIdOrRange, (cmp))\n# define sk_ASIdOrRange_new_null() SKM_sk_new_null(ASIdOrRange)\n# define sk_ASIdOrRange_free(st) SKM_sk_free(ASIdOrRange, (st))\n# define sk_ASIdOrRange_num(st) SKM_sk_num(ASIdOrRange, (st))\n# define sk_ASIdOrRange_value(st, i) SKM_sk_value(ASIdOrRange, (st), (i))\n# define sk_ASIdOrRange_set(st, i, val) SKM_sk_set(ASIdOrRange, (st), (i), (val))\n# define sk_ASIdOrRange_zero(st) SKM_sk_zero(ASIdOrRange, (st))\n# define sk_ASIdOrRange_push(st, val) SKM_sk_push(ASIdOrRange, (st), (val))\n# define sk_ASIdOrRange_unshift(st, val) SKM_sk_unshift(ASIdOrRange, (st), (val))\n# define sk_ASIdOrRange_find(st, val) SKM_sk_find(ASIdOrRange, (st), (val))\n# define sk_ASIdOrRange_find_ex(st, val) SKM_sk_find_ex(ASIdOrRange, (st), (val))\n# define sk_ASIdOrRange_delete(st, i) SKM_sk_delete(ASIdOrRange, (st), (i))\n# define sk_ASIdOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASIdOrRange, (st), (ptr))\n# define sk_ASIdOrRange_insert(st, val, i) SKM_sk_insert(ASIdOrRange, (st), (val), (i))\n# define sk_ASIdOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASIdOrRange, (st), (cmp))\n# define sk_ASIdOrRange_dup(st) SKM_sk_dup(ASIdOrRange, st)\n# define sk_ASIdOrRange_pop_free(st, free_func) SKM_sk_pop_free(ASIdOrRange, (st), (free_func))\n# define sk_ASIdOrRange_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASIdOrRange, (st), (copy_func), (free_func))\n# define sk_ASIdOrRange_shift(st) SKM_sk_shift(ASIdOrRange, (st))\n# define sk_ASIdOrRange_pop(st) SKM_sk_pop(ASIdOrRange, (st))\n# define sk_ASIdOrRange_sort(st) SKM_sk_sort(ASIdOrRange, (st))\n# define sk_ASIdOrRange_is_sorted(st) SKM_sk_is_sorted(ASIdOrRange, (st))\n# define sk_ASN1_GENERALSTRING_new(cmp) SKM_sk_new(ASN1_GENERALSTRING, (cmp))\n# define sk_ASN1_GENERALSTRING_new_null() SKM_sk_new_null(ASN1_GENERALSTRING)\n# define sk_ASN1_GENERALSTRING_free(st) SKM_sk_free(ASN1_GENERALSTRING, (st))\n# define sk_ASN1_GENERALSTRING_num(st) SKM_sk_num(ASN1_GENERALSTRING, (st))\n# define sk_ASN1_GENERALSTRING_value(st, i) SKM_sk_value(ASN1_GENERALSTRING, (st), (i))\n# define sk_ASN1_GENERALSTRING_set(st, i, val) SKM_sk_set(ASN1_GENERALSTRING, (st), (i), (val))\n# define sk_ASN1_GENERALSTRING_zero(st) SKM_sk_zero(ASN1_GENERALSTRING, (st))\n# define sk_ASN1_GENERALSTRING_push(st, val) SKM_sk_push(ASN1_GENERALSTRING, (st), (val))\n# define sk_ASN1_GENERALSTRING_unshift(st, val) SKM_sk_unshift(ASN1_GENERALSTRING, (st), (val))\n# define sk_ASN1_GENERALSTRING_find(st, val) SKM_sk_find(ASN1_GENERALSTRING, (st), (val))\n# define sk_ASN1_GENERALSTRING_find_ex(st, val) SKM_sk_find_ex(ASN1_GENERALSTRING, (st), (val))\n# define sk_ASN1_GENERALSTRING_delete(st, i) SKM_sk_delete(ASN1_GENERALSTRING, (st), (i))\n# define sk_ASN1_GENERALSTRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_GENERALSTRING, (st), (ptr))\n# define sk_ASN1_GENERALSTRING_insert(st, val, i) SKM_sk_insert(ASN1_GENERALSTRING, (st), (val), (i))\n# define sk_ASN1_GENERALSTRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_GENERALSTRING, (st), (cmp))\n# define sk_ASN1_GENERALSTRING_dup(st) SKM_sk_dup(ASN1_GENERALSTRING, st)\n# define sk_ASN1_GENERALSTRING_pop_free(st, free_func) SKM_sk_pop_free(ASN1_GENERALSTRING, (st), (free_func))\n# define sk_ASN1_GENERALSTRING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_GENERALSTRING, (st), (copy_func), (free_func))\n# define sk_ASN1_GENERALSTRING_shift(st) SKM_sk_shift(ASN1_GENERALSTRING, (st))\n# define sk_ASN1_GENERALSTRING_pop(st) SKM_sk_pop(ASN1_GENERALSTRING, (st))\n# define sk_ASN1_GENERALSTRING_sort(st) SKM_sk_sort(ASN1_GENERALSTRING, (st))\n# define sk_ASN1_GENERALSTRING_is_sorted(st) SKM_sk_is_sorted(ASN1_GENERALSTRING, (st))\n# define sk_ASN1_INTEGER_new(cmp) SKM_sk_new(ASN1_INTEGER, (cmp))\n# define sk_ASN1_INTEGER_new_null() SKM_sk_new_null(ASN1_INTEGER)\n# define sk_ASN1_INTEGER_free(st) SKM_sk_free(ASN1_INTEGER, (st))\n# define sk_ASN1_INTEGER_num(st) SKM_sk_num(ASN1_INTEGER, (st))\n# define sk_ASN1_INTEGER_value(st, i) SKM_sk_value(ASN1_INTEGER, (st), (i))\n# define sk_ASN1_INTEGER_set(st, i, val) SKM_sk_set(ASN1_INTEGER, (st), (i), (val))\n# define sk_ASN1_INTEGER_zero(st) SKM_sk_zero(ASN1_INTEGER, (st))\n# define sk_ASN1_INTEGER_push(st, val) SKM_sk_push(ASN1_INTEGER, (st), (val))\n# define sk_ASN1_INTEGER_unshift(st, val) SKM_sk_unshift(ASN1_INTEGER, (st), (val))\n# define sk_ASN1_INTEGER_find(st, val) SKM_sk_find(ASN1_INTEGER, (st), (val))\n# define sk_ASN1_INTEGER_find_ex(st, val) SKM_sk_find_ex(ASN1_INTEGER, (st), (val))\n# define sk_ASN1_INTEGER_delete(st, i) SKM_sk_delete(ASN1_INTEGER, (st), (i))\n# define sk_ASN1_INTEGER_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_INTEGER, (st), (ptr))\n# define sk_ASN1_INTEGER_insert(st, val, i) SKM_sk_insert(ASN1_INTEGER, (st), (val), (i))\n# define sk_ASN1_INTEGER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_INTEGER, (st), (cmp))\n# define sk_ASN1_INTEGER_dup(st) SKM_sk_dup(ASN1_INTEGER, st)\n# define sk_ASN1_INTEGER_pop_free(st, free_func) SKM_sk_pop_free(ASN1_INTEGER, (st), (free_func))\n# define sk_ASN1_INTEGER_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_INTEGER, (st), (copy_func), (free_func))\n# define sk_ASN1_INTEGER_shift(st) SKM_sk_shift(ASN1_INTEGER, (st))\n# define sk_ASN1_INTEGER_pop(st) SKM_sk_pop(ASN1_INTEGER, (st))\n# define sk_ASN1_INTEGER_sort(st) SKM_sk_sort(ASN1_INTEGER, (st))\n# define sk_ASN1_INTEGER_is_sorted(st) SKM_sk_is_sorted(ASN1_INTEGER, (st))\n# define sk_ASN1_OBJECT_new(cmp) SKM_sk_new(ASN1_OBJECT, (cmp))\n# define sk_ASN1_OBJECT_new_null() SKM_sk_new_null(ASN1_OBJECT)\n# define sk_ASN1_OBJECT_free(st) SKM_sk_free(ASN1_OBJECT, (st))\n# define sk_ASN1_OBJECT_num(st) SKM_sk_num(ASN1_OBJECT, (st))\n# define sk_ASN1_OBJECT_value(st, i) SKM_sk_value(ASN1_OBJECT, (st), (i))\n# define sk_ASN1_OBJECT_set(st, i, val) SKM_sk_set(ASN1_OBJECT, (st), (i), (val))\n# define sk_ASN1_OBJECT_zero(st) SKM_sk_zero(ASN1_OBJECT, (st))\n# define sk_ASN1_OBJECT_push(st, val) SKM_sk_push(ASN1_OBJECT, (st), (val))\n# define sk_ASN1_OBJECT_unshift(st, val) SKM_sk_unshift(ASN1_OBJECT, (st), (val))\n# define sk_ASN1_OBJECT_find(st, val) SKM_sk_find(ASN1_OBJECT, (st), (val))\n# define sk_ASN1_OBJECT_find_ex(st, val) SKM_sk_find_ex(ASN1_OBJECT, (st), (val))\n# define sk_ASN1_OBJECT_delete(st, i) SKM_sk_delete(ASN1_OBJECT, (st), (i))\n# define sk_ASN1_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_OBJECT, (st), (ptr))\n# define sk_ASN1_OBJECT_insert(st, val, i) SKM_sk_insert(ASN1_OBJECT, (st), (val), (i))\n# define sk_ASN1_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_OBJECT, (st), (cmp))\n# define sk_ASN1_OBJECT_dup(st) SKM_sk_dup(ASN1_OBJECT, st)\n# define sk_ASN1_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(ASN1_OBJECT, (st), (free_func))\n# define sk_ASN1_OBJECT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_OBJECT, (st), (copy_func), (free_func))\n# define sk_ASN1_OBJECT_shift(st) SKM_sk_shift(ASN1_OBJECT, (st))\n# define sk_ASN1_OBJECT_pop(st) SKM_sk_pop(ASN1_OBJECT, (st))\n# define sk_ASN1_OBJECT_sort(st) SKM_sk_sort(ASN1_OBJECT, (st))\n# define sk_ASN1_OBJECT_is_sorted(st) SKM_sk_is_sorted(ASN1_OBJECT, (st))\n# define sk_ASN1_STRING_TABLE_new(cmp) SKM_sk_new(ASN1_STRING_TABLE, (cmp))\n# define sk_ASN1_STRING_TABLE_new_null() SKM_sk_new_null(ASN1_STRING_TABLE)\n# define sk_ASN1_STRING_TABLE_free(st) SKM_sk_free(ASN1_STRING_TABLE, (st))\n# define sk_ASN1_STRING_TABLE_num(st) SKM_sk_num(ASN1_STRING_TABLE, (st))\n# define sk_ASN1_STRING_TABLE_value(st, i) SKM_sk_value(ASN1_STRING_TABLE, (st), (i))\n# define sk_ASN1_STRING_TABLE_set(st, i, val) SKM_sk_set(ASN1_STRING_TABLE, (st), (i), (val))\n# define sk_ASN1_STRING_TABLE_zero(st) SKM_sk_zero(ASN1_STRING_TABLE, (st))\n# define sk_ASN1_STRING_TABLE_push(st, val) SKM_sk_push(ASN1_STRING_TABLE, (st), (val))\n# define sk_ASN1_STRING_TABLE_unshift(st, val) SKM_sk_unshift(ASN1_STRING_TABLE, (st), (val))\n# define sk_ASN1_STRING_TABLE_find(st, val) SKM_sk_find(ASN1_STRING_TABLE, (st), (val))\n# define sk_ASN1_STRING_TABLE_find_ex(st, val) SKM_sk_find_ex(ASN1_STRING_TABLE, (st), (val))\n# define sk_ASN1_STRING_TABLE_delete(st, i) SKM_sk_delete(ASN1_STRING_TABLE, (st), (i))\n# define sk_ASN1_STRING_TABLE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_STRING_TABLE, (st), (ptr))\n# define sk_ASN1_STRING_TABLE_insert(st, val, i) SKM_sk_insert(ASN1_STRING_TABLE, (st), (val), (i))\n# define sk_ASN1_STRING_TABLE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_STRING_TABLE, (st), (cmp))\n# define sk_ASN1_STRING_TABLE_dup(st) SKM_sk_dup(ASN1_STRING_TABLE, st)\n# define sk_ASN1_STRING_TABLE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_STRING_TABLE, (st), (free_func))\n# define sk_ASN1_STRING_TABLE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_STRING_TABLE, (st), (copy_func), (free_func))\n# define sk_ASN1_STRING_TABLE_shift(st) SKM_sk_shift(ASN1_STRING_TABLE, (st))\n# define sk_ASN1_STRING_TABLE_pop(st) SKM_sk_pop(ASN1_STRING_TABLE, (st))\n# define sk_ASN1_STRING_TABLE_sort(st) SKM_sk_sort(ASN1_STRING_TABLE, (st))\n# define sk_ASN1_STRING_TABLE_is_sorted(st) SKM_sk_is_sorted(ASN1_STRING_TABLE, (st))\n# define sk_ASN1_TYPE_new(cmp) SKM_sk_new(ASN1_TYPE, (cmp))\n# define sk_ASN1_TYPE_new_null() SKM_sk_new_null(ASN1_TYPE)\n# define sk_ASN1_TYPE_free(st) SKM_sk_free(ASN1_TYPE, (st))\n# define sk_ASN1_TYPE_num(st) SKM_sk_num(ASN1_TYPE, (st))\n# define sk_ASN1_TYPE_value(st, i) SKM_sk_value(ASN1_TYPE, (st), (i))\n# define sk_ASN1_TYPE_set(st, i, val) SKM_sk_set(ASN1_TYPE, (st), (i), (val))\n# define sk_ASN1_TYPE_zero(st) SKM_sk_zero(ASN1_TYPE, (st))\n# define sk_ASN1_TYPE_push(st, val) SKM_sk_push(ASN1_TYPE, (st), (val))\n# define sk_ASN1_TYPE_unshift(st, val) SKM_sk_unshift(ASN1_TYPE, (st), (val))\n# define sk_ASN1_TYPE_find(st, val) SKM_sk_find(ASN1_TYPE, (st), (val))\n# define sk_ASN1_TYPE_find_ex(st, val) SKM_sk_find_ex(ASN1_TYPE, (st), (val))\n# define sk_ASN1_TYPE_delete(st, i) SKM_sk_delete(ASN1_TYPE, (st), (i))\n# define sk_ASN1_TYPE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_TYPE, (st), (ptr))\n# define sk_ASN1_TYPE_insert(st, val, i) SKM_sk_insert(ASN1_TYPE, (st), (val), (i))\n# define sk_ASN1_TYPE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_TYPE, (st), (cmp))\n# define sk_ASN1_TYPE_dup(st) SKM_sk_dup(ASN1_TYPE, st)\n# define sk_ASN1_TYPE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_TYPE, (st), (free_func))\n# define sk_ASN1_TYPE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_TYPE, (st), (copy_func), (free_func))\n# define sk_ASN1_TYPE_shift(st) SKM_sk_shift(ASN1_TYPE, (st))\n# define sk_ASN1_TYPE_pop(st) SKM_sk_pop(ASN1_TYPE, (st))\n# define sk_ASN1_TYPE_sort(st) SKM_sk_sort(ASN1_TYPE, (st))\n# define sk_ASN1_TYPE_is_sorted(st) SKM_sk_is_sorted(ASN1_TYPE, (st))\n# define sk_ASN1_UTF8STRING_new(cmp) SKM_sk_new(ASN1_UTF8STRING, (cmp))\n# define sk_ASN1_UTF8STRING_new_null() SKM_sk_new_null(ASN1_UTF8STRING)\n# define sk_ASN1_UTF8STRING_free(st) SKM_sk_free(ASN1_UTF8STRING, (st))\n# define sk_ASN1_UTF8STRING_num(st) SKM_sk_num(ASN1_UTF8STRING, (st))\n# define sk_ASN1_UTF8STRING_value(st, i) SKM_sk_value(ASN1_UTF8STRING, (st), (i))\n# define sk_ASN1_UTF8STRING_set(st, i, val) SKM_sk_set(ASN1_UTF8STRING, (st), (i), (val))\n# define sk_ASN1_UTF8STRING_zero(st) SKM_sk_zero(ASN1_UTF8STRING, (st))\n# define sk_ASN1_UTF8STRING_push(st, val) SKM_sk_push(ASN1_UTF8STRING, (st), (val))\n# define sk_ASN1_UTF8STRING_unshift(st, val) SKM_sk_unshift(ASN1_UTF8STRING, (st), (val))\n# define sk_ASN1_UTF8STRING_find(st, val) SKM_sk_find(ASN1_UTF8STRING, (st), (val))\n# define sk_ASN1_UTF8STRING_find_ex(st, val) SKM_sk_find_ex(ASN1_UTF8STRING, (st), (val))\n# define sk_ASN1_UTF8STRING_delete(st, i) SKM_sk_delete(ASN1_UTF8STRING, (st), (i))\n# define sk_ASN1_UTF8STRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_UTF8STRING, (st), (ptr))\n# define sk_ASN1_UTF8STRING_insert(st, val, i) SKM_sk_insert(ASN1_UTF8STRING, (st), (val), (i))\n# define sk_ASN1_UTF8STRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_UTF8STRING, (st), (cmp))\n# define sk_ASN1_UTF8STRING_dup(st) SKM_sk_dup(ASN1_UTF8STRING, st)\n# define sk_ASN1_UTF8STRING_pop_free(st, free_func) SKM_sk_pop_free(ASN1_UTF8STRING, (st), (free_func))\n# define sk_ASN1_UTF8STRING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_UTF8STRING, (st), (copy_func), (free_func))\n# define sk_ASN1_UTF8STRING_shift(st) SKM_sk_shift(ASN1_UTF8STRING, (st))\n# define sk_ASN1_UTF8STRING_pop(st) SKM_sk_pop(ASN1_UTF8STRING, (st))\n# define sk_ASN1_UTF8STRING_sort(st) SKM_sk_sort(ASN1_UTF8STRING, (st))\n# define sk_ASN1_UTF8STRING_is_sorted(st) SKM_sk_is_sorted(ASN1_UTF8STRING, (st))\n# define sk_ASN1_VALUE_new(cmp) SKM_sk_new(ASN1_VALUE, (cmp))\n# define sk_ASN1_VALUE_new_null() SKM_sk_new_null(ASN1_VALUE)\n# define sk_ASN1_VALUE_free(st) SKM_sk_free(ASN1_VALUE, (st))\n# define sk_ASN1_VALUE_num(st) SKM_sk_num(ASN1_VALUE, (st))\n# define sk_ASN1_VALUE_value(st, i) SKM_sk_value(ASN1_VALUE, (st), (i))\n# define sk_ASN1_VALUE_set(st, i, val) SKM_sk_set(ASN1_VALUE, (st), (i), (val))\n# define sk_ASN1_VALUE_zero(st) SKM_sk_zero(ASN1_VALUE, (st))\n# define sk_ASN1_VALUE_push(st, val) SKM_sk_push(ASN1_VALUE, (st), (val))\n# define sk_ASN1_VALUE_unshift(st, val) SKM_sk_unshift(ASN1_VALUE, (st), (val))\n# define sk_ASN1_VALUE_find(st, val) SKM_sk_find(ASN1_VALUE, (st), (val))\n# define sk_ASN1_VALUE_find_ex(st, val) SKM_sk_find_ex(ASN1_VALUE, (st), (val))\n# define sk_ASN1_VALUE_delete(st, i) SKM_sk_delete(ASN1_VALUE, (st), (i))\n# define sk_ASN1_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ASN1_VALUE, (st), (ptr))\n# define sk_ASN1_VALUE_insert(st, val, i) SKM_sk_insert(ASN1_VALUE, (st), (val), (i))\n# define sk_ASN1_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ASN1_VALUE, (st), (cmp))\n# define sk_ASN1_VALUE_dup(st) SKM_sk_dup(ASN1_VALUE, st)\n# define sk_ASN1_VALUE_pop_free(st, free_func) SKM_sk_pop_free(ASN1_VALUE, (st), (free_func))\n# define sk_ASN1_VALUE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ASN1_VALUE, (st), (copy_func), (free_func))\n# define sk_ASN1_VALUE_shift(st) SKM_sk_shift(ASN1_VALUE, (st))\n# define sk_ASN1_VALUE_pop(st) SKM_sk_pop(ASN1_VALUE, (st))\n# define sk_ASN1_VALUE_sort(st) SKM_sk_sort(ASN1_VALUE, (st))\n# define sk_ASN1_VALUE_is_sorted(st) SKM_sk_is_sorted(ASN1_VALUE, (st))\n# define sk_BIO_new(cmp) SKM_sk_new(BIO, (cmp))\n# define sk_BIO_new_null() SKM_sk_new_null(BIO)\n# define sk_BIO_free(st) SKM_sk_free(BIO, (st))\n# define sk_BIO_num(st) SKM_sk_num(BIO, (st))\n# define sk_BIO_value(st, i) SKM_sk_value(BIO, (st), (i))\n# define sk_BIO_set(st, i, val) SKM_sk_set(BIO, (st), (i), (val))\n# define sk_BIO_zero(st) SKM_sk_zero(BIO, (st))\n# define sk_BIO_push(st, val) SKM_sk_push(BIO, (st), (val))\n# define sk_BIO_unshift(st, val) SKM_sk_unshift(BIO, (st), (val))\n# define sk_BIO_find(st, val) SKM_sk_find(BIO, (st), (val))\n# define sk_BIO_find_ex(st, val) SKM_sk_find_ex(BIO, (st), (val))\n# define sk_BIO_delete(st, i) SKM_sk_delete(BIO, (st), (i))\n# define sk_BIO_delete_ptr(st, ptr) SKM_sk_delete_ptr(BIO, (st), (ptr))\n# define sk_BIO_insert(st, val, i) SKM_sk_insert(BIO, (st), (val), (i))\n# define sk_BIO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BIO, (st), (cmp))\n# define sk_BIO_dup(st) SKM_sk_dup(BIO, st)\n# define sk_BIO_pop_free(st, free_func) SKM_sk_pop_free(BIO, (st), (free_func))\n# define sk_BIO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(BIO, (st), (copy_func), (free_func))\n# define sk_BIO_shift(st) SKM_sk_shift(BIO, (st))\n# define sk_BIO_pop(st) SKM_sk_pop(BIO, (st))\n# define sk_BIO_sort(st) SKM_sk_sort(BIO, (st))\n# define sk_BIO_is_sorted(st) SKM_sk_is_sorted(BIO, (st))\n# define sk_BY_DIR_ENTRY_new(cmp) SKM_sk_new(BY_DIR_ENTRY, (cmp))\n# define sk_BY_DIR_ENTRY_new_null() SKM_sk_new_null(BY_DIR_ENTRY)\n# define sk_BY_DIR_ENTRY_free(st) SKM_sk_free(BY_DIR_ENTRY, (st))\n# define sk_BY_DIR_ENTRY_num(st) SKM_sk_num(BY_DIR_ENTRY, (st))\n# define sk_BY_DIR_ENTRY_value(st, i) SKM_sk_value(BY_DIR_ENTRY, (st), (i))\n# define sk_BY_DIR_ENTRY_set(st, i, val) SKM_sk_set(BY_DIR_ENTRY, (st), (i), (val))\n# define sk_BY_DIR_ENTRY_zero(st) SKM_sk_zero(BY_DIR_ENTRY, (st))\n# define sk_BY_DIR_ENTRY_push(st, val) SKM_sk_push(BY_DIR_ENTRY, (st), (val))\n# define sk_BY_DIR_ENTRY_unshift(st, val) SKM_sk_unshift(BY_DIR_ENTRY, (st), (val))\n# define sk_BY_DIR_ENTRY_find(st, val) SKM_sk_find(BY_DIR_ENTRY, (st), (val))\n# define sk_BY_DIR_ENTRY_find_ex(st, val) SKM_sk_find_ex(BY_DIR_ENTRY, (st), (val))\n# define sk_BY_DIR_ENTRY_delete(st, i) SKM_sk_delete(BY_DIR_ENTRY, (st), (i))\n# define sk_BY_DIR_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(BY_DIR_ENTRY, (st), (ptr))\n# define sk_BY_DIR_ENTRY_insert(st, val, i) SKM_sk_insert(BY_DIR_ENTRY, (st), (val), (i))\n# define sk_BY_DIR_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BY_DIR_ENTRY, (st), (cmp))\n# define sk_BY_DIR_ENTRY_dup(st) SKM_sk_dup(BY_DIR_ENTRY, st)\n# define sk_BY_DIR_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(BY_DIR_ENTRY, (st), (free_func))\n# define sk_BY_DIR_ENTRY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(BY_DIR_ENTRY, (st), (copy_func), (free_func))\n# define sk_BY_DIR_ENTRY_shift(st) SKM_sk_shift(BY_DIR_ENTRY, (st))\n# define sk_BY_DIR_ENTRY_pop(st) SKM_sk_pop(BY_DIR_ENTRY, (st))\n# define sk_BY_DIR_ENTRY_sort(st) SKM_sk_sort(BY_DIR_ENTRY, (st))\n# define sk_BY_DIR_ENTRY_is_sorted(st) SKM_sk_is_sorted(BY_DIR_ENTRY, (st))\n# define sk_BY_DIR_HASH_new(cmp) SKM_sk_new(BY_DIR_HASH, (cmp))\n# define sk_BY_DIR_HASH_new_null() SKM_sk_new_null(BY_DIR_HASH)\n# define sk_BY_DIR_HASH_free(st) SKM_sk_free(BY_DIR_HASH, (st))\n# define sk_BY_DIR_HASH_num(st) SKM_sk_num(BY_DIR_HASH, (st))\n# define sk_BY_DIR_HASH_value(st, i) SKM_sk_value(BY_DIR_HASH, (st), (i))\n# define sk_BY_DIR_HASH_set(st, i, val) SKM_sk_set(BY_DIR_HASH, (st), (i), (val))\n# define sk_BY_DIR_HASH_zero(st) SKM_sk_zero(BY_DIR_HASH, (st))\n# define sk_BY_DIR_HASH_push(st, val) SKM_sk_push(BY_DIR_HASH, (st), (val))\n# define sk_BY_DIR_HASH_unshift(st, val) SKM_sk_unshift(BY_DIR_HASH, (st), (val))\n# define sk_BY_DIR_HASH_find(st, val) SKM_sk_find(BY_DIR_HASH, (st), (val))\n# define sk_BY_DIR_HASH_find_ex(st, val) SKM_sk_find_ex(BY_DIR_HASH, (st), (val))\n# define sk_BY_DIR_HASH_delete(st, i) SKM_sk_delete(BY_DIR_HASH, (st), (i))\n# define sk_BY_DIR_HASH_delete_ptr(st, ptr) SKM_sk_delete_ptr(BY_DIR_HASH, (st), (ptr))\n# define sk_BY_DIR_HASH_insert(st, val, i) SKM_sk_insert(BY_DIR_HASH, (st), (val), (i))\n# define sk_BY_DIR_HASH_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(BY_DIR_HASH, (st), (cmp))\n# define sk_BY_DIR_HASH_dup(st) SKM_sk_dup(BY_DIR_HASH, st)\n# define sk_BY_DIR_HASH_pop_free(st, free_func) SKM_sk_pop_free(BY_DIR_HASH, (st), (free_func))\n# define sk_BY_DIR_HASH_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(BY_DIR_HASH, (st), (copy_func), (free_func))\n# define sk_BY_DIR_HASH_shift(st) SKM_sk_shift(BY_DIR_HASH, (st))\n# define sk_BY_DIR_HASH_pop(st) SKM_sk_pop(BY_DIR_HASH, (st))\n# define sk_BY_DIR_HASH_sort(st) SKM_sk_sort(BY_DIR_HASH, (st))\n# define sk_BY_DIR_HASH_is_sorted(st) SKM_sk_is_sorted(BY_DIR_HASH, (st))\n# define sk_CMS_CertificateChoices_new(cmp) SKM_sk_new(CMS_CertificateChoices, (cmp))\n# define sk_CMS_CertificateChoices_new_null() SKM_sk_new_null(CMS_CertificateChoices)\n# define sk_CMS_CertificateChoices_free(st) SKM_sk_free(CMS_CertificateChoices, (st))\n# define sk_CMS_CertificateChoices_num(st) SKM_sk_num(CMS_CertificateChoices, (st))\n# define sk_CMS_CertificateChoices_value(st, i) SKM_sk_value(CMS_CertificateChoices, (st), (i))\n# define sk_CMS_CertificateChoices_set(st, i, val) SKM_sk_set(CMS_CertificateChoices, (st), (i), (val))\n# define sk_CMS_CertificateChoices_zero(st) SKM_sk_zero(CMS_CertificateChoices, (st))\n# define sk_CMS_CertificateChoices_push(st, val) SKM_sk_push(CMS_CertificateChoices, (st), (val))\n# define sk_CMS_CertificateChoices_unshift(st, val) SKM_sk_unshift(CMS_CertificateChoices, (st), (val))\n# define sk_CMS_CertificateChoices_find(st, val) SKM_sk_find(CMS_CertificateChoices, (st), (val))\n# define sk_CMS_CertificateChoices_find_ex(st, val) SKM_sk_find_ex(CMS_CertificateChoices, (st), (val))\n# define sk_CMS_CertificateChoices_delete(st, i) SKM_sk_delete(CMS_CertificateChoices, (st), (i))\n# define sk_CMS_CertificateChoices_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_CertificateChoices, (st), (ptr))\n# define sk_CMS_CertificateChoices_insert(st, val, i) SKM_sk_insert(CMS_CertificateChoices, (st), (val), (i))\n# define sk_CMS_CertificateChoices_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_CertificateChoices, (st), (cmp))\n# define sk_CMS_CertificateChoices_dup(st) SKM_sk_dup(CMS_CertificateChoices, st)\n# define sk_CMS_CertificateChoices_pop_free(st, free_func) SKM_sk_pop_free(CMS_CertificateChoices, (st), (free_func))\n# define sk_CMS_CertificateChoices_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_CertificateChoices, (st), (copy_func), (free_func))\n# define sk_CMS_CertificateChoices_shift(st) SKM_sk_shift(CMS_CertificateChoices, (st))\n# define sk_CMS_CertificateChoices_pop(st) SKM_sk_pop(CMS_CertificateChoices, (st))\n# define sk_CMS_CertificateChoices_sort(st) SKM_sk_sort(CMS_CertificateChoices, (st))\n# define sk_CMS_CertificateChoices_is_sorted(st) SKM_sk_is_sorted(CMS_CertificateChoices, (st))\n# define sk_CMS_RecipientEncryptedKey_new(cmp) SKM_sk_new(CMS_RecipientEncryptedKey, (cmp))\n# define sk_CMS_RecipientEncryptedKey_new_null() SKM_sk_new_null(CMS_RecipientEncryptedKey)\n# define sk_CMS_RecipientEncryptedKey_free(st) SKM_sk_free(CMS_RecipientEncryptedKey, (st))\n# define sk_CMS_RecipientEncryptedKey_num(st) SKM_sk_num(CMS_RecipientEncryptedKey, (st))\n# define sk_CMS_RecipientEncryptedKey_value(st, i) SKM_sk_value(CMS_RecipientEncryptedKey, (st), (i))\n# define sk_CMS_RecipientEncryptedKey_set(st, i, val) SKM_sk_set(CMS_RecipientEncryptedKey, (st), (i), (val))\n# define sk_CMS_RecipientEncryptedKey_zero(st) SKM_sk_zero(CMS_RecipientEncryptedKey, (st))\n# define sk_CMS_RecipientEncryptedKey_push(st, val) SKM_sk_push(CMS_RecipientEncryptedKey, (st), (val))\n# define sk_CMS_RecipientEncryptedKey_unshift(st, val) SKM_sk_unshift(CMS_RecipientEncryptedKey, (st), (val))\n# define sk_CMS_RecipientEncryptedKey_find(st, val) SKM_sk_find(CMS_RecipientEncryptedKey, (st), (val))\n# define sk_CMS_RecipientEncryptedKey_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientEncryptedKey, (st), (val))\n# define sk_CMS_RecipientEncryptedKey_delete(st, i) SKM_sk_delete(CMS_RecipientEncryptedKey, (st), (i))\n# define sk_CMS_RecipientEncryptedKey_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientEncryptedKey, (st), (ptr))\n# define sk_CMS_RecipientEncryptedKey_insert(st, val, i) SKM_sk_insert(CMS_RecipientEncryptedKey, (st), (val), (i))\n# define sk_CMS_RecipientEncryptedKey_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientEncryptedKey, (st), (cmp))\n# define sk_CMS_RecipientEncryptedKey_dup(st) SKM_sk_dup(CMS_RecipientEncryptedKey, st)\n# define sk_CMS_RecipientEncryptedKey_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientEncryptedKey, (st), (free_func))\n# define sk_CMS_RecipientEncryptedKey_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_RecipientEncryptedKey, (st), (copy_func), (free_func))\n# define sk_CMS_RecipientEncryptedKey_shift(st) SKM_sk_shift(CMS_RecipientEncryptedKey, (st))\n# define sk_CMS_RecipientEncryptedKey_pop(st) SKM_sk_pop(CMS_RecipientEncryptedKey, (st))\n# define sk_CMS_RecipientEncryptedKey_sort(st) SKM_sk_sort(CMS_RecipientEncryptedKey, (st))\n# define sk_CMS_RecipientEncryptedKey_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientEncryptedKey, (st))\n# define sk_CMS_RecipientInfo_new(cmp) SKM_sk_new(CMS_RecipientInfo, (cmp))\n# define sk_CMS_RecipientInfo_new_null() SKM_sk_new_null(CMS_RecipientInfo)\n# define sk_CMS_RecipientInfo_free(st) SKM_sk_free(CMS_RecipientInfo, (st))\n# define sk_CMS_RecipientInfo_num(st) SKM_sk_num(CMS_RecipientInfo, (st))\n# define sk_CMS_RecipientInfo_value(st, i) SKM_sk_value(CMS_RecipientInfo, (st), (i))\n# define sk_CMS_RecipientInfo_set(st, i, val) SKM_sk_set(CMS_RecipientInfo, (st), (i), (val))\n# define sk_CMS_RecipientInfo_zero(st) SKM_sk_zero(CMS_RecipientInfo, (st))\n# define sk_CMS_RecipientInfo_push(st, val) SKM_sk_push(CMS_RecipientInfo, (st), (val))\n# define sk_CMS_RecipientInfo_unshift(st, val) SKM_sk_unshift(CMS_RecipientInfo, (st), (val))\n# define sk_CMS_RecipientInfo_find(st, val) SKM_sk_find(CMS_RecipientInfo, (st), (val))\n# define sk_CMS_RecipientInfo_find_ex(st, val) SKM_sk_find_ex(CMS_RecipientInfo, (st), (val))\n# define sk_CMS_RecipientInfo_delete(st, i) SKM_sk_delete(CMS_RecipientInfo, (st), (i))\n# define sk_CMS_RecipientInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RecipientInfo, (st), (ptr))\n# define sk_CMS_RecipientInfo_insert(st, val, i) SKM_sk_insert(CMS_RecipientInfo, (st), (val), (i))\n# define sk_CMS_RecipientInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RecipientInfo, (st), (cmp))\n# define sk_CMS_RecipientInfo_dup(st) SKM_sk_dup(CMS_RecipientInfo, st)\n# define sk_CMS_RecipientInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_RecipientInfo, (st), (free_func))\n# define sk_CMS_RecipientInfo_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_RecipientInfo, (st), (copy_func), (free_func))\n# define sk_CMS_RecipientInfo_shift(st) SKM_sk_shift(CMS_RecipientInfo, (st))\n# define sk_CMS_RecipientInfo_pop(st) SKM_sk_pop(CMS_RecipientInfo, (st))\n# define sk_CMS_RecipientInfo_sort(st) SKM_sk_sort(CMS_RecipientInfo, (st))\n# define sk_CMS_RecipientInfo_is_sorted(st) SKM_sk_is_sorted(CMS_RecipientInfo, (st))\n# define sk_CMS_RevocationInfoChoice_new(cmp) SKM_sk_new(CMS_RevocationInfoChoice, (cmp))\n# define sk_CMS_RevocationInfoChoice_new_null() SKM_sk_new_null(CMS_RevocationInfoChoice)\n# define sk_CMS_RevocationInfoChoice_free(st) SKM_sk_free(CMS_RevocationInfoChoice, (st))\n# define sk_CMS_RevocationInfoChoice_num(st) SKM_sk_num(CMS_RevocationInfoChoice, (st))\n# define sk_CMS_RevocationInfoChoice_value(st, i) SKM_sk_value(CMS_RevocationInfoChoice, (st), (i))\n# define sk_CMS_RevocationInfoChoice_set(st, i, val) SKM_sk_set(CMS_RevocationInfoChoice, (st), (i), (val))\n# define sk_CMS_RevocationInfoChoice_zero(st) SKM_sk_zero(CMS_RevocationInfoChoice, (st))\n# define sk_CMS_RevocationInfoChoice_push(st, val) SKM_sk_push(CMS_RevocationInfoChoice, (st), (val))\n# define sk_CMS_RevocationInfoChoice_unshift(st, val) SKM_sk_unshift(CMS_RevocationInfoChoice, (st), (val))\n# define sk_CMS_RevocationInfoChoice_find(st, val) SKM_sk_find(CMS_RevocationInfoChoice, (st), (val))\n# define sk_CMS_RevocationInfoChoice_find_ex(st, val) SKM_sk_find_ex(CMS_RevocationInfoChoice, (st), (val))\n# define sk_CMS_RevocationInfoChoice_delete(st, i) SKM_sk_delete(CMS_RevocationInfoChoice, (st), (i))\n# define sk_CMS_RevocationInfoChoice_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_RevocationInfoChoice, (st), (ptr))\n# define sk_CMS_RevocationInfoChoice_insert(st, val, i) SKM_sk_insert(CMS_RevocationInfoChoice, (st), (val), (i))\n# define sk_CMS_RevocationInfoChoice_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_RevocationInfoChoice, (st), (cmp))\n# define sk_CMS_RevocationInfoChoice_dup(st) SKM_sk_dup(CMS_RevocationInfoChoice, st)\n# define sk_CMS_RevocationInfoChoice_pop_free(st, free_func) SKM_sk_pop_free(CMS_RevocationInfoChoice, (st), (free_func))\n# define sk_CMS_RevocationInfoChoice_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_RevocationInfoChoice, (st), (copy_func), (free_func))\n# define sk_CMS_RevocationInfoChoice_shift(st) SKM_sk_shift(CMS_RevocationInfoChoice, (st))\n# define sk_CMS_RevocationInfoChoice_pop(st) SKM_sk_pop(CMS_RevocationInfoChoice, (st))\n# define sk_CMS_RevocationInfoChoice_sort(st) SKM_sk_sort(CMS_RevocationInfoChoice, (st))\n# define sk_CMS_RevocationInfoChoice_is_sorted(st) SKM_sk_is_sorted(CMS_RevocationInfoChoice, (st))\n# define sk_CMS_SignerInfo_new(cmp) SKM_sk_new(CMS_SignerInfo, (cmp))\n# define sk_CMS_SignerInfo_new_null() SKM_sk_new_null(CMS_SignerInfo)\n# define sk_CMS_SignerInfo_free(st) SKM_sk_free(CMS_SignerInfo, (st))\n# define sk_CMS_SignerInfo_num(st) SKM_sk_num(CMS_SignerInfo, (st))\n# define sk_CMS_SignerInfo_value(st, i) SKM_sk_value(CMS_SignerInfo, (st), (i))\n# define sk_CMS_SignerInfo_set(st, i, val) SKM_sk_set(CMS_SignerInfo, (st), (i), (val))\n# define sk_CMS_SignerInfo_zero(st) SKM_sk_zero(CMS_SignerInfo, (st))\n# define sk_CMS_SignerInfo_push(st, val) SKM_sk_push(CMS_SignerInfo, (st), (val))\n# define sk_CMS_SignerInfo_unshift(st, val) SKM_sk_unshift(CMS_SignerInfo, (st), (val))\n# define sk_CMS_SignerInfo_find(st, val) SKM_sk_find(CMS_SignerInfo, (st), (val))\n# define sk_CMS_SignerInfo_find_ex(st, val) SKM_sk_find_ex(CMS_SignerInfo, (st), (val))\n# define sk_CMS_SignerInfo_delete(st, i) SKM_sk_delete(CMS_SignerInfo, (st), (i))\n# define sk_CMS_SignerInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(CMS_SignerInfo, (st), (ptr))\n# define sk_CMS_SignerInfo_insert(st, val, i) SKM_sk_insert(CMS_SignerInfo, (st), (val), (i))\n# define sk_CMS_SignerInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CMS_SignerInfo, (st), (cmp))\n# define sk_CMS_SignerInfo_dup(st) SKM_sk_dup(CMS_SignerInfo, st)\n# define sk_CMS_SignerInfo_pop_free(st, free_func) SKM_sk_pop_free(CMS_SignerInfo, (st), (free_func))\n# define sk_CMS_SignerInfo_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CMS_SignerInfo, (st), (copy_func), (free_func))\n# define sk_CMS_SignerInfo_shift(st) SKM_sk_shift(CMS_SignerInfo, (st))\n# define sk_CMS_SignerInfo_pop(st) SKM_sk_pop(CMS_SignerInfo, (st))\n# define sk_CMS_SignerInfo_sort(st) SKM_sk_sort(CMS_SignerInfo, (st))\n# define sk_CMS_SignerInfo_is_sorted(st) SKM_sk_is_sorted(CMS_SignerInfo, (st))\n# define sk_CONF_IMODULE_new(cmp) SKM_sk_new(CONF_IMODULE, (cmp))\n# define sk_CONF_IMODULE_new_null() SKM_sk_new_null(CONF_IMODULE)\n# define sk_CONF_IMODULE_free(st) SKM_sk_free(CONF_IMODULE, (st))\n# define sk_CONF_IMODULE_num(st) SKM_sk_num(CONF_IMODULE, (st))\n# define sk_CONF_IMODULE_value(st, i) SKM_sk_value(CONF_IMODULE, (st), (i))\n# define sk_CONF_IMODULE_set(st, i, val) SKM_sk_set(CONF_IMODULE, (st), (i), (val))\n# define sk_CONF_IMODULE_zero(st) SKM_sk_zero(CONF_IMODULE, (st))\n# define sk_CONF_IMODULE_push(st, val) SKM_sk_push(CONF_IMODULE, (st), (val))\n# define sk_CONF_IMODULE_unshift(st, val) SKM_sk_unshift(CONF_IMODULE, (st), (val))\n# define sk_CONF_IMODULE_find(st, val) SKM_sk_find(CONF_IMODULE, (st), (val))\n# define sk_CONF_IMODULE_find_ex(st, val) SKM_sk_find_ex(CONF_IMODULE, (st), (val))\n# define sk_CONF_IMODULE_delete(st, i) SKM_sk_delete(CONF_IMODULE, (st), (i))\n# define sk_CONF_IMODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_IMODULE, (st), (ptr))\n# define sk_CONF_IMODULE_insert(st, val, i) SKM_sk_insert(CONF_IMODULE, (st), (val), (i))\n# define sk_CONF_IMODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_IMODULE, (st), (cmp))\n# define sk_CONF_IMODULE_dup(st) SKM_sk_dup(CONF_IMODULE, st)\n# define sk_CONF_IMODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_IMODULE, (st), (free_func))\n# define sk_CONF_IMODULE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CONF_IMODULE, (st), (copy_func), (free_func))\n# define sk_CONF_IMODULE_shift(st) SKM_sk_shift(CONF_IMODULE, (st))\n# define sk_CONF_IMODULE_pop(st) SKM_sk_pop(CONF_IMODULE, (st))\n# define sk_CONF_IMODULE_sort(st) SKM_sk_sort(CONF_IMODULE, (st))\n# define sk_CONF_IMODULE_is_sorted(st) SKM_sk_is_sorted(CONF_IMODULE, (st))\n# define sk_CONF_MODULE_new(cmp) SKM_sk_new(CONF_MODULE, (cmp))\n# define sk_CONF_MODULE_new_null() SKM_sk_new_null(CONF_MODULE)\n# define sk_CONF_MODULE_free(st) SKM_sk_free(CONF_MODULE, (st))\n# define sk_CONF_MODULE_num(st) SKM_sk_num(CONF_MODULE, (st))\n# define sk_CONF_MODULE_value(st, i) SKM_sk_value(CONF_MODULE, (st), (i))\n# define sk_CONF_MODULE_set(st, i, val) SKM_sk_set(CONF_MODULE, (st), (i), (val))\n# define sk_CONF_MODULE_zero(st) SKM_sk_zero(CONF_MODULE, (st))\n# define sk_CONF_MODULE_push(st, val) SKM_sk_push(CONF_MODULE, (st), (val))\n# define sk_CONF_MODULE_unshift(st, val) SKM_sk_unshift(CONF_MODULE, (st), (val))\n# define sk_CONF_MODULE_find(st, val) SKM_sk_find(CONF_MODULE, (st), (val))\n# define sk_CONF_MODULE_find_ex(st, val) SKM_sk_find_ex(CONF_MODULE, (st), (val))\n# define sk_CONF_MODULE_delete(st, i) SKM_sk_delete(CONF_MODULE, (st), (i))\n# define sk_CONF_MODULE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_MODULE, (st), (ptr))\n# define sk_CONF_MODULE_insert(st, val, i) SKM_sk_insert(CONF_MODULE, (st), (val), (i))\n# define sk_CONF_MODULE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_MODULE, (st), (cmp))\n# define sk_CONF_MODULE_dup(st) SKM_sk_dup(CONF_MODULE, st)\n# define sk_CONF_MODULE_pop_free(st, free_func) SKM_sk_pop_free(CONF_MODULE, (st), (free_func))\n# define sk_CONF_MODULE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CONF_MODULE, (st), (copy_func), (free_func))\n# define sk_CONF_MODULE_shift(st) SKM_sk_shift(CONF_MODULE, (st))\n# define sk_CONF_MODULE_pop(st) SKM_sk_pop(CONF_MODULE, (st))\n# define sk_CONF_MODULE_sort(st) SKM_sk_sort(CONF_MODULE, (st))\n# define sk_CONF_MODULE_is_sorted(st) SKM_sk_is_sorted(CONF_MODULE, (st))\n# define sk_CONF_VALUE_new(cmp) SKM_sk_new(CONF_VALUE, (cmp))\n# define sk_CONF_VALUE_new_null() SKM_sk_new_null(CONF_VALUE)\n# define sk_CONF_VALUE_free(st) SKM_sk_free(CONF_VALUE, (st))\n# define sk_CONF_VALUE_num(st) SKM_sk_num(CONF_VALUE, (st))\n# define sk_CONF_VALUE_value(st, i) SKM_sk_value(CONF_VALUE, (st), (i))\n# define sk_CONF_VALUE_set(st, i, val) SKM_sk_set(CONF_VALUE, (st), (i), (val))\n# define sk_CONF_VALUE_zero(st) SKM_sk_zero(CONF_VALUE, (st))\n# define sk_CONF_VALUE_push(st, val) SKM_sk_push(CONF_VALUE, (st), (val))\n# define sk_CONF_VALUE_unshift(st, val) SKM_sk_unshift(CONF_VALUE, (st), (val))\n# define sk_CONF_VALUE_find(st, val) SKM_sk_find(CONF_VALUE, (st), (val))\n# define sk_CONF_VALUE_find_ex(st, val) SKM_sk_find_ex(CONF_VALUE, (st), (val))\n# define sk_CONF_VALUE_delete(st, i) SKM_sk_delete(CONF_VALUE, (st), (i))\n# define sk_CONF_VALUE_delete_ptr(st, ptr) SKM_sk_delete_ptr(CONF_VALUE, (st), (ptr))\n# define sk_CONF_VALUE_insert(st, val, i) SKM_sk_insert(CONF_VALUE, (st), (val), (i))\n# define sk_CONF_VALUE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CONF_VALUE, (st), (cmp))\n# define sk_CONF_VALUE_dup(st) SKM_sk_dup(CONF_VALUE, st)\n# define sk_CONF_VALUE_pop_free(st, free_func) SKM_sk_pop_free(CONF_VALUE, (st), (free_func))\n# define sk_CONF_VALUE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CONF_VALUE, (st), (copy_func), (free_func))\n# define sk_CONF_VALUE_shift(st) SKM_sk_shift(CONF_VALUE, (st))\n# define sk_CONF_VALUE_pop(st) SKM_sk_pop(CONF_VALUE, (st))\n# define sk_CONF_VALUE_sort(st) SKM_sk_sort(CONF_VALUE, (st))\n# define sk_CONF_VALUE_is_sorted(st) SKM_sk_is_sorted(CONF_VALUE, (st))\n# define sk_CRYPTO_EX_DATA_FUNCS_new(cmp) SKM_sk_new(CRYPTO_EX_DATA_FUNCS, (cmp))\n# define sk_CRYPTO_EX_DATA_FUNCS_new_null() SKM_sk_new_null(CRYPTO_EX_DATA_FUNCS)\n# define sk_CRYPTO_EX_DATA_FUNCS_free(st) SKM_sk_free(CRYPTO_EX_DATA_FUNCS, (st))\n# define sk_CRYPTO_EX_DATA_FUNCS_num(st) SKM_sk_num(CRYPTO_EX_DATA_FUNCS, (st))\n# define sk_CRYPTO_EX_DATA_FUNCS_value(st, i) SKM_sk_value(CRYPTO_EX_DATA_FUNCS, (st), (i))\n# define sk_CRYPTO_EX_DATA_FUNCS_set(st, i, val) SKM_sk_set(CRYPTO_EX_DATA_FUNCS, (st), (i), (val))\n# define sk_CRYPTO_EX_DATA_FUNCS_zero(st) SKM_sk_zero(CRYPTO_EX_DATA_FUNCS, (st))\n# define sk_CRYPTO_EX_DATA_FUNCS_push(st, val) SKM_sk_push(CRYPTO_EX_DATA_FUNCS, (st), (val))\n# define sk_CRYPTO_EX_DATA_FUNCS_unshift(st, val) SKM_sk_unshift(CRYPTO_EX_DATA_FUNCS, (st), (val))\n# define sk_CRYPTO_EX_DATA_FUNCS_find(st, val) SKM_sk_find(CRYPTO_EX_DATA_FUNCS, (st), (val))\n# define sk_CRYPTO_EX_DATA_FUNCS_find_ex(st, val) SKM_sk_find_ex(CRYPTO_EX_DATA_FUNCS, (st), (val))\n# define sk_CRYPTO_EX_DATA_FUNCS_delete(st, i) SKM_sk_delete(CRYPTO_EX_DATA_FUNCS, (st), (i))\n# define sk_CRYPTO_EX_DATA_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_EX_DATA_FUNCS, (st), (ptr))\n# define sk_CRYPTO_EX_DATA_FUNCS_insert(st, val, i) SKM_sk_insert(CRYPTO_EX_DATA_FUNCS, (st), (val), (i))\n# define sk_CRYPTO_EX_DATA_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_EX_DATA_FUNCS, (st), (cmp))\n# define sk_CRYPTO_EX_DATA_FUNCS_dup(st) SKM_sk_dup(CRYPTO_EX_DATA_FUNCS, st)\n# define sk_CRYPTO_EX_DATA_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_EX_DATA_FUNCS, (st), (free_func))\n# define sk_CRYPTO_EX_DATA_FUNCS_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CRYPTO_EX_DATA_FUNCS, (st), (copy_func), (free_func))\n# define sk_CRYPTO_EX_DATA_FUNCS_shift(st) SKM_sk_shift(CRYPTO_EX_DATA_FUNCS, (st))\n# define sk_CRYPTO_EX_DATA_FUNCS_pop(st) SKM_sk_pop(CRYPTO_EX_DATA_FUNCS, (st))\n# define sk_CRYPTO_EX_DATA_FUNCS_sort(st) SKM_sk_sort(CRYPTO_EX_DATA_FUNCS, (st))\n# define sk_CRYPTO_EX_DATA_FUNCS_is_sorted(st) SKM_sk_is_sorted(CRYPTO_EX_DATA_FUNCS, (st))\n# define sk_CRYPTO_dynlock_new(cmp) SKM_sk_new(CRYPTO_dynlock, (cmp))\n# define sk_CRYPTO_dynlock_new_null() SKM_sk_new_null(CRYPTO_dynlock)\n# define sk_CRYPTO_dynlock_free(st) SKM_sk_free(CRYPTO_dynlock, (st))\n# define sk_CRYPTO_dynlock_num(st) SKM_sk_num(CRYPTO_dynlock, (st))\n# define sk_CRYPTO_dynlock_value(st, i) SKM_sk_value(CRYPTO_dynlock, (st), (i))\n# define sk_CRYPTO_dynlock_set(st, i, val) SKM_sk_set(CRYPTO_dynlock, (st), (i), (val))\n# define sk_CRYPTO_dynlock_zero(st) SKM_sk_zero(CRYPTO_dynlock, (st))\n# define sk_CRYPTO_dynlock_push(st, val) SKM_sk_push(CRYPTO_dynlock, (st), (val))\n# define sk_CRYPTO_dynlock_unshift(st, val) SKM_sk_unshift(CRYPTO_dynlock, (st), (val))\n# define sk_CRYPTO_dynlock_find(st, val) SKM_sk_find(CRYPTO_dynlock, (st), (val))\n# define sk_CRYPTO_dynlock_find_ex(st, val) SKM_sk_find_ex(CRYPTO_dynlock, (st), (val))\n# define sk_CRYPTO_dynlock_delete(st, i) SKM_sk_delete(CRYPTO_dynlock, (st), (i))\n# define sk_CRYPTO_dynlock_delete_ptr(st, ptr) SKM_sk_delete_ptr(CRYPTO_dynlock, (st), (ptr))\n# define sk_CRYPTO_dynlock_insert(st, val, i) SKM_sk_insert(CRYPTO_dynlock, (st), (val), (i))\n# define sk_CRYPTO_dynlock_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(CRYPTO_dynlock, (st), (cmp))\n# define sk_CRYPTO_dynlock_dup(st) SKM_sk_dup(CRYPTO_dynlock, st)\n# define sk_CRYPTO_dynlock_pop_free(st, free_func) SKM_sk_pop_free(CRYPTO_dynlock, (st), (free_func))\n# define sk_CRYPTO_dynlock_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(CRYPTO_dynlock, (st), (copy_func), (free_func))\n# define sk_CRYPTO_dynlock_shift(st) SKM_sk_shift(CRYPTO_dynlock, (st))\n# define sk_CRYPTO_dynlock_pop(st) SKM_sk_pop(CRYPTO_dynlock, (st))\n# define sk_CRYPTO_dynlock_sort(st) SKM_sk_sort(CRYPTO_dynlock, (st))\n# define sk_CRYPTO_dynlock_is_sorted(st) SKM_sk_is_sorted(CRYPTO_dynlock, (st))\n# define sk_DIST_POINT_new(cmp) SKM_sk_new(DIST_POINT, (cmp))\n# define sk_DIST_POINT_new_null() SKM_sk_new_null(DIST_POINT)\n# define sk_DIST_POINT_free(st) SKM_sk_free(DIST_POINT, (st))\n# define sk_DIST_POINT_num(st) SKM_sk_num(DIST_POINT, (st))\n# define sk_DIST_POINT_value(st, i) SKM_sk_value(DIST_POINT, (st), (i))\n# define sk_DIST_POINT_set(st, i, val) SKM_sk_set(DIST_POINT, (st), (i), (val))\n# define sk_DIST_POINT_zero(st) SKM_sk_zero(DIST_POINT, (st))\n# define sk_DIST_POINT_push(st, val) SKM_sk_push(DIST_POINT, (st), (val))\n# define sk_DIST_POINT_unshift(st, val) SKM_sk_unshift(DIST_POINT, (st), (val))\n# define sk_DIST_POINT_find(st, val) SKM_sk_find(DIST_POINT, (st), (val))\n# define sk_DIST_POINT_find_ex(st, val) SKM_sk_find_ex(DIST_POINT, (st), (val))\n# define sk_DIST_POINT_delete(st, i) SKM_sk_delete(DIST_POINT, (st), (i))\n# define sk_DIST_POINT_delete_ptr(st, ptr) SKM_sk_delete_ptr(DIST_POINT, (st), (ptr))\n# define sk_DIST_POINT_insert(st, val, i) SKM_sk_insert(DIST_POINT, (st), (val), (i))\n# define sk_DIST_POINT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(DIST_POINT, (st), (cmp))\n# define sk_DIST_POINT_dup(st) SKM_sk_dup(DIST_POINT, st)\n# define sk_DIST_POINT_pop_free(st, free_func) SKM_sk_pop_free(DIST_POINT, (st), (free_func))\n# define sk_DIST_POINT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(DIST_POINT, (st), (copy_func), (free_func))\n# define sk_DIST_POINT_shift(st) SKM_sk_shift(DIST_POINT, (st))\n# define sk_DIST_POINT_pop(st) SKM_sk_pop(DIST_POINT, (st))\n# define sk_DIST_POINT_sort(st) SKM_sk_sort(DIST_POINT, (st))\n# define sk_DIST_POINT_is_sorted(st) SKM_sk_is_sorted(DIST_POINT, (st))\n# define sk_ENGINE_new(cmp) SKM_sk_new(ENGINE, (cmp))\n# define sk_ENGINE_new_null() SKM_sk_new_null(ENGINE)\n# define sk_ENGINE_free(st) SKM_sk_free(ENGINE, (st))\n# define sk_ENGINE_num(st) SKM_sk_num(ENGINE, (st))\n# define sk_ENGINE_value(st, i) SKM_sk_value(ENGINE, (st), (i))\n# define sk_ENGINE_set(st, i, val) SKM_sk_set(ENGINE, (st), (i), (val))\n# define sk_ENGINE_zero(st) SKM_sk_zero(ENGINE, (st))\n# define sk_ENGINE_push(st, val) SKM_sk_push(ENGINE, (st), (val))\n# define sk_ENGINE_unshift(st, val) SKM_sk_unshift(ENGINE, (st), (val))\n# define sk_ENGINE_find(st, val) SKM_sk_find(ENGINE, (st), (val))\n# define sk_ENGINE_find_ex(st, val) SKM_sk_find_ex(ENGINE, (st), (val))\n# define sk_ENGINE_delete(st, i) SKM_sk_delete(ENGINE, (st), (i))\n# define sk_ENGINE_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE, (st), (ptr))\n# define sk_ENGINE_insert(st, val, i) SKM_sk_insert(ENGINE, (st), (val), (i))\n# define sk_ENGINE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE, (st), (cmp))\n# define sk_ENGINE_dup(st) SKM_sk_dup(ENGINE, st)\n# define sk_ENGINE_pop_free(st, free_func) SKM_sk_pop_free(ENGINE, (st), (free_func))\n# define sk_ENGINE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ENGINE, (st), (copy_func), (free_func))\n# define sk_ENGINE_shift(st) SKM_sk_shift(ENGINE, (st))\n# define sk_ENGINE_pop(st) SKM_sk_pop(ENGINE, (st))\n# define sk_ENGINE_sort(st) SKM_sk_sort(ENGINE, (st))\n# define sk_ENGINE_is_sorted(st) SKM_sk_is_sorted(ENGINE, (st))\n# define sk_ENGINE_CLEANUP_ITEM_new(cmp) SKM_sk_new(ENGINE_CLEANUP_ITEM, (cmp))\n# define sk_ENGINE_CLEANUP_ITEM_new_null() SKM_sk_new_null(ENGINE_CLEANUP_ITEM)\n# define sk_ENGINE_CLEANUP_ITEM_free(st) SKM_sk_free(ENGINE_CLEANUP_ITEM, (st))\n# define sk_ENGINE_CLEANUP_ITEM_num(st) SKM_sk_num(ENGINE_CLEANUP_ITEM, (st))\n# define sk_ENGINE_CLEANUP_ITEM_value(st, i) SKM_sk_value(ENGINE_CLEANUP_ITEM, (st), (i))\n# define sk_ENGINE_CLEANUP_ITEM_set(st, i, val) SKM_sk_set(ENGINE_CLEANUP_ITEM, (st), (i), (val))\n# define sk_ENGINE_CLEANUP_ITEM_zero(st) SKM_sk_zero(ENGINE_CLEANUP_ITEM, (st))\n# define sk_ENGINE_CLEANUP_ITEM_push(st, val) SKM_sk_push(ENGINE_CLEANUP_ITEM, (st), (val))\n# define sk_ENGINE_CLEANUP_ITEM_unshift(st, val) SKM_sk_unshift(ENGINE_CLEANUP_ITEM, (st), (val))\n# define sk_ENGINE_CLEANUP_ITEM_find(st, val) SKM_sk_find(ENGINE_CLEANUP_ITEM, (st), (val))\n# define sk_ENGINE_CLEANUP_ITEM_find_ex(st, val) SKM_sk_find_ex(ENGINE_CLEANUP_ITEM, (st), (val))\n# define sk_ENGINE_CLEANUP_ITEM_delete(st, i) SKM_sk_delete(ENGINE_CLEANUP_ITEM, (st), (i))\n# define sk_ENGINE_CLEANUP_ITEM_delete_ptr(st, ptr) SKM_sk_delete_ptr(ENGINE_CLEANUP_ITEM, (st), (ptr))\n# define sk_ENGINE_CLEANUP_ITEM_insert(st, val, i) SKM_sk_insert(ENGINE_CLEANUP_ITEM, (st), (val), (i))\n# define sk_ENGINE_CLEANUP_ITEM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ENGINE_CLEANUP_ITEM, (st), (cmp))\n# define sk_ENGINE_CLEANUP_ITEM_dup(st) SKM_sk_dup(ENGINE_CLEANUP_ITEM, st)\n# define sk_ENGINE_CLEANUP_ITEM_pop_free(st, free_func) SKM_sk_pop_free(ENGINE_CLEANUP_ITEM, (st), (free_func))\n# define sk_ENGINE_CLEANUP_ITEM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ENGINE_CLEANUP_ITEM, (st), (copy_func), (free_func))\n# define sk_ENGINE_CLEANUP_ITEM_shift(st) SKM_sk_shift(ENGINE_CLEANUP_ITEM, (st))\n# define sk_ENGINE_CLEANUP_ITEM_pop(st) SKM_sk_pop(ENGINE_CLEANUP_ITEM, (st))\n# define sk_ENGINE_CLEANUP_ITEM_sort(st) SKM_sk_sort(ENGINE_CLEANUP_ITEM, (st))\n# define sk_ENGINE_CLEANUP_ITEM_is_sorted(st) SKM_sk_is_sorted(ENGINE_CLEANUP_ITEM, (st))\n# define sk_ESS_CERT_ID_new(cmp) SKM_sk_new(ESS_CERT_ID, (cmp))\n# define sk_ESS_CERT_ID_new_null() SKM_sk_new_null(ESS_CERT_ID)\n# define sk_ESS_CERT_ID_free(st) SKM_sk_free(ESS_CERT_ID, (st))\n# define sk_ESS_CERT_ID_num(st) SKM_sk_num(ESS_CERT_ID, (st))\n# define sk_ESS_CERT_ID_value(st, i) SKM_sk_value(ESS_CERT_ID, (st), (i))\n# define sk_ESS_CERT_ID_set(st, i, val) SKM_sk_set(ESS_CERT_ID, (st), (i), (val))\n# define sk_ESS_CERT_ID_zero(st) SKM_sk_zero(ESS_CERT_ID, (st))\n# define sk_ESS_CERT_ID_push(st, val) SKM_sk_push(ESS_CERT_ID, (st), (val))\n# define sk_ESS_CERT_ID_unshift(st, val) SKM_sk_unshift(ESS_CERT_ID, (st), (val))\n# define sk_ESS_CERT_ID_find(st, val) SKM_sk_find(ESS_CERT_ID, (st), (val))\n# define sk_ESS_CERT_ID_find_ex(st, val) SKM_sk_find_ex(ESS_CERT_ID, (st), (val))\n# define sk_ESS_CERT_ID_delete(st, i) SKM_sk_delete(ESS_CERT_ID, (st), (i))\n# define sk_ESS_CERT_ID_delete_ptr(st, ptr) SKM_sk_delete_ptr(ESS_CERT_ID, (st), (ptr))\n# define sk_ESS_CERT_ID_insert(st, val, i) SKM_sk_insert(ESS_CERT_ID, (st), (val), (i))\n# define sk_ESS_CERT_ID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ESS_CERT_ID, (st), (cmp))\n# define sk_ESS_CERT_ID_dup(st) SKM_sk_dup(ESS_CERT_ID, st)\n# define sk_ESS_CERT_ID_pop_free(st, free_func) SKM_sk_pop_free(ESS_CERT_ID, (st), (free_func))\n# define sk_ESS_CERT_ID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(ESS_CERT_ID, (st), (copy_func), (free_func))\n# define sk_ESS_CERT_ID_shift(st) SKM_sk_shift(ESS_CERT_ID, (st))\n# define sk_ESS_CERT_ID_pop(st) SKM_sk_pop(ESS_CERT_ID, (st))\n# define sk_ESS_CERT_ID_sort(st) SKM_sk_sort(ESS_CERT_ID, (st))\n# define sk_ESS_CERT_ID_is_sorted(st) SKM_sk_is_sorted(ESS_CERT_ID, (st))\n# define sk_EVP_MD_new(cmp) SKM_sk_new(EVP_MD, (cmp))\n# define sk_EVP_MD_new_null() SKM_sk_new_null(EVP_MD)\n# define sk_EVP_MD_free(st) SKM_sk_free(EVP_MD, (st))\n# define sk_EVP_MD_num(st) SKM_sk_num(EVP_MD, (st))\n# define sk_EVP_MD_value(st, i) SKM_sk_value(EVP_MD, (st), (i))\n# define sk_EVP_MD_set(st, i, val) SKM_sk_set(EVP_MD, (st), (i), (val))\n# define sk_EVP_MD_zero(st) SKM_sk_zero(EVP_MD, (st))\n# define sk_EVP_MD_push(st, val) SKM_sk_push(EVP_MD, (st), (val))\n# define sk_EVP_MD_unshift(st, val) SKM_sk_unshift(EVP_MD, (st), (val))\n# define sk_EVP_MD_find(st, val) SKM_sk_find(EVP_MD, (st), (val))\n# define sk_EVP_MD_find_ex(st, val) SKM_sk_find_ex(EVP_MD, (st), (val))\n# define sk_EVP_MD_delete(st, i) SKM_sk_delete(EVP_MD, (st), (i))\n# define sk_EVP_MD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_MD, (st), (ptr))\n# define sk_EVP_MD_insert(st, val, i) SKM_sk_insert(EVP_MD, (st), (val), (i))\n# define sk_EVP_MD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_MD, (st), (cmp))\n# define sk_EVP_MD_dup(st) SKM_sk_dup(EVP_MD, st)\n# define sk_EVP_MD_pop_free(st, free_func) SKM_sk_pop_free(EVP_MD, (st), (free_func))\n# define sk_EVP_MD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_MD, (st), (copy_func), (free_func))\n# define sk_EVP_MD_shift(st) SKM_sk_shift(EVP_MD, (st))\n# define sk_EVP_MD_pop(st) SKM_sk_pop(EVP_MD, (st))\n# define sk_EVP_MD_sort(st) SKM_sk_sort(EVP_MD, (st))\n# define sk_EVP_MD_is_sorted(st) SKM_sk_is_sorted(EVP_MD, (st))\n# define sk_EVP_PBE_CTL_new(cmp) SKM_sk_new(EVP_PBE_CTL, (cmp))\n# define sk_EVP_PBE_CTL_new_null() SKM_sk_new_null(EVP_PBE_CTL)\n# define sk_EVP_PBE_CTL_free(st) SKM_sk_free(EVP_PBE_CTL, (st))\n# define sk_EVP_PBE_CTL_num(st) SKM_sk_num(EVP_PBE_CTL, (st))\n# define sk_EVP_PBE_CTL_value(st, i) SKM_sk_value(EVP_PBE_CTL, (st), (i))\n# define sk_EVP_PBE_CTL_set(st, i, val) SKM_sk_set(EVP_PBE_CTL, (st), (i), (val))\n# define sk_EVP_PBE_CTL_zero(st) SKM_sk_zero(EVP_PBE_CTL, (st))\n# define sk_EVP_PBE_CTL_push(st, val) SKM_sk_push(EVP_PBE_CTL, (st), (val))\n# define sk_EVP_PBE_CTL_unshift(st, val) SKM_sk_unshift(EVP_PBE_CTL, (st), (val))\n# define sk_EVP_PBE_CTL_find(st, val) SKM_sk_find(EVP_PBE_CTL, (st), (val))\n# define sk_EVP_PBE_CTL_find_ex(st, val) SKM_sk_find_ex(EVP_PBE_CTL, (st), (val))\n# define sk_EVP_PBE_CTL_delete(st, i) SKM_sk_delete(EVP_PBE_CTL, (st), (i))\n# define sk_EVP_PBE_CTL_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PBE_CTL, (st), (ptr))\n# define sk_EVP_PBE_CTL_insert(st, val, i) SKM_sk_insert(EVP_PBE_CTL, (st), (val), (i))\n# define sk_EVP_PBE_CTL_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PBE_CTL, (st), (cmp))\n# define sk_EVP_PBE_CTL_dup(st) SKM_sk_dup(EVP_PBE_CTL, st)\n# define sk_EVP_PBE_CTL_pop_free(st, free_func) SKM_sk_pop_free(EVP_PBE_CTL, (st), (free_func))\n# define sk_EVP_PBE_CTL_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_PBE_CTL, (st), (copy_func), (free_func))\n# define sk_EVP_PBE_CTL_shift(st) SKM_sk_shift(EVP_PBE_CTL, (st))\n# define sk_EVP_PBE_CTL_pop(st) SKM_sk_pop(EVP_PBE_CTL, (st))\n# define sk_EVP_PBE_CTL_sort(st) SKM_sk_sort(EVP_PBE_CTL, (st))\n# define sk_EVP_PBE_CTL_is_sorted(st) SKM_sk_is_sorted(EVP_PBE_CTL, (st))\n# define sk_EVP_PKEY_ASN1_METHOD_new(cmp) SKM_sk_new(EVP_PKEY_ASN1_METHOD, (cmp))\n# define sk_EVP_PKEY_ASN1_METHOD_new_null() SKM_sk_new_null(EVP_PKEY_ASN1_METHOD)\n# define sk_EVP_PKEY_ASN1_METHOD_free(st) SKM_sk_free(EVP_PKEY_ASN1_METHOD, (st))\n# define sk_EVP_PKEY_ASN1_METHOD_num(st) SKM_sk_num(EVP_PKEY_ASN1_METHOD, (st))\n# define sk_EVP_PKEY_ASN1_METHOD_value(st, i) SKM_sk_value(EVP_PKEY_ASN1_METHOD, (st), (i))\n# define sk_EVP_PKEY_ASN1_METHOD_set(st, i, val) SKM_sk_set(EVP_PKEY_ASN1_METHOD, (st), (i), (val))\n# define sk_EVP_PKEY_ASN1_METHOD_zero(st) SKM_sk_zero(EVP_PKEY_ASN1_METHOD, (st))\n# define sk_EVP_PKEY_ASN1_METHOD_push(st, val) SKM_sk_push(EVP_PKEY_ASN1_METHOD, (st), (val))\n# define sk_EVP_PKEY_ASN1_METHOD_unshift(st, val) SKM_sk_unshift(EVP_PKEY_ASN1_METHOD, (st), (val))\n# define sk_EVP_PKEY_ASN1_METHOD_find(st, val) SKM_sk_find(EVP_PKEY_ASN1_METHOD, (st), (val))\n# define sk_EVP_PKEY_ASN1_METHOD_find_ex(st, val) SKM_sk_find_ex(EVP_PKEY_ASN1_METHOD, (st), (val))\n# define sk_EVP_PKEY_ASN1_METHOD_delete(st, i) SKM_sk_delete(EVP_PKEY_ASN1_METHOD, (st), (i))\n# define sk_EVP_PKEY_ASN1_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PKEY_ASN1_METHOD, (st), (ptr))\n# define sk_EVP_PKEY_ASN1_METHOD_insert(st, val, i) SKM_sk_insert(EVP_PKEY_ASN1_METHOD, (st), (val), (i))\n# define sk_EVP_PKEY_ASN1_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PKEY_ASN1_METHOD, (st), (cmp))\n# define sk_EVP_PKEY_ASN1_METHOD_dup(st) SKM_sk_dup(EVP_PKEY_ASN1_METHOD, st)\n# define sk_EVP_PKEY_ASN1_METHOD_pop_free(st, free_func) SKM_sk_pop_free(EVP_PKEY_ASN1_METHOD, (st), (free_func))\n# define sk_EVP_PKEY_ASN1_METHOD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_PKEY_ASN1_METHOD, (st), (copy_func), (free_func))\n# define sk_EVP_PKEY_ASN1_METHOD_shift(st) SKM_sk_shift(EVP_PKEY_ASN1_METHOD, (st))\n# define sk_EVP_PKEY_ASN1_METHOD_pop(st) SKM_sk_pop(EVP_PKEY_ASN1_METHOD, (st))\n# define sk_EVP_PKEY_ASN1_METHOD_sort(st) SKM_sk_sort(EVP_PKEY_ASN1_METHOD, (st))\n# define sk_EVP_PKEY_ASN1_METHOD_is_sorted(st) SKM_sk_is_sorted(EVP_PKEY_ASN1_METHOD, (st))\n# define sk_EVP_PKEY_METHOD_new(cmp) SKM_sk_new(EVP_PKEY_METHOD, (cmp))\n# define sk_EVP_PKEY_METHOD_new_null() SKM_sk_new_null(EVP_PKEY_METHOD)\n# define sk_EVP_PKEY_METHOD_free(st) SKM_sk_free(EVP_PKEY_METHOD, (st))\n# define sk_EVP_PKEY_METHOD_num(st) SKM_sk_num(EVP_PKEY_METHOD, (st))\n# define sk_EVP_PKEY_METHOD_value(st, i) SKM_sk_value(EVP_PKEY_METHOD, (st), (i))\n# define sk_EVP_PKEY_METHOD_set(st, i, val) SKM_sk_set(EVP_PKEY_METHOD, (st), (i), (val))\n# define sk_EVP_PKEY_METHOD_zero(st) SKM_sk_zero(EVP_PKEY_METHOD, (st))\n# define sk_EVP_PKEY_METHOD_push(st, val) SKM_sk_push(EVP_PKEY_METHOD, (st), (val))\n# define sk_EVP_PKEY_METHOD_unshift(st, val) SKM_sk_unshift(EVP_PKEY_METHOD, (st), (val))\n# define sk_EVP_PKEY_METHOD_find(st, val) SKM_sk_find(EVP_PKEY_METHOD, (st), (val))\n# define sk_EVP_PKEY_METHOD_find_ex(st, val) SKM_sk_find_ex(EVP_PKEY_METHOD, (st), (val))\n# define sk_EVP_PKEY_METHOD_delete(st, i) SKM_sk_delete(EVP_PKEY_METHOD, (st), (i))\n# define sk_EVP_PKEY_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(EVP_PKEY_METHOD, (st), (ptr))\n# define sk_EVP_PKEY_METHOD_insert(st, val, i) SKM_sk_insert(EVP_PKEY_METHOD, (st), (val), (i))\n# define sk_EVP_PKEY_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(EVP_PKEY_METHOD, (st), (cmp))\n# define sk_EVP_PKEY_METHOD_dup(st) SKM_sk_dup(EVP_PKEY_METHOD, st)\n# define sk_EVP_PKEY_METHOD_pop_free(st, free_func) SKM_sk_pop_free(EVP_PKEY_METHOD, (st), (free_func))\n# define sk_EVP_PKEY_METHOD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(EVP_PKEY_METHOD, (st), (copy_func), (free_func))\n# define sk_EVP_PKEY_METHOD_shift(st) SKM_sk_shift(EVP_PKEY_METHOD, (st))\n# define sk_EVP_PKEY_METHOD_pop(st) SKM_sk_pop(EVP_PKEY_METHOD, (st))\n# define sk_EVP_PKEY_METHOD_sort(st) SKM_sk_sort(EVP_PKEY_METHOD, (st))\n# define sk_EVP_PKEY_METHOD_is_sorted(st) SKM_sk_is_sorted(EVP_PKEY_METHOD, (st))\n# define sk_GENERAL_NAME_new(cmp) SKM_sk_new(GENERAL_NAME, (cmp))\n# define sk_GENERAL_NAME_new_null() SKM_sk_new_null(GENERAL_NAME)\n# define sk_GENERAL_NAME_free(st) SKM_sk_free(GENERAL_NAME, (st))\n# define sk_GENERAL_NAME_num(st) SKM_sk_num(GENERAL_NAME, (st))\n# define sk_GENERAL_NAME_value(st, i) SKM_sk_value(GENERAL_NAME, (st), (i))\n# define sk_GENERAL_NAME_set(st, i, val) SKM_sk_set(GENERAL_NAME, (st), (i), (val))\n# define sk_GENERAL_NAME_zero(st) SKM_sk_zero(GENERAL_NAME, (st))\n# define sk_GENERAL_NAME_push(st, val) SKM_sk_push(GENERAL_NAME, (st), (val))\n# define sk_GENERAL_NAME_unshift(st, val) SKM_sk_unshift(GENERAL_NAME, (st), (val))\n# define sk_GENERAL_NAME_find(st, val) SKM_sk_find(GENERAL_NAME, (st), (val))\n# define sk_GENERAL_NAME_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAME, (st), (val))\n# define sk_GENERAL_NAME_delete(st, i) SKM_sk_delete(GENERAL_NAME, (st), (i))\n# define sk_GENERAL_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAME, (st), (ptr))\n# define sk_GENERAL_NAME_insert(st, val, i) SKM_sk_insert(GENERAL_NAME, (st), (val), (i))\n# define sk_GENERAL_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAME, (st), (cmp))\n# define sk_GENERAL_NAME_dup(st) SKM_sk_dup(GENERAL_NAME, st)\n# define sk_GENERAL_NAME_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAME, (st), (free_func))\n# define sk_GENERAL_NAME_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(GENERAL_NAME, (st), (copy_func), (free_func))\n# define sk_GENERAL_NAME_shift(st) SKM_sk_shift(GENERAL_NAME, (st))\n# define sk_GENERAL_NAME_pop(st) SKM_sk_pop(GENERAL_NAME, (st))\n# define sk_GENERAL_NAME_sort(st) SKM_sk_sort(GENERAL_NAME, (st))\n# define sk_GENERAL_NAME_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAME, (st))\n# define sk_GENERAL_NAMES_new(cmp) SKM_sk_new(GENERAL_NAMES, (cmp))\n# define sk_GENERAL_NAMES_new_null() SKM_sk_new_null(GENERAL_NAMES)\n# define sk_GENERAL_NAMES_free(st) SKM_sk_free(GENERAL_NAMES, (st))\n# define sk_GENERAL_NAMES_num(st) SKM_sk_num(GENERAL_NAMES, (st))\n# define sk_GENERAL_NAMES_value(st, i) SKM_sk_value(GENERAL_NAMES, (st), (i))\n# define sk_GENERAL_NAMES_set(st, i, val) SKM_sk_set(GENERAL_NAMES, (st), (i), (val))\n# define sk_GENERAL_NAMES_zero(st) SKM_sk_zero(GENERAL_NAMES, (st))\n# define sk_GENERAL_NAMES_push(st, val) SKM_sk_push(GENERAL_NAMES, (st), (val))\n# define sk_GENERAL_NAMES_unshift(st, val) SKM_sk_unshift(GENERAL_NAMES, (st), (val))\n# define sk_GENERAL_NAMES_find(st, val) SKM_sk_find(GENERAL_NAMES, (st), (val))\n# define sk_GENERAL_NAMES_find_ex(st, val) SKM_sk_find_ex(GENERAL_NAMES, (st), (val))\n# define sk_GENERAL_NAMES_delete(st, i) SKM_sk_delete(GENERAL_NAMES, (st), (i))\n# define sk_GENERAL_NAMES_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_NAMES, (st), (ptr))\n# define sk_GENERAL_NAMES_insert(st, val, i) SKM_sk_insert(GENERAL_NAMES, (st), (val), (i))\n# define sk_GENERAL_NAMES_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_NAMES, (st), (cmp))\n# define sk_GENERAL_NAMES_dup(st) SKM_sk_dup(GENERAL_NAMES, st)\n# define sk_GENERAL_NAMES_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_NAMES, (st), (free_func))\n# define sk_GENERAL_NAMES_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(GENERAL_NAMES, (st), (copy_func), (free_func))\n# define sk_GENERAL_NAMES_shift(st) SKM_sk_shift(GENERAL_NAMES, (st))\n# define sk_GENERAL_NAMES_pop(st) SKM_sk_pop(GENERAL_NAMES, (st))\n# define sk_GENERAL_NAMES_sort(st) SKM_sk_sort(GENERAL_NAMES, (st))\n# define sk_GENERAL_NAMES_is_sorted(st) SKM_sk_is_sorted(GENERAL_NAMES, (st))\n# define sk_GENERAL_SUBTREE_new(cmp) SKM_sk_new(GENERAL_SUBTREE, (cmp))\n# define sk_GENERAL_SUBTREE_new_null() SKM_sk_new_null(GENERAL_SUBTREE)\n# define sk_GENERAL_SUBTREE_free(st) SKM_sk_free(GENERAL_SUBTREE, (st))\n# define sk_GENERAL_SUBTREE_num(st) SKM_sk_num(GENERAL_SUBTREE, (st))\n# define sk_GENERAL_SUBTREE_value(st, i) SKM_sk_value(GENERAL_SUBTREE, (st), (i))\n# define sk_GENERAL_SUBTREE_set(st, i, val) SKM_sk_set(GENERAL_SUBTREE, (st), (i), (val))\n# define sk_GENERAL_SUBTREE_zero(st) SKM_sk_zero(GENERAL_SUBTREE, (st))\n# define sk_GENERAL_SUBTREE_push(st, val) SKM_sk_push(GENERAL_SUBTREE, (st), (val))\n# define sk_GENERAL_SUBTREE_unshift(st, val) SKM_sk_unshift(GENERAL_SUBTREE, (st), (val))\n# define sk_GENERAL_SUBTREE_find(st, val) SKM_sk_find(GENERAL_SUBTREE, (st), (val))\n# define sk_GENERAL_SUBTREE_find_ex(st, val) SKM_sk_find_ex(GENERAL_SUBTREE, (st), (val))\n# define sk_GENERAL_SUBTREE_delete(st, i) SKM_sk_delete(GENERAL_SUBTREE, (st), (i))\n# define sk_GENERAL_SUBTREE_delete_ptr(st, ptr) SKM_sk_delete_ptr(GENERAL_SUBTREE, (st), (ptr))\n# define sk_GENERAL_SUBTREE_insert(st, val, i) SKM_sk_insert(GENERAL_SUBTREE, (st), (val), (i))\n# define sk_GENERAL_SUBTREE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(GENERAL_SUBTREE, (st), (cmp))\n# define sk_GENERAL_SUBTREE_dup(st) SKM_sk_dup(GENERAL_SUBTREE, st)\n# define sk_GENERAL_SUBTREE_pop_free(st, free_func) SKM_sk_pop_free(GENERAL_SUBTREE, (st), (free_func))\n# define sk_GENERAL_SUBTREE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(GENERAL_SUBTREE, (st), (copy_func), (free_func))\n# define sk_GENERAL_SUBTREE_shift(st) SKM_sk_shift(GENERAL_SUBTREE, (st))\n# define sk_GENERAL_SUBTREE_pop(st) SKM_sk_pop(GENERAL_SUBTREE, (st))\n# define sk_GENERAL_SUBTREE_sort(st) SKM_sk_sort(GENERAL_SUBTREE, (st))\n# define sk_GENERAL_SUBTREE_is_sorted(st) SKM_sk_is_sorted(GENERAL_SUBTREE, (st))\n# define sk_IPAddressFamily_new(cmp) SKM_sk_new(IPAddressFamily, (cmp))\n# define sk_IPAddressFamily_new_null() SKM_sk_new_null(IPAddressFamily)\n# define sk_IPAddressFamily_free(st) SKM_sk_free(IPAddressFamily, (st))\n# define sk_IPAddressFamily_num(st) SKM_sk_num(IPAddressFamily, (st))\n# define sk_IPAddressFamily_value(st, i) SKM_sk_value(IPAddressFamily, (st), (i))\n# define sk_IPAddressFamily_set(st, i, val) SKM_sk_set(IPAddressFamily, (st), (i), (val))\n# define sk_IPAddressFamily_zero(st) SKM_sk_zero(IPAddressFamily, (st))\n# define sk_IPAddressFamily_push(st, val) SKM_sk_push(IPAddressFamily, (st), (val))\n# define sk_IPAddressFamily_unshift(st, val) SKM_sk_unshift(IPAddressFamily, (st), (val))\n# define sk_IPAddressFamily_find(st, val) SKM_sk_find(IPAddressFamily, (st), (val))\n# define sk_IPAddressFamily_find_ex(st, val) SKM_sk_find_ex(IPAddressFamily, (st), (val))\n# define sk_IPAddressFamily_delete(st, i) SKM_sk_delete(IPAddressFamily, (st), (i))\n# define sk_IPAddressFamily_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressFamily, (st), (ptr))\n# define sk_IPAddressFamily_insert(st, val, i) SKM_sk_insert(IPAddressFamily, (st), (val), (i))\n# define sk_IPAddressFamily_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressFamily, (st), (cmp))\n# define sk_IPAddressFamily_dup(st) SKM_sk_dup(IPAddressFamily, st)\n# define sk_IPAddressFamily_pop_free(st, free_func) SKM_sk_pop_free(IPAddressFamily, (st), (free_func))\n# define sk_IPAddressFamily_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(IPAddressFamily, (st), (copy_func), (free_func))\n# define sk_IPAddressFamily_shift(st) SKM_sk_shift(IPAddressFamily, (st))\n# define sk_IPAddressFamily_pop(st) SKM_sk_pop(IPAddressFamily, (st))\n# define sk_IPAddressFamily_sort(st) SKM_sk_sort(IPAddressFamily, (st))\n# define sk_IPAddressFamily_is_sorted(st) SKM_sk_is_sorted(IPAddressFamily, (st))\n# define sk_IPAddressOrRange_new(cmp) SKM_sk_new(IPAddressOrRange, (cmp))\n# define sk_IPAddressOrRange_new_null() SKM_sk_new_null(IPAddressOrRange)\n# define sk_IPAddressOrRange_free(st) SKM_sk_free(IPAddressOrRange, (st))\n# define sk_IPAddressOrRange_num(st) SKM_sk_num(IPAddressOrRange, (st))\n# define sk_IPAddressOrRange_value(st, i) SKM_sk_value(IPAddressOrRange, (st), (i))\n# define sk_IPAddressOrRange_set(st, i, val) SKM_sk_set(IPAddressOrRange, (st), (i), (val))\n# define sk_IPAddressOrRange_zero(st) SKM_sk_zero(IPAddressOrRange, (st))\n# define sk_IPAddressOrRange_push(st, val) SKM_sk_push(IPAddressOrRange, (st), (val))\n# define sk_IPAddressOrRange_unshift(st, val) SKM_sk_unshift(IPAddressOrRange, (st), (val))\n# define sk_IPAddressOrRange_find(st, val) SKM_sk_find(IPAddressOrRange, (st), (val))\n# define sk_IPAddressOrRange_find_ex(st, val) SKM_sk_find_ex(IPAddressOrRange, (st), (val))\n# define sk_IPAddressOrRange_delete(st, i) SKM_sk_delete(IPAddressOrRange, (st), (i))\n# define sk_IPAddressOrRange_delete_ptr(st, ptr) SKM_sk_delete_ptr(IPAddressOrRange, (st), (ptr))\n# define sk_IPAddressOrRange_insert(st, val, i) SKM_sk_insert(IPAddressOrRange, (st), (val), (i))\n# define sk_IPAddressOrRange_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(IPAddressOrRange, (st), (cmp))\n# define sk_IPAddressOrRange_dup(st) SKM_sk_dup(IPAddressOrRange, st)\n# define sk_IPAddressOrRange_pop_free(st, free_func) SKM_sk_pop_free(IPAddressOrRange, (st), (free_func))\n# define sk_IPAddressOrRange_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(IPAddressOrRange, (st), (copy_func), (free_func))\n# define sk_IPAddressOrRange_shift(st) SKM_sk_shift(IPAddressOrRange, (st))\n# define sk_IPAddressOrRange_pop(st) SKM_sk_pop(IPAddressOrRange, (st))\n# define sk_IPAddressOrRange_sort(st) SKM_sk_sort(IPAddressOrRange, (st))\n# define sk_IPAddressOrRange_is_sorted(st) SKM_sk_is_sorted(IPAddressOrRange, (st))\n# define sk_KRB5_APREQBODY_new(cmp) SKM_sk_new(KRB5_APREQBODY, (cmp))\n# define sk_KRB5_APREQBODY_new_null() SKM_sk_new_null(KRB5_APREQBODY)\n# define sk_KRB5_APREQBODY_free(st) SKM_sk_free(KRB5_APREQBODY, (st))\n# define sk_KRB5_APREQBODY_num(st) SKM_sk_num(KRB5_APREQBODY, (st))\n# define sk_KRB5_APREQBODY_value(st, i) SKM_sk_value(KRB5_APREQBODY, (st), (i))\n# define sk_KRB5_APREQBODY_set(st, i, val) SKM_sk_set(KRB5_APREQBODY, (st), (i), (val))\n# define sk_KRB5_APREQBODY_zero(st) SKM_sk_zero(KRB5_APREQBODY, (st))\n# define sk_KRB5_APREQBODY_push(st, val) SKM_sk_push(KRB5_APREQBODY, (st), (val))\n# define sk_KRB5_APREQBODY_unshift(st, val) SKM_sk_unshift(KRB5_APREQBODY, (st), (val))\n# define sk_KRB5_APREQBODY_find(st, val) SKM_sk_find(KRB5_APREQBODY, (st), (val))\n# define sk_KRB5_APREQBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_APREQBODY, (st), (val))\n# define sk_KRB5_APREQBODY_delete(st, i) SKM_sk_delete(KRB5_APREQBODY, (st), (i))\n# define sk_KRB5_APREQBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_APREQBODY, (st), (ptr))\n# define sk_KRB5_APREQBODY_insert(st, val, i) SKM_sk_insert(KRB5_APREQBODY, (st), (val), (i))\n# define sk_KRB5_APREQBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_APREQBODY, (st), (cmp))\n# define sk_KRB5_APREQBODY_dup(st) SKM_sk_dup(KRB5_APREQBODY, st)\n# define sk_KRB5_APREQBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_APREQBODY, (st), (free_func))\n# define sk_KRB5_APREQBODY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_APREQBODY, (st), (copy_func), (free_func))\n# define sk_KRB5_APREQBODY_shift(st) SKM_sk_shift(KRB5_APREQBODY, (st))\n# define sk_KRB5_APREQBODY_pop(st) SKM_sk_pop(KRB5_APREQBODY, (st))\n# define sk_KRB5_APREQBODY_sort(st) SKM_sk_sort(KRB5_APREQBODY, (st))\n# define sk_KRB5_APREQBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_APREQBODY, (st))\n# define sk_KRB5_AUTHDATA_new(cmp) SKM_sk_new(KRB5_AUTHDATA, (cmp))\n# define sk_KRB5_AUTHDATA_new_null() SKM_sk_new_null(KRB5_AUTHDATA)\n# define sk_KRB5_AUTHDATA_free(st) SKM_sk_free(KRB5_AUTHDATA, (st))\n# define sk_KRB5_AUTHDATA_num(st) SKM_sk_num(KRB5_AUTHDATA, (st))\n# define sk_KRB5_AUTHDATA_value(st, i) SKM_sk_value(KRB5_AUTHDATA, (st), (i))\n# define sk_KRB5_AUTHDATA_set(st, i, val) SKM_sk_set(KRB5_AUTHDATA, (st), (i), (val))\n# define sk_KRB5_AUTHDATA_zero(st) SKM_sk_zero(KRB5_AUTHDATA, (st))\n# define sk_KRB5_AUTHDATA_push(st, val) SKM_sk_push(KRB5_AUTHDATA, (st), (val))\n# define sk_KRB5_AUTHDATA_unshift(st, val) SKM_sk_unshift(KRB5_AUTHDATA, (st), (val))\n# define sk_KRB5_AUTHDATA_find(st, val) SKM_sk_find(KRB5_AUTHDATA, (st), (val))\n# define sk_KRB5_AUTHDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHDATA, (st), (val))\n# define sk_KRB5_AUTHDATA_delete(st, i) SKM_sk_delete(KRB5_AUTHDATA, (st), (i))\n# define sk_KRB5_AUTHDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHDATA, (st), (ptr))\n# define sk_KRB5_AUTHDATA_insert(st, val, i) SKM_sk_insert(KRB5_AUTHDATA, (st), (val), (i))\n# define sk_KRB5_AUTHDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHDATA, (st), (cmp))\n# define sk_KRB5_AUTHDATA_dup(st) SKM_sk_dup(KRB5_AUTHDATA, st)\n# define sk_KRB5_AUTHDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHDATA, (st), (free_func))\n# define sk_KRB5_AUTHDATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_AUTHDATA, (st), (copy_func), (free_func))\n# define sk_KRB5_AUTHDATA_shift(st) SKM_sk_shift(KRB5_AUTHDATA, (st))\n# define sk_KRB5_AUTHDATA_pop(st) SKM_sk_pop(KRB5_AUTHDATA, (st))\n# define sk_KRB5_AUTHDATA_sort(st) SKM_sk_sort(KRB5_AUTHDATA, (st))\n# define sk_KRB5_AUTHDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHDATA, (st))\n# define sk_KRB5_AUTHENTBODY_new(cmp) SKM_sk_new(KRB5_AUTHENTBODY, (cmp))\n# define sk_KRB5_AUTHENTBODY_new_null() SKM_sk_new_null(KRB5_AUTHENTBODY)\n# define sk_KRB5_AUTHENTBODY_free(st) SKM_sk_free(KRB5_AUTHENTBODY, (st))\n# define sk_KRB5_AUTHENTBODY_num(st) SKM_sk_num(KRB5_AUTHENTBODY, (st))\n# define sk_KRB5_AUTHENTBODY_value(st, i) SKM_sk_value(KRB5_AUTHENTBODY, (st), (i))\n# define sk_KRB5_AUTHENTBODY_set(st, i, val) SKM_sk_set(KRB5_AUTHENTBODY, (st), (i), (val))\n# define sk_KRB5_AUTHENTBODY_zero(st) SKM_sk_zero(KRB5_AUTHENTBODY, (st))\n# define sk_KRB5_AUTHENTBODY_push(st, val) SKM_sk_push(KRB5_AUTHENTBODY, (st), (val))\n# define sk_KRB5_AUTHENTBODY_unshift(st, val) SKM_sk_unshift(KRB5_AUTHENTBODY, (st), (val))\n# define sk_KRB5_AUTHENTBODY_find(st, val) SKM_sk_find(KRB5_AUTHENTBODY, (st), (val))\n# define sk_KRB5_AUTHENTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_AUTHENTBODY, (st), (val))\n# define sk_KRB5_AUTHENTBODY_delete(st, i) SKM_sk_delete(KRB5_AUTHENTBODY, (st), (i))\n# define sk_KRB5_AUTHENTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_AUTHENTBODY, (st), (ptr))\n# define sk_KRB5_AUTHENTBODY_insert(st, val, i) SKM_sk_insert(KRB5_AUTHENTBODY, (st), (val), (i))\n# define sk_KRB5_AUTHENTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_AUTHENTBODY, (st), (cmp))\n# define sk_KRB5_AUTHENTBODY_dup(st) SKM_sk_dup(KRB5_AUTHENTBODY, st)\n# define sk_KRB5_AUTHENTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_AUTHENTBODY, (st), (free_func))\n# define sk_KRB5_AUTHENTBODY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_AUTHENTBODY, (st), (copy_func), (free_func))\n# define sk_KRB5_AUTHENTBODY_shift(st) SKM_sk_shift(KRB5_AUTHENTBODY, (st))\n# define sk_KRB5_AUTHENTBODY_pop(st) SKM_sk_pop(KRB5_AUTHENTBODY, (st))\n# define sk_KRB5_AUTHENTBODY_sort(st) SKM_sk_sort(KRB5_AUTHENTBODY, (st))\n# define sk_KRB5_AUTHENTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_AUTHENTBODY, (st))\n# define sk_KRB5_CHECKSUM_new(cmp) SKM_sk_new(KRB5_CHECKSUM, (cmp))\n# define sk_KRB5_CHECKSUM_new_null() SKM_sk_new_null(KRB5_CHECKSUM)\n# define sk_KRB5_CHECKSUM_free(st) SKM_sk_free(KRB5_CHECKSUM, (st))\n# define sk_KRB5_CHECKSUM_num(st) SKM_sk_num(KRB5_CHECKSUM, (st))\n# define sk_KRB5_CHECKSUM_value(st, i) SKM_sk_value(KRB5_CHECKSUM, (st), (i))\n# define sk_KRB5_CHECKSUM_set(st, i, val) SKM_sk_set(KRB5_CHECKSUM, (st), (i), (val))\n# define sk_KRB5_CHECKSUM_zero(st) SKM_sk_zero(KRB5_CHECKSUM, (st))\n# define sk_KRB5_CHECKSUM_push(st, val) SKM_sk_push(KRB5_CHECKSUM, (st), (val))\n# define sk_KRB5_CHECKSUM_unshift(st, val) SKM_sk_unshift(KRB5_CHECKSUM, (st), (val))\n# define sk_KRB5_CHECKSUM_find(st, val) SKM_sk_find(KRB5_CHECKSUM, (st), (val))\n# define sk_KRB5_CHECKSUM_find_ex(st, val) SKM_sk_find_ex(KRB5_CHECKSUM, (st), (val))\n# define sk_KRB5_CHECKSUM_delete(st, i) SKM_sk_delete(KRB5_CHECKSUM, (st), (i))\n# define sk_KRB5_CHECKSUM_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_CHECKSUM, (st), (ptr))\n# define sk_KRB5_CHECKSUM_insert(st, val, i) SKM_sk_insert(KRB5_CHECKSUM, (st), (val), (i))\n# define sk_KRB5_CHECKSUM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_CHECKSUM, (st), (cmp))\n# define sk_KRB5_CHECKSUM_dup(st) SKM_sk_dup(KRB5_CHECKSUM, st)\n# define sk_KRB5_CHECKSUM_pop_free(st, free_func) SKM_sk_pop_free(KRB5_CHECKSUM, (st), (free_func))\n# define sk_KRB5_CHECKSUM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_CHECKSUM, (st), (copy_func), (free_func))\n# define sk_KRB5_CHECKSUM_shift(st) SKM_sk_shift(KRB5_CHECKSUM, (st))\n# define sk_KRB5_CHECKSUM_pop(st) SKM_sk_pop(KRB5_CHECKSUM, (st))\n# define sk_KRB5_CHECKSUM_sort(st) SKM_sk_sort(KRB5_CHECKSUM, (st))\n# define sk_KRB5_CHECKSUM_is_sorted(st) SKM_sk_is_sorted(KRB5_CHECKSUM, (st))\n# define sk_KRB5_ENCDATA_new(cmp) SKM_sk_new(KRB5_ENCDATA, (cmp))\n# define sk_KRB5_ENCDATA_new_null() SKM_sk_new_null(KRB5_ENCDATA)\n# define sk_KRB5_ENCDATA_free(st) SKM_sk_free(KRB5_ENCDATA, (st))\n# define sk_KRB5_ENCDATA_num(st) SKM_sk_num(KRB5_ENCDATA, (st))\n# define sk_KRB5_ENCDATA_value(st, i) SKM_sk_value(KRB5_ENCDATA, (st), (i))\n# define sk_KRB5_ENCDATA_set(st, i, val) SKM_sk_set(KRB5_ENCDATA, (st), (i), (val))\n# define sk_KRB5_ENCDATA_zero(st) SKM_sk_zero(KRB5_ENCDATA, (st))\n# define sk_KRB5_ENCDATA_push(st, val) SKM_sk_push(KRB5_ENCDATA, (st), (val))\n# define sk_KRB5_ENCDATA_unshift(st, val) SKM_sk_unshift(KRB5_ENCDATA, (st), (val))\n# define sk_KRB5_ENCDATA_find(st, val) SKM_sk_find(KRB5_ENCDATA, (st), (val))\n# define sk_KRB5_ENCDATA_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCDATA, (st), (val))\n# define sk_KRB5_ENCDATA_delete(st, i) SKM_sk_delete(KRB5_ENCDATA, (st), (i))\n# define sk_KRB5_ENCDATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCDATA, (st), (ptr))\n# define sk_KRB5_ENCDATA_insert(st, val, i) SKM_sk_insert(KRB5_ENCDATA, (st), (val), (i))\n# define sk_KRB5_ENCDATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCDATA, (st), (cmp))\n# define sk_KRB5_ENCDATA_dup(st) SKM_sk_dup(KRB5_ENCDATA, st)\n# define sk_KRB5_ENCDATA_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCDATA, (st), (free_func))\n# define sk_KRB5_ENCDATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_ENCDATA, (st), (copy_func), (free_func))\n# define sk_KRB5_ENCDATA_shift(st) SKM_sk_shift(KRB5_ENCDATA, (st))\n# define sk_KRB5_ENCDATA_pop(st) SKM_sk_pop(KRB5_ENCDATA, (st))\n# define sk_KRB5_ENCDATA_sort(st) SKM_sk_sort(KRB5_ENCDATA, (st))\n# define sk_KRB5_ENCDATA_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCDATA, (st))\n# define sk_KRB5_ENCKEY_new(cmp) SKM_sk_new(KRB5_ENCKEY, (cmp))\n# define sk_KRB5_ENCKEY_new_null() SKM_sk_new_null(KRB5_ENCKEY)\n# define sk_KRB5_ENCKEY_free(st) SKM_sk_free(KRB5_ENCKEY, (st))\n# define sk_KRB5_ENCKEY_num(st) SKM_sk_num(KRB5_ENCKEY, (st))\n# define sk_KRB5_ENCKEY_value(st, i) SKM_sk_value(KRB5_ENCKEY, (st), (i))\n# define sk_KRB5_ENCKEY_set(st, i, val) SKM_sk_set(KRB5_ENCKEY, (st), (i), (val))\n# define sk_KRB5_ENCKEY_zero(st) SKM_sk_zero(KRB5_ENCKEY, (st))\n# define sk_KRB5_ENCKEY_push(st, val) SKM_sk_push(KRB5_ENCKEY, (st), (val))\n# define sk_KRB5_ENCKEY_unshift(st, val) SKM_sk_unshift(KRB5_ENCKEY, (st), (val))\n# define sk_KRB5_ENCKEY_find(st, val) SKM_sk_find(KRB5_ENCKEY, (st), (val))\n# define sk_KRB5_ENCKEY_find_ex(st, val) SKM_sk_find_ex(KRB5_ENCKEY, (st), (val))\n# define sk_KRB5_ENCKEY_delete(st, i) SKM_sk_delete(KRB5_ENCKEY, (st), (i))\n# define sk_KRB5_ENCKEY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_ENCKEY, (st), (ptr))\n# define sk_KRB5_ENCKEY_insert(st, val, i) SKM_sk_insert(KRB5_ENCKEY, (st), (val), (i))\n# define sk_KRB5_ENCKEY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_ENCKEY, (st), (cmp))\n# define sk_KRB5_ENCKEY_dup(st) SKM_sk_dup(KRB5_ENCKEY, st)\n# define sk_KRB5_ENCKEY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_ENCKEY, (st), (free_func))\n# define sk_KRB5_ENCKEY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_ENCKEY, (st), (copy_func), (free_func))\n# define sk_KRB5_ENCKEY_shift(st) SKM_sk_shift(KRB5_ENCKEY, (st))\n# define sk_KRB5_ENCKEY_pop(st) SKM_sk_pop(KRB5_ENCKEY, (st))\n# define sk_KRB5_ENCKEY_sort(st) SKM_sk_sort(KRB5_ENCKEY, (st))\n# define sk_KRB5_ENCKEY_is_sorted(st) SKM_sk_is_sorted(KRB5_ENCKEY, (st))\n# define sk_KRB5_PRINCNAME_new(cmp) SKM_sk_new(KRB5_PRINCNAME, (cmp))\n# define sk_KRB5_PRINCNAME_new_null() SKM_sk_new_null(KRB5_PRINCNAME)\n# define sk_KRB5_PRINCNAME_free(st) SKM_sk_free(KRB5_PRINCNAME, (st))\n# define sk_KRB5_PRINCNAME_num(st) SKM_sk_num(KRB5_PRINCNAME, (st))\n# define sk_KRB5_PRINCNAME_value(st, i) SKM_sk_value(KRB5_PRINCNAME, (st), (i))\n# define sk_KRB5_PRINCNAME_set(st, i, val) SKM_sk_set(KRB5_PRINCNAME, (st), (i), (val))\n# define sk_KRB5_PRINCNAME_zero(st) SKM_sk_zero(KRB5_PRINCNAME, (st))\n# define sk_KRB5_PRINCNAME_push(st, val) SKM_sk_push(KRB5_PRINCNAME, (st), (val))\n# define sk_KRB5_PRINCNAME_unshift(st, val) SKM_sk_unshift(KRB5_PRINCNAME, (st), (val))\n# define sk_KRB5_PRINCNAME_find(st, val) SKM_sk_find(KRB5_PRINCNAME, (st), (val))\n# define sk_KRB5_PRINCNAME_find_ex(st, val) SKM_sk_find_ex(KRB5_PRINCNAME, (st), (val))\n# define sk_KRB5_PRINCNAME_delete(st, i) SKM_sk_delete(KRB5_PRINCNAME, (st), (i))\n# define sk_KRB5_PRINCNAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_PRINCNAME, (st), (ptr))\n# define sk_KRB5_PRINCNAME_insert(st, val, i) SKM_sk_insert(KRB5_PRINCNAME, (st), (val), (i))\n# define sk_KRB5_PRINCNAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_PRINCNAME, (st), (cmp))\n# define sk_KRB5_PRINCNAME_dup(st) SKM_sk_dup(KRB5_PRINCNAME, st)\n# define sk_KRB5_PRINCNAME_pop_free(st, free_func) SKM_sk_pop_free(KRB5_PRINCNAME, (st), (free_func))\n# define sk_KRB5_PRINCNAME_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_PRINCNAME, (st), (copy_func), (free_func))\n# define sk_KRB5_PRINCNAME_shift(st) SKM_sk_shift(KRB5_PRINCNAME, (st))\n# define sk_KRB5_PRINCNAME_pop(st) SKM_sk_pop(KRB5_PRINCNAME, (st))\n# define sk_KRB5_PRINCNAME_sort(st) SKM_sk_sort(KRB5_PRINCNAME, (st))\n# define sk_KRB5_PRINCNAME_is_sorted(st) SKM_sk_is_sorted(KRB5_PRINCNAME, (st))\n# define sk_KRB5_TKTBODY_new(cmp) SKM_sk_new(KRB5_TKTBODY, (cmp))\n# define sk_KRB5_TKTBODY_new_null() SKM_sk_new_null(KRB5_TKTBODY)\n# define sk_KRB5_TKTBODY_free(st) SKM_sk_free(KRB5_TKTBODY, (st))\n# define sk_KRB5_TKTBODY_num(st) SKM_sk_num(KRB5_TKTBODY, (st))\n# define sk_KRB5_TKTBODY_value(st, i) SKM_sk_value(KRB5_TKTBODY, (st), (i))\n# define sk_KRB5_TKTBODY_set(st, i, val) SKM_sk_set(KRB5_TKTBODY, (st), (i), (val))\n# define sk_KRB5_TKTBODY_zero(st) SKM_sk_zero(KRB5_TKTBODY, (st))\n# define sk_KRB5_TKTBODY_push(st, val) SKM_sk_push(KRB5_TKTBODY, (st), (val))\n# define sk_KRB5_TKTBODY_unshift(st, val) SKM_sk_unshift(KRB5_TKTBODY, (st), (val))\n# define sk_KRB5_TKTBODY_find(st, val) SKM_sk_find(KRB5_TKTBODY, (st), (val))\n# define sk_KRB5_TKTBODY_find_ex(st, val) SKM_sk_find_ex(KRB5_TKTBODY, (st), (val))\n# define sk_KRB5_TKTBODY_delete(st, i) SKM_sk_delete(KRB5_TKTBODY, (st), (i))\n# define sk_KRB5_TKTBODY_delete_ptr(st, ptr) SKM_sk_delete_ptr(KRB5_TKTBODY, (st), (ptr))\n# define sk_KRB5_TKTBODY_insert(st, val, i) SKM_sk_insert(KRB5_TKTBODY, (st), (val), (i))\n# define sk_KRB5_TKTBODY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(KRB5_TKTBODY, (st), (cmp))\n# define sk_KRB5_TKTBODY_dup(st) SKM_sk_dup(KRB5_TKTBODY, st)\n# define sk_KRB5_TKTBODY_pop_free(st, free_func) SKM_sk_pop_free(KRB5_TKTBODY, (st), (free_func))\n# define sk_KRB5_TKTBODY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(KRB5_TKTBODY, (st), (copy_func), (free_func))\n# define sk_KRB5_TKTBODY_shift(st) SKM_sk_shift(KRB5_TKTBODY, (st))\n# define sk_KRB5_TKTBODY_pop(st) SKM_sk_pop(KRB5_TKTBODY, (st))\n# define sk_KRB5_TKTBODY_sort(st) SKM_sk_sort(KRB5_TKTBODY, (st))\n# define sk_KRB5_TKTBODY_is_sorted(st) SKM_sk_is_sorted(KRB5_TKTBODY, (st))\n# define sk_MEM_OBJECT_DATA_new(cmp) SKM_sk_new(MEM_OBJECT_DATA, (cmp))\n# define sk_MEM_OBJECT_DATA_new_null() SKM_sk_new_null(MEM_OBJECT_DATA)\n# define sk_MEM_OBJECT_DATA_free(st) SKM_sk_free(MEM_OBJECT_DATA, (st))\n# define sk_MEM_OBJECT_DATA_num(st) SKM_sk_num(MEM_OBJECT_DATA, (st))\n# define sk_MEM_OBJECT_DATA_value(st, i) SKM_sk_value(MEM_OBJECT_DATA, (st), (i))\n# define sk_MEM_OBJECT_DATA_set(st, i, val) SKM_sk_set(MEM_OBJECT_DATA, (st), (i), (val))\n# define sk_MEM_OBJECT_DATA_zero(st) SKM_sk_zero(MEM_OBJECT_DATA, (st))\n# define sk_MEM_OBJECT_DATA_push(st, val) SKM_sk_push(MEM_OBJECT_DATA, (st), (val))\n# define sk_MEM_OBJECT_DATA_unshift(st, val) SKM_sk_unshift(MEM_OBJECT_DATA, (st), (val))\n# define sk_MEM_OBJECT_DATA_find(st, val) SKM_sk_find(MEM_OBJECT_DATA, (st), (val))\n# define sk_MEM_OBJECT_DATA_find_ex(st, val) SKM_sk_find_ex(MEM_OBJECT_DATA, (st), (val))\n# define sk_MEM_OBJECT_DATA_delete(st, i) SKM_sk_delete(MEM_OBJECT_DATA, (st), (i))\n# define sk_MEM_OBJECT_DATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(MEM_OBJECT_DATA, (st), (ptr))\n# define sk_MEM_OBJECT_DATA_insert(st, val, i) SKM_sk_insert(MEM_OBJECT_DATA, (st), (val), (i))\n# define sk_MEM_OBJECT_DATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MEM_OBJECT_DATA, (st), (cmp))\n# define sk_MEM_OBJECT_DATA_dup(st) SKM_sk_dup(MEM_OBJECT_DATA, st)\n# define sk_MEM_OBJECT_DATA_pop_free(st, free_func) SKM_sk_pop_free(MEM_OBJECT_DATA, (st), (free_func))\n# define sk_MEM_OBJECT_DATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(MEM_OBJECT_DATA, (st), (copy_func), (free_func))\n# define sk_MEM_OBJECT_DATA_shift(st) SKM_sk_shift(MEM_OBJECT_DATA, (st))\n# define sk_MEM_OBJECT_DATA_pop(st) SKM_sk_pop(MEM_OBJECT_DATA, (st))\n# define sk_MEM_OBJECT_DATA_sort(st) SKM_sk_sort(MEM_OBJECT_DATA, (st))\n# define sk_MEM_OBJECT_DATA_is_sorted(st) SKM_sk_is_sorted(MEM_OBJECT_DATA, (st))\n# define sk_MIME_HEADER_new(cmp) SKM_sk_new(MIME_HEADER, (cmp))\n# define sk_MIME_HEADER_new_null() SKM_sk_new_null(MIME_HEADER)\n# define sk_MIME_HEADER_free(st) SKM_sk_free(MIME_HEADER, (st))\n# define sk_MIME_HEADER_num(st) SKM_sk_num(MIME_HEADER, (st))\n# define sk_MIME_HEADER_value(st, i) SKM_sk_value(MIME_HEADER, (st), (i))\n# define sk_MIME_HEADER_set(st, i, val) SKM_sk_set(MIME_HEADER, (st), (i), (val))\n# define sk_MIME_HEADER_zero(st) SKM_sk_zero(MIME_HEADER, (st))\n# define sk_MIME_HEADER_push(st, val) SKM_sk_push(MIME_HEADER, (st), (val))\n# define sk_MIME_HEADER_unshift(st, val) SKM_sk_unshift(MIME_HEADER, (st), (val))\n# define sk_MIME_HEADER_find(st, val) SKM_sk_find(MIME_HEADER, (st), (val))\n# define sk_MIME_HEADER_find_ex(st, val) SKM_sk_find_ex(MIME_HEADER, (st), (val))\n# define sk_MIME_HEADER_delete(st, i) SKM_sk_delete(MIME_HEADER, (st), (i))\n# define sk_MIME_HEADER_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_HEADER, (st), (ptr))\n# define sk_MIME_HEADER_insert(st, val, i) SKM_sk_insert(MIME_HEADER, (st), (val), (i))\n# define sk_MIME_HEADER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_HEADER, (st), (cmp))\n# define sk_MIME_HEADER_dup(st) SKM_sk_dup(MIME_HEADER, st)\n# define sk_MIME_HEADER_pop_free(st, free_func) SKM_sk_pop_free(MIME_HEADER, (st), (free_func))\n# define sk_MIME_HEADER_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(MIME_HEADER, (st), (copy_func), (free_func))\n# define sk_MIME_HEADER_shift(st) SKM_sk_shift(MIME_HEADER, (st))\n# define sk_MIME_HEADER_pop(st) SKM_sk_pop(MIME_HEADER, (st))\n# define sk_MIME_HEADER_sort(st) SKM_sk_sort(MIME_HEADER, (st))\n# define sk_MIME_HEADER_is_sorted(st) SKM_sk_is_sorted(MIME_HEADER, (st))\n# define sk_MIME_PARAM_new(cmp) SKM_sk_new(MIME_PARAM, (cmp))\n# define sk_MIME_PARAM_new_null() SKM_sk_new_null(MIME_PARAM)\n# define sk_MIME_PARAM_free(st) SKM_sk_free(MIME_PARAM, (st))\n# define sk_MIME_PARAM_num(st) SKM_sk_num(MIME_PARAM, (st))\n# define sk_MIME_PARAM_value(st, i) SKM_sk_value(MIME_PARAM, (st), (i))\n# define sk_MIME_PARAM_set(st, i, val) SKM_sk_set(MIME_PARAM, (st), (i), (val))\n# define sk_MIME_PARAM_zero(st) SKM_sk_zero(MIME_PARAM, (st))\n# define sk_MIME_PARAM_push(st, val) SKM_sk_push(MIME_PARAM, (st), (val))\n# define sk_MIME_PARAM_unshift(st, val) SKM_sk_unshift(MIME_PARAM, (st), (val))\n# define sk_MIME_PARAM_find(st, val) SKM_sk_find(MIME_PARAM, (st), (val))\n# define sk_MIME_PARAM_find_ex(st, val) SKM_sk_find_ex(MIME_PARAM, (st), (val))\n# define sk_MIME_PARAM_delete(st, i) SKM_sk_delete(MIME_PARAM, (st), (i))\n# define sk_MIME_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(MIME_PARAM, (st), (ptr))\n# define sk_MIME_PARAM_insert(st, val, i) SKM_sk_insert(MIME_PARAM, (st), (val), (i))\n# define sk_MIME_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MIME_PARAM, (st), (cmp))\n# define sk_MIME_PARAM_dup(st) SKM_sk_dup(MIME_PARAM, st)\n# define sk_MIME_PARAM_pop_free(st, free_func) SKM_sk_pop_free(MIME_PARAM, (st), (free_func))\n# define sk_MIME_PARAM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(MIME_PARAM, (st), (copy_func), (free_func))\n# define sk_MIME_PARAM_shift(st) SKM_sk_shift(MIME_PARAM, (st))\n# define sk_MIME_PARAM_pop(st) SKM_sk_pop(MIME_PARAM, (st))\n# define sk_MIME_PARAM_sort(st) SKM_sk_sort(MIME_PARAM, (st))\n# define sk_MIME_PARAM_is_sorted(st) SKM_sk_is_sorted(MIME_PARAM, (st))\n# define sk_NAME_FUNCS_new(cmp) SKM_sk_new(NAME_FUNCS, (cmp))\n# define sk_NAME_FUNCS_new_null() SKM_sk_new_null(NAME_FUNCS)\n# define sk_NAME_FUNCS_free(st) SKM_sk_free(NAME_FUNCS, (st))\n# define sk_NAME_FUNCS_num(st) SKM_sk_num(NAME_FUNCS, (st))\n# define sk_NAME_FUNCS_value(st, i) SKM_sk_value(NAME_FUNCS, (st), (i))\n# define sk_NAME_FUNCS_set(st, i, val) SKM_sk_set(NAME_FUNCS, (st), (i), (val))\n# define sk_NAME_FUNCS_zero(st) SKM_sk_zero(NAME_FUNCS, (st))\n# define sk_NAME_FUNCS_push(st, val) SKM_sk_push(NAME_FUNCS, (st), (val))\n# define sk_NAME_FUNCS_unshift(st, val) SKM_sk_unshift(NAME_FUNCS, (st), (val))\n# define sk_NAME_FUNCS_find(st, val) SKM_sk_find(NAME_FUNCS, (st), (val))\n# define sk_NAME_FUNCS_find_ex(st, val) SKM_sk_find_ex(NAME_FUNCS, (st), (val))\n# define sk_NAME_FUNCS_delete(st, i) SKM_sk_delete(NAME_FUNCS, (st), (i))\n# define sk_NAME_FUNCS_delete_ptr(st, ptr) SKM_sk_delete_ptr(NAME_FUNCS, (st), (ptr))\n# define sk_NAME_FUNCS_insert(st, val, i) SKM_sk_insert(NAME_FUNCS, (st), (val), (i))\n# define sk_NAME_FUNCS_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(NAME_FUNCS, (st), (cmp))\n# define sk_NAME_FUNCS_dup(st) SKM_sk_dup(NAME_FUNCS, st)\n# define sk_NAME_FUNCS_pop_free(st, free_func) SKM_sk_pop_free(NAME_FUNCS, (st), (free_func))\n# define sk_NAME_FUNCS_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(NAME_FUNCS, (st), (copy_func), (free_func))\n# define sk_NAME_FUNCS_shift(st) SKM_sk_shift(NAME_FUNCS, (st))\n# define sk_NAME_FUNCS_pop(st) SKM_sk_pop(NAME_FUNCS, (st))\n# define sk_NAME_FUNCS_sort(st) SKM_sk_sort(NAME_FUNCS, (st))\n# define sk_NAME_FUNCS_is_sorted(st) SKM_sk_is_sorted(NAME_FUNCS, (st))\n# define sk_OCSP_CERTID_new(cmp) SKM_sk_new(OCSP_CERTID, (cmp))\n# define sk_OCSP_CERTID_new_null() SKM_sk_new_null(OCSP_CERTID)\n# define sk_OCSP_CERTID_free(st) SKM_sk_free(OCSP_CERTID, (st))\n# define sk_OCSP_CERTID_num(st) SKM_sk_num(OCSP_CERTID, (st))\n# define sk_OCSP_CERTID_value(st, i) SKM_sk_value(OCSP_CERTID, (st), (i))\n# define sk_OCSP_CERTID_set(st, i, val) SKM_sk_set(OCSP_CERTID, (st), (i), (val))\n# define sk_OCSP_CERTID_zero(st) SKM_sk_zero(OCSP_CERTID, (st))\n# define sk_OCSP_CERTID_push(st, val) SKM_sk_push(OCSP_CERTID, (st), (val))\n# define sk_OCSP_CERTID_unshift(st, val) SKM_sk_unshift(OCSP_CERTID, (st), (val))\n# define sk_OCSP_CERTID_find(st, val) SKM_sk_find(OCSP_CERTID, (st), (val))\n# define sk_OCSP_CERTID_find_ex(st, val) SKM_sk_find_ex(OCSP_CERTID, (st), (val))\n# define sk_OCSP_CERTID_delete(st, i) SKM_sk_delete(OCSP_CERTID, (st), (i))\n# define sk_OCSP_CERTID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_CERTID, (st), (ptr))\n# define sk_OCSP_CERTID_insert(st, val, i) SKM_sk_insert(OCSP_CERTID, (st), (val), (i))\n# define sk_OCSP_CERTID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_CERTID, (st), (cmp))\n# define sk_OCSP_CERTID_dup(st) SKM_sk_dup(OCSP_CERTID, st)\n# define sk_OCSP_CERTID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_CERTID, (st), (free_func))\n# define sk_OCSP_CERTID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_CERTID, (st), (copy_func), (free_func))\n# define sk_OCSP_CERTID_shift(st) SKM_sk_shift(OCSP_CERTID, (st))\n# define sk_OCSP_CERTID_pop(st) SKM_sk_pop(OCSP_CERTID, (st))\n# define sk_OCSP_CERTID_sort(st) SKM_sk_sort(OCSP_CERTID, (st))\n# define sk_OCSP_CERTID_is_sorted(st) SKM_sk_is_sorted(OCSP_CERTID, (st))\n# define sk_OCSP_ONEREQ_new(cmp) SKM_sk_new(OCSP_ONEREQ, (cmp))\n# define sk_OCSP_ONEREQ_new_null() SKM_sk_new_null(OCSP_ONEREQ)\n# define sk_OCSP_ONEREQ_free(st) SKM_sk_free(OCSP_ONEREQ, (st))\n# define sk_OCSP_ONEREQ_num(st) SKM_sk_num(OCSP_ONEREQ, (st))\n# define sk_OCSP_ONEREQ_value(st, i) SKM_sk_value(OCSP_ONEREQ, (st), (i))\n# define sk_OCSP_ONEREQ_set(st, i, val) SKM_sk_set(OCSP_ONEREQ, (st), (i), (val))\n# define sk_OCSP_ONEREQ_zero(st) SKM_sk_zero(OCSP_ONEREQ, (st))\n# define sk_OCSP_ONEREQ_push(st, val) SKM_sk_push(OCSP_ONEREQ, (st), (val))\n# define sk_OCSP_ONEREQ_unshift(st, val) SKM_sk_unshift(OCSP_ONEREQ, (st), (val))\n# define sk_OCSP_ONEREQ_find(st, val) SKM_sk_find(OCSP_ONEREQ, (st), (val))\n# define sk_OCSP_ONEREQ_find_ex(st, val) SKM_sk_find_ex(OCSP_ONEREQ, (st), (val))\n# define sk_OCSP_ONEREQ_delete(st, i) SKM_sk_delete(OCSP_ONEREQ, (st), (i))\n# define sk_OCSP_ONEREQ_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_ONEREQ, (st), (ptr))\n# define sk_OCSP_ONEREQ_insert(st, val, i) SKM_sk_insert(OCSP_ONEREQ, (st), (val), (i))\n# define sk_OCSP_ONEREQ_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_ONEREQ, (st), (cmp))\n# define sk_OCSP_ONEREQ_dup(st) SKM_sk_dup(OCSP_ONEREQ, st)\n# define sk_OCSP_ONEREQ_pop_free(st, free_func) SKM_sk_pop_free(OCSP_ONEREQ, (st), (free_func))\n# define sk_OCSP_ONEREQ_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_ONEREQ, (st), (copy_func), (free_func))\n# define sk_OCSP_ONEREQ_shift(st) SKM_sk_shift(OCSP_ONEREQ, (st))\n# define sk_OCSP_ONEREQ_pop(st) SKM_sk_pop(OCSP_ONEREQ, (st))\n# define sk_OCSP_ONEREQ_sort(st) SKM_sk_sort(OCSP_ONEREQ, (st))\n# define sk_OCSP_ONEREQ_is_sorted(st) SKM_sk_is_sorted(OCSP_ONEREQ, (st))\n# define sk_OCSP_RESPID_new(cmp) SKM_sk_new(OCSP_RESPID, (cmp))\n# define sk_OCSP_RESPID_new_null() SKM_sk_new_null(OCSP_RESPID)\n# define sk_OCSP_RESPID_free(st) SKM_sk_free(OCSP_RESPID, (st))\n# define sk_OCSP_RESPID_num(st) SKM_sk_num(OCSP_RESPID, (st))\n# define sk_OCSP_RESPID_value(st, i) SKM_sk_value(OCSP_RESPID, (st), (i))\n# define sk_OCSP_RESPID_set(st, i, val) SKM_sk_set(OCSP_RESPID, (st), (i), (val))\n# define sk_OCSP_RESPID_zero(st) SKM_sk_zero(OCSP_RESPID, (st))\n# define sk_OCSP_RESPID_push(st, val) SKM_sk_push(OCSP_RESPID, (st), (val))\n# define sk_OCSP_RESPID_unshift(st, val) SKM_sk_unshift(OCSP_RESPID, (st), (val))\n# define sk_OCSP_RESPID_find(st, val) SKM_sk_find(OCSP_RESPID, (st), (val))\n# define sk_OCSP_RESPID_find_ex(st, val) SKM_sk_find_ex(OCSP_RESPID, (st), (val))\n# define sk_OCSP_RESPID_delete(st, i) SKM_sk_delete(OCSP_RESPID, (st), (i))\n# define sk_OCSP_RESPID_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_RESPID, (st), (ptr))\n# define sk_OCSP_RESPID_insert(st, val, i) SKM_sk_insert(OCSP_RESPID, (st), (val), (i))\n# define sk_OCSP_RESPID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_RESPID, (st), (cmp))\n# define sk_OCSP_RESPID_dup(st) SKM_sk_dup(OCSP_RESPID, st)\n# define sk_OCSP_RESPID_pop_free(st, free_func) SKM_sk_pop_free(OCSP_RESPID, (st), (free_func))\n# define sk_OCSP_RESPID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_RESPID, (st), (copy_func), (free_func))\n# define sk_OCSP_RESPID_shift(st) SKM_sk_shift(OCSP_RESPID, (st))\n# define sk_OCSP_RESPID_pop(st) SKM_sk_pop(OCSP_RESPID, (st))\n# define sk_OCSP_RESPID_sort(st) SKM_sk_sort(OCSP_RESPID, (st))\n# define sk_OCSP_RESPID_is_sorted(st) SKM_sk_is_sorted(OCSP_RESPID, (st))\n# define sk_OCSP_SINGLERESP_new(cmp) SKM_sk_new(OCSP_SINGLERESP, (cmp))\n# define sk_OCSP_SINGLERESP_new_null() SKM_sk_new_null(OCSP_SINGLERESP)\n# define sk_OCSP_SINGLERESP_free(st) SKM_sk_free(OCSP_SINGLERESP, (st))\n# define sk_OCSP_SINGLERESP_num(st) SKM_sk_num(OCSP_SINGLERESP, (st))\n# define sk_OCSP_SINGLERESP_value(st, i) SKM_sk_value(OCSP_SINGLERESP, (st), (i))\n# define sk_OCSP_SINGLERESP_set(st, i, val) SKM_sk_set(OCSP_SINGLERESP, (st), (i), (val))\n# define sk_OCSP_SINGLERESP_zero(st) SKM_sk_zero(OCSP_SINGLERESP, (st))\n# define sk_OCSP_SINGLERESP_push(st, val) SKM_sk_push(OCSP_SINGLERESP, (st), (val))\n# define sk_OCSP_SINGLERESP_unshift(st, val) SKM_sk_unshift(OCSP_SINGLERESP, (st), (val))\n# define sk_OCSP_SINGLERESP_find(st, val) SKM_sk_find(OCSP_SINGLERESP, (st), (val))\n# define sk_OCSP_SINGLERESP_find_ex(st, val) SKM_sk_find_ex(OCSP_SINGLERESP, (st), (val))\n# define sk_OCSP_SINGLERESP_delete(st, i) SKM_sk_delete(OCSP_SINGLERESP, (st), (i))\n# define sk_OCSP_SINGLERESP_delete_ptr(st, ptr) SKM_sk_delete_ptr(OCSP_SINGLERESP, (st), (ptr))\n# define sk_OCSP_SINGLERESP_insert(st, val, i) SKM_sk_insert(OCSP_SINGLERESP, (st), (val), (i))\n# define sk_OCSP_SINGLERESP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(OCSP_SINGLERESP, (st), (cmp))\n# define sk_OCSP_SINGLERESP_dup(st) SKM_sk_dup(OCSP_SINGLERESP, st)\n# define sk_OCSP_SINGLERESP_pop_free(st, free_func) SKM_sk_pop_free(OCSP_SINGLERESP, (st), (free_func))\n# define sk_OCSP_SINGLERESP_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(OCSP_SINGLERESP, (st), (copy_func), (free_func))\n# define sk_OCSP_SINGLERESP_shift(st) SKM_sk_shift(OCSP_SINGLERESP, (st))\n# define sk_OCSP_SINGLERESP_pop(st) SKM_sk_pop(OCSP_SINGLERESP, (st))\n# define sk_OCSP_SINGLERESP_sort(st) SKM_sk_sort(OCSP_SINGLERESP, (st))\n# define sk_OCSP_SINGLERESP_is_sorted(st) SKM_sk_is_sorted(OCSP_SINGLERESP, (st))\n# define sk_PKCS12_SAFEBAG_new(cmp) SKM_sk_new(PKCS12_SAFEBAG, (cmp))\n# define sk_PKCS12_SAFEBAG_new_null() SKM_sk_new_null(PKCS12_SAFEBAG)\n# define sk_PKCS12_SAFEBAG_free(st) SKM_sk_free(PKCS12_SAFEBAG, (st))\n# define sk_PKCS12_SAFEBAG_num(st) SKM_sk_num(PKCS12_SAFEBAG, (st))\n# define sk_PKCS12_SAFEBAG_value(st, i) SKM_sk_value(PKCS12_SAFEBAG, (st), (i))\n# define sk_PKCS12_SAFEBAG_set(st, i, val) SKM_sk_set(PKCS12_SAFEBAG, (st), (i), (val))\n# define sk_PKCS12_SAFEBAG_zero(st) SKM_sk_zero(PKCS12_SAFEBAG, (st))\n# define sk_PKCS12_SAFEBAG_push(st, val) SKM_sk_push(PKCS12_SAFEBAG, (st), (val))\n# define sk_PKCS12_SAFEBAG_unshift(st, val) SKM_sk_unshift(PKCS12_SAFEBAG, (st), (val))\n# define sk_PKCS12_SAFEBAG_find(st, val) SKM_sk_find(PKCS12_SAFEBAG, (st), (val))\n# define sk_PKCS12_SAFEBAG_find_ex(st, val) SKM_sk_find_ex(PKCS12_SAFEBAG, (st), (val))\n# define sk_PKCS12_SAFEBAG_delete(st, i) SKM_sk_delete(PKCS12_SAFEBAG, (st), (i))\n# define sk_PKCS12_SAFEBAG_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS12_SAFEBAG, (st), (ptr))\n# define sk_PKCS12_SAFEBAG_insert(st, val, i) SKM_sk_insert(PKCS12_SAFEBAG, (st), (val), (i))\n# define sk_PKCS12_SAFEBAG_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS12_SAFEBAG, (st), (cmp))\n# define sk_PKCS12_SAFEBAG_dup(st) SKM_sk_dup(PKCS12_SAFEBAG, st)\n# define sk_PKCS12_SAFEBAG_pop_free(st, free_func) SKM_sk_pop_free(PKCS12_SAFEBAG, (st), (free_func))\n# define sk_PKCS12_SAFEBAG_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS12_SAFEBAG, (st), (copy_func), (free_func))\n# define sk_PKCS12_SAFEBAG_shift(st) SKM_sk_shift(PKCS12_SAFEBAG, (st))\n# define sk_PKCS12_SAFEBAG_pop(st) SKM_sk_pop(PKCS12_SAFEBAG, (st))\n# define sk_PKCS12_SAFEBAG_sort(st) SKM_sk_sort(PKCS12_SAFEBAG, (st))\n# define sk_PKCS12_SAFEBAG_is_sorted(st) SKM_sk_is_sorted(PKCS12_SAFEBAG, (st))\n# define sk_PKCS7_new(cmp) SKM_sk_new(PKCS7, (cmp))\n# define sk_PKCS7_new_null() SKM_sk_new_null(PKCS7)\n# define sk_PKCS7_free(st) SKM_sk_free(PKCS7, (st))\n# define sk_PKCS7_num(st) SKM_sk_num(PKCS7, (st))\n# define sk_PKCS7_value(st, i) SKM_sk_value(PKCS7, (st), (i))\n# define sk_PKCS7_set(st, i, val) SKM_sk_set(PKCS7, (st), (i), (val))\n# define sk_PKCS7_zero(st) SKM_sk_zero(PKCS7, (st))\n# define sk_PKCS7_push(st, val) SKM_sk_push(PKCS7, (st), (val))\n# define sk_PKCS7_unshift(st, val) SKM_sk_unshift(PKCS7, (st), (val))\n# define sk_PKCS7_find(st, val) SKM_sk_find(PKCS7, (st), (val))\n# define sk_PKCS7_find_ex(st, val) SKM_sk_find_ex(PKCS7, (st), (val))\n# define sk_PKCS7_delete(st, i) SKM_sk_delete(PKCS7, (st), (i))\n# define sk_PKCS7_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7, (st), (ptr))\n# define sk_PKCS7_insert(st, val, i) SKM_sk_insert(PKCS7, (st), (val), (i))\n# define sk_PKCS7_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7, (st), (cmp))\n# define sk_PKCS7_dup(st) SKM_sk_dup(PKCS7, st)\n# define sk_PKCS7_pop_free(st, free_func) SKM_sk_pop_free(PKCS7, (st), (free_func))\n# define sk_PKCS7_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS7, (st), (copy_func), (free_func))\n# define sk_PKCS7_shift(st) SKM_sk_shift(PKCS7, (st))\n# define sk_PKCS7_pop(st) SKM_sk_pop(PKCS7, (st))\n# define sk_PKCS7_sort(st) SKM_sk_sort(PKCS7, (st))\n# define sk_PKCS7_is_sorted(st) SKM_sk_is_sorted(PKCS7, (st))\n# define sk_PKCS7_RECIP_INFO_new(cmp) SKM_sk_new(PKCS7_RECIP_INFO, (cmp))\n# define sk_PKCS7_RECIP_INFO_new_null() SKM_sk_new_null(PKCS7_RECIP_INFO)\n# define sk_PKCS7_RECIP_INFO_free(st) SKM_sk_free(PKCS7_RECIP_INFO, (st))\n# define sk_PKCS7_RECIP_INFO_num(st) SKM_sk_num(PKCS7_RECIP_INFO, (st))\n# define sk_PKCS7_RECIP_INFO_value(st, i) SKM_sk_value(PKCS7_RECIP_INFO, (st), (i))\n# define sk_PKCS7_RECIP_INFO_set(st, i, val) SKM_sk_set(PKCS7_RECIP_INFO, (st), (i), (val))\n# define sk_PKCS7_RECIP_INFO_zero(st) SKM_sk_zero(PKCS7_RECIP_INFO, (st))\n# define sk_PKCS7_RECIP_INFO_push(st, val) SKM_sk_push(PKCS7_RECIP_INFO, (st), (val))\n# define sk_PKCS7_RECIP_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_RECIP_INFO, (st), (val))\n# define sk_PKCS7_RECIP_INFO_find(st, val) SKM_sk_find(PKCS7_RECIP_INFO, (st), (val))\n# define sk_PKCS7_RECIP_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_RECIP_INFO, (st), (val))\n# define sk_PKCS7_RECIP_INFO_delete(st, i) SKM_sk_delete(PKCS7_RECIP_INFO, (st), (i))\n# define sk_PKCS7_RECIP_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_RECIP_INFO, (st), (ptr))\n# define sk_PKCS7_RECIP_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_RECIP_INFO, (st), (val), (i))\n# define sk_PKCS7_RECIP_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_RECIP_INFO, (st), (cmp))\n# define sk_PKCS7_RECIP_INFO_dup(st) SKM_sk_dup(PKCS7_RECIP_INFO, st)\n# define sk_PKCS7_RECIP_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_RECIP_INFO, (st), (free_func))\n# define sk_PKCS7_RECIP_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS7_RECIP_INFO, (st), (copy_func), (free_func))\n# define sk_PKCS7_RECIP_INFO_shift(st) SKM_sk_shift(PKCS7_RECIP_INFO, (st))\n# define sk_PKCS7_RECIP_INFO_pop(st) SKM_sk_pop(PKCS7_RECIP_INFO, (st))\n# define sk_PKCS7_RECIP_INFO_sort(st) SKM_sk_sort(PKCS7_RECIP_INFO, (st))\n# define sk_PKCS7_RECIP_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_RECIP_INFO, (st))\n# define sk_PKCS7_SIGNER_INFO_new(cmp) SKM_sk_new(PKCS7_SIGNER_INFO, (cmp))\n# define sk_PKCS7_SIGNER_INFO_new_null() SKM_sk_new_null(PKCS7_SIGNER_INFO)\n# define sk_PKCS7_SIGNER_INFO_free(st) SKM_sk_free(PKCS7_SIGNER_INFO, (st))\n# define sk_PKCS7_SIGNER_INFO_num(st) SKM_sk_num(PKCS7_SIGNER_INFO, (st))\n# define sk_PKCS7_SIGNER_INFO_value(st, i) SKM_sk_value(PKCS7_SIGNER_INFO, (st), (i))\n# define sk_PKCS7_SIGNER_INFO_set(st, i, val) SKM_sk_set(PKCS7_SIGNER_INFO, (st), (i), (val))\n# define sk_PKCS7_SIGNER_INFO_zero(st) SKM_sk_zero(PKCS7_SIGNER_INFO, (st))\n# define sk_PKCS7_SIGNER_INFO_push(st, val) SKM_sk_push(PKCS7_SIGNER_INFO, (st), (val))\n# define sk_PKCS7_SIGNER_INFO_unshift(st, val) SKM_sk_unshift(PKCS7_SIGNER_INFO, (st), (val))\n# define sk_PKCS7_SIGNER_INFO_find(st, val) SKM_sk_find(PKCS7_SIGNER_INFO, (st), (val))\n# define sk_PKCS7_SIGNER_INFO_find_ex(st, val) SKM_sk_find_ex(PKCS7_SIGNER_INFO, (st), (val))\n# define sk_PKCS7_SIGNER_INFO_delete(st, i) SKM_sk_delete(PKCS7_SIGNER_INFO, (st), (i))\n# define sk_PKCS7_SIGNER_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(PKCS7_SIGNER_INFO, (st), (ptr))\n# define sk_PKCS7_SIGNER_INFO_insert(st, val, i) SKM_sk_insert(PKCS7_SIGNER_INFO, (st), (val), (i))\n# define sk_PKCS7_SIGNER_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(PKCS7_SIGNER_INFO, (st), (cmp))\n# define sk_PKCS7_SIGNER_INFO_dup(st) SKM_sk_dup(PKCS7_SIGNER_INFO, st)\n# define sk_PKCS7_SIGNER_INFO_pop_free(st, free_func) SKM_sk_pop_free(PKCS7_SIGNER_INFO, (st), (free_func))\n# define sk_PKCS7_SIGNER_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(PKCS7_SIGNER_INFO, (st), (copy_func), (free_func))\n# define sk_PKCS7_SIGNER_INFO_shift(st) SKM_sk_shift(PKCS7_SIGNER_INFO, (st))\n# define sk_PKCS7_SIGNER_INFO_pop(st) SKM_sk_pop(PKCS7_SIGNER_INFO, (st))\n# define sk_PKCS7_SIGNER_INFO_sort(st) SKM_sk_sort(PKCS7_SIGNER_INFO, (st))\n# define sk_PKCS7_SIGNER_INFO_is_sorted(st) SKM_sk_is_sorted(PKCS7_SIGNER_INFO, (st))\n# define sk_POLICYINFO_new(cmp) SKM_sk_new(POLICYINFO, (cmp))\n# define sk_POLICYINFO_new_null() SKM_sk_new_null(POLICYINFO)\n# define sk_POLICYINFO_free(st) SKM_sk_free(POLICYINFO, (st))\n# define sk_POLICYINFO_num(st) SKM_sk_num(POLICYINFO, (st))\n# define sk_POLICYINFO_value(st, i) SKM_sk_value(POLICYINFO, (st), (i))\n# define sk_POLICYINFO_set(st, i, val) SKM_sk_set(POLICYINFO, (st), (i), (val))\n# define sk_POLICYINFO_zero(st) SKM_sk_zero(POLICYINFO, (st))\n# define sk_POLICYINFO_push(st, val) SKM_sk_push(POLICYINFO, (st), (val))\n# define sk_POLICYINFO_unshift(st, val) SKM_sk_unshift(POLICYINFO, (st), (val))\n# define sk_POLICYINFO_find(st, val) SKM_sk_find(POLICYINFO, (st), (val))\n# define sk_POLICYINFO_find_ex(st, val) SKM_sk_find_ex(POLICYINFO, (st), (val))\n# define sk_POLICYINFO_delete(st, i) SKM_sk_delete(POLICYINFO, (st), (i))\n# define sk_POLICYINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYINFO, (st), (ptr))\n# define sk_POLICYINFO_insert(st, val, i) SKM_sk_insert(POLICYINFO, (st), (val), (i))\n# define sk_POLICYINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYINFO, (st), (cmp))\n# define sk_POLICYINFO_dup(st) SKM_sk_dup(POLICYINFO, st)\n# define sk_POLICYINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYINFO, (st), (free_func))\n# define sk_POLICYINFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(POLICYINFO, (st), (copy_func), (free_func))\n# define sk_POLICYINFO_shift(st) SKM_sk_shift(POLICYINFO, (st))\n# define sk_POLICYINFO_pop(st) SKM_sk_pop(POLICYINFO, (st))\n# define sk_POLICYINFO_sort(st) SKM_sk_sort(POLICYINFO, (st))\n# define sk_POLICYINFO_is_sorted(st) SKM_sk_is_sorted(POLICYINFO, (st))\n# define sk_POLICYQUALINFO_new(cmp) SKM_sk_new(POLICYQUALINFO, (cmp))\n# define sk_POLICYQUALINFO_new_null() SKM_sk_new_null(POLICYQUALINFO)\n# define sk_POLICYQUALINFO_free(st) SKM_sk_free(POLICYQUALINFO, (st))\n# define sk_POLICYQUALINFO_num(st) SKM_sk_num(POLICYQUALINFO, (st))\n# define sk_POLICYQUALINFO_value(st, i) SKM_sk_value(POLICYQUALINFO, (st), (i))\n# define sk_POLICYQUALINFO_set(st, i, val) SKM_sk_set(POLICYQUALINFO, (st), (i), (val))\n# define sk_POLICYQUALINFO_zero(st) SKM_sk_zero(POLICYQUALINFO, (st))\n# define sk_POLICYQUALINFO_push(st, val) SKM_sk_push(POLICYQUALINFO, (st), (val))\n# define sk_POLICYQUALINFO_unshift(st, val) SKM_sk_unshift(POLICYQUALINFO, (st), (val))\n# define sk_POLICYQUALINFO_find(st, val) SKM_sk_find(POLICYQUALINFO, (st), (val))\n# define sk_POLICYQUALINFO_find_ex(st, val) SKM_sk_find_ex(POLICYQUALINFO, (st), (val))\n# define sk_POLICYQUALINFO_delete(st, i) SKM_sk_delete(POLICYQUALINFO, (st), (i))\n# define sk_POLICYQUALINFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICYQUALINFO, (st), (ptr))\n# define sk_POLICYQUALINFO_insert(st, val, i) SKM_sk_insert(POLICYQUALINFO, (st), (val), (i))\n# define sk_POLICYQUALINFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICYQUALINFO, (st), (cmp))\n# define sk_POLICYQUALINFO_dup(st) SKM_sk_dup(POLICYQUALINFO, st)\n# define sk_POLICYQUALINFO_pop_free(st, free_func) SKM_sk_pop_free(POLICYQUALINFO, (st), (free_func))\n# define sk_POLICYQUALINFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(POLICYQUALINFO, (st), (copy_func), (free_func))\n# define sk_POLICYQUALINFO_shift(st) SKM_sk_shift(POLICYQUALINFO, (st))\n# define sk_POLICYQUALINFO_pop(st) SKM_sk_pop(POLICYQUALINFO, (st))\n# define sk_POLICYQUALINFO_sort(st) SKM_sk_sort(POLICYQUALINFO, (st))\n# define sk_POLICYQUALINFO_is_sorted(st) SKM_sk_is_sorted(POLICYQUALINFO, (st))\n# define sk_POLICY_MAPPING_new(cmp) SKM_sk_new(POLICY_MAPPING, (cmp))\n# define sk_POLICY_MAPPING_new_null() SKM_sk_new_null(POLICY_MAPPING)\n# define sk_POLICY_MAPPING_free(st) SKM_sk_free(POLICY_MAPPING, (st))\n# define sk_POLICY_MAPPING_num(st) SKM_sk_num(POLICY_MAPPING, (st))\n# define sk_POLICY_MAPPING_value(st, i) SKM_sk_value(POLICY_MAPPING, (st), (i))\n# define sk_POLICY_MAPPING_set(st, i, val) SKM_sk_set(POLICY_MAPPING, (st), (i), (val))\n# define sk_POLICY_MAPPING_zero(st) SKM_sk_zero(POLICY_MAPPING, (st))\n# define sk_POLICY_MAPPING_push(st, val) SKM_sk_push(POLICY_MAPPING, (st), (val))\n# define sk_POLICY_MAPPING_unshift(st, val) SKM_sk_unshift(POLICY_MAPPING, (st), (val))\n# define sk_POLICY_MAPPING_find(st, val) SKM_sk_find(POLICY_MAPPING, (st), (val))\n# define sk_POLICY_MAPPING_find_ex(st, val) SKM_sk_find_ex(POLICY_MAPPING, (st), (val))\n# define sk_POLICY_MAPPING_delete(st, i) SKM_sk_delete(POLICY_MAPPING, (st), (i))\n# define sk_POLICY_MAPPING_delete_ptr(st, ptr) SKM_sk_delete_ptr(POLICY_MAPPING, (st), (ptr))\n# define sk_POLICY_MAPPING_insert(st, val, i) SKM_sk_insert(POLICY_MAPPING, (st), (val), (i))\n# define sk_POLICY_MAPPING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(POLICY_MAPPING, (st), (cmp))\n# define sk_POLICY_MAPPING_dup(st) SKM_sk_dup(POLICY_MAPPING, st)\n# define sk_POLICY_MAPPING_pop_free(st, free_func) SKM_sk_pop_free(POLICY_MAPPING, (st), (free_func))\n# define sk_POLICY_MAPPING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(POLICY_MAPPING, (st), (copy_func), (free_func))\n# define sk_POLICY_MAPPING_shift(st) SKM_sk_shift(POLICY_MAPPING, (st))\n# define sk_POLICY_MAPPING_pop(st) SKM_sk_pop(POLICY_MAPPING, (st))\n# define sk_POLICY_MAPPING_sort(st) SKM_sk_sort(POLICY_MAPPING, (st))\n# define sk_POLICY_MAPPING_is_sorted(st) SKM_sk_is_sorted(POLICY_MAPPING, (st))\n# define sk_SCT_new(cmp) SKM_sk_new(SCT, (cmp))\n# define sk_SCT_new_null() SKM_sk_new_null(SCT)\n# define sk_SCT_free(st) SKM_sk_free(SCT, (st))\n# define sk_SCT_num(st) SKM_sk_num(SCT, (st))\n# define sk_SCT_value(st, i) SKM_sk_value(SCT, (st), (i))\n# define sk_SCT_set(st, i, val) SKM_sk_set(SCT, (st), (i), (val))\n# define sk_SCT_zero(st) SKM_sk_zero(SCT, (st))\n# define sk_SCT_push(st, val) SKM_sk_push(SCT, (st), (val))\n# define sk_SCT_unshift(st, val) SKM_sk_unshift(SCT, (st), (val))\n# define sk_SCT_find(st, val) SKM_sk_find(SCT, (st), (val))\n# define sk_SCT_find_ex(st, val) SKM_sk_find_ex(SCT, (st), (val))\n# define sk_SCT_delete(st, i) SKM_sk_delete(SCT, (st), (i))\n# define sk_SCT_delete_ptr(st, ptr) SKM_sk_delete_ptr(SCT, (st), (ptr))\n# define sk_SCT_insert(st, val, i) SKM_sk_insert(SCT, (st), (val), (i))\n# define sk_SCT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SCT, (st), (cmp))\n# define sk_SCT_dup(st) SKM_sk_dup(SCT, st)\n# define sk_SCT_pop_free(st, free_func) SKM_sk_pop_free(SCT, (st), (free_func))\n# define sk_SCT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SCT, (st), (copy_func), (free_func))\n# define sk_SCT_shift(st) SKM_sk_shift(SCT, (st))\n# define sk_SCT_pop(st) SKM_sk_pop(SCT, (st))\n# define sk_SCT_sort(st) SKM_sk_sort(SCT, (st))\n# define sk_SCT_is_sorted(st) SKM_sk_is_sorted(SCT, (st))\n# define sk_SRP_gN_new(cmp) SKM_sk_new(SRP_gN, (cmp))\n# define sk_SRP_gN_new_null() SKM_sk_new_null(SRP_gN)\n# define sk_SRP_gN_free(st) SKM_sk_free(SRP_gN, (st))\n# define sk_SRP_gN_num(st) SKM_sk_num(SRP_gN, (st))\n# define sk_SRP_gN_value(st, i) SKM_sk_value(SRP_gN, (st), (i))\n# define sk_SRP_gN_set(st, i, val) SKM_sk_set(SRP_gN, (st), (i), (val))\n# define sk_SRP_gN_zero(st) SKM_sk_zero(SRP_gN, (st))\n# define sk_SRP_gN_push(st, val) SKM_sk_push(SRP_gN, (st), (val))\n# define sk_SRP_gN_unshift(st, val) SKM_sk_unshift(SRP_gN, (st), (val))\n# define sk_SRP_gN_find(st, val) SKM_sk_find(SRP_gN, (st), (val))\n# define sk_SRP_gN_find_ex(st, val) SKM_sk_find_ex(SRP_gN, (st), (val))\n# define sk_SRP_gN_delete(st, i) SKM_sk_delete(SRP_gN, (st), (i))\n# define sk_SRP_gN_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN, (st), (ptr))\n# define sk_SRP_gN_insert(st, val, i) SKM_sk_insert(SRP_gN, (st), (val), (i))\n# define sk_SRP_gN_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN, (st), (cmp))\n# define sk_SRP_gN_dup(st) SKM_sk_dup(SRP_gN, st)\n# define sk_SRP_gN_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN, (st), (free_func))\n# define sk_SRP_gN_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRP_gN, (st), (copy_func), (free_func))\n# define sk_SRP_gN_shift(st) SKM_sk_shift(SRP_gN, (st))\n# define sk_SRP_gN_pop(st) SKM_sk_pop(SRP_gN, (st))\n# define sk_SRP_gN_sort(st) SKM_sk_sort(SRP_gN, (st))\n# define sk_SRP_gN_is_sorted(st) SKM_sk_is_sorted(SRP_gN, (st))\n# define sk_SRP_gN_cache_new(cmp) SKM_sk_new(SRP_gN_cache, (cmp))\n# define sk_SRP_gN_cache_new_null() SKM_sk_new_null(SRP_gN_cache)\n# define sk_SRP_gN_cache_free(st) SKM_sk_free(SRP_gN_cache, (st))\n# define sk_SRP_gN_cache_num(st) SKM_sk_num(SRP_gN_cache, (st))\n# define sk_SRP_gN_cache_value(st, i) SKM_sk_value(SRP_gN_cache, (st), (i))\n# define sk_SRP_gN_cache_set(st, i, val) SKM_sk_set(SRP_gN_cache, (st), (i), (val))\n# define sk_SRP_gN_cache_zero(st) SKM_sk_zero(SRP_gN_cache, (st))\n# define sk_SRP_gN_cache_push(st, val) SKM_sk_push(SRP_gN_cache, (st), (val))\n# define sk_SRP_gN_cache_unshift(st, val) SKM_sk_unshift(SRP_gN_cache, (st), (val))\n# define sk_SRP_gN_cache_find(st, val) SKM_sk_find(SRP_gN_cache, (st), (val))\n# define sk_SRP_gN_cache_find_ex(st, val) SKM_sk_find_ex(SRP_gN_cache, (st), (val))\n# define sk_SRP_gN_cache_delete(st, i) SKM_sk_delete(SRP_gN_cache, (st), (i))\n# define sk_SRP_gN_cache_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_gN_cache, (st), (ptr))\n# define sk_SRP_gN_cache_insert(st, val, i) SKM_sk_insert(SRP_gN_cache, (st), (val), (i))\n# define sk_SRP_gN_cache_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_gN_cache, (st), (cmp))\n# define sk_SRP_gN_cache_dup(st) SKM_sk_dup(SRP_gN_cache, st)\n# define sk_SRP_gN_cache_pop_free(st, free_func) SKM_sk_pop_free(SRP_gN_cache, (st), (free_func))\n# define sk_SRP_gN_cache_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRP_gN_cache, (st), (copy_func), (free_func))\n# define sk_SRP_gN_cache_shift(st) SKM_sk_shift(SRP_gN_cache, (st))\n# define sk_SRP_gN_cache_pop(st) SKM_sk_pop(SRP_gN_cache, (st))\n# define sk_SRP_gN_cache_sort(st) SKM_sk_sort(SRP_gN_cache, (st))\n# define sk_SRP_gN_cache_is_sorted(st) SKM_sk_is_sorted(SRP_gN_cache, (st))\n# define sk_SRP_user_pwd_new(cmp) SKM_sk_new(SRP_user_pwd, (cmp))\n# define sk_SRP_user_pwd_new_null() SKM_sk_new_null(SRP_user_pwd)\n# define sk_SRP_user_pwd_free(st) SKM_sk_free(SRP_user_pwd, (st))\n# define sk_SRP_user_pwd_num(st) SKM_sk_num(SRP_user_pwd, (st))\n# define sk_SRP_user_pwd_value(st, i) SKM_sk_value(SRP_user_pwd, (st), (i))\n# define sk_SRP_user_pwd_set(st, i, val) SKM_sk_set(SRP_user_pwd, (st), (i), (val))\n# define sk_SRP_user_pwd_zero(st) SKM_sk_zero(SRP_user_pwd, (st))\n# define sk_SRP_user_pwd_push(st, val) SKM_sk_push(SRP_user_pwd, (st), (val))\n# define sk_SRP_user_pwd_unshift(st, val) SKM_sk_unshift(SRP_user_pwd, (st), (val))\n# define sk_SRP_user_pwd_find(st, val) SKM_sk_find(SRP_user_pwd, (st), (val))\n# define sk_SRP_user_pwd_find_ex(st, val) SKM_sk_find_ex(SRP_user_pwd, (st), (val))\n# define sk_SRP_user_pwd_delete(st, i) SKM_sk_delete(SRP_user_pwd, (st), (i))\n# define sk_SRP_user_pwd_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRP_user_pwd, (st), (ptr))\n# define sk_SRP_user_pwd_insert(st, val, i) SKM_sk_insert(SRP_user_pwd, (st), (val), (i))\n# define sk_SRP_user_pwd_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRP_user_pwd, (st), (cmp))\n# define sk_SRP_user_pwd_dup(st) SKM_sk_dup(SRP_user_pwd, st)\n# define sk_SRP_user_pwd_pop_free(st, free_func) SKM_sk_pop_free(SRP_user_pwd, (st), (free_func))\n# define sk_SRP_user_pwd_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRP_user_pwd, (st), (copy_func), (free_func))\n# define sk_SRP_user_pwd_shift(st) SKM_sk_shift(SRP_user_pwd, (st))\n# define sk_SRP_user_pwd_pop(st) SKM_sk_pop(SRP_user_pwd, (st))\n# define sk_SRP_user_pwd_sort(st) SKM_sk_sort(SRP_user_pwd, (st))\n# define sk_SRP_user_pwd_is_sorted(st) SKM_sk_is_sorted(SRP_user_pwd, (st))\n# define sk_SRTP_PROTECTION_PROFILE_new(cmp) SKM_sk_new(SRTP_PROTECTION_PROFILE, (cmp))\n# define sk_SRTP_PROTECTION_PROFILE_new_null() SKM_sk_new_null(SRTP_PROTECTION_PROFILE)\n# define sk_SRTP_PROTECTION_PROFILE_free(st) SKM_sk_free(SRTP_PROTECTION_PROFILE, (st))\n# define sk_SRTP_PROTECTION_PROFILE_num(st) SKM_sk_num(SRTP_PROTECTION_PROFILE, (st))\n# define sk_SRTP_PROTECTION_PROFILE_value(st, i) SKM_sk_value(SRTP_PROTECTION_PROFILE, (st), (i))\n# define sk_SRTP_PROTECTION_PROFILE_set(st, i, val) SKM_sk_set(SRTP_PROTECTION_PROFILE, (st), (i), (val))\n# define sk_SRTP_PROTECTION_PROFILE_zero(st) SKM_sk_zero(SRTP_PROTECTION_PROFILE, (st))\n# define sk_SRTP_PROTECTION_PROFILE_push(st, val) SKM_sk_push(SRTP_PROTECTION_PROFILE, (st), (val))\n# define sk_SRTP_PROTECTION_PROFILE_unshift(st, val) SKM_sk_unshift(SRTP_PROTECTION_PROFILE, (st), (val))\n# define sk_SRTP_PROTECTION_PROFILE_find(st, val) SKM_sk_find(SRTP_PROTECTION_PROFILE, (st), (val))\n# define sk_SRTP_PROTECTION_PROFILE_find_ex(st, val) SKM_sk_find_ex(SRTP_PROTECTION_PROFILE, (st), (val))\n# define sk_SRTP_PROTECTION_PROFILE_delete(st, i) SKM_sk_delete(SRTP_PROTECTION_PROFILE, (st), (i))\n# define sk_SRTP_PROTECTION_PROFILE_delete_ptr(st, ptr) SKM_sk_delete_ptr(SRTP_PROTECTION_PROFILE, (st), (ptr))\n# define sk_SRTP_PROTECTION_PROFILE_insert(st, val, i) SKM_sk_insert(SRTP_PROTECTION_PROFILE, (st), (val), (i))\n# define sk_SRTP_PROTECTION_PROFILE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SRTP_PROTECTION_PROFILE, (st), (cmp))\n# define sk_SRTP_PROTECTION_PROFILE_dup(st) SKM_sk_dup(SRTP_PROTECTION_PROFILE, st)\n# define sk_SRTP_PROTECTION_PROFILE_pop_free(st, free_func) SKM_sk_pop_free(SRTP_PROTECTION_PROFILE, (st), (free_func))\n# define sk_SRTP_PROTECTION_PROFILE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SRTP_PROTECTION_PROFILE, (st), (copy_func), (free_func))\n# define sk_SRTP_PROTECTION_PROFILE_shift(st) SKM_sk_shift(SRTP_PROTECTION_PROFILE, (st))\n# define sk_SRTP_PROTECTION_PROFILE_pop(st) SKM_sk_pop(SRTP_PROTECTION_PROFILE, (st))\n# define sk_SRTP_PROTECTION_PROFILE_sort(st) SKM_sk_sort(SRTP_PROTECTION_PROFILE, (st))\n# define sk_SRTP_PROTECTION_PROFILE_is_sorted(st) SKM_sk_is_sorted(SRTP_PROTECTION_PROFILE, (st))\n# define sk_SSL_CIPHER_new(cmp) SKM_sk_new(SSL_CIPHER, (cmp))\n# define sk_SSL_CIPHER_new_null() SKM_sk_new_null(SSL_CIPHER)\n# define sk_SSL_CIPHER_free(st) SKM_sk_free(SSL_CIPHER, (st))\n# define sk_SSL_CIPHER_num(st) SKM_sk_num(SSL_CIPHER, (st))\n# define sk_SSL_CIPHER_value(st, i) SKM_sk_value(SSL_CIPHER, (st), (i))\n# define sk_SSL_CIPHER_set(st, i, val) SKM_sk_set(SSL_CIPHER, (st), (i), (val))\n# define sk_SSL_CIPHER_zero(st) SKM_sk_zero(SSL_CIPHER, (st))\n# define sk_SSL_CIPHER_push(st, val) SKM_sk_push(SSL_CIPHER, (st), (val))\n# define sk_SSL_CIPHER_unshift(st, val) SKM_sk_unshift(SSL_CIPHER, (st), (val))\n# define sk_SSL_CIPHER_find(st, val) SKM_sk_find(SSL_CIPHER, (st), (val))\n# define sk_SSL_CIPHER_find_ex(st, val) SKM_sk_find_ex(SSL_CIPHER, (st), (val))\n# define sk_SSL_CIPHER_delete(st, i) SKM_sk_delete(SSL_CIPHER, (st), (i))\n# define sk_SSL_CIPHER_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_CIPHER, (st), (ptr))\n# define sk_SSL_CIPHER_insert(st, val, i) SKM_sk_insert(SSL_CIPHER, (st), (val), (i))\n# define sk_SSL_CIPHER_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_CIPHER, (st), (cmp))\n# define sk_SSL_CIPHER_dup(st) SKM_sk_dup(SSL_CIPHER, st)\n# define sk_SSL_CIPHER_pop_free(st, free_func) SKM_sk_pop_free(SSL_CIPHER, (st), (free_func))\n# define sk_SSL_CIPHER_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SSL_CIPHER, (st), (copy_func), (free_func))\n# define sk_SSL_CIPHER_shift(st) SKM_sk_shift(SSL_CIPHER, (st))\n# define sk_SSL_CIPHER_pop(st) SKM_sk_pop(SSL_CIPHER, (st))\n# define sk_SSL_CIPHER_sort(st) SKM_sk_sort(SSL_CIPHER, (st))\n# define sk_SSL_CIPHER_is_sorted(st) SKM_sk_is_sorted(SSL_CIPHER, (st))\n# define sk_SSL_COMP_new(cmp) SKM_sk_new(SSL_COMP, (cmp))\n# define sk_SSL_COMP_new_null() SKM_sk_new_null(SSL_COMP)\n# define sk_SSL_COMP_free(st) SKM_sk_free(SSL_COMP, (st))\n# define sk_SSL_COMP_num(st) SKM_sk_num(SSL_COMP, (st))\n# define sk_SSL_COMP_value(st, i) SKM_sk_value(SSL_COMP, (st), (i))\n# define sk_SSL_COMP_set(st, i, val) SKM_sk_set(SSL_COMP, (st), (i), (val))\n# define sk_SSL_COMP_zero(st) SKM_sk_zero(SSL_COMP, (st))\n# define sk_SSL_COMP_push(st, val) SKM_sk_push(SSL_COMP, (st), (val))\n# define sk_SSL_COMP_unshift(st, val) SKM_sk_unshift(SSL_COMP, (st), (val))\n# define sk_SSL_COMP_find(st, val) SKM_sk_find(SSL_COMP, (st), (val))\n# define sk_SSL_COMP_find_ex(st, val) SKM_sk_find_ex(SSL_COMP, (st), (val))\n# define sk_SSL_COMP_delete(st, i) SKM_sk_delete(SSL_COMP, (st), (i))\n# define sk_SSL_COMP_delete_ptr(st, ptr) SKM_sk_delete_ptr(SSL_COMP, (st), (ptr))\n# define sk_SSL_COMP_insert(st, val, i) SKM_sk_insert(SSL_COMP, (st), (val), (i))\n# define sk_SSL_COMP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SSL_COMP, (st), (cmp))\n# define sk_SSL_COMP_dup(st) SKM_sk_dup(SSL_COMP, st)\n# define sk_SSL_COMP_pop_free(st, free_func) SKM_sk_pop_free(SSL_COMP, (st), (free_func))\n# define sk_SSL_COMP_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SSL_COMP, (st), (copy_func), (free_func))\n# define sk_SSL_COMP_shift(st) SKM_sk_shift(SSL_COMP, (st))\n# define sk_SSL_COMP_pop(st) SKM_sk_pop(SSL_COMP, (st))\n# define sk_SSL_COMP_sort(st) SKM_sk_sort(SSL_COMP, (st))\n# define sk_SSL_COMP_is_sorted(st) SKM_sk_is_sorted(SSL_COMP, (st))\n# define sk_STACK_OF_X509_NAME_ENTRY_new(cmp) SKM_sk_new(STACK_OF_X509_NAME_ENTRY, (cmp))\n# define sk_STACK_OF_X509_NAME_ENTRY_new_null() SKM_sk_new_null(STACK_OF_X509_NAME_ENTRY)\n# define sk_STACK_OF_X509_NAME_ENTRY_free(st) SKM_sk_free(STACK_OF_X509_NAME_ENTRY, (st))\n# define sk_STACK_OF_X509_NAME_ENTRY_num(st) SKM_sk_num(STACK_OF_X509_NAME_ENTRY, (st))\n# define sk_STACK_OF_X509_NAME_ENTRY_value(st, i) SKM_sk_value(STACK_OF_X509_NAME_ENTRY, (st), (i))\n# define sk_STACK_OF_X509_NAME_ENTRY_set(st, i, val) SKM_sk_set(STACK_OF_X509_NAME_ENTRY, (st), (i), (val))\n# define sk_STACK_OF_X509_NAME_ENTRY_zero(st) SKM_sk_zero(STACK_OF_X509_NAME_ENTRY, (st))\n# define sk_STACK_OF_X509_NAME_ENTRY_push(st, val) SKM_sk_push(STACK_OF_X509_NAME_ENTRY, (st), (val))\n# define sk_STACK_OF_X509_NAME_ENTRY_unshift(st, val) SKM_sk_unshift(STACK_OF_X509_NAME_ENTRY, (st), (val))\n# define sk_STACK_OF_X509_NAME_ENTRY_find(st, val) SKM_sk_find(STACK_OF_X509_NAME_ENTRY, (st), (val))\n# define sk_STACK_OF_X509_NAME_ENTRY_find_ex(st, val) SKM_sk_find_ex(STACK_OF_X509_NAME_ENTRY, (st), (val))\n# define sk_STACK_OF_X509_NAME_ENTRY_delete(st, i) SKM_sk_delete(STACK_OF_X509_NAME_ENTRY, (st), (i))\n# define sk_STACK_OF_X509_NAME_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(STACK_OF_X509_NAME_ENTRY, (st), (ptr))\n# define sk_STACK_OF_X509_NAME_ENTRY_insert(st, val, i) SKM_sk_insert(STACK_OF_X509_NAME_ENTRY, (st), (val), (i))\n# define sk_STACK_OF_X509_NAME_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STACK_OF_X509_NAME_ENTRY, (st), (cmp))\n# define sk_STACK_OF_X509_NAME_ENTRY_dup(st) SKM_sk_dup(STACK_OF_X509_NAME_ENTRY, st)\n# define sk_STACK_OF_X509_NAME_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(STACK_OF_X509_NAME_ENTRY, (st), (free_func))\n# define sk_STACK_OF_X509_NAME_ENTRY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(STACK_OF_X509_NAME_ENTRY, (st), (copy_func), (free_func))\n# define sk_STACK_OF_X509_NAME_ENTRY_shift(st) SKM_sk_shift(STACK_OF_X509_NAME_ENTRY, (st))\n# define sk_STACK_OF_X509_NAME_ENTRY_pop(st) SKM_sk_pop(STACK_OF_X509_NAME_ENTRY, (st))\n# define sk_STACK_OF_X509_NAME_ENTRY_sort(st) SKM_sk_sort(STACK_OF_X509_NAME_ENTRY, (st))\n# define sk_STACK_OF_X509_NAME_ENTRY_is_sorted(st) SKM_sk_is_sorted(STACK_OF_X509_NAME_ENTRY, (st))\n# define sk_STORE_ATTR_INFO_new(cmp) SKM_sk_new(STORE_ATTR_INFO, (cmp))\n# define sk_STORE_ATTR_INFO_new_null() SKM_sk_new_null(STORE_ATTR_INFO)\n# define sk_STORE_ATTR_INFO_free(st) SKM_sk_free(STORE_ATTR_INFO, (st))\n# define sk_STORE_ATTR_INFO_num(st) SKM_sk_num(STORE_ATTR_INFO, (st))\n# define sk_STORE_ATTR_INFO_value(st, i) SKM_sk_value(STORE_ATTR_INFO, (st), (i))\n# define sk_STORE_ATTR_INFO_set(st, i, val) SKM_sk_set(STORE_ATTR_INFO, (st), (i), (val))\n# define sk_STORE_ATTR_INFO_zero(st) SKM_sk_zero(STORE_ATTR_INFO, (st))\n# define sk_STORE_ATTR_INFO_push(st, val) SKM_sk_push(STORE_ATTR_INFO, (st), (val))\n# define sk_STORE_ATTR_INFO_unshift(st, val) SKM_sk_unshift(STORE_ATTR_INFO, (st), (val))\n# define sk_STORE_ATTR_INFO_find(st, val) SKM_sk_find(STORE_ATTR_INFO, (st), (val))\n# define sk_STORE_ATTR_INFO_find_ex(st, val) SKM_sk_find_ex(STORE_ATTR_INFO, (st), (val))\n# define sk_STORE_ATTR_INFO_delete(st, i) SKM_sk_delete(STORE_ATTR_INFO, (st), (i))\n# define sk_STORE_ATTR_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(STORE_ATTR_INFO, (st), (ptr))\n# define sk_STORE_ATTR_INFO_insert(st, val, i) SKM_sk_insert(STORE_ATTR_INFO, (st), (val), (i))\n# define sk_STORE_ATTR_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STORE_ATTR_INFO, (st), (cmp))\n# define sk_STORE_ATTR_INFO_dup(st) SKM_sk_dup(STORE_ATTR_INFO, st)\n# define sk_STORE_ATTR_INFO_pop_free(st, free_func) SKM_sk_pop_free(STORE_ATTR_INFO, (st), (free_func))\n# define sk_STORE_ATTR_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(STORE_ATTR_INFO, (st), (copy_func), (free_func))\n# define sk_STORE_ATTR_INFO_shift(st) SKM_sk_shift(STORE_ATTR_INFO, (st))\n# define sk_STORE_ATTR_INFO_pop(st) SKM_sk_pop(STORE_ATTR_INFO, (st))\n# define sk_STORE_ATTR_INFO_sort(st) SKM_sk_sort(STORE_ATTR_INFO, (st))\n# define sk_STORE_ATTR_INFO_is_sorted(st) SKM_sk_is_sorted(STORE_ATTR_INFO, (st))\n# define sk_STORE_OBJECT_new(cmp) SKM_sk_new(STORE_OBJECT, (cmp))\n# define sk_STORE_OBJECT_new_null() SKM_sk_new_null(STORE_OBJECT)\n# define sk_STORE_OBJECT_free(st) SKM_sk_free(STORE_OBJECT, (st))\n# define sk_STORE_OBJECT_num(st) SKM_sk_num(STORE_OBJECT, (st))\n# define sk_STORE_OBJECT_value(st, i) SKM_sk_value(STORE_OBJECT, (st), (i))\n# define sk_STORE_OBJECT_set(st, i, val) SKM_sk_set(STORE_OBJECT, (st), (i), (val))\n# define sk_STORE_OBJECT_zero(st) SKM_sk_zero(STORE_OBJECT, (st))\n# define sk_STORE_OBJECT_push(st, val) SKM_sk_push(STORE_OBJECT, (st), (val))\n# define sk_STORE_OBJECT_unshift(st, val) SKM_sk_unshift(STORE_OBJECT, (st), (val))\n# define sk_STORE_OBJECT_find(st, val) SKM_sk_find(STORE_OBJECT, (st), (val))\n# define sk_STORE_OBJECT_find_ex(st, val) SKM_sk_find_ex(STORE_OBJECT, (st), (val))\n# define sk_STORE_OBJECT_delete(st, i) SKM_sk_delete(STORE_OBJECT, (st), (i))\n# define sk_STORE_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(STORE_OBJECT, (st), (ptr))\n# define sk_STORE_OBJECT_insert(st, val, i) SKM_sk_insert(STORE_OBJECT, (st), (val), (i))\n# define sk_STORE_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(STORE_OBJECT, (st), (cmp))\n# define sk_STORE_OBJECT_dup(st) SKM_sk_dup(STORE_OBJECT, st)\n# define sk_STORE_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(STORE_OBJECT, (st), (free_func))\n# define sk_STORE_OBJECT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(STORE_OBJECT, (st), (copy_func), (free_func))\n# define sk_STORE_OBJECT_shift(st) SKM_sk_shift(STORE_OBJECT, (st))\n# define sk_STORE_OBJECT_pop(st) SKM_sk_pop(STORE_OBJECT, (st))\n# define sk_STORE_OBJECT_sort(st) SKM_sk_sort(STORE_OBJECT, (st))\n# define sk_STORE_OBJECT_is_sorted(st) SKM_sk_is_sorted(STORE_OBJECT, (st))\n# define sk_SXNETID_new(cmp) SKM_sk_new(SXNETID, (cmp))\n# define sk_SXNETID_new_null() SKM_sk_new_null(SXNETID)\n# define sk_SXNETID_free(st) SKM_sk_free(SXNETID, (st))\n# define sk_SXNETID_num(st) SKM_sk_num(SXNETID, (st))\n# define sk_SXNETID_value(st, i) SKM_sk_value(SXNETID, (st), (i))\n# define sk_SXNETID_set(st, i, val) SKM_sk_set(SXNETID, (st), (i), (val))\n# define sk_SXNETID_zero(st) SKM_sk_zero(SXNETID, (st))\n# define sk_SXNETID_push(st, val) SKM_sk_push(SXNETID, (st), (val))\n# define sk_SXNETID_unshift(st, val) SKM_sk_unshift(SXNETID, (st), (val))\n# define sk_SXNETID_find(st, val) SKM_sk_find(SXNETID, (st), (val))\n# define sk_SXNETID_find_ex(st, val) SKM_sk_find_ex(SXNETID, (st), (val))\n# define sk_SXNETID_delete(st, i) SKM_sk_delete(SXNETID, (st), (i))\n# define sk_SXNETID_delete_ptr(st, ptr) SKM_sk_delete_ptr(SXNETID, (st), (ptr))\n# define sk_SXNETID_insert(st, val, i) SKM_sk_insert(SXNETID, (st), (val), (i))\n# define sk_SXNETID_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SXNETID, (st), (cmp))\n# define sk_SXNETID_dup(st) SKM_sk_dup(SXNETID, st)\n# define sk_SXNETID_pop_free(st, free_func) SKM_sk_pop_free(SXNETID, (st), (free_func))\n# define sk_SXNETID_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(SXNETID, (st), (copy_func), (free_func))\n# define sk_SXNETID_shift(st) SKM_sk_shift(SXNETID, (st))\n# define sk_SXNETID_pop(st) SKM_sk_pop(SXNETID, (st))\n# define sk_SXNETID_sort(st) SKM_sk_sort(SXNETID, (st))\n# define sk_SXNETID_is_sorted(st) SKM_sk_is_sorted(SXNETID, (st))\n# define sk_UI_STRING_new(cmp) SKM_sk_new(UI_STRING, (cmp))\n# define sk_UI_STRING_new_null() SKM_sk_new_null(UI_STRING)\n# define sk_UI_STRING_free(st) SKM_sk_free(UI_STRING, (st))\n# define sk_UI_STRING_num(st) SKM_sk_num(UI_STRING, (st))\n# define sk_UI_STRING_value(st, i) SKM_sk_value(UI_STRING, (st), (i))\n# define sk_UI_STRING_set(st, i, val) SKM_sk_set(UI_STRING, (st), (i), (val))\n# define sk_UI_STRING_zero(st) SKM_sk_zero(UI_STRING, (st))\n# define sk_UI_STRING_push(st, val) SKM_sk_push(UI_STRING, (st), (val))\n# define sk_UI_STRING_unshift(st, val) SKM_sk_unshift(UI_STRING, (st), (val))\n# define sk_UI_STRING_find(st, val) SKM_sk_find(UI_STRING, (st), (val))\n# define sk_UI_STRING_find_ex(st, val) SKM_sk_find_ex(UI_STRING, (st), (val))\n# define sk_UI_STRING_delete(st, i) SKM_sk_delete(UI_STRING, (st), (i))\n# define sk_UI_STRING_delete_ptr(st, ptr) SKM_sk_delete_ptr(UI_STRING, (st), (ptr))\n# define sk_UI_STRING_insert(st, val, i) SKM_sk_insert(UI_STRING, (st), (val), (i))\n# define sk_UI_STRING_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(UI_STRING, (st), (cmp))\n# define sk_UI_STRING_dup(st) SKM_sk_dup(UI_STRING, st)\n# define sk_UI_STRING_pop_free(st, free_func) SKM_sk_pop_free(UI_STRING, (st), (free_func))\n# define sk_UI_STRING_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(UI_STRING, (st), (copy_func), (free_func))\n# define sk_UI_STRING_shift(st) SKM_sk_shift(UI_STRING, (st))\n# define sk_UI_STRING_pop(st) SKM_sk_pop(UI_STRING, (st))\n# define sk_UI_STRING_sort(st) SKM_sk_sort(UI_STRING, (st))\n# define sk_UI_STRING_is_sorted(st) SKM_sk_is_sorted(UI_STRING, (st))\n# define sk_X509_new(cmp) SKM_sk_new(X509, (cmp))\n# define sk_X509_new_null() SKM_sk_new_null(X509)\n# define sk_X509_free(st) SKM_sk_free(X509, (st))\n# define sk_X509_num(st) SKM_sk_num(X509, (st))\n# define sk_X509_value(st, i) SKM_sk_value(X509, (st), (i))\n# define sk_X509_set(st, i, val) SKM_sk_set(X509, (st), (i), (val))\n# define sk_X509_zero(st) SKM_sk_zero(X509, (st))\n# define sk_X509_push(st, val) SKM_sk_push(X509, (st), (val))\n# define sk_X509_unshift(st, val) SKM_sk_unshift(X509, (st), (val))\n# define sk_X509_find(st, val) SKM_sk_find(X509, (st), (val))\n# define sk_X509_find_ex(st, val) SKM_sk_find_ex(X509, (st), (val))\n# define sk_X509_delete(st, i) SKM_sk_delete(X509, (st), (i))\n# define sk_X509_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509, (st), (ptr))\n# define sk_X509_insert(st, val, i) SKM_sk_insert(X509, (st), (val), (i))\n# define sk_X509_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509, (st), (cmp))\n# define sk_X509_dup(st) SKM_sk_dup(X509, st)\n# define sk_X509_pop_free(st, free_func) SKM_sk_pop_free(X509, (st), (free_func))\n# define sk_X509_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509, (st), (copy_func), (free_func))\n# define sk_X509_shift(st) SKM_sk_shift(X509, (st))\n# define sk_X509_pop(st) SKM_sk_pop(X509, (st))\n# define sk_X509_sort(st) SKM_sk_sort(X509, (st))\n# define sk_X509_is_sorted(st) SKM_sk_is_sorted(X509, (st))\n# define sk_X509V3_EXT_METHOD_new(cmp) SKM_sk_new(X509V3_EXT_METHOD, (cmp))\n# define sk_X509V3_EXT_METHOD_new_null() SKM_sk_new_null(X509V3_EXT_METHOD)\n# define sk_X509V3_EXT_METHOD_free(st) SKM_sk_free(X509V3_EXT_METHOD, (st))\n# define sk_X509V3_EXT_METHOD_num(st) SKM_sk_num(X509V3_EXT_METHOD, (st))\n# define sk_X509V3_EXT_METHOD_value(st, i) SKM_sk_value(X509V3_EXT_METHOD, (st), (i))\n# define sk_X509V3_EXT_METHOD_set(st, i, val) SKM_sk_set(X509V3_EXT_METHOD, (st), (i), (val))\n# define sk_X509V3_EXT_METHOD_zero(st) SKM_sk_zero(X509V3_EXT_METHOD, (st))\n# define sk_X509V3_EXT_METHOD_push(st, val) SKM_sk_push(X509V3_EXT_METHOD, (st), (val))\n# define sk_X509V3_EXT_METHOD_unshift(st, val) SKM_sk_unshift(X509V3_EXT_METHOD, (st), (val))\n# define sk_X509V3_EXT_METHOD_find(st, val) SKM_sk_find(X509V3_EXT_METHOD, (st), (val))\n# define sk_X509V3_EXT_METHOD_find_ex(st, val) SKM_sk_find_ex(X509V3_EXT_METHOD, (st), (val))\n# define sk_X509V3_EXT_METHOD_delete(st, i) SKM_sk_delete(X509V3_EXT_METHOD, (st), (i))\n# define sk_X509V3_EXT_METHOD_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509V3_EXT_METHOD, (st), (ptr))\n# define sk_X509V3_EXT_METHOD_insert(st, val, i) SKM_sk_insert(X509V3_EXT_METHOD, (st), (val), (i))\n# define sk_X509V3_EXT_METHOD_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509V3_EXT_METHOD, (st), (cmp))\n# define sk_X509V3_EXT_METHOD_dup(st) SKM_sk_dup(X509V3_EXT_METHOD, st)\n# define sk_X509V3_EXT_METHOD_pop_free(st, free_func) SKM_sk_pop_free(X509V3_EXT_METHOD, (st), (free_func))\n# define sk_X509V3_EXT_METHOD_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509V3_EXT_METHOD, (st), (copy_func), (free_func))\n# define sk_X509V3_EXT_METHOD_shift(st) SKM_sk_shift(X509V3_EXT_METHOD, (st))\n# define sk_X509V3_EXT_METHOD_pop(st) SKM_sk_pop(X509V3_EXT_METHOD, (st))\n# define sk_X509V3_EXT_METHOD_sort(st) SKM_sk_sort(X509V3_EXT_METHOD, (st))\n# define sk_X509V3_EXT_METHOD_is_sorted(st) SKM_sk_is_sorted(X509V3_EXT_METHOD, (st))\n# define sk_X509_ALGOR_new(cmp) SKM_sk_new(X509_ALGOR, (cmp))\n# define sk_X509_ALGOR_new_null() SKM_sk_new_null(X509_ALGOR)\n# define sk_X509_ALGOR_free(st) SKM_sk_free(X509_ALGOR, (st))\n# define sk_X509_ALGOR_num(st) SKM_sk_num(X509_ALGOR, (st))\n# define sk_X509_ALGOR_value(st, i) SKM_sk_value(X509_ALGOR, (st), (i))\n# define sk_X509_ALGOR_set(st, i, val) SKM_sk_set(X509_ALGOR, (st), (i), (val))\n# define sk_X509_ALGOR_zero(st) SKM_sk_zero(X509_ALGOR, (st))\n# define sk_X509_ALGOR_push(st, val) SKM_sk_push(X509_ALGOR, (st), (val))\n# define sk_X509_ALGOR_unshift(st, val) SKM_sk_unshift(X509_ALGOR, (st), (val))\n# define sk_X509_ALGOR_find(st, val) SKM_sk_find(X509_ALGOR, (st), (val))\n# define sk_X509_ALGOR_find_ex(st, val) SKM_sk_find_ex(X509_ALGOR, (st), (val))\n# define sk_X509_ALGOR_delete(st, i) SKM_sk_delete(X509_ALGOR, (st), (i))\n# define sk_X509_ALGOR_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ALGOR, (st), (ptr))\n# define sk_X509_ALGOR_insert(st, val, i) SKM_sk_insert(X509_ALGOR, (st), (val), (i))\n# define sk_X509_ALGOR_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ALGOR, (st), (cmp))\n# define sk_X509_ALGOR_dup(st) SKM_sk_dup(X509_ALGOR, st)\n# define sk_X509_ALGOR_pop_free(st, free_func) SKM_sk_pop_free(X509_ALGOR, (st), (free_func))\n# define sk_X509_ALGOR_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_ALGOR, (st), (copy_func), (free_func))\n# define sk_X509_ALGOR_shift(st) SKM_sk_shift(X509_ALGOR, (st))\n# define sk_X509_ALGOR_pop(st) SKM_sk_pop(X509_ALGOR, (st))\n# define sk_X509_ALGOR_sort(st) SKM_sk_sort(X509_ALGOR, (st))\n# define sk_X509_ALGOR_is_sorted(st) SKM_sk_is_sorted(X509_ALGOR, (st))\n# define sk_X509_ATTRIBUTE_new(cmp) SKM_sk_new(X509_ATTRIBUTE, (cmp))\n# define sk_X509_ATTRIBUTE_new_null() SKM_sk_new_null(X509_ATTRIBUTE)\n# define sk_X509_ATTRIBUTE_free(st) SKM_sk_free(X509_ATTRIBUTE, (st))\n# define sk_X509_ATTRIBUTE_num(st) SKM_sk_num(X509_ATTRIBUTE, (st))\n# define sk_X509_ATTRIBUTE_value(st, i) SKM_sk_value(X509_ATTRIBUTE, (st), (i))\n# define sk_X509_ATTRIBUTE_set(st, i, val) SKM_sk_set(X509_ATTRIBUTE, (st), (i), (val))\n# define sk_X509_ATTRIBUTE_zero(st) SKM_sk_zero(X509_ATTRIBUTE, (st))\n# define sk_X509_ATTRIBUTE_push(st, val) SKM_sk_push(X509_ATTRIBUTE, (st), (val))\n# define sk_X509_ATTRIBUTE_unshift(st, val) SKM_sk_unshift(X509_ATTRIBUTE, (st), (val))\n# define sk_X509_ATTRIBUTE_find(st, val) SKM_sk_find(X509_ATTRIBUTE, (st), (val))\n# define sk_X509_ATTRIBUTE_find_ex(st, val) SKM_sk_find_ex(X509_ATTRIBUTE, (st), (val))\n# define sk_X509_ATTRIBUTE_delete(st, i) SKM_sk_delete(X509_ATTRIBUTE, (st), (i))\n# define sk_X509_ATTRIBUTE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_ATTRIBUTE, (st), (ptr))\n# define sk_X509_ATTRIBUTE_insert(st, val, i) SKM_sk_insert(X509_ATTRIBUTE, (st), (val), (i))\n# define sk_X509_ATTRIBUTE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_ATTRIBUTE, (st), (cmp))\n# define sk_X509_ATTRIBUTE_dup(st) SKM_sk_dup(X509_ATTRIBUTE, st)\n# define sk_X509_ATTRIBUTE_pop_free(st, free_func) SKM_sk_pop_free(X509_ATTRIBUTE, (st), (free_func))\n# define sk_X509_ATTRIBUTE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_ATTRIBUTE, (st), (copy_func), (free_func))\n# define sk_X509_ATTRIBUTE_shift(st) SKM_sk_shift(X509_ATTRIBUTE, (st))\n# define sk_X509_ATTRIBUTE_pop(st) SKM_sk_pop(X509_ATTRIBUTE, (st))\n# define sk_X509_ATTRIBUTE_sort(st) SKM_sk_sort(X509_ATTRIBUTE, (st))\n# define sk_X509_ATTRIBUTE_is_sorted(st) SKM_sk_is_sorted(X509_ATTRIBUTE, (st))\n# define sk_X509_CRL_new(cmp) SKM_sk_new(X509_CRL, (cmp))\n# define sk_X509_CRL_new_null() SKM_sk_new_null(X509_CRL)\n# define sk_X509_CRL_free(st) SKM_sk_free(X509_CRL, (st))\n# define sk_X509_CRL_num(st) SKM_sk_num(X509_CRL, (st))\n# define sk_X509_CRL_value(st, i) SKM_sk_value(X509_CRL, (st), (i))\n# define sk_X509_CRL_set(st, i, val) SKM_sk_set(X509_CRL, (st), (i), (val))\n# define sk_X509_CRL_zero(st) SKM_sk_zero(X509_CRL, (st))\n# define sk_X509_CRL_push(st, val) SKM_sk_push(X509_CRL, (st), (val))\n# define sk_X509_CRL_unshift(st, val) SKM_sk_unshift(X509_CRL, (st), (val))\n# define sk_X509_CRL_find(st, val) SKM_sk_find(X509_CRL, (st), (val))\n# define sk_X509_CRL_find_ex(st, val) SKM_sk_find_ex(X509_CRL, (st), (val))\n# define sk_X509_CRL_delete(st, i) SKM_sk_delete(X509_CRL, (st), (i))\n# define sk_X509_CRL_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_CRL, (st), (ptr))\n# define sk_X509_CRL_insert(st, val, i) SKM_sk_insert(X509_CRL, (st), (val), (i))\n# define sk_X509_CRL_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_CRL, (st), (cmp))\n# define sk_X509_CRL_dup(st) SKM_sk_dup(X509_CRL, st)\n# define sk_X509_CRL_pop_free(st, free_func) SKM_sk_pop_free(X509_CRL, (st), (free_func))\n# define sk_X509_CRL_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_CRL, (st), (copy_func), (free_func))\n# define sk_X509_CRL_shift(st) SKM_sk_shift(X509_CRL, (st))\n# define sk_X509_CRL_pop(st) SKM_sk_pop(X509_CRL, (st))\n# define sk_X509_CRL_sort(st) SKM_sk_sort(X509_CRL, (st))\n# define sk_X509_CRL_is_sorted(st) SKM_sk_is_sorted(X509_CRL, (st))\n# define sk_X509_EXTENSION_new(cmp) SKM_sk_new(X509_EXTENSION, (cmp))\n# define sk_X509_EXTENSION_new_null() SKM_sk_new_null(X509_EXTENSION)\n# define sk_X509_EXTENSION_free(st) SKM_sk_free(X509_EXTENSION, (st))\n# define sk_X509_EXTENSION_num(st) SKM_sk_num(X509_EXTENSION, (st))\n# define sk_X509_EXTENSION_value(st, i) SKM_sk_value(X509_EXTENSION, (st), (i))\n# define sk_X509_EXTENSION_set(st, i, val) SKM_sk_set(X509_EXTENSION, (st), (i), (val))\n# define sk_X509_EXTENSION_zero(st) SKM_sk_zero(X509_EXTENSION, (st))\n# define sk_X509_EXTENSION_push(st, val) SKM_sk_push(X509_EXTENSION, (st), (val))\n# define sk_X509_EXTENSION_unshift(st, val) SKM_sk_unshift(X509_EXTENSION, (st), (val))\n# define sk_X509_EXTENSION_find(st, val) SKM_sk_find(X509_EXTENSION, (st), (val))\n# define sk_X509_EXTENSION_find_ex(st, val) SKM_sk_find_ex(X509_EXTENSION, (st), (val))\n# define sk_X509_EXTENSION_delete(st, i) SKM_sk_delete(X509_EXTENSION, (st), (i))\n# define sk_X509_EXTENSION_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_EXTENSION, (st), (ptr))\n# define sk_X509_EXTENSION_insert(st, val, i) SKM_sk_insert(X509_EXTENSION, (st), (val), (i))\n# define sk_X509_EXTENSION_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_EXTENSION, (st), (cmp))\n# define sk_X509_EXTENSION_dup(st) SKM_sk_dup(X509_EXTENSION, st)\n# define sk_X509_EXTENSION_pop_free(st, free_func) SKM_sk_pop_free(X509_EXTENSION, (st), (free_func))\n# define sk_X509_EXTENSION_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_EXTENSION, (st), (copy_func), (free_func))\n# define sk_X509_EXTENSION_shift(st) SKM_sk_shift(X509_EXTENSION, (st))\n# define sk_X509_EXTENSION_pop(st) SKM_sk_pop(X509_EXTENSION, (st))\n# define sk_X509_EXTENSION_sort(st) SKM_sk_sort(X509_EXTENSION, (st))\n# define sk_X509_EXTENSION_is_sorted(st) SKM_sk_is_sorted(X509_EXTENSION, (st))\n# define sk_X509_INFO_new(cmp) SKM_sk_new(X509_INFO, (cmp))\n# define sk_X509_INFO_new_null() SKM_sk_new_null(X509_INFO)\n# define sk_X509_INFO_free(st) SKM_sk_free(X509_INFO, (st))\n# define sk_X509_INFO_num(st) SKM_sk_num(X509_INFO, (st))\n# define sk_X509_INFO_value(st, i) SKM_sk_value(X509_INFO, (st), (i))\n# define sk_X509_INFO_set(st, i, val) SKM_sk_set(X509_INFO, (st), (i), (val))\n# define sk_X509_INFO_zero(st) SKM_sk_zero(X509_INFO, (st))\n# define sk_X509_INFO_push(st, val) SKM_sk_push(X509_INFO, (st), (val))\n# define sk_X509_INFO_unshift(st, val) SKM_sk_unshift(X509_INFO, (st), (val))\n# define sk_X509_INFO_find(st, val) SKM_sk_find(X509_INFO, (st), (val))\n# define sk_X509_INFO_find_ex(st, val) SKM_sk_find_ex(X509_INFO, (st), (val))\n# define sk_X509_INFO_delete(st, i) SKM_sk_delete(X509_INFO, (st), (i))\n# define sk_X509_INFO_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_INFO, (st), (ptr))\n# define sk_X509_INFO_insert(st, val, i) SKM_sk_insert(X509_INFO, (st), (val), (i))\n# define sk_X509_INFO_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_INFO, (st), (cmp))\n# define sk_X509_INFO_dup(st) SKM_sk_dup(X509_INFO, st)\n# define sk_X509_INFO_pop_free(st, free_func) SKM_sk_pop_free(X509_INFO, (st), (free_func))\n# define sk_X509_INFO_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_INFO, (st), (copy_func), (free_func))\n# define sk_X509_INFO_shift(st) SKM_sk_shift(X509_INFO, (st))\n# define sk_X509_INFO_pop(st) SKM_sk_pop(X509_INFO, (st))\n# define sk_X509_INFO_sort(st) SKM_sk_sort(X509_INFO, (st))\n# define sk_X509_INFO_is_sorted(st) SKM_sk_is_sorted(X509_INFO, (st))\n# define sk_X509_LOOKUP_new(cmp) SKM_sk_new(X509_LOOKUP, (cmp))\n# define sk_X509_LOOKUP_new_null() SKM_sk_new_null(X509_LOOKUP)\n# define sk_X509_LOOKUP_free(st) SKM_sk_free(X509_LOOKUP, (st))\n# define sk_X509_LOOKUP_num(st) SKM_sk_num(X509_LOOKUP, (st))\n# define sk_X509_LOOKUP_value(st, i) SKM_sk_value(X509_LOOKUP, (st), (i))\n# define sk_X509_LOOKUP_set(st, i, val) SKM_sk_set(X509_LOOKUP, (st), (i), (val))\n# define sk_X509_LOOKUP_zero(st) SKM_sk_zero(X509_LOOKUP, (st))\n# define sk_X509_LOOKUP_push(st, val) SKM_sk_push(X509_LOOKUP, (st), (val))\n# define sk_X509_LOOKUP_unshift(st, val) SKM_sk_unshift(X509_LOOKUP, (st), (val))\n# define sk_X509_LOOKUP_find(st, val) SKM_sk_find(X509_LOOKUP, (st), (val))\n# define sk_X509_LOOKUP_find_ex(st, val) SKM_sk_find_ex(X509_LOOKUP, (st), (val))\n# define sk_X509_LOOKUP_delete(st, i) SKM_sk_delete(X509_LOOKUP, (st), (i))\n# define sk_X509_LOOKUP_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_LOOKUP, (st), (ptr))\n# define sk_X509_LOOKUP_insert(st, val, i) SKM_sk_insert(X509_LOOKUP, (st), (val), (i))\n# define sk_X509_LOOKUP_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_LOOKUP, (st), (cmp))\n# define sk_X509_LOOKUP_dup(st) SKM_sk_dup(X509_LOOKUP, st)\n# define sk_X509_LOOKUP_pop_free(st, free_func) SKM_sk_pop_free(X509_LOOKUP, (st), (free_func))\n# define sk_X509_LOOKUP_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_LOOKUP, (st), (copy_func), (free_func))\n# define sk_X509_LOOKUP_shift(st) SKM_sk_shift(X509_LOOKUP, (st))\n# define sk_X509_LOOKUP_pop(st) SKM_sk_pop(X509_LOOKUP, (st))\n# define sk_X509_LOOKUP_sort(st) SKM_sk_sort(X509_LOOKUP, (st))\n# define sk_X509_LOOKUP_is_sorted(st) SKM_sk_is_sorted(X509_LOOKUP, (st))\n# define sk_X509_NAME_new(cmp) SKM_sk_new(X509_NAME, (cmp))\n# define sk_X509_NAME_new_null() SKM_sk_new_null(X509_NAME)\n# define sk_X509_NAME_free(st) SKM_sk_free(X509_NAME, (st))\n# define sk_X509_NAME_num(st) SKM_sk_num(X509_NAME, (st))\n# define sk_X509_NAME_value(st, i) SKM_sk_value(X509_NAME, (st), (i))\n# define sk_X509_NAME_set(st, i, val) SKM_sk_set(X509_NAME, (st), (i), (val))\n# define sk_X509_NAME_zero(st) SKM_sk_zero(X509_NAME, (st))\n# define sk_X509_NAME_push(st, val) SKM_sk_push(X509_NAME, (st), (val))\n# define sk_X509_NAME_unshift(st, val) SKM_sk_unshift(X509_NAME, (st), (val))\n# define sk_X509_NAME_find(st, val) SKM_sk_find(X509_NAME, (st), (val))\n# define sk_X509_NAME_find_ex(st, val) SKM_sk_find_ex(X509_NAME, (st), (val))\n# define sk_X509_NAME_delete(st, i) SKM_sk_delete(X509_NAME, (st), (i))\n# define sk_X509_NAME_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME, (st), (ptr))\n# define sk_X509_NAME_insert(st, val, i) SKM_sk_insert(X509_NAME, (st), (val), (i))\n# define sk_X509_NAME_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME, (st), (cmp))\n# define sk_X509_NAME_dup(st) SKM_sk_dup(X509_NAME, st)\n# define sk_X509_NAME_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME, (st), (free_func))\n# define sk_X509_NAME_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_NAME, (st), (copy_func), (free_func))\n# define sk_X509_NAME_shift(st) SKM_sk_shift(X509_NAME, (st))\n# define sk_X509_NAME_pop(st) SKM_sk_pop(X509_NAME, (st))\n# define sk_X509_NAME_sort(st) SKM_sk_sort(X509_NAME, (st))\n# define sk_X509_NAME_is_sorted(st) SKM_sk_is_sorted(X509_NAME, (st))\n# define sk_X509_NAME_ENTRY_new(cmp) SKM_sk_new(X509_NAME_ENTRY, (cmp))\n# define sk_X509_NAME_ENTRY_new_null() SKM_sk_new_null(X509_NAME_ENTRY)\n# define sk_X509_NAME_ENTRY_free(st) SKM_sk_free(X509_NAME_ENTRY, (st))\n# define sk_X509_NAME_ENTRY_num(st) SKM_sk_num(X509_NAME_ENTRY, (st))\n# define sk_X509_NAME_ENTRY_value(st, i) SKM_sk_value(X509_NAME_ENTRY, (st), (i))\n# define sk_X509_NAME_ENTRY_set(st, i, val) SKM_sk_set(X509_NAME_ENTRY, (st), (i), (val))\n# define sk_X509_NAME_ENTRY_zero(st) SKM_sk_zero(X509_NAME_ENTRY, (st))\n# define sk_X509_NAME_ENTRY_push(st, val) SKM_sk_push(X509_NAME_ENTRY, (st), (val))\n# define sk_X509_NAME_ENTRY_unshift(st, val) SKM_sk_unshift(X509_NAME_ENTRY, (st), (val))\n# define sk_X509_NAME_ENTRY_find(st, val) SKM_sk_find(X509_NAME_ENTRY, (st), (val))\n# define sk_X509_NAME_ENTRY_find_ex(st, val) SKM_sk_find_ex(X509_NAME_ENTRY, (st), (val))\n# define sk_X509_NAME_ENTRY_delete(st, i) SKM_sk_delete(X509_NAME_ENTRY, (st), (i))\n# define sk_X509_NAME_ENTRY_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_NAME_ENTRY, (st), (ptr))\n# define sk_X509_NAME_ENTRY_insert(st, val, i) SKM_sk_insert(X509_NAME_ENTRY, (st), (val), (i))\n# define sk_X509_NAME_ENTRY_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_NAME_ENTRY, (st), (cmp))\n# define sk_X509_NAME_ENTRY_dup(st) SKM_sk_dup(X509_NAME_ENTRY, st)\n# define sk_X509_NAME_ENTRY_pop_free(st, free_func) SKM_sk_pop_free(X509_NAME_ENTRY, (st), (free_func))\n# define sk_X509_NAME_ENTRY_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_NAME_ENTRY, (st), (copy_func), (free_func))\n# define sk_X509_NAME_ENTRY_shift(st) SKM_sk_shift(X509_NAME_ENTRY, (st))\n# define sk_X509_NAME_ENTRY_pop(st) SKM_sk_pop(X509_NAME_ENTRY, (st))\n# define sk_X509_NAME_ENTRY_sort(st) SKM_sk_sort(X509_NAME_ENTRY, (st))\n# define sk_X509_NAME_ENTRY_is_sorted(st) SKM_sk_is_sorted(X509_NAME_ENTRY, (st))\n# define sk_X509_OBJECT_new(cmp) SKM_sk_new(X509_OBJECT, (cmp))\n# define sk_X509_OBJECT_new_null() SKM_sk_new_null(X509_OBJECT)\n# define sk_X509_OBJECT_free(st) SKM_sk_free(X509_OBJECT, (st))\n# define sk_X509_OBJECT_num(st) SKM_sk_num(X509_OBJECT, (st))\n# define sk_X509_OBJECT_value(st, i) SKM_sk_value(X509_OBJECT, (st), (i))\n# define sk_X509_OBJECT_set(st, i, val) SKM_sk_set(X509_OBJECT, (st), (i), (val))\n# define sk_X509_OBJECT_zero(st) SKM_sk_zero(X509_OBJECT, (st))\n# define sk_X509_OBJECT_push(st, val) SKM_sk_push(X509_OBJECT, (st), (val))\n# define sk_X509_OBJECT_unshift(st, val) SKM_sk_unshift(X509_OBJECT, (st), (val))\n# define sk_X509_OBJECT_find(st, val) SKM_sk_find(X509_OBJECT, (st), (val))\n# define sk_X509_OBJECT_find_ex(st, val) SKM_sk_find_ex(X509_OBJECT, (st), (val))\n# define sk_X509_OBJECT_delete(st, i) SKM_sk_delete(X509_OBJECT, (st), (i))\n# define sk_X509_OBJECT_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_OBJECT, (st), (ptr))\n# define sk_X509_OBJECT_insert(st, val, i) SKM_sk_insert(X509_OBJECT, (st), (val), (i))\n# define sk_X509_OBJECT_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_OBJECT, (st), (cmp))\n# define sk_X509_OBJECT_dup(st) SKM_sk_dup(X509_OBJECT, st)\n# define sk_X509_OBJECT_pop_free(st, free_func) SKM_sk_pop_free(X509_OBJECT, (st), (free_func))\n# define sk_X509_OBJECT_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_OBJECT, (st), (copy_func), (free_func))\n# define sk_X509_OBJECT_shift(st) SKM_sk_shift(X509_OBJECT, (st))\n# define sk_X509_OBJECT_pop(st) SKM_sk_pop(X509_OBJECT, (st))\n# define sk_X509_OBJECT_sort(st) SKM_sk_sort(X509_OBJECT, (st))\n# define sk_X509_OBJECT_is_sorted(st) SKM_sk_is_sorted(X509_OBJECT, (st))\n# define sk_X509_POLICY_DATA_new(cmp) SKM_sk_new(X509_POLICY_DATA, (cmp))\n# define sk_X509_POLICY_DATA_new_null() SKM_sk_new_null(X509_POLICY_DATA)\n# define sk_X509_POLICY_DATA_free(st) SKM_sk_free(X509_POLICY_DATA, (st))\n# define sk_X509_POLICY_DATA_num(st) SKM_sk_num(X509_POLICY_DATA, (st))\n# define sk_X509_POLICY_DATA_value(st, i) SKM_sk_value(X509_POLICY_DATA, (st), (i))\n# define sk_X509_POLICY_DATA_set(st, i, val) SKM_sk_set(X509_POLICY_DATA, (st), (i), (val))\n# define sk_X509_POLICY_DATA_zero(st) SKM_sk_zero(X509_POLICY_DATA, (st))\n# define sk_X509_POLICY_DATA_push(st, val) SKM_sk_push(X509_POLICY_DATA, (st), (val))\n# define sk_X509_POLICY_DATA_unshift(st, val) SKM_sk_unshift(X509_POLICY_DATA, (st), (val))\n# define sk_X509_POLICY_DATA_find(st, val) SKM_sk_find(X509_POLICY_DATA, (st), (val))\n# define sk_X509_POLICY_DATA_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_DATA, (st), (val))\n# define sk_X509_POLICY_DATA_delete(st, i) SKM_sk_delete(X509_POLICY_DATA, (st), (i))\n# define sk_X509_POLICY_DATA_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_DATA, (st), (ptr))\n# define sk_X509_POLICY_DATA_insert(st, val, i) SKM_sk_insert(X509_POLICY_DATA, (st), (val), (i))\n# define sk_X509_POLICY_DATA_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_DATA, (st), (cmp))\n# define sk_X509_POLICY_DATA_dup(st) SKM_sk_dup(X509_POLICY_DATA, st)\n# define sk_X509_POLICY_DATA_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_DATA, (st), (free_func))\n# define sk_X509_POLICY_DATA_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_POLICY_DATA, (st), (copy_func), (free_func))\n# define sk_X509_POLICY_DATA_shift(st) SKM_sk_shift(X509_POLICY_DATA, (st))\n# define sk_X509_POLICY_DATA_pop(st) SKM_sk_pop(X509_POLICY_DATA, (st))\n# define sk_X509_POLICY_DATA_sort(st) SKM_sk_sort(X509_POLICY_DATA, (st))\n# define sk_X509_POLICY_DATA_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_DATA, (st))\n# define sk_X509_POLICY_NODE_new(cmp) SKM_sk_new(X509_POLICY_NODE, (cmp))\n# define sk_X509_POLICY_NODE_new_null() SKM_sk_new_null(X509_POLICY_NODE)\n# define sk_X509_POLICY_NODE_free(st) SKM_sk_free(X509_POLICY_NODE, (st))\n# define sk_X509_POLICY_NODE_num(st) SKM_sk_num(X509_POLICY_NODE, (st))\n# define sk_X509_POLICY_NODE_value(st, i) SKM_sk_value(X509_POLICY_NODE, (st), (i))\n# define sk_X509_POLICY_NODE_set(st, i, val) SKM_sk_set(X509_POLICY_NODE, (st), (i), (val))\n# define sk_X509_POLICY_NODE_zero(st) SKM_sk_zero(X509_POLICY_NODE, (st))\n# define sk_X509_POLICY_NODE_push(st, val) SKM_sk_push(X509_POLICY_NODE, (st), (val))\n# define sk_X509_POLICY_NODE_unshift(st, val) SKM_sk_unshift(X509_POLICY_NODE, (st), (val))\n# define sk_X509_POLICY_NODE_find(st, val) SKM_sk_find(X509_POLICY_NODE, (st), (val))\n# define sk_X509_POLICY_NODE_find_ex(st, val) SKM_sk_find_ex(X509_POLICY_NODE, (st), (val))\n# define sk_X509_POLICY_NODE_delete(st, i) SKM_sk_delete(X509_POLICY_NODE, (st), (i))\n# define sk_X509_POLICY_NODE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_POLICY_NODE, (st), (ptr))\n# define sk_X509_POLICY_NODE_insert(st, val, i) SKM_sk_insert(X509_POLICY_NODE, (st), (val), (i))\n# define sk_X509_POLICY_NODE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_POLICY_NODE, (st), (cmp))\n# define sk_X509_POLICY_NODE_dup(st) SKM_sk_dup(X509_POLICY_NODE, st)\n# define sk_X509_POLICY_NODE_pop_free(st, free_func) SKM_sk_pop_free(X509_POLICY_NODE, (st), (free_func))\n# define sk_X509_POLICY_NODE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_POLICY_NODE, (st), (copy_func), (free_func))\n# define sk_X509_POLICY_NODE_shift(st) SKM_sk_shift(X509_POLICY_NODE, (st))\n# define sk_X509_POLICY_NODE_pop(st) SKM_sk_pop(X509_POLICY_NODE, (st))\n# define sk_X509_POLICY_NODE_sort(st) SKM_sk_sort(X509_POLICY_NODE, (st))\n# define sk_X509_POLICY_NODE_is_sorted(st) SKM_sk_is_sorted(X509_POLICY_NODE, (st))\n# define sk_X509_PURPOSE_new(cmp) SKM_sk_new(X509_PURPOSE, (cmp))\n# define sk_X509_PURPOSE_new_null() SKM_sk_new_null(X509_PURPOSE)\n# define sk_X509_PURPOSE_free(st) SKM_sk_free(X509_PURPOSE, (st))\n# define sk_X509_PURPOSE_num(st) SKM_sk_num(X509_PURPOSE, (st))\n# define sk_X509_PURPOSE_value(st, i) SKM_sk_value(X509_PURPOSE, (st), (i))\n# define sk_X509_PURPOSE_set(st, i, val) SKM_sk_set(X509_PURPOSE, (st), (i), (val))\n# define sk_X509_PURPOSE_zero(st) SKM_sk_zero(X509_PURPOSE, (st))\n# define sk_X509_PURPOSE_push(st, val) SKM_sk_push(X509_PURPOSE, (st), (val))\n# define sk_X509_PURPOSE_unshift(st, val) SKM_sk_unshift(X509_PURPOSE, (st), (val))\n# define sk_X509_PURPOSE_find(st, val) SKM_sk_find(X509_PURPOSE, (st), (val))\n# define sk_X509_PURPOSE_find_ex(st, val) SKM_sk_find_ex(X509_PURPOSE, (st), (val))\n# define sk_X509_PURPOSE_delete(st, i) SKM_sk_delete(X509_PURPOSE, (st), (i))\n# define sk_X509_PURPOSE_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_PURPOSE, (st), (ptr))\n# define sk_X509_PURPOSE_insert(st, val, i) SKM_sk_insert(X509_PURPOSE, (st), (val), (i))\n# define sk_X509_PURPOSE_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_PURPOSE, (st), (cmp))\n# define sk_X509_PURPOSE_dup(st) SKM_sk_dup(X509_PURPOSE, st)\n# define sk_X509_PURPOSE_pop_free(st, free_func) SKM_sk_pop_free(X509_PURPOSE, (st), (free_func))\n# define sk_X509_PURPOSE_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_PURPOSE, (st), (copy_func), (free_func))\n# define sk_X509_PURPOSE_shift(st) SKM_sk_shift(X509_PURPOSE, (st))\n# define sk_X509_PURPOSE_pop(st) SKM_sk_pop(X509_PURPOSE, (st))\n# define sk_X509_PURPOSE_sort(st) SKM_sk_sort(X509_PURPOSE, (st))\n# define sk_X509_PURPOSE_is_sorted(st) SKM_sk_is_sorted(X509_PURPOSE, (st))\n# define sk_X509_REVOKED_new(cmp) SKM_sk_new(X509_REVOKED, (cmp))\n# define sk_X509_REVOKED_new_null() SKM_sk_new_null(X509_REVOKED)\n# define sk_X509_REVOKED_free(st) SKM_sk_free(X509_REVOKED, (st))\n# define sk_X509_REVOKED_num(st) SKM_sk_num(X509_REVOKED, (st))\n# define sk_X509_REVOKED_value(st, i) SKM_sk_value(X509_REVOKED, (st), (i))\n# define sk_X509_REVOKED_set(st, i, val) SKM_sk_set(X509_REVOKED, (st), (i), (val))\n# define sk_X509_REVOKED_zero(st) SKM_sk_zero(X509_REVOKED, (st))\n# define sk_X509_REVOKED_push(st, val) SKM_sk_push(X509_REVOKED, (st), (val))\n# define sk_X509_REVOKED_unshift(st, val) SKM_sk_unshift(X509_REVOKED, (st), (val))\n# define sk_X509_REVOKED_find(st, val) SKM_sk_find(X509_REVOKED, (st), (val))\n# define sk_X509_REVOKED_find_ex(st, val) SKM_sk_find_ex(X509_REVOKED, (st), (val))\n# define sk_X509_REVOKED_delete(st, i) SKM_sk_delete(X509_REVOKED, (st), (i))\n# define sk_X509_REVOKED_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_REVOKED, (st), (ptr))\n# define sk_X509_REVOKED_insert(st, val, i) SKM_sk_insert(X509_REVOKED, (st), (val), (i))\n# define sk_X509_REVOKED_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_REVOKED, (st), (cmp))\n# define sk_X509_REVOKED_dup(st) SKM_sk_dup(X509_REVOKED, st)\n# define sk_X509_REVOKED_pop_free(st, free_func) SKM_sk_pop_free(X509_REVOKED, (st), (free_func))\n# define sk_X509_REVOKED_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_REVOKED, (st), (copy_func), (free_func))\n# define sk_X509_REVOKED_shift(st) SKM_sk_shift(X509_REVOKED, (st))\n# define sk_X509_REVOKED_pop(st) SKM_sk_pop(X509_REVOKED, (st))\n# define sk_X509_REVOKED_sort(st) SKM_sk_sort(X509_REVOKED, (st))\n# define sk_X509_REVOKED_is_sorted(st) SKM_sk_is_sorted(X509_REVOKED, (st))\n# define sk_X509_TRUST_new(cmp) SKM_sk_new(X509_TRUST, (cmp))\n# define sk_X509_TRUST_new_null() SKM_sk_new_null(X509_TRUST)\n# define sk_X509_TRUST_free(st) SKM_sk_free(X509_TRUST, (st))\n# define sk_X509_TRUST_num(st) SKM_sk_num(X509_TRUST, (st))\n# define sk_X509_TRUST_value(st, i) SKM_sk_value(X509_TRUST, (st), (i))\n# define sk_X509_TRUST_set(st, i, val) SKM_sk_set(X509_TRUST, (st), (i), (val))\n# define sk_X509_TRUST_zero(st) SKM_sk_zero(X509_TRUST, (st))\n# define sk_X509_TRUST_push(st, val) SKM_sk_push(X509_TRUST, (st), (val))\n# define sk_X509_TRUST_unshift(st, val) SKM_sk_unshift(X509_TRUST, (st), (val))\n# define sk_X509_TRUST_find(st, val) SKM_sk_find(X509_TRUST, (st), (val))\n# define sk_X509_TRUST_find_ex(st, val) SKM_sk_find_ex(X509_TRUST, (st), (val))\n# define sk_X509_TRUST_delete(st, i) SKM_sk_delete(X509_TRUST, (st), (i))\n# define sk_X509_TRUST_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_TRUST, (st), (ptr))\n# define sk_X509_TRUST_insert(st, val, i) SKM_sk_insert(X509_TRUST, (st), (val), (i))\n# define sk_X509_TRUST_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_TRUST, (st), (cmp))\n# define sk_X509_TRUST_dup(st) SKM_sk_dup(X509_TRUST, st)\n# define sk_X509_TRUST_pop_free(st, free_func) SKM_sk_pop_free(X509_TRUST, (st), (free_func))\n# define sk_X509_TRUST_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_TRUST, (st), (copy_func), (free_func))\n# define sk_X509_TRUST_shift(st) SKM_sk_shift(X509_TRUST, (st))\n# define sk_X509_TRUST_pop(st) SKM_sk_pop(X509_TRUST, (st))\n# define sk_X509_TRUST_sort(st) SKM_sk_sort(X509_TRUST, (st))\n# define sk_X509_TRUST_is_sorted(st) SKM_sk_is_sorted(X509_TRUST, (st))\n# define sk_X509_VERIFY_PARAM_new(cmp) SKM_sk_new(X509_VERIFY_PARAM, (cmp))\n# define sk_X509_VERIFY_PARAM_new_null() SKM_sk_new_null(X509_VERIFY_PARAM)\n# define sk_X509_VERIFY_PARAM_free(st) SKM_sk_free(X509_VERIFY_PARAM, (st))\n# define sk_X509_VERIFY_PARAM_num(st) SKM_sk_num(X509_VERIFY_PARAM, (st))\n# define sk_X509_VERIFY_PARAM_value(st, i) SKM_sk_value(X509_VERIFY_PARAM, (st), (i))\n# define sk_X509_VERIFY_PARAM_set(st, i, val) SKM_sk_set(X509_VERIFY_PARAM, (st), (i), (val))\n# define sk_X509_VERIFY_PARAM_zero(st) SKM_sk_zero(X509_VERIFY_PARAM, (st))\n# define sk_X509_VERIFY_PARAM_push(st, val) SKM_sk_push(X509_VERIFY_PARAM, (st), (val))\n# define sk_X509_VERIFY_PARAM_unshift(st, val) SKM_sk_unshift(X509_VERIFY_PARAM, (st), (val))\n# define sk_X509_VERIFY_PARAM_find(st, val) SKM_sk_find(X509_VERIFY_PARAM, (st), (val))\n# define sk_X509_VERIFY_PARAM_find_ex(st, val) SKM_sk_find_ex(X509_VERIFY_PARAM, (st), (val))\n# define sk_X509_VERIFY_PARAM_delete(st, i) SKM_sk_delete(X509_VERIFY_PARAM, (st), (i))\n# define sk_X509_VERIFY_PARAM_delete_ptr(st, ptr) SKM_sk_delete_ptr(X509_VERIFY_PARAM, (st), (ptr))\n# define sk_X509_VERIFY_PARAM_insert(st, val, i) SKM_sk_insert(X509_VERIFY_PARAM, (st), (val), (i))\n# define sk_X509_VERIFY_PARAM_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(X509_VERIFY_PARAM, (st), (cmp))\n# define sk_X509_VERIFY_PARAM_dup(st) SKM_sk_dup(X509_VERIFY_PARAM, st)\n# define sk_X509_VERIFY_PARAM_pop_free(st, free_func) SKM_sk_pop_free(X509_VERIFY_PARAM, (st), (free_func))\n# define sk_X509_VERIFY_PARAM_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(X509_VERIFY_PARAM, (st), (copy_func), (free_func))\n# define sk_X509_VERIFY_PARAM_shift(st) SKM_sk_shift(X509_VERIFY_PARAM, (st))\n# define sk_X509_VERIFY_PARAM_pop(st) SKM_sk_pop(X509_VERIFY_PARAM, (st))\n# define sk_X509_VERIFY_PARAM_sort(st) SKM_sk_sort(X509_VERIFY_PARAM, (st))\n# define sk_X509_VERIFY_PARAM_is_sorted(st) SKM_sk_is_sorted(X509_VERIFY_PARAM, (st))\n# define sk_nid_triple_new(cmp) SKM_sk_new(nid_triple, (cmp))\n# define sk_nid_triple_new_null() SKM_sk_new_null(nid_triple)\n# define sk_nid_triple_free(st) SKM_sk_free(nid_triple, (st))\n# define sk_nid_triple_num(st) SKM_sk_num(nid_triple, (st))\n# define sk_nid_triple_value(st, i) SKM_sk_value(nid_triple, (st), (i))\n# define sk_nid_triple_set(st, i, val) SKM_sk_set(nid_triple, (st), (i), (val))\n# define sk_nid_triple_zero(st) SKM_sk_zero(nid_triple, (st))\n# define sk_nid_triple_push(st, val) SKM_sk_push(nid_triple, (st), (val))\n# define sk_nid_triple_unshift(st, val) SKM_sk_unshift(nid_triple, (st), (val))\n# define sk_nid_triple_find(st, val) SKM_sk_find(nid_triple, (st), (val))\n# define sk_nid_triple_find_ex(st, val) SKM_sk_find_ex(nid_triple, (st), (val))\n# define sk_nid_triple_delete(st, i) SKM_sk_delete(nid_triple, (st), (i))\n# define sk_nid_triple_delete_ptr(st, ptr) SKM_sk_delete_ptr(nid_triple, (st), (ptr))\n# define sk_nid_triple_insert(st, val, i) SKM_sk_insert(nid_triple, (st), (val), (i))\n# define sk_nid_triple_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(nid_triple, (st), (cmp))\n# define sk_nid_triple_dup(st) SKM_sk_dup(nid_triple, st)\n# define sk_nid_triple_pop_free(st, free_func) SKM_sk_pop_free(nid_triple, (st), (free_func))\n# define sk_nid_triple_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(nid_triple, (st), (copy_func), (free_func))\n# define sk_nid_triple_shift(st) SKM_sk_shift(nid_triple, (st))\n# define sk_nid_triple_pop(st) SKM_sk_pop(nid_triple, (st))\n# define sk_nid_triple_sort(st) SKM_sk_sort(nid_triple, (st))\n# define sk_nid_triple_is_sorted(st) SKM_sk_is_sorted(nid_triple, (st))\n# define sk_void_new(cmp) SKM_sk_new(void, (cmp))\n# define sk_void_new_null() SKM_sk_new_null(void)\n# define sk_void_free(st) SKM_sk_free(void, (st))\n# define sk_void_num(st) SKM_sk_num(void, (st))\n# define sk_void_value(st, i) SKM_sk_value(void, (st), (i))\n# define sk_void_set(st, i, val) SKM_sk_set(void, (st), (i), (val))\n# define sk_void_zero(st) SKM_sk_zero(void, (st))\n# define sk_void_push(st, val) SKM_sk_push(void, (st), (val))\n# define sk_void_unshift(st, val) SKM_sk_unshift(void, (st), (val))\n# define sk_void_find(st, val) SKM_sk_find(void, (st), (val))\n# define sk_void_find_ex(st, val) SKM_sk_find_ex(void, (st), (val))\n# define sk_void_delete(st, i) SKM_sk_delete(void, (st), (i))\n# define sk_void_delete_ptr(st, ptr) SKM_sk_delete_ptr(void, (st), (ptr))\n# define sk_void_insert(st, val, i) SKM_sk_insert(void, (st), (val), (i))\n# define sk_void_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(void, (st), (cmp))\n# define sk_void_dup(st) SKM_sk_dup(void, st)\n# define sk_void_pop_free(st, free_func) SKM_sk_pop_free(void, (st), (free_func))\n# define sk_void_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(void, (st), (copy_func), (free_func))\n# define sk_void_shift(st) SKM_sk_shift(void, (st))\n# define sk_void_pop(st) SKM_sk_pop(void, (st))\n# define sk_void_sort(st) SKM_sk_sort(void, (st))\n# define sk_void_is_sorted(st) SKM_sk_is_sorted(void, (st))\n# define sk_OPENSSL_STRING_new(cmp) ((STACK_OF(OPENSSL_STRING) *)sk_new(CHECKED_SK_CMP_FUNC(char, cmp)))\n# define sk_OPENSSL_STRING_new_null() ((STACK_OF(OPENSSL_STRING) *)sk_new_null())\n# define sk_OPENSSL_STRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val))\n# define sk_OPENSSL_STRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val))\n# define sk_OPENSSL_STRING_value(st, i) ((OPENSSL_STRING)sk_value(CHECKED_STACK_OF(OPENSSL_STRING, st), i))\n# define sk_OPENSSL_STRING_num(st) SKM_sk_num(OPENSSL_STRING, st)\n# define sk_OPENSSL_STRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_FREE_FUNC(char, free_func))\n# define sk_OPENSSL_STRING_deep_copy(st, copy_func, free_func) ((STACK_OF(OPENSSL_STRING) *)sk_deep_copy(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_COPY_FUNC(char, copy_func), CHECKED_SK_FREE_FUNC(char, free_func)))\n# define sk_OPENSSL_STRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val), i)\n# define sk_OPENSSL_STRING_free(st) SKM_sk_free(OPENSSL_STRING, st)\n# define sk_OPENSSL_STRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_STRING, st), i, CHECKED_PTR_OF(char, val))\n# define sk_OPENSSL_STRING_zero(st) SKM_sk_zero(OPENSSL_STRING, (st))\n# define sk_OPENSSL_STRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, val))\n# define sk_OPENSSL_STRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_STRING), st), CHECKED_CONST_PTR_OF(char, val))\n# define sk_OPENSSL_STRING_delete(st, i) SKM_sk_delete(OPENSSL_STRING, (st), (i))\n# define sk_OPENSSL_STRING_delete_ptr(st, ptr) (OPENSSL_STRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_PTR_OF(char, ptr))\n# define sk_OPENSSL_STRING_set_cmp_func(st, cmp)  \\\n        ((int (*)(const char * const *,const char * const *)) \\\n        sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_STRING, st), CHECKED_SK_CMP_FUNC(char, cmp)))\n# define sk_OPENSSL_STRING_dup(st) SKM_sk_dup(OPENSSL_STRING, st)\n# define sk_OPENSSL_STRING_shift(st) SKM_sk_shift(OPENSSL_STRING, (st))\n# define sk_OPENSSL_STRING_pop(st) (char *)sk_pop(CHECKED_STACK_OF(OPENSSL_STRING, st))\n# define sk_OPENSSL_STRING_sort(st) SKM_sk_sort(OPENSSL_STRING, (st))\n# define sk_OPENSSL_STRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_STRING, (st))\n# define sk_OPENSSL_BLOCK_new(cmp) ((STACK_OF(OPENSSL_BLOCK) *)sk_new(CHECKED_SK_CMP_FUNC(void, cmp)))\n# define sk_OPENSSL_BLOCK_new_null() ((STACK_OF(OPENSSL_BLOCK) *)sk_new_null())\n# define sk_OPENSSL_BLOCK_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val))\n# define sk_OPENSSL_BLOCK_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val))\n# define sk_OPENSSL_BLOCK_value(st, i) ((OPENSSL_BLOCK)sk_value(CHECKED_STACK_OF(OPENSSL_BLOCK, st), i))\n# define sk_OPENSSL_BLOCK_num(st) SKM_sk_num(OPENSSL_BLOCK, st)\n# define sk_OPENSSL_BLOCK_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_FREE_FUNC(void, free_func))\n# define sk_OPENSSL_BLOCK_deep_copy(st, copy_func, free_func) ((STACK_OF(OPENSSL_BLOCK) *)sk_deep_copy(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_COPY_FUNC(void, copy_func), CHECKED_SK_FREE_FUNC(void, free_func)))\n# define sk_OPENSSL_BLOCK_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val), i)\n# define sk_OPENSSL_BLOCK_free(st) SKM_sk_free(OPENSSL_BLOCK, st)\n# define sk_OPENSSL_BLOCK_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_BLOCK, st), i, CHECKED_PTR_OF(void, val))\n# define sk_OPENSSL_BLOCK_zero(st) SKM_sk_zero(OPENSSL_BLOCK, (st))\n# define sk_OPENSSL_BLOCK_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, val))\n# define sk_OPENSSL_BLOCK_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_BLOCK), st), CHECKED_CONST_PTR_OF(void, val))\n# define sk_OPENSSL_BLOCK_delete(st, i) SKM_sk_delete(OPENSSL_BLOCK, (st), (i))\n# define sk_OPENSSL_BLOCK_delete_ptr(st, ptr) (OPENSSL_BLOCK *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_PTR_OF(void, ptr))\n# define sk_OPENSSL_BLOCK_set_cmp_func(st, cmp)  \\\n        ((int (*)(const void * const *,const void * const *)) \\\n        sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_BLOCK, st), CHECKED_SK_CMP_FUNC(void, cmp)))\n# define sk_OPENSSL_BLOCK_dup(st) SKM_sk_dup(OPENSSL_BLOCK, st)\n# define sk_OPENSSL_BLOCK_shift(st) SKM_sk_shift(OPENSSL_BLOCK, (st))\n# define sk_OPENSSL_BLOCK_pop(st) (void *)sk_pop(CHECKED_STACK_OF(OPENSSL_BLOCK, st))\n# define sk_OPENSSL_BLOCK_sort(st) SKM_sk_sort(OPENSSL_BLOCK, (st))\n# define sk_OPENSSL_BLOCK_is_sorted(st) SKM_sk_is_sorted(OPENSSL_BLOCK, (st))\n# define sk_OPENSSL_PSTRING_new(cmp) ((STACK_OF(OPENSSL_PSTRING) *)sk_new(CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp)))\n# define sk_OPENSSL_PSTRING_new_null() ((STACK_OF(OPENSSL_PSTRING) *)sk_new_null())\n# define sk_OPENSSL_PSTRING_push(st, val) sk_push(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))\n# define sk_OPENSSL_PSTRING_find(st, val) sk_find(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))\n# define sk_OPENSSL_PSTRING_value(st, i) ((OPENSSL_PSTRING)sk_value(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i))\n# define sk_OPENSSL_PSTRING_num(st) SKM_sk_num(OPENSSL_PSTRING, st)\n# define sk_OPENSSL_PSTRING_pop_free(st, free_func) sk_pop_free(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_FREE_FUNC(OPENSSL_STRING, free_func))\n# define sk_OPENSSL_PSTRING_deep_copy(st, copy_func, free_func) ((STACK_OF(OPENSSL_PSTRING) *)sk_deep_copy(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_COPY_FUNC(OPENSSL_STRING, copy_func), CHECKED_SK_FREE_FUNC(OPENSSL_STRING, free_func)))\n# define sk_OPENSSL_PSTRING_insert(st, val, i) sk_insert(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val), i)\n# define sk_OPENSSL_PSTRING_free(st) SKM_sk_free(OPENSSL_PSTRING, st)\n# define sk_OPENSSL_PSTRING_set(st, i, val) sk_set(CHECKED_STACK_OF(OPENSSL_PSTRING, st), i, CHECKED_PTR_OF(OPENSSL_STRING, val))\n# define sk_OPENSSL_PSTRING_zero(st) SKM_sk_zero(OPENSSL_PSTRING, (st))\n# define sk_OPENSSL_PSTRING_unshift(st, val) sk_unshift(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, val))\n# define sk_OPENSSL_PSTRING_find_ex(st, val) sk_find_ex((_STACK *)CHECKED_CONST_PTR_OF(STACK_OF(OPENSSL_PSTRING), st), CHECKED_CONST_PTR_OF(OPENSSL_STRING, val))\n# define sk_OPENSSL_PSTRING_delete(st, i) SKM_sk_delete(OPENSSL_PSTRING, (st), (i))\n# define sk_OPENSSL_PSTRING_delete_ptr(st, ptr) (OPENSSL_PSTRING *)sk_delete_ptr(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_PTR_OF(OPENSSL_STRING, ptr))\n# define sk_OPENSSL_PSTRING_set_cmp_func(st, cmp)  \\\n        ((int (*)(const OPENSSL_STRING * const *,const OPENSSL_STRING * const *)) \\\n        sk_set_cmp_func(CHECKED_STACK_OF(OPENSSL_PSTRING, st), CHECKED_SK_CMP_FUNC(OPENSSL_STRING, cmp)))\n# define sk_OPENSSL_PSTRING_dup(st) SKM_sk_dup(OPENSSL_PSTRING, st)\n# define sk_OPENSSL_PSTRING_shift(st) SKM_sk_shift(OPENSSL_PSTRING, (st))\n# define sk_OPENSSL_PSTRING_pop(st) (OPENSSL_STRING *)sk_pop(CHECKED_STACK_OF(OPENSSL_PSTRING, st))\n# define sk_OPENSSL_PSTRING_sort(st) SKM_sk_sort(OPENSSL_PSTRING, (st))\n# define sk_OPENSSL_PSTRING_is_sorted(st) SKM_sk_is_sorted(OPENSSL_PSTRING, (st))\n# define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(ACCESS_DESCRIPTION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(ACCESS_DESCRIPTION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_ACCESS_DESCRIPTION(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(ACCESS_DESCRIPTION, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_ACCESS_DESCRIPTION(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(ACCESS_DESCRIPTION, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_ASN1_INTEGER(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(ASN1_INTEGER, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_ASN1_INTEGER(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(ASN1_INTEGER, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_ASN1_INTEGER(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(ASN1_INTEGER, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_ASN1_INTEGER(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(ASN1_INTEGER, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_ASN1_OBJECT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(ASN1_OBJECT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_ASN1_OBJECT(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(ASN1_OBJECT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_ASN1_OBJECT(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(ASN1_OBJECT, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_ASN1_OBJECT(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(ASN1_OBJECT, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_ASN1_TYPE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(ASN1_TYPE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_ASN1_TYPE(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(ASN1_TYPE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_ASN1_TYPE(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(ASN1_TYPE, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_ASN1_TYPE(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(ASN1_TYPE, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(ASN1_UTF8STRING, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_ASN1_UTF8STRING(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(ASN1_UTF8STRING, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_ASN1_UTF8STRING(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(ASN1_UTF8STRING, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_ASN1_UTF8STRING(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(ASN1_UTF8STRING, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_DIST_POINT(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(DIST_POINT, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_DIST_POINT(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(DIST_POINT, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_DIST_POINT(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(DIST_POINT, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_DIST_POINT(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(DIST_POINT, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_ESS_CERT_ID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(ESS_CERT_ID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_ESS_CERT_ID(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(ESS_CERT_ID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_ESS_CERT_ID(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(ESS_CERT_ID, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_ESS_CERT_ID(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(ESS_CERT_ID, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_EVP_MD(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(EVP_MD, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_EVP_MD(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(EVP_MD, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_EVP_MD(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(EVP_MD, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_EVP_MD(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(EVP_MD, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_GENERAL_NAME(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(GENERAL_NAME, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_GENERAL_NAME(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(GENERAL_NAME, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_GENERAL_NAME(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(GENERAL_NAME, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_GENERAL_NAME(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(GENERAL_NAME, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_OCSP_ONEREQ(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(OCSP_ONEREQ, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_OCSP_ONEREQ(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(OCSP_ONEREQ, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_OCSP_ONEREQ(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(OCSP_ONEREQ, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_OCSP_ONEREQ(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(OCSP_ONEREQ, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(OCSP_SINGLERESP, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_OCSP_SINGLERESP(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(OCSP_SINGLERESP, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_OCSP_SINGLERESP(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(OCSP_SINGLERESP, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_OCSP_SINGLERESP(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(OCSP_SINGLERESP, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(PKCS12_SAFEBAG, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_PKCS12_SAFEBAG(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(PKCS12_SAFEBAG, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_PKCS12_SAFEBAG(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(PKCS12_SAFEBAG, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_PKCS12_SAFEBAG(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(PKCS12_SAFEBAG, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_PKCS7(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(PKCS7, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_PKCS7(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(PKCS7, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_PKCS7(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(PKCS7, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_PKCS7(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(PKCS7, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(PKCS7_RECIP_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(PKCS7_RECIP_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_PKCS7_RECIP_INFO(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(PKCS7_RECIP_INFO, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_PKCS7_RECIP_INFO(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(PKCS7_RECIP_INFO, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(PKCS7_SIGNER_INFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(PKCS7_SIGNER_INFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_PKCS7_SIGNER_INFO(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(PKCS7_SIGNER_INFO, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_PKCS7_SIGNER_INFO(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(PKCS7_SIGNER_INFO, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_POLICYINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(POLICYINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_POLICYINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(POLICYINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_POLICYINFO(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(POLICYINFO, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_POLICYINFO(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(POLICYINFO, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_POLICYQUALINFO(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(POLICYQUALINFO, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_POLICYQUALINFO(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(POLICYQUALINFO, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_POLICYQUALINFO(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(POLICYQUALINFO, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_POLICYQUALINFO(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(POLICYQUALINFO, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_SXNETID(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(SXNETID, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_SXNETID(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(SXNETID, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_SXNETID(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(SXNETID, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_SXNETID(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(SXNETID, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_X509(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(X509, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_X509(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(X509, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_X509(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(X509, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_X509(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(X509, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_X509_ALGOR(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(X509_ALGOR, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_X509_ALGOR(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(X509_ALGOR, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_X509_ALGOR(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(X509_ALGOR, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_X509_ALGOR(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(X509_ALGOR, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(X509_ATTRIBUTE, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_X509_ATTRIBUTE(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(X509_ATTRIBUTE, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_X509_ATTRIBUTE(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(X509_ATTRIBUTE, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_X509_ATTRIBUTE(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(X509_ATTRIBUTE, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_X509_CRL(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(X509_CRL, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_X509_CRL(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(X509_CRL, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_X509_CRL(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(X509_CRL, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_X509_CRL(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(X509_CRL, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_X509_EXTENSION(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(X509_EXTENSION, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_X509_EXTENSION(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(X509_EXTENSION, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_X509_EXTENSION(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(X509_EXTENSION, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_X509_EXTENSION(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(X509_EXTENSION, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(X509_NAME_ENTRY, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_X509_NAME_ENTRY(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(X509_NAME_ENTRY, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_X509_NAME_ENTRY(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(X509_NAME_ENTRY, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_X509_NAME_ENTRY(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(X509_NAME_ENTRY, (buf), (len), (d2i_func), (free_func))\n# define d2i_ASN1_SET_OF_X509_REVOKED(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \\\n        SKM_ASN1_SET_OF_d2i(X509_REVOKED, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class))\n# define i2d_ASN1_SET_OF_X509_REVOKED(st, pp, i2d_func, ex_tag, ex_class, is_set) \\\n        SKM_ASN1_SET_OF_i2d(X509_REVOKED, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set))\n# define ASN1_seq_pack_X509_REVOKED(st, i2d_func, buf, len) \\\n        SKM_ASN1_seq_pack(X509_REVOKED, (st), (i2d_func), (buf), (len))\n# define ASN1_seq_unpack_X509_REVOKED(buf, len, d2i_func, free_func) \\\n        SKM_ASN1_seq_unpack(X509_REVOKED, (buf), (len), (d2i_func), (free_func))\n# define PKCS12_decrypt_d2i_PKCS12_SAFEBAG(algor, d2i_func, free_func, pass, passlen, oct, seq) \\\n        SKM_PKCS12_decrypt_d2i(PKCS12_SAFEBAG, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))\n# define PKCS12_decrypt_d2i_PKCS7(algor, d2i_func, free_func, pass, passlen, oct, seq) \\\n        SKM_PKCS12_decrypt_d2i(PKCS7, (algor), (d2i_func), (free_func), (pass), (passlen), (oct), (seq))\n# define lh_ADDED_OBJ_new() LHM_lh_new(ADDED_OBJ,added_obj)\n# define lh_ADDED_OBJ_insert(lh,inst) LHM_lh_insert(ADDED_OBJ,lh,inst)\n# define lh_ADDED_OBJ_retrieve(lh,inst) LHM_lh_retrieve(ADDED_OBJ,lh,inst)\n# define lh_ADDED_OBJ_delete(lh,inst) LHM_lh_delete(ADDED_OBJ,lh,inst)\n# define lh_ADDED_OBJ_doall(lh,fn) LHM_lh_doall(ADDED_OBJ,lh,fn)\n# define lh_ADDED_OBJ_doall_arg(lh,fn,arg_type,arg) \\\n  LHM_lh_doall_arg(ADDED_OBJ,lh,fn,arg_type,arg)\n# define lh_ADDED_OBJ_error(lh) LHM_lh_error(ADDED_OBJ,lh)\n# define lh_ADDED_OBJ_num_items(lh) LHM_lh_num_items(ADDED_OBJ,lh)\n# define lh_ADDED_OBJ_down_load(lh) LHM_lh_down_load(ADDED_OBJ,lh)\n# define lh_ADDED_OBJ_node_stats_bio(lh,out) \\\n  LHM_lh_node_stats_bio(ADDED_OBJ,lh,out)\n# define lh_ADDED_OBJ_node_usage_stats_bio(lh,out) \\\n  LHM_lh_node_usage_stats_bio(ADDED_OBJ,lh,out)\n# define lh_ADDED_OBJ_stats_bio(lh,out) \\\n  LHM_lh_stats_bio(ADDED_OBJ,lh,out)\n# define lh_ADDED_OBJ_free(lh) LHM_lh_free(ADDED_OBJ,lh)\n# define lh_APP_INFO_new() LHM_lh_new(APP_INFO,app_info)\n# define lh_APP_INFO_insert(lh,inst) LHM_lh_insert(APP_INFO,lh,inst)\n# define lh_APP_INFO_retrieve(lh,inst) LHM_lh_retrieve(APP_INFO,lh,inst)\n# define lh_APP_INFO_delete(lh,inst) LHM_lh_delete(APP_INFO,lh,inst)\n# define lh_APP_INFO_doall(lh,fn) LHM_lh_doall(APP_INFO,lh,fn)\n# define lh_APP_INFO_doall_arg(lh,fn,arg_type,arg) \\\n  LHM_lh_doall_arg(APP_INFO,lh,fn,arg_type,arg)\n# define lh_APP_INFO_error(lh) LHM_lh_error(APP_INFO,lh)\n# define lh_APP_INFO_num_items(lh) LHM_lh_num_items(APP_INFO,lh)\n# define lh_APP_INFO_down_load(lh) LHM_lh_down_load(APP_INFO,lh)\n# define lh_APP_INFO_node_stats_bio(lh,out) \\\n  LHM_lh_node_stats_bio(APP_INFO,lh,out)\n# define lh_APP_INFO_node_usage_stats_bio(lh,out) \\\n  LHM_lh_node_usage_stats_bio(APP_INFO,lh,out)\n# define lh_APP_INFO_stats_bio(lh,out) \\\n  LHM_lh_stats_bio(APP_INFO,lh,out)\n# define lh_APP_INFO_free(lh) LHM_lh_free(APP_INFO,lh)\n# define lh_CONF_VALUE_new() LHM_lh_new(CONF_VALUE,conf_value)\n# define lh_CONF_VALUE_insert(lh,inst) LHM_lh_insert(CONF_VALUE,lh,inst)\n# define lh_CONF_VALUE_retrieve(lh,inst) LHM_lh_retrieve(CONF_VALUE,lh,inst)\n# define lh_CONF_VALUE_delete(lh,inst) LHM_lh_delete(CONF_VALUE,lh,inst)\n# define lh_CONF_VALUE_doall(lh,fn) LHM_lh_doall(CONF_VALUE,lh,fn)\n# define lh_CONF_VALUE_doall_arg(lh,fn,arg_type,arg) \\\n  LHM_lh_doall_arg(CONF_VALUE,lh,fn,arg_type,arg)\n# define lh_CONF_VALUE_error(lh) LHM_lh_error(CONF_VALUE,lh)\n# define lh_CONF_VALUE_num_items(lh) LHM_lh_num_items(CONF_VALUE,lh)\n# define lh_CONF_VALUE_down_load(lh) LHM_lh_down_load(CONF_VALUE,lh)\n# define lh_CONF_VALUE_node_stats_bio(lh,out) \\\n  LHM_lh_node_stats_bio(CONF_VALUE,lh,out)\n# define lh_CONF_VALUE_node_usage_stats_bio(lh,out) \\\n  LHM_lh_node_usage_stats_bio(CONF_VALUE,lh,out)\n# define lh_CONF_VALUE_stats_bio(lh,out) \\\n  LHM_lh_stats_bio(CONF_VALUE,lh,out)\n# define lh_CONF_VALUE_free(lh) LHM_lh_free(CONF_VALUE,lh)\n# define lh_ENGINE_PILE_new() LHM_lh_new(ENGINE_PILE,engine_pile)\n# define lh_ENGINE_PILE_insert(lh,inst) LHM_lh_insert(ENGINE_PILE,lh,inst)\n# define lh_ENGINE_PILE_retrieve(lh,inst) LHM_lh_retrieve(ENGINE_PILE,lh,inst)\n# define lh_ENGINE_PILE_delete(lh,inst) LHM_lh_delete(ENGINE_PILE,lh,inst)\n# define lh_ENGINE_PILE_doall(lh,fn) LHM_lh_doall(ENGINE_PILE,lh,fn)\n# define lh_ENGINE_PILE_doall_arg(lh,fn,arg_type,arg) \\\n  LHM_lh_doall_arg(ENGINE_PILE,lh,fn,arg_type,arg)\n# define lh_ENGINE_PILE_error(lh) LHM_lh_error(ENGINE_PILE,lh)\n# define lh_ENGINE_PILE_num_items(lh) LHM_lh_num_items(ENGINE_PILE,lh)\n# define lh_ENGINE_PILE_down_load(lh) LHM_lh_down_load(ENGINE_PILE,lh)\n# define lh_ENGINE_PILE_node_stats_bio(lh,out) \\\n  LHM_lh_node_stats_bio(ENGINE_PILE,lh,out)\n# define lh_ENGINE_PILE_node_usage_stats_bio(lh,out) \\\n  LHM_lh_node_usage_stats_bio(ENGINE_PILE,lh,out)\n# define lh_ENGINE_PILE_stats_bio(lh,out) \\\n  LHM_lh_stats_bio(ENGINE_PILE,lh,out)\n# define lh_ENGINE_PILE_free(lh) LHM_lh_free(ENGINE_PILE,lh)\n# define lh_ERR_STATE_new() LHM_lh_new(ERR_STATE,err_state)\n# define lh_ERR_STATE_insert(lh,inst) LHM_lh_insert(ERR_STATE,lh,inst)\n# define lh_ERR_STATE_retrieve(lh,inst) LHM_lh_retrieve(ERR_STATE,lh,inst)\n# define lh_ERR_STATE_delete(lh,inst) LHM_lh_delete(ERR_STATE,lh,inst)\n# define lh_ERR_STATE_doall(lh,fn) LHM_lh_doall(ERR_STATE,lh,fn)\n# define lh_ERR_STATE_doall_arg(lh,fn,arg_type,arg) \\\n  LHM_lh_doall_arg(ERR_STATE,lh,fn,arg_type,arg)\n# define lh_ERR_STATE_error(lh) LHM_lh_error(ERR_STATE,lh)\n# define lh_ERR_STATE_num_items(lh) LHM_lh_num_items(ERR_STATE,lh)\n# define lh_ERR_STATE_down_load(lh) LHM_lh_down_load(ERR_STATE,lh)\n# define lh_ERR_STATE_node_stats_bio(lh,out) \\\n  LHM_lh_node_stats_bio(ERR_STATE,lh,out)\n# define lh_ERR_STATE_node_usage_stats_bio(lh,out) \\\n  LHM_lh_node_usage_stats_bio(ERR_STATE,lh,out)\n# define lh_ERR_STATE_stats_bio(lh,out) \\\n  LHM_lh_stats_bio(ERR_STATE,lh,out)\n# define lh_ERR_STATE_free(lh) LHM_lh_free(ERR_STATE,lh)\n# define lh_ERR_STRING_DATA_new() LHM_lh_new(ERR_STRING_DATA,err_string_data)\n# define lh_ERR_STRING_DATA_insert(lh,inst) LHM_lh_insert(ERR_STRING_DATA,lh,inst)\n# define lh_ERR_STRING_DATA_retrieve(lh,inst) LHM_lh_retrieve(ERR_STRING_DATA,lh,inst)\n# define lh_ERR_STRING_DATA_delete(lh,inst) LHM_lh_delete(ERR_STRING_DATA,lh,inst)\n# define lh_ERR_STRING_DATA_doall(lh,fn) LHM_lh_doall(ERR_STRING_DATA,lh,fn)\n# define lh_ERR_STRING_DATA_doall_arg(lh,fn,arg_type,arg) \\\n  LHM_lh_doall_arg(ERR_STRING_DATA,lh,fn,arg_type,arg)\n# define lh_ERR_STRING_DATA_error(lh) LHM_lh_error(ERR_STRING_DATA,lh)\n# define lh_ERR_STRING_DATA_num_items(lh) LHM_lh_num_items(ERR_STRING_DATA,lh)\n# define lh_ERR_STRING_DATA_down_load(lh) LHM_lh_down_load(ERR_STRING_DATA,lh)\n# define lh_ERR_STRING_DATA_node_stats_bio(lh,out) \\\n  LHM_lh_node_stats_bio(ERR_STRING_DATA,lh,out)\n# define lh_ERR_STRING_DATA_node_usage_stats_bio(lh,out) \\\n  LHM_lh_node_usage_stats_bio(ERR_STRING_DATA,lh,out)\n# define lh_ERR_STRING_DATA_stats_bio(lh,out) \\\n  LHM_lh_stats_bio(ERR_STRING_DATA,lh,out)\n# define lh_ERR_STRING_DATA_free(lh) LHM_lh_free(ERR_STRING_DATA,lh)\n# define lh_EX_CLASS_ITEM_new() LHM_lh_new(EX_CLASS_ITEM,ex_class_item)\n# define lh_EX_CLASS_ITEM_insert(lh,inst) LHM_lh_insert(EX_CLASS_ITEM,lh,inst)\n# define lh_EX_CLASS_ITEM_retrieve(lh,inst) LHM_lh_retrieve(EX_CLASS_ITEM,lh,inst)\n# define lh_EX_CLASS_ITEM_delete(lh,inst) LHM_lh_delete(EX_CLASS_ITEM,lh,inst)\n# define lh_EX_CLASS_ITEM_doall(lh,fn) LHM_lh_doall(EX_CLASS_ITEM,lh,fn)\n# define lh_EX_CLASS_ITEM_doall_arg(lh,fn,arg_type,arg) \\\n  LHM_lh_doall_arg(EX_CLASS_ITEM,lh,fn,arg_type,arg)\n# define lh_EX_CLASS_ITEM_error(lh) LHM_lh_error(EX_CLASS_ITEM,lh)\n# define lh_EX_CLASS_ITEM_num_items(lh) LHM_lh_num_items(EX_CLASS_ITEM,lh)\n# define lh_EX_CLASS_ITEM_down_load(lh) LHM_lh_down_load(EX_CLASS_ITEM,lh)\n# define lh_EX_CLASS_ITEM_node_stats_bio(lh,out) \\\n  LHM_lh_node_stats_bio(EX_CLASS_ITEM,lh,out)\n# define lh_EX_CLASS_ITEM_node_usage_stats_bio(lh,out) \\\n  LHM_lh_node_usage_stats_bio(EX_CLASS_ITEM,lh,out)\n# define lh_EX_CLASS_ITEM_stats_bio(lh,out) \\\n  LHM_lh_stats_bio(EX_CLASS_ITEM,lh,out)\n# define lh_EX_CLASS_ITEM_free(lh) LHM_lh_free(EX_CLASS_ITEM,lh)\n# define lh_FUNCTION_new() LHM_lh_new(FUNCTION,function)\n# define lh_FUNCTION_insert(lh,inst) LHM_lh_insert(FUNCTION,lh,inst)\n# define lh_FUNCTION_retrieve(lh,inst) LHM_lh_retrieve(FUNCTION,lh,inst)\n# define lh_FUNCTION_delete(lh,inst) LHM_lh_delete(FUNCTION,lh,inst)\n# define lh_FUNCTION_doall(lh,fn) LHM_lh_doall(FUNCTION,lh,fn)\n# define lh_FUNCTION_doall_arg(lh,fn,arg_type,arg) \\\n  LHM_lh_doall_arg(FUNCTION,lh,fn,arg_type,arg)\n# define lh_FUNCTION_error(lh) LHM_lh_error(FUNCTION,lh)\n# define lh_FUNCTION_num_items(lh) LHM_lh_num_items(FUNCTION,lh)\n# define lh_FUNCTION_down_load(lh) LHM_lh_down_load(FUNCTION,lh)\n# define lh_FUNCTION_node_stats_bio(lh,out) \\\n  LHM_lh_node_stats_bio(FUNCTION,lh,out)\n# define lh_FUNCTION_node_usage_stats_bio(lh,out) \\\n  LHM_lh_node_usage_stats_bio(FUNCTION,lh,out)\n# define lh_FUNCTION_stats_bio(lh,out) \\\n  LHM_lh_stats_bio(FUNCTION,lh,out)\n# define lh_FUNCTION_free(lh) LHM_lh_free(FUNCTION,lh)\n# define lh_MEM_new() LHM_lh_new(MEM,mem)\n# define lh_MEM_insert(lh,inst) LHM_lh_insert(MEM,lh,inst)\n# define lh_MEM_retrieve(lh,inst) LHM_lh_retrieve(MEM,lh,inst)\n# define lh_MEM_delete(lh,inst) LHM_lh_delete(MEM,lh,inst)\n# define lh_MEM_doall(lh,fn) LHM_lh_doall(MEM,lh,fn)\n# define lh_MEM_doall_arg(lh,fn,arg_type,arg) \\\n  LHM_lh_doall_arg(MEM,lh,fn,arg_type,arg)\n# define lh_MEM_error(lh) LHM_lh_error(MEM,lh)\n# define lh_MEM_num_items(lh) LHM_lh_num_items(MEM,lh)\n# define lh_MEM_down_load(lh) LHM_lh_down_load(MEM,lh)\n# define lh_MEM_node_stats_bio(lh,out) \\\n  LHM_lh_node_stats_bio(MEM,lh,out)\n# define lh_MEM_node_usage_stats_bio(lh,out) \\\n  LHM_lh_node_usage_stats_bio(MEM,lh,out)\n# define lh_MEM_stats_bio(lh,out) \\\n  LHM_lh_stats_bio(MEM,lh,out)\n# define lh_MEM_free(lh) LHM_lh_free(MEM,lh)\n# define lh_OBJ_NAME_new() LHM_lh_new(OBJ_NAME,obj_name)\n# define lh_OBJ_NAME_insert(lh,inst) LHM_lh_insert(OBJ_NAME,lh,inst)\n# define lh_OBJ_NAME_retrieve(lh,inst) LHM_lh_retrieve(OBJ_NAME,lh,inst)\n# define lh_OBJ_NAME_delete(lh,inst) LHM_lh_delete(OBJ_NAME,lh,inst)\n# define lh_OBJ_NAME_doall(lh,fn) LHM_lh_doall(OBJ_NAME,lh,fn)\n# define lh_OBJ_NAME_doall_arg(lh,fn,arg_type,arg) \\\n  LHM_lh_doall_arg(OBJ_NAME,lh,fn,arg_type,arg)\n# define lh_OBJ_NAME_error(lh) LHM_lh_error(OBJ_NAME,lh)\n# define lh_OBJ_NAME_num_items(lh) LHM_lh_num_items(OBJ_NAME,lh)\n# define lh_OBJ_NAME_down_load(lh) LHM_lh_down_load(OBJ_NAME,lh)\n# define lh_OBJ_NAME_node_stats_bio(lh,out) \\\n  LHM_lh_node_stats_bio(OBJ_NAME,lh,out)\n# define lh_OBJ_NAME_node_usage_stats_bio(lh,out) \\\n  LHM_lh_node_usage_stats_bio(OBJ_NAME,lh,out)\n# define lh_OBJ_NAME_stats_bio(lh,out) \\\n  LHM_lh_stats_bio(OBJ_NAME,lh,out)\n# define lh_OBJ_NAME_free(lh) LHM_lh_free(OBJ_NAME,lh)\n# define lh_OPENSSL_CSTRING_new() LHM_lh_new(OPENSSL_CSTRING,openssl_cstring)\n# define lh_OPENSSL_CSTRING_insert(lh,inst) LHM_lh_insert(OPENSSL_CSTRING,lh,inst)\n# define lh_OPENSSL_CSTRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_CSTRING,lh,inst)\n# define lh_OPENSSL_CSTRING_delete(lh,inst) LHM_lh_delete(OPENSSL_CSTRING,lh,inst)\n# define lh_OPENSSL_CSTRING_doall(lh,fn) LHM_lh_doall(OPENSSL_CSTRING,lh,fn)\n# define lh_OPENSSL_CSTRING_doall_arg(lh,fn,arg_type,arg) \\\n  LHM_lh_doall_arg(OPENSSL_CSTRING,lh,fn,arg_type,arg)\n# define lh_OPENSSL_CSTRING_error(lh) LHM_lh_error(OPENSSL_CSTRING,lh)\n# define lh_OPENSSL_CSTRING_num_items(lh) LHM_lh_num_items(OPENSSL_CSTRING,lh)\n# define lh_OPENSSL_CSTRING_down_load(lh) LHM_lh_down_load(OPENSSL_CSTRING,lh)\n# define lh_OPENSSL_CSTRING_node_stats_bio(lh,out) \\\n  LHM_lh_node_stats_bio(OPENSSL_CSTRING,lh,out)\n# define lh_OPENSSL_CSTRING_node_usage_stats_bio(lh,out) \\\n  LHM_lh_node_usage_stats_bio(OPENSSL_CSTRING,lh,out)\n# define lh_OPENSSL_CSTRING_stats_bio(lh,out) \\\n  LHM_lh_stats_bio(OPENSSL_CSTRING,lh,out)\n# define lh_OPENSSL_CSTRING_free(lh) LHM_lh_free(OPENSSL_CSTRING,lh)\n# define lh_OPENSSL_STRING_new() LHM_lh_new(OPENSSL_STRING,openssl_string)\n# define lh_OPENSSL_STRING_insert(lh,inst) LHM_lh_insert(OPENSSL_STRING,lh,inst)\n# define lh_OPENSSL_STRING_retrieve(lh,inst) LHM_lh_retrieve(OPENSSL_STRING,lh,inst)\n# define lh_OPENSSL_STRING_delete(lh,inst) LHM_lh_delete(OPENSSL_STRING,lh,inst)\n# define lh_OPENSSL_STRING_doall(lh,fn) LHM_lh_doall(OPENSSL_STRING,lh,fn)\n# define lh_OPENSSL_STRING_doall_arg(lh,fn,arg_type,arg) \\\n  LHM_lh_doall_arg(OPENSSL_STRING,lh,fn,arg_type,arg)\n# define lh_OPENSSL_STRING_error(lh) LHM_lh_error(OPENSSL_STRING,lh)\n# define lh_OPENSSL_STRING_num_items(lh) LHM_lh_num_items(OPENSSL_STRING,lh)\n# define lh_OPENSSL_STRING_down_load(lh) LHM_lh_down_load(OPENSSL_STRING,lh)\n# define lh_OPENSSL_STRING_node_stats_bio(lh,out) \\\n  LHM_lh_node_stats_bio(OPENSSL_STRING,lh,out)\n# define lh_OPENSSL_STRING_node_usage_stats_bio(lh,out) \\\n  LHM_lh_node_usage_stats_bio(OPENSSL_STRING,lh,out)\n# define lh_OPENSSL_STRING_stats_bio(lh,out) \\\n  LHM_lh_stats_bio(OPENSSL_STRING,lh,out)\n# define lh_OPENSSL_STRING_free(lh) LHM_lh_free(OPENSSL_STRING,lh)\n# define lh_SSL_SESSION_new() LHM_lh_new(SSL_SESSION,ssl_session)\n# define lh_SSL_SESSION_insert(lh,inst) LHM_lh_insert(SSL_SESSION,lh,inst)\n# define lh_SSL_SESSION_retrieve(lh,inst) LHM_lh_retrieve(SSL_SESSION,lh,inst)\n# define lh_SSL_SESSION_delete(lh,inst) LHM_lh_delete(SSL_SESSION,lh,inst)\n# define lh_SSL_SESSION_doall(lh,fn) LHM_lh_doall(SSL_SESSION,lh,fn)\n# define lh_SSL_SESSION_doall_arg(lh,fn,arg_type,arg) \\\n  LHM_lh_doall_arg(SSL_SESSION,lh,fn,arg_type,arg)\n# define lh_SSL_SESSION_error(lh) LHM_lh_error(SSL_SESSION,lh)\n# define lh_SSL_SESSION_num_items(lh) LHM_lh_num_items(SSL_SESSION,lh)\n# define lh_SSL_SESSION_down_load(lh) LHM_lh_down_load(SSL_SESSION,lh)\n# define lh_SSL_SESSION_node_stats_bio(lh,out) \\\n  LHM_lh_node_stats_bio(SSL_SESSION,lh,out)\n# define lh_SSL_SESSION_node_usage_stats_bio(lh,out) \\\n  LHM_lh_node_usage_stats_bio(SSL_SESSION,lh,out)\n# define lh_SSL_SESSION_stats_bio(lh,out) \\\n  LHM_lh_stats_bio(SSL_SESSION,lh,out)\n# define lh_SSL_SESSION_free(lh) LHM_lh_free(SSL_SESSION,lh)\n#ifdef  __cplusplus\n}\n#endif\n#endif                          /* !defined HEADER_SAFESTACK_H */\n"
  },
  {
    "path": "third_party/include/openssl/seed.h",
    "content": "/*\n * Copyright (c) 2007 KISA(Korea Information Security Agency). All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Neither the name of author nor the names of its contributors may\n *    be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n */\n/* ====================================================================\n * Copyright (c) 1998-2007 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_SEED_H\n# define HEADER_SEED_H\n\n# include <openssl/opensslconf.h>\n# include <openssl/e_os2.h>\n# include <openssl/crypto.h>\n\n# ifdef OPENSSL_NO_SEED\n#  error SEED is disabled.\n# endif\n\n/* look whether we need 'long' to get 32 bits */\n# ifdef AES_LONG\n#  ifndef SEED_LONG\n#   define SEED_LONG 1\n#  endif\n# endif\n\n# if !defined(NO_SYS_TYPES_H)\n#  include <sys/types.h>\n# endif\n\n# define SEED_BLOCK_SIZE 16\n# define SEED_KEY_LENGTH 16\n\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct seed_key_st {\n# ifdef SEED_LONG\n    unsigned long data[32];\n# else\n    unsigned int data[32];\n# endif\n} SEED_KEY_SCHEDULE;\n\n# ifdef OPENSSL_FIPS\nvoid private_SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],\n                          SEED_KEY_SCHEDULE *ks);\n# endif\nvoid SEED_set_key(const unsigned char rawkey[SEED_KEY_LENGTH],\n                  SEED_KEY_SCHEDULE *ks);\n\nvoid SEED_encrypt(const unsigned char s[SEED_BLOCK_SIZE],\n                  unsigned char d[SEED_BLOCK_SIZE],\n                  const SEED_KEY_SCHEDULE *ks);\nvoid SEED_decrypt(const unsigned char s[SEED_BLOCK_SIZE],\n                  unsigned char d[SEED_BLOCK_SIZE],\n                  const SEED_KEY_SCHEDULE *ks);\n\nvoid SEED_ecb_encrypt(const unsigned char *in, unsigned char *out,\n                      const SEED_KEY_SCHEDULE *ks, int enc);\nvoid SEED_cbc_encrypt(const unsigned char *in, unsigned char *out, size_t len,\n                      const SEED_KEY_SCHEDULE *ks,\n                      unsigned char ivec[SEED_BLOCK_SIZE], int enc);\nvoid SEED_cfb128_encrypt(const unsigned char *in, unsigned char *out,\n                         size_t len, const SEED_KEY_SCHEDULE *ks,\n                         unsigned char ivec[SEED_BLOCK_SIZE], int *num,\n                         int enc);\nvoid SEED_ofb128_encrypt(const unsigned char *in, unsigned char *out,\n                         size_t len, const SEED_KEY_SCHEDULE *ks,\n                         unsigned char ivec[SEED_BLOCK_SIZE], int *num);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif                          /* HEADER_SEED_H */\n"
  },
  {
    "path": "third_party/include/openssl/sha.h",
    "content": "/* crypto/sha/sha.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_SHA_H\n# define HEADER_SHA_H\n\n# include <openssl/e_os2.h>\n# include <stddef.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# if defined(OPENSSL_NO_SHA) || (defined(OPENSSL_NO_SHA0) && defined(OPENSSL_NO_SHA1))\n#  error SHA is disabled.\n# endif\n\n# if defined(OPENSSL_FIPS)\n#  define FIPS_SHA_SIZE_T size_t\n# endif\n\n/*-\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n * ! SHA_LONG has to be at least 32 bits wide. If it's wider, then !\n * ! SHA_LONG_LOG2 has to be defined along.                        !\n * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n */\n\n# if defined(__LP32__)\n#  define SHA_LONG unsigned long\n# elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__)\n#  define SHA_LONG unsigned long\n#  define SHA_LONG_LOG2 3\n# else\n#  define SHA_LONG unsigned int\n# endif\n\n# define SHA_LBLOCK      16\n# define SHA_CBLOCK      (SHA_LBLOCK*4)/* SHA treats input data as a\n                                        * contiguous array of 32 bit wide\n                                        * big-endian values. */\n# define SHA_LAST_BLOCK  (SHA_CBLOCK-8)\n# define SHA_DIGEST_LENGTH 20\n\ntypedef struct SHAstate_st {\n    SHA_LONG h0, h1, h2, h3, h4;\n    SHA_LONG Nl, Nh;\n    SHA_LONG data[SHA_LBLOCK];\n    unsigned int num;\n} SHA_CTX;\n\n# ifndef OPENSSL_NO_SHA0\n#  ifdef OPENSSL_FIPS\nint private_SHA_Init(SHA_CTX *c);\n#  endif\nint SHA_Init(SHA_CTX *c);\nint SHA_Update(SHA_CTX *c, const void *data, size_t len);\nint SHA_Final(unsigned char *md, SHA_CTX *c);\nunsigned char *SHA(const unsigned char *d, size_t n, unsigned char *md);\nvoid SHA_Transform(SHA_CTX *c, const unsigned char *data);\n# endif\n# ifndef OPENSSL_NO_SHA1\n#  ifdef OPENSSL_FIPS\nint private_SHA1_Init(SHA_CTX *c);\n#  endif\nint SHA1_Init(SHA_CTX *c);\nint SHA1_Update(SHA_CTX *c, const void *data, size_t len);\nint SHA1_Final(unsigned char *md, SHA_CTX *c);\nunsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md);\nvoid SHA1_Transform(SHA_CTX *c, const unsigned char *data);\n# endif\n\n# define SHA256_CBLOCK   (SHA_LBLOCK*4)/* SHA-256 treats input data as a\n                                        * contiguous array of 32 bit wide\n                                        * big-endian values. */\n# define SHA224_DIGEST_LENGTH    28\n# define SHA256_DIGEST_LENGTH    32\n\ntypedef struct SHA256state_st {\n    SHA_LONG h[8];\n    SHA_LONG Nl, Nh;\n    SHA_LONG data[SHA_LBLOCK];\n    unsigned int num, md_len;\n} SHA256_CTX;\n\n# ifndef OPENSSL_NO_SHA256\n#  ifdef OPENSSL_FIPS\nint private_SHA224_Init(SHA256_CTX *c);\nint private_SHA256_Init(SHA256_CTX *c);\n#  endif\nint SHA224_Init(SHA256_CTX *c);\nint SHA224_Update(SHA256_CTX *c, const void *data, size_t len);\nint SHA224_Final(unsigned char *md, SHA256_CTX *c);\nunsigned char *SHA224(const unsigned char *d, size_t n, unsigned char *md);\nint SHA256_Init(SHA256_CTX *c);\nint SHA256_Update(SHA256_CTX *c, const void *data, size_t len);\nint SHA256_Final(unsigned char *md, SHA256_CTX *c);\nunsigned char *SHA256(const unsigned char *d, size_t n, unsigned char *md);\nvoid SHA256_Transform(SHA256_CTX *c, const unsigned char *data);\n# endif\n\n# define SHA384_DIGEST_LENGTH    48\n# define SHA512_DIGEST_LENGTH    64\n\n# ifndef OPENSSL_NO_SHA512\n/*\n * Unlike 32-bit digest algorithms, SHA-512 *relies* on SHA_LONG64\n * being exactly 64-bit wide. See Implementation Notes in sha512.c\n * for further details.\n */\n/*\n * SHA-512 treats input data as a\n * contiguous array of 64 bit\n * wide big-endian values.\n */\n#  define SHA512_CBLOCK   (SHA_LBLOCK*8)\n#  if (defined(_WIN32) || defined(_WIN64)) && !defined(__MINGW32__)\n#   define SHA_LONG64 unsigned __int64\n#   define U64(C)     C##UI64\n#  elif defined(__arch64__)\n#   define SHA_LONG64 unsigned long\n#   define U64(C)     C##UL\n#  else\n#   define SHA_LONG64 unsigned long long\n#   define U64(C)     C##ULL\n#  endif\n\ntypedef struct SHA512state_st {\n    SHA_LONG64 h[8];\n    SHA_LONG64 Nl, Nh;\n    union {\n        SHA_LONG64 d[SHA_LBLOCK];\n        unsigned char p[SHA512_CBLOCK];\n    } u;\n    unsigned int num, md_len;\n} SHA512_CTX;\n# endif\n\n# ifndef OPENSSL_NO_SHA512\n#  ifdef OPENSSL_FIPS\nint private_SHA384_Init(SHA512_CTX *c);\nint private_SHA512_Init(SHA512_CTX *c);\n#  endif\nint SHA384_Init(SHA512_CTX *c);\nint SHA384_Update(SHA512_CTX *c, const void *data, size_t len);\nint SHA384_Final(unsigned char *md, SHA512_CTX *c);\nunsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md);\nint SHA512_Init(SHA512_CTX *c);\nint SHA512_Update(SHA512_CTX *c, const void *data, size_t len);\nint SHA512_Final(unsigned char *md, SHA512_CTX *c);\nunsigned char *SHA512(const unsigned char *d, size_t n, unsigned char *md);\nvoid SHA512_Transform(SHA512_CTX *c, const unsigned char *data);\n# endif\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/srp.h",
    "content": "/* crypto/srp/srp.h */\n/*\n * Written by Christophe Renou (christophe.renou@edelweb.fr) with the\n * precious help of Peter Sylvester (peter.sylvester@edelweb.fr) for the\n * EdelKey project and contributed to the OpenSSL project 2004.\n */\n/* ====================================================================\n * Copyright (c) 2004 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n#ifndef __SRP_H__\n# define __SRP_H__\n\n# ifndef OPENSSL_NO_SRP\n\n#  include <stdio.h>\n#  include <string.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n#  include <openssl/safestack.h>\n#  include <openssl/bn.h>\n#  include <openssl/crypto.h>\n\ntypedef struct SRP_gN_cache_st {\n    char *b64_bn;\n    BIGNUM *bn;\n} SRP_gN_cache;\n\n\nDECLARE_STACK_OF(SRP_gN_cache)\n\ntypedef struct SRP_user_pwd_st {\n    /* Owned by us. */\n    char *id;\n    BIGNUM *s;\n    BIGNUM *v;\n    /* Not owned by us. */\n    const BIGNUM *g;\n    const BIGNUM *N;\n    /* Owned by us. */\n    char *info;\n} SRP_user_pwd;\n\nDECLARE_STACK_OF(SRP_user_pwd)\n\nvoid SRP_user_pwd_free(SRP_user_pwd *user_pwd);\n\ntypedef struct SRP_VBASE_st {\n    STACK_OF(SRP_user_pwd) *users_pwd;\n    STACK_OF(SRP_gN_cache) *gN_cache;\n/* to simulate a user */\n    char *seed_key;\n    BIGNUM *default_g;\n    BIGNUM *default_N;\n} SRP_VBASE;\n\n/*\n * Structure interne pour retenir les couples N et g\n */\ntypedef struct SRP_gN_st {\n    char *id;\n    BIGNUM *g;\n    BIGNUM *N;\n} SRP_gN;\n\nDECLARE_STACK_OF(SRP_gN)\n\nSRP_VBASE *SRP_VBASE_new(char *seed_key);\nint SRP_VBASE_free(SRP_VBASE *vb);\nint SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file);\n\n/* This method ignores the configured seed and fails for an unknown user. */\nSRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username);\n/* NOTE: unlike in SRP_VBASE_get_by_user, caller owns the returned pointer.*/\nSRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username);\n\nchar *SRP_create_verifier(const char *user, const char *pass, char **salt,\n                          char **verifier, const char *N, const char *g);\nint SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt,\n                           BIGNUM **verifier, BIGNUM *N, BIGNUM *g);\n\n#  define SRP_NO_ERROR 0\n#  define SRP_ERR_VBASE_INCOMPLETE_FILE 1\n#  define SRP_ERR_VBASE_BN_LIB 2\n#  define SRP_ERR_OPEN_FILE 3\n#  define SRP_ERR_MEMORY 4\n\n#  define DB_srptype      0\n#  define DB_srpverifier  1\n#  define DB_srpsalt      2\n#  define DB_srpid        3\n#  define DB_srpgN        4\n#  define DB_srpinfo      5\n#  undef  DB_NUMBER\n#  define DB_NUMBER       6\n\n#  define DB_SRP_INDEX    'I'\n#  define DB_SRP_VALID    'V'\n#  define DB_SRP_REVOKED  'R'\n#  define DB_SRP_MODIF    'v'\n\n/* see srp.c */\nchar *SRP_check_known_gN_param(BIGNUM *g, BIGNUM *N);\nSRP_gN *SRP_get_default_gN(const char *id);\n\n/* server side .... */\nBIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b,\n                            BIGNUM *N);\nBIGNUM *SRP_Calc_B(BIGNUM *b, BIGNUM *N, BIGNUM *g, BIGNUM *v);\nint SRP_Verify_A_mod_N(BIGNUM *A, BIGNUM *N);\nBIGNUM *SRP_Calc_u(BIGNUM *A, BIGNUM *B, BIGNUM *N);\n\n/* client side .... */\nBIGNUM *SRP_Calc_x(BIGNUM *s, const char *user, const char *pass);\nBIGNUM *SRP_Calc_A(BIGNUM *a, BIGNUM *N, BIGNUM *g);\nBIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x,\n                            BIGNUM *a, BIGNUM *u);\nint SRP_Verify_B_mod_N(BIGNUM *B, BIGNUM *N);\n\n#  define SRP_MINIMAL_N 1024\n\n#ifdef  __cplusplus\n}\n#endif\n\n# endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/srtp.h",
    "content": "/* ssl/srtp.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n/* ====================================================================\n * Copyright (c) 1998-2006 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n/*\n * DTLS code by Eric Rescorla <ekr@rtfm.com>\n *\n * Copyright (C) 2006, Network Resonance, Inc. Copyright (C) 2011, RTFM, Inc.\n */\n\n#ifndef HEADER_D1_SRTP_H\n# define HEADER_D1_SRTP_H\n\n# include <openssl/ssl.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# define SRTP_AES128_CM_SHA1_80 0x0001\n# define SRTP_AES128_CM_SHA1_32 0x0002\n# define SRTP_AES128_F8_SHA1_80 0x0003\n# define SRTP_AES128_F8_SHA1_32 0x0004\n# define SRTP_NULL_SHA1_80      0x0005\n# define SRTP_NULL_SHA1_32      0x0006\n\n# ifndef OPENSSL_NO_SRTP\n\nint SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles);\nint SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles);\n\nSTACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl);\nSRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s);\n\n# endif\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/ssl.h",
    "content": "/* ssl/ssl.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n/* ====================================================================\n * Copyright (c) 1998-2007 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n/* ====================================================================\n * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.\n * ECC cipher suite support in OpenSSL originally developed by\n * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.\n */\n/* ====================================================================\n * Copyright 2005 Nokia. All rights reserved.\n *\n * The portions of the attached software (\"Contribution\") is developed by\n * Nokia Corporation and is licensed pursuant to the OpenSSL open source\n * license.\n *\n * The Contribution, originally written by Mika Kousa and Pasi Eronen of\n * Nokia Corporation, consists of the \"PSK\" (Pre-Shared Key) ciphersuites\n * support (see RFC 4279) to OpenSSL.\n *\n * No patent licenses or other rights except those expressly stated in\n * the OpenSSL open source license shall be deemed granted or received\n * expressly, by implication, estoppel, or otherwise.\n *\n * No assurances are provided by Nokia that the Contribution does not\n * infringe the patent or other intellectual property rights of any third\n * party or that the license provides you with all the necessary rights\n * to make use of the Contribution.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND. IN\n * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA\n * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY\n * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR\n * OTHERWISE.\n */\n\n#ifndef HEADER_SSL_H\n# define HEADER_SSL_H\n\n# include <openssl/e_os2.h>\n\n# ifndef OPENSSL_NO_COMP\n#  include <openssl/comp.h>\n# endif\n# ifndef OPENSSL_NO_BIO\n#  include <openssl/bio.h>\n# endif\n# ifndef OPENSSL_NO_DEPRECATED\n#  ifndef OPENSSL_NO_X509\n#   include <openssl/x509.h>\n#  endif\n#  include <openssl/crypto.h>\n#  include <openssl/lhash.h>\n#  include <openssl/buffer.h>\n# endif\n# include <openssl/pem.h>\n# include <openssl/hmac.h>\n\n# include <openssl/kssl.h>\n# include <openssl/safestack.h>\n# include <openssl/symhacks.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* SSLeay version number for ASN.1 encoding of the session information */\n/*-\n * Version 0 - initial version\n * Version 1 - added the optional peer certificate\n */\n# define SSL_SESSION_ASN1_VERSION 0x0001\n\n/* text strings for the ciphers */\n# define SSL_TXT_NULL_WITH_MD5           SSL2_TXT_NULL_WITH_MD5\n# define SSL_TXT_RC4_128_WITH_MD5        SSL2_TXT_RC4_128_WITH_MD5\n# define SSL_TXT_RC4_128_EXPORT40_WITH_MD5 SSL2_TXT_RC4_128_EXPORT40_WITH_MD5\n# define SSL_TXT_RC2_128_CBC_WITH_MD5    SSL2_TXT_RC2_128_CBC_WITH_MD5\n# define SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5\n# define SSL_TXT_IDEA_128_CBC_WITH_MD5   SSL2_TXT_IDEA_128_CBC_WITH_MD5\n# define SSL_TXT_DES_64_CBC_WITH_MD5     SSL2_TXT_DES_64_CBC_WITH_MD5\n# define SSL_TXT_DES_64_CBC_WITH_SHA     SSL2_TXT_DES_64_CBC_WITH_SHA\n# define SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5\n# define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA\n\n/*\n * VRS Additional Kerberos5 entries\n */\n# define SSL_TXT_KRB5_DES_64_CBC_SHA   SSL3_TXT_KRB5_DES_64_CBC_SHA\n# define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA\n# define SSL_TXT_KRB5_RC4_128_SHA      SSL3_TXT_KRB5_RC4_128_SHA\n# define SSL_TXT_KRB5_IDEA_128_CBC_SHA SSL3_TXT_KRB5_IDEA_128_CBC_SHA\n# define SSL_TXT_KRB5_DES_64_CBC_MD5   SSL3_TXT_KRB5_DES_64_CBC_MD5\n# define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5\n# define SSL_TXT_KRB5_RC4_128_MD5      SSL3_TXT_KRB5_RC4_128_MD5\n# define SSL_TXT_KRB5_IDEA_128_CBC_MD5 SSL3_TXT_KRB5_IDEA_128_CBC_MD5\n\n# define SSL_TXT_KRB5_DES_40_CBC_SHA   SSL3_TXT_KRB5_DES_40_CBC_SHA\n# define SSL_TXT_KRB5_RC2_40_CBC_SHA   SSL3_TXT_KRB5_RC2_40_CBC_SHA\n# define SSL_TXT_KRB5_RC4_40_SHA       SSL3_TXT_KRB5_RC4_40_SHA\n# define SSL_TXT_KRB5_DES_40_CBC_MD5   SSL3_TXT_KRB5_DES_40_CBC_MD5\n# define SSL_TXT_KRB5_RC2_40_CBC_MD5   SSL3_TXT_KRB5_RC2_40_CBC_MD5\n# define SSL_TXT_KRB5_RC4_40_MD5       SSL3_TXT_KRB5_RC4_40_MD5\n\n# define SSL_TXT_KRB5_DES_40_CBC_SHA   SSL3_TXT_KRB5_DES_40_CBC_SHA\n# define SSL_TXT_KRB5_DES_40_CBC_MD5   SSL3_TXT_KRB5_DES_40_CBC_MD5\n# define SSL_TXT_KRB5_DES_64_CBC_SHA   SSL3_TXT_KRB5_DES_64_CBC_SHA\n# define SSL_TXT_KRB5_DES_64_CBC_MD5   SSL3_TXT_KRB5_DES_64_CBC_MD5\n# define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA\n# define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5\n# define SSL_MAX_KRB5_PRINCIPAL_LENGTH  256\n\n# define SSL_MAX_SSL_SESSION_ID_LENGTH           32\n# define SSL_MAX_SID_CTX_LENGTH                  32\n\n# define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES     (512/8)\n# define SSL_MAX_KEY_ARG_LENGTH                  8\n# define SSL_MAX_MASTER_KEY_LENGTH               48\n\n/* These are used to specify which ciphers to use and not to use */\n\n# define SSL_TXT_EXP40           \"EXPORT40\"\n# define SSL_TXT_EXP56           \"EXPORT56\"\n# define SSL_TXT_LOW             \"LOW\"\n# define SSL_TXT_MEDIUM          \"MEDIUM\"\n# define SSL_TXT_HIGH            \"HIGH\"\n# define SSL_TXT_FIPS            \"FIPS\"\n\n# define SSL_TXT_kFZA            \"kFZA\"/* unused! */\n# define SSL_TXT_aFZA            \"aFZA\"/* unused! */\n# define SSL_TXT_eFZA            \"eFZA\"/* unused! */\n# define SSL_TXT_FZA             \"FZA\"/* unused! */\n\n# define SSL_TXT_aNULL           \"aNULL\"\n# define SSL_TXT_eNULL           \"eNULL\"\n# define SSL_TXT_NULL            \"NULL\"\n\n# define SSL_TXT_kRSA            \"kRSA\"\n# define SSL_TXT_kDHr            \"kDHr\"\n# define SSL_TXT_kDHd            \"kDHd\"\n# define SSL_TXT_kDH             \"kDH\"\n# define SSL_TXT_kEDH            \"kEDH\"\n# define SSL_TXT_kDHE            \"kDHE\"/* alias for kEDH */\n# define SSL_TXT_kKRB5           \"kKRB5\"\n# define SSL_TXT_kECDHr          \"kECDHr\"\n# define SSL_TXT_kECDHe          \"kECDHe\"\n# define SSL_TXT_kECDH           \"kECDH\"\n# define SSL_TXT_kEECDH          \"kEECDH\"\n# define SSL_TXT_kECDHE          \"kECDHE\"/* alias for kEECDH */\n# define SSL_TXT_kPSK            \"kPSK\"\n# define SSL_TXT_kGOST           \"kGOST\"\n# define SSL_TXT_kSRP            \"kSRP\"\n\n# define SSL_TXT_aRSA            \"aRSA\"\n# define SSL_TXT_aDSS            \"aDSS\"\n# define SSL_TXT_aDH             \"aDH\"\n# define SSL_TXT_aECDH           \"aECDH\"\n# define SSL_TXT_aKRB5           \"aKRB5\"\n# define SSL_TXT_aECDSA          \"aECDSA\"\n# define SSL_TXT_aPSK            \"aPSK\"\n# define SSL_TXT_aGOST94 \"aGOST94\"\n# define SSL_TXT_aGOST01 \"aGOST01\"\n# define SSL_TXT_aGOST  \"aGOST\"\n# define SSL_TXT_aSRP            \"aSRP\"\n\n# define SSL_TXT_DSS             \"DSS\"\n# define SSL_TXT_DH              \"DH\"\n# define SSL_TXT_EDH             \"EDH\"/* same as \"kEDH:-ADH\" */\n# define SSL_TXT_DHE             \"DHE\"/* alias for EDH */\n# define SSL_TXT_ADH             \"ADH\"\n# define SSL_TXT_RSA             \"RSA\"\n# define SSL_TXT_ECDH            \"ECDH\"\n# define SSL_TXT_EECDH           \"EECDH\"/* same as \"kEECDH:-AECDH\" */\n# define SSL_TXT_ECDHE           \"ECDHE\"/* alias for ECDHE\" */\n# define SSL_TXT_AECDH           \"AECDH\"\n# define SSL_TXT_ECDSA           \"ECDSA\"\n# define SSL_TXT_KRB5            \"KRB5\"\n# define SSL_TXT_PSK             \"PSK\"\n# define SSL_TXT_SRP             \"SRP\"\n\n# define SSL_TXT_DES             \"DES\"\n# define SSL_TXT_3DES            \"3DES\"\n# define SSL_TXT_RC4             \"RC4\"\n# define SSL_TXT_RC2             \"RC2\"\n# define SSL_TXT_IDEA            \"IDEA\"\n# define SSL_TXT_SEED            \"SEED\"\n# define SSL_TXT_AES128          \"AES128\"\n# define SSL_TXT_AES256          \"AES256\"\n# define SSL_TXT_AES             \"AES\"\n# define SSL_TXT_AES_GCM         \"AESGCM\"\n# define SSL_TXT_CAMELLIA128     \"CAMELLIA128\"\n# define SSL_TXT_CAMELLIA256     \"CAMELLIA256\"\n# define SSL_TXT_CAMELLIA        \"CAMELLIA\"\n\n# define SSL_TXT_MD5             \"MD5\"\n# define SSL_TXT_SHA1            \"SHA1\"\n# define SSL_TXT_SHA             \"SHA\"/* same as \"SHA1\" */\n# define SSL_TXT_GOST94          \"GOST94\"\n# define SSL_TXT_GOST89MAC               \"GOST89MAC\"\n# define SSL_TXT_SHA256          \"SHA256\"\n# define SSL_TXT_SHA384          \"SHA384\"\n\n# define SSL_TXT_SSLV2           \"SSLv2\"\n# define SSL_TXT_SSLV3           \"SSLv3\"\n# define SSL_TXT_TLSV1           \"TLSv1\"\n# define SSL_TXT_TLSV1_1         \"TLSv1.1\"\n# define SSL_TXT_TLSV1_2         \"TLSv1.2\"\n\n# define SSL_TXT_EXP             \"EXP\"\n# define SSL_TXT_EXPORT          \"EXPORT\"\n\n# define SSL_TXT_ALL             \"ALL\"\n\n/*-\n * COMPLEMENTOF* definitions. These identifiers are used to (de-select)\n * ciphers normally not being used.\n * Example: \"RC4\" will activate all ciphers using RC4 including ciphers\n * without authentication, which would normally disabled by DEFAULT (due\n * the \"!ADH\" being part of default). Therefore \"RC4:!COMPLEMENTOFDEFAULT\"\n * will make sure that it is also disabled in the specific selection.\n * COMPLEMENTOF* identifiers are portable between version, as adjustments\n * to the default cipher setup will also be included here.\n *\n * COMPLEMENTOFDEFAULT does not experience the same special treatment that\n * DEFAULT gets, as only selection is being done and no sorting as needed\n * for DEFAULT.\n */\n# define SSL_TXT_CMPALL          \"COMPLEMENTOFALL\"\n# define SSL_TXT_CMPDEF          \"COMPLEMENTOFDEFAULT\"\n\n/*\n * The following cipher list is used by default. It also is substituted when\n * an application-defined cipher list string starts with 'DEFAULT'.\n */\n# define SSL_DEFAULT_CIPHER_LIST \"ALL:!EXPORT:!LOW:!aNULL:!eNULL:!SSLv2\"\n/*\n * As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always\n * starts with a reasonable order, and all we have to do for DEFAULT is\n * throwing out anonymous and unencrypted ciphersuites! (The latter are not\n * actually enabled by ALL, but \"ALL:RSA\" would enable some of them.)\n */\n\n/* Used in SSL_set_shutdown()/SSL_get_shutdown(); */\n# define SSL_SENT_SHUTDOWN       1\n# define SSL_RECEIVED_SHUTDOWN   2\n\n#ifdef __cplusplus\n}\n#endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# if (defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_MD5)) && !defined(OPENSSL_NO_SSL2)\n#  define OPENSSL_NO_SSL2\n# endif\n\n# define SSL_FILETYPE_ASN1       X509_FILETYPE_ASN1\n# define SSL_FILETYPE_PEM        X509_FILETYPE_PEM\n\n/*\n * This is needed to stop compilers complaining about the 'struct ssl_st *'\n * function parameters used to prototype callbacks in SSL_CTX.\n */\ntypedef struct ssl_st *ssl_crock_st;\ntypedef struct tls_session_ticket_ext_st TLS_SESSION_TICKET_EXT;\ntypedef struct ssl_method_st SSL_METHOD;\ntypedef struct ssl_cipher_st SSL_CIPHER;\ntypedef struct ssl_session_st SSL_SESSION;\ntypedef struct tls_sigalgs_st TLS_SIGALGS;\ntypedef struct ssl_conf_ctx_st SSL_CONF_CTX;\n\nDECLARE_STACK_OF(SSL_CIPHER)\n\n/* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*/\ntypedef struct srtp_protection_profile_st {\n    const char *name;\n    unsigned long id;\n} SRTP_PROTECTION_PROFILE;\n\nDECLARE_STACK_OF(SRTP_PROTECTION_PROFILE)\n\ntypedef int (*tls_session_ticket_ext_cb_fn) (SSL *s,\n                                             const unsigned char *data,\n                                             int len, void *arg);\ntypedef int (*tls_session_secret_cb_fn) (SSL *s, void *secret,\n                                         int *secret_len,\n                                         STACK_OF(SSL_CIPHER) *peer_ciphers,\n                                         SSL_CIPHER **cipher, void *arg);\n\n# ifndef OPENSSL_NO_TLSEXT\n\n/* Typedefs for handling custom extensions */\n\ntypedef int (*custom_ext_add_cb) (SSL *s, unsigned int ext_type,\n                                  const unsigned char **out,\n                                  size_t *outlen, int *al, void *add_arg);\n\ntypedef void (*custom_ext_free_cb) (SSL *s, unsigned int ext_type,\n                                    const unsigned char *out, void *add_arg);\n\ntypedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type,\n                                    const unsigned char *in,\n                                    size_t inlen, int *al, void *parse_arg);\n\n# endif\n\n# ifndef OPENSSL_NO_SSL_INTERN\n\n/* used to hold info on the particular ciphers used */\nstruct ssl_cipher_st {\n    int valid;\n    const char *name;           /* text name */\n    unsigned long id;           /* id, 4 bytes, first is version */\n    /*\n     * changed in 0.9.9: these four used to be portions of a single value\n     * 'algorithms'\n     */\n    unsigned long algorithm_mkey; /* key exchange algorithm */\n    unsigned long algorithm_auth; /* server authentication */\n    unsigned long algorithm_enc; /* symmetric encryption */\n    unsigned long algorithm_mac; /* symmetric authentication */\n    unsigned long algorithm_ssl; /* (major) protocol version */\n    unsigned long algo_strength; /* strength and export flags */\n    unsigned long algorithm2;   /* Extra flags */\n    int strength_bits;          /* Number of bits really used */\n    int alg_bits;               /* Number of bits for algorithm */\n};\n\n/* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */\nstruct ssl_method_st {\n    int version;\n    int (*ssl_new) (SSL *s);\n    void (*ssl_clear) (SSL *s);\n    void (*ssl_free) (SSL *s);\n    int (*ssl_accept) (SSL *s);\n    int (*ssl_connect) (SSL *s);\n    int (*ssl_read) (SSL *s, void *buf, int len);\n    int (*ssl_peek) (SSL *s, void *buf, int len);\n    int (*ssl_write) (SSL *s, const void *buf, int len);\n    int (*ssl_shutdown) (SSL *s);\n    int (*ssl_renegotiate) (SSL *s);\n    int (*ssl_renegotiate_check) (SSL *s);\n    long (*ssl_get_message) (SSL *s, int st1, int stn, int mt, long\n                             max, int *ok);\n    int (*ssl_read_bytes) (SSL *s, int type, unsigned char *buf, int len,\n                           int peek);\n    int (*ssl_write_bytes) (SSL *s, int type, const void *buf_, int len);\n    int (*ssl_dispatch_alert) (SSL *s);\n    long (*ssl_ctrl) (SSL *s, int cmd, long larg, void *parg);\n    long (*ssl_ctx_ctrl) (SSL_CTX *ctx, int cmd, long larg, void *parg);\n    const SSL_CIPHER *(*get_cipher_by_char) (const unsigned char *ptr);\n    int (*put_cipher_by_char) (const SSL_CIPHER *cipher, unsigned char *ptr);\n    int (*ssl_pending) (const SSL *s);\n    int (*num_ciphers) (void);\n    const SSL_CIPHER *(*get_cipher) (unsigned ncipher);\n    const struct ssl_method_st *(*get_ssl_method) (int version);\n    long (*get_timeout) (void);\n    struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */\n    int (*ssl_version) (void);\n    long (*ssl_callback_ctrl) (SSL *s, int cb_id, void (*fp) (void));\n    long (*ssl_ctx_callback_ctrl) (SSL_CTX *s, int cb_id, void (*fp) (void));\n};\n\n/*-\n * Lets make this into an ASN.1 type structure as follows\n * SSL_SESSION_ID ::= SEQUENCE {\n *      version                 INTEGER,        -- structure version number\n *      SSLversion              INTEGER,        -- SSL version number\n *      Cipher                  OCTET STRING,   -- the 3 byte cipher ID\n *      Session_ID              OCTET STRING,   -- the Session ID\n *      Master_key              OCTET STRING,   -- the master key\n *      KRB5_principal          OCTET STRING    -- optional Kerberos principal\n *      Key_Arg [ 0 ] IMPLICIT  OCTET STRING,   -- the optional Key argument\n *      Time [ 1 ] EXPLICIT     INTEGER,        -- optional Start Time\n *      Timeout [ 2 ] EXPLICIT  INTEGER,        -- optional Timeout ins seconds\n *      Peer [ 3 ] EXPLICIT     X509,           -- optional Peer Certificate\n *      Session_ID_context [ 4 ] EXPLICIT OCTET STRING,   -- the Session ID context\n *      Verify_result [ 5 ] EXPLICIT INTEGER,   -- X509_V_... code for `Peer'\n *      HostName [ 6 ] EXPLICIT OCTET STRING,   -- optional HostName from servername TLS extension\n *      PSK_identity_hint [ 7 ] EXPLICIT OCTET STRING, -- optional PSK identity hint\n *      PSK_identity [ 8 ] EXPLICIT OCTET STRING,  -- optional PSK identity\n *      Ticket_lifetime_hint [9] EXPLICIT INTEGER, -- server's lifetime hint for session ticket\n *      Ticket [10]             EXPLICIT OCTET STRING, -- session ticket (clients only)\n *      Compression_meth [11]   EXPLICIT OCTET STRING, -- optional compression method\n *      SRP_username [ 12 ] EXPLICIT OCTET STRING -- optional SRP username\n *      }\n * Look in ssl/ssl_asn1.c for more details\n * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-).\n */\nstruct ssl_session_st {\n    int ssl_version;            /* what ssl version session info is being\n                                 * kept in here? */\n    /* only really used in SSLv2 */\n    unsigned int key_arg_length;\n    unsigned char key_arg[SSL_MAX_KEY_ARG_LENGTH];\n    int master_key_length;\n    unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH];\n    /* session_id - valid? */\n    unsigned int session_id_length;\n    unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH];\n    /*\n     * this is used to determine whether the session is being reused in the\n     * appropriate context. It is up to the application to set this, via\n     * SSL_new\n     */\n    unsigned int sid_ctx_length;\n    unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];\n#  ifndef OPENSSL_NO_KRB5\n    unsigned int krb5_client_princ_len;\n    unsigned char krb5_client_princ[SSL_MAX_KRB5_PRINCIPAL_LENGTH];\n#  endif                        /* OPENSSL_NO_KRB5 */\n#  ifndef OPENSSL_NO_PSK\n    char *psk_identity_hint;\n    char *psk_identity;\n#  endif\n    /*\n     * Used to indicate that session resumption is not allowed. Applications\n     * can also set this bit for a new session via not_resumable_session_cb\n     * to disable session caching and tickets.\n     */\n    int not_resumable;\n    /* The cert is the certificate used to establish this connection */\n    struct sess_cert_st /* SESS_CERT */ *sess_cert;\n    /*\n     * This is the cert for the other end. On clients, it will be the same as\n     * sess_cert->peer_key->x509 (the latter is not enough as sess_cert is\n     * not retained in the external representation of sessions, see\n     * ssl_asn1.c).\n     */\n    X509 *peer;\n    /*\n     * when app_verify_callback accepts a session where the peer's\n     * certificate is not ok, we must remember the error for session reuse:\n     */\n    long verify_result;         /* only for servers */\n    int references;\n    long timeout;\n    long time;\n    unsigned int compress_meth; /* Need to lookup the method */\n    const SSL_CIPHER *cipher;\n    unsigned long cipher_id;    /* when ASN.1 loaded, this needs to be used\n                                 * to load the 'cipher' structure */\n    STACK_OF(SSL_CIPHER) *ciphers; /* shared ciphers? */\n    CRYPTO_EX_DATA ex_data;     /* application specific data */\n    /*\n     * These are used to make removal of session-ids more efficient and to\n     * implement a maximum cache size.\n     */\n    struct ssl_session_st *prev, *next;\n#  ifndef OPENSSL_NO_TLSEXT\n    char *tlsext_hostname;\n#   ifndef OPENSSL_NO_EC\n    size_t tlsext_ecpointformatlist_length;\n    unsigned char *tlsext_ecpointformatlist; /* peer's list */\n    size_t tlsext_ellipticcurvelist_length;\n    unsigned char *tlsext_ellipticcurvelist; /* peer's list */\n#   endif                       /* OPENSSL_NO_EC */\n    /* RFC4507 info */\n    unsigned char *tlsext_tick; /* Session ticket */\n    size_t tlsext_ticklen;      /* Session ticket length */\n    long tlsext_tick_lifetime_hint; /* Session lifetime hint in seconds */\n#  endif\n#  ifndef OPENSSL_NO_SRP\n    char *srp_username;\n#  endif\n};\n\n# endif\n\n# define SSL_OP_MICROSOFT_SESS_ID_BUG                    0x00000001L\n# define SSL_OP_NETSCAPE_CHALLENGE_BUG                   0x00000002L\n/* Allow initial connection to servers that don't support RI */\n# define SSL_OP_LEGACY_SERVER_CONNECT                    0x00000004L\n# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG         0x00000008L\n# define SSL_OP_TLSEXT_PADDING                           0x00000010L\n# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER               0x00000020L\n# define SSL_OP_SAFARI_ECDHE_ECDSA_BUG                   0x00000040L\n# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG                 0x00000080L\n# define SSL_OP_TLS_D5_BUG                               0x00000100L\n# define SSL_OP_TLS_BLOCK_PADDING_BUG                    0x00000200L\n\n/* Hasn't done anything since OpenSSL 0.9.7h, retained for compatibility */\n# define SSL_OP_MSIE_SSLV2_RSA_PADDING                   0x0\n/* Refers to ancient SSLREF and SSLv2, retained for compatibility */\n# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG              0x0\n\n/*\n * Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added in\n * OpenSSL 0.9.6d.  Usually (depending on the application protocol) the\n * workaround is not needed.  Unfortunately some broken SSL/TLS\n * implementations cannot handle it at all, which is why we include it in\n * SSL_OP_ALL.\n */\n/* added in 0.9.6e */\n# define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS              0x00000800L\n\n/*\n * SSL_OP_ALL: various bug workarounds that should be rather harmless.  This\n * used to be 0x000FFFFFL before 0.9.7.\n */\n# define SSL_OP_ALL                                      0x80000BFFL\n\n/* DTLS options */\n# define SSL_OP_NO_QUERY_MTU                 0x00001000L\n/* Turn on Cookie Exchange (on relevant for servers) */\n# define SSL_OP_COOKIE_EXCHANGE              0x00002000L\n/* Don't use RFC4507 ticket extension */\n# define SSL_OP_NO_TICKET                    0x00004000L\n/* Use Cisco's \"speshul\" version of DTLS_BAD_VER (as client)  */\n# define SSL_OP_CISCO_ANYCONNECT             0x00008000L\n\n/* As server, disallow session resumption on renegotiation */\n# define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION   0x00010000L\n/* Don't use compression even if supported */\n# define SSL_OP_NO_COMPRESSION                           0x00020000L\n/* Permit unsafe legacy renegotiation */\n# define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION        0x00040000L\n/* If set, always create a new key when using tmp_ecdh parameters */\n# define SSL_OP_SINGLE_ECDH_USE                          0x00080000L\n/* Does nothing: retained for compatibility */\n# define SSL_OP_SINGLE_DH_USE                            0x00100000L\n/* Does nothing: retained for compatibiity */\n# define SSL_OP_EPHEMERAL_RSA                            0x0\n/*\n * Set on servers to choose the cipher according to the server's preferences\n */\n# define SSL_OP_CIPHER_SERVER_PREFERENCE                 0x00400000L\n/*\n * If set, a server will allow a client to issue a SSLv3.0 version number as\n * latest version supported in the premaster secret, even when TLSv1.0\n * (version 3.1) was announced in the client hello. Normally this is\n * forbidden to prevent version rollback attacks.\n */\n# define SSL_OP_TLS_ROLLBACK_BUG                         0x00800000L\n\n# define SSL_OP_NO_SSLv2                                 0x01000000L\n# define SSL_OP_NO_SSLv3                                 0x02000000L\n# define SSL_OP_NO_TLSv1                                 0x04000000L\n# define SSL_OP_NO_TLSv1_2                               0x08000000L\n# define SSL_OP_NO_TLSv1_1                               0x10000000L\n\n# define SSL_OP_NO_DTLSv1                                0x04000000L\n# define SSL_OP_NO_DTLSv1_2                              0x08000000L\n\n# define SSL_OP_NO_SSL_MASK (SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|\\\n        SSL_OP_NO_TLSv1|SSL_OP_NO_TLSv1_1|SSL_OP_NO_TLSv1_2)\n\n/*\n * These next two were never actually used for anything since SSLeay zap so\n * we have some more flags.\n */\n/*\n * The next flag deliberately changes the ciphertest, this is a check for the\n * PKCS#1 attack\n */\n# define SSL_OP_PKCS1_CHECK_1                            0x0\n# define SSL_OP_PKCS1_CHECK_2                            0x0\n\n# define SSL_OP_NETSCAPE_CA_DN_BUG                       0x20000000L\n# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG          0x40000000L\n/*\n * Make server add server-hello extension from early version of cryptopro\n * draft, when GOST ciphersuite is negotiated. Required for interoperability\n * with CryptoPro CSP 3.x\n */\n# define SSL_OP_CRYPTOPRO_TLSEXT_BUG                     0x80000000L\n\n/*\n * Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success\n * when just a single record has been written):\n */\n# define SSL_MODE_ENABLE_PARTIAL_WRITE       0x00000001L\n/*\n * Make it possible to retry SSL_write() with changed buffer location (buffer\n * contents must stay the same!); this is not the default to avoid the\n * misconception that non-blocking SSL_write() behaves like non-blocking\n * write():\n */\n# define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L\n/*\n * Never bother the application with retries if the transport is blocking:\n */\n# define SSL_MODE_AUTO_RETRY 0x00000004L\n/* Don't attempt to automatically build certificate chain */\n# define SSL_MODE_NO_AUTO_CHAIN 0x00000008L\n/*\n * Save RAM by releasing read and write buffers when they're empty. (SSL3 and\n * TLS only.) \"Released\" buffers are put onto a free-list in the context or\n * just freed (depending on the context's setting for freelist_max_len).\n */\n# define SSL_MODE_RELEASE_BUFFERS 0x00000010L\n/*\n * Send the current time in the Random fields of the ClientHello and\n * ServerHello records for compatibility with hypothetical implementations\n * that require it.\n */\n# define SSL_MODE_SEND_CLIENTHELLO_TIME 0x00000020L\n# define SSL_MODE_SEND_SERVERHELLO_TIME 0x00000040L\n/*\n * Send TLS_FALLBACK_SCSV in the ClientHello. To be set only by applications\n * that reconnect with a downgraded protocol version; see\n * draft-ietf-tls-downgrade-scsv-00 for details. DO NOT ENABLE THIS if your\n * application attempts a normal handshake. Only use this in explicit\n * fallback retries, following the guidance in\n * draft-ietf-tls-downgrade-scsv-00.\n */\n# define SSL_MODE_SEND_FALLBACK_SCSV 0x00000080L\n\n/* Cert related flags */\n/*\n * Many implementations ignore some aspects of the TLS standards such as\n * enforcing certifcate chain algorithms. When this is set we enforce them.\n */\n# define SSL_CERT_FLAG_TLS_STRICT                0x00000001L\n\n/* Suite B modes, takes same values as certificate verify flags */\n# define SSL_CERT_FLAG_SUITEB_128_LOS_ONLY       0x10000\n/* Suite B 192 bit only mode */\n# define SSL_CERT_FLAG_SUITEB_192_LOS            0x20000\n/* Suite B 128 bit mode allowing 192 bit algorithms */\n# define SSL_CERT_FLAG_SUITEB_128_LOS            0x30000\n\n/* Perform all sorts of protocol violations for testing purposes */\n# define SSL_CERT_FLAG_BROKEN_PROTOCOL           0x10000000\n\n/* Flags for building certificate chains */\n/* Treat any existing certificates as untrusted CAs */\n# define SSL_BUILD_CHAIN_FLAG_UNTRUSTED          0x1\n/* Don't include root CA in chain */\n# define SSL_BUILD_CHAIN_FLAG_NO_ROOT            0x2\n/* Just check certificates already there */\n# define SSL_BUILD_CHAIN_FLAG_CHECK              0x4\n/* Ignore verification errors */\n# define SSL_BUILD_CHAIN_FLAG_IGNORE_ERROR       0x8\n/* Clear verification errors from queue */\n# define SSL_BUILD_CHAIN_FLAG_CLEAR_ERROR        0x10\n\n/* Flags returned by SSL_check_chain */\n/* Certificate can be used with this session */\n# define CERT_PKEY_VALID         0x1\n/* Certificate can also be used for signing */\n# define CERT_PKEY_SIGN          0x2\n/* EE certificate signing algorithm OK */\n# define CERT_PKEY_EE_SIGNATURE  0x10\n/* CA signature algorithms OK */\n# define CERT_PKEY_CA_SIGNATURE  0x20\n/* EE certificate parameters OK */\n# define CERT_PKEY_EE_PARAM      0x40\n/* CA certificate parameters OK */\n# define CERT_PKEY_CA_PARAM      0x80\n/* Signing explicitly allowed as opposed to SHA1 fallback */\n# define CERT_PKEY_EXPLICIT_SIGN 0x100\n/* Client CA issuer names match (always set for server cert) */\n# define CERT_PKEY_ISSUER_NAME   0x200\n/* Cert type matches client types (always set for server cert) */\n# define CERT_PKEY_CERT_TYPE     0x400\n/* Cert chain suitable to Suite B */\n# define CERT_PKEY_SUITEB        0x800\n\n# define SSL_CONF_FLAG_CMDLINE           0x1\n# define SSL_CONF_FLAG_FILE              0x2\n# define SSL_CONF_FLAG_CLIENT            0x4\n# define SSL_CONF_FLAG_SERVER            0x8\n# define SSL_CONF_FLAG_SHOW_ERRORS       0x10\n# define SSL_CONF_FLAG_CERTIFICATE       0x20\n/* Configuration value types */\n# define SSL_CONF_TYPE_UNKNOWN           0x0\n# define SSL_CONF_TYPE_STRING            0x1\n# define SSL_CONF_TYPE_FILE              0x2\n# define SSL_CONF_TYPE_DIR               0x3\n\n/*\n * Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, they\n * cannot be used to clear bits.\n */\n\n# define SSL_CTX_set_options(ctx,op) \\\n        SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)\n# define SSL_CTX_clear_options(ctx,op) \\\n        SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_OPTIONS,(op),NULL)\n# define SSL_CTX_get_options(ctx) \\\n        SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,0,NULL)\n# define SSL_set_options(ssl,op) \\\n        SSL_ctrl((ssl),SSL_CTRL_OPTIONS,(op),NULL)\n# define SSL_clear_options(ssl,op) \\\n        SSL_ctrl((ssl),SSL_CTRL_CLEAR_OPTIONS,(op),NULL)\n# define SSL_get_options(ssl) \\\n        SSL_ctrl((ssl),SSL_CTRL_OPTIONS,0,NULL)\n\n# define SSL_CTX_set_mode(ctx,op) \\\n        SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL)\n# define SSL_CTX_clear_mode(ctx,op) \\\n        SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_MODE,(op),NULL)\n# define SSL_CTX_get_mode(ctx) \\\n        SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL)\n# define SSL_clear_mode(ssl,op) \\\n        SSL_ctrl((ssl),SSL_CTRL_CLEAR_MODE,(op),NULL)\n# define SSL_set_mode(ssl,op) \\\n        SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL)\n# define SSL_get_mode(ssl) \\\n        SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL)\n# define SSL_set_mtu(ssl, mtu) \\\n        SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL)\n# define DTLS_set_link_mtu(ssl, mtu) \\\n        SSL_ctrl((ssl),DTLS_CTRL_SET_LINK_MTU,(mtu),NULL)\n# define DTLS_get_link_min_mtu(ssl) \\\n        SSL_ctrl((ssl),DTLS_CTRL_GET_LINK_MIN_MTU,0,NULL)\n\n# define SSL_get_secure_renegotiation_support(ssl) \\\n        SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL)\n\n# ifndef OPENSSL_NO_HEARTBEATS\n#  define SSL_heartbeat(ssl) \\\n        SSL_ctrl((ssl),SSL_CTRL_TLS_EXT_SEND_HEARTBEAT,0,NULL)\n# endif\n\n# define SSL_CTX_set_cert_flags(ctx,op) \\\n        SSL_CTX_ctrl((ctx),SSL_CTRL_CERT_FLAGS,(op),NULL)\n# define SSL_set_cert_flags(s,op) \\\n        SSL_ctrl((s),SSL_CTRL_CERT_FLAGS,(op),NULL)\n# define SSL_CTX_clear_cert_flags(ctx,op) \\\n        SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL)\n# define SSL_clear_cert_flags(s,op) \\\n        SSL_ctrl((s),SSL_CTRL_CLEAR_CERT_FLAGS,(op),NULL)\n\nvoid SSL_CTX_set_msg_callback(SSL_CTX *ctx,\n                              void (*cb) (int write_p, int version,\n                                          int content_type, const void *buf,\n                                          size_t len, SSL *ssl, void *arg));\nvoid SSL_set_msg_callback(SSL *ssl,\n                          void (*cb) (int write_p, int version,\n                                      int content_type, const void *buf,\n                                      size_t len, SSL *ssl, void *arg));\n# define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg))\n# define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg))\n\n# ifndef OPENSSL_NO_SRP\n\n#  ifndef OPENSSL_NO_SSL_INTERN\n\ntypedef struct srp_ctx_st {\n    /* param for all the callbacks */\n    void *SRP_cb_arg;\n    /* set client Hello login callback */\n    int (*TLS_ext_srp_username_callback) (SSL *, int *, void *);\n    /* set SRP N/g param callback for verification */\n    int (*SRP_verify_param_callback) (SSL *, void *);\n    /* set SRP client passwd callback */\n    char *(*SRP_give_srp_client_pwd_callback) (SSL *, void *);\n    char *login;\n    BIGNUM *N, *g, *s, *B, *A;\n    BIGNUM *a, *b, *v;\n    char *info;\n    int strength;\n    unsigned long srp_Mask;\n} SRP_CTX;\n\n#  endif\n\n/* see tls_srp.c */\nint SSL_SRP_CTX_init(SSL *s);\nint SSL_CTX_SRP_CTX_init(SSL_CTX *ctx);\nint SSL_SRP_CTX_free(SSL *ctx);\nint SSL_CTX_SRP_CTX_free(SSL_CTX *ctx);\nint SSL_srp_server_param_with_username(SSL *s, int *ad);\nint SRP_generate_server_master_secret(SSL *s, unsigned char *master_key);\nint SRP_Calc_A_param(SSL *s);\nint SRP_generate_client_master_secret(SSL *s, unsigned char *master_key);\n\n# endif\n\n# if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32)\n#  define SSL_MAX_CERT_LIST_DEFAULT 1024*30\n                                          /* 30k max cert list :-) */\n# else\n#  define SSL_MAX_CERT_LIST_DEFAULT 1024*100\n                                           /* 100k max cert list :-) */\n# endif\n\n# define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT      (1024*20)\n\n/*\n * This callback type is used inside SSL_CTX, SSL, and in the functions that\n * set them. It is used to override the generation of SSL/TLS session IDs in\n * a server. Return value should be zero on an error, non-zero to proceed.\n * Also, callbacks should themselves check if the id they generate is unique\n * otherwise the SSL handshake will fail with an error - callbacks can do\n * this using the 'ssl' value they're passed by;\n * SSL_has_matching_session_id(ssl, id, *id_len) The length value passed in\n * is set at the maximum size the session ID can be. In SSLv2 this is 16\n * bytes, whereas SSLv3/TLSv1 it is 32 bytes. The callback can alter this\n * length to be less if desired, but under SSLv2 session IDs are supposed to\n * be fixed at 16 bytes so the id will be padded after the callback returns\n * in this case. It is also an error for the callback to set the size to\n * zero.\n */\ntypedef int (*GEN_SESSION_CB) (const SSL *ssl, unsigned char *id,\n                               unsigned int *id_len);\n\ntypedef struct ssl_comp_st SSL_COMP;\n\n# ifndef OPENSSL_NO_SSL_INTERN\n\nstruct ssl_comp_st {\n    int id;\n    const char *name;\n#  ifndef OPENSSL_NO_COMP\n    COMP_METHOD *method;\n#  else\n    char *method;\n#  endif\n};\n\nDECLARE_STACK_OF(SSL_COMP)\nDECLARE_LHASH_OF(SSL_SESSION);\n\nstruct ssl_ctx_st {\n    const SSL_METHOD *method;\n    STACK_OF(SSL_CIPHER) *cipher_list;\n    /* same as above but sorted for lookup */\n    STACK_OF(SSL_CIPHER) *cipher_list_by_id;\n    struct x509_store_st /* X509_STORE */ *cert_store;\n    LHASH_OF(SSL_SESSION) *sessions;\n    /*\n     * Most session-ids that will be cached, default is\n     * SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited.\n     */\n    unsigned long session_cache_size;\n    struct ssl_session_st *session_cache_head;\n    struct ssl_session_st *session_cache_tail;\n    /*\n     * This can have one of 2 values, ored together, SSL_SESS_CACHE_CLIENT,\n     * SSL_SESS_CACHE_SERVER, Default is SSL_SESSION_CACHE_SERVER, which\n     * means only SSL_accept which cache SSL_SESSIONS.\n     */\n    int session_cache_mode;\n    /*\n     * If timeout is not 0, it is the default timeout value set when\n     * SSL_new() is called.  This has been put in to make life easier to set\n     * things up\n     */\n    long session_timeout;\n    /*\n     * If this callback is not null, it will be called each time a session id\n     * is added to the cache.  If this function returns 1, it means that the\n     * callback will do a SSL_SESSION_free() when it has finished using it.\n     * Otherwise, on 0, it means the callback has finished with it. If\n     * remove_session_cb is not null, it will be called when a session-id is\n     * removed from the cache.  After the call, OpenSSL will\n     * SSL_SESSION_free() it.\n     */\n    int (*new_session_cb) (struct ssl_st *ssl, SSL_SESSION *sess);\n    void (*remove_session_cb) (struct ssl_ctx_st *ctx, SSL_SESSION *sess);\n    SSL_SESSION *(*get_session_cb) (struct ssl_st *ssl,\n                                    unsigned char *data, int len, int *copy);\n    struct {\n        int sess_connect;       /* SSL new conn - started */\n        int sess_connect_renegotiate; /* SSL reneg - requested */\n        int sess_connect_good;  /* SSL new conne/reneg - finished */\n        int sess_accept;        /* SSL new accept - started */\n        int sess_accept_renegotiate; /* SSL reneg - requested */\n        int sess_accept_good;   /* SSL accept/reneg - finished */\n        int sess_miss;          /* session lookup misses */\n        int sess_timeout;       /* reuse attempt on timeouted session */\n        int sess_cache_full;    /* session removed due to full cache */\n        int sess_hit;           /* session reuse actually done */\n        int sess_cb_hit;        /* session-id that was not in the cache was\n                                 * passed back via the callback.  This\n                                 * indicates that the application is\n                                 * supplying session-id's from other\n                                 * processes - spooky :-) */\n    } stats;\n\n    int references;\n\n    /* if defined, these override the X509_verify_cert() calls */\n    int (*app_verify_callback) (X509_STORE_CTX *, void *);\n    void *app_verify_arg;\n    /*\n     * before OpenSSL 0.9.7, 'app_verify_arg' was ignored\n     * ('app_verify_callback' was called with just one argument)\n     */\n\n    /* Default password callback. */\n    pem_password_cb *default_passwd_callback;\n\n    /* Default password callback user data. */\n    void *default_passwd_callback_userdata;\n\n    /* get client cert callback */\n    int (*client_cert_cb) (SSL *ssl, X509 **x509, EVP_PKEY **pkey);\n\n    /* cookie generate callback */\n    int (*app_gen_cookie_cb) (SSL *ssl, unsigned char *cookie,\n                              unsigned int *cookie_len);\n\n    /* verify cookie callback */\n    int (*app_verify_cookie_cb) (SSL *ssl, unsigned char *cookie,\n                                 unsigned int cookie_len);\n\n    CRYPTO_EX_DATA ex_data;\n\n    const EVP_MD *rsa_md5;      /* For SSLv2 - name is 'ssl2-md5' */\n    const EVP_MD *md5;          /* For SSLv3/TLSv1 'ssl3-md5' */\n    const EVP_MD *sha1;         /* For SSLv3/TLSv1 'ssl3->sha1' */\n\n    STACK_OF(X509) *extra_certs;\n    STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */\n\n    /* Default values used when no per-SSL value is defined follow */\n\n    /* used if SSL's info_callback is NULL */\n    void (*info_callback) (const SSL *ssl, int type, int val);\n\n    /* what we put in client cert requests */\n    STACK_OF(X509_NAME) *client_CA;\n\n    /*\n     * Default values to use in SSL structures follow (these are copied by\n     * SSL_new)\n     */\n\n    unsigned long options;\n    unsigned long mode;\n    long max_cert_list;\n\n    struct cert_st /* CERT */ *cert;\n    int read_ahead;\n\n    /* callback that allows applications to peek at protocol messages */\n    void (*msg_callback) (int write_p, int version, int content_type,\n                          const void *buf, size_t len, SSL *ssl, void *arg);\n    void *msg_callback_arg;\n\n    int verify_mode;\n    unsigned int sid_ctx_length;\n    unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];\n    /* called 'verify_callback' in the SSL */\n    int (*default_verify_callback) (int ok, X509_STORE_CTX *ctx);\n\n    /* Default generate session ID callback. */\n    GEN_SESSION_CB generate_session_id;\n\n    X509_VERIFY_PARAM *param;\n\n#  if 0\n    int purpose;                /* Purpose setting */\n    int trust;                  /* Trust setting */\n#  endif\n\n    int quiet_shutdown;\n\n    /*\n     * Maximum amount of data to send in one fragment. actual record size can\n     * be more than this due to padding and MAC overheads.\n     */\n    unsigned int max_send_fragment;\n\n#  ifndef OPENSSL_NO_ENGINE\n    /*\n     * Engine to pass requests for client certs to\n     */\n    ENGINE *client_cert_engine;\n#  endif\n\n#  ifndef OPENSSL_NO_TLSEXT\n    /* TLS extensions servername callback */\n    int (*tlsext_servername_callback) (SSL *, int *, void *);\n    void *tlsext_servername_arg;\n    /* RFC 4507 session ticket keys */\n    unsigned char tlsext_tick_key_name[16];\n    unsigned char tlsext_tick_hmac_key[16];\n    unsigned char tlsext_tick_aes_key[16];\n    /* Callback to support customisation of ticket key setting */\n    int (*tlsext_ticket_key_cb) (SSL *ssl,\n                                 unsigned char *name, unsigned char *iv,\n                                 EVP_CIPHER_CTX *ectx,\n                                 HMAC_CTX *hctx, int enc);\n\n    /* certificate status request info */\n    /* Callback for status request */\n    int (*tlsext_status_cb) (SSL *ssl, void *arg);\n    void *tlsext_status_arg;\n\n    /* draft-rescorla-tls-opaque-prf-input-00.txt information */\n    int (*tlsext_opaque_prf_input_callback) (SSL *, void *peerinput,\n                                             size_t len, void *arg);\n    void *tlsext_opaque_prf_input_callback_arg;\n#  endif\n\n#  ifndef OPENSSL_NO_PSK\n    char *psk_identity_hint;\n    unsigned int (*psk_client_callback) (SSL *ssl, const char *hint,\n                                         char *identity,\n                                         unsigned int max_identity_len,\n                                         unsigned char *psk,\n                                         unsigned int max_psk_len);\n    unsigned int (*psk_server_callback) (SSL *ssl, const char *identity,\n                                         unsigned char *psk,\n                                         unsigned int max_psk_len);\n#  endif\n\n#  ifndef OPENSSL_NO_BUF_FREELISTS\n#   define SSL_MAX_BUF_FREELIST_LEN_DEFAULT 32\n    unsigned int freelist_max_len;\n    struct ssl3_buf_freelist_st *wbuf_freelist;\n    struct ssl3_buf_freelist_st *rbuf_freelist;\n#  endif\n#  ifndef OPENSSL_NO_SRP\n    SRP_CTX srp_ctx;            /* ctx for SRP authentication */\n#  endif\n\n#  ifndef OPENSSL_NO_TLSEXT\n\n#   ifndef OPENSSL_NO_NEXTPROTONEG\n    /* Next protocol negotiation information */\n    /* (for experimental NPN extension). */\n\n    /*\n     * For a server, this contains a callback function by which the set of\n     * advertised protocols can be provided.\n     */\n    int (*next_protos_advertised_cb) (SSL *s, const unsigned char **buf,\n                                      unsigned int *len, void *arg);\n    void *next_protos_advertised_cb_arg;\n    /*\n     * For a client, this contains a callback function that selects the next\n     * protocol from the list provided by the server.\n     */\n    int (*next_proto_select_cb) (SSL *s, unsigned char **out,\n                                 unsigned char *outlen,\n                                 const unsigned char *in,\n                                 unsigned int inlen, void *arg);\n    void *next_proto_select_cb_arg;\n#   endif\n    /* SRTP profiles we are willing to do from RFC 5764 */\n    STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles;\n\n    /*\n     * ALPN information (we are in the process of transitioning from NPN to\n     * ALPN.)\n     */\n\n    /*-\n     * For a server, this contains a callback function that allows the\n     * server to select the protocol for the connection.\n     *   out: on successful return, this must point to the raw protocol\n     *        name (without the length prefix).\n     *   outlen: on successful return, this contains the length of |*out|.\n     *   in: points to the client's list of supported protocols in\n     *       wire-format.\n     *   inlen: the length of |in|.\n     */\n    int (*alpn_select_cb) (SSL *s,\n                           const unsigned char **out,\n                           unsigned char *outlen,\n                           const unsigned char *in,\n                           unsigned int inlen, void *arg);\n    void *alpn_select_cb_arg;\n\n    /*\n     * For a client, this contains the list of supported protocols in wire\n     * format.\n     */\n    unsigned char *alpn_client_proto_list;\n    unsigned alpn_client_proto_list_len;\n\n#   ifndef OPENSSL_NO_EC\n    /* EC extension values inherited by SSL structure */\n    size_t tlsext_ecpointformatlist_length;\n    unsigned char *tlsext_ecpointformatlist;\n    size_t tlsext_ellipticcurvelist_length;\n    unsigned char *tlsext_ellipticcurvelist;\n#   endif                       /* OPENSSL_NO_EC */\n#  endif\n};\n\n# endif\n\n# define SSL_SESS_CACHE_OFF                      0x0000\n# define SSL_SESS_CACHE_CLIENT                   0x0001\n# define SSL_SESS_CACHE_SERVER                   0x0002\n# define SSL_SESS_CACHE_BOTH     (SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER)\n# define SSL_SESS_CACHE_NO_AUTO_CLEAR            0x0080\n/* enough comments already ... see SSL_CTX_set_session_cache_mode(3) */\n# define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP       0x0100\n# define SSL_SESS_CACHE_NO_INTERNAL_STORE        0x0200\n# define SSL_SESS_CACHE_NO_INTERNAL \\\n        (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP|SSL_SESS_CACHE_NO_INTERNAL_STORE)\n\nLHASH_OF(SSL_SESSION) *SSL_CTX_sessions(SSL_CTX *ctx);\n# define SSL_CTX_sess_number(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL)\n# define SSL_CTX_sess_connect(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL)\n# define SSL_CTX_sess_connect_good(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL)\n# define SSL_CTX_sess_connect_renegotiate(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL)\n# define SSL_CTX_sess_accept(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL)\n# define SSL_CTX_sess_accept_renegotiate(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL)\n# define SSL_CTX_sess_accept_good(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL)\n# define SSL_CTX_sess_hits(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL)\n# define SSL_CTX_sess_cb_hits(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL)\n# define SSL_CTX_sess_misses(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL)\n# define SSL_CTX_sess_timeouts(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL)\n# define SSL_CTX_sess_cache_full(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL)\n\nvoid SSL_CTX_sess_set_new_cb(SSL_CTX *ctx,\n                             int (*new_session_cb) (struct ssl_st *ssl,\n                                                    SSL_SESSION *sess));\nint (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx)) (struct ssl_st *ssl,\n                                              SSL_SESSION *sess);\nvoid SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx,\n                                void (*remove_session_cb) (struct ssl_ctx_st\n                                                           *ctx,\n                                                           SSL_SESSION\n                                                           *sess));\nvoid (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx)) (struct ssl_ctx_st *ctx,\n                                                  SSL_SESSION *sess);\nvoid SSL_CTX_sess_set_get_cb(SSL_CTX *ctx,\n                             SSL_SESSION *(*get_session_cb) (struct ssl_st\n                                                             *ssl,\n                                                             unsigned char\n                                                             *data, int len,\n                                                             int *copy));\nSSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx)) (struct ssl_st *ssl,\n                                                       unsigned char *Data,\n                                                       int len, int *copy);\nvoid SSL_CTX_set_info_callback(SSL_CTX *ctx,\n                               void (*cb) (const SSL *ssl, int type,\n                                           int val));\nvoid (*SSL_CTX_get_info_callback(SSL_CTX *ctx)) (const SSL *ssl, int type,\n                                                 int val);\nvoid SSL_CTX_set_client_cert_cb(SSL_CTX *ctx,\n                                int (*client_cert_cb) (SSL *ssl, X509 **x509,\n                                                       EVP_PKEY **pkey));\nint (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx)) (SSL *ssl, X509 **x509,\n                                                 EVP_PKEY **pkey);\n# ifndef OPENSSL_NO_ENGINE\nint SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e);\n# endif\nvoid SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx,\n                                    int (*app_gen_cookie_cb) (SSL *ssl,\n                                                              unsigned char\n                                                              *cookie,\n                                                              unsigned int\n                                                              *cookie_len));\nvoid SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx,\n                                  int (*app_verify_cookie_cb) (SSL *ssl,\n                                                               unsigned char\n                                                               *cookie,\n                                                               unsigned int\n                                                               cookie_len));\n# ifndef OPENSSL_NO_NEXTPROTONEG\nvoid SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *s,\n                                           int (*cb) (SSL *ssl,\n                                                      const unsigned char\n                                                      **out,\n                                                      unsigned int *outlen,\n                                                      void *arg), void *arg);\nvoid SSL_CTX_set_next_proto_select_cb(SSL_CTX *s,\n                                      int (*cb) (SSL *ssl,\n                                                 unsigned char **out,\n                                                 unsigned char *outlen,\n                                                 const unsigned char *in,\n                                                 unsigned int inlen,\n                                                 void *arg), void *arg);\nvoid SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data,\n                                    unsigned *len);\n# endif\n\n# ifndef OPENSSL_NO_TLSEXT\nint SSL_select_next_proto(unsigned char **out, unsigned char *outlen,\n                          const unsigned char *in, unsigned int inlen,\n                          const unsigned char *client,\n                          unsigned int client_len);\n# endif\n\n# define OPENSSL_NPN_UNSUPPORTED 0\n# define OPENSSL_NPN_NEGOTIATED  1\n# define OPENSSL_NPN_NO_OVERLAP  2\n\nint SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const unsigned char *protos,\n                            unsigned protos_len);\nint SSL_set_alpn_protos(SSL *ssl, const unsigned char *protos,\n                        unsigned protos_len);\nvoid SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx,\n                                int (*cb) (SSL *ssl,\n                                           const unsigned char **out,\n                                           unsigned char *outlen,\n                                           const unsigned char *in,\n                                           unsigned int inlen,\n                                           void *arg), void *arg);\nvoid SSL_get0_alpn_selected(const SSL *ssl, const unsigned char **data,\n                            unsigned *len);\n\n# ifndef OPENSSL_NO_PSK\n/*\n * the maximum length of the buffer given to callbacks containing the\n * resulting identity/psk\n */\n#  define PSK_MAX_IDENTITY_LEN 128\n#  define PSK_MAX_PSK_LEN 256\nvoid SSL_CTX_set_psk_client_callback(SSL_CTX *ctx,\n                                     unsigned int (*psk_client_callback) (SSL\n                                                                          *ssl,\n                                                                          const\n                                                                          char\n                                                                          *hint,\n                                                                          char\n                                                                          *identity,\n                                                                          unsigned\n                                                                          int\n                                                                          max_identity_len,\n                                                                          unsigned\n                                                                          char\n                                                                          *psk,\n                                                                          unsigned\n                                                                          int\n                                                                          max_psk_len));\nvoid SSL_set_psk_client_callback(SSL *ssl,\n                                 unsigned int (*psk_client_callback) (SSL\n                                                                      *ssl,\n                                                                      const\n                                                                      char\n                                                                      *hint,\n                                                                      char\n                                                                      *identity,\n                                                                      unsigned\n                                                                      int\n                                                                      max_identity_len,\n                                                                      unsigned\n                                                                      char\n                                                                      *psk,\n                                                                      unsigned\n                                                                      int\n                                                                      max_psk_len));\nvoid SSL_CTX_set_psk_server_callback(SSL_CTX *ctx,\n                                     unsigned int (*psk_server_callback) (SSL\n                                                                          *ssl,\n                                                                          const\n                                                                          char\n                                                                          *identity,\n                                                                          unsigned\n                                                                          char\n                                                                          *psk,\n                                                                          unsigned\n                                                                          int\n                                                                          max_psk_len));\nvoid SSL_set_psk_server_callback(SSL *ssl,\n                                 unsigned int (*psk_server_callback) (SSL\n                                                                      *ssl,\n                                                                      const\n                                                                      char\n                                                                      *identity,\n                                                                      unsigned\n                                                                      char\n                                                                      *psk,\n                                                                      unsigned\n                                                                      int\n                                                                      max_psk_len));\nint SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *identity_hint);\nint SSL_use_psk_identity_hint(SSL *s, const char *identity_hint);\nconst char *SSL_get_psk_identity_hint(const SSL *s);\nconst char *SSL_get_psk_identity(const SSL *s);\n# endif\n\n# ifndef OPENSSL_NO_TLSEXT\n/* Register callbacks to handle custom TLS Extensions for client or server. */\n\nint SSL_CTX_add_client_custom_ext(SSL_CTX *ctx, unsigned int ext_type,\n                                  custom_ext_add_cb add_cb,\n                                  custom_ext_free_cb free_cb,\n                                  void *add_arg,\n                                  custom_ext_parse_cb parse_cb,\n                                  void *parse_arg);\n\nint SSL_CTX_add_server_custom_ext(SSL_CTX *ctx, unsigned int ext_type,\n                                  custom_ext_add_cb add_cb,\n                                  custom_ext_free_cb free_cb,\n                                  void *add_arg,\n                                  custom_ext_parse_cb parse_cb,\n                                  void *parse_arg);\n\nint SSL_extension_supported(unsigned int ext_type);\n\n# endif\n\n# define SSL_NOTHING     1\n# define SSL_WRITING     2\n# define SSL_READING     3\n# define SSL_X509_LOOKUP 4\n\n/* These will only be used when doing non-blocking IO */\n# define SSL_want_nothing(s)     (SSL_want(s) == SSL_NOTHING)\n# define SSL_want_read(s)        (SSL_want(s) == SSL_READING)\n# define SSL_want_write(s)       (SSL_want(s) == SSL_WRITING)\n# define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP)\n\n# define SSL_MAC_FLAG_READ_MAC_STREAM 1\n# define SSL_MAC_FLAG_WRITE_MAC_STREAM 2\n\n# ifndef OPENSSL_NO_SSL_INTERN\n\nstruct ssl_st {\n    /*\n     * protocol version (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION,\n     * DTLS1_VERSION)\n     */\n    int version;\n    /* SSL_ST_CONNECT or SSL_ST_ACCEPT */\n    int type;\n    /* SSLv3 */\n    const SSL_METHOD *method;\n    /*\n     * There are 2 BIO's even though they are normally both the same.  This\n     * is so data can be read and written to different handlers\n     */\n#  ifndef OPENSSL_NO_BIO\n    /* used by SSL_read */\n    BIO *rbio;\n    /* used by SSL_write */\n    BIO *wbio;\n    /* used during session-id reuse to concatenate messages */\n    BIO *bbio;\n#  else\n    /* used by SSL_read */\n    char *rbio;\n    /* used by SSL_write */\n    char *wbio;\n    char *bbio;\n#  endif\n    /*\n     * This holds a variable that indicates what we were doing when a 0 or -1\n     * is returned.  This is needed for non-blocking IO so we know what\n     * request needs re-doing when in SSL_accept or SSL_connect\n     */\n    int rwstate;\n    /* true when we are actually in SSL_accept() or SSL_connect() */\n    int in_handshake;\n    int (*handshake_func) (SSL *);\n    /*\n     * Imagine that here's a boolean member \"init\" that is switched as soon\n     * as SSL_set_{accept/connect}_state is called for the first time, so\n     * that \"state\" and \"handshake_func\" are properly initialized.  But as\n     * handshake_func is == 0 until then, we use this test instead of an\n     * \"init\" member.\n     */\n    /* are we the server side? - mostly used by SSL_clear */\n    int server;\n    /*\n     * Generate a new session or reuse an old one.\n     * NB: For servers, the 'new' session may actually be a previously\n     * cached session or even the previous session unless\n     * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set\n     */\n    int new_session;\n    /* don't send shutdown packets */\n    int quiet_shutdown;\n    /* we have shut things down, 0x01 sent, 0x02 for received */\n    int shutdown;\n    /* where we are */\n    int state;\n    /* where we are when reading */\n    int rstate;\n    BUF_MEM *init_buf;          /* buffer used during init */\n    void *init_msg;             /* pointer to handshake message body, set by\n                                 * ssl3_get_message() */\n    int init_num;               /* amount read/written */\n    int init_off;               /* amount read/written */\n    /* used internally to point at a raw packet */\n    unsigned char *packet;\n    unsigned int packet_length;\n    struct ssl2_state_st *s2;   /* SSLv2 variables */\n    struct ssl3_state_st *s3;   /* SSLv3 variables */\n    struct dtls1_state_st *d1;  /* DTLSv1 variables */\n    int read_ahead;             /* Read as many input bytes as possible (for\n                                 * non-blocking reads) */\n    /* callback that allows applications to peek at protocol messages */\n    void (*msg_callback) (int write_p, int version, int content_type,\n                          const void *buf, size_t len, SSL *ssl, void *arg);\n    void *msg_callback_arg;\n    int hit;                    /* reusing a previous session */\n    X509_VERIFY_PARAM *param;\n#  if 0\n    int purpose;                /* Purpose setting */\n    int trust;                  /* Trust setting */\n#  endif\n    /* crypto */\n    STACK_OF(SSL_CIPHER) *cipher_list;\n    STACK_OF(SSL_CIPHER) *cipher_list_by_id;\n    /*\n     * These are the ones being used, the ones in SSL_SESSION are the ones to\n     * be 'copied' into these ones\n     */\n    int mac_flags;\n    EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */\n    EVP_MD_CTX *read_hash;      /* used for mac generation */\n#  ifndef OPENSSL_NO_COMP\n    COMP_CTX *expand;           /* uncompress */\n#  else\n    char *expand;\n#  endif\n    EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */\n    EVP_MD_CTX *write_hash;     /* used for mac generation */\n#  ifndef OPENSSL_NO_COMP\n    COMP_CTX *compress;         /* compression */\n#  else\n    char *compress;\n#  endif\n    /* session info */\n    /* client cert? */\n    /* This is used to hold the server certificate used */\n    struct cert_st /* CERT */ *cert;\n    /*\n     * the session_id_context is used to ensure sessions are only reused in\n     * the appropriate context\n     */\n    unsigned int sid_ctx_length;\n    unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];\n    /* This can also be in the session once a session is established */\n    SSL_SESSION *session;\n    /* Default generate session ID callback. */\n    GEN_SESSION_CB generate_session_id;\n    /* Used in SSL2 and SSL3 */\n    /*\n     * 0 don't care about verify failure.\n     * 1 fail if verify fails\n     */\n    int verify_mode;\n    /* fail if callback returns 0 */\n    int (*verify_callback) (int ok, X509_STORE_CTX *ctx);\n    /* optional informational callback */\n    void (*info_callback) (const SSL *ssl, int type, int val);\n    /* error bytes to be written */\n    int error;\n    /* actual code */\n    int error_code;\n#  ifndef OPENSSL_NO_KRB5\n    /* Kerberos 5 context */\n    KSSL_CTX *kssl_ctx;\n#  endif                        /* OPENSSL_NO_KRB5 */\n#  ifndef OPENSSL_NO_PSK\n    unsigned int (*psk_client_callback) (SSL *ssl, const char *hint,\n                                         char *identity,\n                                         unsigned int max_identity_len,\n                                         unsigned char *psk,\n                                         unsigned int max_psk_len);\n    unsigned int (*psk_server_callback) (SSL *ssl, const char *identity,\n                                         unsigned char *psk,\n                                         unsigned int max_psk_len);\n#  endif\n    SSL_CTX *ctx;\n    /*\n     * set this flag to 1 and a sleep(1) is put into all SSL_read() and\n     * SSL_write() calls, good for nbio debuging :-)\n     */\n    int debug;\n    /* extra application data */\n    long verify_result;\n    CRYPTO_EX_DATA ex_data;\n    /* for server side, keep the list of CA_dn we can use */\n    STACK_OF(X509_NAME) *client_CA;\n    int references;\n    /* protocol behaviour */\n    unsigned long options;\n    /* API behaviour */\n    unsigned long mode;\n    long max_cert_list;\n    int first_packet;\n    /* what was passed, used for SSLv3/TLS rollback check */\n    int client_version;\n    unsigned int max_send_fragment;\n#  ifndef OPENSSL_NO_TLSEXT\n    /* TLS extension debug callback */\n    void (*tlsext_debug_cb) (SSL *s, int client_server, int type,\n                             unsigned char *data, int len, void *arg);\n    void *tlsext_debug_arg;\n    char *tlsext_hostname;\n    /*-\n     * no further mod of servername\n     * 0 : call the servername extension callback.\n     * 1 : prepare 2, allow last ack just after in server callback.\n     * 2 : don't call servername callback, no ack in server hello\n     */\n    int servername_done;\n    /* certificate status request info */\n    /* Status type or -1 if no status type */\n    int tlsext_status_type;\n    /* Expect OCSP CertificateStatus message */\n    int tlsext_status_expected;\n    /* OCSP status request only */\n    STACK_OF(OCSP_RESPID) *tlsext_ocsp_ids;\n    X509_EXTENSIONS *tlsext_ocsp_exts;\n    /* OCSP response received or to be sent */\n    unsigned char *tlsext_ocsp_resp;\n    int tlsext_ocsp_resplen;\n    /* RFC4507 session ticket expected to be received or sent */\n    int tlsext_ticket_expected;\n#   ifndef OPENSSL_NO_EC\n    size_t tlsext_ecpointformatlist_length;\n    /* our list */\n    unsigned char *tlsext_ecpointformatlist;\n    size_t tlsext_ellipticcurvelist_length;\n    /* our list */\n    unsigned char *tlsext_ellipticcurvelist;\n#   endif                       /* OPENSSL_NO_EC */\n    /*\n     * draft-rescorla-tls-opaque-prf-input-00.txt information to be used for\n     * handshakes\n     */\n    void *tlsext_opaque_prf_input;\n    size_t tlsext_opaque_prf_input_len;\n    /* TLS Session Ticket extension override */\n    TLS_SESSION_TICKET_EXT *tlsext_session_ticket;\n    /* TLS Session Ticket extension callback */\n    tls_session_ticket_ext_cb_fn tls_session_ticket_ext_cb;\n    void *tls_session_ticket_ext_cb_arg;\n    /* TLS pre-shared secret session resumption */\n    tls_session_secret_cb_fn tls_session_secret_cb;\n    void *tls_session_secret_cb_arg;\n    SSL_CTX *initial_ctx;       /* initial ctx, used to store sessions */\n#   ifndef OPENSSL_NO_NEXTPROTONEG\n    /*\n     * Next protocol negotiation. For the client, this is the protocol that\n     * we sent in NextProtocol and is set when handling ServerHello\n     * extensions. For a server, this is the client's selected_protocol from\n     * NextProtocol and is set when handling the NextProtocol message, before\n     * the Finished message.\n     */\n    unsigned char *next_proto_negotiated;\n    unsigned char next_proto_negotiated_len;\n#   endif\n#   define session_ctx initial_ctx\n    /* What we'll do */\n    STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles;\n    /* What's been chosen */\n    SRTP_PROTECTION_PROFILE *srtp_profile;\n        /*-\n         * Is use of the Heartbeat extension negotiated?\n         * 0: disabled\n         * 1: enabled\n         * 2: enabled, but not allowed to send Requests\n         */\n    unsigned int tlsext_heartbeat;\n    /* Indicates if a HeartbeatRequest is in flight */\n    unsigned int tlsext_hb_pending;\n    /* HeartbeatRequest sequence number */\n    unsigned int tlsext_hb_seq;\n#  else\n#   define session_ctx ctx\n#  endif                        /* OPENSSL_NO_TLSEXT */\n    /*-\n     * 1 if we are renegotiating.\n     * 2 if we are a server and are inside a handshake\n     * (i.e. not just sending a HelloRequest)\n     */\n    int renegotiate;\n#  ifndef OPENSSL_NO_SRP\n    /* ctx for SRP authentication */\n    SRP_CTX srp_ctx;\n#  endif\n#  ifndef OPENSSL_NO_TLSEXT\n    /*\n     * For a client, this contains the list of supported protocols in wire\n     * format.\n     */\n    unsigned char *alpn_client_proto_list;\n    unsigned alpn_client_proto_list_len;\n#  endif                        /* OPENSSL_NO_TLSEXT */\n};\n\n# endif\n\n#ifdef __cplusplus\n}\n#endif\n\n# include <openssl/ssl2.h>\n# include <openssl/ssl3.h>\n# include <openssl/tls1.h>      /* This is mostly sslv3 with a few tweaks */\n# include <openssl/dtls1.h>     /* Datagram TLS */\n# include <openssl/ssl23.h>\n# include <openssl/srtp.h>      /* Support for the use_srtp extension */\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* compatibility */\n# define SSL_set_app_data(s,arg)         (SSL_set_ex_data(s,0,(char *)arg))\n# define SSL_get_app_data(s)             (SSL_get_ex_data(s,0))\n# define SSL_SESSION_set_app_data(s,a)   (SSL_SESSION_set_ex_data(s,0,(char *)a))\n# define SSL_SESSION_get_app_data(s)     (SSL_SESSION_get_ex_data(s,0))\n# define SSL_CTX_get_app_data(ctx)       (SSL_CTX_get_ex_data(ctx,0))\n# define SSL_CTX_set_app_data(ctx,arg)   (SSL_CTX_set_ex_data(ctx,0,(char *)arg))\n\n/*\n * The following are the possible values for ssl->state are are used to\n * indicate where we are up to in the SSL connection establishment. The\n * macros that follow are about the only things you should need to use and\n * even then, only when using non-blocking IO. It can also be useful to work\n * out where you were when the connection failed\n */\n\n# define SSL_ST_CONNECT                  0x1000\n# define SSL_ST_ACCEPT                   0x2000\n# define SSL_ST_MASK                     0x0FFF\n# define SSL_ST_INIT                     (SSL_ST_CONNECT|SSL_ST_ACCEPT)\n# define SSL_ST_BEFORE                   0x4000\n# define SSL_ST_OK                       0x03\n# define SSL_ST_RENEGOTIATE              (0x04|SSL_ST_INIT)\n# define SSL_ST_ERR                      (0x05|SSL_ST_INIT)\n\n# define SSL_CB_LOOP                     0x01\n# define SSL_CB_EXIT                     0x02\n# define SSL_CB_READ                     0x04\n# define SSL_CB_WRITE                    0x08\n# define SSL_CB_ALERT                    0x4000/* used in callback */\n# define SSL_CB_READ_ALERT               (SSL_CB_ALERT|SSL_CB_READ)\n# define SSL_CB_WRITE_ALERT              (SSL_CB_ALERT|SSL_CB_WRITE)\n# define SSL_CB_ACCEPT_LOOP              (SSL_ST_ACCEPT|SSL_CB_LOOP)\n# define SSL_CB_ACCEPT_EXIT              (SSL_ST_ACCEPT|SSL_CB_EXIT)\n# define SSL_CB_CONNECT_LOOP             (SSL_ST_CONNECT|SSL_CB_LOOP)\n# define SSL_CB_CONNECT_EXIT             (SSL_ST_CONNECT|SSL_CB_EXIT)\n# define SSL_CB_HANDSHAKE_START          0x10\n# define SSL_CB_HANDSHAKE_DONE           0x20\n\n/* Is the SSL_connection established? */\n# define SSL_get_state(a)                SSL_state(a)\n# define SSL_is_init_finished(a)         (SSL_state(a) == SSL_ST_OK)\n# define SSL_in_init(a)                  (SSL_state(a)&SSL_ST_INIT)\n# define SSL_in_before(a)                (SSL_state(a)&SSL_ST_BEFORE)\n# define SSL_in_connect_init(a)          (SSL_state(a)&SSL_ST_CONNECT)\n# define SSL_in_accept_init(a)           (SSL_state(a)&SSL_ST_ACCEPT)\n\n/*\n * The following 2 states are kept in ssl->rstate when reads fail, you should\n * not need these\n */\n# define SSL_ST_READ_HEADER                      0xF0\n# define SSL_ST_READ_BODY                        0xF1\n# define SSL_ST_READ_DONE                        0xF2\n\n/*-\n * Obtain latest Finished message\n *   -- that we sent (SSL_get_finished)\n *   -- that we expected from peer (SSL_get_peer_finished).\n * Returns length (0 == no Finished so far), copies up to 'count' bytes.\n */\nsize_t SSL_get_finished(const SSL *s, void *buf, size_t count);\nsize_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count);\n\n/*\n * use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 2 options are\n * 'ored' with SSL_VERIFY_PEER if they are desired\n */\n# define SSL_VERIFY_NONE                 0x00\n# define SSL_VERIFY_PEER                 0x01\n# define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02\n# define SSL_VERIFY_CLIENT_ONCE          0x04\n\n# define OpenSSL_add_ssl_algorithms()    SSL_library_init()\n# define SSLeay_add_ssl_algorithms()     SSL_library_init()\n\n/* this is for backward compatibility */\n# if 0                          /* NEW_SSLEAY */\n#  define SSL_CTX_set_default_verify(a,b,c) SSL_CTX_set_verify(a,b,c)\n#  define SSL_set_pref_cipher(c,n)        SSL_set_cipher_list(c,n)\n#  define SSL_add_session(a,b)            SSL_CTX_add_session((a),(b))\n#  define SSL_remove_session(a,b)         SSL_CTX_remove_session((a),(b))\n#  define SSL_flush_sessions(a,b)         SSL_CTX_flush_sessions((a),(b))\n# endif\n/* More backward compatibility */\n# define SSL_get_cipher(s) \\\n                SSL_CIPHER_get_name(SSL_get_current_cipher(s))\n# define SSL_get_cipher_bits(s,np) \\\n                SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np)\n# define SSL_get_cipher_version(s) \\\n                SSL_CIPHER_get_version(SSL_get_current_cipher(s))\n# define SSL_get_cipher_name(s) \\\n                SSL_CIPHER_get_name(SSL_get_current_cipher(s))\n# define SSL_get_time(a)         SSL_SESSION_get_time(a)\n# define SSL_set_time(a,b)       SSL_SESSION_set_time((a),(b))\n# define SSL_get_timeout(a)      SSL_SESSION_get_timeout(a)\n# define SSL_set_timeout(a,b)    SSL_SESSION_set_timeout((a),(b))\n\n# define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id)\n# define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id)\n\nDECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)\n# define SSL_AD_REASON_OFFSET            1000/* offset to get SSL_R_... value\n                                              * from SSL_AD_... */\n/* These alert types are for SSLv3 and TLSv1 */\n# define SSL_AD_CLOSE_NOTIFY             SSL3_AD_CLOSE_NOTIFY\n/* fatal */\n# define SSL_AD_UNEXPECTED_MESSAGE       SSL3_AD_UNEXPECTED_MESSAGE\n/* fatal */\n# define SSL_AD_BAD_RECORD_MAC           SSL3_AD_BAD_RECORD_MAC\n# define SSL_AD_DECRYPTION_FAILED        TLS1_AD_DECRYPTION_FAILED\n# define SSL_AD_RECORD_OVERFLOW          TLS1_AD_RECORD_OVERFLOW\n/* fatal */\n# define SSL_AD_DECOMPRESSION_FAILURE    SSL3_AD_DECOMPRESSION_FAILURE\n/* fatal */\n# define SSL_AD_HANDSHAKE_FAILURE        SSL3_AD_HANDSHAKE_FAILURE\n/* Not for TLS */\n# define SSL_AD_NO_CERTIFICATE           SSL3_AD_NO_CERTIFICATE\n# define SSL_AD_BAD_CERTIFICATE          SSL3_AD_BAD_CERTIFICATE\n# define SSL_AD_UNSUPPORTED_CERTIFICATE  SSL3_AD_UNSUPPORTED_CERTIFICATE\n# define SSL_AD_CERTIFICATE_REVOKED      SSL3_AD_CERTIFICATE_REVOKED\n# define SSL_AD_CERTIFICATE_EXPIRED      SSL3_AD_CERTIFICATE_EXPIRED\n# define SSL_AD_CERTIFICATE_UNKNOWN      SSL3_AD_CERTIFICATE_UNKNOWN\n/* fatal */\n# define SSL_AD_ILLEGAL_PARAMETER        SSL3_AD_ILLEGAL_PARAMETER\n/* fatal */\n# define SSL_AD_UNKNOWN_CA               TLS1_AD_UNKNOWN_CA\n/* fatal */\n# define SSL_AD_ACCESS_DENIED            TLS1_AD_ACCESS_DENIED\n/* fatal */\n# define SSL_AD_DECODE_ERROR             TLS1_AD_DECODE_ERROR\n# define SSL_AD_DECRYPT_ERROR            TLS1_AD_DECRYPT_ERROR\n/* fatal */\n# define SSL_AD_EXPORT_RESTRICTION       TLS1_AD_EXPORT_RESTRICTION\n/* fatal */\n# define SSL_AD_PROTOCOL_VERSION         TLS1_AD_PROTOCOL_VERSION\n/* fatal */\n# define SSL_AD_INSUFFICIENT_SECURITY    TLS1_AD_INSUFFICIENT_SECURITY\n/* fatal */\n# define SSL_AD_INTERNAL_ERROR           TLS1_AD_INTERNAL_ERROR\n# define SSL_AD_USER_CANCELLED           TLS1_AD_USER_CANCELLED\n# define SSL_AD_NO_RENEGOTIATION         TLS1_AD_NO_RENEGOTIATION\n# define SSL_AD_UNSUPPORTED_EXTENSION    TLS1_AD_UNSUPPORTED_EXTENSION\n# define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE\n# define SSL_AD_UNRECOGNIZED_NAME        TLS1_AD_UNRECOGNIZED_NAME\n# define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE\n# define SSL_AD_BAD_CERTIFICATE_HASH_VALUE TLS1_AD_BAD_CERTIFICATE_HASH_VALUE\n/* fatal */\n# define SSL_AD_UNKNOWN_PSK_IDENTITY     TLS1_AD_UNKNOWN_PSK_IDENTITY\n/* fatal */\n# define SSL_AD_INAPPROPRIATE_FALLBACK   TLS1_AD_INAPPROPRIATE_FALLBACK\n# define SSL_ERROR_NONE                  0\n# define SSL_ERROR_SSL                   1\n# define SSL_ERROR_WANT_READ             2\n# define SSL_ERROR_WANT_WRITE            3\n# define SSL_ERROR_WANT_X509_LOOKUP      4\n# define SSL_ERROR_SYSCALL               5/* look at error stack/return\n                                           * value/errno */\n# define SSL_ERROR_ZERO_RETURN           6\n# define SSL_ERROR_WANT_CONNECT          7\n# define SSL_ERROR_WANT_ACCEPT           8\n# define SSL_CTRL_NEED_TMP_RSA                   1\n# define SSL_CTRL_SET_TMP_RSA                    2\n# define SSL_CTRL_SET_TMP_DH                     3\n# define SSL_CTRL_SET_TMP_ECDH                   4\n# define SSL_CTRL_SET_TMP_RSA_CB                 5\n# define SSL_CTRL_SET_TMP_DH_CB                  6\n# define SSL_CTRL_SET_TMP_ECDH_CB                7\n# define SSL_CTRL_GET_SESSION_REUSED             8\n# define SSL_CTRL_GET_CLIENT_CERT_REQUEST        9\n# define SSL_CTRL_GET_NUM_RENEGOTIATIONS         10\n# define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS       11\n# define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS       12\n# define SSL_CTRL_GET_FLAGS                      13\n# define SSL_CTRL_EXTRA_CHAIN_CERT               14\n# define SSL_CTRL_SET_MSG_CALLBACK               15\n# define SSL_CTRL_SET_MSG_CALLBACK_ARG           16\n/* only applies to datagram connections */\n# define SSL_CTRL_SET_MTU                17\n/* Stats */\n# define SSL_CTRL_SESS_NUMBER                    20\n# define SSL_CTRL_SESS_CONNECT                   21\n# define SSL_CTRL_SESS_CONNECT_GOOD              22\n# define SSL_CTRL_SESS_CONNECT_RENEGOTIATE       23\n# define SSL_CTRL_SESS_ACCEPT                    24\n# define SSL_CTRL_SESS_ACCEPT_GOOD               25\n# define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE        26\n# define SSL_CTRL_SESS_HIT                       27\n# define SSL_CTRL_SESS_CB_HIT                    28\n# define SSL_CTRL_SESS_MISSES                    29\n# define SSL_CTRL_SESS_TIMEOUTS                  30\n# define SSL_CTRL_SESS_CACHE_FULL                31\n# define SSL_CTRL_OPTIONS                        32\n# define SSL_CTRL_MODE                           33\n# define SSL_CTRL_GET_READ_AHEAD                 40\n# define SSL_CTRL_SET_READ_AHEAD                 41\n# define SSL_CTRL_SET_SESS_CACHE_SIZE            42\n# define SSL_CTRL_GET_SESS_CACHE_SIZE            43\n# define SSL_CTRL_SET_SESS_CACHE_MODE            44\n# define SSL_CTRL_GET_SESS_CACHE_MODE            45\n# define SSL_CTRL_GET_MAX_CERT_LIST              50\n# define SSL_CTRL_SET_MAX_CERT_LIST              51\n# define SSL_CTRL_SET_MAX_SEND_FRAGMENT          52\n/* see tls1.h for macros based on these */\n# ifndef OPENSSL_NO_TLSEXT\n#  define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB       53\n#  define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG      54\n#  define SSL_CTRL_SET_TLSEXT_HOSTNAME            55\n#  define SSL_CTRL_SET_TLSEXT_DEBUG_CB            56\n#  define SSL_CTRL_SET_TLSEXT_DEBUG_ARG           57\n#  define SSL_CTRL_GET_TLSEXT_TICKET_KEYS         58\n#  define SSL_CTRL_SET_TLSEXT_TICKET_KEYS         59\n#  define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT    60\n#  define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB 61\n#  define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG 62\n#  define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB       63\n#  define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG   64\n#  define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE     65\n#  define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS     66\n#  define SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS     67\n#  define SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS      68\n#  define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS      69\n#  define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP        70\n#  define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP        71\n#  define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB       72\n#  define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB    75\n#  define SSL_CTRL_SET_SRP_VERIFY_PARAM_CB                76\n#  define SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB             77\n#  define SSL_CTRL_SET_SRP_ARG            78\n#  define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME               79\n#  define SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH               80\n#  define SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD               81\n#  ifndef OPENSSL_NO_HEARTBEATS\n#   define SSL_CTRL_TLS_EXT_SEND_HEARTBEAT                         85\n#   define SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING          86\n#   define SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS      87\n#  endif\n# endif                         /* OPENSSL_NO_TLSEXT */\n# define DTLS_CTRL_GET_TIMEOUT           73\n# define DTLS_CTRL_HANDLE_TIMEOUT        74\n# define DTLS_CTRL_LISTEN                        75\n# define SSL_CTRL_GET_RI_SUPPORT                 76\n# define SSL_CTRL_CLEAR_OPTIONS                  77\n# define SSL_CTRL_CLEAR_MODE                     78\n# define SSL_CTRL_GET_EXTRA_CHAIN_CERTS          82\n# define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS        83\n# define SSL_CTRL_CHAIN                          88\n# define SSL_CTRL_CHAIN_CERT                     89\n# define SSL_CTRL_GET_CURVES                     90\n# define SSL_CTRL_SET_CURVES                     91\n# define SSL_CTRL_SET_CURVES_LIST                92\n# define SSL_CTRL_GET_SHARED_CURVE               93\n# define SSL_CTRL_SET_ECDH_AUTO                  94\n# define SSL_CTRL_SET_SIGALGS                    97\n# define SSL_CTRL_SET_SIGALGS_LIST               98\n# define SSL_CTRL_CERT_FLAGS                     99\n# define SSL_CTRL_CLEAR_CERT_FLAGS               100\n# define SSL_CTRL_SET_CLIENT_SIGALGS             101\n# define SSL_CTRL_SET_CLIENT_SIGALGS_LIST        102\n# define SSL_CTRL_GET_CLIENT_CERT_TYPES          103\n# define SSL_CTRL_SET_CLIENT_CERT_TYPES          104\n# define SSL_CTRL_BUILD_CERT_CHAIN               105\n# define SSL_CTRL_SET_VERIFY_CERT_STORE          106\n# define SSL_CTRL_SET_CHAIN_CERT_STORE           107\n# define SSL_CTRL_GET_PEER_SIGNATURE_NID         108\n# define SSL_CTRL_GET_SERVER_TMP_KEY             109\n# define SSL_CTRL_GET_RAW_CIPHERLIST             110\n# define SSL_CTRL_GET_EC_POINT_FORMATS           111\n# define SSL_CTRL_GET_CHAIN_CERTS                115\n# define SSL_CTRL_SELECT_CURRENT_CERT            116\n# define SSL_CTRL_SET_CURRENT_CERT               117\n# define SSL_CTRL_CHECK_PROTO_VERSION            119\n# define DTLS_CTRL_SET_LINK_MTU                  120\n# define DTLS_CTRL_GET_LINK_MIN_MTU              121\n# define SSL_CERT_SET_FIRST                      1\n# define SSL_CERT_SET_NEXT                       2\n# define SSL_CERT_SET_SERVER                     3\n# define DTLSv1_get_timeout(ssl, arg) \\\n        SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg)\n# define DTLSv1_handle_timeout(ssl) \\\n        SSL_ctrl(ssl,DTLS_CTRL_HANDLE_TIMEOUT,0, NULL)\n# define DTLSv1_listen(ssl, peer) \\\n        SSL_ctrl(ssl,DTLS_CTRL_LISTEN,0, (void *)peer)\n# define SSL_session_reused(ssl) \\\n        SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL)\n# define SSL_num_renegotiations(ssl) \\\n        SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL)\n# define SSL_clear_num_renegotiations(ssl) \\\n        SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL)\n# define SSL_total_renegotiations(ssl) \\\n        SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL)\n# define SSL_CTX_need_tmp_RSA(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,NULL)\n# define SSL_CTX_set_tmp_rsa(ctx,rsa) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)\n# define SSL_CTX_set_tmp_dh(ctx,dh) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh)\n# define SSL_CTX_set_tmp_ecdh(ctx,ecdh) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)\n# define SSL_need_tmp_RSA(ssl) \\\n        SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,NULL)\n# define SSL_set_tmp_rsa(ssl,rsa) \\\n        SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)\n# define SSL_set_tmp_dh(ssl,dh) \\\n        SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)dh)\n# define SSL_set_tmp_ecdh(ssl,ecdh) \\\n        SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)\n# define SSL_CTX_add_extra_chain_cert(ctx,x509) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)\n# define SSL_CTX_get_extra_chain_certs(ctx,px509) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,0,px509)\n# define SSL_CTX_get_extra_chain_certs_only(ctx,px509) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,1,px509)\n# define SSL_CTX_clear_extra_chain_certs(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS,0,NULL)\n# define SSL_CTX_set0_chain(ctx,sk) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,0,(char *)sk)\n# define SSL_CTX_set1_chain(ctx,sk) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN,1,(char *)sk)\n# define SSL_CTX_add0_chain_cert(ctx,x509) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,0,(char *)x509)\n# define SSL_CTX_add1_chain_cert(ctx,x509) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,(char *)x509)\n# define SSL_CTX_get0_chain_certs(ctx,px509) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERTS,0,px509)\n# define SSL_CTX_clear_chain_certs(ctx) \\\n        SSL_CTX_set0_chain(ctx,NULL)\n# define SSL_CTX_build_cert_chain(ctx, flags) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL)\n# define SSL_CTX_select_current_cert(ctx,x509) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)x509)\n# define SSL_CTX_set_current_cert(ctx, op) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURRENT_CERT, op, NULL)\n# define SSL_CTX_set0_verify_cert_store(ctx,st) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)st)\n# define SSL_CTX_set1_verify_cert_store(ctx,st) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)st)\n# define SSL_CTX_set0_chain_cert_store(ctx,st) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)st)\n# define SSL_CTX_set1_chain_cert_store(ctx,st) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)st)\n# define SSL_set0_chain(ctx,sk) \\\n        SSL_ctrl(ctx,SSL_CTRL_CHAIN,0,(char *)sk)\n# define SSL_set1_chain(ctx,sk) \\\n        SSL_ctrl(ctx,SSL_CTRL_CHAIN,1,(char *)sk)\n# define SSL_add0_chain_cert(ctx,x509) \\\n        SSL_ctrl(ctx,SSL_CTRL_CHAIN_CERT,0,(char *)x509)\n# define SSL_add1_chain_cert(ctx,x509) \\\n        SSL_ctrl(ctx,SSL_CTRL_CHAIN_CERT,1,(char *)x509)\n# define SSL_get0_chain_certs(ctx,px509) \\\n        SSL_ctrl(ctx,SSL_CTRL_GET_CHAIN_CERTS,0,px509)\n# define SSL_clear_chain_certs(ctx) \\\n        SSL_set0_chain(ctx,NULL)\n# define SSL_build_cert_chain(s, flags) \\\n        SSL_ctrl(s,SSL_CTRL_BUILD_CERT_CHAIN, flags, NULL)\n# define SSL_select_current_cert(ctx,x509) \\\n        SSL_ctrl(ctx,SSL_CTRL_SELECT_CURRENT_CERT,0,(char *)x509)\n# define SSL_set_current_cert(ctx,op) \\\n        SSL_ctrl(ctx,SSL_CTRL_SET_CURRENT_CERT, op, NULL)\n# define SSL_set0_verify_cert_store(s,st) \\\n        SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,0,(char *)st)\n# define SSL_set1_verify_cert_store(s,st) \\\n        SSL_ctrl(s,SSL_CTRL_SET_VERIFY_CERT_STORE,1,(char *)st)\n# define SSL_set0_chain_cert_store(s,st) \\\n        SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,0,(char *)st)\n# define SSL_set1_chain_cert_store(s,st) \\\n        SSL_ctrl(s,SSL_CTRL_SET_CHAIN_CERT_STORE,1,(char *)st)\n# define SSL_get1_curves(ctx, s) \\\n        SSL_ctrl(ctx,SSL_CTRL_GET_CURVES,0,(char *)s)\n# define SSL_CTX_set1_curves(ctx, clist, clistlen) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURVES,clistlen,(char *)clist)\n# define SSL_CTX_set1_curves_list(ctx, s) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CURVES_LIST,0,(char *)s)\n# define SSL_set1_curves(ctx, clist, clistlen) \\\n        SSL_ctrl(ctx,SSL_CTRL_SET_CURVES,clistlen,(char *)clist)\n# define SSL_set1_curves_list(ctx, s) \\\n        SSL_ctrl(ctx,SSL_CTRL_SET_CURVES_LIST,0,(char *)s)\n# define SSL_get_shared_curve(s, n) \\\n        SSL_ctrl(s,SSL_CTRL_GET_SHARED_CURVE,n,NULL)\n# define SSL_CTX_set_ecdh_auto(ctx, onoff) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_ECDH_AUTO,onoff,NULL)\n# define SSL_set_ecdh_auto(s, onoff) \\\n        SSL_ctrl(s,SSL_CTRL_SET_ECDH_AUTO,onoff,NULL)\n# define SSL_CTX_set1_sigalgs(ctx, slist, slistlen) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist)\n# define SSL_CTX_set1_sigalgs_list(ctx, s) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s)\n# define SSL_set1_sigalgs(ctx, slist, slistlen) \\\n        SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist)\n# define SSL_set1_sigalgs_list(ctx, s) \\\n        SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s)\n# define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS,slistlen,(int *)slist)\n# define SSL_CTX_set1_client_sigalgs_list(ctx, s) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)s)\n# define SSL_set1_client_sigalgs(ctx, slist, slistlen) \\\n        SSL_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS,clistlen,(int *)slist)\n# define SSL_set1_client_sigalgs_list(ctx, s) \\\n        SSL_ctrl(ctx,SSL_CTRL_SET_CLIENT_SIGALGS_LIST,0,(char *)s)\n# define SSL_get0_certificate_types(s, clist) \\\n        SSL_ctrl(s, SSL_CTRL_GET_CLIENT_CERT_TYPES, 0, (char *)clist)\n# define SSL_CTX_set1_client_certificate_types(ctx, clist, clistlen) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_CLIENT_CERT_TYPES,clistlen,(char *)clist)\n# define SSL_set1_client_certificate_types(s, clist, clistlen) \\\n        SSL_ctrl(s,SSL_CTRL_SET_CLIENT_CERT_TYPES,clistlen,(char *)clist)\n# define SSL_get_peer_signature_nid(s, pn) \\\n        SSL_ctrl(s,SSL_CTRL_GET_PEER_SIGNATURE_NID,0,pn)\n# define SSL_get_server_tmp_key(s, pk) \\\n        SSL_ctrl(s,SSL_CTRL_GET_SERVER_TMP_KEY,0,pk)\n# define SSL_get0_raw_cipherlist(s, plst) \\\n        SSL_ctrl(s,SSL_CTRL_GET_RAW_CIPHERLIST,0,(char *)plst)\n# define SSL_get0_ec_point_formats(s, plst) \\\n        SSL_ctrl(s,SSL_CTRL_GET_EC_POINT_FORMATS,0,(char *)plst)\n# ifndef OPENSSL_NO_BIO\nBIO_METHOD *BIO_f_ssl(void);\nBIO *BIO_new_ssl(SSL_CTX *ctx, int client);\nBIO *BIO_new_ssl_connect(SSL_CTX *ctx);\nBIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx);\nint BIO_ssl_copy_session_id(BIO *to, BIO *from);\nvoid BIO_ssl_shutdown(BIO *ssl_bio);\n\n# endif\n\nint SSL_CTX_set_cipher_list(SSL_CTX *, const char *str);\nSSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);\nvoid SSL_CTX_free(SSL_CTX *);\nlong SSL_CTX_set_timeout(SSL_CTX *ctx, long t);\nlong SSL_CTX_get_timeout(const SSL_CTX *ctx);\nX509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *);\nvoid SSL_CTX_set_cert_store(SSL_CTX *, X509_STORE *);\nint SSL_want(const SSL *s);\nint SSL_clear(SSL *s);\n\nvoid SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm);\n\nconst SSL_CIPHER *SSL_get_current_cipher(const SSL *s);\nint SSL_CIPHER_get_bits(const SSL_CIPHER *c, int *alg_bits);\nchar *SSL_CIPHER_get_version(const SSL_CIPHER *c);\nconst char *SSL_CIPHER_get_name(const SSL_CIPHER *c);\nunsigned long SSL_CIPHER_get_id(const SSL_CIPHER *c);\n\nint SSL_get_fd(const SSL *s);\nint SSL_get_rfd(const SSL *s);\nint SSL_get_wfd(const SSL *s);\nconst char *SSL_get_cipher_list(const SSL *s, int n);\nchar *SSL_get_shared_ciphers(const SSL *s, char *buf, int len);\nint SSL_get_read_ahead(const SSL *s);\nint SSL_pending(const SSL *s);\n# ifndef OPENSSL_NO_SOCK\nint SSL_set_fd(SSL *s, int fd);\nint SSL_set_rfd(SSL *s, int fd);\nint SSL_set_wfd(SSL *s, int fd);\n# endif\n# ifndef OPENSSL_NO_BIO\nvoid SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio);\nBIO *SSL_get_rbio(const SSL *s);\nBIO *SSL_get_wbio(const SSL *s);\n# endif\nint SSL_set_cipher_list(SSL *s, const char *str);\nvoid SSL_set_read_ahead(SSL *s, int yes);\nint SSL_get_verify_mode(const SSL *s);\nint SSL_get_verify_depth(const SSL *s);\nint (*SSL_get_verify_callback(const SSL *s)) (int, X509_STORE_CTX *);\nvoid SSL_set_verify(SSL *s, int mode,\n                    int (*callback) (int ok, X509_STORE_CTX *ctx));\nvoid SSL_set_verify_depth(SSL *s, int depth);\nvoid SSL_set_cert_cb(SSL *s, int (*cb) (SSL *ssl, void *arg), void *arg);\n# ifndef OPENSSL_NO_RSA\nint SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa);\n# endif\nint SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len);\nint SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey);\nint SSL_use_PrivateKey_ASN1(int pk, SSL *ssl, const unsigned char *d,\n                            long len);\nint SSL_use_certificate(SSL *ssl, X509 *x);\nint SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len);\n\n# ifndef OPENSSL_NO_TLSEXT\n/* Set serverinfo data for the current active cert. */\nint SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,\n                           size_t serverinfo_length);\n#  ifndef OPENSSL_NO_STDIO\nint SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file);\n#  endif                        /* NO_STDIO */\n\n# endif\n\n# ifndef OPENSSL_NO_STDIO\nint SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type);\nint SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type);\nint SSL_use_certificate_file(SSL *ssl, const char *file, int type);\nint SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type);\nint SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type);\nint SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type);\n/* PEM type */\nint SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file);\nSTACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);\nint SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,\n                                        const char *file);\n#  ifndef OPENSSL_SYS_VMS\n/* XXXXX: Better scheme needed! [was: #ifndef MAC_OS_pre_X] */\n#   ifndef OPENSSL_SYS_MACINTOSH_CLASSIC\nint SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,\n                                       const char *dir);\n#   endif\n#  endif\n\n# endif\n\nvoid SSL_load_error_strings(void);\nconst char *SSL_state_string(const SSL *s);\nconst char *SSL_rstate_string(const SSL *s);\nconst char *SSL_state_string_long(const SSL *s);\nconst char *SSL_rstate_string_long(const SSL *s);\nlong SSL_SESSION_get_time(const SSL_SESSION *s);\nlong SSL_SESSION_set_time(SSL_SESSION *s, long t);\nlong SSL_SESSION_get_timeout(const SSL_SESSION *s);\nlong SSL_SESSION_set_timeout(SSL_SESSION *s, long t);\nvoid SSL_copy_session_id(SSL *to, const SSL *from);\nX509 *SSL_SESSION_get0_peer(SSL_SESSION *s);\nint SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx,\n                                unsigned int sid_ctx_len);\n\nSSL_SESSION *SSL_SESSION_new(void);\nconst unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s,\n                                        unsigned int *len);\nunsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s);\n# ifndef OPENSSL_NO_FP_API\nint SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *ses);\n# endif\n# ifndef OPENSSL_NO_BIO\nint SSL_SESSION_print(BIO *fp, const SSL_SESSION *ses);\n# endif\nvoid SSL_SESSION_free(SSL_SESSION *ses);\nint i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp);\nint SSL_set_session(SSL *to, SSL_SESSION *session);\nint SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c);\nint SSL_CTX_remove_session(SSL_CTX *, SSL_SESSION *c);\nint SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB);\nint SSL_set_generate_session_id(SSL *, GEN_SESSION_CB);\nint SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id,\n                                unsigned int id_len);\nSSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,\n                             long length);\n\n# ifdef HEADER_X509_H\nX509 *SSL_get_peer_certificate(const SSL *s);\n# endif\n\nSTACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s);\n\nint SSL_CTX_get_verify_mode(const SSL_CTX *ctx);\nint SSL_CTX_get_verify_depth(const SSL_CTX *ctx);\nint (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx)) (int,\n                                                        X509_STORE_CTX *);\nvoid SSL_CTX_set_verify(SSL_CTX *ctx, int mode,\n                        int (*callback) (int, X509_STORE_CTX *));\nvoid SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth);\nvoid SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx,\n                                      int (*cb) (X509_STORE_CTX *, void *),\n                                      void *arg);\nvoid SSL_CTX_set_cert_cb(SSL_CTX *c, int (*cb) (SSL *ssl, void *arg),\n                         void *arg);\n# ifndef OPENSSL_NO_RSA\nint SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa);\n# endif\nint SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d,\n                                   long len);\nint SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey);\nint SSL_CTX_use_PrivateKey_ASN1(int pk, SSL_CTX *ctx,\n                                const unsigned char *d, long len);\nint SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x);\nint SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len,\n                                 const unsigned char *d);\n\nvoid SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb);\nvoid SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u);\n\nint SSL_CTX_check_private_key(const SSL_CTX *ctx);\nint SSL_check_private_key(const SSL *ctx);\n\nint SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx,\n                                   unsigned int sid_ctx_len);\n\nSSL *SSL_new(SSL_CTX *ctx);\nint SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx,\n                               unsigned int sid_ctx_len);\n\nint SSL_CTX_set_purpose(SSL_CTX *s, int purpose);\nint SSL_set_purpose(SSL *s, int purpose);\nint SSL_CTX_set_trust(SSL_CTX *s, int trust);\nint SSL_set_trust(SSL *s, int trust);\n\nint SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm);\nint SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm);\n\nX509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx);\nX509_VERIFY_PARAM *SSL_get0_param(SSL *ssl);\n\n# ifndef OPENSSL_NO_SRP\nint SSL_CTX_set_srp_username(SSL_CTX *ctx, char *name);\nint SSL_CTX_set_srp_password(SSL_CTX *ctx, char *password);\nint SSL_CTX_set_srp_strength(SSL_CTX *ctx, int strength);\nint SSL_CTX_set_srp_client_pwd_callback(SSL_CTX *ctx,\n                                        char *(*cb) (SSL *, void *));\nint SSL_CTX_set_srp_verify_param_callback(SSL_CTX *ctx,\n                                          int (*cb) (SSL *, void *));\nint SSL_CTX_set_srp_username_callback(SSL_CTX *ctx,\n                                      int (*cb) (SSL *, int *, void *));\nint SSL_CTX_set_srp_cb_arg(SSL_CTX *ctx, void *arg);\n\nint SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g,\n                             BIGNUM *sa, BIGNUM *v, char *info);\nint SSL_set_srp_server_param_pw(SSL *s, const char *user, const char *pass,\n                                const char *grp);\n\nBIGNUM *SSL_get_srp_g(SSL *s);\nBIGNUM *SSL_get_srp_N(SSL *s);\n\nchar *SSL_get_srp_username(SSL *s);\nchar *SSL_get_srp_userinfo(SSL *s);\n# endif\n\nvoid SSL_certs_clear(SSL *s);\nvoid SSL_free(SSL *ssl);\nint SSL_accept(SSL *ssl);\nint SSL_connect(SSL *ssl);\nint SSL_read(SSL *ssl, void *buf, int num);\nint SSL_peek(SSL *ssl, void *buf, int num);\nint SSL_write(SSL *ssl, const void *buf, int num);\nlong SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg);\nlong SSL_callback_ctrl(SSL *, int, void (*)(void));\nlong SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg);\nlong SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void));\n\nint SSL_get_error(const SSL *s, int ret_code);\nconst char *SSL_get_version(const SSL *s);\n\n/* This sets the 'default' SSL version that SSL_new() will create */\nint SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth);\n\n# ifndef OPENSSL_NO_SSL2_METHOD\nconst SSL_METHOD *SSLv2_method(void); /* SSLv2 */\nconst SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */\nconst SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */\n# endif\n\n# ifndef OPENSSL_NO_SSL3_METHOD\nconst SSL_METHOD *SSLv3_method(void); /* SSLv3 */\nconst SSL_METHOD *SSLv3_server_method(void); /* SSLv3 */\nconst SSL_METHOD *SSLv3_client_method(void); /* SSLv3 */\n# endif\n\nconst SSL_METHOD *SSLv23_method(void); /* Negotiate highest available SSL/TLS\n                                        * version */\nconst SSL_METHOD *SSLv23_server_method(void); /* Negotiate highest available\n                                               * SSL/TLS version */\nconst SSL_METHOD *SSLv23_client_method(void); /* Negotiate highest available\n                                               * SSL/TLS version */\n\nconst SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */\nconst SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */\nconst SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */\n\nconst SSL_METHOD *TLSv1_1_method(void); /* TLSv1.1 */\nconst SSL_METHOD *TLSv1_1_server_method(void); /* TLSv1.1 */\nconst SSL_METHOD *TLSv1_1_client_method(void); /* TLSv1.1 */\n\nconst SSL_METHOD *TLSv1_2_method(void); /* TLSv1.2 */\nconst SSL_METHOD *TLSv1_2_server_method(void); /* TLSv1.2 */\nconst SSL_METHOD *TLSv1_2_client_method(void); /* TLSv1.2 */\n\nconst SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */\nconst SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */\nconst SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */\n\nconst SSL_METHOD *DTLSv1_2_method(void); /* DTLSv1.2 */\nconst SSL_METHOD *DTLSv1_2_server_method(void); /* DTLSv1.2 */\nconst SSL_METHOD *DTLSv1_2_client_method(void); /* DTLSv1.2 */\n\nconst SSL_METHOD *DTLS_method(void); /* DTLS 1.0 and 1.2 */\nconst SSL_METHOD *DTLS_server_method(void); /* DTLS 1.0 and 1.2 */\nconst SSL_METHOD *DTLS_client_method(void); /* DTLS 1.0 and 1.2 */\n\nSTACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s);\n\nint SSL_do_handshake(SSL *s);\nint SSL_renegotiate(SSL *s);\nint SSL_renegotiate_abbreviated(SSL *s);\nint SSL_renegotiate_pending(SSL *s);\nint SSL_shutdown(SSL *s);\n\nconst SSL_METHOD *SSL_CTX_get_ssl_method(SSL_CTX *ctx);\nconst SSL_METHOD *SSL_get_ssl_method(SSL *s);\nint SSL_set_ssl_method(SSL *s, const SSL_METHOD *method);\nconst char *SSL_alert_type_string_long(int value);\nconst char *SSL_alert_type_string(int value);\nconst char *SSL_alert_desc_string_long(int value);\nconst char *SSL_alert_desc_string(int value);\n\nvoid SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list);\nvoid SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list);\nSTACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s);\nSTACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s);\nint SSL_add_client_CA(SSL *ssl, X509 *x);\nint SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x);\n\nvoid SSL_set_connect_state(SSL *s);\nvoid SSL_set_accept_state(SSL *s);\n\nlong SSL_get_default_timeout(const SSL *s);\n\nint SSL_library_init(void);\n\nchar *SSL_CIPHER_description(const SSL_CIPHER *, char *buf, int size);\nSTACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk);\n\nSSL *SSL_dup(SSL *ssl);\n\nX509 *SSL_get_certificate(const SSL *ssl);\n/*\n * EVP_PKEY\n */ struct evp_pkey_st *SSL_get_privatekey(const SSL *ssl);\n\nX509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx);\nEVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx);\n\nvoid SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode);\nint SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx);\nvoid SSL_set_quiet_shutdown(SSL *ssl, int mode);\nint SSL_get_quiet_shutdown(const SSL *ssl);\nvoid SSL_set_shutdown(SSL *ssl, int mode);\nint SSL_get_shutdown(const SSL *ssl);\nint SSL_version(const SSL *ssl);\nint SSL_CTX_set_default_verify_paths(SSL_CTX *ctx);\nint SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile,\n                                  const char *CApath);\n# define SSL_get0_session SSL_get_session/* just peek at pointer */\nSSL_SESSION *SSL_get_session(const SSL *ssl);\nSSL_SESSION *SSL_get1_session(SSL *ssl); /* obtain a reference count */\nSSL_CTX *SSL_get_SSL_CTX(const SSL *ssl);\nSSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx);\nvoid SSL_set_info_callback(SSL *ssl,\n                           void (*cb) (const SSL *ssl, int type, int val));\nvoid (*SSL_get_info_callback(const SSL *ssl)) (const SSL *ssl, int type,\n                                               int val);\nint SSL_state(const SSL *ssl);\nvoid SSL_set_state(SSL *ssl, int state);\n\nvoid SSL_set_verify_result(SSL *ssl, long v);\nlong SSL_get_verify_result(const SSL *ssl);\n\nint SSL_set_ex_data(SSL *ssl, int idx, void *data);\nvoid *SSL_get_ex_data(const SSL *ssl, int idx);\nint SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,\n                         CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);\n\nint SSL_SESSION_set_ex_data(SSL_SESSION *ss, int idx, void *data);\nvoid *SSL_SESSION_get_ex_data(const SSL_SESSION *ss, int idx);\nint SSL_SESSION_get_ex_new_index(long argl, void *argp,\n                                 CRYPTO_EX_new *new_func,\n                                 CRYPTO_EX_dup *dup_func,\n                                 CRYPTO_EX_free *free_func);\n\nint SSL_CTX_set_ex_data(SSL_CTX *ssl, int idx, void *data);\nvoid *SSL_CTX_get_ex_data(const SSL_CTX *ssl, int idx);\nint SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,\n                             CRYPTO_EX_dup *dup_func,\n                             CRYPTO_EX_free *free_func);\n\nint SSL_get_ex_data_X509_STORE_CTX_idx(void);\n\n# define SSL_CTX_sess_set_cache_size(ctx,t) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL)\n# define SSL_CTX_sess_get_cache_size(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL)\n# define SSL_CTX_set_session_cache_mode(ctx,m) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL)\n# define SSL_CTX_get_session_cache_mode(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL)\n\n# define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx)\n# define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m)\n# define SSL_CTX_get_read_ahead(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL)\n# define SSL_CTX_set_read_ahead(ctx,m) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL)\n# define SSL_CTX_get_max_cert_list(ctx) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)\n# define SSL_CTX_set_max_cert_list(ctx,m) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)\n# define SSL_get_max_cert_list(ssl) \\\n        SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)\n# define SSL_set_max_cert_list(ssl,m) \\\n        SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)\n\n# define SSL_CTX_set_max_send_fragment(ctx,m) \\\n        SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL)\n# define SSL_set_max_send_fragment(ssl,m) \\\n        SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL)\n\n     /* NB: the keylength is only applicable when is_export is true */\n# ifndef OPENSSL_NO_RSA\nvoid SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,\n                                  RSA *(*cb) (SSL *ssl, int is_export,\n                                              int keylength));\n\nvoid SSL_set_tmp_rsa_callback(SSL *ssl,\n                              RSA *(*cb) (SSL *ssl, int is_export,\n                                          int keylength));\n# endif\n# ifndef OPENSSL_NO_DH\nvoid SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx,\n                                 DH *(*dh) (SSL *ssl, int is_export,\n                                            int keylength));\nvoid SSL_set_tmp_dh_callback(SSL *ssl,\n                             DH *(*dh) (SSL *ssl, int is_export,\n                                        int keylength));\n# endif\n# ifndef OPENSSL_NO_ECDH\nvoid SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx,\n                                   EC_KEY *(*ecdh) (SSL *ssl, int is_export,\n                                                    int keylength));\nvoid SSL_set_tmp_ecdh_callback(SSL *ssl,\n                               EC_KEY *(*ecdh) (SSL *ssl, int is_export,\n                                                int keylength));\n# endif\n\nconst COMP_METHOD *SSL_get_current_compression(SSL *s);\nconst COMP_METHOD *SSL_get_current_expansion(SSL *s);\nconst char *SSL_COMP_get_name(const COMP_METHOD *comp);\nSTACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void);\nSTACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP)\n                                                      *meths);\nvoid SSL_COMP_free_compression_methods(void);\nint SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);\n\nconst SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr);\n\n/* TLS extensions functions */\nint SSL_set_session_ticket_ext(SSL *s, void *ext_data, int ext_len);\n\nint SSL_set_session_ticket_ext_cb(SSL *s, tls_session_ticket_ext_cb_fn cb,\n                                  void *arg);\n\n/* Pre-shared secret session resumption functions */\nint SSL_set_session_secret_cb(SSL *s,\n                              tls_session_secret_cb_fn tls_session_secret_cb,\n                              void *arg);\n\nvoid SSL_set_debug(SSL *s, int debug);\nint SSL_cache_hit(SSL *s);\nint SSL_is_server(SSL *s);\n\nSSL_CONF_CTX *SSL_CONF_CTX_new(void);\nint SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx);\nvoid SSL_CONF_CTX_free(SSL_CONF_CTX *cctx);\nunsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags);\nunsigned int SSL_CONF_CTX_clear_flags(SSL_CONF_CTX *cctx, unsigned int flags);\nint SSL_CONF_CTX_set1_prefix(SSL_CONF_CTX *cctx, const char *pre);\n\nvoid SSL_CONF_CTX_set_ssl(SSL_CONF_CTX *cctx, SSL *ssl);\nvoid SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx);\n\nint SSL_CONF_cmd(SSL_CONF_CTX *cctx, const char *cmd, const char *value);\nint SSL_CONF_cmd_argv(SSL_CONF_CTX *cctx, int *pargc, char ***pargv);\nint SSL_CONF_cmd_value_type(SSL_CONF_CTX *cctx, const char *cmd);\n\n# ifndef OPENSSL_NO_SSL_TRACE\nvoid SSL_trace(int write_p, int version, int content_type,\n               const void *buf, size_t len, SSL *ssl, void *arg);\nconst char *SSL_CIPHER_standard_name(const SSL_CIPHER *c);\n# endif\n\n# ifndef OPENSSL_NO_UNIT_TEST\nconst struct openssl_ssl_test_functions *SSL_test_functions(void);\n# endif\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_SSL_strings(void);\n\n/* Error codes for the SSL functions. */\n\n/* Function codes. */\n# define SSL_F_CHECK_SUITEB_CIPHER_LIST                   331\n# define SSL_F_CLIENT_CERTIFICATE                         100\n# define SSL_F_CLIENT_FINISHED                            167\n# define SSL_F_CLIENT_HELLO                               101\n# define SSL_F_CLIENT_MASTER_KEY                          102\n# define SSL_F_D2I_SSL_SESSION                            103\n# define SSL_F_DO_DTLS1_WRITE                             245\n# define SSL_F_DO_SSL3_WRITE                              104\n# define SSL_F_DTLS1_ACCEPT                               246\n# define SSL_F_DTLS1_ADD_CERT_TO_BUF                      295\n# define SSL_F_DTLS1_BUFFER_RECORD                        247\n# define SSL_F_DTLS1_CHECK_TIMEOUT_NUM                    316\n# define SSL_F_DTLS1_CLIENT_HELLO                         248\n# define SSL_F_DTLS1_CONNECT                              249\n# define SSL_F_DTLS1_ENC                                  250\n# define SSL_F_DTLS1_GET_HELLO_VERIFY                     251\n# define SSL_F_DTLS1_GET_MESSAGE                          252\n# define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT                 253\n# define SSL_F_DTLS1_GET_RECORD                           254\n# define SSL_F_DTLS1_HANDLE_TIMEOUT                       297\n# define SSL_F_DTLS1_HEARTBEAT                            305\n# define SSL_F_DTLS1_OUTPUT_CERT_CHAIN                    255\n# define SSL_F_DTLS1_PREPROCESS_FRAGMENT                  288\n# define SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS             424\n# define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE           256\n# define SSL_F_DTLS1_PROCESS_RECORD                       257\n# define SSL_F_DTLS1_READ_BYTES                           258\n# define SSL_F_DTLS1_READ_FAILED                          259\n# define SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST             260\n# define SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE              261\n# define SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE             262\n# define SSL_F_DTLS1_SEND_CLIENT_VERIFY                   263\n# define SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST            264\n# define SSL_F_DTLS1_SEND_SERVER_CERTIFICATE              265\n# define SSL_F_DTLS1_SEND_SERVER_HELLO                    266\n# define SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE             267\n# define SSL_F_DTLS1_WRITE_APP_DATA_BYTES                 268\n# define SSL_F_GET_CLIENT_FINISHED                        105\n# define SSL_F_GET_CLIENT_HELLO                           106\n# define SSL_F_GET_CLIENT_MASTER_KEY                      107\n# define SSL_F_GET_SERVER_FINISHED                        108\n# define SSL_F_GET_SERVER_HELLO                           109\n# define SSL_F_GET_SERVER_STATIC_DH_KEY                   340\n# define SSL_F_GET_SERVER_VERIFY                          110\n# define SSL_F_I2D_SSL_SESSION                            111\n# define SSL_F_READ_N                                     112\n# define SSL_F_REQUEST_CERTIFICATE                        113\n# define SSL_F_SERVER_FINISH                              239\n# define SSL_F_SERVER_HELLO                               114\n# define SSL_F_SERVER_VERIFY                              240\n# define SSL_F_SSL23_ACCEPT                               115\n# define SSL_F_SSL23_CLIENT_HELLO                         116\n# define SSL_F_SSL23_CONNECT                              117\n# define SSL_F_SSL23_GET_CLIENT_HELLO                     118\n# define SSL_F_SSL23_GET_SERVER_HELLO                     119\n# define SSL_F_SSL23_PEEK                                 237\n# define SSL_F_SSL23_READ                                 120\n# define SSL_F_SSL23_WRITE                                121\n# define SSL_F_SSL2_ACCEPT                                122\n# define SSL_F_SSL2_CONNECT                               123\n# define SSL_F_SSL2_ENC_INIT                              124\n# define SSL_F_SSL2_GENERATE_KEY_MATERIAL                 241\n# define SSL_F_SSL2_PEEK                                  234\n# define SSL_F_SSL2_READ                                  125\n# define SSL_F_SSL2_READ_INTERNAL                         236\n# define SSL_F_SSL2_SET_CERTIFICATE                       126\n# define SSL_F_SSL2_WRITE                                 127\n# define SSL_F_SSL3_ACCEPT                                128\n# define SSL_F_SSL3_ADD_CERT_TO_BUF                       296\n# define SSL_F_SSL3_CALLBACK_CTRL                         233\n# define SSL_F_SSL3_CHANGE_CIPHER_STATE                   129\n# define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM              130\n# define SSL_F_SSL3_CHECK_CLIENT_HELLO                    304\n# define SSL_F_SSL3_CHECK_FINISHED                        339\n# define SSL_F_SSL3_CLIENT_HELLO                          131\n# define SSL_F_SSL3_CONNECT                               132\n# define SSL_F_SSL3_CTRL                                  213\n# define SSL_F_SSL3_CTX_CTRL                              133\n# define SSL_F_SSL3_DIGEST_CACHED_RECORDS                 293\n# define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC                 292\n# define SSL_F_SSL3_ENC                                   134\n# define SSL_F_SSL3_GENERATE_KEY_BLOCK                    238\n# define SSL_F_SSL3_GENERATE_MASTER_SECRET                388\n# define SSL_F_SSL3_GET_CERTIFICATE_REQUEST               135\n# define SSL_F_SSL3_GET_CERT_STATUS                       289\n# define SSL_F_SSL3_GET_CERT_VERIFY                       136\n# define SSL_F_SSL3_GET_CLIENT_CERTIFICATE                137\n# define SSL_F_SSL3_GET_CLIENT_HELLO                      138\n# define SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE               139\n# define SSL_F_SSL3_GET_FINISHED                          140\n# define SSL_F_SSL3_GET_KEY_EXCHANGE                      141\n# define SSL_F_SSL3_GET_MESSAGE                           142\n# define SSL_F_SSL3_GET_NEW_SESSION_TICKET                283\n# define SSL_F_SSL3_GET_NEXT_PROTO                        306\n# define SSL_F_SSL3_GET_RECORD                            143\n# define SSL_F_SSL3_GET_SERVER_CERTIFICATE                144\n# define SSL_F_SSL3_GET_SERVER_DONE                       145\n# define SSL_F_SSL3_GET_SERVER_HELLO                      146\n# define SSL_F_SSL3_HANDSHAKE_MAC                         285\n# define SSL_F_SSL3_NEW_SESSION_TICKET                    287\n# define SSL_F_SSL3_OUTPUT_CERT_CHAIN                     147\n# define SSL_F_SSL3_PEEK                                  235\n# define SSL_F_SSL3_READ_BYTES                            148\n# define SSL_F_SSL3_READ_N                                149\n# define SSL_F_SSL3_SEND_CERTIFICATE_REQUEST              150\n# define SSL_F_SSL3_SEND_CLIENT_CERTIFICATE               151\n# define SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE              152\n# define SSL_F_SSL3_SEND_CLIENT_VERIFY                    153\n# define SSL_F_SSL3_SEND_SERVER_CERTIFICATE               154\n# define SSL_F_SSL3_SEND_SERVER_HELLO                     242\n# define SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE              155\n# define SSL_F_SSL3_SETUP_KEY_BLOCK                       157\n# define SSL_F_SSL3_SETUP_READ_BUFFER                     156\n# define SSL_F_SSL3_SETUP_WRITE_BUFFER                    291\n# define SSL_F_SSL3_WRITE_BYTES                           158\n# define SSL_F_SSL3_WRITE_PENDING                         159\n# define SSL_F_SSL_ADD_CERT_CHAIN                         318\n# define SSL_F_SSL_ADD_CERT_TO_BUF                        319\n# define SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT        298\n# define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT                 277\n# define SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT           307\n# define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK         215\n# define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK        216\n# define SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT        299\n# define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT                 278\n# define SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT           308\n# define SSL_F_SSL_BAD_METHOD                             160\n# define SSL_F_SSL_BUILD_CERT_CHAIN                       332\n# define SSL_F_SSL_BYTES_TO_CIPHER_LIST                   161\n# define SSL_F_SSL_CERT_DUP                               221\n# define SSL_F_SSL_CERT_INST                              222\n# define SSL_F_SSL_CERT_INSTANTIATE                       214\n# define SSL_F_SSL_CERT_NEW                               162\n# define SSL_F_SSL_CHECK_PRIVATE_KEY                      163\n# define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT               280\n# define SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG            279\n# define SSL_F_SSL_CIPHER_PROCESS_RULESTR                 230\n# define SSL_F_SSL_CIPHER_STRENGTH_SORT                   231\n# define SSL_F_SSL_CLEAR                                  164\n# define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD            165\n# define SSL_F_SSL_CONF_CMD                               334\n# define SSL_F_SSL_CREATE_CIPHER_LIST                     166\n# define SSL_F_SSL_CTRL                                   232\n# define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY                  168\n# define SSL_F_SSL_CTX_MAKE_PROFILES                      309\n# define SSL_F_SSL_CTX_NEW                                169\n# define SSL_F_SSL_CTX_SET_CIPHER_LIST                    269\n# define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE             290\n# define SSL_F_SSL_CTX_SET_PURPOSE                        226\n# define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT             219\n# define SSL_F_SSL_CTX_SET_SSL_VERSION                    170\n# define SSL_F_SSL_CTX_SET_TRUST                          229\n# define SSL_F_SSL_CTX_USE_CERTIFICATE                    171\n# define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1               172\n# define SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE         220\n# define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE               173\n# define SSL_F_SSL_CTX_USE_PRIVATEKEY                     174\n# define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1                175\n# define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE                176\n# define SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT              272\n# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY                  177\n# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1             178\n# define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE             179\n# define SSL_F_SSL_CTX_USE_SERVERINFO                     336\n# define SSL_F_SSL_CTX_USE_SERVERINFO_FILE                337\n# define SSL_F_SSL_DO_HANDSHAKE                           180\n# define SSL_F_SSL_GET_NEW_SESSION                        181\n# define SSL_F_SSL_GET_PREV_SESSION                       217\n# define SSL_F_SSL_GET_SERVER_CERT_INDEX                  322\n# define SSL_F_SSL_GET_SERVER_SEND_CERT                   182\n# define SSL_F_SSL_GET_SERVER_SEND_PKEY                   317\n# define SSL_F_SSL_GET_SIGN_PKEY                          183\n# define SSL_F_SSL_INIT_WBIO_BUFFER                       184\n# define SSL_F_SSL_LOAD_CLIENT_CA_FILE                    185\n# define SSL_F_SSL_NEW                                    186\n# define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT      300\n# define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT               302\n# define SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT         310\n# define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT      301\n# define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT               303\n# define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT         311\n# define SSL_F_SSL_PEEK                                   270\n# define SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT             281\n# define SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT             282\n# define SSL_F_SSL_READ                                   223\n# define SSL_F_SSL_RSA_PRIVATE_DECRYPT                    187\n# define SSL_F_SSL_RSA_PUBLIC_ENCRYPT                     188\n# define SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT                320\n# define SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT                321\n# define SSL_F_SSL_SESSION_DUP                            348\n# define SSL_F_SSL_SESSION_NEW                            189\n# define SSL_F_SSL_SESSION_PRINT_FP                       190\n# define SSL_F_SSL_SESSION_SET1_ID_CONTEXT                312\n# define SSL_F_SSL_SESS_CERT_NEW                          225\n# define SSL_F_SSL_SET_CERT                               191\n# define SSL_F_SSL_SET_CIPHER_LIST                        271\n# define SSL_F_SSL_SET_FD                                 192\n# define SSL_F_SSL_SET_PKEY                               193\n# define SSL_F_SSL_SET_PURPOSE                            227\n# define SSL_F_SSL_SET_RFD                                194\n# define SSL_F_SSL_SET_SESSION                            195\n# define SSL_F_SSL_SET_SESSION_ID_CONTEXT                 218\n# define SSL_F_SSL_SET_SESSION_TICKET_EXT                 294\n# define SSL_F_SSL_SET_TRUST                              228\n# define SSL_F_SSL_SET_WFD                                196\n# define SSL_F_SSL_SHUTDOWN                               224\n# define SSL_F_SSL_SRP_CTX_INIT                           313\n# define SSL_F_SSL_UNDEFINED_CONST_FUNCTION               243\n# define SSL_F_SSL_UNDEFINED_FUNCTION                     197\n# define SSL_F_SSL_UNDEFINED_VOID_FUNCTION                244\n# define SSL_F_SSL_USE_CERTIFICATE                        198\n# define SSL_F_SSL_USE_CERTIFICATE_ASN1                   199\n# define SSL_F_SSL_USE_CERTIFICATE_FILE                   200\n# define SSL_F_SSL_USE_PRIVATEKEY                         201\n# define SSL_F_SSL_USE_PRIVATEKEY_ASN1                    202\n# define SSL_F_SSL_USE_PRIVATEKEY_FILE                    203\n# define SSL_F_SSL_USE_PSK_IDENTITY_HINT                  273\n# define SSL_F_SSL_USE_RSAPRIVATEKEY                      204\n# define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1                 205\n# define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE                 206\n# define SSL_F_SSL_VERIFY_CERT_CHAIN                      207\n# define SSL_F_SSL_WRITE                                  208\n# define SSL_F_TLS12_CHECK_PEER_SIGALG                    333\n# define SSL_F_TLS1_CERT_VERIFY_MAC                       286\n# define SSL_F_TLS1_CHANGE_CIPHER_STATE                   209\n# define SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT              274\n# define SSL_F_TLS1_ENC                                   210\n# define SSL_F_TLS1_EXPORT_KEYING_MATERIAL                314\n# define SSL_F_TLS1_GET_CURVELIST                         338\n# define SSL_F_TLS1_HEARTBEAT                             315\n# define SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT            275\n# define SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT            276\n# define SSL_F_TLS1_PRF                                   284\n# define SSL_F_TLS1_SETUP_KEY_BLOCK                       211\n# define SSL_F_TLS1_SET_SERVER_SIGALGS                    335\n# define SSL_F_WRITE_PENDING                              212\n\n/* Reason codes. */\n# define SSL_R_APP_DATA_IN_HANDSHAKE                      100\n# define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272\n# define SSL_R_BAD_ALERT_RECORD                           101\n# define SSL_R_BAD_AUTHENTICATION_TYPE                    102\n# define SSL_R_BAD_CHANGE_CIPHER_SPEC                     103\n# define SSL_R_BAD_CHECKSUM                               104\n# define SSL_R_BAD_DATA                                   390\n# define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK              106\n# define SSL_R_BAD_DECOMPRESSION                          107\n# define SSL_R_BAD_DH_G_LENGTH                            108\n# define SSL_R_BAD_DH_G_VALUE                             375\n# define SSL_R_BAD_DH_PUB_KEY_LENGTH                      109\n# define SSL_R_BAD_DH_PUB_KEY_VALUE                       393\n# define SSL_R_BAD_DH_P_LENGTH                            110\n# define SSL_R_BAD_DH_P_VALUE                             395\n# define SSL_R_BAD_DIGEST_LENGTH                          111\n# define SSL_R_BAD_DSA_SIGNATURE                          112\n# define SSL_R_BAD_ECC_CERT                               304\n# define SSL_R_BAD_ECDSA_SIGNATURE                        305\n# define SSL_R_BAD_ECPOINT                                306\n# define SSL_R_BAD_HANDSHAKE_LENGTH                       332\n# define SSL_R_BAD_HELLO_REQUEST                          105\n# define SSL_R_BAD_LENGTH                                 271\n# define SSL_R_BAD_MAC_DECODE                             113\n# define SSL_R_BAD_MAC_LENGTH                             333\n# define SSL_R_BAD_MESSAGE_TYPE                           114\n# define SSL_R_BAD_PACKET_LENGTH                          115\n# define SSL_R_BAD_PROTOCOL_VERSION_NUMBER                116\n# define SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH               316\n# define SSL_R_BAD_RESPONSE_ARGUMENT                      117\n# define SSL_R_BAD_RSA_DECRYPT                            118\n# define SSL_R_BAD_RSA_ENCRYPT                            119\n# define SSL_R_BAD_RSA_E_LENGTH                           120\n# define SSL_R_BAD_RSA_MODULUS_LENGTH                     121\n# define SSL_R_BAD_RSA_SIGNATURE                          122\n# define SSL_R_BAD_SIGNATURE                              123\n# define SSL_R_BAD_SRP_A_LENGTH                           347\n# define SSL_R_BAD_SRP_B_LENGTH                           348\n# define SSL_R_BAD_SRP_G_LENGTH                           349\n# define SSL_R_BAD_SRP_N_LENGTH                           350\n# define SSL_R_BAD_SRP_PARAMETERS                         371\n# define SSL_R_BAD_SRP_S_LENGTH                           351\n# define SSL_R_BAD_SRTP_MKI_VALUE                         352\n# define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST           353\n# define SSL_R_BAD_SSL_FILETYPE                           124\n# define SSL_R_BAD_SSL_SESSION_ID_LENGTH                  125\n# define SSL_R_BAD_STATE                                  126\n# define SSL_R_BAD_VALUE                                  384\n# define SSL_R_BAD_WRITE_RETRY                            127\n# define SSL_R_BIO_NOT_SET                                128\n# define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG                  129\n# define SSL_R_BN_LIB                                     130\n# define SSL_R_CA_DN_LENGTH_MISMATCH                      131\n# define SSL_R_CA_DN_TOO_LONG                             132\n# define SSL_R_CCS_RECEIVED_EARLY                         133\n# define SSL_R_CERTIFICATE_VERIFY_FAILED                  134\n# define SSL_R_CERT_CB_ERROR                              377\n# define SSL_R_CERT_LENGTH_MISMATCH                       135\n# define SSL_R_CHALLENGE_IS_DIFFERENT                     136\n# define SSL_R_CIPHER_CODE_WRONG_LENGTH                   137\n# define SSL_R_CIPHER_OR_HASH_UNAVAILABLE                 138\n# define SSL_R_CIPHER_TABLE_SRC_ERROR                     139\n# define SSL_R_CLIENTHELLO_TLSEXT                         226\n# define SSL_R_COMPRESSED_LENGTH_TOO_LONG                 140\n# define SSL_R_COMPRESSION_DISABLED                       343\n# define SSL_R_COMPRESSION_FAILURE                        141\n# define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE    307\n# define SSL_R_COMPRESSION_LIBRARY_ERROR                  142\n# define SSL_R_CONNECTION_ID_IS_DIFFERENT                 143\n# define SSL_R_CONNECTION_TYPE_NOT_SET                    144\n# define SSL_R_COOKIE_MISMATCH                            308\n# define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED              145\n# define SSL_R_DATA_LENGTH_TOO_LONG                       146\n# define SSL_R_DECRYPTION_FAILED                          147\n# define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC        281\n# define SSL_R_DH_KEY_TOO_SMALL                           372\n# define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG            148\n# define SSL_R_DIGEST_CHECK_FAILED                        149\n# define SSL_R_DTLS_MESSAGE_TOO_BIG                       334\n# define SSL_R_DUPLICATE_COMPRESSION_ID                   309\n# define SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT             317\n# define SSL_R_ECC_CERT_NOT_FOR_SIGNING                   318\n# define SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE         322\n# define SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE        323\n# define SSL_R_ECDH_REQUIRED_FOR_SUITEB_MODE              374\n# define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER               310\n# define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST         354\n# define SSL_R_ENCRYPTED_LENGTH_TOO_LONG                  150\n# define SSL_R_ERROR_GENERATING_TMP_RSA_KEY               282\n# define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST              151\n# define SSL_R_EXCESSIVE_MESSAGE_SIZE                     152\n# define SSL_R_EXTRA_DATA_IN_MESSAGE                      153\n# define SSL_R_GOT_A_FIN_BEFORE_A_CCS                     154\n# define SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS                355\n# define SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION           356\n# define SSL_R_HTTPS_PROXY_REQUEST                        155\n# define SSL_R_HTTP_REQUEST                               156\n# define SSL_R_ILLEGAL_PADDING                            283\n# define SSL_R_ILLEGAL_SUITEB_DIGEST                      380\n# define SSL_R_INAPPROPRIATE_FALLBACK                     373\n# define SSL_R_INCONSISTENT_COMPRESSION                   340\n# define SSL_R_INVALID_CHALLENGE_LENGTH                   158\n# define SSL_R_INVALID_COMMAND                            280\n# define SSL_R_INVALID_COMPRESSION_ALGORITHM              341\n# define SSL_R_INVALID_NULL_CMD_NAME                      385\n# define SSL_R_INVALID_PURPOSE                            278\n# define SSL_R_INVALID_SERVERINFO_DATA                    388\n# define SSL_R_INVALID_SRP_USERNAME                       357\n# define SSL_R_INVALID_STATUS_RESPONSE                    328\n# define SSL_R_INVALID_TICKET_KEYS_LENGTH                 325\n# define SSL_R_INVALID_TRUST                              279\n# define SSL_R_KEY_ARG_TOO_LONG                           284\n# define SSL_R_KRB5                                       285\n# define SSL_R_KRB5_C_CC_PRINC                            286\n# define SSL_R_KRB5_C_GET_CRED                            287\n# define SSL_R_KRB5_C_INIT                                288\n# define SSL_R_KRB5_C_MK_REQ                              289\n# define SSL_R_KRB5_S_BAD_TICKET                          290\n# define SSL_R_KRB5_S_INIT                                291\n# define SSL_R_KRB5_S_RD_REQ                              292\n# define SSL_R_KRB5_S_TKT_EXPIRED                         293\n# define SSL_R_KRB5_S_TKT_NYV                             294\n# define SSL_R_KRB5_S_TKT_SKEW                            295\n# define SSL_R_LENGTH_MISMATCH                            159\n# define SSL_R_LENGTH_TOO_SHORT                           160\n# define SSL_R_LIBRARY_BUG                                274\n# define SSL_R_LIBRARY_HAS_NO_CIPHERS                     161\n# define SSL_R_MESSAGE_TOO_LONG                           296\n# define SSL_R_MISSING_DH_DSA_CERT                        162\n# define SSL_R_MISSING_DH_KEY                             163\n# define SSL_R_MISSING_DH_RSA_CERT                        164\n# define SSL_R_MISSING_DSA_SIGNING_CERT                   165\n# define SSL_R_MISSING_ECDH_CERT                          382\n# define SSL_R_MISSING_ECDSA_SIGNING_CERT                 381\n# define SSL_R_MISSING_EXPORT_TMP_DH_KEY                  166\n# define SSL_R_MISSING_EXPORT_TMP_RSA_KEY                 167\n# define SSL_R_MISSING_RSA_CERTIFICATE                    168\n# define SSL_R_MISSING_RSA_ENCRYPTING_CERT                169\n# define SSL_R_MISSING_RSA_SIGNING_CERT                   170\n# define SSL_R_MISSING_SRP_PARAM                          358\n# define SSL_R_MISSING_TMP_DH_KEY                         171\n# define SSL_R_MISSING_TMP_ECDH_KEY                       311\n# define SSL_R_MISSING_TMP_RSA_KEY                        172\n# define SSL_R_MISSING_TMP_RSA_PKEY                       173\n# define SSL_R_MISSING_VERIFY_MESSAGE                     174\n# define SSL_R_MULTIPLE_SGC_RESTARTS                      346\n# define SSL_R_NON_SSLV2_INITIAL_PACKET                   175\n# define SSL_R_NO_CERTIFICATES_RETURNED                   176\n# define SSL_R_NO_CERTIFICATE_ASSIGNED                    177\n# define SSL_R_NO_CERTIFICATE_RETURNED                    178\n# define SSL_R_NO_CERTIFICATE_SET                         179\n# define SSL_R_NO_CERTIFICATE_SPECIFIED                   180\n# define SSL_R_NO_CIPHERS_AVAILABLE                       181\n# define SSL_R_NO_CIPHERS_PASSED                          182\n# define SSL_R_NO_CIPHERS_SPECIFIED                       183\n# define SSL_R_NO_CIPHER_LIST                             184\n# define SSL_R_NO_CIPHER_MATCH                            185\n# define SSL_R_NO_CLIENT_CERT_METHOD                      331\n# define SSL_R_NO_CLIENT_CERT_RECEIVED                    186\n# define SSL_R_NO_COMPRESSION_SPECIFIED                   187\n# define SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER           330\n# define SSL_R_NO_METHOD_SPECIFIED                        188\n# define SSL_R_NO_PEM_EXTENSIONS                          389\n# define SSL_R_NO_PRIVATEKEY                              189\n# define SSL_R_NO_PRIVATE_KEY_ASSIGNED                    190\n# define SSL_R_NO_PROTOCOLS_AVAILABLE                     191\n# define SSL_R_NO_PUBLICKEY                               192\n# define SSL_R_NO_RENEGOTIATION                           339\n# define SSL_R_NO_REQUIRED_DIGEST                         324\n# define SSL_R_NO_SHARED_CIPHER                           193\n# define SSL_R_NO_SHARED_SIGATURE_ALGORITHMS              376\n# define SSL_R_NO_SRTP_PROFILES                           359\n# define SSL_R_NO_VERIFY_CALLBACK                         194\n# define SSL_R_NULL_SSL_CTX                               195\n# define SSL_R_NULL_SSL_METHOD_PASSED                     196\n# define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED            197\n# define SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED 344\n# define SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE       387\n# define SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE        379\n# define SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE              297\n# define SSL_R_OPAQUE_PRF_INPUT_TOO_LONG                  327\n# define SSL_R_PACKET_LENGTH_TOO_LONG                     198\n# define SSL_R_PARSE_TLSEXT                               227\n# define SSL_R_PATH_TOO_LONG                              270\n# define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE          199\n# define SSL_R_PEER_ERROR                                 200\n# define SSL_R_PEER_ERROR_CERTIFICATE                     201\n# define SSL_R_PEER_ERROR_NO_CERTIFICATE                  202\n# define SSL_R_PEER_ERROR_NO_CIPHER                       203\n# define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE    204\n# define SSL_R_PEM_NAME_BAD_PREFIX                        391\n# define SSL_R_PEM_NAME_TOO_SHORT                         392\n# define SSL_R_PRE_MAC_LENGTH_TOO_LONG                    205\n# define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS          206\n# define SSL_R_PROTOCOL_IS_SHUTDOWN                       207\n# define SSL_R_PSK_IDENTITY_NOT_FOUND                     223\n# define SSL_R_PSK_NO_CLIENT_CB                           224\n# define SSL_R_PSK_NO_SERVER_CB                           225\n# define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR                   208\n# define SSL_R_PUBLIC_KEY_IS_NOT_RSA                      209\n# define SSL_R_PUBLIC_KEY_NOT_RSA                         210\n# define SSL_R_READ_BIO_NOT_SET                           211\n# define SSL_R_READ_TIMEOUT_EXPIRED                       312\n# define SSL_R_READ_WRONG_PACKET_TYPE                     212\n# define SSL_R_RECORD_LENGTH_MISMATCH                     213\n# define SSL_R_RECORD_TOO_LARGE                           214\n# define SSL_R_RECORD_TOO_SMALL                           298\n# define SSL_R_RENEGOTIATE_EXT_TOO_LONG                   335\n# define SSL_R_RENEGOTIATION_ENCODING_ERR                 336\n# define SSL_R_RENEGOTIATION_MISMATCH                     337\n# define SSL_R_REQUIRED_CIPHER_MISSING                    215\n# define SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING    342\n# define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO                 216\n# define SSL_R_REUSE_CERT_TYPE_NOT_ZERO                   217\n# define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO                 218\n# define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING           345\n# define SSL_R_SERVERHELLO_TLSEXT                         275\n# define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED           277\n# define SSL_R_SHORT_READ                                 219\n# define SSL_R_SHUTDOWN_WHILE_IN_INIT                     407\n# define SSL_R_SIGNATURE_ALGORITHMS_ERROR                 360\n# define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE      220\n# define SSL_R_SRP_A_CALC                                 361\n# define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES           362\n# define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG      363\n# define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE            364\n# define SSL_R_SSL23_DOING_SESSION_ID_REUSE               221\n# define SSL_R_SSL2_CONNECTION_ID_TOO_LONG                299\n# define SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT             321\n# define SSL_R_SSL3_EXT_INVALID_SERVERNAME                319\n# define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE           320\n# define SSL_R_SSL3_SESSION_ID_TOO_LONG                   300\n# define SSL_R_SSL3_SESSION_ID_TOO_SHORT                  222\n# define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE                1042\n# define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC                 1020\n# define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED            1045\n# define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED            1044\n# define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN            1046\n# define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE          1030\n# define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE              1040\n# define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER              1047\n# define SSL_R_SSLV3_ALERT_NO_CERTIFICATE                 1041\n# define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE             1010\n# define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE        1043\n# define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION         228\n# define SSL_R_SSL_HANDSHAKE_FAILURE                      229\n# define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS                 230\n# define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED             301\n# define SSL_R_SSL_SESSION_ID_CONFLICT                    302\n# define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG            273\n# define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH              303\n# define SSL_R_SSL_SESSION_ID_IS_DIFFERENT                231\n# define SSL_R_TLSV1_ALERT_ACCESS_DENIED                  1049\n# define SSL_R_TLSV1_ALERT_DECODE_ERROR                   1050\n# define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED              1021\n# define SSL_R_TLSV1_ALERT_DECRYPT_ERROR                  1051\n# define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION             1060\n# define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK         1086\n# define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY          1071\n# define SSL_R_TLSV1_ALERT_INTERNAL_ERROR                 1080\n# define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION               1100\n# define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION               1070\n# define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW                1022\n# define SSL_R_TLSV1_ALERT_UNKNOWN_CA                     1048\n# define SSL_R_TLSV1_ALERT_USER_CANCELLED                 1090\n# define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE           1114\n# define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE      1113\n# define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE             1111\n# define SSL_R_TLSV1_UNRECOGNIZED_NAME                    1112\n# define SSL_R_TLSV1_UNSUPPORTED_EXTENSION                1110\n# define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER       232\n# define SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT           365\n# define SSL_R_TLS_HEARTBEAT_PENDING                      366\n# define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL                 367\n# define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST             157\n# define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233\n# define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG    234\n# define SSL_R_TOO_MANY_WARN_ALERTS                       409\n# define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER            235\n# define SSL_R_UNABLE_TO_DECODE_DH_CERTS                  236\n# define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS                313\n# define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY               237\n# define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS               238\n# define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS             314\n# define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS       239\n# define SSL_R_UNABLE_TO_FIND_SSL_METHOD                  240\n# define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES           241\n# define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES           242\n# define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES          243\n# define SSL_R_UNEXPECTED_MESSAGE                         244\n# define SSL_R_UNEXPECTED_RECORD                          245\n# define SSL_R_UNINITIALIZED                              276\n# define SSL_R_UNKNOWN_ALERT_TYPE                         246\n# define SSL_R_UNKNOWN_CERTIFICATE_TYPE                   247\n# define SSL_R_UNKNOWN_CIPHER_RETURNED                    248\n# define SSL_R_UNKNOWN_CIPHER_TYPE                        249\n# define SSL_R_UNKNOWN_CMD_NAME                           386\n# define SSL_R_UNKNOWN_DIGEST                             368\n# define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE                  250\n# define SSL_R_UNKNOWN_PKEY_TYPE                          251\n# define SSL_R_UNKNOWN_PROTOCOL                           252\n# define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE                  253\n# define SSL_R_UNKNOWN_SSL_VERSION                        254\n# define SSL_R_UNKNOWN_STATE                              255\n# define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED       338\n# define SSL_R_UNSUPPORTED_CIPHER                         256\n# define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM          257\n# define SSL_R_UNSUPPORTED_DIGEST_TYPE                    326\n# define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE                 315\n# define SSL_R_UNSUPPORTED_PROTOCOL                       258\n# define SSL_R_UNSUPPORTED_SSL_VERSION                    259\n# define SSL_R_UNSUPPORTED_STATUS_TYPE                    329\n# define SSL_R_USE_SRTP_NOT_NEGOTIATED                    369\n# define SSL_R_WRITE_BIO_NOT_SET                          260\n# define SSL_R_WRONG_CERTIFICATE_TYPE                     383\n# define SSL_R_WRONG_CIPHER_RETURNED                      261\n# define SSL_R_WRONG_CURVE                                378\n# define SSL_R_WRONG_MESSAGE_TYPE                         262\n# define SSL_R_WRONG_NUMBER_OF_KEY_BITS                   263\n# define SSL_R_WRONG_SIGNATURE_LENGTH                     264\n# define SSL_R_WRONG_SIGNATURE_SIZE                       265\n# define SSL_R_WRONG_SIGNATURE_TYPE                       370\n# define SSL_R_WRONG_SSL_VERSION                          266\n# define SSL_R_WRONG_VERSION_NUMBER                       267\n# define SSL_R_X509_LIB                                   268\n# define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS           269\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/ssl2.h",
    "content": "/* ssl/ssl2.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_SSL2_H\n# define HEADER_SSL2_H\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* Protocol Version Codes */\n# define SSL2_VERSION            0x0002\n# define SSL2_VERSION_MAJOR      0x00\n# define SSL2_VERSION_MINOR      0x02\n/* #define SSL2_CLIENT_VERSION  0x0002 */\n/* #define SSL2_SERVER_VERSION  0x0002 */\n\n/* Protocol Message Codes */\n# define SSL2_MT_ERROR                   0\n# define SSL2_MT_CLIENT_HELLO            1\n# define SSL2_MT_CLIENT_MASTER_KEY       2\n# define SSL2_MT_CLIENT_FINISHED         3\n# define SSL2_MT_SERVER_HELLO            4\n# define SSL2_MT_SERVER_VERIFY           5\n# define SSL2_MT_SERVER_FINISHED         6\n# define SSL2_MT_REQUEST_CERTIFICATE     7\n# define SSL2_MT_CLIENT_CERTIFICATE      8\n\n/* Error Message Codes */\n# define SSL2_PE_UNDEFINED_ERROR         0x0000\n# define SSL2_PE_NO_CIPHER               0x0001\n# define SSL2_PE_NO_CERTIFICATE          0x0002\n# define SSL2_PE_BAD_CERTIFICATE         0x0004\n# define SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE 0x0006\n\n/* Cipher Kind Values */\n# define SSL2_CK_NULL_WITH_MD5                   0x02000000/* v3 */\n# define SSL2_CK_RC4_128_WITH_MD5                0x02010080\n# define SSL2_CK_RC4_128_EXPORT40_WITH_MD5       0x02020080\n# define SSL2_CK_RC2_128_CBC_WITH_MD5            0x02030080\n# define SSL2_CK_RC2_128_CBC_EXPORT40_WITH_MD5   0x02040080\n# define SSL2_CK_IDEA_128_CBC_WITH_MD5           0x02050080\n# define SSL2_CK_DES_64_CBC_WITH_MD5             0x02060040\n# define SSL2_CK_DES_64_CBC_WITH_SHA             0x02060140/* v3 */\n# define SSL2_CK_DES_192_EDE3_CBC_WITH_MD5       0x020700c0\n# define SSL2_CK_DES_192_EDE3_CBC_WITH_SHA       0x020701c0/* v3 */\n# define SSL2_CK_RC4_64_WITH_MD5                 0x02080080/* MS hack */\n\n# define SSL2_CK_DES_64_CFB64_WITH_MD5_1         0x02ff0800/* SSLeay */\n# define SSL2_CK_NULL                            0x02ff0810/* SSLeay */\n\n# define SSL2_TXT_DES_64_CFB64_WITH_MD5_1        \"DES-CFB-M1\"\n# define SSL2_TXT_NULL_WITH_MD5                  \"NULL-MD5\"\n# define SSL2_TXT_RC4_128_WITH_MD5               \"RC4-MD5\"\n# define SSL2_TXT_RC4_128_EXPORT40_WITH_MD5      \"EXP-RC4-MD5\"\n# define SSL2_TXT_RC2_128_CBC_WITH_MD5           \"RC2-CBC-MD5\"\n# define SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5  \"EXP-RC2-CBC-MD5\"\n# define SSL2_TXT_IDEA_128_CBC_WITH_MD5          \"IDEA-CBC-MD5\"\n# define SSL2_TXT_DES_64_CBC_WITH_MD5            \"DES-CBC-MD5\"\n# define SSL2_TXT_DES_64_CBC_WITH_SHA            \"DES-CBC-SHA\"\n# define SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5      \"DES-CBC3-MD5\"\n# define SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA      \"DES-CBC3-SHA\"\n# define SSL2_TXT_RC4_64_WITH_MD5                \"RC4-64-MD5\"\n\n# define SSL2_TXT_NULL                           \"NULL\"\n\n/* Flags for the SSL_CIPHER.algorithm2 field */\n# define SSL2_CF_5_BYTE_ENC                      0x01\n# define SSL2_CF_8_BYTE_ENC                      0x02\n\n/* Certificate Type Codes */\n# define SSL2_CT_X509_CERTIFICATE                0x01\n\n/* Authentication Type Code */\n# define SSL2_AT_MD5_WITH_RSA_ENCRYPTION         0x01\n\n# define SSL2_MAX_SSL_SESSION_ID_LENGTH          32\n\n/* Upper/Lower Bounds */\n# define SSL2_MAX_MASTER_KEY_LENGTH_IN_BITS      256\n# ifdef OPENSSL_SYS_MPE\n#  define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER    29998u\n# else\n#  define SSL2_MAX_RECORD_LENGTH_2_BYTE_HEADER    32767u\n                                                       /* 2^15-1 */\n# endif\n# define SSL2_MAX_RECORD_LENGTH_3_BYTE_HEADER    16383/* 2^14-1 */\n\n# define SSL2_CHALLENGE_LENGTH   16\n/*\n * #define SSL2_CHALLENGE_LENGTH 32\n */\n# define SSL2_MIN_CHALLENGE_LENGTH       16\n# define SSL2_MAX_CHALLENGE_LENGTH       32\n# define SSL2_CONNECTION_ID_LENGTH       16\n# define SSL2_MAX_CONNECTION_ID_LENGTH   16\n# define SSL2_SSL_SESSION_ID_LENGTH      16\n# define SSL2_MAX_CERT_CHALLENGE_LENGTH  32\n# define SSL2_MIN_CERT_CHALLENGE_LENGTH  16\n# define SSL2_MAX_KEY_MATERIAL_LENGTH    24\n\n# ifndef HEADER_SSL_LOCL_H\n#  define  CERT           char\n# endif\n\n# ifndef OPENSSL_NO_SSL_INTERN\n\ntypedef struct ssl2_state_st {\n    int three_byte_header;\n    int clear_text;             /* clear text */\n    int escape;                 /* not used in SSLv2 */\n    int ssl2_rollback;          /* used if SSLv23 rolled back to SSLv2 */\n    /*\n     * non-blocking io info, used to make sure the same args were passwd\n     */\n    unsigned int wnum;          /* number of bytes sent so far */\n    int wpend_tot;\n    const unsigned char *wpend_buf;\n    int wpend_off;              /* offset to data to write */\n    int wpend_len;              /* number of bytes passwd to write */\n    int wpend_ret;              /* number of bytes to return to caller */\n    /* buffer raw data */\n    int rbuf_left;\n    int rbuf_offs;\n    unsigned char *rbuf;\n    unsigned char *wbuf;\n    unsigned char *write_ptr;   /* used to point to the start due to 2/3 byte\n                                 * header. */\n    unsigned int padding;\n    unsigned int rlength;       /* passed to ssl2_enc */\n    int ract_data_length;       /* Set when things are encrypted. */\n    unsigned int wlength;       /* passed to ssl2_enc */\n    int wact_data_length;       /* Set when things are decrypted. */\n    unsigned char *ract_data;\n    unsigned char *wact_data;\n    unsigned char *mac_data;\n    unsigned char *read_key;\n    unsigned char *write_key;\n    /* Stuff specifically to do with this SSL session */\n    unsigned int challenge_length;\n    unsigned char challenge[SSL2_MAX_CHALLENGE_LENGTH];\n    unsigned int conn_id_length;\n    unsigned char conn_id[SSL2_MAX_CONNECTION_ID_LENGTH];\n    unsigned int key_material_length;\n    unsigned char key_material[SSL2_MAX_KEY_MATERIAL_LENGTH * 2];\n    unsigned long read_sequence;\n    unsigned long write_sequence;\n    struct {\n        unsigned int conn_id_length;\n        unsigned int cert_type;\n        unsigned int cert_length;\n        unsigned int csl;\n        unsigned int clear;\n        unsigned int enc;\n        unsigned char ccl[SSL2_MAX_CERT_CHALLENGE_LENGTH];\n        unsigned int cipher_spec_length;\n        unsigned int session_id_length;\n        unsigned int clen;\n        unsigned int rlen;\n    } tmp;\n} SSL2_STATE;\n\n# endif\n\n/* SSLv2 */\n/* client */\n# define SSL2_ST_SEND_CLIENT_HELLO_A             (0x10|SSL_ST_CONNECT)\n# define SSL2_ST_SEND_CLIENT_HELLO_B             (0x11|SSL_ST_CONNECT)\n# define SSL2_ST_GET_SERVER_HELLO_A              (0x20|SSL_ST_CONNECT)\n# define SSL2_ST_GET_SERVER_HELLO_B              (0x21|SSL_ST_CONNECT)\n# define SSL2_ST_SEND_CLIENT_MASTER_KEY_A        (0x30|SSL_ST_CONNECT)\n# define SSL2_ST_SEND_CLIENT_MASTER_KEY_B        (0x31|SSL_ST_CONNECT)\n# define SSL2_ST_SEND_CLIENT_FINISHED_A          (0x40|SSL_ST_CONNECT)\n# define SSL2_ST_SEND_CLIENT_FINISHED_B          (0x41|SSL_ST_CONNECT)\n# define SSL2_ST_SEND_CLIENT_CERTIFICATE_A       (0x50|SSL_ST_CONNECT)\n# define SSL2_ST_SEND_CLIENT_CERTIFICATE_B       (0x51|SSL_ST_CONNECT)\n# define SSL2_ST_SEND_CLIENT_CERTIFICATE_C       (0x52|SSL_ST_CONNECT)\n# define SSL2_ST_SEND_CLIENT_CERTIFICATE_D       (0x53|SSL_ST_CONNECT)\n# define SSL2_ST_GET_SERVER_VERIFY_A             (0x60|SSL_ST_CONNECT)\n# define SSL2_ST_GET_SERVER_VERIFY_B             (0x61|SSL_ST_CONNECT)\n# define SSL2_ST_GET_SERVER_FINISHED_A           (0x70|SSL_ST_CONNECT)\n# define SSL2_ST_GET_SERVER_FINISHED_B           (0x71|SSL_ST_CONNECT)\n# define SSL2_ST_CLIENT_START_ENCRYPTION         (0x80|SSL_ST_CONNECT)\n# define SSL2_ST_X509_GET_CLIENT_CERTIFICATE     (0x90|SSL_ST_CONNECT)\n/* server */\n# define SSL2_ST_GET_CLIENT_HELLO_A              (0x10|SSL_ST_ACCEPT)\n# define SSL2_ST_GET_CLIENT_HELLO_B              (0x11|SSL_ST_ACCEPT)\n# define SSL2_ST_GET_CLIENT_HELLO_C              (0x12|SSL_ST_ACCEPT)\n# define SSL2_ST_SEND_SERVER_HELLO_A             (0x20|SSL_ST_ACCEPT)\n# define SSL2_ST_SEND_SERVER_HELLO_B             (0x21|SSL_ST_ACCEPT)\n# define SSL2_ST_GET_CLIENT_MASTER_KEY_A         (0x30|SSL_ST_ACCEPT)\n# define SSL2_ST_GET_CLIENT_MASTER_KEY_B         (0x31|SSL_ST_ACCEPT)\n# define SSL2_ST_SEND_SERVER_VERIFY_A            (0x40|SSL_ST_ACCEPT)\n# define SSL2_ST_SEND_SERVER_VERIFY_B            (0x41|SSL_ST_ACCEPT)\n# define SSL2_ST_SEND_SERVER_VERIFY_C            (0x42|SSL_ST_ACCEPT)\n# define SSL2_ST_GET_CLIENT_FINISHED_A           (0x50|SSL_ST_ACCEPT)\n# define SSL2_ST_GET_CLIENT_FINISHED_B           (0x51|SSL_ST_ACCEPT)\n# define SSL2_ST_SEND_SERVER_FINISHED_A          (0x60|SSL_ST_ACCEPT)\n# define SSL2_ST_SEND_SERVER_FINISHED_B          (0x61|SSL_ST_ACCEPT)\n# define SSL2_ST_SEND_REQUEST_CERTIFICATE_A      (0x70|SSL_ST_ACCEPT)\n# define SSL2_ST_SEND_REQUEST_CERTIFICATE_B      (0x71|SSL_ST_ACCEPT)\n# define SSL2_ST_SEND_REQUEST_CERTIFICATE_C      (0x72|SSL_ST_ACCEPT)\n# define SSL2_ST_SEND_REQUEST_CERTIFICATE_D      (0x73|SSL_ST_ACCEPT)\n# define SSL2_ST_SERVER_START_ENCRYPTION         (0x80|SSL_ST_ACCEPT)\n# define SSL2_ST_X509_GET_SERVER_CERTIFICATE     (0x90|SSL_ST_ACCEPT)\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/ssl23.h",
    "content": "/* ssl/ssl23.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_SSL23_H\n# define HEADER_SSL23_H\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * client\n */\n/* write to server */\n# define SSL23_ST_CW_CLNT_HELLO_A        (0x210|SSL_ST_CONNECT)\n# define SSL23_ST_CW_CLNT_HELLO_B        (0x211|SSL_ST_CONNECT)\n/* read from server */\n# define SSL23_ST_CR_SRVR_HELLO_A        (0x220|SSL_ST_CONNECT)\n# define SSL23_ST_CR_SRVR_HELLO_B        (0x221|SSL_ST_CONNECT)\n\n/* server */\n/* read from client */\n# define SSL23_ST_SR_CLNT_HELLO_A        (0x210|SSL_ST_ACCEPT)\n# define SSL23_ST_SR_CLNT_HELLO_B        (0x211|SSL_ST_ACCEPT)\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/ssl3.h",
    "content": "/* ssl/ssl3.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n/* ====================================================================\n * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n/* ====================================================================\n * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.\n * ECC cipher suite support in OpenSSL originally developed by\n * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.\n */\n\n#ifndef HEADER_SSL3_H\n# define HEADER_SSL3_H\n\n# ifndef OPENSSL_NO_COMP\n#  include <openssl/comp.h>\n# endif\n# include <openssl/buffer.h>\n# include <openssl/evp.h>\n# include <openssl/ssl.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * Signalling cipher suite value from RFC 5746\n * (TLS_EMPTY_RENEGOTIATION_INFO_SCSV)\n */\n# define SSL3_CK_SCSV                            0x030000FF\n\n/*\n * Signalling cipher suite value from draft-ietf-tls-downgrade-scsv-00\n * (TLS_FALLBACK_SCSV)\n */\n# define SSL3_CK_FALLBACK_SCSV                   0x03005600\n\n# define SSL3_CK_RSA_NULL_MD5                    0x03000001\n# define SSL3_CK_RSA_NULL_SHA                    0x03000002\n# define SSL3_CK_RSA_RC4_40_MD5                  0x03000003\n# define SSL3_CK_RSA_RC4_128_MD5                 0x03000004\n# define SSL3_CK_RSA_RC4_128_SHA                 0x03000005\n# define SSL3_CK_RSA_RC2_40_MD5                  0x03000006\n# define SSL3_CK_RSA_IDEA_128_SHA                0x03000007\n# define SSL3_CK_RSA_DES_40_CBC_SHA              0x03000008\n# define SSL3_CK_RSA_DES_64_CBC_SHA              0x03000009\n# define SSL3_CK_RSA_DES_192_CBC3_SHA            0x0300000A\n\n# define SSL3_CK_DH_DSS_DES_40_CBC_SHA           0x0300000B\n# define SSL3_CK_DH_DSS_DES_64_CBC_SHA           0x0300000C\n# define SSL3_CK_DH_DSS_DES_192_CBC3_SHA         0x0300000D\n# define SSL3_CK_DH_RSA_DES_40_CBC_SHA           0x0300000E\n# define SSL3_CK_DH_RSA_DES_64_CBC_SHA           0x0300000F\n# define SSL3_CK_DH_RSA_DES_192_CBC3_SHA         0x03000010\n\n# define SSL3_CK_EDH_DSS_DES_40_CBC_SHA          0x03000011\n# define SSL3_CK_DHE_DSS_DES_40_CBC_SHA          SSL3_CK_EDH_DSS_DES_40_CBC_SHA\n# define SSL3_CK_EDH_DSS_DES_64_CBC_SHA          0x03000012\n# define SSL3_CK_DHE_DSS_DES_64_CBC_SHA          SSL3_CK_EDH_DSS_DES_64_CBC_SHA\n# define SSL3_CK_EDH_DSS_DES_192_CBC3_SHA        0x03000013\n# define SSL3_CK_DHE_DSS_DES_192_CBC3_SHA        SSL3_CK_EDH_DSS_DES_192_CBC3_SHA\n# define SSL3_CK_EDH_RSA_DES_40_CBC_SHA          0x03000014\n# define SSL3_CK_DHE_RSA_DES_40_CBC_SHA          SSL3_CK_EDH_RSA_DES_40_CBC_SHA\n# define SSL3_CK_EDH_RSA_DES_64_CBC_SHA          0x03000015\n# define SSL3_CK_DHE_RSA_DES_64_CBC_SHA          SSL3_CK_EDH_RSA_DES_64_CBC_SHA\n# define SSL3_CK_EDH_RSA_DES_192_CBC3_SHA        0x03000016\n# define SSL3_CK_DHE_RSA_DES_192_CBC3_SHA        SSL3_CK_EDH_RSA_DES_192_CBC3_SHA\n\n# define SSL3_CK_ADH_RC4_40_MD5                  0x03000017\n# define SSL3_CK_ADH_RC4_128_MD5                 0x03000018\n# define SSL3_CK_ADH_DES_40_CBC_SHA              0x03000019\n# define SSL3_CK_ADH_DES_64_CBC_SHA              0x0300001A\n# define SSL3_CK_ADH_DES_192_CBC_SHA             0x0300001B\n\n# if 0\n#  define SSL3_CK_FZA_DMS_NULL_SHA                0x0300001C\n#  define SSL3_CK_FZA_DMS_FZA_SHA                 0x0300001D\n#  if 0                         /* Because it clashes with KRB5, is never\n                                 * used any more, and is safe to remove\n                                 * according to David Hopwood\n                                 * <david.hopwood@zetnet.co.uk> of the\n                                 * ietf-tls list */\n#   define SSL3_CK_FZA_DMS_RC4_SHA                 0x0300001E\n#  endif\n# endif\n\n/*\n * VRS Additional Kerberos5 entries\n */\n# define SSL3_CK_KRB5_DES_64_CBC_SHA             0x0300001E\n# define SSL3_CK_KRB5_DES_192_CBC3_SHA           0x0300001F\n# define SSL3_CK_KRB5_RC4_128_SHA                0x03000020\n# define SSL3_CK_KRB5_IDEA_128_CBC_SHA           0x03000021\n# define SSL3_CK_KRB5_DES_64_CBC_MD5             0x03000022\n# define SSL3_CK_KRB5_DES_192_CBC3_MD5           0x03000023\n# define SSL3_CK_KRB5_RC4_128_MD5                0x03000024\n# define SSL3_CK_KRB5_IDEA_128_CBC_MD5           0x03000025\n\n# define SSL3_CK_KRB5_DES_40_CBC_SHA             0x03000026\n# define SSL3_CK_KRB5_RC2_40_CBC_SHA             0x03000027\n# define SSL3_CK_KRB5_RC4_40_SHA                 0x03000028\n# define SSL3_CK_KRB5_DES_40_CBC_MD5             0x03000029\n# define SSL3_CK_KRB5_RC2_40_CBC_MD5             0x0300002A\n# define SSL3_CK_KRB5_RC4_40_MD5                 0x0300002B\n\n# define SSL3_TXT_RSA_NULL_MD5                   \"NULL-MD5\"\n# define SSL3_TXT_RSA_NULL_SHA                   \"NULL-SHA\"\n# define SSL3_TXT_RSA_RC4_40_MD5                 \"EXP-RC4-MD5\"\n# define SSL3_TXT_RSA_RC4_128_MD5                \"RC4-MD5\"\n# define SSL3_TXT_RSA_RC4_128_SHA                \"RC4-SHA\"\n# define SSL3_TXT_RSA_RC2_40_MD5                 \"EXP-RC2-CBC-MD5\"\n# define SSL3_TXT_RSA_IDEA_128_SHA               \"IDEA-CBC-SHA\"\n# define SSL3_TXT_RSA_DES_40_CBC_SHA             \"EXP-DES-CBC-SHA\"\n# define SSL3_TXT_RSA_DES_64_CBC_SHA             \"DES-CBC-SHA\"\n# define SSL3_TXT_RSA_DES_192_CBC3_SHA           \"DES-CBC3-SHA\"\n\n# define SSL3_TXT_DH_DSS_DES_40_CBC_SHA          \"EXP-DH-DSS-DES-CBC-SHA\"\n# define SSL3_TXT_DH_DSS_DES_64_CBC_SHA          \"DH-DSS-DES-CBC-SHA\"\n# define SSL3_TXT_DH_DSS_DES_192_CBC3_SHA        \"DH-DSS-DES-CBC3-SHA\"\n# define SSL3_TXT_DH_RSA_DES_40_CBC_SHA          \"EXP-DH-RSA-DES-CBC-SHA\"\n# define SSL3_TXT_DH_RSA_DES_64_CBC_SHA          \"DH-RSA-DES-CBC-SHA\"\n# define SSL3_TXT_DH_RSA_DES_192_CBC3_SHA        \"DH-RSA-DES-CBC3-SHA\"\n\n# define SSL3_TXT_DHE_DSS_DES_40_CBC_SHA         \"EXP-DHE-DSS-DES-CBC-SHA\"\n# define SSL3_TXT_DHE_DSS_DES_64_CBC_SHA         \"DHE-DSS-DES-CBC-SHA\"\n# define SSL3_TXT_DHE_DSS_DES_192_CBC3_SHA       \"DHE-DSS-DES-CBC3-SHA\"\n# define SSL3_TXT_DHE_RSA_DES_40_CBC_SHA         \"EXP-DHE-RSA-DES-CBC-SHA\"\n# define SSL3_TXT_DHE_RSA_DES_64_CBC_SHA         \"DHE-RSA-DES-CBC-SHA\"\n# define SSL3_TXT_DHE_RSA_DES_192_CBC3_SHA       \"DHE-RSA-DES-CBC3-SHA\"\n\n/*\n * This next block of six \"EDH\" labels is for backward compatibility with\n * older versions of OpenSSL.  New code should use the six \"DHE\" labels above\n * instead:\n */\n# define SSL3_TXT_EDH_DSS_DES_40_CBC_SHA         \"EXP-EDH-DSS-DES-CBC-SHA\"\n# define SSL3_TXT_EDH_DSS_DES_64_CBC_SHA         \"EDH-DSS-DES-CBC-SHA\"\n# define SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA       \"EDH-DSS-DES-CBC3-SHA\"\n# define SSL3_TXT_EDH_RSA_DES_40_CBC_SHA         \"EXP-EDH-RSA-DES-CBC-SHA\"\n# define SSL3_TXT_EDH_RSA_DES_64_CBC_SHA         \"EDH-RSA-DES-CBC-SHA\"\n# define SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA       \"EDH-RSA-DES-CBC3-SHA\"\n\n# define SSL3_TXT_ADH_RC4_40_MD5                 \"EXP-ADH-RC4-MD5\"\n# define SSL3_TXT_ADH_RC4_128_MD5                \"ADH-RC4-MD5\"\n# define SSL3_TXT_ADH_DES_40_CBC_SHA             \"EXP-ADH-DES-CBC-SHA\"\n# define SSL3_TXT_ADH_DES_64_CBC_SHA             \"ADH-DES-CBC-SHA\"\n# define SSL3_TXT_ADH_DES_192_CBC_SHA            \"ADH-DES-CBC3-SHA\"\n\n# if 0\n#  define SSL3_TXT_FZA_DMS_NULL_SHA               \"FZA-NULL-SHA\"\n#  define SSL3_TXT_FZA_DMS_FZA_SHA                \"FZA-FZA-CBC-SHA\"\n#  define SSL3_TXT_FZA_DMS_RC4_SHA                \"FZA-RC4-SHA\"\n# endif\n\n# define SSL3_TXT_KRB5_DES_64_CBC_SHA            \"KRB5-DES-CBC-SHA\"\n# define SSL3_TXT_KRB5_DES_192_CBC3_SHA          \"KRB5-DES-CBC3-SHA\"\n# define SSL3_TXT_KRB5_RC4_128_SHA               \"KRB5-RC4-SHA\"\n# define SSL3_TXT_KRB5_IDEA_128_CBC_SHA          \"KRB5-IDEA-CBC-SHA\"\n# define SSL3_TXT_KRB5_DES_64_CBC_MD5            \"KRB5-DES-CBC-MD5\"\n# define SSL3_TXT_KRB5_DES_192_CBC3_MD5          \"KRB5-DES-CBC3-MD5\"\n# define SSL3_TXT_KRB5_RC4_128_MD5               \"KRB5-RC4-MD5\"\n# define SSL3_TXT_KRB5_IDEA_128_CBC_MD5          \"KRB5-IDEA-CBC-MD5\"\n\n# define SSL3_TXT_KRB5_DES_40_CBC_SHA            \"EXP-KRB5-DES-CBC-SHA\"\n# define SSL3_TXT_KRB5_RC2_40_CBC_SHA            \"EXP-KRB5-RC2-CBC-SHA\"\n# define SSL3_TXT_KRB5_RC4_40_SHA                \"EXP-KRB5-RC4-SHA\"\n# define SSL3_TXT_KRB5_DES_40_CBC_MD5            \"EXP-KRB5-DES-CBC-MD5\"\n# define SSL3_TXT_KRB5_RC2_40_CBC_MD5            \"EXP-KRB5-RC2-CBC-MD5\"\n# define SSL3_TXT_KRB5_RC4_40_MD5                \"EXP-KRB5-RC4-MD5\"\n\n# define SSL3_SSL_SESSION_ID_LENGTH              32\n# define SSL3_MAX_SSL_SESSION_ID_LENGTH          32\n\n# define SSL3_MASTER_SECRET_SIZE                 48\n# define SSL3_RANDOM_SIZE                        32\n# define SSL3_SESSION_ID_SIZE                    32\n# define SSL3_RT_HEADER_LENGTH                   5\n\n# define SSL3_HM_HEADER_LENGTH                  4\n\n# ifndef SSL3_ALIGN_PAYLOAD\n /*\n  * Some will argue that this increases memory footprint, but it's not\n  * actually true. Point is that malloc has to return at least 64-bit aligned\n  * pointers, meaning that allocating 5 bytes wastes 3 bytes in either case.\n  * Suggested pre-gaping simply moves these wasted bytes from the end of\n  * allocated region to its front, but makes data payload aligned, which\n  * improves performance:-)\n  */\n#  define SSL3_ALIGN_PAYLOAD                     8\n# else\n#  if (SSL3_ALIGN_PAYLOAD&(SSL3_ALIGN_PAYLOAD-1))!=0\n#   error \"insane SSL3_ALIGN_PAYLOAD\"\n#   undef SSL3_ALIGN_PAYLOAD\n#  endif\n# endif\n\n/*\n * This is the maximum MAC (digest) size used by the SSL library. Currently\n * maximum of 20 is used by SHA1, but we reserve for future extension for\n * 512-bit hashes.\n */\n\n# define SSL3_RT_MAX_MD_SIZE                     64\n\n/*\n * Maximum block size used in all ciphersuites. Currently 16 for AES.\n */\n\n# define SSL_RT_MAX_CIPHER_BLOCK_SIZE            16\n\n# define SSL3_RT_MAX_EXTRA                       (16384)\n\n/* Maximum plaintext length: defined by SSL/TLS standards */\n# define SSL3_RT_MAX_PLAIN_LENGTH                16384\n/* Maximum compression overhead: defined by SSL/TLS standards */\n# define SSL3_RT_MAX_COMPRESSED_OVERHEAD         1024\n\n/*\n * The standards give a maximum encryption overhead of 1024 bytes. In\n * practice the value is lower than this. The overhead is the maximum number\n * of padding bytes (256) plus the mac size.\n */\n# define SSL3_RT_MAX_ENCRYPTED_OVERHEAD  (256 + SSL3_RT_MAX_MD_SIZE)\n\n/*\n * OpenSSL currently only uses a padding length of at most one block so the\n * send overhead is smaller.\n */\n\n# define SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD \\\n                        (SSL_RT_MAX_CIPHER_BLOCK_SIZE + SSL3_RT_MAX_MD_SIZE)\n\n/* If compression isn't used don't include the compression overhead */\n\n# ifdef OPENSSL_NO_COMP\n#  define SSL3_RT_MAX_COMPRESSED_LENGTH           SSL3_RT_MAX_PLAIN_LENGTH\n# else\n#  define SSL3_RT_MAX_COMPRESSED_LENGTH   \\\n                (SSL3_RT_MAX_PLAIN_LENGTH+SSL3_RT_MAX_COMPRESSED_OVERHEAD)\n# endif\n# define SSL3_RT_MAX_ENCRYPTED_LENGTH    \\\n                (SSL3_RT_MAX_ENCRYPTED_OVERHEAD+SSL3_RT_MAX_COMPRESSED_LENGTH)\n# define SSL3_RT_MAX_PACKET_SIZE         \\\n                (SSL3_RT_MAX_ENCRYPTED_LENGTH+SSL3_RT_HEADER_LENGTH)\n\n# define SSL3_MD_CLIENT_FINISHED_CONST   \"\\x43\\x4C\\x4E\\x54\"\n# define SSL3_MD_SERVER_FINISHED_CONST   \"\\x53\\x52\\x56\\x52\"\n\n# define SSL3_VERSION                    0x0300\n# define SSL3_VERSION_MAJOR              0x03\n# define SSL3_VERSION_MINOR              0x00\n\n# define SSL3_RT_CHANGE_CIPHER_SPEC      20\n# define SSL3_RT_ALERT                   21\n# define SSL3_RT_HANDSHAKE               22\n# define SSL3_RT_APPLICATION_DATA        23\n# define TLS1_RT_HEARTBEAT               24\n\n/* Pseudo content types to indicate additional parameters */\n# define TLS1_RT_CRYPTO                  0x1000\n# define TLS1_RT_CRYPTO_PREMASTER        (TLS1_RT_CRYPTO | 0x1)\n# define TLS1_RT_CRYPTO_CLIENT_RANDOM    (TLS1_RT_CRYPTO | 0x2)\n# define TLS1_RT_CRYPTO_SERVER_RANDOM    (TLS1_RT_CRYPTO | 0x3)\n# define TLS1_RT_CRYPTO_MASTER           (TLS1_RT_CRYPTO | 0x4)\n\n# define TLS1_RT_CRYPTO_READ             0x0000\n# define TLS1_RT_CRYPTO_WRITE            0x0100\n# define TLS1_RT_CRYPTO_MAC              (TLS1_RT_CRYPTO | 0x5)\n# define TLS1_RT_CRYPTO_KEY              (TLS1_RT_CRYPTO | 0x6)\n# define TLS1_RT_CRYPTO_IV               (TLS1_RT_CRYPTO | 0x7)\n# define TLS1_RT_CRYPTO_FIXED_IV         (TLS1_RT_CRYPTO | 0x8)\n\n/* Pseudo content type for SSL/TLS header info */\n# define SSL3_RT_HEADER                  0x100\n\n# define SSL3_AL_WARNING                 1\n# define SSL3_AL_FATAL                   2\n\n# define SSL3_AD_CLOSE_NOTIFY             0\n# define SSL3_AD_UNEXPECTED_MESSAGE      10/* fatal */\n# define SSL3_AD_BAD_RECORD_MAC          20/* fatal */\n# define SSL3_AD_DECOMPRESSION_FAILURE   30/* fatal */\n# define SSL3_AD_HANDSHAKE_FAILURE       40/* fatal */\n# define SSL3_AD_NO_CERTIFICATE          41\n# define SSL3_AD_BAD_CERTIFICATE         42\n# define SSL3_AD_UNSUPPORTED_CERTIFICATE 43\n# define SSL3_AD_CERTIFICATE_REVOKED     44\n# define SSL3_AD_CERTIFICATE_EXPIRED     45\n# define SSL3_AD_CERTIFICATE_UNKNOWN     46\n# define SSL3_AD_ILLEGAL_PARAMETER       47/* fatal */\n\n# define TLS1_HB_REQUEST         1\n# define TLS1_HB_RESPONSE        2\n\n# ifndef OPENSSL_NO_SSL_INTERN\n\ntypedef struct ssl3_record_st {\n    /* type of record */\n    /*\n     * r\n     */ int type;\n    /* How many bytes available */\n    /*\n     * rw\n     */ unsigned int length;\n    /* read/write offset into 'buf' */\n    /*\n     * r\n     */ unsigned int off;\n    /* pointer to the record data */\n    /*\n     * rw\n     */ unsigned char *data;\n    /* where the decode bytes are */\n    /*\n     * rw\n     */ unsigned char *input;\n    /* only used with decompression - malloc()ed */\n    /*\n     * r\n     */ unsigned char *comp;\n    /* epoch number, needed by DTLS1 */\n    /*\n     * r\n     */ unsigned long epoch;\n    /* sequence number, needed by DTLS1 */\n    /*\n     * r\n     */ unsigned char seq_num[8];\n} SSL3_RECORD;\n\ntypedef struct ssl3_buffer_st {\n    /* at least SSL3_RT_MAX_PACKET_SIZE bytes, see ssl3_setup_buffers() */\n    unsigned char *buf;\n    /* buffer size */\n    size_t len;\n    /* where to 'copy from' */\n    int offset;\n    /* how many bytes left */\n    int left;\n} SSL3_BUFFER;\n\n# endif\n\n# define SSL3_CT_RSA_SIGN                        1\n# define SSL3_CT_DSS_SIGN                        2\n# define SSL3_CT_RSA_FIXED_DH                    3\n# define SSL3_CT_DSS_FIXED_DH                    4\n# define SSL3_CT_RSA_EPHEMERAL_DH                5\n# define SSL3_CT_DSS_EPHEMERAL_DH                6\n# define SSL3_CT_FORTEZZA_DMS                    20\n/*\n * SSL3_CT_NUMBER is used to size arrays and it must be large enough to\n * contain all of the cert types defined either for SSLv3 and TLSv1.\n */\n# define SSL3_CT_NUMBER                  9\n\n# define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS       0x0001\n# define SSL3_FLAGS_DELAY_CLIENT_FINISHED        0x0002\n# define SSL3_FLAGS_POP_BUFFER                   0x0004\n# define TLS1_FLAGS_TLS_PADDING_BUG              0x0008\n# define TLS1_FLAGS_SKIP_CERT_VERIFY             0x0010\n# define TLS1_FLAGS_KEEP_HANDSHAKE               0x0020\n/*\n * Set when the handshake is ready to process peer's ChangeCipherSpec message.\n * Cleared after the message has been processed.\n */\n# define SSL3_FLAGS_CCS_OK                       0x0080\n\n/* SSL3_FLAGS_SGC_RESTART_DONE is no longer used */\n# define SSL3_FLAGS_SGC_RESTART_DONE             0x0040\n\n# ifndef OPENSSL_NO_SSL_INTERN\n\ntypedef struct ssl3_state_st {\n    long flags;\n    int delay_buf_pop_ret;\n    unsigned char read_sequence[8];\n    int read_mac_secret_size;\n    unsigned char read_mac_secret[EVP_MAX_MD_SIZE];\n    unsigned char write_sequence[8];\n    int write_mac_secret_size;\n    unsigned char write_mac_secret[EVP_MAX_MD_SIZE];\n    unsigned char server_random[SSL3_RANDOM_SIZE];\n    unsigned char client_random[SSL3_RANDOM_SIZE];\n    /* flags for countermeasure against known-IV weakness */\n    int need_empty_fragments;\n    int empty_fragment_done;\n    /* The value of 'extra' when the buffers were initialized */\n    int init_extra;\n    SSL3_BUFFER rbuf;           /* read IO goes into here */\n    SSL3_BUFFER wbuf;           /* write IO goes into here */\n    SSL3_RECORD rrec;           /* each decoded record goes in here */\n    SSL3_RECORD wrec;           /* goes out from here */\n    /*\n     * storage for Alert/Handshake protocol data received but not yet\n     * processed by ssl3_read_bytes:\n     */\n    unsigned char alert_fragment[2];\n    unsigned int alert_fragment_len;\n    unsigned char handshake_fragment[4];\n    unsigned int handshake_fragment_len;\n    /* partial write - check the numbers match */\n    unsigned int wnum;          /* number of bytes sent so far */\n    int wpend_tot;              /* number bytes written */\n    int wpend_type;\n    int wpend_ret;              /* number of bytes submitted */\n    const unsigned char *wpend_buf;\n    /* used during startup, digest all incoming/outgoing packets */\n    BIO *handshake_buffer;\n    /*\n     * When set of handshake digests is determined, buffer is hashed and\n     * freed and MD_CTX-es for all required digests are stored in this array\n     */\n    EVP_MD_CTX **handshake_dgst;\n    /*\n     * Set whenever an expected ChangeCipherSpec message is processed.\n     * Unset when the peer's Finished message is received.\n     * Unexpected ChangeCipherSpec messages trigger a fatal alert.\n     */\n    int change_cipher_spec;\n    int warn_alert;\n    int fatal_alert;\n    /*\n     * we allow one fatal and one warning alert to be outstanding, send close\n     * alert via the warning alert\n     */\n    int alert_dispatch;\n    unsigned char send_alert[2];\n    /*\n     * This flag is set when we should renegotiate ASAP, basically when there\n     * is no more data in the read or write buffers\n     */\n    int renegotiate;\n    int total_renegotiations;\n    int num_renegotiations;\n    int in_read_app_data;\n    /*\n     * Opaque PRF input as used for the current handshake. These fields are\n     * used only if TLSEXT_TYPE_opaque_prf_input is defined (otherwise, they\n     * are merely present to improve binary compatibility)\n     */\n    void *client_opaque_prf_input;\n    size_t client_opaque_prf_input_len;\n    void *server_opaque_prf_input;\n    size_t server_opaque_prf_input_len;\n    struct {\n        /* actually only needs to be 16+20 */\n        unsigned char cert_verify_md[EVP_MAX_MD_SIZE * 2];\n        /* actually only need to be 16+20 for SSLv3 and 12 for TLS */\n        unsigned char finish_md[EVP_MAX_MD_SIZE * 2];\n        int finish_md_len;\n        unsigned char peer_finish_md[EVP_MAX_MD_SIZE * 2];\n        int peer_finish_md_len;\n        unsigned long message_size;\n        int message_type;\n        /* used to hold the new cipher we are going to use */\n        const SSL_CIPHER *new_cipher;\n#  ifndef OPENSSL_NO_DH\n        DH *dh;\n#  endif\n#  ifndef OPENSSL_NO_ECDH\n        EC_KEY *ecdh;           /* holds short lived ECDH key */\n#  endif\n        /* used when SSL_ST_FLUSH_DATA is entered */\n        int next_state;\n        int reuse_message;\n        /* used for certificate requests */\n        int cert_req;\n        int ctype_num;\n        char ctype[SSL3_CT_NUMBER];\n        STACK_OF(X509_NAME) *ca_names;\n        int use_rsa_tmp;\n        int key_block_length;\n        unsigned char *key_block;\n        const EVP_CIPHER *new_sym_enc;\n        const EVP_MD *new_hash;\n        int new_mac_pkey_type;\n        int new_mac_secret_size;\n#  ifndef OPENSSL_NO_COMP\n        const SSL_COMP *new_compression;\n#  else\n        char *new_compression;\n#  endif\n        int cert_request;\n    } tmp;\n\n    /* Connection binding to prevent renegotiation attacks */\n    unsigned char previous_client_finished[EVP_MAX_MD_SIZE];\n    unsigned char previous_client_finished_len;\n    unsigned char previous_server_finished[EVP_MAX_MD_SIZE];\n    unsigned char previous_server_finished_len;\n    int send_connection_binding; /* TODOEKR */\n\n#  ifndef OPENSSL_NO_NEXTPROTONEG\n    /*\n     * Set if we saw the Next Protocol Negotiation extension from our peer.\n     */\n    int next_proto_neg_seen;\n#  endif\n\n#  ifndef OPENSSL_NO_TLSEXT\n#   ifndef OPENSSL_NO_EC\n    /*\n     * This is set to true if we believe that this is a version of Safari\n     * running on OS X 10.6 or newer. We wish to know this because Safari on\n     * 10.8 .. 10.8.3 has broken ECDHE-ECDSA support.\n     */\n    char is_probably_safari;\n#   endif                       /* !OPENSSL_NO_EC */\n\n    /*\n     * ALPN information (we are in the process of transitioning from NPN to\n     * ALPN.)\n     */\n\n    /*\n     * In a server these point to the selected ALPN protocol after the\n     * ClientHello has been processed. In a client these contain the protocol\n     * that the server selected once the ServerHello has been processed.\n     */\n    unsigned char *alpn_selected;\n    unsigned alpn_selected_len;\n#  endif                        /* OPENSSL_NO_TLSEXT */\n} SSL3_STATE;\n\n# endif\n\n/* SSLv3 */\n/*\n * client\n */\n/* extra state */\n# define SSL3_ST_CW_FLUSH                (0x100|SSL_ST_CONNECT)\n# ifndef OPENSSL_NO_SCTP\n#  define DTLS1_SCTP_ST_CW_WRITE_SOCK                     (0x310|SSL_ST_CONNECT)\n#  define DTLS1_SCTP_ST_CR_READ_SOCK                      (0x320|SSL_ST_CONNECT)\n# endif\n/* write to server */\n# define SSL3_ST_CW_CLNT_HELLO_A         (0x110|SSL_ST_CONNECT)\n# define SSL3_ST_CW_CLNT_HELLO_B         (0x111|SSL_ST_CONNECT)\n/* read from server */\n# define SSL3_ST_CR_SRVR_HELLO_A         (0x120|SSL_ST_CONNECT)\n# define SSL3_ST_CR_SRVR_HELLO_B         (0x121|SSL_ST_CONNECT)\n# define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_A (0x126|SSL_ST_CONNECT)\n# define DTLS1_ST_CR_HELLO_VERIFY_REQUEST_B (0x127|SSL_ST_CONNECT)\n# define SSL3_ST_CR_CERT_A               (0x130|SSL_ST_CONNECT)\n# define SSL3_ST_CR_CERT_B               (0x131|SSL_ST_CONNECT)\n# define SSL3_ST_CR_KEY_EXCH_A           (0x140|SSL_ST_CONNECT)\n# define SSL3_ST_CR_KEY_EXCH_B           (0x141|SSL_ST_CONNECT)\n# define SSL3_ST_CR_CERT_REQ_A           (0x150|SSL_ST_CONNECT)\n# define SSL3_ST_CR_CERT_REQ_B           (0x151|SSL_ST_CONNECT)\n# define SSL3_ST_CR_SRVR_DONE_A          (0x160|SSL_ST_CONNECT)\n# define SSL3_ST_CR_SRVR_DONE_B          (0x161|SSL_ST_CONNECT)\n/* write to server */\n# define SSL3_ST_CW_CERT_A               (0x170|SSL_ST_CONNECT)\n# define SSL3_ST_CW_CERT_B               (0x171|SSL_ST_CONNECT)\n# define SSL3_ST_CW_CERT_C               (0x172|SSL_ST_CONNECT)\n# define SSL3_ST_CW_CERT_D               (0x173|SSL_ST_CONNECT)\n# define SSL3_ST_CW_KEY_EXCH_A           (0x180|SSL_ST_CONNECT)\n# define SSL3_ST_CW_KEY_EXCH_B           (0x181|SSL_ST_CONNECT)\n# define SSL3_ST_CW_CERT_VRFY_A          (0x190|SSL_ST_CONNECT)\n# define SSL3_ST_CW_CERT_VRFY_B          (0x191|SSL_ST_CONNECT)\n# define SSL3_ST_CW_CHANGE_A             (0x1A0|SSL_ST_CONNECT)\n# define SSL3_ST_CW_CHANGE_B             (0x1A1|SSL_ST_CONNECT)\n# ifndef OPENSSL_NO_NEXTPROTONEG\n#  define SSL3_ST_CW_NEXT_PROTO_A         (0x200|SSL_ST_CONNECT)\n#  define SSL3_ST_CW_NEXT_PROTO_B         (0x201|SSL_ST_CONNECT)\n# endif\n# define SSL3_ST_CW_FINISHED_A           (0x1B0|SSL_ST_CONNECT)\n# define SSL3_ST_CW_FINISHED_B           (0x1B1|SSL_ST_CONNECT)\n/* read from server */\n# define SSL3_ST_CR_CHANGE_A             (0x1C0|SSL_ST_CONNECT)\n# define SSL3_ST_CR_CHANGE_B             (0x1C1|SSL_ST_CONNECT)\n# define SSL3_ST_CR_FINISHED_A           (0x1D0|SSL_ST_CONNECT)\n# define SSL3_ST_CR_FINISHED_B           (0x1D1|SSL_ST_CONNECT)\n# define SSL3_ST_CR_SESSION_TICKET_A     (0x1E0|SSL_ST_CONNECT)\n# define SSL3_ST_CR_SESSION_TICKET_B     (0x1E1|SSL_ST_CONNECT)\n# define SSL3_ST_CR_CERT_STATUS_A        (0x1F0|SSL_ST_CONNECT)\n# define SSL3_ST_CR_CERT_STATUS_B        (0x1F1|SSL_ST_CONNECT)\n\n/* server */\n/* extra state */\n# define SSL3_ST_SW_FLUSH                (0x100|SSL_ST_ACCEPT)\n# ifndef OPENSSL_NO_SCTP\n#  define DTLS1_SCTP_ST_SW_WRITE_SOCK                     (0x310|SSL_ST_ACCEPT)\n#  define DTLS1_SCTP_ST_SR_READ_SOCK                      (0x320|SSL_ST_ACCEPT)\n# endif\n/* read from client */\n/* Do not change the number values, they do matter */\n# define SSL3_ST_SR_CLNT_HELLO_A         (0x110|SSL_ST_ACCEPT)\n# define SSL3_ST_SR_CLNT_HELLO_B         (0x111|SSL_ST_ACCEPT)\n# define SSL3_ST_SR_CLNT_HELLO_C         (0x112|SSL_ST_ACCEPT)\n# define SSL3_ST_SR_CLNT_HELLO_D         (0x115|SSL_ST_ACCEPT)\n/* write to client */\n# define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_A (0x113|SSL_ST_ACCEPT)\n# define DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B (0x114|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_HELLO_REQ_A          (0x120|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_HELLO_REQ_B          (0x121|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_HELLO_REQ_C          (0x122|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_SRVR_HELLO_A         (0x130|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_SRVR_HELLO_B         (0x131|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_CERT_A               (0x140|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_CERT_B               (0x141|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_KEY_EXCH_A           (0x150|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_KEY_EXCH_B           (0x151|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_CERT_REQ_A           (0x160|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_CERT_REQ_B           (0x161|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_SRVR_DONE_A          (0x170|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_SRVR_DONE_B          (0x171|SSL_ST_ACCEPT)\n/* read from client */\n# define SSL3_ST_SR_CERT_A               (0x180|SSL_ST_ACCEPT)\n# define SSL3_ST_SR_CERT_B               (0x181|SSL_ST_ACCEPT)\n# define SSL3_ST_SR_KEY_EXCH_A           (0x190|SSL_ST_ACCEPT)\n# define SSL3_ST_SR_KEY_EXCH_B           (0x191|SSL_ST_ACCEPT)\n# define SSL3_ST_SR_CERT_VRFY_A          (0x1A0|SSL_ST_ACCEPT)\n# define SSL3_ST_SR_CERT_VRFY_B          (0x1A1|SSL_ST_ACCEPT)\n# define SSL3_ST_SR_CHANGE_A             (0x1B0|SSL_ST_ACCEPT)\n# define SSL3_ST_SR_CHANGE_B             (0x1B1|SSL_ST_ACCEPT)\n# ifndef OPENSSL_NO_NEXTPROTONEG\n#  define SSL3_ST_SR_NEXT_PROTO_A         (0x210|SSL_ST_ACCEPT)\n#  define SSL3_ST_SR_NEXT_PROTO_B         (0x211|SSL_ST_ACCEPT)\n# endif\n# define SSL3_ST_SR_FINISHED_A           (0x1C0|SSL_ST_ACCEPT)\n# define SSL3_ST_SR_FINISHED_B           (0x1C1|SSL_ST_ACCEPT)\n/* write to client */\n# define SSL3_ST_SW_CHANGE_A             (0x1D0|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_CHANGE_B             (0x1D1|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_FINISHED_A           (0x1E0|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_FINISHED_B           (0x1E1|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_SESSION_TICKET_A     (0x1F0|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_SESSION_TICKET_B     (0x1F1|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_CERT_STATUS_A        (0x200|SSL_ST_ACCEPT)\n# define SSL3_ST_SW_CERT_STATUS_B        (0x201|SSL_ST_ACCEPT)\n\n# define SSL3_MT_HELLO_REQUEST                   0\n# define SSL3_MT_CLIENT_HELLO                    1\n# define SSL3_MT_SERVER_HELLO                    2\n# define SSL3_MT_NEWSESSION_TICKET               4\n# define SSL3_MT_CERTIFICATE                     11\n# define SSL3_MT_SERVER_KEY_EXCHANGE             12\n# define SSL3_MT_CERTIFICATE_REQUEST             13\n# define SSL3_MT_SERVER_DONE                     14\n# define SSL3_MT_CERTIFICATE_VERIFY              15\n# define SSL3_MT_CLIENT_KEY_EXCHANGE             16\n# define SSL3_MT_FINISHED                        20\n# define SSL3_MT_CERTIFICATE_STATUS              22\n# ifndef OPENSSL_NO_NEXTPROTONEG\n#  define SSL3_MT_NEXT_PROTO                      67\n# endif\n# define DTLS1_MT_HELLO_VERIFY_REQUEST    3\n\n# define SSL3_MT_CCS                             1\n\n/* These are used when changing over to a new cipher */\n# define SSL3_CC_READ            0x01\n# define SSL3_CC_WRITE           0x02\n# define SSL3_CC_CLIENT          0x10\n# define SSL3_CC_SERVER          0x20\n# define SSL3_CHANGE_CIPHER_CLIENT_WRITE (SSL3_CC_CLIENT|SSL3_CC_WRITE)\n# define SSL3_CHANGE_CIPHER_SERVER_READ  (SSL3_CC_SERVER|SSL3_CC_READ)\n# define SSL3_CHANGE_CIPHER_CLIENT_READ  (SSL3_CC_CLIENT|SSL3_CC_READ)\n# define SSL3_CHANGE_CIPHER_SERVER_WRITE (SSL3_CC_SERVER|SSL3_CC_WRITE)\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/stack.h",
    "content": "/* crypto/stack/stack.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_STACK_H\n# define HEADER_STACK_H\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct stack_st {\n    int num;\n    char **data;\n    int sorted;\n    int num_alloc;\n    int (*comp) (const void *, const void *);\n} _STACK;                       /* Use STACK_OF(...) instead */\n\n# define M_sk_num(sk)            ((sk) ? (sk)->num:-1)\n# define M_sk_value(sk,n)        ((sk) ? (sk)->data[n] : NULL)\n\nint sk_num(const _STACK *);\nvoid *sk_value(const _STACK *, int);\n\nvoid *sk_set(_STACK *, int, void *);\n\n_STACK *sk_new(int (*cmp) (const void *, const void *));\n_STACK *sk_new_null(void);\nvoid sk_free(_STACK *);\nvoid sk_pop_free(_STACK *st, void (*func) (void *));\n_STACK *sk_deep_copy(_STACK *, void *(*)(void *), void (*)(void *));\nint sk_insert(_STACK *sk, void *data, int where);\nvoid *sk_delete(_STACK *st, int loc);\nvoid *sk_delete_ptr(_STACK *st, void *p);\nint sk_find(_STACK *st, void *data);\nint sk_find_ex(_STACK *st, void *data);\nint sk_push(_STACK *st, void *data);\nint sk_unshift(_STACK *st, void *data);\nvoid *sk_shift(_STACK *st);\nvoid *sk_pop(_STACK *st);\nvoid sk_zero(_STACK *st);\nint (*sk_set_cmp_func(_STACK *sk, int (*c) (const void *, const void *)))\n (const void *, const void *);\n_STACK *sk_dup(_STACK *st);\nvoid sk_sort(_STACK *st);\nint sk_is_sorted(const _STACK *st);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/symhacks.h",
    "content": "/* ====================================================================\n * Copyright (c) 1999 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_SYMHACKS_H\n# define HEADER_SYMHACKS_H\n\n# include <openssl/e_os2.h>\n\n/*\n * Hacks to solve the problem with linkers incapable of handling very long\n * symbol names.  In the case of VMS, the limit is 31 characters on VMS for\n * VAX.\n */\n/*\n * Note that this affects util/libeay.num and util/ssleay.num...  you may\n * change those manually, but that's not recommended, as those files are\n * controlled centrally and updated on Unix, and the central definition may\n * disagree with yours, which in turn may come with shareable library\n * incompatibilities.\n */\n# ifdef OPENSSL_SYS_VMS\n\n/* Hack a long name in crypto/ex_data.c */\n#  undef CRYPTO_get_ex_data_implementation\n#  define CRYPTO_get_ex_data_implementation       CRYPTO_get_ex_data_impl\n#  undef CRYPTO_set_ex_data_implementation\n#  define CRYPTO_set_ex_data_implementation       CRYPTO_set_ex_data_impl\n\n/* Hack a long name in crypto/asn1/a_mbstr.c */\n#  undef ASN1_STRING_set_default_mask_asc\n#  define ASN1_STRING_set_default_mask_asc        ASN1_STRING_set_def_mask_asc\n\n#  if 0                         /* No longer needed, since safestack macro\n                                 * magic does the job */\n/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_SIGNER_INFO) */\n#   undef i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO\n#   define i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO       i2d_ASN1_SET_OF_PKCS7_SIGINF\n#   undef d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO\n#   define d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO       d2i_ASN1_SET_OF_PKCS7_SIGINF\n#  endif\n\n#  if 0                         /* No longer needed, since safestack macro\n                                 * magic does the job */\n/* Hack the names created with DECLARE_ASN1_SET_OF(PKCS7_RECIP_INFO) */\n#   undef i2d_ASN1_SET_OF_PKCS7_RECIP_INFO\n#   define i2d_ASN1_SET_OF_PKCS7_RECIP_INFO        i2d_ASN1_SET_OF_PKCS7_RECINF\n#   undef d2i_ASN1_SET_OF_PKCS7_RECIP_INFO\n#   define d2i_ASN1_SET_OF_PKCS7_RECIP_INFO        d2i_ASN1_SET_OF_PKCS7_RECINF\n#  endif\n\n#  if 0                         /* No longer needed, since safestack macro\n                                 * magic does the job */\n/* Hack the names created with DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) */\n#   undef i2d_ASN1_SET_OF_ACCESS_DESCRIPTION\n#   define i2d_ASN1_SET_OF_ACCESS_DESCRIPTION      i2d_ASN1_SET_OF_ACC_DESC\n#   undef d2i_ASN1_SET_OF_ACCESS_DESCRIPTION\n#   define d2i_ASN1_SET_OF_ACCESS_DESCRIPTION      d2i_ASN1_SET_OF_ACC_DESC\n#  endif\n\n/* Hack the names created with DECLARE_PEM_rw(NETSCAPE_CERT_SEQUENCE) */\n#  undef PEM_read_NETSCAPE_CERT_SEQUENCE\n#  define PEM_read_NETSCAPE_CERT_SEQUENCE         PEM_read_NS_CERT_SEQ\n#  undef PEM_write_NETSCAPE_CERT_SEQUENCE\n#  define PEM_write_NETSCAPE_CERT_SEQUENCE        PEM_write_NS_CERT_SEQ\n#  undef PEM_read_bio_NETSCAPE_CERT_SEQUENCE\n#  define PEM_read_bio_NETSCAPE_CERT_SEQUENCE     PEM_read_bio_NS_CERT_SEQ\n#  undef PEM_write_bio_NETSCAPE_CERT_SEQUENCE\n#  define PEM_write_bio_NETSCAPE_CERT_SEQUENCE    PEM_write_bio_NS_CERT_SEQ\n#  undef PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE\n#  define PEM_write_cb_bio_NETSCAPE_CERT_SEQUENCE PEM_write_cb_bio_NS_CERT_SEQ\n\n/* Hack the names created with DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO) */\n#  undef PEM_read_PKCS8_PRIV_KEY_INFO\n#  define PEM_read_PKCS8_PRIV_KEY_INFO            PEM_read_P8_PRIV_KEY_INFO\n#  undef PEM_write_PKCS8_PRIV_KEY_INFO\n#  define PEM_write_PKCS8_PRIV_KEY_INFO           PEM_write_P8_PRIV_KEY_INFO\n#  undef PEM_read_bio_PKCS8_PRIV_KEY_INFO\n#  define PEM_read_bio_PKCS8_PRIV_KEY_INFO        PEM_read_bio_P8_PRIV_KEY_INFO\n#  undef PEM_write_bio_PKCS8_PRIV_KEY_INFO\n#  define PEM_write_bio_PKCS8_PRIV_KEY_INFO       PEM_write_bio_P8_PRIV_KEY_INFO\n#  undef PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO\n#  define PEM_write_cb_bio_PKCS8_PRIV_KEY_INFO    PEM_wrt_cb_bio_P8_PRIV_KEY_INFO\n\n/* Hack other PEM names */\n#  undef PEM_write_bio_PKCS8PrivateKey_nid\n#  define PEM_write_bio_PKCS8PrivateKey_nid       PEM_write_bio_PKCS8PrivKey_nid\n\n/* Hack some long X509 names */\n#  undef X509_REVOKED_get_ext_by_critical\n#  define X509_REVOKED_get_ext_by_critical        X509_REVOKED_get_ext_by_critic\n#  undef X509_policy_tree_get0_user_policies\n#  define X509_policy_tree_get0_user_policies     X509_pcy_tree_get0_usr_policies\n#  undef X509_policy_node_get0_qualifiers\n#  define X509_policy_node_get0_qualifiers        X509_pcy_node_get0_qualifiers\n#  undef X509_STORE_CTX_get_explicit_policy\n#  define X509_STORE_CTX_get_explicit_policy      X509_STORE_CTX_get_expl_policy\n#  undef X509_STORE_CTX_get0_current_issuer\n#  define X509_STORE_CTX_get0_current_issuer      X509_STORE_CTX_get0_cur_issuer\n\n/* Hack some long CRYPTO names */\n#  undef CRYPTO_set_dynlock_destroy_callback\n#  define CRYPTO_set_dynlock_destroy_callback     CRYPTO_set_dynlock_destroy_cb\n#  undef CRYPTO_set_dynlock_create_callback\n#  define CRYPTO_set_dynlock_create_callback      CRYPTO_set_dynlock_create_cb\n#  undef CRYPTO_set_dynlock_lock_callback\n#  define CRYPTO_set_dynlock_lock_callback        CRYPTO_set_dynlock_lock_cb\n#  undef CRYPTO_get_dynlock_lock_callback\n#  define CRYPTO_get_dynlock_lock_callback        CRYPTO_get_dynlock_lock_cb\n#  undef CRYPTO_get_dynlock_destroy_callback\n#  define CRYPTO_get_dynlock_destroy_callback     CRYPTO_get_dynlock_destroy_cb\n#  undef CRYPTO_get_dynlock_create_callback\n#  define CRYPTO_get_dynlock_create_callback      CRYPTO_get_dynlock_create_cb\n#  undef CRYPTO_set_locked_mem_ex_functions\n#  define CRYPTO_set_locked_mem_ex_functions      CRYPTO_set_locked_mem_ex_funcs\n#  undef CRYPTO_get_locked_mem_ex_functions\n#  define CRYPTO_get_locked_mem_ex_functions      CRYPTO_get_locked_mem_ex_funcs\n\n/* Hack some long SSL/TLS names */\n#  undef SSL_CTX_set_default_verify_paths\n#  define SSL_CTX_set_default_verify_paths        SSL_CTX_set_def_verify_paths\n#  undef SSL_get_ex_data_X509_STORE_CTX_idx\n#  define SSL_get_ex_data_X509_STORE_CTX_idx      SSL_get_ex_d_X509_STORE_CTX_idx\n#  undef SSL_add_file_cert_subjects_to_stack\n#  define SSL_add_file_cert_subjects_to_stack     SSL_add_file_cert_subjs_to_stk\n#  undef SSL_add_dir_cert_subjects_to_stack\n#  define SSL_add_dir_cert_subjects_to_stack      SSL_add_dir_cert_subjs_to_stk\n#  undef SSL_CTX_use_certificate_chain_file\n#  define SSL_CTX_use_certificate_chain_file      SSL_CTX_use_cert_chain_file\n#  undef SSL_CTX_set_cert_verify_callback\n#  define SSL_CTX_set_cert_verify_callback        SSL_CTX_set_cert_verify_cb\n#  undef SSL_CTX_set_default_passwd_cb_userdata\n#  define SSL_CTX_set_default_passwd_cb_userdata  SSL_CTX_set_def_passwd_cb_ud\n#  undef SSL_COMP_get_compression_methods\n#  define SSL_COMP_get_compression_methods        SSL_COMP_get_compress_methods\n#  undef SSL_COMP_set0_compression_methods\n#  define SSL_COMP_set0_compression_methods       SSL_COMP_set0_compress_methods\n#  undef SSL_COMP_free_compression_methods\n#  define SSL_COMP_free_compression_methods       SSL_COMP_free_compress_methods\n#  undef ssl_add_clienthello_renegotiate_ext\n#  define ssl_add_clienthello_renegotiate_ext     ssl_add_clienthello_reneg_ext\n#  undef ssl_add_serverhello_renegotiate_ext\n#  define ssl_add_serverhello_renegotiate_ext     ssl_add_serverhello_reneg_ext\n#  undef ssl_parse_clienthello_renegotiate_ext\n#  define ssl_parse_clienthello_renegotiate_ext   ssl_parse_clienthello_reneg_ext\n#  undef ssl_parse_serverhello_renegotiate_ext\n#  define ssl_parse_serverhello_renegotiate_ext   ssl_parse_serverhello_reneg_ext\n#  undef SSL_srp_server_param_with_username\n#  define SSL_srp_server_param_with_username      SSL_srp_server_param_with_un\n#  undef SSL_CTX_set_srp_client_pwd_callback\n#  define SSL_CTX_set_srp_client_pwd_callback     SSL_CTX_set_srp_client_pwd_cb\n#  undef SSL_CTX_set_srp_verify_param_callback\n#  define SSL_CTX_set_srp_verify_param_callback   SSL_CTX_set_srp_vfy_param_cb\n#  undef SSL_CTX_set_srp_username_callback\n#  define SSL_CTX_set_srp_username_callback       SSL_CTX_set_srp_un_cb\n#  undef ssl_add_clienthello_use_srtp_ext\n#  define ssl_add_clienthello_use_srtp_ext        ssl_add_clihello_use_srtp_ext\n#  undef ssl_add_serverhello_use_srtp_ext\n#  define ssl_add_serverhello_use_srtp_ext        ssl_add_serhello_use_srtp_ext\n#  undef ssl_parse_clienthello_use_srtp_ext\n#  define ssl_parse_clienthello_use_srtp_ext      ssl_parse_clihello_use_srtp_ext\n#  undef ssl_parse_serverhello_use_srtp_ext\n#  define ssl_parse_serverhello_use_srtp_ext      ssl_parse_serhello_use_srtp_ext\n#  undef SSL_CTX_set_next_protos_advertised_cb\n#  define SSL_CTX_set_next_protos_advertised_cb   SSL_CTX_set_next_protos_adv_cb\n#  undef SSL_CTX_set_next_proto_select_cb\n#  define SSL_CTX_set_next_proto_select_cb        SSL_CTX_set_next_proto_sel_cb\n\n#  undef tls1_send_server_supplemental_data\n#  define tls1_send_server_supplemental_data      tls1_send_server_suppl_data\n#  undef tls1_send_client_supplemental_data\n#  define tls1_send_client_supplemental_data      tls1_send_client_suppl_data\n#  undef tls1_get_server_supplemental_data\n#  define tls1_get_server_supplemental_data       tls1_get_server_suppl_data\n#  undef tls1_get_client_supplemental_data\n#  define tls1_get_client_supplemental_data       tls1_get_client_suppl_data\n\n#  undef ssl3_cbc_record_digest_supported\n#  define ssl3_cbc_record_digest_supported        ssl3_cbc_record_digest_support\n#  undef ssl_check_clienthello_tlsext_late\n#  define ssl_check_clienthello_tlsext_late       ssl_check_clihello_tlsext_late\n#  undef ssl_check_clienthello_tlsext_early\n#  define ssl_check_clienthello_tlsext_early      ssl_check_clihello_tlsext_early\n\n/* Hack some RSA long names */\n#  undef RSA_padding_check_PKCS1_OAEP_mgf1\n#  define RSA_padding_check_PKCS1_OAEP_mgf1       RSA_pad_check_PKCS1_OAEP_mgf1\n\n/* Hack some ENGINE long names */\n#  undef ENGINE_get_default_BN_mod_exp_crt\n#  define ENGINE_get_default_BN_mod_exp_crt       ENGINE_get_def_BN_mod_exp_crt\n#  undef ENGINE_set_default_BN_mod_exp_crt\n#  define ENGINE_set_default_BN_mod_exp_crt       ENGINE_set_def_BN_mod_exp_crt\n#  undef ENGINE_set_load_privkey_function\n#  define ENGINE_set_load_privkey_function        ENGINE_set_load_privkey_fn\n#  undef ENGINE_get_load_privkey_function\n#  define ENGINE_get_load_privkey_function        ENGINE_get_load_privkey_fn\n#  undef ENGINE_unregister_pkey_asn1_meths\n#  define ENGINE_unregister_pkey_asn1_meths       ENGINE_unreg_pkey_asn1_meths\n#  undef ENGINE_register_all_pkey_asn1_meths\n#  define ENGINE_register_all_pkey_asn1_meths     ENGINE_reg_all_pkey_asn1_meths\n#  undef ENGINE_set_default_pkey_asn1_meths\n#  define ENGINE_set_default_pkey_asn1_meths      ENGINE_set_def_pkey_asn1_meths\n#  undef ENGINE_get_pkey_asn1_meth_engine\n#  define ENGINE_get_pkey_asn1_meth_engine        ENGINE_get_pkey_asn1_meth_eng\n#  undef ENGINE_set_load_ssl_client_cert_function\n#  define ENGINE_set_load_ssl_client_cert_function \\\n                                                ENGINE_set_ld_ssl_clnt_cert_fn\n#  undef ENGINE_get_ssl_client_cert_function\n#  define ENGINE_get_ssl_client_cert_function     ENGINE_get_ssl_client_cert_fn\n\n/* Hack some long OCSP names */\n#  undef OCSP_REQUEST_get_ext_by_critical\n#  define OCSP_REQUEST_get_ext_by_critical        OCSP_REQUEST_get_ext_by_crit\n#  undef OCSP_BASICRESP_get_ext_by_critical\n#  define OCSP_BASICRESP_get_ext_by_critical      OCSP_BASICRESP_get_ext_by_crit\n#  undef OCSP_SINGLERESP_get_ext_by_critical\n#  define OCSP_SINGLERESP_get_ext_by_critical     OCSP_SINGLERESP_get_ext_by_crit\n\n/* Hack some long DES names */\n#  undef _ossl_old_des_ede3_cfb64_encrypt\n#  define _ossl_old_des_ede3_cfb64_encrypt        _ossl_odes_ede3_cfb64_encrypt\n#  undef _ossl_old_des_ede3_ofb64_encrypt\n#  define _ossl_old_des_ede3_ofb64_encrypt        _ossl_odes_ede3_ofb64_encrypt\n\n/* Hack some long EVP names */\n#  undef OPENSSL_add_all_algorithms_noconf\n#  define OPENSSL_add_all_algorithms_noconf       OPENSSL_add_all_algo_noconf\n#  undef OPENSSL_add_all_algorithms_conf\n#  define OPENSSL_add_all_algorithms_conf         OPENSSL_add_all_algo_conf\n#  undef EVP_PKEY_meth_set_verify_recover\n#  define EVP_PKEY_meth_set_verify_recover        EVP_PKEY_meth_set_vrfy_recover\n#  undef EVP_PKEY_meth_get_verify_recover\n#  define EVP_PKEY_meth_get_verify_recover        EVP_PKEY_meth_get_vrfy_recover\n\n/* Hack some long EC names */\n#  undef EC_GROUP_set_point_conversion_form\n#  define EC_GROUP_set_point_conversion_form      EC_GROUP_set_point_conv_form\n#  undef EC_GROUP_get_point_conversion_form\n#  define EC_GROUP_get_point_conversion_form      EC_GROUP_get_point_conv_form\n#  undef EC_GROUP_clear_free_all_extra_data\n#  define EC_GROUP_clear_free_all_extra_data      EC_GROUP_clr_free_all_xtra_data\n#  undef EC_KEY_set_public_key_affine_coordinates\n#  define EC_KEY_set_public_key_affine_coordinates \\\n                                                EC_KEY_set_pub_key_aff_coords\n#  undef EC_POINT_set_Jprojective_coordinates_GFp\n#  define EC_POINT_set_Jprojective_coordinates_GFp \\\n                                                EC_POINT_set_Jproj_coords_GFp\n#  undef EC_POINT_get_Jprojective_coordinates_GFp\n#  define EC_POINT_get_Jprojective_coordinates_GFp \\\n                                                EC_POINT_get_Jproj_coords_GFp\n#  undef EC_POINT_set_affine_coordinates_GFp\n#  define EC_POINT_set_affine_coordinates_GFp     EC_POINT_set_affine_coords_GFp\n#  undef EC_POINT_get_affine_coordinates_GFp\n#  define EC_POINT_get_affine_coordinates_GFp     EC_POINT_get_affine_coords_GFp\n#  undef EC_POINT_set_compressed_coordinates_GFp\n#  define EC_POINT_set_compressed_coordinates_GFp EC_POINT_set_compr_coords_GFp\n#  undef EC_POINT_set_affine_coordinates_GF2m\n#  define EC_POINT_set_affine_coordinates_GF2m    EC_POINT_set_affine_coords_GF2m\n#  undef EC_POINT_get_affine_coordinates_GF2m\n#  define EC_POINT_get_affine_coordinates_GF2m    EC_POINT_get_affine_coords_GF2m\n#  undef EC_POINT_set_compressed_coordinates_GF2m\n#  define EC_POINT_set_compressed_coordinates_GF2m \\\n                                                EC_POINT_set_compr_coords_GF2m\n#  undef ec_GF2m_simple_group_clear_finish\n#  define ec_GF2m_simple_group_clear_finish       ec_GF2m_simple_grp_clr_finish\n#  undef ec_GF2m_simple_group_check_discriminant\n#  define ec_GF2m_simple_group_check_discriminant ec_GF2m_simple_grp_chk_discrim\n#  undef ec_GF2m_simple_point_clear_finish\n#  define ec_GF2m_simple_point_clear_finish       ec_GF2m_simple_pt_clr_finish\n#  undef ec_GF2m_simple_point_set_to_infinity\n#  define ec_GF2m_simple_point_set_to_infinity    ec_GF2m_simple_pt_set_to_inf\n#  undef ec_GF2m_simple_points_make_affine\n#  define ec_GF2m_simple_points_make_affine       ec_GF2m_simple_pts_make_affine\n#  undef ec_GF2m_simple_point_set_affine_coordinates\n#  define ec_GF2m_simple_point_set_affine_coordinates \\\n                                                ec_GF2m_smp_pt_set_af_coords\n#  undef ec_GF2m_simple_point_get_affine_coordinates\n#  define ec_GF2m_simple_point_get_affine_coordinates \\\n                                                ec_GF2m_smp_pt_get_af_coords\n#  undef ec_GF2m_simple_set_compressed_coordinates\n#  define ec_GF2m_simple_set_compressed_coordinates \\\n                                                ec_GF2m_smp_set_compr_coords\n#  undef ec_GFp_simple_group_set_curve_GFp\n#  define ec_GFp_simple_group_set_curve_GFp       ec_GFp_simple_grp_set_curve_GFp\n#  undef ec_GFp_simple_group_get_curve_GFp\n#  define ec_GFp_simple_group_get_curve_GFp       ec_GFp_simple_grp_get_curve_GFp\n#  undef ec_GFp_simple_group_clear_finish\n#  define ec_GFp_simple_group_clear_finish        ec_GFp_simple_grp_clear_finish\n#  undef ec_GFp_simple_group_set_generator\n#  define ec_GFp_simple_group_set_generator       ec_GFp_simple_grp_set_generator\n#  undef ec_GFp_simple_group_get0_generator\n#  define ec_GFp_simple_group_get0_generator      ec_GFp_simple_grp_gt0_generator\n#  undef ec_GFp_simple_group_get_cofactor\n#  define ec_GFp_simple_group_get_cofactor        ec_GFp_simple_grp_get_cofactor\n#  undef ec_GFp_simple_point_clear_finish\n#  define ec_GFp_simple_point_clear_finish        ec_GFp_simple_pt_clear_finish\n#  undef ec_GFp_simple_point_set_to_infinity\n#  define ec_GFp_simple_point_set_to_infinity     ec_GFp_simple_pt_set_to_inf\n#  undef ec_GFp_simple_points_make_affine\n#  define ec_GFp_simple_points_make_affine        ec_GFp_simple_pts_make_affine\n#  undef ec_GFp_simple_set_Jprojective_coordinates_GFp\n#  define ec_GFp_simple_set_Jprojective_coordinates_GFp \\\n                                                ec_GFp_smp_set_Jproj_coords_GFp\n#  undef ec_GFp_simple_get_Jprojective_coordinates_GFp\n#  define ec_GFp_simple_get_Jprojective_coordinates_GFp \\\n                                                ec_GFp_smp_get_Jproj_coords_GFp\n#  undef ec_GFp_simple_point_set_affine_coordinates_GFp\n#  define ec_GFp_simple_point_set_affine_coordinates_GFp \\\n                                                ec_GFp_smp_pt_set_af_coords_GFp\n#  undef ec_GFp_simple_point_get_affine_coordinates_GFp\n#  define ec_GFp_simple_point_get_affine_coordinates_GFp \\\n                                                ec_GFp_smp_pt_get_af_coords_GFp\n#  undef ec_GFp_simple_set_compressed_coordinates_GFp\n#  define ec_GFp_simple_set_compressed_coordinates_GFp \\\n                                                ec_GFp_smp_set_compr_coords_GFp\n#  undef ec_GFp_simple_point_set_affine_coordinates\n#  define ec_GFp_simple_point_set_affine_coordinates \\\n                                                ec_GFp_smp_pt_set_af_coords\n#  undef ec_GFp_simple_point_get_affine_coordinates\n#  define ec_GFp_simple_point_get_affine_coordinates \\\n                                                ec_GFp_smp_pt_get_af_coords\n#  undef ec_GFp_simple_set_compressed_coordinates\n#  define ec_GFp_simple_set_compressed_coordinates \\\n                                                ec_GFp_smp_set_compr_coords\n#  undef ec_GFp_simple_group_check_discriminant\n#  define ec_GFp_simple_group_check_discriminant  ec_GFp_simple_grp_chk_discrim\n\n/* Hack som long STORE names */\n#  undef STORE_method_set_initialise_function\n#  define STORE_method_set_initialise_function    STORE_meth_set_initialise_fn\n#  undef STORE_method_set_cleanup_function\n#  define STORE_method_set_cleanup_function       STORE_meth_set_cleanup_fn\n#  undef STORE_method_set_generate_function\n#  define STORE_method_set_generate_function      STORE_meth_set_generate_fn\n#  undef STORE_method_set_modify_function\n#  define STORE_method_set_modify_function        STORE_meth_set_modify_fn\n#  undef STORE_method_set_revoke_function\n#  define STORE_method_set_revoke_function        STORE_meth_set_revoke_fn\n#  undef STORE_method_set_delete_function\n#  define STORE_method_set_delete_function        STORE_meth_set_delete_fn\n#  undef STORE_method_set_list_start_function\n#  define STORE_method_set_list_start_function    STORE_meth_set_list_start_fn\n#  undef STORE_method_set_list_next_function\n#  define STORE_method_set_list_next_function     STORE_meth_set_list_next_fn\n#  undef STORE_method_set_list_end_function\n#  define STORE_method_set_list_end_function      STORE_meth_set_list_end_fn\n#  undef STORE_method_set_update_store_function\n#  define STORE_method_set_update_store_function  STORE_meth_set_update_store_fn\n#  undef STORE_method_set_lock_store_function\n#  define STORE_method_set_lock_store_function    STORE_meth_set_lock_store_fn\n#  undef STORE_method_set_unlock_store_function\n#  define STORE_method_set_unlock_store_function  STORE_meth_set_unlock_store_fn\n#  undef STORE_method_get_initialise_function\n#  define STORE_method_get_initialise_function    STORE_meth_get_initialise_fn\n#  undef STORE_method_get_cleanup_function\n#  define STORE_method_get_cleanup_function       STORE_meth_get_cleanup_fn\n#  undef STORE_method_get_generate_function\n#  define STORE_method_get_generate_function      STORE_meth_get_generate_fn\n#  undef STORE_method_get_modify_function\n#  define STORE_method_get_modify_function        STORE_meth_get_modify_fn\n#  undef STORE_method_get_revoke_function\n#  define STORE_method_get_revoke_function        STORE_meth_get_revoke_fn\n#  undef STORE_method_get_delete_function\n#  define STORE_method_get_delete_function        STORE_meth_get_delete_fn\n#  undef STORE_method_get_list_start_function\n#  define STORE_method_get_list_start_function    STORE_meth_get_list_start_fn\n#  undef STORE_method_get_list_next_function\n#  define STORE_method_get_list_next_function     STORE_meth_get_list_next_fn\n#  undef STORE_method_get_list_end_function\n#  define STORE_method_get_list_end_function      STORE_meth_get_list_end_fn\n#  undef STORE_method_get_update_store_function\n#  define STORE_method_get_update_store_function  STORE_meth_get_update_store_fn\n#  undef STORE_method_get_lock_store_function\n#  define STORE_method_get_lock_store_function    STORE_meth_get_lock_store_fn\n#  undef STORE_method_get_unlock_store_function\n#  define STORE_method_get_unlock_store_function  STORE_meth_get_unlock_store_fn\n\n/* Hack some long TS names */\n#  undef TS_RESP_CTX_set_status_info_cond\n#  define TS_RESP_CTX_set_status_info_cond        TS_RESP_CTX_set_stat_info_cond\n#  undef TS_RESP_CTX_set_clock_precision_digits\n#  define TS_RESP_CTX_set_clock_precision_digits  TS_RESP_CTX_set_clk_prec_digits\n#  undef TS_CONF_set_clock_precision_digits\n#  define TS_CONF_set_clock_precision_digits      TS_CONF_set_clk_prec_digits\n\n/* Hack some long CMS names */\n#  undef CMS_RecipientInfo_ktri_get0_algs\n#  define CMS_RecipientInfo_ktri_get0_algs        CMS_RecipInfo_ktri_get0_algs\n#  undef CMS_RecipientInfo_ktri_get0_signer_id\n#  define CMS_RecipientInfo_ktri_get0_signer_id   CMS_RecipInfo_ktri_get0_sigr_id\n#  undef CMS_OtherRevocationInfoFormat_it\n#  define CMS_OtherRevocationInfoFormat_it        CMS_OtherRevocInfoFormat_it\n#  undef CMS_KeyAgreeRecipientIdentifier_it\n#  define CMS_KeyAgreeRecipientIdentifier_it      CMS_KeyAgreeRecipIdentifier_it\n#  undef CMS_OriginatorIdentifierOrKey_it\n#  define CMS_OriginatorIdentifierOrKey_it        CMS_OriginatorIdOrKey_it\n#  undef cms_SignerIdentifier_get0_signer_id\n#  define cms_SignerIdentifier_get0_signer_id     cms_SignerId_get0_signer_id\n#  undef CMS_RecipientInfo_kari_get0_orig_id\n#  define CMS_RecipientInfo_kari_get0_orig_id     CMS_RecipInfo_kari_get0_orig_id\n#  undef CMS_RecipientInfo_kari_get0_reks\n#  define CMS_RecipientInfo_kari_get0_reks        CMS_RecipInfo_kari_get0_reks\n#  undef CMS_RecipientEncryptedKey_cert_cmp\n#  define CMS_RecipientEncryptedKey_cert_cmp      CMS_RecipEncryptedKey_cert_cmp\n#  undef CMS_RecipientInfo_kari_set0_pkey\n#  define CMS_RecipientInfo_kari_set0_pkey        CMS_RecipInfo_kari_set0_pkey\n#  undef CMS_RecipientEncryptedKey_get0_id\n#  define CMS_RecipientEncryptedKey_get0_id       CMS_RecipEncryptedKey_get0_id\n#  undef CMS_RecipientInfo_kari_orig_id_cmp\n#  define CMS_RecipientInfo_kari_orig_id_cmp      CMS_RecipInfo_kari_orig_id_cmp\n\n/* Hack some long DTLS1 names */\n#  undef dtls1_retransmit_buffered_messages\n#  define dtls1_retransmit_buffered_messages      dtls1_retransmit_buffered_msgs\n\n/* Hack some long SRP names */\n#  undef SRP_generate_server_master_secret\n#  define SRP_generate_server_master_secret       SRP_gen_server_master_secret\n#  undef SRP_generate_client_master_secret\n#  define SRP_generate_client_master_secret       SRP_gen_client_master_secret\n\n/* Hack some long UI names */\n#  undef UI_method_get_prompt_constructor\n#  define UI_method_get_prompt_constructor        UI_method_get_prompt_constructr\n#  undef UI_method_set_prompt_constructor\n#  define UI_method_set_prompt_constructor        UI_method_set_prompt_constructr\n\n# endif                         /* defined OPENSSL_SYS_VMS */\n\n/* Case insensitive linking causes problems.... */\n# if defined(OPENSSL_SYS_VMS) || defined(OPENSSL_SYS_OS2)\n#  undef ERR_load_CRYPTO_strings\n#  define ERR_load_CRYPTO_strings                 ERR_load_CRYPTOlib_strings\n#  undef OCSP_crlID_new\n#  define OCSP_crlID_new                          OCSP_crlID2_new\n\n#  undef d2i_ECPARAMETERS\n#  define d2i_ECPARAMETERS                        d2i_UC_ECPARAMETERS\n#  undef i2d_ECPARAMETERS\n#  define i2d_ECPARAMETERS                        i2d_UC_ECPARAMETERS\n#  undef d2i_ECPKPARAMETERS\n#  define d2i_ECPKPARAMETERS                      d2i_UC_ECPKPARAMETERS\n#  undef i2d_ECPKPARAMETERS\n#  define i2d_ECPKPARAMETERS                      i2d_UC_ECPKPARAMETERS\n\n/*\n * These functions do not seem to exist! However, I'm paranoid... Original\n * command in x509v3.h: These functions are being redefined in another\n * directory, and clash when the linker is case-insensitive, so let's hide\n * them a little, by giving them an extra 'o' at the beginning of the name...\n */\n#  undef X509v3_cleanup_extensions\n#  define X509v3_cleanup_extensions               oX509v3_cleanup_extensions\n#  undef X509v3_add_extension\n#  define X509v3_add_extension                    oX509v3_add_extension\n#  undef X509v3_add_netscape_extensions\n#  define X509v3_add_netscape_extensions          oX509v3_add_netscape_extensions\n#  undef X509v3_add_standard_extensions\n#  define X509v3_add_standard_extensions          oX509v3_add_standard_extensions\n\n/* This one clashes with CMS_data_create */\n#  undef cms_Data_create\n#  define cms_Data_create                         priv_cms_Data_create\n\n# endif\n\n#endif                          /* ! defined HEADER_VMS_IDHACKS_H */\n"
  },
  {
    "path": "third_party/include/openssl/tls1.h",
    "content": "/* ssl/tls1.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n/* ====================================================================\n * Copyright (c) 1998-2006 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n/* ====================================================================\n * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.\n *\n * Portions of the attached software (\"Contribution\") are developed by\n * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project.\n *\n * The Contribution is licensed pursuant to the OpenSSL open source\n * license provided above.\n *\n * ECC cipher suite support in OpenSSL originally written by\n * Vipul Gupta and Sumit Gupta of Sun Microsystems Laboratories.\n *\n */\n/* ====================================================================\n * Copyright 2005 Nokia. All rights reserved.\n *\n * The portions of the attached software (\"Contribution\") is developed by\n * Nokia Corporation and is licensed pursuant to the OpenSSL open source\n * license.\n *\n * The Contribution, originally written by Mika Kousa and Pasi Eronen of\n * Nokia Corporation, consists of the \"PSK\" (Pre-Shared Key) ciphersuites\n * support (see RFC 4279) to OpenSSL.\n *\n * No patent licenses or other rights except those expressly stated in\n * the OpenSSL open source license shall be deemed granted or received\n * expressly, by implication, estoppel, or otherwise.\n *\n * No assurances are provided by Nokia that the Contribution does not\n * infringe the patent or other intellectual property rights of any third\n * party or that the license provides you with all the necessary rights\n * to make use of the Contribution.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY KIND. IN\n * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA\n * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY\n * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR\n * OTHERWISE.\n */\n\n#ifndef HEADER_TLS1_H\n# define HEADER_TLS1_H\n\n# include <openssl/buffer.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES    0\n\n# define TLS1_VERSION                    0x0301\n# define TLS1_1_VERSION                  0x0302\n# define TLS1_2_VERSION                  0x0303\n# define TLS_MAX_VERSION                 TLS1_2_VERSION\n\n# define TLS1_VERSION_MAJOR              0x03\n# define TLS1_VERSION_MINOR              0x01\n\n# define TLS1_1_VERSION_MAJOR            0x03\n# define TLS1_1_VERSION_MINOR            0x02\n\n# define TLS1_2_VERSION_MAJOR            0x03\n# define TLS1_2_VERSION_MINOR            0x03\n\n# define TLS1_get_version(s) \\\n                ((s->version >> 8) == TLS1_VERSION_MAJOR ? s->version : 0)\n\n# define TLS1_get_client_version(s) \\\n                ((s->client_version >> 8) == TLS1_VERSION_MAJOR ? s->client_version : 0)\n\n# define TLS1_AD_DECRYPTION_FAILED       21\n# define TLS1_AD_RECORD_OVERFLOW         22\n# define TLS1_AD_UNKNOWN_CA              48/* fatal */\n# define TLS1_AD_ACCESS_DENIED           49/* fatal */\n# define TLS1_AD_DECODE_ERROR            50/* fatal */\n# define TLS1_AD_DECRYPT_ERROR           51\n# define TLS1_AD_EXPORT_RESTRICTION      60/* fatal */\n# define TLS1_AD_PROTOCOL_VERSION        70/* fatal */\n# define TLS1_AD_INSUFFICIENT_SECURITY   71/* fatal */\n# define TLS1_AD_INTERNAL_ERROR          80/* fatal */\n# define TLS1_AD_INAPPROPRIATE_FALLBACK  86/* fatal */\n# define TLS1_AD_USER_CANCELLED          90\n# define TLS1_AD_NO_RENEGOTIATION        100\n/* codes 110-114 are from RFC3546 */\n# define TLS1_AD_UNSUPPORTED_EXTENSION   110\n# define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111\n# define TLS1_AD_UNRECOGNIZED_NAME       112\n# define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113\n# define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114\n# define TLS1_AD_UNKNOWN_PSK_IDENTITY    115/* fatal */\n\n/* ExtensionType values from RFC3546 / RFC4366 / RFC6066 */\n# define TLSEXT_TYPE_server_name                 0\n# define TLSEXT_TYPE_max_fragment_length         1\n# define TLSEXT_TYPE_client_certificate_url      2\n# define TLSEXT_TYPE_trusted_ca_keys             3\n# define TLSEXT_TYPE_truncated_hmac              4\n# define TLSEXT_TYPE_status_request              5\n/* ExtensionType values from RFC4681 */\n# define TLSEXT_TYPE_user_mapping                6\n/* ExtensionType values from RFC5878 */\n# define TLSEXT_TYPE_client_authz                7\n# define TLSEXT_TYPE_server_authz                8\n/* ExtensionType values from RFC6091 */\n# define TLSEXT_TYPE_cert_type           9\n\n/* ExtensionType values from RFC4492 */\n# define TLSEXT_TYPE_elliptic_curves             10\n# define TLSEXT_TYPE_ec_point_formats            11\n\n/* ExtensionType value from RFC5054 */\n# define TLSEXT_TYPE_srp                         12\n\n/* ExtensionType values from RFC5246 */\n# define TLSEXT_TYPE_signature_algorithms        13\n\n/* ExtensionType value from RFC5764 */\n# define TLSEXT_TYPE_use_srtp    14\n\n/* ExtensionType value from RFC5620 */\n# define TLSEXT_TYPE_heartbeat   15\n\n/* ExtensionType value from RFC7301 */\n# define TLSEXT_TYPE_application_layer_protocol_negotiation 16\n\n/*\n * ExtensionType value for TLS padding extension.\n * http://tools.ietf.org/html/draft-agl-tls-padding\n */\n# define TLSEXT_TYPE_padding     21\n\n/* ExtensionType value from RFC4507 */\n# define TLSEXT_TYPE_session_ticket              35\n\n/* ExtensionType value from draft-rescorla-tls-opaque-prf-input-00.txt */\n# if 0\n/*\n * will have to be provided externally for now ,\n * i.e. build with -DTLSEXT_TYPE_opaque_prf_input=38183\n * using whatever extension number you'd like to try\n */\n#  define TLSEXT_TYPE_opaque_prf_input           ??\n# endif\n\n/* Temporary extension type */\n# define TLSEXT_TYPE_renegotiate                 0xff01\n\n# ifndef OPENSSL_NO_NEXTPROTONEG\n/* This is not an IANA defined extension number */\n#  define TLSEXT_TYPE_next_proto_neg              13172\n# endif\n\n/* NameType value from RFC3546 */\n# define TLSEXT_NAMETYPE_host_name 0\n/* status request value from RFC3546 */\n# define TLSEXT_STATUSTYPE_ocsp 1\n\n/* ECPointFormat values from RFC4492 */\n# define TLSEXT_ECPOINTFORMAT_first                      0\n# define TLSEXT_ECPOINTFORMAT_uncompressed               0\n# define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime  1\n# define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_char2  2\n# define TLSEXT_ECPOINTFORMAT_last                       2\n\n/* Signature and hash algorithms from RFC5246 */\n# define TLSEXT_signature_anonymous                      0\n# define TLSEXT_signature_rsa                            1\n# define TLSEXT_signature_dsa                            2\n# define TLSEXT_signature_ecdsa                          3\n\n/* Total number of different signature algorithms */\n# define TLSEXT_signature_num                            4\n\n# define TLSEXT_hash_none                                0\n# define TLSEXT_hash_md5                                 1\n# define TLSEXT_hash_sha1                                2\n# define TLSEXT_hash_sha224                              3\n# define TLSEXT_hash_sha256                              4\n# define TLSEXT_hash_sha384                              5\n# define TLSEXT_hash_sha512                              6\n\n/* Total number of different digest algorithms */\n\n# define TLSEXT_hash_num                                 7\n\n/* Flag set for unrecognised algorithms */\n# define TLSEXT_nid_unknown                              0x1000000\n\n/* ECC curves */\n\n# define TLSEXT_curve_P_256                              23\n# define TLSEXT_curve_P_384                              24\n\n# ifndef OPENSSL_NO_TLSEXT\n\n#  define TLSEXT_MAXLEN_host_name 255\n\nconst char *SSL_get_servername(const SSL *s, const int type);\nint SSL_get_servername_type(const SSL *s);\n/*\n * SSL_export_keying_material exports a value derived from the master secret,\n * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and\n * optional context. (Since a zero length context is allowed, the |use_context|\n * flag controls whether a context is included.) It returns 1 on success and\n * zero otherwise.\n */\nint SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,\n                               const char *label, size_t llen,\n                               const unsigned char *context, size_t contextlen,\n                               int use_context);\n\nint SSL_get_sigalgs(SSL *s, int idx,\n                    int *psign, int *phash, int *psignandhash,\n                    unsigned char *rsig, unsigned char *rhash);\n\nint SSL_get_shared_sigalgs(SSL *s, int idx,\n                           int *psign, int *phash, int *psignandhash,\n                           unsigned char *rsig, unsigned char *rhash);\n\nint SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain);\n\n#  define SSL_set_tlsext_host_name(s,name) \\\nSSL_ctrl(s,SSL_CTRL_SET_TLSEXT_HOSTNAME,TLSEXT_NAMETYPE_host_name,(char *)name)\n\n#  define SSL_set_tlsext_debug_callback(ssl, cb) \\\nSSL_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_CB,(void (*)(void))cb)\n\n#  define SSL_set_tlsext_debug_arg(ssl, arg) \\\nSSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_DEBUG_ARG,0, (void *)arg)\n\n#  define SSL_set_tlsext_status_type(ssl, type) \\\nSSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE,type, NULL)\n\n#  define SSL_get_tlsext_status_exts(ssl, arg) \\\nSSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg)\n\n#  define SSL_set_tlsext_status_exts(ssl, arg) \\\nSSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS,0, (void *)arg)\n\n#  define SSL_get_tlsext_status_ids(ssl, arg) \\\nSSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg)\n\n#  define SSL_set_tlsext_status_ids(ssl, arg) \\\nSSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS,0, (void *)arg)\n\n#  define SSL_get_tlsext_status_ocsp_resp(ssl, arg) \\\nSSL_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP,0, (void *)arg)\n\n#  define SSL_set_tlsext_status_ocsp_resp(ssl, arg, arglen) \\\nSSL_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP,arglen, (void *)arg)\n\n#  define SSL_CTX_set_tlsext_servername_callback(ctx, cb) \\\nSSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_CB,(void (*)(void))cb)\n\n#  define SSL_TLSEXT_ERR_OK 0\n#  define SSL_TLSEXT_ERR_ALERT_WARNING 1\n#  define SSL_TLSEXT_ERR_ALERT_FATAL 2\n#  define SSL_TLSEXT_ERR_NOACK 3\n\n#  define SSL_CTX_set_tlsext_servername_arg(ctx, arg) \\\nSSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG,0, (void *)arg)\n\n#  define SSL_CTX_get_tlsext_ticket_keys(ctx, keys, keylen) \\\n        SSL_CTX_ctrl((ctx),SSL_CTRL_GET_TLSEXT_TICKET_KEYS,(keylen),(keys))\n#  define SSL_CTX_set_tlsext_ticket_keys(ctx, keys, keylen) \\\n        SSL_CTX_ctrl((ctx),SSL_CTRL_SET_TLSEXT_TICKET_KEYS,(keylen),(keys))\n\n#  define SSL_CTX_set_tlsext_status_cb(ssl, cb) \\\nSSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb)\n\n#  define SSL_CTX_set_tlsext_status_arg(ssl, arg) \\\nSSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg)\n\n#  define SSL_set_tlsext_opaque_prf_input(s, src, len) \\\nSSL_ctrl(s,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT, len, src)\n#  define SSL_CTX_set_tlsext_opaque_prf_input_callback(ctx, cb) \\\nSSL_CTX_callback_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB, (void (*)(void))cb)\n#  define SSL_CTX_set_tlsext_opaque_prf_input_callback_arg(ctx, arg) \\\nSSL_CTX_ctrl(ctx,SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG, 0, arg)\n\n#  define SSL_CTX_set_tlsext_ticket_key_cb(ssl, cb) \\\nSSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb)\n\n#  ifndef OPENSSL_NO_HEARTBEATS\n#   define SSL_TLSEXT_HB_ENABLED                           0x01\n#   define SSL_TLSEXT_HB_DONT_SEND_REQUESTS        0x02\n#   define SSL_TLSEXT_HB_DONT_RECV_REQUESTS        0x04\n\n#   define SSL_get_tlsext_heartbeat_pending(ssl) \\\n        SSL_ctrl((ssl),SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING,0,NULL)\n#   define SSL_set_tlsext_heartbeat_no_requests(ssl, arg) \\\n        SSL_ctrl((ssl),SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS,arg,NULL)\n#  endif\n# endif\n\n/* PSK ciphersuites from 4279 */\n# define TLS1_CK_PSK_WITH_RC4_128_SHA                    0x0300008A\n# define TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA               0x0300008B\n# define TLS1_CK_PSK_WITH_AES_128_CBC_SHA                0x0300008C\n# define TLS1_CK_PSK_WITH_AES_256_CBC_SHA                0x0300008D\n\n/*\n * Additional TLS ciphersuites from expired Internet Draft\n * draft-ietf-tls-56-bit-ciphersuites-01.txt (available if\n * TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES is defined, see s3_lib.c).  We\n * actually treat them like SSL 3.0 ciphers, which we probably shouldn't.\n * Note that the first two are actually not in the IDs.\n */\n# define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5          0x03000060/* not in\n                                                                    * ID */\n# define TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5      0x03000061/* not in\n                                                                    * ID */\n# define TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA         0x03000062\n# define TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA     0x03000063\n# define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA          0x03000064\n# define TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA      0x03000065\n# define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA                0x03000066\n\n/* AES ciphersuites from RFC3268 */\n# define TLS1_CK_RSA_WITH_AES_128_SHA                    0x0300002F\n# define TLS1_CK_DH_DSS_WITH_AES_128_SHA                 0x03000030\n# define TLS1_CK_DH_RSA_WITH_AES_128_SHA                 0x03000031\n# define TLS1_CK_DHE_DSS_WITH_AES_128_SHA                0x03000032\n# define TLS1_CK_DHE_RSA_WITH_AES_128_SHA                0x03000033\n# define TLS1_CK_ADH_WITH_AES_128_SHA                    0x03000034\n\n# define TLS1_CK_RSA_WITH_AES_256_SHA                    0x03000035\n# define TLS1_CK_DH_DSS_WITH_AES_256_SHA                 0x03000036\n# define TLS1_CK_DH_RSA_WITH_AES_256_SHA                 0x03000037\n# define TLS1_CK_DHE_DSS_WITH_AES_256_SHA                0x03000038\n# define TLS1_CK_DHE_RSA_WITH_AES_256_SHA                0x03000039\n# define TLS1_CK_ADH_WITH_AES_256_SHA                    0x0300003A\n\n/* TLS v1.2 ciphersuites */\n# define TLS1_CK_RSA_WITH_NULL_SHA256                    0x0300003B\n# define TLS1_CK_RSA_WITH_AES_128_SHA256                 0x0300003C\n# define TLS1_CK_RSA_WITH_AES_256_SHA256                 0x0300003D\n# define TLS1_CK_DH_DSS_WITH_AES_128_SHA256              0x0300003E\n# define TLS1_CK_DH_RSA_WITH_AES_128_SHA256              0x0300003F\n# define TLS1_CK_DHE_DSS_WITH_AES_128_SHA256             0x03000040\n\n/* Camellia ciphersuites from RFC4132 */\n# define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA           0x03000041\n# define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA        0x03000042\n# define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA        0x03000043\n# define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA       0x03000044\n# define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA       0x03000045\n# define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA           0x03000046\n\n/* TLS v1.2 ciphersuites */\n# define TLS1_CK_DHE_RSA_WITH_AES_128_SHA256             0x03000067\n# define TLS1_CK_DH_DSS_WITH_AES_256_SHA256              0x03000068\n# define TLS1_CK_DH_RSA_WITH_AES_256_SHA256              0x03000069\n# define TLS1_CK_DHE_DSS_WITH_AES_256_SHA256             0x0300006A\n# define TLS1_CK_DHE_RSA_WITH_AES_256_SHA256             0x0300006B\n# define TLS1_CK_ADH_WITH_AES_128_SHA256                 0x0300006C\n# define TLS1_CK_ADH_WITH_AES_256_SHA256                 0x0300006D\n\n/* Camellia ciphersuites from RFC4132 */\n# define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA           0x03000084\n# define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA        0x03000085\n# define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA        0x03000086\n# define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA       0x03000087\n# define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA       0x03000088\n# define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA           0x03000089\n\n/* SEED ciphersuites from RFC4162 */\n# define TLS1_CK_RSA_WITH_SEED_SHA                       0x03000096\n# define TLS1_CK_DH_DSS_WITH_SEED_SHA                    0x03000097\n# define TLS1_CK_DH_RSA_WITH_SEED_SHA                    0x03000098\n# define TLS1_CK_DHE_DSS_WITH_SEED_SHA                   0x03000099\n# define TLS1_CK_DHE_RSA_WITH_SEED_SHA                   0x0300009A\n# define TLS1_CK_ADH_WITH_SEED_SHA                       0x0300009B\n\n/* TLS v1.2 GCM ciphersuites from RFC5288 */\n# define TLS1_CK_RSA_WITH_AES_128_GCM_SHA256             0x0300009C\n# define TLS1_CK_RSA_WITH_AES_256_GCM_SHA384             0x0300009D\n# define TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256         0x0300009E\n# define TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384         0x0300009F\n# define TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256          0x030000A0\n# define TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384          0x030000A1\n# define TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256         0x030000A2\n# define TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384         0x030000A3\n# define TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256          0x030000A4\n# define TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384          0x030000A5\n# define TLS1_CK_ADH_WITH_AES_128_GCM_SHA256             0x030000A6\n# define TLS1_CK_ADH_WITH_AES_256_GCM_SHA384             0x030000A7\n\n/*\n * ECC ciphersuites from draft-ietf-tls-ecc-12.txt with changes soon to be in\n * draft 13\n */\n# define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA                0x0300C001\n# define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA             0x0300C002\n# define TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA        0x0300C003\n# define TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA         0x0300C004\n# define TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA         0x0300C005\n\n# define TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA               0x0300C006\n# define TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA            0x0300C007\n# define TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA       0x0300C008\n# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA        0x0300C009\n# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA        0x0300C00A\n\n# define TLS1_CK_ECDH_RSA_WITH_NULL_SHA                  0x0300C00B\n# define TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA               0x0300C00C\n# define TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA          0x0300C00D\n# define TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA           0x0300C00E\n# define TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA           0x0300C00F\n\n# define TLS1_CK_ECDHE_RSA_WITH_NULL_SHA                 0x0300C010\n# define TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA              0x0300C011\n# define TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA         0x0300C012\n# define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA          0x0300C013\n# define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA          0x0300C014\n\n# define TLS1_CK_ECDH_anon_WITH_NULL_SHA                 0x0300C015\n# define TLS1_CK_ECDH_anon_WITH_RC4_128_SHA              0x0300C016\n# define TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA         0x0300C017\n# define TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA          0x0300C018\n# define TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA          0x0300C019\n\n/* SRP ciphersuites from RFC 5054 */\n# define TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA           0x0300C01A\n# define TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA       0x0300C01B\n# define TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA       0x0300C01C\n# define TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA            0x0300C01D\n# define TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA        0x0300C01E\n# define TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA        0x0300C01F\n# define TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA            0x0300C020\n# define TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA        0x0300C021\n# define TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA        0x0300C022\n\n/* ECDH HMAC based ciphersuites from RFC5289 */\n\n# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256         0x0300C023\n# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384         0x0300C024\n# define TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256          0x0300C025\n# define TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384          0x0300C026\n# define TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256           0x0300C027\n# define TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384           0x0300C028\n# define TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256            0x0300C029\n# define TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384            0x0300C02A\n\n/* ECDH GCM based ciphersuites from RFC5289 */\n# define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256     0x0300C02B\n# define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384     0x0300C02C\n# define TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256      0x0300C02D\n# define TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384      0x0300C02E\n# define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256       0x0300C02F\n# define TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384       0x0300C030\n# define TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256        0x0300C031\n# define TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384        0x0300C032\n\n/*\n * XXX * Backward compatibility alert: + * Older versions of OpenSSL gave\n * some DHE ciphers names with \"EDH\" + * instead of \"DHE\".  Going forward, we\n * should be using DHE + * everywhere, though we may indefinitely maintain\n * aliases for users + * or configurations that used \"EDH\" +\n */\n# define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5         \"EXP1024-RC4-MD5\"\n# define TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5     \"EXP1024-RC2-CBC-MD5\"\n# define TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA        \"EXP1024-DES-CBC-SHA\"\n# define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA    \"EXP1024-DHE-DSS-DES-CBC-SHA\"\n# define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA         \"EXP1024-RC4-SHA\"\n# define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA     \"EXP1024-DHE-DSS-RC4-SHA\"\n# define TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA               \"DHE-DSS-RC4-SHA\"\n\n/* AES ciphersuites from RFC3268 */\n# define TLS1_TXT_RSA_WITH_AES_128_SHA                   \"AES128-SHA\"\n# define TLS1_TXT_DH_DSS_WITH_AES_128_SHA                \"DH-DSS-AES128-SHA\"\n# define TLS1_TXT_DH_RSA_WITH_AES_128_SHA                \"DH-RSA-AES128-SHA\"\n# define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA               \"DHE-DSS-AES128-SHA\"\n# define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA               \"DHE-RSA-AES128-SHA\"\n# define TLS1_TXT_ADH_WITH_AES_128_SHA                   \"ADH-AES128-SHA\"\n\n# define TLS1_TXT_RSA_WITH_AES_256_SHA                   \"AES256-SHA\"\n# define TLS1_TXT_DH_DSS_WITH_AES_256_SHA                \"DH-DSS-AES256-SHA\"\n# define TLS1_TXT_DH_RSA_WITH_AES_256_SHA                \"DH-RSA-AES256-SHA\"\n# define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA               \"DHE-DSS-AES256-SHA\"\n# define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA               \"DHE-RSA-AES256-SHA\"\n# define TLS1_TXT_ADH_WITH_AES_256_SHA                   \"ADH-AES256-SHA\"\n\n/* ECC ciphersuites from RFC4492 */\n# define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA               \"ECDH-ECDSA-NULL-SHA\"\n# define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA            \"ECDH-ECDSA-RC4-SHA\"\n# define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA       \"ECDH-ECDSA-DES-CBC3-SHA\"\n# define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA        \"ECDH-ECDSA-AES128-SHA\"\n# define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA        \"ECDH-ECDSA-AES256-SHA\"\n\n# define TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA              \"ECDHE-ECDSA-NULL-SHA\"\n# define TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA           \"ECDHE-ECDSA-RC4-SHA\"\n# define TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA      \"ECDHE-ECDSA-DES-CBC3-SHA\"\n# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA       \"ECDHE-ECDSA-AES128-SHA\"\n# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA       \"ECDHE-ECDSA-AES256-SHA\"\n\n# define TLS1_TXT_ECDH_RSA_WITH_NULL_SHA                 \"ECDH-RSA-NULL-SHA\"\n# define TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA              \"ECDH-RSA-RC4-SHA\"\n# define TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA         \"ECDH-RSA-DES-CBC3-SHA\"\n# define TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA          \"ECDH-RSA-AES128-SHA\"\n# define TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA          \"ECDH-RSA-AES256-SHA\"\n\n# define TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA                \"ECDHE-RSA-NULL-SHA\"\n# define TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA             \"ECDHE-RSA-RC4-SHA\"\n# define TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA        \"ECDHE-RSA-DES-CBC3-SHA\"\n# define TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA         \"ECDHE-RSA-AES128-SHA\"\n# define TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA         \"ECDHE-RSA-AES256-SHA\"\n\n# define TLS1_TXT_ECDH_anon_WITH_NULL_SHA                \"AECDH-NULL-SHA\"\n# define TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA             \"AECDH-RC4-SHA\"\n# define TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA        \"AECDH-DES-CBC3-SHA\"\n# define TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA         \"AECDH-AES128-SHA\"\n# define TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA         \"AECDH-AES256-SHA\"\n\n/* PSK ciphersuites from RFC 4279 */\n# define TLS1_TXT_PSK_WITH_RC4_128_SHA                   \"PSK-RC4-SHA\"\n# define TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA              \"PSK-3DES-EDE-CBC-SHA\"\n# define TLS1_TXT_PSK_WITH_AES_128_CBC_SHA               \"PSK-AES128-CBC-SHA\"\n# define TLS1_TXT_PSK_WITH_AES_256_CBC_SHA               \"PSK-AES256-CBC-SHA\"\n\n/* SRP ciphersuite from RFC 5054 */\n# define TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA          \"SRP-3DES-EDE-CBC-SHA\"\n# define TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA      \"SRP-RSA-3DES-EDE-CBC-SHA\"\n# define TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA      \"SRP-DSS-3DES-EDE-CBC-SHA\"\n# define TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA           \"SRP-AES-128-CBC-SHA\"\n# define TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA       \"SRP-RSA-AES-128-CBC-SHA\"\n# define TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA       \"SRP-DSS-AES-128-CBC-SHA\"\n# define TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA           \"SRP-AES-256-CBC-SHA\"\n# define TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA       \"SRP-RSA-AES-256-CBC-SHA\"\n# define TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA       \"SRP-DSS-AES-256-CBC-SHA\"\n\n/* Camellia ciphersuites from RFC4132 */\n# define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA          \"CAMELLIA128-SHA\"\n# define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA       \"DH-DSS-CAMELLIA128-SHA\"\n# define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA       \"DH-RSA-CAMELLIA128-SHA\"\n# define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA      \"DHE-DSS-CAMELLIA128-SHA\"\n# define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA      \"DHE-RSA-CAMELLIA128-SHA\"\n# define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA          \"ADH-CAMELLIA128-SHA\"\n\n# define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA          \"CAMELLIA256-SHA\"\n# define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA       \"DH-DSS-CAMELLIA256-SHA\"\n# define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA       \"DH-RSA-CAMELLIA256-SHA\"\n# define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA      \"DHE-DSS-CAMELLIA256-SHA\"\n# define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA      \"DHE-RSA-CAMELLIA256-SHA\"\n# define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA          \"ADH-CAMELLIA256-SHA\"\n\n/* SEED ciphersuites from RFC4162 */\n# define TLS1_TXT_RSA_WITH_SEED_SHA                      \"SEED-SHA\"\n# define TLS1_TXT_DH_DSS_WITH_SEED_SHA                   \"DH-DSS-SEED-SHA\"\n# define TLS1_TXT_DH_RSA_WITH_SEED_SHA                   \"DH-RSA-SEED-SHA\"\n# define TLS1_TXT_DHE_DSS_WITH_SEED_SHA                  \"DHE-DSS-SEED-SHA\"\n# define TLS1_TXT_DHE_RSA_WITH_SEED_SHA                  \"DHE-RSA-SEED-SHA\"\n# define TLS1_TXT_ADH_WITH_SEED_SHA                      \"ADH-SEED-SHA\"\n\n/* TLS v1.2 ciphersuites */\n# define TLS1_TXT_RSA_WITH_NULL_SHA256                   \"NULL-SHA256\"\n# define TLS1_TXT_RSA_WITH_AES_128_SHA256                \"AES128-SHA256\"\n# define TLS1_TXT_RSA_WITH_AES_256_SHA256                \"AES256-SHA256\"\n# define TLS1_TXT_DH_DSS_WITH_AES_128_SHA256             \"DH-DSS-AES128-SHA256\"\n# define TLS1_TXT_DH_RSA_WITH_AES_128_SHA256             \"DH-RSA-AES128-SHA256\"\n# define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256            \"DHE-DSS-AES128-SHA256\"\n# define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256            \"DHE-RSA-AES128-SHA256\"\n# define TLS1_TXT_DH_DSS_WITH_AES_256_SHA256             \"DH-DSS-AES256-SHA256\"\n# define TLS1_TXT_DH_RSA_WITH_AES_256_SHA256             \"DH-RSA-AES256-SHA256\"\n# define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256            \"DHE-DSS-AES256-SHA256\"\n# define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256            \"DHE-RSA-AES256-SHA256\"\n# define TLS1_TXT_ADH_WITH_AES_128_SHA256                \"ADH-AES128-SHA256\"\n# define TLS1_TXT_ADH_WITH_AES_256_SHA256                \"ADH-AES256-SHA256\"\n\n/* TLS v1.2 GCM ciphersuites from RFC5288 */\n# define TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256            \"AES128-GCM-SHA256\"\n# define TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384            \"AES256-GCM-SHA384\"\n# define TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256        \"DHE-RSA-AES128-GCM-SHA256\"\n# define TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384        \"DHE-RSA-AES256-GCM-SHA384\"\n# define TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256         \"DH-RSA-AES128-GCM-SHA256\"\n# define TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384         \"DH-RSA-AES256-GCM-SHA384\"\n# define TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256        \"DHE-DSS-AES128-GCM-SHA256\"\n# define TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384        \"DHE-DSS-AES256-GCM-SHA384\"\n# define TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256         \"DH-DSS-AES128-GCM-SHA256\"\n# define TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384         \"DH-DSS-AES256-GCM-SHA384\"\n# define TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256            \"ADH-AES128-GCM-SHA256\"\n# define TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384            \"ADH-AES256-GCM-SHA384\"\n\n/* ECDH HMAC based ciphersuites from RFC5289 */\n\n# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256    \"ECDHE-ECDSA-AES128-SHA256\"\n# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384    \"ECDHE-ECDSA-AES256-SHA384\"\n# define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256     \"ECDH-ECDSA-AES128-SHA256\"\n# define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384     \"ECDH-ECDSA-AES256-SHA384\"\n# define TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256      \"ECDHE-RSA-AES128-SHA256\"\n# define TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384      \"ECDHE-RSA-AES256-SHA384\"\n# define TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256       \"ECDH-RSA-AES128-SHA256\"\n# define TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384       \"ECDH-RSA-AES256-SHA384\"\n\n/* ECDH GCM based ciphersuites from RFC5289 */\n# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256    \"ECDHE-ECDSA-AES128-GCM-SHA256\"\n# define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384    \"ECDHE-ECDSA-AES256-GCM-SHA384\"\n# define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256     \"ECDH-ECDSA-AES128-GCM-SHA256\"\n# define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384     \"ECDH-ECDSA-AES256-GCM-SHA384\"\n# define TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256      \"ECDHE-RSA-AES128-GCM-SHA256\"\n# define TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384      \"ECDHE-RSA-AES256-GCM-SHA384\"\n# define TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256       \"ECDH-RSA-AES128-GCM-SHA256\"\n# define TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384       \"ECDH-RSA-AES256-GCM-SHA384\"\n\n# define TLS_CT_RSA_SIGN                 1\n# define TLS_CT_DSS_SIGN                 2\n# define TLS_CT_RSA_FIXED_DH             3\n# define TLS_CT_DSS_FIXED_DH             4\n# define TLS_CT_ECDSA_SIGN               64\n# define TLS_CT_RSA_FIXED_ECDH           65\n# define TLS_CT_ECDSA_FIXED_ECDH         66\n# define TLS_CT_GOST94_SIGN              21\n# define TLS_CT_GOST01_SIGN              22\n/*\n * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see\n * comment there)\n */\n# define TLS_CT_NUMBER                   9\n\n# define TLS1_FINISH_MAC_LENGTH          12\n\n# define TLS_MD_MAX_CONST_SIZE                   20\n# define TLS_MD_CLIENT_FINISH_CONST              \"client finished\"\n# define TLS_MD_CLIENT_FINISH_CONST_SIZE         15\n# define TLS_MD_SERVER_FINISH_CONST              \"server finished\"\n# define TLS_MD_SERVER_FINISH_CONST_SIZE         15\n# define TLS_MD_SERVER_WRITE_KEY_CONST           \"server write key\"\n# define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE      16\n# define TLS_MD_KEY_EXPANSION_CONST              \"key expansion\"\n# define TLS_MD_KEY_EXPANSION_CONST_SIZE         13\n# define TLS_MD_CLIENT_WRITE_KEY_CONST           \"client write key\"\n# define TLS_MD_CLIENT_WRITE_KEY_CONST_SIZE      16\n# define TLS_MD_SERVER_WRITE_KEY_CONST           \"server write key\"\n# define TLS_MD_SERVER_WRITE_KEY_CONST_SIZE      16\n# define TLS_MD_IV_BLOCK_CONST                   \"IV block\"\n# define TLS_MD_IV_BLOCK_CONST_SIZE              8\n# define TLS_MD_MASTER_SECRET_CONST              \"master secret\"\n# define TLS_MD_MASTER_SECRET_CONST_SIZE         13\n\n# ifdef CHARSET_EBCDIC\n#  undef TLS_MD_CLIENT_FINISH_CONST\n/*\n * client finished\n */\n#  define TLS_MD_CLIENT_FINISH_CONST    \"\\x63\\x6c\\x69\\x65\\x6e\\x74\\x20\\x66\\x69\\x6e\\x69\\x73\\x68\\x65\\x64\"\n\n#  undef TLS_MD_SERVER_FINISH_CONST\n/*\n * server finished\n */\n#  define TLS_MD_SERVER_FINISH_CONST    \"\\x73\\x65\\x72\\x76\\x65\\x72\\x20\\x66\\x69\\x6e\\x69\\x73\\x68\\x65\\x64\"\n\n#  undef TLS_MD_SERVER_WRITE_KEY_CONST\n/*\n * server write key\n */\n#  define TLS_MD_SERVER_WRITE_KEY_CONST \"\\x73\\x65\\x72\\x76\\x65\\x72\\x20\\x77\\x72\\x69\\x74\\x65\\x20\\x6b\\x65\\x79\"\n\n#  undef TLS_MD_KEY_EXPANSION_CONST\n/*\n * key expansion\n */\n#  define TLS_MD_KEY_EXPANSION_CONST    \"\\x6b\\x65\\x79\\x20\\x65\\x78\\x70\\x61\\x6e\\x73\\x69\\x6f\\x6e\"\n\n#  undef TLS_MD_CLIENT_WRITE_KEY_CONST\n/*\n * client write key\n */\n#  define TLS_MD_CLIENT_WRITE_KEY_CONST \"\\x63\\x6c\\x69\\x65\\x6e\\x74\\x20\\x77\\x72\\x69\\x74\\x65\\x20\\x6b\\x65\\x79\"\n\n#  undef TLS_MD_SERVER_WRITE_KEY_CONST\n/*\n * server write key\n */\n#  define TLS_MD_SERVER_WRITE_KEY_CONST \"\\x73\\x65\\x72\\x76\\x65\\x72\\x20\\x77\\x72\\x69\\x74\\x65\\x20\\x6b\\x65\\x79\"\n\n#  undef TLS_MD_IV_BLOCK_CONST\n/*\n * IV block\n */\n#  define TLS_MD_IV_BLOCK_CONST         \"\\x49\\x56\\x20\\x62\\x6c\\x6f\\x63\\x6b\"\n\n#  undef TLS_MD_MASTER_SECRET_CONST\n/*\n * master secret\n */\n#  define TLS_MD_MASTER_SECRET_CONST    \"\\x6d\\x61\\x73\\x74\\x65\\x72\\x20\\x73\\x65\\x63\\x72\\x65\\x74\"\n# endif\n\n/* TLS Session Ticket extension struct */\nstruct tls_session_ticket_ext_st {\n    unsigned short length;\n    void *data;\n};\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/ts.h",
    "content": "/* crypto/ts/ts.h */\n/*\n * Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL project\n * 2002, 2003, 2004.\n */\n/* ====================================================================\n * Copyright (c) 2006 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_TS_H\n# define HEADER_TS_H\n\n# include <openssl/opensslconf.h>\n# include <openssl/symhacks.h>\n# ifndef OPENSSL_NO_BUFFER\n#  include <openssl/buffer.h>\n# endif\n# ifndef OPENSSL_NO_EVP\n#  include <openssl/evp.h>\n# endif\n# ifndef OPENSSL_NO_BIO\n#  include <openssl/bio.h>\n# endif\n# include <openssl/stack.h>\n# include <openssl/asn1.h>\n# include <openssl/safestack.h>\n\n# ifndef OPENSSL_NO_RSA\n#  include <openssl/rsa.h>\n# endif\n\n# ifndef OPENSSL_NO_DSA\n#  include <openssl/dsa.h>\n# endif\n\n# ifndef OPENSSL_NO_DH\n#  include <openssl/dh.h>\n# endif\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# ifdef WIN32\n/* Under Win32 this is defined in wincrypt.h */\n#  undef X509_NAME\n# endif\n\n# include <openssl/x509.h>\n# include <openssl/x509v3.h>\n\n/*-\nMessageImprint ::= SEQUENCE  {\n     hashAlgorithm                AlgorithmIdentifier,\n     hashedMessage                OCTET STRING  }\n*/\n\ntypedef struct TS_msg_imprint_st {\n    X509_ALGOR *hash_algo;\n    ASN1_OCTET_STRING *hashed_msg;\n} TS_MSG_IMPRINT;\n\n/*-\nTimeStampReq ::= SEQUENCE  {\n   version                  INTEGER  { v1(1) },\n   messageImprint           MessageImprint,\n     --a hash algorithm OID and the hash value of the data to be\n     --time-stamped\n   reqPolicy                TSAPolicyId                OPTIONAL,\n   nonce                    INTEGER                    OPTIONAL,\n   certReq                  BOOLEAN                    DEFAULT FALSE,\n   extensions               [0] IMPLICIT Extensions    OPTIONAL  }\n*/\n\ntypedef struct TS_req_st {\n    ASN1_INTEGER *version;\n    TS_MSG_IMPRINT *msg_imprint;\n    ASN1_OBJECT *policy_id;     /* OPTIONAL */\n    ASN1_INTEGER *nonce;        /* OPTIONAL */\n    ASN1_BOOLEAN cert_req;      /* DEFAULT FALSE */\n    STACK_OF(X509_EXTENSION) *extensions; /* [0] OPTIONAL */\n} TS_REQ;\n\n/*-\nAccuracy ::= SEQUENCE {\n                seconds        INTEGER           OPTIONAL,\n                millis     [0] INTEGER  (1..999) OPTIONAL,\n                micros     [1] INTEGER  (1..999) OPTIONAL  }\n*/\n\ntypedef struct TS_accuracy_st {\n    ASN1_INTEGER *seconds;\n    ASN1_INTEGER *millis;\n    ASN1_INTEGER *micros;\n} TS_ACCURACY;\n\n/*-\nTSTInfo ::= SEQUENCE  {\n    version                      INTEGER  { v1(1) },\n    policy                       TSAPolicyId,\n    messageImprint               MessageImprint,\n      -- MUST have the same value as the similar field in\n      -- TimeStampReq\n    serialNumber                 INTEGER,\n     -- Time-Stamping users MUST be ready to accommodate integers\n     -- up to 160 bits.\n    genTime                      GeneralizedTime,\n    accuracy                     Accuracy                 OPTIONAL,\n    ordering                     BOOLEAN             DEFAULT FALSE,\n    nonce                        INTEGER                  OPTIONAL,\n      -- MUST be present if the similar field was present\n      -- in TimeStampReq.  In that case it MUST have the same value.\n    tsa                          [0] GeneralName          OPTIONAL,\n    extensions                   [1] IMPLICIT Extensions  OPTIONAL   }\n*/\n\ntypedef struct TS_tst_info_st {\n    ASN1_INTEGER *version;\n    ASN1_OBJECT *policy_id;\n    TS_MSG_IMPRINT *msg_imprint;\n    ASN1_INTEGER *serial;\n    ASN1_GENERALIZEDTIME *time;\n    TS_ACCURACY *accuracy;\n    ASN1_BOOLEAN ordering;\n    ASN1_INTEGER *nonce;\n    GENERAL_NAME *tsa;\n    STACK_OF(X509_EXTENSION) *extensions;\n} TS_TST_INFO;\n\n/*-\nPKIStatusInfo ::= SEQUENCE {\n    status        PKIStatus,\n    statusString  PKIFreeText     OPTIONAL,\n    failInfo      PKIFailureInfo  OPTIONAL  }\n\nFrom RFC 1510 - section 3.1.1:\nPKIFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String\n        -- text encoded as UTF-8 String (note:  each UTF8String SHOULD\n        -- include an RFC 1766 language tag to indicate the language\n        -- of the contained text)\n*/\n\n/* Possible values for status. See ts_resp_print.c && ts_resp_verify.c. */\n\n# define TS_STATUS_GRANTED                       0\n# define TS_STATUS_GRANTED_WITH_MODS             1\n# define TS_STATUS_REJECTION                     2\n# define TS_STATUS_WAITING                       3\n# define TS_STATUS_REVOCATION_WARNING            4\n# define TS_STATUS_REVOCATION_NOTIFICATION       5\n\n/*\n * Possible values for failure_info. See ts_resp_print.c && ts_resp_verify.c\n */\n\n# define TS_INFO_BAD_ALG                 0\n# define TS_INFO_BAD_REQUEST             2\n# define TS_INFO_BAD_DATA_FORMAT         5\n# define TS_INFO_TIME_NOT_AVAILABLE      14\n# define TS_INFO_UNACCEPTED_POLICY       15\n# define TS_INFO_UNACCEPTED_EXTENSION    16\n# define TS_INFO_ADD_INFO_NOT_AVAILABLE  17\n# define TS_INFO_SYSTEM_FAILURE          25\n\ntypedef struct TS_status_info_st {\n    ASN1_INTEGER *status;\n    STACK_OF(ASN1_UTF8STRING) *text;\n    ASN1_BIT_STRING *failure_info;\n} TS_STATUS_INFO;\n\nDECLARE_STACK_OF(ASN1_UTF8STRING)\nDECLARE_ASN1_SET_OF(ASN1_UTF8STRING)\n\n/*-\nTimeStampResp ::= SEQUENCE  {\n     status                  PKIStatusInfo,\n     timeStampToken          TimeStampToken     OPTIONAL }\n*/\n\ntypedef struct TS_resp_st {\n    TS_STATUS_INFO *status_info;\n    PKCS7 *token;\n    TS_TST_INFO *tst_info;\n} TS_RESP;\n\n/* The structure below would belong to the ESS component. */\n\n/*-\nIssuerSerial ::= SEQUENCE {\n        issuer                   GeneralNames,\n        serialNumber             CertificateSerialNumber\n        }\n*/\n\ntypedef struct ESS_issuer_serial {\n    STACK_OF(GENERAL_NAME) *issuer;\n    ASN1_INTEGER *serial;\n} ESS_ISSUER_SERIAL;\n\n/*-\nESSCertID ::=  SEQUENCE {\n        certHash                 Hash,\n        issuerSerial             IssuerSerial OPTIONAL\n}\n*/\n\ntypedef struct ESS_cert_id {\n    ASN1_OCTET_STRING *hash;    /* Always SHA-1 digest. */\n    ESS_ISSUER_SERIAL *issuer_serial;\n} ESS_CERT_ID;\n\nDECLARE_STACK_OF(ESS_CERT_ID)\nDECLARE_ASN1_SET_OF(ESS_CERT_ID)\n\n/*-\nSigningCertificate ::=  SEQUENCE {\n       certs        SEQUENCE OF ESSCertID,\n       policies     SEQUENCE OF PolicyInformation OPTIONAL\n}\n*/\n\ntypedef struct ESS_signing_cert {\n    STACK_OF(ESS_CERT_ID) *cert_ids;\n    STACK_OF(POLICYINFO) *policy_info;\n} ESS_SIGNING_CERT;\n\nTS_REQ *TS_REQ_new(void);\nvoid TS_REQ_free(TS_REQ *a);\nint i2d_TS_REQ(const TS_REQ *a, unsigned char **pp);\nTS_REQ *d2i_TS_REQ(TS_REQ **a, const unsigned char **pp, long length);\n\nTS_REQ *TS_REQ_dup(TS_REQ *a);\n\nTS_REQ *d2i_TS_REQ_fp(FILE *fp, TS_REQ **a);\nint i2d_TS_REQ_fp(FILE *fp, TS_REQ *a);\nTS_REQ *d2i_TS_REQ_bio(BIO *fp, TS_REQ **a);\nint i2d_TS_REQ_bio(BIO *fp, TS_REQ *a);\n\nTS_MSG_IMPRINT *TS_MSG_IMPRINT_new(void);\nvoid TS_MSG_IMPRINT_free(TS_MSG_IMPRINT *a);\nint i2d_TS_MSG_IMPRINT(const TS_MSG_IMPRINT *a, unsigned char **pp);\nTS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT(TS_MSG_IMPRINT **a,\n                                   const unsigned char **pp, long length);\n\nTS_MSG_IMPRINT *TS_MSG_IMPRINT_dup(TS_MSG_IMPRINT *a);\n\nTS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT **a);\nint i2d_TS_MSG_IMPRINT_fp(FILE *fp, TS_MSG_IMPRINT *a);\nTS_MSG_IMPRINT *d2i_TS_MSG_IMPRINT_bio(BIO *fp, TS_MSG_IMPRINT **a);\nint i2d_TS_MSG_IMPRINT_bio(BIO *fp, TS_MSG_IMPRINT *a);\n\nTS_RESP *TS_RESP_new(void);\nvoid TS_RESP_free(TS_RESP *a);\nint i2d_TS_RESP(const TS_RESP *a, unsigned char **pp);\nTS_RESP *d2i_TS_RESP(TS_RESP **a, const unsigned char **pp, long length);\nTS_TST_INFO *PKCS7_to_TS_TST_INFO(PKCS7 *token);\nTS_RESP *TS_RESP_dup(TS_RESP *a);\n\nTS_RESP *d2i_TS_RESP_fp(FILE *fp, TS_RESP **a);\nint i2d_TS_RESP_fp(FILE *fp, TS_RESP *a);\nTS_RESP *d2i_TS_RESP_bio(BIO *fp, TS_RESP **a);\nint i2d_TS_RESP_bio(BIO *fp, TS_RESP *a);\n\nTS_STATUS_INFO *TS_STATUS_INFO_new(void);\nvoid TS_STATUS_INFO_free(TS_STATUS_INFO *a);\nint i2d_TS_STATUS_INFO(const TS_STATUS_INFO *a, unsigned char **pp);\nTS_STATUS_INFO *d2i_TS_STATUS_INFO(TS_STATUS_INFO **a,\n                                   const unsigned char **pp, long length);\nTS_STATUS_INFO *TS_STATUS_INFO_dup(TS_STATUS_INFO *a);\n\nTS_TST_INFO *TS_TST_INFO_new(void);\nvoid TS_TST_INFO_free(TS_TST_INFO *a);\nint i2d_TS_TST_INFO(const TS_TST_INFO *a, unsigned char **pp);\nTS_TST_INFO *d2i_TS_TST_INFO(TS_TST_INFO **a, const unsigned char **pp,\n                             long length);\nTS_TST_INFO *TS_TST_INFO_dup(TS_TST_INFO *a);\n\nTS_TST_INFO *d2i_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO **a);\nint i2d_TS_TST_INFO_fp(FILE *fp, TS_TST_INFO *a);\nTS_TST_INFO *d2i_TS_TST_INFO_bio(BIO *fp, TS_TST_INFO **a);\nint i2d_TS_TST_INFO_bio(BIO *fp, TS_TST_INFO *a);\n\nTS_ACCURACY *TS_ACCURACY_new(void);\nvoid TS_ACCURACY_free(TS_ACCURACY *a);\nint i2d_TS_ACCURACY(const TS_ACCURACY *a, unsigned char **pp);\nTS_ACCURACY *d2i_TS_ACCURACY(TS_ACCURACY **a, const unsigned char **pp,\n                             long length);\nTS_ACCURACY *TS_ACCURACY_dup(TS_ACCURACY *a);\n\nESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_new(void);\nvoid ESS_ISSUER_SERIAL_free(ESS_ISSUER_SERIAL *a);\nint i2d_ESS_ISSUER_SERIAL(const ESS_ISSUER_SERIAL *a, unsigned char **pp);\nESS_ISSUER_SERIAL *d2i_ESS_ISSUER_SERIAL(ESS_ISSUER_SERIAL **a,\n                                         const unsigned char **pp,\n                                         long length);\nESS_ISSUER_SERIAL *ESS_ISSUER_SERIAL_dup(ESS_ISSUER_SERIAL *a);\n\nESS_CERT_ID *ESS_CERT_ID_new(void);\nvoid ESS_CERT_ID_free(ESS_CERT_ID *a);\nint i2d_ESS_CERT_ID(const ESS_CERT_ID *a, unsigned char **pp);\nESS_CERT_ID *d2i_ESS_CERT_ID(ESS_CERT_ID **a, const unsigned char **pp,\n                             long length);\nESS_CERT_ID *ESS_CERT_ID_dup(ESS_CERT_ID *a);\n\nESS_SIGNING_CERT *ESS_SIGNING_CERT_new(void);\nvoid ESS_SIGNING_CERT_free(ESS_SIGNING_CERT *a);\nint i2d_ESS_SIGNING_CERT(const ESS_SIGNING_CERT *a, unsigned char **pp);\nESS_SIGNING_CERT *d2i_ESS_SIGNING_CERT(ESS_SIGNING_CERT **a,\n                                       const unsigned char **pp, long length);\nESS_SIGNING_CERT *ESS_SIGNING_CERT_dup(ESS_SIGNING_CERT *a);\n\nvoid ERR_load_TS_strings(void);\n\nint TS_REQ_set_version(TS_REQ *a, long version);\nlong TS_REQ_get_version(const TS_REQ *a);\n\nint TS_REQ_set_msg_imprint(TS_REQ *a, TS_MSG_IMPRINT *msg_imprint);\nTS_MSG_IMPRINT *TS_REQ_get_msg_imprint(TS_REQ *a);\n\nint TS_MSG_IMPRINT_set_algo(TS_MSG_IMPRINT *a, X509_ALGOR *alg);\nX509_ALGOR *TS_MSG_IMPRINT_get_algo(TS_MSG_IMPRINT *a);\n\nint TS_MSG_IMPRINT_set_msg(TS_MSG_IMPRINT *a, unsigned char *d, int len);\nASN1_OCTET_STRING *TS_MSG_IMPRINT_get_msg(TS_MSG_IMPRINT *a);\n\nint TS_REQ_set_policy_id(TS_REQ *a, ASN1_OBJECT *policy);\nASN1_OBJECT *TS_REQ_get_policy_id(TS_REQ *a);\n\nint TS_REQ_set_nonce(TS_REQ *a, const ASN1_INTEGER *nonce);\nconst ASN1_INTEGER *TS_REQ_get_nonce(const TS_REQ *a);\n\nint TS_REQ_set_cert_req(TS_REQ *a, int cert_req);\nint TS_REQ_get_cert_req(const TS_REQ *a);\n\nSTACK_OF(X509_EXTENSION) *TS_REQ_get_exts(TS_REQ *a);\nvoid TS_REQ_ext_free(TS_REQ *a);\nint TS_REQ_get_ext_count(TS_REQ *a);\nint TS_REQ_get_ext_by_NID(TS_REQ *a, int nid, int lastpos);\nint TS_REQ_get_ext_by_OBJ(TS_REQ *a, ASN1_OBJECT *obj, int lastpos);\nint TS_REQ_get_ext_by_critical(TS_REQ *a, int crit, int lastpos);\nX509_EXTENSION *TS_REQ_get_ext(TS_REQ *a, int loc);\nX509_EXTENSION *TS_REQ_delete_ext(TS_REQ *a, int loc);\nint TS_REQ_add_ext(TS_REQ *a, X509_EXTENSION *ex, int loc);\nvoid *TS_REQ_get_ext_d2i(TS_REQ *a, int nid, int *crit, int *idx);\n\n/* Function declarations for TS_REQ defined in ts/ts_req_print.c */\n\nint TS_REQ_print_bio(BIO *bio, TS_REQ *a);\n\n/* Function declarations for TS_RESP defined in ts/ts_resp_utils.c */\n\nint TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *info);\nTS_STATUS_INFO *TS_RESP_get_status_info(TS_RESP *a);\n\n/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */\nvoid TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info);\nPKCS7 *TS_RESP_get_token(TS_RESP *a);\nTS_TST_INFO *TS_RESP_get_tst_info(TS_RESP *a);\n\nint TS_TST_INFO_set_version(TS_TST_INFO *a, long version);\nlong TS_TST_INFO_get_version(const TS_TST_INFO *a);\n\nint TS_TST_INFO_set_policy_id(TS_TST_INFO *a, ASN1_OBJECT *policy_id);\nASN1_OBJECT *TS_TST_INFO_get_policy_id(TS_TST_INFO *a);\n\nint TS_TST_INFO_set_msg_imprint(TS_TST_INFO *a, TS_MSG_IMPRINT *msg_imprint);\nTS_MSG_IMPRINT *TS_TST_INFO_get_msg_imprint(TS_TST_INFO *a);\n\nint TS_TST_INFO_set_serial(TS_TST_INFO *a, const ASN1_INTEGER *serial);\nconst ASN1_INTEGER *TS_TST_INFO_get_serial(const TS_TST_INFO *a);\n\nint TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime);\nconst ASN1_GENERALIZEDTIME *TS_TST_INFO_get_time(const TS_TST_INFO *a);\n\nint TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy);\nTS_ACCURACY *TS_TST_INFO_get_accuracy(TS_TST_INFO *a);\n\nint TS_ACCURACY_set_seconds(TS_ACCURACY *a, const ASN1_INTEGER *seconds);\nconst ASN1_INTEGER *TS_ACCURACY_get_seconds(const TS_ACCURACY *a);\n\nint TS_ACCURACY_set_millis(TS_ACCURACY *a, const ASN1_INTEGER *millis);\nconst ASN1_INTEGER *TS_ACCURACY_get_millis(const TS_ACCURACY *a);\n\nint TS_ACCURACY_set_micros(TS_ACCURACY *a, const ASN1_INTEGER *micros);\nconst ASN1_INTEGER *TS_ACCURACY_get_micros(const TS_ACCURACY *a);\n\nint TS_TST_INFO_set_ordering(TS_TST_INFO *a, int ordering);\nint TS_TST_INFO_get_ordering(const TS_TST_INFO *a);\n\nint TS_TST_INFO_set_nonce(TS_TST_INFO *a, const ASN1_INTEGER *nonce);\nconst ASN1_INTEGER *TS_TST_INFO_get_nonce(const TS_TST_INFO *a);\n\nint TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa);\nGENERAL_NAME *TS_TST_INFO_get_tsa(TS_TST_INFO *a);\n\nSTACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a);\nvoid TS_TST_INFO_ext_free(TS_TST_INFO *a);\nint TS_TST_INFO_get_ext_count(TS_TST_INFO *a);\nint TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos);\nint TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, ASN1_OBJECT *obj, int lastpos);\nint TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos);\nX509_EXTENSION *TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc);\nX509_EXTENSION *TS_TST_INFO_delete_ext(TS_TST_INFO *a, int loc);\nint TS_TST_INFO_add_ext(TS_TST_INFO *a, X509_EXTENSION *ex, int loc);\nvoid *TS_TST_INFO_get_ext_d2i(TS_TST_INFO *a, int nid, int *crit, int *idx);\n\n/*\n * Declarations related to response generation, defined in ts/ts_resp_sign.c.\n */\n\n/* Optional flags for response generation. */\n\n/* Don't include the TSA name in response. */\n# define TS_TSA_NAME             0x01\n\n/* Set ordering to true in response. */\n# define TS_ORDERING             0x02\n\n/*\n * Include the signer certificate and the other specified certificates in\n * the ESS signing certificate attribute beside the PKCS7 signed data.\n * Only the signer certificates is included by default.\n */\n# define TS_ESS_CERT_ID_CHAIN    0x04\n\n/* Forward declaration. */\nstruct TS_resp_ctx;\n\n/* This must return a unique number less than 160 bits long. */\ntypedef ASN1_INTEGER *(*TS_serial_cb) (struct TS_resp_ctx *, void *);\n\n/*\n * This must return the seconds and microseconds since Jan 1, 1970 in the sec\n * and usec variables allocated by the caller. Return non-zero for success\n * and zero for failure.\n */\ntypedef int (*TS_time_cb) (struct TS_resp_ctx *, void *, long *sec,\n                           long *usec);\n\n/*\n * This must process the given extension. It can modify the TS_TST_INFO\n * object of the context. Return values: !0 (processed), 0 (error, it must\n * set the status info/failure info of the response).\n */\ntypedef int (*TS_extension_cb) (struct TS_resp_ctx *, X509_EXTENSION *,\n                                void *);\n\ntypedef struct TS_resp_ctx {\n    X509 *signer_cert;\n    EVP_PKEY *signer_key;\n    STACK_OF(X509) *certs;      /* Certs to include in signed data. */\n    STACK_OF(ASN1_OBJECT) *policies; /* Acceptable policies. */\n    ASN1_OBJECT *default_policy; /* It may appear in policies, too. */\n    STACK_OF(EVP_MD) *mds;      /* Acceptable message digests. */\n    ASN1_INTEGER *seconds;      /* accuracy, 0 means not specified. */\n    ASN1_INTEGER *millis;       /* accuracy, 0 means not specified. */\n    ASN1_INTEGER *micros;       /* accuracy, 0 means not specified. */\n    unsigned clock_precision_digits; /* fraction of seconds in time stamp\n                                      * token. */\n    unsigned flags;             /* Optional info, see values above. */\n    /* Callback functions. */\n    TS_serial_cb serial_cb;\n    void *serial_cb_data;       /* User data for serial_cb. */\n    TS_time_cb time_cb;\n    void *time_cb_data;         /* User data for time_cb. */\n    TS_extension_cb extension_cb;\n    void *extension_cb_data;    /* User data for extension_cb. */\n    /* These members are used only while creating the response. */\n    TS_REQ *request;\n    TS_RESP *response;\n    TS_TST_INFO *tst_info;\n} TS_RESP_CTX;\n\nDECLARE_STACK_OF(EVP_MD)\nDECLARE_ASN1_SET_OF(EVP_MD)\n\n/* Creates a response context that can be used for generating responses. */\nTS_RESP_CTX *TS_RESP_CTX_new(void);\nvoid TS_RESP_CTX_free(TS_RESP_CTX *ctx);\n\n/* This parameter must be set. */\nint TS_RESP_CTX_set_signer_cert(TS_RESP_CTX *ctx, X509 *signer);\n\n/* This parameter must be set. */\nint TS_RESP_CTX_set_signer_key(TS_RESP_CTX *ctx, EVP_PKEY *key);\n\n/* This parameter must be set. */\nint TS_RESP_CTX_set_def_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *def_policy);\n\n/* No additional certs are included in the response by default. */\nint TS_RESP_CTX_set_certs(TS_RESP_CTX *ctx, STACK_OF(X509) *certs);\n\n/*\n * Adds a new acceptable policy, only the default policy is accepted by\n * default.\n */\nint TS_RESP_CTX_add_policy(TS_RESP_CTX *ctx, ASN1_OBJECT *policy);\n\n/*\n * Adds a new acceptable message digest. Note that no message digests are\n * accepted by default. The md argument is shared with the caller.\n */\nint TS_RESP_CTX_add_md(TS_RESP_CTX *ctx, const EVP_MD *md);\n\n/* Accuracy is not included by default. */\nint TS_RESP_CTX_set_accuracy(TS_RESP_CTX *ctx,\n                             int secs, int millis, int micros);\n\n/*\n * Clock precision digits, i.e. the number of decimal digits: '0' means sec,\n * '3' msec, '6' usec, and so on. Default is 0.\n */\nint TS_RESP_CTX_set_clock_precision_digits(TS_RESP_CTX *ctx,\n                                           unsigned clock_precision_digits);\n/* At most we accept usec precision. */\n# define TS_MAX_CLOCK_PRECISION_DIGITS   6\n\n/* Maximum status message length */\n# define TS_MAX_STATUS_LENGTH   (1024 * 1024)\n\n/* No flags are set by default. */\nvoid TS_RESP_CTX_add_flags(TS_RESP_CTX *ctx, int flags);\n\n/* Default callback always returns a constant. */\nvoid TS_RESP_CTX_set_serial_cb(TS_RESP_CTX *ctx, TS_serial_cb cb, void *data);\n\n/* Default callback uses the gettimeofday() and gmtime() system calls. */\nvoid TS_RESP_CTX_set_time_cb(TS_RESP_CTX *ctx, TS_time_cb cb, void *data);\n\n/*\n * Default callback rejects all extensions. The extension callback is called\n * when the TS_TST_INFO object is already set up and not signed yet.\n */\n/* FIXME: extension handling is not tested yet. */\nvoid TS_RESP_CTX_set_extension_cb(TS_RESP_CTX *ctx,\n                                  TS_extension_cb cb, void *data);\n\n/* The following methods can be used in the callbacks. */\nint TS_RESP_CTX_set_status_info(TS_RESP_CTX *ctx,\n                                int status, const char *text);\n\n/* Sets the status info only if it is still TS_STATUS_GRANTED. */\nint TS_RESP_CTX_set_status_info_cond(TS_RESP_CTX *ctx,\n                                     int status, const char *text);\n\nint TS_RESP_CTX_add_failure_info(TS_RESP_CTX *ctx, int failure);\n\n/* The get methods below can be used in the extension callback. */\nTS_REQ *TS_RESP_CTX_get_request(TS_RESP_CTX *ctx);\n\nTS_TST_INFO *TS_RESP_CTX_get_tst_info(TS_RESP_CTX *ctx);\n\n/*\n * Creates the signed TS_TST_INFO and puts it in TS_RESP.\n * In case of errors it sets the status info properly.\n * Returns NULL only in case of memory allocation/fatal error.\n */\nTS_RESP *TS_RESP_create_response(TS_RESP_CTX *ctx, BIO *req_bio);\n\n/*\n * Declarations related to response verification,\n * they are defined in ts/ts_resp_verify.c.\n */\n\nint TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs,\n                             X509_STORE *store, X509 **signer_out);\n\n/* Context structure for the generic verify method. */\n\n/* Verify the signer's certificate and the signature of the response. */\n# define TS_VFY_SIGNATURE        (1u << 0)\n/* Verify the version number of the response. */\n# define TS_VFY_VERSION          (1u << 1)\n/* Verify if the policy supplied by the user matches the policy of the TSA. */\n# define TS_VFY_POLICY           (1u << 2)\n/*\n * Verify the message imprint provided by the user. This flag should not be\n * specified with TS_VFY_DATA.\n */\n# define TS_VFY_IMPRINT          (1u << 3)\n/*\n * Verify the message imprint computed by the verify method from the user\n * provided data and the MD algorithm of the response. This flag should not\n * be specified with TS_VFY_IMPRINT.\n */\n# define TS_VFY_DATA             (1u << 4)\n/* Verify the nonce value. */\n# define TS_VFY_NONCE            (1u << 5)\n/* Verify if the TSA name field matches the signer certificate. */\n# define TS_VFY_SIGNER           (1u << 6)\n/* Verify if the TSA name field equals to the user provided name. */\n# define TS_VFY_TSA_NAME         (1u << 7)\n\n/* You can use the following convenience constants. */\n# define TS_VFY_ALL_IMPRINT      (TS_VFY_SIGNATURE       \\\n                                 | TS_VFY_VERSION       \\\n                                 | TS_VFY_POLICY        \\\n                                 | TS_VFY_IMPRINT       \\\n                                 | TS_VFY_NONCE         \\\n                                 | TS_VFY_SIGNER        \\\n                                 | TS_VFY_TSA_NAME)\n# define TS_VFY_ALL_DATA         (TS_VFY_SIGNATURE       \\\n                                 | TS_VFY_VERSION       \\\n                                 | TS_VFY_POLICY        \\\n                                 | TS_VFY_DATA          \\\n                                 | TS_VFY_NONCE         \\\n                                 | TS_VFY_SIGNER        \\\n                                 | TS_VFY_TSA_NAME)\n\ntypedef struct TS_verify_ctx {\n    /* Set this to the union of TS_VFY_... flags you want to carry out. */\n    unsigned flags;\n    /* Must be set only with TS_VFY_SIGNATURE. certs is optional. */\n    X509_STORE *store;\n    STACK_OF(X509) *certs;\n    /* Must be set only with TS_VFY_POLICY. */\n    ASN1_OBJECT *policy;\n    /*\n     * Must be set only with TS_VFY_IMPRINT. If md_alg is NULL, the\n     * algorithm from the response is used.\n     */\n    X509_ALGOR *md_alg;\n    unsigned char *imprint;\n    unsigned imprint_len;\n    /* Must be set only with TS_VFY_DATA. */\n    BIO *data;\n    /* Must be set only with TS_VFY_TSA_NAME. */\n    ASN1_INTEGER *nonce;\n    /* Must be set only with TS_VFY_TSA_NAME. */\n    GENERAL_NAME *tsa_name;\n} TS_VERIFY_CTX;\n\nint TS_RESP_verify_response(TS_VERIFY_CTX *ctx, TS_RESP *response);\nint TS_RESP_verify_token(TS_VERIFY_CTX *ctx, PKCS7 *token);\n\n/*\n * Declarations related to response verification context,\n * they are defined in ts/ts_verify_ctx.c.\n */\n\n/* Set all fields to zero. */\nTS_VERIFY_CTX *TS_VERIFY_CTX_new(void);\nvoid TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx);\nvoid TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx);\nvoid TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx);\n\n/*-\n * If ctx is NULL, it allocates and returns a new object, otherwise\n * it returns ctx. It initialises all the members as follows:\n * flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE)\n * certs = NULL\n * store = NULL\n * policy = policy from the request or NULL if absent (in this case\n *      TS_VFY_POLICY is cleared from flags as well)\n * md_alg = MD algorithm from request\n * imprint, imprint_len = imprint from request\n * data = NULL\n * nonce, nonce_len = nonce from the request or NULL if absent (in this case\n *      TS_VFY_NONCE is cleared from flags as well)\n * tsa_name = NULL\n * Important: after calling this method TS_VFY_SIGNATURE should be added!\n */\nTS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx);\n\n/* Function declarations for TS_RESP defined in ts/ts_resp_print.c */\n\nint TS_RESP_print_bio(BIO *bio, TS_RESP *a);\nint TS_STATUS_INFO_print_bio(BIO *bio, TS_STATUS_INFO *a);\nint TS_TST_INFO_print_bio(BIO *bio, TS_TST_INFO *a);\n\n/* Common utility functions defined in ts/ts_lib.c */\n\nint TS_ASN1_INTEGER_print_bio(BIO *bio, const ASN1_INTEGER *num);\nint TS_OBJ_print_bio(BIO *bio, const ASN1_OBJECT *obj);\nint TS_ext_print_bio(BIO *bio, const STACK_OF(X509_EXTENSION) *extensions);\nint TS_X509_ALGOR_print_bio(BIO *bio, const X509_ALGOR *alg);\nint TS_MSG_IMPRINT_print_bio(BIO *bio, TS_MSG_IMPRINT *msg);\n\n/*\n * Function declarations for handling configuration options, defined in\n * ts/ts_conf.c\n */\n\nX509 *TS_CONF_load_cert(const char *file);\nSTACK_OF(X509) *TS_CONF_load_certs(const char *file);\nEVP_PKEY *TS_CONF_load_key(const char *file, const char *pass);\nconst char *TS_CONF_get_tsa_section(CONF *conf, const char *section);\nint TS_CONF_set_serial(CONF *conf, const char *section, TS_serial_cb cb,\n                       TS_RESP_CTX *ctx);\nint TS_CONF_set_crypto_device(CONF *conf, const char *section,\n                              const char *device);\nint TS_CONF_set_default_engine(const char *name);\nint TS_CONF_set_signer_cert(CONF *conf, const char *section,\n                            const char *cert, TS_RESP_CTX *ctx);\nint TS_CONF_set_certs(CONF *conf, const char *section, const char *certs,\n                      TS_RESP_CTX *ctx);\nint TS_CONF_set_signer_key(CONF *conf, const char *section,\n                           const char *key, const char *pass,\n                           TS_RESP_CTX *ctx);\nint TS_CONF_set_def_policy(CONF *conf, const char *section,\n                           const char *policy, TS_RESP_CTX *ctx);\nint TS_CONF_set_policies(CONF *conf, const char *section, TS_RESP_CTX *ctx);\nint TS_CONF_set_digests(CONF *conf, const char *section, TS_RESP_CTX *ctx);\nint TS_CONF_set_accuracy(CONF *conf, const char *section, TS_RESP_CTX *ctx);\nint TS_CONF_set_clock_precision_digits(CONF *conf, const char *section,\n                                       TS_RESP_CTX *ctx);\nint TS_CONF_set_ordering(CONF *conf, const char *section, TS_RESP_CTX *ctx);\nint TS_CONF_set_tsa_name(CONF *conf, const char *section, TS_RESP_CTX *ctx);\nint TS_CONF_set_ess_cert_id_chain(CONF *conf, const char *section,\n                                  TS_RESP_CTX *ctx);\n\n/* -------------------------------------------------- */\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_TS_strings(void);\n\n/* Error codes for the TS functions. */\n\n/* Function codes. */\n# define TS_F_D2I_TS_RESP                                 147\n# define TS_F_DEF_SERIAL_CB                               110\n# define TS_F_DEF_TIME_CB                                 111\n# define TS_F_ESS_ADD_SIGNING_CERT                        112\n# define TS_F_ESS_CERT_ID_NEW_INIT                        113\n# define TS_F_ESS_SIGNING_CERT_NEW_INIT                   114\n# define TS_F_INT_TS_RESP_VERIFY_TOKEN                    149\n# define TS_F_PKCS7_TO_TS_TST_INFO                        148\n# define TS_F_TS_ACCURACY_SET_MICROS                      115\n# define TS_F_TS_ACCURACY_SET_MILLIS                      116\n# define TS_F_TS_ACCURACY_SET_SECONDS                     117\n# define TS_F_TS_CHECK_IMPRINTS                           100\n# define TS_F_TS_CHECK_NONCES                             101\n# define TS_F_TS_CHECK_POLICY                             102\n# define TS_F_TS_CHECK_SIGNING_CERTS                      103\n# define TS_F_TS_CHECK_STATUS_INFO                        104\n# define TS_F_TS_COMPUTE_IMPRINT                          145\n# define TS_F_TS_CONF_SET_DEFAULT_ENGINE                  146\n# define TS_F_TS_GET_STATUS_TEXT                          105\n# define TS_F_TS_MSG_IMPRINT_SET_ALGO                     118\n# define TS_F_TS_REQ_SET_MSG_IMPRINT                      119\n# define TS_F_TS_REQ_SET_NONCE                            120\n# define TS_F_TS_REQ_SET_POLICY_ID                        121\n# define TS_F_TS_RESP_CREATE_RESPONSE                     122\n# define TS_F_TS_RESP_CREATE_TST_INFO                     123\n# define TS_F_TS_RESP_CTX_ADD_FAILURE_INFO                124\n# define TS_F_TS_RESP_CTX_ADD_MD                          125\n# define TS_F_TS_RESP_CTX_ADD_POLICY                      126\n# define TS_F_TS_RESP_CTX_NEW                             127\n# define TS_F_TS_RESP_CTX_SET_ACCURACY                    128\n# define TS_F_TS_RESP_CTX_SET_CERTS                       129\n# define TS_F_TS_RESP_CTX_SET_DEF_POLICY                  130\n# define TS_F_TS_RESP_CTX_SET_SIGNER_CERT                 131\n# define TS_F_TS_RESP_CTX_SET_STATUS_INFO                 132\n# define TS_F_TS_RESP_GET_POLICY                          133\n# define TS_F_TS_RESP_SET_GENTIME_WITH_PRECISION          134\n# define TS_F_TS_RESP_SET_STATUS_INFO                     135\n# define TS_F_TS_RESP_SET_TST_INFO                        150\n# define TS_F_TS_RESP_SIGN                                136\n# define TS_F_TS_RESP_VERIFY_SIGNATURE                    106\n# define TS_F_TS_RESP_VERIFY_TOKEN                        107\n# define TS_F_TS_TST_INFO_SET_ACCURACY                    137\n# define TS_F_TS_TST_INFO_SET_MSG_IMPRINT                 138\n# define TS_F_TS_TST_INFO_SET_NONCE                       139\n# define TS_F_TS_TST_INFO_SET_POLICY_ID                   140\n# define TS_F_TS_TST_INFO_SET_SERIAL                      141\n# define TS_F_TS_TST_INFO_SET_TIME                        142\n# define TS_F_TS_TST_INFO_SET_TSA                         143\n# define TS_F_TS_VERIFY                                   108\n# define TS_F_TS_VERIFY_CERT                              109\n# define TS_F_TS_VERIFY_CTX_NEW                           144\n\n/* Reason codes. */\n# define TS_R_BAD_PKCS7_TYPE                              132\n# define TS_R_BAD_TYPE                                    133\n# define TS_R_CERTIFICATE_VERIFY_ERROR                    100\n# define TS_R_COULD_NOT_SET_ENGINE                        127\n# define TS_R_COULD_NOT_SET_TIME                          115\n# define TS_R_D2I_TS_RESP_INT_FAILED                      128\n# define TS_R_DETACHED_CONTENT                            134\n# define TS_R_ESS_ADD_SIGNING_CERT_ERROR                  116\n# define TS_R_ESS_SIGNING_CERTIFICATE_ERROR               101\n# define TS_R_INVALID_NULL_POINTER                        102\n# define TS_R_INVALID_SIGNER_CERTIFICATE_PURPOSE          117\n# define TS_R_MESSAGE_IMPRINT_MISMATCH                    103\n# define TS_R_NONCE_MISMATCH                              104\n# define TS_R_NONCE_NOT_RETURNED                          105\n# define TS_R_NO_CONTENT                                  106\n# define TS_R_NO_TIME_STAMP_TOKEN                         107\n# define TS_R_PKCS7_ADD_SIGNATURE_ERROR                   118\n# define TS_R_PKCS7_ADD_SIGNED_ATTR_ERROR                 119\n# define TS_R_PKCS7_TO_TS_TST_INFO_FAILED                 129\n# define TS_R_POLICY_MISMATCH                             108\n# define TS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE      120\n# define TS_R_RESPONSE_SETUP_ERROR                        121\n# define TS_R_SIGNATURE_FAILURE                           109\n# define TS_R_THERE_MUST_BE_ONE_SIGNER                    110\n# define TS_R_TIME_SYSCALL_ERROR                          122\n# define TS_R_TOKEN_NOT_PRESENT                           130\n# define TS_R_TOKEN_PRESENT                               131\n# define TS_R_TSA_NAME_MISMATCH                           111\n# define TS_R_TSA_UNTRUSTED                               112\n# define TS_R_TST_INFO_SETUP_ERROR                        123\n# define TS_R_TS_DATASIGN                                 124\n# define TS_R_UNACCEPTABLE_POLICY                         125\n# define TS_R_UNSUPPORTED_MD_ALGORITHM                    126\n# define TS_R_UNSUPPORTED_VERSION                         113\n# define TS_R_WRONG_CONTENT_TYPE                          114\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/txt_db.h",
    "content": "/* crypto/txt_db/txt_db.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_TXT_DB_H\n# define HEADER_TXT_DB_H\n\n# include <openssl/opensslconf.h>\n# ifndef OPENSSL_NO_BIO\n#  include <openssl/bio.h>\n# endif\n# include <openssl/stack.h>\n# include <openssl/lhash.h>\n\n# define DB_ERROR_OK                     0\n# define DB_ERROR_MALLOC                 1\n# define DB_ERROR_INDEX_CLASH            2\n# define DB_ERROR_INDEX_OUT_OF_RANGE     3\n# define DB_ERROR_NO_INDEX               4\n# define DB_ERROR_INSERT_INDEX_CLASH     5\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\ntypedef OPENSSL_STRING *OPENSSL_PSTRING;\nDECLARE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING)\n\ntypedef struct txt_db_st {\n    int num_fields;\n    STACK_OF(OPENSSL_PSTRING) *data;\n    LHASH_OF(OPENSSL_STRING) **index;\n    int (**qual) (OPENSSL_STRING *);\n    long error;\n    long arg1;\n    long arg2;\n    OPENSSL_STRING *arg_row;\n} TXT_DB;\n\n# ifndef OPENSSL_NO_BIO\nTXT_DB *TXT_DB_read(BIO *in, int num);\nlong TXT_DB_write(BIO *out, TXT_DB *db);\n# else\nTXT_DB *TXT_DB_read(char *in, int num);\nlong TXT_DB_write(char *out, TXT_DB *db);\n# endif\nint TXT_DB_create_index(TXT_DB *db, int field, int (*qual) (OPENSSL_STRING *),\n                        LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp);\nvoid TXT_DB_free(TXT_DB *db);\nOPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx,\n                                    OPENSSL_STRING *value);\nint TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value);\n\n#ifdef  __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/ui.h",
    "content": "/* crypto/ui/ui.h */\n/*\n * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project\n * 2001.\n */\n/* ====================================================================\n * Copyright (c) 2001 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_UI_H\n# define HEADER_UI_H\n\n# ifndef OPENSSL_NO_DEPRECATED\n#  include <openssl/crypto.h>\n# endif\n# include <openssl/safestack.h>\n# include <openssl/ossl_typ.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/* Declared already in ossl_typ.h */\n/* typedef struct ui_st UI; */\n/* typedef struct ui_method_st UI_METHOD; */\n\n/*\n * All the following functions return -1 or NULL on error and in some cases\n * (UI_process()) -2 if interrupted or in some other way cancelled. When\n * everything is fine, they return 0, a positive value or a non-NULL pointer,\n * all depending on their purpose.\n */\n\n/* Creators and destructor.   */\nUI *UI_new(void);\nUI *UI_new_method(const UI_METHOD *method);\nvoid UI_free(UI *ui);\n\n/*-\n   The following functions are used to add strings to be printed and prompt\n   strings to prompt for data.  The names are UI_{add,dup}_<function>_string\n   and UI_{add,dup}_input_boolean.\n\n   UI_{add,dup}_<function>_string have the following meanings:\n        add     add a text or prompt string.  The pointers given to these\n                functions are used verbatim, no copying is done.\n        dup     make a copy of the text or prompt string, then add the copy\n                to the collection of strings in the user interface.\n        <function>\n                The function is a name for the functionality that the given\n                string shall be used for.  It can be one of:\n                        input   use the string as data prompt.\n                        verify  use the string as verification prompt.  This\n                                is used to verify a previous input.\n                        info    use the string for informational output.\n                        error   use the string for error output.\n   Honestly, there's currently no difference between info and error for the\n   moment.\n\n   UI_{add,dup}_input_boolean have the same semantics for \"add\" and \"dup\",\n   and are typically used when one wants to prompt for a yes/no response.\n\n   All of the functions in this group take a UI and a prompt string.\n   The string input and verify addition functions also take a flag argument,\n   a buffer for the result to end up with, a minimum input size and a maximum\n   input size (the result buffer MUST be large enough to be able to contain\n   the maximum number of characters).  Additionally, the verify addition\n   functions takes another buffer to compare the result against.\n   The boolean input functions take an action description string (which should\n   be safe to ignore if the expected user action is obvious, for example with\n   a dialog box with an OK button and a Cancel button), a string of acceptable\n   characters to mean OK and to mean Cancel.  The two last strings are checked\n   to make sure they don't have common characters.  Additionally, the same\n   flag argument as for the string input is taken, as well as a result buffer.\n   The result buffer is required to be at least one byte long.  Depending on\n   the answer, the first character from the OK or the Cancel character strings\n   will be stored in the first byte of the result buffer.  No NUL will be\n   added, so the result is *not* a string.\n\n   On success, the all return an index of the added information.  That index\n   is usefull when retrieving results with UI_get0_result(). */\nint UI_add_input_string(UI *ui, const char *prompt, int flags,\n                        char *result_buf, int minsize, int maxsize);\nint UI_dup_input_string(UI *ui, const char *prompt, int flags,\n                        char *result_buf, int minsize, int maxsize);\nint UI_add_verify_string(UI *ui, const char *prompt, int flags,\n                         char *result_buf, int minsize, int maxsize,\n                         const char *test_buf);\nint UI_dup_verify_string(UI *ui, const char *prompt, int flags,\n                         char *result_buf, int minsize, int maxsize,\n                         const char *test_buf);\nint UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc,\n                         const char *ok_chars, const char *cancel_chars,\n                         int flags, char *result_buf);\nint UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc,\n                         const char *ok_chars, const char *cancel_chars,\n                         int flags, char *result_buf);\nint UI_add_info_string(UI *ui, const char *text);\nint UI_dup_info_string(UI *ui, const char *text);\nint UI_add_error_string(UI *ui, const char *text);\nint UI_dup_error_string(UI *ui, const char *text);\n\n/* These are the possible flags.  They can be or'ed together. */\n/* Use to have echoing of input */\n# define UI_INPUT_FLAG_ECHO              0x01\n/*\n * Use a default password.  Where that password is found is completely up to\n * the application, it might for example be in the user data set with\n * UI_add_user_data().  It is not recommended to have more than one input in\n * each UI being marked with this flag, or the application might get\n * confused.\n */\n# define UI_INPUT_FLAG_DEFAULT_PWD       0x02\n\n/*-\n * The user of these routines may want to define flags of their own.  The core\n * UI won't look at those, but will pass them on to the method routines.  They\n * must use higher bits so they don't get confused with the UI bits above.\n * UI_INPUT_FLAG_USER_BASE tells which is the lowest bit to use.  A good\n * example of use is this:\n *\n *    #define MY_UI_FLAG1       (0x01 << UI_INPUT_FLAG_USER_BASE)\n *\n*/\n# define UI_INPUT_FLAG_USER_BASE 16\n\n/*-\n * The following function helps construct a prompt.  object_desc is a\n * textual short description of the object, for example \"pass phrase\",\n * and object_name is the name of the object (might be a card name or\n * a file name.\n * The returned string shall always be allocated on the heap with\n * OPENSSL_malloc(), and need to be free'd with OPENSSL_free().\n *\n * If the ui_method doesn't contain a pointer to a user-defined prompt\n * constructor, a default string is built, looking like this:\n *\n *       \"Enter {object_desc} for {object_name}:\"\n *\n * So, if object_desc has the value \"pass phrase\" and object_name has\n * the value \"foo.key\", the resulting string is:\n *\n *       \"Enter pass phrase for foo.key:\"\n*/\nchar *UI_construct_prompt(UI *ui_method,\n                          const char *object_desc, const char *object_name);\n\n/*\n * The following function is used to store a pointer to user-specific data.\n * Any previous such pointer will be returned and replaced.\n *\n * For callback purposes, this function makes a lot more sense than using\n * ex_data, since the latter requires that different parts of OpenSSL or\n * applications share the same ex_data index.\n *\n * Note that the UI_OpenSSL() method completely ignores the user data. Other\n * methods may not, however.\n */\nvoid *UI_add_user_data(UI *ui, void *user_data);\n/* We need a user data retrieving function as well.  */\nvoid *UI_get0_user_data(UI *ui);\n\n/* Return the result associated with a prompt given with the index i. */\nconst char *UI_get0_result(UI *ui, int i);\n\n/* When all strings have been added, process the whole thing. */\nint UI_process(UI *ui);\n\n/*\n * Give a user interface parametrised control commands.  This can be used to\n * send down an integer, a data pointer or a function pointer, as well as be\n * used to get information from a UI.\n */\nint UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f) (void));\n\n/* The commands */\n/*\n * Use UI_CONTROL_PRINT_ERRORS with the value 1 to have UI_process print the\n * OpenSSL error stack before printing any info or added error messages and\n * before any prompting.\n */\n# define UI_CTRL_PRINT_ERRORS            1\n/*\n * Check if a UI_process() is possible to do again with the same instance of\n * a user interface.  This makes UI_ctrl() return 1 if it is redoable, and 0\n * if not.\n */\n# define UI_CTRL_IS_REDOABLE             2\n\n/* Some methods may use extra data */\n# define UI_set_app_data(s,arg)         UI_set_ex_data(s,0,arg)\n# define UI_get_app_data(s)             UI_get_ex_data(s,0)\nint UI_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,\n                        CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);\nint UI_set_ex_data(UI *r, int idx, void *arg);\nvoid *UI_get_ex_data(UI *r, int idx);\n\n/* Use specific methods instead of the built-in one */\nvoid UI_set_default_method(const UI_METHOD *meth);\nconst UI_METHOD *UI_get_default_method(void);\nconst UI_METHOD *UI_get_method(UI *ui);\nconst UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth);\n\n/* The method with all the built-in thingies */\nUI_METHOD *UI_OpenSSL(void);\n\n/* ---------- For method writers ---------- */\n/*-\n   A method contains a number of functions that implement the low level\n   of the User Interface.  The functions are:\n\n        an opener       This function starts a session, maybe by opening\n                        a channel to a tty, or by opening a window.\n        a writer        This function is called to write a given string,\n                        maybe to the tty, maybe as a field label in a\n                        window.\n        a flusher       This function is called to flush everything that\n                        has been output so far.  It can be used to actually\n                        display a dialog box after it has been built.\n        a reader        This function is called to read a given prompt,\n                        maybe from the tty, maybe from a field in a\n                        window.  Note that it's called wth all string\n                        structures, not only the prompt ones, so it must\n                        check such things itself.\n        a closer        This function closes the session, maybe by closing\n                        the channel to the tty, or closing the window.\n\n   All these functions are expected to return:\n\n        0       on error.\n        1       on success.\n        -1      on out-of-band events, for example if some prompting has\n                been canceled (by pressing Ctrl-C, for example).  This is\n                only checked when returned by the flusher or the reader.\n\n   The way this is used, the opener is first called, then the writer for all\n   strings, then the flusher, then the reader for all strings and finally the\n   closer.  Note that if you want to prompt from a terminal or other command\n   line interface, the best is to have the reader also write the prompts\n   instead of having the writer do it.  If you want to prompt from a dialog\n   box, the writer can be used to build up the contents of the box, and the\n   flusher to actually display the box and run the event loop until all data\n   has been given, after which the reader only grabs the given data and puts\n   them back into the UI strings.\n\n   All method functions take a UI as argument.  Additionally, the writer and\n   the reader take a UI_STRING.\n*/\n\n/*\n * The UI_STRING type is the data structure that contains all the needed info\n * about a string or a prompt, including test data for a verification prompt.\n */\ntypedef struct ui_string_st UI_STRING;\nDECLARE_STACK_OF(UI_STRING)\n\n/*\n * The different types of strings that are currently supported. This is only\n * needed by method authors.\n */\nenum UI_string_types {\n    UIT_NONE = 0,\n    UIT_PROMPT,                 /* Prompt for a string */\n    UIT_VERIFY,                 /* Prompt for a string and verify */\n    UIT_BOOLEAN,                /* Prompt for a yes/no response */\n    UIT_INFO,                   /* Send info to the user */\n    UIT_ERROR                   /* Send an error message to the user */\n};\n\n/* Create and manipulate methods */\nUI_METHOD *UI_create_method(char *name);\nvoid UI_destroy_method(UI_METHOD *ui_method);\nint UI_method_set_opener(UI_METHOD *method, int (*opener) (UI *ui));\nint UI_method_set_writer(UI_METHOD *method,\n                         int (*writer) (UI *ui, UI_STRING *uis));\nint UI_method_set_flusher(UI_METHOD *method, int (*flusher) (UI *ui));\nint UI_method_set_reader(UI_METHOD *method,\n                         int (*reader) (UI *ui, UI_STRING *uis));\nint UI_method_set_closer(UI_METHOD *method, int (*closer) (UI *ui));\nint UI_method_set_prompt_constructor(UI_METHOD *method,\n                                     char *(*prompt_constructor) (UI *ui,\n                                                                  const char\n                                                                  *object_desc,\n                                                                  const char\n                                                                  *object_name));\nint (*UI_method_get_opener(UI_METHOD *method)) (UI *);\nint (*UI_method_get_writer(UI_METHOD *method)) (UI *, UI_STRING *);\nint (*UI_method_get_flusher(UI_METHOD *method)) (UI *);\nint (*UI_method_get_reader(UI_METHOD *method)) (UI *, UI_STRING *);\nint (*UI_method_get_closer(UI_METHOD *method)) (UI *);\nchar *(*UI_method_get_prompt_constructor(UI_METHOD *method)) (UI *,\n                                                              const char *,\n                                                              const char *);\n\n/*\n * The following functions are helpers for method writers to access relevant\n * data from a UI_STRING.\n */\n\n/* Return type of the UI_STRING */\nenum UI_string_types UI_get_string_type(UI_STRING *uis);\n/* Return input flags of the UI_STRING */\nint UI_get_input_flags(UI_STRING *uis);\n/* Return the actual string to output (the prompt, info or error) */\nconst char *UI_get0_output_string(UI_STRING *uis);\n/*\n * Return the optional action string to output (the boolean promtp\n * instruction)\n */\nconst char *UI_get0_action_string(UI_STRING *uis);\n/* Return the result of a prompt */\nconst char *UI_get0_result_string(UI_STRING *uis);\n/*\n * Return the string to test the result against.  Only useful with verifies.\n */\nconst char *UI_get0_test_string(UI_STRING *uis);\n/* Return the required minimum size of the result */\nint UI_get_result_minsize(UI_STRING *uis);\n/* Return the required maximum size of the result */\nint UI_get_result_maxsize(UI_STRING *uis);\n/* Set the result of a UI_STRING. */\nint UI_set_result(UI *ui, UI_STRING *uis, const char *result);\n\n/* A couple of popular utility functions */\nint UI_UTIL_read_pw_string(char *buf, int length, const char *prompt,\n                           int verify);\nint UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt,\n                    int verify);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_UI_strings(void);\n\n/* Error codes for the UI functions. */\n\n/* Function codes. */\n# define UI_F_GENERAL_ALLOCATE_BOOLEAN                    108\n# define UI_F_GENERAL_ALLOCATE_PROMPT                     109\n# define UI_F_GENERAL_ALLOCATE_STRING                     100\n# define UI_F_UI_CTRL                                     111\n# define UI_F_UI_DUP_ERROR_STRING                         101\n# define UI_F_UI_DUP_INFO_STRING                          102\n# define UI_F_UI_DUP_INPUT_BOOLEAN                        110\n# define UI_F_UI_DUP_INPUT_STRING                         103\n# define UI_F_UI_DUP_VERIFY_STRING                        106\n# define UI_F_UI_GET0_RESULT                              107\n# define UI_F_UI_NEW_METHOD                               104\n# define UI_F_UI_SET_RESULT                               105\n\n/* Reason codes. */\n# define UI_R_COMMON_OK_AND_CANCEL_CHARACTERS             104\n# define UI_R_INDEX_TOO_LARGE                             102\n# define UI_R_INDEX_TOO_SMALL                             103\n# define UI_R_NO_RESULT_BUFFER                            105\n# define UI_R_RESULT_TOO_LARGE                            100\n# define UI_R_RESULT_TOO_SMALL                            101\n# define UI_R_UNKNOWN_CONTROL_COMMAND                     106\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/ui_compat.h",
    "content": "/* crypto/ui/ui.h */\n/*\n * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project\n * 2001.\n */\n/* ====================================================================\n * Copyright (c) 2001 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n\n#ifndef HEADER_UI_COMPAT_H\n# define HEADER_UI_COMPAT_H\n\n# include <openssl/opensslconf.h>\n# include <openssl/ui.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n/*\n * The following functions were previously part of the DES section, and are\n * provided here for backward compatibility reasons.\n */\n\n# define des_read_pw_string(b,l,p,v) \\\n        _ossl_old_des_read_pw_string((b),(l),(p),(v))\n# define des_read_pw(b,bf,s,p,v) \\\n        _ossl_old_des_read_pw((b),(bf),(s),(p),(v))\n\nint _ossl_old_des_read_pw_string(char *buf, int length, const char *prompt,\n                                 int verify);\nint _ossl_old_des_read_pw(char *buf, char *buff, int size, const char *prompt,\n                          int verify);\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/whrlpool.h",
    "content": "#ifndef HEADER_WHRLPOOL_H\n# define HEADER_WHRLPOOL_H\n\n# include <openssl/e_os2.h>\n# include <stddef.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n# define WHIRLPOOL_DIGEST_LENGTH (512/8)\n# define WHIRLPOOL_BBLOCK        512\n# define WHIRLPOOL_COUNTER       (256/8)\n\ntypedef struct {\n    union {\n        unsigned char c[WHIRLPOOL_DIGEST_LENGTH];\n        /* double q is here to ensure 64-bit alignment */\n        double q[WHIRLPOOL_DIGEST_LENGTH / sizeof(double)];\n    } H;\n    unsigned char data[WHIRLPOOL_BBLOCK / 8];\n    unsigned int bitoff;\n    size_t bitlen[WHIRLPOOL_COUNTER / sizeof(size_t)];\n} WHIRLPOOL_CTX;\n\n# ifndef OPENSSL_NO_WHIRLPOOL\n#  ifdef OPENSSL_FIPS\nint private_WHIRLPOOL_Init(WHIRLPOOL_CTX *c);\n#  endif\nint WHIRLPOOL_Init(WHIRLPOOL_CTX *c);\nint WHIRLPOOL_Update(WHIRLPOOL_CTX *c, const void *inp, size_t bytes);\nvoid WHIRLPOOL_BitUpdate(WHIRLPOOL_CTX *c, const void *inp, size_t bits);\nint WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c);\nunsigned char *WHIRLPOOL(const void *inp, size_t bytes, unsigned char *md);\n# endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/x509.h",
    "content": "/* crypto/x509/x509.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n/* ====================================================================\n * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.\n * ECDH support in OpenSSL originally developed by\n * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.\n */\n\n#ifndef HEADER_X509_H\n# define HEADER_X509_H\n\n# include <openssl/e_os2.h>\n# include <openssl/symhacks.h>\n# ifndef OPENSSL_NO_BUFFER\n#  include <openssl/buffer.h>\n# endif\n# ifndef OPENSSL_NO_EVP\n#  include <openssl/evp.h>\n# endif\n# ifndef OPENSSL_NO_BIO\n#  include <openssl/bio.h>\n# endif\n# include <openssl/stack.h>\n# include <openssl/asn1.h>\n# include <openssl/safestack.h>\n\n# ifndef OPENSSL_NO_EC\n#  include <openssl/ec.h>\n# endif\n\n# ifndef OPENSSL_NO_ECDSA\n#  include <openssl/ecdsa.h>\n# endif\n\n# ifndef OPENSSL_NO_ECDH\n#  include <openssl/ecdh.h>\n# endif\n\n# ifndef OPENSSL_NO_DEPRECATED\n#  ifndef OPENSSL_NO_RSA\n#   include <openssl/rsa.h>\n#  endif\n#  ifndef OPENSSL_NO_DSA\n#   include <openssl/dsa.h>\n#  endif\n#  ifndef OPENSSL_NO_DH\n#   include <openssl/dh.h>\n#  endif\n# endif\n\n# ifndef OPENSSL_NO_SHA\n#  include <openssl/sha.h>\n# endif\n# include <openssl/ossl_typ.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# ifdef OPENSSL_SYS_WIN32\n/* Under Win32 these are defined in wincrypt.h */\n#  undef X509_NAME\n#  undef X509_CERT_PAIR\n#  undef X509_EXTENSIONS\n# endif\n\n# define X509_FILETYPE_PEM       1\n# define X509_FILETYPE_ASN1      2\n# define X509_FILETYPE_DEFAULT   3\n\n# define X509v3_KU_DIGITAL_SIGNATURE     0x0080\n# define X509v3_KU_NON_REPUDIATION       0x0040\n# define X509v3_KU_KEY_ENCIPHERMENT      0x0020\n# define X509v3_KU_DATA_ENCIPHERMENT     0x0010\n# define X509v3_KU_KEY_AGREEMENT         0x0008\n# define X509v3_KU_KEY_CERT_SIGN         0x0004\n# define X509v3_KU_CRL_SIGN              0x0002\n# define X509v3_KU_ENCIPHER_ONLY         0x0001\n# define X509v3_KU_DECIPHER_ONLY         0x8000\n# define X509v3_KU_UNDEF                 0xffff\n\ntypedef struct X509_objects_st {\n    int nid;\n    int (*a2i) (void);\n    int (*i2a) (void);\n} X509_OBJECTS;\n\nstruct X509_algor_st {\n    ASN1_OBJECT *algorithm;\n    ASN1_TYPE *parameter;\n} /* X509_ALGOR */ ;\n\nDECLARE_ASN1_SET_OF(X509_ALGOR)\n\ntypedef STACK_OF(X509_ALGOR) X509_ALGORS;\n\ntypedef struct X509_val_st {\n    ASN1_TIME *notBefore;\n    ASN1_TIME *notAfter;\n} X509_VAL;\n\nstruct X509_pubkey_st {\n    X509_ALGOR *algor;\n    ASN1_BIT_STRING *public_key;\n    EVP_PKEY *pkey;\n};\n\ntypedef struct X509_sig_st {\n    X509_ALGOR *algor;\n    ASN1_OCTET_STRING *digest;\n} X509_SIG;\n\ntypedef struct X509_name_entry_st {\n    ASN1_OBJECT *object;\n    ASN1_STRING *value;\n    int set;\n    int size;                   /* temp variable */\n} X509_NAME_ENTRY;\n\nDECLARE_STACK_OF(X509_NAME_ENTRY)\nDECLARE_ASN1_SET_OF(X509_NAME_ENTRY)\n\n/* we always keep X509_NAMEs in 2 forms. */\nstruct X509_name_st {\n    STACK_OF(X509_NAME_ENTRY) *entries;\n    int modified;               /* true if 'bytes' needs to be built */\n# ifndef OPENSSL_NO_BUFFER\n    BUF_MEM *bytes;\n# else\n    char *bytes;\n# endif\n/*      unsigned long hash; Keep the hash around for lookups */\n    unsigned char *canon_enc;\n    int canon_enclen;\n} /* X509_NAME */ ;\n\nDECLARE_STACK_OF(X509_NAME)\n\n# define X509_EX_V_NETSCAPE_HACK         0x8000\n# define X509_EX_V_INIT                  0x0001\ntypedef struct X509_extension_st {\n    ASN1_OBJECT *object;\n    ASN1_BOOLEAN critical;\n    ASN1_OCTET_STRING *value;\n} X509_EXTENSION;\n\ntypedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS;\n\nDECLARE_STACK_OF(X509_EXTENSION)\nDECLARE_ASN1_SET_OF(X509_EXTENSION)\n\n/* a sequence of these are used */\ntypedef struct x509_attributes_st {\n    ASN1_OBJECT *object;\n    int single;                 /* 0 for a set, 1 for a single item (which is\n                                 * wrong) */\n    union {\n        char *ptr;\n        /*\n         * 0\n         */ STACK_OF(ASN1_TYPE) *set;\n        /*\n         * 1\n         */ ASN1_TYPE *single;\n    } value;\n} X509_ATTRIBUTE;\n\nDECLARE_STACK_OF(X509_ATTRIBUTE)\nDECLARE_ASN1_SET_OF(X509_ATTRIBUTE)\n\ntypedef struct X509_req_info_st {\n    ASN1_ENCODING enc;\n    ASN1_INTEGER *version;\n    X509_NAME *subject;\n    X509_PUBKEY *pubkey;\n    /*  d=2 hl=2 l=  0 cons: cont: 00 */\n    STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */\n} X509_REQ_INFO;\n\ntypedef struct X509_req_st {\n    X509_REQ_INFO *req_info;\n    X509_ALGOR *sig_alg;\n    ASN1_BIT_STRING *signature;\n    int references;\n} X509_REQ;\n\ntypedef struct x509_cinf_st {\n    ASN1_INTEGER *version;      /* [ 0 ] default of v1 */\n    ASN1_INTEGER *serialNumber;\n    X509_ALGOR *signature;\n    X509_NAME *issuer;\n    X509_VAL *validity;\n    X509_NAME *subject;\n    X509_PUBKEY *key;\n    ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */\n    ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */\n    STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */\n    ASN1_ENCODING enc;\n} X509_CINF;\n\n/*\n * This stuff is certificate \"auxiliary info\" it contains details which are\n * useful in certificate stores and databases. When used this is tagged onto\n * the end of the certificate itself\n */\n\ntypedef struct x509_cert_aux_st {\n    STACK_OF(ASN1_OBJECT) *trust; /* trusted uses */\n    STACK_OF(ASN1_OBJECT) *reject; /* rejected uses */\n    ASN1_UTF8STRING *alias;     /* \"friendly name\" */\n    ASN1_OCTET_STRING *keyid;   /* key id of private key */\n    STACK_OF(X509_ALGOR) *other; /* other unspecified info */\n} X509_CERT_AUX;\n\nstruct x509_st {\n    X509_CINF *cert_info;\n    X509_ALGOR *sig_alg;\n    ASN1_BIT_STRING *signature;\n    int valid;\n    int references;\n    char *name;\n    CRYPTO_EX_DATA ex_data;\n    /* These contain copies of various extension values */\n    long ex_pathlen;\n    long ex_pcpathlen;\n    unsigned long ex_flags;\n    unsigned long ex_kusage;\n    unsigned long ex_xkusage;\n    unsigned long ex_nscert;\n    ASN1_OCTET_STRING *skid;\n    AUTHORITY_KEYID *akid;\n    X509_POLICY_CACHE *policy_cache;\n    STACK_OF(DIST_POINT) *crldp;\n    STACK_OF(GENERAL_NAME) *altname;\n    NAME_CONSTRAINTS *nc;\n# ifndef OPENSSL_NO_RFC3779\n    STACK_OF(IPAddressFamily) *rfc3779_addr;\n    struct ASIdentifiers_st *rfc3779_asid;\n# endif\n# ifndef OPENSSL_NO_SHA\n    unsigned char sha1_hash[SHA_DIGEST_LENGTH];\n# endif\n    X509_CERT_AUX *aux;\n} /* X509 */ ;\n\nDECLARE_STACK_OF(X509)\nDECLARE_ASN1_SET_OF(X509)\n\n/* This is used for a table of trust checking functions */\n\ntypedef struct x509_trust_st {\n    int trust;\n    int flags;\n    int (*check_trust) (struct x509_trust_st *, X509 *, int);\n    char *name;\n    int arg1;\n    void *arg2;\n} X509_TRUST;\n\nDECLARE_STACK_OF(X509_TRUST)\n\ntypedef struct x509_cert_pair_st {\n    X509 *forward;\n    X509 *reverse;\n} X509_CERT_PAIR;\n\n/* standard trust ids */\n\n# define X509_TRUST_DEFAULT      -1/* Only valid in purpose settings */\n\n# define X509_TRUST_COMPAT       1\n# define X509_TRUST_SSL_CLIENT   2\n# define X509_TRUST_SSL_SERVER   3\n# define X509_TRUST_EMAIL        4\n# define X509_TRUST_OBJECT_SIGN  5\n# define X509_TRUST_OCSP_SIGN    6\n# define X509_TRUST_OCSP_REQUEST 7\n# define X509_TRUST_TSA          8\n\n/* Keep these up to date! */\n# define X509_TRUST_MIN          1\n# define X509_TRUST_MAX          8\n\n/* trust_flags values */\n# define X509_TRUST_DYNAMIC      1\n# define X509_TRUST_DYNAMIC_NAME 2\n\n/* check_trust return codes */\n\n# define X509_TRUST_TRUSTED      1\n# define X509_TRUST_REJECTED     2\n# define X509_TRUST_UNTRUSTED    3\n\n/* Flags for X509_print_ex() */\n\n# define X509_FLAG_COMPAT                0\n# define X509_FLAG_NO_HEADER             1L\n# define X509_FLAG_NO_VERSION            (1L << 1)\n# define X509_FLAG_NO_SERIAL             (1L << 2)\n# define X509_FLAG_NO_SIGNAME            (1L << 3)\n# define X509_FLAG_NO_ISSUER             (1L << 4)\n# define X509_FLAG_NO_VALIDITY           (1L << 5)\n# define X509_FLAG_NO_SUBJECT            (1L << 6)\n# define X509_FLAG_NO_PUBKEY             (1L << 7)\n# define X509_FLAG_NO_EXTENSIONS         (1L << 8)\n# define X509_FLAG_NO_SIGDUMP            (1L << 9)\n# define X509_FLAG_NO_AUX                (1L << 10)\n# define X509_FLAG_NO_ATTRIBUTES         (1L << 11)\n# define X509_FLAG_NO_IDS                (1L << 12)\n\n/* Flags specific to X509_NAME_print_ex() */\n\n/* The field separator information */\n\n# define XN_FLAG_SEP_MASK        (0xf << 16)\n\n# define XN_FLAG_COMPAT          0/* Traditional SSLeay: use old\n                                   * X509_NAME_print */\n# define XN_FLAG_SEP_COMMA_PLUS  (1 << 16)/* RFC2253 ,+ */\n# define XN_FLAG_SEP_CPLUS_SPC   (2 << 16)/* ,+ spaced: more readable */\n# define XN_FLAG_SEP_SPLUS_SPC   (3 << 16)/* ;+ spaced */\n# define XN_FLAG_SEP_MULTILINE   (4 << 16)/* One line per field */\n\n# define XN_FLAG_DN_REV          (1 << 20)/* Reverse DN order */\n\n/* How the field name is shown */\n\n# define XN_FLAG_FN_MASK         (0x3 << 21)\n\n# define XN_FLAG_FN_SN           0/* Object short name */\n# define XN_FLAG_FN_LN           (1 << 21)/* Object long name */\n# define XN_FLAG_FN_OID          (2 << 21)/* Always use OIDs */\n# define XN_FLAG_FN_NONE         (3 << 21)/* No field names */\n\n# define XN_FLAG_SPC_EQ          (1 << 23)/* Put spaces round '=' */\n\n/*\n * This determines if we dump fields we don't recognise: RFC2253 requires\n * this.\n */\n\n# define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24)\n\n# define XN_FLAG_FN_ALIGN        (1 << 25)/* Align field names to 20\n                                           * characters */\n\n/* Complete set of RFC2253 flags */\n\n# define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \\\n                        XN_FLAG_SEP_COMMA_PLUS | \\\n                        XN_FLAG_DN_REV | \\\n                        XN_FLAG_FN_SN | \\\n                        XN_FLAG_DUMP_UNKNOWN_FIELDS)\n\n/* readable oneline form */\n\n# define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \\\n                        ASN1_STRFLGS_ESC_QUOTE | \\\n                        XN_FLAG_SEP_CPLUS_SPC | \\\n                        XN_FLAG_SPC_EQ | \\\n                        XN_FLAG_FN_SN)\n\n/* readable multiline form */\n\n# define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \\\n                        ASN1_STRFLGS_ESC_MSB | \\\n                        XN_FLAG_SEP_MULTILINE | \\\n                        XN_FLAG_SPC_EQ | \\\n                        XN_FLAG_FN_LN | \\\n                        XN_FLAG_FN_ALIGN)\n\nstruct x509_revoked_st {\n    ASN1_INTEGER *serialNumber;\n    ASN1_TIME *revocationDate;\n    STACK_OF(X509_EXTENSION) /* optional */ *extensions;\n    /* Set up if indirect CRL */\n    STACK_OF(GENERAL_NAME) *issuer;\n    /* Revocation reason */\n    int reason;\n    int sequence;               /* load sequence */\n};\n\nDECLARE_STACK_OF(X509_REVOKED)\nDECLARE_ASN1_SET_OF(X509_REVOKED)\n\ntypedef struct X509_crl_info_st {\n    ASN1_INTEGER *version;\n    X509_ALGOR *sig_alg;\n    X509_NAME *issuer;\n    ASN1_TIME *lastUpdate;\n    ASN1_TIME *nextUpdate;\n    STACK_OF(X509_REVOKED) *revoked;\n    STACK_OF(X509_EXTENSION) /* [0] */ *extensions;\n    ASN1_ENCODING enc;\n} X509_CRL_INFO;\n\nstruct X509_crl_st {\n    /* actual signature */\n    X509_CRL_INFO *crl;\n    X509_ALGOR *sig_alg;\n    ASN1_BIT_STRING *signature;\n    int references;\n    int flags;\n    /* Copies of various extensions */\n    AUTHORITY_KEYID *akid;\n    ISSUING_DIST_POINT *idp;\n    /* Convenient breakdown of IDP */\n    int idp_flags;\n    int idp_reasons;\n    /* CRL and base CRL numbers for delta processing */\n    ASN1_INTEGER *crl_number;\n    ASN1_INTEGER *base_crl_number;\n# ifndef OPENSSL_NO_SHA\n    unsigned char sha1_hash[SHA_DIGEST_LENGTH];\n# endif\n    STACK_OF(GENERAL_NAMES) *issuers;\n    const X509_CRL_METHOD *meth;\n    void *meth_data;\n} /* X509_CRL */ ;\n\nDECLARE_STACK_OF(X509_CRL)\nDECLARE_ASN1_SET_OF(X509_CRL)\n\ntypedef struct private_key_st {\n    int version;\n    /* The PKCS#8 data types */\n    X509_ALGOR *enc_algor;\n    ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */\n    /* When decrypted, the following will not be NULL */\n    EVP_PKEY *dec_pkey;\n    /* used to encrypt and decrypt */\n    int key_length;\n    char *key_data;\n    int key_free;               /* true if we should auto free key_data */\n    /* expanded version of 'enc_algor' */\n    EVP_CIPHER_INFO cipher;\n    int references;\n} X509_PKEY;\n\n# ifndef OPENSSL_NO_EVP\ntypedef struct X509_info_st {\n    X509 *x509;\n    X509_CRL *crl;\n    X509_PKEY *x_pkey;\n    EVP_CIPHER_INFO enc_cipher;\n    int enc_len;\n    char *enc_data;\n    int references;\n} X509_INFO;\n\nDECLARE_STACK_OF(X509_INFO)\n# endif\n\n/*\n * The next 2 structures and their 8 routines were sent to me by Pat Richard\n * <patr@x509.com> and are used to manipulate Netscapes spki structures -\n * useful if you are writing a CA web page\n */\ntypedef struct Netscape_spkac_st {\n    X509_PUBKEY *pubkey;\n    ASN1_IA5STRING *challenge;  /* challenge sent in atlas >= PR2 */\n} NETSCAPE_SPKAC;\n\ntypedef struct Netscape_spki_st {\n    NETSCAPE_SPKAC *spkac;      /* signed public key and challenge */\n    X509_ALGOR *sig_algor;\n    ASN1_BIT_STRING *signature;\n} NETSCAPE_SPKI;\n\n/* Netscape certificate sequence structure */\ntypedef struct Netscape_certificate_sequence {\n    ASN1_OBJECT *type;\n    STACK_OF(X509) *certs;\n} NETSCAPE_CERT_SEQUENCE;\n\n/*- Unused (and iv length is wrong)\ntypedef struct CBCParameter_st\n        {\n        unsigned char iv[8];\n        } CBC_PARAM;\n*/\n\n/* Password based encryption structure */\n\ntypedef struct PBEPARAM_st {\n    ASN1_OCTET_STRING *salt;\n    ASN1_INTEGER *iter;\n} PBEPARAM;\n\n/* Password based encryption V2 structures */\n\ntypedef struct PBE2PARAM_st {\n    X509_ALGOR *keyfunc;\n    X509_ALGOR *encryption;\n} PBE2PARAM;\n\ntypedef struct PBKDF2PARAM_st {\n/* Usually OCTET STRING but could be anything */\n    ASN1_TYPE *salt;\n    ASN1_INTEGER *iter;\n    ASN1_INTEGER *keylength;\n    X509_ALGOR *prf;\n} PBKDF2PARAM;\n\n/* PKCS#8 private key info structure */\n\nstruct pkcs8_priv_key_info_st {\n    /* Flag for various broken formats */\n    int broken;\n# define PKCS8_OK                0\n# define PKCS8_NO_OCTET          1\n# define PKCS8_EMBEDDED_PARAM    2\n# define PKCS8_NS_DB             3\n# define PKCS8_NEG_PRIVKEY       4\n    ASN1_INTEGER *version;\n    X509_ALGOR *pkeyalg;\n    /* Should be OCTET STRING but some are broken */\n    ASN1_TYPE *pkey;\n    STACK_OF(X509_ATTRIBUTE) *attributes;\n};\n\n#ifdef  __cplusplus\n}\n#endif\n\n# include <openssl/x509_vfy.h>\n# include <openssl/pkcs7.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# define X509_EXT_PACK_UNKNOWN   1\n# define X509_EXT_PACK_STRING    2\n\n# define         X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version)\n/* #define      X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */\n# define         X509_get_notBefore(x) ((x)->cert_info->validity->notBefore)\n# define         X509_get_notAfter(x) ((x)->cert_info->validity->notAfter)\n# define         X509_extract_key(x)     X509_get_pubkey(x)/*****/\n# define         X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version)\n# define         X509_REQ_get_subject_name(x) ((x)->req_info->subject)\n# define         X509_REQ_extract_key(a) X509_REQ_get_pubkey(a)\n# define         X509_name_cmp(a,b)      X509_NAME_cmp((a),(b))\n# define         X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm))\n\n# define         X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version)\n# define         X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate)\n# define         X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate)\n# define         X509_CRL_get_issuer(x) ((x)->crl->issuer)\n# define         X509_CRL_get_REVOKED(x) ((x)->crl->revoked)\n\nvoid X509_CRL_set_default_method(const X509_CRL_METHOD *meth);\nX509_CRL_METHOD *X509_CRL_METHOD_new(int (*crl_init) (X509_CRL *crl),\n                                     int (*crl_free) (X509_CRL *crl),\n                                     int (*crl_lookup) (X509_CRL *crl,\n                                                        X509_REVOKED **ret,\n                                                        ASN1_INTEGER *ser,\n                                                        X509_NAME *issuer),\n                                     int (*crl_verify) (X509_CRL *crl,\n                                                        EVP_PKEY *pk));\nvoid X509_CRL_METHOD_free(X509_CRL_METHOD *m);\n\nvoid X509_CRL_set_meth_data(X509_CRL *crl, void *dat);\nvoid *X509_CRL_get_meth_data(X509_CRL *crl);\n\n/*\n * This one is only used so that a binary form can output, as in\n * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf)\n */\n# define         X509_get_X509_PUBKEY(x) ((x)->cert_info->key)\n\nconst char *X509_verify_cert_error_string(long n);\n\n# ifndef OPENSSL_NO_EVP\nint X509_verify(X509 *a, EVP_PKEY *r);\n\nint X509_REQ_verify(X509_REQ *a, EVP_PKEY *r);\nint X509_CRL_verify(X509_CRL *a, EVP_PKEY *r);\nint NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r);\n\nNETSCAPE_SPKI *NETSCAPE_SPKI_b64_decode(const char *str, int len);\nchar *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x);\nEVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x);\nint NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey);\n\nint NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki);\n\nint X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent);\nint X509_signature_print(BIO *bp, X509_ALGOR *alg, ASN1_STRING *sig);\n\nint X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);\nint X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx);\nint X509_http_nbio(OCSP_REQ_CTX *rctx, X509 **pcert);\nint X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md);\nint X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx);\nint X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md);\nint X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx);\nint X509_CRL_http_nbio(OCSP_REQ_CTX *rctx, X509_CRL **pcrl);\nint NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md);\n\nint X509_pubkey_digest(const X509 *data, const EVP_MD *type,\n                       unsigned char *md, unsigned int *len);\nint X509_digest(const X509 *data, const EVP_MD *type,\n                unsigned char *md, unsigned int *len);\nint X509_CRL_digest(const X509_CRL *data, const EVP_MD *type,\n                    unsigned char *md, unsigned int *len);\nint X509_REQ_digest(const X509_REQ *data, const EVP_MD *type,\n                    unsigned char *md, unsigned int *len);\nint X509_NAME_digest(const X509_NAME *data, const EVP_MD *type,\n                     unsigned char *md, unsigned int *len);\n# endif\n\n# ifndef OPENSSL_NO_FP_API\nX509 *d2i_X509_fp(FILE *fp, X509 **x509);\nint i2d_X509_fp(FILE *fp, X509 *x509);\nX509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl);\nint i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl);\nX509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req);\nint i2d_X509_REQ_fp(FILE *fp, X509_REQ *req);\n#  ifndef OPENSSL_NO_RSA\nRSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa);\nint i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa);\nRSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa);\nint i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa);\nRSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa);\nint i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa);\n#  endif\n#  ifndef OPENSSL_NO_DSA\nDSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa);\nint i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa);\nDSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa);\nint i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa);\n#  endif\n#  ifndef OPENSSL_NO_EC\nEC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey);\nint i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey);\nEC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey);\nint i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey);\n#  endif\nX509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8);\nint i2d_PKCS8_fp(FILE *fp, X509_SIG *p8);\nPKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,\n                                                PKCS8_PRIV_KEY_INFO **p8inf);\nint i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, PKCS8_PRIV_KEY_INFO *p8inf);\nint i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key);\nint i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey);\nEVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a);\nint i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey);\nEVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a);\n# endif\n\n# ifndef OPENSSL_NO_BIO\nX509 *d2i_X509_bio(BIO *bp, X509 **x509);\nint i2d_X509_bio(BIO *bp, X509 *x509);\nX509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl);\nint i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl);\nX509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req);\nint i2d_X509_REQ_bio(BIO *bp, X509_REQ *req);\n#  ifndef OPENSSL_NO_RSA\nRSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa);\nint i2d_RSAPrivateKey_bio(BIO *bp, RSA *rsa);\nRSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa);\nint i2d_RSAPublicKey_bio(BIO *bp, RSA *rsa);\nRSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa);\nint i2d_RSA_PUBKEY_bio(BIO *bp, RSA *rsa);\n#  endif\n#  ifndef OPENSSL_NO_DSA\nDSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa);\nint i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa);\nDSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa);\nint i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa);\n#  endif\n#  ifndef OPENSSL_NO_EC\nEC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey);\nint i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *eckey);\nEC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey);\nint i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey);\n#  endif\nX509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8);\nint i2d_PKCS8_bio(BIO *bp, X509_SIG *p8);\nPKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,\n                                                 PKCS8_PRIV_KEY_INFO **p8inf);\nint i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, PKCS8_PRIV_KEY_INFO *p8inf);\nint i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key);\nint i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey);\nEVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a);\nint i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey);\nEVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a);\n# endif\n\nX509 *X509_dup(X509 *x509);\nX509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa);\nX509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex);\nX509_CRL *X509_CRL_dup(X509_CRL *crl);\nX509_REVOKED *X509_REVOKED_dup(X509_REVOKED *rev);\nX509_REQ *X509_REQ_dup(X509_REQ *req);\nX509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn);\nint X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype,\n                    void *pval);\nvoid X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,\n                     X509_ALGOR *algor);\nvoid X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);\nint X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b);\n\nX509_NAME *X509_NAME_dup(X509_NAME *xn);\nX509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne);\n\nint X509_cmp_time(const ASN1_TIME *s, time_t *t);\nint X509_cmp_current_time(const ASN1_TIME *s);\nASN1_TIME *X509_time_adj(ASN1_TIME *s, long adj, time_t *t);\nASN1_TIME *X509_time_adj_ex(ASN1_TIME *s,\n                            int offset_day, long offset_sec, time_t *t);\nASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj);\n\nconst char *X509_get_default_cert_area(void);\nconst char *X509_get_default_cert_dir(void);\nconst char *X509_get_default_cert_file(void);\nconst char *X509_get_default_cert_dir_env(void);\nconst char *X509_get_default_cert_file_env(void);\nconst char *X509_get_default_private_dir(void);\n\nX509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md);\nX509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey);\n\nDECLARE_ASN1_FUNCTIONS(X509_ALGOR)\nDECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS)\nDECLARE_ASN1_FUNCTIONS(X509_VAL)\n\nDECLARE_ASN1_FUNCTIONS(X509_PUBKEY)\n\nint X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey);\nEVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key);\nint X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain);\nint i2d_PUBKEY(EVP_PKEY *a, unsigned char **pp);\nEVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp, long length);\n# ifndef OPENSSL_NO_RSA\nint i2d_RSA_PUBKEY(RSA *a, unsigned char **pp);\nRSA *d2i_RSA_PUBKEY(RSA **a, const unsigned char **pp, long length);\n# endif\n# ifndef OPENSSL_NO_DSA\nint i2d_DSA_PUBKEY(DSA *a, unsigned char **pp);\nDSA *d2i_DSA_PUBKEY(DSA **a, const unsigned char **pp, long length);\n# endif\n# ifndef OPENSSL_NO_EC\nint i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp);\nEC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, long length);\n# endif\n\nDECLARE_ASN1_FUNCTIONS(X509_SIG)\nDECLARE_ASN1_FUNCTIONS(X509_REQ_INFO)\nDECLARE_ASN1_FUNCTIONS(X509_REQ)\n\nDECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE)\nX509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value);\n\nDECLARE_ASN1_FUNCTIONS(X509_EXTENSION)\nDECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS)\n\nDECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY)\n\nDECLARE_ASN1_FUNCTIONS(X509_NAME)\n\nint X509_NAME_set(X509_NAME **xn, X509_NAME *name);\n\nDECLARE_ASN1_FUNCTIONS(X509_CINF)\n\nDECLARE_ASN1_FUNCTIONS(X509)\nDECLARE_ASN1_FUNCTIONS(X509_CERT_AUX)\n\nDECLARE_ASN1_FUNCTIONS(X509_CERT_PAIR)\n\nint X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,\n                          CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);\nint X509_set_ex_data(X509 *r, int idx, void *arg);\nvoid *X509_get_ex_data(X509 *r, int idx);\nint i2d_X509_AUX(X509 *a, unsigned char **pp);\nX509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length);\n\nint i2d_re_X509_tbs(X509 *x, unsigned char **pp);\n\nvoid X509_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg,\n                         const X509 *x);\nint X509_get_signature_nid(const X509 *x);\n\nint X509_alias_set1(X509 *x, unsigned char *name, int len);\nint X509_keyid_set1(X509 *x, unsigned char *id, int len);\nunsigned char *X509_alias_get0(X509 *x, int *len);\nunsigned char *X509_keyid_get0(X509 *x, int *len);\nint (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *,\n                                                                int);\nint X509_TRUST_set(int *t, int trust);\nint X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj);\nint X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj);\nvoid X509_trust_clear(X509 *x);\nvoid X509_reject_clear(X509 *x);\n\nDECLARE_ASN1_FUNCTIONS(X509_REVOKED)\nDECLARE_ASN1_FUNCTIONS(X509_CRL_INFO)\nDECLARE_ASN1_FUNCTIONS(X509_CRL)\n\nint X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev);\nint X509_CRL_get0_by_serial(X509_CRL *crl,\n                            X509_REVOKED **ret, ASN1_INTEGER *serial);\nint X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x);\n\nX509_PKEY *X509_PKEY_new(void);\nvoid X509_PKEY_free(X509_PKEY *a);\nint i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp);\nX509_PKEY *d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp,\n                         long length);\n\nDECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI)\nDECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)\nDECLARE_ASN1_FUNCTIONS(NETSCAPE_CERT_SEQUENCE)\n\n# ifndef OPENSSL_NO_EVP\nX509_INFO *X509_INFO_new(void);\nvoid X509_INFO_free(X509_INFO *a);\nchar *X509_NAME_oneline(X509_NAME *a, char *buf, int size);\n\nint ASN1_verify(i2d_of_void *i2d, X509_ALGOR *algor1,\n                ASN1_BIT_STRING *signature, char *data, EVP_PKEY *pkey);\n\nint ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,\n                unsigned char *md, unsigned int *len);\n\nint ASN1_sign(i2d_of_void *i2d, X509_ALGOR *algor1,\n              X509_ALGOR *algor2, ASN1_BIT_STRING *signature,\n              char *data, EVP_PKEY *pkey, const EVP_MD *type);\n\nint ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *data,\n                     unsigned char *md, unsigned int *len);\n\nint ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1,\n                     ASN1_BIT_STRING *signature, void *data, EVP_PKEY *pkey);\n\nint ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1,\n                   X509_ALGOR *algor2, ASN1_BIT_STRING *signature, void *data,\n                   EVP_PKEY *pkey, const EVP_MD *type);\nint ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1,\n                       X509_ALGOR *algor2, ASN1_BIT_STRING *signature,\n                       void *asn, EVP_MD_CTX *ctx);\n# endif\n\nint X509_set_version(X509 *x, long version);\nint X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);\nASN1_INTEGER *X509_get_serialNumber(X509 *x);\nint X509_set_issuer_name(X509 *x, X509_NAME *name);\nX509_NAME *X509_get_issuer_name(X509 *a);\nint X509_set_subject_name(X509 *x, X509_NAME *name);\nX509_NAME *X509_get_subject_name(X509 *a);\nint X509_set_notBefore(X509 *x, const ASN1_TIME *tm);\nint X509_set_notAfter(X509 *x, const ASN1_TIME *tm);\nint X509_set_pubkey(X509 *x, EVP_PKEY *pkey);\nEVP_PKEY *X509_get_pubkey(X509 *x);\nASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x);\nint X509_certificate_type(X509 *x, EVP_PKEY *pubkey /* optional */ );\n\nint X509_REQ_set_version(X509_REQ *x, long version);\nint X509_REQ_set_subject_name(X509_REQ *req, X509_NAME *name);\nint X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);\nEVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req);\nint X509_REQ_extension_nid(int nid);\nint *X509_REQ_get_extension_nids(void);\nvoid X509_REQ_set_extension_nids(int *nids);\nSTACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);\nint X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,\n                                int nid);\nint X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts);\nint X509_REQ_get_attr_count(const X509_REQ *req);\nint X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos);\nint X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj,\n                             int lastpos);\nX509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc);\nX509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc);\nint X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr);\nint X509_REQ_add1_attr_by_OBJ(X509_REQ *req,\n                              const ASN1_OBJECT *obj, int type,\n                              const unsigned char *bytes, int len);\nint X509_REQ_add1_attr_by_NID(X509_REQ *req,\n                              int nid, int type,\n                              const unsigned char *bytes, int len);\nint X509_REQ_add1_attr_by_txt(X509_REQ *req,\n                              const char *attrname, int type,\n                              const unsigned char *bytes, int len);\n\nint X509_CRL_set_version(X509_CRL *x, long version);\nint X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);\nint X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm);\nint X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm);\nint X509_CRL_sort(X509_CRL *crl);\n\nint X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial);\nint X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm);\n\nX509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer,\n                        EVP_PKEY *skey, const EVP_MD *md, unsigned int flags);\n\nint X509_REQ_check_private_key(X509_REQ *x509, EVP_PKEY *pkey);\n\nint X509_check_private_key(X509 *x509, EVP_PKEY *pkey);\nint X509_chain_check_suiteb(int *perror_depth,\n                            X509 *x, STACK_OF(X509) *chain,\n                            unsigned long flags);\nint X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, unsigned long flags);\nSTACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain);\n\nint X509_issuer_and_serial_cmp(const X509 *a, const X509 *b);\nunsigned long X509_issuer_and_serial_hash(X509 *a);\n\nint X509_issuer_name_cmp(const X509 *a, const X509 *b);\nunsigned long X509_issuer_name_hash(X509 *a);\n\nint X509_subject_name_cmp(const X509 *a, const X509 *b);\nunsigned long X509_subject_name_hash(X509 *x);\n\n# ifndef OPENSSL_NO_MD5\nunsigned long X509_issuer_name_hash_old(X509 *a);\nunsigned long X509_subject_name_hash_old(X509 *x);\n# endif\n\nint X509_cmp(const X509 *a, const X509 *b);\nint X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b);\nunsigned long X509_NAME_hash(X509_NAME *x);\nunsigned long X509_NAME_hash_old(X509_NAME *x);\n\nint X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);\nint X509_CRL_match(const X509_CRL *a, const X509_CRL *b);\n# ifndef OPENSSL_NO_FP_API\nint X509_print_ex_fp(FILE *bp, X509 *x, unsigned long nmflag,\n                     unsigned long cflag);\nint X509_print_fp(FILE *bp, X509 *x);\nint X509_CRL_print_fp(FILE *bp, X509_CRL *x);\nint X509_REQ_print_fp(FILE *bp, X509_REQ *req);\nint X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent,\n                          unsigned long flags);\n# endif\n\n# ifndef OPENSSL_NO_BIO\nint X509_NAME_print(BIO *bp, X509_NAME *name, int obase);\nint X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent,\n                       unsigned long flags);\nint X509_print_ex(BIO *bp, X509 *x, unsigned long nmflag,\n                  unsigned long cflag);\nint X509_print(BIO *bp, X509 *x);\nint X509_ocspid_print(BIO *bp, X509 *x);\nint X509_CERT_AUX_print(BIO *bp, X509_CERT_AUX *x, int indent);\nint X509_CRL_print(BIO *bp, X509_CRL *x);\nint X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag,\n                      unsigned long cflag);\nint X509_REQ_print(BIO *bp, X509_REQ *req);\n# endif\n\nint X509_NAME_entry_count(X509_NAME *name);\nint X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len);\nint X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj,\n                              char *buf, int len);\n\n/*\n * NOTE: you should be passsing -1, not 0 as lastpos.  The functions that use\n * lastpos, search after that position on.\n */\nint X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos);\nint X509_NAME_get_index_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj,\n                               int lastpos);\nX509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc);\nX509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc);\nint X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne,\n                        int loc, int set);\nint X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type,\n                               unsigned char *bytes, int len, int loc,\n                               int set);\nint X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,\n                               unsigned char *bytes, int len, int loc,\n                               int set);\nX509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,\n                                               const char *field, int type,\n                                               const unsigned char *bytes,\n                                               int len);\nX509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,\n                                               int type, unsigned char *bytes,\n                                               int len);\nint X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type,\n                               const unsigned char *bytes, int len, int loc,\n                               int set);\nX509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,\n                                               ASN1_OBJECT *obj, int type,\n                                               const unsigned char *bytes,\n                                               int len);\nint X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, ASN1_OBJECT *obj);\nint X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,\n                             const unsigned char *bytes, int len);\nASN1_OBJECT *X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne);\nASN1_STRING *X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne);\n\nint X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x);\nint X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x,\n                          int nid, int lastpos);\nint X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x,\n                          ASN1_OBJECT *obj, int lastpos);\nint X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x,\n                               int crit, int lastpos);\nX509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc);\nX509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);\nSTACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,\n                                         X509_EXTENSION *ex, int loc);\n\nint X509_get_ext_count(X509 *x);\nint X509_get_ext_by_NID(X509 *x, int nid, int lastpos);\nint X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos);\nint X509_get_ext_by_critical(X509 *x, int crit, int lastpos);\nX509_EXTENSION *X509_get_ext(X509 *x, int loc);\nX509_EXTENSION *X509_delete_ext(X509 *x, int loc);\nint X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);\nvoid *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx);\nint X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,\n                      unsigned long flags);\n\nint X509_CRL_get_ext_count(X509_CRL *x);\nint X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos);\nint X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj, int lastpos);\nint X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos);\nX509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc);\nX509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);\nint X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);\nvoid *X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx);\nint X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,\n                          unsigned long flags);\n\nint X509_REVOKED_get_ext_count(X509_REVOKED *x);\nint X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos);\nint X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x, ASN1_OBJECT *obj,\n                                int lastpos);\nint X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos);\nX509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc);\nX509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc);\nint X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc);\nvoid *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx);\nint X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,\n                              unsigned long flags);\n\nX509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex,\n                                             int nid, int crit,\n                                             ASN1_OCTET_STRING *data);\nX509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,\n                                             ASN1_OBJECT *obj, int crit,\n                                             ASN1_OCTET_STRING *data);\nint X509_EXTENSION_set_object(X509_EXTENSION *ex, ASN1_OBJECT *obj);\nint X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);\nint X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data);\nASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex);\nASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);\nint X509_EXTENSION_get_critical(X509_EXTENSION *ex);\n\nint X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x);\nint X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid,\n                           int lastpos);\nint X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk,\n                           ASN1_OBJECT *obj, int lastpos);\nX509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc);\nX509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc);\nSTACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x,\n                                           X509_ATTRIBUTE *attr);\nSTACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE)\n                                                  **x, const ASN1_OBJECT *obj,\n                                                  int type,\n                                                  const unsigned char *bytes,\n                                                  int len);\nSTACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE)\n                                                  **x, int nid, int type,\n                                                  const unsigned char *bytes,\n                                                  int len);\nSTACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE)\n                                                  **x, const char *attrname,\n                                                  int type,\n                                                  const unsigned char *bytes,\n                                                  int len);\nvoid *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, ASN1_OBJECT *obj,\n                              int lastpos, int type);\nX509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid,\n                                             int atrtype, const void *data,\n                                             int len);\nX509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,\n                                             const ASN1_OBJECT *obj,\n                                             int atrtype, const void *data,\n                                             int len);\nX509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr,\n                                             const char *atrname, int type,\n                                             const unsigned char *bytes,\n                                             int len);\nint X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj);\nint X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,\n                             const void *data, int len);\nvoid *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, int atrtype,\n                               void *data);\nint X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr);\nASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr);\nASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx);\n\nint EVP_PKEY_get_attr_count(const EVP_PKEY *key);\nint EVP_PKEY_get_attr_by_NID(const EVP_PKEY *key, int nid, int lastpos);\nint EVP_PKEY_get_attr_by_OBJ(const EVP_PKEY *key, ASN1_OBJECT *obj,\n                             int lastpos);\nX509_ATTRIBUTE *EVP_PKEY_get_attr(const EVP_PKEY *key, int loc);\nX509_ATTRIBUTE *EVP_PKEY_delete_attr(EVP_PKEY *key, int loc);\nint EVP_PKEY_add1_attr(EVP_PKEY *key, X509_ATTRIBUTE *attr);\nint EVP_PKEY_add1_attr_by_OBJ(EVP_PKEY *key,\n                              const ASN1_OBJECT *obj, int type,\n                              const unsigned char *bytes, int len);\nint EVP_PKEY_add1_attr_by_NID(EVP_PKEY *key,\n                              int nid, int type,\n                              const unsigned char *bytes, int len);\nint EVP_PKEY_add1_attr_by_txt(EVP_PKEY *key,\n                              const char *attrname, int type,\n                              const unsigned char *bytes, int len);\n\nint X509_verify_cert(X509_STORE_CTX *ctx);\n\n/* lookup a cert from a X509 STACK */\nX509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk, X509_NAME *name,\n                                     ASN1_INTEGER *serial);\nX509 *X509_find_by_subject(STACK_OF(X509) *sk, X509_NAME *name);\n\nDECLARE_ASN1_FUNCTIONS(PBEPARAM)\nDECLARE_ASN1_FUNCTIONS(PBE2PARAM)\nDECLARE_ASN1_FUNCTIONS(PBKDF2PARAM)\n\nint PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter,\n                         const unsigned char *salt, int saltlen);\n\nX509_ALGOR *PKCS5_pbe_set(int alg, int iter,\n                          const unsigned char *salt, int saltlen);\nX509_ALGOR *PKCS5_pbe2_set(const EVP_CIPHER *cipher, int iter,\n                           unsigned char *salt, int saltlen);\nX509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter,\n                              unsigned char *salt, int saltlen,\n                              unsigned char *aiv, int prf_nid);\n\nX509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen,\n                             int prf_nid, int keylen);\n\n/* PKCS#8 utilities */\n\nDECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO)\n\nEVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8);\nPKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey);\nPKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken);\nPKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken);\n\nint PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj,\n                    int version, int ptype, void *pval,\n                    unsigned char *penc, int penclen);\nint PKCS8_pkey_get0(ASN1_OBJECT **ppkalg,\n                    const unsigned char **pk, int *ppklen,\n                    X509_ALGOR **pa, PKCS8_PRIV_KEY_INFO *p8);\n\nint X509_PUBKEY_set0_param(X509_PUBKEY *pub, ASN1_OBJECT *aobj,\n                           int ptype, void *pval,\n                           unsigned char *penc, int penclen);\nint X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg,\n                           const unsigned char **pk, int *ppklen,\n                           X509_ALGOR **pa, X509_PUBKEY *pub);\n\nint X509_check_trust(X509 *x, int id, int flags);\nint X509_TRUST_get_count(void);\nX509_TRUST *X509_TRUST_get0(int idx);\nint X509_TRUST_get_by_id(int id);\nint X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int),\n                   char *name, int arg1, void *arg2);\nvoid X509_TRUST_cleanup(void);\nint X509_TRUST_get_flags(X509_TRUST *xp);\nchar *X509_TRUST_get0_name(X509_TRUST *xp);\nint X509_TRUST_get_trust(X509_TRUST *xp);\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\n\nvoid ERR_load_X509_strings(void);\n\n/* Error codes for the X509 functions. */\n\n/* Function codes. */\n# define X509_F_ADD_CERT_DIR                              100\n# define X509_F_BY_FILE_CTRL                              101\n# define X509_F_CHECK_NAME_CONSTRAINTS                    106\n# define X509_F_CHECK_POLICY                              145\n# define X509_F_DIR_CTRL                                  102\n# define X509_F_GET_CERT_BY_SUBJECT                       103\n# define X509_F_NETSCAPE_SPKI_B64_DECODE                  129\n# define X509_F_NETSCAPE_SPKI_B64_ENCODE                  130\n# define X509_F_X509AT_ADD1_ATTR                          135\n# define X509_F_X509V3_ADD_EXT                            104\n# define X509_F_X509_ATTRIBUTE_CREATE_BY_NID              136\n# define X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ              137\n# define X509_F_X509_ATTRIBUTE_CREATE_BY_TXT              140\n# define X509_F_X509_ATTRIBUTE_GET0_DATA                  139\n# define X509_F_X509_ATTRIBUTE_SET1_DATA                  138\n# define X509_F_X509_CHECK_PRIVATE_KEY                    128\n# define X509_F_X509_CRL_DIFF                             105\n# define X509_F_X509_CRL_PRINT_FP                         147\n# define X509_F_X509_EXTENSION_CREATE_BY_NID              108\n# define X509_F_X509_EXTENSION_CREATE_BY_OBJ              109\n# define X509_F_X509_GET_PUBKEY_PARAMETERS                110\n# define X509_F_X509_LOAD_CERT_CRL_FILE                   132\n# define X509_F_X509_LOAD_CERT_FILE                       111\n# define X509_F_X509_LOAD_CRL_FILE                        112\n# define X509_F_X509_NAME_ADD_ENTRY                       113\n# define X509_F_X509_NAME_ENTRY_CREATE_BY_NID             114\n# define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT             131\n# define X509_F_X509_NAME_ENTRY_SET_OBJECT                115\n# define X509_F_X509_NAME_ONELINE                         116\n# define X509_F_X509_NAME_PRINT                           117\n# define X509_F_X509_PRINT_EX_FP                          118\n# define X509_F_X509_PUBKEY_GET                           119\n# define X509_F_X509_PUBKEY_SET                           120\n# define X509_F_X509_REQ_CHECK_PRIVATE_KEY                144\n# define X509_F_X509_REQ_PRINT_EX                         121\n# define X509_F_X509_REQ_PRINT_FP                         122\n# define X509_F_X509_REQ_TO_X509                          123\n# define X509_F_X509_STORE_ADD_CERT                       124\n# define X509_F_X509_STORE_ADD_CRL                        125\n# define X509_F_X509_STORE_CTX_GET1_ISSUER                146\n# define X509_F_X509_STORE_CTX_INIT                       143\n# define X509_F_X509_STORE_CTX_NEW                        142\n# define X509_F_X509_STORE_CTX_PURPOSE_INHERIT            134\n# define X509_F_X509_TO_X509_REQ                          126\n# define X509_F_X509_TRUST_ADD                            133\n# define X509_F_X509_TRUST_SET                            141\n# define X509_F_X509_VERIFY_CERT                          127\n\n/* Reason codes. */\n# define X509_R_AKID_MISMATCH                             110\n# define X509_R_BAD_X509_FILETYPE                         100\n# define X509_R_BASE64_DECODE_ERROR                       118\n# define X509_R_CANT_CHECK_DH_KEY                         114\n# define X509_R_CERT_ALREADY_IN_HASH_TABLE                101\n# define X509_R_CRL_ALREADY_DELTA                         127\n# define X509_R_CRL_VERIFY_FAILURE                        131\n# define X509_R_ERR_ASN1_LIB                              102\n# define X509_R_IDP_MISMATCH                              128\n# define X509_R_INVALID_DIRECTORY                         113\n# define X509_R_INVALID_FIELD_NAME                        119\n# define X509_R_INVALID_TRUST                             123\n# define X509_R_ISSUER_MISMATCH                           129\n# define X509_R_KEY_TYPE_MISMATCH                         115\n# define X509_R_KEY_VALUES_MISMATCH                       116\n# define X509_R_LOADING_CERT_DIR                          103\n# define X509_R_LOADING_DEFAULTS                          104\n# define X509_R_METHOD_NOT_SUPPORTED                      124\n# define X509_R_NAME_TOO_LONG                             134\n# define X509_R_NEWER_CRL_NOT_NEWER                       132\n# define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY              105\n# define X509_R_NO_CRL_NUMBER                             130\n# define X509_R_PUBLIC_KEY_DECODE_ERROR                   125\n# define X509_R_PUBLIC_KEY_ENCODE_ERROR                   126\n# define X509_R_SHOULD_RETRY                              106\n# define X509_R_UNABLE_TO_FIND_PARAMETERS_IN_CHAIN        107\n# define X509_R_UNABLE_TO_GET_CERTS_PUBLIC_KEY            108\n# define X509_R_UNKNOWN_KEY_TYPE                          117\n# define X509_R_UNKNOWN_NID                               109\n# define X509_R_UNKNOWN_PURPOSE_ID                        121\n# define X509_R_UNKNOWN_TRUST_ID                          120\n# define X509_R_UNSUPPORTED_ALGORITHM                     111\n# define X509_R_WRONG_LOOKUP_TYPE                         112\n# define X509_R_WRONG_TYPE                                122\n\n# ifdef  __cplusplus\n}\n# endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/x509_vfy.h",
    "content": "/* crypto/x509/x509_vfy.h */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to.  The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code.  The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n *    must display the following acknowledgement:\n *    \"This product includes cryptographic software written by\n *     Eric Young (eay@cryptsoft.com)\"\n *    The word 'cryptographic' can be left out if the rouines from the library\n *    being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n *    the apps directory (application code) you must include an acknowledgement:\n *    \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed.  i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n\n#ifndef HEADER_X509_H\n# include <openssl/x509.h>\n/*\n * openssl/x509.h ends up #include-ing this file at about the only\n * appropriate moment.\n */\n#endif\n\n#ifndef HEADER_X509_VFY_H\n# define HEADER_X509_VFY_H\n\n# include <openssl/opensslconf.h>\n# ifndef OPENSSL_NO_LHASH\n#  include <openssl/lhash.h>\n# endif\n# include <openssl/bio.h>\n# include <openssl/crypto.h>\n# include <openssl/symhacks.h>\n\n#ifdef  __cplusplus\nextern \"C\" {\n#endif\n\n# if 0\n/* Outer object */\ntypedef struct x509_hash_dir_st {\n    int num_dirs;\n    char **dirs;\n    int *dirs_type;\n    int num_dirs_alloced;\n} X509_HASH_DIR_CTX;\n# endif\n\ntypedef struct x509_file_st {\n    int num_paths;              /* number of paths to files or directories */\n    int num_alloced;\n    char **paths;               /* the list of paths or directories */\n    int *path_type;\n} X509_CERT_FILE_CTX;\n\n/*******************************/\n/*-\nSSL_CTX -> X509_STORE\n                -> X509_LOOKUP\n                        ->X509_LOOKUP_METHOD\n                -> X509_LOOKUP\n                        ->X509_LOOKUP_METHOD\n\nSSL     -> X509_STORE_CTX\n                ->X509_STORE\n\nThe X509_STORE holds the tables etc for verification stuff.\nA X509_STORE_CTX is used while validating a single certificate.\nThe X509_STORE has X509_LOOKUPs for looking up certs.\nThe X509_STORE then calls a function to actually verify the\ncertificate chain.\n*/\n\n# define X509_LU_RETRY           -1\n# define X509_LU_FAIL            0\n# define X509_LU_X509            1\n# define X509_LU_CRL             2\n# define X509_LU_PKEY            3\n\ntypedef struct x509_object_st {\n    /* one of the above types */\n    int type;\n    union {\n        char *ptr;\n        X509 *x509;\n        X509_CRL *crl;\n        EVP_PKEY *pkey;\n    } data;\n} X509_OBJECT;\n\ntypedef struct x509_lookup_st X509_LOOKUP;\n\nDECLARE_STACK_OF(X509_LOOKUP)\nDECLARE_STACK_OF(X509_OBJECT)\n\n/* This is a static that defines the function interface */\ntypedef struct x509_lookup_method_st {\n    const char *name;\n    int (*new_item) (X509_LOOKUP *ctx);\n    void (*free) (X509_LOOKUP *ctx);\n    int (*init) (X509_LOOKUP *ctx);\n    int (*shutdown) (X509_LOOKUP *ctx);\n    int (*ctrl) (X509_LOOKUP *ctx, int cmd, const char *argc, long argl,\n                 char **ret);\n    int (*get_by_subject) (X509_LOOKUP *ctx, int type, X509_NAME *name,\n                           X509_OBJECT *ret);\n    int (*get_by_issuer_serial) (X509_LOOKUP *ctx, int type, X509_NAME *name,\n                                 ASN1_INTEGER *serial, X509_OBJECT *ret);\n    int (*get_by_fingerprint) (X509_LOOKUP *ctx, int type,\n                               unsigned char *bytes, int len,\n                               X509_OBJECT *ret);\n    int (*get_by_alias) (X509_LOOKUP *ctx, int type, char *str, int len,\n                         X509_OBJECT *ret);\n} X509_LOOKUP_METHOD;\n\ntypedef struct X509_VERIFY_PARAM_ID_st X509_VERIFY_PARAM_ID;\n\n/*\n * This structure hold all parameters associated with a verify operation by\n * including an X509_VERIFY_PARAM structure in related structures the\n * parameters used can be customized\n */\n\ntypedef struct X509_VERIFY_PARAM_st {\n    char *name;\n    time_t check_time;          /* Time to use */\n    unsigned long inh_flags;    /* Inheritance flags */\n    unsigned long flags;        /* Various verify flags */\n    int purpose;                /* purpose to check untrusted certificates */\n    int trust;                  /* trust setting to check */\n    int depth;                  /* Verify depth */\n    STACK_OF(ASN1_OBJECT) *policies; /* Permissible policies */\n    X509_VERIFY_PARAM_ID *id;   /* opaque ID data */\n} X509_VERIFY_PARAM;\n\nDECLARE_STACK_OF(X509_VERIFY_PARAM)\n\n/*\n * This is used to hold everything.  It is used for all certificate\n * validation.  Once we have a certificate chain, the 'verify' function is\n * then called to actually check the cert chain.\n */\nstruct x509_store_st {\n    /* The following is a cache of trusted certs */\n    int cache;                  /* if true, stash any hits */\n    STACK_OF(X509_OBJECT) *objs; /* Cache of all objects */\n    /* These are external lookup methods */\n    STACK_OF(X509_LOOKUP) *get_cert_methods;\n    X509_VERIFY_PARAM *param;\n    /* Callbacks for various operations */\n    /* called to verify a certificate */\n    int (*verify) (X509_STORE_CTX *ctx);\n    /* error callback */\n    int (*verify_cb) (int ok, X509_STORE_CTX *ctx);\n    /* get issuers cert from ctx */\n    int (*get_issuer) (X509 **issuer, X509_STORE_CTX *ctx, X509 *x);\n    /* check issued */\n    int (*check_issued) (X509_STORE_CTX *ctx, X509 *x, X509 *issuer);\n    /* Check revocation status of chain */\n    int (*check_revocation) (X509_STORE_CTX *ctx);\n    /* retrieve CRL */\n    int (*get_crl) (X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x);\n    /* Check CRL validity */\n    int (*check_crl) (X509_STORE_CTX *ctx, X509_CRL *crl);\n    /* Check certificate against CRL */\n    int (*cert_crl) (X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x);\n    STACK_OF(X509) *(*lookup_certs) (X509_STORE_CTX *ctx, X509_NAME *nm);\n    STACK_OF(X509_CRL) *(*lookup_crls) (X509_STORE_CTX *ctx, X509_NAME *nm);\n    int (*cleanup) (X509_STORE_CTX *ctx);\n    CRYPTO_EX_DATA ex_data;\n    int references;\n} /* X509_STORE */ ;\n\nint X509_STORE_set_depth(X509_STORE *store, int depth);\n\n# define X509_STORE_set_verify_cb_func(ctx,func) ((ctx)->verify_cb=(func))\n# define X509_STORE_set_verify_func(ctx,func)    ((ctx)->verify=(func))\n\n/* This is the functions plus an instance of the local variables. */\nstruct x509_lookup_st {\n    int init;                   /* have we been started */\n    int skip;                   /* don't use us. */\n    X509_LOOKUP_METHOD *method; /* the functions */\n    char *method_data;          /* method data */\n    X509_STORE *store_ctx;      /* who owns us */\n} /* X509_LOOKUP */ ;\n\n/*\n * This is a used when verifying cert chains.  Since the gathering of the\n * cert chain can take some time (and have to be 'retried', this needs to be\n * kept and passed around.\n */\nstruct x509_store_ctx_st {      /* X509_STORE_CTX */\n    X509_STORE *ctx;\n    /* used when looking up certs */\n    int current_method;\n    /* The following are set by the caller */\n    /* The cert to check */\n    X509 *cert;\n    /* chain of X509s - untrusted - passed in */\n    STACK_OF(X509) *untrusted;\n    /* set of CRLs passed in */\n    STACK_OF(X509_CRL) *crls;\n    X509_VERIFY_PARAM *param;\n    /* Other info for use with get_issuer() */\n    void *other_ctx;\n    /* Callbacks for various operations */\n    /* called to verify a certificate */\n    int (*verify) (X509_STORE_CTX *ctx);\n    /* error callback */\n    int (*verify_cb) (int ok, X509_STORE_CTX *ctx);\n    /* get issuers cert from ctx */\n    int (*get_issuer) (X509 **issuer, X509_STORE_CTX *ctx, X509 *x);\n    /* check issued */\n    int (*check_issued) (X509_STORE_CTX *ctx, X509 *x, X509 *issuer);\n    /* Check revocation status of chain */\n    int (*check_revocation) (X509_STORE_CTX *ctx);\n    /* retrieve CRL */\n    int (*get_crl) (X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x);\n    /* Check CRL validity */\n    int (*check_crl) (X509_STORE_CTX *ctx, X509_CRL *crl);\n    /* Check certificate against CRL */\n    int (*cert_crl) (X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x);\n    int (*check_policy) (X509_STORE_CTX *ctx);\n    STACK_OF(X509) *(*lookup_certs) (X509_STORE_CTX *ctx, X509_NAME *nm);\n    STACK_OF(X509_CRL) *(*lookup_crls) (X509_STORE_CTX *ctx, X509_NAME *nm);\n    int (*cleanup) (X509_STORE_CTX *ctx);\n    /* The following is built up */\n    /* if 0, rebuild chain */\n    int valid;\n    /* index of last untrusted cert */\n    int last_untrusted;\n    /* chain of X509s - built up and trusted */\n    STACK_OF(X509) *chain;\n    /* Valid policy tree */\n    X509_POLICY_TREE *tree;\n    /* Require explicit policy value */\n    int explicit_policy;\n    /* When something goes wrong, this is why */\n    int error_depth;\n    int error;\n    X509 *current_cert;\n    /* cert currently being tested as valid issuer */\n    X509 *current_issuer;\n    /* current CRL */\n    X509_CRL *current_crl;\n    /* score of current CRL */\n    int current_crl_score;\n    /* Reason mask */\n    unsigned int current_reasons;\n    /* For CRL path validation: parent context */\n    X509_STORE_CTX *parent;\n    CRYPTO_EX_DATA ex_data;\n} /* X509_STORE_CTX */ ;\n\nvoid X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);\n\n# define X509_STORE_CTX_set_app_data(ctx,data) \\\n        X509_STORE_CTX_set_ex_data(ctx,0,data)\n# define X509_STORE_CTX_get_app_data(ctx) \\\n        X509_STORE_CTX_get_ex_data(ctx,0)\n\n# define X509_L_FILE_LOAD        1\n# define X509_L_ADD_DIR          2\n\n# define X509_LOOKUP_load_file(x,name,type) \\\n                X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL)\n\n# define X509_LOOKUP_add_dir(x,name,type) \\\n                X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL)\n\n# define         X509_V_OK                                       0\n# define         X509_V_ERR_UNSPECIFIED                          1\n\n# define         X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT            2\n# define         X509_V_ERR_UNABLE_TO_GET_CRL                    3\n# define         X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE     4\n# define         X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE      5\n# define         X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY   6\n# define         X509_V_ERR_CERT_SIGNATURE_FAILURE               7\n# define         X509_V_ERR_CRL_SIGNATURE_FAILURE                8\n# define         X509_V_ERR_CERT_NOT_YET_VALID                   9\n# define         X509_V_ERR_CERT_HAS_EXPIRED                     10\n# define         X509_V_ERR_CRL_NOT_YET_VALID                    11\n# define         X509_V_ERR_CRL_HAS_EXPIRED                      12\n# define         X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD       13\n# define         X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD        14\n# define         X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD       15\n# define         X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD       16\n# define         X509_V_ERR_OUT_OF_MEM                           17\n# define         X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT          18\n# define         X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN            19\n# define         X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY    20\n# define         X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE      21\n# define         X509_V_ERR_CERT_CHAIN_TOO_LONG                  22\n# define         X509_V_ERR_CERT_REVOKED                         23\n# define         X509_V_ERR_INVALID_CA                           24\n# define         X509_V_ERR_PATH_LENGTH_EXCEEDED                 25\n# define         X509_V_ERR_INVALID_PURPOSE                      26\n# define         X509_V_ERR_CERT_UNTRUSTED                       27\n# define         X509_V_ERR_CERT_REJECTED                        28\n/* These are 'informational' when looking for issuer cert */\n# define         X509_V_ERR_SUBJECT_ISSUER_MISMATCH              29\n# define         X509_V_ERR_AKID_SKID_MISMATCH                   30\n# define         X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH          31\n# define         X509_V_ERR_KEYUSAGE_NO_CERTSIGN                 32\n\n# define         X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER             33\n# define         X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION         34\n# define         X509_V_ERR_KEYUSAGE_NO_CRL_SIGN                 35\n# define         X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION     36\n# define         X509_V_ERR_INVALID_NON_CA                       37\n# define         X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED           38\n# define         X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE        39\n# define         X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED       40\n\n# define         X509_V_ERR_INVALID_EXTENSION                    41\n# define         X509_V_ERR_INVALID_POLICY_EXTENSION             42\n# define         X509_V_ERR_NO_EXPLICIT_POLICY                   43\n# define         X509_V_ERR_DIFFERENT_CRL_SCOPE                  44\n# define         X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE        45\n\n# define         X509_V_ERR_UNNESTED_RESOURCE                    46\n\n# define         X509_V_ERR_PERMITTED_VIOLATION                  47\n# define         X509_V_ERR_EXCLUDED_VIOLATION                   48\n# define         X509_V_ERR_SUBTREE_MINMAX                       49\n# define         X509_V_ERR_APPLICATION_VERIFICATION             50\n# define         X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE          51\n# define         X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX        52\n# define         X509_V_ERR_UNSUPPORTED_NAME_SYNTAX              53\n# define         X509_V_ERR_CRL_PATH_VALIDATION_ERROR            54\n\n/* Suite B mode algorithm violation */\n# define         X509_V_ERR_SUITE_B_INVALID_VERSION              56\n# define         X509_V_ERR_SUITE_B_INVALID_ALGORITHM            57\n# define         X509_V_ERR_SUITE_B_INVALID_CURVE                58\n# define         X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM  59\n# define         X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED              60\n# define         X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61\n\n/* Host, email and IP check errors */\n# define         X509_V_ERR_HOSTNAME_MISMATCH                    62\n# define         X509_V_ERR_EMAIL_MISMATCH                       63\n# define         X509_V_ERR_IP_ADDRESS_MISMATCH                  64\n\n/* Caller error */\n# define         X509_V_ERR_INVALID_CALL                         65\n/* Issuer lookup error */\n# define         X509_V_ERR_STORE_LOOKUP                         66\n\n# define         X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION         67\n\n/* Certificate verify flags */\n\n/* Send issuer+subject checks to verify_cb */\n# define X509_V_FLAG_CB_ISSUER_CHECK             0x1\n/* Use check time instead of current time */\n# define X509_V_FLAG_USE_CHECK_TIME              0x2\n/* Lookup CRLs */\n# define X509_V_FLAG_CRL_CHECK                   0x4\n/* Lookup CRLs for whole chain */\n# define X509_V_FLAG_CRL_CHECK_ALL               0x8\n/* Ignore unhandled critical extensions */\n# define X509_V_FLAG_IGNORE_CRITICAL             0x10\n/* Disable workarounds for broken certificates */\n# define X509_V_FLAG_X509_STRICT                 0x20\n/* Enable proxy certificate validation */\n# define X509_V_FLAG_ALLOW_PROXY_CERTS           0x40\n/* Enable policy checking */\n# define X509_V_FLAG_POLICY_CHECK                0x80\n/* Policy variable require-explicit-policy */\n# define X509_V_FLAG_EXPLICIT_POLICY             0x100\n/* Policy variable inhibit-any-policy */\n# define X509_V_FLAG_INHIBIT_ANY                 0x200\n/* Policy variable inhibit-policy-mapping */\n# define X509_V_FLAG_INHIBIT_MAP                 0x400\n/* Notify callback that policy is OK */\n# define X509_V_FLAG_NOTIFY_POLICY               0x800\n/* Extended CRL features such as indirect CRLs, alternate CRL signing keys */\n# define X509_V_FLAG_EXTENDED_CRL_SUPPORT        0x1000\n/* Delta CRL support */\n# define X509_V_FLAG_USE_DELTAS                  0x2000\n/* Check selfsigned CA signature */\n# define X509_V_FLAG_CHECK_SS_SIGNATURE          0x4000\n/* Use trusted store first */\n# define X509_V_FLAG_TRUSTED_FIRST               0x8000\n/* Suite B 128 bit only mode: not normally used */\n# define X509_V_FLAG_SUITEB_128_LOS_ONLY         0x10000\n/* Suite B 192 bit only mode */\n# define X509_V_FLAG_SUITEB_192_LOS              0x20000\n/* Suite B 128 bit mode allowing 192 bit algorithms */\n# define X509_V_FLAG_SUITEB_128_LOS              0x30000\n\n/* Allow partial chains if at least one certificate is in trusted store */\n# define X509_V_FLAG_PARTIAL_CHAIN               0x80000\n/*\n * If the initial chain is not trusted, do not attempt to build an alternative\n * chain. Alternate chain checking was introduced in 1.0.2b. Setting this flag\n * will force the behaviour to match that of previous versions.\n */\n# define X509_V_FLAG_NO_ALT_CHAINS               0x100000\n\n# define X509_VP_FLAG_DEFAULT                    0x1\n# define X509_VP_FLAG_OVERWRITE                  0x2\n# define X509_VP_FLAG_RESET_FLAGS                0x4\n# define X509_VP_FLAG_LOCKED                     0x8\n# define X509_VP_FLAG_ONCE                       0x10\n\n/* Internal use: mask of policy related options */\n# define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \\\n                                | X509_V_FLAG_EXPLICIT_POLICY \\\n                                | X509_V_FLAG_INHIBIT_ANY \\\n                                | X509_V_FLAG_INHIBIT_MAP)\n\nint X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type,\n                               X509_NAME *name);\nX509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,\n                                             int type, X509_NAME *name);\nX509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,\n                                        X509_OBJECT *x);\nvoid X509_OBJECT_up_ref_count(X509_OBJECT *a);\nvoid X509_OBJECT_free_contents(X509_OBJECT *a);\nX509_STORE *X509_STORE_new(void);\nvoid X509_STORE_free(X509_STORE *v);\n\nSTACK_OF(X509) *X509_STORE_get1_certs(X509_STORE_CTX *st, X509_NAME *nm);\nSTACK_OF(X509_CRL) *X509_STORE_get1_crls(X509_STORE_CTX *st, X509_NAME *nm);\nint X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags);\nint X509_STORE_set_purpose(X509_STORE *ctx, int purpose);\nint X509_STORE_set_trust(X509_STORE *ctx, int trust);\nint X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *pm);\n\nvoid X509_STORE_set_verify_cb(X509_STORE *ctx,\n                              int (*verify_cb) (int, X509_STORE_CTX *));\n\nvoid X509_STORE_set_lookup_crls_cb(X509_STORE *ctx,\n                                   STACK_OF(X509_CRL) *(*cb) (X509_STORE_CTX\n                                                              *ctx,\n                                                              X509_NAME *nm));\n\nX509_STORE_CTX *X509_STORE_CTX_new(void);\n\nint X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);\n\nvoid X509_STORE_CTX_free(X509_STORE_CTX *ctx);\nint X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store,\n                        X509 *x509, STACK_OF(X509) *chain);\nvoid X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);\nvoid X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);\n\nX509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx);\n\nX509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m);\n\nX509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void);\nX509_LOOKUP_METHOD *X509_LOOKUP_file(void);\n\nint X509_STORE_add_cert(X509_STORE *ctx, X509 *x);\nint X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x);\n\nint X509_STORE_get_by_subject(X509_STORE_CTX *vs, int type, X509_NAME *name,\n                              X509_OBJECT *ret);\n\nint X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,\n                     long argl, char **ret);\n\n# ifndef OPENSSL_NO_STDIO\nint X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);\nint X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);\nint X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);\n# endif\n\nX509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);\nvoid X509_LOOKUP_free(X509_LOOKUP *ctx);\nint X509_LOOKUP_init(X509_LOOKUP *ctx);\nint X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name,\n                           X509_OBJECT *ret);\nint X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name,\n                                 ASN1_INTEGER *serial, X509_OBJECT *ret);\nint X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type,\n                               unsigned char *bytes, int len,\n                               X509_OBJECT *ret);\nint X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, int len,\n                         X509_OBJECT *ret);\nint X509_LOOKUP_shutdown(X509_LOOKUP *ctx);\n\n# ifndef OPENSSL_NO_STDIO\nint X509_STORE_load_locations(X509_STORE *ctx,\n                              const char *file, const char *dir);\nint X509_STORE_set_default_paths(X509_STORE *ctx);\n# endif\n\nint X509_STORE_CTX_get_ex_new_index(long argl, void *argp,\n                                    CRYPTO_EX_new *new_func,\n                                    CRYPTO_EX_dup *dup_func,\n                                    CRYPTO_EX_free *free_func);\nint X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data);\nvoid *X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx, int idx);\nint X509_STORE_CTX_get_error(X509_STORE_CTX *ctx);\nvoid X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int s);\nint X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx);\nX509 *X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx);\nX509 *X509_STORE_CTX_get0_current_issuer(X509_STORE_CTX *ctx);\nX509_CRL *X509_STORE_CTX_get0_current_crl(X509_STORE_CTX *ctx);\nX509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(X509_STORE_CTX *ctx);\nSTACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx);\nSTACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx);\nvoid X509_STORE_CTX_set_cert(X509_STORE_CTX *c, X509 *x);\nvoid X509_STORE_CTX_set_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk);\nvoid X509_STORE_CTX_set0_crls(X509_STORE_CTX *c, STACK_OF(X509_CRL) *sk);\nint X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);\nint X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust);\nint X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,\n                                   int purpose, int trust);\nvoid X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags);\nvoid X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags,\n                             time_t t);\nvoid X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx,\n                                  int (*verify_cb) (int, X509_STORE_CTX *));\n\nX509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx);\nint X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx);\n\nX509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx);\nvoid X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param);\nint X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name);\n\n/* X509_VERIFY_PARAM functions */\n\nX509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void);\nvoid X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param);\nint X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to,\n                              const X509_VERIFY_PARAM *from);\nint X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to,\n                           const X509_VERIFY_PARAM *from);\nint X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name);\nint X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param,\n                                unsigned long flags);\nint X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,\n                                  unsigned long flags);\nunsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param);\nint X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);\nint X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);\nvoid X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth);\nvoid X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t);\nint X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,\n                                  ASN1_OBJECT *policy);\nint X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param,\n                                    STACK_OF(ASN1_OBJECT) *policies);\n\nint X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,\n                                const char *name, size_t namelen);\nint X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,\n                                const char *name, size_t namelen);\nvoid X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,\n                                     unsigned int flags);\nchar *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *);\nint X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,\n                                 const char *email, size_t emaillen);\nint X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,\n                              const unsigned char *ip, size_t iplen);\nint X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param,\n                                  const char *ipasc);\n\nint X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param);\nconst char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param);\n\nint X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param);\nint X509_VERIFY_PARAM_get_count(void);\nconst X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id);\nconst X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name);\nvoid X509_VERIFY_PARAM_table_cleanup(void);\n\nint X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy,\n                      STACK_OF(X509) *certs,\n                      STACK_OF(ASN1_OBJECT) *policy_oids, unsigned int flags);\n\nvoid X509_policy_tree_free(X509_POLICY_TREE *tree);\n\nint X509_policy_tree_level_count(const X509_POLICY_TREE *tree);\nX509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree,\n                                               int i);\n\nSTACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_policies(const\n                                                           X509_POLICY_TREE\n                                                           *tree);\n\nSTACK_OF(X509_POLICY_NODE) *X509_policy_tree_get0_user_policies(const\n                                                                X509_POLICY_TREE\n                                                                *tree);\n\nint X509_policy_level_node_count(X509_POLICY_LEVEL *level);\n\nX509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level,\n                                              int i);\n\nconst ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node);\n\nSTACK_OF(POLICYQUALINFO) *X509_policy_node_get0_qualifiers(const\n                                                           X509_POLICY_NODE\n                                                           *node);\nconst X509_POLICY_NODE *X509_policy_node_get0_parent(const X509_POLICY_NODE\n                                                     *node);\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  },
  {
    "path": "third_party/include/openssl/x509v3.h",
    "content": "/* x509v3.h */\n/*\n * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project\n * 1999.\n */\n/* ====================================================================\n * Copyright (c) 1999-2004 The OpenSSL Project.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in\n *    the documentation and/or other materials provided with the\n *    distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n *    software must display the following acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n *    endorse or promote products derived from this software without\n *    prior written permission. For written permission, please contact\n *    licensing@OpenSSL.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n *    nor may \"OpenSSL\" appear in their names without prior written\n *    permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n *    acknowledgment:\n *    \"This product includes software developed by the OpenSSL Project\n *    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com).  This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n#ifndef HEADER_X509V3_H\n# define HEADER_X509V3_H\n\n# include <openssl/bio.h>\n# include <openssl/x509.h>\n# include <openssl/conf.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n# ifdef OPENSSL_SYS_WIN32\n/* Under Win32 these are defined in wincrypt.h */\n#  undef X509_NAME\n#  undef X509_CERT_PAIR\n#  undef X509_EXTENSIONS\n# endif\n\n/* Forward reference */\nstruct v3_ext_method;\nstruct v3_ext_ctx;\n\n/* Useful typedefs */\n\ntypedef void *(*X509V3_EXT_NEW)(void);\ntypedef void (*X509V3_EXT_FREE) (void *);\ntypedef void *(*X509V3_EXT_D2I)(void *, const unsigned char **, long);\ntypedef int (*X509V3_EXT_I2D) (void *, unsigned char **);\ntypedef STACK_OF(CONF_VALUE) *\n    (*X509V3_EXT_I2V) (const struct v3_ext_method *method, void *ext,\n                       STACK_OF(CONF_VALUE) *extlist);\ntypedef void *(*X509V3_EXT_V2I)(const struct v3_ext_method *method,\n                                struct v3_ext_ctx *ctx,\n                                STACK_OF(CONF_VALUE) *values);\ntypedef char *(*X509V3_EXT_I2S)(const struct v3_ext_method *method,\n                                void *ext);\ntypedef void *(*X509V3_EXT_S2I)(const struct v3_ext_method *method,\n                                struct v3_ext_ctx *ctx, const char *str);\ntypedef int (*X509V3_EXT_I2R) (const struct v3_ext_method *method, void *ext,\n                               BIO *out, int indent);\ntypedef void *(*X509V3_EXT_R2I)(const struct v3_ext_method *method,\n                                struct v3_ext_ctx *ctx, const char *str);\n\n/* V3 extension structure */\n\nstruct v3_ext_method {\n    int ext_nid;\n    int ext_flags;\n/* If this is set the following four fields are ignored */\n    ASN1_ITEM_EXP *it;\n/* Old style ASN1 calls */\n    X509V3_EXT_NEW ext_new;\n    X509V3_EXT_FREE ext_free;\n    X509V3_EXT_D2I d2i;\n    X509V3_EXT_I2D i2d;\n/* The following pair is used for string extensions */\n    X509V3_EXT_I2S i2s;\n    X509V3_EXT_S2I s2i;\n/* The following pair is used for multi-valued extensions */\n    X509V3_EXT_I2V i2v;\n    X509V3_EXT_V2I v2i;\n/* The following are used for raw extensions */\n    X509V3_EXT_I2R i2r;\n    X509V3_EXT_R2I r2i;\n    void *usr_data;             /* Any extension specific data */\n};\n\ntypedef struct X509V3_CONF_METHOD_st {\n    char *(*get_string) (void *db, char *section, char *value);\n    STACK_OF(CONF_VALUE) *(*get_section) (void *db, char *section);\n    void (*free_string) (void *db, char *string);\n    void (*free_section) (void *db, STACK_OF(CONF_VALUE) *section);\n} X509V3_CONF_METHOD;\n\n/* Context specific info */\nstruct v3_ext_ctx {\n# define CTX_TEST 0x1\n    int flags;\n    X509 *issuer_cert;\n    X509 *subject_cert;\n    X509_REQ *subject_req;\n    X509_CRL *crl;\n    X509V3_CONF_METHOD *db_meth;\n    void *db;\n/* Maybe more here */\n};\n\ntypedef struct v3_ext_method X509V3_EXT_METHOD;\n\nDECLARE_STACK_OF(X509V3_EXT_METHOD)\n\n/* ext_flags values */\n# define X509V3_EXT_DYNAMIC      0x1\n# define X509V3_EXT_CTX_DEP      0x2\n# define X509V3_EXT_MULTILINE    0x4\n\ntypedef BIT_STRING_BITNAME ENUMERATED_NAMES;\n\ntypedef struct BASIC_CONSTRAINTS_st {\n    int ca;\n    ASN1_INTEGER *pathlen;\n} BASIC_CONSTRAINTS;\n\ntypedef struct PKEY_USAGE_PERIOD_st {\n    ASN1_GENERALIZEDTIME *notBefore;\n    ASN1_GENERALIZEDTIME *notAfter;\n} PKEY_USAGE_PERIOD;\n\ntypedef struct otherName_st {\n    ASN1_OBJECT *type_id;\n    ASN1_TYPE *value;\n} OTHERNAME;\n\ntypedef struct EDIPartyName_st {\n    ASN1_STRING *nameAssigner;\n    ASN1_STRING *partyName;\n} EDIPARTYNAME;\n\ntypedef struct GENERAL_NAME_st {\n# define GEN_OTHERNAME   0\n# define GEN_EMAIL       1\n# define GEN_DNS         2\n# define GEN_X400        3\n# define GEN_DIRNAME     4\n# define GEN_EDIPARTY    5\n# define GEN_URI         6\n# define GEN_IPADD       7\n# define GEN_RID         8\n    int type;\n    union {\n        char *ptr;\n        OTHERNAME *otherName;   /* otherName */\n        ASN1_IA5STRING *rfc822Name;\n        ASN1_IA5STRING *dNSName;\n        ASN1_TYPE *x400Address;\n        X509_NAME *directoryName;\n        EDIPARTYNAME *ediPartyName;\n        ASN1_IA5STRING *uniformResourceIdentifier;\n        ASN1_OCTET_STRING *iPAddress;\n        ASN1_OBJECT *registeredID;\n        /* Old names */\n        ASN1_OCTET_STRING *ip;  /* iPAddress */\n        X509_NAME *dirn;        /* dirn */\n        ASN1_IA5STRING *ia5;    /* rfc822Name, dNSName,\n                                 * uniformResourceIdentifier */\n        ASN1_OBJECT *rid;       /* registeredID */\n        ASN1_TYPE *other;       /* x400Address */\n    } d;\n} GENERAL_NAME;\n\ntypedef STACK_OF(GENERAL_NAME) GENERAL_NAMES;\n\ntypedef struct ACCESS_DESCRIPTION_st {\n    ASN1_OBJECT *method;\n    GENERAL_NAME *location;\n} ACCESS_DESCRIPTION;\n\ntypedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS;\n\ntypedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE;\n\nDECLARE_STACK_OF(GENERAL_NAME)\nDECLARE_ASN1_SET_OF(GENERAL_NAME)\n\nDECLARE_STACK_OF(ACCESS_DESCRIPTION)\nDECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION)\n\ntypedef struct DIST_POINT_NAME_st {\n    int type;\n    union {\n        GENERAL_NAMES *fullname;\n        STACK_OF(X509_NAME_ENTRY) *relativename;\n    } name;\n/* If relativename then this contains the full distribution point name */\n    X509_NAME *dpname;\n} DIST_POINT_NAME;\n/* All existing reasons */\n# define CRLDP_ALL_REASONS       0x807f\n\n# define CRL_REASON_NONE                         -1\n# define CRL_REASON_UNSPECIFIED                  0\n# define CRL_REASON_KEY_COMPROMISE               1\n# define CRL_REASON_CA_COMPROMISE                2\n# define CRL_REASON_AFFILIATION_CHANGED          3\n# define CRL_REASON_SUPERSEDED                   4\n# define CRL_REASON_CESSATION_OF_OPERATION       5\n# define CRL_REASON_CERTIFICATE_HOLD             6\n# define CRL_REASON_REMOVE_FROM_CRL              8\n# define CRL_REASON_PRIVILEGE_WITHDRAWN          9\n# define CRL_REASON_AA_COMPROMISE                10\n\nstruct DIST_POINT_st {\n    DIST_POINT_NAME *distpoint;\n    ASN1_BIT_STRING *reasons;\n    GENERAL_NAMES *CRLissuer;\n    int dp_reasons;\n};\n\ntypedef STACK_OF(DIST_POINT) CRL_DIST_POINTS;\n\nDECLARE_STACK_OF(DIST_POINT)\nDECLARE_ASN1_SET_OF(DIST_POINT)\n\nstruct AUTHORITY_KEYID_st {\n    ASN1_OCTET_STRING *keyid;\n    GENERAL_NAMES *issuer;\n    ASN1_INTEGER *serial;\n};\n\n/* Strong extranet structures */\n\ntypedef struct SXNET_ID_st {\n    ASN1_INTEGER *zone;\n    ASN1_OCTET_STRING *user;\n} SXNETID;\n\nDECLARE_STACK_OF(SXNETID)\nDECLARE_ASN1_SET_OF(SXNETID)\n\ntypedef struct SXNET_st {\n    ASN1_INTEGER *version;\n    STACK_OF(SXNETID) *ids;\n} SXNET;\n\ntypedef struct NOTICEREF_st {\n    ASN1_STRING *organization;\n    STACK_OF(ASN1_INTEGER) *noticenos;\n} NOTICEREF;\n\ntypedef struct USERNOTICE_st {\n    NOTICEREF *noticeref;\n    ASN1_STRING *exptext;\n} USERNOTICE;\n\ntypedef struct POLICYQUALINFO_st {\n    ASN1_OBJECT *pqualid;\n    union {\n        ASN1_IA5STRING *cpsuri;\n        USERNOTICE *usernotice;\n        ASN1_TYPE *other;\n    } d;\n} POLICYQUALINFO;\n\nDECLARE_STACK_OF(POLICYQUALINFO)\nDECLARE_ASN1_SET_OF(POLICYQUALINFO)\n\ntypedef struct POLICYINFO_st {\n    ASN1_OBJECT *policyid;\n    STACK_OF(POLICYQUALINFO) *qualifiers;\n} POLICYINFO;\n\ntypedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES;\n\nDECLARE_STACK_OF(POLICYINFO)\nDECLARE_ASN1_SET_OF(POLICYINFO)\n\ntypedef struct POLICY_MAPPING_st {\n    ASN1_OBJECT *issuerDomainPolicy;\n    ASN1_OBJECT *subjectDomainPolicy;\n} POLICY_MAPPING;\n\nDECLARE_STACK_OF(POLICY_MAPPING)\n\ntypedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS;\n\ntypedef struct GENERAL_SUBTREE_st {\n    GENERAL_NAME *base;\n    ASN1_INTEGER *minimum;\n    ASN1_INTEGER *maximum;\n} GENERAL_SUBTREE;\n\nDECLARE_STACK_OF(GENERAL_SUBTREE)\n\nstruct NAME_CONSTRAINTS_st {\n    STACK_OF(GENERAL_SUBTREE) *permittedSubtrees;\n    STACK_OF(GENERAL_SUBTREE) *excludedSubtrees;\n};\n\ntypedef struct POLICY_CONSTRAINTS_st {\n    ASN1_INTEGER *requireExplicitPolicy;\n    ASN1_INTEGER *inhibitPolicyMapping;\n} POLICY_CONSTRAINTS;\n\n/* Proxy certificate structures, see RFC 3820 */\ntypedef struct PROXY_POLICY_st {\n    ASN1_OBJECT *policyLanguage;\n    ASN1_OCTET_STRING *policy;\n} PROXY_POLICY;\n\ntypedef struct PROXY_CERT_INFO_EXTENSION_st {\n    ASN1_INTEGER *pcPathLengthConstraint;\n    PROXY_POLICY *proxyPolicy;\n} PROXY_CERT_INFO_EXTENSION;\n\nDECLARE_ASN1_FUNCTIONS(PROXY_POLICY)\nDECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION)\n\nstruct ISSUING_DIST_POINT_st {\n    DIST_POINT_NAME *distpoint;\n    int onlyuser;\n    int onlyCA;\n    ASN1_BIT_STRING *onlysomereasons;\n    int indirectCRL;\n    int onlyattr;\n};\n\n/* Values in idp_flags field */\n/* IDP present */\n# define IDP_PRESENT     0x1\n/* IDP values inconsistent */\n# define IDP_INVALID     0x2\n/* onlyuser true */\n# define IDP_ONLYUSER    0x4\n/* onlyCA true */\n# define IDP_ONLYCA      0x8\n/* onlyattr true */\n# define IDP_ONLYATTR    0x10\n/* indirectCRL true */\n# define IDP_INDIRECT    0x20\n/* onlysomereasons present */\n# define IDP_REASONS     0x40\n\n# define X509V3_conf_err(val) ERR_add_error_data(6, \"section:\", val->section, \\\n\",name:\", val->name, \",value:\", val->value);\n\n# define X509V3_set_ctx_test(ctx) \\\n                        X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST)\n# define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL;\n\n# define EXT_BITSTRING(nid, table) { nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \\\n                        0,0,0,0, \\\n                        0,0, \\\n                        (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \\\n                        (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \\\n                        NULL, NULL, \\\n                        table}\n\n# define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \\\n                        0,0,0,0, \\\n                        (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \\\n                        (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \\\n                        0,0,0,0, \\\n                        NULL}\n\n# define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}\n\n/* X509_PURPOSE stuff */\n\n# define EXFLAG_BCONS            0x1\n# define EXFLAG_KUSAGE           0x2\n# define EXFLAG_XKUSAGE          0x4\n# define EXFLAG_NSCERT           0x8\n\n# define EXFLAG_CA               0x10\n/* Really self issued not necessarily self signed */\n# define EXFLAG_SI               0x20\n# define EXFLAG_V1               0x40\n# define EXFLAG_INVALID          0x80\n# define EXFLAG_SET              0x100\n# define EXFLAG_CRITICAL         0x200\n# define EXFLAG_PROXY            0x400\n\n# define EXFLAG_INVALID_POLICY   0x800\n# define EXFLAG_FRESHEST         0x1000\n/* Self signed */\n# define EXFLAG_SS               0x2000\n\n# define KU_DIGITAL_SIGNATURE    0x0080\n# define KU_NON_REPUDIATION      0x0040\n# define KU_KEY_ENCIPHERMENT     0x0020\n# define KU_DATA_ENCIPHERMENT    0x0010\n# define KU_KEY_AGREEMENT        0x0008\n# define KU_KEY_CERT_SIGN        0x0004\n# define KU_CRL_SIGN             0x0002\n# define KU_ENCIPHER_ONLY        0x0001\n# define KU_DECIPHER_ONLY        0x8000\n\n# define NS_SSL_CLIENT           0x80\n# define NS_SSL_SERVER           0x40\n# define NS_SMIME                0x20\n# define NS_OBJSIGN              0x10\n# define NS_SSL_CA               0x04\n# define NS_SMIME_CA             0x02\n# define NS_OBJSIGN_CA           0x01\n# define NS_ANY_CA               (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA)\n\n# define XKU_SSL_SERVER          0x1\n# define XKU_SSL_CLIENT          0x2\n# define XKU_SMIME               0x4\n# define XKU_CODE_SIGN           0x8\n# define XKU_SGC                 0x10\n# define XKU_OCSP_SIGN           0x20\n# define XKU_TIMESTAMP           0x40\n# define XKU_DVCS                0x80\n# define XKU_ANYEKU              0x100\n\n# define X509_PURPOSE_DYNAMIC    0x1\n# define X509_PURPOSE_DYNAMIC_NAME       0x2\n\ntypedef struct x509_purpose_st {\n    int purpose;\n    int trust;                  /* Default trust ID */\n    int flags;\n    int (*check_purpose) (const struct x509_purpose_st *, const X509 *, int);\n    char *name;\n    char *sname;\n    void *usr_data;\n} X509_PURPOSE;\n\n# define X509_PURPOSE_SSL_CLIENT         1\n# define X509_PURPOSE_SSL_SERVER         2\n# define X509_PURPOSE_NS_SSL_SERVER      3\n# define X509_PURPOSE_SMIME_SIGN         4\n# define X509_PURPOSE_SMIME_ENCRYPT      5\n# define X509_PURPOSE_CRL_SIGN           6\n# define X509_PURPOSE_ANY                7\n# define X509_PURPOSE_OCSP_HELPER        8\n# define X509_PURPOSE_TIMESTAMP_SIGN     9\n\n# define X509_PURPOSE_MIN                1\n# define X509_PURPOSE_MAX                9\n\n/* Flags for X509V3_EXT_print() */\n\n# define X509V3_EXT_UNKNOWN_MASK         (0xfL << 16)\n/* Return error for unknown extensions */\n# define X509V3_EXT_DEFAULT              0\n/* Print error for unknown extensions */\n# define X509V3_EXT_ERROR_UNKNOWN        (1L << 16)\n/* ASN1 parse unknown extensions */\n# define X509V3_EXT_PARSE_UNKNOWN        (2L << 16)\n/* BIO_dump unknown extensions */\n# define X509V3_EXT_DUMP_UNKNOWN         (3L << 16)\n\n/* Flags for X509V3_add1_i2d */\n\n# define X509V3_ADD_OP_MASK              0xfL\n# define X509V3_ADD_DEFAULT              0L\n# define X509V3_ADD_APPEND               1L\n# define X509V3_ADD_REPLACE              2L\n# define X509V3_ADD_REPLACE_EXISTING     3L\n# define X509V3_ADD_KEEP_EXISTING        4L\n# define X509V3_ADD_DELETE               5L\n# define X509V3_ADD_SILENT               0x10\n\nDECLARE_STACK_OF(X509_PURPOSE)\n\nDECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS)\n\nDECLARE_ASN1_FUNCTIONS(SXNET)\nDECLARE_ASN1_FUNCTIONS(SXNETID)\n\nint SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen);\nint SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user,\n                       int userlen);\nint SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user,\n                         int userlen);\n\nASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone);\nASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone);\nASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone);\n\nDECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID)\n\nDECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD)\n\nDECLARE_ASN1_FUNCTIONS(GENERAL_NAME)\nGENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a);\nint GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b);\n\nASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,\n                                     X509V3_CTX *ctx,\n                                     STACK_OF(CONF_VALUE) *nval);\nSTACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method,\n                                          ASN1_BIT_STRING *bits,\n                                          STACK_OF(CONF_VALUE) *extlist);\n\nSTACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method,\n                                       GENERAL_NAME *gen,\n                                       STACK_OF(CONF_VALUE) *ret);\nint GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen);\n\nDECLARE_ASN1_FUNCTIONS(GENERAL_NAMES)\n\nSTACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method,\n                                        GENERAL_NAMES *gen,\n                                        STACK_OF(CONF_VALUE) *extlist);\nGENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method,\n                                 X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval);\n\nDECLARE_ASN1_FUNCTIONS(OTHERNAME)\nDECLARE_ASN1_FUNCTIONS(EDIPARTYNAME)\nint OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b);\nvoid GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value);\nvoid *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype);\nint GENERAL_NAME_set0_othername(GENERAL_NAME *gen,\n                                ASN1_OBJECT *oid, ASN1_TYPE *value);\nint GENERAL_NAME_get0_otherName(GENERAL_NAME *gen,\n                                ASN1_OBJECT **poid, ASN1_TYPE **pvalue);\n\nchar *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,\n                            ASN1_OCTET_STRING *ia5);\nASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,\n                                         X509V3_CTX *ctx, char *str);\n\nDECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE)\nint i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION *a);\n\nDECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES)\nDECLARE_ASN1_FUNCTIONS(POLICYINFO)\nDECLARE_ASN1_FUNCTIONS(POLICYQUALINFO)\nDECLARE_ASN1_FUNCTIONS(USERNOTICE)\nDECLARE_ASN1_FUNCTIONS(NOTICEREF)\n\nDECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS)\nDECLARE_ASN1_FUNCTIONS(DIST_POINT)\nDECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME)\nDECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT)\n\nint DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname);\n\nint NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc);\n\nDECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION)\nDECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS)\n\nDECLARE_ASN1_ITEM(POLICY_MAPPING)\nDECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING)\nDECLARE_ASN1_ITEM(POLICY_MAPPINGS)\n\nDECLARE_ASN1_ITEM(GENERAL_SUBTREE)\nDECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE)\n\nDECLARE_ASN1_ITEM(NAME_CONSTRAINTS)\nDECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS)\n\nDECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS)\nDECLARE_ASN1_ITEM(POLICY_CONSTRAINTS)\n\nGENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out,\n                               const X509V3_EXT_METHOD *method,\n                               X509V3_CTX *ctx, int gen_type, char *value,\n                               int is_nc);\n\n# ifdef HEADER_CONF_H\nGENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method,\n                               X509V3_CTX *ctx, CONF_VALUE *cnf);\nGENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out,\n                                  const X509V3_EXT_METHOD *method,\n                                  X509V3_CTX *ctx, CONF_VALUE *cnf,\n                                  int is_nc);\nvoid X509V3_conf_free(CONF_VALUE *val);\n\nX509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid,\n                                     char *value);\nX509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name,\n                                 char *value);\nint X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section,\n                            STACK_OF(X509_EXTENSION) **sk);\nint X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,\n                         X509 *cert);\nint X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,\n                             X509_REQ *req);\nint X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section,\n                             X509_CRL *crl);\n\nX509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf,\n                                    X509V3_CTX *ctx, int ext_nid,\n                                    char *value);\nX509_EXTENSION *X509V3_EXT_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,\n                                char *name, char *value);\nint X509V3_EXT_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,\n                        char *section, X509 *cert);\nint X509V3_EXT_REQ_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,\n                            char *section, X509_REQ *req);\nint X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx,\n                            char *section, X509_CRL *crl);\n\nint X509V3_add_value_bool_nf(char *name, int asn1_bool,\n                             STACK_OF(CONF_VALUE) **extlist);\nint X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool);\nint X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint);\nvoid X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf);\nvoid X509V3_set_conf_lhash(X509V3_CTX *ctx, LHASH_OF(CONF_VALUE) *lhash);\n# endif\n\nchar *X509V3_get_string(X509V3_CTX *ctx, char *name, char *section);\nSTACK_OF(CONF_VALUE) *X509V3_get_section(X509V3_CTX *ctx, char *section);\nvoid X509V3_string_free(X509V3_CTX *ctx, char *str);\nvoid X509V3_section_free(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section);\nvoid X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject,\n                    X509_REQ *req, X509_CRL *crl, int flags);\n\nint X509V3_add_value(const char *name, const char *value,\n                     STACK_OF(CONF_VALUE) **extlist);\nint X509V3_add_value_uchar(const char *name, const unsigned char *value,\n                           STACK_OF(CONF_VALUE) **extlist);\nint X509V3_add_value_bool(const char *name, int asn1_bool,\n                          STACK_OF(CONF_VALUE) **extlist);\nint X509V3_add_value_int(const char *name, ASN1_INTEGER *aint,\n                         STACK_OF(CONF_VALUE) **extlist);\nchar *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint);\nASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value);\nchar *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint);\nchar *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth,\n                                ASN1_ENUMERATED *aint);\nint X509V3_EXT_add(X509V3_EXT_METHOD *ext);\nint X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist);\nint X509V3_EXT_add_alias(int nid_to, int nid_from);\nvoid X509V3_EXT_cleanup(void);\n\nconst X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext);\nconst X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid);\nint X509V3_add_standard_extensions(void);\nSTACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line);\nvoid *X509V3_EXT_d2i(X509_EXTENSION *ext);\nvoid *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit,\n                     int *idx);\nint X509V3_EXT_free(int nid, void *ext_data);\n\nX509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc);\nint X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value,\n                    int crit, unsigned long flags);\n\nchar *hex_to_string(const unsigned char *buffer, long len);\nunsigned char *string_to_hex(const char *str, long *len);\nint name_cmp(const char *name, const char *cmp);\n\nvoid X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent,\n                        int ml);\nint X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag,\n                     int indent);\nint X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent);\n\nint X509V3_extensions_print(BIO *out, char *title,\n                            STACK_OF(X509_EXTENSION) *exts,\n                            unsigned long flag, int indent);\n\nint X509_check_ca(X509 *x);\nint X509_check_purpose(X509 *x, int id, int ca);\nint X509_supported_extension(X509_EXTENSION *ex);\nint X509_PURPOSE_set(int *p, int purpose);\nint X509_check_issued(X509 *issuer, X509 *subject);\nint X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid);\nint X509_PURPOSE_get_count(void);\nX509_PURPOSE *X509_PURPOSE_get0(int idx);\nint X509_PURPOSE_get_by_sname(char *sname);\nint X509_PURPOSE_get_by_id(int id);\nint X509_PURPOSE_add(int id, int trust, int flags,\n                     int (*ck) (const X509_PURPOSE *, const X509 *, int),\n                     char *name, char *sname, void *arg);\nchar *X509_PURPOSE_get0_name(X509_PURPOSE *xp);\nchar *X509_PURPOSE_get0_sname(X509_PURPOSE *xp);\nint X509_PURPOSE_get_trust(X509_PURPOSE *xp);\nvoid X509_PURPOSE_cleanup(void);\nint X509_PURPOSE_get_id(X509_PURPOSE *);\n\nSTACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x);\nSTACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x);\nvoid X509_email_free(STACK_OF(OPENSSL_STRING) *sk);\nSTACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x);\n/* Flags for X509_check_* functions */\n\n/*\n * Always check subject name for host match even if subject alt names present\n */\n# define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT    0x1\n/* Disable wildcard matching for dnsName fields and common name. */\n# define X509_CHECK_FLAG_NO_WILDCARDS    0x2\n/* Wildcards must not match a partial label. */\n# define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS 0x4\n/* Allow (non-partial) wildcards to match multiple labels. */\n# define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0x8\n/* Constraint verifier subdomain patterns to match a single labels. */\n# define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0x10\n/*\n * Match reference identifiers starting with \".\" to any sub-domain.\n * This is a non-public flag, turned on implicitly when the subject\n * reference identity is a DNS name.\n */\n# define _X509_CHECK_FLAG_DOT_SUBDOMAINS 0x8000\n\nint X509_check_host(X509 *x, const char *chk, size_t chklen,\n                    unsigned int flags, char **peername);\nint X509_check_email(X509 *x, const char *chk, size_t chklen,\n                     unsigned int flags);\nint X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen,\n                  unsigned int flags);\nint X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags);\n\nASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc);\nASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc);\nint a2i_ipadd(unsigned char *ipout, const char *ipasc);\nint X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk,\n                             unsigned long chtype);\n\nvoid X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent);\nDECLARE_STACK_OF(X509_POLICY_NODE)\n\n# ifndef OPENSSL_NO_RFC3779\n\ntypedef struct ASRange_st {\n    ASN1_INTEGER *min, *max;\n} ASRange;\n\n#  define ASIdOrRange_id          0\n#  define ASIdOrRange_range       1\n\ntypedef struct ASIdOrRange_st {\n    int type;\n    union {\n        ASN1_INTEGER *id;\n        ASRange *range;\n    } u;\n} ASIdOrRange;\n\ntypedef STACK_OF(ASIdOrRange) ASIdOrRanges;\nDECLARE_STACK_OF(ASIdOrRange)\n\n#  define ASIdentifierChoice_inherit              0\n#  define ASIdentifierChoice_asIdsOrRanges        1\n\ntypedef struct ASIdentifierChoice_st {\n    int type;\n    union {\n        ASN1_NULL *inherit;\n        ASIdOrRanges *asIdsOrRanges;\n    } u;\n} ASIdentifierChoice;\n\ntypedef struct ASIdentifiers_st {\n    ASIdentifierChoice *asnum, *rdi;\n} ASIdentifiers;\n\nDECLARE_ASN1_FUNCTIONS(ASRange)\nDECLARE_ASN1_FUNCTIONS(ASIdOrRange)\nDECLARE_ASN1_FUNCTIONS(ASIdentifierChoice)\nDECLARE_ASN1_FUNCTIONS(ASIdentifiers)\n\ntypedef struct IPAddressRange_st {\n    ASN1_BIT_STRING *min, *max;\n} IPAddressRange;\n\n#  define IPAddressOrRange_addressPrefix  0\n#  define IPAddressOrRange_addressRange   1\n\ntypedef struct IPAddressOrRange_st {\n    int type;\n    union {\n        ASN1_BIT_STRING *addressPrefix;\n        IPAddressRange *addressRange;\n    } u;\n} IPAddressOrRange;\n\ntypedef STACK_OF(IPAddressOrRange) IPAddressOrRanges;\nDECLARE_STACK_OF(IPAddressOrRange)\n\n#  define IPAddressChoice_inherit                 0\n#  define IPAddressChoice_addressesOrRanges       1\n\ntypedef struct IPAddressChoice_st {\n    int type;\n    union {\n        ASN1_NULL *inherit;\n        IPAddressOrRanges *addressesOrRanges;\n    } u;\n} IPAddressChoice;\n\ntypedef struct IPAddressFamily_st {\n    ASN1_OCTET_STRING *addressFamily;\n    IPAddressChoice *ipAddressChoice;\n} IPAddressFamily;\n\ntypedef STACK_OF(IPAddressFamily) IPAddrBlocks;\nDECLARE_STACK_OF(IPAddressFamily)\n\nDECLARE_ASN1_FUNCTIONS(IPAddressRange)\nDECLARE_ASN1_FUNCTIONS(IPAddressOrRange)\nDECLARE_ASN1_FUNCTIONS(IPAddressChoice)\nDECLARE_ASN1_FUNCTIONS(IPAddressFamily)\n\n/*\n * API tag for elements of the ASIdentifer SEQUENCE.\n */\n#  define V3_ASID_ASNUM   0\n#  define V3_ASID_RDI     1\n\n/*\n * AFI values, assigned by IANA.  It'd be nice to make the AFI\n * handling code totally generic, but there are too many little things\n * that would need to be defined for other address families for it to\n * be worth the trouble.\n */\n#  define IANA_AFI_IPV4   1\n#  define IANA_AFI_IPV6   2\n\n/*\n * Utilities to construct and extract values from RFC3779 extensions,\n * since some of the encodings (particularly for IP address prefixes\n * and ranges) are a bit tedious to work with directly.\n */\nint v3_asid_add_inherit(ASIdentifiers *asid, int which);\nint v3_asid_add_id_or_range(ASIdentifiers *asid, int which,\n                            ASN1_INTEGER *min, ASN1_INTEGER *max);\nint v3_addr_add_inherit(IPAddrBlocks *addr,\n                        const unsigned afi, const unsigned *safi);\nint v3_addr_add_prefix(IPAddrBlocks *addr,\n                       const unsigned afi, const unsigned *safi,\n                       unsigned char *a, const int prefixlen);\nint v3_addr_add_range(IPAddrBlocks *addr,\n                      const unsigned afi, const unsigned *safi,\n                      unsigned char *min, unsigned char *max);\nunsigned v3_addr_get_afi(const IPAddressFamily *f);\nint v3_addr_get_range(IPAddressOrRange *aor, const unsigned afi,\n                      unsigned char *min, unsigned char *max,\n                      const int length);\n\n/*\n * Canonical forms.\n */\nint v3_asid_is_canonical(ASIdentifiers *asid);\nint v3_addr_is_canonical(IPAddrBlocks *addr);\nint v3_asid_canonize(ASIdentifiers *asid);\nint v3_addr_canonize(IPAddrBlocks *addr);\n\n/*\n * Tests for inheritance and containment.\n */\nint v3_asid_inherits(ASIdentifiers *asid);\nint v3_addr_inherits(IPAddrBlocks *addr);\nint v3_asid_subset(ASIdentifiers *a, ASIdentifiers *b);\nint v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b);\n\n/*\n * Check whether RFC 3779 extensions nest properly in chains.\n */\nint v3_asid_validate_path(X509_STORE_CTX *);\nint v3_addr_validate_path(X509_STORE_CTX *);\nint v3_asid_validate_resource_set(STACK_OF(X509) *chain,\n                                  ASIdentifiers *ext, int allow_inheritance);\nint v3_addr_validate_resource_set(STACK_OF(X509) *chain,\n                                  IPAddrBlocks *ext, int allow_inheritance);\n\n# endif                         /* OPENSSL_NO_RFC3779 */\n\n/* BEGIN ERROR CODES */\n/*\n * The following lines are auto generated by the script mkerr.pl. Any changes\n * made after this point may be overwritten when the script is next run.\n */\nvoid ERR_load_X509V3_strings(void);\n\n/* Error codes for the X509V3 functions. */\n\n/* Function codes. */\n# define X509V3_F_A2I_GENERAL_NAME                        164\n# define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE             161\n# define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL         162\n# define X509V3_F_COPY_EMAIL                              122\n# define X509V3_F_COPY_ISSUER                             123\n# define X509V3_F_DO_DIRNAME                              144\n# define X509V3_F_DO_EXT_CONF                             124\n# define X509V3_F_DO_EXT_I2D                              135\n# define X509V3_F_DO_EXT_NCONF                            151\n# define X509V3_F_DO_I2V_NAME_CONSTRAINTS                 148\n# define X509V3_F_GNAMES_FROM_SECTNAME                    156\n# define X509V3_F_HEX_TO_STRING                           111\n# define X509V3_F_I2S_ASN1_ENUMERATED                     121\n# define X509V3_F_I2S_ASN1_IA5STRING                      149\n# define X509V3_F_I2S_ASN1_INTEGER                        120\n# define X509V3_F_I2V_AUTHORITY_INFO_ACCESS               138\n# define X509V3_F_NOTICE_SECTION                          132\n# define X509V3_F_NREF_NOS                                133\n# define X509V3_F_POLICY_SECTION                          131\n# define X509V3_F_PROCESS_PCI_VALUE                       150\n# define X509V3_F_R2I_CERTPOL                             130\n# define X509V3_F_R2I_PCI                                 155\n# define X509V3_F_S2I_ASN1_IA5STRING                      100\n# define X509V3_F_S2I_ASN1_INTEGER                        108\n# define X509V3_F_S2I_ASN1_OCTET_STRING                   112\n# define X509V3_F_S2I_ASN1_SKEY_ID                        114\n# define X509V3_F_S2I_SKEY_ID                             115\n# define X509V3_F_SET_DIST_POINT_NAME                     158\n# define X509V3_F_STRING_TO_HEX                           113\n# define X509V3_F_SXNET_ADD_ID_ASC                        125\n# define X509V3_F_SXNET_ADD_ID_INTEGER                    126\n# define X509V3_F_SXNET_ADD_ID_ULONG                      127\n# define X509V3_F_SXNET_GET_ID_ASC                        128\n# define X509V3_F_SXNET_GET_ID_ULONG                      129\n# define X509V3_F_V2I_ASIDENTIFIERS                       163\n# define X509V3_F_V2I_ASN1_BIT_STRING                     101\n# define X509V3_F_V2I_AUTHORITY_INFO_ACCESS               139\n# define X509V3_F_V2I_AUTHORITY_KEYID                     119\n# define X509V3_F_V2I_BASIC_CONSTRAINTS                   102\n# define X509V3_F_V2I_CRLD                                134\n# define X509V3_F_V2I_EXTENDED_KEY_USAGE                  103\n# define X509V3_F_V2I_GENERAL_NAMES                       118\n# define X509V3_F_V2I_GENERAL_NAME_EX                     117\n# define X509V3_F_V2I_IDP                                 157\n# define X509V3_F_V2I_IPADDRBLOCKS                        159\n# define X509V3_F_V2I_ISSUER_ALT                          153\n# define X509V3_F_V2I_NAME_CONSTRAINTS                    147\n# define X509V3_F_V2I_POLICY_CONSTRAINTS                  146\n# define X509V3_F_V2I_POLICY_MAPPINGS                     145\n# define X509V3_F_V2I_SUBJECT_ALT                         154\n# define X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL          160\n# define X509V3_F_V3_GENERIC_EXTENSION                    116\n# define X509V3_F_X509V3_ADD1_I2D                         140\n# define X509V3_F_X509V3_ADD_VALUE                        105\n# define X509V3_F_X509V3_EXT_ADD                          104\n# define X509V3_F_X509V3_EXT_ADD_ALIAS                    106\n# define X509V3_F_X509V3_EXT_CONF                         107\n# define X509V3_F_X509V3_EXT_FREE                         165\n# define X509V3_F_X509V3_EXT_I2D                          136\n# define X509V3_F_X509V3_EXT_NCONF                        152\n# define X509V3_F_X509V3_GET_SECTION                      142\n# define X509V3_F_X509V3_GET_STRING                       143\n# define X509V3_F_X509V3_GET_VALUE_BOOL                   110\n# define X509V3_F_X509V3_PARSE_LIST                       109\n# define X509V3_F_X509_PURPOSE_ADD                        137\n# define X509V3_F_X509_PURPOSE_SET                        141\n\n/* Reason codes. */\n# define X509V3_R_BAD_IP_ADDRESS                          118\n# define X509V3_R_BAD_OBJECT                              119\n# define X509V3_R_BN_DEC2BN_ERROR                         100\n# define X509V3_R_BN_TO_ASN1_INTEGER_ERROR                101\n# define X509V3_R_CANNOT_FIND_FREE_FUNCTION               168\n# define X509V3_R_DIRNAME_ERROR                           149\n# define X509V3_R_DISTPOINT_ALREADY_SET                   160\n# define X509V3_R_DUPLICATE_ZONE_ID                       133\n# define X509V3_R_ERROR_CONVERTING_ZONE                   131\n# define X509V3_R_ERROR_CREATING_EXTENSION                144\n# define X509V3_R_ERROR_IN_EXTENSION                      128\n# define X509V3_R_EXPECTED_A_SECTION_NAME                 137\n# define X509V3_R_EXTENSION_EXISTS                        145\n# define X509V3_R_EXTENSION_NAME_ERROR                    115\n# define X509V3_R_EXTENSION_NOT_FOUND                     102\n# define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED         103\n# define X509V3_R_EXTENSION_VALUE_ERROR                   116\n# define X509V3_R_ILLEGAL_EMPTY_EXTENSION                 151\n# define X509V3_R_ILLEGAL_HEX_DIGIT                       113\n# define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG             152\n# define X509V3_R_INVALID_ASNUMBER                        162\n# define X509V3_R_INVALID_ASRANGE                         163\n# define X509V3_R_INVALID_BOOLEAN_STRING                  104\n# define X509V3_R_INVALID_EXTENSION_STRING                105\n# define X509V3_R_INVALID_INHERITANCE                     165\n# define X509V3_R_INVALID_IPADDRESS                       166\n# define X509V3_R_INVALID_MULTIPLE_RDNS                   161\n# define X509V3_R_INVALID_NAME                            106\n# define X509V3_R_INVALID_NULL_ARGUMENT                   107\n# define X509V3_R_INVALID_NULL_NAME                       108\n# define X509V3_R_INVALID_NULL_VALUE                      109\n# define X509V3_R_INVALID_NUMBER                          140\n# define X509V3_R_INVALID_NUMBERS                         141\n# define X509V3_R_INVALID_OBJECT_IDENTIFIER               110\n# define X509V3_R_INVALID_OPTION                          138\n# define X509V3_R_INVALID_POLICY_IDENTIFIER               134\n# define X509V3_R_INVALID_PROXY_POLICY_SETTING            153\n# define X509V3_R_INVALID_PURPOSE                         146\n# define X509V3_R_INVALID_SAFI                            164\n# define X509V3_R_INVALID_SECTION                         135\n# define X509V3_R_INVALID_SYNTAX                          143\n# define X509V3_R_ISSUER_DECODE_ERROR                     126\n# define X509V3_R_MISSING_VALUE                           124\n# define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS           142\n# define X509V3_R_NO_CONFIG_DATABASE                      136\n# define X509V3_R_NO_ISSUER_CERTIFICATE                   121\n# define X509V3_R_NO_ISSUER_DETAILS                       127\n# define X509V3_R_NO_POLICY_IDENTIFIER                    139\n# define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED   154\n# define X509V3_R_NO_PUBLIC_KEY                           114\n# define X509V3_R_NO_SUBJECT_DETAILS                      125\n# define X509V3_R_ODD_NUMBER_OF_DIGITS                    112\n# define X509V3_R_OPERATION_NOT_DEFINED                   148\n# define X509V3_R_OTHERNAME_ERROR                         147\n# define X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED         155\n# define X509V3_R_POLICY_PATH_LENGTH                      156\n# define X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED      157\n# define X509V3_R_POLICY_SYNTAX_NOT_CURRENTLY_SUPPORTED   158\n# define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 159\n# define X509V3_R_SECTION_NOT_FOUND                       150\n# define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS            122\n# define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID              123\n# define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT             111\n# define X509V3_R_UNKNOWN_EXTENSION                       129\n# define X509V3_R_UNKNOWN_EXTENSION_NAME                  130\n# define X509V3_R_UNKNOWN_OPTION                          120\n# define X509V3_R_UNSUPPORTED_OPTION                      117\n# define X509V3_R_UNSUPPORTED_TYPE                        167\n# define X509V3_R_USER_TOO_LONG                           132\n\n#ifdef  __cplusplus\n}\n#endif\n#endif\n"
  }
]