A container referencing a random-access range of modifiable, percent-decoded path segments.
Defined in header <boost/url/segments.hpp>
class segments
Name |
Description |
---|---|
A read-only bidirectional iterator to a decoded segment. |
|
A type which can represent a segment as a reference. |
|
A signed integer type. |
|
A read-only bidirectional iterator to a decoded segment. |
|
A type which can represent a segment as a 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 an iterator to the first element. |
|
Remove the contents of the container. |
|
Check if the path has no segments. |
|
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 [constructor] |
Constructor. |
Return the number of elements in the array. |
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 se = u.segments(); for( segments::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>