00001 00005 class CharPack 00006 00007 { 00008 protected: 00009 VecSimplest(char) array; 00010 int current_index; 00011 int nitems; 00012 00013 void copy (char* from, int nbytes, char* to); 00014 00015 public: 00016 CharPack () {} 00017 CharPack (int nbytes) { redim(nbytes); } 00018 ~CharPack () {} 00019 bool redim (int nbytes) { return array.redim(nbytes); } 00020 int getNoItems () const { return nitems; } 00021 char* getCharArray () { return array.getPtr0(); } 00022 int getCurrentIndex() const{ return current_index; } 00023 00024 void initPack () { current_index = 1; nitems = 0; } 00025 void initUnPack () { current_index = 1; } 00026 00027 bool pack (real r); 00028 bool pack (int i); 00029 bool pack (const String& s); 00030 bool pack (const Complex& c); 00031 bool unpack (real& r); 00032 bool unpack (int& i); 00033 bool unpack (String& s); 00034 bool unpack (Complex& c); 00035 00036 void debugPrint (Os os); 00037 }; 00038 00039