2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-23 03:18:59 +00:00
qpdf/libqpdf/qpdf/QPDF_Real.hh
2022-06-27 12:50:35 -04:00

28 lines
835 B
C++

#ifndef QPDF_REAL_HH
#define QPDF_REAL_HH
#include <qpdf/QPDFObject.hh>
class QPDF_Real: public QPDFObject
{
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);
virtual QPDFObject::object_type_e getTypeCode() const;
virtual char const* getTypeName() const;
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