Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove operator= base types #193

Merged
merged 1 commit into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions ebml/EbmlFloat.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ class EBML_DLL_API EbmlFloat : public EbmlElement {
}


// EbmlFloat & operator=(const float NewValue) { Value = NewValue; return *this;}
EbmlFloat & operator=(const double NewValue) { Value = NewValue; SetValueIsSet(); return *this;}

bool IsSmallerThan(const EbmlElement *Cmp) const override;

using EbmlElement::operator const EbmlId &;
Expand Down
2 changes: 0 additions & 2 deletions ebml/EbmlSInteger.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class EBML_DLL_API EbmlSInteger : public EbmlElement {
EbmlSInteger(const EbmlCallbacks &);
explicit EbmlSInteger(const EbmlCallbacks &, std::int64_t DefaultValue);

EbmlSInteger & operator = (std::int64_t NewValue) {Value = NewValue; SetValueIsSet(); return *this;}

/*!
Set the default size of the integer (usually 1,2,4 or 8)
*/
Expand Down
1 change: 0 additions & 1 deletion ebml/EbmlString.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class EBML_DLL_API EbmlString : public EbmlElement {
filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;
filepos_t UpdateSize(ShouldWrite writeFilter = WriteSkipDefault, bool bForceRender = false) override;

EbmlString & operator=(const std::string &);
using EbmlElement::operator const EbmlId &;
explicit operator const std::string &() const;

Expand Down
2 changes: 0 additions & 2 deletions ebml/EbmlUInteger.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ class EBML_DLL_API EbmlUInteger : public EbmlElement {
EbmlUInteger(const EbmlCallbacks &);
explicit EbmlUInteger(const EbmlCallbacks &, std::uint64_t DefaultValue);

EbmlUInteger & operator=(std::uint64_t NewValue) {Value = NewValue; SetValueIsSet(); return *this;}

/*!
Set the default size of the integer (usually 1,2,4 or 8)
*/
Expand Down
1 change: 0 additions & 1 deletion ebml/EbmlUnicodeString.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class EBML_DLL_API EbmlUnicodeString : public EbmlElement {
filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA) override;
filepos_t UpdateSize(ShouldWrite writeFilter = WriteSkipDefault, bool bForceRender = false) override;

EbmlUnicodeString & operator=(const UTFstring &); ///< platform dependant code
using EbmlElement::operator const EbmlId &;
explicit operator const UTFstring &() const;

Expand Down
4 changes: 3 additions & 1 deletion src/EbmlFloat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ EbmlFloat::operator double() const {return (Value);}
double EbmlFloat::GetValue() const {return Value;}

EbmlFloat & EbmlFloat::SetValue(double NewValue) {
return *this = NewValue;
Value = NewValue;
SetValueIsSet();
return *this;
}

/*!
Expand Down
4 changes: 3 additions & 1 deletion src/EbmlSInteger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ EbmlSInteger::operator std::int64_t() const {return Value;}
std::int64_t EbmlSInteger::GetValue() const {return Value;}

EbmlSInteger & EbmlSInteger::SetValue(std::int64_t NewValue) {
return *this = NewValue;
Value = NewValue;
SetValueIsSet();
return *this;
}

/*!
Expand Down
13 changes: 2 additions & 11 deletions src/EbmlString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,12 @@ filepos_t EbmlString::RenderData(IOCallback & output, bool /* bForceRender */, S

EbmlString::operator const std::string &() const {return Value;}

EbmlString & EbmlString::operator=(const std::string & NewString)
{
Value = NewString;
EbmlString &EbmlString::SetValue(std::string const &NewValue) {
Value = NewValue;
SetValueIsSet();
/* done automatically
SetSize_(Value.length());
if (GetDefaultSize() > GetSize())
SetSize_(GetDefaultSize());*/
return *this;
}

EbmlString &EbmlString::SetValue(std::string const &NewValue) {
return *this = NewValue;
}

std::string EbmlString::GetValue() const {
return Value;
}
Expand Down
4 changes: 3 additions & 1 deletion src/EbmlUInteger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ EbmlUInteger::operator std::uint64_t() const {return Value;}
std::uint64_t EbmlUInteger::GetValue() const {return Value;}

EbmlUInteger & EbmlUInteger::SetValue(std::uint64_t NewValue) {
return *this = NewValue;
Value = NewValue;
SetValueIsSet();
return *this;
}

/*!
Expand Down
15 changes: 5 additions & 10 deletions src/EbmlUnicodeString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,16 @@ filepos_t EbmlUnicodeString::RenderData(IOCallback & output, bool /* bForceRende

EbmlUnicodeString::operator const UTFstring &() const {return Value;}

EbmlUnicodeString & EbmlUnicodeString::operator=(const UTFstring & NewString)
{
Value = NewString;
EbmlUnicodeString &EbmlUnicodeString::SetValue(UTFstring const &NewValue) {
Value = NewValue;
SetValueIsSet();
return *this;
}

EbmlUnicodeString &EbmlUnicodeString::SetValue(UTFstring const &NewValue) {
return *this = NewValue;
}

EbmlUnicodeString &EbmlUnicodeString::SetValueUTF8(std::string const &NewValue) {
UTFstring NewValueUTFstring;
NewValueUTFstring.SetUTF8(NewValue);
return *this = NewValueUTFstring;
Value.SetUTF8(NewValue);
robUx4 marked this conversation as resolved.
Show resolved Hide resolved
SetValueIsSet();
return *this;
}

UTFstring EbmlUnicodeString::GetValue() const {
Expand Down