/// <summary> /// Adds entry from specified file. /// </summary> /// <param name="resPath">The resPath to entry. It should start with res://</param> public static void Add(this PckPacker source, string resPath, string filePath) { if (source is null) { throw new ArgumentNullException(nameof(source)); } source.Add(new PckPackerEntryFile(resPath, filePath)); }
/// <summary> /// Adds entry from bytes. /// </summary> /// <param name="resPath">The resPath to entry. It should start with res://</param> public static void Add(this PckPacker source, string resPath, byte[] bytes) { if (source is null) { throw new ArgumentNullException(nameof(source)); } source.Add(new PckPackerEntryBytes(resPath, bytes)); }
/// <summary> /// Adds entry from specified stream. /// </summary> /// <param name="resPath">The resPath to entry. It should start with res://</param> public static void Add(this PckPacker source, string resPath, Stream stream) { if (source is null) { throw new ArgumentNullException(nameof(source)); } source.Add(new PckPackerEntryStream(resPath, stream)); }
/// <summary> /// Adds entry from PckArchiveEntry with a new resPath. /// </summary> /// <param name="resPath">The resPath to entry. It should start with res://</param> public static void Add(this PckPacker source, string resPath, PckArchiveEntry entry) { if (source is null) { throw new ArgumentNullException(nameof(source)); } source.Add(new PckPackerEntryEntry(resPath, entry)); }
/// <summary> /// Adds entry from specified text. /// </summary> /// <param name="resPath">The resPath to entry. It should start with res://</param> public static void Add(this PckPacker source, string resPath, string text, Encoding encoding) { if (source is null) { throw new ArgumentNullException(nameof(source)); } if (text is null) { throw new ArgumentNullException(nameof(source)); } if (encoding is null) { throw new ArgumentNullException(nameof(source)); } var bytes = encoding.GetBytes(text); source.Add(new PckPackerEntryBytes(resPath, bytes)); }