2 * Copyright 2013, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
9 static BulletData sEmptyBullet
;
14 fBulletData(&sEmptyBullet
)
19 Bullet::Bullet(const BString
& string
, float spacing
)
21 fBulletData(new BulletData(string
, spacing
), true)
26 Bullet::Bullet(const Bullet
& other
)
28 fBulletData(other
.fBulletData
)
34 Bullet::operator=(const Bullet
& other
)
39 fBulletData
= other
.fBulletData
;
45 Bullet::operator==(const Bullet
& other
) const
50 if (fBulletData
== other
.fBulletData
)
53 if (fBulletData
.Get() != NULL
&& other
.fBulletData
.Get() != NULL
)
54 return *fBulletData
.Get() == *other
.fBulletData
.Get();
61 Bullet::operator!=(const Bullet
& other
) const
63 return !(*this == other
);
68 Bullet::SetString(const BString
& string
)
70 BulletDataRef data
= fBulletData
->SetString(string
);
71 if (data
== fBulletData
)
72 return data
->String() == string
;
80 Bullet::String() const
82 return fBulletData
->String();
87 Bullet::SetSpacing(float spacing
)
89 BulletDataRef data
= fBulletData
->SetSpacing(spacing
);
90 if (data
== fBulletData
)
91 return data
->Spacing() == spacing
;
99 Bullet::Spacing() const
101 return fBulletData
->Spacing();