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

Function add

src/auth/SecureRemotePassword/Message.h:125–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123
124 template <typename T>
125 unsigned add(unsigned& t, unsigned& sz, FieldLink* lnk)
126 {
127 if (metadata)
128 {
129 unsigned l = metadata->getCount(&statusWrapper);
130 check(&statusWrapper);
131 if (fieldCount >= l)
132 {
133#ifdef INTERNAL_FIREBIRD
134 (Firebird::Arg::Gds(isc_random) <<
135 "Attempt to add to the message more variables than possible").raise();
136#else
137 fatalErrorHandler("Attempt to add to the message more variables than possible");
138#endif
139 }
140
141 t = metadata->getType(&statusWrapper, fieldCount);
142 check(&statusWrapper);
143 sz = metadata->getLength(&statusWrapper, fieldCount);
144 check(&statusWrapper);
145 if (!checkType<T>(t, sz))
146 {
147#ifdef INTERNAL_FIREBIRD
148 (Firebird::Arg::Gds(isc_random) << "Incompatible data type").raise();
149#else
150 fatalErrorHandler("Incompatible data type");
151#endif
152 }
153 }
154 else
155 {
156 fb_assert(builder);
157
158 unsigned f = builder->addField(&statusWrapper);
159 check(&statusWrapper);
160
161 fb_assert(f == fieldCount);
162
163 t = getType<T>(sz);
164 builder->setType(&statusWrapper, f, t);
165 check(&statusWrapper);
166 builder->setLength(&statusWrapper, f, sz);
167 check(&statusWrapper);
168
169 lnk->next = fieldList;
170 fieldList = lnk;
171 }
172
173 return fieldCount++;
174 }
175
176 static void check(Firebird::IStatus* status)
177 {

Callers 15

loginFailMethod · 0.50
setMethod · 0.50
executeMethod · 0.50
aggPassMethod · 0.50
DatabaseBindingsMethod · 0.50
setRuleMethod · 0.50
addMethod · 0.50
populateMethod · 0.50
PushRpbMethod · 0.50
ArrayMethod · 0.50
pushMethod · 0.50

Calls 9

GdsClass · 0.85
checkFunction · 0.70
getCountMethod · 0.45
raiseMethod · 0.45
getTypeMethod · 0.45
getLengthMethod · 0.45
addFieldMethod · 0.45
setTypeMethod · 0.45
setLengthMethod · 0.45

Tested by

no test coverage detected