public override Task <string[]> List(string identifier, StorageListOptions options)
        {
            List <string> items    = new List <string>();
            string        fullPath = GetAbsolutePath(identifier);

#if !UNITY_EDITOR && (UNITY_WSA || UNITY_WINRT)
            identifier = identifier.Replace('/', '\\');
            fullPath   = fullPath.Replace('/', '\\');
#endif

            if (options.Recurse)
            {
                items.AddRange(Directory.GetFiles(fullPath, "*.*", SearchOption.AllDirectories));
                items.AddRange(Directory.GetDirectories(fullPath, "*", SearchOption.AllDirectories));
            }
            else if (Directory.Exists(fullPath))
            {
                items.AddRange(Directory.GetDirectories(fullPath));
                items.AddRange(Directory.GetFiles(fullPath));
            }
            if (options.MaxResults.HasValue)
            {
                items.Capacity = options.MaxResults.GetValueOrDefault();
            }
            return(Task.FromResult(items.ToArray()));
        }
Exemple #2
0
        public override async Task <string[]> List(string identifier, StorageListOptions options)
        {
            List <string> items = await LoadCatalog();

            if (options.MaxResults.HasValue)
            {
                items.Capacity = options.MaxResults.GetValueOrDefault();
            }
            return(items.FindAll(item => item.Contains(identifier)).ToArray());
        }
 public abstract Task <string[]> List(string identifier, StorageListOptions options);