Base class of a component. More...
#include <uri.hpp>
Inheritance diagram for UPnPsdk::CComponent:Public Types | |
| enum struct | STATE { undef , empty , avail } |
| Defines the possible states of a URI component. More... | |
Public Member Functions | |
| STATE | state () const |
| Get state of the component. | |
| const std::string & | str () const |
| Get the string of the component. | |
Protected Attributes | |
| STATE | m_state {STATE::undef} |
| Current state of the component. | |
| std::string | m_component |
| Name of the component. | |
Base class of a component.
All special URI components (scheme, userinfo, host, port, path, query, fragment) are derived from this class.
|
strong |
Defines the possible states of a URI component.
Quote RFC3986 5.3.:
Note that we are careful to preserve the distinction between a component that is undefined, meaning that its separator was not present in the reference, and a component that is empty, meaning that the separator was present and was immediately followed by the next component separator or the end of the reference.
The state of a component in this class is not oriented on the input URI reference, but on its output URI reference taking normalization and comparison into account (RFC3986 6.). For example an input URI reference "https://@[::1]:" will not set authority.userinfo.state() and authority.port.state() to 'STATE::empty' but to 'STATE::undef', because the expected output URI reference is "https://[::1]".
| Enumerator | |
|---|---|
| undef | component is undefined, component string is empty. |
| empty | Component is defined but empty, component string is empty. |
| avail | Component string is available, means it has a valid content. |
| CComponent::STATE UPnPsdk::CComponent::state | ( | ) | const |
| const std::string & UPnPsdk::CComponent::str | ( | ) | const |
|
protected |
|
protected |