mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-03 03:11:43 +02:00
made "serialize" const
This commit is contained in:
parent
56389ad202
commit
b936bffeff
11 changed files with 104 additions and 73 deletions
|
@ -49,7 +49,7 @@ public:
|
|||
stream.read(&command[0], size);
|
||||
}
|
||||
|
||||
virtual uint32_t getSize()
|
||||
virtual uint32_t getSize() const
|
||||
{
|
||||
return sizeof(int16_t) + command.size();
|
||||
}
|
||||
|
@ -57,10 +57,10 @@ public:
|
|||
std::string command;
|
||||
|
||||
protected:
|
||||
virtual void doserialize(std::ostream& stream)
|
||||
virtual void doserialize(std::ostream& stream) const
|
||||
{
|
||||
int16_t size(command.size());
|
||||
stream.write(reinterpret_cast<char *>(&size), sizeof(int16_t));
|
||||
stream.write(reinterpret_cast<const char *>(&size), sizeof(int16_t));
|
||||
stream.write(command.c_str(), size);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue