From 07bc299e9e4372bf05e2e4b4e02f934b3455bc89 Mon Sep 17 00:00:00 2001 From: youngwolf Date: Fri, 15 Jan 2021 11:13:30 +0800 Subject: [PATCH] Supplement annotations. --- include/ascs/ext/ext.h | 6 +++--- include/ascs/ext/unpacker.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/ascs/ext/ext.h b/include/ascs/ext/ext.h index f130dbb..fd05c71 100644 --- a/include/ascs/ext/ext.h +++ b/include/ascs/ext/ext.h @@ -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 according to std::string), because std::string +//a substitute of std::string (just for unpacking scenario, many features are missing against 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 diff --git a/include/ascs/ext/unpacker.h b/include/ascs/ext/unpacker.h index 7ceb894..07af4a1 100644 --- a/include/ascs/ext/unpacker.h +++ b/include/ascs/ext/unpacker.h @@ -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 class flexible_unpacker : public i_unpacker -- GitLab