1
#pragma once
2

            
3
#include <string>
4

            
5
#include "source/common/json/json_streamer.h"
6
#include "source/common/protobuf/protobuf.h"
7

            
8
namespace Envoy {
9
namespace Json {
10

            
11
class Utility {
12
public:
13
  /**
14
   * Convert a Protobuf::Value to a JSON string.
15
   * @param value message of type type.googleapis.com/google.protobuf.Value
16
   * @param dest JSON string.
17
   */
18
  static void appendValueToString(const Protobuf::Value& value, std::string& dest);
19

            
20
  /**
21
   * Convert a Protobuf::Struct to a JSON string.
22
   * @param struct_value message of type type.googleapis.com/google.protobuf.Struct
23
   * @param dest JSON string.
24
   */
25
  static void appendStructToString(const Protobuf::Struct& struct_value, std::string& dest);
26
};
27

            
28
} // namespace Json
29
} // namespace Envoy