Exemplo n.º 1
0
 RedisCommandFrame(ArgumentArray& cmd) :
         type(REDIS_CMD_INVALID), m_is_inline(false), m_cmd_seted(false), m_raw_data_size(0)
 {
     m_cmd = cmd.front();
     cmd.pop_front();
     m_args = cmd;
 }
Exemplo n.º 2
0
 RedisCommandFrame(const char* fmt, ...) :
         type(REDIS_CMD_INVALID), m_is_inline(false), m_cmd_seted(false), m_raw_data_size(0)
 {
     va_list ap;
     va_start(ap, fmt);
     char buf[1024];
     vsnprintf(buf, sizeof(buf) - 1, fmt, ap);
     va_end(ap);
     char * pch;
     pch = strtok(buf, " ");
     while (pch != NULL)
     {
         m_args.push_back(std::string(pch));
         pch = strtok(NULL, " ");
     }
     m_cmd = m_args.front();
     m_args.pop_front();
 }