summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/IceSSL/RFC2253.cpp16
-rw-r--r--cpp/src/IceSSL/RFC2253.h39
2 files changed, 29 insertions, 26 deletions
diff --git a/cpp/src/IceSSL/RFC2253.cpp b/cpp/src/IceSSL/RFC2253.cpp
index 031e78b8bf8..ade183d39b6 100644
--- a/cpp/src/IceSSL/RFC2253.cpp
+++ b/cpp/src/IceSSL/RFC2253.cpp
@@ -16,11 +16,9 @@ using namespace IceSSL;
//
// See RFC 2253 and RFC 1779.
//
-namespace RFC2253
-{
static string special = ",=+<>#;";
-string hexvalid = "0123456789abcdefABCDEF";
+static string hexvalid = "0123456789abcdefABCDEF";
static char unescapeHex(const string&, size_t);
static pair<string,string> parseNameComponent(const string&, size_t&);
@@ -31,8 +29,8 @@ static string parsePair(const string&, size_t&);
static string parseHexPair(const string&, size_t&, bool);
static void eatWhite(const string&, size_t&);
-RDNSeqSeq
-parse(const string& data)
+IceSSL::RFC2253::RDNSeqSeq
+IceSSL::RFC2253::parse(const string& data)
{
RDNSeqSeq results;
RDNSeq current;
@@ -64,8 +62,8 @@ parse(const string& data)
return results;
}
-RDNSeq
-parseStrict(const string& data)
+IceSSL::RFC2253::RDNSeq
+IceSSL::RFC2253::parseStrict(const string& data)
{
RDNSeq results;
size_t pos = 0;
@@ -86,7 +84,7 @@ parseStrict(const string& data)
}
string
-unescape(const string& data)
+IceSSL::RFC2253::unescape(const string& data)
{
if(data.size() == 0)
{
@@ -474,8 +472,6 @@ eatWhite(const string& data, size_t& pos)
}
}
-}
-
#ifdef never
void
print(const list< list<pair<string, string> > >& r)
diff --git a/cpp/src/IceSSL/RFC2253.h b/cpp/src/IceSSL/RFC2253.h
index 22bd20e2eba..f5edcd6088f 100644
--- a/cpp/src/IceSSL/RFC2253.h
+++ b/cpp/src/IceSSL/RFC2253.h
@@ -10,35 +10,41 @@
#ifndef ICE_SSL_RFC_2253_H
#define ICE_SSL_RFC_2253_H
-#include <IceUtil/Exception.h>
+#include <IceUtil/Config.h>
#include <list>
-namespace RFC2253
-{
-
//
-// This returns a list of list of RDN pairs parsed according to the
-// RFC2253 parsing rules as outlined in section 3 and section 4 of the
-// RFC.
+// The methods in the IceSSL::RFC2253 namespace implement a parser
+// for relative distinguished name (RDN) pairs using the parsing
+// rules outlined in sections 3 and 4 of RFC 2253.
+//
+// Note that this parser does not unescape the elements of the RDNs.
+// For example, parsing the following RDN
//
-// Note that this parser does not unescape the elements of the RDNs. So:
+// O=Sue\, Grabit and Runn
//
-// O=Sue\, Grabit and Runn will result in ("O","Sue\, Grabit and
-// Runn") not ("O","Sue, Grabit and Runn").
+// results in the pair ("O","Sue\, Grabit and Runn") and not
+// ("O","Sue, Grabit and Runn").
//
+namespace IceSSL
+{
+namespace RFC2253
+{
+
typedef std::list< std::pair<std::string, std::string> > RDNSeq;
typedef std::list<RDNSeq> RDNSeqSeq;
+
//
-// This method seperates DNs with the ';' character.
-//
-// This method returns a list of list of DNs. Any failure in parsing
-// results in a ParseException being thrown.
+// This method separates DNs with the ';' character and returns
+// a list of list of RDN pairs. Any failure in parsing results in a
+// ParseException being thrown.
//
RDNSeqSeq parse(const std::string&);
+
//
-// RDNs are seperated with ',' and ';'.
+// RDNs are separated with ',' and ';'.
//
-// This method returns a list of list of RDNs. Any failure in parsing
+// This method returns a list of RDN pairs. Any failure in parsing
// results in a ParseException being thrown.
//
RDNSeq parseStrict(const std::string&);
@@ -49,5 +55,6 @@ RDNSeq parseStrict(const std::string&);
std::string unescape(const std::string&);
}
+}
#endif