|
|
For example, if the Document contains as text the
string "This is a test", the following code:
will modify the text of the Document to
"This is a simple test".
The most important aspect of this function is that it will make the proper arrangements so as the Annotations contained inside the Document to be displaced by a proper amound of characters so as Annotations spanning text ranges after the replacement point to span the same text portions, after the string has replaced the desired characters.
This function will return the new Document text (as an object of type CDM_RawData) if the replacement was succesful. Note that the returned object is owned by the CDM. The caller is not supposed to free or modify the returned object.
In case of an error, NULL will be return and an error message will be
left at the current active Tcl interpreter (CDM_Interp).
This function will return the new Document text (as an object of type
CDM_RawData) if the replacement was succesful.
The returned object is property of the CDM and should never be
freed or modified in any way by the caller. Return Value:
In case of an error, NULL will be return and an error message will be
left at the current active Tcl interpreter (CDM_Interp). This function is equivelant to tip_RawDataReplaceCharacters (Tcl API). Generated by: petasis@aias on Wed Aug 16 10:31:57 PM EEST 2006.
This function can be also used in order to delete
characters from the text contained in the specified Document, if the
value of the "string" parameter is NULL or an empty string (like "").
In this case, all Annotations objects contained in the specified
Document are searched: if any of them has a Span object in its Span
set whoose offsets span portion of the charactes to be deleted,
then this Span is eliminated from the Span set of the Annotation
object. Note that no Annotation objects are deleted from the Document,
although character deletion can result in Annotations with an empty
Span set. Notes:
CDM_ByteSequenceReplaceCharacters, CDM_RawDataInsertString,
CDM_DisplaceAnnotations,
CDM_GetRawData, CDM_SetRawData,
tip_RawDataReplaceCharacters
See Also: