Provide GetValue() and SetValue() functions for EbmlFloat/SInteger/UInteger

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@840 a6f86f6d-0131-4f8e-9e7b-e335508773d5
This commit is contained in:
Moritz Bunkus 2012-09-04 07:36:48 +00:00
parent c2ab2859ac
commit b95a4104aa
6 changed files with 25 additions and 0 deletions

View File

@ -82,6 +82,9 @@ class EBML_DLL_API EbmlFloat : public EbmlElement {
operator float() const;
operator double() const;
EbmlFloat &SetValue(double NewValue);
double GetValue() const;
void SetDefaultValue(double);
double DefaultVal() const;

View File

@ -76,6 +76,9 @@ class EBML_DLL_API EbmlSInteger : public EbmlElement {
operator int32() const;
operator int64() const;
EbmlSInteger &SetValue(int64 NewValue);
int64 GetValue() const;
void SetDefaultValue(int64 aValue) {assert(!DefaultISset()); DefaultValue = aValue; SetDefaultIsSet();}
int64 DefaultVal() const {assert(DefaultISset()); return DefaultValue;}

View File

@ -74,6 +74,9 @@ class EBML_DLL_API EbmlUInteger : public EbmlElement {
operator uint32() const;
operator uint64() const;
EbmlUInteger &SetValue(uint64 NewValue);
uint64 GetValue() const;
void SetDefaultValue(uint64);
uint64 DefaultVal() const;

View File

@ -76,6 +76,11 @@ double EbmlFloat::DefaultVal() const
EbmlFloat::operator float() const {return float(Value);}
EbmlFloat::operator double() const {return double(Value);}
double EbmlFloat::GetValue() const {return Value;}
EbmlFloat & EbmlFloat::SetValue(double NewValue) {
return *this = NewValue;
}
/*!
\todo handle exception on errors

View File

@ -60,6 +60,12 @@ EbmlSInteger::operator int16() const {return int16(Value);}
EbmlSInteger::operator int32() const {return int32(Value);}
EbmlSInteger::operator int64() const {return Value;}
int64 EbmlSInteger::GetValue() const {return Value;}
EbmlSInteger & EbmlSInteger::SetValue(int64 NewValue) {
return *this = NewValue;
}
/*!
\todo handle exception on errors
*/

View File

@ -75,6 +75,11 @@ EbmlUInteger::operator uint16() const {return uint16(Value);}
EbmlUInteger::operator uint32() const {return uint32(Value);}
EbmlUInteger::operator uint64() const {return Value;}
uint64 EbmlUInteger::GetValue() const {return Value;}
EbmlUInteger & EbmlUInteger::SetValue(uint64 NewValue) {
return *this = NewValue;
}
/*!
\todo handle exception on errors