A reference-like container to modifiable URL segments.
Defined in header <boost/url/segments_encoded.hpp>
class segments_encoded
Name |
Description |
---|---|
A read-only bidirectional iterator to an encoded segment. |
|
A type which can represent a segment as a const reference. |
|
A signed integer type. |
|
A read-only bidirectional iterator to an encoded segment. |
|
A type which can represent a segment as a const reference. |
|
An unsigned integer type. |
|
A type which can represent a segment as a value. |
Name |
Description |
---|---|
Replace the contents of the container. |
|
Access the last element. |
|
Return a const iterator to the first element. |
|
Remove the contents of the container. |
|
Return this container as percent-decoded segments. |
|
Return true if the container is empty. |
|
Return an iterator to the element following the last element. |
|
Erase an element. |
|
Access the first element. |
|
Insert an element. |
|
Returns true if this contains an absolute path. |
|
Assignment. |
|
Remove the last element. |
|
Add an element to the end. |
|
segments_encoded [constructor] |
Constructor. |
Return the number of elements in the container. |
This class implements a RandomAccessContainer representing
the path segments in a url
as percent-encoded strings.
Ownership of the segments is not transferred; the container references the
buffer in the url. Therefore, the lifetime of the url must remain valid until
this container no longer exists. Objects of this type are not constructed
directly; Instead, call the corresponding non-const member function of url
to obtain an instance of the container:
url u = parse_relative_ref( "/path/to/file.txt" ); segments_encoded se = u.encoded_segments(); for( segments_encoded::value_type s : se ) std::cout << s << std::endl;
The reference
and const_reference
nested types are
defined as publicly accessible nested classes. They proxy the behavior of
a reference to a percent-encoded string in the underlying URL. The primary
use of these references is to provide l-values that can be returned from
element-accessing operations. Any reads or writes which happen through a
reference
or const_reference
potentially read
or write the underlying url
.
url
.
Convenience header <boost/url.hpp>