* Correct comments about sizes/offsets in invisible string header record

git-svn-id: trunk@33247 -
This commit is contained in:
michael 2016-03-13 19:03:40 +00:00
parent 416151a335
commit 1bdae1edc8
3 changed files with 12 additions and 13 deletions

View File

@ -24,12 +24,12 @@
This file contains the implementation of the AnsiString type,
and all things that are needed for it.
AnsiString is defined as a 'silent' pchar :
a pchar that points to :
a pchar that points to (S= SizeOf(SizeInt)):
@-16 : Code page indicator.
@-12 : Character size (2 bytes)
@-8 : SizeInt for reference count;
@-4 : SizeInt for size;
@-3*S : Code page indicator.
@-3*S+2 : Character size (2 bytes)
@-2*S : SizeInt for reference count;
@-S : SizeInt for size;
@ : String + Terminating #0;
Pchar(Ansistring) is a valid typecast.
So AS[i] is converted to the address @AS+i-1.

View File

@ -21,12 +21,12 @@
This file contains the implementation of the UnicodeString type,
and all things that are needed for it.
UnicodeString is defined as a 'silent' punicodechar :
a punicodechar that points to :
a punicodechar that points to (S = SizeOf(SizeInt)) :
@-8 : SizeInt for reference count;
@-4 : SizeInt for size; size=number of chars. Multiply with
sizeof(UnicodeChar) to get the number of bytes. This is compatible with Delphi.
@ : String + Terminating #0;
@-2*S : SizeInt for reference count;
@-S : SizeInt for size; size=number of chars. Multiply with
sizeof(UnicodeChar) to get the number of bytes. This is compatible with Delphi.
@ : String + Terminating #0;
Punicodechar(Unicodestring) is a valid typecast.
So WS[i] is converted to the address @WS+i-1.

View File

@ -18,10 +18,9 @@
This file contains the implementation of the WideString type,
and all things that are needed for it.
WideString is defined as a 'silent' pwidechar :
a pwidechar that points to :
a pwidechar that points to:
@-8 : SizeInt for reference count;
@-4 : SizeInt for size; size=number of bytes, not the number of chars. Divide or multiply
@-4 : DWord for size; size=number of bytes, not the number of chars. Divide or multiply
with sizeof(WideChar) to convert. This is needed to be compatible with Delphi and
Windows COM BSTR.
@ : String + Terminating #0;