DSIBinaryLikeHelper Class Reference

Inherits Simba::DSI::DSIBinaryCollator.

Inherited by DSIBinaryLikeMatcher [private].

List of all members.

Static Public Member Functions

static void IntializeEncoding (const EncodingType &in_encoding, simba_string &out_multiChar, simba_string &out_singleChar, simba_string &out_spaceChar, simba_int32 &out_codeUnitSize)
 Set the encoding byte length from type.
static void ParsePatternAndEscapeStrings (const void *in_pattern, simba_int32 in_patternLength, const void *in_escapeChar, simba_int32 in_escapeCharLength, IndexVector &io_metaCharVector, simba_string &io_cPattern, const simba_string &in_multiChar, const simba_string &in_singleChar, const simba_int32 in_codeunitSize)
 Parse the pattern string and push all metacharacters to an Index Vector.

Protected Types

typedef SearchContext
< DSIBinaryLikeHelper
LikeSearchContext
 The typeDefinition of the search optimization structure to use.

Protected Member Functions

 DSIBinaryLikeHelper (EncodingType in_encoding, const simba_string in_multiChar, const simba_string in_singleChar, const simba_string in_spaceChar, const simba_int32 in_codeUnitSize)
 Constructor, initializes inherited class DSIBinaryCollator.
bool EndsWith (const LikeVector::const_iterator &in_LikeNodeIter, const void *in_string, const simba_int32 in_stringByteLength, const simba_int32 in_startIndexInBytes, simba_int32 &out_resultLengthInBytes) const
 Match the pattern to the end of the input string. Ignores all trailing spaces after last char.
bool Search (simba_int32 in_offset, const void *in_pattern, const simba_int32 in_patternByteLength, const void *in_string, const simba_int32 in_stringByteLength, simba_int32 &out_resultLengthInBytes, simba_int32 &out_indexInBytes) const
 Search for pattern within string.
bool SkipN (const void *in_string, const simba_int32 in_stringByteLength, simba_int32 in_currentIndexInBytes, simba_int32 in_skipGraphemes, simba_int32 &out_numberofBytesSkipped) const
 Skip 'n' grapheme clusters in the input string.
bool StartsWith (const void *in_pattern, const simba_int32 in_patternByteLength, const void *in_string, const simba_int32 in_stringByteLength, const simba_int32 in_startIndexInBytes, simba_int32 &out_resultLengthInBytes) const
 Match the pattern to the beginning of the input string.

Member Typedef Documentation

The typeDefinition of the search optimization structure to use.


Constructor & Destructor Documentation

DSIBinaryLikeHelper ( EncodingType  in_encoding,
const simba_string  in_multiChar,
const simba_string  in_singleChar,
const simba_string  in_spaceChar,
const simba_int32  in_codeUnitSize 
) [protected]

Constructor, initializes inherited class DSIBinaryCollator.

Parameters:
the encoding type for the match and pattern strings.
in_multiChar The converted multiple "%" wild card character with the same encoding as in_encoding.
in_singleChar The converted single "_" wild card character with the same encoding as in_encoding.
in_spaceChar The converted space " " character with the same encoding as in_encoding.
in_codeUnitSize The code unit size in bytes for the encoding of in_encodding.

Member Function Documentation

bool EndsWith ( const LikeVector::const_iterator &  in_LikeNodeIter,
const void *  in_string,
const simba_int32  in_stringByteLength,
const simba_int32  in_startIndexInBytes,
simba_int32 &  out_resultLengthInBytes 
) const [protected]

Match the pattern to the end of the input string. Ignores all trailing spaces after last char.

Parameters:
in_likeNodeIter An iterator pointing to the final node in the LikeVector.
in_string Void pointer to the string being searched. Cannot be NULL. (NOT OWN)
in_stringByteLength The length of the string in bytes.
in_startIndexInBytes The offset where searching will start, in bytes.
out_resultLengthInBytes Return the length of a matched segment in bytes.
Returns:
a boolean value. TRUE if match found, FALSE otherwise.
static void IntializeEncoding ( const EncodingType &  in_encoding,
simba_string &  out_multiChar,
simba_string &  out_singleChar,
simba_string &  out_spaceChar,
simba_int32 &  out_codeUnitSize 
) [static]

Set the encoding byte length from type.

Parameters:
in_encoding The encoding type.
out_multiChar A string for the converted % char.
out_singleChar A string for the converted _ char.
out_spaceChar A string for the converted " " char.
out_codeUnitSize The size of the code unit.
static void ParsePatternAndEscapeStrings ( const void *  in_pattern,
simba_int32  in_patternLength,
const void *  in_escapeChar,
simba_int32  in_escapeCharLength,
IndexVector io_metaCharVector,
simba_string &  io_cPattern,
const simba_string &  in_multiChar,
const simba_string &  in_singleChar,
const simba_int32  in_codeunitSize 
) [static]

Parse the pattern string and push all metacharacters to an Index Vector.

Parameters:
in_pattern A byte array containing the pattern. Can not be NULL. (NOT OWN)
in_patternLength The length of in_pattern in bytes.
in_escapeChar THe escape character for the pattern. If NULL, assume no escape char. (NOT OWN)
in_escapeCharLength The length of in_escapeChar in bytes.
io_metaCharVector A IndexVector which will be populated with all non-escaped metaCharacters.
io_cPattern The cleaned pattern string (no escape characters)
in_multiChar The converted multiple wild card character with the same encoding as in_pattern.
in_singleChar The converted single wild card character with the same encoding as in_pattern.
in_codeunitSize The code unit size in bytes for the encoding of in_pattern.
bool Search ( simba_int32  in_offset,
const void *  in_pattern,
const simba_int32  in_patternByteLength,
const void *  in_string,
const simba_int32  in_stringByteLength,
simba_int32 &  out_resultLengthInBytes,
simba_int32 &  out_indexInBytes 
) const [protected]

Search for pattern within string.

The collations of the two given strings are already known at the creation time of the Collator.

Parameters:
in_offset The offset to use when searching.
in_pattern Void pointer to the pattern. Cannot be NULL. (NOT OWN)
in_patternByteLength The length of the pattern in bytes.
in_string Void pointer to the string being searched. Cannot be NULL. (NOT OWN)
in_stringByteLength The length of the string in bytes.
out_resultLengthInBytes Return the length of matched segment in bytes.
out_indexInBytes the index position in bytes if match found. If no match found, output SIMBA_NPOS.
Returns:
true if match was found.
bool SkipN ( const void *  in_string,
const simba_int32  in_stringByteLength,
simba_int32  in_currentIndexInBytes,
simba_int32  in_skipGraphemes,
simba_int32 &  out_numberofBytesSkipped 
) const [protected]

Skip 'n' grapheme clusters in the input string.

For the purposes of binary comparisons, the 'grapheme cluster' will be considered and treated as a code unit as defined by the encoding type.

Parameters:
in_string Void pointer to the string being searched. Cannot be NULL. (NOT OWN)
in_stringByteLength The length of the string in bytes.
in_startIndexInBytes The offset where searching will start, in bytes.
in_skipGraphemes The number of 'grapheme clusters' to skip.
out_numberofBytesSkipped the number of bytes skipped based on the grapheme cluster analysis of the string
Returns:
true if the skip succeeded.
bool StartsWith ( const void *  in_pattern,
const simba_int32  in_patternByteLength,
const void *  in_string,
const simba_int32  in_stringByteLength,
const simba_int32  in_startIndexInBytes,
simba_int32 &  out_resultLengthInBytes 
) const [protected]

Match the pattern to the beginning of the input string.

Parameters:
in_pattern Void pointer to the pattern. Cannot be NULL. (NOT OWN)
in_patternByteLength The length of the pattern in bytes.
in_string Void pointer to the string being searched. Cannot be NULL. (NOT OWN)
in_stringByteLength The length of the string in bytes.
in_startIndexInBytes The offset where searching will start, in bytes.
out_resultLengthInBytes Return the length of matched segment in bytes.
Returns:
a boolean value. TRUE if matched found, FALSE otherwise.

The documentation for this class was generated from the following file:

Generated on Wed May 17 14:21:15 2017 for SimbaEngine 10.1.3.1011 by simba