Subversion Repositories HomeAutomation

Rev

Rev 1916 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. /*
  2.  *
  3.  *  Copyright (C) 2010  Mattias Runge
  4.  *
  5.  *  This program is free software; you can redistribute it and/or modify
  6.  *  it under the terms of the GNU General Public License as published by
  7.  *  the Free Software Foundation; either version 2 of the License, or
  8.  *  (at your option) any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU General Public License along
  16.  *  with this program; if not, write to the Free Software Foundation, Inc.,
  17.  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18.  *
  19.  */
  20.  
  21. #ifndef TYPE_BUFFER_H
  22. #define TYPE_BUFFER_H
  23.  
  24. #include <string>
  25. #include <vector>
  26.  
  27. #include <boost/shared_ptr.hpp>
  28.  
  29. #include "common.h"
  30.  
  31. namespace atom {
  32. namespace common {
  33.  
  34. typedef std::vector<unsigned char> Byteset;
  35. /*
  36. class Byteset
  37. {
  38. public:
  39.     typedef boost::shared_ptr<Byteset> Pointer;
  40.    
  41.     Byteset(unsigned int max_size);
  42.     Byteset(const Byteset& set);
  43.     Byteset(std::string str);
  44.     Byteset(std::string str, bool no_null_termination);
  45.     virtual ~Byteset();
  46.    
  47.     unsigned int GetMaxSize() const;
  48.     unsigned char* Get() const;
  49.    
  50.     std::string ToCharString();
  51.     std::string ToDebugString();
  52.    
  53.     unsigned char& operator[](unsigned int index);
  54.  
  55.     unsigned int GetSize() const;
  56.     void SetSize(unsigned int size);
  57.    
  58.     void Append(unsigned char byte);
  59.    
  60.     void Clear();
  61.     void Fill(char c);
  62.    
  63. private:
  64.     unsigned char* bytes_;
  65.     unsigned int max_size_;
  66.    
  67.     unsigned int size_;
  68.    
  69. };
  70. */
  71. }; // namespace type
  72. }; // namespace atom
  73.  
  74. #endif // TYPE_BUFFER_H
  75.