SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
SWGHelpers.cpp
Go to the documentation of this file.
1 
13 #include "SWGHelpers.h"
14 #include "SWGModelFactory.h"
15 #include "SWGObject.h"
16 #include <QDebug>
17 #include <QJsonArray>
18 #include <QJsonValue>
19 #include <QDateTime>
20 
21 
22 namespace SWGSDRangel {
23 
24 void
25 setValue(void* value, QJsonValue obj, QString type, QString complexType) {
26  if(value == nullptr) {
27  // can't set value with a null pointer
28  return;
29  }
30  if(QStringLiteral("bool").compare(type) == 0) {
31  bool * val = static_cast<bool*>(value);
32  *val = obj.toBool();
33  }
34  else if(QStringLiteral("qint32").compare(type) == 0) {
35  qint32 *val = static_cast<qint32*>(value);
36  *val = obj.toInt();
37  }
38  else if(QStringLiteral("qint64").compare(type) == 0) {
39  qint64 *val = static_cast<qint64*>(value);
40  *val = obj.toVariant().toLongLong();
41  }
42  else if(QStringLiteral("float").compare(type) == 0) {
43  float *val = static_cast<float*>(value);
44  *val = obj.toDouble();
45  }
46  else if(QStringLiteral("double").compare(type) == 0) {
47  double *val = static_cast<double*>(value);
48  *val = obj.toDouble();
49  }
50  else if (QStringLiteral("QString").compare(type) == 0) {
51  QString **val = static_cast<QString**>(value);
52  if(val != nullptr) {
53  if(!obj.isNull()) {
54  // create a new value and return
55  if(*val != nullptr) delete *val;
56  *val = new QString(obj.toString());
57  return;
58  }
59  else {
60  // set target to nullptr
61  if(*val != nullptr) delete *val;
62  *val = nullptr;
63  }
64  }
65  else {
66  qDebug() << "Can't set value because the target pointer is nullptr";
67  }
68  }
69  else if (QStringLiteral("QDateTime").compare(type) == 0) {
70  QDateTime **val = static_cast<QDateTime**>(value);
71 
72  if(val != nullptr) {
73  if(!obj.isNull()) {
74  // create a new value and return
75  if(*val != nullptr) delete *val;
76  *val = new QDateTime(QDateTime::fromString(obj.toString(), Qt::ISODate));
77  return;
78  }
79  else {
80  // set target to nullptr
81  if(*val != nullptr) delete *val;
82  *val = nullptr;
83  }
84  }
85  else {
86  qDebug() << "Can't set value because the target pointer is nullptr";
87  }
88  }
89  else if (QStringLiteral("QDate").compare(type) == 0) {
90  QDate **val = static_cast<QDate**>(value);
91 
92  if(val != nullptr) {
93  if(!obj.isNull()) {
94  // create a new value and return
95  if(*val != nullptr) delete *val;
96  *val = new QDate(QDate::fromString(obj.toString(), Qt::ISODate));
97  return;
98  }
99  else {
100  // set target to nullptr
101  if(*val != nullptr) delete *val;
102  *val = nullptr;
103  }
104  }
105  else {
106  qDebug() << "Can't set value because the target pointer is nullptr";
107  }
108  }
109  else if (QStringLiteral("QByteArray").compare(type) == 0) {
110  QByteArray **val = static_cast<QByteArray**>(value);
111 
112  if(val != nullptr) {
113  if(!obj.isNull()) {
114  // create a new value and return
115  if(*val != nullptr) delete *val;
116 
117  *val = new QByteArray(QByteArray::fromBase64(QByteArray::fromStdString(obj.toString().toStdString())));
118  return;
119  }
120  else {
121  // set target to nullptr
122  if(*val != nullptr) delete *val;
123  *val = nullptr;
124  }
125  }
126  else {
127  qDebug() << "Can't set value because the target pointer is nullptr";
128  }
129  }
130  else if(type.startsWith("SWG") && obj.isObject()) {
131  // complex type
132  QJsonObject jsonObj = obj.toObject();
133  SWGObject * so = (SWGObject*)::SWGSDRangel::create(complexType);
134  if(so != nullptr) {
135  so->fromJsonObject(jsonObj);
136  SWGObject **val = static_cast<SWGObject**>(value);
137  if(*val != nullptr) delete *val;
138  *val = so;
139  }
140  }
141  else if(type.startsWith("QList") && QString("").compare(complexType) != 0 && obj.isArray()) {
142  // list of values
143  if(complexType.startsWith("SWG")) {
144  auto output = reinterpret_cast<QList<SWGObject *> **> (value);
145  for (auto item : **output) {
146  if(item != nullptr) delete item;
147  }
148  (*output)->clear();
149  QJsonArray arr = obj.toArray();
150  for (const QJsonValue & jval : arr) {
151  // it's an object
152  SWGObject * val = (SWGObject*)::SWGSDRangel::create(complexType);
153  QJsonObject t = jval.toObject();
154  val->fromJsonObject(t);
155  (*output)->append(val);
156  }
157  }
158  else if(QStringLiteral("qint32").compare(complexType) == 0) {
159  auto output = reinterpret_cast<QList<qint32> **> (value);
160  (*output)->clear();
161  QJsonArray arr = obj.toArray();
162  for (const QJsonValue & jval : arr){
163  qint32 val;
164  ::SWGSDRangel::setValue(&val, jval, QStringLiteral("qint32"), QStringLiteral(""));
165  (*output)->push_back(val);
166  }
167  }
168  else if(QStringLiteral("qint64").compare(complexType) == 0) {
169  auto output = reinterpret_cast<QList<qint64> **> (value);
170  (*output)->clear();
171  QJsonArray arr = obj.toArray();
172  for (const QJsonValue & jval : arr){
173  qint64 val;
174  ::SWGSDRangel::setValue(&val, jval, QStringLiteral("qint64"), QStringLiteral(""));
175  (*output)->push_back(val);
176  }
177  }
178  else if(QStringLiteral("bool").compare(complexType) == 0) {
179  auto output = reinterpret_cast<QList<bool> **> (value);
180  (*output)->clear();
181  QJsonArray arr = obj.toArray();
182  for (const QJsonValue & jval : arr){
183  bool val;
184  ::SWGSDRangel::setValue(&val, jval, QStringLiteral("bool"), QStringLiteral(""));
185  (*output)->push_back(val);
186  }
187  }
188  else if(QStringLiteral("float").compare(complexType) == 0) {
189  auto output = reinterpret_cast<QList<float> **> (value);
190  (*output)->clear();
191  QJsonArray arr = obj.toArray();
192  for (const QJsonValue & jval : arr){
193  float val;
194  ::SWGSDRangel::setValue(&val, jval, QStringLiteral("float"), QStringLiteral(""));
195  (*output)->push_back(val);
196  }
197  }
198  else if(QStringLiteral("double").compare(complexType) == 0) {
199  auto output = reinterpret_cast<QList<double> **> (value);
200  (*output)->clear();
201  QJsonArray arr = obj.toArray();
202  for (const QJsonValue & jval : arr){
203  double val;
204  ::SWGSDRangel::setValue(&val, jval, QStringLiteral("double"), QStringLiteral(""));
205  (*output)->push_back(val);
206  }
207  }
208  else if(QStringLiteral("QString").compare(complexType) == 0) {
209  auto output = reinterpret_cast<QList<QString*> **> (value);
210  for (auto item : **output) {
211  if(item != nullptr) delete item;
212  }
213  (*output)->clear();
214  QJsonArray arr = obj.toArray();
215  for (const QJsonValue & jval : arr){
216  QString * val = new QString();
217  ::SWGSDRangel::setValue(&val, jval, QStringLiteral("QString"), QStringLiteral(""));
218  (*output)->push_back(val);
219  }
220  }
221  else if(QStringLiteral("QDate").compare(complexType) == 0) {
222  auto output = reinterpret_cast<QList<QDate*> **> (value);
223  for (auto item : **output) {
224  if(item != nullptr) delete item;
225  }
226  (*output)->clear();
227  QJsonArray arr = obj.toArray();
228  for (const QJsonValue & jval : arr){
229  QDate * val = new QDate();
230  ::SWGSDRangel::setValue(&val, jval, QStringLiteral("QDate"), QStringLiteral(""));
231  (*output)->push_back(val);
232  }
233  }
234  else if(QStringLiteral("QDateTime").compare(complexType) == 0) {
235  auto output = reinterpret_cast<QList<QDateTime*> **> (value);
236  for (auto item : **output) {
237  if(item != nullptr) delete item;
238  }
239  (*output)->clear();
240  QJsonArray arr = obj.toArray();
241  for (const QJsonValue & jval : arr){
242  QDateTime * val = new QDateTime();
243  ::SWGSDRangel::setValue(&val, jval, QStringLiteral("QDateTime"), QStringLiteral(""));
244  (*output)->push_back(val);
245  }
246  }
247  }
248  else if(type.startsWith("QMap") && QString("").compare(complexType) != 0 && obj.isObject()) {
249  // list of values
250  if(complexType.startsWith("SWG")) {
251  auto output = reinterpret_cast<QMap<QString, SWGObject*> **> (value);
252  for (auto item : **output) {
253  if(item != nullptr) delete item;
254  }
255  (*output)->clear();
256  auto varmap = obj.toObject().toVariantMap();
257  if(varmap.count() > 0){
258  for(auto itemkey : varmap.keys() ){
259  auto val = (SWGObject*)::SWGSDRangel::create(complexType);
260  auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey));
261  ::SWGSDRangel::setValue(&val, jsonval, complexType, complexType);
262  (*output)->insert(itemkey, val);
263  }
264  }
265  }
266  else if(QStringLiteral("qint32").compare(complexType) == 0) {
267  auto output = reinterpret_cast<QMap<QString, qint32> **> (value);
268  (*output)->clear();
269  auto varmap = obj.toObject().toVariantMap();
270  if(varmap.count() > 0){
271  for(auto itemkey : varmap.keys() ){
272  qint32 val;
273  auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey));
274  ::SWGSDRangel::setValue(&val, jsonval, QStringLiteral("qint32"), QStringLiteral(""));
275  (*output)->insert( itemkey, val);
276  }
277  }
278  }
279  else if(QStringLiteral("qint64").compare(complexType) == 0) {
280  auto output = reinterpret_cast<QMap<QString, qint64> **> (value);
281  (*output)->clear();
282  auto varmap = obj.toObject().toVariantMap();
283  if(varmap.count() > 0){
284  for(auto itemkey : varmap.keys() ){
285  qint64 val;
286  auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey));
287  ::SWGSDRangel::setValue(&val, jsonval, QStringLiteral("qint64"), QStringLiteral(""));
288  (*output)->insert( itemkey, val);
289  }
290  }
291  }
292  else if(QStringLiteral("bool").compare(complexType) == 0) {
293  auto output = reinterpret_cast<QMap<QString, bool> **> (value);
294  (*output)->clear();
295  auto varmap = obj.toObject().toVariantMap();
296  if(varmap.count() > 0){
297  for(auto itemkey : varmap.keys() ){
298  bool val;
299  auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey));
300  ::SWGSDRangel::setValue(&val, jsonval, QStringLiteral("bool"), QStringLiteral(""));
301  (*output)->insert( itemkey, val);
302  }
303  }
304  }
305  else if(QStringLiteral("float").compare(complexType) == 0) {
306  auto output = reinterpret_cast<QMap<QString, float> **> (value);
307  (*output)->clear();
308  auto varmap = obj.toObject().toVariantMap();
309  if(varmap.count() > 0){
310  for(auto itemkey : varmap.keys() ){
311  float val;
312  auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey));
313  ::SWGSDRangel::setValue(&val, jsonval, QStringLiteral("float"), QStringLiteral(""));
314  (*output)->insert( itemkey, val);
315  }
316  }
317  }
318  else if(QStringLiteral("double").compare(complexType) == 0) {
319  auto output = reinterpret_cast<QMap<QString, double> **> (value);
320  (*output)->clear();
321  auto varmap = obj.toObject().toVariantMap();
322  if(varmap.count() > 0){
323  for(auto itemkey : varmap.keys() ){
324  double val;
325  auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey));
326  ::SWGSDRangel::setValue(&val, jsonval, QStringLiteral("double"), QStringLiteral(""));
327  (*output)->insert( itemkey, val);
328  }
329  }
330  }
331  else if(QStringLiteral("QString").compare(complexType) == 0) {
332  auto output = reinterpret_cast<QMap<QString, QString*> **> (value);
333  for (auto item : **output) {
334  if(item != nullptr) delete item;
335  }
336  (*output)->clear();
337  auto varmap = obj.toObject().toVariantMap();
338  if(varmap.count() > 0){
339  for(auto itemkey : varmap.keys() ){
340  QString * val = new QString();
341  auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey));
342  ::SWGSDRangel::setValue(&val, jsonval, QStringLiteral("QString"), QStringLiteral(""));
343  (*output)->insert( itemkey, val);
344  }
345  }
346  }
347  else if(QStringLiteral("QDate").compare(complexType) == 0) {
348  auto output = reinterpret_cast<QMap<QString, QDate*> **> (value);
349  for (auto item : **output) {
350  if(item != nullptr) delete item;
351  }
352  (*output)->clear();
353  auto varmap = obj.toObject().toVariantMap();
354  if(varmap.count() > 0){
355  for(auto itemkey : varmap.keys() ){
356  QDate * val = new QDate();
357  auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey));
358  ::SWGSDRangel::setValue(&val, jsonval, QStringLiteral("QDate"), QStringLiteral(""));
359  (*output)->insert( itemkey, val);
360  }
361  }
362  }
363  else if(QStringLiteral("QDateTime").compare(complexType) == 0) {
364  auto output = reinterpret_cast<QMap<QString, QDateTime*> **> (value);
365  for (auto item : **output) {
366  if(item != nullptr) delete item;
367  }
368  (*output)->clear();
369  auto varmap = obj.toObject().toVariantMap();
370  if(varmap.count() > 0){
371  for(auto itemkey : varmap.keys() ){
372  QDateTime * val = new QDateTime();
373  auto jsonval = QJsonValue::fromVariant(varmap.value(itemkey));
374  ::SWGSDRangel::setValue(&val, jsonval, QStringLiteral("QDateTime"), QStringLiteral(""));
375  (*output)->insert( itemkey, val);
376  }
377  }
378  }
379  }
380 }
381 
382 void
383 toJsonValue(QString name, void* value, QJsonObject* output, QString type) {
384  if(value == nullptr) {
385  return;
386  }
387  if(type.startsWith("SWG")) {
388  SWGObject *SWGobject = reinterpret_cast<SWGObject *>(value);
389  if(SWGobject != nullptr) {
390  QJsonObject* o = (*SWGobject).asJsonObject();
391  if (o != nullptr)
392  {
393  if(name != nullptr) {
394  output->insert(name, *o);
395  if(o != nullptr) delete o;
396  }
397  else {
398  output->empty();
399  for(QString key : o->keys()) {
400  output->insert(key, o->value(key));
401  }
402  }
403  }
404  }
405  }
406  else if(QStringLiteral("QString").compare(type) == 0) {
407  QString* str = static_cast<QString*>(value);
408  output->insert(name, QJsonValue(*str));
409  }
410  else if(QStringLiteral("qint32").compare(type) == 0) {
411  qint32* str = static_cast<qint32*>(value);
412  output->insert(name, QJsonValue(*str));
413  }
414  else if(QStringLiteral("qint64").compare(type) == 0) {
415  qint64* str = static_cast<qint64*>(value);
416  output->insert(name, QJsonValue(*str));
417  }
418  else if(QStringLiteral("bool").compare(type) == 0) {
419  bool* str = static_cast<bool*>(value);
420  output->insert(name, QJsonValue(*str));
421  }
422  else if(QStringLiteral("float").compare(type) == 0) {
423  float* str = static_cast<float*>(value);
424  output->insert(name, QJsonValue((double)*str));
425  }
426  else if(QStringLiteral("double").compare(type) == 0) {
427  double* str = static_cast<double*>(value);
428  output->insert(name, QJsonValue(*str));
429  }
430  else if(QStringLiteral("QDate").compare(type) == 0) {
431  QDate* date = static_cast<QDate*>(value);
432  output->insert(name, QJsonValue(date->toString(Qt::ISODate)));
433  }
434  else if(QStringLiteral("QDateTime").compare(type) == 0) {
435  QDateTime* datetime = static_cast<QDateTime*>(value);
436  output->insert(name, QJsonValue(datetime->toString(Qt::ISODate)));
437  }
438  else if(QStringLiteral("QByteArray").compare(type) == 0) {
439  QByteArray* byteArray = static_cast<QByteArray*>(value);
440  output->insert(name, QJsonValue(QString(byteArray->toBase64())));
441  }
442 }
443 
444 void
445 toJsonArray(QList<void*>* value, QJsonObject* output, QString innerName, QString innerType) {
446  if((value == nullptr) || (output == nullptr)) {
447  return;
448  }
449  QJsonArray outputarray;
450  if(innerType.startsWith("SWG")){
451  for(void* obj : *value) {
452  SWGObject *SWGobject = reinterpret_cast<SWGObject *>(obj);
453  if(SWGobject != nullptr)
454  {
455  QJsonObject* o = SWGobject->asJsonObject();
456  outputarray.append(*o);
457  delete o;
458  }
459  }
460  }
461  else if(QStringLiteral("QString").compare(innerType) == 0) {
462  for(QString* obj : *(reinterpret_cast<QList<QString*>*>(value))){
463  outputarray.append(QJsonValue(*obj));
464  }
465  }
466  else if(QStringLiteral("QDate").compare(innerType) == 0) {
467  for(QDate* obj : *(reinterpret_cast<QList<QDate*>*>(value))){
468  outputarray.append(QJsonValue(obj->toString(Qt::ISODate)));
469  }
470  }
471  else if(QStringLiteral("QDateTime").compare(innerType) == 0) {
472  for(QDateTime* obj : *(reinterpret_cast<QList<QDateTime*>*>(value))){
473  outputarray.append(QJsonValue(obj->toString(Qt::ISODate))); }
474  }
475  else if(QStringLiteral("QByteArray").compare(innerType) == 0) {
476  for(QByteArray* obj : *(reinterpret_cast<QList<QByteArray*>*>(value))){
477  outputarray.append(QJsonValue(QString(obj->toBase64())));
478  }
479  }
480  else if(QStringLiteral("qint32").compare(innerType) == 0) {
481  for(qint32 obj : *(reinterpret_cast<QList<qint32>*>(value)))
482  outputarray.append(QJsonValue(obj));
483  }
484  else if(QStringLiteral("qint64").compare(innerType) == 0) {
485  for(qint64 obj : *(reinterpret_cast<QList<qint64>*>(value)))
486  outputarray.append(QJsonValue(obj));
487  }
488  else if(QStringLiteral("bool").compare(innerType) == 0) {
489  for(bool obj : *(reinterpret_cast<QList<bool>*>(value)))
490  outputarray.append(QJsonValue(obj));
491  }
492  else if(QStringLiteral("float").compare(innerType) == 0) {
493  for(float obj : *(reinterpret_cast<QList<float>*>(value)))
494  outputarray.append(QJsonValue(obj));
495  }
496  else if(QStringLiteral("double").compare(innerType) == 0) {
497  for(double obj : *(reinterpret_cast<QList<double>*>(value)))
498  outputarray.append(QJsonValue(obj));
499  }
500  output->insert(innerName, outputarray);
501 }
502 
503 void
504 toJsonMap(QMap<QString, void*>* value, QJsonObject* output, QString innerName, QString innerType) {
505  if((value == nullptr) || (output == nullptr)) {
506  return;
507  }
508  QJsonObject mapobj;
509  if(innerType.startsWith("SWG")){
510  auto items = reinterpret_cast< QMap<QString, SWGObject*> *>(value);
511  for(auto itemkey: items->keys()) {
512  ::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType);
513  }
514  }
515  else if(QStringLiteral("QString").compare(innerType) == 0) {
516  auto items = reinterpret_cast< QMap<QString, QString*> *>(value);
517  for(auto itemkey: items->keys()) {
518  ::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType);
519  }
520  }
521  else if(QStringLiteral("QDate").compare(innerType) == 0) {
522  auto items = reinterpret_cast< QMap<QString, QDate*> *>(value);
523  for(auto itemkey: items->keys()) {
524  ::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType);
525  }
526  }
527  else if(QStringLiteral("QDateTime").compare(innerType) == 0) {
528  auto items = reinterpret_cast< QMap<QString, QDateTime*> *>(value);
529  for(auto itemkey: items->keys()) {
530  ::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType);
531  }
532  }
533  else if(QStringLiteral("QByteArray").compare(innerType) == 0) {
534  auto items = reinterpret_cast< QMap<QString, QByteArray*> *>(value);
535  for(auto itemkey: items->keys()) {
536  ::SWGSDRangel::toJsonValue(itemkey, items->value(itemkey), &mapobj, innerType);
537  }
538  }
539  else if(QStringLiteral("qint32").compare(innerType) == 0) {
540  auto items = reinterpret_cast< QMap<QString, qint32> *>(value);
541  for(auto itemkey: items->keys()) {
542  auto val = items->value(itemkey);
543  ::SWGSDRangel::toJsonValue(itemkey, &val, &mapobj, innerType);
544  }
545  }
546  else if(QStringLiteral("qint64").compare(innerType) == 0) {
547  auto items = reinterpret_cast< QMap<QString, qint64> *>(value);
548  for(auto itemkey: items->keys()) {
549  auto val = items->value(itemkey);
550  ::SWGSDRangel::toJsonValue(itemkey, &val, &mapobj, innerType);
551  }
552  }
553  else if(QStringLiteral("bool").compare(innerType) == 0) {
554  auto items = reinterpret_cast< QMap<QString, bool> *>(value);
555  for(auto itemkey: items->keys()) {
556  auto val = items->value(itemkey);
557  ::SWGSDRangel::toJsonValue(itemkey, &val, &mapobj, innerType);
558  }
559  }
560  else if(QStringLiteral("float").compare(innerType) == 0) {
561  auto items = reinterpret_cast< QMap<QString, float> *>(value);
562  for(auto itemkey: items->keys()) {
563  auto val = items->value(itemkey);
564  ::SWGSDRangel::toJsonValue(itemkey, &val, &mapobj, innerType);
565  }
566  }
567  else if(QStringLiteral("double").compare(innerType) == 0) {
568  auto items = reinterpret_cast< QMap<QString, double> *>(value);
569  for(auto itemkey: items->keys() ) {
570  auto val = items->value(itemkey);
571  ::SWGSDRangel::toJsonValue(itemkey, &val, &mapobj, innerType);
572  }
573  }
574  output->insert(innerName, mapobj);
575 }
576 
577 QString
578 stringValue(QString* value) {
579  QString* str = static_cast<QString*>(value);
580  return QString(*str);
581 }
582 
583 QString
584 stringValue(qint32 value) {
585  return QString::number(value);
586 }
587 
588 QString
589 stringValue(qint64 value) {
590  return QString::number(value);
591 }
592 
593 QString
594 stringValue(bool value) {
595  return QString(value ? "true" : "false");
596 }
597 
598 }
void toJsonValue(QString name, void *value, QJsonObject *output, QString type)
Definition: SWGHelpers.cpp:383
void toJsonMap(QMap< QString, void *> *value, QJsonObject *output, QString innerName, QString innerType)
Definition: SWGHelpers.cpp:504
void * create(QString type)
virtual QJsonObject * asJsonObject()
Definition: SWGObject.h:22
void setValue(void *value, QJsonValue obj, QString type, QString complexType)
Definition: SWGHelpers.cpp:25
void toJsonArray(QList< void *> *value, QJsonObject *output, QString innerName, QString innerType)
Definition: SWGHelpers.cpp:445
virtual void fromJsonObject(QJsonObject &json)
Definition: SWGObject.h:30
QString stringValue(QString *value)
Definition: SWGHelpers.cpp:578