cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
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 */
21
23
25
27 : object_(object) {}
28
29const msgpack::object& FmtMsgpackObjectProxy::object() const noexcept {
30 return object_;
31}
32
33} // namespace msgpack_rpc::util::impl
34
35namespace fmt {
36
37format_context::iterator
38formatter<msgpack_rpc::util::impl::FmtMsgpackObjectProxy>::
39 format( // NOLINT(readability-convert-member-functions-to-static): required by an external library.
41 format_context& context) const {
43 context.out(), value.object());
44}
45
46} // namespace fmt
47
48namespace msgpack_rpc::util {
49
51 const msgpack::object& object) {
52 return impl::FmtMsgpackObjectProxy(object);
53}
54
55} // namespace msgpack_rpc::util
Class to format objects in msgpack library using fmt library.
const msgpack::object & object() const noexcept
Get the object in msgpack library.
const msgpack::object & object_
Object in msgpack library.
FmtMsgpackObjectProxy(const msgpack::object &object)
Constructor.
Definition of format_msgpack_object function.
Definition of format_msgpack_object_to function.
Namespace of fmt library.
Definition uri.h:113
Namespace of internal implementations.
Namespace of utilities.
impl::FmtMsgpackObjectProxy format_msgpack_object(const msgpack::object &object)
Format an object in msgpack library using fmt library.
Iterator format_msgpack_object_to(Iterator iterator, const msgpack::object &object)
Format an object in msgpack library.