Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::SafeCStr< N > Class Template Reference

Safe and efficient conversion of a string_view to a null terminated c-string Uses a internal char buffer of size N to store a null terminated copy of the string_view if string_view is larger than N a char[] will be heap allocated. Note: string_view.data() is not null terminated and can not be passed to functions that expect a c-string. More...

#include <safecstr.h>

Public Member Functions

 SafeCStr (const std::string_view sv)
 
const char * c_str () const
 
 operator const char * () const
 

Detailed Description

template<size_t N = 120>
class inviwo::SafeCStr< N >

Safe and efficient conversion of a string_view to a null terminated c-string Uses a internal char buffer of size N to store a null terminated copy of the string_view if string_view is larger than N a char[] will be heap allocated. Note: string_view.data() is not null terminated and can not be passed to functions that expect a c-string.


The documentation for this class was generated from the following file: