コード例 #1
0
ファイル: VFSPath.cs プロジェクト: HarryCU/QwPlatform
 internal VFSPathItem(string fullName, string name, VFSPathItem next, bool isFileName = false)
 {
     Name       = name;
     _next      = next;
     FullName   = fullName;
     IsFileName = isFileName;
 }
コード例 #2
0
ファイル: VFSPath.cs プロジェクト: HarryCU/QwPlatform
        public static VFSPathItem Parse(string path)
        {
            var         items = path.Split(PathSeparator[0]);
            VFSPathItem root = null, next = null;
            var         lastIndex = items.Length - 1;

            for (int i = lastIndex; i >= 0; i--)
            {
                if (i == 0)
                {
                    root = new VFSPathItem(items[i], items[i], next);
                }
                else
                {
                    next = new VFSPathItem(string.Join(PathSeparator, items, 0, i + 1), items[i], next, lastIndex == i);
                }
            }

            return(root);
        }