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

Method putStrArg

src/common/StatusArg.cpp:151–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149}
150
151void StatusVector::ImplStatusVector::putStrArg(unsigned startWith)
152{
153 for (ISC_STATUS* arg = m_status_vector.begin() + startWith; *arg != isc_arg_end; arg += fb_utils::nextArg(*arg))
154 {
155 if (!fb_utils::isStr(*arg))
156 continue;
157
158 const char** ptr = reinterpret_cast<const char**>(&arg[fb_utils::nextArg(*arg) - 1]);
159 unsigned pos = m_strings.length();
160 const char* oldBase = m_strings.c_str();
161
162 if (*arg == isc_arg_cstring)
163 {
164 m_strings.reserve(m_strings.length() + arg[1] + 1);
165 m_strings.append(*ptr, arg[1]);
166 m_strings.append(1, '\0');
167 }
168 else
169 m_strings.append(*ptr, strlen(*ptr) + 1);
170
171 *ptr = &m_strings[pos];
172 setStrPointers(oldBase);
173 }
174}
175
176void StatusVector::ImplStatusVector::setStrPointers(const char* oldBase)
177{

Callers

nothing calls this directly

Calls 7

nextArgFunction · 0.85
isStrFunction · 0.85
beginMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45
reserveMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected