From 850f22b09898c3527952dfbb38a94783b823f2b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Sat, 25 Jan 2020 14:26:57 +0100 Subject: [PATCH] C++1x-ification --- Redis/include/Poco/Redis/Array.h | 10 +++++----- Redis/include/Poco/Redis/Client.h | 4 ++-- Redis/include/Poco/Redis/Command.h | 2 +- Redis/include/Poco/Redis/Type.h | 24 ++++++++++++------------ 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Redis/include/Poco/Redis/Array.h b/Redis/include/Poco/Redis/Array.h index 262abc9a4..15b7cd0c0 100644 --- a/Redis/include/Poco/Redis/Array.h +++ b/Redis/include/Poco/Redis/Array.h @@ -35,7 +35,7 @@ class Redis_API Array /// value. { public: - typedef std::vector::const_iterator const_iterator; + using const_iterator = std::vector::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 > _elements; + Nullable> _elements; }; diff --git a/Redis/include/Poco/Redis/Client.h b/Redis/include/Poco/Redis/Client.h index 6b204ae6c..079947e9b 100644 --- a/Redis/include/Poco/Redis/Client.h +++ b/Redis/include/Poco/Redis/Client.h @@ -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. This is + /// implemented as an alias for Poco::Nullable. This is /// because a bulk string can represent a Null value. /// /// BulkString bs = client.execute(...); @@ -71,7 +71,7 @@ class Redis_API Client /// command << "list"; { public: - typedef SharedPtr Ptr; + using Ptr = SharedPtr; Client(); /// Creates an unconnected Client. diff --git a/Redis/include/Poco/Redis/Command.h b/Redis/include/Poco/Redis/Command.h index 627441c65..f5cbd3c55 100644 --- a/Redis/include/Poco/Redis/Command.h +++ b/Redis/include/Poco/Redis/Command.h @@ -49,7 +49,7 @@ class Redis_API Command: public Array /// { public: - typedef std::vector StringVec; + using StringVec = std::vector; Command(const std::string& command); /// Creates a command. diff --git a/Redis/include/Poco/Redis/Type.h b/Redis/include/Poco/Redis/Type.h index 79c534f1a..084b3f710 100644 --- a/Redis/include/Poco/Redis/Type.h +++ b/Redis/include/Poco/Redis/Type.h @@ -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 Ptr; + using Ptr = SharedPtr; RedisType(); /// Creates the RedisType. @@ -132,9 +132,9 @@ struct RedisTypeTraits template<> struct RedisTypeTraits { - enum + enum { - TypeId = RedisType::REDIS_INTEGER + TypeId = RedisType::REDIS_INTEGER }; static const char marker = ':'; @@ -155,9 +155,9 @@ struct RedisTypeTraits template<> struct RedisTypeTraits { - enum - { - TypeId = RedisType::REDIS_SIMPLE_STRING + enum + { + TypeId = RedisType::REDIS_SIMPLE_STRING }; static const char marker = '+'; @@ -174,17 +174,17 @@ struct RedisTypeTraits }; -typedef Nullable BulkString; +using BulkString = Nullable; /// A bulk string is a string that can contain a NULL value. - /// So, BulkString is a typedef for Nullable. + /// So, BulkString is an alias for Nullable. template<> struct RedisTypeTraits { - enum - { - TypeId = RedisType::REDIS_BULK_STRING + enum + { + TypeId = RedisType::REDIS_BULK_STRING }; static const char marker = '$';