添加广播方式升级
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "QByteArray"
|
||||
#include "QList"
|
||||
#include "QDebug"
|
||||
|
||||
class myarray : public QByteArray
|
||||
{
|
||||
@@ -19,6 +20,7 @@ public:
|
||||
}
|
||||
myarray(int size, char data) : QByteArray(size, data) {}
|
||||
myarray(const myarray &data) : QByteArray(data) {}
|
||||
myarray(const QByteArray &data) : QByteArray(data) {}
|
||||
virtual ~myarray() {}
|
||||
char &operator[](int index)
|
||||
{
|
||||
@@ -29,6 +31,13 @@ public:
|
||||
return data()[size-1];
|
||||
return data()[index];
|
||||
}
|
||||
bool operator==(const char *s){
|
||||
return QByteArray::operator==(s);
|
||||
}
|
||||
bool operator==(const myarray &s){
|
||||
// qDebug("s1=%s,s2=%s",data(),s.data());
|
||||
return strcmp(s.data(),data())==0;
|
||||
}
|
||||
myarray &operator=(const myarray &b)
|
||||
{
|
||||
QByteArray::operator=(b);
|
||||
|
Reference in New Issue
Block a user