コード例 #1
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);
        }
コード例 #2
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);
        }
コード例 #3
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);
        }