UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
UPnPsdk::CComponent Class Reference

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.
 

Detailed Description

Base class of a component.

All special URI components (scheme, userinfo, host, port, path, query, fragment) are derived from this class.

Definition at line 132 of file uri.hpp.

Member Enumeration Documentation

◆ STATE

enum struct UPnPsdk::CComponent::STATE
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.

Definition at line 152 of file uri.hpp.

Member Function Documentation

◆ state()

CComponent::STATE UPnPsdk::CComponent::state ( ) const

Get state of the component.

Returns
State of the component.

Definition at line 181 of file uri.cpp.

+ Here is the caller graph for this function:

◆ str()

const std::string & UPnPsdk::CComponent::str ( ) const

Get the string of the component.

Returns
Reference of the component string. It is empty for STATE "undef" and "empty".

Definition at line 186 of file uri.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_state

STATE UPnPsdk::CComponent::m_state {STATE::undef}
protected

Current state of the component.

Definition at line 169 of file uri.hpp.

◆ m_component

std::string UPnPsdk::CComponent::m_component
protected

Name of the component.

Definition at line 174 of file uri.hpp.


The documentation for this class was generated from the following files: