WebCFace
2.5.2
Web-based Communication Framework & Dashboard-like UI
Loading...
Searching...
No Matches
text.h
Go to the documentation of this file.
1
#pragma once
2
#include "
./base.h
"
3
#include "
webcface/common/encoding.h
"
4
#include "
webcface/common/val_adaptor.h
"
5
6
#ifndef MSGPACK_DEFINE_MAP
7
#define MSGPACK_DEFINE_MAP(...)
8
#endif
9
10
WEBCFACE_NS_BEGIN
11
namespace
message {
12
13
struct
Text
:
public
MessageBase
<MessageKind::text> {
14
SharedString
field
;
15
std::shared_ptr<ValAdaptor>
data
;
16
MSGPACK_DEFINE_MAP
(MSGPACK_NVP(
"f"
, field), MSGPACK_NVP(
"d"
, data))
17
};
18
19
template
<>
20
struct
Res
<
Text
> :
public
MessageBase
<MessageKind::text + MessageKind::res> {
21
unsigned
int
req_id = 0;
22
SharedString
sub_field
;
23
std::shared_ptr<ValAdaptor>
data
;
24
Res
() =
default
;
25
Res
(
unsigned
int
req_id,
const
SharedString
&sub_field,
26
const
std::shared_ptr<ValAdaptor> &data)
27
: req_id(req_id), sub_field(sub_field), data(data) {}
28
MSGPACK_DEFINE_MAP
(MSGPACK_NVP(
"i"
, req_id), MSGPACK_NVP(
"f"
, sub_field),
29
MSGPACK_NVP(
"d"
, data))
30
};
31
32
}
33
WEBCFACE_NS_END
base.h
webcface::SharedString
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition
encoding.h:69
encoding.h
MSGPACK_DEFINE_MAP
#define MSGPACK_DEFINE_MAP(...)
Definition
canvas2d.h:10
val_adaptor.h
webcface::message::MessageBase
型からkindを取得するためだけのベースクラス
Definition
base.h:53
webcface::message::Res< Text >::sub_field
SharedString sub_field
Definition
text.h:22
webcface::message::Res< Text >::Res
Res()=default
webcface::message::Res< Text >::data
std::shared_ptr< ValAdaptor > data
Definition
text.h:23
webcface::message::Res< Text >::Res
Res(unsigned int req_id, const SharedString &sub_field, const std::shared_ptr< ValAdaptor > &data)
Definition
text.h:25
webcface::message::Res
Definition
base.h:58
webcface::message::Text
Definition
text.h:13
webcface::message::Text::field
SharedString field
Definition
text.h:14
webcface::message::Text::data
std::shared_ptr< ValAdaptor > data
Definition
text.h:15
WEBCFACE_NS_END
#define WEBCFACE_NS_END
Definition
webcface-config.h:104
WEBCFACE_NS_BEGIN
#define WEBCFACE_NS_BEGIN
Definition
webcface-config.h:103
common
include
webcface
common
internal
message
text.h
Generated on Tue Jan 7 2025 18:24:41 for WebCFace by
1.9.7