diff options
| author | oy <Tom_Adams@web.de> | 2011-04-13 20:37:12 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-04-13 20:37:12 +0200 |
| commit | 06115dd49dca2f8eb5f14606437e8fd20037cc4d (patch) | |
| tree | 5ec4bca6158319b3f5285d7689c5f94ae8da8c93 /src/base/tl/string.h | |
| parent | 63e059b8fff6498e42b765a1dca000e53005ea77 (diff) | |
| download | zcatch-06115dd49dca2f8eb5f14606437e8fd20037cc4d.tar.gz zcatch-06115dd49dca2f8eb5f14606437e8fd20037cc4d.zip | |
added "Whitespace and line Endings cleanup" by GreYFoX
Diffstat (limited to 'src/base/tl/string.h')
| -rw-r--r-- | src/base/tl/string.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/base/tl/string.h b/src/base/tl/string.h index 18fab4d4..e0b891ad 100644 --- a/src/base/tl/string.h +++ b/src/base/tl/string.h @@ -11,38 +11,38 @@ class string_base : private ALLOCATOR { char *str; int length; - + void reset() { str = 0; length = 0; } - + void free() { ALLOCATOR::free_array(str); reset(); - } - + } + void copy(const char *other_str, int other_length) { length = other_length; str = ALLOCATOR::alloc_array(length+1); mem_copy(str, other_str, length+1); } - + void copy(const string_base &other) { if(!other.str) return; copy(other.str, other.length); } - + public: string_base() { reset(); } string_base(const char *other_str) { copy(other_str, str_length(other_str)); } string_base(const string_base &other) { reset(); copy(other); } ~string_base() { free(); } - + string_base &operator = (const char *other) { free(); @@ -50,17 +50,17 @@ public: copy(other, str_length(other)); return *this; } - + string_base &operator = (const string_base &other) { free(); copy(other); return *this; } - + bool operator < (const char *other_str) const { return str_comp(str, other_str) < 0; } operator const char *() const { return str; } - + const char *cstr() const { return str; } }; |