📄 jcledisef.pas
字号:
procedure ParseELMSDataOfCOMSDefinition(Data: string; Element: TEDISEFElement;
ELMSList: TEDISEFDataObjectList);
procedure ParseELMSDataOfSEGSDefinition(Data: string; Element: TEDISEFElement;
ELMSList: TEDISEFDataObjectList);
function CombineELMSDataOfCOMSorSEGSDefinition(Element: TEDISEFElement;
ELMSList: TEDISEFDataObjectList): string;
procedure ParseCOMSDataOfCOMSDefinition(Data: string; CompositeElement: TEDISEFCompositeElement;
ELMSList: TEDISEFDataObjectList);
function CombineCOMSDataOfCOMSDefinition(CompositeElement: TEDISEFCompositeElement): string;
procedure ParseCOMSDataOfSEGSDefinition(Data: string; CompositeElement: TEDISEFCompositeElement;
COMSList: TEDISEFDataObjectList);
function CombineCOMSDataOfSEGSDefinition(CompositeElement: TEDISEFCompositeElement): string;
procedure ParseSEGSDataOfSEGSDefinition(Data: string; Segment: TEDISEFSegment;
SEFFile: TEDISEFFile);
function CombineSEGSDataOfSEGSDefinition(Segment: TEDISEFSegment): string;
procedure ParseSEGSDataOfSETSDefinition(Data: string; Segment: TEDISEFSegment;
SEFFile: TEDISEFFile);
function CombineSEGSDataOfSETSDefinition(Segment: TEDISEFSegment): string;
procedure ParseLoopDataOfSETSDefinition(Data: string; Loop: TEDISEFLoop;
SEFFile: TEDISEFFile);
procedure ParseTableDataOfSETSDefinition(Data: string; Table: TEDISEFTable;
SEFFile: TEDISEFFile);
procedure ParseSetsDataOfSETSDefinition(Data: string; ASet: TEDISEFSet; SEFFile: TEDISEFFile);
procedure ExtractFromDataObjectGroup(DataObjectClass: TEDISEFDataObjectClass;
DataObjectGroup: TEDISEFDataObjectGroup; ObjectList: TObjectList); overload;
procedure ExtractFromDataObjectGroup(DataObjectClasses: array of TEDISEFDataObjectClass;
DataObjectGroup: TEDISEFDataObjectGroup; ObjectList: TObjectList); overload;
function AddSubElementTo(DataObjectGroup: TEDISEFDataObjectGroup): TEDISEFSubElement;
function AppendSubElementTo(DataObjectGroup: TEDISEFDataObjectGroup;
SubElement: TEDISEFSubElement): TEDISEFSubElement;
function ExtractSubElementFrom(DataObjectGroup: TEDISEFDataObjectGroup;
SubElement: TEDISEFSubElement): TEDISEFSubElement;
procedure DeleteSubElementFrom(DataObjectGroup: TEDISEFDataObjectGroup;
SubElement: TEDISEFSubElement);
function InsertSubElementInto(DataObjectGroup: TEDISEFDataObjectGroup;
BeforeObject: TEDISEFDataObject): TEDISEFSubElement; overload;
function InsertSubElementInto(DataObjectGroup: TEDISEFDataObjectGroup;
SubElement: TEDISEFSubElement; BeforeObject: TEDISEFDataObject): TEDISEFSubElement; overload;
function AddElementTo(DataObjectGroup: TEDISEFDataObjectGroup): TEDISEFElement;
function AppendElementTo(DataObjectGroup: TEDISEFDataObjectGroup;
Element: TEDISEFElement): TEDISEFElement;
function ExtractElementFrom(DataObjectGroup: TEDISEFDataObjectGroup;
Element: TEDISEFElement): TEDISEFElement;
procedure DeleteElementFrom(DataObjectGroup: TEDISEFDataObjectGroup;
Element: TEDISEFElement);
function InsertElementInto(DataObjectGroup: TEDISEFDataObjectGroup;
BeforeObject: TEDISEFDataObject): TEDISEFElement; overload;
function InsertElementInto(DataObjectGroup: TEDISEFDataObjectGroup;
Element: TEDISEFElement; BeforeObject: TEDISEFDataObject): TEDISEFElement; overload;
function AddRepeatingPatternTo(DataObjectGroup: TEDISEFDataObjectGroup): TEDISEFRepeatingPattern;
function AppendRepeatingPatternTo(DataObjectGroup: TEDISEFDataObjectGroup;
RepeatingPattern: TEDISEFRepeatingPattern): TEDISEFRepeatingPattern;
function ExtractRepeatingPatternFrom(DataObjectGroup: TEDISEFDataObjectGroup;
RepeatingPattern: TEDISEFRepeatingPattern): TEDISEFRepeatingPattern;
procedure DeleteRepeatingPatternFrom(DataObjectGroup: TEDISEFDataObjectGroup;
RepeatingPattern: TEDISEFRepeatingPattern);
function InsertRepeatingPatternInto(DataObjectGroup: TEDISEFDataObjectGroup;
BeforeObject: TEDISEFDataObject): TEDISEFRepeatingPattern; overload;
function InsertRepeatingPatternInto(DataObjectGroup: TEDISEFDataObjectGroup;
RepeatingPattern: TEDISEFRepeatingPattern;
BeforeObject: TEDISEFDataObject): TEDISEFRepeatingPattern; overload;
function AddCompositeElementTo(DataObjectGroup: TEDISEFDataObjectGroup): TEDISEFCompositeElement;
function AppendCompositeElementTo(DataObjectGroup: TEDISEFDataObjectGroup;
CompositeElement: TEDISEFCompositeElement): TEDISEFCompositeElement;
function ExtractCompositeElementFrom(DataObjectGroup: TEDISEFDataObjectGroup;
CompositeElement: TEDISEFCompositeElement): TEDISEFCompositeElement;
procedure DeleteCompositeElementFrom(DataObjectGroup: TEDISEFDataObjectGroup;
CompositeElement: TEDISEFCompositeElement);
function InsertCompositeElementInto(DataObjectGroup: TEDISEFDataObjectGroup;
BeforeObject: TEDISEFDataObject): TEDISEFCompositeElement; overload;
function InsertCompositeElementInto(DataObjectGroup: TEDISEFDataObjectGroup;
CompositeElement: TEDISEFCompositeElement;
BeforeObject: TEDISEFDataObject): TEDISEFCompositeElement; overload;
function AddSegmentTo(DataObjectGroup: TEDISEFDataObjectGroup): TEDISEFSegment;
function AppendSegmentTo(DataObjectGroup: TEDISEFDataObjectGroup;
Segment: TEDISEFSegment): TEDISEFSegment;
function ExtractSegmentFrom(DataObjectGroup: TEDISEFDataObjectGroup;
Segment: TEDISEFSegment): TEDISEFSegment;
procedure DeleteSegmentFrom(DataObjectGroup: TEDISEFDataObjectGroup;
Segment: TEDISEFSegment);
function InsertSegmentInto(DataObjectGroup: TEDISEFDataObjectGroup;
BeforeObject: TEDISEFDataObject): TEDISEFSegment; overload;
function InsertSegmentInto(DataObjectGroup: TEDISEFDataObjectGroup;
Segment: TEDISEFSegment; BeforeObject: TEDISEFDataObject): TEDISEFSegment; overload;
function AddLoopTo(DataObjectGroup: TEDISEFDataObjectGroup): TEDISEFLoop;
function AppendLoopTo(DataObjectGroup: TEDISEFDataObjectGroup;
Loop: TEDISEFLoop): TEDISEFLoop;
function ExtractLoopFrom(DataObjectGroup: TEDISEFDataObjectGroup;
Loop: TEDISEFLoop): TEDISEFLoop;
procedure DeleteLoopFrom(DataObjectGroup: TEDISEFDataObjectGroup;
Loop: TEDISEFLoop);
function InsertLoopInto(DataObjectGroup: TEDISEFDataObjectGroup;
BeforeObject: TEDISEFDataObject): TEDISEFLoop; overload;
function InsertLoopInto(DataObjectGroup: TEDISEFDataObjectGroup;
Loop: TEDISEFLoop; BeforeObject: TEDISEFDataObject): TEDISEFLoop; overload;
function AddTableTo(DataObjectGroup: TEDISEFDataObjectGroup): TEDISEFTable;
function AppendTableTo(DataObjectGroup: TEDISEFDataObjectGroup;
Table: TEDISEFTable): TEDISEFTable;
function ExtractTableFrom(DataObjectGroup: TEDISEFDataObjectGroup;
Table: TEDISEFTable): TEDISEFTable;
procedure DeleteTableFrom(DataObjectGroup: TEDISEFDataObjectGroup;
Table: TEDISEFTable);
function InsertTableInto(DataObjectGroup: TEDISEFDataObjectGroup;
BeforeObject: TEDISEFDataObject): TEDISEFTable; overload;
function InsertTableInto(DataObjectGroup: TEDISEFDataObjectGroup;
Table: TEDISEFTable; BeforeObject: TEDISEFDataObject): TEDISEFTable; overload;
implementation
uses
JclResources, JclStrings;
const
Value_Optional = 'O';
Value_Conditional = 'C';
Value_One = '1';
Value_GreaterThanOne = '>1';
Value_Version10 = '1.0';
Value_QuestionMark = '?';
SEFDelimiter_EqualSign = '=';
SEFDelimiter_OpeningBrace = '{';
SEFDelimiter_ClosingBrace = '}';
SEFDelimiter_OpeningBracket = '[';
SEFDelimiter_ClosingBracket = ']';
SEFDelimiter_AtSign = '@';
SEFDelimiter_SemiColon = ';';
SEFDelimiter_Colon = ':';
SEFDelimiter_Comma = ',';
SEFDelimiter_Period = '.';
SEFDelimiter_Caret = '^';
SEFDelimiter_PlusSign = '+';
SEFDelimiter_MinusSign = '-';
SEFDelimiter_Asterisk = '*';
// Procedures
function GetEDISEFUserAttributeDescription(Attribute: TEDISEFComsUserAttributes): string;
begin
case Attribute of
caPeriod:
Result := EDISEFUserAttributePeriodDesc;
caExclamationPoint:
Result := EDISEFUserAttributeExclamationPointDesc;
caDollarSign:
Result := EDISEFUserAttributeDollarSignDesc;
caHyphen:
Result := EDISEFUserAttributeHyphenDesc;
caAmpersand:
Result := EDISEFUserAttributeAmpersandDesc;
else
Result := RsUnknownAttribute;
end;
end;
function GetEDISEFUserAttributeDescription(Attribute: string): string;
begin
if Attribute = '' then
Attribute := Value_QuestionMark;
case Attribute[1] of
EDISEFUserAttributePeriod:
Result := EDISEFUserAttributePeriodDesc;
EDISEFUserAttributeExclamationPoint:
Result := EDISEFUserAttributeExclamationPointDesc;
EDISEFUserAttributeDollarSign:
Result := EDISEFUserAttributeDollarSignDesc;
EDISEFUserAttributeHyphen:
Result := EDISEFUserAttributeHyphenDesc;
EDISEFUserAttributeAmpersand:
Result := EDISEFUserAttributeAmpersandDesc;
else
Result := RsUnknownAttribute;
end;
end;
procedure ParseELMSDataOfELMSDefinition(Data: string; Element: TEDISEFElement);
var
Temp: TStringList;
begin
// Clear any old values
Element.UserAttribute := '';
Element.Ordinal := -1;
Element.ElementType := '';
Element.MinimumLength := 0;
Element.MaximumLength := 0;
Element.RequirementDesignator := Value_Optional;
Element.RepeatCount := 1;
//
Temp := TStringList.Create;
try
Temp.Text := Data;
Element.Id := Temp.Names[0];
{$IFDEF COMPILER7_UP}
Temp.CommaText := Temp.ValueFromIndex[0];
{$ELSE}
Temp.CommaText := Temp.Values[Element.Id];
{$ENDIF COMPILER7_UP}
if Temp.Count >= 1 then
Element.ElementType := Temp[0];
if Temp.Count >= 2 then
Element.MinimumLength := StrToInt(Temp[1]);
if Temp.Count >= 3 then
Element.MaximumLength := StrToInt(Temp[2]);
finally
Temp.Free;
end;
end;
function CombineELMSDataOfELMSDefinition(Element: TEDISEFElement): string;
begin
Result := Element.Id + SEFDelimiter_EqualSign + Element.ElementType + SEFDelimiter_Comma +
IntToStr(Element.MinimumLength) + SEFDelimiter_Comma + IntToStr(Element.MaximumLength);
end;
procedure ParseELMSDataOfCOMSDefinition(Data: string; Element: TEDISEFElement;
ELMSList: TEDISEFDataObjectList);
var
I, J, K, L, M, N, O, P: Integer;
ListItem: TEDISEFDataObjectListItem;
begin
// Clear any old values
Element.UserAttribute := '';
Element.Ordinal := -1;
Element.ElementType := '';
Element.MinimumLength := 0;
Element.MaximumLength := 0;
Element.RequirementDesignator := Value_Optional;
Element.RepeatCount := 1;
// Parse User Attribute
if Data[1] in EDISEFUserAttributeSet then
begin
Element.UserAttribute := Data[1];
I := 2;
end
else
I := 1;
// Get delimiter locations
J := StrSearch(SEFDelimiter_AtSign, Data, 1);
K := StrSearch(SEFDelimiter_SemiColon, Data, 1);
L := StrSearch(SEFDelimiter_Colon, Data, 1);
M := StrSearch(SEFDelimiter_Comma, Data, 1);
N := StrSearch(SEFDelimiter_Comma, Data, M + 1);
P := Length(Data) + 1;
// Parse Id using the closest delimiter
O := P;
if J <> 0 then
if O > J then
O := J;
if K <> 0 then
if O > K then
O := K;
if L <> 0 then
if O > L then
O := L;
if M <> 0 then
if O > M then
O := M;
Element.Id := Copy(Data, I, O - I);
// Get Default Values
if ELMSList <> nil then
begin
ListItem := ELMSList.FindItemByName(Element.Id);
if ListItem <> nil then
Element.Assign(TEDISEFElement(ListItem.EDISEFDataObject));
end;
// Parse other attributes
if J <> 0 then
begin
Inc(J);
O := P;
if K <> 0 then
if O > K then
O := K;
if L <> 0 then
if O > L then
O := L;
if M <> 0 then
if O > M then
O := M;
if (O - J) > 0 then
Element.Ordinal := StrToInt(Copy(Data, J, O - J));
end;
if K <> 0 then
begin
Inc(K);
O := P;
if L <> 0 then
if O > L then
O := L;
if M <> 0 then
if O > M then
O := M;
if (O - K) > 0 then
Element.MinimumLength := StrToInt(Copy(Data, K, O - K));
end;
if L <> 0 then
begin
Inc(L);
O := P;
if M <> 0 then
if O > M then
O := M;
if (O - L) > 0 then
Element.MaximumLength := StrToInt(Copy(Data, L, O - L));
end;
if M <> 0 then
begin
Inc(M);
O := P;
if N <> 0 then
if O > N then
O := N;
if (O - M) > 0 then
Element.RequirementDesignator := Copy(Data, M, O - M);
end;
if N <> 0 then
begin
Inc(N);
if (P - N) > 0 then
Element.RepeatCount := StrToInt(Copy(Data, N, 1));
end;
end;
function CombineELMSDataOfCOMSorSEGSDefinition(Element: TEDISEFElement;
ELMSList: TEDISEFDataObjectList): string;
var
CompareElement: TEDISEFElement;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -