Class Specialization
CStyle String
Allows adaption of strings to C-style strings.
Parameters
The value type, that is the type of the items/characters stored in the string. Note: Remarks: Use Value to get the value type for a given class. |
Specialization of
Implements
Metafunctions
The default overflow strategy for explicit resize. (String) | |
The default overflow strategy for implicit resize. (String) | |
Infix sequence type. (String) | |
Determines whether a container stores its elements in sequential order. (String) | |
Type of iterator objects that are used to traverse the container. (String) | |
Type of an object that represents a position in a container. (String) | |
Prefix sequence type. (String) | |
The default alphabet type of a suffix array, i.e. the type to store a position of a string or string set. (String) | |
The spec of a class. (String) | |
Suffix sequence type. (String) |
Functions
Concatenate two containers. (String) | |
Assigns one object to another object. (String) | |
Assigns value to item. (Container) | |
Tests whether iterator is at nil position. (String) | |
The last item in container. (Container) | |
The begin of a container. (String) | |
Begin position of object in host. (String) | |
Test whether an automaton can parse a string completely. (String) | |
The maximal length. (String) | |
Resets an object. (String) | |
Returns all leaves underneath a given vertex. (String) | |
Makes an object to owner of its content. | |
Creates a factor oracle. (String) | |
Creates a factor oracle for the reversed string. (String) | |
Creates a trie of all suffixes of a text. (String) | |
Creates a trie. (String) | |
Creates a trie for all reversed keywords. (String) | |
Test whether object depends on other objects. | |
Determines the consensus pattern of a given profile. (String) | |
Test a container for being empty. (String) | |
The end of a container. (String) | |
End position of object in host. (String) | |
Erases a part of a container (String) | |
Extends a seed. (String) | |
Extenstion of seeds. (String) | |
Resizes and fills a container. (String) | |
The first item in container. (Container) | |
Constructs a alignment from a ChainedSeed. (String) | |
Computes a pairwise distance matrix from an alignment graph. (String) | |
Gets the successor for a given vertex and an edge label. For an automaton a single character is required whereas for a word graph getSuccessor takes a string. (String) | |
Access to the value. (Container) | |
Iterates down one edge or a path in a tree. (String) | |
Moves iterator to nil position. (String) | |
Computes the heaviest increasing subsequence. (String) | |
A value that identifies the underlying sequence. (String) | |
Creates infix object. (String) | |
Creates infix object. (String) | |
Iterator to item at given position. (String) | |
The number of items/characters. (String) | |
Computes the longest common subsequence. (String) | |
Computes the longest increasing subsequence. (String) | |
Assigns value to item. (Container) | |
Parses a string one character at a time and moves accordingly in the automaton. (String) | |
Position of an iterator. (Container) | |
Creates prefix object. (String) | |
Replaces a part of a container with another container. (String) | |
Changes the length. (String) | |
Makes free space in container (String) | |
Calculates the score of a seed. (String) | |
Sets the haystack of a Finder object. (String) | |
Sets the needle of a Pattern object and optionally induces preprocessing. (String) | |
Determines whether two sequences share the same resource. (String) | |
Computes a guide tree from a distance matrix. (String) | |
Retrieves a string of delimiter positions of a StringSet which is needed for local<->global position conversions. (String) | |
Takes a shape given as a string of '1' (relevant position) and '0' (irrelevant position) and converts it into a Shape object. (String) | |
Creates suffix object. (String) | |
Access sequence as c-style string. (String) | |
Performs a topological sort on a directed acyclic graph (DAG). (String) | |
Computes a guide tree from a distance matrix. (String) | |
Reference to the value. (String) |
Remarks
The purpose of this class is to access to the content of a sequence
in a "zero terminated string" style.
This can be useful if SEQAN classes has to be integrated in programs that use char arrays
to store strings.
Instances of String<TValue, CStyle> can implicitely converted to a TValue * that
points to a zero terminated CStyle of TValue .
The stored c-style string object can be set by constructors or assignment.
The content of a c-style string can eighter be stored in a separate buffer, that is the source string
is copied. Or the buffer of the source string itself is used instead, in this case the c-style string
depends on the source string and gets invalid as soon as the buffer of the source string is destroyed.
Hence, this class is a kind of adaptor from an arbitrary SEQAN string to char arrays.
Of course, the opposite way is possible too:
Read here about adapting char arrays to SEQAN strings.
Examples
String<char> str = "this is a test string";
//Create a c-style string object for str:
String<char, CStyle> c_style = str;
//Now use c_style as char array:
strcmp(c_style, "compare it to this string");
If the c-style string is needed only temporarily, the function toCString can be used:
strcmp(toCString(str), "compare it to this string");
Example Programs
See Also
SeqAn - Sequence Analysis Library - www.seqan.de