summaryrefslogtreecommitdiff
path: root/Meta/Lagom/TestJson.cpp
blob: 17ade893a744951eb5a914f4161f38954eb92cf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
 * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <AK/JsonObject.h>
#include <AK/JsonValue.h>
#include <stdio.h>

int main(int, char**)
{
    auto value = JsonValue::from_string("{\"property\": \"value\"}");
    VERIFY(value.has_value());
    printf("parsed: _%s_\n", value.value().to_string().characters());
    printf("object.property = '%s'\n", value.value().as_object().get("property").to_string().characters());
    return 0;
}