aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf/QPDF_Real.hh
blob: dc0f3ff8f7625dd868a0ae4de5ae90689b4c7e1f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef QPDF_REAL_HH
#define QPDF_REAL_HH

#include <qpdf/QPDFValue.hh>

class QPDF_Real: public QPDFValue
{
  public:
    virtual ~QPDF_Real() = default;
    static std::shared_ptr<QPDFObject> create(std::string const& val);
    static std::shared_ptr<QPDFObject>
    create(double value, int decimal_places, bool trim_trailing_zeroes);
    virtual std::shared_ptr<QPDFObject> shallowCopy();
    virtual std::string unparse();
    virtual JSON getJSON(int json_version);
    std::string getVal();

  private:
    QPDF_Real(std::string const& val);
    QPDF_Real(double value, int decimal_places, bool trim_trailing_zeroes);
    // Store reals as strings to avoid roundoff errors.
    std::string val;
};

#endif // QPDF_REAL_HH