diff options
-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)); } |