Commit 66414c31 authored by Jesse McGrew's avatar Jesse McGrew
Browse files

Reword "size limit exceeded" message and mention abbreviations if not yet used. [ZILF-171]

parent ff3bfecdfa09
......@@ -628,8 +628,20 @@ General switches:
}
if (length > maxLength * 1024)
Errors.ThrowSerious("file length of {0} exceeds V{1} maximum of {2}K",
length, ctx.ZVersion, maxLength);
{
string protip;
if (ctx.StringEncoder.AbbreviationCount < 96)
{
protip = " (generating text abbreviations may help; see documentation for the -ab switch)";
}
else
{
protip = "";
}
Errors.ThrowSerious("file length of {0} exceeds platform limit by {1} bytes{2}",
length, length - maxLength * 1024, protip);
}
// calculate file checksum
ctx.Position = 64;
......
......@@ -68,6 +68,8 @@ namespace Zilf.Common.StringEncoding
charset = DefaultCharset.Select(s => s.Select(UnicodeTranslation.ToZscii).ToArray()).ToArray();
}
public int AbbreviationCount => abbrevs.Count;
public bool Frozen { get; private set; }
/// <exception cref="InvalidOperationException">Too late to add abbreviations, or too many abbreviations.</exception>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment