00001 /* Copyright (c) 2006, Gennady Bystritsky <bystr@mac.com> 00002 * 00003 * Distributed under the MIT Licence. 00004 * This is free software. See 'LICENSE' for details. 00005 * You must read and accept the license prior to use. 00006 */ 00007 00008 #ifndef _SK_UTIL_CONTAINER_ 00009 #define _SK_UTIL_CONTAINER_ 00010 00011 #include <sk/util/Object.h> 00012 #include <sk/util/String.h> 00013 #include <vector> 00014 00015 namespace sk { 00016 namespace util { 00017 class Container 00018 : public std::vector<char>, 00019 public virtual sk::util::Object 00020 { 00021 public: 00022 Container(); 00023 Container(int size); 00024 Container(const char* buffer); 00025 Container(const char* buffer, int length); 00026 Container(const std::string& string); 00027 Container(const std::string& string, int number); 00028 Container(const std::vector<char>& vector); 00029 Container(const std::vector<char>& vector, int number); 00030 virtual ~Container(); 00031 00032 bool isEmpty() const; 00033 int size() const; 00034 int length() const; 00035 00036 Container& operator += (const char* buffer); 00037 Container& operator += (const std::string& string); 00038 Container& operator += (const std::vector<char>& other); 00039 00040 Container& append(const std::vector<char>& other); 00041 00042 // sk::util::Object re-implementation. 00043 const sk::util::Class getClass() const; 00044 const sk::util::String inspect() const; 00045 const sk::util::String toString() const; 00046 }; 00047 } 00048 } 00049 00050 #endif /* _SK_UTIL_CONTAINER_ */