Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
youngwolf
ascs
提交
07bc299e
A
ascs
项目概览
youngwolf
/
ascs
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ascs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
07bc299e
编写于
1月 15, 2021
作者:
Y
youngwolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Supplement annotations.
上级
5458a2b3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
4 deletion
+4
-4
include/ascs/ext/ext.h
include/ascs/ext/ext.h
+3
-3
include/ascs/ext/unpacker.h
include/ascs/ext/unpacker.h
+1
-1
未找到文件。
include/ascs/ext/ext.h
浏览文件 @
07bc299e
...
...
@@ -52,10 +52,10 @@ public:
virtual
const
char
*
data
()
const
{
return
std
::
string
::
data
();}
};
//a substitute of std::string (just for unpacking scenario, many features are missing a
ccording to
std::string), because std::string
//a substitute of std::string (just for unpacking scenario, many features are missing a
gainst
std::string), because std::string
// has a small defect which is terrible for unpacking scenario, it cannot change its size without fill its buffer.
//please note that basic_buffer won't append '\0' to the end of the string (std::string will do), you
cannot treat it as a string and
//
print it with "%s" format even all characters in it are printable (because no '\0' appended to them
).
//please note that basic_buffer won't append '\0' to the end of the string (std::string will do), you
must appen '\0' characters
//
by your own if you want to print it via "%s" formatter, e.g. basic_buffer("123", 4), bb.append("abc", 4
).
class
basic_buffer
#if defined(_MSC_VER) && _MSC_VER <= 1800
:
public
asio
::
noncopyable
...
...
include/ascs/ext/unpacker.h
浏览文件 @
07bc299e
...
...
@@ -176,7 +176,7 @@ protected:
//protocol: length + body
//this unpacker has a fixed buffer (4000 bytes), if messages can be held in it, then this unpacker works just as the default unpacker,
// otherwise, a dynamic
std::string will be created to hold big messages, then this unpacker works just
as the non_copy_unpacker.
// otherwise, a dynamic
T will be created to hold big messages, then this unpacker works
as the non_copy_unpacker.
//T can be std::string or basic_buffer, the latter will not fill its buffer in resize invocation, so is more efficient.
template
<
typename
T
=
basic_buffer
>
class
flexible_unpacker
:
public
i_unpacker
<
T
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录