girtobac
0.4
Create FB Headers from GObject Introspection *.gir files
|
Object to check texts (Su) and provide replacements (Er) More...
Public Member Functions | |
RepData (BYVAL_AS_CONST_gchar_PTR T) | |
the constructor stores the tag name More... | |
FUNCTION_AS_LONG | Az () |
provide number of entries in the buffer More... | |
SUB | add (BYVAL_AS_CONST_ZSTRING_PTR, BYVAL_AS_CONST_ZSTRING_PTR) |
Add entries to buffers. More... | |
FUNCTION_AS_CONST_ZSTRING_PTR | rep (BYVAL_AS_CONST_gchar_PTR T) |
Get replacement for a text (if any)) More... | |
SUB | list (BYREF_AS_STRING Li) |
Generate a list of un-used symbols. More... | |
Public Attributes | |
CONST_gchar_PTR | Na |
the name of the XML-tag More... | |
STRING | Er |
buffer holding replacement texts and match-entry-counters More... | |
STRING | Su = MKL(0) & CHR(1) |
buffer holding the entry counter, search texts and the start of their replacements More... | |
Object to check texts (Su) and provide replacements (Er)
This object can get feeded by search and replacement texts. After adding some pairs the RepData::rep() member function is used to receive the replacement text for a match or the original text otherwise. The search is done case-sensitive. Search text must not contain CHR(0) to CHR(2), because these characters are used internally.
The object counts the number of entries and the number of matches for each entry. The list member function executes a callback function on each entry.
Definition at line 25 of file girtobac_RepData.bas.
RepData::RepData | ( | BYVAL_AS_CONST_gchar_PTR | T | ) |
the constructor stores the tag name
Definition at line 38 of file girtobac_RepData.bas.
FUNCTION_AS_LONG RepData::Az | ( | ) |
provide number of entries in the buffer
Each time a text gets added to the UDT a counter gets increased. This function provides the counter result. (An entry can get added only once, a duplicate doesn't get counted.)
Definition at line 50 of file girtobac_RepData.bas.
SUB RepData::add | ( | BYVAL_AS_CONST_ZSTRING_PTR | S, |
BYVAL_AS_CONST_ZSTRING_PTR | E | ||
) |
Add entries to buffers.
S | The text to search for |
E | The replacement for this search text |
This function gets called to add some text to the UDT. It adds both, the text to search for and the text replacement to the buffers and sets their counter to zero. In case of duplicates or illegal characters in the search string an error text gets returned (and zero on success). There's no checking of the replacement string, it mustn't contain zero characters.
Definition at line 86 of file girtobac_RepData.bas.
FUNCTION_AS_CONST_ZSTRING_PTR RepData::rep | ( | BYVAL_AS_CONST_gchar_PTR | T | ) |
Get replacement for a text (if any))
T | The text to search for |
This function searches for a text in the search buffer. On found the text (case-sensitive) it returns a pointer to the replacement string (defined when calling the function RepData::add()). In case of no match in the search buffer a pointer to the original text gets returned.
Definition at line 106 of file girtobac_RepData.bas.
SUB RepData::list | ( | BYREF_AS_STRING | Li | ) |
Generate a list of un-used symbols.
Li | string to list un-used symbols |
Each symbol-found gets counted. This procedure adds the un-used symbols to the list in the string.
Definition at line 61 of file girtobac_RepData.bas.
CONST_gchar_PTR RepData::Na |
the name of the XML-tag
Definition at line 26 of file girtobac_RepData.bas.
STRING RepData::Er |
buffer holding replacement texts and match-entry-counters
Definition at line 28 of file girtobac_RepData.bas.
STRING RepData::Su = MKL(0) & CHR(1) |
buffer holding the entry counter, search texts and the start of their replacements
Definition at line 29 of file girtobac_RepData.bas.