@@ -359,7 +359,7 @@ namespace Aws
359359
360360 String JsonView::GetString (const char *key) const
361361 {
362- assert (m_value);
362+ AWS_ASSERT (m_value);
363363 auto item = cJSON_GetObjectItemCaseSensitive (m_value, key);
364364 auto str = cJSON_GetStringValue (item);
365365 return str != nullptr ? str : " " ;
@@ -379,31 +379,31 @@ namespace Aws
379379
380380 bool JsonView::GetBool (const char *key) const
381381 {
382- assert (m_value);
382+ AWS_ASSERT (m_value);
383383 auto item = cJSON_GetObjectItemCaseSensitive (m_value, key);
384- assert (item);
384+ AWS_ASSERT (item);
385385 return item->valueint != 0 ;
386386 }
387387
388388 bool JsonView::AsBool () const
389389 {
390- assert (cJSON_IsBool (m_value));
390+ AWS_ASSERT (cJSON_IsBool (m_value));
391391 return cJSON_IsTrue (m_value) != 0 ;
392392 }
393393
394394 int JsonView::GetInteger (const String &key) const { return GetInteger (key.c_str ()); }
395395
396396 int JsonView::GetInteger (const char *key) const
397397 {
398- assert (m_value);
398+ AWS_ASSERT (m_value);
399399 auto item = cJSON_GetObjectItemCaseSensitive (m_value, key);
400- assert (item);
400+ AWS_ASSERT (item);
401401 return item->valueint ;
402402 }
403403
404404 int JsonView::AsInteger () const
405405 {
406- assert (cJSON_IsNumber (m_value)); // can be double or value larger than int_max, but at least not UB
406+ AWS_ASSERT (cJSON_IsNumber (m_value)); // can be double or value larger than int_max, but at least not UB
407407 return m_value->valueint ;
408408 }
409409
@@ -413,31 +413,31 @@ namespace Aws
413413
414414 int64_t JsonView::AsInt64 () const
415415 {
416- assert (cJSON_IsNumber (m_value));
416+ AWS_ASSERT (cJSON_IsNumber (m_value));
417417 return static_cast <int64_t >(m_value->valuedouble );
418418 }
419419
420420 double JsonView::GetDouble (const String &key) const { return GetDouble (key.c_str ()); }
421421
422422 double JsonView::GetDouble (const char *key) const
423423 {
424- assert (m_value);
424+ AWS_ASSERT (m_value);
425425 auto item = cJSON_GetObjectItemCaseSensitive (m_value, key);
426- assert (item);
426+ AWS_ASSERT (item);
427427 return item->valuedouble ;
428428 }
429429
430430 double JsonView::AsDouble () const
431431 {
432- assert (cJSON_IsNumber (m_value));
432+ AWS_ASSERT (cJSON_IsNumber (m_value));
433433 return m_value->valuedouble ;
434434 }
435435
436436 JsonView JsonView::GetJsonObject (const String &key) const { return GetJsonObject (key.c_str ()); }
437437
438438 JsonView JsonView::GetJsonObject (const char *key) const
439439 {
440- assert (m_value);
440+ AWS_ASSERT (m_value);
441441 auto item = cJSON_GetObjectItemCaseSensitive (m_value, key);
442442 return item;
443443 }
@@ -446,24 +446,24 @@ namespace Aws
446446
447447 JsonObject JsonView::GetJsonObjectCopy (const char *key) const
448448 {
449- assert (m_value);
449+ AWS_ASSERT (m_value);
450450 /* force a deep copy */
451451 return JsonObject (cJSON_GetObjectItemCaseSensitive (m_value, key));
452452 }
453453
454454 JsonView JsonView::AsObject () const
455455 {
456- assert (cJSON_IsObject (m_value));
456+ AWS_ASSERT (cJSON_IsObject (m_value));
457457 return m_value;
458458 }
459459
460460 Vector<JsonView> JsonView::GetArray (const String &key) const { return GetArray (key.c_str ()); }
461461
462462 Vector<JsonView> JsonView::GetArray (const char *key) const
463463 {
464- assert (m_value);
464+ AWS_ASSERT (m_value);
465465 auto array = cJSON_GetObjectItemCaseSensitive (m_value, key);
466- assert (cJSON_IsArray (array));
466+ AWS_ASSERT (cJSON_IsArray (array));
467467 Vector<JsonView> returnArray (static_cast <size_t >(cJSON_GetArraySize (array)));
468468
469469 auto element = array->child ;
@@ -477,7 +477,7 @@ namespace Aws
477477
478478 Vector<JsonView> JsonView::AsArray () const
479479 {
480- assert (cJSON_IsArray (m_value));
480+ AWS_ASSERT (cJSON_IsArray (m_value));
481481 Vector<JsonView> returnArray (static_cast <size_t >(cJSON_GetArraySize (m_value)));
482482
483483 auto element = m_value->child ;
0 commit comments