1 #include <FormatParameters.h>
4 static const format_alignment kDefaultAlignment
= B_ALIGN_FORMAT_RIGHT
;
5 static const size_t kDefaultFormatWidth
= 1;
14 BFormatParameters::BFormatParameters(const BFormatParameters
*parent
)
21 BFormatParameters::BFormatParameters(const BFormatParameters
&other
)
22 : fParent(other
.fParent
),
23 fAlignment(other
.fAlignment
),
30 BFormatParameters::~BFormatParameters()
36 BFormatParameters::SetAlignment(format_alignment alignment
)
38 fAlignment
= alignment
;
39 fFlags
|= ALIGNMENT_SET
;
44 BFormatParameters::Alignment() const
46 if (fFlags
& ALIGNMENT_SET
)
49 return fParent
->Alignment();
50 return kDefaultAlignment
;
55 BFormatParameters::SetFormatWidth(size_t width
)
63 BFormatParameters::FormatWidth() const
65 if (fFlags
& WIDTH_SET
)
68 return fParent
->FormatWidth();
69 return kDefaultFormatWidth
;
72 // SetParentParameters
74 BFormatParameters::SetParentParameters(const BFormatParameters
*parent
)
80 const BFormatParameters
*
81 BFormatParameters::ParentParameters() const
88 BFormatParameters::operator=(const BFormatParameters
&other
)
90 fParent
= other
.fParent
;
91 fAlignment
= other
.fAlignment
;
92 fWidth
= other
.fWidth
;
93 fFlags
= other
.fFlags
;