40 lines
859 B
C++
40 lines
859 B
C++
#ifndef seafire__common__io__read_until_hxx_
|
|
#define seafire__common__io__read_until_hxx_
|
|
|
|
#include <seafire/common/io/stream.hxx>
|
|
|
|
#include <functional>
|
|
#include <system_error>
|
|
|
|
#include <asio.hpp>
|
|
|
|
namespace seafire::common::io
|
|
{
|
|
|
|
using match_condition_t = std::function<
|
|
std::pair<char const*, bool>(char const*, char const*, std::error_code&)
|
|
>;
|
|
|
|
using read_until_handler_t = std::function<
|
|
void(std::error_code, std::size_t)
|
|
>;
|
|
|
|
std::size_t
|
|
read_until(stream_t&, asio::streambuf&, match_condition_t);
|
|
|
|
std::size_t
|
|
read_until(stream_t&,
|
|
asio::streambuf&,
|
|
match_condition_t,
|
|
std::error_code&);
|
|
|
|
void
|
|
async_read_until(stream_t&,
|
|
asio::streambuf&,
|
|
match_condition_t,
|
|
read_until_handler_t);
|
|
|
|
} // namespace seafire::common::io
|
|
|
|
#endif
|