Exemplo n.º 1
0
        public AssetFolder OpenNamespacedFolder(string relativeBasePath, string namespacePath)
        {
            AssetFolder assetFolder = this.OpenFolder(relativeBasePath);

            foreach (string name in PBXPath.Split(namespacePath))
            {
                assetFolder = assetFolder.OpenFolder(name);
                assetFolder.providesNamespace = true;
            }
            return(assetFolder);
        }
Exemplo n.º 2
0
        public AssetFolder OpenNamespacedFolder(string relativeBasePath, string namespacePath)
        {
            AssetFolder folder = this.OpenFolder(relativeBasePath);

            string[] strArray = PBXPath.Split(namespacePath);
            foreach (string str in strArray)
            {
                folder = folder.OpenFolder(str);
                folder.providesNamespace = true;
            }
            return(folder);
        }
Exemplo n.º 3
0
        // Creates a directory structure with "provides namespace" attribute.
        // First, retrieves or creates the directory at relativeBasePath, creating parent
        // directories if needed. Effectively calls OpenFolder(relativeBasePath).
        // Then, relative to this directory, creates namespacePath directories with "provides
        // namespace" attribute set. Fails if the attribute can't be set.
        public AssetFolder OpenNamespacedFolder(string relativeBasePath, string namespacePath)
        {
            var folder    = OpenFolder(relativeBasePath);
            var pathItems = PBXPath.Split(namespacePath);

            foreach (var pathItem in pathItems)
            {
                folder = folder.OpenFolder(pathItem);
                folder.providesNamespace = true;
            }
            return(folder);
        }
Exemplo n.º 4
0
        private AssetFolder OpenFolderForResource(string relativePath)
        {
            List <string> list = PBXPath.Split(relativePath).ToList <string>();

            list.RemoveAt(list.Count - 1);
            AssetFolder root = this.root;

            foreach (string str in list)
            {
                root = root.OpenFolder(str);
            }
            return(root);
        }
Exemplo n.º 5
0
        private AssetFolder OpenFolderForResource(string relativePath)
        {
            List <string> list = Enumerable.ToList <string>((IEnumerable <string>)PBXPath.Split(relativePath));

            list.RemoveAt(list.Count - 1);
            AssetFolder assetFolder = this.root;

            foreach (string name in list)
            {
                assetFolder = assetFolder.OpenFolder(name);
            }
            return(assetFolder);
        }
Exemplo n.º 6
0
        AssetFolder OpenFolderForResource(string relativePath)
        {
            var pathItems = PBXPath.Split(relativePath).ToList();

            // remove path filename
            pathItems.RemoveAt(pathItems.Count - 1);

            AssetFolder folder = root;

            foreach (var pathItem in pathItems)
            {
                folder = folder.OpenFolder(pathItem);
            }
            return(folder);
        }
Exemplo n.º 7
0
        /// Creates source group identified by sourceGroup, if needed, and returns it.
        /// If sourceGroup is empty or null, root group is returned
        private PBXGroupData CreateSourceGroup(string sourceGroup)
        {
            sourceGroup = PBXPath.FixSlashes(sourceGroup);

            if (sourceGroup == null || sourceGroup == "")
            {
                return(GroupsGetMainGroup());
            }

            PBXGroupData gr = GroupsGetByProjectPath(sourceGroup);

            if (gr != null)
            {
                return(gr);
            }

            // the group does not exist -- create new
            gr = GroupsGetMainGroup();

            var    elements    = PBXPath.Split(sourceGroup);
            string projectPath = null;

            foreach (string pathEl in elements)
            {
                if (projectPath == null)
                {
                    projectPath = pathEl;
                }
                else
                {
                    projectPath += "/" + pathEl;
                }

                PBXGroupData child = GetPBXGroupChildByName(gr, pathEl);
                if (child != null)
                {
                    gr = child;
                }
                else
                {
                    PBXGroupData newGroup = PBXGroupData.Create(pathEl, pathEl, PBXSourceTree.Group);
                    gr.children.AddGUID(newGroup.guid);
                    GroupsAdd(projectPath, gr, newGroup);
                    gr = newGroup;
                }
            }
            return(gr);
        }
Exemplo n.º 8
0
        public AssetFolder OpenFolder(string relativePath)
        {
            if (relativePath == null)
            {
                return(this.root);
            }
            string[] strArray = PBXPath.Split(relativePath);
            if (strArray.Length == 0)
            {
                return(this.root);
            }
            AssetFolder root = this.root;

            foreach (string str in strArray)
            {
                root = root.OpenFolder(str);
            }
            return(root);
        }
Exemplo n.º 9
0
        public AssetFolder OpenFolder(string relativePath)
        {
            if (relativePath == null)
            {
                return(this.root);
            }
            string[] strArray = PBXPath.Split(relativePath);
            if (strArray.Length == 0)
            {
                return(this.root);
            }
            AssetFolder assetFolder = this.root;

            foreach (string name in strArray)
            {
                assetFolder = assetFolder.OpenFolder(name);
            }
            return(assetFolder);
        }
Exemplo n.º 10
0
        // Checks if a folder with given path exists and returns it if it does.
        // Otherwise, creates a new folder. Parent folders are created if needed.
        public AssetFolder OpenFolder(string relativePath)
        {
            if (relativePath == null)
            {
                return(root);
            }
            var pathItems = PBXPath.Split(relativePath);

            if (pathItems.Length == 0)
            {
                return(root);
            }
            AssetFolder folder = root;

            foreach (var pathItem in pathItems)
            {
                folder = folder.OpenFolder(pathItem);
            }
            return(folder);
        }
Exemplo n.º 11
0
        private PBXGroupData CreateSourceGroup(string sourceGroup)
        {
            sourceGroup = PBXPath.FixSlashes(sourceGroup);
            if ((sourceGroup == null) || (sourceGroup == ""))
            {
                return(this.GroupsGetMainGroup());
            }
            PBXGroupData group = this.GroupsGetByProjectPath(sourceGroup);

            if (group == null)
            {
                group = this.GroupsGetMainGroup();
                string[] strArray    = PBXPath.Split(sourceGroup);
                string   projectPath = null;
                foreach (string str2 in strArray)
                {
                    if (projectPath == null)
                    {
                        projectPath = str2;
                    }
                    else
                    {
                        projectPath = projectPath + "/" + str2;
                    }
                    PBXGroupData pBXGroupChildByName = this.GetPBXGroupChildByName(group, str2);
                    if (pBXGroupChildByName != null)
                    {
                        group = pBXGroupChildByName;
                    }
                    else
                    {
                        PBXGroupData gr = PBXGroupData.Create(str2, str2, PBXSourceTree.Group);
                        group.children.AddGUID(gr.guid);
                        this.GroupsAdd(projectPath, group, gr);
                        group = gr;
                    }
                }
            }
            return(group);
        }