v1.3.3
This commit is contained in:
parent
ce331f4417
commit
f46240850e
Binary file not shown.
|
|
@ -1,4 +1,4 @@
|
||||||
// Version 1.3.3
|
// Version 1.3.4
|
||||||
|
|
||||||
Function TOfficeObj(n);
|
Function TOfficeObj(n);
|
||||||
Begin
|
Begin
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Version 1.3.3
|
// Version 1.3.4
|
||||||
|
|
||||||
Type TSDocxFile = Class
|
Type TSDocxFile = Class
|
||||||
///Version: V1.0 2022-09-20
|
///Version: V1.0 2022-09-20
|
||||||
|
|
@ -18,7 +18,17 @@ Type TSDocxFile = Class
|
||||||
Function Create(alias, fname); overload;
|
Function Create(alias, fname); overload;
|
||||||
Begin
|
Begin
|
||||||
init();
|
init();
|
||||||
OpenFile(alias, fname);
|
OpenFile(alias, fname, nil);
|
||||||
|
End;
|
||||||
|
|
||||||
|
///构造函数,打开已经存在的docx文件
|
||||||
|
///alias: string,文件目录别名
|
||||||
|
///fname: string,文件名
|
||||||
|
///passwd: string,密码
|
||||||
|
Function Create(alias, fname, passwd); overload;
|
||||||
|
Begin
|
||||||
|
init();
|
||||||
|
OpenFile(alias, fname, passwd);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function Destory();
|
Function Destory();
|
||||||
|
|
@ -34,11 +44,12 @@ Type TSDocxFile = Class
|
||||||
///打开docx文件
|
///打开docx文件
|
||||||
///alias: string,文件目录别名
|
///alias: string,文件目录别名
|
||||||
///fname: string,文件名
|
///fname: string,文件名
|
||||||
|
///[passwd]: string,密码
|
||||||
///返回:[err, errmsg]
|
///返回:[err, errmsg]
|
||||||
Function OpenFile(alias, fname);
|
Function OpenFile(alias, fname, passwd);
|
||||||
Begin
|
Begin
|
||||||
if not ifObj(zipfile_) then return array(-1, 'Create ZipFile object fail.');
|
if not ifObj(zipfile_) then return array(-1, 'Create ZipFile object fail.');
|
||||||
[err, errmsg] := zipfile_.Open(alias, fname);
|
[err, errmsg] := zipfile_.Open(alias, fname, passwd);
|
||||||
if err=0 then Begin
|
if err=0 then Begin
|
||||||
document_ := new docxDocument(zipfile_);
|
document_ := new docxDocument(zipfile_);
|
||||||
End;
|
End;
|
||||||
|
|
@ -57,6 +68,12 @@ Type TSDocxFile = Class
|
||||||
return array(err, errmsg);
|
return array(err, errmsg);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
///设置密码
|
||||||
|
Function SetPassword(passwd)
|
||||||
|
Begin
|
||||||
|
if not ifnil(passwd) then zipfile_.Password := passwd;
|
||||||
|
End;
|
||||||
|
|
||||||
///保存文件
|
///保存文件
|
||||||
///返回: [err, info]
|
///返回: [err, info]
|
||||||
Function Save();
|
Function Save();
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Version 1.3.3
|
// Version 1.3.4
|
||||||
|
|
||||||
Type TSExcelFile = Class
|
Type TSExcelFile = Class
|
||||||
///Version: V1.0 2022-08-08
|
///Version: V1.0 2022-08-08
|
||||||
|
|
@ -18,7 +18,17 @@ Type TSExcelFile = Class
|
||||||
Function Create(alias, fname); overload;
|
Function Create(alias, fname); overload;
|
||||||
Begin
|
Begin
|
||||||
init();
|
init();
|
||||||
OpenFile(alias, fname);
|
OpenFile(alias, fname, nil);
|
||||||
|
End;
|
||||||
|
|
||||||
|
///构造函数,打开已经存在的excel文件
|
||||||
|
///alias: string,文件目录别名
|
||||||
|
///fname: string,文件名
|
||||||
|
///passwd: string,密码
|
||||||
|
Function Create(alias, fname, passwd); overload;
|
||||||
|
Begin
|
||||||
|
init();
|
||||||
|
OpenFile(alias, fname, passwd);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
//析构函数
|
//析构函数
|
||||||
|
|
@ -35,12 +45,13 @@ Type TSExcelFile = Class
|
||||||
///打开excel文件
|
///打开excel文件
|
||||||
///alias: string,文件目录别名
|
///alias: string,文件目录别名
|
||||||
///fname: string,文件名
|
///fname: string,文件名
|
||||||
|
///[passwd]: string,密码
|
||||||
///返回: [err, errmsg]
|
///返回: [err, errmsg]
|
||||||
Function OpenFile(alias, fname);
|
Function OpenFile(alias, fname, passwd);
|
||||||
Begin
|
Begin
|
||||||
init();
|
init();
|
||||||
if not ifObj(zipfile_) then return array(-1, 'Create ZipFile object fail.');
|
if not ifObj(zipfile_) then return array(-1, 'Create ZipFile object fail.');
|
||||||
[err, errmsg] := zipfile_.Open(alias, fname);
|
[err, errmsg] := zipfile_.Open(alias, fname, passwd);
|
||||||
if err=0 then Begin
|
if err=0 then Begin
|
||||||
workbook_ := new xlsxWorkBook(zipfile_);
|
workbook_ := new xlsxWorkBook(zipfile_);
|
||||||
workbook_.Load();
|
workbook_.Load();
|
||||||
|
|
@ -69,6 +80,12 @@ Type TSExcelFile = Class
|
||||||
return zipfile_.Save();
|
return zipfile_.Save();
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
///设置密码
|
||||||
|
Function SetPassword(passwd)
|
||||||
|
Begin
|
||||||
|
if not ifnil(passwd) then zipfile_.Password := passwd;
|
||||||
|
End;
|
||||||
|
|
||||||
///打开二进制内容
|
///打开二进制内容
|
||||||
///data: 二进制数据
|
///data: 二进制数据
|
||||||
///返回: [err, errmsg]
|
///返回: [err, errmsg]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue