267c6a9b0d
fix HaikuDepot build after hrev55006 Change-Id: I3c275e1b0f23f936db448ad82639458535617d6a Reviewed-on: https://review.haiku-os.org/c/haiku/+/3809 Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
/*
|
|
* Copyright 2003-2017, Haiku, Inc.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _B_NUMBER_FORMAT_H_
|
|
#define _B_NUMBER_FORMAT_H_
|
|
|
|
|
|
#include <Format.h>
|
|
|
|
|
|
enum BNumberElement {
|
|
B_DECIMAL_SEPARATOR = 10, // Values 0-9 are reserved for digit symbols
|
|
B_GROUPING_SEPARATOR,
|
|
};
|
|
|
|
class BNumberFormatImpl;
|
|
|
|
|
|
class BNumberFormat : public BFormat {
|
|
public:
|
|
BNumberFormat();
|
|
BNumberFormat(const BLocale* locale);
|
|
~BNumberFormat();
|
|
|
|
ssize_t Format(char* string, size_t maxSize,
|
|
const double value);
|
|
status_t Format(BString& string, const double value);
|
|
ssize_t Format(char* string, size_t maxSize,
|
|
const int32 value);
|
|
status_t Format(BString& string, const int32 value);
|
|
|
|
ssize_t FormatMonetary(char* string, size_t maxSize,
|
|
const double value);
|
|
status_t FormatMonetary(BString& string,
|
|
const double value);
|
|
|
|
ssize_t FormatPercent(char* string, size_t maxSize,
|
|
const double value);
|
|
status_t FormatPercent(BString& string,
|
|
const double value);
|
|
|
|
status_t Parse(const BString& string, double& value);
|
|
|
|
BString GetSeparator(BNumberElement element);
|
|
|
|
private:
|
|
BNumberFormat(const BNumberFormat &other);
|
|
|
|
private:
|
|
BNumberFormatImpl* fPrivateData;
|
|
};
|
|
|
|
|
|
#endif // _B_NUMBER_FORMAT_H_
|