MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / TextType

Method TextType

src/common/TextType.cpp:104–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102
103
104TextType::TextType(TTYPE_ID _type, texttype *_tt, USHORT _attributes, CharSet* _cs)
105 : tt(_tt), cs(_cs), type(_type), attributes(_attributes)
106{
107 if (cs->getSqlMatchAnyLength() != 0)
108 {
109 canonical(cs->getSqlMatchAnyLength(), cs->getSqlMatchAny(),
110 sizeof(ULONG), reinterpret_cast<UCHAR*>(&canonicalChars[CHAR_SQL_MATCH_ANY]));
111 }
112 else
113 memset(&canonicalChars[CHAR_SQL_MATCH_ANY], 0, sizeof(ULONG));
114
115 if (cs->getSqlMatchOneLength() != 0)
116 {
117 canonical(cs->getSqlMatchOneLength(), cs->getSqlMatchOne(),
118 sizeof(ULONG), reinterpret_cast<UCHAR*>(&canonicalChars[CHAR_SQL_MATCH_ONE]));
119 }
120 else
121 memset(&canonicalChars[CHAR_SQL_MATCH_ONE], 0, sizeof(ULONG));
122
123 struct Conversion
124 {
125 USHORT code;
126 int ch;
127 };
128
129 const Conversion conversions[] =
130 {
131 {'*', CHAR_ASTERISK},
132 {'@', CHAR_AT},
133 {'^', CHAR_CIRCUMFLEX},
134 {':', CHAR_COLON},
135 {',', CHAR_COMMA},
136 {'=', CHAR_EQUAL},
137 {'-', CHAR_MINUS},
138 {'%', CHAR_PERCENT},
139 {'+', CHAR_PLUS},
140 {'?', CHAR_QUESTION_MARK},
141 {' ', CHAR_SPACE},
142 {'~', CHAR_TILDE},
143 {'_', CHAR_UNDERLINE},
144 {'|', CHAR_VERTICAL_BAR},
145 {'"', CHAR_DOUBLE_QUOTE},
146 {'{', CHAR_OPEN_BRACE},
147 {'}', CHAR_CLOSE_BRACE},
148 {'[', CHAR_OPEN_BRACKET},
149 {']', CHAR_CLOSE_BRACKET},
150 {'(', CHAR_OPEN_PAREN},
151 {')', CHAR_CLOSE_PAREN},
152 {'s', CHAR_LOWER_S},
153 {'S', CHAR_UPPER_S}
154 };
155
156 for (int i = 0; i < FB_NELEM(conversions); i++)
157 {
158 try
159 {
160 UCHAR temp[sizeof(ULONG)];
161

Callers

nothing calls this directly

Calls 7

canonicalClass · 0.85
getSqlMatchAnyLengthMethod · 0.80
getSqlMatchAnyMethod · 0.80
getSqlMatchOneLengthMethod · 0.80
getSqlMatchOneMethod · 0.80
getConvFromUnicodeMethod · 0.80
convertMethod · 0.45

Tested by

no test coverage detected