summaryrefslogtreecommitdiff
path: root/rfc4251.C
diff options
context:
space:
mode:
authorTimo Weingärtner <timo@tiwe.de>2015-08-31 20:22:37 +0200
committerTimo Weingärtner <timo@tiwe.de>2015-08-31 20:22:37 +0200
commit8f675da301eafe79897f3ad67ff5450fcc397f78 (patch)
tree126388c8ff57830d8c3633827a5e4a2b94d7f5a2 /rfc4251.C
parent774ff2757de2a32c57046cbdc8425c6c22759035 (diff)
downloadssh-agent-filter-8f675da301eafe79897f3ad67ff5450fcc397f78.tar.gz
move rfc4251 types into their own namespace
Diffstat (limited to 'rfc4251.C')
-rw-r--r--rfc4251.C12
1 files changed, 8 insertions, 4 deletions
diff --git a/rfc4251.C b/rfc4251.C
index 0b7aa62..bf3fe4a 100644
--- a/rfc4251.C
+++ b/rfc4251.C
@@ -1,7 +1,7 @@
/*
* rfc4251.C -- support for name-list type from RFC 4251, section 5
*
- * These are the conversions between an rfc4251string containing a name-list
+ * These are the conversions between an rfc4251::string containing a name-list
* and vector<string>.
*
* Copyright (C) 2013 Timo Weingärtner <timo@tiwe.de>
@@ -24,12 +24,14 @@
#include "rfc4251.H"
-rfc4251string::rfc4251string (std::vector<std::string> const & v) {
+namespace rfc4251 {
+
+string::string (std::vector<std::string> const & v) {
for (auto it = v.begin(); it != v.end();) {
if (it->size() == 0)
throw std::length_error{"name of zero length"};
if (value.size() + it->size() > std::numeric_limits<uint32_t>::max())
- throw std::length_error{"32-bit limit for rfc4251string exceeded"};
+ throw std::length_error{"32-bit limit for rfc4251::string exceeded"};
value.insert(value.end(), it->data(), it->data() + it->size());
++it;
if (it == v.end())
@@ -38,7 +40,7 @@ rfc4251string::rfc4251string (std::vector<std::string> const & v) {
}
}
-rfc4251string::operator std::vector<std::string> () const {
+string::operator std::vector<std::string> () const {
std::vector<std::string> ret;
auto name_start = value.begin();
if (name_start != value.end())
@@ -54,3 +56,5 @@ rfc4251string::operator std::vector<std::string> () const {
}
return ret;
}
+
+}