|
WD
|
#include <webdriver_route_table.h>

Public Member Functions | |
| RouteTable () | |
| RouteTable (const RouteTable &obj) | |
| RouteTable & | operator= (const RouteTable &obj) |
| virtual | ~RouteTable () |
| template<typename CommandType > | |
| bool | Add (const std::string &pattern) |
| void | Remove (const std::string &pattern) |
| void | Clear () |
| bool | HasRoute (const std::string &pattern) |
| CommandCreatorPtr | GetRouteForURL (const std::string &url, std::string *pattern=NULL) const |
| std::vector< std::string > | GetRoutes () |
Container for routes. Each route is a pair - url pattern and command creator. url pattern is string. Some path segments in this url pattern can be wildcarded with single '*'. In example - "/session/*/log"
|
explicit |
Creates a new RouteTable that will register all URL commands with the given context.
| webdriver::RouteTable::RouteTable | ( | const RouteTable & | obj | ) |
Copy constructor.
|
virtual |
| bool webdriver::RouteTable::Add | ( | const std::string & | pattern | ) |
Registers a command for a WebDriver command using the given URL pattern.
| <CommandType> | class of command to handle this route. Must be subtype of webdriver::Command |
| pattern | url pattern of route to add |
| void webdriver::RouteTable::Clear | ( | ) |
Removes all routes.
| CommandCreatorPtr webdriver::RouteTable::GetRouteForURL | ( | const std::string & | url, |
| std::string * | pattern = NULL |
||
| ) | const |
Find matched route for given url and retrieve CommandCreator for this route.
| url | url to handle | |
| [out] | pattern | optional output - matched pattern for url |
| std::vector<std::string> webdriver::RouteTable::GetRoutes | ( | ) |
Returns list of registered routes
| bool webdriver::RouteTable::HasRoute | ( | const std::string & | pattern | ) |
Checks if route is already registered
| pattern | url pattern of route to check |
| RouteTable& webdriver::RouteTable::operator= | ( | const RouteTable & | obj | ) |
assignment operator
| void webdriver::RouteTable::Remove | ( | const std::string & | pattern | ) |
Removes a command for pattern registered previously.
| pattern | url pattern of route to remove |