//////////////////////////////////////////////////////////////////////// // Copyright (c) Nehmulos 2011-2014 // This file is part of N0 Strain Serialization Library. // // N0Strain-Serialization-Library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // N0Strain-Serialization-Library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with N0Strain-Serialization-Library. If not, see https://gnu.org/licenses/lgpl-3.0 //////////////////////////////////////////////////////////////////////// #pragma once #include "Describer.h" namespace nw { class Writer : public Describer { public: virtual void describeValueConst(const bool&) = 0; virtual void describeValueConst(const char&) = 0; virtual void describeValueConst(const unsigned char&) = 0; virtual void describeValueConst(const signed char&) = 0; //2 byte virtual void describeValueConst(const short&) = 0; virtual void describeValueConst(const unsigned short&) = 0; //4 byte virtual void describeValueConst(const int&) = 0; virtual void describeValueConst(const unsigned int&) = 0; virtual void describeValueConst(const long&) = 0; virtual void describeValueConst(const unsigned long&) = 0; virtual void describeValueConst(const float&) = 0; virtual void describeValueConst(const Pointer) = 0; //8 byte virtual void describeValueConst(const double&) = 0; virtual void describeValueConst(const long long&) = 0; //12 byte virtual void describeValueConst(const long double&) = 0; //variable size virtual void describeValueConst(const String&) = 0; virtual void describeBlobConst(const String blobName, const nw::Pointer binaryBlob, unsigned int blobSize) = 0; inline void describeConst(const String childName,const bool& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const char& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const unsigned char& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const signed char& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const short& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const unsigned short& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const int& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const unsigned int& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const long& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const unsigned long& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const float& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const Pointer ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const double& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const long long& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const long double& ref) {describeName(childName); describeValueConst(ref);} inline void describeConst(const String childName,const String& ref) {describeName(childName); describeValueConst(ref);} inline void describeValue(bool& value) final {describeValueConst(value);} inline void describeValue(char& value) final {describeValueConst(value);} inline void describeValue(unsigned char& value) final {describeValueConst(value);} inline void describeValue(signed char& value) final {describeValueConst(value);} //2 byte inline void describeValue(short& value) final {describeValueConst(value);} inline void describeValue(unsigned short& value) final {describeValueConst(value);} //4 byte inline void describeValue(int& value) final {describeValueConst(value);} inline void describeValue(unsigned int& value) final {describeValueConst(value);} inline void describeValue(long& value) final {describeValueConst(value);} inline void describeValue(unsigned long& value) final {describeValueConst(value);} inline void describeValue(float& value) final {describeValueConst(value);} inline void describeValue(Pointer value) final {describeValueConst(value);} //8 byte inline void describeValue(double& value) final {describeValueConst(value);} inline void describeValue(long long& value) final {describeValueConst(value);} //12 byte inline void describeValue(long double& value) final {describeValueConst(value);} //variable size inline void describeValue(String& value) final {describeValueConst(value);} inline void describeBlob(const String blobName, const nw::Pointer binaryBlob, unsigned int blobSize) final {describeBlobConst(blobName, binaryBlob, blobSize);} }; } // namespace nw