7457ccb4b2
The ICU class is named MessageFormat, but on Haiku, it sounds too much like something related to BMessage (which it isn't in the slightest) and not part of the Locale system. It works almost entirely with BStrings, so naming it BStringFormat makes much more sense. OK'ed by PulkoMandy and Humdinger.
45 lines
892 B
C++
45 lines
892 B
C++
/*
|
|
* Copyright 2014-2015 Haiku, Inc. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Adrien Destugues, pulkomandy@pulkomandy.tk
|
|
* John Scipione, jscipione@gmail.com
|
|
*/
|
|
#ifndef _B_STRING_FORMAT_H_
|
|
#define _B_STRING_FORMAT_H_
|
|
|
|
|
|
#include <Format.h>
|
|
|
|
|
|
#ifndef U_ICU_NAMESPACE
|
|
#define U_ICU_NAMESPACE icu
|
|
#endif
|
|
namespace U_ICU_NAMESPACE {
|
|
class MessageFormat;
|
|
class UnicodeString;
|
|
}
|
|
|
|
|
|
class BStringFormat : public BFormat {
|
|
public:
|
|
BStringFormat(const BLanguage& language,
|
|
const BString pattern);
|
|
BStringFormat(const BString pattern);
|
|
~BStringFormat();
|
|
|
|
status_t InitCheck();
|
|
|
|
status_t Format(BString& buffer, const int64 arg) const;
|
|
|
|
private:
|
|
status_t _Initialize(const U_ICU_NAMESPACE::UnicodeString&);
|
|
|
|
private:
|
|
U_ICU_NAMESPACE::MessageFormat* fFormatter;
|
|
};
|
|
|
|
|
|
#endif // _B_STRING_FORMAT_H_
|