OpenDDS::Security::CommonUtilities::URI Struct Reference

This URI abstraction is currently naive and only separates the URI scheme on the LHS from the "everything-else" of the URI on the RHS. As such this may only handle the URI_FILE and URI_DATA cases properly. Further investigate into URI_PKCS11 should be completed. More...

#include <CommonUtilities.h>

Collaboration diagram for OpenDDS::Security::CommonUtilities::URI:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Scheme { URI_UNKNOWN, URI_FILE, URI_DATA, URI_PKCS11 }

Public Member Functions

 URI (const std::string &src)

Public Attributes

Scheme scheme
std::string everything_else

Detailed Description

This URI abstraction is currently naive and only separates the URI scheme on the LHS from the "everything-else" of the URI on the RHS. As such this may only handle the URI_FILE and URI_DATA cases properly. Further investigate into URI_PKCS11 should be completed.

Definition at line 24 of file CommonUtilities.h.


Member Enumeration Documentation

Enumerator:
URI_UNKNOWN 
URI_FILE 
URI_DATA 
URI_PKCS11 

Definition at line 25 of file CommonUtilities.h.

00026   {
00027     URI_UNKNOWN,
00028     URI_FILE,
00029     URI_DATA,
00030     URI_PKCS11,
00031   };


Constructor & Destructor Documentation

OpenDDS::Security::CommonUtilities::URI::URI ( const std::string &  src  )  [explicit]

Definition at line 11 of file CommonUtilities.cpp.

References everything_else, scheme, URI_DATA, URI_FILE, and URI_PKCS11.

00012   : scheme(URI_UNKNOWN), everything_else("") //authority(), path(""), query(""), fragment("")
00013 {
00014   typedef std::vector<std::pair<std::string, Scheme> > uri_pattern_t;
00015 
00016   uri_pattern_t uri_patterns;
00017   uri_patterns.push_back(std::make_pair("file:", URI_FILE));
00018   uri_patterns.push_back(std::make_pair("data:", URI_DATA));
00019   uri_patterns.push_back(std::make_pair("pkcs11:", URI_PKCS11));
00020 
00021   for (uri_pattern_t::iterator i = uri_patterns.begin();
00022        i != uri_patterns.end(); ++i) {
00023     const std::string& pfx = i->first;
00024     size_t pfx_end = pfx.length();
00025 
00026     if (src.substr(0, pfx_end) == pfx) {
00027       everything_else = src.substr(pfx_end, std::string::npos);
00028       scheme = i->second;
00029       break;
00030     }
00031   }
00032 }


Member Data Documentation


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1