Sack Library Documentation
ContentsIndexReferenceHome
PreviousUpNext
sack::containers::text::TEXT Structure
C++
typedef struct text_segment_tag {
  _32 flags;
  struct text_segment_tag * Next;
  struct text_segment_tag * Prior;
  FORMAT format;
  struct {
    PTRSZVAL size;
    TEXTCHAR data[1];
  } data;
} TEXT, * PTEXT;
Members 
Description 
_32 flags; 
then here I could overlap with pEnt .bshadow, bmacro, btext ? 
struct text_segment_tag * Next; 
This points to the next segment in the sentence or phrase. NULL if at the end of the line. 
struct text_segment_tag * Prior; 
This points to the prior segment in the sentence or phrase. (NULL if at the first segment) 
FORMAT format; 
format is 64 bits. it's two 32 bit bitfields (position, expression) valid if TF_FORMAT is set... 
struct {
PTRSZVAL size;
TEXTCHAR data[1];
} data; 
A description of the data stored here. It is compatible with a DATABLOCk.... 
PTRSZVAL size; 
unsigned size; size is sometimes a pointer value... this means bad thing when we change platforms... Or not, since we went to PTRSZVAL which is big enough for a pointer. 
TEXTCHAR data[1]; 
the data of the test segment beginning of var data - this is created size+sizeof(TEXT) 

A Text segment, it is based on DataBlock that has a length and an addtional region at the end of the structure which contains the text of the segment. Segments may have formatting attributes. Segments may be linked to other segments in a NEXTLINE/PRIORLINE. Segments may have indirect content, which may represent phrases. Sets of segments may represent sentence diagrams. A Pointer to a TEXT type. 

TEXT is a type I created to provide a variety of functions. One particular application was a common language processor, and I created the TEXT structure to store elements which are described by language. Sentences are words, and phases. A phrase is a set of words, but sometimes a word is a phrase. 

 

(sentence) = ( word ) ... (phrase ) ... 

(phrase) = (word)... 

 

hmm.. how to describe this. 

 

PTEXT phrase = NULL;
SegAppend( phrase, SegCreateFromText( "Test" ) );
SegAppend( phrase, SegCreateFromText( "Test" ) );
SegAppend( phrase, SegCreateFromText( "Test" ) );

 

PTEXT segments point at other segments. A list of segments is a sentence. Segments can have information encoded on them that remove text from them. For instance, < and > tags might be removed around a phrase and stored as an attribute of the segment. A segment with such an attribute could be an indirect segment that points at a list of words which are the phrases in the tag. 

 

   
a map of two segments, and their content...
   
    (segment with TF_TAG) -> (segment with TF_TAG)
          |                        |
          + - ("html")             + - (body) -> (background="#000000")
   
   
would actually expand to
   <html><body background="#000000">
   
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright (c) 2000+. All rights reserved.
What do you think about this topic? Send feedback!