1 // ***************************************************************************
2 // ByteArray_p.h (c) 2011 Derek Barnett
3 // Marth Lab, Department of Biology, Boston College
4 // ---------------------------------------------------------------------------
5 // Last modified: 10 November 2011 (DB)
6 // ---------------------------------------------------------------------------
7 // Provides a dynamic, variable-length byte buffer
8 // ***************************************************************************
17 // This file is not part of the BamTools API. It exists purely as an
18 // implementation detail. This header file may change from version to version
19 // without notice, or even be removed.
23 #include "api/api_global.h"
30 // provides a wrapper around a byte vector
36 ByteArray(const std::string& value);
37 ByteArray(const std::vector<char>& value);
38 ByteArray(const char* value, size_t n);
39 ByteArray(const ByteArray& other);
42 ByteArray& operator=(const ByteArray& other);
44 // ByteArray interface
48 const char* ConstData(void) const;
50 const char& operator[](size_t i) const;
51 char& operator[](size_t i);
53 // byte array manipulation
55 size_t IndexOf(const char c, const size_t from = 0, const size_t to = 0) const;
56 ByteArray& Remove(size_t from, size_t n);
57 void Resize(size_t n);
58 size_t Size(void) const;
63 std::vector<char> m_data;
66 } // namespace Internal
67 } // namespace BamTools
69 #endif // BYTEARRAY_P_H