summaryrefslogtreecommitdiff
path: root/src/util/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/string.h')
-rw-r--r--src/util/string.h23
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; }
+};