Library: Redis
Package: Redis
Header: Poco/Redis/Type.h
This class is used to store elements with different types in an array.
Constructor and Destructor:-
Syntax of constructor -
RedisType();
Syntax of destructor -
virtual ~RedisType();
Member Function(s):
static RedisType::Ptr createRedisType(
char marker
);
This function creates the type for an array. This type is determined by the type of marker mentioned in the function.
Types of marker and the type associated to them are as follows:
'+': a simple string (std::string)
'-': an error (Error)
'$': a bulk string (BulkString)
'*': an array (Array)
':': a signed 64 bit integer (Int64)
bool isArray() const;
This function when called tells whether the value is Redis Array or not. It returns boolean value true if it is a Redis array otherwise returns false.
bool isBulkString() const;
This function when called tells whether the value is Redis bulkString or not. It returns boolean value true if it is a Redis bulkString otherwise returns false.
bool isError() const;
This function when called tells whether the value is a Redis error or not. It returns boolean value true if it is a Redis error otherwise returns false.
bool isInteger() const;
This function when called tells whether the value is a Redis 64 bit integer or not. It returns boolean value true if it is a Redis integer otherwise returns false.
bool isSimpleString() const;
This function when called tells whether the value is a simple string or not. It returns a boolean value true if it is a simple string otherwise returns false.
virtual void read(
RedisInputStream & input
) = 0;
This function reads the value from the stream.
virtual std::string toString() const = 0;
This function converts the value to RESP string where RESP stands for REdis Serialization Protocol.
virtual int type() const = 0;
Upon calling this function returns the type of value.
Comments