7 #include <LocaleRoster.h>
10 BFormat::BFormat(const BLocale
* locale
)
13 locale
= BLocaleRoster::Default()->GetDefaultLocale();
16 fInitStatus
= B_BAD_DATA
;
24 BFormat::BFormat(const BLanguage
& language
,
25 const BFormattingConventions
& conventions
)
27 _Initialize(language
, conventions
);
31 BFormat::BFormat(const BFormat
&other
)
33 fConventions(other
.fConventions
),
34 fLanguage(other
.fLanguage
),
35 fInitStatus(other
.fInitStatus
)
46 BFormat::InitCheck() const
53 BFormat::_Initialize(const BLocale
& locale
)
55 BFormattingConventions conventions
;
58 fInitStatus
= locale
.GetFormattingConventions(&conventions
);
59 if (fInitStatus
!= B_OK
)
62 fInitStatus
= locale
.GetLanguage(&language
);
63 if (fInitStatus
!= B_OK
)
66 return _Initialize(language
, conventions
);
71 BFormat::_Initialize(const BLanguage
& language
,
72 const BFormattingConventions
& conventions
)
74 fConventions
= conventions
;