Base Framework
Public Member Functions | Static Public Member Functions | List of all members
Urn Class Reference

Uniform Resource Name (URN) More...

#include <base/net/Urn.h>

Inherits Object.

Public Member Functions

 Urn () noexcept
 
 Urn (const String &urn)
 
 Urn (const String &nid, const String &nss)
 
 Urn (const Urn &copy) noexcept
 
Urnoperator= (const Urn &assign) noexcept
 
bool operator== (const Urn &compare) const noexcept
 
const StringgetNID () const noexcept
 
const StringgetNSS () const noexcept
 
String getUnescapedNSS () const
 
void setNID (const String &value)
 
void setNSS (const String &value)
 
String getUrn () const
 
 operator String () const
 

Static Public Member Functions

static bool isUrn (const String &urn) noexcept
 

Detailed Description

Uniform Resource Name (URN)

Implementation of Uniform Resource Name (URN) as specified by RFC 2141. Uniform Resource Names (URNs) are intended to serve as persistent, location-independent, resource identifiers. The components of the urn are stored internally in escaped format.

See https://en.wikipedia.org/wiki/Uniform_Resource_Name.

Urn urn("urn:NID:NSS")
Version
1.0

Constructor & Destructor Documentation

◆ Urn() [1/4]

Urn::Urn ( )
noexcept

Initializes urn as invalid.

◆ Urn() [2/4]

Urn::Urn ( const String urn)

Initializes urn from a string representation.

Parameters
urnThe string representation of the URN.

◆ Urn() [3/4]

Urn::Urn ( const String nid,
const String nss 
)

Initializes URN from nid and nss strings.

Parameters
nidThe namespace identifier.
nssThe namespace specific string.

◆ Urn() [4/4]

Urn::Urn ( const Urn copy)
noexcept

Initializes urn from other urn.

Member Function Documentation

◆ getNID()

const String& Urn::getNID ( ) const
inlinenoexcept

Returns the namespace identifier.

◆ getNSS()

const String& Urn::getNSS ( ) const
inlinenoexcept

Returns the namespace specific string.

◆ getUnescapedNSS()

String Urn::getUnescapedNSS ( ) const

Returns the unescaped namespace specific string.

◆ getUrn()

String Urn::getUrn ( ) const

Returns the URN in escaped format.

◆ isUrn()

static bool Urn::isUrn ( const String urn)
staticnoexcept

Returns true if the specified string is a valid urn.

◆ operator String()

Urn::operator String ( ) const
inline

Returns the URN in escaped format.

◆ operator=()

Urn& Urn::operator= ( const Urn assign)
noexcept

Assignment of URN by URN.

◆ operator==()

bool Urn::operator== ( const Urn compare) const
noexcept

Returns true if the URN are equal.

◆ setNID()

void Urn::setNID ( const String value)

Sets the nid of the URN.

◆ setNSS()

void Urn::setNSS ( const String value)

Sets the namespace specific string of the URN.

Urn
Uniform Resource Name (URN)
Definition: Urn.h:39