Realistic 3D camera system
3D camera system components
read_until.hpp
Go to the documentation of this file.
1 //
2 // read_until.hpp
3 // ~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10 
11 #ifndef ASIO_READ_UNTIL_HPP
12 #define ASIO_READ_UNTIL_HPP
13 
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 
18 #include "asio/detail/config.hpp"
19 
20 #if !defined(ASIO_NO_IOSTREAM)
21 
22 #include <cstddef>
23 #include <string>
24 #include "asio/async_result.hpp"
25 #include "asio/basic_streambuf.hpp"
28 #include "asio/error.hpp"
29 
31 
32 namespace asio {
33 
34 namespace detail
35 {
36  char (&has_result_type_helper(...))[2];
37 
38  template <typename T>
39  char has_result_type_helper(T*, typename T::result_type* = 0);
40 
41  template <typename T>
43  {
44  enum { value = (sizeof((has_result_type_helper)((T*)(0))) == 1) };
45  };
46 } // namespace detail
47 
50 template <typename T>
52 {
53 #if defined(GENERATING_DOCUMENTATION)
54  static const bool value;
56 #else
57  enum
58  {
59  value = asio::is_function<
60  typename asio::remove_pointer<T>::type>::value
62  };
63 #endif
64 };
65 
73 
75 
122 template <typename SyncReadStream, typename Allocator>
123 std::size_t read_until(SyncReadStream& s,
125 
127 
156 template <typename SyncReadStream, typename Allocator>
157 std::size_t read_until(SyncReadStream& s,
159  asio::error_code& ec);
160 
162 
209 template <typename SyncReadStream, typename Allocator>
210 std::size_t read_until(SyncReadStream& s,
211  asio::basic_streambuf<Allocator>& b, const std::string& delim);
212 
214 
243 template <typename SyncReadStream, typename Allocator>
244 std::size_t read_until(SyncReadStream& s,
245  asio::basic_streambuf<Allocator>& b, const std::string& delim,
246  asio::error_code& ec);
247 
248 #if defined(ASIO_HAS_BOOST_REGEX) \
249  || defined(GENERATING_DOCUMENTATION)
250 
253 
301 template <typename SyncReadStream, typename Allocator>
302 std::size_t read_until(SyncReadStream& s,
303  asio::basic_streambuf<Allocator>& b, const boost::regex& expr);
304 
307 
338 template <typename SyncReadStream, typename Allocator>
339 std::size_t read_until(SyncReadStream& s,
340  asio::basic_streambuf<Allocator>& b, const boost::regex& expr,
341  asio::error_code& ec);
342 
343 #endif // defined(ASIO_HAS_BOOST_REGEX)
344  // || defined(GENERATING_DOCUMENTATION)
345 
347 
445 template <typename SyncReadStream, typename Allocator, typename MatchCondition>
446 std::size_t read_until(SyncReadStream& s,
449 
451 
500 template <typename SyncReadStream, typename Allocator, typename MatchCondition>
501 std::size_t read_until(SyncReadStream& s,
503  MatchCondition match_condition, asio::error_code& ec,
505 
515 
518 
594 template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
595 ASIO_INITFN_RESULT_TYPE(ReadHandler,
596  void (asio::error_code, std::size_t))
597 async_read_until(AsyncReadStream& s,
598  asio::basic_streambuf<Allocator>& b,
599  char delim, ASIO_MOVE_ARG(ReadHandler) handler);
600 
603 
679 template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
680 ASIO_INITFN_RESULT_TYPE(ReadHandler,
681  void (asio::error_code, std::size_t))
682 async_read_until(AsyncReadStream& s,
683  asio::basic_streambuf<Allocator>& b, const std::string& delim,
684  ASIO_MOVE_ARG(ReadHandler) handler);
685 
686 #if defined(ASIO_HAS_BOOST_REGEX) \
687  || defined(GENERATING_DOCUMENTATION)
688 
691 
771 template <typename AsyncReadStream, typename Allocator, typename ReadHandler>
772 ASIO_INITFN_RESULT_TYPE(ReadHandler,
773  void (asio::error_code, std::size_t))
774 async_read_until(AsyncReadStream& s,
775  asio::basic_streambuf<Allocator>& b, const boost::regex& expr,
776  ASIO_MOVE_ARG(ReadHandler) handler);
777 
778 #endif // defined(ASIO_HAS_BOOST_REGEX)
779  // || defined(GENERATING_DOCUMENTATION)
780 
783 
904 template <typename AsyncReadStream, typename Allocator,
905  typename MatchCondition, typename ReadHandler>
906 ASIO_INITFN_RESULT_TYPE(ReadHandler,
907  void (asio::error_code, std::size_t))
908 async_read_until(AsyncReadStream& s,
909  asio::basic_streambuf<Allocator>& b,
910  MatchCondition match_condition, ASIO_MOVE_ARG(ReadHandler) handler,
911  typename enable_if<is_match_condition<MatchCondition>::value>::type* = 0);
912 
915 } // namespace asio
916 
917 #include "asio/detail/pop_options.hpp"
918 
919 #include "asio/impl/read_until.hpp"
920 
921 #endif // !defined(ASIO_NO_IOSTREAM)
922 
923 #endif // ASIO_READ_UNTIL_HPP
SocketService & s
Definition: connect.hpp:521
STL namespace.
asio::basic_streambuf< Allocator > & b
Definition: read.hpp:702
ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler, void(asio::error_code, Iterator)) async_connect(basic_socket< Protocol
std::size_t read_until(SyncReadStream &s, asio::basic_streambuf< Allocator > &b, char delim)
Read data into a streambuf until it contains a specified delimiter.
Definition: read_until.hpp:37
char(& has_result_type_helper(...))[2]
asio::basic_streambuf< Allocator > CompletionCondition ASIO_MOVE_ARG(ReadHandler) handler)
Definition: read.hpp:704
Class to represent an error code value.
Definition: error_code.hpp:80
asio::basic_streambuf< Allocator > MatchCondition match_condition
Automatically resizable buffer class based on std::streambuf.
asio::basic_streambuf< Allocator > char delim
Definition: read_until.hpp:498