diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-03-14 20:44:53 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2018-03-14 20:44:53 +0000 |
commit | ebccad6fa63b829955e02cf4dcd2a6c700b4045a (patch) | |
tree | e79d74756987dd8d660d4dafc376ec02b83bb886 | |
parent | Add a string_view accessor for MemMap (diff) | |
download | libadhocutil-ebccad6fa63b829955e02cf4dcd2a6c700b4045a.tar.bz2 libadhocutil-ebccad6fa63b829955e02cf4dcd2a6c700b4045a.tar.xz libadhocutil-ebccad6fa63b829955e02cf4dcd2a6c700b4045a.zip |
Add documentation for MemMap::sv()
-rw-r--r-- | libadhocutil/fileUtils.h | 6 |
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)); } |