2018-08-12 18:07:22 +00:00
|
|
|
#ifndef QPDF_REAL_HH
|
|
|
|
#define QPDF_REAL_HH
|
2008-04-29 12:55:25 +00:00
|
|
|
|
2022-08-02 20:35:04 +00:00
|
|
|
#include <qpdf/QPDFValue.hh>
|
2008-04-29 12:55:25 +00:00
|
|
|
|
2022-08-02 20:35:04 +00:00
|
|
|
class QPDF_Real: public QPDFValue
|
2008-04-29 12:55:25 +00:00
|
|
|
{
|
|
|
|
public:
|
2023-06-01 14:21:32 +00:00
|
|
|
~QPDF_Real() override = default;
|
2022-09-08 15:29:23 +00:00
|
|
|
static std::shared_ptr<QPDFObject> create(std::string const& val);
|
|
|
|
static std::shared_ptr<QPDFObject>
|
2022-06-27 16:50:35 +00:00
|
|
|
create(double value, int decimal_places, bool trim_trailing_zeroes);
|
2023-06-01 14:21:32 +00:00
|
|
|
std::shared_ptr<QPDFObject> copy(bool shallow = false) override;
|
|
|
|
std::string unparse() override;
|
2024-02-09 13:09:08 +00:00
|
|
|
void writeJSON(int json_version, JSON::Writer& p) override;
|
2023-06-01 14:21:32 +00:00
|
|
|
std::string
|
|
|
|
getStringValue() const override
|
2022-12-21 13:14:05 +00:00
|
|
|
{
|
|
|
|
return val;
|
|
|
|
}
|
2008-04-29 12:55:25 +00:00
|
|
|
|
|
|
|
private:
|
2022-06-16 16:45:04 +00:00
|
|
|
QPDF_Real(std::string const& val);
|
|
|
|
QPDF_Real(double value, int decimal_places, bool trim_trailing_zeroes);
|
2008-04-29 12:55:25 +00:00
|
|
|
// Store reals as strings to avoid roundoff errors.
|
|
|
|
std::string val;
|
|
|
|
};
|
|
|
|
|
2018-08-12 18:07:22 +00:00
|
|
|
#endif // QPDF_REAL_HH
|