From a257a44837e78d283f1735b4685618c270aa54bc Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Sun, 20 Apr 2014 23:35:04 +0200 Subject: 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) --- rfc4251.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'rfc4251.h') 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 { 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 () const; operator mpz_class () const; -- cgit v1.2.3