OpenDDS  Snapshot(2023/04/28-20:55)
Public Types | Public Member Functions | Public Attributes | List of all members
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]

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 28 of file CommonUtilities.h.

Member Enumeration Documentation

◆ Scheme

Constructor & Destructor Documentation

◆ URI()

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

Definition at line 16 of file CommonUtilities.cpp.

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

17  : scheme(URI_UNKNOWN), everything_else("") //authority(), path(""), query(""), fragment("")
18 {
19  typedef std::vector<std::pair<std::string, Scheme> > uri_pattern_t;
20 
21  uri_pattern_t uri_patterns;
22  uri_patterns.push_back(std::make_pair("file:", URI_FILE));
23  uri_patterns.push_back(std::make_pair("data:", URI_DATA));
24  uri_patterns.push_back(std::make_pair("pkcs11:", URI_PKCS11));
25 
26  for (uri_pattern_t::iterator i = uri_patterns.begin();
27  i != uri_patterns.end(); ++i) {
28  const std::string& pfx = i->first;
29  size_t pfx_end = pfx.length();
30 
31  if (src.substr(0, pfx_end) == pfx) {
32  everything_else = src.substr(pfx_end, std::string::npos);
33  scheme = i->second;
34  break;
35  }
36  }
37 }

Member Data Documentation

◆ everything_else

std::string OpenDDS::Security::CommonUtilities::URI::everything_else

◆ scheme

Scheme OpenDDS::Security::CommonUtilities::URI::scheme

The documentation for this struct was generated from the following files: