Lines Matching refs:Indent
35 const std::string Indent = " "; variable
57 return "\n" + Indent + Indent + in OffsetPrefix()
60 Indent + Indent + "if o != 0:\n"; in OffsetPrefix()
67 code += Indent + "__slots__ = ['_tab']"; in BeginClass()
103 return "\n" + std::string(num * Indent.length(), ' '); in GenIndents()
110 code += Indent; in EnumMember()
127 code += Indent + "@classmethod\n"; in NewRootTypeFromBuffer()
128 code += Indent + "def GetRootAs"; in NewRootTypeFromBuffer()
131 code += Indent + Indent; in NewRootTypeFromBuffer()
134 code += Indent + Indent + "x = " + NormalizedName(struct_def) + "()\n"; in NewRootTypeFromBuffer()
135 code += Indent + Indent + "x.Init(buf, n + offset)\n"; in NewRootTypeFromBuffer()
136 code += Indent + Indent + "return x\n"; in NewRootTypeFromBuffer()
140 code += Indent + "@classmethod\n"; in NewRootTypeFromBuffer()
141 code += Indent + "def GetRootAs"; in NewRootTypeFromBuffer()
144 … code += Indent + Indent + "\"\"\"This method is deprecated. Please switch to GetRootAs.\"\"\"\n"; in NewRootTypeFromBuffer()
145 code += Indent + Indent + "return cls.GetRootAs(buf, offset)\n"; in NewRootTypeFromBuffer()
154 code += Indent + Indent + "self._tab = flatbuffers.table.Table(buf, pos)\n"; in InitializeExisting()
166 code += Indent + Indent + Indent + "return self._tab.VectorLen(o)\n"; in GetVectorLen()
167 code += Indent + Indent + "return 0\n\n"; in GetVectorLen()
209 code += Indent + Indent + Indent + "return " + getter + "\n"; in GetScalarFieldOfTable()
218 code += Indent + Indent + "return " + default_value + "\n\n"; in GetScalarFieldOfTable()
229 code += Indent + Indent + "obj.Init(self._tab.Bytes, self._tab.Pos + "; in GetStructFieldOfStruct()
231 code += "\n" + Indent + Indent + "return obj\n\n"; in GetStructFieldOfStruct()
243 code += Indent + Indent + "obj.Init(self._tab.Bytes, self._tab.Pos + "; in GetArrayOfStruct()
246 code += ")\n" + Indent + Indent + "return obj\n\n"; in GetArrayOfStruct()
268 code += Indent + Indent + Indent + "x = o + self._tab.Pos\n"; in GetStructFieldOfTable()
270 code += Indent + Indent + Indent; in GetStructFieldOfTable()
274 code += Indent + Indent + Indent; in GetStructFieldOfTable()
278 code += Indent + Indent + Indent + "obj = " + TypeName(field) + "()\n"; in GetStructFieldOfTable()
279 code += Indent + Indent + Indent + "obj.Init(self._tab.Bytes, x)\n"; in GetStructFieldOfTable()
280 code += Indent + Indent + Indent + "return obj\n"; in GetStructFieldOfTable()
281 code += Indent + Indent + "return None\n\n"; in GetStructFieldOfTable()
292 code += Indent + Indent + Indent + "return " + GenGetter(field.value.type); in GetStringField()
294 code += Indent + Indent + "return None\n\n"; in GetStringField()
309 Indent + Indent + Indent + "from flatbuffers.table import Table\n"; in GetUnionField()
311 code += Indent + Indent + Indent; in GetUnionField()
315 code += Indent + Indent + Indent + "obj = Table(bytearray(), 0)\n"; in GetUnionField()
316 code += Indent + Indent + Indent + GenGetter(field.value.type); in GetUnionField()
317 code += "obj, o)\n" + Indent + Indent + Indent + "return obj\n"; in GetUnionField()
318 code += Indent + Indent + "return None\n\n"; in GetUnionField()
345 code += Indent + Indent + Indent + "x = self._tab.Vector(o)\n"; in GetMemberOfVectorOfStruct()
346 code += Indent + Indent + Indent; in GetMemberOfVectorOfStruct()
350 code += Indent + Indent + Indent + "x = self._tab.Indirect(x)\n"; in GetMemberOfVectorOfStruct()
353 code += Indent + Indent + Indent; in GetMemberOfVectorOfStruct()
357 code += Indent + Indent + Indent + "obj = " + TypeName(field) + "()\n"; in GetMemberOfVectorOfStruct()
358 code += Indent + Indent + Indent + "obj.Init(self._tab.Bytes, x)\n"; in GetMemberOfVectorOfStruct()
359 code += Indent + Indent + Indent + "return obj\n"; in GetMemberOfVectorOfStruct()
360 code += Indent + Indent + "return None\n\n"; in GetMemberOfVectorOfStruct()
375 code += Indent + Indent + Indent + "a = self._tab.Vector(o)\n"; in GetMemberOfVectorOfNonStruct()
376 code += Indent + Indent + Indent; in GetMemberOfVectorOfNonStruct()
381 code += Indent + Indent + "return \"\"\n"; in GetMemberOfVectorOfNonStruct()
383 code += Indent + Indent + "return 0\n"; in GetMemberOfVectorOfNonStruct()
404 code += Indent + Indent + Indent; in GetVectorOfNonStructAsNumpy()
411 code += Indent + Indent + "return \"\"\n"; in GetVectorOfNonStructAsNumpy()
413 code += Indent + Indent + "return 0\n"; in GetVectorOfNonStructAsNumpy()
442 code += Indent + Indent + Indent; in GetVectorAsNestedFlatbuffer()
444 code += Indent + Indent + Indent + "return " + unqualified_name; in GetVectorAsNestedFlatbuffer()
447 code += Indent + Indent + "return 0\n"; in GetVectorAsNestedFlatbuffer()
563 code += Indent + "\"\"\"This method is deprecated. Please switch to Start.\"\"\"\n"; in GetStartOfTable()
564 code += Indent + "return Start(builder)\n"; in GetStartOfTable()
596 code += Indent + "\"\"\"This method is deprecated. Please switch to Add"; in BuildFieldOfTable()
598 code += Indent + "return Add" + MakeCamel(NormalizedName(field)); in BuildFieldOfTable()
624 code += Indent + "\"\"\"This method is deprecated. Please switch to Start.\"\"\"\n"; in BuildVectorOfTable()
625 code += Indent + "return Start"; in BuildVectorOfTable()
650 code += Indent + "builder.StartVector("; in BuildVectorOfTableFromBytes()
657 code += Indent + "builder.head = builder.head - len(bytes)\n"; in BuildVectorOfTableFromBytes()
658 code += Indent + "builder.Bytes[builder.head : builder.head + len(bytes)]"; in BuildVectorOfTableFromBytes()
660 code += Indent + "return builder.EndVector()\n"; in BuildVectorOfTableFromBytes()
665 code += Indent + "builder.StartVector("; in BuildVectorOfTableFromBytes()
669 code += Indent + "builder.head = builder.head - len(bytes)\n"; in BuildVectorOfTableFromBytes()
670 code += Indent + "builder.Bytes[builder.head : builder.head + len(bytes)]"; in BuildVectorOfTableFromBytes()
672 code += Indent + "return builder.EndVector()\n"; in BuildVectorOfTableFromBytes()
682 code += Indent + "\"\"\"This method is deprecated. Please switch to End.\"\"\"\n"; in GetEndOffsetOnTable()
683 code += Indent + "return End(builder)"; in GetEndOffsetOnTable()
689 code += Indent + "# " + NormalizedName(struct_def) + "\n"; in GenReceiver()
690 code += Indent + "def "; in GenReceiver()
696 GenComment(field.doc_comment, code_ptr, &def_comment, Indent.c_str()); in GenStructAccessor()
741 code += Indent + "@classmethod\n"; in GenStructSizeOf()
742 code += Indent + "def SizeOf(cls):\n"; in GenStructSizeOf()
744 Indent + Indent + "return " + NumToString(struct_def.bytesize) + "\n"; in GenStructSizeOf()
781 code += Indent + "@classmethod\n"; in GenHasFileIdentifier()
782 code += Indent + "def " + NormalizedName(struct_def); in GenHasFileIdentifier()
785 code += Indent + Indent; in GenHasFileIdentifier()
1627 GenComment(ev.doc_comment, code_ptr, &def_comment, Indent.c_str()); in GenEnum()