Reference | Class Hierarchy | Class Index | Member Index |
Functions | |
template<typename Sync_Read_Stream, typename Allocator> | |
std::size_t | asio::read_until (Sync_Read_Stream &s, asio::basic_streambuf< Allocator > &b, char delim) |
Read data into a streambuf until a delimiter is encountered. | |
template<typename Sync_Read_Stream, typename Allocator, typename Error_Handler> | |
std::size_t | asio::read_until (Sync_Read_Stream &s, asio::basic_streambuf< Allocator > &b, char delim, Error_Handler error_handler) |
Read data into a streambuf until a delimiter is encountered. | |
template<typename Sync_Read_Stream, typename Allocator> | |
std::size_t | asio::read_until (Sync_Read_Stream &s, asio::basic_streambuf< Allocator > &b, const boost::regex &expr) |
Read data into a streambuf until a regular expression is located. | |
template<typename Sync_Read_Stream, typename Allocator, typename Error_Handler> | |
std::size_t | asio::read_until (Sync_Read_Stream &s, asio::basic_streambuf< Allocator > &b, const boost::regex &expr, Error_Handler error_handler) |
Read data into a streambuf until a regular expression is located. |
std::size_t asio::read_until | ( | Sync_Read_Stream & | s, | |
asio::basic_streambuf< Allocator > & | b, | |||
char | delim | |||
) |
Read data into a streambuf until a delimiter is encountered.
This function is used to read data into the specified streambuf until the streambuf's get area contains the specified delimiter. The call will block until one of the following conditions is true:
s | The stream from which the data is to be read. The type must support the Sync_Read_Stream concept. | |
b | A streambuf object into which the data will be read. | |
delim | The delimiter character. |
Sync_Read_Stream::error_type | Thrown on failure. |
asio::streambuf b; asio::read_until(s, b, '\n'); std::istream is(&b); std::string line; std::getline(is, line);
asio::read_until( s, b, delim, asio::throw_error());
std::size_t asio::read_until | ( | Sync_Read_Stream & | s, | |
asio::basic_streambuf< Allocator > & | b, | |||
char | delim, | |||
Error_Handler | error_handler | |||
) |
Read data into a streambuf until a delimiter is encountered.
This function is used to read data into the specified streambuf until the streambuf's get area contains the specified delimiter. The call will block until one of the following conditions is true:
s | The stream from which the data is to be read. The type must support the Sync_Read_Stream concept. | |
b | A streambuf object into which the data will be read. | |
delim | The delimiter character. | |
error_handler | A handler to be called when the operation completes, to indicate whether or not an error has occurred. Copies will be made of the handler as required. The function signature of the handler must be: void error_handler( const Sync_Read_Stream::error_type& error // Result of operation. ); |
std::size_t asio::read_until | ( | Sync_Read_Stream & | s, | |
asio::basic_streambuf< Allocator > & | b, | |||
const boost::regex & | expr | |||
) |
Read data into a streambuf until a regular expression is located.
This function is used to read data into the specified streambuf until the streambuf's get area contains some data that matches a regular expression. The call will block until one of the following conditions is true:
s | The stream from which the data is to be read. The type must support the Sync_Read_Stream concept. | |
b | A streambuf object into which the data will be read. | |
expr | The regular expression. |
Sync_Read_Stream::error_type | Thrown on failure. |
asio::streambuf b; asio::read_until(s, b, boost::regex("\r\n")); std::istream is(&b); std::string line; std::getline(is, line);
asio::read_until( s, b, expr, asio::throw_error());
std::size_t asio::read_until | ( | Sync_Read_Stream & | s, | |
asio::basic_streambuf< Allocator > & | b, | |||
const boost::regex & | expr, | |||
Error_Handler | error_handler | |||
) |
Read data into a streambuf until a regular expression is located.
This function is used to read data into the specified streambuf until the streambuf's get area contains some data that matches a regular expression. The call will block until one of the following conditions is true:
s | The stream from which the data is to be read. The type must support the Sync_Read_Stream concept. | |
b | A streambuf object into which the data will be read. | |
expr | The regular expression. | |
error_handler | A handler to be called when the operation completes, to indicate whether or not an error has occurred. Copies will be made of the handler as required. The function signature of the handler must be: void error_handler( const Sync_Read_Stream::error_type& error // Result of operation. ); |