Public Member Functions | |
RouteContainer () | |
Empty constructor. | |
RouteContainer (std::string const &routes) | |
Constructor from a JSON array of routes. | |
bool | addRoute (std::string const &routingDirective) |
Register a JSON string as a routing directive. More... | |
std::string | getRoutes (bool styled=false) const |
Get a JSON array of all routing directives. More... | |
std::string | getSource (std::string const &destination) const |
Get the source JSON string for a given destination path. More... | |
std::string | getSourceAt (size_t i) const |
std::string | getDestinationAt (size_t i) const |
std::string | getRouteForDestination (std::string const &destination) const |
Get the full routing JSON string for a given destination path. More... | |
std::size_t | size () const |
Gets the number of directives. | |
std::vector< std::string > const & | getRouteList () const |
Static Public Member Functions | |
static std::string | getDestinationFromString (std::string const &route) |
Gets the destination of a route, given the route in string format. | |
static std::string | getSourceFromString (std::string const &route) |
Gets the source of a route, given the route in string format. | |
Definition at line 40 of file RouteContainer.h.
bool osvr::common::RouteContainer::addRoute | ( | std::string const & | routingDirective | ) |
Register a JSON string as a routing directive.
Definition at line 84 of file RouteContainer.cpp.
std::string osvr::common::RouteContainer::getRoutes | ( | bool | styled = false | ) | const |
Get a JSON array of all routing directives.
styled | Pass true if you want the result pretty-printed. |
Definition at line 89 of file RouteContainer.cpp.
std::string osvr::common::RouteContainer::getSource | ( | std::string const & | destination | ) | const |
Get the source JSON string for a given destination path.
Definition at line 101 of file RouteContainer.cpp.
std::string osvr::common::RouteContainer::getRouteForDestination | ( | std::string const & | destination | ) | const |
Get the full routing JSON string for a given destination path.
Definition at line 120 of file RouteContainer.cpp.