TestJson.cpp 507 B

1234567891011121314151617
  1. /*
  2. * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <AK/JsonObject.h>
  7. #include <AK/JsonValue.h>
  8. #include <stdio.h>
  9. int main(int, char**)
  10. {
  11. auto value = JsonValue::from_string("{\"property\": \"value\"}").release_value_but_fixme_should_propagate_errors();
  12. printf("parsed: _%s_\n", value.to_string().characters());
  13. printf("object.property = '%s'\n", value.as_object().get("property").to_string().characters());
  14. return 0;
  15. }