Simple string set class for use in the dtSearch C++ Support classes and sample code.
File: dstring.h
Namespace: dtSearch
Method |
Description |
---|---|
Constructor | |
Constructor copying data from another string set | |
Constructor copying data from a buffer containing null-delimited string set | |
Constructor specifying a starting size for the buffer | |
Constructor specifying a starting size for the buffer and for the index | |
Append all strings from a set to this set | |
Append a .NET System::String | |
Append a .NET System::String | |
Append a string to the set | |
Format an integer as a string and append it to the set | |
Append a field-value pair (appends the field name, then appends the value) | |
Append a string to this set only if it is not already present | |
Append a Unicode string to the set (converting to UTF8) | |
Append a Unicode string to the set (converting to UTF8) | |
Clear all strings from the set | |
Copy a set | |
Make a string set from a .NET System::Collections::Specialized::StringCollection | |
Make a string set from a .NET System::Collections::Specialized::StringCollection | |
Copy a set from a buffer containing a null-delimited string set, terminated by a double null | |
Remove a string from the set | |
Find a string in the set | |
Search for a field name. Assumes the set contains a series of field names, each followed by its corresponding field value | |
Find a string starting with a prefix | |
Format the set as a delimited, quoted string, minimizing the use of quotation marks | |
Format the set as a delimited, quoted string (assumes values contain no quotes) | |
Format the set as field: value pairs | |
Returns the start of the buffer containing the strings in this set | |
Return the number of strings in the set | |
Retrieve a field value by name. | |
Return last string from the set | |
Return the size of the data in the buffer | |
Read lines of text from a file into a string set | |
Read lines of text from a file into a string set (UTF-8 filename) | |
Return one string from the set | |
Append a string to this set only if it is not already present, using a case-insensitive search | |
Find a string in the set (case-insensitive) | |
Find a string starting with a prefix (case-insensitive) | |
Append all strings in another set that are not already present, using a case-insensitive search | |
Parse lines of text from a text buffer into a string set | |
Insert a string as the first string in this set | |
Find a string starting with a prefix, searching in reverse order | |
Sort strings in the set in alphabetical order | |
Create a string set from a delimited string | |
Create a string set from a delimited string, allowing for multiple delimiter characters | |
Create a string set from a delimited string, allowing for quotation | |
Append all strings in another set that are not already present | |
Write lines of text to a file from a string set (UTF-8 filename) |
Method |
Description |
---|---|
Constructor | |
Constructor copying data from another string set | |
Constructor copying data from a buffer containing null-delimited string set | |
Constructor specifying a starting size for the buffer | |
Constructor specifying a starting size for the buffer and for the index | |
Append all strings from a set to this set | |
Append a .NET System::String | |
Append a .NET System::String | |
Append a string to the set | |
Format an integer as a string and append it to the set | |
Append a field-value pair (appends the field name, then appends the value) | |
Append a string to this set only if it is not already present | |
Append a Unicode string to the set (converting to UTF8) | |
Append a Unicode string to the set (converting to UTF8) | |
Clear all strings from the set | |
Copy a set | |
Make a string set from a .NET System::Collections::Specialized::StringCollection | |
Make a string set from a .NET System::Collections::Specialized::StringCollection | |
Copy a set from a buffer containing a null-delimited string set, terminated by a double null | |
Remove a string from the set | |
Find a string in the set | |
Search for a field name. Assumes the set contains a series of field names, each followed by its corresponding field value | |
Find a string starting with a prefix | |
Format the set as a delimited, quoted string, minimizing the use of quotation marks | |
Format the set as a delimited, quoted string (assumes values contain no quotes) | |
Format the set as field: value pairs | |
Returns the start of the buffer containing the strings in this set | |
Return the number of strings in the set | |
Retrieve a field value by name. | |
Return last string from the set | |
Return the size of the data in the buffer | |
Read lines of text from a file into a string set | |
Read lines of text from a file into a string set (UTF-8 filename) | |
Return one string from the set | |
Append a string to this set only if it is not already present, using a case-insensitive search | |
Find a string in the set (case-insensitive) | |
Find a string starting with a prefix (case-insensitive) | |
Append all strings in another set that are not already present, using a case-insensitive search | |
Parse lines of text from a text buffer into a string set | |
Insert a string as the first string in this set | |
Find a string starting with a prefix, searching in reverse order | |
Sort strings in the set in alphabetical order | |
Create a string set from a delimited string | |
Create a string set from a delimited string, allowing for multiple delimiter characters | |
Create a string set from a delimited string, allowing for quotation | |
Append all strings in another set that are not already present | |
Write lines of text to a file from a string set (UTF-8 filename) |
Usually the text in a DStringSet is stored as UTF-8, although any single-byte character set can be used.
In the dtSearch Engine's C++ API, several API elements expect a set of strings, such as the folders to index in dtsIndexJob or the indexes to search in dtsSearchJob, formatted as a null-delimited string set Each string is separated by a single null character, with a double-null at the end, like this:
DStringSet provides a class to construct this type of string set. To create a null-delimited string set from a set of strings, declare a DStringSet, call append() with each string, and then call getBuffer() to get the start of the buffer. Example: