Add Dns::Data Assignment Operator

This commit is contained in:
2020-05-01 11:09:16 +02:00
parent 215a68b795
commit c7b7bb1cf4
2 changed files with 8 additions and 0 deletions
+6
View File
@@ -24,6 +24,12 @@ Data::Data(const Data& data) :
{ {
} }
Data& Data::operator=(Data other)
{
m_data = other.m_data;
return *this;
}
uint8_t& Data::GetAt(unsigned pos) uint8_t& Data::GetAt(unsigned pos)
{ {
return m_data[pos]; return m_data[pos];
+2
View File
@@ -16,6 +16,8 @@ public:
Data(const uint8_t* msg, unsigned length); Data(const uint8_t* msg, unsigned length);
Data(const Data& data); Data(const Data& data);
Data& operator=(Data other);
uint8_t& GetAt(unsigned pos); uint8_t& GetAt(unsigned pos);
const uint8_t& GetAt(unsigned pos) const; const uint8_t& GetAt(unsigned pos) const;
uint16_t& GetAt16(unsigned pos); uint16_t& GetAt16(unsigned pos);