Unit
IB_Components
Declaration
TIB_StringList = class(TStringList)
Description
This class is used heavily throughout IB Objects. It is used in order to
store information that is keyed to a column name. Typically it containes a
list of column names with an '=' and a value that is to be associated with
that column. I call this pair a "link entry".
It is also possible for multiple values to be associated with a column. These
are accessed by using link entry params. It can be thought of like command-line
parameters where there are multiple settings on one line of text.
This type of storage makes it very easy to store settings between sessions
so that user preferences can be maintained. Take a close look at IB_WISQL
code to see how settings are streamed to/from the system registry between
sessions.
IBF_Query should be the best example in this project. Be sure to
look through IBF_Base to see how I have a foundation for streaming built. You
will most likely want to use the WriteStrings() and ReadStrings() methods
to put string list data in/out of the system registry.
Some properties that are referred to heavily are mirrored to an actual
variable so that they can be directly read without the overhead of parsing
these string list entries. Thus, it may appear that duplication exists in
the component interface.
The BNF of the syntax for the link entries are as follows:
Since I don't exactly recall the proper syntax for this I'll give the key
that I use:
< > denote a logical item of the BNF
[] denote an optional portion of an item
( | ) denotes that only one of the items separated by the | are valid
'' denote literal characters
- < link entry > ::= < link name >< equal sign >< link value >
- < link name > ::= [< table name >< period >]< column name >
- < link value > ::= (< string literal >|< param list >)
- < param list > ::= < param name >[=< literal >]
[< param delimiter >< param list >]
- < literal > ::= < char list item >[< literal >]
- < char list item > ::= (< char >|< char pair >)
- < char pair > ::= ( '\=' | '\;' | '\\' | '\n' | '\0' )
- < char > ::= < any character except 2nd char of char pair >
- < param delimiter > ::= ';'
- < equal sign > ::= '='
- < period > ::= '.'
- < table name > ::= < IB identifier >
- < column name > ::= < IB identifier >
- < param name > ::= < IB identifier >
- < IB identifier > ::= < string with no spaces or funky characters, etc. >
The special characters are used in order to prevent the stringlist from
becomming corrupted and to simplify parsing of each string list item.
Don't confuse the notion of "param" above with the input parameters of a
SQL statement. They are used in a different context here.
When using the properties to interface with the contents of the stringlist
the special characters are all converted for you. But, it you directly
access the raw contents of the list you will need to take the special
characters into consideration yourself.
Also, please be cautios of how you punctuate these link entries. In general
if will be a good idea to avoid extra spaces since my parsing may not be so
kind as to allow them.
Introduced Public Properties |
AllowBlankLines |
IndexNames |
Indexed reference to the name portion of the link entry. |
IndexParamIsSet |
Tells whether a value exists for a parameter from the value portions of
a link entry that corresponds with the given index reference. |
IndexParamValue |
Value of a parameter from the value portions of a link entry that
corresponds with the given index reference. |
IndexValues |
Indexed reference to the value portion of the link entry. |
LinkIndex |
Index of the Link in the list of link entries. |
LinkParamIsSet |
Tells whether a value exists for a parameter from the value portions of
a link entry that corresponds with the given link. |
LinkParamValue |
Value of a parameter from the value portions of a link entry that
corresponds with the given link. |
LinkValues |
Value protion associated with the Link in the list of link entries. |
SafeCommaText |
Introduced Public Methods |