Files
cryptsetup/tests/fuzz/json_proto_converter.h
Milan Broz 661f57def4 Use SPDX license identifiers.
This patch switches code to SPDX one-line license identifiers according to
https://spdx.dev/learn/handling-license-info/
and replacing long license text headers.

I used C++ format on the first line in style
// SPDX-License-Identifier: <id>
except exported libcryptsetup.h, when only C comments are used.

The only additional changes are:
- switch backend utf8.c from LGPL2+ to LGPL2.1+ (as in systemd)
- add some additional formatting lines.
2024-06-03 16:38:15 +00:00

33 lines
717 B
C++

// SPDX-License-Identifier: Apache-2.0
//
// Copyright 2020 Google Inc.
//
#ifndef JSON_PROTO_CONVERTER_H_
#define JSON_PROTO_CONVERTER_H_
#include <sstream>
#include <string>
#include "LUKS2_plain_JSON.pb.h"
namespace json_proto {
class JsonProtoConverter {
public:
std::string Convert(const json_proto::JsonObject&);
std::string Convert(const json_proto::ArrayValue&);
private:
std::stringstream data_;
void AppendArray(const json_proto::ArrayValue&);
void AppendNumber(const json_proto::NumberValue&);
void AppendObject(const json_proto::JsonObject&);
void AppendValue(const json_proto::JsonValue&);
};
} // namespace json_proto
#endif // TESTING_LIBFUZZER_PROTO_JSON_PROTO_CONVERTER_H_