2 * Copyright 2015, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
5 #ifndef INTEGER_VALUE_FORMATTER_H
6 #define INTEGER_VALUE_FORMATTER_H
9 #include "util/IntegerFormatter.h"
10 #include "ValueFormatter.h"
17 class IntegerValueFormatter
: public ValueFormatter
{
22 IntegerValueFormatter(Config
* config
);
23 virtual ~IntegerValueFormatter();
25 Config
* GetConfig() const
28 virtual Settings
* GetSettings() const;
30 virtual status_t
FormatValue(Value
* value
, BString
& _output
);
32 virtual bool SupportsValidation() const;
34 virtual bool ValidateFormattedValue(
36 type_code type
) const;
38 virtual status_t
GetValueFromFormattedInput(
39 const BString
& input
, type_code type
,
40 Value
*& _output
) const;
43 status_t
_PerformValidation(const BString
& input
,
46 bool wantsValue
) const;
47 status_t
_ValidateSigned(const BString
& input
,
50 bool wantsValue
= false) const;
51 status_t
_ValidateUnsigned(const BString
& input
,
54 integer_format format
,
55 bool wantsValue
= false) const;
61 class IntegerValueFormatter::Config
: public BReferenceable
{
65 virtual Settings
* GetSettings() const = 0;
66 virtual integer_format
IntegerFormat() const = 0;
70 #endif // INTEGER_VALUE_FORMATTER_H