示例#1
0
        public void Unserialise(Stream s)
        {
            Type     = (EFSNodeType)s.ReadValue <int>();
            Name     = s.ReadValue <Tools.ByValStrings.ByValANSIString128>().cstring;
            Metadata = s.ReadValue <EFSNodeInformation>();
            Flags    = s.ReadValue <uint>();
            int dl = s.ReadValue <int>();

            if (dl > 0)
            {
                Data = s.ReadNew(dl);
            }
            else
            {
                Data = null;
            }
            int cl = s.ReadValue <int>();

            if (cl > 0)
            {
                c_list = new List <EFSNode>();
                for (int i = 0; i < cl; i++)
                {
                    EFSNode child = new EFSNode();
                    child.Unserialise(s);
                    c_list.Add(child);
                }
            }
            else
            {
                Children = null;
            }
        }
示例#2
0
        public static EFSNode CreateFromStream(Stream s)
        {
            EFSNode n = new EFSNode();

            n.Unserialise(s);
            return(n);
        }
示例#3
0
 public EFSNode AddChild(EFSNode n)
 {
     if (c_list == null)
     {
         c_list = new List <EFSNode>();
     }
     lock (c_list)
     {
         int i = c_list.Count;
         c_list.Add(n);
         return(c_list[i]);
     }
 }
示例#4
0
 public EmbeddedFilesystem()
 {
     root = new EFSNode(EFSNodeType.Folder, "", null);
 }