diff options
| author | navewindre <boneyaard@gmail.com> | 2025-09-03 20:10:09 +0200 |
|---|---|---|
| committer | navewindre <boneyaard@gmail.com> | 2025-09-03 20:10:09 +0200 |
| commit | f8b92ce3aa08b1445c9f956d8166830946562d12 (patch) | |
| tree | 94e63a5aec9f8f52b577f56799e0c9201fd976a5 /src/util/string.h | |
a
Diffstat (limited to 'src/util/string.h')
| -rw-r--r-- | src/util/string.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/util/string.h b/src/util/string.h new file mode 100644 index 0000000..b261e76 --- /dev/null +++ b/src/util/string.h @@ -0,0 +1,23 @@ +#pragma once +#include <string.h> + +#include "typedef.h" + +template <U32 N> +struct STR { + char data[N]; + enum { + size = N + }; + STR() { + memset( data, 0, N ); + } + STR( const char* str ) { + memcpy( data, str, N ); + } + STR( const STR<N>& str ) { + memcpy( data, str.data, N ); + } + + operator char*() { return data; } +}; |
