An array can contain other arrays ... it can even contain an error ...

This commit is contained in:
fbraem 2015-10-23 22:00:50 +02:00
parent 901751f800
commit f77642a77a
2 changed files with 11 additions and 4 deletions

View File

@ -23,12 +23,14 @@
#include "Poco/Redis/Redis.h"
#include "Poco/Redis/Type.h"
#include "Poco/Redis/Error.h"
#include "Poco/Redis/Exception.h"
namespace Poco {
namespace Redis {
class Redis_API Array
/// Represents a Redis Array.
{
public:
Array();
@ -123,13 +125,19 @@ void Type<Array>::read(RedisSocket& socket)
switch(elementType)
{
case ElementTraits<Int64>::marker :
element = new Type<Int64>();
element = new Type<Int64>();
break;
case ElementTraits<std::string>::marker :
element = new Type<std::string>();
break;
case ElementTraits<BulkString>::marker :
element = new Type<BulkString>();
element = new Type<BulkString>();
break;
case ElementTraits<Array>::marker :
element = new Type<Array>();
break;
case ElementTraits<Error>::marker :
element = new Type<Error>();
break;
}

View File

@ -51,8 +51,6 @@ class Redis_API Client
/// {
/// // We have a Null value
/// }
///
/// An Array can't contain another Array.
{
public:
typedef Poco::SharedPtr<Client> Ptr;
@ -152,6 +150,7 @@ private:
/// $ : a bulk string (BulkString)
/// * : an array (Array)
/// : : a signed 64 bit integer (Int64)
friend class Array;
};