summaryrefslogtreecommitdiff
path: root/rfc4251.h
diff options
context:
space:
mode:
authorTimo Weingärtner <timo@tiwe.de>2014-04-20 23:35:04 +0200
committerTimo Weingärtner <timo@tiwe.de>2014-04-20 23:35:04 +0200
commita257a44837e78d283f1735b4685618c270aa54bc (patch)
tree1156ace98f6269b0b72c4d0ff9ecb3c39dfb7a08 /rfc4251.h
parenta7f6e0c1d8553df678aa7b401eb374cf179210f7 (diff)
downloadssh-agent-filter-a257a44837e78d283f1735b4685618c270aa54bc.tar.gz
use boost::iostreams instead of std::stringstreams
boost::iostreams::array_source instead of istringstream boost::iostreams::back_insert_device instead of ostringstream this should save at least one copy each and still has length checks (input) or dynamic growth (output)
Diffstat (limited to 'rfc4251.h')
-rw-r--r--rfc4251.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/rfc4251.h b/rfc4251.h
index 876db07..3c291a2 100644
--- a/rfc4251.h
+++ b/rfc4251.h
@@ -164,6 +164,10 @@ struct rfc4251string : boost::totally_ordered<rfc4251string> {
explicit rfc4251string (mpz_class const & x) : rfc4251string{x.get_mpz_t()} {}
inline explicit rfc4251string (std::istream &);
+ size_t size () const { return value.size(); }
+ char const * data () const { return value.data(); }
+ char * data () { return value.data(); }
+
operator std::string () const { return {value.begin(), value.end()}; }
operator std::vector<std::string> () const;
operator mpz_class () const;