# automatically generated by the FlatBuffers compiler, do not modify

# namespace: MNN

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class AsString(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAs(cls, buf, offset=0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = AsString()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def GetRootAsAsString(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # AsString
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # AsString
    def T(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # AsString
    def Precision(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # AsString
    def Scientific(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

    # AsString
    def Shortest(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

    # AsString
    def Width(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

    # AsString
    def FillString(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

def AsStringStart(builder): builder.StartObject(6)
def Start(builder):
    return AsStringStart(builder)
def AsStringAddT(builder, t): builder.PrependInt32Slot(0, t, 0)
def AddT(builder, t):
    return AsStringAddT(builder, t)
def AsStringAddPrecision(builder, precision): builder.PrependInt32Slot(1, precision, 0)
def AddPrecision(builder, precision):
    return AsStringAddPrecision(builder, precision)
def AsStringAddScientific(builder, scientific): builder.PrependBoolSlot(2, scientific, 0)
def AddScientific(builder, scientific):
    return AsStringAddScientific(builder, scientific)
def AsStringAddShortest(builder, shortest): builder.PrependBoolSlot(3, shortest, 0)
def AddShortest(builder, shortest):
    return AsStringAddShortest(builder, shortest)
def AsStringAddWidth(builder, width): builder.PrependInt32Slot(4, width, 0)
def AddWidth(builder, width):
    return AsStringAddWidth(builder, width)
def AsStringAddFillString(builder, fillString): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(fillString), 0)
def AddFillString(builder, fillString):
    return AsStringAddFillString(builder, fillString)
def AsStringEnd(builder): return builder.EndObject()
def End(builder):
    return AsStringEnd(builder)