2 * Copyright 2013, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
6 #include "BulletData.h"
11 BulletData::BulletData()
19 BulletData::BulletData(const BString
& string
, float spacing
)
27 BulletData::BulletData(const BulletData
& other
)
29 fString(other
.fString
),
30 fSpacing(other
.fSpacing
)
36 BulletData::operator==(const BulletData
& other
) const
41 return fString
== other
.fString
42 && fSpacing
== other
.fSpacing
;
47 BulletData::operator!=(const BulletData
& other
) const
49 return !(*this == other
);
54 BulletData::SetString(const BString
& string
)
56 if (fString
== string
)
57 return BulletDataRef(this);
59 BulletData
* ret
= new(std::nothrow
) BulletData(*this);
61 return BulletDataRef(this);
63 ret
->fString
= string
;
64 return BulletDataRef(ret
, true);
69 BulletData::SetSpacing(float spacing
)
71 if (fSpacing
== spacing
)
72 return BulletDataRef(this);
74 BulletData
* ret
= new(std::nothrow
) BulletData(*this);
76 return BulletDataRef(this);
78 ret
->fSpacing
= spacing
;
79 return BulletDataRef(ret
, true);
83 // #pragma mark - private
87 BulletData::operator=(const BulletData
& other
)