C++1x-ification

This commit is contained in:
Günter Obiltschnig 2020-01-25 14:26:57 +01:00
parent 0f3cc83ab7
commit 850f22b098
4 changed files with 20 additions and 20 deletions

View File

@ -35,7 +35,7 @@ class Redis_API Array
/// value.
{
public:
typedef std::vector<RedisType::Ptr>::const_iterator const_iterator;
using const_iterator = std::vector<RedisType::Ptr>::const_iterator;
Array();
/// 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!).
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.
@ -107,7 +107,7 @@ public:
/// Removes all elements from the array.
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.
@ -149,7 +149,7 @@ public:
/// Redis Protocol specification.
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.
@ -157,7 +157,7 @@ private:
void checkNull();
/// Checks for null array and sets a new vector if true.
Nullable<std::vector<RedisType::Ptr> > _elements;
Nullable<std::vector<RedisType::Ptr>> _elements;
};

View File

@ -37,7 +37,7 @@ class Redis_API Client
/// 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
/// 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.
///
/// BulkString bs = client.execute<BulkString>(...);
@ -71,7 +71,7 @@ class Redis_API Client
/// command << "list";
{
public:
typedef SharedPtr<Client> Ptr;
using Ptr = SharedPtr<Client>;
Client();
/// Creates an unconnected Client.

View File

@ -49,7 +49,7 @@ class Redis_API Command: public Array
///
{
public:
typedef std::vector<std::string> StringVec;
using StringVec = std::vector<std::string>;
Command(const std::string& command);
/// Creates a command.

View File

@ -36,7 +36,7 @@ class Redis_API RedisType
/// element with different types in Array.
{
public:
enum Types
enum Types
{
REDIS_INTEGER, /// Redis Integer
REDIS_SIMPLE_STRING, /// Redis Simple String
@ -45,7 +45,7 @@ public:
REDIS_ERROR /// Redis Error
};
typedef SharedPtr<RedisType> Ptr;
using Ptr = SharedPtr<RedisType>;
RedisType();
/// Creates the RedisType.
@ -132,9 +132,9 @@ struct RedisTypeTraits
template<>
struct RedisTypeTraits<Int64>
{
enum
enum
{
TypeId = RedisType::REDIS_INTEGER
TypeId = RedisType::REDIS_INTEGER
};
static const char marker = ':';
@ -155,9 +155,9 @@ struct RedisTypeTraits<Int64>
template<>
struct RedisTypeTraits<std::string>
{
enum
{
TypeId = RedisType::REDIS_SIMPLE_STRING
enum
{
TypeId = RedisType::REDIS_SIMPLE_STRING
};
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.
/// So, BulkString is a typedef for Nullable<std::string>.
/// So, BulkString is an alias for Nullable<std::string>.
template<>
struct RedisTypeTraits<BulkString>
{
enum
{
TypeId = RedisType::REDIS_BULK_STRING
enum
{
TypeId = RedisType::REDIS_BULK_STRING
};
static const char marker = '$';