4 using System.Collections.Generic;
6 namespace Monodoc.Storage
8 // A read-only storage to access ecma XML document based on a standard directory layout
9 // id are relative path inside the base doc directory
10 public class UncompiledDocStorage : IDocStorage
12 readonly string basePath;
14 public UncompiledDocStorage (string basePath)
16 this.basePath = basePath;
19 public bool SupportRevision {
25 public IDocRevisionManager RevisionManager {
31 public bool SupportChange {
37 public string Store (string id, string text)
39 throw new NotSupportedException ();
42 public string Store (string id, byte[] data)
44 throw new NotSupportedException ();
47 public string Store (string id, Stream stream)
49 throw new NotSupportedException ();
52 public Stream Retrieve (string id)
55 if ('/' != Path.DirectorySeparatorChar)
56 path = path.Replace ('/', Path.DirectorySeparatorChar);
57 return File.OpenRead (Path.Combine (basePath, path));
60 public IEnumerable<string> GetAvailableIds ()
62 return Directory.EnumerateFiles (basePath, "*.xml", SearchOption.AllDirectories);
65 public void Dispose ()