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

Function parseSyncReplica

src/jrd/replication/Config.cpp:172–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170 }
171
172 bool parseSyncReplica(CheckStatusWrapper* status, const ConfigFile::Parameters& params, SyncReplica& output)
173 {
174 bool result = true;
175 for (const auto& el : params)
176 {
177 const string key(el.name.c_str());
178 const string value(el.value);
179
180 if (value.isEmpty())
181 {
182 configError(status, "empty value", output.database, key);
183 result = false;
184 }
185
186 if (key.find("username") == 0)
187 {
188 if (output.username.hasData())
189 {
190 configError(status, "multiple values", output.database, "username");
191 result = false;
192 }
193 result &= parseExternalValue(status, key, value, output.username);
194 output.username.rtrim(" ");
195 }
196 else if (key.find("password") == 0)
197 {
198 if (output.password.hasData())
199 {
200 configError(status, "multiple values", output.database, "password");
201 result = false;
202 }
203 result &= parseExternalValue(status, key, value, output.password);
204 }
205 else
206 {
207 configError(status, "unknown key", output.database, key);
208 result = false;
209 }
210 }
211 return result;
212 }
213}
214
215

Callers 1

getMethod · 0.85

Calls 7

configErrorFunction · 0.85
parseExternalValueFunction · 0.85
rtrimMethod · 0.80
c_strMethod · 0.45
isEmptyMethod · 0.45
findMethod · 0.45
hasDataMethod · 0.45

Tested by

no test coverage detected