public void OverwriteSample(string hash, string content, SampleDesc newDesc) { if (!archive.ContainsEntry(hash)) { return; } archive.UpdateEntry(hash, content); index[hash] = newDesc; }
public string GetSampleFromID(string id, out SampleDesc desc) { desc = new SampleDesc(); var entry = archive[id]; if (entry == null) { return(null); } desc = index[id]; using (var stream = entry.OpenReader()) return(new StreamReader(stream).ReadToEnd()); }
// Returns an id that can be used to register the sample position in the documentation flow public string RegisterSample(string source, SampleDesc desc) { var hash = StringHash(source); validFiles.Add(hash); desc.ID = hash; if (!archive.ContainsEntry(hash)) { archive.AddEntry(hash, source); index[hash] = desc; } return(hash); }
public string GetSampleFromContent(string content, out SampleDesc desc) { return(GetSampleFromID(StringHash(content), out desc)); }
// Returns an id that can be used to register the sample position in the documentation flow public string RegisterSample(string source, SampleDesc desc) { var hash = StringHash (source); validFiles.Add (hash); desc.ID = hash; if (!archive.ContainsEntry (hash)) { archive.AddEntry (hash, source); index[hash] = desc; } return hash; }
public void OverwriteSample(string hash, string content, SampleDesc newDesc) { if (!archive.ContainsEntry (hash)) return; archive.UpdateEntry (hash, content); index[hash] = newDesc; }
public string GetSampleFromID(string id, out SampleDesc desc) { desc = new SampleDesc (); var entry = archive[id]; if (entry == null) return null; desc = index[id]; using (var stream = entry.OpenReader ()) return new StreamReader (stream).ReadToEnd (); }
public string GetSampleFromContent(string content, out SampleDesc desc) { return GetSampleFromID (StringHash (content), out desc); }