---
title: llarp/util/json.hpp

---

# llarp/util/json.hpp



## Namespaces

| Name           |
| -------------- |
| **[llarp](Namespaces/namespacellarp.md)** <br>[crypto.hpp] |
| **[llarp::json](Namespaces/namespacellarp_1_1json.md)**  |

## Classes

|                | Name           |
| -------------- | -------------- |
| struct | **[llarp::json::IParser](Classes/structllarp_1_1json_1_1IParser.md)**  |




## Source code

```cpp
#pragma once

#include <nlohmann/json.hpp>

#include <memory>
#include <iostream>

namespace llarp
{
  namespace json
  {
    using Object = nlohmann::json;

    struct IParser
    {
      virtual ~IParser() = default;

      enum Result
      {
        eNeedData,
        eDone,
        eParseError
      };

      virtual bool
      FeedData(const char* buf, size_t sz) = 0;
      virtual Result
      Parse(Object& obj) const = 0;
    };

    IParser*
    MakeParser(size_t contentSize);

  }  // namespace json
}  // namespace llarp
```


-------------------------------

Updated on 2023-01-09 at 19:27:44 +0000
