// // istreambuf.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_ISTREAMBUF_HPP #define URDL_ISTREAMBUF_HPP #include #include #include "urdl/detail/config.hpp" #include "urdl/option_set.hpp" #include "urdl/url.hpp" #include "urdl/detail/abi_prefix.hpp" namespace urdl { /// The class @c istreambuf associates the input sequence with the content from /// a specified URL. /** * @par Requirements * @e Header: @c @n * @e Namespace: @c urdl */ class istreambuf : public std::streambuf { public: /// Constructs an object of class @c istreambuf. URDL_DECL istreambuf(); /// Destroys an object of class @c istreambuf. URDL_DECL ~istreambuf(); /// Sets an option to control the behaviour of the stream buffer. /** * @param option The option to be set on the stream buffer. * * @par Remarks * Options are uniquely identified by type. */ template void set_option(const Option& option) { option_set options; options.set_option(option); set_options(options); } /// Sets options to control the behaviour of the stream buffer. /** * @param options The options to be set on the stream buffer. */ URDL_DECL void set_options(const option_set& options); /// Gets the current value of an option that controls the behaviour of the /// stream buffer. /** * @returns The current value of the option. * * @par Remarks * Options are uniquely identified by type. */ template Option get_option() const { option_set options(get_options()); return options.get_option