cpp-msgpack-rpc
0.2.0
An RPC library implementing MessagePack RPC.
Toggle main menu visibility
Loading...
Searching...
No Matches
format_msgpack_object.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2023 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
#include "
msgpack_rpc/util/format_msgpack_object.h
"
21
22
#include "
msgpack_rpc/util/format_msgpack_object_to.h
"
23
24
namespace
msgpack_rpc::util::impl
{
25
26
FmtMsgpackObjectProxy::FmtMsgpackObjectProxy
(
const
msgpack::object&
object
)
27
:
object_
(
object
) {}
28
29
const
msgpack::object&
FmtMsgpackObjectProxy::object
() const noexcept {
30
return
object_
;
31
}
32
33
}
// namespace msgpack_rpc::util::impl
34
35
namespace
fmt
{
36
37
format_context::iterator
38
formatter<msgpack_rpc::util::impl::FmtMsgpackObjectProxy>::
39
format(
// NOLINT(readability-convert-member-functions-to-static): required by an external library.
40
const
msgpack_rpc::util::impl::FmtMsgpackObjectProxy
& value,
41
format_context& context)
const
{
42
return
msgpack_rpc::util::format_msgpack_object_to
(
43
context.out(), value.
object
());
44
}
45
46
}
// namespace fmt
47
48
namespace
msgpack_rpc::util
{
49
50
impl::FmtMsgpackObjectProxy
format_msgpack_object
(
51
const
msgpack::object&
object
) {
52
return
impl::FmtMsgpackObjectProxy
(
object
);
53
}
54
55
}
// namespace msgpack_rpc::util
msgpack_rpc::util::impl::FmtMsgpackObjectProxy
Class to format objects in msgpack library using fmt library.
Definition
format_msgpack_object.h:32
msgpack_rpc::util::impl::FmtMsgpackObjectProxy::object
const msgpack::object & object() const noexcept
Get the object in msgpack library.
Definition
format_msgpack_object.cpp:29
msgpack_rpc::util::impl::FmtMsgpackObjectProxy::object_
const msgpack::object & object_
Object in msgpack library.
Definition
format_msgpack_object.h:51
msgpack_rpc::util::impl::FmtMsgpackObjectProxy::FmtMsgpackObjectProxy
FmtMsgpackObjectProxy(const msgpack::object &object)
Constructor.
Definition
format_msgpack_object.cpp:26
format_msgpack_object.h
Definition of format_msgpack_object function.
format_msgpack_object_to.h
Definition of format_msgpack_object_to function.
fmt
Namespace of fmt library.
Definition
uri.h:113
msgpack_rpc::util::impl
Namespace of internal implementations.
Definition
format_msgpack_object.h:27
msgpack_rpc::util
Namespace of utilities.
Definition
format_msgpack_object.h:27
msgpack_rpc::util::format_msgpack_object
impl::FmtMsgpackObjectProxy format_msgpack_object(const msgpack::object &object)
Format an object in msgpack library using fmt library.
Definition
format_msgpack_object.cpp:50
msgpack_rpc::util::format_msgpack_object_to
Iterator format_msgpack_object_to(Iterator iterator, const msgpack::object &object)
Format an object in msgpack library.
Definition
format_msgpack_object_to.h:254
src
msgpack_rpc
util
format_msgpack_object.cpp
Generated on
for cpp-msgpack-rpc by
1.18.0