typed files ограничения на кодировки

This commit is contained in:
Mikhalkovich Stanislav 2019-02-03 21:27:30 +03:00
parent 4ef57069ad
commit b5013332fd
6 changed files with 14 additions and 10 deletions

View file

@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "4";
public const string Build = "2";
public const string Revision = "1971";
public const string Revision = "1972";
public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;

View file

@ -1,4 +1,4 @@
%COREVERSION%=2
%REVISION%=1971
%MINOR%=4
%REVISION%=1972
%COREVERSION%=2
%MAJOR%=3

View file

@ -1 +1 @@
!define VERSION '3.4.2.1971'
!define VERSION '3.4.2.1972'

View file

@ -64,7 +64,7 @@ namespace PascalABCCompiler.SyntaxTreeConverters
cv.ProcessNode(root);
cv.Output(@"Light1.txt");*/
try
/*try
{
root.visit(new SimplePrettyPrinterVisitor(@"d:\\zzz4.txt"));
}
@ -72,7 +72,7 @@ namespace PascalABCCompiler.SyntaxTreeConverters
{
System.IO.File.AppendAllText(@"d:\\zzz4.txt",e.Message);
}
}*/
#endif

View file

@ -6323,6 +6323,8 @@ procedure Reset(f: AbstractBinaryFile; en: Encoding);
begin
if f.fi = nil then
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
if (f is TypedFile) and not en.IsSingleByte then
raise new System.IO.IOException(GetTranslation(TYPED_FILE_CANBE_OPENED_IN_SINGLEBYTE_ENCODING_ONLY));
if f.fs = nil then
begin
f.fs := new FileStream(f.fi.FullName, FileMode.Open);
@ -6349,10 +6351,10 @@ end;
procedure Rewrite(f: AbstractBinaryFile; en: Encoding);
begin
if (f is TypedFile) and not en.IsSingleByte then
raise new System.IO.IOException(GetTranslation(TYPED_FILE_CANBE_OPENED_IN_SINGLEBYTE_ENCODING_ONLY));
if f.fi = nil then
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
if (f is TypedFile) and not en.IsSingleByte then
raise new System.IO.IOException(GetTranslation(TYPED_FILE_CANBE_OPENED_IN_SINGLEBYTE_ENCODING_ONLY));
if f.fs = nil then
begin
f.fs := new FileStream(f.fi.FullName, FileMode.Create);

View file

@ -6323,6 +6323,8 @@ procedure Reset(f: AbstractBinaryFile; en: Encoding);
begin
if f.fi = nil then
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
if (f is TypedFile) and not en.IsSingleByte then
raise new System.IO.IOException(GetTranslation(TYPED_FILE_CANBE_OPENED_IN_SINGLEBYTE_ENCODING_ONLY));
if f.fs = nil then
begin
f.fs := new FileStream(f.fi.FullName, FileMode.Open);
@ -6349,10 +6351,10 @@ end;
procedure Rewrite(f: AbstractBinaryFile; en: Encoding);
begin
if (f is TypedFile) and not en.IsSingleByte then
raise new System.IO.IOException(GetTranslation(TYPED_FILE_CANBE_OPENED_IN_SINGLEBYTE_ENCODING_ONLY));
if f.fi = nil then
raise new System.IO.IOException(GetTranslation(FILE_NOT_ASSIGNED));
if (f is TypedFile) and not en.IsSingleByte then
raise new System.IO.IOException(GetTranslation(TYPED_FILE_CANBE_OPENED_IN_SINGLEBYTE_ENCODING_ONLY));
if f.fs = nil then
begin
f.fs := new FileStream(f.fi.FullName, FileMode.Create);