# 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 PdfBoolValue(PdfObject):
    
    def __init__(self) -> None:
        super().__init__()
        self.val = False
    
    def to_string_ex(self, lev : int) -> str:
        return "{0}".format((" True" if self.val else "False"))
    
    def is_simple(self, lev : int) -> bool:
        return True
    
    def write0_(self, s : Stream) -> None:
        buf = "{0}".format(("true" if self.val else "false")).encode("ASCII", 'ignore')
        s.write(buf, 0, len(buf))