2015-06-07 00:24:09 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2015, Rene Gollent, rene@gollent.com.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef FLOAT_VALUE_FORMATTER_H
|
|
|
|
#define FLOAT_VALUE_FORMATTER_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "ValueFormatter.h"
|
|
|
|
|
|
|
|
|
|
|
|
class Settings;
|
|
|
|
class Value;
|
|
|
|
|
|
|
|
|
|
|
|
class FloatValueFormatter : public ValueFormatter {
|
|
|
|
public:
|
|
|
|
FloatValueFormatter();
|
|
|
|
virtual ~FloatValueFormatter();
|
|
|
|
|
|
|
|
virtual Settings* GetSettings() const
|
|
|
|
{ return NULL; }
|
|
|
|
|
|
|
|
virtual status_t FormatValue(Value* value, BString& _output);
|
2015-07-25 02:22:08 +03:00
|
|
|
|
|
|
|
virtual bool SupportsValidation() const;
|
|
|
|
|
|
|
|
virtual bool ValidateFormattedValue(
|
|
|
|
const BString& input,
|
|
|
|
type_code type) const;
|
|
|
|
|
|
|
|
virtual status_t GetValueFromFormattedInput(
|
|
|
|
const BString& input, type_code type,
|
|
|
|
Value*& _output) const;
|
|
|
|
private:
|
|
|
|
|
|
|
|
status_t _PerformValidation(const BString& input,
|
|
|
|
type_code type,
|
|
|
|
::Value*& _output,
|
|
|
|
bool wantsValue) const;
|
2015-06-07 00:24:09 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // FLOAT_VALUE_FORMATTER_H
|