Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
jordo committed Aug 4, 2023
1 parent 20eeeb5 commit 6f388c3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions spine-cpp/spine-cpp/include/spine/SpineString.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
namespace spine {
class SP_API String : public SpineObject {
public:
String() : _length(0), _buffer(NULL), _tofree(true) {
String() : _length(0), _buffer(NULL), _tempowner(true) {
}

String(const char *chars, bool own = false, bool tofree = true) {
_tofree = tofree;
_tempowner = tofree;
if (!chars) {
_length = 0;
_buffer = NULL;
Expand All @@ -59,7 +59,7 @@ namespace spine {
}

String(const String &other) {
_tofree = true;
_tempowner = true;
if (!other._buffer) {
_length = 0;
_buffer = NULL;
Expand All @@ -84,7 +84,7 @@ namespace spine {

void own(const String &other) {
if (this == &other) return;
if (_buffer && _tofree) {
if (_buffer && _tempowner) {
SpineExtension::free(_buffer, __FILE__, __LINE__);
}
_length = other._length;
Expand All @@ -95,7 +95,7 @@ namespace spine {

void own(const char *chars) {
if (_buffer == chars) return;
if (_buffer && _tofree) {
if (_buffer && _tempowner) {
SpineExtension::free(_buffer, __FILE__, __LINE__);
}

Expand All @@ -115,7 +115,7 @@ namespace spine {

String &operator=(const String &other) {
if (this == &other) return *this;
if (_buffer && _tofree) {
if (_buffer && _tempowner) {
SpineExtension::free(_buffer, __FILE__, __LINE__);
}
if (!other._buffer) {
Expand All @@ -131,7 +131,7 @@ namespace spine {

String &operator=(const char *chars) {
if (_buffer == chars) return *this;
if (_buffer && _tofree) {
if (_buffer && _tempowner) {
SpineExtension::free(_buffer, __FILE__, __LINE__);
}
if (!chars) {
Expand Down Expand Up @@ -202,15 +202,15 @@ namespace spine {
}

~String() {
if (_buffer && _tofree) {
if (_buffer && _tempowner) {
SpineExtension::free(_buffer, __FILE__, __LINE__);
}
}

private:
mutable size_t _length;
mutable char *_buffer;
mutable bool _tofree;
mutable bool _tempowner;
};
}

Expand Down

0 comments on commit 6f388c3

Please sign in to comment.