mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 19:20:05 +00:00
Default ValidateMessage implementation
This commit is contained in:
parent
0303412519
commit
cb86ab4b9b
6 changed files with 59 additions and 48 deletions
|
|
@ -30,11 +30,13 @@ protected:
|
|||
Message(Message&&) noexcept;
|
||||
Message& operator=(Message&&) noexcept;
|
||||
|
||||
virtual bool ValidateMessage(std::istream& is, size_t bytesRead) const = 0;
|
||||
virtual bool ValidateMessage(std::istream& is, size_t bytesRead) const;
|
||||
|
||||
public:
|
||||
virtual ~Message();
|
||||
|
||||
virtual size_t data_size() const = 0;
|
||||
|
||||
virtual bool Parse(std::istream& is) = 0;
|
||||
|
||||
static void ReadBoolean(std::istream& is, bool& value)
|
||||
|
|
|
|||
|
|
@ -29,11 +29,11 @@ protected:
|
|||
Level2Message(Level2Message&&) noexcept;
|
||||
Level2Message& operator=(Level2Message&&) noexcept;
|
||||
|
||||
bool ValidateMessage(std::istream& is, size_t bytesRead) const override;
|
||||
|
||||
public:
|
||||
virtual ~Level2Message();
|
||||
|
||||
size_t data_size() const override;
|
||||
|
||||
const Level2MessageHeader& header() const;
|
||||
|
||||
void set_header(Level2MessageHeader&& header);
|
||||
|
|
|
|||
|
|
@ -48,9 +48,11 @@ public:
|
|||
|
||||
bool IsCompressionEnabled() const;
|
||||
|
||||
bool Parse(std::istream& is);
|
||||
size_t data_size() const override;
|
||||
|
||||
static const size_t SIZE = 102u;
|
||||
bool Parse(std::istream& is) override;
|
||||
|
||||
static constexpr size_t SIZE = 102u;
|
||||
|
||||
private:
|
||||
std::unique_ptr<ProductDescriptionBlockImpl> p;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue