summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2018-03-14 20:44:53 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2018-03-14 20:44:53 +0000
commitebccad6fa63b829955e02cf4dcd2a6c700b4045a (patch)
treee79d74756987dd8d660d4dafc376ec02b83bb886
parentAdd a string_view accessor for MemMap (diff)
downloadlibadhocutil-ebccad6fa63b829955e02cf4dcd2a6c700b4045a.tar.bz2
libadhocutil-ebccad6fa63b829955e02cf4dcd2a6c700b4045a.tar.xz
libadhocutil-ebccad6fa63b829955e02cf4dcd2a6c700b4045a.zip
Add documentation for MemMap::sv()
-rw-r--r--libadhocutil/fileUtils.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libadhocutil/fileUtils.h b/libadhocutil/fileUtils.h
index 56ece22..9cc73cb 100644
--- a/libadhocutil/fileUtils.h
+++ b/libadhocutil/fileUtils.h
@@ -151,9 +151,11 @@ namespace AdHoc {
/// The file data.
void * const data;
+ /**
+ * Create a std::string_view of the mapped data.
+ */
template<typename T = char>
- auto
- sv() const
+ auto sv() const
{
return std::basic_string_view<T>((const T *)data, st.st_size / sizeof(T));
}