diff options
author | Alexis211 <alexis211@gmail.com> | 2009-10-18 15:27:34 +0200 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-10-18 15:27:34 +0200 |
commit | 323e12f1f9ab33df15dcfed210e807561d98fa8c (patch) | |
tree | 7d76e6932d4a979a1f2bfafc94478b66b1479bbc /Source/Library/Common/ByteArray.class.h | |
parent | bc2eccdd11c27029096fb3e891073503eb269e27 (diff) | |
download | Melon-323e12f1f9ab33df15dcfed210e807561d98fa8c.tar.gz Melon-323e12f1f9ab33df15dcfed210e807561d98fa8c.zip |
Re-organized everything
Diffstat (limited to 'Source/Library/Common/ByteArray.class.h')
-rw-r--r-- | Source/Library/Common/ByteArray.class.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/Library/Common/ByteArray.class.h b/Source/Library/Common/ByteArray.class.h new file mode 100644 index 0000000..339e0d4 --- /dev/null +++ b/Source/Library/Common/ByteArray.class.h @@ -0,0 +1,27 @@ +#ifndef DEF_BYTEARRAY_CLASS_H +#define DEF_BYTEARRAY_CLASS_H + +#include <String.class.h> + +class ByteArray : public BasicString<u8int> { + public: + ByteArray() : BasicString<u8int>() {} + ByteArray(const BasicString<u8int> &bs) : BasicString<u8int>() { + m_length = bs.size(); + m_string = new u8int[m_length]; + for (u32int i = 0; i < m_length; i++) + m_string[i] = bs[i]; + } + ByteArray(const ByteArray& other) : BasicString<u8int>(other) {} + ByteArray(const char* c); + ByteArray(u32int size) : BasicString<u8int>((u8int)0, size) {} + ByteArray(const String &string, u8int encoding = UE_UTF8) : BasicString<u8int>() { affect(string, encoding); } + + void affect(const String& string, u8int encoding = UE_UTF8); + void resize(u32int size); + + String toString(u8int encoding = UE_UTF8); + operator u8int* () { return m_string; } +}; + +#endif |