ONE - On-device Neural Engine
Loading...
Searching...
No Matches
flex_flat_util.h
Go to the documentation of this file.
1
/*
2
* Copyright 2022 Google Inc. All rights reserved.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef FLATBUFFERS_FLEX_FLAT_UTIL_H_
18
#define FLATBUFFERS_FLEX_FLAT_UTIL_H_
19
20
#include "
flatbuffers/flatbuffers.h
"
21
#include "
flatbuffers/flexbuffers.h
"
22
23
namespace
flexbuffers
{
24
25
// Verifies the `nested` flexbuffer within a flatbuffer vector is valid.
26
inline
bool
VerifyNestedFlexBuffer
(
27
const
flatbuffers::Vector<uint8_t>
*
const
nested,
28
flatbuffers::Verifier &verifier) {
29
if
(!nested)
return
true
;
30
return
verifier.Check(
flexbuffers::VerifyBuffer
(
31
nested->
data
(), nested->
size
(), verifier.GetFlexReuseTracker()));
32
}
33
34
}
// namespace flexbuffers
35
36
#endif
// FLATBUFFERS_FLEX_FLAT_UTIL_H_
flatbuffers::Vector
Definition
vector.h:148
flatbuffers::Vector::data
const T * data() const
Definition
vector.h:260
flatbuffers::Vector::size
SizeT size() const
Definition
vector.h:164
flatbuffers.h
flexbuffers.h
flexbuffers
Definition
flex_flat_util.h:23
flexbuffers::VerifyBuffer
bool VerifyBuffer(const uint8_t *buf, size_t buf_len, std::vector< uint8_t > *reuse_tracker=nullptr)
Definition
flexbuffers.h:1875
flexbuffers::VerifyNestedFlexBuffer
bool VerifyNestedFlexBuffer(const flatbuffers::Vector< uint8_t > *const nested, flatbuffers::Verifier &verifier)
Definition
flex_flat_util.h:26
onert-micro
externals
flatbuffers
flex_flat_util.h
Generated by
1.9.8