mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-25 02:06:04 +02:00
C++1x-ification
This commit is contained in:
@@ -35,7 +35,7 @@ class Redis_API Array
|
|||||||
/// value.
|
/// value.
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::vector<RedisType::Ptr>::const_iterator const_iterator;
|
using const_iterator = std::vector<RedisType::Ptr>::const_iterator;
|
||||||
|
|
||||||
Array();
|
Array();
|
||||||
/// Creates an Array. As long as there are no elements added,
|
/// Creates an Array. As long as there are no elements added,
|
||||||
@@ -99,7 +99,7 @@ public:
|
|||||||
/// Adds a simple string (can't contain newline characters!).
|
/// Adds a simple string (can't contain newline characters!).
|
||||||
|
|
||||||
const_iterator begin() const;
|
const_iterator begin() const;
|
||||||
/// Returns an iterator to the start of the array.
|
/// Returns an iterator to the start of the array.
|
||||||
///
|
///
|
||||||
/// Note: this can throw a NullValueException when this is a Null array.
|
/// Note: this can throw a NullValueException when this is a Null array.
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ public:
|
|||||||
/// Removes all elements from the array.
|
/// Removes all elements from the array.
|
||||||
|
|
||||||
const_iterator end() const;
|
const_iterator end() const;
|
||||||
/// Returns an iterator to the end of the array.
|
/// Returns an iterator to the end of the array.
|
||||||
///
|
///
|
||||||
/// Note: this can throw a NullValueException when this is a Null array.
|
/// Note: this can throw a NullValueException when this is a Null array.
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ public:
|
|||||||
/// Redis Protocol specification.
|
/// Redis Protocol specification.
|
||||||
|
|
||||||
size_t size() const;
|
size_t size() const;
|
||||||
/// Returns the size of the array.
|
/// Returns the size of the array.
|
||||||
///
|
///
|
||||||
/// Note: this can throw a NullValueException when this is a Null array.
|
/// Note: this can throw a NullValueException when this is a Null array.
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ private:
|
|||||||
void checkNull();
|
void checkNull();
|
||||||
/// Checks for null array and sets a new vector if true.
|
/// Checks for null array and sets a new vector if true.
|
||||||
|
|
||||||
Nullable<std::vector<RedisType::Ptr> > _elements;
|
Nullable<std::vector<RedisType::Ptr>> _elements;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class Redis_API Client
|
|||||||
/// bit integer, a simple string, a bulk string, an array or an error. The
|
/// bit integer, a simple string, a bulk string, an array or an error. The
|
||||||
/// first element of the command array is the Redis command. A simple string
|
/// first element of the command array is the Redis command. A simple string
|
||||||
/// is a string that cannot contain a CR or LF character. A bulk string is
|
/// is a string that cannot contain a CR or LF character. A bulk string is
|
||||||
/// implemented as a typedef for Poco::Nullable<std::string>. This is
|
/// implemented as an alias for Poco::Nullable<std::string>. This is
|
||||||
/// because a bulk string can represent a Null value.
|
/// because a bulk string can represent a Null value.
|
||||||
///
|
///
|
||||||
/// BulkString bs = client.execute<BulkString>(...);
|
/// BulkString bs = client.execute<BulkString>(...);
|
||||||
@@ -71,7 +71,7 @@ class Redis_API Client
|
|||||||
/// command << "list";
|
/// command << "list";
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef SharedPtr<Client> Ptr;
|
using Ptr = SharedPtr<Client>;
|
||||||
|
|
||||||
Client();
|
Client();
|
||||||
/// Creates an unconnected Client.
|
/// Creates an unconnected Client.
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class Redis_API Command: public Array
|
|||||||
///
|
///
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef std::vector<std::string> StringVec;
|
using StringVec = std::vector<std::string>;
|
||||||
|
|
||||||
Command(const std::string& command);
|
Command(const std::string& command);
|
||||||
/// Creates a command.
|
/// Creates a command.
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class Redis_API RedisType
|
|||||||
/// element with different types in Array.
|
/// element with different types in Array.
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum Types
|
enum Types
|
||||||
{
|
{
|
||||||
REDIS_INTEGER, /// Redis Integer
|
REDIS_INTEGER, /// Redis Integer
|
||||||
REDIS_SIMPLE_STRING, /// Redis Simple String
|
REDIS_SIMPLE_STRING, /// Redis Simple String
|
||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
REDIS_ERROR /// Redis Error
|
REDIS_ERROR /// Redis Error
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef SharedPtr<RedisType> Ptr;
|
using Ptr = SharedPtr<RedisType>;
|
||||||
|
|
||||||
RedisType();
|
RedisType();
|
||||||
/// Creates the RedisType.
|
/// Creates the RedisType.
|
||||||
@@ -132,9 +132,9 @@ struct RedisTypeTraits
|
|||||||
template<>
|
template<>
|
||||||
struct RedisTypeTraits<Int64>
|
struct RedisTypeTraits<Int64>
|
||||||
{
|
{
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
TypeId = RedisType::REDIS_INTEGER
|
TypeId = RedisType::REDIS_INTEGER
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char marker = ':';
|
static const char marker = ':';
|
||||||
@@ -155,9 +155,9 @@ struct RedisTypeTraits<Int64>
|
|||||||
template<>
|
template<>
|
||||||
struct RedisTypeTraits<std::string>
|
struct RedisTypeTraits<std::string>
|
||||||
{
|
{
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
TypeId = RedisType::REDIS_SIMPLE_STRING
|
TypeId = RedisType::REDIS_SIMPLE_STRING
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char marker = '+';
|
static const char marker = '+';
|
||||||
@@ -174,17 +174,17 @@ struct RedisTypeTraits<std::string>
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef Nullable<std::string> BulkString;
|
using BulkString = Nullable<std::string>;
|
||||||
/// A bulk string is a string that can contain a NULL value.
|
/// A bulk string is a string that can contain a NULL value.
|
||||||
/// So, BulkString is a typedef for Nullable<std::string>.
|
/// So, BulkString is an alias for Nullable<std::string>.
|
||||||
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct RedisTypeTraits<BulkString>
|
struct RedisTypeTraits<BulkString>
|
||||||
{
|
{
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
TypeId = RedisType::REDIS_BULK_STRING
|
TypeId = RedisType::REDIS_BULK_STRING
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char marker = '$';
|
static const char marker = '$';
|
||||||
|
|||||||
Reference in New Issue
Block a user