From aff8d1afbb9024a1ddf9e9279562b61f610b9ed3 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 1 Jul 2019 19:47:07 +0100 Subject: Fix linter and doxygen warnings --- libadhocutil/memstream.cpp | 1 + libadhocutil/memstream.h | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/libadhocutil/memstream.cpp b/libadhocutil/memstream.cpp index 35d42ad..a4ce95e 100644 --- a/libadhocutil/memstream.cpp +++ b/libadhocutil/memstream.cpp @@ -12,6 +12,7 @@ namespace AdHoc { MemStream::~MemStream() { fclose(strm); + // NOLINTNEXTLINE(hicpp-no-malloc) free(buf); } diff --git a/libadhocutil/memstream.h b/libadhocutil/memstream.h index b807d8b..20b65fc 100644 --- a/libadhocutil/memstream.h +++ b/libadhocutil/memstream.h @@ -6,6 +6,9 @@ #include namespace AdHoc { + /** + * Wrapper around open_memstream(3) + */ class DLL_PUBLIC MemStream { public: MemStream(); @@ -17,12 +20,18 @@ namespace AdHoc { void operator=(const MemStream &) = delete; void operator=(MemStream &&) = delete; + /// Implicit conversion to use as FILE* for writes operator FILE * (); + /// Implicit conversion to use as const char * for reads operator const char * () const; + /// Implicit conversion to use as std::string_view for reads operator std::string_view () const; + /// Get buffer contents const char * buffer() const; + /// Get buffer contents view std::string_view sv() const; + /// Get buffer length size_t length() const; private: -- cgit v1.2.3