From d7781f06f180fa2f7893fe6cac0b8024aff84719 Mon Sep 17 00:00:00 2001 From: dsiders Date: Wed, 26 Jul 2023 03:06:44 +0100 Subject: [PATCH] Docs: LCL/lresources. Adds and updates topics for changes in cb4383bd4c. * TLazObjectWriterString * TLRSObjectWriter.WriteString (cherry picked from commit df44e8f62cf4593089ab131033ef559050323215) --- docs/xml/lcl/lresources.xml | 59 +++++++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 5 deletions(-) diff --git a/docs/xml/lcl/lresources.xml b/docs/xml/lcl/lresources.xml index cb4383bd4c..a134fa7144 100644 --- a/docs/xml/lcl/lresources.xml +++ b/docs/xml/lcl/lresources.xml @@ -1011,7 +1011,29 @@ writer. - + + + + +Compiler version-specific alias for String values used in TLRSObjectWriter. + + +

+TLazObjectWriterString is the type passed as an argument to the +WriteString method in TLRSObjectWriter. +

+

+For FPC version 3.3.1 and later, it is an alias to the RawByteString type. For +previous FPC versions, it is an alias to the String type. +

+
+ +Added in LazUtils version 3.0. + + + + +
Object writer for Lazarus Resource Streams. @@ -1429,12 +1451,39 @@ The TLRSObjectWriter can find empty entries and omit writing them to stream. - - - + +Writes a string value using the format for the LRS object writer. + + +

+WriteString is an overridden method in TLazObjectWriter +used to store the specified string value to the storage format used in the +writer class. +

+

+WriteString uses the length of the specified string in Value to determine the +actions needed in the method. If the value can be represented using the +ShortString type (255 characters or less), WriteValue is called to write a +single Byte value with the length for the vaString type. For longer string +values, an Integer value is written using the Endian-ness for the platform. +The Write method is called to store the string content when the length is a +positive non-zero value. +

+

+WriteString implements the abstract virtual method defined in +TAbstractObjectWriter. +

+
+ +Modified in LCL version 3.0 to use the TLazObjectWriterString type +instead of the String type in the Value argument. + + +TAbstractObjectWriter +
- +String value stored in the method.