MCPcopy Create free account
hub / github.com/MITK/MITK / Serialize

Method Serialize

Plugins/org.blueberry.core.commands/src/berryParameterizedCommand.cpp:200–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200QString ParameterizedCommand::Serialize()
201{
202 const QString escapedId(this->Escape(this->GetId()));
203
204 if (parameterizations.empty())
205 {
206 return escapedId;
207 }
208
209 QString str;
210 QTextStream buffer(&str);
211 buffer << CommandManager::PARAMETER_START_CHAR;
212
213 for (int i = 0; i < parameterizations.size(); i++)
214 {
215
216 if (i> 0)
217 {
218 // insert separator between parameters
219 buffer << CommandManager::PARAMETER_SEPARATOR_CHAR;
220 }
221
222 const Parameterization& parameterization = parameterizations[i];
223 const QString parameterId(parameterization.GetParameter()->GetId());
224 const QString escapedParameterId(this->Escape(parameterId));
225
226 buffer << escapedParameterId;
227
228 const QString parameterValue(parameterization.GetValue());
229 if (!parameterValue.isEmpty())
230 {
231 const QString escapedParameterValue(this->Escape(parameterValue));
232 buffer << CommandManager::ID_VALUE_CHAR
233 << escapedParameterValue;
234 }
235 }
236
237 buffer << CommandManager::PARAMETER_END_CHAR;
238
239 return str;
240}
241
242QString ParameterizedCommand::ToString() const
243{

Callers

nothing calls this directly

Calls 6

EscapeMethod · 0.95
GetIdMethod · 0.95
emptyMethod · 0.45
sizeMethod · 0.45
GetParameterMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected