#include <URNResolver.h>
Public Member Functions | |
| URNResolver (const string &_config_file="") | |
| Constructor. | |
| void | loadConfigFile (const string &config_file) |
| Loads a config file and adds its resolution rules to the URNResolver. | |
| void | addURNResolveRule (const string &name_space, const string &prefix, const string &path) |
| Addes a new urn resolve rule to the URN resolver. | |
| string | resolveURN (const string &urn) |
| Given a URN name the resolved path is returned. | |
Protected Types | |
|
typedef map< string, string, lessthan_string > | URNmap |
Protected Member Functions | |
| bool | nonCaseEquals (const string &s1, const string &s2) |
| bool | hasPrefix (const string &s, const string &prefix) |
| string | toLower (const string &s) |
Protected Attributes | |
| URNmap | urn_prefix_map |
| string | config_file |
| bool | initialised |
Static Protected Attributes | |
| static const unsigned int | MAX_LINE_SIZE = 1024 |
A URN allows an abstract resolution mechanism to be invoked to locate a resource (IETF RFC 2141 http://www.ietf.org/rfc/rfc2141.txt?number=2141). This allows a resource to be located on the local machine or a platform dependent resource to be located using the URN along with platform-specific identifiers.
A URN is specified on the following form urn:namespace:namespace_string
The namespace identifies how the namespace_string should be interpreted.
The URNResolver has a map from urn prefixes to paths that it will use to resolve the urn. Normally the rules resides in a config file that are given to the URNResolver constructor. The rules are on the form
urn:web3d: c: urn:h3d:textures http://www.h3d.org/textures
This means that e.g. urn:h3d:textures/concrete.jpg will be resolved to http://www.h3d.org/textures/concrete.jpg/
|
|
Constructor. The config_file specifies a file containing URN lookup rules. |
|
||||||||||||||||
|
Addes a new urn resolve rule to the URN resolver.
|
|
|
Given a URN name the resolved path is returned. If no resolution could be found using the rules, urn is returned. |
1.4.5