forked from boostorg/beast
More split compilation in rfc7230.hpp
* Moved `find` and `exists` to the `ipp` file. * Fixed missing include file in MSVC. Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
Version 260:
|
||||||
|
|
||||||
|
* More split compilation in rfc7230.hpp
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Version 259:
|
Version 259:
|
||||||
|
|
||||||
* Reduce the number of instantiations of filter_token_list
|
* Reduce the number of instantiations of filter_token_list
|
||||||
|
@@ -244,27 +244,6 @@ cend() const ->
|
|||||||
return const_iterator{s_.end(), s_.end()};
|
return const_iterator{s_.end(), s_.end()};
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
|
||||||
auto
|
|
||||||
ext_list::
|
|
||||||
find(T const& s) ->
|
|
||||||
const_iterator
|
|
||||||
{
|
|
||||||
return std::find_if(begin(), end(),
|
|
||||||
[&s](value_type const& v)
|
|
||||||
{
|
|
||||||
return iequals(s, v.first);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class T>
|
|
||||||
bool
|
|
||||||
ext_list::
|
|
||||||
exists(T const& s)
|
|
||||||
{
|
|
||||||
return find(s) != end();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -378,19 +357,6 @@ cend() const ->
|
|||||||
return const_iterator{s_.end(), s_.end()};
|
return const_iterator{s_.end(), s_.end()};
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
|
||||||
bool
|
|
||||||
token_list::
|
|
||||||
exists(T const& s)
|
|
||||||
{
|
|
||||||
return std::find_if(begin(), end(),
|
|
||||||
[&s](value_type const& v)
|
|
||||||
{
|
|
||||||
return iequals(s, v);
|
|
||||||
}
|
|
||||||
) != end();
|
|
||||||
}
|
|
||||||
|
|
||||||
template<class Policy>
|
template<class Policy>
|
||||||
bool
|
bool
|
||||||
validate_list(detail::basic_parsed_list<
|
validate_list(detail::basic_parsed_list<
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
#define BOOST_BEAST_HTTP_IMPL_RFC7230_IPP
|
#define BOOST_BEAST_HTTP_IMPL_RFC7230_IPP
|
||||||
|
|
||||||
#include <boost/beast/http/rfc7230.hpp>
|
#include <boost/beast/http/rfc7230.hpp>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
namespace boost {
|
namespace boost {
|
||||||
namespace beast {
|
namespace beast {
|
||||||
@@ -123,6 +124,24 @@ increment()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto
|
||||||
|
ext_list::
|
||||||
|
find(string_view const& s) -> const_iterator
|
||||||
|
{
|
||||||
|
return std::find_if(begin(), end(),
|
||||||
|
[&s](value_type const& v)
|
||||||
|
{
|
||||||
|
return beast::iequals(s, v.first);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ext_list::
|
||||||
|
exists(string_view const& s)
|
||||||
|
{
|
||||||
|
return find(s) != end();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
token_list::const_iterator::
|
token_list::const_iterator::
|
||||||
increment()
|
increment()
|
||||||
@@ -169,6 +188,18 @@ increment()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
token_list::
|
||||||
|
exists(string_view const& s)
|
||||||
|
{
|
||||||
|
return std::find_if(begin(), end(),
|
||||||
|
[&s](value_type const& v)
|
||||||
|
{
|
||||||
|
return beast::iequals(s, v);
|
||||||
|
}
|
||||||
|
) != end();
|
||||||
|
}
|
||||||
|
|
||||||
} // http
|
} // http
|
||||||
} // beast
|
} // beast
|
||||||
} // boost
|
} // boost
|
||||||
|
@@ -190,17 +190,17 @@ public:
|
|||||||
@return An iterator to the matching token, or `end()` if no
|
@return An iterator to the matching token, or `end()` if no
|
||||||
token exists.
|
token exists.
|
||||||
*/
|
*/
|
||||||
template<class T>
|
BOOST_BEAST_DECL
|
||||||
const_iterator
|
const_iterator
|
||||||
find(T const& s);
|
find(string_view const& s);
|
||||||
|
|
||||||
/** Return `true` if a token is present in the list.
|
/** Return `true` if a token is present in the list.
|
||||||
|
|
||||||
@param s The token to find. A case-insensitive comparison is used.
|
@param s The token to find. A case-insensitive comparison is used.
|
||||||
*/
|
*/
|
||||||
template<class T>
|
BOOST_BEAST_DECL
|
||||||
bool
|
bool
|
||||||
exists(T const& s);
|
exists(string_view const& s);
|
||||||
};
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@@ -275,9 +275,9 @@ public:
|
|||||||
|
|
||||||
@param s The token to find. A case-insensitive comparison is used.
|
@param s The token to find. A case-insensitive comparison is used.
|
||||||
*/
|
*/
|
||||||
template<class T>
|
BOOST_BEAST_DECL
|
||||||
bool
|
bool
|
||||||
exists(T const& s);
|
exists(string_view const& s);
|
||||||
};
|
};
|
||||||
|
|
||||||
/** A list of tokens in a comma separated HTTP field value.
|
/** A list of tokens in a comma separated HTTP field value.
|
||||||
|
Reference in New Issue
Block a user