class_docstr: OLE2 Directory Entry
class_docstr_tok: ["OLE2","Directory","Entry"]
docstr: Walk through red-black tree of children of this directory entry to add
  all of them to the kids list. (recursive method)
  
  :param child_sid: index of child directory entry to use, or None when called
      first time for the root. (only used during recursion)
docstr_tok: ["Walk","through","red-black","tree","of","children","of","this","directory","entry","to","add","all","of","them","to","the","kids","list",".","(","recursive","method",")",":","param","child_sid",":","index","of","child","directory","entry","to","use",",","or","None","when","called","first","time","for","the","root",".","(","only","used","during","recursion",")"]
code: def append_kids(self, child_sid):
      """
      Walk through red-black tree of children of this directory entry to add
      all of them to the kids list. (recursive method)
  
      :param child_sid: index of child directory entry to use, or None when called
          first time for the root. (only used during recursion)
      """
      log.debug("append_kids: child_sid=%d" % child_sid)
      # [PL] this method was added to use simple recursion instead of a complex
      # algorithm.
      # if this is not a storage or a leaf of the tree, nothing to do:
      if child_sid == NOSTREAM:
          return
      # check if child SID is in the proper range:
      if child_sid < 0 or child_sid >= len(self.olefile.direntries):
          self.olefile._raise_defect(
              DEFECT_INCORRECT, "OLE DirEntry index out of range"
          )
      else:
          # get child direntry:
          child = self.olefile._load_direntry(
              child_sid
          )  # direntries[child_sid]
          log.debug(
              "append_kids: child_sid=%d - %s - sid_left=%d, sid_right=%d, sid_child=%d"
              % (
                  child.sid,
                  repr(child.name),
                  child.sid_left,
                  child.sid_right,
                  child.sid_child,
              )
          )
          # Check if kid was not already referenced in a storage:
          if child.used:
              self.olefile._raise_defect(
                  DEFECT_INCORRECT,
                  "OLE Entry referenced more than once",
              )
              return
          child.used = True
          # the directory entries are organized as a red-black tree.
          # (cf. Wikipedia for details)
          # First walk through left side of the tree:
          self.append_kids(child.sid_left)
          # Check if its name is not already used (case-insensitive):
          name_lower = child.name.lower()
          if name_lower in self.kids_dict:
              self.olefile._raise_defect(
                  DEFECT_INCORRECT, "Duplicate filename in OLE storage"
              )
          # Then the child_sid OleDirectoryEntry object is appended to the
          # kids list and dictionary:
          self.kids.append(child)
          self.kids_dict[name_lower] = child
          # Finally walk through right side of the tree:
          self.append_kids(child.sid_right)
          # Afterwards build kid's own tree if it's also a storage:
          child.build_storage_tree()
  
imports: from __future__ import print_function
  import io
  import sys
  import struct, array, os.path, datetime, logging
label_desc: Use image node_id 4 for calling the OleDirectoryEntry obj's underlying member method code with example usage: obj.append_kids(child_sid) without return types