![]() |
Home | Libraries | People | FAQ | More |
Return the first segment.
std::string front() const;
This function returns a string with the first segment of the path without any leading or trailing '/' separators. Any percent-escapes in the string are decoded first.
this->[link url.ref.boost__urls__segments_base.empty `empty`]() == false
return *[link url.ref.boost__urls__segments_base.begin `begin`]();
assert( url_view( "/path/to/file.txt" ).segments().[link url.ref.boost__urls__segments_base.front `front`]() == "path" );
Linear in this->front().size()
.
Calls to allocate may throw.