MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / QByteArrayView

Class QByteArrayView

src/ByteArrayUtils.h:28–46  ·  view source on GitHub ↗

WARNING: Dirty QT5 compat. Tested on Debian 13.

Source from the content-addressed store, hash-verified

26
27// WARNING: Dirty QT5 compat. Tested on Debian 13.
28class QByteArrayView
29{
30public:
31 QByteArrayView() : m_data(nullptr), m_size(0) {}
32 QByteArrayView(const char* data, qsizetype size) : m_data(data), m_size(size) {}
33 QByteArrayView(const QByteArray& ba) : m_data(ba.constData()), m_size(ba.size()) {}
34 const char* data() const { return m_data; }
35 qsizetype size() const { return m_size; }
36 bool isEmpty() const { return m_size == 0; }
37 bool operator==(const QByteArrayView& other) const
38 {
39 return m_size == other.m_size && (m_data == other.m_data || (m_size > 0 && std::memcmp(m_data, other.m_data, m_size) == 0));
40 }
41 bool operator!=(const QByteArrayView& other) const { return !(*this == other); }
42
43private:
44 const char* m_data;
45 qsizetype m_size;
46};
47#endif
48#include <QList>
49#include <QSet>

Callers 1

splitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected