Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
4b7215036b | |||
e65fadfba6 | |||
fd407094a2 | |||
76e12d7093 | |||
2a9219ce7e | |||
cacc2c3a5b | |||
ceda771700 | |||
c6ad04e6ee | |||
9671407556 | |||
c35dab8350 | |||
c772d7b60e | |||
e1b61b5041 | |||
db95855ab6 | |||
5dce94a4a3 | |||
7adad67dd9 | |||
5275ab73ac | |||
a50d28e9a2 | |||
57238020a3 |
82
.drone.yml
82
.drone.yml
|
@ -25,8 +25,8 @@ steps:
|
||||||
MASTODON_CPP_ACCESS_TOKEN:
|
MASTODON_CPP_ACCESS_TOKEN:
|
||||||
from_secret: mastodon_cpp_access_token
|
from_secret: mastodon_cpp_access_token
|
||||||
commands:
|
commands:
|
||||||
- rm /etc/apt/apt.conf.d/docker-clean
|
- rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
- rm /var/cache/apt/archives/lock
|
- rm -f /var/cache/apt/archives/lock
|
||||||
- apt-get update -q
|
- apt-get update -q
|
||||||
- apt-get install -qy build-essential cmake
|
- apt-get install -qy build-essential cmake
|
||||||
- apt-get install -qy libpoco-dev libjsoncpp-dev doxygen catch
|
- apt-get install -qy libpoco-dev libjsoncpp-dev doxygen catch
|
||||||
|
@ -48,8 +48,8 @@ steps:
|
||||||
MASTODON_CPP_ACCESS_TOKEN:
|
MASTODON_CPP_ACCESS_TOKEN:
|
||||||
from_secret: mastodon_cpp_access_token
|
from_secret: mastodon_cpp_access_token
|
||||||
commands:
|
commands:
|
||||||
- rm /etc/apt/apt.conf.d/docker-clean
|
- rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
- rm /var/cache/apt/archives/lock
|
- rm -f /var/cache/apt/archives/lock
|
||||||
- apt-get update -q
|
- apt-get update -q
|
||||||
- echo "APT::Default-Release \"stretch\";" >> /etc/apt/apt.conf.d/00default_release
|
- echo "APT::Default-Release \"stretch\";" >> /etc/apt/apt.conf.d/00default_release
|
||||||
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main" >> /etc/apt/sources.list.d/ubuntu-toolchain-r.list
|
- echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main" >> /etc/apt/sources.list.d/ubuntu-toolchain-r.list
|
||||||
|
@ -77,8 +77,8 @@ steps:
|
||||||
MASTODON_CPP_ACCESS_TOKEN:
|
MASTODON_CPP_ACCESS_TOKEN:
|
||||||
from_secret: mastodon_cpp_access_token
|
from_secret: mastodon_cpp_access_token
|
||||||
commands:
|
commands:
|
||||||
- rm /etc/apt/apt.conf.d/docker-clean
|
- rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
- rm /var/cache/apt/archives/lock
|
- rm -f /var/cache/apt/archives/lock
|
||||||
- apt-get update -q
|
- apt-get update -q
|
||||||
- echo "APT::Default-Release \"stretch\";" >> /etc/apt/apt.conf.d/00default_release
|
- echo "APT::Default-Release \"stretch\";" >> /etc/apt/apt.conf.d/00default_release
|
||||||
- echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/stretch.list
|
- echo "deb http://deb.debian.org/debian stretch-backports main" >> /etc/apt/sources.list.d/stretch.list
|
||||||
|
@ -104,8 +104,8 @@ steps:
|
||||||
MASTODON_CPP_ACCESS_TOKEN:
|
MASTODON_CPP_ACCESS_TOKEN:
|
||||||
from_secret: mastodon_cpp_access_token
|
from_secret: mastodon_cpp_access_token
|
||||||
commands:
|
commands:
|
||||||
- rm /etc/apt/apt.conf.d/docker-clean
|
- rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
- rm /var/cache/apt/archives/lock
|
- rm -f /var/cache/apt/archives/lock
|
||||||
- apt-get update -q
|
- apt-get update -q
|
||||||
- apt-get update -q
|
- apt-get update -q
|
||||||
- apt-get install -qy build-essential cmake clang
|
- apt-get install -qy build-essential cmake clang
|
||||||
|
@ -153,34 +153,73 @@ trigger:
|
||||||
- tag
|
- tag
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: deb
|
- name: Debian stretch
|
||||||
image: debian:stretch-slim
|
image: debian:stretch-slim
|
||||||
pull: always
|
pull: always
|
||||||
environment:
|
environment:
|
||||||
CXXFLAGS: -pipe -O2
|
CXXFLAGS: -pipe -O2
|
||||||
|
LANG: C.utf8
|
||||||
commands:
|
commands:
|
||||||
- rm /etc/apt/apt.conf.d/docker-clean
|
- rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
- rm /var/cache/apt/archives/lock
|
- rm -f /var/cache/apt/archives/lock
|
||||||
- apt-get update -q
|
- apt-get update -q
|
||||||
- apt-get install -qy build-essential cmake
|
- apt-get install -qy build-essential cmake lsb-release
|
||||||
- apt-get install -qy libpoco-dev libjsoncpp-dev doxygen file
|
- apt-get install -qy libpoco-dev libjsoncpp-dev file
|
||||||
- rm -rf build && mkdir -p build && cd build
|
- rm -rf build && mkdir -p build && cd build
|
||||||
- cmake -DWITH_DOC=NO ..
|
|
||||||
- make package
|
|
||||||
- cmake -DWITH_DEB=YES -DWITH_DOC=NO ..
|
- cmake -DWITH_DEB=YES -DWITH_DOC=NO ..
|
||||||
- make package
|
- make package
|
||||||
- cp -v mastodon-cpp-${DRONE_TAG}_x86_64.tar.gz ..
|
- cp -v libmastodon-cpp_${DRONE_TAG}-0_stretch_amd64.deb ..
|
||||||
- cp -v libmastodon-cpp_${DRONE_TAG}-0_amd64.deb ..
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: debian-package-cache
|
- name: debian-package-cache
|
||||||
path: /var/cache/apt/archives
|
path: /var/cache/apt/archives
|
||||||
|
|
||||||
- name: rpm
|
- name: Debian buster
|
||||||
|
image: debian:buster-slim
|
||||||
|
pull: always
|
||||||
|
environment:
|
||||||
|
CXXFLAGS: -pipe -O2
|
||||||
|
LANG: C.utf8
|
||||||
|
commands:
|
||||||
|
- rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
|
- rm -f /var/cache/apt/archives/lock
|
||||||
|
- apt-get update -q
|
||||||
|
- apt-get install -qy build-essential cmake lsb-release
|
||||||
|
- apt-get install -qy libpoco-dev libjsoncpp-dev file
|
||||||
|
- rm -rf build && mkdir -p build && cd build
|
||||||
|
- cmake -DWITH_DEB=YES -DWITH_DOC=NO ..
|
||||||
|
- make package
|
||||||
|
- cp -v libmastodon-cpp_${DRONE_TAG}-0_buster_amd64.deb ..
|
||||||
|
volumes:
|
||||||
|
- name: debian-package-cache
|
||||||
|
path: /var/cache/apt/archives
|
||||||
|
|
||||||
|
- name: Ubuntu bionic
|
||||||
|
image: ubuntu:bionic
|
||||||
|
pull: always
|
||||||
|
environment:
|
||||||
|
CXXFLAGS: -pipe -O2
|
||||||
|
LANG: C.utf8
|
||||||
|
commands:
|
||||||
|
- rm -f /etc/apt/apt.conf.d/docker-clean
|
||||||
|
- rm -f /var/cache/apt/archives/lock
|
||||||
|
- apt-get update -q
|
||||||
|
- apt-get install -qy build-essential cmake lsb-release
|
||||||
|
- apt-get install -qy libpoco-dev libjsoncpp-dev file
|
||||||
|
- rm -rf build && mkdir -p build && cd build
|
||||||
|
- cmake -DWITH_DEB=YES -DWITH_DOC=NO ..
|
||||||
|
- make package
|
||||||
|
- cp -v libmastodon-cpp_${DRONE_TAG}-0_bionic_amd64.deb ..
|
||||||
|
volumes:
|
||||||
|
- name: debian-package-cache
|
||||||
|
path: /var/cache/apt/archives
|
||||||
|
|
||||||
|
- name: CentOS 7
|
||||||
image: centos:7
|
image: centos:7
|
||||||
pull: always
|
pull: always
|
||||||
environment:
|
environment:
|
||||||
CXX: /opt/rh/devtoolset-6/root/usr/bin/g++
|
CXX: /opt/rh/devtoolset-6/root/usr/bin/g++
|
||||||
CXXFLAGS: -pipe -O2
|
CXXFLAGS: -pipe -O2
|
||||||
|
LANG: C.utf8
|
||||||
commands:
|
commands:
|
||||||
- sed -i 's/keepcache=0/keepcache=1/' /etc/yum.conf
|
- sed -i 's/keepcache=0/keepcache=1/' /etc/yum.conf
|
||||||
- curl -s -o /var/cache/yum/epel-release-latest-7.noarch.rpm http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
- curl -s -o /var/cache/yum/epel-release-latest-7.noarch.rpm http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
||||||
|
@ -191,8 +230,6 @@ steps:
|
||||||
- yum install -qy poco-devel openssl-devel doxygen rpm-build
|
- yum install -qy poco-devel openssl-devel doxygen rpm-build
|
||||||
- yum --enablerepo=epel install -qy cmake3 jsoncpp-devel
|
- yum --enablerepo=epel install -qy cmake3 jsoncpp-devel
|
||||||
- rm -rf build && mkdir -p build && cd build
|
- rm -rf build && mkdir -p build && cd build
|
||||||
- cmake3 -DWITH_EXAMPLES=NO -DWITH_TESTS=NO ..
|
|
||||||
- make package
|
|
||||||
- cmake3 -DWITH_RPM=YES -DWITH_DOC=NO ..
|
- cmake3 -DWITH_RPM=YES -DWITH_DOC=NO ..
|
||||||
- make package
|
- make package
|
||||||
- cp -v libmastodon-cpp-${DRONE_TAG}-0.x86_64.rpm ..
|
- cp -v libmastodon-cpp-${DRONE_TAG}-0.x86_64.rpm ..
|
||||||
|
@ -210,8 +247,9 @@ steps:
|
||||||
title: ${DRONE_TAG}
|
title: ${DRONE_TAG}
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files:
|
files:
|
||||||
- mastodon-cpp-${DRONE_TAG}_x86_64.tar.gz
|
- libmastodon-cpp_${DRONE_TAG}-0_stretch_amd64.deb
|
||||||
- libmastodon-cpp_${DRONE_TAG}-0_amd64.deb
|
- libmastodon-cpp_${DRONE_TAG}-0_buster_amd64.deb
|
||||||
|
- libmastodon-cpp_${DRONE_TAG}-0_bionic_amd64.deb
|
||||||
- libmastodon-cpp-${DRONE_TAG}-0.x86_64.rpm
|
- libmastodon-cpp-${DRONE_TAG}-0.x86_64.rpm
|
||||||
checksum:
|
checksum:
|
||||||
- sha256
|
- sha256
|
||||||
|
|
|
@ -5,10 +5,16 @@ root = true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
|
||||||
tab_width = 4
|
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
max_line_length = 80
|
max_line_length = 80
|
||||||
|
|
||||||
|
[*.?pp]
|
||||||
|
indent_size = 4
|
||||||
|
tab_width = 4
|
||||||
|
|
||||||
|
[{CMakeLists.txt,*.cmake}]
|
||||||
|
indent_size = 2
|
||||||
|
tab_width = 2
|
||||||
|
|
|
@ -9,7 +9,7 @@ endif()
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
project (mastodon-cpp
|
project (mastodon-cpp
|
||||||
VERSION 0.111.1
|
VERSION 0.111.5
|
||||||
LANGUAGES CXX)
|
LANGUAGES CXX)
|
||||||
|
|
||||||
# DESCRIPTION was introduced in version 3.9.
|
# DESCRIPTION was introduced in version 3.9.
|
||||||
|
|
15
README.adoc
15
README.adoc
|
@ -3,9 +3,18 @@
|
||||||
:project: mastodon-cpp
|
:project: mastodon-cpp
|
||||||
:uri-base: https://schlomp.space/tastytea/{project}
|
:uri-base: https://schlomp.space/tastytea/{project}
|
||||||
:uri-branch-main: {uri-base}/src/branch/master
|
:uri-branch-main: {uri-base}/src/branch/master
|
||||||
|
:uri-mastodonpp: https://schlomp.space/tastytea/mastodonpp
|
||||||
|
|
||||||
|
[IMPORTANT]
|
||||||
|
This project has become too complicated to maintain by myself and I can't find
|
||||||
|
the energy to add features. **You can find a complete rewrite, with cleaner and
|
||||||
|
much easier to understand code at link:{uri-mastodonpp}[mastodonpp].** I
|
||||||
|
recommend switching to it. You can still report bugs here and I will respond,
|
||||||
|
but I won't put too much work in it. If you want to take over maintainership,
|
||||||
|
get in touch.
|
||||||
|
|
||||||
*{project}* is a C++ wrapper for the Mastodon API. You submit an API call
|
*{project}* is a C++ wrapper for the Mastodon API. You submit an API call
|
||||||
and get the raw JSON or easy to use abstractions.
|
and get the raw JSON that you can then transform into easy to use abstractions.
|
||||||
|
|
||||||
== Usage
|
== Usage
|
||||||
|
|
||||||
|
@ -77,10 +86,6 @@ Not included in this list are entities.
|
||||||
==== Return types
|
==== Return types
|
||||||
|
|
||||||
* `Mastodon::return_call`: Contains the response from `Mastodon::API` calls.
|
* `Mastodon::return_call`: Contains the response from `Mastodon::API` calls.
|
||||||
* `Mastodon::Easy::return_entity`: Contains the response from high-level
|
|
||||||
functions that return a single `Mastodon::Easy::Entity`.
|
|
||||||
* `Mastodon::Easy::return_entities_vector`: Contains the response from
|
|
||||||
high-level functions that return multiple `Mastodon::Easy::Entity`.
|
|
||||||
|
|
||||||
==== Other types
|
==== Other types
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
find_depencency(jsoncpp CONFIG REQUIRED)
|
find_dependency(jsoncpp CONFIG REQUIRED)
|
||||||
find_package(Poco COMPONENTS Foundation Net NetSSL CONFIG REQUIRED)
|
find_package(Poco COMPONENTS Foundation Net NetSSL CONFIG REQUIRED)
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
|
||||||
|
|
|
@ -26,8 +26,11 @@ if (WITH_DEB)
|
||||||
execute_process(COMMAND dpkg --print-architecture
|
execute_process(COMMAND dpkg --print-architecture
|
||||||
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
execute_process(COMMAND lsb_release --codename --short
|
||||||
|
OUTPUT_VARIABLE DEBIAN_CODENAME
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
set(CPACK_PACKAGE_FILE_NAME
|
set(CPACK_PACKAGE_FILE_NAME
|
||||||
"${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-0_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
"${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-0_${DEBIAN_CODENAME}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WITH_RPM)
|
if (WITH_RPM)
|
||||||
|
|
|
@ -7,5 +7,5 @@ endforeach()
|
||||||
|
|
||||||
if(WITH_DOC)
|
if(WITH_DOC)
|
||||||
install(FILES ${sources_examples}
|
install(FILES ${sources_examples}
|
||||||
DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples")
|
DESTINATION "${CMAKE_INSTALL_DOCDIR}/${PROJECT_NAME}/examples")
|
||||||
endif()
|
endif()
|
||||||
|
|
48
examples/example04_list_custom_emojis.cpp
Normal file
48
examples/example04_list_custom_emojis.cpp
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
// This file is part of mastodon-cpp.
|
||||||
|
// Prints shortcode + URL for each custom emoji.
|
||||||
|
|
||||||
|
// Don't compile this if the Easy-interface is turned off
|
||||||
|
#ifndef WITHOUT_EASY
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include "mastodon-cpp.hpp"
|
||||||
|
#include "easy/all.hpp"
|
||||||
|
|
||||||
|
using std::string;
|
||||||
|
using std::vector;
|
||||||
|
using namespace Mastodon;
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
const vector<string> args(argv, argv + argc);
|
||||||
|
if (args.size() < 2)
|
||||||
|
{
|
||||||
|
std::cerr << "usage: " << args[0] << " <instance>\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Construct a Mastodon::Easy object.
|
||||||
|
Easy::API masto(args[1], "");
|
||||||
|
const return_call ret = masto.get(API::v1::custom_emojis);
|
||||||
|
|
||||||
|
// Convert JSON array into vector of strings.
|
||||||
|
for (const string &str : Easy::json_array_to_vector(ret))
|
||||||
|
{
|
||||||
|
// Construct Emoji object from string.
|
||||||
|
const Easy::Emoji emoji(str);
|
||||||
|
std::cout << ':' << emoji.shortcode() << ": <" << emoji.url() << ">\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
#include <iostream>
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
std::cout << "mastodon-cpp was compiled without Easy support.\n";
|
||||||
|
return 255;
|
||||||
|
}
|
||||||
|
#endif // WITHOUT_EASY
|
|
@ -167,6 +167,7 @@ namespace Easy
|
||||||
*
|
*
|
||||||
* @since 0.100.0
|
* @since 0.100.0
|
||||||
*/
|
*/
|
||||||
|
[[deprecated("Will go away in 1.0.0 with no replacement.")]]
|
||||||
const return_entity<Easy::Status> send_post(const Status &status);
|
const return_entity<Easy::Status> send_post(const Status &status);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -174,6 +175,7 @@ namespace Easy
|
||||||
*
|
*
|
||||||
* @since 0.100.0
|
* @since 0.100.0
|
||||||
*/
|
*/
|
||||||
|
[[deprecated("Will go away in 1.0.0 with no replacement.")]]
|
||||||
const return_entity<Easy::Status> send_toot(const Status &status);
|
const return_entity<Easy::Status> send_toot(const Status &status);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -187,6 +189,7 @@ namespace Easy
|
||||||
*
|
*
|
||||||
* @since 0.100.0
|
* @since 0.100.0
|
||||||
*/
|
*/
|
||||||
|
[[deprecated("Will go away in 1.0.0 with no replacement.")]]
|
||||||
const return_entity_vector<Easy::Notification> get_notifications(
|
const return_entity_vector<Easy::Notification> get_notifications(
|
||||||
const uint16_t limit = 20, const string since_id = "",
|
const uint16_t limit = 20, const string since_id = "",
|
||||||
const string max_id = "");
|
const string max_id = "");
|
||||||
|
|
|
@ -36,8 +36,9 @@ namespace Easy
|
||||||
*
|
*
|
||||||
* @since 0.100.0
|
* @since 0.100.0
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T> struct
|
||||||
struct return_entity : return_base
|
[[deprecated("Will go away in 1.0.0 with no replacement.")]]
|
||||||
|
return_entity : return_base
|
||||||
{
|
{
|
||||||
/*!
|
/*!
|
||||||
* @brief Mastodon::Easy::Entity
|
* @brief Mastodon::Easy::Entity
|
||||||
|
@ -107,8 +108,9 @@ namespace Easy
|
||||||
*
|
*
|
||||||
* @since 0.100.0
|
* @since 0.100.0
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T> struct
|
||||||
struct return_entity_vector : return_base
|
[[deprecated("Will go away in 1.0.0 with no replacement.")]]
|
||||||
|
return_entity_vector : return_base
|
||||||
{
|
{
|
||||||
/*!
|
/*!
|
||||||
* @brief std::vector of Mastodon::Easy::Entity.
|
* @brief std::vector of Mastodon::Easy::Entity.
|
||||||
|
|
|
@ -347,7 +347,6 @@ return_call API::http::request_common(const http_method &meth,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: get_headers() doesn't work anymore.
|
|
||||||
void API::http::get_headers(string &headers) const
|
void API::http::get_headers(string &headers) const
|
||||||
{
|
{
|
||||||
headers = _headers;
|
headers = _headers;
|
||||||
|
|
|
@ -269,11 +269,15 @@ return_call API::register_app2(const string &client_id,
|
||||||
const string API::get_header(std::string header) const
|
const string API::get_header(std::string header) const
|
||||||
{
|
{
|
||||||
string headers;
|
string headers;
|
||||||
|
string headers_lower;
|
||||||
_http.get_headers(headers);
|
_http.get_headers(headers);
|
||||||
std::transform(headers.begin(), headers.end(), headers.begin(), ::tolower);
|
headers_lower.resize(headers.size());
|
||||||
|
|
||||||
|
std::transform(headers.begin(), headers.end(),
|
||||||
|
headers_lower.begin(), ::tolower);
|
||||||
std::transform(header.begin(), header.end(), header.begin(), ::tolower);
|
std::transform(header.begin(), header.end(), header.begin(), ::tolower);
|
||||||
|
|
||||||
size_t startpos = headers.find(header + ':');
|
size_t startpos = headers_lower.find(header + ':');
|
||||||
if (startpos != std::string::npos)
|
if (startpos != std::string::npos)
|
||||||
{
|
{
|
||||||
startpos = headers.find(':', startpos) + 2;
|
startpos = headers.find(':', startpos) + 2;
|
||||||
|
|
Reference in New Issue
Block a user