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

A class representing the association of an URN to some paths. A path maybe a filesystem path, an URL, a hostname/port identifier or any other location address that can be represented as a character string. The list if registered paths is ordered to reflect some possible priority policy, depending on the way paths have been inserted in the register. More...

#include <bayeux/datatools/urn_to_path.h>

Inheritance diagram for datatools::urn_to_path:
datatools::i_serializable datatools::i_tree_dumpable

Public Member Functions

 urn_to_path ()
 Default constructor. More...
 
 urn_to_path (const std::string &urn_, const std::string &path_, const std::string &category_="", const std::string &mime_="")
 Constructor with explicit attributes and one single registered path. More...
 
 urn_to_path (const std::string &urn_, const std::string &category_, const std::string &mime_, const std::vector< std::string > &paths_)
 Constructor with explicit attributes. More...
 
virtual ~urn_to_path ()
 Destructor. More...
 
bool is_valid () const
 Check validity. More...
 
void reset ()
 Reset. More...
 
bool has_urn () const
 Check if URN identifier is set. More...
 
void set_urn (const std::string &)
 Set the URN identifier. More...
 
const std::string & get_urn () const
 Return the URN identifier. More...
 
bool has_single_path () const
 Check if one single path is set. More...
 
bool has_path () const
 Check is at least one path is set. More...
 
bool has_path_by_value (const std::string &) const
 Check if a specific path is registered. More...
 
void set_path (const std::string &path_)
 Set a single path at first position. More...
 
const std::string & get_path () const
 Return the path at first position. More...
 
std::size_t get_number_of_paths () const
 Return the number of regisgtered paths. More...
 
const std::string & get_path_by_index (const std::size_t index_=0) const
 Return the path registered at given position. More...
 
void add_path (const std::string &, bool preprend_=false)
 Add a path (postpend) More...
 
void clear_paths ()
 Remove all registered paths. More...
 
bool has_category () const
 Check if the category is set. More...
 
void set_category (const std::string &)
 Set the category. More...
 
const std::string & get_category () const
 Return the category. More...
 
void reset_category ()
 Reset the category. More...
 
bool has_mime () const
 Check if the MIME type is set. More...
 
void set_mime (const std::string &)
 Set the MIME type. More...
 
const std::string & get_mime () const
 Return the MIME type. More...
 
void reset_mime ()
 Reset the MIME type. More...
 
virtual void tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
 Main interface method for smart dump. 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...
 
- Public Member Functions inherited from datatools::i_tree_dumpable
 i_tree_dumpable ()
 Constructor. More...
 
virtual ~i_tree_dumpable ()
 Destructor. More...
 
virtual void print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const
 Main new interface method for printing. More...
 
void print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const
 Printing with jsonized options. More...
 
void print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const
 Printing with jsonized options. More...
 
void tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const
 
void tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const
 
void smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const
 

Additional Inherited Members

- Public Types inherited from datatools::i_tree_dumpable
enum  ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 }
 Enumeration for standard output streams. More...
 
- Static Public Member Functions inherited from datatools::i_tree_dumpable
static const boost::property_tree::ptree & empty_options ()
 
static boost::property_tree::ptree make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false)
 
static std::ostream & last_skip_tag (std::ostream &out_)
 
static std::ostream & skip_tag (std::ostream &out_)
 
static std::ostream & last_tag (std::ostream &out_)
 
static std::ostream & tag (std::ostream &out_)
 

Detailed Description

A class representing the association of an URN to some paths. A path maybe a filesystem path, an URL, a hostname/port identifier or any other location address that can be represented as a character string. The list if registered paths is ordered to reflect some possible priority policy, depending on the way paths have been inserted in the register.

It is possible to assign a category to the object, examples: "configuration", "data", "debian::package", "images"...

It is possible to assign a MIME type to the object, examples: "text/configuration", "image/png"...

A URN-to-path record is considered value if its URN is set and at least one path is registered.

Constructor & Destructor Documentation

◆ urn_to_path() [1/3]

datatools::urn_to_path::urn_to_path ( )

Default constructor.

◆ urn_to_path() [2/3]

datatools::urn_to_path::urn_to_path ( const std::string &  urn_,
const std::string &  path_,
const std::string &  category_ = "",
const std::string &  mime_ = "" 
)

Constructor with explicit attributes and one single registered path.

◆ urn_to_path() [3/3]

datatools::urn_to_path::urn_to_path ( const std::string &  urn_,
const std::string &  category_,
const std::string &  mime_,
const std::vector< std::string > &  paths_ 
)

Constructor with explicit attributes.

◆ ~urn_to_path()

virtual datatools::urn_to_path::~urn_to_path ( )
virtual

Destructor.

Member Function Documentation

◆ add_path()

void datatools::urn_to_path::add_path ( const std::string &  ,
bool  preprend_ = false 
)

Add a path (postpend)

◆ clear_paths()

void datatools::urn_to_path::clear_paths ( )

Remove all registered paths.

◆ get_category()

const std::string& datatools::urn_to_path::get_category ( ) const

Return the category.

◆ get_mime()

const std::string& datatools::urn_to_path::get_mime ( ) const

Return the MIME type.

◆ get_number_of_paths()

std::size_t datatools::urn_to_path::get_number_of_paths ( ) const

Return the number of regisgtered paths.

◆ get_path()

const std::string& datatools::urn_to_path::get_path ( ) const

Return the path at first position.

◆ get_path_by_index()

const std::string& datatools::urn_to_path::get_path_by_index ( const std::size_t  index_ = 0) const

Return the path registered at given position.

◆ get_urn()

const std::string& datatools::urn_to_path::get_urn ( ) const

Return the URN identifier.

◆ has_category()

bool datatools::urn_to_path::has_category ( ) const

Check if the category is set.

◆ has_mime()

bool datatools::urn_to_path::has_mime ( ) const

Check if the MIME type is set.

◆ has_path()

bool datatools::urn_to_path::has_path ( ) const

Check is at least one path is set.

◆ has_path_by_value()

bool datatools::urn_to_path::has_path_by_value ( const std::string &  ) const

Check if a specific path is registered.

◆ has_single_path()

bool datatools::urn_to_path::has_single_path ( ) const

Check if one single path is set.

◆ has_urn()

bool datatools::urn_to_path::has_urn ( ) const

Check if URN identifier is set.

◆ is_valid()

bool datatools::urn_to_path::is_valid ( ) const

Check validity.

◆ reset()

void datatools::urn_to_path::reset ( )

Reset.

◆ reset_category()

void datatools::urn_to_path::reset_category ( )

Reset the category.

◆ reset_mime()

void datatools::urn_to_path::reset_mime ( )

Reset the MIME type.

◆ set_category()

void datatools::urn_to_path::set_category ( const std::string &  )

Set the category.

◆ set_mime()

void datatools::urn_to_path::set_mime ( const std::string &  )

Set the MIME type.

◆ set_path()

void datatools::urn_to_path::set_path ( const std::string &  path_)

Set a single path at first position.

◆ set_urn()

void datatools::urn_to_path::set_urn ( const std::string &  )

Set the URN identifier.

◆ tree_dump()

virtual void datatools::urn_to_path::tree_dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "",
bool  inherit_ = false 
) const
virtual

Main interface method for smart dump.

Reimplemented from datatools::i_tree_dumpable.


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