7#include "core/fpdfapi/parser/cpdf_number.h"
9#include "core/fxcrt/fx_stream.h"
11CPDF_Number::CPDF_Number() =
default;
13CPDF_Number::CPDF_Number(
int value) : m_Number(value) {}
15CPDF_Number::CPDF_Number(
float value) : m_Number(value) {}
17CPDF_Number::CPDF_Number(ByteStringView str) : m_Number(str) {}
26 return m_Number.IsInteger()
27 ? pdfium::MakeRetain<CPDF_Number>(m_Number.GetSigned())
28 : pdfium::MakeRetain<CPDF_Number>(m_Number.GetFloat());
32 return m_Number.GetFloat();
36 return m_Number.GetSigned();
44 m_Number = FX_Number(str.AsStringView());
48 return m_Number.IsInteger() ? ByteString::FormatInteger(m_Number.GetSigned())
49 : ByteString::FormatFloat(m_Number.GetFloat());
bool WriteTo(IFX_ArchiveStream *archive, const CPDF_Encryptor *encryptor) const override
float GetNumber() const override
int GetInteger() const override
RetainPtr< CPDF_Object > Clone() const override
void SetString(const ByteString &str) override
ByteString GetString() const override
CPDF_Number * AsMutableNumber() override
Type GetType() const override
bool WriteString(ByteStringView str)