Skip to content

Commit b28e89b

Browse files
committed
remove the EbmlElement::SizeIsValid pure virtual method
We get that information from the EbmlCallbacks.
1 parent 92f9655 commit b28e89b

File tree

10 files changed

+1
-20
lines changed

10 files changed

+1
-20
lines changed

ebml/EbmlBinary.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class EBML_DLL_API EbmlBinary : public EbmlElement {
3030
EbmlBinary& operator=(const EbmlBinary & ElementToClone);
3131
~EbmlBinary() override;
3232

33-
bool SizeIsValid(std::uint64_t size) const override {return size < 0x7FFFFFFF;} // we don't mind about what's inside
3433
static inline bool SizeIsValid(std::uint64_t size) {return size < 0x7FFFFFFF;} // we don't mind about what's inside
3534

3635
filepos_t RenderData(IOCallback & output, bool bForceRender, const ShouldWrite & writeFilter = WriteSkipDefault) override;

ebml/EbmlCrc32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
namespace libebml {
1515

16-
DECLARE_EBML_BINARY_LENGTH(EbmlCrc32, 4)
16+
DECLARE_EBML_BINARY(EbmlCrc32)
1717
public:
1818
filepos_t RenderData(IOCallback & output, bool bForceRender, const ShouldWrite & writeFilter = WriteSkipDefault) override;
1919
filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;

ebml/EbmlDate.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ class EBML_DLL_API EbmlDate : public EbmlElementDefaultSameStorage<std::int64_t>
4141
std::int64_t GetEpochDate() const {return EbmlToEpoch(EbmlElementDefaultSameStorage<std::int64_t>::GetValue());}
4242
std::int64_t GetValue() const {return GetEpochDate();}
4343

44-
bool SizeIsValid(std::uint64_t size) const override {return size == 8 || size == 0;}
45-
4644
static inline bool SizeIsValid(std::uint64_t size) {return size == 8 || size == 0;}
4745

4846
/*!

ebml/EbmlElement.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,6 @@ class DllApi x : public BaseClass { \
199199
#define DECLARE_xxx_BINARY(x,DllApi) \
200200
DECLARE_xxx_BASE(x, DllApi, libebml::EbmlBinary)
201201

202-
#define DECLARE_xxx_BINARY_LENGTH(x,len,DllApi) \
203-
DECLARE_xxx_BASE(x, DllApi, libebml::EbmlBinary) \
204-
bool SizeIsValid(std::uint64_t size) const override {return size == len;}
205-
206202
#define DECLARE_xxx_UINTEGER(x,DllApi) \
207203
DECLARE_xxx_BASE_NODEFAULT(x, DllApi, libebml::EbmlUInteger, std::uint64_t)
208204

@@ -243,7 +239,6 @@ class DllApi x : public BaseClass { \
243239
#define DECLARE_EBML_UINTEGER_DEF(x) DECLARE_xxx_UINTEGER_DEF(x,EBML_DLL_API)
244240
#define DECLARE_EBML_STRING_DEF(x) DECLARE_xxx_STRING_DEF( x,EBML_DLL_API)
245241
#define DECLARE_EBML_BINARY(x) DECLARE_xxx_BINARY( x,EBML_DLL_API)
246-
#define DECLARE_EBML_BINARY_LENGTH(x,len) DECLARE_xxx_BINARY_LENGTH(x,len,EBML_DLL_API)
247242

248243
#define EBML_CONCRETE_CLASS(Type) \
249244
public: \
@@ -613,7 +608,6 @@ class EBML_DLL_API EbmlElement {
613608
return false;
614609
}
615610

616-
virtual bool SizeIsValid(std::uint64_t) const = 0;
617611
bool ValidateSize() const { return ElementSpec().IsSizeValid(GetSize(), !IsFiniteSize()); }
618612

619613
std::uint64_t GetElementPosition() const {

ebml/EbmlFloat.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ class EBML_DLL_API EbmlFloat : public EbmlElementDefaultSameStorage<double> {
2525

2626
EbmlFloat(const EbmlCallbacksDefault<double> &, Precision prec = FLOAT_32);
2727

28-
bool SizeIsValid(std::uint64_t size) const override
29-
{
30-
return (size == 4 || size == 8);
31-
}
32-
3328
static inline bool SizeIsValid(std::uint64_t size)
3429
{
3530
return (size == 4 || size == 8);

ebml/EbmlMaster.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class EBML_DLL_API EbmlMaster : public EbmlElement {
3333
explicit EbmlMaster(const EbmlCallbacksMaster &, bool bSizeIsKnown = true);
3434
EbmlMaster(const EbmlMaster & ElementToClone);
3535
EbmlMaster& operator=(const EbmlMaster&) = delete;
36-
bool SizeIsValid(std::uint64_t /*size*/) const override {return true;}
3736
static inline bool SizeIsValid(std::uint64_t /*size*/) {return true;}
3837
/*!
3938
\warning be carefull to clear the memory allocated in the ElementList elsewhere

ebml/EbmlSInteger.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class EBML_DLL_API EbmlSInteger : public EbmlElementDefaultSameStorage<std::int6
3131
*/
3232
void SetDefaultSize(std::uint64_t nDefaultSize = DEFAULT_INT_SIZE) override {EbmlElement::SetDefaultSize(nDefaultSize); SetSize_(nDefaultSize);}
3333

34-
bool SizeIsValid(std::uint64_t size) const override {return size <= 8;}
3534
static inline bool SizeIsValid(std::uint64_t size) {return size <= 8;}
3635
filepos_t RenderData(IOCallback & output, bool bForceRender, const ShouldWrite & writeFilter = WriteSkipDefault) override;
3736
filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;

ebml/EbmlString.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class EBML_DLL_API EbmlString : public EbmlElementDefaultStorage<const char *, s
2222
public:
2323
EbmlString(const EbmlCallbacksDefault<const char *> &);
2424

25-
bool SizeIsValid(std::uint64_t size) const override {return size < 0x7FFFFFFF;} // any size is possible
2625
static inline bool SizeIsValid(std::uint64_t size) {return size < 0x7FFFFFFF;} // any size is possible
2726
filepos_t RenderData(IOCallback & output, bool bForceRender, const ShouldWrite & writeFilter = WriteSkipDefault) override;
2827
filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;

ebml/EbmlUInteger.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class EBML_DLL_API EbmlUInteger : public EbmlElementDefaultSameStorage<std::uint
2929
*/
3030
void SetDefaultSize(std::uint64_t nDefaultSize = DEFAULT_UINT_SIZE) override {EbmlElement::SetDefaultSize(nDefaultSize); SetSize_(nDefaultSize);}
3131

32-
bool SizeIsValid(std::uint64_t size) const override {return size <= 8;}
3332
static inline bool SizeIsValid(std::uint64_t size) {return size <= 8;}
3433
filepos_t RenderData(IOCallback & output, bool bForceRender, const ShouldWrite & writeFilter = WriteSkipDefault) override;
3534
filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;

ebml/EbmlUnicodeString.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class EBML_DLL_API EbmlUnicodeString : public EbmlElementDefaultStorage<const wc
6868
public:
6969
EbmlUnicodeString(const EbmlCallbacksDefault<const wchar_t *> &);
7070

71-
bool SizeIsValid(std::uint64_t /*size*/) const override {return true;} // any size is possible
7271
static inline bool SizeIsValid(std::uint64_t /*size*/) {return true;} // any size is possible
7372
filepos_t RenderData(IOCallback & output, bool bForceRender, const ShouldWrite & writeFilter = WriteSkipDefault) override;
7473
filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;

0 commit comments

Comments
 (0)