Пример #1
0
        private RPFEntry FindDirectory(Queue <string> queue, string basePath)
        {
            var path  = queue.Dequeue();
            var entry = m_subEntries.Find(e => e.Name == basePath + path);

            if (entry != null)
            {
                if (!entry.IsDirectory)
                {
                    throw new InvalidOperationException("This already is a file, so a directory can't be made.");
                }
            }
            else
            {
                entry = new RPFEntry(basePath + path, true);

                m_subEntries.Add(entry);
            }

            if (queue.Count > 1)
            {
                entry = entry.FindDirectory(queue, basePath + path + "/");
            }

            return(entry);
        }
Пример #2
0
 public RPFFile()
 {
     RootEntry = new RPFEntry("", true);
 }
Пример #3
0
        private RPFEntry FindDirectory(Queue<string> queue, string basePath)
        {
            var path = queue.Dequeue();
            var entry = m_subEntries.Find(e => e.Name == basePath + path);

            if (entry != null)
            {
                if (!entry.IsDirectory)
                {
                    throw new InvalidOperationException("This already is a file, so a directory can't be made.");
                }
            }
            else
            {
                entry = new RPFEntry(basePath + path, true);

                m_subEntries.Add(entry);
            }

            if (queue.Count > 1)
            {
                entry = entry.FindDirectory(queue, basePath + path + "/");
            }

            return entry;
        }