+ added Lua4Delphi

This commit is contained in:
Daniele Teti 2021-12-30 10:21:38 +01:00
parent f1fa322632
commit f119fb0a13
59 changed files with 9977 additions and 0 deletions

View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1,60 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{162C2B63-ECD5-4626-8E5B-156604960725}</ProjectGuid>
</PropertyGroup>
<ItemGroup>
<Projects Include="unittests\LuaBindingUnitTests.dproj">
<Dependencies/>
</Projects>
<Projects Include="samples\01\LuaEmbedded.dproj">
<Dependencies/>
</Projects>
<Projects Include="samples\02\LuaConsole.dproj">
<Dependencies/>
</Projects>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Default.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Default.Personality/>
</BorlandProject>
</ProjectExtensions>
<Target Name="LuaBindingUnitTests">
<MSBuild Projects="unittests\LuaBindingUnitTests.dproj"/>
</Target>
<Target Name="LuaBindingUnitTests:Clean">
<MSBuild Projects="unittests\LuaBindingUnitTests.dproj" Targets="Clean"/>
</Target>
<Target Name="LuaBindingUnitTests:Make">
<MSBuild Projects="unittests\LuaBindingUnitTests.dproj" Targets="Make"/>
</Target>
<Target Name="LuaEmbedded">
<MSBuild Projects="samples\01\LuaEmbedded.dproj"/>
</Target>
<Target Name="LuaEmbedded:Clean">
<MSBuild Projects="samples\01\LuaEmbedded.dproj" Targets="Clean"/>
</Target>
<Target Name="LuaEmbedded:Make">
<MSBuild Projects="samples\01\LuaEmbedded.dproj" Targets="Make"/>
</Target>
<Target Name="LuaConsole">
<MSBuild Projects="samples\02\LuaConsole.dproj"/>
</Target>
<Target Name="LuaConsole:Clean">
<MSBuild Projects="samples\02\LuaConsole.dproj" Targets="Clean"/>
</Target>
<Target Name="LuaConsole:Make">
<MSBuild Projects="samples\02\LuaConsole.dproj" Targets="Make"/>
</Target>
<Target Name="Build">
<CallTarget Targets="LuaBindingUnitTests;LuaEmbedded;LuaConsole"/>
</Target>
<Target Name="Clean">
<CallTarget Targets="LuaBindingUnitTests:Clean;LuaEmbedded:Clean;LuaConsole:Clean"/>
</Target>
<Target Name="Make">
<CallTarget Targets="LuaBindingUnitTests:Make;LuaEmbedded:Make;LuaConsole:Make"/>
</Target>
<Import Project="$(BDS)\Bin\CodeGear.Group.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Group.Targets')"/>
</Project>

View File

@ -0,0 +1,129 @@
unit LuaBind.CustomType.DataSet;
interface
uses
Data.DB,
LuaBind;
type
TLuaDataSetExposerLibraries = class(TInterfacedObject, ILuaLibraryLoader)
public
procedure Execute(ALuaEngine: TLuaEngine);
end;
procedure ExposeDataSet(ALuaEngine: TLuaEngine; ADataSet: TDataSet; AVariableName: AnsiString);
implementation
uses LuaBind.Intf;
function _dataset_eof(L: plua_state): Integer; cdecl;
var
ds: TDataSet;
s : ansistring;
begin
s := lua_typename(L, lua_type(L, - 1));
assert(lua_islightuserdata(L, - 1));
ds := TDataSet(lua_topointer(L, - 1));
if ds.Eof then
lua_pushboolean(L, 1)
else
lua_pushboolean(L, 0);
Result := 1;
end;
function _dataset_move_next(L: plua_state): Integer; cdecl;
var
ds: TDataSet;
begin
assert(lua_islightuserdata(L, - 1));
ds := TDataSet(lua_topointer(L, - 1));
ds.Next;
Result := 0;
end;
function _dataset_field_by_name(L: plua_state): Integer; cdecl;
var
fieldname: AnsiString;
ds : TDataSet;
sdata : AnsiString;
begin
assert(lua_isstring(L, - 1) = 1);
assert(lua_islightuserdata(L, - 2));
fieldname := lua_tostring(L, - 1);
lua_pop(L, 1);
ds := TDataSet(lua_topointer(L, - 1));
lua_pop(L, 1);
sdata := ds.FieldByName(String(fieldname)).AsAnsiString;
lua_pushstring(L, pansichar(sdata));
Result := 1;
end;
function _dataset_close(L: plua_state): Integer; cdecl;
var
ds: TDataSet;
begin
assert(lua_islightuserdata(L, - 1));
ds := TDataSet(lua_topointer(L, - 1));
ds.Close;
Result := 0;
end;
function _dataset_first(L: plua_state): Integer; cdecl;
var
ds: TDataSet;
begin
assert(lua_islightuserdata(L, - 1));
ds := TDataSet(lua_topointer(L, - 1));
ds.First;
Result := 0;
end;
function _dataset_is_open(L: plua_state): Integer; cdecl;
var
ds: TDataSet;
o : Integer;
begin
assert(lua_islightuserdata(L, - 1));
ds := TDataSet(lua_topointer(L, - 1));
if ds.State = dsInactive then
o := 0
else
o := 1;
lua_pushboolean(L, o);
Result := 1;
end;
function _dataset_open(L: plua_state): Integer; cdecl;
var
ds: TDataSet;
begin
assert(lua_islightuserdata(L, - 1));
ds := TDataSet(lua_topointer(L, - 1));
ds.Open;
Result := 0;
end;
procedure ExposeDataSet(ALuaEngine: TLuaEngine; ADataSet: TDataSet; AVariableName: AnsiString);
begin
ALuaEngine.DeclareGlobalLightUserData(AVariableName, ADataSet);
end;
{ TLuaDataSetExportlibraries }
procedure TLuaDataSetExposerLibraries.Execute(ALuaEngine: TLuaEngine);
begin
ALuaEngine.
DeclareGlobalFunction('_dataset_eof', @_dataset_eof).
DeclareGlobalFunction('_dataset_move_next', @_dataset_move_next).
DeclareGlobalFunction('_dataset_field_by_name', @_dataset_field_by_name).
DeclareGlobalFunction('_dataset_first', @_dataset_first).
DeclareGlobalFunction('_dataset_is_open', @_dataset_is_open).
DeclareGlobalFunction('_dataset_open', @_dataset_open).
DeclareGlobalFunction('_dataset_close', @_dataset_close);
end;
end.

View File

@ -0,0 +1,285 @@
unit LuaBind.CustomType.PODO;
interface
uses
LuaBind;
type
TLuaDelphiObjectExposerLibraries = class(TInterfacedObject, ILuaLibraryLoader)
public
procedure Execute(ALuaEngine: TLuaEngine);
end;
procedure ExposeDelphiObject(ALuaEngine: TLuaEngine; AObject: TObject;
AVariableName: AnsiString);
implementation
uses
LuaBind.Intf,
System.Rtti,
System.SysUtils,
System.TypInfo;
function InvokeMethod(Obj: TObject; MethodName: AnsiString; params: TArray<TValue>): TValue;
var
ctx : TRTTIContext;
_type: TRttiType;
_m : TRttiMethod;
_p : TRttiProperty;
_pars: TArray<TRttiParameter>;
par : TRttiParameter;
i : Integer;
begin
ctx := TRTTIContext.Create;
try
_type := ctx.GetType(Obj.ClassInfo);
_m := _type.GetMethod(MethodName);
if _m = nil then
begin
_p := _type.GetProperty(MethodName);
if _p = nil then
raise Exception.CreateFmt('Method or property [%s] not found', [MethodName]);
Result := _p.GetValue(Obj);
end
else
begin
_pars := _m.GetParameters;
i := 0;
for par in _pars do
begin
if par.ParamType.TypeKind in [tkInteger, tkInt64] then
begin
if params[i].Kind in [tkFloat] then
params[i] := Trunc(params[i].AsExtended);
end;
end;
Result := _m.Invoke(Obj, params);
end;
finally
ctx.Free;
end;
end;
procedure SetProperty(Obj: TObject; const PropertyName: string;
const Value: TValue);
var
Prop : TRttiProperty;
ARttiType: TRttiType;
ctx : TRTTIContext;
begin
ARttiType := ctx.GetType(Obj.ClassType);
if not Assigned(ARttiType) then
raise Exception.CreateFmt('Cannot get RTTI for type [%s]',
[ARttiType.ToString]);
Prop := ARttiType.GetProperty(PropertyName);
if not Assigned(Prop) then
raise Exception.CreateFmt('Cannot get RTTI for property [%s.%s]',
[ARttiType.ToString, PropertyName]);
if Prop.IsWritable then
begin
if Prop.PropertyType.TypeKind in [tkInteger, tkInt64] then
Prop.SetValue(Obj, Trunc(Value.AsExtended))
else
Prop.SetValue(Obj, Value);
end
else
raise Exception.CreateFmt('Property is not writeable [%s.%s]',
[ARttiType.ToString, PropertyName]);
end;
function _delphi_is_a_property(L: Plua_State): Integer; cdecl;
var
lvt : TLuaValueType;
PropertyName: string;
Obj : TObject;
propname : TValue;
ctx : TRTTIContext;
_rttitype : TRttiType;
begin
Result := 0;
try
assert(lua_isstring(L, - 1) = 1);
assert(lua_islightuserdata(L, - 2));
PropertyName := TLuaValue.PopTValueFromStack(L).AsString;
Obj := TLuaValue.PopTValueFromStack(L).AsObject;
ctx := TRTTIContext.Create;
try
_rttitype := ctx.GetType(Obj.ClassType);
if Assigned(_rttitype.GetProperty(PropertyName)) then
TLuaUtils.PushTValue(L, true)
else
TLuaUtils.PushTValue(L, false);
finally
ctx.Free;
end;
Result := 1;
except
on E: Exception do
begin
lua_pushstring(L, PAnsiChar(UTF8Encode(E.ClassName + ' ' + E.Message)));
lua_error(L);
end;
end;
end;
// allows to create a delphi object using a parametersless constructor
function _delphi_create_object(L: Plua_State): Integer; cdecl;
var
ParCount : Integer;
_classname: string;
ctx : TRTTIContext;
_type : TRttiType;
Obj : TObject;
_m : TRttiMethod;
_mm : TRttiMethod;
begin
Result := 0;
try
ParCount := lua_gettop(L) - 1;
if ParCount > 0 then
raise ELuaConstructorException.Create('Constructor parameters are not supported');
// Create the object
_classname := TLuaValue.PopTValueFromStack(L).AsString;
_type := ctx.FindType(_classname);
if _type = nil then
raise ELuaException.Create('Cannot find type ' + _classname +
'. Is it a Fully Qualified Name?');
_m := nil;
for _mm in _type.AsInstance.GetDeclaredMethods do
if _mm.IsConstructor and (Length(_mm.GetParameters) = 0) then
begin
_m := _mm;
Break;
end;
if Assigned(_m) then
Obj := _m.Invoke(_type.AsInstance.MetaclassType, []).AsObject
else
raise ELuaConstructorException.Create
('Cannot find a suitable constructor for ' + _type.AsInstance.QualifiedName);
TLuaUtils.PushTValue(L, Obj);
Result := 1;
except
on E: Exception do
begin
lua_pushstring(L, PAnsiChar(UTF8Encode(E.ClassName + ' ' + E.Message)));
lua_error(L);
end;
end;
end;
function _delphi_set_property(L: Plua_State): Integer; cdecl;
var
Value : TValue;
PropertyName: AnsiString;
Obj : TObject;
begin
Result := 0;
try
assert(lua_isstring(L, - 2) = 1);
assert(lua_islightuserdata(L, - 3));
Value := TLuaValue.PopTValueFromStack(L);
PropertyName := TLuaValue.PopTValueFromStack(L).AsString;
Obj := TLuaValue.PopTValueFromStack(L).AsObject;
SetProperty(Obj, PropertyName, Value);
Result := 0;
except
on E: Exception do
begin
lua_pushstring(L, PAnsiChar(UTF8Encode(E.ClassName + ' ' + E.Message)));
lua_error(L);
end;
end;
end;
function _delphi_call_method(L: Plua_State): Integer; cdecl;
var
s : AnsiString;
params : TArray<TValue>;
maxindex : Integer;
i : Integer;
LuaValueType: TLuaValueType;
MethodName : AnsiString;
Obj : TObject;
v : TValue;
begin
Result := 0;
try
assert(lua_istable(L, - 1));
assert(lua_isstring(L, - 2) = 1);
assert(lua_islightuserdata(L, - 3));
lua_getfield(L, - 1, 'maxindex');
maxindex := lua_tointeger(L, - 1);
lua_pop(L, 1);
if maxindex > - 1 then
begin
SetLength(params, maxindex + 1);
for i := 0 to maxindex do
begin
s := '_' + IntToStr(i);
lua_getfield(L, - 1, PAnsiChar(s));
LuaValueType := TLuaValue.GetLuaValueType(L, - 1);
params[i] := TLuaValue.GetTValueFromLuaValueType(LuaValueType, L, - 1);
lua_pop(L, 1);
end;
end;
lua_pop(L, 1); // pop the table
// read the method name
LuaValueType := TLuaValue.GetLuaValueType(L, - 1);
if LuaValueType <> lvtString then
raise ELuaException.Create('Bad error! Cannot find the method name');
MethodName := TLuaValue.GetTValueFromLuaValueType(LuaValueType, L, - 1).AsString;
lua_pop(L, 1); // remove the methodname
// read the pointer
LuaValueType := TLuaValue.GetLuaValueType(L, - 1);
if LuaValueType <> lvtLightUserData then
raise ELuaException.Create('Bad error! Cannot find the object ref');
Obj := TLuaValue.GetTValueFromLuaValueType(LuaValueType, L, - 1).AsObject;
lua_pop(L, 1); // remove the lightuserdata
v := InvokeMethod(Obj, MethodName, params);
if v.IsEmpty then
Result := 0
else
begin
Result := 1;
TLuaUtils.PushTValue(L, v);
end;
except
on E: Exception do
begin
lua_pushstring(L, PAnsiChar(UTF8Encode(E.ClassName + ' ' + E.Message)));
lua_error(L);
end;
end;
end;
procedure ExposeDelphiObject(ALuaEngine: TLuaEngine;
AObject:
TObject;
AVariableName:
AnsiString);
begin
ALuaEngine.DeclareGlobalLightUserData(AVariableName, AObject);
end;
{ TLuaDelphiObjectExposerLibraries }
procedure TLuaDelphiObjectExposerLibraries.Execute(ALuaEngine: TLuaEngine);
begin
inherited;
ALuaEngine.
DeclareGlobalFunction('_delphi_call_method', @_delphi_call_method).
DeclareGlobalFunction('_delphi_create_object', @_delphi_create_object).
DeclareGlobalFunction('_delphi_is_a_property', @_delphi_is_a_property).
DeclareGlobalFunction('_delphi_set_property', @_delphi_set_property);
end;
end.

View File

@ -0,0 +1,95 @@
unit LuaBind.CustomType.UserType;
interface
uses
LuaBind;
type
TLuaMyTest = class(TInterfacedObject, ILuaLibraryLoader)
public
procedure Execute(ALuaEngine: TLuaEngine);
end;
procedure ExposeMyTest(ALuaEngine: TLuaEngine; AObject: TObject;
AVariableName: AnsiString);
implementation
uses
LuaBind.Intf,
System.Classes;
var
MyTest: TArray<luaL_Reg>;
{ TLuaMyTest }
type
PStringList = ^TStringlist;
function _NewObject(L: Plua_State): Integer; cdecl;
var
psl: PStringList;
begin
if lua_gettop(L) <> 0 then
Exit(luaL_error(L, PAnsiChar('Got arguments expected no arguments')));
psl := lua_newuserdata(L, SizeOf(PStringList));
psl^ := TStringlist.Create;
lua_getglobal(L, PAnsiChar('TStringList'));
lua_setmetatable(L, - 2);
Result := 1;
end;
function _TStringList_free(L: Plua_State): Integer; cdecl;
var
s: string;
p: PStringList;
begin
if (lua_gettop(L) <> 1) or (lua_isuserdata(L, - 1) = 0) then
Exit(luaL_error(L, PAnsiChar('No params allowed or no valid userdata')));
p := PStringList(lua_touserdata(L, - 1));
lua_pop(L, 1);
p^.Free;
p^ := nil;
Result := 0;
end;
function _TStringList_add(L: Plua_State): Integer; cdecl;
var
s: string;
p: PStringList;
begin
if lua_gettop(L) <> 2 then
Exit(luaL_error(L, PAnsiChar('Wrong number of parameters: 2 expected')));
s := TLuaValue.PopTValueFromStack(L).AsString;
p := PStringList(lua_touserdata(L, - 1));
lua_pop(L, 1);
p^.Add(s);
Result := 0;
end;
procedure TLuaMyTest.Execute(ALuaEngine: TLuaEngine);
begin
SetLength(MyTest, 4);
MyTest[0].name := PAnsiChar('new');
MyTest[0].func := @_NewObject;
MyTest[1].name := PAnsiChar('add');
MyTest[1].func := @_TStringList_add;
MyTest[2].name := PAnsiChar('__gc');
MyTest[2].func := @_TStringList_free;
MyTest[3].name := nil;
MyTest[3].func := nil;
luaL_register(ALuaEngine.GetRawLuaState, 'TStringList', @MyTest[0]);
lua_pushvalue(ALuaEngine.GetRawLuaState, - 1);
lua_setfield(ALuaEngine.GetRawLuaState, - 2, '__index');
end;
procedure ExposeMyTest(ALuaEngine: TLuaEngine; AObject: TObject;
AVariableName: AnsiString);
begin
end;
end.

View File

@ -0,0 +1,131 @@
unit LuaBind.DelphiObjects;
interface
uses
LuaBind.Intf;
function _delphi_call_method(const L: Plua_State): Integer; cdecl;
implementation
uses
System.Rtti,
LuaBind,
System.SysUtils,
System.TypInfo;
function InvokeMethod(Obj: TObject; MethodName: AnsiString; params: TArray<TValue>): TValue;
var
ctx: TRTTIContext;
_type: TRttiType;
_m: TRttiMethod;
_p: TRttiProperty;
_pars: TArray<TRttiParameter>;
par: TRttiParameter;
i: Integer;
LMethodName: String;
begin
LMethodName := String(MethodName);
ctx := TRTTIContext.Create;
try
_type := ctx.GetType(Obj.ClassInfo);
_m := _type.GetMethod(LMethodName);
if _m = nil then
begin
_p := _type.GetProperty(LMethodName);
if _p = nil then
raise Exception.CreateFmt('Method or property [%s] not found', [LMethodName]);
Result := _p.GetValue(Obj);
end
else
begin
_pars := _m.GetParameters;
i := 0;
for par in _pars do
begin
if par.ParamType.TypeKind in [tkInteger, tkInt64] then
begin
if params[i].Kind in [tkFloat] then
params[i] := Trunc(params[i].AsExtended);
end;
end;
Result := _m.Invoke(Obj, params);
end;
finally
ctx.Free;
end;
end;
function _delphi_call_method(const L: Plua_State): Integer; cdecl;
var
s: AnsiString;
params: TArray<TValue>;
maxindex: Integer;
i: Integer;
LuaValueType: TLuaValueType;
MethodName: AnsiString;
Obj: TObject;
v: TValue;
begin
Result := 0;
try
Result := lua_gettop(L);
assert(lua_istable(L, 1));
assert(lua_isstring(L, 2) = 1);
MethodName := lua_tostring(L, 2);
// assert(lua_islightuserdata(L, - 3));
// lua_getfield(L, - 1, 'maxindex');
// maxindex := lua_tointeger(L, - 1); //decomment this?7
maxindex := 0; { TODO -oOwner -cGeneral : this method is in alpha stage }
lua_pop(L, 1);
if maxindex > - 1 then
begin
SetLength(params, maxindex + 1);
for i := 0 to maxindex do
begin
s := '_' + AnsiString(IntToStr(i));
lua_getfield(L, - 1, PAnsiChar(s));
LuaValueType := TLuaValue.GetLuaValueType(L, - 1);
params[i] := TLuaValue.GetTValueFromLuaValueType(LuaValueType, L, - 1);
lua_pop(L, 1);
end;
end;
lua_pop(L, 1); // pop the table
// read the method name
LuaValueType := TLuaValue.GetLuaValueType(L, - 1);
if LuaValueType <> lvtString then
raise ELuaException.Create('Bad error! Cannot find the method name');
MethodName := AnsiString(TLuaValue.GetTValueFromLuaValueType(LuaValueType, L, - 1).AsString);
lua_pop(L, 1); // remove the methodname
// read the pointer
LuaValueType := TLuaValue.GetLuaValueType(L, - 1);
if LuaValueType <> lvtLightUserData then
raise ELuaException.Create('Bad error! Cannot find the object ref');
Obj := TLuaValue.GetTValueFromLuaValueType(LuaValueType, L, - 1).AsObject;
lua_pop(L, 1); // remove the lightuserdata
v := InvokeMethod(Obj, MethodName, params);
if v.IsEmpty then
Result := 0
else
begin
Result := 1;
TLuaUtils.PushTValue(L, v);
end;
except
on E: Exception do
begin
lua_pushstring(L, PAnsiChar(UTF8Encode(E.ClassName + ' ' + E.Message)));
lua_error(L);
end;
end;
end;
end.

View File

@ -0,0 +1,388 @@
{$WARNINGS OFF}
unit LuaBind.Filters.Text;
interface
uses
System.SysUtils;
type
TLuaEmbeddedTextFilter = class
private
FTemplateCode: string;
FLuaCode: string;
FCurrCharIndex: int64;
FOutputStringBuilder: TStringBuilder;
FCurrChar: Char;
FOutputFunction: string;
procedure SetLuaCode(const Value: string);
procedure SetTemplateCode(const Value: string);
procedure NextChar;
function LookAhead(Offset: Integer): Char;
procedure PushToOutput(const AChar: Char);
procedure SetOutputFunction(const Value: string);
public
constructor Create;
procedure Execute;
property TemplateCode: string read FTemplateCode write SetTemplateCode;
property LuaCode: string read FLuaCode write SetLuaCode;
property OutputFunction: string read FOutputFunction write SetOutputFunction;
// helpers
class function ExecuteWithResult(eLuaScript: AnsiString; const ParamNames: array of string;
const ParamValues: array of string): string;
end;
implementation
uses
LuaBind.Intf,
System.Classes,
LuaBind;
threadvar _OutputBuffer: TStringBuilder;
function __lua_stream_out(L: Plua_State): Integer; cdecl;
var
s: string;
o: TObject;
stream: TStreamWriter;
begin
if lua_gettop(L) <> 2 then
begin
luaL_error(L, PAnsiChar('Wrong parameters number'));
Exit(0);
end;
if lua_isstring(L, - 1) = 1 then
begin
s := lua_tostring(L, - 1);
lua_pop(L, 1);
end
else
begin
luaL_error(L, PAnsiChar('Type mismatch, expected String'));
Exit(0);
end;
if lua_islightuserdata(L, - 1) then
begin
o := TObject(lua_topointer(L, - 1));
lua_pop(L, 1);
end
else
begin
luaL_error(L, PAnsiChar('Type mismatch, expected LightUserData'));
Exit(0);
end;
stream := o as TStreamWriter;
stream.Write(s);
Result := 0;
end;
{ TLuaEmbeddedTextFilter }
constructor TLuaEmbeddedTextFilter.Create;
begin
inherited;
FOutputFunction := 'response:out';
end;
procedure TLuaEmbeddedTextFilter.Execute;
var
StartCode: Boolean;
State: Integer;
const
PARSER_VERBATIM_TEXT = $8000;
PARSER_VERBATIM_CODE = PARSER_VERBATIM_TEXT + 1;
PARSER_VERBATIM_EXPRESSION = PARSER_VERBATIM_CODE + 1;
PARSER_VERBATIM_CODE_STRING_SINGLE_QUOTED = PARSER_VERBATIM_EXPRESSION + 1;
PARSER_VERBATIM_CODE_STRING_DOUBLE_QUOTED = PARSER_VERBATIM_CODE_STRING_SINGLE_QUOTED + 1;
begin
FCurrCharIndex := 0;
State := PARSER_VERBATIM_TEXT;
NextChar;
FOutputStringBuilder := TStringBuilder.Create;
try
StartCode := True;
while FCurrChar <> #0 do
begin
case State of
PARSER_VERBATIM_TEXT:
begin
if FCurrChar = '<' then
begin
if (LookAhead(1) = '?') and (LookAhead(2) = 'l') and (LookAhead(3) = 'u') and
(LookAhead(4) = 'a') then
begin
NextChar; // ?
NextChar; // l
NextChar; // u
NextChar; // a
NextChar; // _
if not StartCode then
FOutputStringBuilder.Append(']]');
StartCode := False;
if FCurrChar = '=' then // expression
begin
State := PARSER_VERBATIM_EXPRESSION;
FOutputStringBuilder.Append(FOutputFunction + '(');
NextChar;
end
else
State := PARSER_VERBATIM_CODE;
end
else
begin
if StartCode then
begin
StartCode := False;
FOutputStringBuilder.Append(FOutputFunction + ' [[' + sLineBreak);
end;
PushToOutput('<');
NextChar;
end;
end
else // FCurrChar <> '<'
begin
if StartCode then
begin
StartCode := False;
FOutputStringBuilder.Append(FOutputFunction + ' [[' + sLineBreak);
end;
PushToOutput(FCurrChar);
NextChar;
end;
end;
PARSER_VERBATIM_CODE_STRING_SINGLE_QUOTED:
begin
if FCurrChar = '''' then
begin
State := PARSER_VERBATIM_CODE;
PushToOutput('''');
NextChar;
end
else if (FCurrChar = '\') and (LookAhead(1) = '''') then
begin
PushToOutput('\');
PushToOutput('''');
NextChar;
NextChar;
end
else
begin
PushToOutput(FCurrChar);
NextChar;
end;
end;
PARSER_VERBATIM_CODE_STRING_DOUBLE_QUOTED:
begin
if FCurrChar = '"' then
begin
State := PARSER_VERBATIM_CODE;
PushToOutput('"');
NextChar;
end
else if (FCurrChar = '\') and (LookAhead(1) = '"') then
begin
PushToOutput('\');
PushToOutput('"');
NextChar;
NextChar;
end
else
begin
PushToOutput(FCurrChar);
NextChar;
end;
end;
PARSER_VERBATIM_CODE:
begin
if FCurrChar = '''' then
begin
State := PARSER_VERBATIM_CODE_STRING_SINGLE_QUOTED;
PushToOutput('''');
NextChar;
end
else if FCurrChar = '"' then
begin
State := PARSER_VERBATIM_CODE_STRING_DOUBLE_QUOTED;
PushToOutput('"');
NextChar;
end
else if FCurrChar = '?' then
begin
if (LookAhead(1) = '>') then
begin
NextChar; // >
NextChar; // _
FOutputStringBuilder.Append(sLineBreak + FOutputFunction + ' [[' + sLineBreak);
State := PARSER_VERBATIM_TEXT;
end
else
begin
PushToOutput('?');
NextChar;
end;
end
else // FCurrChar <> '?'
begin
PushToOutput(FCurrChar);
NextChar;
end;
end; // PARSER_VERBATIM_CODE
PARSER_VERBATIM_EXPRESSION:
begin
if FCurrChar = '?' then
begin
if (LookAhead(1) = '>') then
begin
NextChar; // >
NextChar; // _
FOutputStringBuilder.Append(')');
FOutputStringBuilder.Append(sLineBreak + FOutputFunction + ' [[' + sLineBreak);
State := PARSER_VERBATIM_TEXT;
end
else
begin
PushToOutput('?');
NextChar;
end;
end
else // FCurrChar <> '?'
begin
PushToOutput(FCurrChar);
NextChar;
end;
end;
end; // case
end; // while
if (State = PARSER_VERBATIM_TEXT) and (not StartCode) then
FOutputStringBuilder.Append(']]')
else if not StartCode then
raise ELuaFilterException.Create('Expected closing Lua tag');
FLuaCode := FOutputStringBuilder.ToString;
finally
FOutputStringBuilder.Free;
end;
end;
function __lua_out(L: Plua_State): Integer; cdecl;
var
s: string;
begin
if lua_gettop(L) <> 1 then
begin
luaL_error(L, PAnsiChar('Wrong parameters number'));
Exit(0);
end;
if lua_isstring(L, - 1) = 1 then
begin
s := lua_tostring(L, - 1);
lua_pop(L, 1);
end
else
begin
luaL_error(L, PAnsiChar('Type mismatch, expected String'));
Exit(0);
end;
_OutputBuffer.Append(s);
Result := 0;
end;
class function TLuaEmbeddedTextFilter.ExecuteWithResult(eLuaScript: AnsiString;
const ParamNames, ParamValues: array of string): string;
var
LuaFilter: TLuaEmbeddedTextFilter;
L: TLuaEngine;
I: Integer;
function GetOutputBuffer: TStringBuilder;
begin
Result := _OutputBuffer;
end;
begin
if Length(ParamNames) <> Length(ParamValues) then
raise ELuaRuntimeException.Create('Number of params names and param values is not equals');
LuaFilter := TLuaEmbeddedTextFilter.Create;
try
LuaFilter.OutputFunction := '_out';
LuaFilter.TemplateCode := eLuaScript;
LuaFilter.Execute;
_OutputBuffer := TStringBuilder.Create;
try
L := TLuaEngine.Create;
try
for I := 0 to Length(ParamNames) - 1 do
L.DeclareGlobalString(ParamNames[I], ParamValues[I]);
L.DeclareGlobalFunction('_out', @__lua_out);
L.LoadScript(LuaFilter.LuaCode);
L.Execute;
Result := _OutputBuffer.ToString;
finally
L.Free;
end;
finally
FreeAndNil(_OutputBuffer);
end;
finally
LuaFilter.Free;
end;
end;
function TLuaEmbeddedTextFilter.LookAhead(Offset: Integer): Char;
begin
if FCurrCharIndex + Offset <= Length(FTemplateCode) then
Result := FTemplateCode[FCurrCharIndex + Offset]
else
Result := #0;
end;
procedure TLuaEmbeddedTextFilter.NextChar;
begin
if FCurrCharIndex = Length(FTemplateCode) then
begin
FCurrCharIndex := - 1;
FCurrChar := #0;
end
else
begin
FCurrCharIndex := FCurrCharIndex + 1;
FCurrChar := FTemplateCode[FCurrCharIndex];
end;
end;
procedure TLuaEmbeddedTextFilter.PushToOutput(const AChar: Char);
begin
FOutputStringBuilder.Append(AChar);
end;
procedure TLuaEmbeddedTextFilter.SetLuaCode(const Value: string);
begin
FLuaCode := Value;
end;
procedure TLuaEmbeddedTextFilter.SetOutputFunction(const Value: string);
begin
FOutputFunction := Value;
end;
procedure TLuaEmbeddedTextFilter.SetTemplateCode(const Value: string);
begin
FTemplateCode := Value;
end;
end.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,903 @@
{$WARNINGS OFF}
unit LuaBind;
interface
uses LuaBind.Intf,
System.Classes,
System.SysUtils,
System.Rtti,
System.Generics.Collections;
type
ELuaException = class(Exception)
end;
ELuaRuntimeException = class(ELuaException)
end;
ELuaConstructorException = class(ELuaException)
end;
ELuaSyntaxError = class(ELuaException)
end;
ELuaFilterException = class(ELuaSyntaxError)
end;
ILuaValue = interface
['{8621BAD3-B847-4176-937F-2CD016BBE13E}']
/// ///
function IsNil: boolean;
function IsNumber: boolean;
function IsInteger: boolean;
function IsString: boolean;
function IsBoolean: boolean;
function IsLightUserData: boolean;
/// ///
function GetAsNumber: Double;
function GetAsInteger: Integer;
function GetAsString: AnsiString;
function GetAsBoolean: boolean;
function GetAsLightUserData: Pointer;
end;
TLuaValueType = (lvtNil, lvtNumber, lvtInteger, lvtString, lvtBoolean,
lvtLightUserData, lvtTable, lvtFunction, lvtUserData, lvtThread);
TLuaValue = class(TInterfacedObject, ILuaValue)
strict private
FLuaValueType: TLuaValueType;
strict private
protected
/// ///
function IsNil: boolean;
function IsNumber: boolean;
function IsInteger: boolean;
function IsString: boolean;
function IsBoolean: boolean;
function IsLightUserData: boolean;
/// ///
function GetAsNumber: Double;
function GetAsInteger: Integer;
function GetAsString: AnsiString;
function GetAsBoolean: boolean;
function GetAsLightUserData: Pointer;
private
procedure CheckType(LuaValueType: TLuaValueType);
protected
FValue: TValue;
constructor Create(LuaState: Plua_State; StackIndex: Integer);
public
class function GetAsLuaTable(LuaState: Plua_State;
StackIndex: Integer): TValue;
class function GetLuaValueType(LuaState: Plua_State; StackIndex: Integer)
: TLuaValueType;
class function GetTValueFromLuaValueType(LuaValueType: TLuaValueType;
LuaState: Plua_State; StackIndex: Integer): TValue; static;
class function PopTValueFromStack(LuaState: Plua_State): TValue; static;
end;
ILuaLibraryLoader = interface;
TLuaEngine = class
strict private
procedure CheckLuaError(const r: Integer);
private
procedure InternalDeclareTable(AObject: TObject);
protected
LState: Plua_State;
procedure InitLua;
procedure CloseLua;
public
constructor Create; overload; virtual;
constructor Create(const AScript: string); overload; virtual;
destructor Destroy; override;
function GetRawLuaState: Plua_State;
procedure Reset;
procedure LoadScript(const AScript: AnsiString); overload;
procedure LoadScript(const AStream: TStream;
AOwnStream: boolean = true); overload;
procedure LoadFromFile(const AFileName: AnsiString);
procedure Execute;
procedure ExecuteFile(const AFileName: AnsiString);
procedure ExecuteScript(const AScript: AnsiString);
// PUSH methods for simple types
function DeclareGlobalNil(AName: AnsiString): TLuaEngine;
function DeclareGlobalNumber(AName: AnsiString; AValue: Double): TLuaEngine;
function DeclareGlobalInteger(AName: AnsiString; AValue: Integer)
: TLuaEngine;
function DeclareGlobalString(AName: AnsiString; AValue: AnsiString)
: TLuaEngine;
function DeclareGlobalBoolean(AName: AnsiString; AValue: boolean)
: TLuaEngine;
function DeclareGlobalLightUserData(AName: AnsiString; AValue: Pointer)
: TLuaEngine;
function DeclareGlobalUserData(AName: AnsiString; AValue: Pointer)
: TLuaEngine;
// PUSH complex types
function DeclareGlobalFunction(AName: AnsiString; AFunction: lua_CFunction)
: TLuaEngine;
function DeclareGlobalDelphiObjectAsTable(AObject: TObject;
AVariableName: string): TLuaEngine;
// Helpers to PUSH specific types coping properties or data into Lua tables
function DeclareTable(const ATableName: AnsiString; AKeys: array of string;
AValues: array of string): TLuaEngine; overload;
function DeclareTable(const ATableName: AnsiString; AKeys: array of Integer;
AValues: array of string): TLuaEngine; overload;
function DeclareTable(const ATableName: AnsiString;
ADictionary: TDictionary<TValue, TValue>): TLuaEngine; overload;
function DeclareTable(const ATableName: AnsiString;
ADictionary: TDictionary<string, string>): TLuaEngine; overload;
function DeclareTable(const ATableName: AnsiString; AObject: TObject)
: TLuaEngine; overload;
function DeclareTable(const ATableName: AnsiString; __self: Pointer;
AFunctions: TDictionary<string, lua_CFunction>;
AData: TDictionary<string, TValue>
): TLuaEngine; overload;
// GET methods for simple types
function GetGlobal(AName: AnsiString): ILuaValue;
// External load libraries
procedure LoadExternalLibraries(ALuaLibraryLoader: ILuaLibraryLoader);
// function
function ExecuteFunction(FunctionName: AnsiString;
const Params: array of TValue): TValue;
// helpers
class function ExecuteWithResult(AScript: AnsiString;
const ParamNames: array of string;
const ParamValues: array of string): string;
end;
ILuaLibraryLoader = interface
['{46A7894C-DDA8-4E15-95EB-B52463341FF1}']
procedure Execute(ALuaEngine: TLuaEngine);
end;
TLuaUtils = class sealed
public
class procedure PushTValue(L: Plua_State; Value: TValue); static;
end;
implementation
uses
typinfo,
LuaBind.DelphiObjects;
function internal_call_method(LState: Plua_State): Integer; cdecl;
begin
// raise Exception.Create('Error Message');
lua_pop(LState, 1);
lua_pop(LState, 1);
lua_pushcfunction(LState, @_delphi_call_method);
Result := 1;
// Result := lua_gettop(LState);
// for I := 1 to Result do
// begin
// v := TLuaValue.PopTValueFromStack(LState);
// end
// // Result := _delphi_call_method(LState)
end;
class procedure TLuaUtils.PushTValue(L: Plua_State; Value: TValue);
var
utf8s: RawByteString;
begin
case Value.Kind of
tkUnknown, tkChar, tkSet, tkMethod, tkVariant, tkArray, tkProcedure,
tkRecord, tkInterface, tkDynArray, tkClassRef:
begin
lua_pushnil(L);
// raise Exception.Create('Unsupported return type: ' + Value.ToString);
end;
tkInteger:
lua_pushinteger(L, Value.AsInteger);
tkEnumeration:
begin
if Value.IsType<boolean> then
begin
if Value.AsBoolean then
lua_pushboolean(L, 1)
else
lua_pushboolean(L, 0);
end
else
lua_pushinteger(L, Value.AsInteger);
end;
tkFloat:
lua_pushnumber(L, Value.AsExtended);
tkString, tkWChar, tkLString, tkWString, tkUString:
begin
utf8s := UTF8Encode(Value.AsString);
lua_pushstring(L, PAnsiChar(utf8s));
end;
tkClass:
lua_pushlightuserdata(L, Pointer(Value.AsObject));
tkInt64:
lua_pushnumber(L, Value.AsInt64);
tkPointer:
lua_pushlightuserdata(L, Pointer(Value.AsObject));
end;
end;
{ TLuaEngine }
constructor TLuaEngine.Create;
begin
inherited Create;
InitLua;
end;
procedure TLuaEngine.CloseLua;
begin
lua_close(LState);
end;
constructor TLuaEngine.Create(const AScript: string);
begin
Create;
LoadScript(AScript);
end;
function TLuaEngine.DeclareGlobalBoolean(AName: AnsiString; AValue: boolean)
: TLuaEngine;
var
b: Integer;
begin
if AValue then
b := 1
else
b := 0;
lua_pushboolean(LState, b);
lua_setglobal(LState, PAnsiChar(AName));
Result := Self;
end;
function TLuaEngine.DeclareGlobalDelphiObjectAsTable(AObject: TObject;
AVariableName: string): TLuaEngine;
begin
// lua_createtable(L, 0, 0);
// lua_createtable(L, 0, 1);
assert(lua_isnil(LState, -1));
lua_newtable(LState);
assert(lua_istable(LState, -1));
lua_newtable(LState);
lua_pushcfunction(LState, @internal_call_method);
lua_setfield(LState, -2, '__index');
lua_setmetatable(LState, -2);
lua_setglobal(LState, PAnsiChar(AnsiString(AVariableName)));
// http://stackoverflow.com/questions/3449759/lua-c-api-and-metatable-functions
// lua_newtable(LState);
// lua_pushstring(LState, PAnsiChar('__handle__'));
// lua_pushlightuserdata(LState, Pointer(AObject));
// lua_settable(LState, - 3);
// {
// for prop in ctx.GetType(AObject.ClassInfo).GetProperties do
// begin
// v := prop.GetValue(AObject);
// if v.Kind = tkUnknown then
// continue;
// k := prop.Name;
// TLuaUtils.PushTValue(LState, k);
// TLuaUtils.PushTValue(LState, v);
// lua_settable(LState, - 3);
// end;
//
// for method in ctx.GetType(AObject.ClassInfo).GetMethods
// begin
// if not (method.Visibility in [mvPublic, mvPublished]) then
// continue;
// k := method.Name;
// TLuaUtils.PushTValue(LState, k);
// lua_pushcfunction(LState, @internal_call_method);
// lua_settable(LState, - 3);
// end;
// }
//
// lua_setglobal(LState, PAnsiChar(AnsiString(AVariableName)));
//
// // define metatable
// // lua_createtable(LState, 0, 0);
// lua_createtable(LState, 0, 1);
// lua_pushcfunction(LState, @internal_call_method);
// lua_setfield(LState, - 2, AnsiString('__index'));
// lua_setmetatable(LState, - 2);
// lua_setglobal(LState, PAnsiChar(AnsiString(AVariableName)));
end;
function TLuaEngine.DeclareGlobalFunction(AName: AnsiString;
AFunction: lua_CFunction): TLuaEngine;
begin
lua_pushcfunction(LState, AFunction);
lua_setglobal(LState, PAnsiChar(AName));
Result := Self;
end;
function TLuaEngine.DeclareGlobalInteger(AName: AnsiString; AValue: Integer)
: TLuaEngine;
begin
lua_pushinteger(LState, AValue);
lua_setglobal(LState, PAnsiChar(AName));
Result := Self;
end;
function TLuaEngine.DeclareGlobalLightUserData(AName: AnsiString;
AValue: Pointer): TLuaEngine;
begin
lua_pushlightuserdata(LState, AValue);
lua_setglobal(LState, PAnsiChar(AName));
Result := Self;
end;
function TLuaEngine.DeclareGlobalNil(AName: AnsiString): TLuaEngine;
begin
lua_pushnil(LState);
lua_setglobal(LState, PAnsiChar(AName));
Result := Self;
end;
function TLuaEngine.DeclareGlobalNumber(AName: AnsiString; AValue: Double)
: TLuaEngine;
begin
lua_pushnumber(LState, AValue);
lua_setglobal(LState, PAnsiChar(AName));
Result := Self;
end;
function TLuaEngine.DeclareGlobalString(AName: AnsiString; AValue: AnsiString)
: TLuaEngine;
begin
lua_pushstring(LState, PAnsiChar(AValue));
lua_setglobal(LState, PAnsiChar(AName));
Result := Self;
end;
function TLuaEngine.DeclareGlobalUserData(AName: AnsiString; AValue: Pointer)
: TLuaEngine;
begin
raise ELuaException.Create('Not implemented');
Result := Self;
end;
function TLuaEngine.DeclareTable(const ATableName: AnsiString;
AKeys: array of Integer; AValues: array of string): TLuaEngine;
var
I: Integer;
k: Integer;
v: string;
begin
lua_newtable(LState);
for I := 0 to high(AKeys) do
begin
k := AKeys[I];
v := AValues[I];
TLuaUtils.PushTValue(LState, k);
TLuaUtils.PushTValue(LState, v);
lua_settable(LState, -3);
end;
lua_setglobal(LState, PAnsiChar(ATableName));
Result := Self;
end;
function TLuaEngine.DeclareTable(const ATableName: AnsiString;
ADictionary: TDictionary<TValue, TValue>): TLuaEngine;
var
key: TValue;
begin
lua_newtable(LState);
for key in ADictionary.Keys do
begin
TLuaUtils.PushTValue(LState, key);
TLuaUtils.PushTValue(LState, ADictionary.Items[key]);
lua_settable(LState, -3);
end;
lua_setglobal(LState, PAnsiChar(ATableName));
Result := Self;
end;
function TLuaEngine.DeclareTable(const ATableName: AnsiString;
ADictionary: TDictionary<string, string>): TLuaEngine;
var
key: string;
begin
lua_newtable(LState);
for key in ADictionary.Keys do
begin
TLuaUtils.PushTValue(LState, key);
TLuaUtils.PushTValue(LState, ADictionary.Items[key]);
lua_settable(LState, -3);
end;
lua_setglobal(LState, PAnsiChar(ATableName));
end;
function TLuaEngine.DeclareTable(const ATableName: AnsiString;
AKeys: array of string; AValues: array of string): TLuaEngine;
var
I: Integer;
k: string;
v: string;
begin
lua_newtable(LState);
for I := 0 to high(AKeys) do
begin
k := AKeys[I];
v := AValues[I];
TLuaUtils.PushTValue(LState, k);
TLuaUtils.PushTValue(LState, v);
lua_settable(LState, -3);
end;
lua_setglobal(LState, PAnsiChar(ATableName));
end;
destructor TLuaEngine.Destroy;
begin
CloseLua;
inherited;
end;
procedure TLuaEngine.Execute;
var
r: Integer;
begin
r := lua_pcall(LState, 0, 0, 0);
CheckLuaError(r);
end;
procedure TLuaEngine.CheckLuaError(const r: Integer);
var
err: PAnsiChar;
begin
case r of
// success
0:
begin
end;
// a runtime error.
LUA_ERRRUN:
begin
err := lua_tostring(LState, -1);
lua_pop(LState, 1);
raise ELuaRuntimeException.CreateFmt('Runtime error [%s]', [err]);
end;
// memory allocation error. For such errors, Lua does not call the error handler function.
LUA_ERRMEM:
begin
err := lua_tostring(LState, -1);
lua_pop(LState, 1);
raise ELuaException.CreateFmt('Memory allocation error [%s]', [err]);
end;
// error while running the error handler function.
LUA_ERRERR:
begin
err := lua_tostring(LState, -1);
lua_pop(LState, 1);
raise ELuaException.CreateFmt
('Error while running the error handler function [%s]', [err]);
end;
LUA_ERRSYNTAX:
begin
err := lua_tostring(LState, -1);
lua_pop(LState, 1);
raise ELuaSyntaxError.CreateFmt('Syntax Error [%s]', [err]);
end
else
begin
err := lua_tostring(LState, -1);
lua_pop(LState, 1);
raise ELuaException.CreateFmt('Unknown Error [%s]', [err]);
end;
end;
end;
procedure TLuaEngine.ExecuteFile(const AFileName: AnsiString);
begin
LoadFromFile(AFileName);
Execute;
end;
function TLuaEngine.ExecuteFunction(FunctionName: AnsiString;
const Params: array of TValue): TValue;
var
p: TValue;
r: Integer;
begin
lua_getglobal(LState, PAnsiChar(FunctionName));
for p in Params do
TLuaUtils.PushTValue(LState, p);
r := lua_pcall(LState, Length(Params), 1, 0);
CheckLuaError(r);
Result := TLuaValue.PopTValueFromStack(LState);
end;
function TLuaEngine.GetGlobal(AName: AnsiString): ILuaValue;
begin
lua_getglobal(LState, PAnsiChar(AName));
Result := TLuaValue.Create(LState, -1);
end;
function TLuaEngine.GetRawLuaState: Plua_State;
begin
Result := LState;
end;
procedure TLuaEngine.InitLua;
begin
LState := lua_open;
if not assigned(LState) then
raise ELuaException.Create('Cannot initialize Lua');
luaL_openlibs(LState);
end;
procedure TLuaEngine.LoadExternalLibraries(ALuaLibraryLoader
: ILuaLibraryLoader);
begin
ALuaLibraryLoader.Execute(Self);
end;
procedure TLuaEngine.LoadFromFile(const AFileName: AnsiString);
var
err: PAnsiChar;
begin
if luaL_loadfile(LState, PAnsiChar(AFileName)) <> 0 then
begin
err := lua_tostring(LState, -1);
lua_pop(LState, 1);
raise ELuaException.Create(err);
end;
end;
procedure TLuaEngine.LoadScript(const AStream: TStream; AOwnStream: boolean);
var
sr: TStreamReader;
s: string;
begin
sr := TStreamReader.Create(AStream);
try
if AOwnStream then
sr.OwnStream;
s := sr.ReadToEnd;
LoadScript(s);
finally
sr.Free;
end;
end;
procedure TLuaEngine.Reset;
begin
CloseLua;
InitLua;
end;
procedure TLuaEngine.ExecuteScript(const AScript: AnsiString);
var
err: PAnsiChar;
begin
if luaL_dostring(LState, PAnsiChar(AScript)) then
begin
err := lua_tostring(LState, -1);
lua_pop(LState, 1);
raise ELuaException.Create(err);
end;
end;
class function TLuaEngine.ExecuteWithResult(AScript: AnsiString;
const ParamNames, ParamValues: array of string): string;
var
L: TLuaEngine;
I: Integer;
begin
L := TLuaEngine.Create;
try
L.LoadScript(AScript);
if Length(ParamNames) <> Length(ParamValues) then
raise ELuaRuntimeException.Create
('Number of params names and param values is not equals');
for I := 0 to Length(ParamNames) - 1 do
L.DeclareGlobalString(ParamNames[I], ParamValues[I]);
L.Execute;
finally
L.Free;
end;
end;
procedure TLuaEngine.LoadScript(const AScript: AnsiString);
var
err: PAnsiChar;
begin
if luaL_loadstring(LState, PAnsiChar(AScript)) <> 0 then
begin
err := lua_tostring(LState, -1);
lua_pop(LState, 1);
raise ELuaException.Create(err);
end;
end;
procedure TLuaEngine.InternalDeclareTable(AObject: TObject);
var
prop: TRTTIProperty;
ctx: TRTTIContext;
properties: TArray<TRTTIProperty>;
k: AnsiString;
Value: TValue;
o: TObject;
begin
ctx := TRTTIContext.Create;
try
lua_newtable(LState);
properties := ctx.GetType(AObject.ClassType).GetProperties;
for prop in properties do
begin
if not(prop.Visibility in [mvPublic, mvPublished]) then
continue;
k := prop.Name;
TLuaUtils.PushTValue(LState, k);
Value := prop.GetValue(AObject);
if Value.TypeInfo^.Kind = tkClass then
begin
o := Value.AsObject;
if not assigned(o) then
lua_pushnil(LState)
else
InternalDeclareTable(Value.AsObject);
end
else
begin
if Value.Kind = tkEnumeration then
begin
Value := prop.GetValue(AObject).AsOrdinal;
end;
TLuaUtils.PushTValue(LState, Value)
end;
lua_settable(LState, -3);
end;
finally
ctx.Free;
end;
end;
function TLuaEngine.DeclareTable(const ATableName: AnsiString; AObject: TObject)
: TLuaEngine;
begin
InternalDeclareTable(AObject);
lua_setglobal(LState, PAnsiChar(ATableName));
end;
function TLuaEngine.DeclareTable(const ATableName: AnsiString; __self: Pointer;
AFunctions: TDictionary<string, lua_CFunction>;
AData: TDictionary<string, TValue>): TLuaEngine;
var
key: string;
begin
lua_newtable(LState);
TLuaUtils.PushTValue(LState, '__self');
lua_pushlightuserdata(LState, __self);
lua_settable(LState, -3);
for key in AFunctions.Keys do
begin
TLuaUtils.PushTValue(LState, key);
lua_pushcfunction(LState, AFunctions[key]);
lua_settable(LState, -3);
end;
if Assigned(AData) then
begin
for key in AData.Keys do
begin
TLuaUtils.PushTValue(LState, key);
TLuaUtils.PushTValue(LState, AData[key]);
lua_settable(LState, -3);
end;
end;
lua_setglobal(LState, PAnsiChar(ATableName));
end;
{ TLuaValue }
class function TLuaValue.GetTValueFromLuaValueType(LuaValueType: TLuaValueType;
LuaState: Plua_State; StackIndex: Integer): TValue;
var
a: AnsiString;
begin
case LuaValueType of
lvtNil:
Result := nil;
lvtNumber:
Result := lua_tonumber(LuaState, StackIndex);
lvtInteger:
Result := lua_tointeger(LuaState, StackIndex);
lvtString:
begin
a := lua_tostring(LuaState, StackIndex);
Result := a;
end;
lvtBoolean:
Result := lua_toboolean(LuaState, StackIndex) = 1;
lvtLightUserData:
Result := TObject(lua_topointer(LuaState, StackIndex));
lvtTable:
begin
Result := GetAsLuaTable(LuaState, StackIndex);
end;
lvtFunction:
begin
raise ELuaException.Create('Not implemented');
// _lua_CFunction := lua_tocfunction(LuaState, StackIndex);
Result := nil; { todo }
end;
lvtUserData:
raise ELuaException.Create('UserData not allowed here');
lvtThread:
begin
raise ELuaException.Create('Not implemented');
// _pluastate := lua_tothread(LuaState, StackIndex);
Result := nil; { todo }
end;
end;
end;
constructor TLuaValue.Create(LuaState: Plua_State; StackIndex: Integer);
begin
inherited Create;
FLuaValueType := GetLuaValueType(LuaState, StackIndex);
FValue := GetTValueFromLuaValueType(FLuaValueType, LuaState, StackIndex);
end;
class function TLuaValue.GetLuaValueType(LuaState: Plua_State;
StackIndex: Integer): TLuaValueType;
begin
Result := lvtNil;
case lua_type(LuaState, StackIndex) of
lua_tnil:
Result := lvtNil;
LUA_TNUMBER:
Result := lvtNumber;
LUA_TBOOLEAN:
Result := lvtBoolean;
LUA_TSTRING:
Result := lvtString;
LUA_TTABLE:
Result := lvtTable;
LUA_TFUNCTION:
Result := lvtFunction;
LUA_TUSERDATA:
Result := lvtUserData;
LUA_TTHREAD:
Result := lvtThread;
LUA_TLIGHTUSERDATA:
Result := lvtLightUserData;
LUA_TNONE:
raise ELuaException.Create('Invalid stack index location');
end;
end;
procedure TLuaValue.CheckType(LuaValueType: TLuaValueType);
begin
if FLuaValueType <> LuaValueType then
raise ELuaException.Create('Cannot access value as ' +
GetEnumName(TypeInfo(TLuaValueType), Ord(LuaValueType)) + ' while it is '
+ GetEnumName(TypeInfo(TLuaValueType), Ord(FLuaValueType)));
end;
function TLuaValue.GetAsBoolean: boolean;
begin
CheckType(lvtBoolean);
Result := FValue.AsBoolean;
end;
function TLuaValue.GetAsInteger: Integer;
begin
Result := 0;
if Self.FLuaValueType = lvtNumber then
begin
if GetAsNumber = Trunc(GetAsNumber) then
Result := Trunc(GetAsNumber)
else
CheckType(lvtInteger);
end
else
begin
CheckType(lvtInteger);
Result := FValue.AsInteger;
end;
end;
function TLuaValue.GetAsLightUserData: Pointer;
begin
CheckType(lvtLightUserData);
Result := Pointer(FValue.AsObject);
end;
class function TLuaValue.GetAsLuaTable(LuaState: Plua_State;
StackIndex: Integer): TValue;
begin
raise ELuaException.Create('Not implemented');
end;
function TLuaValue.GetAsNumber: Double;
begin
CheckType(lvtNumber);
Result := FValue.AsExtended;
end;
function TLuaValue.GetAsString: AnsiString;
begin
CheckType(lvtString);
Result := FValue.AsString;
end;
function TLuaValue.IsBoolean: boolean;
begin
Result := FLuaValueType = lvtBoolean;
end;
function TLuaValue.IsInteger: boolean;
begin
Result := FLuaValueType = lvtInteger;
end;
function TLuaValue.IsLightUserData: boolean;
begin
Result := FLuaValueType = lvtLightUserData;
end;
function TLuaValue.IsNil: boolean;
begin
Result := FLuaValueType = lvtNil;
end;
function TLuaValue.IsNumber: boolean;
begin
Result := FLuaValueType = lvtNumber;
end;
function TLuaValue.IsString: boolean;
begin
Result := FLuaValueType = lvtString;
end;
class function TLuaValue.PopTValueFromStack(LuaState: Plua_State): TValue;
var
lvt: TLuaValueType;
begin
lvt := TLuaValue.GetLuaValueType(LuaState, -1);
Result := TLuaValue.GetTValueFromLuaValueType(lvt, LuaState, -1);
lua_pop(LuaState, 1);
end;
end.

View File

@ -0,0 +1,4 @@
# lua4delphi
Delphi binding for Lua 5.1 language
This project was initially part of [DelphiMVCFramework](https://github.com/danieleteti/delphimvcframework) but now it is an indipendent project.

View File

@ -0,0 +1,27 @@
program LuaEmbedded;
{$APPTYPE CONSOLE}
{$R *.res}
uses
LuaBind.Filters.Text,
System.IOUtils;
var
eLuaFilter: TLuaEmbeddedTextFilter;
begin
eLuaFilter := TLuaEmbeddedTextFilter.Create;
try
eLuaFilter.OutputFunction := 'io.write';
eLuaFilter.TemplateCode := TFile.ReadAllText(ParamStr(1));
eLuaFilter.Execute;
TFile.WriteAllText(TPath.ChangeExtension(ParamStr(1), '.lua'), eLuaFilter.LuaCode);
finally
eLuaFilter.Free;
end;
end.

View File

@ -0,0 +1,954 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{D2CDB6BD-1AC1-49D5-87D9-23DAE45069D0}</ProjectGuid>
<ProjectVersion>19.3</ProjectVersion>
<FrameworkType>None</FrameworkType>
<MainSource>LuaEmbedded.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Android' and '$(Base)'=='true') or '$(Base_Android)'!=''">
<Base_Android>true</Base_Android>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Android64' and '$(Base)'=='true') or '$(Base_Android64)'!=''">
<Base_Android64>true</Base_Android64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<SanitizedProjectName>LuaEmbedded</SanitizedProjectName>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<DCC_UsePackage>fmx;IndySystem;DBXInterBaseDriver;DataSnapCommon;DataSnapClient;DataSnapServer;DataSnapProviderClient;DbxCommonDriver;dbxcds;DBXOracleDriver;CustomIPTransport;AureliusXE2;dsnap;IndyCore;fmxase;inetdbxpress;IPIndyImpl;bindcompfmx;rtl;dbrtl;DbxClientDriver;bindcomp;inetdb;xmlrtl;ibxpress;IndyProtocols;DBXMySQLDriver;bindengine;soaprtl;DBXInformixDriver;DBXFirebirdDriver;inet;fmxobj;LKSL;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;$(DCC_UsePackage)</DCC_UsePackage>
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Android)'!=''">
<Android_SplashImage470>$(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png</Android_SplashImage470>
<Android_LauncherIcon72>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png</Android_LauncherIcon72>
<Android_SplashImage640>$(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png</Android_SplashImage640>
<AUP_CAMERA>true</AUP_CAMERA>
<AUP_CALL_PHONE>true</AUP_CALL_PHONE>
<AUP_WRITE_EXTERNAL_STORAGE>true</AUP_WRITE_EXTERNAL_STORAGE>
<AUP_ACCESS_COARSE_LOCATION>true</AUP_ACCESS_COARSE_LOCATION>
<Android_LauncherIcon48>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png</Android_LauncherIcon48>
<Android_SplashImage426>$(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png</Android_SplashImage426>
<AUP_READ_EXTERNAL_STORAGE>true</AUP_READ_EXTERNAL_STORAGE>
<Android_SplashImage960>$(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png</Android_SplashImage960>
<Android_LauncherIcon96>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png</Android_LauncherIcon96>
<AUP_WRITE_CALENDAR>true</AUP_WRITE_CALENDAR>
<BT_BuildType>Debug</BT_BuildType>
<AUP_ACCESS_FINE_LOCATION>true</AUP_ACCESS_FINE_LOCATION>
<EnabledSysJars>android-support-v4.dex.jar;apk-expansion.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar</EnabledSysJars>
<AUP_INTERNET>true</AUP_INTERNET>
<AUP_READ_CALENDAR>true</AUP_READ_CALENDAR>
<AUP_READ_PHONE_STATE>true</AUP_READ_PHONE_STATE>
<VerInfo_Keys>package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
<Android_LauncherIcon144>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png</Android_LauncherIcon144>
<Android_LauncherIcon36>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png</Android_LauncherIcon36>
<Android_NotificationIcon24>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png</Android_NotificationIcon24>
<Android_NotificationIcon36>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png</Android_NotificationIcon36>
<Android_NotificationIcon48>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png</Android_NotificationIcon48>
<Android_NotificationIcon72>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png</Android_NotificationIcon72>
<Android_NotificationIcon96>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png</Android_NotificationIcon96>
<Android_LauncherIcon192>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png</Android_LauncherIcon192>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Android64)'!=''">
<VerInfo_Keys>package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
<BT_BuildType>Debug</BT_BuildType>
<Base_Android>true</Base_Android>
<CfgParent>Base</CfgParent>
<Base>true</Base>
<Android_SplashImage470>$(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png</Android_SplashImage470>
<Android_LauncherIcon72>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png</Android_LauncherIcon72>
<Android_SplashImage640>$(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png</Android_SplashImage640>
<AUP_CAMERA>true</AUP_CAMERA>
<AUP_CALL_PHONE>true</AUP_CALL_PHONE>
<AUP_WRITE_EXTERNAL_STORAGE>true</AUP_WRITE_EXTERNAL_STORAGE>
<AUP_ACCESS_COARSE_LOCATION>true</AUP_ACCESS_COARSE_LOCATION>
<Android_LauncherIcon48>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png</Android_LauncherIcon48>
<Android_SplashImage426>$(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png</Android_SplashImage426>
<AUP_READ_EXTERNAL_STORAGE>true</AUP_READ_EXTERNAL_STORAGE>
<Android_SplashImage960>$(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png</Android_SplashImage960>
<Android_LauncherIcon96>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png</Android_LauncherIcon96>
<AUP_WRITE_CALENDAR>true</AUP_WRITE_CALENDAR>
<AUP_ACCESS_FINE_LOCATION>true</AUP_ACCESS_FINE_LOCATION>
<EnabledSysJars>android-support-v4.dex.jar;apk-expansion.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar</EnabledSysJars>
<AUP_INTERNET>true</AUP_INTERNET>
<AUP_READ_CALENDAR>true</AUP_READ_CALENDAR>
<AUP_READ_PHONE_STATE>true</AUP_READ_PHONE_STATE>
<Android_LauncherIcon144>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png</Android_LauncherIcon144>
<Android_LauncherIcon36>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png</Android_LauncherIcon36>
<Android_LauncherIcon192>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png</Android_LauncherIcon192>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_UsePackage>JvGlobus;JvMM;JvDlgs;JvCrypt;TeeDB;Rave100VCL;vclib;inetdbbde;DBXSybaseASEDriver;vclimg;DataBindingsVCL160;fmi;vcldb;vcldsnap;dac160;unidacvcl160;DBXDb2Driver;Intraweb_120_160;dwsLibRuntime;JvCore;vclribbon;frxe16;vcl;CloudService;DBXMSSQLDriver;CodeSiteExpressPkg;unidac160;FmxTeeUI;JvAppFrm;JvRuntimeDesign;webdsnap;JclDeveloperTools;adortl;JvWizards;SimpleGraphPackage;NewAC;OpenWirePkgD16;vcldbx;frx16;DotNet4Delphi_XE2;crcontrols160;JclContainers;Tee;DataBindings;DBXOdbcDriver;JvCmp;JvSystem;svnui;adgrmxe2;JvControls;frxDB16;intrawebdb_120_160;fs16;vclactnband;FMXTee;TeeUI;bindcompvcl;JvStdCtrls;JvCustom;Jcl;vclie;vcltouch;dacvcl160;websnap;VclSmp;fsDB16;DataSnapConnectors;RlxPackage;dsnapcon;JclVcl;JvPascalInterpreter;vclx;Lua4Delphi;svn;bdertl;$(DCC_UsePackage)</DCC_UsePackage>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_UsePackage>TeeDB;vclib;DBXSybaseASEDriver;vclimg;vcldb;vcldsnap;DBXDb2Driver;vcl;DBXMSSQLDriver;webdsnap;adortl;Tee;DBXOdbcDriver;adgrmxe2;vclactnband;TeeUI;bindcompvcl;vclie;vcltouch;websnap;VclSmp;DataSnapConnectors;dsnapcon;vclx;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<DCC_RemoteDebug>true</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<Debugger_RunParams>test01.elua</Debugger_RunParams>
<DCC_UnitSearchPath>..\..\;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<Manifest_File>None</Manifest_File>
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_RemoteDebug>false</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_DebugInformation>0</DCC_DebugInformation>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1040</VersionInfo>
<VersionInfo Name="CodePage">1252</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="C:\windows\system32\OpenWireBindingDsnD16.bpl">(untitled)</Excluded_Packages>
<Excluded_Packages Name="C:\windows\system32\OpenWireEditorDsnD16.bpl">(untitled)</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k160.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp160.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k160.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp160.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
<Source>
<Source Name="MainSource">LuaEmbedded.dpr</Source>
</Source>
</Delphi.Personality>
<Deployment Version="3">
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libPCRE.dylib" Class="DependencyModule"/>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libpcre.dylib" Class="DependencyModule">
<Platform Name="iOSSimulator">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
<Platform Name="OSX32">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
<Platform Name="iOSSimulator">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClasses">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiFile">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon192">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyFramework">
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyModule">
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="DependencyPackage">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="File">
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX64">
<Operation>0</Operation>
</Platform>
<Platform Name="OSXARM64">
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iOS_AppStore1024">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon152">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon167">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_SpotLight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon180">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification60">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting87">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectAndroidManifest">
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSEntitlements"/>
<DeployClass Name="ProjectiOSInfoPList"/>
<DeployClass Name="ProjectiOSLaunchScreen"/>
<DeployClass Name="ProjectiOSResource">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXDebug"/>
<DeployClass Name="ProjectOSXEntitlements"/>
<DeployClass Name="ProjectOSXInfoPList"/>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="Linux64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo150">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo44">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
</Deployment>
<Platforms>
<Platform value="Android">False</Platform>
<Platform value="Android64">False</Platform>
<Platform value="Linux64">False</Platform>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
<Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
</Project>

View File

@ -0,0 +1,13 @@
This is a normal text file
but now I'm start a Lua tag
<?lua
--here I can write simple Lua code
for i = 1,5 do
print("i = " .. tostring(i));
end
?>
And now back to the simple text mode
Expressions are supported too.
Do you know what is the result of 5*5?
5*5 = <?lua= 5*5 ?>
bye bye

View File

@ -0,0 +1,39 @@
program LuaConsole;
{$APPTYPE CONSOLE}
{$R *.res}
uses
LuaBind,
System.SysUtils,
LuaBind.Intf in '..\..\LuaBind.Intf.pas';
var
LuaEngine: TLuaEngine;
ScriptDir, PackagePathToAppend: string;
begin
try
LuaEngine := TLuaEngine.Create;
try
ScriptDir := IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(1)));
PackagePathToAppend := ScriptDir + '?.lua';
LuaEngine.ExecuteScript('package.path = package.path .. ";' +
PackagePathToAppend.Replace('\', '\\') + '"' + sLineBreak +
'__SCRIPTFILE__ = "' + ParamStr(1).Replace('\', '\\') + '"' +
sLineBreak +
'__SCRIPTDIR__ = "' + ScriptDir.Replace('\', '\\') + '"' +
sLineBreak);
LuaEngine.LoadFromFile(ParamStr(1));
LuaEngine.Execute;
finally
LuaEngine.Free;
end;
except
on E: Exception do
Writeln(E.ClassName, ': ', E.Message);
end;
if DebugHook <> 0 then
readln;
end.

View File

@ -0,0 +1,994 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{F33CC2C0-360B-4A50-8D01-0DFBCF12DFD3}</ProjectGuid>
<ProjectVersion>19.3</ProjectVersion>
<FrameworkType>None</FrameworkType>
<MainSource>LuaConsole.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Android' and '$(Base)'=='true') or '$(Base_Android)'!=''">
<Base_Android>true</Base_Android>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Android64' and '$(Base)'=='true') or '$(Base_Android64)'!=''">
<Base_Android64>true</Base_Android64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='OSX64' and '$(Base)'=='true') or '$(Base_OSX64)'!=''">
<Base_OSX64>true</Base_OSX64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<SanitizedProjectName>LuaConsole</SanitizedProjectName>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace)</DCC_Namespace>
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Android)'!=''">
<Android_SplashImage470>$(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png</Android_SplashImage470>
<Android_LauncherIcon72>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png</Android_LauncherIcon72>
<Android_SplashImage640>$(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png</Android_SplashImage640>
<AUP_CAMERA>true</AUP_CAMERA>
<AUP_CALL_PHONE>true</AUP_CALL_PHONE>
<AUP_WRITE_EXTERNAL_STORAGE>true</AUP_WRITE_EXTERNAL_STORAGE>
<AUP_ACCESS_COARSE_LOCATION>true</AUP_ACCESS_COARSE_LOCATION>
<Android_LauncherIcon48>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png</Android_LauncherIcon48>
<Android_SplashImage426>$(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png</Android_SplashImage426>
<AUP_READ_EXTERNAL_STORAGE>true</AUP_READ_EXTERNAL_STORAGE>
<Android_SplashImage960>$(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png</Android_SplashImage960>
<Android_LauncherIcon96>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png</Android_LauncherIcon96>
<AUP_WRITE_CALENDAR>true</AUP_WRITE_CALENDAR>
<BT_BuildType>Debug</BT_BuildType>
<AUP_ACCESS_FINE_LOCATION>true</AUP_ACCESS_FINE_LOCATION>
<EnabledSysJars>android-support-v4.dex.jar;apk-expansion.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar</EnabledSysJars>
<AUP_INTERNET>true</AUP_INTERNET>
<AUP_READ_CALENDAR>true</AUP_READ_CALENDAR>
<AUP_READ_PHONE_STATE>true</AUP_READ_PHONE_STATE>
<VerInfo_Keys>package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
<Android_LauncherIcon144>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png</Android_LauncherIcon144>
<Android_LauncherIcon36>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png</Android_LauncherIcon36>
<Android_NotificationIcon24>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png</Android_NotificationIcon24>
<Android_NotificationIcon36>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png</Android_NotificationIcon36>
<Android_NotificationIcon48>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png</Android_NotificationIcon48>
<Android_NotificationIcon72>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png</Android_NotificationIcon72>
<Android_NotificationIcon96>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png</Android_NotificationIcon96>
<Android_LauncherIcon192>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png</Android_LauncherIcon192>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Android64)'!=''">
<VerInfo_Keys>package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
<BT_BuildType>Debug</BT_BuildType>
<Base_Android>true</Base_Android>
<CfgParent>Base</CfgParent>
<Base>true</Base>
<Android_SplashImage470>$(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png</Android_SplashImage470>
<Android_LauncherIcon72>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png</Android_LauncherIcon72>
<Android_SplashImage640>$(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png</Android_SplashImage640>
<AUP_CAMERA>true</AUP_CAMERA>
<AUP_CALL_PHONE>true</AUP_CALL_PHONE>
<AUP_WRITE_EXTERNAL_STORAGE>true</AUP_WRITE_EXTERNAL_STORAGE>
<AUP_ACCESS_COARSE_LOCATION>true</AUP_ACCESS_COARSE_LOCATION>
<Android_LauncherIcon48>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png</Android_LauncherIcon48>
<Android_SplashImage426>$(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png</Android_SplashImage426>
<AUP_READ_EXTERNAL_STORAGE>true</AUP_READ_EXTERNAL_STORAGE>
<Android_SplashImage960>$(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png</Android_SplashImage960>
<Android_LauncherIcon96>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png</Android_LauncherIcon96>
<AUP_WRITE_CALENDAR>true</AUP_WRITE_CALENDAR>
<AUP_ACCESS_FINE_LOCATION>true</AUP_ACCESS_FINE_LOCATION>
<EnabledSysJars>android-support-v4.dex.jar;apk-expansion.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar</EnabledSysJars>
<AUP_INTERNET>true</AUP_INTERNET>
<AUP_READ_CALENDAR>true</AUP_READ_CALENDAR>
<AUP_READ_PHONE_STATE>true</AUP_READ_PHONE_STATE>
<Android_LauncherIcon144>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png</Android_LauncherIcon144>
<Android_LauncherIcon36>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png</Android_LauncherIcon36>
<Android_LauncherIcon192>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png</Android_LauncherIcon192>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_OSX64)'!=''">
<Base_OSX32>true</Base_OSX32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
<DCC_ConsoleTarget>true</DCC_ConsoleTarget>
<DCC_UsePackage>IndyIPClient;AnyDAC_PhysADS_D18;AnyDAC_PhysODBC_D18;AnyDAC_GUIxForms_D18;DBXSqliteDriver;AnyDAC_ComI_D18;AnyDAC_PhysTDBX_D18;fmx;IndySystem;AnyDAC_PhysIB_D18;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapServer;DataSnapProviderClient;DbxCommonDriver;dbxcds;AnyDAC_PhysMSAcc_D18;DBXOracleDriver;CustomIPTransport;dsnap;IndyIPServer;AnyDAC_PhysPg_D18;fmxase;IndyCore;IndyIPCommon;CloudService;FmxTeeUI;AnyDAC_PhysMSSQL_D18;AnyDAC_PhysOracle_D18;inetdbxpress;AnyDAC_PhysMySQL_D18;AnyDAC_Phys_D18;AnyDAC_Comp_D18;bindcompfmx;rtl;dbrtl;DbxClientDriver;bindcomp;inetdb;xmlrtl;ibxpress;IndyProtocols;DBXMySQLDriver;bindengine;soaprtl;bindcompdbx;FMXTee;AnyDAC_PhysASA_D18;DBXInformixDriver;DBXFirebirdDriver;AnyDAC_PhysSQLITE_D18;inet;fmxobj;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;AnyDAC_PhysDb2_D18;$(DCC_UsePackage);$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<Manifest_File>None</Manifest_File>
<DCC_ConsoleTarget>true</DCC_ConsoleTarget>
<DCC_UnitSearchPath>..\..\;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<Debugger_RunParams>D:\DEV\bitPresenze30\servers\bpserver\data\e.lua</Debugger_RunParams>
<DCC_UsePackage>IndyIPClient;AnyDAC_PhysADS_D18;AnyDAC_PhysODBC_D18;AnyDAC_GUIxForms_D18;NxGridDsgn_dxe3;DBXSqliteDriver;frxDB18;AnyDAC_ComI_D18;AnyDAC_PhysTDBX_D18;tmswizdXE4;fmx;IndySystem;TeeDB;frx18;AnyDAC_PhysIB_D18;inetdbbde;vclib;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapServer;sample01adapters;DataSnapProviderClient;DBXSybaseASEDriver;DbxCommonDriver;vclimg;dbxcds;DatasnapConnectorsFreePascal;MetropolisUILiveTile;NxDBGridDsgn_dxe3;vcldb;vcldsnap;AnyDAC_PhysMSAcc_D18;DBXDb2Driver;DBXOracleDriver;CustomIPTransport;NxDBGridRun_dxe3;vclribbon;dsnap;IndyIPServer;AnyDAC_PhysPg_D18;fmxase;vcl;IndyCore;IndyIPCommon;CloudService;DBXMSSQLDriver;FmxTeeUI;CodeSiteExpressPkg;AnyDAC_PhysMSSQL_D18;AnyDAC_PhysOracle_D18;inetdbxpress;webdsnap;AnyDAC_PhysMySQL_D18;NxCollectionRun_dxe3;adortl;CustomAdaptersMDPackage;AnyDAC_Phys_D18;NxCollectionDsgn_dxe3;NxGridRun_dxe3;NxCommonDsgn_dxe3;AnyDAC_Comp_D18;NxCommonRun_dxe3;bindcompfmx;tmsdXE4;BPAdapters;vcldbx;TextPkg;rtl;dbrtl;DbxClientDriver;bindcomp;inetdb;Tee;DBXOdbcDriver;NxAddonsRun_dxe3;dorm_runtime_xe4;xmlrtl;svnui;ibxpress;NxSheetRun_dxe3;IndyProtocols;DBXMySQLDriver;frxe18;vclactnband;bindengine;soaprtl;bindcompdbx;FMXTee;TeeUI;bindcompvcl;vclie;vcltouch;AnyDAC_PhysASA_D18;tmsexdXE4;VclSmp;DBXInformixDriver;Intraweb;DataSnapConnectors;NxInspectorRun_dxe3;dsnapcon;DBXFirebirdDriver;AnyDAC_PhysSQLITE_D18;inet;tmsxlsdXE4;fmxobj;vclx;svn;DBXSybaseASADriver;fmxdae;NxInspectorDsgn_dxe3;bdertl;VirtualTreesR;dbexpress;DataSnapIndy10ServerTransport;AnyDAC_PhysDb2_D18;$(DCC_UsePackage)</DCC_UsePackage>
<VerInfo_Locale>1033</VerInfo_Locale>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_ConsoleTarget>true</DCC_ConsoleTarget>
<DCC_UsePackage>IndyIPClient;AnyDAC_PhysADS_D18;AnyDAC_PhysODBC_D18;AnyDAC_GUIxForms_D18;NxGridDsgn_dxe3;DBXSqliteDriver;AnyDAC_ComI_D18;AnyDAC_PhysTDBX_D18;fmx;IndySystem;TeeDB;AnyDAC_PhysIB_D18;vclib;DBXInterBaseDriver;DataSnapClient;DataSnapCommon;DataSnapServer;DataSnapProviderClient;DBXSybaseASEDriver;DbxCommonDriver;vclimg;dbxcds;DatasnapConnectorsFreePascal;MetropolisUILiveTile;NxDBGridDsgn_dxe3;vcldb;vcldsnap;AnyDAC_PhysMSAcc_D18;DBXDb2Driver;DBXOracleDriver;CustomIPTransport;NxDBGridRun_dxe3;vclribbon;dsnap;IndyIPServer;AnyDAC_PhysPg_D18;fmxase;vcl;IndyCore;IndyIPCommon;CloudService;DBXMSSQLDriver;FmxTeeUI;AnyDAC_PhysMSSQL_D18;AnyDAC_PhysOracle_D18;inetdbxpress;webdsnap;AnyDAC_PhysMySQL_D18;NxCollectionRun_dxe3;adortl;AnyDAC_Phys_D18;NxCollectionDsgn_dxe3;NxGridRun_dxe3;NxCommonDsgn_dxe3;AnyDAC_Comp_D18;NxCommonRun_dxe3;bindcompfmx;rtl;dbrtl;DbxClientDriver;bindcomp;inetdb;Tee;DBXOdbcDriver;NxAddonsRun_dxe3;xmlrtl;ibxpress;NxSheetRun_dxe3;IndyProtocols;DBXMySQLDriver;vclactnband;bindengine;soaprtl;bindcompdbx;FMXTee;TeeUI;bindcompvcl;vclie;vcltouch;AnyDAC_PhysASA_D18;VclSmp;DBXInformixDriver;Intraweb;DataSnapConnectors;NxInspectorRun_dxe3;dsnapcon;DBXFirebirdDriver;AnyDAC_PhysSQLITE_D18;inet;fmxobj;vclx;DBXSybaseASADriver;fmxdae;NxInspectorDsgn_dxe3;VirtualTreesR;dbexpress;DataSnapIndy10ServerTransport;AnyDAC_PhysDb2_D18;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_DebugDCUs>true</DCC_DebugDCUs>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<DCC_RemoteDebug>true</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<Manifest_File>None</Manifest_File>
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_RemoteDebug>false</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_DebugInformation>0</DCC_DebugInformation>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="..\..\LuaBind.Intf.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<Source>
<Source Name="MainSource">LuaConsole.dpr</Source>
</Source>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1040</VersionInfo>
<VersionInfo Name="CodePage">1252</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
<VersionInfoKeys Name="CFBundleName"/>
<VersionInfoKeys Name="CFBundleDisplayName"/>
<VersionInfoKeys Name="UIDeviceFamily"/>
<VersionInfoKeys Name="CFBundleIdentifier"/>
<VersionInfoKeys Name="CFBundleVersion"/>
<VersionInfoKeys Name="CFBundlePackageType"/>
<VersionInfoKeys Name="CFBundleSignature"/>
<VersionInfoKeys Name="CFBundleAllowMixedLocalizations"/>
<VersionInfoKeys Name="UISupportedInterfaceOrientations"/>
<VersionInfoKeys Name="CFBundleExecutable"/>
<VersionInfoKeys Name="CFBundleResourceSpecification"/>
<VersionInfoKeys Name="LSRequiresIPhoneOS"/>
<VersionInfoKeys Name="CFBundleInfoDictionaryVersion"/>
<VersionInfoKeys Name="CFBundleDevelopmentRegion"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k180.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp180.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k180.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp180.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Deployment Version="3">
<DeployFile LocalName="Win32\Debug\LuaConsole.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>LuaConsole.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libPCRE.dylib" Class="DependencyModule"/>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libpcre.dylib" Class="DependencyModule">
<Platform Name="iOSSimulator">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
<Platform Name="OSX32">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
<Platform Name="iOSSimulator">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClasses">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiFile">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon192">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyFramework">
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyModule">
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="DependencyPackage">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="File">
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX64">
<Operation>0</Operation>
</Platform>
<Platform Name="OSXARM64">
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iOS_AppStore1024">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon152">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon167">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_SpotLight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon180">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification60">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting87">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectAndroidManifest">
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSEntitlements"/>
<DeployClass Name="ProjectiOSInfoPList"/>
<DeployClass Name="ProjectiOSLaunchScreen"/>
<DeployClass Name="ProjectiOSResource">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXDebug"/>
<DeployClass Name="ProjectOSXEntitlements"/>
<DeployClass Name="ProjectOSXInfoPList"/>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="Linux64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo150">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo44">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
</Deployment>
<Platforms>
<Platform value="Android">False</Platform>
<Platform value="Android64">False</Platform>
<Platform value="Linux64">False</Platform>
<Platform value="OSX64">False</Platform>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
</Project>

View File

@ -0,0 +1,13 @@
--print(package.path)
--[[
require'lfs'
print(lfs.currentdir ())
--table.foreach(_G, print)
]]
for i= 0,9 do
print(i)
end

View File

@ -0,0 +1,20 @@
-- configuration file for program `pp'
-- define window size
theform = {
f = form,
setcaption = function (value)
_setcaption(theform.f, value)
end
}
width = 200
height = x1+x2+x3;
stringa = 'UPPERCASE='..delphiuppercase('daniele teti')..
'Nome: '..daniele.nome..
'Cognome: '..daniele.cognome..
'Età: '..daniele.eta..
'Il nome completo è: '..daniele:fullname()
--theform:setcaption("Hello World")
_setcaption( form, "ciao mondo" )

View File

@ -0,0 +1,229 @@
--[[ DataDumper.lua
Copyright (c) 2007 Olivetti-Engineering SA
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
]]
local dumplua_closure = [[
local closures = {}
local function closure(t)
closures[#closures+1] = t
t[1] = assert(loadstring(t[1]))
return t[1]
end
for _,t in pairs(closures) do
for i = 2,#t do
debug.setupvalue(t[1], i-1, t[i])
end
end
]]
local lua_reserved_keywords = {
'and', 'break', 'do', 'else', 'elseif', 'end', 'false', 'for',
'function', 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat',
'return', 'then', 'true', 'until', 'while' }
local function keys(t)
local res = {}
local oktypes = { stringstring = true, numbernumber = true }
local function cmpfct(a,b)
if oktypes[type(a)..type(b)] then
return a < b
else
return type(a) < type(b)
end
end
for k in pairs(t) do
res[#res+1] = k
end
table.sort(res, cmpfct)
return res
end
local c_functions = {}
for _,lib in pairs{'_G', 'string', 'table', 'math',
'io', 'os', 'coroutine', 'package', 'debug'} do
local t = _G[lib] or {}
lib = lib .. "."
if lib == "_G." then lib = "" end
for k,v in pairs(t) do
if type(v) == 'function' and not pcall(string.dump, v) then
c_functions[v] = lib..k
end
end
end
function DataDumper(value, varname, fastmode, ident)
local defined, dumplua = {}
-- Local variables for speed optimization
local string_format, type, string_dump, string_rep =
string.format, type, string.dump, string.rep
local tostring, pairs, table_concat =
tostring, pairs, table.concat
local keycache, strvalcache, out, closure_cnt = {}, {}, {}, 0
setmetatable(strvalcache, {__index = function(t,value)
local res = string_format('%q', value)
t[value] = res
return res
end})
local fcts = {
string = function(value) return strvalcache[value] end,
number = function(value) return value end,
boolean = function(value) return tostring(value) end,
['nil'] = function(value) return 'nil' end,
['function'] = function(value)
return string_format("loadstring(%q)", string_dump(value))
end,
userdata = function() error("Cannot dump userdata") end,
thread = function() error("Cannot dump threads") end,
}
local function test_defined(value, path)
if defined[value] then
if path:match("^getmetatable.*%)$") then
out[#out+1] = string_format("s%s, %s)\n", path:sub(2,-2), defined[value])
else
out[#out+1] = path .. " = " .. defined[value] .. "\n"
end
return true
end
defined[value] = path
end
local function make_key(t, key)
local s
if type(key) == 'string' and key:match('^[_%a][_%w]*$') then
s = key .. "="
else
s = "[" .. dumplua(key, 0) .. "]="
end
t[key] = s
return s
end
for _,k in ipairs(lua_reserved_keywords) do
keycache[k] = '["'..k..'"] = '
end
if fastmode then
fcts.table = function (value)
-- Table value
local numidx = 1
out[#out+1] = "{"
for key,val in pairs(value) do
if key == numidx then
numidx = numidx + 1
else
out[#out+1] = keycache[key]
end
local str = dumplua(val)
out[#out+1] = str..","
end
if string.sub(out[#out], -1) == "," then
out[#out] = string.sub(out[#out], 1, -2);
end
out[#out+1] = "}"
return ""
end
else
fcts.table = function (value, ident, path)
if test_defined(value, path) then return "nil" end
-- Table value
local sep, str, numidx, totallen = " ", {}, 1, 0
local meta, metastr = (debug or getfenv()).getmetatable(value)
if meta then
ident = ident + 1
metastr = dumplua(meta, ident, "getmetatable("..path..")")
totallen = totallen + #metastr + 16
end
for _,key in pairs(keys(value)) do
local val = value[key]
local s = ""
local subpath = path
if key == numidx then
subpath = subpath .. "[" .. numidx .. "]"
numidx = numidx + 1
else
s = keycache[key]
if not s:match "^%[" then subpath = subpath .. "." end
subpath = subpath .. s:gsub("%s*=%s*$","")
end
s = s .. dumplua(val, ident+1, subpath)
str[#str+1] = s
totallen = totallen + #s + 2
end
if totallen > 80 then
sep = "\n" .. string_rep(" ", ident+1)
end
str = "{"..sep..table_concat(str, ","..sep).." "..sep:sub(1,-3).."}"
if meta then
sep = sep:sub(1,-3)
return "setmetatable("..sep..str..","..sep..metastr..sep:sub(1,-3)..")"
end
return str
end
fcts['function'] = function (value, ident, path)
if test_defined(value, path) then return "nil" end
if c_functions[value] then
return c_functions[value]
elseif debug == nil or debug.getupvalue(value, 1) == nil then
return string_format("loadstring(%q)", string_dump(value))
end
closure_cnt = closure_cnt + 1
local res = {string.dump(value)}
for i = 1,math.huge do
local name, v = debug.getupvalue(value,i)
if name == nil then break end
res[i+1] = v
end
return "closure " .. dumplua(res, ident, "closures["..closure_cnt.."]")
end
end
function dumplua(value, ident, path)
return fcts[type(value)](value, ident, path)
end
if varname == nil then
varname = "return "
elseif varname:match("^[%a_][%w_]*$") then
varname = varname .. " = "
end
if fastmode then
setmetatable(keycache, {__index = make_key })
out[1] = varname
table.insert(out,dumplua(value, 0))
return table.concat(out)
else
setmetatable(keycache, {__index = make_key })
local items = {}
for i=1,10 do items[i] = '' end
items[3] = dumplua(value, ident or 0, "t")
if closure_cnt > 0 then
items[1], items[6] = dumplua_closure:match("(.*\n)\n(.*)")
out[#out+1] = ""
end
if #out > 0 then
items[2], items[4] = "local t = ", "\n"
items[5] = table.concat(out)
items[7] = varname .. "t"
else
items[2] = varname
end
return table.concat(items)
end
end

View File

@ -0,0 +1,5 @@
Ciao
<?lua io.write("hello") ?>
mondo
<?lua io.write("world") ?>
close

View File

@ -0,0 +1,10 @@
io.write [[
Ciao
]] io.write("hello")
io.write [[
mondo
]] io.write("world")
io.write [[
close]]

View File

@ -0,0 +1,6 @@
Ciao
<?lua io.write("hello") ?>
mondo
<?lua io.write("world") ?>
Hi, my name is <?lua= "Daniele Teti" ?>. What's your name?
close

View File

@ -0,0 +1,13 @@
io.write [[
Ciao
]] io.write("hello")
io.write [[
mondo
]] io.write("world")
io.write [[
Hi, my name is ]]io.write( "Daniele Teti" )
io.write [[
. What's your name?
close]]

View File

@ -0,0 +1,26 @@
<html>
<head>
<title>Hello DWS</title>
</head>
<body>
<h2>Hello DWS</h2>
<p>This page was generated at <?pas=FormatDateTime('hh:nn:ss.zzz', Now)?>.</p>
<p>Some test links<ul>
<li><a href="requestInfo.dws">blank request info</a></li>
<li><a href="requestInfo.dws?p=alpha&b=beta&c=gamma+delta">parameterized request info</a></li>
</ul></p>
<p>Some facts:<ul><?lua
function print_facts(i)
print(tostring(i) .. ' + ' .. tostring(i) .. ' = ' .. tostring(i+i))
end
for i = 1,5 do
print('<li>');
print_facts(i);
print('</li>');
end
?>
</ul></p>
</body>
</html>

View File

@ -0,0 +1,29 @@
io.write [[
<html>
<head>
<title>Hello DWS</title>
</head>
<body>
<h2>Hello DWS</h2>
<p>This page was generated at <?pas=FormatDateTime('hh:nn:ss.zzz', Now)?>.</p>
<p>Some test links<ul>
<li><a href="requestInfo.dws">blank request info</a></li>
<li><a href="requestInfo.dws?p=alpha&b=beta&c=gamma+delta">parameterized request info</a></li>
</ul></p>
<p>Some facts:<ul>]]
function print_facts(i)
print(tostring(i) .. ' + ' .. tostring(i) .. ' = ' .. tostring(i+i))
end
for i = 1,5 do
print('<li>');
print_facts(i);
print('</li>');
end
io.write [[
</ul></p>
</body>
</html>]]

View File

@ -0,0 +1,2 @@
<?lua local x = 1 ?>
Hello World <?lua= x?>

View File

@ -0,0 +1,6 @@
local x = 1
io.write [[
Hello World ]]io.write( x)
io.write [[
]]

View File

@ -0,0 +1,9 @@
Hello There
<?lua
local x = "This is an open tag <?lua"
?>
<?lua=x?>
<?lua
local y = "This is a closing tag ?>"
?>
<?lua=y?>

View File

@ -0,0 +1,18 @@
io.write [[
Hello There
]]
local x = "This is an open tag <?lua"
io.write [[
]]io.write(x)
io.write [[
]]
local y = "This is a closing tag ?>"
io.write [[
]]io.write(y)
io.write [[
]]

View File

@ -0,0 +1,9 @@
Hello There
<?lua
local x = "Here there is an \" escaped double quote\""
?>
<?lua=x?>
<?lua
local y = "Here there is only one \" escaped double quote"
?>
<?lua=y?>

View File

@ -0,0 +1,18 @@
io.write [[
Hello There
]]
local x = "Here there is an \" escaped double quote\""
io.write [[
]]io.write(x)
io.write [[
]]
local y = "Here there is only one \" escaped double quote"
io.write [[
]]io.write(y)
io.write [[
]]

View File

@ -0,0 +1 @@
lua %1 > "%1.txt"

View File

@ -0,0 +1,189 @@
-------------------------------------------------------------------------------
-- includes a new tostring function that handles tables recursively
--
-- @author Danilo Tuler (tuler@ideais.com.br)
-- @author Andre Carregal (info@keplerproject.org)
-- @author Thiago Costa Ponte (thiago@ideais.com.br)
--
-- @copyright 2004-2011 Kepler Project
-------------------------------------------------------------------------------
local type, table, string, _tostring, tonumber = type, table, string, tostring, tonumber
local select = select
local error = error
local format = string.format
module("logging")
-- Meta information
_COPYRIGHT = "Copyright (C) 2004-2011 Kepler Project"
_DESCRIPTION = "A simple API to use logging features in Lua"
_VERSION = "LuaLogging 1.1.4"
-- The DEBUG Level designates fine-grained instring.formational events that are most
-- useful to debug an application
DEBUG = "DEBUG"
-- The INFO level designates instring.formational messages that highlight the
-- progress of the application at coarse-grained level
INFO = "INFO"
-- The WARN level designates potentially harmful situations
WARN = "WARN"
-- The ERROR level designates error events that might still allow the
-- application to continue running
ERROR = "ERROR"
-- The FATAL level designates very severe error events that will presumably
-- lead the application to abort
FATAL = "FATAL"
local LEVEL = {"DEBUG", "INFO", "WARN", "ERROR", "FATAL"}
local MAX_LEVELS = #LEVEL
-- make level names to order
for i=1,MAX_LEVELS do
LEVEL[LEVEL[i]] = i
end
-- private log function, with support for formating a complex log message.
local function LOG_MSG(self, level, fmt, ...)
local f_type = type(fmt)
if f_type == 'string' then
if select('#', ...) > 0 then
return self:append(level, format(fmt, ...))
else
-- only a single string, no formating needed.
return self:append(level, fmt)
end
elseif f_type == 'function' then
-- fmt should be a callable function which returns the message to log
return self:append(level, fmt(...))
end
-- fmt is not a string and not a function, just call tostring() on it.
return self:append(level, tostring(fmt))
end
-- create the proxy functions for each log level.
local LEVEL_FUNCS = {}
for i=1,MAX_LEVELS do
local level = LEVEL[i]
LEVEL_FUNCS[i] = function(self, ...)
-- no level checking needed here, this function will only be called if it's level is active.
return LOG_MSG(self, level, ...)
end
end
-- do nothing function for disabled levels.
local function disable_level() end
-- improved assertion funciton.
local function assert(exp, ...)
-- if exp is true, we are finished so don't do any processing of the parameters
if exp then return exp, ... end
-- assertion failed, raise error
error(format(...), 2)
end
-------------------------------------------------------------------------------
-- Creates a new logger object
-- @param append Function used by the logger to append a message with a
-- log-level to the log stream.
-- @return Table representing the new logger object.
-------------------------------------------------------------------------------
function new(append)
if type(append) ~= "function" then
return nil, "Appender must be a function."
end
local logger = {}
logger.append = append
logger.setLevel = function (self, level)
local order = LEVEL[level]
assert(order, "undefined level `%s'", _tostring(level))
self.level = level
self.level_order = order
-- enable/disable levels
for i=1,MAX_LEVELS do
local name = LEVEL[i]:lower()
if i >= order then
self[name] = LEVEL_FUNCS[i]
else
self[name] = disable_level
end
end
end
-- generic log function.
logger.log = function (self, level, ...)
local order = LEVEL[level]
assert(order, "undefined level `%s'", _tostring(level))
if order < self.level_order then
return
end
return LOG_MSG(self, level, ...)
end
-- initialize log level.
logger:setLevel(DEBUG)
return logger
end
-------------------------------------------------------------------------------
-- Prepares the log message
-------------------------------------------------------------------------------
function prepareLogMsg(pattern, dt, level, message)
local logMsg = pattern or "%date %level %message\n"
message = string.gsub(message, "%%", "%%%%")
logMsg = string.gsub(logMsg, "%%date", dt)
logMsg = string.gsub(logMsg, "%%level", level)
logMsg = string.gsub(logMsg, "%%message", message)
return logMsg
end
-------------------------------------------------------------------------------
-- Converts a Lua value to a string
--
-- Converts Table fields in alphabetical order
-------------------------------------------------------------------------------
function tostring(value)
local str = ''
if (type(value) ~= 'table') then
if (type(value) == 'string') then
str = string.format("%q", value)
else
str = _tostring(value)
end
else
local auxTable = {}
table.foreach(value, function(i, v)
if (tonumber(i) ~= i) then
table.insert(auxTable, i)
else
table.insert(auxTable, tostring(i))
end
end)
table.sort(auxTable)
str = str..'{'
local separator = ""
local entry = ""
table.foreachi (auxTable, function (i, fieldName)
if ((tonumber(fieldName)) and (tonumber(fieldName) > 0)) then
entry = tostring(value[tonumber(fieldName)])
else
entry = fieldName.." = "..tostring(value[fieldName])
end
str = str..separator..entry
separator = ", "
end)
str = str..'}'
end
return str
end

View File

@ -0,0 +1,27 @@
sample = {}
local function getvalue (self, key, args)
print ("retrieving", key)
if (key == 'pippo') then
return function (p1,p2,p3,p4,p5,p6) return p2 end
end
return "__newindex "..key
end
local function setvalue(self,key,value)
print ("setting",key,"to",value)
-- ... do some here with key / values
end
local function oncall(self, key, args)
print("function calling...")
print(key)
end
setmetatable(sample,{__index = getvalue, __newindex = setvalue, __call = oncall})
--sample['hello'] = 'world';
--print(sample['hello']);
--print(sample(123))
print(sample:pippo(23))

View File

@ -0,0 +1,18 @@
io.write [[
This is a normal text file
but now I'm start a Lua tag
]]
--here I can write simple Lua code
for i = 1,5 do
print("i = " .. tostring(i));
end
io.write [[
And now back to the simple text mode
Expressions are supported too.
Do you know what is the result of 5*5?
5*5 = ]]io.write( 5*5 )
io.write [[
bye bye]]

View File

@ -0,0 +1,9 @@
a = {
nome = "Daniele",
cognome = "Teti",
eta = 32
}
for k,v in pairs(a) do
print(k..'='..v)
end

View File

@ -0,0 +1,2 @@
days = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}
print(days[3]);

View File

@ -0,0 +1,9 @@
require"logging.console"
local logger = logging.console()
logger:info("logging.console test")
logger:debug("debugging...")
logger:error("error!")
logger:debug("string with %4")
print("Console Logging OK")

View File

@ -0,0 +1,6 @@
require "logging.file"
local logger = logging.file("__TEST%s.log", "%Y-%m-%d")
logger:info("logging.file test")
logger:debug("debugging...")
logger:error("error!")
logger:info({id = "1"})

View File

@ -0,0 +1,5 @@
local x = 1+2+3;
local s = "Hello World";
if (x > 2) then
print(s);
end

View File

@ -0,0 +1,23 @@
require "lua_taival.datasets"
local s = open_dataset(people);
s.first();
local f = io.open("test_02.txt", "w")
while not s.eof() do
f:write(s.get('first_name').." "..s.get('last_name').." "..s.get('born_date').." "..s.get("is_male").."\n")
s.movenext()
end;
s.close()
f:write(tostring(s.is_open()))
s.open()
f:write(tostring(s.is_open()))
s.movenext()
f:write(tostring(s.is_open()))
s.first()
f:write(tostring(s.is_open()))
s.movenext()
f:write(tostring(s.is_open()))
s.close()
f:write(tostring(s.is_open()))
f:close()

View File

@ -0,0 +1,26 @@
require "lua_taival.delphiobjects"
require "logging.file"
logger = logging.file("test_03_TEST.log")
local s = connect_to_delphi_object(person);
s.FirstName = "Daniele";
s.LastName = "Teti";
s.Age = 30;
s.BecomeOlder(2);
first_name = s.FirstName;
last_name = s.LastName;
full_name = s.GetFullName('Mr.');
age = s.Age;
--reading property
local name = s.LastName
--writing a property
s.LastName = "Teti" --you can write to a property in this way

View File

@ -0,0 +1,10 @@
require "lua_taival.delphiobjects"
require "logging.file"
logger = logging.file("test_04_TEST_%s.log", "%Y-%m-%d")
local sl = connect_to_delphi_object(stringlist);
sl.Add("two");
sl.Add("three");
sl.Add("four");
logger:debug(sl.Text);

View File

@ -0,0 +1,7 @@
require "lua_taival.delphiobjects"
require "logging.file"
logger = logging.file("test_05_TEST_%s.log", "%Y-%m-%d")
local sl = connect_to_delphi_object(stringlist);
sl.Text = "Daniele Teti"
logger:debug(sl.Text);

View File

@ -0,0 +1,8 @@
require "lua_taival.delphiobjects"
require "logging.file"
logger = logging.file("test_06_TEST.log")
local sl = create_delphi_object('System.Classes.TStringList')
sl.Text = "Daniele Teti"
logger:debug('Ecco il contenuto della TStringList: '..sl.Text);
sl.Free();

View File

@ -0,0 +1,6 @@
require "lua_taival.delphiobjects"
require "logging.file"
logger = logging.file("test_07_TEST_%s.log", "%Y-%m-%d")
--this should raise an exception
local fs = create_delphi_object('System.Classes.TFileStream');

View File

@ -0,0 +1,3 @@
function myfunc(a,b,c)
return a..b..c
end

View File

@ -0,0 +1,5 @@
local sl = TStringList.new()
sl:add('Hello World')
--sl.add('Hello World2')

View File

@ -0,0 +1,21 @@
program LuaPlayground;
uses
Vcl.Forms,
Unit11 in 'Unit11.pas' {MainForm},
LuaBind.Intf in '..\..\LuaBind.Intf.pas',
LuaBind in '..\..\LuaBind.pas',
LuaBind.CustomType.DataSet in '..\..\LuaBind.CustomType.DataSet.pas',
LuaBind.DelphiObjects in '..\..\LuaBind.DelphiObjects.pas';
{$R *.res}
begin
ReportMemoryLeaksOnShutdown := True;
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TMainForm, MainForm);
Application.Run;
end.

View File

@ -0,0 +1,989 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{F2D71A9C-D7E4-4B13-9AB9-F8ED3349D646}</ProjectGuid>
<ProjectVersion>19.3</ProjectVersion>
<FrameworkType>VCL</FrameworkType>
<MainSource>LuaPlayground.dpr</MainSource>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<DCC_UsePackage>bindcompfmx;fmx;rtl;dbrtl;IndySystem;DbxClientDriver;bindcomp;inetdb;DBXInterBaseDriver;DataSnapCommon;DataSnapClient;DataSnapServer;DataSnapProviderClient;xmlrtl;DbxCommonDriver;IndyProtocols;DBXMySQLDriver;dbxcds;soaprtl;bindengine;DBXOracleDriver;dsnap;DBXInformixDriver;IndyCore;fmxase;DBXFirebirdDriver;inet;fmxobj;inetdbxpress;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;IPIndyImpl;$(DCC_UsePackage)</DCC_UsePackage>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
<DCC_DcuOutput>.\$(Platform)\$(Config)</DCC_DcuOutput>
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
<DCC_E>false</DCC_E>
<DCC_N>false</DCC_N>
<DCC_S>false</DCC_S>
<DCC_F>false</DCC_F>
<DCC_K>false</DCC_K>
<SanitizedProjectName>LuaPlayground</SanitizedProjectName>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_UsePackage>OpenWirePkgD16;vcldbx;frx16;TeeDB;Rave100VCL;vclib;Tee;inetdbbde;DBXOdbcDriver;DBXSybaseASEDriver;ibxpress;svnui;vclimg;OpenWireLabPkgD16;intrawebdb_120_160;fmi;frxDB16;fs16;vclactnband;FMXTee;vcldb;TeeUI;bindcompvcl;vcldsnap;SynEdit_RXE2;vclie;vcltouch;Intraweb_120_160;DBXDb2Driver;websnap;dwsLibRuntime;vclribbon;VclSmp;fsDB16;frxe16;vcl;DataSnapConnectors;UIBD16Win32R;CodeSiteExpressPkg;CloudService;DBXMSSQLDriver;FmxTeeUI;dsnapcon;RlxPackage;DataSnapServerConnectionMonitoring;vclx;webdsnap;svn;bdertl;adortl;$(DCC_UsePackage)</DCC_UsePackage>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_UsePackage>DBXOdbcDriver;DBXSybaseASEDriver;vclimg;vclactnband;vcldb;bindcompvcl;vcldsnap;SynEdit_RXE2;vclie;vcltouch;DBXDb2Driver;websnap;VclSmp;vcl;DataSnapConnectors;DBXMSSQLDriver;dsnapcon;vclx;webdsnap;$(DCC_UsePackage)</DCC_UsePackage>
<UWP_DelphiLogo44>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png</UWP_DelphiLogo44>
<UWP_DelphiLogo150>$(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png</UWP_DelphiLogo150>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<DCC_RemoteDebug>true</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<DCC_RemoteDebug>false</DCC_RemoteDebug>
<BT_BuildType>Debug</BT_BuildType>
<DCC_ExeOutput>..\bin</DCC_ExeOutput>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Locale>1033</VerInfo_Locale>
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_DebugInformation>0</DCC_DebugInformation>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="Unit11.pas">
<Form>MainForm</Form>
<FormType>dfm</FormType>
</DCCReference>
<DCCReference Include="..\..\LuaBind.Intf.pas"/>
<DCCReference Include="..\..\LuaBind.pas"/>
<DCCReference Include="..\..\LuaBind.CustomType.DataSet.pas"/>
<DCCReference Include="..\..\LuaBind.DelphiObjects.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1040</VersionInfo>
<VersionInfo Name="CodePage">1252</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
</VersionInfoKeys>
<Source>
<Source Name="MainSource">LuaPlayground.dpr</Source>
</Source>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k280.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp280.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k280.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp280.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
</Delphi.Personality>
<Deployment Version="3">
<DeployFile LocalName="..\bin\LuaPlayground.exe" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>LuaPlayground.exe</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClasses">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiFile">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon192">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyFramework">
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyModule">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="DependencyPackage">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="File">
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources\StartUp\</RemoteDir>
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iOS_AppStore1024">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon152">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon167">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_SpotLight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon180">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification60">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting87">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectAndroidManifest">
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSEntitlements">
<Platform Name="iOSDevice32">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSInfoPList">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSLaunchScreen">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSResource">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXDebug">
<Platform Name="OSX64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXEntitlements">
<Platform Name="OSX32">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>..\</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXInfoPList">
<Platform Name="OSX32">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="Linux64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\MacOS</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo150">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo44">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
</Deployment>
<Platforms>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
<UnitTesting>
<TestProjectName>C:\Users\Daniele\Desktop\luawrapper\unittests\LuaTestTests.dproj</TestProjectName>
</UnitTesting>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
<Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
</Project>

View File

@ -0,0 +1,401 @@
unit LuaWrapper;
interface
uses dorLua,
System.Classes,
System.SysUtils,
System.Rtti;
type
ELuaException = class(Exception)
end;
ILuaValue = interface
['{8621BAD3-B847-4176-937F-2CD016BBE13E}']
/// ///
function IsNil: boolean;
function IsNumber: boolean;
function IsInteger: boolean;
function IsString: boolean;
function IsBoolean: boolean;
function IsLightUserData: boolean;
/// ///
function GetAsNumber: Double;
function GetAsInteger: Integer;
function GetAsString: AnsiString;
function GetAsBoolean: boolean;
function GetAsLightUserData: Pointer;
end;
TLuaValueType = (lvtNil, lvtNumber, lvtInteger, lvtString, lvtBoolean, lvtLightUserData,
lvtTable, lvtFunction, lvtUserData, lvtThread);
TLuaValue = class(TInterfacedObject, ILuaValue)
strict private
FLuaValueType: TLuaValueType;
strict
private
protected
/// ///
function IsNil: boolean;
function IsNumber: boolean;
function IsInteger: boolean;
function IsString: boolean;
function IsBoolean: boolean;
function IsLightUserData: boolean;
/// ///
function GetAsNumber: Double;
function GetAsInteger: Integer;
function GetAsString: AnsiString;
function GetAsBoolean: boolean;
function GetAsLightUserData: Pointer;
private
procedure CheckType(LuaValueType: TLuaValueType);
protected
FValue: TValue;
constructor Create(LuaState: Plua_State; StackIndex: Integer);
{ todo }
function GetAsLuaTable(LuaState: Plua_State; StackIndex: Integer): TValue;
public
class function GetLuaValueType(LuaState: Plua_State; StackIndex: Integer): TLuaValueType;
end;
TLuaEngine = class
strict protected
LState: Plua_State;
public
constructor Create; overload; virtual;
constructor Create(const AScript: String); overload; virtual;
destructor Destroy; override;
procedure LoadScript(const AScript: AnsiString); overload;
procedure LoadScript(const AStream: TStream; AOwnStream: boolean = true); overload;
procedure LoadFromFile(const AFileName: String);
procedure Execute;
// PUSH methods for simple types
function DeclareGlobalNil(AName: AnsiString): TLuaEngine;
function DeclareGlobalNumber(AName: AnsiString; AValue: Double): TLuaEngine;
function DeclareGlobalInteger(AName: AnsiString; AValue: Integer): TLuaEngine;
function DeclareGlobalString(AName: AnsiString; AValue: AnsiString): TLuaEngine;
function DeclareGlobalBoolean(AName: AnsiString; AValue: boolean): TLuaEngine;
function DeclareGlobalLightUserData(AName: AnsiString; AValue: Pointer): TLuaEngine;
// GET methods for simple types
function GetGlobal(AName: AnsiString): ILuaValue;
end;
implementation
{ TLuaEngine }
constructor TLuaEngine.Create;
begin
inherited Create;
LState := lua_open;
if not assigned(LState) then
raise ELuaException.Create('Cannot initialize Lua');
luaL_openlibs(LState);
end;
constructor TLuaEngine.Create(const AScript: String);
begin
Create;
LoadScript(AScript);
end;
function TLuaEngine.DeclareGlobalBoolean(AName: AnsiString; AValue: boolean): TLuaEngine;
var
b: Integer;
begin
if AValue then
b := 1
else
b := 0;
lua_pushboolean(LState, b);
lua_setglobal(LState, PAnsiChar(AName));
end;
function TLuaEngine.DeclareGlobalInteger(AName: AnsiString; AValue: Integer): TLuaEngine;
begin
lua_pushinteger(LState, AValue);
lua_setglobal(LState, PAnsiChar(AName));
end;
function TLuaEngine.DeclareGlobalLightUserData(AName: AnsiString; AValue: Pointer): TLuaEngine;
begin
lua_pushlightuserdata(LState, AValue);
lua_setglobal(LState, PAnsiChar(AName));
end;
function TLuaEngine.DeclareGlobalNil(AName: AnsiString): TLuaEngine;
begin
lua_pushnil(LState);
lua_setglobal(LState, PAnsiChar(AName));
end;
function TLuaEngine.DeclareGlobalNumber(AName: AnsiString; AValue: Double): TLuaEngine;
begin
lua_pushnumber(LState, AValue);
lua_setglobal(LState, PAnsiChar(AName));
end;
function TLuaEngine.DeclareGlobalString(AName: AnsiString; AValue: AnsiString): TLuaEngine;
begin
lua_pushstring(LState, PAnsiChar(AValue));
lua_setglobal(LState, PAnsiChar(AName));
end;
destructor TLuaEngine.Destroy;
begin
lua_close(LState);
inherited;
end;
procedure TLuaEngine.Execute;
var
err: PAnsiChar;
r: Integer;
begin
r := lua_pcall(LState, 0, 0, 0);
case r of
// success
0:
begin
lua_pop(LState, lua_gettop(LState));
end;
// a runtime error.
LUA_ERRRUN:
begin
err := lua_tostring(LState, -1);
raise ELuaException.CreateFmt('Runtime error [%s]', [err]);
lua_pop(LState, 1);
end;
// memory allocation error. For such errors, Lua does not call the error handler function.
LUA_ERRMEM:
begin
err := lua_tostring(LState, -1);
raise ELuaException.CreateFmt('Memory allocation error [%s]', [err]);
lua_pop(LState, 1);
end;
// error while running the error handler function.
LUA_ERRERR:
begin
err := lua_tostring(LState, -1);
raise ELuaException.CreateFmt('Error while running the error handler function [%s]', [err]);
lua_pop(LState, 1);
end;
else
begin
err := lua_tostring(LState, -1);
raise ELuaException.CreateFmt('Unknown Error [%s]', [err]);
lua_pop(LState, 1);
end;
end;
end;
function TLuaEngine.GetGlobal(AName: AnsiString): ILuaValue;
begin
lua_getglobal(LState, PAnsiChar(AName));
Result := TLuaValue.Create(LState, -1);
end;
procedure TLuaEngine.LoadFromFile(const AFileName: String);
var
err: PAnsiChar;
begin
if luaL_loadfile(LState, PAnsiChar(AFileName)) <> 0 then
begin
err := lua_tostring(LState, -1);
lua_pop(LState, 1);
raise ELuaException.Create(err);
end;
end;
procedure TLuaEngine.LoadScript(const AStream: TStream; AOwnStream: boolean);
var
sr: TStreamReader;
s: string;
begin
sr := TStreamReader.Create(AStream);
try
if AOwnStream then
sr.OwnStream;
s := sr.ReadToEnd;
LoadScript(s);
finally
sr.Free;
end;
end;
procedure TLuaEngine.LoadScript(const AScript: AnsiString);
var
err: PAnsiChar;
begin
if luaL_loadstring(LState,
PAnsiChar(AScript)) <> 0 then
begin
err := lua_tostring(LState, -1);
lua_pop(LState, 1);
raise ELuaException.Create(err);
end;
end;
{ TLuaValue }
constructor TLuaValue.Create(LuaState: Plua_State; StackIndex: Integer);
var
a: AnsiString;
_lua_CFunction: lua_CFunction;
_pluastate: Plua_State;
begin
inherited Create;
FLuaValueType := GetLuaValueType(LuaState, StackIndex);
case FLuaValueType of
lvtNil:
FValue := nil;
lvtNumber:
FValue := lua_tonumber(LuaState, StackIndex);
lvtInteger:
FValue := lua_tointeger(LuaState, StackIndex);
lvtString:
begin
a := lua_tostring(LuaState, StackIndex);
FValue := a;
end;
lvtBoolean:
FValue := lua_toboolean(LuaState, StackIndex) = 1;
lvtLightUserData:
FValue := lua_topointer(LuaState, StackIndex);
lvtTable:
begin
FValue := GetAsLuaTable(LuaState, StackIndex);
end;
lvtFunction:
begin
_lua_CFunction := lua_tocfunction(LuaState, StackIndex);
FValue := nil; { todo }
end;
lvtUserData:
FValue := lua_touserdata(LuaState, StackIndex);
lvtThread:
begin
_pluastate := lua_tothread(LuaState, StackIndex);
FValue := nil; { todo }
end;
end;
end;
class function TLuaValue.GetLuaValueType(LuaState: Plua_State; StackIndex: Integer):
TLuaValueType;
begin
case lua_type(LuaState, StackIndex) of
LUA_TNIL:
Result := lvtNil;
LUA_TNUMBER:
Result := lvtNumber;
LUA_TBOOLEAN:
Result := lvtBoolean;
LUA_TSTRING:
Result := lvtString;
LUA_TTABLE:
Result := lvtTable;
LUA_TFUNCTION:
Result := lvtFunction;
LUA_TUSERDATA:
Result := lvtUserData;
LUA_TTHREAD:
Result := lvtThread;
LUA_TLIGHTUSERDATA:
Result := lvtLightUserData;
LUA_TNONE:
raise ELuaException.Create('Invalid stack index location');
end;
end;
procedure TLuaValue.CheckType(LuaValueType: TLuaValueType);
begin
if FLuaValueType <> LuaValueType then
raise ELuaException.Create('Cannot access value as ' + inttostr(Integer(LuaValueType)));
end;
function TLuaValue.GetAsBoolean:
boolean;
begin
CheckType(lvtBoolean);
Result := FValue.AsBoolean;
end;
function TLuaValue.GetAsInteger: Integer;
begin
CheckType(lvtInteger);
Result := FValue.AsInteger;
end;
function TLuaValue.GetAsLightUserData: Pointer;
begin
CheckType(lvtLightUserData);
Result := FValue.AsType<Pointer>;
end;
function TLuaValue.GetAsLuaTable(LuaState: Plua_State; StackIndex: Integer): TValue;
begin
{ todo }
end;
function TLuaValue.GetAsNumber: Double;
begin
CheckType(lvtNumber);
Result := FValue.AsExtended;
end;
function TLuaValue.GetAsString: AnsiString;
begin
CheckType(lvtString);
Result := FValue.AsString;
end;
function TLuaValue.IsBoolean: boolean;
begin
Result := FLuaValueType = lvtBoolean;
end;
function TLuaValue.IsInteger: boolean;
begin
Result := FLuaValueType = lvtInteger;
end;
function TLuaValue.IsLightUserData: boolean;
begin
Result := FLuaValueType = lvtLightUserData;
end;
function TLuaValue.IsNil: boolean;
begin
Result := FLuaValueType = lvtNil;
end;
function TLuaValue.IsNumber: boolean;
begin
Result := FLuaValueType = lvtNumber;
end;
function TLuaValue.IsString: boolean;
begin
Result := FLuaValueType = lvtString;
end;
end.

View File

@ -0,0 +1,52 @@
object MainForm: TMainForm
Left = 0
Top = 0
Caption = 'PlaygroundForm'
ClientHeight = 404
ClientWidth = 533
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 8
Top = 8
Width = 145
Height = 49
Caption = 'lua_pcall'
TabOrder = 0
OnClick = Button1Click
end
object Button2: TButton
Left = 159
Top = 8
Width = 179
Height = 49
Caption = 'Load Config File'
TabOrder = 1
OnClick = Button2Click
end
object Button3: TButton
Left = 8
Top = 63
Width = 515
Height = 50
Caption = 'push_object_properties'
TabOrder = 2
OnClick = Button3Click
end
object Button4: TButton
Left = 344
Top = 8
Width = 179
Height = 49
Caption = 'GetGlobal'
TabOrder = 3
OnClick = Button4Click
end
end

View File

@ -0,0 +1,495 @@
unit MainFormU;
interface
uses
Winapi.Windows,
Winapi.Messages,
System.SysUtils,
System.Variants,
System.Classes,
Vcl.Graphics,
Vcl.Controls,
Vcl.Forms,
Vcl.Dialogs,
Vcl.StdCtrls,
Data.DB,
Datasnap.DBClient,
Vcl.ExtCtrls,
Vcl.DBCtrls,
Vcl.Grids,
Vcl.DBGrids;
type
TMainForm = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button5Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
TPersona = class
private
FAge : Integer;
FLastName : string;
FFirstName: string;
FBornDate : TDateTime;
FChild : TPersona;
procedure SetAge(const Value: Integer);
procedure SetFirstName(const Value: string);
procedure SetLastName(const Value: string);
procedure SetBornDate(const Value: TDateTime);
procedure SetChild(const Value: TPersona);
public
class function NewPersona: TPersona;
property FirstName: string read FFirstName write SetFirstName;
property LastName: string read FLastName write SetLastName;
property Age: Integer read FAge write SetAge;
property BornDate: TDateTime read FBornDate write SetBornDate;
property Child: TPersona read FChild write SetChild;
end;
var
MainForm: TMainForm;
implementation
uses
rtti,
System.TypInfo,
LuaBind.Intf,
LuaBind;
{$R *.dfm}
procedure TMainForm.Button1Click(Sender: TObject);
var
state: Plua_State;
begin
state := lua_open;
if not assigned(state) then
raise Exception.Create('Cannot initialize Lua');
try
luaL_openlibs(state);
if luaL_loadstring(state,
'days = {"Sunday", "Monday", "Tuesday", "Wednesday"}; ' +
'print(days[2]);') = 0 then
begin
if lua_pcall(state, 0, 1, 0) <> 0 then
begin
ShowMessage(lua_tostring(state, - 1));
lua_pop(state, 1);
end
else
begin
lua_pop(state, lua_gettop(state));
end;
end
else
begin
ShowMessage(lua_tostring(state, - 1));
lua_pop(state, 1);
end;
finally
lua_close(state);
end;
end;
function MyFunctionForLua(L: Plua_State): Integer; cdecl;
var
v: pansichar;
s: ansistring;
begin
s := uppercase(lua_tostring(L, 1));
lua_pushstring(L, pansichar(s));
Result := 1; // * number of results * /
end;
function myfullname(L: Plua_State): Integer; cdecl;
var
v: pansichar;
s: ansistring;
begin
assert(lua_istable(L, - 1));
lua_getfield(L, - 1, pansichar('nome'));
s := lua_tostring(L, - 1);
lua_pushstring(L, pansichar(s));
Result := 1; // * number of results * /
end;
function _setcaption(L: Plua_State): Integer; cdecl;
var
form : TForm;
newcaption: ansistring;
begin
assert(lua_type(L, - 1) = LUA_TSTRING);
assert(lua_type(L, - 2) = LUA_TLIGHTUSERDATA);
newcaption := lua_tostring(L, - 1);
lua_pop(L, 1);
form := TForm(lua_topointer(L, - 1));
lua_pop(L, 1);
form.Caption := newcaption;
Result := 0;
end;
function doSomethingOnDelphiObject(L: Plua_State): Integer; cdecl;
var
v : pansichar;
s : ansistring;
p : Pointer;
form: TMainForm;
begin
// TFileStream.Create('', fmCreate);
assert(lua_islightuserdata(L, - 1));
// lua_pop(L, );
p := lua_topointer(L, - 1);
lua_pop(L, 1);
form := TMainForm(p);
form.Caption := 'Cambiato da Lua';
// lua_getfield(L, -1, pansichar('nome'));
// s := lua_tostring(L, -1);
// lua_pushstring(L, pansichar(s));
//
Result := 0; // * number of results * /
end;
procedure SetSomeTables(L: Plua_State);
begin
lua_newtable(L);
lua_pushstring(L, 'nome');
lua_pushstring(L, 'Daniele');
lua_settable(L, - 3);
lua_pushstring(L, 'cognome');
lua_pushstring(L, 'Teti');
lua_settable(L, - 3);
lua_pushstring(L, 'eta');
lua_pushnumber(L, 3);
lua_settable(L, - 3);
lua_pushstring(L, 'fullname');
lua_pushcfunction(L, @myfullname);
lua_settable(L, - 3);
lua_setglobal(L, 'daniele');
end;
// procedure SetSomeTables(L: Plua_State);
// begin
// lua_newtable(L);
// lua_pushstring(L, 'nome');
// lua_pushstring(L, 'Daniele');
// lua_pushstring(L, 'cognome');
// lua_pushnumber(L, 2);
// lua_pushstring(L, 'eta');
// lua_pushnumber(L, 3);
// lua_pushstring(L, 'fullname');
// lua_pushcfunction(L, @myfullname);
// lua_settable(L, -9);
// lua_settable(L, -7);
// lua_settable(L, -5);
// lua_settable(L, -3);
// lua_setglobal(L, 'daniele');
// end;
procedure SetSomeVariables(L: Plua_State);
begin
lua_pushnumber(L, 11);
lua_pushnumber(L, 22);
lua_pushnumber(L, 33);
lua_setglobal(L, 'x3');
lua_setglobal(L, 'x2');
lua_setglobal(L, 'x1');
end;
function Load(filename: ansistring; out AWidth: Integer;
out AHeight: Integer): string;
var
L : Plua_State;
AStringa: string;
begin
L := lua_open();
luaL_openlibs(L);
// luaopen_base(L);
// luaopen_io(L);
// luaopen_string(L);
// luaopen_math(L);
if (luaL_loadfile(L, pansichar(filename)) > 0) then
begin
Exit('Cannot run configuration file ' + lua_tostring(L, - 1));
end;
SetSomeVariables(L);
SetSomeTables(L);
lua_pushcfunction(L, @MyFunctionForLua);
lua_setglobal(L, 'delphiuppercase');
lua_pushcfunction(L, @doSomethingOnDelphiObject);
lua_setglobal(L, 'dosomething');
lua_pushcfunction(L, @_setcaption);
lua_setglobal(L, '_setcaption');
lua_pushlightuserdata(L, MainForm);
lua_setglobal(L, 'form');
if lua_pcall(L, 0, 0, 0) > 0 then
begin
Exit('Cannot exec configuration file ' + lua_tostring(L, - 1));
end;
lua_getglobal(L, 'width');
lua_getglobal(L, 'height');
lua_getglobal(L, 'stringa');
if (lua_isnumber(L, - 3) = 0) then
Exit('Width should be a number');
if (lua_isnumber(L, - 2) = 0) then
Exit('Height should be a number');
if (lua_isstring(L, - 1) = 0) then
Exit('stringa should be a string');
AWidth := lua_tointeger(L, - 3);
AHeight := lua_tointeger(L, - 2);
AStringa := lua_tostring(L, - 1);
lua_close(L);
Result := Format('Width: %d, Height: %d, Stringa: %s',
[AWidth, AHeight, AStringa]);
end;
procedure TMainForm.Button2Click(Sender: TObject);
var
w: Integer;
h: Integer;
begin
ShowMessage(Load('config.lua', w, h));
end;
procedure push_object_properties(L: Plua_State; AObject: TObject;
AName: string);
var
prop : TRttiProperty;
ctx : TRttiContext;
properties: TArray<TRttiProperty>;
k : ansistring;
Value : TValue;
v : ansistring;
begin
ctx := TRttiContext.Create;
try
lua_newtable(L);
properties := ctx.GetType(AObject.ClassType).GetProperties;
for prop in properties do
begin
k := prop.Name;
lua_pushstring(L, pansichar(k));
Value := prop.GetValue(AObject);
if Value.TypeInfo^.Kind in [tkString, tkUString] then
begin
v := Value.AsString;
lua_pushstring(L, pansichar(v));
end
else if Value.TypeInfo^.Kind = tkInteger then
begin
lua_pushnumber(L, Value.AsInteger);
end
else if Value.TypeInfo^.Kind = tkFloat then
begin
lua_pushnumber(L, Value.AsExtended);
end
else if Value.TypeInfo^.Kind = tkClass then
begin
if Value.IsEmpty then
lua_pushnil(L)
else
push_object_properties(L, Value.AsObject, '');
end;
lua_settable(L, - 3);
end;
finally
ctx.Free;
end;
end;
procedure push_table(L: Plua_State; Keys: array of ansistring;
Values: array of ansistring);
var
key : TObject;
I : Integer;
k : ansistring;
v : ansistring;
pvalue, pkey: pansichar;
le : Cardinal;
begin
// lua_newtable(L);
// pkey := GetMemory(Length('firstname') + 1);
// pkey := StrCopy(pkey, pansichar('firstname'));
// lua_pushstring(L, pkey);
// //lua_pushstring(L, 'firstname');
// lua_pushstring(L, 'Daniele');
// lua_settable(L, -3);
// lua_pushstring(L, 'lastname');
// lua_pushstring(L, 'Teti');
// lua_settable(L, -3);
lua_newtable(L);
for I := 0 to high(Keys) do
begin
k := Keys[I];
v := Values[I];
lua_pushstring(L, pansichar(k));
lua_pushstring(L, pansichar(v));
lua_settable(L, - 3);
end;
// k := Keys[I];
// pkey := GetMemory(Length(k) + 1);
// ZeroMemory(pkey, Length(k) + 1);
// MoveMemory(pkey, pansichar(k), Length(k));
/// / pkey := StrPCopy(pkey, pansichar(k));
//
// v := Values[I];
// pvalue := GetMemory(Length(v) + 1);
// pvalue := StrCopy(pvalue, pansichar(v));
//
// lua_pushstring(L, pkey);
// lua_pushstring(L, pvalue);
// lua_settable(L, -3);
end;
procedure TMainForm.Button3Click(Sender: TObject);
var
L : Plua_State;
persona: TPersona;
begin
persona := TPersona.Create;
try
persona.FirstName := 'Daniele';
persona.LastName := 'Teti';
persona.Age := 32;
persona.BornDate := date;
persona.Child := TPersona.NewPersona;
L := lua_open;
try
luaL_openlibs(L);
if luaL_loadfile(L, 'test01.html') > 0 then
raise Exception.Create('Cannot run configuration file ' +
lua_tostring(L, - 1));
// push_table(L, ['firstname', 'lastname'], ['Daniele', 'Teti']);
push_object_properties(L, persona, 'persona');
lua_setglobal(L, 'persona');
if lua_pcall(L, 0, 0, 0) > 0 then
begin
raise Exception.Create('Cannot exec configuration file ' +
lua_tostring(L, - 1));
end;
lua_getglobal(L, 'p');
ShowMessage(lua_tostring(L, - 1));
finally
lua_close(L);
end;
finally
persona.Child.Free;
persona.Free;
end;
end;
procedure TMainForm.Button4Click(Sender: TObject);
var
lua: TLuaEngine;
v : ILuaValue;
begin
lua := TLuaEngine.Create;
try
lua.LoadScript(
'local z = y + 2;' + sLineBreak +
'x = y + 1 + z;');
lua.DeclareGlobalInteger('y', 4);
lua.Execute;
v := lua.GetGlobal('x');
if v.IsNumber then
ShowMessage(FloatToStr(v.GetAsNumber));
finally
lua.Free;
end;
end;
procedure TMainForm.Button5Click(Sender: TObject);
begin
// ClientDataSet1.SaveToFile(ClientDataSet1.filename);
// ClientDataSet1.Close;
end;
procedure TMainForm.FormCreate(Sender: TObject);
begin
// ClientDataSet1.Close;
// ClientDataSet1.filename := '..\..\..\unittests\win32\debug\samplecds.xml';
// ClientDataSet1.Open;
end;
{ TPersona }
class function TPersona.NewPersona: TPersona;
begin
Result := TPersona.Create;
Result.FirstName := 'Mattia';
Result.LastName := 'Teti';
Result.Age := 1;
Result.BornDate := EncodeDate(2011, 11, 17);
end;
procedure TPersona.SetAge(const Value: Integer);
begin
FAge := Value;
end;
procedure TPersona.SetBornDate(const Value: TDateTime);
begin
FBornDate := Value;
end;
procedure TPersona.SetChild(const Value: TPersona);
begin
FChild := Value;
end;
procedure TPersona.SetFirstName(const Value: string);
begin
FFirstName := Value;
end;
procedure TPersona.SetLastName(const Value: string);
begin
FLastName := Value;
end;
end.

View File

@ -0,0 +1,27 @@
program LuaBindingUnitTests;
{$IFDEF CONSOLE_TESTRUNNER}
{$APPTYPE CONSOLE}
{$ENDIF}
uses
DUnitTestRunner,
TestLuaWrapper in 'TestLuaWrapper.pas',
TestObjects in 'TestObjects.pas',
TestLuaEmbeddedTextFilter in 'TestLuaEmbeddedTextFilter.pas',
LuaBind.Filters.Text in '..\LuaBind.Filters.Text.pas',
LuaBind.Intf in '..\LuaBind.Intf.pas',
LuaBind.CustomType.DataSet in '..\LuaBind.CustomType.DataSet.pas',
LuaBind.CustomType.PODO in '..\LuaBind.CustomType.PODO.pas',
LuaBind.CustomType.UserType in '..\LuaBind.CustomType.UserType.pas',
LuaBind in '..\LuaBind.pas',
LuaBind.DelphiObjects in '..\LuaBind.DelphiObjects.pas';
{$R *.RES}
begin
ReportMemoryLeaksOnShutdown := True;
DUnitTestRunner.RunRegisteredTests;
end.

View File

@ -0,0 +1,971 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{617B701F-53AB-42BC-8140-9BEC89FB3469}</ProjectGuid>
<ProjectVersion>19.3</ProjectVersion>
<FrameworkType>None</FrameworkType>
<Base>True</Base>
<Config Condition="'$(Config)'==''">Debug</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Console</AppType>
<MainSource>LuaBindingUnitTests.dpr</MainSource>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Android' and '$(Base)'=='true') or '$(Base_Android)'!=''">
<Base_Android>true</Base_Android>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Android64' and '$(Base)'=='true') or '$(Base_Android64)'!=''">
<Base_Android64>true</Base_Android64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
<Base_Win32>true</Base_Win32>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
<Base_Win64>true</Base_Win64>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
<Cfg_1>true</Cfg_1>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Cfg_1)'=='true') or '$(Cfg_1_Win32)'!=''">
<Cfg_1_Win32>true</Cfg_1_Win32>
<CfgParent>Cfg_1</CfgParent>
<Cfg_1>true</Cfg_1>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
<Cfg_2>true</Cfg_2>
<CfgParent>Base</CfgParent>
<Base>true</Base>
</PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''">
<SanitizedProjectName>LuaBindingUnitTests</SanitizedProjectName>
<Icns_MainIcns>$(BDS)\bin\delphi_PROJECTICNS.icns</Icns_MainIcns>
<Icon_MainIcon>$(BDS)\bin\delphi_PROJECTICON.ico</Icon_MainIcon>
<DCC_UnitSearchPath>$(BDS)\Source\DUnit\src;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<DCC_Define>_CONSOLE_TESTRUNNER;$(DCC_Define)</DCC_Define>
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;$(DCC_Namespace)</DCC_Namespace>
<DCC_UsePackage>fmx;IndySystem;DBXInterBaseDriver;DataSnapCommon;DataSnapClient;DataSnapServer;DataSnapProviderClient;DbxCommonDriver;dbxcds;DBXOracleDriver;CustomIPTransport;AureliusXE2;dsnap;IndyCore;fmxase;inetdbxpress;IPIndyImpl;bindcompfmx;rtl;dbrtl;DbxClientDriver;bindcomp;inetdb;xmlrtl;ibxpress;IndyProtocols;DBXMySQLDriver;bindengine;soaprtl;DBXInformixDriver;DBXFirebirdDriver;inet;fmxobj;LKSL;DBXSybaseASADriver;fmxdae;dbexpress;DataSnapIndy10ServerTransport;$(DCC_UsePackage)</DCC_UsePackage>
<DCC_DcuOutput>.</DCC_DcuOutput>
<DCC_ExeOutput>.\$(Platform)\$(Config)</DCC_ExeOutput>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Android)'!=''">
<Android_SplashImage470>$(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png</Android_SplashImage470>
<Android_LauncherIcon72>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png</Android_LauncherIcon72>
<Android_SplashImage640>$(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png</Android_SplashImage640>
<AUP_CAMERA>true</AUP_CAMERA>
<AUP_CALL_PHONE>true</AUP_CALL_PHONE>
<AUP_WRITE_EXTERNAL_STORAGE>true</AUP_WRITE_EXTERNAL_STORAGE>
<AUP_ACCESS_COARSE_LOCATION>true</AUP_ACCESS_COARSE_LOCATION>
<Android_LauncherIcon48>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png</Android_LauncherIcon48>
<Android_SplashImage426>$(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png</Android_SplashImage426>
<AUP_READ_EXTERNAL_STORAGE>true</AUP_READ_EXTERNAL_STORAGE>
<Android_SplashImage960>$(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png</Android_SplashImage960>
<Android_LauncherIcon96>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png</Android_LauncherIcon96>
<AUP_WRITE_CALENDAR>true</AUP_WRITE_CALENDAR>
<BT_BuildType>Debug</BT_BuildType>
<AUP_ACCESS_FINE_LOCATION>true</AUP_ACCESS_FINE_LOCATION>
<EnabledSysJars>android-support-v4.dex.jar;apk-expansion.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar</EnabledSysJars>
<AUP_INTERNET>true</AUP_INTERNET>
<AUP_READ_CALENDAR>true</AUP_READ_CALENDAR>
<AUP_READ_PHONE_STATE>true</AUP_READ_PHONE_STATE>
<VerInfo_Keys>package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
<Android_LauncherIcon144>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png</Android_LauncherIcon144>
<Android_LauncherIcon36>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png</Android_LauncherIcon36>
<Android_NotificationIcon24>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_24x24.png</Android_NotificationIcon24>
<Android_NotificationIcon36>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_36x36.png</Android_NotificationIcon36>
<Android_NotificationIcon48>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_48x48.png</Android_NotificationIcon48>
<Android_NotificationIcon72>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_72x72.png</Android_NotificationIcon72>
<Android_NotificationIcon96>$(BDS)\bin\Artwork\Android\FM_NotificationIcon_96x96.png</Android_NotificationIcon96>
<Android_LauncherIcon192>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png</Android_LauncherIcon192>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Android64)'!=''">
<VerInfo_Keys>package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey=</VerInfo_Keys>
<BT_BuildType>Debug</BT_BuildType>
<Base_Android>true</Base_Android>
<CfgParent>Base</CfgParent>
<Base>true</Base>
<Android_SplashImage470>$(BDS)\bin\Artwork\Android\FM_SplashImage_470x320.png</Android_SplashImage470>
<Android_LauncherIcon72>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_72x72.png</Android_LauncherIcon72>
<Android_SplashImage640>$(BDS)\bin\Artwork\Android\FM_SplashImage_640x480.png</Android_SplashImage640>
<AUP_CAMERA>true</AUP_CAMERA>
<AUP_CALL_PHONE>true</AUP_CALL_PHONE>
<AUP_WRITE_EXTERNAL_STORAGE>true</AUP_WRITE_EXTERNAL_STORAGE>
<AUP_ACCESS_COARSE_LOCATION>true</AUP_ACCESS_COARSE_LOCATION>
<Android_LauncherIcon48>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_48x48.png</Android_LauncherIcon48>
<Android_SplashImage426>$(BDS)\bin\Artwork\Android\FM_SplashImage_426x320.png</Android_SplashImage426>
<AUP_READ_EXTERNAL_STORAGE>true</AUP_READ_EXTERNAL_STORAGE>
<Android_SplashImage960>$(BDS)\bin\Artwork\Android\FM_SplashImage_960x720.png</Android_SplashImage960>
<Android_LauncherIcon96>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_96x96.png</Android_LauncherIcon96>
<AUP_WRITE_CALENDAR>true</AUP_WRITE_CALENDAR>
<AUP_ACCESS_FINE_LOCATION>true</AUP_ACCESS_FINE_LOCATION>
<EnabledSysJars>android-support-v4.dex.jar;apk-expansion.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar</EnabledSysJars>
<AUP_INTERNET>true</AUP_INTERNET>
<AUP_READ_CALENDAR>true</AUP_READ_CALENDAR>
<AUP_READ_PHONE_STATE>true</AUP_READ_PHONE_STATE>
<Android_LauncherIcon144>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_144x144.png</Android_LauncherIcon144>
<Android_LauncherIcon36>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_36x36.png</Android_LauncherIcon36>
<Android_LauncherIcon192>$(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png</Android_LauncherIcon192>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<DCC_UsePackage>JvGlobus;JvMM;JvDlgs;JvCrypt;TeeDB;Rave100VCL;vclib;inetdbbde;DBXSybaseASEDriver;vclimg;DataBindingsVCL160;fmi;vcldb;vcldsnap;dac160;unidacvcl160;DBXDb2Driver;Intraweb_120_160;dwsLibRuntime;JvCore;vclribbon;frxe16;vcl;CloudService;DBXMSSQLDriver;CodeSiteExpressPkg;unidac160;FmxTeeUI;JvAppFrm;JvRuntimeDesign;webdsnap;JclDeveloperTools;adortl;JvWizards;SimpleGraphPackage;NewAC;OpenWirePkgD16;vcldbx;frx16;DotNet4Delphi_XE2;crcontrols160;JclContainers;Tee;DataBindings;DBXOdbcDriver;JvCmp;JvSystem;svnui;adgrmxe2;JvControls;frxDB16;intrawebdb_120_160;fs16;vclactnband;FMXTee;TeeUI;bindcompvcl;JvStdCtrls;JvCustom;Jcl;vclie;vcltouch;dacvcl160;websnap;VclSmp;fsDB16;DataSnapConnectors;RlxPackage;dsnapcon;JclVcl;JvPascalInterpreter;vclx;Lua4Delphi;svn;bdertl;$(DCC_UsePackage)</DCC_UsePackage>
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_Keys>CompanyName=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName);FileDescription=$(MSBuildProjectName);ProductName=$(MSBuildProjectName)</VerInfo_Keys>
<DCC_ExeOutput>..\samples\bin</DCC_ExeOutput>
<Manifest_File>(None)</Manifest_File>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win64)'!=''">
<DCC_UsePackage>vclib;DBXSybaseASEDriver;vclimg;vcldb;vcldsnap;DBXDb2Driver;vcl;DBXMSSQLDriver;webdsnap;adortl;DBXOdbcDriver;adgrmxe2;vclactnband;bindcompvcl;vclie;vcltouch;websnap;VclSmp;DataSnapConnectors;dsnapcon;vclx;$(DCC_UsePackage)</DCC_UsePackage>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1)'!=''">
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
<DCC_Optimize>false</DCC_Optimize>
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
<DCC_RemoteDebug>true</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">
<DCC_MapFile>3</DCC_MapFile>
<Manifest_File>None</Manifest_File>
<VerInfo_Locale>1033</VerInfo_Locale>
<DCC_RemoteDebug>false</DCC_RemoteDebug>
</PropertyGroup>
<PropertyGroup Condition="'$(Cfg_2)'!=''">
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
<DCC_DebugInformation>0</DCC_DebugInformation>
</PropertyGroup>
<ItemGroup>
<DelphiCompile Include="$(MainSource)">
<MainSource>MainSource</MainSource>
</DelphiCompile>
<DCCReference Include="TestLuaWrapper.pas"/>
<DCCReference Include="TestObjects.pas"/>
<DCCReference Include="TestLuaEmbeddedTextFilter.pas"/>
<DCCReference Include="..\LuaBind.Filters.Text.pas"/>
<DCCReference Include="..\LuaBind.Intf.pas"/>
<DCCReference Include="..\LuaBind.CustomType.DataSet.pas"/>
<DCCReference Include="..\LuaBind.CustomType.PODO.pas"/>
<DCCReference Include="..\LuaBind.CustomType.UserType.pas"/>
<DCCReference Include="..\LuaBind.pas"/>
<DCCReference Include="..\LuaBind.DelphiObjects.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
</BuildConfiguration>
<BuildConfiguration Include="Debug">
<Key>Cfg_1</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
<BuildConfiguration Include="Release">
<Key>Cfg_2</Key>
<CfgParent>Base</CfgParent>
</BuildConfiguration>
</ItemGroup>
<ProjectExtensions>
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
<Borland.ProjectType/>
<BorlandProject>
<Delphi.Personality>
<VersionInfo>
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
<VersionInfo Name="MajorVer">1</VersionInfo>
<VersionInfo Name="MinorVer">0</VersionInfo>
<VersionInfo Name="Release">0</VersionInfo>
<VersionInfo Name="Build">0</VersionInfo>
<VersionInfo Name="Debug">False</VersionInfo>
<VersionInfo Name="PreRelease">False</VersionInfo>
<VersionInfo Name="Special">False</VersionInfo>
<VersionInfo Name="Private">False</VersionInfo>
<VersionInfo Name="DLL">False</VersionInfo>
<VersionInfo Name="Locale">1040</VersionInfo>
<VersionInfo Name="CodePage">1252</VersionInfo>
</VersionInfo>
<VersionInfoKeys>
<VersionInfoKeys Name="CompanyName"/>
<VersionInfoKeys Name="FileDescription"/>
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="InternalName"/>
<VersionInfoKeys Name="LegalCopyright"/>
<VersionInfoKeys Name="LegalTrademarks"/>
<VersionInfoKeys Name="OriginalFilename"/>
<VersionInfoKeys Name="ProductName"/>
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
<VersionInfoKeys Name="Comments"/>
</VersionInfoKeys>
<Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcboffice2k280.bpl">Embarcadero C++Builder Office 2000 Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\bcbofficexp280.bpl">Embarcadero C++Builder Office XP Servers Package</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k280.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
<Excluded_Packages Name="$(BDSBIN)\dclofficexp280.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
</Excluded_Packages>
<Source>
<Source Name="MainSource">LuaBindingUnitTests.dpr</Source>
</Source>
</Delphi.Personality>
<Deployment Version="3">
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libPCRE.dylib" Class="DependencyModule"/>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libpcre.dylib" Class="DependencyModule">
<Platform Name="iOSSimulator">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\osx32\libcgunwind.1.0.dylib" Class="DependencyModule">
<Platform Name="OSX32">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployFile LocalName="$(BDS)\Redist\iossimulator\libcgunwind.1.0.dylib" Class="DependencyModule">
<Platform Name="iOSSimulator">
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidClasses">
<Platform Name="Android">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>classes</RemoteDir>
<Operation>64</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidFileProvider">
<Platform Name="Android">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\xml</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidGDBServer">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiFile">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeArmeabiv7aFile">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidLibnativeMipsFile">
<Platform Name="Android">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\mips</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidServiceOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashImageDef">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStyles">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="AndroidSplashStylesV21">
<Platform Name="Android">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values-v21</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Colors">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_DefaultAppIcon">
<Platform Name="Android">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon144">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon192">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-ldpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_LauncherIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon24">
<Platform Name="Android">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-mdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon36">
<Platform Name="Android">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-hdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon48">
<Platform Name="Android">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon72">
<Platform Name="Android">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_NotificationIcon96">
<Platform Name="Android">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xxxhdpi</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage426">
<Platform Name="Android">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-small</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage470">
<Platform Name="Android">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-normal</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage640">
<Platform Name="Android">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-large</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_SplashImage960">
<Platform Name="Android">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\drawable-xlarge</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="Android_Strings">
<Platform Name="Android">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>res\values</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DebugSymbols">
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyFramework">
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.framework</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="DependencyModule">
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.dll;.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="DependencyPackage">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
<Extensions>.dylib</Extensions>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
<Extensions>.bpl</Extensions>
</Platform>
</DeployClass>
<DeployClass Name="File">
<Platform Name="Android">
<Operation>0</Operation>
</Platform>
<Platform Name="Android64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>0</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>0</Operation>
</Platform>
<Platform Name="OSX64">
<Operation>0</Operation>
</Platform>
<Platform Name="OSXARM64">
<Operation>0</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iOS_AppStore1024">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon152">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_AppIcon167">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPad_SpotLight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_AppIcon180">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Launch3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark2x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_LaunchDark3x">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification40">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Notification60">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting58">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Setting87">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight120">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="iPhone_Spotlight80">
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectAndroidManifest">
<Platform Name="Android">
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSDeviceDebug">
<Platform Name="iOSDevice32">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<RemoteDir>..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectiOSEntitlements"/>
<DeployClass Name="ProjectiOSInfoPList"/>
<DeployClass Name="ProjectiOSLaunchScreen"/>
<DeployClass Name="ProjectiOSResource">
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOSXDebug"/>
<DeployClass Name="ProjectOSXEntitlements"/>
<DeployClass Name="ProjectOSXInfoPList"/>
<DeployClass Name="ProjectOSXResource">
<Platform Name="OSX32">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<RemoteDir>Contents\Resources</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Required="true" Name="ProjectOutput">
<Platform Name="Android">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Android64">
<RemoteDir>library\lib\arm64-v8a</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice32">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSDevice64">
<Operation>1</Operation>
</Platform>
<Platform Name="iOSSimulator">
<Operation>1</Operation>
</Platform>
<Platform Name="Linux64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX32">
<Operation>1</Operation>
</Platform>
<Platform Name="OSX64">
<Operation>1</Operation>
</Platform>
<Platform Name="OSXARM64">
<Operation>1</Operation>
</Platform>
<Platform Name="Win32">
<Operation>0</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectOutput_Android32">
<Platform Name="Android64">
<RemoteDir>library\lib\armeabi-v7a</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="ProjectUWPManifest">
<Platform Name="Win32">
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo150">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<DeployClass Name="UWP_DelphiLogo44">
<Platform Name="Win32">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
<Platform Name="Win64">
<RemoteDir>Assets</RemoteDir>
<Operation>1</Operation>
</Platform>
</DeployClass>
<ProjectRoot Platform="OSX32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSX64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win32" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Android" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="Win64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="OSXARM64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSDevice32" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="iOSDevice64" Name="$(PROJECTNAME).app"/>
<ProjectRoot Platform="Linux64" Name="$(PROJECTNAME)"/>
<ProjectRoot Platform="iOSSimulator" Name="$(PROJECTNAME).app"/>
</Deployment>
<Platforms>
<Platform value="Android">False</Platform>
<Platform value="Android64">False</Platform>
<Platform value="Linux64">False</Platform>
<Platform value="Win32">True</Platform>
<Platform value="Win64">False</Platform>
</Platforms>
<UnitTesting>
<TestFramework>DUnit / Delphi Win32</TestFramework>
<TestRunner>GUI</TestRunner>
<SourceProjectName>C:\Users\Daniele\Desktop\luawrapper\mytest\LuaTest.dproj</SourceProjectName>
<TestProjectName/>
</UnitTesting>
</BorlandProject>
<ProjectFileVersion>12</ProjectFileVersion>
</ProjectExtensions>
<Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
<Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
<Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/>
</Project>

View File

@ -0,0 +1,168 @@
unit TestLuaEmbeddedTextFilter;
{
Delphi DUnit Test Case
----------------------
This unit contains a skeleton test case class generated by the Test Case Wizard.
Modify the generated code to correctly setup and call the methods from the unit
being tested.
}
interface
uses
TestFramework,
System.Classes,
TestLuaWrapper,
System.SysUtils,
LuaBind,
LuaBind.Intf,
System.Rtti;
type
TTestEmbeddedTextFilter = class(TTestCase)
strict private
FLuaEngine: TLuaEngine;
public
procedure SetUp; override;
procedure TearDown; override;
published
procedure TestDoAllTests;
procedure TestHelperExecAndGet01;
procedure TestHelperExecAndGetMultiThread;
end;
implementation
uses
System.IOUtils,
LuaBind.Filters.Text,
System.Generics.collections,
System.Types;
{ TTestEmbeddedTextFilter }
procedure TTestEmbeddedTextFilter.SetUp;
begin
inherited;
FLuaEngine := TLuaEngine.Create;
end;
procedure TTestEmbeddedTextFilter.TearDown;
begin
FLuaEngine.Free;
inherited;
end;
procedure TTestEmbeddedTextFilter.TestDoAllTests;
var
luafiles: TStringDynArray;
f : string;
Filter : TLuaEmbeddedTextFilter;
begin
luafiles := TDirectory.GetFiles('embeddedtextfiltertests', '*.elua');
TArray.Sort<string>(luafiles);
for f in luafiles do
begin
Filter := TLuaEmbeddedTextFilter.Create;
try
Filter.OutputFunction := 'io.write';
Filter.TemplateCode := TFile.ReadAllText(f);
Filter.Execute;
TFile.WriteAllText(ChangeFileExt(f, '.lua'), Filter.LuaCode);
try
FLuaEngine.LoadScript(Filter.LuaCode);
FLuaEngine.Execute; // only check if is ok the syntax
except
on E: Exception do
begin
Fail('File ' + f + ' - ' + E.Message);
end;
end;
finally
Filter.Free;
end;
end;
end;
procedure TTestEmbeddedTextFilter.TestHelperExecAndGet01;
var
r: string;
begin
r := TLuaEmbeddedTextFilter.ExecuteWithResult('hello',
['nome', 'cognome'],
['Daniele', 'Teti']);
CheckEquals('hello', r);
r := TLuaEmbeddedTextFilter.ExecuteWithResult('Hello <?lua=nome ?>,<?lua=cognome ?>, how are you?',
['nome', 'cognome'],
['Daniele', 'Teti']);
CheckEquals('Hello Daniele,Teti, how are you?', r);
r := TLuaEmbeddedTextFilter.ExecuteWithResult
('Hello <?lua=nome ?>,<?lua=cognome ?>, <?lua for i=1,100 do _out("*") end?> how are you?',
['nome', 'cognome'],
['Daniele', 'Teti']);
CheckEquals('Hello Daniele,Teti, ' +
StringOfChar('*', 100)
+ ' how are you?', r)
end;
procedure TTestEmbeddedTextFilter.TestHelperExecAndGetMultiThread;
var
p : TProc;
t1 : TThread;
I : Integer;
ThreadList: TList<TThread>;
ooo : string;
begin
p :=
procedure
var
r: string;
begin
r := TLuaEmbeddedTextFilter.ExecuteWithResult
('Hello <?lua=nome ?>,<?lua=cognome ?>, <?lua for i=1,100 do _out("*") end?> how are you?',
['nome', 'cognome'],
['Daniele', 'Teti']);
TThread.Synchronize(nil,
procedure
begin
ooo := ooo +
BoolToStr('Hello Daniele,Teti, ' +
StringOfChar('*', 100)
+ ' how are you?' = r)[1];
end);
end;
ooo := '';
ThreadList := TList<TThread>.Create;
try
for I := 1 to 50 do
begin
t1 := TThread.CreateAnonymousThread(p);
t1.FreeOnTerminate := false;
t1.Start;
ThreadList.Add(t1);
end;
while ThreadList.Count > 0 do
begin
ThreadList[0].WaitFor;
ThreadList[0].Free;
ThreadList.Delete(0);
end;
CheckEquals(StringOfChar('T', 50), ooo);
finally
ThreadList.Free;
end;
end;
initialization
// Register any test cases with the test runner
RegisterTest(TTestEmbeddedTextFilter.Suite);
end.

View File

@ -0,0 +1,579 @@
unit TestLuaWrapper;
{
Delphi DUnit Test Case
----------------------
This unit contains a skeleton test case class generated by the Test Case Wizard.
Modify the generated code to correctly setup and call the methods from the unit
being tested.
}
{ .$RTTI EXPLICIT METHODS([vcPublished, vcPublic]) }
interface
uses
TestFramework,
System.Classes,
LuaBind.Intf,
LuaBind,
System.Rtti,
System.SysUtils;
type
// Test methods for class TLuaEngine
TestTLuaEngine = class(TTestCase)
strict private
FLuaEngine: TLuaEngine;
private
public
procedure SetUp; override;
procedure TearDown; override;
published
procedure TestLoadScript;
procedure TestLoadScript1;
procedure TestLoadFromFile;
procedure TestDeclareGlobalNil;
procedure TestDeclareGlobalNumber;
procedure TestDeclareGlobalInteger;
procedure TestDeclareGlobalString;
procedure TestDeclareGlobalBoolean;
procedure TestDeclareGlobalLightUserData;
procedure TestDeclareGlobalUserData;
/// /////
procedure TestDeclareGlobalFunction;
procedure TestGetGlobal;
/// ///test core extensions
procedure TestExposeDataSet;
procedure TestExposeDelphiObject;
procedure TestExposeDelphiObjectNoDeps;
procedure TestExposeVCLDelphiObject;
procedure TestExposeVCLDelphiObjectSetProperty;
procedure TestCreateDelphiObject;
procedure TestCreateDelphiObjectWithWringConstructor;
/// ///// test helper pusher
procedure TestPushTableWithIntegerKeys;
procedure TestPushTableWithStringKeys;
procedure TestPushTableWithTValueValues;
procedure TestPushTableFromCompoundObject;
/// ////
procedure TestExecuteFunction;
procedure TestMyDirtyTests;
end;
implementation
uses
System.IOUtils,
LuaBind.CustomType.DataSet,
Datasnap.DBClient,
LuaBind.CustomType.PODO,
LuaBind.CustomType.UserType,
System.Generics.Collections,
TestObjects;
procedure TestTLuaEngine.SetUp;
begin
FLuaEngine := TLuaEngine.Create;
end;
procedure TestTLuaEngine.TearDown;
begin
FLuaEngine.Free;
FLuaEngine := nil;
end;
procedure TestTLuaEngine.TestLoadScript;
var
AScript: AnsiString;
begin
FLuaEngine.LoadScript(AScript);
FLuaEngine.Execute;
FLuaEngine.LoadScript('local x = 1+2+3;');
FLuaEngine.Execute;
ExpectedException := ELuaRuntimeException;
FLuaEngine.LoadScript('local x = pippo.makeBooom();');
FLuaEngine.Execute;
end;
procedure TestTLuaEngine.TestLoadScript1;
var
AStream: TStream;
begin
AStream := TFile.OpenRead('test_01.lua');
FLuaEngine.LoadScript(AStream, true);
FLuaEngine.Execute;
end;
procedure TestTLuaEngine.TestMyDirtyTests;
begin
FLuaEngine.LoadExternalLibraries(TLuaMyTest.Create);
FLuaEngine.LoadFromFile('test_mydirtytest.lua');
FLuaEngine.Execute;
end;
procedure TestTLuaEngine.TestPushTableFromCompoundObject;
var
father, Child: TPerson;
begin
father := TPerson.Create;
try
father.Child := TPerson.Create;
try
father.FirstName := 'Daniele';
father.LastName := 'Teti';
father.Age := 32;
father.Child.FirstName := 'Daniele Son';
father.Child.LastName := 'Teti';
father.Child.Age := 2;
father.Child.Child := nil;
FLuaEngine.DeclareTable('person', father);
FLuaEngine.LoadScript
('s = person.FirstName .. person.LastName .. tostring(person.Age) .. person.Child.FirstName .. person.Child.LastName .. person.Child.Age');
FLuaEngine.Execute;
CheckEquals('DanieleTeti32Daniele SonTeti2', FLuaEngine.GetGlobal('s').GetAsString);
finally
father.Child.Free;
end;
finally
father.Free;
end;
end;
procedure TestTLuaEngine.TestPushTableWithIntegerKeys;
begin
FLuaEngine.DeclareTable('mytable', [1, 2, 3, 4], ['daniele', 'teti', 'peter', 'parker']);
FLuaEngine.LoadScript('s = mytable[1]..mytable[2]..mytable[3]..mytable[4]');
FLuaEngine.Execute;
CheckEquals('danieletetipeterparker', FLuaEngine.GetGlobal('s').GetAsString)
end;
procedure TestTLuaEngine.TestPushTableWithStringKeys;
begin
FLuaEngine.DeclareTable('mytable', ['a', 'b', 'c', 'd'], ['daniele', 'teti', 'peter', 'parker']);
FLuaEngine.LoadScript(
's1 = mytable["a"] .. mytable["b"] .. mytable["c"] .. mytable["d"];' +
's2 = mytable.a .. mytable.b .. mytable.c .. mytable.d');
FLuaEngine.Execute;
CheckEquals('danieletetipeterparker', FLuaEngine.GetGlobal('s1').GetAsString);
CheckEquals('danieletetipeterparker', FLuaEngine.GetGlobal('s2').GetAsString)
end;
procedure TestTLuaEngine.TestPushTableWithTValueValues;
var
dict: TDictionary<TValue, TValue>;
begin
dict := TDictionary<TValue, TValue>.Create;
try
dict.AddOrSetValue('hello', 'world');
dict.AddOrSetValue(1234, 'onetwothree');
dict.AddOrSetValue('yes', true);
dict.AddOrSetValue('no', false);
FLuaEngine.DeclareTable('mytable', dict);
FLuaEngine.LoadScript
('s = mytable.hello .. mytable[1234] .. tostring(mytable.yes) .. tostring(mytable["no"])');
FLuaEngine.Execute;
CheckEquals('worldonetwothreetruefalse', FLuaEngine.GetGlobal('s').GetAsString)
finally
dict.Free;
end;
end;
procedure TestTLuaEngine.TestLoadFromFile;
begin
FLuaEngine.LoadFromFile('test_01.lua');
FLuaEngine.Execute;
end;
procedure TestTLuaEngine.TestDeclareGlobalNil;
begin
FLuaEngine.DeclareGlobalNil('_nil');
FLuaEngine.LoadScript('');
FLuaEngine.Execute;
CheckTrue(FLuaEngine.GetGlobal('_nil').IsNil);
end;
procedure TestTLuaEngine.TestDeclareGlobalNumber;
var
Value : ILuaValue;
_tot, _number1, _number2, _number3, _number4: Double;
begin
_number1 := 1;
_number2 := 1.1234;
_number3 := 1234.5678;
_number4 := 12345678;
FLuaEngine.DeclareGlobalNumber('_number1', _number1);
FLuaEngine.DeclareGlobalNumber('_number2', _number2);
FLuaEngine.DeclareGlobalNumber('_number3', _number3);
FLuaEngine.DeclareGlobalNumber('_number4', _number4);
FLuaEngine.LoadScript('_tot = _number1 + _number2 + _number3 + _number4;');
FLuaEngine.Execute;
Value := FLuaEngine.GetGlobal('_tot');
CheckTrue(Value.IsNumber);
CheckFalse(Value.IsInteger);
CheckFalse(Value.IsString);
CheckFalse(Value.IsNil);
CheckFalse(Value.IsBoolean);
CheckFalse(Value.IsLightUserData);
_tot := _number1 + _number2 + _number3 + _number4;
CheckTrue(abs(_tot - Value.GetAsNumber) < 0.0001);
ExpectedException := ELuaException;
Value.GetAsString;
end;
procedure TestTLuaEngine.TestDeclareGlobalInteger;
var
Value : ILuaValue;
_tot, _number1, _number2, _number3, _number4: Integer;
begin
_number1 := 1;
_number2 := 1234;
_number3 := 12345678;
_number4 := 12345678;
FLuaEngine.DeclareGlobalInteger('_number1', _number1);
FLuaEngine.DeclareGlobalInteger('_number2', _number2);
FLuaEngine.DeclareGlobalInteger('_number3', _number3);
FLuaEngine.DeclareGlobalInteger('_number4', _number4);
FLuaEngine.LoadScript('_tot = _number1 + _number2 + _number3 + _number4;');
FLuaEngine.Execute;
Value := FLuaEngine.GetGlobal('_tot');
CheckTrue(Value.IsNumber);
/// a sum of integers returns a NUMBER result type.. :-(
CheckFalse(Value.IsInteger);
CheckFalse(Value.IsString);
CheckFalse(Value.IsNil);
CheckFalse(Value.IsBoolean);
CheckFalse(Value.IsLightUserData);
_tot := _number1 + _number2 + _number3 + _number4;
CheckTrue(abs(_tot - Value.GetAsNumber) < 0.0001);
ExpectedException := ELuaException;
Value.GetAsString;
end;
procedure TestTLuaEngine.TestDeclareGlobalString;
var
Value : ILuaValue;
_tot, _string1, _string2, _string3, _string4: AnsiString;
begin
_string1 := '';
_string2 := 'hello';
_string3 := 'Lua';
_string4 := 'world àèéùòìçò§£$%';
FLuaEngine.DeclareGlobalString('_string1', _string1);
FLuaEngine.DeclareGlobalString('_string2', _string2);
FLuaEngine.DeclareGlobalString('_string3', _string3);
FLuaEngine.DeclareGlobalString('_string4', _string4);
FLuaEngine.LoadScript('_tot = _string1 .. _string2 .. _string3 .. _string4;');
FLuaEngine.Execute;
Value := FLuaEngine.GetGlobal('_tot');
CheckFalse(Value.IsNumber);
CheckFalse(Value.IsInteger);
CheckTrue(Value.IsString);
CheckFalse(Value.IsNil);
CheckFalse(Value.IsBoolean);
CheckFalse(Value.IsLightUserData);
_tot := _string1 + _string2 + _string3 + _string4;
CheckEquals('helloLuaworld àèéùòìçò§£$%', _tot);
ExpectedException := ELuaException;
Value.GetAsInteger;
end;
procedure TestTLuaEngine.TestDeclareGlobalUserData;
begin
// FLuaEngine.DeclareGlobalUserData('pippo', nil);
// FLuaEngine.LoadScript('');
// FLuaEngine.Execute;
end;
procedure TestTLuaEngine.TestExecuteFunction;
var
r: AnsiString;
begin
FLuaEngine.LoadScript('function myfunc(a,b,c) return a..b..c end');
FLuaEngine.Execute;
r := FLuaEngine.ExecuteFunction('myfunc', ['hello', 'Lua', 'world']).AsString;
CheckEquals('helloLuaworld', r);
FLuaEngine.Reset;
FLuaEngine.LoadFromFile('test_08.lua');
FLuaEngine.Execute;
r := FLuaEngine.ExecuteFunction('myfunc', ['hello', 'Lua', 'world']).AsString;
CheckEquals('helloLuaworld', r);
end;
procedure TestTLuaEngine.TestExposeDataSet;
var
ds: TClientDataSet;
_1: string;
_2: string;
begin
ds := TClientDataSet.Create(nil);
try
ds.LoadFromFile('samplecds.xml');
ds.Open;
FLuaEngine.LoadExternalLibraries(TLuaDataSetExposerLibraries.Create);
ExposeDataSet(FLuaEngine, ds, 'people');
FLuaEngine.LoadFromFile('test_02.lua');
FLuaEngine.Execute;
finally
ds.Free;
end;
_1 := TFile.ReadAllText('test_02_expected.txt');
_2 := TFile.ReadAllText('test_02.txt');
CheckEquals(_1, _2);
end;
procedure TestTLuaEngine.TestExposeDelphiObject;
var
person: TPerson;
begin
person := TPerson.Create;
try
FLuaEngine.LoadExternalLibraries(TLuaDelphiObjectExposerLibraries.Create);
ExposeDelphiObject(FLuaEngine, person, 'person');
FLuaEngine.LoadFromFile('test_03.lua');
FLuaEngine.Execute;
CheckEquals('Teti', FLuaEngine.GetGlobal('last_name').GetAsString);
CheckEquals('Daniele', FLuaEngine.GetGlobal('first_name').GetAsString);
CheckEquals('Mr. Daniele Teti', FLuaEngine.GetGlobal('full_name').GetAsString);
CheckEquals(32, FLuaEngine.GetGlobal('age').GetAsInteger);
CheckEquals('Teti', person.LastName);
CheckEquals('Daniele', person.FirstName);
CheckEquals(32, person.Age);
finally
person.Free;
end;
end;
procedure TestTLuaEngine.TestExposeDelphiObjectNoDeps;
var
person: TPerson;
begin
person := TPerson.Create;
try
person.FirstName := 'Daniele';
person.LastName := 'Teti';
person.Age := 33;
FLuaEngine.DeclareGlobalDelphiObjectAsTable(person, 'person');
// FLuaEngine.ExecuteScript('r = person.FirstName .. person.LastName .. tostring(person.Age)');
// CheckEquals('DanieleTeti33', FLuaEngine.GetGlobal('r').GetAsString);
FLuaEngine.LoadScript('x = person:hello("parametro1", "parametro2")');
FLuaEngine.Execute;
// FLuaEngine.ExecuteScript('person:BecomeOlder(1)');
CheckEquals('DanieleTeti34', FLuaEngine.GetGlobal('x').GetAsString);
finally
person.Free;
end;
end;
procedure TestTLuaEngine.TestExposeVCLDelphiObject;
var
sl: TStringList;
begin
sl := TStringList.Create;
try
sl.Add('first');
FLuaEngine.LoadExternalLibraries(TLuaDelphiObjectExposerLibraries.Create);
ExposeDelphiObject(FLuaEngine, sl, 'stringlist');
FLuaEngine.LoadFromFile('test_04.lua');
FLuaEngine.Execute;
CheckEquals(4, sl.Count);
finally
sl.Free;
end;
end;
procedure TestTLuaEngine.TestExposeVCLDelphiObjectSetProperty;
var
sl: TStringList;
begin
sl := TStringList.Create;
try
sl.Add('first');
sl.Add('two');
sl.Add('three');
FLuaEngine.LoadExternalLibraries(TLuaDelphiObjectExposerLibraries.Create);
ExposeDelphiObject(FLuaEngine, sl, 'stringlist');
FLuaEngine.LoadFromFile('test_05.lua');
FLuaEngine.Execute;
CheckEquals(1, sl.Count);
CheckEquals('Daniele Teti', sl[0]);
finally
sl.Free;
end;
end;
procedure TestTLuaEngine.TestCreateDelphiObject;
begin
FLuaEngine.LoadExternalLibraries(TLuaDelphiObjectExposerLibraries.Create);
FLuaEngine.LoadFromFile('test_06.lua');
FLuaEngine.Execute;
end;
procedure TestTLuaEngine.TestCreateDelphiObjectWithWringConstructor;
begin
FLuaEngine.LoadExternalLibraries(TLuaDelphiObjectExposerLibraries.Create);
FLuaEngine.LoadFromFile('test_07.lua');
ExpectedException := ELuaRuntimeException;
FLuaEngine.Execute;
end;
procedure TestTLuaEngine.TestDeclareGlobalBoolean;
var
Value : ILuaValue;
_tot, _boolean1, _boolean2, _boolean3, _boolean4: boolean;
begin
_boolean1 := true;
_boolean2 := false;
_boolean3 := true;
_boolean4 := false;
FLuaEngine.DeclareGlobalBoolean('_boolean1', _boolean1);
FLuaEngine.DeclareGlobalBoolean('_boolean2', _boolean2);
FLuaEngine.DeclareGlobalBoolean('_boolean3', _boolean3);
FLuaEngine.DeclareGlobalBoolean('_boolean4', _boolean4);
FLuaEngine.LoadScript('_tot = _boolean1 or _boolean2 and _boolean3 or _boolean4;');
FLuaEngine.Execute;
Value := FLuaEngine.GetGlobal('_tot');
CheckFalse(Value.IsNumber);
CheckFalse(Value.IsInteger);
CheckFalse(Value.IsString);
CheckFalse(Value.IsNil);
CheckTrue(Value.IsBoolean);
CheckFalse(Value.IsLightUserData);
_tot := _boolean1 or _boolean2 and _boolean3 or _boolean4;
CheckEquals(_tot, Value.GetAsBoolean);
ExpectedException := ELuaException;
Value.GetAsString;
end;
procedure TestTLuaEngine.TestDeclareGlobalFunction;
function SayHello(L: Plua_State): Integer; cdecl;
var
s: AnsiString;
begin
s := lua_tostring(L, - 1);
s := 'before ' + s + ' after';
lua_pop(L, 1);
lua_pushstring(L, PAnsiChar(s));
Result := 1;
end;
var
Value: ILuaValue;
begin
FLuaEngine.DeclareGlobalFunction('sayhello', @SayHello);
FLuaEngine.LoadScript('x = sayhello("hello world")');
FLuaEngine.Execute;
Value := FLuaEngine.GetGlobal('x');
CheckEquals('before hello world after', Value.GetAsString);
end;
procedure TestTLuaEngine.TestDeclareGlobalLightUserData;
var
Value: ILuaValue;
_ptr : Pointer;
Obj : TStringList;
Obj2 : TStringList;
function AddToTStringList(L: Plua_State): Integer; cdecl;
var
sl: TStringList;
s : AnsiString;
begin
s := lua_tostring(L, - 1);
lua_pop(L, 1);
sl := TStringList(lua_topointer(L, - 1));
lua_pop(L, 1);
sl.Add(s);
Result := 0;
end;
begin
_ptr := nil;
FLuaEngine.DeclareGlobalLightUserData('_ptr', _ptr);
FLuaEngine.LoadScript('x = _ptr');
FLuaEngine.Execute;
Value := FLuaEngine.GetGlobal('x');
CheckTrue(Value.IsLightUserData);
CheckTrue(Value.GetAsLightUserData = nil);
// Now try to pass a tstringlist
Obj := TStringList.Create;
try
Obj.Add('Hello World');
_ptr := Pointer(Obj);
FLuaEngine.DeclareGlobalLightUserData('_ptr1', _ptr);
FLuaEngine.DeclareGlobalFunction('additem', @AddToTStringList);
FLuaEngine.LoadScript('x = _ptr1; additem(x,"added from Lua")');
FLuaEngine.Execute;
Value := FLuaEngine.GetGlobal('x');
CheckFalse(Value.IsNumber);
CheckFalse(Value.IsInteger);
CheckFalse(Value.IsString);
CheckFalse(Value.IsNil);
CheckFalse(Value.IsBoolean);
CheckTrue(Value.IsLightUserData);
CheckNotNull(Value.GetAsLightUserData);
_ptr := Value.GetAsLightUserData;
Obj2 := TStringList(_ptr);
CheckEquals(2, Obj2.Count);
CheckEquals('Hello World', Obj2[0]);
CheckEquals('added from Lua', Obj2[1]);
finally
Obj.Free;
end;
ExpectedException := ELuaException;
Value.GetAsString;
end;
procedure TestTLuaEngine.TestGetGlobal;
var
ReturnValue: ILuaValue;
AName : AnsiString;
begin
// TODO: Setup method call parameters
ReturnValue := FLuaEngine.GetGlobal(AName);
// TODO: Validate method results
end;
{ TPerson }
initialization
// Register any test cases with the test runner
RegisterTest(TestTLuaEngine.Suite);
end.

View File

@ -0,0 +1,63 @@
unit TestObjects;
interface
type
TPerson = class(TObject)
private
FLastName: String;
FFirstName: String;
FAge: Integer;
FChild: TPerson;
procedure SetLastName(const Value: String);
procedure SetFirstName(const Value: String);
procedure SetAge(const Value: Integer);
procedure SetChild(const Value: TPerson);
public
constructor Create;
function GetFullName(ASalutation: String): String;
procedure BecomeOlder(HowManyYear: Integer);
property Child: TPerson read FChild write SetChild;
property LastName: String read FLastName write SetLastName;
property FirstName: String read FFirstName write SetFirstName;
property Age: Integer read FAge write SetAge;
end;
implementation
procedure TPerson.BecomeOlder(HowManyYear: Integer);
begin
FAge := FAge + HowManyYear;
end;
constructor TPerson.Create;
begin
inherited;
end;
function TPerson.GetFullName(ASalutation: String): String;
begin
Result := ASalutation + ' ' + FFirstName + ' ' + FLastName;
end;
procedure TPerson.SetAge(const Value: Integer);
begin
FAge := Value;
end;
procedure TPerson.SetChild(const Value: TPerson);
begin
FChild := Value;
end;
procedure TPerson.SetFirstName(const Value: String);
begin
FFirstName := Value;
end;
procedure TPerson.SetLastName(const Value: String);
begin
FLastName := Value;
end;
end.