Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Member Functions | Static Public Member Functions | Friends | List of all members
datatools::urn Class Reference

A class representing a simplified URN conforming parts of the RFC2141. More...

#include <bayeux/datatools/urn.h>

Inheritance diagram for datatools::urn:
datatools::i_serializable

Public Member Functions

 urn ()
 Default constructor. More...
 
 urn (const std::vector< std::string > &segments_)
 Constructor with explicit path segments. More...
 
virtual ~urn ()
 Destructor. More...
 
bool is_valid () const
 Check validity. More...
 
bool has_namespace () const
 Check is namespace is set. More...
 
const std::string & get_namespace () const
 Return the namespace. More...
 
void set_segments (const std::vector< std::string > &segments_)
 Set path segments. More...
 
void append_segment (const std::string &segment_)
 Append a path segment. More...
 
std::size_t get_depth () const
 Return the depth of the path segments. More...
 
void reset ()
 Clear the path segments. More...
 
const std::vector< std::string > & get_segments () const
 Return the path segments. More...
 
void to_string (std::string &) const
 Convert to a string. More...
 
std::string to_string () const
 Return a string representation. More...
 
bool from_string (const std::string &)
 Initialize from a string. More...
 
- Public Member Functions inherited from datatools::i_serializable
 i_serializable ()
 Default constructor. More...
 
virtual ~i_serializable ()
 Destructor. More...
 
virtual const std::string & get_serial_tag () const =0
 Return the serialization string identifier of the class. More...
 

Static Public Member Functions

static const std::string & urn_scheme ()
 Return the URN scheme. More...
 
static char urn_separator ()
 Return the URN separator. More...
 

Friends

std::ostream & operator<< (std::ostream &, const urn &)
 

Detailed Description

A class representing a simplified URN conforming parts of the RFC2141.

See also
http://www.ietf.org/rfc/rfc2141.txt Supported format is :
urn:namespace:specific-path

Constructor & Destructor Documentation

◆ urn() [1/2]

datatools::urn::urn ( )

Default constructor.

◆ urn() [2/2]

datatools::urn::urn ( const std::vector< std::string > &  segments_)

Constructor with explicit path segments.

◆ ~urn()

virtual datatools::urn::~urn ( )
virtual

Destructor.

Member Function Documentation

◆ append_segment()

void datatools::urn::append_segment ( const std::string &  segment_)

Append a path segment.

◆ from_string()

bool datatools::urn::from_string ( const std::string &  )

Initialize from a string.

◆ get_depth()

std::size_t datatools::urn::get_depth ( ) const

Return the depth of the path segments.

◆ get_namespace()

const std::string& datatools::urn::get_namespace ( ) const

Return the namespace.

◆ get_segments()

const std::vector<std::string>& datatools::urn::get_segments ( ) const

Return the path segments.

◆ has_namespace()

bool datatools::urn::has_namespace ( ) const

Check is namespace is set.

◆ is_valid()

bool datatools::urn::is_valid ( ) const

Check validity.

◆ reset()

void datatools::urn::reset ( )

Clear the path segments.

◆ set_segments()

void datatools::urn::set_segments ( const std::vector< std::string > &  segments_)

Set path segments.

◆ to_string() [1/2]

void datatools::urn::to_string ( std::string &  ) const

Convert to a string.

◆ to_string() [2/2]

std::string datatools::urn::to_string ( ) const

Return a string representation.

◆ urn_scheme()

static const std::string& datatools::urn::urn_scheme ( )
static

Return the URN scheme.

◆ urn_separator()

static char datatools::urn::urn_separator ( )
static

Return the URN separator.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  ,
const urn  
)
friend

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