cpp-msgpack-light
0.3.0
A light library to serialize MessagePack.
Toggle main menu visibility
Loading...
Searching...
No Matches
extension_ref.h
Go to the documentation of this file.
1
/*
2
* Copyright 2024 MusicScience37 (Kenta Kabashima)
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
*/
20
#pragma once
21
22
#include <cstdint>
23
24
#include "
msgpack_light/binary.h
"
25
#include "
msgpack_light/details/object_data.h
"
26
27
namespace
msgpack_light
{
28
40
class
const_extension_ref
{
41
public
:
47
explicit
const_extension_ref
(
const
details::extension_data
&
data
)
48
:
data_
(&
data
) {}
49
55
[[nodiscard]] std::int8_t
type
()
const
{
return
data_
->
type
; }
56
62
[[nodiscard]]
binary_view
data
() const noexcept {
63
return
binary_view
(
data_
->
data
,
data_
->
size
);
64
}
65
66
private
:
68
const
details::extension_data
*
data_
;
69
};
70
71
}
// namespace msgpack_light
binary.h
Definition of binary class.
msgpack_light::binary_view
Class to refer binary data.
Definition
binary.h:78
msgpack_light::binary_view::binary_view
binary_view() noexcept
Constructor.
Definition
binary.h:85
msgpack_light::const_extension_ref::data_
const details::extension_data * data_
Data.
Definition
extension_ref.h:68
msgpack_light::const_extension_ref::type
std::int8_t type() const
Get the type.
Definition
extension_ref.h:55
msgpack_light::const_extension_ref::data
binary_view data() const noexcept
Get the data of the value.
Definition
extension_ref.h:62
msgpack_light::const_extension_ref::const_extension_ref
const_extension_ref(const details::extension_data &data)
Constructor.
Definition
extension_ref.h:47
msgpack_light
Namespace of this project.
Definition
binary.h:33
object_data.h
Definition of object_data struct.
msgpack_light::details::extension_data
Struct of data of extensions.
Definition
object_data.h:80
msgpack_light::details::extension_data::size
std::size_t size
Size of the data.
Definition
object_data.h:88
msgpack_light::details::extension_data::type
std::int8_t type
Type.
Definition
object_data.h:82
msgpack_light::details::extension_data::data
unsigned char * data
Data.
Definition
object_data.h:85
include
msgpack_light
details
extension_ref.h
Generated on
for cpp-msgpack-light by
1.18.0