From 8f675da301eafe79897f3ad67ff5450fcc397f78 Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Mon, 31 Aug 2015 20:22:37 +0200 Subject: move rfc4251 types into their own namespace --- rfc4251.C | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'rfc4251.C') 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. * * Copyright (C) 2013 Timo Weingärtner @@ -24,12 +24,14 @@ #include "rfc4251.H" -rfc4251string::rfc4251string (std::vector const & v) { +namespace rfc4251 { + +string::string (std::vector 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::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 const & v) { } } -rfc4251string::operator std::vector () const { +string::operator std::vector () const { std::vector ret; auto name_start = value.begin(); if (name_start != value.end()) @@ -54,3 +56,5 @@ rfc4251string::operator std::vector () const { } return ret; } + +} -- cgit v1.2.3