btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / debugger / value / value_formatters / IntegerValueFormatter.h
blob9467c8ae9e53c1b2207e15cc2d9083ce5a533411
1 /*
2 * Copyright 2015, Rene Gollent, rene@gollent.com.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef INTEGER_VALUE_FORMATTER_H
6 #define INTEGER_VALUE_FORMATTER_H
9 #include "util/IntegerFormatter.h"
10 #include "ValueFormatter.h"
13 class Settings;
14 class Value;
17 class IntegerValueFormatter : public ValueFormatter {
18 public:
19 class Config;
21 public:
22 IntegerValueFormatter(Config* config);
23 virtual ~IntegerValueFormatter();
25 Config* GetConfig() const
26 { return fConfig; }
28 virtual Settings* GetSettings() const;
30 virtual status_t FormatValue(Value* value, BString& _output);
32 virtual bool SupportsValidation() const;
34 virtual bool ValidateFormattedValue(
35 const BString& input,
36 type_code type) const;
38 virtual status_t GetValueFromFormattedInput(
39 const BString& input, type_code type,
40 Value*& _output) const;
41 private:
43 status_t _PerformValidation(const BString& input,
44 type_code type,
45 ::Value*& _output,
46 bool wantsValue) const;
47 status_t _ValidateSigned(const BString& input,
48 type_code type,
49 ::Value*& _output,
50 bool wantsValue = false) const;
51 status_t _ValidateUnsigned(const BString& input,
52 type_code type,
53 ::Value*& _output,
54 integer_format format,
55 bool wantsValue = false) const;
57 Config* fConfig;
61 class IntegerValueFormatter::Config : public BReferenceable {
62 public:
63 virtual ~Config();
65 virtual Settings* GetSettings() const = 0;
66 virtual integer_format IntegerFormat() const = 0;
70 #endif // INTEGER_VALUE_FORMATTER_H