Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
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>
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_) |
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.
datatools::urn_to_path::urn_to_path | ( | ) |
Default constructor.
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.
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.
|
virtual |
Destructor.
void datatools::urn_to_path::add_path | ( | const std::string & | , |
bool | preprend_ = false |
||
) |
Add a path (postpend)
void datatools::urn_to_path::clear_paths | ( | ) |
Remove all registered paths.
const std::string& datatools::urn_to_path::get_category | ( | ) | const |
Return the category.
const std::string& datatools::urn_to_path::get_mime | ( | ) | const |
Return the MIME type.
std::size_t datatools::urn_to_path::get_number_of_paths | ( | ) | const |
Return the number of regisgtered paths.
const std::string& datatools::urn_to_path::get_path | ( | ) | const |
Return the path at first position.
Return the path registered at given position.
const std::string& datatools::urn_to_path::get_urn | ( | ) | const |
Return the URN identifier.
bool datatools::urn_to_path::has_category | ( | ) | const |
Check if the category is set.
bool datatools::urn_to_path::has_mime | ( | ) | const |
Check if the MIME type is set.
bool datatools::urn_to_path::has_path | ( | ) | const |
Check is at least one path is set.
bool datatools::urn_to_path::has_path_by_value | ( | const std::string & | ) | const |
Check if a specific path is registered.
bool datatools::urn_to_path::has_single_path | ( | ) | const |
Check if one single path is set.
bool datatools::urn_to_path::has_urn | ( | ) | const |
Check if URN identifier is set.
bool datatools::urn_to_path::is_valid | ( | ) | const |
Check validity.
void datatools::urn_to_path::reset | ( | ) |
Reset.
void datatools::urn_to_path::reset_category | ( | ) |
Reset the category.
void datatools::urn_to_path::reset_mime | ( | ) |
Reset the MIME type.
void datatools::urn_to_path::set_category | ( | const std::string & | ) |
Set the category.
void datatools::urn_to_path::set_mime | ( | const std::string & | ) |
Set the MIME type.
void datatools::urn_to_path::set_path | ( | const std::string & | path_ | ) |
Set a single path at first position.
void datatools::urn_to_path::set_urn | ( | const std::string & | ) |
Set the URN identifier.
|
virtual |
Main interface method for smart dump.
Reimplemented from datatools::i_tree_dumpable.