提交 07bc299e 编写于 作者: Y youngwolf

Supplement annotations.

上级 5458a2b3
......@@ -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
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册