summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-07-01 19:47:07 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2019-07-01 19:47:07 +0100
commitaff8d1afbb9024a1ddf9e9279562b61f610b9ed3 (patch)
tree621c44d7375d3c1ae31770262397aabdd6c38bf0
parentGet glibmm flags from pkg-config (diff)
downloadlibadhocutil-aff8d1afbb9024a1ddf9e9279562b61f610b9ed3.tar.bz2
libadhocutil-aff8d1afbb9024a1ddf9e9279562b61f610b9ed3.tar.xz
libadhocutil-aff8d1afbb9024a1ddf9e9279562b61f610b9ed3.zip
Fix linter and doxygen warnings
-rw-r--r--libadhocutil/memstream.cpp1
-rw-r--r--libadhocutil/memstream.h9
2 files changed, 10 insertions, 0 deletions
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 <string_view>
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: