Rev 1916 | Details | Compare with Previous | Last modification | View Log | SVN | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1596 | runge | 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> |
||
| 1987 | runge | 25 | #include <vector> |
| 1596 | runge | 26 | |
| 27 | #include <boost/shared_ptr.hpp> |
||
| 28 | |||
| 29 | #include "common.h" |
||
| 30 | |||
| 31 | namespace atom { |
||
| 1642 | runge | 32 | namespace common { |
| 1596 | runge | 33 | |
| 1987 | runge | 34 | typedef std::vector<unsigned char> Byteset; |
| 35 | /* |
||
| 1596 | runge | 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); |
||
| 1916 | runge | 44 | Byteset(std::string str, bool no_null_termination); |
| 1596 | runge | 45 | virtual ~Byteset(); |
| 46 | |||
| 47 | unsigned int GetMaxSize() const; |
||
| 48 | unsigned char* Get() const; |
||
| 49 | |||
| 1597 | runge | 50 | std::string ToCharString(); |
| 1598 | runge | 51 | std::string ToDebugString(); |
| 1597 | runge | 52 | |
| 1596 | runge | 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(); |
||
| 1642 | runge | 61 | void Fill(char c); |
| 1596 | runge | 62 | |
| 63 | private: |
||
| 64 | unsigned char* bytes_; |
||
| 65 | unsigned int max_size_; |
||
| 66 | |||
| 67 | unsigned int size_; |
||
| 68 | |||
| 69 | }; |
||
| 1987 | runge | 70 | */ |
| 1596 | runge | 71 | }; // namespace type |
| 72 | }; // namespace atom |
||
| 73 | |||
| 74 | #endif // TYPE_BUFFER_H |