-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef2db3c
commit f3e9885
Showing
14 changed files
with
1,728 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
[/ | ||
Copyright (c) 2022 Alan de Freitas (alandefreitas@gmail.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) | ||
|
||
Official repository: https://github.com/CPPAlliance/url | ||
] | ||
|
||
[section MutableString] | ||
|
||
A ['MutableString] is a container that has the `assign` and | ||
`append` member functions that accept iterators to `char`. | ||
|
||
The class __pct_encoded_view__ provides a operations | ||
to assign and append percent-decoded values to a | ||
['MutableString]. | ||
|
||
When storing decoded values in a container, these functions | ||
allow the caller to recycle the input string without | ||
reallocating memory. | ||
|
||
[heading Related Identifiers] | ||
|
||
* __pct_encoded_view__ | ||
* [link url.ref.boost__urls__pct_encoded_rule `pct_encoded_rule`] | ||
|
||
[heading Requirements] | ||
|
||
In this table: | ||
|
||
* `T` is a type meeting the requirements of ['MutableString] | ||
* `s` is a mutable container of type `T` | ||
* `first`, `last` are __InputIterator__s whose `value_type` is `char` | ||
and which refer to the valid character sequence `[ first, last )` | ||
|
||
[table Valid expressions | ||
[[Expression] [Type] [Semantics, Pre/Post-conditions]] | ||
[ | ||
[ | ||
``` | ||
T::value_type | ||
``` | ||
] | ||
[`char`] | ||
[ | ||
Requires: `std::is_same_v< T::value_type, char >` | ||
] | ||
][ | ||
[ | ||
``` | ||
s.assign(first,last) | ||
``` | ||
] | ||
[] | ||
[ | ||
This member function assigns the characters from the | ||
range in `[first, last)` to `s`. | ||
] | ||
][ | ||
[ | ||
``` | ||
s.append(first,last) | ||
``` | ||
] | ||
[] | ||
[ | ||
This member function appends the characters from the | ||
range in `[first, last)` to `s`. | ||
] | ||
]] | ||
|
||
[heading Exemplar] | ||
|
||
[snippet_mutable_string_exemplar] | ||
|
||
[heading Models] | ||
|
||
* __std_string__ | ||
|
||
[heading Models] | ||
|
||
* __pct_encoded_view__ | ||
* [def __pct_encoded_view__ [link url.ref.boost__urls__pct_encoded_view `pct_encoded_view`]] | ||
|
||
[endsect] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// | ||
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail 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) | ||
// | ||
// Official repository: https://github.com/CPPAlliance/url | ||
// | ||
|
||
#ifndef BOOST_URL_IS_MUTABLE_STRING_HPP | ||
#define BOOST_URL_IS_MUTABLE_STRING_HPP | ||
|
||
#include <type_traits> | ||
|
||
namespace boost { | ||
namespace urls { | ||
namespace grammar { | ||
|
||
/** Alias for `std::true_type` if `T` satisfies __MutableString__ | ||
for the iterator type `I` | ||
*/ | ||
#ifdef BOOST_URL_DOCS | ||
template<class T, class I> | ||
using is_mutable_string = __see_below__; | ||
#else | ||
namespace detail | ||
{ | ||
template<class T, class = void> | ||
struct has_value_type : std::false_type {}; | ||
|
||
template<class T> | ||
struct has_value_type<T, boost::void_t< | ||
typename T::value_type>> | ||
: std::true_type | ||
{}; | ||
|
||
template<class T, class I, class = void> | ||
struct has_assign_and_append : std::false_type {}; | ||
|
||
template<class T, class I> | ||
struct has_assign_and_append<T, I, boost::void_t< | ||
// T::append(I, I) | ||
decltype( | ||
std::declval<T&>() | ||
.append( | ||
std::declval<I>(), | ||
std::declval<I>()) | ||
), | ||
// T::assign(I, I) | ||
decltype( | ||
std::declval<T&>() | ||
.assign( | ||
std::declval<I>(), | ||
std::declval<I>()) | ||
)>> | ||
: std::true_type | ||
{}; | ||
} | ||
|
||
template <class T, class I, class = void> | ||
struct is_mutable_string : std::false_type {}; | ||
|
||
template <class T, class I> | ||
struct is_mutable_string< | ||
T, I, | ||
typename std::enable_if< | ||
detail::has_value_type<T>::value && | ||
detail::has_assign_and_append<T, I>::value | ||
>::type> | ||
: std::is_same<typename T::value_type, char> | ||
{}; | ||
#endif | ||
|
||
} // grammar | ||
} // urls | ||
} // boost | ||
|
||
#endif |
Oops, something went wrong.