# SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved.
# Non-Commercial Freeware and Commercial Software.
# This class is generated using the converter UniSharping (www.unisharping.ru) from Pullenti C# project.
# The latest version of the code is available on the site www.pullenti.ru

from pullenti.unisharp.Streams import Stream

from pullenti.unitext.internal.pdf.PdfObject import PdfObject

class PdfIntValue(PdfObject):
    
    def __init__(self) -> None:
        super().__init__()
        self.val = 0
    
    def get_double(self) -> float:
        return self.val
    
    def to_string_ex(self, lev : int) -> str:
        return str(self.val)
    
    def is_simple(self, lev : int) -> bool:
        return True
    
    def write0_(self, s : Stream) -> None:
        buf = "{0}".format(self.val).encode("ASCII", 'ignore')
        s.write(buf, 0, len(buf))
    
    @staticmethod
    def _new229(_arg1 : int) -> 'PdfIntValue':
        res = PdfIntValue()
        res.val = _arg1
        return res