jamesge commented on a change in pull request #972: Redis server protocol
URL: https://github.com/apache/incubator-brpc/pull/972#discussion_r360761223
 
 

 ##########
 File path: src/brpc/redis_reply.h
 ##########
 @@ -56,6 +59,29 @@ class RedisReply {
     bool is_string() const;  // True if the reply is a string.
     bool is_array() const;   // True if the reply is an array.
 
+    // Set the reply to the null string.
+    void SetNullString();
+
+    // Set the reply to the null array.
+    void SetNullArray();
+
+    // Set the reply to the array with `size' elements. After calling
+    // SetArray, use operator[] to visit sub replies and set their
+    // value.
+    void SetArray(int size);
+
+    // Set the reply to status message `str'.
+    void SetStatus(const std::string& str);
+
+    // Set the reply to error message `str'.
+    void SetError(const std::string& str);
+
+    // Set the reply to integer `value'.
+    void SetInteger(int64_t value);
+
+    // Set the reply to string `str'.
+    void SetString(const std::string& str);
 
 Review comment:
   类型为什么不是StringPiece?内部实现无法直接存储string的话都要考虑一下StringPiece,以避免无谓的分配和复制。

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to