generate.toc="chapter toc section toc"
- ;
-
-install html
- :
- /boost//doc/src/boostbook.css
- /boost//doc/src/images/blank.png
- /boost//doc/src/images/caution.png
- /boost//doc/src/images/draft.png
- /boost//doc/src/images/home.png
- /boost//doc/src/images/important.png
- /boost//doc/src/images/next_disabled.png
- /boost//doc/src/images/next.png
- /boost//doc/src/images/note.png
- /boost//doc/src/images/prev_disabled.png
- /boost//doc/src/images/prev.png
- /boost//doc/src/images/tip.png
- /boost//doc/src/images/up_disabled.png
- /boost//doc/src/images/up.png
- /boost//doc/src/images/warning.png
- urdl.png
- ;
diff --git a/thirdparty/urdl-2013-08-15/doc/doxy2qbk.pl b/thirdparty/urdl-2013-08-15/doc/doxy2qbk.pl
deleted file mode 100755
index 1bc0a09..0000000
--- a/thirdparty/urdl-2013-08-15/doc/doxy2qbk.pl
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/perl -w
-
-# Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-#
-# Distributed under the Boost Software License, Version 1.0. (See accompanying
-# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-use strict;
-
-system("doxygen reference.dox");
-chdir("xml");
-system("xsltproc combine.xslt index.xml > all.xml");
-chdir("..");
-system("xsltproc reference.xsl xml/all.xml > reference.qbk");
-system("rm -rf xml");
diff --git a/thirdparty/urdl-2013-08-15/doc/index.html b/thirdparty/urdl-2013-08-15/doc/index.html
deleted file mode 100644
index 15253e0..0000000
--- a/thirdparty/urdl-2013-08-15/doc/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
- Urdl
-
-
-
-
- Automatic redirection failed, please go to
- html/index.html
-
-
-
- Copyright (c) 2009-2013 Christopher M. Kohlhoff
-
-
- Distributed under the Boost Software License, Version 1.0. (See accompanying
- file LICENSE_1_0.txt or copy at
- www.boost.org/LICENSE_1_0.txt )
-
-
-
diff --git a/thirdparty/urdl-2013-08-15/doc/index.xml b/thirdparty/urdl-2013-08-15/doc/index.xml
deleted file mode 100644
index 973bc4c..0000000
--- a/thirdparty/urdl-2013-08-15/doc/index.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
diff --git a/thirdparty/urdl-2013-08-15/doc/reference.dox b/thirdparty/urdl-2013-08-15/doc/reference.dox
deleted file mode 100644
index 001f113..0000000
--- a/thirdparty/urdl-2013-08-15/doc/reference.dox
+++ /dev/null
@@ -1,223 +0,0 @@
-# Doxyfile 1.4.5
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME = "Urdl Reference"
-PROJECT_NUMBER =
-OUTPUT_DIRECTORY = .
-CREATE_SUBDIRS = NO
-OUTPUT_LANGUAGE = English
-USE_WINDOWS_ENCODING = NO
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ABBREVIATE_BRIEF =
-ALWAYS_DETAILED_SEC = YES
-INLINE_INHERITED_MEMB = YES
-FULL_PATH_NAMES = YES
-STRIP_FROM_PATH = ./../../../
-STRIP_FROM_INC_PATH =
-SHORT_NAMES = NO
-JAVADOC_AUTOBRIEF = NO
-MULTILINE_CPP_IS_BRIEF = YES
-DETAILS_AT_TOP = YES
-INHERIT_DOCS = NO
-SEPARATE_MEMBER_PAGES = NO
-TAB_SIZE = 2
-ALIASES =
-OPTIMIZE_OUTPUT_FOR_C = NO
-OPTIMIZE_OUTPUT_JAVA = NO
-BUILTIN_STL_SUPPORT = NO
-DISTRIBUTE_GROUP_DOC = NO
-SUBGROUPING = YES
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-EXTRACT_ALL = YES
-EXTRACT_PRIVATE = YES
-EXTRACT_STATIC = YES
-EXTRACT_LOCAL_CLASSES = NO
-EXTRACT_LOCAL_METHODS = NO
-HIDE_UNDOC_MEMBERS = YES
-HIDE_UNDOC_CLASSES = YES
-HIDE_FRIEND_COMPOUNDS = NO
-HIDE_IN_BODY_DOCS = NO
-INTERNAL_DOCS = NO
-CASE_SENSE_NAMES = YES
-HIDE_SCOPE_NAMES = NO
-SHOW_INCLUDE_FILES = NO
-INLINE_INFO = NO
-SORT_MEMBER_DOCS = NO
-SORT_BRIEF_DOCS = NO
-SORT_BY_SCOPE_NAME = NO
-GENERATE_TODOLIST = NO
-GENERATE_TESTLIST = NO
-GENERATE_BUGLIST = NO
-GENERATE_DEPRECATEDLIST= NO
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-SHOW_USED_FILES = NO
-SHOW_DIRECTORIES = NO
-FILE_VERSION_FILTER =
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = NO
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_IF_DOC_ERROR = YES
-WARN_NO_PARAMDOC = NO
-WARN_FORMAT = "$file:$line: $text"
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = ./../include/urdl std_dox.txt
-FILE_PATTERNS = *.hpp
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = YES
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_PATTERNS =
-FILTER_SOURCE_FILES = NO
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = NO
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = NO
-REFERENCES_RELATION = NO
-USE_HTAGS = NO
-VERBATIM_HEADERS = NO
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = YES
-COLS_IN_ALPHA_INDEX = 1
-IGNORE_PREFIX =
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = NO
-HTML_OUTPUT = .
-HTML_FILE_EXTENSION = .html
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_ALIGN_MEMBERS = YES
-GENERATE_HTMLHELP = NO
-CHM_FILE =
-HHC_LOCATION =
-GENERATE_CHI = NO
-BINARY_TOC = NO
-TOC_EXPAND = NO
-DISABLE_INDEX = YES
-ENUM_VALUES_PER_LINE = 1
-GENERATE_TREEVIEW = NO
-TREEVIEW_WIDTH = 250
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = NO
-LATEX_OUTPUT = latex
-LATEX_CMD_NAME = latex
-MAKEINDEX_CMD_NAME = makeindex
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-LATEX_HIDE_INDICES = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT = rtf
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = NO
-MAN_OUTPUT = man
-MAN_EXTENSION = .3
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = YES
-XML_OUTPUT = xml
-XML_SCHEMA =
-XML_DTD =
-XML_PROGRAMLISTING = NO
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD = NO
-PERLMOD_LATEX = NO
-PERLMOD_PRETTY = YES
-PERLMOD_MAKEVAR_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = YES
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED = URDL_DECL
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-TAGFILES =
-GENERATE_TAGFILE =
-ALLEXTERNALS = NO
-EXTERNAL_GROUPS = YES
-PERL_PATH = /usr/bin/perl
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = NO
-HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = YES
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = NO
-GROUP_GRAPHS = NO
-UML_LOOK = NO
-TEMPLATE_RELATIONS = YES
-INCLUDE_GRAPH = NO
-INCLUDED_BY_GRAPH = NO
-CALL_GRAPH = NO
-GRAPHICAL_HIERARCHY = NO
-DIRECTORY_GRAPH = NO
-DOT_IMAGE_FORMAT = png
-DOT_PATH =
-DOTFILE_DIRS =
-MAX_DOT_GRAPH_WIDTH = 640
-MAX_DOT_GRAPH_HEIGHT = 640
-MAX_DOT_GRAPH_DEPTH = 0
-DOT_TRANSPARENT = NO
-DOT_MULTI_TARGETS = NO
-GENERATE_LEGEND = NO
-DOT_CLEANUP = YES
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine
-#---------------------------------------------------------------------------
-SEARCHENGINE = NO
diff --git a/thirdparty/urdl-2013-08-15/doc/reference.qbk b/thirdparty/urdl-2013-08-15/doc/reference.qbk
deleted file mode 100644
index 08f20a0..0000000
--- a/thirdparty/urdl-2013-08-15/doc/reference.qbk
+++ /dev/null
@@ -1,4535 +0,0 @@
-[/
- / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
- /
- / Distributed under the Boost Software License, Version 1.0. (See accompanying
- / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- /]
-
-[section:reference Reference]
-
-
-
-[section:core Core Classes]
-
-
-[section:istream istream]
-
-[indexterm2 istream..class]
-The class `istream` supports reading content from a specified URL.
-
-
- class istream :
- public std::basic_istream< char >
-
-
-['[*Member Functions]]
-[table
- [[Name][Description]]
-
- [
- [[link urdl.reference.core.istream.close [*close]]]
- [Closes the stream. ]
- ]
-
- [
- [[link urdl.reference.core.istream.content_length [*content_length]]]
- [Gets the length of the content obtained from the URL. ]
- ]
-
- [
- [[link urdl.reference.core.istream.content_type [*content_type]]]
- [Gets the MIME type of the content obtained from the URL. ]
- ]
-
- [
- [[link urdl.reference.core.istream.error [*error]]]
- [Gets the last error associated with the stream. ]
- ]
-
- [
- [[link urdl.reference.core.istream.get_option [*get_option]]]
- [Gets the current value of an option that controls the behaviour of the stream. ]
- ]
-
- [
- [[link urdl.reference.core.istream.get_options [*get_options]]]
- [Gets the values of all options set on the stream. ]
- ]
-
- [
- [[link urdl.reference.core.istream.headers [*headers]]]
- [Gets the protocol-specific headers obtained from the URL. ]
- ]
-
- [
- [[link urdl.reference.core.istream.is_open [*is_open]]]
- [Determines whether the stream is open. ]
- ]
-
- [
- [[link urdl.reference.core.istream.istream [*istream]]]
- [Constructs an object of class istream. ]
- ]
-
- [
- [[link urdl.reference.core.istream.open [*open]]]
- [Opens the specified URL. ]
- ]
-
- [
- [[link urdl.reference.core.istream.open_timeout [*open_timeout]]]
- [Gets the open timeout of the stream.
-
- Sets the open timeout of the stream. ]
- ]
-
- [
- [[link urdl.reference.core.istream.rdbuf [*rdbuf]]]
- [Gets the underlying stream buffer. ]
- ]
-
- [
- [[link urdl.reference.core.istream.read_timeout [*read_timeout]]]
- [Gets the read timeout of the stream.
-
- Sets the read timeout of the stream. ]
- ]
-
- [
- [[link urdl.reference.core.istream.set_option [*set_option]]]
- [Sets an option to control the behaviour of the stream. ]
- ]
-
- [
- [[link urdl.reference.core.istream.set_options [*set_options]]]
- [Sets options to control the behaviour of the stream. ]
- ]
-
-]
-
-
-['[*Remarks]]
-
-The class stores an object of class `istreambuf`.
-
-Currently supported URL protocols are `http`, `https` and `file`.
-
-
-['[*Example]]
-
-To read the entire content of a resource located by a URL into a string:
-
- urdl::istream is("http://www.boost.org/LICENSE_1_0.txt");
- if (is)
- {
- std::string content;
- if (std::getline(is, content, std::char_traits::eof()))
- {
- ...
- }
- }
-
-
-
-
-['[*Requirements]]
-
-[*Header:] ``
-
-[*Namespace:] `urdl`
-
-
-
-[section:close istream::close]
-
-[indexterm2 close..istream]
-Closes the stream.
-
-
- void close();
-
-
-
-['[*Remarks]]
-
-Calls `rdbuf()->close()` and, if that function returns a null pointer, calls `setstate(failbit)` (which may throw `ios_base::failure`).
-
-
-
-[endsect]
-
-
-
-[section:content_length istream::content_length]
-
-[indexterm2 content_length..istream]
-Gets the length of the content obtained from the URL.
-
-
- std::size_t content_length() const;
-
-
-
-['[*Return Value]]
-
-The length, in bytes, of the content. If the content associated with the URL does not specify a length, `std::numeric_limits::max()`.
-
-['[*Remarks]]
-
-Returns `rdbuf()->content_length()`.
-
-
-
-[endsect]
-
-
-
-[section:content_type istream::content_type]
-
-[indexterm2 content_type..istream]
-Gets the MIME type of the content obtained from the URL.
-
-
- std::string content_type() const;
-
-
-
-['[*Return Value]]
-
-A string specifying the MIME type. Examples of possible return values include `text/plain`, `text/html` and `image/png`.
-
-['[*Remarks]]
-
-Returns `rdbuf()->content_type()`.
-
-Not all URL protocols support a content type. For these protocols, this function returns an empty string.
-
-
-[endsect]
-
-
-
-[section:error istream::error]
-
-[indexterm2 error..istream]
-Gets the last error associated with the stream.
-
-
- const boost::system::error_code & error() const;
-
-
-
-['[*Return Value]]
-
-An `error_code` corresponding to the last error from the stream.
-
-['[*Remarks]]
-
-Returns a reference to an `error_code` object representing the last failure reported by an `istreambuf` function. The set of possible `error_code` values and categories depends on the protocol of the URL used to open the stream.
-
-['[*Example]]
-
-To take action given a specific error:
-
- urdl::istream is("http://somesite/page");
- if (!is)
- {
- if (is.error() == urdl::http::errc::forbidden)
- {
- std::cout << "Computer says no" << std::endl;
- }
- }
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:get_option istream::get_option]
-
-[indexterm2 get_option..istream]
-Gets the current value of an option that controls the behaviour of the stream.
-
-
- template<
- typename Option>
- Option get_option() const;
-
-
-
-['[*Return Value]]
-
-The current value of the option.
-
-['[*Remarks]]
-
-Returns `rdbuf()->get_option()`. Options are uniquely identified by type.
-
-['[*Example]]
-
-
-
- urdl::istream is;
- urdl::http::max_redirects option
- = is.get_option();
- std::size_t value = option.value();
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:get_options istream::get_options]
-
-[indexterm2 get_options..istream]
-Gets the values of all options set on the stream.
-
-
- option_set get_options() const;
-
-
-
-['[*Return Value]]
-
-An option set containing all options from the stream.
-
-['[*Remarks]]
-
-Returns `rdbuf()->get_options()`.
-
-['[*Example]]
-
-To get the options that have been set on the stream:
-
- urdl::istream is;
- ...
- urdl::option_set options(is.get_options());
- urdl::http::max_redirects option
- = options.get_option();
- std::size_t value = option.value();
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:headers istream::headers]
-
-[indexterm2 headers..istream]
-Gets the protocol-specific headers obtained from the URL.
-
-
- std::string headers() const;
-
-
-
-['[*Return Value]]
-
-A string containing the headers returned with the content from the URL. The format and interpretation of these headers is specific to the protocol associated with the URL.
-
-['[*Remarks]]
-
-Returns `rdbuf()->headers()`.
-
-
-
-[endsect]
-
-
-
-[section:is_open istream::is_open]
-
-[indexterm2 is_open..istream]
-Determines whether the stream is open.
-
-
- bool is_open() const;
-
-
-
-['[*Return Value]]
-
-`true` if the stream is open, `false` otherwise.
-
-['[*Remarks]]
-
-Returns `rdbuf()->is_open()`.
-
-
-
-[endsect]
-
-
-[section:istream istream::istream]
-
-[indexterm2 istream..istream]
-Constructs an object of class `istream`.
-
-
- ``[link urdl.reference.core.istream.istream.overload1 istream]``();
- `` [''''»''' [link urdl.reference.core.istream.istream.overload1 more...]]``
-
- explicit ``[link urdl.reference.core.istream.istream.overload2 istream]``(
- const url & u);
- `` [''''»''' [link urdl.reference.core.istream.istream.overload2 more...]]``
-
- explicit ``[link urdl.reference.core.istream.istream.overload3 istream]``(
- const url & u,
- const option_set & options);
- `` [''''»''' [link urdl.reference.core.istream.istream.overload3 more...]]``
-
-
-[section:overload1 istream::istream (1 of 3 overloads)]
-
-
-Constructs an object of class `istream`.
-
-
- istream();
-
-
-
-['[*Remarks]]
-
-Initializes the base class with `std::basic_istream(sb)`, where sb is an object of class `istreambuf` stored within the class.
-
-
-
-[endsect]
-
-
-
-[section:overload2 istream::istream (2 of 3 overloads)]
-
-
-Constructs an object of class `istream`.
-
-
- explicit istream(
- const url & u);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[u][The URL to open.]]
-
-]
-
-['[*Remarks]]
-
-Initializes the base class with `std::basic_istream(sb)`, where `sb` is an object of class `istreambuf` stored within the class. It also opens `sb` by performing `sb.open(u)` and, if that fails (returns a null pointer), calls `setstate(failbit)`.
-
-
-
-[endsect]
-
-
-
-[section:overload3 istream::istream (3 of 3 overloads)]
-
-
-Constructs an object of class `istream`.
-
-
- explicit istream(
- const url & u,
- const option_set & options);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[u][The URL to open.]]
-
-[[options][The options to be set on the stream.]]
-
-]
-
-['[*Remarks]]
-
-Initializes the base class with `std::basic_istream(sb)`, where `sb` is an object of class `istreambuf` stored within the class. It also performs `rdbuf()->set_options(options)`, then opens `sb` by performing `sb.open(u)` and, if that fails (returns a null pointer), calls `setstate(failbit)`.
-
-['[*Example]]
-
-
-
- urdl::option_set options;
- options.set_option(urdl::http::max_redirects(1));
- urdl::istream is("http://www.boost.org", options);
-
-
-
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:open istream::open]
-
-[indexterm2 open..istream]
-Opens the specified URL.
-
-
- void open(
- const url & u);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[u][The URL to open.]]
-
-]
-
-['[*Remarks]]
-
-Calls `rdbuf()->open(u)`. If that function does not return a null pointer, calls `clear()`. Otherwise calls `setstate(failbit)` (which may throw `ios_base::failure`).
-
-
-
-[endsect]
-
-
-[section:open_timeout istream::open_timeout]
-
-[indexterm2 open_timeout..istream]
-Gets the open timeout of the stream.
-
-
- std::size_t ``[link urdl.reference.core.istream.open_timeout.overload1 open_timeout]``() const;
- `` [''''»''' [link urdl.reference.core.istream.open_timeout.overload1 more...]]``
-
-
-Sets the open timeout of the stream.
-
-
- void ``[link urdl.reference.core.istream.open_timeout.overload2 open_timeout]``(
- std::size_t milliseconds);
- `` [''''»''' [link urdl.reference.core.istream.open_timeout.overload2 more...]]``
-
-
-[section:overload1 istream::open_timeout (1 of 2 overloads)]
-
-
-Gets the open timeout of the stream.
-
-
- std::size_t open_timeout() const;
-
-
-
-['[*Return Value]]
-
-The timeout, in milliseconds, used when opening a URL.
-
-['[*Remarks]]
-
-Returns `rdbuf()->open_timeout()`.
-
-
-
-[endsect]
-
-
-
-[section:overload2 istream::open_timeout (2 of 2 overloads)]
-
-
-Sets the open timeout of the stream.
-
-
- void open_timeout(
- std::size_t milliseconds);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[milliseconds][The timeout, in milliseconds, to be used when opening a URL.]]
-
-]
-
-['[*Remarks]]
-
-Performs `rdbuf()->open_timeout(milliseconds)`.
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:rdbuf istream::rdbuf]
-
-[indexterm2 rdbuf..istream]
-Gets the underlying stream buffer.
-
-
- istreambuf * rdbuf() const;
-
-
-
-['[*Return Value]]
-
-A pointer to the stream buffer contained within the class.
-
-
-
-[endsect]
-
-
-[section:read_timeout istream::read_timeout]
-
-[indexterm2 read_timeout..istream]
-Gets the read timeout of the stream.
-
-
- std::size_t ``[link urdl.reference.core.istream.read_timeout.overload1 read_timeout]``() const;
- `` [''''»''' [link urdl.reference.core.istream.read_timeout.overload1 more...]]``
-
-
-Sets the read timeout of the stream.
-
-
- void ``[link urdl.reference.core.istream.read_timeout.overload2 read_timeout]``(
- std::size_t milliseconds);
- `` [''''»''' [link urdl.reference.core.istream.read_timeout.overload2 more...]]``
-
-
-[section:overload1 istream::read_timeout (1 of 2 overloads)]
-
-
-Gets the read timeout of the stream.
-
-
- std::size_t read_timeout() const;
-
-
-
-['[*Return Value]]
-
-The timeout, in milliseconds, used for individual read operations on the underlying transport.
-
-['[*Remarks]]
-
-Returns `rdbuf()->read_timeout()`.
-
-
-
-[endsect]
-
-
-
-[section:overload2 istream::read_timeout (2 of 2 overloads)]
-
-
-Sets the read timeout of the stream.
-
-
- void read_timeout(
- std::size_t milliseconds);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[milliseconds][The timeout, in milliseconds, to be used for individual read operations on the underlying transport.]]
-
-]
-
-['[*Remarks]]
-
-Performs `rdbuf()->read_timeout(milliseconds)`.
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:set_option istream::set_option]
-
-[indexterm2 set_option..istream]
-Sets an option to control the behaviour of the stream.
-
-
- template<
- typename Option>
- void set_option(
- const Option & option);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[option][The option to be set on the stream.]]
-
-]
-
-['[*Remarks]]
-
-Performs `rdbuf()->set_option(option)`. Options are uniquely identified by type.
-
-['[*Example]]
-
-
-
- urdl::istream is;
- is.set_option(urdl::http::max_redirects(1));
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:set_options istream::set_options]
-
-[indexterm2 set_options..istream]
-Sets options to control the behaviour of the stream.
-
-
- void set_options(
- const option_set & options);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[options][The options to be set on the stream. The options in the set are added on top of any options already set on the stream.]]
-
-]
-
-['[*Remarks]]
-
-Performs `rdbuf()->set_options(options)`.
-
-['[*Example]]
-
-
-
- urdl::istream is;
- urdl::option_set options;
- options.set_option(urdl::http::max_redirects(1));
- options.set_option(urdl::ssl::verify_peer(false));
- stream.set_options(options);
-
-
-
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:istreambuf istreambuf]
-
-[indexterm2 istreambuf..class]
-The class `istreambuf` associates the input sequence with the content from a specified URL.
-
-
- class istreambuf :
- public std::streambuf
-
-
-['[*Member Functions]]
-[table
- [[Name][Description]]
-
- [
- [[link urdl.reference.core.istreambuf.close [*close]]]
- [Closes the stream buffer. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.content_length [*content_length]]]
- [Gets the length of the content obtained from the URL. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.content_type [*content_type]]]
- [Gets the MIME type of the content obtained from the URL. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.get_option [*get_option]]]
- [Gets the current value of an option that controls the behaviour of the stream buffer. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.get_options [*get_options]]]
- [Gets the values of all options set on the stream. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.headers [*headers]]]
- [Gets the protocol-specific headers obtained from the URL. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.is_open [*is_open]]]
- [Determines whether the stream buffer is open. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.istreambuf [*istreambuf]]]
- [Constructs an object of class istreambuf. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.open [*open]]]
- [Opens the specified URL. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.open_timeout [*open_timeout]]]
- [Gets the open timeout of the stream buffer.
-
- Sets the open timeout of the stream buffer. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.puberror [*puberror]]]
- [Gets the last error associated with the stream buffer. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.read_timeout [*read_timeout]]]
- [Gets the read timeout of the stream buffer.
-
- Sets the read timeout of the stream buffer. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.set_option [*set_option]]]
- [Sets an option to control the behaviour of the stream buffer. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.set_options [*set_options]]]
- [Sets options to control the behaviour of the stream buffer. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf._istreambuf [*~istreambuf]]]
- [Destroys an object of class istreambuf. ]
- ]
-
-]
-
-['[*Protected Member Functions]]
-[table
- [[Name][Description]]
-
- [
- [[link urdl.reference.core.istreambuf.error [*error]]]
- [Gets the last error associated with the stream. ]
- ]
-
- [
- [[link urdl.reference.core.istreambuf.underflow [*underflow]]]
- [Overrides std::streambuf behaviour. ]
- ]
-
-]
-
-
-['[*Requirements]]
-
-[*Header:] ``
-
-[*Namespace:] `urdl`
-
-
-
-[section:close istreambuf::close]
-
-[indexterm2 close..istreambuf]
-Closes the stream buffer.
-
-
- istreambuf * close();
-
-
-
-['[*Return Value]]
-
-`this` on success, a null pointer otherwise.
-
-['[*Remarks]]
-
-If `is_open() == false`, returns a null pointer. Otherwise, closes the underlying transport's resources as required. If any of those operations fail, `close` fails by returning a null pointer.
-
-
-
-[endsect]
-
-
-
-[section:content_length istreambuf::content_length]
-
-[indexterm2 content_length..istreambuf]
-Gets the length of the content obtained from the URL.
-
-
- std::size_t content_length() const;
-
-
-
-['[*Return Value]]
-
-The length, in bytes, of the content. If the content associated with the URL does not specify a length, `std::numeric_limits::max()`.
-
-
-
-[endsect]
-
-
-
-[section:content_type istreambuf::content_type]
-
-[indexterm2 content_type..istreambuf]
-Gets the MIME type of the content obtained from the URL.
-
-
- std::string content_type() const;
-
-
-
-['[*Return Value]]
-
-A string specifying the MIME type. Examples of possible return values include `text/plain`, `text/html` and `image/png`.
-
-['[*Remarks]]
-
-Not all URL protocols support a content type. For these protocols, this function returns an empty string.
-
-
-
-[endsect]
-
-
-
-[section:error istreambuf::error]
-
-[indexterm2 error..istreambuf]
-Gets the last error associated with the stream.
-
-
- const boost::system::error_code & error() const;
-
-
-
-['[*Return Value]]
-
-An `error_code` corresponding to the last error from the stream.
-
-['[*Remarks]]
-
-Returns a reference to an `error_code` object representing the last failure reported by an `istreambuf` function. The set of possible `error_code` values and categories depends on the protocol of the URL used to open the stream buffer.
-
-
-
-[endsect]
-
-
-
-[section:get_option istreambuf::get_option]
-
-[indexterm2 get_option..istreambuf]
-Gets the current value of an option that controls the behaviour of the stream buffer.
-
-
- template<
- typename Option>
- Option get_option() const;
-
-
-
-['[*Return Value]]
-
-The current value of the option.
-
-['[*Remarks]]
-
-Options are uniquely identified by type.
-
-
-
-[endsect]
-
-
-
-[section:get_options istreambuf::get_options]
-
-[indexterm2 get_options..istreambuf]
-Gets the values of all options set on the stream.
-
-
- option_set get_options() const;
-
-
-
-['[*Return Value]]
-
-An option set containing all options from the stream buffer.
-
-
-
-[endsect]
-
-
-
-[section:headers istreambuf::headers]
-
-[indexterm2 headers..istreambuf]
-Gets the protocol-specific headers obtained from the URL.
-
-
- std::string headers() const;
-
-
-
-['[*Return Value]]
-
-A string containing the headers returned with the content from the URL. The format and interpretation of these headers is specific to the protocol associated with the URL.
-
-
-
-[endsect]
-
-
-
-[section:is_open istreambuf::is_open]
-
-[indexterm2 is_open..istreambuf]
-Determines whether the stream buffer is open.
-
-
- bool is_open() const;
-
-
-
-['[*Return Value]]
-
-`true` if the stream buffer is open, `false` otherwise.
-
-['[*Remarks]]
-
-Returns `true` if a previous call to `open` succeeded (returned a non-null value) and there has been no intervening call to `close`.
-
-
-
-[endsect]
-
-
-
-[section:istreambuf istreambuf::istreambuf]
-
-[indexterm2 istreambuf..istreambuf]
-Constructs an object of class `istreambuf`.
-
-
- istreambuf();
-
-
-
-[endsect]
-
-
-
-[section:open istreambuf::open]
-
-[indexterm2 open..istreambuf]
-Opens the specified URL.
-
-
- istreambuf * open(
- const url & u);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[u][The URL to open.]]
-
-]
-
-['[*Return Value]]
-
-`this` on success, a null pointer otherwise.
-
-['[*Remarks]]
-
-If `is_open() != false`, returns a null pointer. Otherwise, initializes the `istreambuf` as required.
-
-
-
-[endsect]
-
-
-[section:open_timeout istreambuf::open_timeout]
-
-[indexterm2 open_timeout..istreambuf]
-Gets the open timeout of the stream buffer.
-
-
- std::size_t ``[link urdl.reference.core.istreambuf.open_timeout.overload1 open_timeout]``() const;
- `` [''''»''' [link urdl.reference.core.istreambuf.open_timeout.overload1 more...]]``
-
-
-Sets the open timeout of the stream buffer.
-
-
- void ``[link urdl.reference.core.istreambuf.open_timeout.overload2 open_timeout]``(
- std::size_t milliseconds);
- `` [''''»''' [link urdl.reference.core.istreambuf.open_timeout.overload2 more...]]``
-
-
-[section:overload1 istreambuf::open_timeout (1 of 2 overloads)]
-
-
-Gets the open timeout of the stream buffer.
-
-
- std::size_t open_timeout() const;
-
-
-
-['[*Return Value]]
-
-The timeout, in milliseconds, used when opening a URL.
-
-
-
-[endsect]
-
-
-
-[section:overload2 istreambuf::open_timeout (2 of 2 overloads)]
-
-
-Sets the open timeout of the stream buffer.
-
-
- void open_timeout(
- std::size_t milliseconds);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[milliseconds][The timeout, in milliseconds, to be used when opening a URL. ]]
-
-]
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:puberror istreambuf::puberror]
-
-[indexterm2 puberror..istreambuf]
-Gets the last error associated with the stream buffer.
-
-
- const boost::system::error_code & puberror() const;
-
-
-
-['[*Return Value]]
-
-An `error_code` corresponding to the last error from the stream buffer.
-
-['[*Remarks]]
-
-Returns `error()`.
-
-
-
-[endsect]
-
-
-[section:read_timeout istreambuf::read_timeout]
-
-[indexterm2 read_timeout..istreambuf]
-Gets the read timeout of the stream buffer.
-
-
- std::size_t ``[link urdl.reference.core.istreambuf.read_timeout.overload1 read_timeout]``() const;
- `` [''''»''' [link urdl.reference.core.istreambuf.read_timeout.overload1 more...]]``
-
-
-Sets the read timeout of the stream buffer.
-
-
- void ``[link urdl.reference.core.istreambuf.read_timeout.overload2 read_timeout]``(
- std::size_t milliseconds);
- `` [''''»''' [link urdl.reference.core.istreambuf.read_timeout.overload2 more...]]``
-
-
-[section:overload1 istreambuf::read_timeout (1 of 2 overloads)]
-
-
-Gets the read timeout of the stream buffer.
-
-
- std::size_t read_timeout() const;
-
-
-
-['[*Return Value]]
-
-The timeout, in milliseconds, used for individual read operations on the underlying transport, when downloading the URL's content.
-
-
-
-[endsect]
-
-
-
-[section:overload2 istreambuf::read_timeout (2 of 2 overloads)]
-
-
-Sets the read timeout of the stream buffer.
-
-
- void read_timeout(
- std::size_t milliseconds);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[milliseconds][The timeout, in milliseconds, to be used for individual read operations on the underlying transport, when downloading the URL's content. ]]
-
-]
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:set_option istreambuf::set_option]
-
-[indexterm2 set_option..istreambuf]
-Sets an option to control the behaviour of the stream buffer.
-
-
- template<
- typename Option>
- void set_option(
- const Option & option);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[option][The option to be set on the stream buffer.]]
-
-]
-
-['[*Remarks]]
-
-Options are uniquely identified by type.
-
-
-
-[endsect]
-
-
-
-[section:set_options istreambuf::set_options]
-
-[indexterm2 set_options..istreambuf]
-Sets options to control the behaviour of the stream buffer.
-
-
- void set_options(
- const option_set & options);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[options][The options to be set on the stream buffer. ]]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:underflow istreambuf::underflow]
-
-[indexterm2 underflow..istreambuf]
-Overrides `std::streambuf` behaviour.
-
-
- int_type underflow();
-
-
-par Remarks Behaves according to the specification of `std::streambuf::underflow()`.
-
-
-[endsect]
-
-
-
-[section:_istreambuf istreambuf::~istreambuf]
-
-[indexterm2 ~istreambuf..istreambuf]
-Destroys an object of class `istreambuf`.
-
-
- ~istreambuf();
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:option_set option_set]
-
-[indexterm2 option_set..class]
-The class `option_set` maintains a collection of options.
-
-
- class option_set
-
-
-['[*Member Functions]]
-[table
- [[Name][Description]]
-
- [
- [[link urdl.reference.core.option_set.clear_option [*clear_option]]]
- [Removes an option from the set. ]
- ]
-
- [
- [[link urdl.reference.core.option_set.get_option [*get_option]]]
- [Gets an option from the set. ]
- ]
-
- [
- [[link urdl.reference.core.option_set.operator_eq_ [*operator=]]]
- [Assignment operator. ]
- ]
-
- [
- [[link urdl.reference.core.option_set.option_set [*option_set]]]
- [Constructs an object of class option_set. ]
- ]
-
- [
- [[link urdl.reference.core.option_set.set_option [*set_option]]]
- [Sets the value of an option in the set. ]
- ]
-
- [
- [[link urdl.reference.core.option_set.set_options [*set_options]]]
- [Sets multiple options in a set from another set. ]
- ]
-
- [
- [[link urdl.reference.core.option_set._option_set [*~option_set]]]
- [Destroys an object of class option_set. ]
- ]
-
-]
-
-
-['[*Remarks]]
-
-Options are uniquely identified by type, so the `option_set` class is a collection of objects of differing types, indexed by type.
-
-The option types stored in the set must meet the type requirements for CopyConstructible.
-
-
-['[*Requirements]]
-
-[*Header:] ``
-
-[*Namespace:] `urdl`
-
-
-
-[section:clear_option option_set::clear_option]
-
-[indexterm2 clear_option..option_set]
-Removes an option from the set.
-
-
- template<
- typename Option>
- void clear_option();
-
-
-
-['[*Remarks]]
-
-If the option is queried using the `get_option` member function, it will return the default value of the option.
-
-
-
-[endsect]
-
-
-
-[section:get_option option_set::get_option]
-
-[indexterm2 get_option..option_set]
-Gets an option from the set.
-
-
- template<
- typename Option>
- Option get_option() const;
-
-
-
-['[*Return Value]]
-
-If the option is present in the set, an object containing the value of the option. Otherwise, returns a default-constructed option.
-
-
-
-[endsect]
-
-
-
-[section:operator_eq_ option_set::operator=]
-
-[indexterm2 operator=..option_set]
-Assignment operator.
-
-
- option_set & operator=(
- const option_set & other);
-
-
-
-['[*Remarks]]
-
-Creates an identical copy of another set. Any option queried using the `get_option` member function will return the same value for both sets.
-
-
-
-[endsect]
-
-
-[section:option_set option_set::option_set]
-
-[indexterm2 option_set..option_set]
-Constructs an object of class `option_set`.
-
-
- ``[link urdl.reference.core.option_set.option_set.overload1 option_set]``();
- `` [''''»''' [link urdl.reference.core.option_set.option_set.overload1 more...]]``
-
- ``[link urdl.reference.core.option_set.option_set.overload2 option_set]``(
- const option_set & other);
- `` [''''»''' [link urdl.reference.core.option_set.option_set.overload2 more...]]``
-
-
-[section:overload1 option_set::option_set (1 of 2 overloads)]
-
-
-Constructs an object of class `option_set`.
-
-
- option_set();
-
-
-
-['[*Remarks]]
-
-Creates an empty set. Any option queried using the `get_option` member function will return the default value of the option.
-
-
-
-[endsect]
-
-
-
-[section:overload2 option_set::option_set (2 of 2 overloads)]
-
-
-Constructs an object of class `option_set`.
-
-
- option_set(
- const option_set & other);
-
-
-
-['[*Remarks]]
-
-Creates an identical copy of another set. Any option queried using the `get_option` member function will return the same value for both sets.
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:set_option option_set::set_option]
-
-[indexterm2 set_option..option_set]
-Sets the value of an option in the set.
-
-
- template<
- typename Option>
- void set_option(
- const Option & o);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[o][The option to be set.]]
-
-]
-
-['[*Remarks]]
-
-If the type `Option` is already present in the set, first removes that element. Adds the option to the set.
-
-
-
-[endsect]
-
-
-
-[section:set_options option_set::set_options]
-
-[indexterm2 set_options..option_set]
-Sets multiple options in a set from another set.
-
-
- void set_options(
- const option_set & other);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[other][An option set containing all options to be set in the target.]]
-
-]
-
-['[*Remarks]]
-
-Performs a deep copy of all option values from the object `other` into the target set.
-
-
-
-[endsect]
-
-
-
-[section:_option_set option_set::~option_set]
-
-[indexterm2 ~option_set..option_set]
-Destroys an object of class `option_set`.
-
-
- ~option_set();
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:read_stream read_stream]
-
-[indexterm2 read_stream..class]
-The class `read_stream` supports reading content from a specified URL using synchronous or asynchronous operations.
-
-
- class read_stream
-
-
-['[*Member Functions]]
-[table
- [[Name][Description]]
-
- [
- [[link urdl.reference.core.read_stream.async_open [*async_open]]]
- [Asynchronously opens the specified URL. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.async_read_some [*async_read_some]]]
- [Asynchronously reads some data from the stream. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.close [*close]]]
- [Closes the stream. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.content_length [*content_length]]]
- [Gets the length of the content obtained from the URL. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.content_type [*content_type]]]
- [Gets the MIME type of the content obtained from the URL. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.get_io_service [*get_io_service]]]
- [Gets the io_service associated with the stream. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.get_option [*get_option]]]
- [Gets the current value of an option that controls the behaviour of the stream. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.get_options [*get_options]]]
- [Gets the values of all options set on the stream. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.headers [*headers]]]
- [Gets the protocol-specific headers obtained from the URL. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.is_open [*is_open]]]
- [Determines whether the stream is open. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.open [*open]]]
- [Opens the specified URL. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.read_some [*read_some]]]
- [Reads some data from the stream. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.read_stream [*read_stream]]]
- [Constructs an object of class read_stream. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.set_option [*set_option]]]
- [Sets an option to control the behaviour of the stream. ]
- ]
-
- [
- [[link urdl.reference.core.read_stream.set_options [*set_options]]]
- [Sets options to control the behaviour of the stream. ]
- ]
-
-]
-
-
-['[*Remarks]]
-
-Currently supported URL protocols are `http`, `https` and `file`.
-
-The class `read_stream` meets the type requirements for `SyncReadStream` and `AsyncReadStream`, as defined in the Boost.Asio documentation. This allows objects of class `read_stream` to be used with the functions `boost::asio::read`, `boost::asio::async_read`, `boost::asio::read_until` and `boost::asio::async_read_until`.
-
-
-['[*Example]]
-
-To synchronously open the URL, read the content and write it to standard output:
-
- try
- {
- boost::asio::io_service io_service;
- urdl::read_stream read_stream(io_service);
- read_stream.open("http://www.boost.org/LICENSE_1_0.txt");
- for (;;)
- {
- char data[1024];
- boost::system::error_code ec;
- std::size_t length = stream.read_some(boost::asio::buffer(data), ec);
- if (ec == boost::asio::error::eof)
- break;
- if (ec)
- throw boost::system::system_error(ec);
- os.write(data, length);
- }
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << std::endl;
- }
-
-
-
-
-To asynchronously open the URL, read the content and write it to standard output:
-
- boost::asio::io_service io_service;
- urdl::read_stream read_stream(io_service)
- char data[1024];
- ...
- read_stream.async_open("http://www.boost.org/LICENSE_1_0.txt", open_handler);
- ...
- void open_handler(const boost::system::error_code& ec)
- {
- if (!ec)
- {
- read_stream.async_read_some(boost::asio::buffer(data), read_handler);
- }
- }
- ...
- void read_handler(const boost::system::error_code& ec, std::size_t length)
- {
- if (!ec)
- {
- std::cout.write(data, length);
- read_stream.async_read_some(boost::asio::buffer(data), read_handler);
- }
- }
-
-
-
-
-
-['[*Requirements]]
-
-[*Header:] ``
-
-[*Namespace:] `urdl`
-
-
-
-[section:async_open read_stream::async_open]
-
-[indexterm2 async_open..read_stream]
-Asynchronously opens the specified URL.
-
-
- template<
- typename Handler>
- void async_open(
- const url & u,
- Handler handler);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[u][The URL to open.]]
-
-[[handler][The handler to be called when the open operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& ec // Result of operation.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
-
-]
-
-['[*Example]]
-
-
-
- void open_handler(const boost::system::error_code& ec)
- {
- if (!ec)
- {
- // Open succeeded.
- }
- }
- ...
- urdl::read_stream read_stream(io_service);
- read_stream.async_open("http://www.boost.org/", open_handler);
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:async_read_some read_stream::async_read_some]
-
-[indexterm2 async_read_some..read_stream]
-Asynchronously reads some data from the stream.
-
-
- template<
- typename MutableBufferSequence,
- typename Handler>
- void async_read_some(
- const MutableBufferSequence & buffers,
- Handler handler);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[buffers][One or more buffers into which the data will be read. The type must meet the requirements for `MutableBufferSequence`, as defined in the Boost.Asio documentation. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called.]]
-
-[[handler][The handler to be called when the read operation completes. Copies will be made of the handler as required. The function signature of the handler must be:
-``
- void handler(
- const boost::system::error_code& ec, // Result of operation.
- std::size_t bytes_transferred // Number of bytes read.
- );
-``
-Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using `boost::asio::io_service::post()`.]]
-
-]
-
-['[*Remarks]]
-
-The asynchronous operation will continue until one or more bytes of data has been read successfully, or until an error occurs.
-
-The `async_read_some` operation may not read all of the requested number of bytes. Consider using the `boost::asio::async_read` function if you need to ensure that the requested amount of data is read before the asynchronous operation completes.
-
-
-['[*Example]]
-
-To read into a single data buffer use the `boost::asio::buffer` function as follows:
-
- read_stream.async_read_some(boost::asio::buffer(data, size), handler);
-
-
-See the documentation for the `boost::asio::buffer` function for information on reading into multiple buffers in one go, and how to use it with arrays, `boost::array` or `std::vector`.
-
-
-
-[endsect]
-
-
-[section:close read_stream::close]
-
-[indexterm2 close..read_stream]
-Closes the stream.
-
-
- void ``[link urdl.reference.core.read_stream.close.overload1 close]``();
- `` [''''»''' [link urdl.reference.core.read_stream.close.overload1 more...]]``
-
- boost::system::error_code ``[link urdl.reference.core.read_stream.close.overload2 close]``(
- boost::system::error_code & ec);
- `` [''''»''' [link urdl.reference.core.read_stream.close.overload2 more...]]``
-
-
-[section:overload1 read_stream::close (1 of 2 overloads)]
-
-
-Closes the stream.
-
-
- void close();
-
-
-
-['[*Exceptions]]
-
-
-[variablelist
-
-[[asio::system_error][Thrown on failure.]]
-
-]
-
-['[*Remarks]]
-
-Any asynchronous open or read operations will be cancelled, and will complete with the `boost::asio::error::operation_aborted` error.
-
-
-
-[endsect]
-
-
-
-[section:overload2 read_stream::close (2 of 2 overloads)]
-
-
-Closes the stream.
-
-
- boost::system::error_code close(
- boost::system::error_code & ec);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[ec][Set to indicate what error occurred, if any.]]
-
-]
-
-['[*Return Value]]
-
-`ec`.
-
-['[*Remarks]]
-
-Any asynchronous open or read operations will be cancelled, and will complete with the `boost::asio::error::operation_aborted` error.
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:content_length read_stream::content_length]
-
-[indexterm2 content_length..read_stream]
-Gets the length of the content obtained from the URL.
-
-
- std::size_t content_length() const;
-
-
-
-['[*Return Value]]
-
-The length, in bytes, of the content. If the content associated with the URL does not specify a length, `std::numeric_limits::max()`.
-
-
-
-[endsect]
-
-
-
-[section:content_type read_stream::content_type]
-
-[indexterm2 content_type..read_stream]
-Gets the MIME type of the content obtained from the URL.
-
-
- std::string content_type() const;
-
-
-
-['[*Return Value]]
-
-A string specifying the MIME type. Examples of possible return values include `text/plain`, `text/html` and `image/png`.
-
-['[*Remarks]]
-
-Not all URL protocols support a content type. For these protocols, this function returns an empty string.
-
-
-
-[endsect]
-
-
-
-[section:get_io_service read_stream::get_io_service]
-
-[indexterm2 get_io_service..read_stream]
-Gets the `io_service` associated with the stream.
-
-
- boost::asio::io_service & get_io_service();
-
-
-
-['[*Return Value]]
-
-A reference to the `io_service` object that the stream will use to dispatch handlers. Ownership is not transferred to the caller.
-
-
-
-[endsect]
-
-
-
-[section:get_option read_stream::get_option]
-
-[indexterm2 get_option..read_stream]
-Gets the current value of an option that controls the behaviour of the stream.
-
-
- template<
- typename Option>
- Option get_option() const;
-
-
-
-['[*Return Value]]
-
-The current value of the option.
-
-['[*Remarks]]
-
-Options are uniquely identified by type.
-
-['[*Example]]
-
-
-
- urdl::read_stream stream(io_service);
- urdl::http::max_redirects option
- = stream.get_option();
- std::size_t value = option.value();
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:get_options read_stream::get_options]
-
-[indexterm2 get_options..read_stream]
-Gets the values of all options set on the stream.
-
-
- option_set get_options() const;
-
-
-
-['[*Return Value]]
-
-An option set containing all options from the stream.
-
-['[*Example]]
-
-
-
- urdl::read_stream stream(io_service);
- ...
- urdl::option_set options(stream.get_options());
- urdl::http::max_redirects option
- = options.get_option();
- std::size_t value = option.value();
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:headers read_stream::headers]
-
-[indexterm2 headers..read_stream]
-Gets the protocol-specific headers obtained from the URL.
-
-
- std::string headers() const;
-
-
-
-['[*Return Value]]
-
-A string containing the headers returned with the content from the URL. The format and interpretation of these headers is specific to the protocol associated with the URL.
-
-
-
-[endsect]
-
-
-
-[section:is_open read_stream::is_open]
-
-[indexterm2 is_open..read_stream]
-Determines whether the stream is open.
-
-
- bool is_open() const;
-
-
-
-['[*Return Value]]
-
-`true` if the stream is open, `false` otherwise.
-
-
-
-[endsect]
-
-
-[section:open read_stream::open]
-
-[indexterm2 open..read_stream]
-Opens the specified URL.
-
-
- void ``[link urdl.reference.core.read_stream.open.overload1 open]``(
- const url & u);
- `` [''''»''' [link urdl.reference.core.read_stream.open.overload1 more...]]``
-
- boost::system::error_code ``[link urdl.reference.core.read_stream.open.overload2 open]``(
- const url & u,
- boost::system::error_code & ec);
- `` [''''»''' [link urdl.reference.core.read_stream.open.overload2 more...]]``
-
-
-[section:overload1 read_stream::open (1 of 2 overloads)]
-
-
-Opens the specified URL.
-
-
- void open(
- const url & u);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[u][The URL to open.]]
-
-]
-
-['[*Exceptions]]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure.]]
-
-]
-
-['[*Example]]
-
-
-
- urdl::read_stream read_stream(io_service);
-
- try
- {
- read_stream.open("http://www.boost.org");
- }
- catch (boost::system::error_code& e)
- {
- std::cerr << e.what() << std::endl;
- }
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:overload2 read_stream::open (2 of 2 overloads)]
-
-
-Opens the specified URL.
-
-
- boost::system::error_code open(
- const url & u,
- boost::system::error_code & ec);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[u][The URL to open.]]
-
-[[ec][Set to indicate what error occurred, if any.]]
-
-]
-
-['[*Return Value]]
-
-`ec`.
-
-['[*Example]]
-
-
-
- urdl::read_stream read_stream(io_service);
-
- boost::system::error_code ec;
- read_stream.open("http://www.boost.org", ec);
- if (ec)
- {
- std::cerr << ec.message() << std::endl;
- }
-
-
-
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:read_some read_stream::read_some]
-
-[indexterm2 read_some..read_stream]
-Reads some data from the stream.
-
-
- template<
- typename MutableBufferSequence>
- std::size_t ``[link urdl.reference.core.read_stream.read_some.overload1 read_some]``(
- const MutableBufferSequence & buffers);
- `` [''''»''' [link urdl.reference.core.read_stream.read_some.overload1 more...]]``
-
- template<
- typename MutableBufferSequence>
- std::size_t ``[link urdl.reference.core.read_stream.read_some.overload2 read_some]``(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
- `` [''''»''' [link urdl.reference.core.read_stream.read_some.overload2 more...]]``
-
-
-[section:overload1 read_stream::read_some (1 of 2 overloads)]
-
-
-Reads some data from the stream.
-
-
- template<
- typename MutableBufferSequence>
- std::size_t read_some(
- const MutableBufferSequence & buffers);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[buffers][One or more buffers into which the data will be read. The type must meet the requirements for `MutableBufferSequence`, as defined in the Boost.Asio documentation.]]
-
-]
-
-['[*Return Value]]
-
-The number of bytes read.
-
-['[*Exceptions]]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown on failure. An error code of `boost::asio::error::eof` indicates that the end of the URL content has been reached.]]
-
-]
-
-['[*Remarks]]
-
-The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
-
-The `read_some` operation may not read all of the requested number of bytes. Consider using the `boost::asio::read` function if you need to ensure that the requested amount of data is read before the blocking operation completes.
-
-
-['[*Example]]
-
-To read into a single data buffer use the `boost::asio::buffer` function as follows:
-
- read_stream.read_some(boost::asio::buffer(data, size));
-
-
-See the documentation for the `boost::asio::buffer` function for information on reading into multiple buffers in one go, and how to use it with arrays, `boost::array` or `std::vector`.
-
-
-
-[endsect]
-
-
-
-[section:overload2 read_stream::read_some (2 of 2 overloads)]
-
-
-Reads some data from the stream.
-
-
- template<
- typename MutableBufferSequence>
- std::size_t read_some(
- const MutableBufferSequence & buffers,
- boost::system::error_code & ec);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[buffers][One or more buffers into which the data will be read. The type must meet the requirements for `MutableBufferSequence`, as defined in the Boost.Asio documentation.]]
-
-[[ec][Set to indicate what error occurred, if any. An error code of `boost::asio::error::eof` indicates that the end of the URL content has been reached.]]
-
-]
-
-['[*Return Value]]
-
-The number of bytes read.
-
-['[*Remarks]]
-
-This function is used to read data from the stream. The function call will block until one or more bytes of data has been read successfully, or until an error occurs.
-
-The `read_some` operation may not read all of the requested number of bytes. Consider using the `boost::asio::read` function if you need to ensure that the requested amount of data is read before the blocking operation completes.
-
-
-['[*Example]]
-
-To read into a single data buffer use the `boost::asio::buffer` function as follows:
-
- read_stream.read_some(boost::asio::buffer(data, size));
-
-
-See the documentation for the `boost::asio::buffer` function for information on reading into multiple buffers in one go, and how to use it with arrays, `boost::array` or `std::vector`.
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:read_stream read_stream::read_stream]
-
-[indexterm2 read_stream..read_stream]
-Constructs an object of class `read_stream`.
-
-
- explicit read_stream(
- boost::asio::io_service & io_service);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[io_service][The `io_service` object that the stream will use to dispatch handlers for any asynchronous operations performed on the stream. ]]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:set_option read_stream::set_option]
-
-[indexterm2 set_option..read_stream]
-Sets an option to control the behaviour of the stream.
-
-
- template<
- typename Option>
- void set_option(
- const Option & option);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[option][The option to be set on the stream.]]
-
-]
-
-['[*Remarks]]
-
-Options are uniquely identified by type.
-
-['[*Example]]
-
-
-
- urdl::read_stream stream(io_service);
- stream.set_option(urdl::http::max_redirects(1));
-
-
-
-
-
-
-[endsect]
-
-
-
-[section:set_options read_stream::set_options]
-
-[indexterm2 set_options..read_stream]
-Sets options to control the behaviour of the stream.
-
-
- void set_options(
- const option_set & options);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[options][The options to be set on the stream. The options in the set are added on top of any options already set on the stream.]]
-
-]
-
-['[*Example]]
-
-
-
- urdl::read_stream stream(io_service);
- urdl::option_set options;
- options.set_option(urdl::http::max_redirects(1));
- options.set_option(urdl::ssl::verify_peer(false));
- stream.set_options(options);
-
-
-
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-[section:url url]
-
-[indexterm2 url..class]
-The class `url` enables parsing and accessing the components of URLs.
-
-
- class url
-
-
-['[*Types]]
-[table
- [[Name][Description]]
-
- [
-
- [[link urdl.reference.core.url.components_type [*components_type]]]
- [Components of the URL, used with from_string. ]
-
- ]
-
-]
-
-['[*Member Functions]]
-[table
- [[Name][Description]]
-
- [
- [[link urdl.reference.core.url.fragment [*fragment]]]
- [Gets the fragment component of the URL. ]
- ]
-
- [
- [[link urdl.reference.core.url.from_string [*from_string]]]
- [Converts a string representation of a URL into an object of class url. ]
- ]
-
- [
- [[link urdl.reference.core.url.host [*host]]]
- [Gets the host component of the URL. ]
- ]
-
- [
- [[link urdl.reference.core.url.path [*path]]]
- [Gets the path component of the URL. ]
- ]
-
- [
- [[link urdl.reference.core.url.port [*port]]]
- [Gets the port component of the URL. ]
- ]
-
- [
- [[link urdl.reference.core.url.protocol [*protocol]]]
- [Gets the protocol component of the URL. ]
- ]
-
- [
- [[link urdl.reference.core.url.query [*query]]]
- [Gets the query component of the URL. ]
- ]
-
- [
- [[link urdl.reference.core.url.to_string [*to_string]]]
- [Converts an object of class url to a string representation. ]
- ]
-
- [
- [[link urdl.reference.core.url.url [*url]]]
- [Constructs an object of class url. ]
- ]
-
- [
- [[link urdl.reference.core.url.user_info [*user_info]]]
- [Gets the user info component of the URL. ]
- ]
-
-]
-
-['[*Friends]]
-[table
- [[Name][Description]]
-
- [
- [[link urdl.reference.core.url.operator_not__eq_ [*operator!=]]]
- [Compares two url objects for inequality. ]
- ]
-
- [
- [[link urdl.reference.core.url.operator_lt_ [*operator<]]]
- [Compares two url objects for ordering. ]
- ]
-
- [
- [[link urdl.reference.core.url.operator_eq__eq_ [*operator==]]]
- [Compares two url objects for equality. ]
- ]
-
-]
-
-
-['[*Example]]
-
-To extract the components of a URL:
-
- urdl::url url("http://user:pass@host:1234/dir/page?param=0#anchor");
- std::cout << "Protocol: " << url.protocol() << std::endl;
- std::cout << "User Info: " << url.user_info() << std::endl;
- std::cout << "Host: " << url.host() << std::endl;
- std::cout << "Port: " << url.port() << std::endl;
- std::cout << "Path: " << url.path() << std::endl;
- std::cout << "Query: " << url.query() << std::endl;
- std::cout << "Fragment: " << url.fragment() << std::endl;
-
-
-The above code will print:
-
- Protocol: http
- User Info: user:pass
- Host: host
- Port: 1234
- Path: /dir/page
- Query: param=0
- Fragment: anchor
-
-
-
-
-['[*Requirements]]
-
-[*Header:] ``
-
-[*Namespace:] `urdl`
-
-
-
-[section:components_type url::components_type]
-
-[indexterm2 components_type..url]
-Components of the URL, used with `from_string`.
-
-
- enum components_type
-
-['[*Values]]
-[variablelist
-
- [
- [protocol_component]
- []
- ]
-
- [
- [user_info_component]
- []
- ]
-
- [
- [host_component]
- []
- ]
-
- [
- [port_component]
- []
- ]
-
- [
- [path_component]
- []
- ]
-
- [
- [query_component]
- []
- ]
-
- [
- [fragment_component]
- []
- ]
-
- [
- [all_components]
- []
- ]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:fragment url::fragment]
-
-[indexterm2 fragment..url]
-Gets the fragment component of the URL.
-
-
- std::string fragment() const;
-
-
-
-['[*Return Value]]
-
-A string containing the fragment of the URL.
-
-
-
-[endsect]
-
-
-[section:from_string url::from_string]
-
-[indexterm2 from_string..url]
-Converts a string representation of a URL into an object of class `url`.
-
-
- static url ``[link urdl.reference.core.url.from_string.overload1 from_string]``(
- const char * s);
- `` [''''»''' [link urdl.reference.core.url.from_string.overload1 more...]]``
-
- static url ``[link urdl.reference.core.url.from_string.overload2 from_string]``(
- const char * s,
- boost::system::error_code & ec);
- `` [''''»''' [link urdl.reference.core.url.from_string.overload2 more...]]``
-
- static url ``[link urdl.reference.core.url.from_string.overload3 from_string]``(
- const std::string & s);
- `` [''''»''' [link urdl.reference.core.url.from_string.overload3 more...]]``
-
- static url ``[link urdl.reference.core.url.from_string.overload4 from_string]``(
- const std::string & s,
- boost::system::error_code & ec);
- `` [''''»''' [link urdl.reference.core.url.from_string.overload4 more...]]``
-
-
-[section:overload1 url::from_string (1 of 4 overloads)]
-
-
-Converts a string representation of a URL into an object of class `url`.
-
-
- static url from_string(
- const char * s);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[s][URL string to be parsed into its components.]]
-
-]
-
-['[*Return Value]]
-
-A `url` object corresponding to the specified string.
-
-['[*Exceptions]]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown when the URL string is invalid. ]]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:overload2 url::from_string (2 of 4 overloads)]
-
-
-Converts a string representation of a URL into an object of class `url`.
-
-
- static url from_string(
- const char * s,
- boost::system::error_code & ec);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[s][URL string to be parsed into its components.]]
-
-[[ec][Error code set to indicate the reason for failure, if any.]]
-
-]
-
-['[*Return Value]]
-
-A `url` object corresponding to the specified string.
-
-
-
-[endsect]
-
-
-
-[section:overload3 url::from_string (3 of 4 overloads)]
-
-
-Converts a string representation of a URL into an object of class `url`.
-
-
- static url from_string(
- const std::string & s);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[s][URL string to be parsed into its components.]]
-
-]
-
-['[*Return Value]]
-
-A `url` object corresponding to the specified string.
-
-['[*Exceptions]]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown when the URL string is invalid. ]]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:overload4 url::from_string (4 of 4 overloads)]
-
-
-Converts a string representation of a URL into an object of class `url`.
-
-
- static url from_string(
- const std::string & s,
- boost::system::error_code & ec);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[s][URL string to be parsed into its components.]]
-
-[[ec][Error code set to indicate the reason for failure, if any.]]
-
-]
-
-['[*Return Value]]
-
-A `url` object corresponding to the specified string.
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:host url::host]
-
-[indexterm2 host..url]
-Gets the host component of the URL.
-
-
- std::string host() const;
-
-
-
-['[*Return Value]]
-
-A string containing the host name of the URL.
-
-
-
-[endsect]
-
-
-
-[section:operator_not__eq_ url::operator!=]
-
-[indexterm2 operator!=..url]
-Compares two `url` objects for inequality.
-
-
- friend bool operator!=(
- const url & a,
- const url & b);
-
-
-
-[endsect]
-
-
-
-[section:operator_lt_ url::operator<]
-
-[indexterm2 operator<..url]
-Compares two `url` objects for ordering.
-
-
- friend bool operator<(
- const url & a,
- const url & b);
-
-
-
-[endsect]
-
-
-
-[section:operator_eq__eq_ url::operator==]
-
-[indexterm2 operator==..url]
-Compares two `url` objects for equality.
-
-
- friend bool operator==(
- const url & a,
- const url & b);
-
-
-
-[endsect]
-
-
-
-[section:path url::path]
-
-[indexterm2 path..url]
-Gets the path component of the URL.
-
-
- std::string path() const;
-
-
-
-['[*Return Value]]
-
-A string containing the path of the URL.
-
-['[*Remarks]]
-
-The path string is unescaped. To obtain the path in escaped form, use `to_string(url::path_component)`.
-
-
-
-[endsect]
-
-
-
-[section:port url::port]
-
-[indexterm2 port..url]
-Gets the port component of the URL.
-
-
- unsigned short port() const;
-
-
-
-['[*Return Value]]
-
-The port number of the URL.
-
-['[*Remarks]]
-
-If the URL string did not specify a port, and the protocol is one of `http`, `https` or `ftp`, an appropriate default port number is returned.
-
-
-
-[endsect]
-
-
-
-[section:protocol url::protocol]
-
-[indexterm2 protocol..url]
-Gets the protocol component of the URL.
-
-
- std::string protocol() const;
-
-
-
-['[*Return Value]]
-
-A string specifying the protocol of the URL. Examples include `http`, `https` or `file`.
-
-
-
-[endsect]
-
-
-
-[section:query url::query]
-
-[indexterm2 query..url]
-Gets the query component of the URL.
-
-
- std::string query() const;
-
-
-
-['[*Return Value]]
-
-A string containing the query string of the URL.
-
-['[*Remarks]]
-
-The query string is not unescaped, but is returned in whatever form it takes in the original URL string.
-
-
-
-[endsect]
-
-
-
-[section:to_string url::to_string]
-
-[indexterm2 to_string..url]
-Converts an object of class `url` to a string representation.
-
-
- std::string to_string(
- int components = all_components) const;
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[components][A bitmask specifying which components of the URL should be included in the string. See the `url::components_type` enumeration for possible values.]]
-
-]
-
-['[*Return Value]]
-
-A string representation of the URL.
-
-['[*Examples]]
-
-To convert the entire URL to a string:
-
- std::string s = url.to_string();
-
-
-To convert only the host and port number into a string:
-
- std::string s = url.to_string(
- urdl::url::host_component
- | urdl::url::port_component);
-
-
-
-
-
-
-[endsect]
-
-
-[section:url url::url]
-
-[indexterm2 url..url]
-Constructs an object of class `url`.
-
-
- ``[link urdl.reference.core.url.url.overload1 url]``();
- `` [''''»''' [link urdl.reference.core.url.url.overload1 more...]]``
-
- ``[link urdl.reference.core.url.url.overload2 url]``(
- const char * s);
- `` [''''»''' [link urdl.reference.core.url.url.overload2 more...]]``
-
- ``[link urdl.reference.core.url.url.overload3 url]``(
- const std::string & s);
- `` [''''»''' [link urdl.reference.core.url.url.overload3 more...]]``
-
-
-[section:overload1 url::url (1 of 3 overloads)]
-
-
-Constructs an object of class `url`.
-
-
- url();
-
-
-
-['[*Remarks]]
-
-Postconditions: `protocol()`, `user_info()`, `host()`, `path()`, `query()`, `fragment()` all return an empty string, and `port()` returns 0.
-
-
-
-[endsect]
-
-
-
-[section:overload2 url::url (2 of 3 overloads)]
-
-
-Constructs an object of class `url`.
-
-
- url(
- const char * s);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[s][URL string to be parsed into its components.]]
-
-]
-
-['[*Exceptions]]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown when the URL string is invalid. ]]
-
-]
-
-
-
-[endsect]
-
-
-
-[section:overload3 url::url (3 of 3 overloads)]
-
-
-Constructs an object of class `url`.
-
-
- url(
- const std::string & s);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[s][URL string to be parsed into its components.]]
-
-]
-
-['[*Exceptions]]
-
-
-[variablelist
-
-[[boost::system::system_error][Thrown when the URL string is invalid. ]]
-
-]
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[section:user_info url::user_info]
-
-[indexterm2 user_info..url]
-Gets the user info component of the URL.
-
-
- std::string user_info() const;
-
-
-
-['[*Return Value]]
-
-A string containing the user info of the URL. Typically in the format `user:password`, but depends on the protocol.
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:opt Options]
-
-
-[section:http__max_redirects http::max_redirects]
-
-[indexterm2 http::max_redirects..class]
-Option to specify the maximum number of allowed HTTP redirects.
-
-
- class max_redirects
-
-
-['[*Member Functions]]
-[table
- [[Name][Description]]
-
- [
- [[link urdl.reference.opt.http__max_redirects.max_redirects [*max_redirects]]]
- [Constructs an object of class max_redirects. ]
- ]
-
- [
- [[link urdl.reference.opt.http__max_redirects.value [*value]]]
- [Gets the value of the option.
-
- Sets the value of the option. ]
- ]
-
-]
-
-
-['[*Remarks]]
-
-The default value is for there to be no limit on the number of allowed redirects. Set the option to 0 to disable HTTP redirects.
-
-['[*Example]]
-
-To set maximum number of redirects for an object of class `urdl::istream:`
-
- urdl::istream is;
- is.set_option(urdl::http::max_redirects(1));
- is.open("http://www.boost.org");
-
-
-
-
-To set maximum number of redirects for an object of class `urdl::read_stream:`
-
- urdl::read_stream stream;
- stream.set_option(urdl::http::max_redirects(1));
- stream.open("http://www.boost.org");
-
-
-
-
-
-['[*Requirements]]
-
-[*Header:] ``
-
-[*Namespace:] `urdl::http`
-
-
-[section:max_redirects http::max_redirects::max_redirects]
-
-[indexterm2 max_redirects..http::max_redirects]
-Constructs an object of class `max_redirects`.
-
-
- ``[link urdl.reference.opt.http__max_redirects.max_redirects.overload1 max_redirects]``();
- `` [''''»''' [link urdl.reference.opt.http__max_redirects.max_redirects.overload1 more...]]``
-
- explicit ``[link urdl.reference.opt.http__max_redirects.max_redirects.overload2 max_redirects]``(
- std::size_t v);
- `` [''''»''' [link urdl.reference.opt.http__max_redirects.max_redirects.overload2 more...]]``
-
-
-[section:overload1 http::max_redirects::max_redirects (1 of 2 overloads)]
-
-
-Constructs an object of class `max_redirects`.
-
-
- max_redirects();
-
-
-
-['[*Remarks]]
-
-Postcondition: `value() == std::numeric_limits::max()`.
-
-
-
-[endsect]
-
-
-
-[section:overload2 http::max_redirects::max_redirects (2 of 2 overloads)]
-
-
-Constructs an object of class `max_redirects`.
-
-
- explicit max_redirects(
- std::size_t v);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[v][The desired value for the option.]]
-
-]
-
-['[*Remarks]]
-
-Postcondition: `value() == v`
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:value http::max_redirects::value]
-
-[indexterm2 value..http::max_redirects]
-Gets the value of the option.
-
-
- std::size_t ``[link urdl.reference.opt.http__max_redirects.value.overload1 value]``() const;
- `` [''''»''' [link urdl.reference.opt.http__max_redirects.value.overload1 more...]]``
-
-
-Sets the value of the option.
-
-
- void ``[link urdl.reference.opt.http__max_redirects.value.overload2 value]``(
- std::size_t v);
- `` [''''»''' [link urdl.reference.opt.http__max_redirects.value.overload2 more...]]``
-
-
-[section:overload1 http::max_redirects::value (1 of 2 overloads)]
-
-
-Gets the value of the option.
-
-
- std::size_t value() const;
-
-
-
-['[*Return Value]]
-
-The value of the option.
-
-
-
-[endsect]
-
-
-
-[section:overload2 http::max_redirects::value (2 of 2 overloads)]
-
-
-Sets the value of the option.
-
-
- void value(
- std::size_t v);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[v][The desired value for the option.]]
-
-]
-
-['[*Remarks]]
-
-Postcondition: `value() == v`
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[endsect]
-
-[section:http__request_content http::request_content]
-
-[indexterm2 http::request_content..class]
-Option to specify content to accompany an HTTP request.
-
-
- class request_content
-
-
-['[*Member Functions]]
-[table
- [[Name][Description]]
-
- [
- [[link urdl.reference.opt.http__request_content.request_content [*request_content]]]
- [Constructs an object of class request_content. ]
- ]
-
- [
- [[link urdl.reference.opt.http__request_content.value [*value]]]
- [Gets the value of the option.
-
- Sets the value of the option. ]
- ]
-
-]
-
-
-['[*Remarks]]
-
-The default is for no content to be sent.
-
-['[*Example]]
-
-To add content to the HTTP request using an object of class `urdl::istream:`
-
- urdl::istream is;
- is.set_option(urdl::http::request_method("POST"));
- is.set_option(urdl::http::request_content("Hello, world!"));
- is.set_option(urdl::http::request_content_type("text/plain"));
- is.open("http://host/path");
-
-
-
-
-To add content to the HTTP request using an object of class `urdl::read_stream:`
-
- urdl::read_stream stream;
- stream.set_option(urdl::http::request_method("POST"));
- stream.set_option(urdl::http::request_content("Hello, world!"));
- stream.set_option(urdl::http::request_content_type("text/plain"));
- stream.open("http://host/path");
-
-
-
-
-
-['[*Requirements]]
-
-[*Header:] ``
-
-[*Namespace:] `urdl::http`
-
-
-[section:request_content http::request_content::request_content]
-
-[indexterm2 request_content..http::request_content]
-Constructs an object of class `request_content`.
-
-
- ``[link urdl.reference.opt.http__request_content.request_content.overload1 request_content]``();
- `` [''''»''' [link urdl.reference.opt.http__request_content.request_content.overload1 more...]]``
-
- explicit ``[link urdl.reference.opt.http__request_content.request_content.overload2 request_content]``(
- const std::string & v);
- `` [''''»''' [link urdl.reference.opt.http__request_content.request_content.overload2 more...]]``
-
-
-[section:overload1 http::request_content::request_content (1 of 2 overloads)]
-
-
-Constructs an object of class `request_content`.
-
-
- request_content();
-
-
-
-['[*Remarks]]
-
-Postcondition: `value() == ""`.
-
-
-
-[endsect]
-
-
-
-[section:overload2 http::request_content::request_content (2 of 2 overloads)]
-
-
-Constructs an object of class `request_content`.
-
-
- explicit request_content(
- const std::string & v);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[v][The desired value for the option.]]
-
-]
-
-['[*Remarks]]
-
-Postcondition: `value() == v`
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:value http::request_content::value]
-
-[indexterm2 value..http::request_content]
-Gets the value of the option.
-
-
- std::string ``[link urdl.reference.opt.http__request_content.value.overload1 value]``() const;
- `` [''''»''' [link urdl.reference.opt.http__request_content.value.overload1 more...]]``
-
-
-Sets the value of the option.
-
-
- void ``[link urdl.reference.opt.http__request_content.value.overload2 value]``(
- const std::string & v);
- `` [''''»''' [link urdl.reference.opt.http__request_content.value.overload2 more...]]``
-
-
-[section:overload1 http::request_content::value (1 of 2 overloads)]
-
-
-Gets the value of the option.
-
-
- std::string value() const;
-
-
-
-['[*Return Value]]
-
-The value of the option.
-
-
-
-[endsect]
-
-
-
-[section:overload2 http::request_content::value (2 of 2 overloads)]
-
-
-Sets the value of the option.
-
-
- void value(
- const std::string & v);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[v][The desired value for the option.]]
-
-]
-
-['[*Remarks]]
-
-Postcondition: `value() == v`
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[endsect]
-
-[section:http__request_content_type http::request_content_type]
-
-[indexterm2 http::request_content_type..class]
-Option to specify the type of the content that accompanies an HTTP request.
-
-
- class request_content_type
-
-
-['[*Member Functions]]
-[table
- [[Name][Description]]
-
- [
- [[link urdl.reference.opt.http__request_content_type.request_content_type [*request_content_type]]]
- [Constructs an object of class request_content_type. ]
- ]
-
- [
- [[link urdl.reference.opt.http__request_content_type.value [*value]]]
- [Gets the value of the option.
-
- Sets the value of the option. ]
- ]
-
-]
-
-
-['[*Remarks]]
-
-The default is for no content type to be specified in the request.
-
-['[*Example]]
-
-To add content to the HTTP request using an object of class `urdl::istream:`
-
- urdl::istream is;
- is.set_option(urdl::http::request_method("POST"));
- is.set_option(urdl::http::request_content("Hello, world!"));
- is.set_option(urdl::http::request_content_type("text/plain"));
- is.open("http://host/path");
-
-
-
-
-To add content to the HTTP request using an object of class `urdl::read_stream:`
-
- urdl::read_stream stream;
- stream.set_option(urdl::http::request_method("POST"));
- stream.set_option(urdl::http::request_content("Hello, world!"));
- stream.set_option(urdl::http::request_content_type("text/plain"));
- stream.open("http://host/path");
-
-
-
-
-
-['[*Requirements]]
-
-[*Header:] ``
-
-[*Namespace:] `urdl::http`
-
-
-[section:request_content_type http::request_content_type::request_content_type]
-
-[indexterm2 request_content_type..http::request_content_type]
-Constructs an object of class `request_content_type`.
-
-
- ``[link urdl.reference.opt.http__request_content_type.request_content_type.overload1 request_content_type]``();
- `` [''''»''' [link urdl.reference.opt.http__request_content_type.request_content_type.overload1 more...]]``
-
- explicit ``[link urdl.reference.opt.http__request_content_type.request_content_type.overload2 request_content_type]``(
- const std::string & v);
- `` [''''»''' [link urdl.reference.opt.http__request_content_type.request_content_type.overload2 more...]]``
-
-
-[section:overload1 http::request_content_type::request_content_type (1 of 2 overloads)]
-
-
-Constructs an object of class `request_content_type`.
-
-
- request_content_type();
-
-
-
-['[*Remarks]]
-
-Postcondition: `value() == ""`.
-
-
-
-[endsect]
-
-
-
-[section:overload2 http::request_content_type::request_content_type (2 of 2 overloads)]
-
-
-Constructs an object of class `request_content_type`.
-
-
- explicit request_content_type(
- const std::string & v);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[v][The desired value for the option.]]
-
-]
-
-['[*Remarks]]
-
-Postcondition: `value() == v`
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:value http::request_content_type::value]
-
-[indexterm2 value..http::request_content_type]
-Gets the value of the option.
-
-
- std::string ``[link urdl.reference.opt.http__request_content_type.value.overload1 value]``() const;
- `` [''''»''' [link urdl.reference.opt.http__request_content_type.value.overload1 more...]]``
-
-
-Sets the value of the option.
-
-
- void ``[link urdl.reference.opt.http__request_content_type.value.overload2 value]``(
- const std::string & v);
- `` [''''»''' [link urdl.reference.opt.http__request_content_type.value.overload2 more...]]``
-
-
-[section:overload1 http::request_content_type::value (1 of 2 overloads)]
-
-
-Gets the value of the option.
-
-
- std::string value() const;
-
-
-
-['[*Return Value]]
-
-The value of the option.
-
-
-
-[endsect]
-
-
-
-[section:overload2 http::request_content_type::value (2 of 2 overloads)]
-
-
-Sets the value of the option.
-
-
- void value(
- const std::string & v);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[v][The desired value for the option.]]
-
-]
-
-['[*Remarks]]
-
-Postcondition: `value() == v`
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[endsect]
-
-[section:http__request_method http::request_method]
-
-[indexterm2 http::request_method..class]
-Option to specify the HTTP request method.
-
-
- class request_method
-
-
-['[*Member Functions]]
-[table
- [[Name][Description]]
-
- [
- [[link urdl.reference.opt.http__request_method.request_method [*request_method]]]
- [Constructs an object of class request_method. ]
- ]
-
- [
- [[link urdl.reference.opt.http__request_method.value [*value]]]
- [Gets the value of the option.
-
- Sets the value of the option. ]
- ]
-
-]
-
-
-['[*Remarks]]
-
-The default request method is "GET".
-
-['[*Example]]
-
-To set the request method for an object of class `urdl::istream:`
-
- urdl::istream is;
- is.set_option(urdl::http::request_method("HEAD"));
- is.open("http://www.boost.org");
-
-
-
-
-To set the request method for an object of class `urdl::read_stream:`
-
- urdl::read_stream stream;
- stream.set_option(urdl::http::request_method("HEAD"));
- stream.open("http://www.boost.org");
-
-
-
-
-
-['[*Requirements]]
-
-[*Header:] ``
-
-[*Namespace:] `urdl::http`
-
-
-[section:request_method http::request_method::request_method]
-
-[indexterm2 request_method..http::request_method]
-Constructs an object of class `request_method`.
-
-
- ``[link urdl.reference.opt.http__request_method.request_method.overload1 request_method]``();
- `` [''''»''' [link urdl.reference.opt.http__request_method.request_method.overload1 more...]]``
-
- explicit ``[link urdl.reference.opt.http__request_method.request_method.overload2 request_method]``(
- const std::string & v);
- `` [''''»''' [link urdl.reference.opt.http__request_method.request_method.overload2 more...]]``
-
-
-[section:overload1 http::request_method::request_method (1 of 2 overloads)]
-
-
-Constructs an object of class `request_method`.
-
-
- request_method();
-
-
-
-['[*Remarks]]
-
-Postcondition: `value() == "GET"`.
-
-
-
-[endsect]
-
-
-
-[section:overload2 http::request_method::request_method (2 of 2 overloads)]
-
-
-Constructs an object of class `request_method`.
-
-
- explicit request_method(
- const std::string & v);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[v][The desired value for the option.]]
-
-]
-
-['[*Remarks]]
-
-Postcondition: `value() == v`
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:value http::request_method::value]
-
-[indexterm2 value..http::request_method]
-Gets the value of the option.
-
-
- std::string ``[link urdl.reference.opt.http__request_method.value.overload1 value]``() const;
- `` [''''»''' [link urdl.reference.opt.http__request_method.value.overload1 more...]]``
-
-
-Sets the value of the option.
-
-
- void ``[link urdl.reference.opt.http__request_method.value.overload2 value]``(
- const std::string & v);
- `` [''''»''' [link urdl.reference.opt.http__request_method.value.overload2 more...]]``
-
-
-[section:overload1 http::request_method::value (1 of 2 overloads)]
-
-
-Gets the value of the option.
-
-
- std::string value() const;
-
-
-
-['[*Return Value]]
-
-The value of the option.
-
-
-
-[endsect]
-
-
-
-[section:overload2 http::request_method::value (2 of 2 overloads)]
-
-
-Sets the value of the option.
-
-
- void value(
- const std::string & v);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[v][The desired value for the option.]]
-
-]
-
-['[*Remarks]]
-
-Postcondition: `value() == v`
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[endsect]
-
-[section:http__user_agent http::user_agent]
-
-[indexterm2 http::user_agent..class]
-Option to specify the user agent identifier.
-
-
- class user_agent
-
-
-['[*Member Functions]]
-[table
- [[Name][Description]]
-
- [
- [[link urdl.reference.opt.http__user_agent.user_agent [*user_agent]]]
- [Constructs an object of class user_agent. ]
- ]
-
- [
- [[link urdl.reference.opt.http__user_agent.value [*value]]]
- [Gets the value of the option.
-
- Sets the value of the option. ]
- ]
-
-]
-
-
-['[*Remarks]]
-
-The default is to not specify the user agent.
-
-['[*Example]]
-
-To set the user agent for an object of class `urdl::istream:`
-
- urdl::istream is;
- is.set_option(urdl::http::user_agent("Urdl"));
- is.open("http://www.boost.org");
-
-
-
-
-To set the user agent for an object of class `urdl::read_stream:`
-
- urdl::read_stream stream;
- stream.set_option(urdl::http::user_agent("Urdl"));
- stream.open("http://www.boost.org");
-
-
-
-
-
-['[*Requirements]]
-
-[*Header:] ``
-
-[*Namespace:] `urdl::http`
-
-
-[section:user_agent http::user_agent::user_agent]
-
-[indexterm2 user_agent..http::user_agent]
-Constructs an object of class `user_agent`.
-
-
- ``[link urdl.reference.opt.http__user_agent.user_agent.overload1 user_agent]``();
- `` [''''»''' [link urdl.reference.opt.http__user_agent.user_agent.overload1 more...]]``
-
- explicit ``[link urdl.reference.opt.http__user_agent.user_agent.overload2 user_agent]``(
- const std::string & v);
- `` [''''»''' [link urdl.reference.opt.http__user_agent.user_agent.overload2 more...]]``
-
-
-[section:overload1 http::user_agent::user_agent (1 of 2 overloads)]
-
-
-Constructs an object of class `user_agent`.
-
-
- user_agent();
-
-
-
-['[*Remarks]]
-
-Postcondition: `value() == ""`.
-
-
-
-[endsect]
-
-
-
-[section:overload2 http::user_agent::user_agent (2 of 2 overloads)]
-
-
-Constructs an object of class `user_agent`.
-
-
- explicit user_agent(
- const std::string & v);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[v][The desired value for the option.]]
-
-]
-
-['[*Remarks]]
-
-Postcondition: `value() == v`
-
-
-
-[endsect]
-
-
-[endsect]
-
-[section:value http::user_agent::value]
-
-[indexterm2 value..http::user_agent]
-Gets the value of the option.
-
-
- std::string ``[link urdl.reference.opt.http__user_agent.value.overload1 value]``() const;
- `` [''''»''' [link urdl.reference.opt.http__user_agent.value.overload1 more...]]``
-
-
-Sets the value of the option.
-
-
- void ``[link urdl.reference.opt.http__user_agent.value.overload2 value]``(
- const std::string & v);
- `` [''''»''' [link urdl.reference.opt.http__user_agent.value.overload2 more...]]``
-
-
-[section:overload1 http::user_agent::value (1 of 2 overloads)]
-
-
-Gets the value of the option.
-
-
- std::string value() const;
-
-
-
-['[*Return Value]]
-
-The value of the option.
-
-
-
-[endsect]
-
-
-
-[section:overload2 http::user_agent::value (2 of 2 overloads)]
-
-
-Sets the value of the option.
-
-
- void value(
- const std::string & v);
-
-
-
-['[*Parameters]]
-
-
-[variablelist
-
-[[v][The desired value for the option.]]
-
-]
-
-['[*Remarks]]
-
-Postcondition: `value() == v`
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-[endsect]
-
-
-[endsect]
-
-[section:err Error Handling]
-
-
-
-[section:http__errc__errc_t http::errc::errc_t]
-
-[indexterm1 http::errc::errc_t]
-HTTP error codes.
-
-
- enum errc_t
-
-['[*Values]]
-[variablelist
-
- [
- [malformed_status_line]
- [The response's status line was malformed. ]
- ]
-
- [
- [malformed_response_headers]
- [The response's headers were malformed. ]
- ]
-
- [
- [continue_request]
- [The server-generated status code "100 Continue". ]
- ]
-
- [
- [switching_protocols]
- [The server-generated status code "101 Switching Protocols". ]
- ]
-
- [
- [ok]
- [The server-generated status code "200 OK". ]
- ]
-
- [
- [created]
- [The server-generated status code "201 Created". ]
- ]
-
- [
- [accepted]
- [The server-generated status code "202 Accepted". ]
- ]
-
- [
- [non_authoritative_information]
- [The server-generated status code "203 Non-Authoritative Information". ]
- ]
-
- [
- [no_content]
- [The server-generated status code "204 No Content". ]
- ]
-
- [
- [reset_content]
- [The server-generated status code "205 Reset Content". ]
- ]
-
- [
- [partial_content]
- [The server-generated status code "206 Partial Content". ]
- ]
-
- [
- [multiple_choices]
- [The server-generated status code "300 Multiple Choices". ]
- ]
-
- [
- [moved_permanently]
- [The server-generated status code "301 Moved Permanently". ]
- ]
-
- [
- [found]
- [The server-generated status code "302 Found". ]
- ]
-
- [
- [see_other]
- [The server-generated status code "303 See Other". ]
- ]
-
- [
- [not_modified]
- [The server-generated status code "304 Not Modified". ]
- ]
-
- [
- [use_proxy]
- [The server-generated status code "305 Use Proxy". ]
- ]
-
- [
- [temporary_redirect]
- [The server-generated status code "307 Temporary Redirect". ]
- ]
-
- [
- [bad_request]
- [The server-generated status code "400 Bad Request". ]
- ]
-
- [
- [unauthorized]
- [The server-generated status code "401 Unauthorized". ]
- ]
-
- [
- [payment_required]
- [The server-generated status code "402 Payment Required". ]
- ]
-
- [
- [forbidden]
- [The server-generated status code "403 Forbidden". ]
- ]
-
- [
- [not_found]
- [The server-generated status code "404 Not Found". ]
- ]
-
- [
- [method_not_allowed]
- [The server-generated status code "405 Method Not Allowed". ]
- ]
-
- [
- [not_acceptable]
- [The server-generated status code "406 Not Acceptable". ]
- ]
-
- [
- [proxy_authentication_required]
- [The server-generated status code "407 Proxy Authentication Required". ]
- ]
-
- [
- [request_timeout]
- [The server-generated status code "408 Request Time-out". ]
- ]
-
- [
- [conflict]
- [The server-generated status code "409 Conflict". ]
- ]
-
- [
- [gone]
- [The server-generated status code "410 Gone". ]
- ]
-
- [
- [length_required]
- [The server-generated status code "411 Length Required". ]
- ]
-
- [
- [precondition_failed]
- [The server-generated status code "412 Precondition Failed". ]
- ]
-
- [
- [request_entity_too_large]
- [The server-generated status code "413 Request Entity Too Large". ]
- ]
-
- [
- [request_uri_too_large]
- [The server-generated status code "414 Request URI Too Large". ]
- ]
-
- [
- [unsupported_media_type]
- [The server-generated status code "415 Unsupported Media Type". ]
- ]
-
- [
- [requested_range_not_satisfiable]
- [The server-generated status code "416 Requested Range Not Satisfiable". ]
- ]
-
- [
- [expectation_failed]
- [The server-generated status code "417 Expectation Failed". ]
- ]
-
- [
- [internal_server_error]
- [The server-generated status code "500 Internal Server Error". ]
- ]
-
- [
- [not_implemented]
- [The server-generated status code "501 Not Implemented". ]
- ]
-
- [
- [bad_gateway]
- [The server-generated status code "502 Bad Gateway". ]
- ]
-
- [
- [service_unavailable]
- [The server-generated status code "503 Service Unavailable". ]
- ]
-
- [
- [gateway_timeout]
- [The server-generated status code "504 Gateway Timeout". ]
- ]
-
- [
- [version_not_supported]
- [The server-generated status code "505 HTTP Version Not Supported". ]
- ]
-
-]
-
-
-The enumerators of type `errc_t` are implicitly convertible to objects of type `boost::system::error_code`.
-
-
-['[*Requirements]]
-
-[*Header:] ``
-
-[*Namespace:] `urdl::http`
-
-
-
-[endsect]
-
-
-
-[section:http__errc__make_error_code http::errc::make_error_code]
-
-[indexterm1 http::errc::make_error_code]
-Converts a value of type `errc_t` to a corresponding object of type `boost::system::error_code`.
-
-
- boost::system::error_code make_error_code(
- errc_t e);
-
-
-
-['[*Requirements]]
-
-[*Header:] ``
-
-[*Namespace:] `urdl::http`
-
-
-
-[endsect]
-
-
-
-[section:http__error_category http::error_category]
-
-[indexterm1 http::error_category]
-Gets the error category for HTTP errors.
-
-
- const boost::system::error_category & error_category();
-
-
-
-['[*Return Value]]
-
-The `boost::system::error_category` used for HTTP errors.
-
-['[*Requirements]]
-
-[*Header:] ``
-
-[*Namespace:] `urdl::http`
-
-
-
-[endsect]
-
-
-
-[endsect]
-
-
-[endsect]
diff --git a/thirdparty/urdl-2013-08-15/doc/reference.xsl b/thirdparty/urdl-2013-08-15/doc/reference.xsl
deleted file mode 100644
index f0f8002..0000000
--- a/thirdparty/urdl-2013-08-15/doc/reference.xsl
+++ /dev/null
@@ -1,1251 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[/
- / Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
- /
- / Distributed under the Boost Software License, Version 1.0. (See accompanying
- / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- /]
-
-[section:reference Reference]
-
-
-
-[section:core Core Classes]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[endsect]
-
-[section:opt Options]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[endsect]
-
-[section:err Error Handling]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[endsect]
-
-
- [endsect]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- err.
-
-
- opt.
-
-
- core.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-['[* ]]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ``
-
-
-
-
-
- ``
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-` `
-
-
-
-
-` `
-
-
-
-
-*
-
-
-
-
-[* ]
-
-
-
-
-
-['[*Parameters]]
-
-
-['[*Exceptions]]
-
-
-
-[variablelist
-
-]
-
-
-
-
-[[ ][ ]]
-
-
-
-
-
-
-['[*Return Value]]
-
-
-
-
-
-['[*Remarks]]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- \_
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[link urdl.reference. ]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[section: ]
-
-[indexterm2
-
-..class]
-
-
-
-
-
- :
-
- public ,
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[endsect]
-
-
-
-
-
-
-
-['[*Types]]
-[table
- [[Name][Description]]
-
-
- [
-
-
- [[link urdl.reference. .
- [* ]]]
- [ ]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [[link urdl.reference.
- [* ]]]
- [ ]
-
-
- ]
-
-]
-
-
-
-['[*Member Functions]]
-[table
- [[Name][Description]]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [
- [[link urdl.reference. .
- [*]]]
- [
-
-
-
-
-
-
-
-
- ]
- ]
-
-
-
-]
-
-
-
-['[*Protected Member Functions]]
-[table
- [[Name][Description]]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [
- [[link urdl.reference. .
- [*]]]
- [
-
-
-
-
-
-
-
-
- ]
- ]
-
-
-
-]
-
-
-
-['[*Data Members]]
-[table
- [[Name][Description]]
-
-
- [
- [[link urdl.reference. .
- [* ]]]
- [ ]
- ]
-
-]
-
-
-
-['[*Protected Data Members]]
-[table
- [[Name][Description]]
-
-
- [
- [[link urdl.reference. .
- [* ]]]
- [ ]
- ]
-
-]
-
-
-
-['[*Friends]]
-[table
- [[Name][Description]]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [
- [[link urdl.reference. .
- [*]]]
- [
-
-
-
-
-
-
-
-
- ]
- ]
-
-
-
-]
-
-
-
-['[*Related Functions]]
-[table
- [[Name][Description]]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [
- [[link urdl.reference. .
- [*]]]
- [
-
-
-
-
-
-
-
-
- ]
- ]
-
-
-
-]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[section:
- :: ]
-
-[indexterm2
-
-..
-
-]
-
-
-
-
-
-
-
-
-
-
-
-
- static explicit
- ``[link urdl.reference. . .overload ]``( ) const ;
- `` [''''»'''
- [link urdl.reference.
- . .overload
- more...]]``
-
-
-
-
-[section:
-overload
- ::
- ( of overloads) ]
-
-
-
-
-['Inherited from
-
- .]
-
-
-
-
- [indexterm2
-
- ..
-
- ]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-
-
-
-
-
- typedef ;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- static
- =
- ;
-
-
-
-
- enum
-
-['[*Values]]
-[variablelist
-
- [
- [ ]
- [ ]
- ]
-
-]
-
-
-
-
-
-
-
- static explicit
- ( ) const ;
-
-
-
-
- template< >
-
-
-
-
-
-
-
- = ,
-
-
-
-
-
- = ,
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[section: ]
-
-[indexterm1
-
-]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ``[link urdl.reference. .overload
-]``(
- );
- `` [''''»'''
- [link urdl.reference.
- .overload
- more...]]``
-
-
-
-
-
-
-
-
-
-[section:
-overload
-
- ( of overloads) ]
-
-
- [indexterm1
-
- ]
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[endsect]
-
-
-[endsect]
-
-
-
-
-
diff --git a/thirdparty/urdl-2013-08-15/doc/std_dox.txt b/thirdparty/urdl-2013-08-15/doc/std_dox.txt
deleted file mode 100644
index 3fc0f26..0000000
--- a/thirdparty/urdl-2013-08-15/doc/std_dox.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-/**
-\class std::basic_istream
-*/
-
-/**
-\class std::streambuf
-*/
diff --git a/thirdparty/urdl-2013-08-15/doc/urdl.png b/thirdparty/urdl-2013-08-15/doc/urdl.png
deleted file mode 100755
index 780182f..0000000
Binary files a/thirdparty/urdl-2013-08-15/doc/urdl.png and /dev/null differ
diff --git a/thirdparty/urdl-2013-08-15/doc/urdl.qbk b/thirdparty/urdl-2013-08-15/doc/urdl.qbk
deleted file mode 100644
index 4b2dad1..0000000
--- a/thirdparty/urdl-2013-08-15/doc/urdl.qbk
+++ /dev/null
@@ -1,556 +0,0 @@
-[/
- / Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
- /
- / Distributed under the Boost Software License, Version 1.0. (See accompanying
- / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- /]
-
-[library Urdl
- [quickbook 1.4]
- [copyright 2009-2013 Christopher M. Kohlhoff]
- [purpose Networking/HTTP library]
- [license
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENSE_1_0.txt or copy at
- [@http://www.boost.org/LICENSE_1_0.txt])
- ]
- [category template]
- [category generic]
-]
-
-[template indexterm1[term1] ''''''[term1]''' ''']
-[template indexterm2[term1 term2] ''''''[term1]''' '''[term2]''' ''']
-[def SyncReadStream [@http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/reference/SyncReadStream.html SyncReadStream]]
-[def AsyncReadStream [@http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/reference/AsyncReadStream.html AsyncReadStream]]
-[def boost::asio::read [@http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/reference/read.html boost::asio::read]]
-[def boost::asio::read_until [@http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/reference/read_until.html boost::asio::read_until]]
-[def boost::asio::async_read [@http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/reference/async_read.html boost::asio::async_read]]
-[def boost::asio::async_read_until [@http://www.boost.org/doc/libs/1_39_0/doc/html/boost_asio/reference/async_read_until.html boost::asio::async_read_until]]
-
-[/=============================================================================]
-
-[heading What is Urdl?]
-
-Urdl is a cross-platform C++ library for downloading web content using a URL.
-It provides an easy-to-use extension to standard C++ iostreams and an
-asynchronous interface for use with Boost.Asio.
-
-[heading What can Urdl be used for?]
-
-Possible uses for Urdl include:
-
-* Downloading application configuration or data files.
-
-* Downloading software updates.
-
-* Accessing RSS feeds.
-
-* Web service clients (e.g. SOAP, XML-RPC or REST).
-
-* Web scraping.
-
-[heading Obtaining Urdl]
-
-The latest release of Urdl can be downloaded from
-[@http://sourceforge.net/project/showfiles.php?group_id=262090 SourceForge.net].
-
-[/=============================================================================]
-
-[section:rationale Rationale]
-
-The primary goal of Urdl is:
-
-* To provide a simple abstraction for accessing and downloading internet
- resources.
-
-Some secondary goals include:
-
-* To act as an example of using Boost.Asio to create client-side abstractions.
-
-* To act as an example of how to extend the Boost.System `error_code` facility.
-
-* To explore the use of coroutine for implementing protocols using Boost.Asio.
-
-[endsect]
-
-[/=============================================================================]
-
-[section:features Features]
-
-* [*Support for HTTP, HTTPS and local files.]
-
-[:Resources may be downloaded using HTTP 1.0 (using URLs of the form
- `"http://..."`), HTTPS (`"https://..."`). Local files are also supported
- (`"file://..."`). See [link urdl.planned_features Planned Features] for
- limitations in the current protocol implementations.]
-
-* [*Extension to C++ IOStreams.]
-
-[:The [link urdl.reference.core.istream urdl::istream] class provides a way to
- easily access content using standard C++ I/O facilities.]
-
-* [*Integration with Boost.Asio.]
-
-[:The [link urdl.reference.core.read_stream urdl::read_stream] class allows
- Urdl functionality to be used with other Boost.Asio features such as sockets
- and timers.]
-
-[endsect]
-
-[/=============================================================================]
-
-[section:planned_features Planned features]
-
-The following features are planned for a future release of Urdl:
-
-* [*Support for HTTP chunking.]
-
-[:Add the ability to handle HTTP responses where the [^Transfer-Encoding] is
- [^chunked].]
-
-* [*Support for HTTP proxies.]
-
-[:Add support for making HTTP and HTTPS requests through a proxy.]
-
-* [*Support for FTP.]
-
-[:Add support for downloading files using FTP.]
-
-* [*SSL options to control peer verification.]
-
-[:Add new options for controlling the way Urdl uses SSL to implement HTTPS, e.g.
- the ability to specify a certificate authority file or directory, whether
- peers are verified, etc. The current implementation always verifies the
- peer using OpenSSL's default certificate chains.]
-
-* [*Support for wildcard SSL certificates.]
-
-[:The current implementation of SSL peer verification supports only certificates
- issued to a single hostname.]
-
-* [*Status function callback.]
-
-[:Allow the user to register a `boost::function<>` object using `set_option()`.
- This will be called by the implementation to provide progress updates (e.g.
- resolving, connection, reading, etc).]
-
-* [*Runtime polymorphism and user-supplied backends.]
-
-[:Change the underlying implementation to use runtime polymorphism (abstract
- base classes) to invoke the appropriate protocol implementation. The user
- will be able to register a factory object to provide custom support for
- additional protocols.]
-
-[endsect]
-
-[/=============================================================================]
-
-[section:prerequisites Prerequisites]
-
-Urdl depends on the following libraries:
-
-* [@http://www.boost.org/ Boost] 1.38 or later.
-
-* [@http://www.openssl.org/ OpenSSL] (optional) for HTTPS support.
-
-[endsect]
-
-[/=============================================================================]
-
-[section:platforms Supported platforms]
-
-Urdl has been tested on the following platforms and compilers:
-
-* Debian Linux 5.0 using g++ 4.1.
-
-* Debian Linux 5.0 using g++ 4.3.
-
-* Mac OS X 10.4 using g++ 4.0.1
-
-* Windows using MinGW / g++ 3.4.5
-
-* Windows using Visual C++ 8.0
-
-* Windows using Visual C++ 9.0
-
-[endsect]
-
-[/=============================================================================]
-
-[section:getting_started Getting started]
-
-[section:building Building and using Urdl]
-
-There are three options for using Urdl in an application:
-
-* as a separately compiled library;
-
-* by compiling the source directly into the application; or
-
-* as a header-file-only library.
-
-[heading Using Urdl as a separately compiled library]
-
-Urdl uses [^bjam] and Boost.Build to build shared and static libraries. To
-build the libraries, perform the following steps:
-
-# Set a [^BOOST_ROOT] environment variable pointing to the location of Boost.
-
-# If building on Windows, set an [^OPENSSL_ROOT] environment variable pointing
- to the location of OpenSSL. When building on UNIX, the build scripts assume
- that the OpenSSL headers and libraries may be found in the system's include
- and library paths, respectively. To disable Urdl's SSL support, define
- [^URDL_DISABLE_SSL=1] as an environment variable.
-
-# Run [^bjam] in the top-level directory of the Urdl distribution. Libraries
- should be built into the [^lib] subdirectory.
-
-Then, to use Urdl in an application:
-
-# Add the [^include] subdirectory to your compiler's include path.
-
-# Add the [^lib] subdirectory to your linker's library path.
-
-# Add the Boost directory to your compiler's include path.
-
-# Add the Boost library directory (e.g. [^stage/lib]) to your linker's library
- path. Urdl needs the application to link against the Boost.System and
- Boost.Date_Time libraries.
-
-# If disabling Urdl's SSL support, add [^URDL_DISABLE_SSL=1] to your compiler's
- preprocessor definitions.
-
-# If using the DLL version of Urdl on Windows, add [^URDL_DYN_LINK=1] to your
- compiler's preprocessor definitions.
-
-[heading Compiling Urdl directly into an application]
-
-To compile Urdl directly into an application, perform the following steps:
-
-# Add the [^include] subdirectory to your compiler's include path.
-
-# Add the file [^src/urdl.cpp] to your project or makefile.
-
-# Add the Boost directory to your compiler's include path.
-
-# Add the Boost library directory (e.g. [^stage/lib]) to your linker's library
- path. Urdl needs the application to link against the Boost.System and
- Boost.Date_Time libraries.
-
-# If disabling Urdl's SSL support, add [^URDL_DISABLE_SSL=1] to your compiler's
- preprocessor definitions.
-
-# If building on Windows, add [^URDL_NO_LIB=1] to your compiler's preprocessor
- definitions to disable autolinking.
-
-[heading Using Urdl as a header-only library]
-
-To use Urdl as a header-only library, perform the following steps:
-
-# Add the [^include] subdirectory to your compiler's include path.
-
-# Add the Boost directory to your compiler's include path.
-
-# Add the Boost library directory (e.g. [^stage/lib]) to your linker's library
- path. Urdl needs the application to link against the Boost.System library and
- possibly the Boost.Date_Time library.
-
-# If disabling Urdl's SSL support, add [^URDL_DISABLE_SSL=1] to your compiler's
- preprocessor definitions.
-
-# Add [^URDL_HEADER_ONLY=1] to your compiler's preprocessor definitions.
-
-[endsect]
-
-[section Downloading a file using an istream]
-
-The simplest use of Urdl is to download a file or other resource using the
-[link urdl.reference.core.istream urdl::istream] class.
-
- // For std::cout and std::cerr.
- #include
- #include
-
- // For urdl::istream. Each of Urdl's core classes has its own header file.
- #include
-
- int main()
- {
- // Open the URL. The connection is established and the HTTP request is sent.
- urdl::istream is("http://www.boost.org/LICENSE_1_0.txt");
-
- // Check whether we opened the URL successfully.
- if (!is)
- {
- std::cerr << "Unable to open URL" << std::endl;
- return 1;
- }
-
- // From here on, we can use urdl::istream like any other std::istream
- // object. Let's output the downloaded content one line at a time.
- std::string line;
- while (std::getline(is, line))
- {
- std::cout << line << std::endl;
- }
- }
-
-[endsect]
-
-[section Checking for errors]
-
-If we are unable to open a URL for any reason, we can find out the last error
-from the [link urdl.reference.core.istream urdl::istream] class:
-
- urdl::istream is("http://somehost/path");
- if (!is)
- {
- std::cerr << "Unable to open URL: ";
- std::cerr << is.error().message() << std::endl;
- return 1;
- }
-
-Alternatively, we may test for a specific error:
-
- // For the HTTP error codes.
- #include
-
- ...
-
- urdl::istream is("http://somehost/path");
- if (!is)
- {
- if (is.error() == urdl::http::errc::not_found)
- {
- // Hmm, maybe we can try downloading the file from somewhere else...
- }
- }
-
-[endsect]
-
-[section Setting options to perform an HTTP POST]
-
-To upload over HTTP, we set the [link urdl.reference.opt.http__request_method
-http::request_method], [link urdl.reference.opt.http__request_content
-http::request_content] and [link urdl.reference.opt.http__request_content_type
-http::request_content_type] options on the stream prior to opening the URL:
-
- // For the HTTP options.
- #include
-
- ...
-
- urdl::istream is;
-
- // We're doing an HTTP POST ...
- is.set_option(urdl::http::request_method("POST"));
-
- // ... where the MIME type indicates plain text ...
- is.set_option(urdl::http::request_content_type("text/plain"));
-
- // ... and here's the content.
- is.set_option(urdl::http::request_content("Hello, world!"));
-
- // All options set, so now we can open the URL.
- is.open("http://somehost/path");
-
-[endsect]
-
-[section Grouping and reusing options]
-
-Options may be grouped using an [link urdl.reference.core.option_set
-urdl::option_set] object. This allows the options to be reused across multiple
-requests.
-
- // For urdl::option_set.
- #include
-
- ...
-
- urdl::option_set common_options;
-
- // Prevent HTTP redirections.
- common_options.set_option(urdl::http::max_redirects(0));
-
- // Tell the web server about Urdl.
- common_options.set_option(urdl::http::user_agent("Urdl"));
-
- // Open a URL using only the common options.
- urdl::istream is1("http://somehost/path1", common_options);
-
- // Open a URL with additional options. In this case, the common options are
- // applied to the stream as if we had called set_option invidiually for each
- // option in the set.
- urdl::istream is2;
- is2.set_option(urdl::http::request_method("POST"));
- is2.set_option(urdl::http::request_content_type("text/plain"));
- is2.set_option(urdl::http::request_content("Hello, world!"));
- is2.set_options(common_options);
-
-[endsect]
-
-[section Specifying timeouts]
-
-To prevent unresponsive servers from indefinitely hanging a program, the [link
-urdl.reference.core.istream urdl::istream] class uses a timeout when opening
-the stream and when reading content.
-
- urdl::istream is;
-
- // Fail if the URL cannot be opened within 60 seconds.
- is.open_timeout(60000);
- is.open("http://somehost/path");
-
- if (!is)
- {
- // If the open operation timed out then:
- // is.error() == boost::system::errc::timed_out
- // holds true.
- }
-
- ...
-
- // Fail if an individual read does not complete within 30 seconds.
- is.read_timeout(30000);
-
- // From here on, use urdl::istream like any other std::istream object.
- std::string line;
- while (std::getline(is, line))
- {
- std::cout << line << std::endl;
- }
-
- // If a read operation timed out then:
- // is.error() == boost::system::errc::timed_out
- // holds true.
-
-[endsect]
-
-[section Parsing URLs]
-
-The [link urdl.reference.core.url urdl::url] class gives us the ability to parse
-URLs and access their component parts. The default constructor:
-
- // For urdl::url.
- #include
-
- ...
-
- urdl::url url("http://somehost/path");
-
-provides a conversion from `std::string` or `const char*` to URLs. If the URL
-does not parse correctly, the constructor throws an exception of type
-`boost::system::system_error`. It is this constructor that is used when we
-write:
-
- urdl::istream is("http://somehost/path");
-
-We can also use the [link urdl.reference.core.url.from_string
-urdl::url::from_string] static member function to explicitly parse a URL, with
-the option of choosing a throwing overload:
-
- urdl::url url = urdl::url::from_string("http://somehost/path");
-
-or an overload that does not throw an exception on failure:
-
- boost::system::error_code ec;
- urdl::url url = urdl::url::from_string("http://somehost/path", ec);
-
-[endsect]
-
-[section Integrating with Boost.Asio]
-
-The [link urdl.reference.core.read_stream urdl::read_stream] class allows
-applications to use Urdl's functionality in conjunction with Boost.Asio.
-
-To synchronously open a URL, we may use:
-
- // For urdl::read_stream.
- #include
-
- ...
-
- boost::asio::io_service io_service;
-
- ...
-
- // An urdl::read_stream must always have an associated io_service.
- urdl::read_stream stream(io_service);
-
- // Open the URL synchronously. Throws boost::system::system_error on failure.
- stream.open("http://somehost/path");
-
- ...
-
- // Alternatively, open the URL synchronously without throwing on error.
- boost::system::error_code ec;
- stream.open("http://somehost/path", ec);
-
-To asynchronously open a URL, we can write:
-
- void open_handler(const boost::system::error_code& ec)
- {
- if (ec)
- {
- // URL successfully opened.
- ...
- }
- else
- {
- std::cerr << "Unable to open URL: ";
- std::cerr << is.error().message() << std::endl;
- }
- }
-
- ...
-
- stream.async_open("http://somehost/path", open_handler);
-
-and the callback function `open_handler` will be invoked once the asynchronous
-operation completes.
-
-The [link urdl.reference.core.read_stream urdl::read_stream] class meets
-Boost.Asio's SyncReadStream and AsyncReadStream type requirements. This means
-we can use it with the synchronous functions boost::asio::read and
-boost::asio::read_until:
-
- boost::array data;
- boost::asio::read(stream, boost::asio::buffer(data));
-
- ...
-
- boost::asio::streambuf buffer;
- boost::asio::read_until(stream, buffer, "\r\n");
-
-or with the asynchronous functions boost::asio::async_read and
-boost::asio::async_read_until:
-
- void read_handler(const boost::system::error_code& ec, std::size_t length)
- {
- ...
- }
-
- ...
-
- boost::array data;
- boost::asio::async_read(stream, boost::asio::buffer(data), read_handler);
-
- ...
-
- boost::asio::streambuf buffer;
- boost::asio::async_read_until(stream, buffer, "\r\n", read_handler);
-
-The asynchronous functions on the [link urdl.reference.core.read_stream
-urdl::read_stream] class allow concurrent access to multiple URLs without
-requiring additional threads. Furthermore, we can perform the operations
-concurrently with any of the other asynchronous facilities provided by
-Boost.Asio (sockets, timers and so on).
-
-[endsect]
-
-[endsect]
-
-[/=============================================================================]
-
-[include reference.qbk]
-[xinclude index.xml]
diff --git a/thirdparty/urdl-2013-08-15/example/Jamfile b/thirdparty/urdl-2013-08-15/example/Jamfile
deleted file mode 100644
index 7fa3ad8..0000000
--- a/thirdparty/urdl-2013-08-15/example/Jamfile
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-#
-# Distributed under the Boost Software License, Version 1.0. (See accompanying
-# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-#
-
-project
- :
- requirements ../build//urdl
- :
- default-build
- debug
- multi
- shared
- shared
- ;
-
-exe get1 : get1.cpp ;
-exe get2 : get2.cpp ;
-exe multiget1 : multiget1.cpp ;
-
-explicit multiget2 ;
-exe multiget2 : multiget2.cpp
- /boost/context//boost_context
- /boost/coroutine//boost_coroutine
- ;
diff --git a/thirdparty/urdl-2013-08-15/example/get1.cpp b/thirdparty/urdl-2013-08-15/example/get1.cpp
deleted file mode 100644
index c196010..0000000
--- a/thirdparty/urdl-2013-08-15/example/get1.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// get1.cpp
-// ~~~~~~~~
-//
-// Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#include
-#include
-#include
-#include
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 3)
- {
- std::cerr << "Usage: get1 \n";
- return 1;
- }
-
- urdl::istream is(argv[1]);
- if (!is)
- {
- std::cout << is.error().message() << std::endl;
- return 1;
- }
-
- std::ofstream os(argv[2], std::ios_base::out | std::ios_base::binary);
- if (is.content_length() != std::numeric_limits::max())
- {
- boost::progress_display progress(is.content_length());
- while (is && os)
- {
- char buffer[1024] = "";
- is.read(buffer, sizeof(buffer));
- os.write(buffer, is.gcount());
- progress += is.gcount();
- }
- std::cout << std::endl;
- }
- else
- {
- os << is.rdbuf();
- }
-
- std::cout << is.error().message() << std::endl;
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << std::endl;
- }
-}
diff --git a/thirdparty/urdl-2013-08-15/example/get2.cpp b/thirdparty/urdl-2013-08-15/example/get2.cpp
deleted file mode 100644
index 0fb2d68..0000000
--- a/thirdparty/urdl-2013-08-15/example/get2.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// get2.cpp
-// ~~~~~~~~
-//
-// Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#include
-#include
-#include
-#include
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc != 3)
- {
- std::cerr << "Usage: get2 \n";
- return 1;
- }
-
- boost::asio::io_service io_service;
-
- urdl::read_stream stream(io_service);
- stream.open(argv[1]);
-
- std::ofstream os(argv[2], std::ios_base::out | std::ios_base::binary);
- for (;;)
- {
- char data[1024];
- boost::system::error_code ec;
- std::size_t length = stream.read_some(boost::asio::buffer(data), ec);
- if (ec == boost::asio::error::eof)
- break;
- if (ec)
- throw boost::system::system_error(ec);
- os.write(data, length);
- }
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << std::endl;
- }
-}
diff --git a/thirdparty/urdl-2013-08-15/example/multiget1.cpp b/thirdparty/urdl-2013-08-15/example/multiget1.cpp
deleted file mode 100644
index 8873419..0000000
--- a/thirdparty/urdl-2013-08-15/example/multiget1.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-//
-// multiget1.cpp
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-class downloader
- : public boost::enable_shared_from_this
-{
-public:
- downloader(boost::asio::io_service& io_service)
- : read_stream_(io_service)
- {
- }
-
- void start(const urdl::url& url, const std::string& file)
- {
- file_ = file;
- read_stream_.async_open(url,
- boost::bind(&downloader::handle_open,
- shared_from_this(), _1));
- }
-
-private:
- void handle_open(const boost::system::error_code& ec)
- {
- if (!ec)
- {
- ofstream_.open(file_.c_str(), std::ios_base::out | std::ios_base::binary);
- read_stream_.async_read_some(
- boost::asio::buffer(buffer_),
- boost::bind(&downloader::handle_read,
- shared_from_this(), _1, _2));
- }
- }
-
- void handle_read(const boost::system::error_code& ec, std::size_t length)
- {
- if (!ec)
- {
- ofstream_.write(buffer_, length);
- read_stream_.async_read_some(
- boost::asio::buffer(buffer_),
- boost::bind(&downloader::handle_read,
- shared_from_this(), _1, _2));
- }
- }
-
- urdl::read_stream read_stream_;
- std::string file_;
- std::ofstream ofstream_;
- char buffer_[1024];
-};
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc < 3 || argc % 2 == 0)
- {
- std::cerr << "Usage: multiget1 ";
- std::cerr << "[ ...]\n";
- return 1;
- }
-
- boost::asio::io_service io_service;
-
- for (int i = 1; i < argc; i += 2)
- {
- boost::shared_ptr d(new downloader(io_service));
- d->start(argv[i], argv[i + 1]);
- }
-
- io_service.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << std::endl;
- }
-}
diff --git a/thirdparty/urdl-2013-08-15/example/multiget2.cpp b/thirdparty/urdl-2013-08-15/example/multiget2.cpp
deleted file mode 100644
index c9e771d..0000000
--- a/thirdparty/urdl-2013-08-15/example/multiget2.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// multiget2.cpp
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-void download(boost::asio::io_service& io_service,
- const urdl::url& url, const std::string& file,
- boost::asio::yield_context yield)
-{
- try
- {
- urdl::read_stream read_stream(io_service);
- read_stream.async_open(url, yield);
-
- std::ofstream ofstream(file.c_str(),
- std::ios_base::out | std::ios_base::binary);
-
- char buffer[1024];
- std::size_t length;
- boost::system::error_code ec;
-
- do
- {
- length = read_stream.async_read_some(
- boost::asio::buffer(buffer), yield[ec]);
- ofstream.write(buffer, length);
- } while (length > 0);
- }
- catch (std::exception& e)
- {
- std::cerr << "Download exception: " << e.what() << std::endl;
- }
-}
-
-int main(int argc, char* argv[])
-{
- try
- {
- if (argc < 3 || argc % 2 == 0)
- {
- std::cerr << "Usage: multiget2 ";
- std::cerr << "[ ...]\n";
- return 1;
- }
-
- boost::asio::io_service io_service;
-
- for (int i = 1; i < argc; i += 2)
- {
- boost::asio::spawn(io_service,
- boost::bind(download, boost::ref(io_service),
- urdl::url(argv[i]), std::string(argv[i + 1]), _1));
- }
-
- io_service.run();
- }
- catch (std::exception& e)
- {
- std::cerr << "Exception: " << e.what() << std::endl;
- }
-}
diff --git a/thirdparty/urdl-2013-08-15/include/urdl/detail/abi_prefix.hpp b/thirdparty/urdl-2013-08-15/include/urdl/detail/abi_prefix.hpp
deleted file mode 100644
index 9351c81..0000000
--- a/thirdparty/urdl-2013-08-15/include/urdl/detail/abi_prefix.hpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//
-// abi_prefix.hpp
-// ~~~~~~~~~~~~~~
-//
-// Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-// No include guard.
-
-#include
-
-// Disable some pesky MSVC warnings.
-#if defined(_MSC_VER)
-# pragma warning (push)
-# pragma warning (disable:4127)
-# pragma warning (disable:4251)
-# pragma warning (disable:4355)
-# pragma warning (disable:4512)
-# pragma warning (disable:4996)
-#endif // defined(_MSC_VER)
-
-// Force external visibility of all types.
-#if defined(__GNUC__)
-# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
-# pragma GCC visibility push (default)
-# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
-#endif // defined(__GNUC__)
-
diff --git a/thirdparty/urdl-2013-08-15/include/urdl/detail/abi_suffix.hpp b/thirdparty/urdl-2013-08-15/include/urdl/detail/abi_suffix.hpp
deleted file mode 100644
index 78f1766..0000000
--- a/thirdparty/urdl-2013-08-15/include/urdl/detail/abi_suffix.hpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// abi_suffix.hpp
-// ~~~~~~~~~~~~~~
-//
-// Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-// No include guard.
-
-#if defined(_MSC_VER)
-# pragma warning (pop)
-#endif // defined(_MSC_VER)
-
-#if defined(__GNUC__)
-# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
-# pragma GCC visibility pop
-# endif // (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
-#endif // defined(__GNUC__)
-
-#include
diff --git a/thirdparty/urdl-2013-08-15/include/urdl/detail/config.hpp b/thirdparty/urdl-2013-08-15/include/urdl/detail/config.hpp
deleted file mode 100644
index 64832b2..0000000
--- a/thirdparty/urdl-2013-08-15/include/urdl/detail/config.hpp
+++ /dev/null
@@ -1,94 +0,0 @@
-//
-// config.hpp
-// ~~~~~~~~~~
-//
-// Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-// No include guard.
-
-#include
-#include
-
-#if defined(URDL_HEADER_ONLY)
-# define URDL_DECL inline
-#else // defined(URDL_HEADER_ONLY)
-# if defined(BOOST_HAS_DECLSPEC)
-// We need to import/export our code only if the user has specifically asked
-// for it by defining either BOOST_ALL_DYN_LINK if they want all boost
-// libraries to be dynamically linked (and if boost is dynamically linked, urdl
-// must be dynamically linked too), or URDL_DYN_LINK if they want just urdl to
-// be dynamically liked.
-# if defined(BOOST_ALL_DYN_LINK) || defined(URDL_DYN_LINK)
-# if !defined(URDL_DYN_LINK)
-# define URDL_DYN_LINK
-# endif // !defined(URDL_DYN_LINK)
-// Export if this is our own source, otherwise import.
-# if defined(URDL_SOURCE)
-# define URDL_DECL __declspec(dllexport)
-# else // defined(URDL_SOURCE)
-# define URDL_DECL __declspec(dllimport)
-# endif // defined(URDL_SOURCE)
-# endif // defined(BOOST_ALL_DYN_LINK) || defined(URDL_DYN_LINK)
-# endif // defined(BOOST_HAS_DECLSPEC)
-#endif // defined(URDL_HEADER_ONLY)
-
-// If URDL_DECL isn't defined yet define it now.
-#if !defined(URDL_DECL)
-# define URDL_DECL
-#endif // !defined(URDL_DECL)
-
-#if !defined(URDL_ERROR_CATEGORY_NOEXCEPT)
-# if (BOOST_VERSION >= 105300)
-# define URDL_ERROR_CATEGORY_NOEXCEPT BOOST_NOEXCEPT
-# else // (BOOOST_VERSION >= 105300)
-# define URDL_ERROR_CATEGORY_NOEXCEPT
-# endif // (BOOOST_VERSION >= 105300)
-#endif // !defined(URDL_ERROR_CATEGORY_NOEXCEPT)
-
-#if (BOOST_VERSION >= 105400)
-# define URDL_INITFN_RESULT_TYPE(h, sig) BOOST_ASIO_INITFN_RESULT_TYPE(h, sig)
-#else // (BOOST_VERSION >= 105400)
-# define URDL_INITFN_RESULT_TYPE(h, sig) void
-#endif // (BOOST_VERSION >= 105400)
-
-// Enable library autolinking for MSVC.
-
-#if !defined(BOOST_ALL_NO_LIB) && !defined(URDL_NO_LIB) \
- && !defined(URDL_SOURCE) && !defined(URDL_HEADER_ONLY) \
- && defined(_MSC_VER)
-
-# if !defined(_MT)
-# error "You must use the multithreaded runtime."
-# endif
-
-# if (defined(_DLL) || defined(_RTLDLL)) && defined(URDL_DYN_LINK)
-# define URDL_LIB_PREFIX
-# elif defined(URDL_DYN_LINK)
-# error "Mixing a dll library with a static runtime is unsupported."
-# else
-# define URDL_LIB_PREFIX "lib"
-# endif
-
-# if defined(_DEBUG)
-# if defined(_DLL)
-# define URDL_LIB_SUFFIX "-gd"
-# else
-# define URDL_LIB_SUFFIX "-sgd"
-# endif
-# else
-# if defined(_DLL)
-# define URDL_LIB_SUFFIX
-# else
-# define URDL_LIB_SUFFIX "-s"
-# endif
-# endif
-
-# pragma comment(lib, URDL_LIB_PREFIX "urdl" URDL_LIB_SUFFIX ".lib")
-
-#endif // !defined(BOOST_ALL_NO_LIB) && !defined(URDL_NO_LIB)
- // && !defined(URDL_SOURCE) && !defined(URDL_HEADER_ONLY)
- // && defined(_MSC_VER)
diff --git a/thirdparty/urdl-2013-08-15/include/urdl/detail/connect.hpp b/thirdparty/urdl-2013-08-15/include/urdl/detail/connect.hpp
deleted file mode 100644
index ca8e7cc..0000000
--- a/thirdparty/urdl-2013-08-15/include/urdl/detail/connect.hpp
+++ /dev/null
@@ -1,181 +0,0 @@
-//
-// connect.hpp
-// ~~~~~~~~~~~
-//
-// Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#ifndef URDL_DETAIL_CONNECT_HPP
-#define URDL_DETAIL_CONNECT_HPP
-
-#include
-#include
-#include "urdl/detail/coroutine.hpp"
-
-#include "urdl/detail/abi_prefix.hpp"
-
-namespace urdl {
-namespace detail {
-
-inline boost::system::error_code connect(
- boost::asio::ip::tcp::socket::lowest_layer_type& socket,
- boost::asio::ip::tcp::resolver& resolver,
- const url& u, boost::system::error_code& ec)
-{
- // Create a query that corresponds to the url.
- std::ostringstream port_string;
- port_string << u.port();
- boost::asio::ip::tcp::resolver::query query(u.host(), port_string.str());
-
- // Get a list of endpoints corresponding to the query.
- boost::asio::ip::tcp::resolver::iterator iter = resolver.resolve(query, ec);
- if (ec)
- return ec;
-
- // Try each endpoint until we successfully establish a connection.
- ec = boost::asio::error::host_not_found;
- while (ec && iter != boost::asio::ip::tcp::resolver::iterator())
- {
- socket.close(ec);
- socket.connect(*iter++, ec);
- }
- if (ec)
- return ec;
-
- // Disable the Nagle algorithm on all sockets.
- return socket.set_option(boost::asio::ip::tcp::no_delay(true), ec);
-}
-
-template
-class connect_coro : coroutine
-{
-public:
- connect_coro(Handler handler,
- boost::asio::ip::tcp::socket::lowest_layer_type& socket,
- boost::asio::ip::tcp::resolver& resolver)
- : handler_(handler),
- socket_(socket),
- resolver_(resolver)
- {
- }
-
- void operator()(boost::system::error_code ec,
- boost::asio::ip::tcp::resolver::iterator iter)
- {
- iter_ = iter;
- (*this)(ec);
- }
-
- void operator()(boost::system::error_code ec,
- const boost::asio::ip::tcp::resolver::query* query = 0)
- {
- URDL_CORO_BEGIN;
-
- // Open the socket to give the caller something to close to cancel the
- // asynchronous operation.
- socket_.open(boost::asio::ip::tcp::v4(), ec);
- if (ec)
- {
- URDL_CORO_YIELD(socket_.get_io_service().post(
- boost::asio::detail::bind_handler(*this, ec)));
- handler_(ec);
- return;
- }
-
- // Get a list of endpoints corresponding to the host name.
- URDL_CORO_YIELD(resolver_.async_resolve(*query, *this));
- if (ec)
- {
- handler_(ec);
- return;
- }
-
- // Try each endpoint until we successfully establish a connection.
- ec = boost::asio::error::host_not_found;
- while (ec && iter_ != boost::asio::ip::tcp::resolver::iterator())
- {
- // Check whether the operation has been cancelled.
- if (!socket_.is_open())
- {
- ec = boost::asio::error::operation_aborted;
- handler_(ec);
- return;
- }
-
- // Try next endpoint.
- socket_.close(ec);
- endpoint_ = *iter_++;
- URDL_CORO_YIELD(socket_.async_connect(endpoint_, *this));
- }
- if (ec)
- {
- handler_(ec);
- return;
- }
-
- // Check whether the operation has been cancelled.
- if (!socket_.is_open())
- {
- ec = boost::asio::error::operation_aborted;
- handler_(ec);
- return;
- }
-
- // Disable the Nagle algorithm on all sockets.
- socket_.set_option(boost::asio::ip::tcp::no_delay(true), ec);
-
- handler_(ec);
-
- URDL_CORO_END;
- }
-
- friend void* asio_handler_allocate(std::size_t size,
- connect_coro* this_handler)
- {
- using boost::asio::asio_handler_allocate;
- return asio_handler_allocate(size, &this_handler->handler_);
- }
-
- friend void asio_handler_deallocate(void* pointer, std::size_t size,
- connect_coro* this_handler)
- {
- using boost::asio::asio_handler_deallocate;
- asio_handler_deallocate(pointer, size, &this_handler->handler_);
- }
-
- template
- friend void asio_handler_invoke(const Function& function,
- connect_coro* this_handler)
- {
- using boost::asio::asio_handler_invoke;
- asio_handler_invoke(function, &this_handler->handler_);
- }
-
-private:
- Handler handler_;
- boost::asio::ip::tcp::socket::lowest_layer_type& socket_;
- boost::asio::ip::tcp::resolver& resolver_;
- boost::asio::ip::tcp::resolver::iterator iter_;
- boost::asio::ip::tcp::endpoint endpoint_;
-};
-
-template
-void async_connect(boost::asio::ip::tcp::socket::lowest_layer_type& socket,
- boost::asio::ip::tcp::resolver& resolver, const url& u, Handler handler)
-{
- std::ostringstream port_string;
- port_string << u.port();
- boost::asio::ip::tcp::resolver::query query(u.host(), port_string.str());
- connect_coro(handler, socket, resolver)(
- boost::system::error_code(), &query);
-}
-
-} // namespace detail
-} // namespace urdl
-
-#include "urdl/detail/abi_suffix.hpp"
-
-#endif // URDL_DETAIL_CONNECT_HPP
diff --git a/thirdparty/urdl-2013-08-15/include/urdl/detail/coroutine.hpp b/thirdparty/urdl-2013-08-15/include/urdl/detail/coroutine.hpp
deleted file mode 100644
index 072edaf..0000000
--- a/thirdparty/urdl-2013-08-15/include/urdl/detail/coroutine.hpp
+++ /dev/null
@@ -1,55 +0,0 @@
-//
-// coroutine.hpp
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#ifndef URDL_DETAIL_COROUTINE_HPP
-#define URDL_DETAIL_COROUTINE_HPP
-
-#include "urdl/detail/abi_prefix.hpp"
-
-namespace urdl {
-namespace detail {
-
-class coroutine
-{
-protected:
- coroutine() : coro_value_(0) {}
- int coro_value_;
-};
-
-#define URDL_CORO_BEGIN \
- switch (this->coroutine::coro_value_) \
- { \
- case 0:
-
-#define URDL_CORO_YIELD_IMPL(s,n) \
- do \
- { \
- this->coroutine::coro_value_ = n; \
- s; \
- return; \
- case n: \
- ; \
- } while (0)
-
-#if defined(_MSC_VER)
-# define URDL_CORO_YIELD(s) URDL_CORO_YIELD_IMPL(s, __COUNTER__ + 1)
-#else // defined(_MSC_VER)
-# define URDL_CORO_YIELD(s) URDL_CORO_YIELD_IMPL(s, __LINE__)
-#endif // defined(_MSC_VER)
-
-#define URDL_CORO_END \
- }
-
-} // namespace detail
-} // namespace urdl
-
-#include "urdl/detail/abi_suffix.hpp"
-
-#endif // URDL_DETAIL_COROUTINE_HPP
diff --git a/thirdparty/urdl-2013-08-15/include/urdl/detail/file_read_stream.hpp b/thirdparty/urdl-2013-08-15/include/urdl/detail/file_read_stream.hpp
deleted file mode 100644
index 99372c8..0000000
--- a/thirdparty/urdl-2013-08-15/include/urdl/detail/file_read_stream.hpp
+++ /dev/null
@@ -1,129 +0,0 @@
-//
-// file_read_stream.hpp
-// ~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#ifndef URDL_DETAIL_FILE_READ_STREAM_HPP
-#define URDL_DETAIL_FILE_READ_STREAM_HPP
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include "urdl/option_set.hpp"
-#include "urdl/url.hpp"
-
-#include "urdl/detail/abi_prefix.hpp"
-
-namespace urdl {
-namespace detail {
-
-class file_read_stream
-{
-public:
- explicit file_read_stream(boost::asio::io_service& io_service,
- option_set& options)
- : io_service_(io_service),
- options_(options)
- {
- }
-
- boost::system::error_code open(const url& u, boost::system::error_code& ec)
- {
- file_.clear();
- std::string path = u.path();
-#if defined(BOOST_WINDOWS)
- if (path.length() >= 3 && path[0] == '/'
- && std::isalpha(path[1]) && path[2] == ':')
- path = path.substr(1);
-#endif // defined(BOOST_WINDOWS)
- file_.open(path.c_str(), std::ios_base::in | std::ios_base::binary);
- if (!file_)
- {
- ec = make_error_code(boost::system::errc::no_such_file_or_directory);
- return ec;
- }
- ec = boost::system::error_code();
- return ec;
- }
-
- template
- void async_open(const url& u, Handler handler)
- {
- boost::system::error_code ec;
- open(u, ec);
- io_service_.post(boost::asio::detail::bind_handler(handler, ec));
- }
-
- boost::system::error_code close(boost::system::error_code& ec)
- {
- file_.close();
- file_.clear();
- ec = boost::system::error_code();
- return ec;
- }
-
- bool is_open() const
- {
- // Some older versions of libstdc++ have a non-const is_open().
- return const_cast(file_).is_open();
- }
-
- template
- std::size_t read_some(const MutableBufferSequence& buffers,
- boost::system::error_code& ec)
- {
- if (!file_)
- {
- ec = boost::asio::error::eof;
- return 0;
- }
-
- typename MutableBufferSequence::const_iterator iter = buffers.begin();
- typename MutableBufferSequence::const_iterator end = buffers.end();
- for (; iter != end; ++iter)
- {
- boost::asio::mutable_buffer buffer(*iter);
- size_t length = boost::asio::buffer_size(buffer);
- if (length > 0)
- {
- file_.read(boost::asio::buffer_cast(buffer), length);
- length = file_.gcount();
- if (length == 0 && !file_)
- ec = boost::asio::error::eof;
- return length;
- }
- }
-
- ec = boost::system::error_code();
- return 0;
- }
-
- template
- void async_read_some(const MutableBufferSequence& buffers, Handler handler)
- {
- boost::system::error_code ec;
- std::size_t bytes_transferred = read_some(buffers, ec);
- io_service_.post(boost::asio::detail::bind_handler(
- handler, ec, bytes_transferred));
- }
-
-private:
- boost::asio::io_service& io_service_;
- option_set& options_;
- std::ifstream file_;
-};
-
-} // namespace detail
-} // namespace urdl
-
-#include "urdl/detail/abi_suffix.hpp"
-
-#endif // URDL_DETAIL_FILE_READ_STREAM_HPP
diff --git a/thirdparty/urdl-2013-08-15/include/urdl/detail/handshake.hpp b/thirdparty/urdl-2013-08-15/include/urdl/detail/handshake.hpp
deleted file mode 100644
index e299c02..0000000
--- a/thirdparty/urdl-2013-08-15/include/urdl/detail/handshake.hpp
+++ /dev/null
@@ -1,279 +0,0 @@
-//
-// handshake.hpp
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#ifndef URDL_DETAIL_HANDSHAKE_HPP
-#define URDL_DETAIL_HANDSHAKE_HPP
-
-#include
-#include
-#include
-#include
-#include
-#include "urdl/detail/coroutine.hpp"
-
-#if !defined(URDL_DISABLE_SSL)
-# include
-# include
-#endif // !defined(URDL_DISABLE_SSL)
-
-#include "urdl/detail/abi_prefix.hpp"
-
-namespace urdl {
-namespace detail {
-
-inline boost::system::error_code handshake(
- boost::asio::ip::tcp::socket& /*socket*/,
- const std::string& /*host*/, boost::system::error_code& ec)
-{
- ec = boost::system::error_code();
- return ec;
-}
-
-template
-void async_handshake(boost::asio::ip::tcp::socket& socket,
- const std::string& /*host*/, Handler handler)
-{
- boost::system::error_code ec;
- socket.get_io_service().post(boost::asio::detail::bind_handler(handler, ec));
-}
-
-#if !defined(URDL_DISABLE_SSL)
-inline bool match_pattern(const char* pattern,
- std::size_t pattern_length, const char* host)
-{
- const char* p = pattern;
- const char* p_end = p + pattern_length;
- const char* h = host;
-
- while (p != p_end && *h)
- {
- if (*p == '*')
- {
- ++p;
- while (*h && *h != '.')
- if (match_pattern(p, p_end - p, h++))
- return true;
- }
- else if (std::tolower(*p) == std::tolower(*h))
- {
- ++p;
- ++h;
- }
- else
- {
- return false;
- }
- }
-
- return p == p_end && !*h;
-}
-
-inline bool certificate_matches_host(X509* cert, const std::string& host)
-{
- // Try converting host name to an address. If it is an address then we need
- // to look for an IP address in the certificate rather than a host name.
- boost::system::error_code ec;
- boost::asio::ip::address address
- = boost::asio::ip::address::from_string(host, ec);
- bool is_address = !ec;
-
- // Go through the alternate names in the certificate looking for matching DNS
- // or IP address entries.
- GENERAL_NAMES* gens = static_cast(
- X509_get_ext_d2i(cert, NID_subject_alt_name, 0, 0));
- for (int i = 0; i < sk_GENERAL_NAME_num(gens); ++i)
- {
- GENERAL_NAME* gen = sk_GENERAL_NAME_value(gens, i);
- if (gen->type == GEN_DNS && !is_address)
- {
- ASN1_IA5STRING* domain = gen->d.dNSName;
- if (domain->type == V_ASN1_IA5STRING
- && domain->data && domain->length)
- {
- const char* pattern = reinterpret_cast(domain->data);
- std::size_t pattern_length = domain->length;
- if (match_pattern(pattern, pattern_length, host.c_str()))
- {
- GENERAL_NAMES_free(gens);
- return true;
- }
- }
- }
- else if (gen->type == GEN_IPADD && is_address)
- {
- ASN1_OCTET_STRING* ip_address = gen->d.iPAddress;
- if (ip_address->type == V_ASN1_OCTET_STRING && ip_address->data)
- {
- if (address.is_v4() && ip_address->length == 4)
- {
- boost::asio::ip::address_v4::bytes_type address_bytes
- = address.to_v4().to_bytes();
- if (std::memcmp(address_bytes.data(), ip_address->data, 4) == 0)
- {
- GENERAL_NAMES_free(gens);
- return true;
- }
- }
- else if (address.is_v6() && ip_address->length == 16)
- {
- boost::asio::ip::address_v6::bytes_type address_bytes
- = address.to_v6().to_bytes();
- if (std::memcmp(address_bytes.data(), ip_address->data, 16) == 0)
- {
- GENERAL_NAMES_free(gens);
- return true;
- }
- }
- }
- }
- }
- GENERAL_NAMES_free(gens);
-
- // No match in the alternate names, so try the common names. We should only
- // use the "most specific" common name, which is the last one in the list.
- X509_NAME* name = X509_get_subject_name(cert);
- int i = -1;
- ASN1_STRING* common_name = 0;
- while ((i = X509_NAME_get_index_by_NID(name, NID_commonName, i)) >= 0)
- {
- X509_NAME_ENTRY* name_entry = X509_NAME_get_entry(name, i);
- common_name = X509_NAME_ENTRY_get_data(name_entry);
- }
- if (common_name && common_name->data && common_name->length)
- {
- const char* pattern = reinterpret_cast(common_name->data);
- std::size_t pattern_length = common_name->length;
- if (match_pattern(pattern, pattern_length, host.c_str()))
- return true;
- }
-
- return false;
-}
-
-inline boost::system::error_code handshake(
- boost::asio::ssl::stream& socket,
- const std::string& host, boost::system::error_code& ec)
-{
- // Perform SSL handshake.
- socket.handshake(boost::asio::ssl::stream_base::client, ec);
- if (ec)
- return ec;
-
- // Verify the certificate returned by the host.
- if (X509* cert = SSL_get_peer_certificate(socket.impl()->ssl))
- {
- if (SSL_get_verify_result(socket.impl()->ssl) == X509_V_OK)
- {
- if (certificate_matches_host(cert, host))
- ec = boost::system::error_code();
- else
- ec = make_error_code(boost::system::errc::permission_denied);
- }
- else
- ec = make_error_code(boost::system::errc::permission_denied);
- X509_free(cert);
- }
- else
- ec = make_error_code(boost::system::errc::permission_denied);
-
- return ec;
-}
-
-template
-class handshake_coro : coroutine
-{
-public:
- handshake_coro(Handler handler,
- boost::asio::ssl::stream& socket,
- const std::string& host)
- : handler_(handler),
- socket_(socket),
- host_(host)
- {
- }
-
- void operator()(boost::system::error_code ec)
- {
- URDL_CORO_BEGIN;
-
- // Perform SSL handshake.
- URDL_CORO_YIELD(socket_.async_handshake(
- boost::asio::ssl::stream_base::client, *this));
- if (ec)
- {
- handler_(ec);
- return;
- }
-
- // Verify the certificate returned by the host.
- if (X509* cert = SSL_get_peer_certificate(socket_.impl()->ssl))
- {
- if (SSL_get_verify_result(socket_.impl()->ssl) == X509_V_OK)
- {
- if (certificate_matches_host(cert, host_))
- ec = boost::system::error_code();
- else
- ec = make_error_code(boost::system::errc::permission_denied);
- }
- else
- ec = make_error_code(boost::system::errc::permission_denied);
- X509_free(cert);
- }
- else
- ec = make_error_code(boost::system::errc::permission_denied);
-
- handler_(ec);
-
- URDL_CORO_END;
- }
-
- friend void* asio_handler_allocate(std::size_t size,
- handshake_coro* this_handler)
- {
- using boost::asio::asio_handler_allocate;
- return asio_handler_allocate(size, &this_handler->handler_);
- }
-
- friend void asio_handler_deallocate(void* pointer, std::size_t size,
- handshake_coro* this_handler)
- {
- using boost::asio::asio_handler_deallocate;
- asio_handler_deallocate(pointer, size, &this_handler->handler_);
- }
-
- template
- friend void asio_handler_invoke(const Function& function,
- handshake_coro* this_handler)
- {
- using boost::asio::asio_handler_invoke;
- asio_handler_invoke(function, &this_handler->handler_);
- }
-
-private:
- Handler handler_;
- boost::asio::ssl::stream& socket_;
- std::string host_;
-};
-
-template
-void async_handshake(
- boost::asio::ssl::stream& socket,
- const std::string& host, Handler handler)
-{
- handshake_coro(handler, socket, host)(boost::system::error_code());
-}
-#endif // !defined(URDL_DISABLE_SSL)
-
-} // namespace detail
-} // namespace urdl
-
-#include "urdl/detail/abi_suffix.hpp"
-
-#endif // URDL_DETAIL_HANDSHAKE_HPP
diff --git a/thirdparty/urdl-2013-08-15/include/urdl/detail/http_read_stream.hpp b/thirdparty/urdl-2013-08-15/include/urdl/detail/http_read_stream.hpp
deleted file mode 100644
index 3fcf3e1..0000000
--- a/thirdparty/urdl-2013-08-15/include/urdl/detail/http_read_stream.hpp
+++ /dev/null
@@ -1,533 +0,0 @@
-//
-// http_read_stream.hpp
-// ~~~~~~~~~~~~~~~~~~~~
-//
-// Copyright (c) 2009-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#ifndef URDL_DETAIL_HTTP_READ_STREAM_HPP
-#define URDL_DETAIL_HTTP_READ_STREAM_HPP
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "urdl/http.hpp"
-#include "urdl/option_set.hpp"
-#include "urdl/url.hpp"
-#include "urdl/detail/connect.hpp"
-#include "urdl/detail/coroutine.hpp"
-#include "urdl/detail/handshake.hpp"
-#include "urdl/detail/parsers.hpp"
-
-#include "urdl/detail/abi_prefix.hpp"
-
-namespace urdl {
-namespace detail {
-
-template
-class http_read_stream
-{
-public:
- explicit http_read_stream(boost::asio::io_service& io_service,
- option_set& options)
- : resolver_(io_service),
- socket_(io_service),
- options_(options),
- content_length_(0)
- {
- }
-
- template
- http_read_stream(boost::asio::io_service& io_service,
- option_set& options, Arg& arg)
- : resolver_(io_service),
- socket_(io_service, arg),
- options_(options),
- content_length_(0)
- {
- }
-
- boost::system::error_code open(const url& u, boost::system::error_code& ec)
- {
- // Fail if the socket is already open.
- if (socket_.lowest_layer().is_open())
- {
- ec = boost::asio::error::already_open;
- return ec;
- }
-
- // Establish a connection to the HTTP server.
- connect(socket_.lowest_layer(), resolver_, u, ec);
- if (ec)
- return ec;
-
- // Perform SSL handshake if required.
- handshake(socket_, u.host(), ec);
- if (ec)
- return ec;
-
- // Get the HTTP options used to build the request.
- std::string request_method
- = options_.get_option().value();
- std::string request_content
- = options_.get_option().value();
- std::string request_content_type
- = options_.get_option().value();
- std::string user_agent
- = options_.get_option().value();
-
- // Form the request. We specify the "Connection: close" header so that the
- // server will close the socket after transmitting the response. This will
- // allow us to treat all data up until the EOF as the content.
- std::ostream request_stream(&request_buffer_);
- request_stream << request_method << " ";
- request_stream << u.to_string(url::path_component | url::query_component);
- request_stream << " HTTP/1.0\r\n";
- request_stream << "Host: ";
- request_stream << u.to_string(url::host_component | url::port_component);
- request_stream << "\r\n";
- request_stream << "Accept: */*\r\n";
- if (request_content.length())
- {
- request_stream << "Content-Length: ";
- request_stream << request_content.length() << "\r\n";
- if (request_content_type.length())
- {
- request_stream << "Content-Type: ";
- request_stream << request_content_type << "\r\n";
- }
- }
- if (user_agent.length())
- request_stream << "User-Agent: " << user_agent << "\r\n";
- request_stream << "Connection: close\r\n\r\n";
- request_stream << request_content;
-
- // Send the request.
- boost::asio::write(socket_, request_buffer_,
- boost::asio::transfer_all(), ec);
- if (ec)
- return ec;
-
- int status_code = 0;
- for (;;)
- {
- // Read the reply status line.
- boost::asio::read_until(socket_, reply_buffer_, "\r\n", ec);
- if (ec)
- return ec;
-
- // Extract the response code from the status line.
- int version_major = 0;
- int version_minor = 0;
- if (!parse_http_status_line(
- std::istreambuf_iterator(&reply_buffer_),
- std::istreambuf_iterator(),
- version_major, version_minor, status_code))
- {
- ec = http::errc::malformed_status_line;
- return ec;
- }
-
- // A "continue" header means we need to keep waiting.
- if (status_code != http::errc::continue_request)
- break;
- }
-
- // Read list of headers and save them. If there's anything left in the reply
- // buffer afterwards, it's the start of the content returned by the HTTP
- // server.
- std::size_t bytes_transferred = boost::asio::read_until(
- socket_, reply_buffer_, "\r\n\r\n", ec);
- headers_.resize(bytes_transferred);
- reply_buffer_.sgetn(&headers_[0], bytes_transferred);
- if (ec)
- return ec;
-
- // Parse the headers to get Content-Type and Content-Length.
- if (!parse_http_headers(headers_.begin(), headers_.end(),
- content_type_, content_length_, location_))
- {
- ec = http::errc::malformed_response_headers;
- return ec;
- }
-
- // Check the response code to see if we got the page correctly.
- if (status_code != http::errc::ok)
- ec = make_error_code(static_cast(status_code));
-
- return ec;
- }
-
- template
- class open_coro : coroutine
- {
- public:
- open_coro(Handler handler, boost::asio::ip::tcp::resolver& resolver,
- Stream& socket, const option_set& options,
- boost::asio::streambuf& request_buffer,
- boost::asio::streambuf& reply_buffer, const url& u,
- std::string& headers, std::string& content_type,
- std::size_t& content_length, std::string& location)
- : handler_(handler),
- resolver_(resolver),
- socket_(socket),
- options_(options),
- request_buffer_(request_buffer),
- reply_buffer_(reply_buffer),
- url_(u),
- headers_(headers),
- status_code_(0),
- content_type_(content_type),
- content_length_(content_length),
- location_(location)
- {
- }
-
- void operator()(boost::system::error_code ec,
- std::size_t bytes_transferred = 0)
- {
- URDL_CORO_BEGIN;
-
- // Fail if the socket is already open.
- if (socket_.lowest_layer().is_open())
- {
- ec = boost::asio::error::already_open;
- URDL_CORO_YIELD(socket_.get_io_service().post(
- boost::asio::detail::bind_handler(*this, ec)));
- handler_(ec);
- return;
- }
-
- // Establish a connection to the HTTP server.
- URDL_CORO_YIELD(async_connect(socket_.lowest_layer(),
- resolver_, url_, *this));
- if (ec)
- {
- handler_(ec);
- return;
- }
-
- // Perform SSL handshake if required.
- URDL_CORO_YIELD(async_handshake(socket_, url_.host(), *this));
- if (ec)
- {
- handler_(ec);
- return;
- }
-
- {
- // Get the HTTP options used to build the request.
- std::string request_method
- = options_.get_option().value();
- std::string request_content
- = options_.get_option().value();
- std::string request_content_type
- = options_.get_option().value();
- std::string user_agent
- = options_.get_option().value();
-
- // Form the request. We specify the "Connection: close" header so that
- // the server will close the socket after transmitting the response.
- // This will allow us to treat all data up until the EOF as the
- // content.
- std::ostream request_stream(&request_buffer_);
- request_stream << request_method << " ";
- request_stream << url_.to_string(
- url::path_component | url::query_component);
- request_stream << " HTTP/1.0\r\n";
- request_stream << "Host: ";
- request_stream << url_.to_string(
- url::host_component | url::port_component);
- request_stream << "\r\n";
- request_stream << "Accept: */*\r\n";
- if (request_content.length())
- {
- request_stream << "Content-Length: ";
- request_stream << request_content.length() << "\r\n";
- if (request_content_type.length())
- {
- request_stream << "Content-Type: ";
- request_stream << request_content_type << "\r\n";
- }
- }
- if (user_agent.length())
- request_stream << "User-Agent: " << user_agent << "\r\n";
- request_stream << "Connection: close\r\n\r\n";
- request_stream << request_content;
- }
-
- // Send the request.
- URDL_CORO_YIELD(boost::asio::async_write(socket_,
- request_buffer_, boost::asio::transfer_all(), *this));
- if (ec)
- {
- handler_(ec);
- return;
- }
-
- for (;;)
- {
- // Read the reply status line.
- URDL_CORO_YIELD(boost::asio::async_read_until(socket_,
- reply_buffer_, "\r\n", *this));
- if (ec)
- {
- handler_(ec);
- return;
- }
-
- // Check the response code to see if we got the page correctly.
- {
- int version_major = 0;
- int version_minor = 0;
- if (!parse_http_status_line(
- std::istreambuf_iterator(&reply_buffer_),
- std::istreambuf_iterator(),
- version_major, version_minor, status_code_))
- {
- ec = http::errc::malformed_status_line;
- handler_(ec);
- return;
- }
- }
-
- // A "continue" header means we need to keep waiting.
- if (status_code_ != http::errc::continue_request)
- break;
- }
-
- // Read list of headers and save them. If there's anything left in the
- // reply buffer afterwards, it's the start of the content returned by the
- // HTTP server.
- URDL_CORO_YIELD(boost::asio::async_read_until(socket_,
- reply_buffer_, "\r\n\r\n", *this));
- headers_.resize(bytes_transferred);
- reply_buffer_.sgetn(&headers_[0], bytes_transferred);
- if (ec)
- {
- handler_(ec);
- return;
- }
-
- // Parse the headers to get Content-Type and Content-Length.
- if (!parse_http_headers(headers_.begin(), headers_.end(),
- content_type_, content_length_, location_))
- {
- ec = http::errc::malformed_response_headers;
- handler_(ec);
- return;
- }
-
- // Check the response code to see if we got the page correctly.
- if (status_code_ != http::errc::ok)
- ec = make_error_code(static_cast