{***************************************************************************}
{ This source code was generated automatically by                           }
{ Pas file import tool for Scripter Studio (Pro)                            }
{                                                                           }
{ Scripter Studio and Pas file import tool for Scripter Studio              }
{ written by TMS Software                                                   }
{            copyright © 1997 - 2010                                        }
{            Email : info@tmssoftware.com                                   }
{            Web : http://www.tmssoftware.com                               }
{***************************************************************************}
unit ap_MaskUtils;

interface

uses
  MaskUtils,
  System.Variants,
  atScript;

{$WARNINGS OFF}

type
  TatMaskUtilsLibrary = class(TatScripterLibrary)
    procedure __FormatMaskText(AMachine: TatVirtualMachine);
    procedure __MaskGetMaskSave(AMachine: TatVirtualMachine);
    procedure __MaskGetMaskBlank(AMachine: TatVirtualMachine);
    procedure __MaskGetFldSeparator(AMachine: TatVirtualMachine);
    procedure __PadInputLiterals(AMachine: TatVirtualMachine);
    procedure __MaskOffsetToOffset(AMachine: TatVirtualMachine);
    procedure __MaskOffsetToWideOffset(AMachine: TatVirtualMachine);
    procedure __IsLiteralChar(AMachine: TatVirtualMachine);
    procedure __MaskGetCharType(AMachine: TatVirtualMachine);
    procedure __MaskGetCurrentDirectives(AMachine: TatVirtualMachine);
    procedure __MaskIntlLiteralToChar(AMachine: TatVirtualMachine);
    procedure __OffsetToMaskOffset(AMachine: TatVirtualMachine);
    procedure __MaskDoFormatText(AMachine: TatVirtualMachine);
    procedure __GetDefaultBlank(AMachine: TatVirtualMachine);
    procedure __SetDefaultBlank(AMachine: TatVirtualMachine);
    procedure __GetMaskFieldSeparator(AMachine: TatVirtualMachine);
    procedure __SetMaskFieldSeparator(AMachine: TatVirtualMachine);
    procedure __GetMaskNoSave(AMachine: TatVirtualMachine);
    procedure __SetMaskNoSave(AMachine: TatVirtualMachine);
    procedure Init; override;
    class function LibraryName: string; override;
  end;




implementation



procedure TatMaskUtilsLibrary.__FormatMaskText(AMachine: TatVirtualMachine);
  var
  AResult: variant;
begin
  with AMachine do
  begin
AResult := string(MaskUtils.FormatMaskText(VarToStr(GetInputArg(0)),VarToStr(GetInputArg(1))));
    ReturnOutputArg(AResult);
  end;
end;

procedure TatMaskUtilsLibrary.__MaskGetMaskSave(AMachine: TatVirtualMachine);
  var
  AResult: variant;
begin
  with AMachine do
  begin
AResult := MaskUtils.MaskGetMaskSave(VarToStr(GetInputArg(0)));
    ReturnOutputArg(AResult);
  end;
end;

procedure TatMaskUtilsLibrary.__MaskGetMaskBlank(AMachine: TatVirtualMachine);
  var
  AResult: variant;
begin
  with AMachine do
  begin
AResult := MaskUtils.MaskGetMaskBlank(VarToStr(GetInputArg(0)));
    ReturnOutputArg(AResult);
  end;
end;

procedure TatMaskUtilsLibrary.__MaskGetFldSeparator(AMachine: TatVirtualMachine);
  var
  AResult: variant;
begin
  with AMachine do
  begin
AResult := Integer(MaskUtils.MaskGetFldSeparator(VarToStr(GetInputArg(0))));
    ReturnOutputArg(AResult);
  end;
end;

procedure TatMaskUtilsLibrary.__PadInputLiterals(AMachine: TatVirtualMachine);
  var
  AResult: variant;
begin
  with AMachine do
  begin
AResult := string(MaskUtils.PadInputLiterals(VarToStr(GetInputArg(0)),VarToStr(GetInputArg(1)),VarToStr(GetInputArg(2))[1]));
    ReturnOutputArg(AResult);
  end;
end;

procedure TatMaskUtilsLibrary.__MaskOffsetToOffset(AMachine: TatVirtualMachine);
  var
  AResult: variant;
begin
  with AMachine do
  begin
AResult := Integer(MaskUtils.MaskOffsetToOffset(VarToStr(GetInputArg(0)),VarToInteger(GetInputArg(1))));
    ReturnOutputArg(AResult);
  end;
end;

procedure TatMaskUtilsLibrary.__MaskOffsetToWideOffset(AMachine: TatVirtualMachine);
  var
  AResult: variant;
begin
  with AMachine do
  begin
AResult := Integer(MaskUtils.MaskOffsetToWideOffset(VarToStr(GetInputArg(0)),VarToInteger(GetInputArg(1))));
    ReturnOutputArg(AResult);
  end;
end;

procedure TatMaskUtilsLibrary.__IsLiteralChar(AMachine: TatVirtualMachine);
  var
  AResult: variant;
begin
  with AMachine do
  begin
AResult := MaskUtils.IsLiteralChar(VarToStr(GetInputArg(0)),VarToInteger(GetInputArg(1)));
    ReturnOutputArg(AResult);
  end;
end;

procedure TatMaskUtilsLibrary.__MaskGetCharType(AMachine: TatVirtualMachine);
  var
  AResult: variant;
begin
  with AMachine do
  begin
AResult := Integer(MaskUtils.MaskGetCharType(VarToStr(GetInputArg(0)),VarToInteger(GetInputArg(1))));
    ReturnOutputArg(AResult);
  end;
end;

procedure TatMaskUtilsLibrary.__MaskGetCurrentDirectives(AMachine: TatVirtualMachine);
  var
  AResultSet: TMaskDirectives;
  AResult: variant;
begin
  with AMachine do
  begin
AResultSet := MaskUtils.MaskGetCurrentDirectives(VarToStr(GetInputArg(0)),VarToInteger(GetInputArg(1)));
AResult := IntFromSet(AResultSet, SizeOf(AResultSet));
    ReturnOutputArg(AResult);
  end;
end;

procedure TatMaskUtilsLibrary.__MaskIntlLiteralToChar(AMachine: TatVirtualMachine);
  var
  AResult: variant;
begin
  with AMachine do
  begin
AResult := MaskUtils.MaskIntlLiteralToChar(VarToStr(GetInputArg(0))[1]);
    ReturnOutputArg(AResult);
  end;
end;

procedure TatMaskUtilsLibrary.__OffsetToMaskOffset(AMachine: TatVirtualMachine);
  var
  AResult: variant;
begin
  with AMachine do
  begin
AResult := Integer(MaskUtils.OffsetToMaskOffset(VarToStr(GetInputArg(0)),VarToInteger(GetInputArg(1))));
    ReturnOutputArg(AResult);
  end;
end;

procedure TatMaskUtilsLibrary.__MaskDoFormatText(AMachine: TatVirtualMachine);
  var
  AResult: variant;
begin
  with AMachine do
  begin
AResult := string(MaskUtils.MaskDoFormatText(VarToStr(GetInputArg(0)),VarToStr(GetInputArg(1)),VarToStr(GetInputArg(2))[1]));
    ReturnOutputArg(AResult);
  end;
end;

procedure TatMaskUtilsLibrary.__GetDefaultBlank(AMachine: TatVirtualMachine);
begin
  with AMachine do
  begin
    ReturnOutputArg(MaskUtils.DefaultBlank);
  end;
end;

procedure TatMaskUtilsLibrary.__SetDefaultBlank(AMachine: TatVirtualMachine);
begin
  with AMachine do
  begin
    MaskUtils.DefaultBlank:=VarToStr(GetInputArg(0))[1];
  end;
end;

procedure TatMaskUtilsLibrary.__GetMaskFieldSeparator(AMachine: TatVirtualMachine);
begin
  with AMachine do
  begin
    ReturnOutputArg(MaskUtils.MaskFieldSeparator);
  end;
end;

procedure TatMaskUtilsLibrary.__SetMaskFieldSeparator(AMachine: TatVirtualMachine);
begin
  with AMachine do
  begin
    MaskUtils.MaskFieldSeparator:=VarToStr(GetInputArg(0))[1];
  end;
end;

procedure TatMaskUtilsLibrary.__GetMaskNoSave(AMachine: TatVirtualMachine);
begin
  with AMachine do
  begin
    ReturnOutputArg(MaskUtils.MaskNoSave);
  end;
end;

procedure TatMaskUtilsLibrary.__SetMaskNoSave(AMachine: TatVirtualMachine);
begin
  with AMachine do
  begin
    MaskUtils.MaskNoSave:=VarToStr(GetInputArg(0))[1];
  end;
end;

procedure TatMaskUtilsLibrary.Init;
begin
  With Scripter.DefineClass(ClassType) do
  begin
    DefineMethod('FormatMaskText',2,tkVariant,nil,__FormatMaskText,false,0,'EditMask: string; Value: string');
    DefineMethod('MaskGetMaskSave',1,tkVariant,nil,__MaskGetMaskSave,false,0,'EditMask: string');
    DefineMethod('MaskGetMaskBlank',1,tkVariant,nil,__MaskGetMaskBlank,false,0,'EditMask: string');
    DefineMethod('MaskGetFldSeparator',1,tkInteger,nil,__MaskGetFldSeparator,false,0,'EditMask: string');
    DefineMethod('PadInputLiterals',3,tkVariant,nil,__PadInputLiterals,false,0,'EditMask: String; Value: string; Blank: Char');
    DefineMethod('MaskOffsetToOffset',2,tkInteger,nil,__MaskOffsetToOffset,false,0,'EditMask: String; MaskOffset: Integer');
    DefineMethod('MaskOffsetToWideOffset',2,tkInteger,nil,__MaskOffsetToWideOffset,false,0,'EditMask: String; MaskOffset: Integer');
    DefineMethod('IsLiteralChar',2,tkVariant,nil,__IsLiteralChar,false,0,'EditMask: string; Offset: Integer');
    DefineMethod('MaskGetCharType',2,tkEnumeration,nil,__MaskGetCharType,false,0,'EditMask: string; MaskOffset: Integer');
    DefineMethod('MaskGetCurrentDirectives',2,tkInteger,nil,__MaskGetCurrentDirectives,false,0,'EditMask: string; MaskOffset: Integer');
    DefineMethod('MaskIntlLiteralToChar',1,tkVariant,nil,__MaskIntlLiteralToChar,false,0,'IChar: Char');
    DefineMethod('OffsetToMaskOffset',2,tkInteger,nil,__OffsetToMaskOffset,false,0,'EditMask: string; Offset: Integer');
    DefineMethod('MaskDoFormatText',3,tkVariant,nil,__MaskDoFormatText,false,0,'EditMask: string; Value: string; Blank: Char');
    DefineProp('DefaultBlank',tkVariant,__GetDefaultBlank,__SetDefaultBlank,nil,false,0);
    DefineProp('MaskFieldSeparator',tkVariant,__GetMaskFieldSeparator,__SetMaskFieldSeparator,nil,false,0);
    DefineProp('MaskNoSave',tkVariant,__GetMaskNoSave,__SetMaskNoSave,nil,false,0);
    AddConstant('mcNone',mcNone);
    AddConstant('mcLiteral',mcLiteral);
    AddConstant('mcIntlLiteral',mcIntlLiteral);
    AddConstant('mcDirective',mcDirective);
    AddConstant('mcMask',mcMask);
    AddConstant('mcMaskOpt',mcMaskOpt);
    AddConstant('mcFieldSeparator',mcFieldSeparator);
    AddConstant('mcField',mcField);
    AddConstant('mDirReverse',mDirReverse);
    AddConstant('mDirUpperCase',mDirUpperCase);
    AddConstant('mDirLowerCase',mDirLowerCase);
    AddConstant('mDirLiteral',mDirLiteral);
    AddConstant('mMskAlpha',mMskAlpha);
    AddConstant('mMskAlphaOpt',mMskAlphaOpt);
    AddConstant('mMskAlphaNum',mMskAlphaNum);
    AddConstant('mMskAlphaNumOpt',mMskAlphaNumOpt);
    AddConstant('mMskAscii',mMskAscii);
    AddConstant('mMskAsciiOpt',mMskAsciiOpt);
    AddConstant('mMskNumeric',mMskNumeric);
    AddConstant('mMskNumericOpt',mMskNumericOpt);
    AddConstant('mMskNumSymOpt',mMskNumSymOpt);
    AddConstant('mMskTimeSeparator',mMskTimeSeparator);
    AddConstant('mMskDateSeparator',mMskDateSeparator);
  end;
end;

class function TatMaskUtilsLibrary.LibraryName: string;
begin
  result := 'MaskUtils';
end;

initialization
  RegisterScripterLibrary(TatMaskUtilsLibrary, True);

{$WARNINGS ON}

end.

