mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
implemented archive creation frontend.
This commit is contained in:
@@ -144,10 +144,10 @@ namespace GameRes
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create resource archive named <paramref name="filename"/> containing entries from the
|
||||
/// Create resource wihin stream <paramref name="file"/> containing entries from the
|
||||
/// supplied <paramref name="list"/> and applying necessary <paramref name="options"/>.
|
||||
/// </summary>
|
||||
public virtual void Create (string filename, IEnumerable<Entry> list, ResourceOptions options = null)
|
||||
public virtual void Create (Stream file, IEnumerable<Entry> list, ResourceOptions options = null)
|
||||
{
|
||||
throw new NotImplementedException ("ArchiveFormat.Create is not implemented");
|
||||
}
|
||||
@@ -329,7 +329,7 @@ namespace GameRes
|
||||
}
|
||||
}
|
||||
|
||||
public class InvalidFormatException : Exception
|
||||
public class InvalidFormatException : FileFormatException
|
||||
{
|
||||
public InvalidFormatException() : base(garStrings.MsgInvalidFormat) { }
|
||||
public InvalidFormatException (string msg) : base (msg) { }
|
||||
@@ -346,4 +346,37 @@ namespace GameRes
|
||||
public InvalidEncryptionScheme() : base(garStrings.MsgInvalidEncryption) { }
|
||||
public InvalidEncryptionScheme (string msg) : base (msg) { }
|
||||
}
|
||||
|
||||
public class FileSizeException : Exception
|
||||
{
|
||||
public FileSizeException () : base (garStrings.MsgFileTooLarge) { }
|
||||
public FileSizeException (string msg) : base (msg) { }
|
||||
}
|
||||
|
||||
public class InvalidFileName : Exception
|
||||
{
|
||||
public string FileName { get; set; }
|
||||
|
||||
public InvalidFileName (string filename)
|
||||
: this (filename, garStrings.MsgInvalidFileName)
|
||||
{
|
||||
}
|
||||
|
||||
public InvalidFileName (string filename, string message)
|
||||
: base (message)
|
||||
{
|
||||
FileName = filename;
|
||||
}
|
||||
|
||||
public InvalidFileName (string filename, Exception X)
|
||||
: this (filename, garStrings.MsgInvalidFileName, X)
|
||||
{
|
||||
}
|
||||
|
||||
public InvalidFileName (string filename, string message, Exception X)
|
||||
: base (message, X)
|
||||
{
|
||||
FileName = filename;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
18
GameRes/Strings/garStrings.Designer.cs
generated
18
GameRes/Strings/garStrings.Designer.cs
generated
@@ -60,6 +60,15 @@ namespace GameRes.Strings {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to File is too large.
|
||||
/// </summary>
|
||||
public static string MsgFileTooLarge {
|
||||
get {
|
||||
return ResourceManager.GetString("MsgFileTooLarge", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Inappropriate encryption scheme.
|
||||
/// </summary>
|
||||
@@ -69,6 +78,15 @@ namespace GameRes.Strings {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid file name.
|
||||
/// </summary>
|
||||
public static string MsgInvalidFileName {
|
||||
get {
|
||||
return ResourceManager.GetString("MsgInvalidFileName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Invalid file format.
|
||||
/// </summary>
|
||||
|
||||
@@ -117,9 +117,15 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="MsgFileTooLarge" xml:space="preserve">
|
||||
<value>File is too large</value>
|
||||
</data>
|
||||
<data name="MsgInvalidEncryption" xml:space="preserve">
|
||||
<value>Inappropriate encryption scheme</value>
|
||||
</data>
|
||||
<data name="MsgInvalidFileName" xml:space="preserve">
|
||||
<value>Invalid file name</value>
|
||||
</data>
|
||||
<data name="MsgInvalidFormat" xml:space="preserve">
|
||||
<value>Invalid file format</value>
|
||||
</data>
|
||||
|
||||
@@ -117,9 +117,15 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="MsgFileTooLarge" xml:space="preserve">
|
||||
<value>Слишком большой размер файла</value>
|
||||
</data>
|
||||
<data name="MsgInvalidEncryption" xml:space="preserve">
|
||||
<value>Неподходящий метод шифрования</value>
|
||||
</data>
|
||||
<data name="MsgInvalidFileName" xml:space="preserve">
|
||||
<value>Недопустимое имя файла</value>
|
||||
</data>
|
||||
<data name="MsgInvalidFormat" xml:space="preserve">
|
||||
<value>Некорректный формат файла</value>
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user