Recap:

Way 1: Introduce new method(s), leave Write/ReadAnsiString as is.
1.1
 procedure WriteRawString(const s: string);
 function ReadRawString(Len: integer)

1.2 (ready for future when string will be UnicodeString)
 procedure WriteString(const s: string);
 function ReadString(Len: integer)

1.3 (create superior of Write/ReadAnsiString)
 type TStringLengthPrefix = (lenNone, lenWord, lenDWord);
procedure WriteString(const s: string; WriteLength: TStringLengthPrefix = lenNone); function ReadString(ReadLength: TStringLengthPrefix=lenNone; Len: integer=0);

Way 2: Extend existing Write/ReadAnsiString (keeping backward compatibility)
2.1
 type TStringLengthPrefix = (lenNone, lenWord, lenDWord);
procedure WriteAnsiString(const s: string; WriteLength: TStringLengthPrefix = lenDWord); function ReadAnsiString(ReadLength: TStringLengthPrefix=lenDWord; Len: integer=0); (but IMO in future, when string becomes unicodestring, then "Ansi" in name will sound strange if parameter does not change from "string" to "ansistring")

Way 3: Do nothing ;-)
If nobody else consider it as useful. ;-)

-Laco.

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to