1using System.Collections.Concurrent;
3using System.Text.Json.Serialization;
12 private ConcurrentDictionary<string, byte[]> entries =
new ConcurrentDictionary<string, byte[]>();
26 public SortedDictionary<string, byte[]>
Entries
28 get =>
new(entries);
set => entries =
new(value);
26 public SortedDictionary<string, byte[]>
Entries {
…};
45 public ConcurrentDictionary<string, byte[]>
GetEntries() => entries;
58 public void AddEntry(
string entryName,
byte[] hash)
60 if (!entries.TryAdd(entryName, hash))
62 throw new DuplicateNameException($
"The entry '{entryName}' is already in the manifest.");
58 public void AddEntry(
string entryName,
byte[] hash) {
…}
74 if (!entries.Remove(entryName, out _))
76 throw new KeyNotFoundException(entryName);
92 [JsonSourceGenerationOptions(GenerationMode = JsonSourceGenerationMode.Metadata, WriteIndented =
false, DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
94 internal partial class SourceGenerationManifestContext : JsonSerializerContext
Represents a manifest that holds entries of file names and their corresponding hashes.
SortedDictionary< string, byte[]> Entries
Gets or sets the entries in the manifest as a sorted dictionary.
static string GetNormalizedEntryName(string path)
Converts the path to an standard zip entry name.
void DeleteEntry(string entryName)
Deletes an entry from the manifest.
string? UpdatedBy
Gets or sets the full name of the class that updated the manifest.
bool StoreOriginalFiles
Gets or sets a value indicating whether the files should be stored in the bundle.
void AddEntry(string entryName, byte[] hash)
Adds an entry to the manifest.
ConcurrentDictionary< string, byte[]> GetEntries()
Gets the entries as a thread-safe concurrent dictionary.
HashSet< string > ProtectedEntryNames
Gets or sets the list of entry names that should be protected by the bundle from accidental modificat...