diff --git uppsrc/Core/Convert.h uppsrc/Core/Convert.h --- uppsrc/Core/Convert.h +++ uppsrc/Core/Convert.h @@ -52,8 +52,8 @@ String StdFormat(const Value& q); class ConvertInt : public Convert { public: - virtual Value Scan(const Value& text) const; - virtual int Filter(int chr) const; + Value Scan(const Value& text) const override; + int Filter(int chr) const override; protected: int64 minval, maxval; @@ -96,9 +96,9 @@ struct ConvertInt64 : public ConvertInt { class ConvertDouble : public Convert { public: - virtual Value Format(const Value& q) const; - virtual Value Scan(const Value& text) const; - virtual int Filter(int chr) const; + Value Format(const Value& q) const override; + Value Scan(const Value& text) const override; + int Filter(int chr) const override; protected: double minval, maxval; @@ -128,9 +128,9 @@ const ConvertDouble& StdConvertDoubleNotNull(); class ConvertDate : public Convert { public: - virtual Value Format(const Value& q) const; - virtual Value Scan(const Value& text) const; - virtual int Filter(int chr) const; + Value Format(const Value& q) const override; + Value Scan(const Value& text) const override; + int Filter(int chr) const override; protected: Date minval, maxval, defaultval; @@ -162,9 +162,9 @@ const ConvertDate& StdConvertDateNotNull(); class ConvertTime : public Convert { public: - virtual Value Scan(const Value& text) const; - virtual int Filter(int chr) const; - virtual Value Format(const Value& q) const; + Value Scan(const Value& text) const override; + int Filter(int chr) const override; + Value Format(const Value& q) const override; protected: Time minval, maxval, defaultval; @@ -196,7 +196,7 @@ public: static Time GetDefaultMax() { return ToTime(ConvertDate::GetDefaultMax()); } ConvertTime(Time minval = ToTime(Date::Low()), Time maxval = ToTime(Date::High()), bool notnull = false); - virtual ~ConvertTime(); + ~ConvertTime() override; }; const ConvertTime& StdConvertTime(); @@ -204,7 +204,7 @@ const ConvertTime& StdConvertTimeNotNull(); class ConvertString : public Convert { public: - virtual Value Scan(const Value& text) const; + Value Scan(const Value& text) const override; protected: int maxlen; @@ -233,21 +233,21 @@ class NoConvertClass : public Convert { public: NoConvertClass(); - virtual Value Format(const Value& q) const; + Value Format(const Value& q) const override; }; const NoConvertClass& NoConvert(); class ErrorConvertClass : public Convert { public: - Value Scan(const Value& v) const; + Value Scan(const Value& v) const override; }; const ErrorConvertClass& ErrorConvert(); class MapConvert : public Convert { public: - virtual Value Format(const Value& q) const; + Value Format(const Value& q) const override; protected: VectorMap map; @@ -264,12 +264,12 @@ public: const Value& GetValue(int i) const { return map[i]; } const Value& operator[](int i) const { return map[i]; } - virtual ~MapConvert() {} + ~MapConvert() override {} }; class JoinConvert : public Convert { public: - virtual Value Format(const Value& v) const; + Value Format(const Value& v) const override; protected: struct Item { @@ -291,7 +291,7 @@ public: class FormatConvert : public Convert { public: - virtual Value Format(const Value& v) const; + Value Format(const Value& v) const override; private: String format; diff --git uppsrc/Core/FilterStream.h uppsrc/Core/FilterStream.h --- uppsrc/Core/FilterStream.h +++ uppsrc/Core/FilterStream.h @@ -1,11 +1,11 @@ class InFilterStream : public Stream { public: - virtual bool IsOpen() const; + bool IsOpen() const override; protected: - virtual int _Term(); - virtual int _Get(); - virtual dword _Get(void *data, dword size); + int _Term() override; + int _Get() override; + dword _Get(void *data, dword size) override; Vector buffer; bool eof; @@ -18,8 +18,8 @@ protected: void Fetch(); private: - void SetSize(int64 size) { NEVER(); } // removed - int64 GetSize() const { NEVER(); return 0; } + void SetSize(int64 size) override { NEVER(); } // removed + int64 GetSize() const override { NEVER(); return 0; } public: Stream *in; @@ -48,12 +48,12 @@ public: class OutFilterStream : public Stream { public: - virtual void Close(); - virtual bool IsOpen() const; + void Close() override; + bool IsOpen() const override; protected: - virtual void _Put(int w); - virtual void _Put(const void *data, dword size); + void _Put(int w) override; + void _Put(const void *data, dword size) override; Buffer buffer; int64 count; @@ -84,5 +84,5 @@ public: OutFilterStream(); template OutFilterStream(Stream& in, F& filter) { Set(in, filter); } - ~OutFilterStream(); + ~OutFilterStream() override; }; diff --git uppsrc/Core/Function.h uppsrc/Core/Function.h --- uppsrc/Core/Function.h +++ uppsrc/Core/Function.h @@ -14,7 +14,7 @@ class Function : Moveable> { template struct Wrapper : WrapperBase { F fn; - virtual Res Execute(ArgTypes... args) { return fn(args...); } + Res Execute(ArgTypes... args) override { return fn(args...); } Wrapper(F&& fn) : fn(pick(fn)) {} }; @@ -24,7 +24,7 @@ class Function : Moveable> { Function l; F fn; - virtual Res Execute(ArgTypes... args) { l(args...); return fn(args...); } + Res Execute(ArgTypes... args) override { l(args...); return fn(args...); } Wrapper2(const Function& l, F&& fn) : l(l), fn(pick(fn)) {} Wrapper2(const Function& l, const F& fn) : l(l), fn(fn) {} diff --git uppsrc/Core/Hash.h uppsrc/Core/Hash.h --- uppsrc/Core/Hash.h +++ uppsrc/Core/Hash.h @@ -11,7 +11,7 @@ typedef struct { class Md5Stream : public OutStream { UPP_MD5_CTX context; - virtual void Out(const void *data, dword size); + void Out(const void *data, dword size) override; public: void Finish(byte *hash16); @@ -20,7 +20,7 @@ public: void Reset(); Md5Stream(); - ~Md5Stream(); + ~Md5Stream() override; }; void MD5(byte *hash16, const void *data, dword size); @@ -39,7 +39,7 @@ typedef struct { class Sha1Stream : public OutStream { UPP_SHA1_CTX ctx[1]; - virtual void Out(const void *data, dword size); + void Out(const void *data, dword size) override; void Cleanup() { memset(ctx, 0, sizeof(ctx)); } @@ -52,7 +52,7 @@ public: void New() { Reset(); } Sha1Stream(); - ~Sha1Stream(); + ~Sha1Stream() override; }; void SHA1(byte *hash20, const void *data, dword size); @@ -65,7 +65,7 @@ String SHA1StringS(const String& data); class Sha256Stream : public OutStream { byte buffer[128]; - virtual void Out(const void *data, dword size); + void Out(const void *data, dword size) override; void Cleanup(); @@ -78,7 +78,7 @@ public: void New() { Reset(); } Sha256Stream(); - ~Sha256Stream(); + ~Sha256Stream() override; }; void SHA256(byte *hash20, const void *data, dword size); @@ -91,7 +91,7 @@ String SHA256StringS(const String& data); class xxHashStream : public OutStream { byte context[8 * 8]; - virtual void Out(const void *data, dword size); + void Out(const void *data, dword size) override; public: int Finish(); @@ -107,7 +107,7 @@ int xxHash(const String& s); class xxHash64Stream : public OutStream { byte context[12 * 8]; - virtual void Out(const void *data, dword size); + void Out(const void *data, dword size) override; public: int64 Finish(); diff --git uppsrc/Core/InVector.h uppsrc/Core/InVector.h --- uppsrc/Core/InVector.h +++ uppsrc/Core/InVector.h @@ -622,18 +622,18 @@ struct Slaved_InVector__ : InVectorSlave__ { InVector data; T *res; - virtual void Clear() { data.Clear(); } - virtual void Count(int n) { data.count += n; } - virtual void Insert(int blki, int pos); - virtual void Split(int blki, int nextsize); - virtual void AddFirst(); - virtual void RemoveBlk(int blki, int n) { data.data.Remove(blki, n); } - virtual void Join(int blki) { data.Join(blki); } - virtual void Remove(int blki, int pos, int n) { data.data[blki].Remove(pos, n); } - virtual void Index(int blki, int n) { data.Index(blki, n); } - virtual void Reindex() { data.Reindex(); } + void Clear() override { data.Clear(); } + void Count(int n) override { data.count += n; } + void Insert(int blki, int pos) override; + void Split(int blki, int nextsize) override; + void AddFirst() override; + void RemoveBlk(int blki, int n) override { data.data.Remove(blki, n); } + void Join(int blki) override { data.Join(blki); } + void Remove(int blki, int pos, int n) override { data.data[blki].Remove(pos, n); } + void Index(int blki, int n) override { data.Index(blki, n); } + void Reindex() override { data.Reindex(); } // virtual void Serialize(Stream& s) { data.Serialize(s); } - virtual void Shrink() { data.Shrink(); } + void Shrink() override { data.Shrink(); } T& Get(int blki, int i) const { return *(T*)&data.data[blki][i]; } }; @@ -700,18 +700,18 @@ struct Slaved_InArray__ : InVectorSlave__ { InArray data; T *res; - virtual void Clear() { data.Clear(); } - virtual void Count(int n) { data.iv.count += n; } - virtual void Insert(int blki, int pos); - virtual void Split(int blki, int nextsize); - virtual void AddFirst(); - virtual void RemoveBlk(int blki, int n) { data.iv.data.Remove(blki, n); } - virtual void Join(int blki) { data.iv.Join(blki); } - virtual void Remove(int blki, int pos, int n); - virtual void Index(int blki, int n) { data.iv.Index(blki, n); } - virtual void Reindex() { data.iv.Reindex(); } + void Clear() override { data.Clear(); } + void Count(int n) override { data.iv.count += n; } + void Insert(int blki, int pos) override; + void Split(int blki, int nextsize) override; + void AddFirst() override; + void RemoveBlk(int blki, int n) override { data.iv.data.Remove(blki, n); } + void Join(int blki) override { data.iv.Join(blki); } + void Remove(int blki, int pos, int n) override; + void Index(int blki, int n) override { data.iv.Index(blki, n); } + void Reindex() override { data.iv.Reindex(); } // virtual void Serialize(Stream& s) { data.iv.Serialize(s); } - virtual void Shrink() { data.iv.Shrink(); } + void Shrink() override { data.iv.Shrink(); } T& Get(int blki, int i) const { return *(T*)data.iv.data[blki][i]; } T *Detach(int i) { T *x = data.iv[i]; data.iv[i] = NULL; return x; } diff --git uppsrc/Core/Lang.cpp uppsrc/Core/Lang.cpp --- uppsrc/Core/Lang.cpp +++ uppsrc/Core/Lang.cpp @@ -129,18 +129,18 @@ int GetSystemLNG() { #endif class LangConvertClass : public Convert { - virtual Value Format(const Value& q) const { + Value Format(const Value& q) const override { return LNGAsText((int)q); } - virtual Value Scan(const Value& text) const { + Value Scan(const Value& text) const override { if(IsNull(text)) return 0; int q = LNGFromText((String)text); if(!q) return ErrorValue(t_("Invalid language specification.")); return (int) q; } - virtual int Filter(int chr) const { + int Filter(int chr) const override { return chr == ' ' || chr == '-' || IsDigit(chr) ? chr : IsAlpha(chr) ? ToUpper(chr) : 0; } }; diff --git uppsrc/Core/LocalProcess.h uppsrc/Core/LocalProcess.h --- uppsrc/Core/LocalProcess.h +++ uppsrc/Core/LocalProcess.h @@ -19,16 +19,16 @@ public: class LocalProcess : public AProcess { public: - virtual void Kill(); - virtual bool IsRunning(); - virtual void Write(String s); - virtual bool Read(String& s); - virtual bool Read2(String& os, String &es); - virtual String GetExitMessage(); - virtual int GetExitCode(); - virtual void CloseRead(); - virtual void CloseWrite(); - virtual void Detach(); + void Kill() override; + bool IsRunning() override; + void Write(String s) override; + bool Read(String& s) override; + bool Read2(String& os, String &es) override; + String GetExitMessage() override; + int GetExitCode() override; + void CloseRead() override; + void CloseWrite() override; + void Detach() override; private: void Init(); @@ -85,7 +85,7 @@ public: LocalProcess() { Init(); } LocalProcess(const char *cmdline, const char *envptr = NULL) { Init(); Start(cmdline, envptr); } LocalProcess(const char *cmdline, const Vector& arg, const char *envptr = NULL) { Init(); Start(cmdline, arg, envptr); } - virtual ~LocalProcess() { Kill(); } + ~LocalProcess() override { Kill(); } }; int Sys(const char *cmdline, String& out, bool convertcharset = true); diff --git uppsrc/Core/Log.cpp uppsrc/Core/Log.cpp --- uppsrc/Core/Log.cpp +++ uppsrc/Core/Log.cpp @@ -281,12 +281,12 @@ void ThreadLog::Put(int w) class LogStream : public Stream { protected: - virtual void _Put(int w); - virtual void _Put(const void *data, dword size); - virtual int64 GetSize() const; + void _Put(int w) override; + void _Put(const void *data, dword size) override; + int64 GetSize() const override; public: - virtual bool IsOpen() const; + bool IsOpen() const override; }; int64 LogStream::GetSize() const diff --git uppsrc/Core/Speller.cpp uppsrc/Core/Speller.cpp --- uppsrc/Core/Speller.cpp +++ uppsrc/Core/Speller.cpp @@ -283,8 +283,8 @@ struct SpellKey : Moveable { struct SpellMaker : LRUCache::Maker { SpellKey k; - SpellKey Key() const { return k; } - int Make(bool& r) const { + SpellKey Key() const override { return k; } + int Make(bool& r) const override { r = SpellWordRaw(k.wrd, k.lang); return 1; } diff --git uppsrc/Core/Stream.cpp uppsrc/Core/Stream.cpp --- uppsrc/Core/Stream.cpp +++ uppsrc/Core/Stream.cpp @@ -1203,10 +1203,10 @@ void TeeStream::Out(const void *data, dword size) } struct NilStreamClass : public Stream { - virtual void _Put(int w) {} - virtual bool IsOpen() const { return true; } - virtual int _Term() { return -1; } - virtual int _Get() { return -1; } + void _Put(int w) override {} + bool IsOpen() const override { return true; } + int _Term() override { return -1; } + int _Get() override { return -1; } }; Stream& NilStream() @@ -1244,7 +1244,7 @@ class CoutStream : public Stream { putchar(w); #endif } - virtual void _Put(int w) { + void _Put(int w) override { if(w == '\n') { #ifdef PLATFORM_WIN32 Put0('\r'); @@ -1255,9 +1255,9 @@ class CoutStream : public Stream { if(w != '\r') Put0(w); } - virtual bool IsOpen() const { return true; } + bool IsOpen() const override { return true; } #ifdef PLATFORM_POSIX - virtual void Flush() { fflush(stdout); } + void Flush() override { fflush(stdout); } #endif }; @@ -1267,7 +1267,7 @@ Stream& Cout() } class CerrStream : public Stream { - virtual void _Put(int w) { + void _Put(int w) override { #ifdef PLATFORM_WIN32 static HANDLE h = GetStdHandle(STD_ERROR_HANDLE); char s[1]; @@ -1279,11 +1279,11 @@ class CerrStream : public Stream { #endif } #ifdef PLATFORM_POSIX - virtual void _Put(const void *data, dword size) { + void _Put(const void *data, dword size) override { fwrite(data, 1, size, stderr); } #endif - virtual bool IsOpen() const { return true; } + bool IsOpen() const override { return true; } }; Stream& Cerr() diff --git uppsrc/Core/Stream.h uppsrc/Core/Stream.h --- uppsrc/Core/Stream.h +++ uppsrc/Core/Stream.h @@ -270,17 +270,17 @@ private: // No copy class StringStream : public Stream { protected: - virtual void _Put(int w); - virtual int _Term(); - virtual int _Get(); - virtual void _Put(const void *data, dword size); - virtual dword _Get(void *data, dword size); + void _Put(int w) override; + int _Term() override; + int _Get() override; + void _Put(const void *data, dword size) override; + dword _Get(void *data, dword size) override; public: - virtual void Seek(int64 pos); - virtual int64 GetSize() const; - virtual void SetSize(int64 size); - virtual bool IsOpen() const; + void Seek(int64 pos) override; + int64 GetSize() const override; + void SetSize(int64 size) override; + bool IsOpen() const override; protected: bool writemode; @@ -312,13 +312,13 @@ public: class MemStream : public Stream { protected: - virtual void _Put(const void *data, dword size); - virtual dword _Get(void *data, dword size); + void _Put(const void *data, dword size) override; + dword _Get(void *data, dword size) override; public: - virtual void Seek(int64 pos); - virtual int64 GetSize() const; - virtual bool IsOpen() const; + void Seek(int64 pos) override; + int64 GetSize() const override; + bool IsOpen() const override; public: void Create(void *data, int64 size); @@ -337,17 +337,17 @@ public: class BlockStream : public Stream { protected: - virtual void _Put(int w); - virtual int _Term(); - virtual int _Get(); - virtual void _Put(const void *data, dword size); - virtual dword _Get(void *data, dword size); + void _Put(int w) override; + int _Term() override; + int _Get() override; + void _Put(const void *data, dword size) override; + dword _Get(void *data, dword size) override; public: - virtual void Seek(int64 pos); - virtual int64 GetSize() const; - virtual void SetSize(int64 size); - virtual void Flush(); + void Seek(int64 pos) override; + int64 GetSize() const override; + void SetSize(int64 size) override; + void Flush() override; private: int pagesize; @@ -385,7 +385,7 @@ public: int64 GetStreamSize() const { return streamsize; } BlockStream(); - virtual ~BlockStream(); + ~BlockStream() override; protected: void OpenInit(dword mode, int64 file_size); @@ -393,13 +393,13 @@ protected: class FileStream : public BlockStream { protected: - virtual void SetStreamSize(int64 size); - virtual dword Read(int64 at, void *ptr, dword size); - virtual void Write(int64 at, const void *data, dword size); + void SetStreamSize(int64 size) override; + dword Read(int64 at, void *ptr, dword size) override; + void Write(int64 at, const void *data, dword size) override; public: - virtual void Close(); - virtual bool IsOpen() const; + void Close() override; + bool IsOpen() const override; protected: #ifdef PLATFORM_WIN32 @@ -430,7 +430,7 @@ public: #endif FileStream(); - ~FileStream(); + ~FileStream() override; #ifdef PLATFORM_WIN32 HANDLE GetHandle() const { return handle; } @@ -471,12 +471,12 @@ public: class SizeStream : public Stream { protected: - virtual void _Put(int w); - virtual void _Put(const void *data, dword size); + void _Put(int w) override; + void _Put(const void *data, dword size) override; public: - virtual int64 GetSize() const; - virtual bool IsOpen() const; + int64 GetSize() const override; + bool IsOpen() const override; protected: byte h[256]; @@ -491,16 +491,16 @@ public: class CompareStream : public Stream { protected: - virtual void _Put(int w); - virtual void _Put(const void *data, dword size); + void _Put(int w) override; + void _Put(const void *data, dword size) override; public: - virtual void Seek(int64 pos); - virtual int64 GetSize() const; - virtual void SetSize(int64 size); - virtual void Close(); - virtual bool IsOpen() const; - virtual void Flush(); + void Seek(int64 pos) override; + int64 GetSize() const override; + void SetSize(int64 size) override; + void Close() override; + bool IsOpen() const override; + void Flush() override; private: Stream *stream; @@ -524,24 +524,24 @@ class OutStream : public Stream { byte *h; protected: - virtual void _Put(int w); - virtual void _Put(const void *data, dword size); - virtual bool IsOpen() const; + void _Put(int w) override; + void _Put(const void *data, dword size) override; + bool IsOpen() const override; virtual void Out(const void *data, dword size) = 0; public: - virtual void Close(); + void Close() override; - void Flush(); + void Flush() override; OutStream(); - ~OutStream(); + ~OutStream() override; }; class TeeStream : public OutStream { protected: - virtual void Out(const void *data, dword size); + void Out(const void *data, dword size) override; private: Stream& a; @@ -549,7 +549,7 @@ private: public: TeeStream(Stream& a, Stream& b) : a(a), b(b) {} - ~TeeStream() { Close(); } + ~TeeStream() override { Close(); } }; class FileMapping diff --git uppsrc/Core/Uuid.cpp uppsrc/Core/Uuid.cpp --- uppsrc/Core/Uuid.cpp +++ uppsrc/Core/Uuid.cpp @@ -96,7 +96,7 @@ String Dump(const Uuid& id) { struct UuidValueGenClass : ValueGen { - virtual Value Get() { + Value Get() override { return Format(Uuid::Create()); } }; diff --git uppsrc/Core/Value.cpp uppsrc/Core/Value.cpp --- uppsrc/Core/Value.cpp +++ uppsrc/Core/Value.cpp @@ -721,10 +721,10 @@ String Value::GetName() const class ValueErrorCls : public RichValueRep { public: - virtual dword GetType() const { return ERROR_V; } - virtual bool IsNull() const { return true; } - virtual void Serialize(Stream& s) {} - virtual String AsString() const { return ""; } + dword GetType() const override { return ERROR_V; } + bool IsNull() const override { return true; } + void Serialize(Stream& s) override {} + String AsString() const override { return ""; } ValueErrorCls(const String& s) : RichValueRep(s) {} }; diff --git uppsrc/Core/Value.hpp uppsrc/Core/Value.hpp --- uppsrc/Core/Value.hpp +++ uppsrc/Core/Value.hpp @@ -118,8 +118,8 @@ inline unsigned ValueGetHashValue(const WString& x) { template class RawValueRep : public Value::Void { public: - virtual dword GetType() const { return GetValueTypeNo(); } - virtual bool IsNull() const { return false; } + dword GetType() const override { return GetValueTypeNo(); } + bool IsNull() const override { return false; } T v; @@ -138,18 +138,18 @@ public: template class RichValueRep : public RawValueRep { public: - virtual bool IsNull() const { return UPP::IsNull(this->v); } - virtual void Serialize(Stream& s) { s % this->v; } - virtual void Xmlize(XmlIO& xio) { Upp::Xmlize(xio, this->v); } - virtual void Jsonize(JsonIO& jio) { Upp::Jsonize(jio, this->v); } - virtual unsigned GetHashValue() const { return UPP::ValueGetHashValue(this->v); } - virtual bool IsEqual(const Value::Void *p) { ASSERT(dynamic_cast *>(p)); + bool IsNull() const override { return UPP::IsNull(this->v); } + void Serialize(Stream& s) override { s % this->v; } + void Xmlize(XmlIO& xio) override { Upp::Xmlize(xio, this->v); } + void Jsonize(JsonIO& jio) override { Upp::Jsonize(jio, this->v); } + unsigned GetHashValue() const override { return UPP::ValueGetHashValue(this->v); } + bool IsEqual(const Value::Void *p) override { ASSERT(dynamic_cast *>(p)); return static_cast *>(p)->Get() == this->v; } - virtual bool IsPolyEqual(const Value& b) { return UPP::IsPolyEqual(this->v, b); } - virtual String AsString() const { return UPP::AsString(this->v); } - virtual int Compare(const Value::Void *p) { ASSERT(dynamic_cast *>(p)); + bool IsPolyEqual(const Value& b) override { return UPP::IsPolyEqual(this->v, b); } + String AsString() const override { return UPP::AsString(this->v); } + int Compare(const Value::Void *p) override { ASSERT(dynamic_cast *>(p)); return SgnCompare(this->v, static_cast *>(p)->Get()); } - virtual int PolyCompare(const Value& b) { return Upp::PolyCompare(this->v, b); } + int PolyCompare(const Value& b) override { return Upp::PolyCompare(this->v, b); } RichValueRep(const T& v) : RawValueRep(v) {} RichValueRep() {} diff --git uppsrc/Core/ValueUtil.cpp uppsrc/Core/ValueUtil.cpp --- uppsrc/Core/ValueUtil.cpp +++ uppsrc/Core/ValueUtil.cpp @@ -7,11 +7,11 @@ static String sAsString(const Vector& v); #define LTIMING(x) // RTIMING(x) struct Ref::ValueRef : public RefManager { - virtual int GetType() { return VALUE_V; } - virtual Value GetValue(const void *ptr) { return *(Value *) ptr; } - virtual bool IsNull(const void *ptr) { return UPP::IsNull(*(Value *) ptr); } - virtual void SetValue(void *ptr, const Value& v) { *(Value *) ptr = v; } - virtual void SetNull(void *ptr) { *(Value *) ptr = Null; } + int GetType() override { return VALUE_V; } + Value GetValue(const void *ptr) override { return *(Value *) ptr; } + bool IsNull(const void *ptr) override { return UPP::IsNull(*(Value *) ptr); } + void SetValue(void *ptr, const Value& v) override { *(Value *) ptr = v; } + void SetNull(void *ptr) override { *(Value *) ptr = Null; } }; Ref::Ref(String& s) { ptr = &s; m = &Single< StdRef >(); } diff --git uppsrc/Core/ValueUtil.h uppsrc/Core/ValueUtil.h --- uppsrc/Core/ValueUtil.h +++ uppsrc/Core/ValueUtil.h @@ -36,7 +36,7 @@ struct ValueOrder { struct StdValueOrder : ValueOrder { int language; - virtual bool operator()(const Value& a, const Value& b) const { return StdValueCompare(a, b, language) < 0; } + bool operator()(const Value& a, const Value& b) const override { return StdValueCompare(a, b, language) < 0; } StdValueOrder(int l = -1) : language(l) {} }; @@ -44,7 +44,7 @@ struct StdValueOrder : ValueOrder { struct FnValueOrder : ValueOrder { int (*fn)(const Value& a, const Value& b); - virtual bool operator()(const Value& a, const Value& b) const { return (*fn)(a, b) < 0; } + bool operator()(const Value& a, const Value& b) const override { return (*fn)(a, b) < 0; } FnValueOrder(int (*fn)(const Value& a, const Value& b)) : fn(fn) {} }; @@ -57,7 +57,7 @@ struct ValuePairOrder { struct StdValuePairOrder : ValuePairOrder { int language; - virtual bool operator()(const Value& keya, const Value& valuea, const Value& keyb, const Value& valueb) const; + bool operator()(const Value& keya, const Value& valuea, const Value& keyb, const Value& valueb) const override; StdValuePairOrder(int l = -1); }; @@ -65,7 +65,7 @@ struct StdValuePairOrder : ValuePairOrder { struct FnValuePairOrder : ValuePairOrder { int (*fn)(const Value& k1, const Value& v1, const Value& k2, const Value& v2); - virtual bool operator()(const Value& keya, const Value& valuea, const Value& keyb, const Value& valueb) const; + bool operator()(const Value& keya, const Value& valuea, const Value& keyb, const Value& valueb) const override; FnValuePairOrder(int (*fn)(const Value& k1, const Value& v1, const Value& k2, const Value& v2)) : fn(fn) {} }; @@ -103,12 +103,12 @@ struct RefManager { template struct StdRef : public RefManager { - virtual void SetValue(void *p, const Value& v) { *(T *) p = (T)v; } - virtual Value GetValue(const void *p) { return *(const T *) p; } - virtual int GetType() { return GetValueTypeNo(); } - virtual bool IsNull(const void *p) { return UPP::IsNull(*(T *) p); } - virtual void SetNull(void *p) { UPP::SetNull(*(T *)p); } - virtual ~StdRef() {} + void SetValue(void *p, const Value& v) override { *(T *) p = (T)v; } + Value GetValue(const void *p) override { return *(const T *) p; } + int GetType() override { return GetValueTypeNo(); } + bool IsNull(const void *p) override { return UPP::IsNull(*(T *) p); } + void SetNull(void *p) override { UPP::SetNull(*(T *)p); } + ~StdRef() override {} }; class Ref : Moveable { @@ -201,15 +201,15 @@ ValueType::operator ValueTypeRef() class ValueArray : public ValueType > { struct Data : Value::Void { - virtual dword GetType() const { return VALUEARRAY_V; } - virtual bool IsNull() const; - virtual void Serialize(Stream& s); - virtual void Xmlize(XmlIO& xio); - virtual void Jsonize(JsonIO& jio); - virtual unsigned GetHashValue() const; - virtual bool IsEqual(const Value::Void *p); - virtual String AsString() const; - virtual int Compare(const Value::Void *p); + dword GetType() const override { return VALUEARRAY_V; } + bool IsNull() const override; + void Serialize(Stream& s) override; + void Xmlize(XmlIO& xio) override; + void Jsonize(JsonIO& jio) override; + unsigned GetHashValue() const override; + bool IsEqual(const Value::Void *p) override; + String AsString() const override; + int Compare(const Value::Void *p) override; int GetRefCount() const { return refcount; } Vector& Clone(); @@ -304,15 +304,15 @@ String AsString(const ValueArray& v); class ValueMap : public ValueType >{ struct Data : Value::Void { - virtual dword GetType() const { return VALUEMAP_V; } - virtual bool IsNull() const; - virtual void Serialize(Stream& s); - virtual void Xmlize(XmlIO& xio); - virtual void Jsonize(JsonIO& jio); - virtual unsigned GetHashValue() const; - virtual bool IsEqual(const Value::Void *p); - virtual String AsString() const; - virtual int Compare(const Value::Void *p); + dword GetType() const override { return VALUEMAP_V; } + bool IsNull() const override; + void Serialize(Stream& s) override; + void Xmlize(XmlIO& xio) override; + void Jsonize(JsonIO& jio) override; + unsigned GetHashValue() const override; + bool IsEqual(const Value::Void *p) override; + String AsString() const override; + int Compare(const Value::Void *p) override; const Value& Get(const Value& k) const { int q = key.Find(k); diff --git uppsrc/Core/ValueUtil.hpp uppsrc/Core/ValueUtil.hpp --- uppsrc/Core/ValueUtil.hpp +++ uppsrc/Core/ValueUtil.hpp @@ -45,10 +45,10 @@ int StdValueCompareDesc(const Value& a, const Value& b) #ifdef DEPRECATED template struct RawRef : public RefManager { - virtual void SetValue(void *p, const Value& v) { *(T *) p = RawValue::Extract(v); } - virtual Value GetValue(const void *p) { return RawValue(*(const T *) p); } - virtual int GetType() { return GetValueTypeNo(); } - virtual ~RawRef() {} + void SetValue(void *p, const Value& v) override { *(T *) p = RawValue::Extract(v); } + Value GetValue(const void *p) override { return RawValue(*(const T *) p); } + int GetType() override { return GetValueTypeNo(); } + ~RawRef() override {} }; template diff --git uppsrc/Core/XML.h uppsrc/Core/XML.h --- uppsrc/Core/XML.h +++ uppsrc/Core/XML.h @@ -270,8 +270,8 @@ XmlNode ParseXMLFile(const char *path, ParseXmlFilter& filter, dword style = XML class IgnoreXmlPaths : public ParseXmlFilter { public: - virtual bool DoTag(const String& id); - virtual void EndTag(); + bool DoTag(const String& id) override; + void EndTag() override; private: Index list; diff --git uppsrc/Core/z.h uppsrc/Core/z.h --- uppsrc/Core/z.h +++ uppsrc/Core/z.h @@ -1,7 +1,7 @@ class Crc32Stream : public OutStream { dword crc; - virtual void Out(const void *data, dword size); + void Out(const void *data, dword size) override; public: dword Finish() { Flush(); return crc; } @@ -94,7 +94,7 @@ public: ZCompressStream() {} ZCompressStream(Stream& out) { Open(out); } - ~ZCompressStream() { Close(); } + ~ZCompressStream() override { Close(); } }; class ZDecompressStream : public InFilterStream { @@ -117,7 +117,7 @@ public: ZDecompressStream() {} ZDecompressStream(Stream& out) { Open(out); } - ~ZDecompressStream() { Close(); } + ~ZDecompressStream() override { Close(); } }; int64 CopyStream(Stream& dest, Stream& src, int64 count, Gate progress, int chunk_size = 65536);