Changeset 45 for trunk/UContact.pas
- Timestamp:
- Dec 2, 2021, 3:19:57 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UContact.pas
r42 r45 64 64 procedure EvaluateAttributes; 65 65 function GetDecodedValue: string; 66 function GetEncodedValue: string; 66 67 function MatchNameGroups(AName: string; Groups: TStringArray; 67 68 NoGroups: TStringArray): Boolean; … … 343 344 begin 344 345 if Encoding = 'BASE64' then begin 345 Result := DecodeStringBase64(Value) 346 Result := DecodeStringBase64(Value); 346 347 end else 347 348 if Encoding = 'QUOTED-PRINTABLE' then begin 348 Result := DecodeQuotedPrintable(Value) 349 Result := DecodeQuotedPrintable(Value); 349 350 end 350 351 else Result := ''; 351 352 end; 352 353 354 function TContactProperty.GetEncodedValue: string; 355 begin 356 if Encoding = 'BASE64' then begin 357 Result := EncodeStringBase64(Value); 358 end else 359 if Encoding = 'QUOTED-PRINTABLE' then begin 360 Result := EncodeQuotedPrintable(Value); 361 end 362 else Result := ''; 363 end; 364 353 365 function TContactProperty.MatchNameGroups(AName: string; Groups: TStringArray; 354 366 NoGroups: TStringArray): Boolean; 355 367 var 356 368 I: Integer; 357 Attr: string; 358 begin 359 Attr := Attributes.DelimitedText; 369 begin 360 370 Result := Name = AName; 361 371 if Result and (Length(Groups) > 0) then begin … … 680 690 J: Integer; 681 691 NameText: string; 692 Value2: string; 682 693 begin 683 694 inherited; … … 689 700 for J := 0 to Properties.Count - 1 do 690 701 with Properties[J] do begin 691 if Pos(LineEnding, Value) > 0 then begin 692 NameText := Name; 693 if Attributes.Count > 0 then 694 NameText := NameText + ';' + Attributes.DelimitedText; 695 Add(NameText + ':' + GetNext(Value, LineEnding)); 696 while Pos(LineEnding, Value) > 0 do begin 697 Add(' ' + GetNext(Value, LineEnding)); 702 NameText := Name; 703 if Attributes.Count > 0 then 704 NameText := NameText + ';' + Attributes.DelimitedText; 705 if Encoding <> '' then begin 706 Value2 := GetEncodedValue; 707 NameText := NameText + ';' + Encoding; 708 end else Value2 := Value; 709 if Pos(LineEnding, Value2) > 0 then begin 710 Add(NameText + ':' + GetNext(Value2, LineEnding)); 711 while Pos(LineEnding, Value2) > 0 do begin 712 Add(' ' + GetNext(Value2, LineEnding)); 698 713 end; 699 Add(' ' + GetNext(Value , LineEnding));714 Add(' ' + GetNext(Value2, LineEnding)); 700 715 Add(''); 701 716 end else begin 702 NameText := Name; 703 if Attributes.Count > 0 then 704 NameText := NameText + ';' + Attributes.DelimitedText; 705 Add(NameText + ':' + Value); 717 Add(NameText + ':' + Value2); 706 718 end; 707 719 end; … … 769 781 NewRecord.Properties.Add(NewProperty); 770 782 end; 771 NewProperty.Attributes.DelimitedText := UpperCase(Names);783 NewProperty.Attributes.DelimitedText := Names; 772 784 if NewProperty.Attributes.Count > 0 then begin 773 785 NewProperty.Name := NewProperty.Attributes[0];
Note:
See TracChangeset
for help on using the changeset viewer.