Source release 19.4.0
This commit is contained in:
@@ -7,12 +7,6 @@
|
||||
#ifndef WVOEC_UTIL_CBOR_VALIDATOR_H_
|
||||
#define WVOEC_UTIL_CBOR_VALIDATOR_H_
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "cppbor.h"
|
||||
#include "cppbor_parse.h"
|
||||
#include "wv_class_utils.h"
|
||||
@@ -28,8 +22,9 @@ enum CborMessageStatus {
|
||||
kCborParseError = 2,
|
||||
kCborValidateOk = 3,
|
||||
kCborValidateWarning = 4,
|
||||
kCborValidateError = 5,
|
||||
kCborValidateFatal = 6
|
||||
kCborValidateError = 5, // e.g. unexpected value, signature error, etc.
|
||||
kCborValidateFatal =
|
||||
6, // e.g. unexpected data type, key size, or missing required field
|
||||
};
|
||||
|
||||
std::string CppborMajorTypeToString(cppbor::MajorType type);
|
||||
@@ -61,10 +56,6 @@ class CborValidator {
|
||||
// first and |parse_result_| contains a valid CBOR message.
|
||||
virtual std::string GetFormattedMessage() const;
|
||||
const cppbor::ParseResult& parse_result() const { return parse_result_; }
|
||||
const std::vector<std::pair<CborMessageStatus, std::string>>&
|
||||
validate_messages() {
|
||||
return validate_messages_;
|
||||
}
|
||||
|
||||
protected:
|
||||
void Reset();
|
||||
@@ -77,6 +68,8 @@ class CborValidator {
|
||||
static std::string CheckMapEntry(const cppbor::Map& map,
|
||||
cppbor::MajorType major_type,
|
||||
const std::string& entry_name);
|
||||
// Formats the parsed CBOR |input| and adds identation for readability.
|
||||
static std::string FormatString(const std::string& input);
|
||||
CborMessageStatus message_status_ = kCborUninitialized;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user