@@ -281,12 +281,15 @@ TREMLEntity = record
281
281
}
282
282
end ;
283
283
class var fEntityMap: array of TREMLEntity; // Entity <=> character map
284
+
285
+ // / <summary>Attempts to map a character to an associated mnemonic
286
+ // / character entity, without the surrounding <c>&</c> and <c>;</c>
287
+ // / characters.</summary>
288
+ // / <param name="Ch"><c>Char</c> [in] Character to be mapped.</param>
289
+ // / <returns><c>string</c>. The associated mnemonic entity or an empty
290
+ // / string if not such entity exists.</returns>
284
291
class function CharToMnemonicEntity (const Ch: Char): string;
285
- { Gets the mnemonic character entity that represents a character.
286
- @param Entity [in] Character for which equivalent entity is required.
287
- @return Required entity or '' if character has no matching mnemonic
288
- entity.
289
- }
292
+
290
293
class function GetCount : Integer; static;
291
294
{ Read accessor for Count property.
292
295
@return Number of supported tags.
@@ -309,13 +312,16 @@ TREMLEntity = record
309
312
class destructor Destroy;
310
313
{ Class destructor. Clears entity map
311
314
}
315
+
316
+ // / <summary>Attempts to map a character to a character enitity, without
317
+ // / the surrounding <c>&</c> and <c>;</c> characters.</summary>
318
+ // / <param name="Ch"><c>Char</c> [in] Character to be mapped.</param>
319
+ // / <returns><c>string</c>. A mnemonic entity if one exists for <c>Ch</c>.
320
+ // / Otherwise if <c>Ch</c> is not a printable ASCII character a numeric
321
+ // / entity is returned. If <c>Ch</c> is a printable ASCII character an
322
+ // / empty string is returned.</returns>
312
323
class function MapToEntity (const Ch: Char): string;
313
- { Maps a character to a character entity if appropriate.
314
- @param Ch [in] Character to be mapped.
315
- @return Mnemonic entity if one exists, character itself if it is
316
- printable and has ascii value less than 127, or a numeric character
317
- otherwise.
318
- }
324
+
319
325
class property Count: Integer read GetCount;
320
326
{ Number of supported tags}
321
327
class property Entities[Idx: Integer]: string read GetEntity;
@@ -1013,10 +1019,6 @@ constructor TREMLTags.TREMLTag.Create(const AId: TActiveTextActionElemKind;
1013
1019
{ TREMLEntities }
1014
1020
1015
1021
class function TREMLEntities.CharToMnemonicEntity (const Ch: Char): string;
1016
- { Gets the mnemonic character entity that represents a character.
1017
- @param Entity [in] Character for which equivalent entity is required.
1018
- @return Required entity or '' if character has no matching mnemonic entity.
1019
- }
1020
1022
var
1021
1023
Idx: Integer; // loops thru table of entity / characters
1022
1024
begin
@@ -1112,11 +1114,6 @@ class function TREMLEntities.GetEntity(Idx: Integer): string;
1112
1114
end ;
1113
1115
1114
1116
class function TREMLEntities.MapToEntity (const Ch: Char): string;
1115
- { Maps a character to a character entity if appropriate.
1116
- @param Ch [in] Character to be mapped.
1117
- @return Mnemonic entity if one exists, character itself if it is printable
1118
- and has ascii value less than 127, or a numeric character otherwise.
1119
- }
1120
1117
begin
1121
1118
Result := CharToMnemonicEntity(Ch);
1122
1119
if (Result = ' ' ) and ( (Ord(Ch) <= 31 ) or (Ord(Ch) >= 127 ) ) then
0 commit comments