diff --git a/MongoDB/include/Poco/MongoDB/Array.h b/MongoDB/include/Poco/MongoDB/Array.h index ee306bb01..55e262840 100644 --- a/MongoDB/include/Poco/MongoDB/Array.h +++ b/MongoDB/include/Poco/MongoDB/Array.h @@ -31,7 +31,7 @@ class MongoDB_API Array: public Document /// This class represents a BSON Array. { public: - typedef SharedPtr<Array> Ptr; + using Ptr = SharedPtr<Array>; Array(); /// Creates an empty Array. diff --git a/MongoDB/include/Poco/MongoDB/Binary.h b/MongoDB/include/Poco/MongoDB/Binary.h index 02b6baf1b..5e9eb58f2 100644 --- a/MongoDB/include/Poco/MongoDB/Binary.h +++ b/MongoDB/include/Poco/MongoDB/Binary.h @@ -38,7 +38,7 @@ class MongoDB_API Binary /// A Binary stores its data in a Poco::Buffer<unsigned char>. { public: - typedef SharedPtr<Binary> Ptr; + using Ptr = SharedPtr<Binary>; Binary(); /// Creates an empty Binary with subtype 0. @@ -48,12 +48,12 @@ public: Binary(const UUID& uuid); /// Creates a Binary containing an UUID. - + Binary(const std::string& data, unsigned char subtype = 0); /// Creates a Binary with the contents of the given string and the given subtype. - + Binary(const void* data, Poco::Int32 size, unsigned char subtype = 0); - /// Creates a Binary with the contents of the given buffer and the given subtype. + /// Creates a Binary with the contents of the given buffer and the given subtype. virtual ~Binary(); /// Destroys the Binary. @@ -69,7 +69,7 @@ public: std::string toString(int indent = 0) const; /// Returns the contents of the Binary as Base64-encoded string. - + std::string toRawString() const; /// Returns the raw content of the Binary as a string. @@ -135,7 +135,7 @@ inline void BSONReader::read<Binary::Ptr>(Binary::Ptr& to) unsigned char subtype; _reader >> subtype; to->subtype(subtype); - + _reader.readRaw((char*) to->buffer().begin(), size); } diff --git a/MongoDB/include/Poco/MongoDB/Connection.h b/MongoDB/include/Poco/MongoDB/Connection.h index 202ae9071..870be2a7c 100644 --- a/MongoDB/include/Poco/MongoDB/Connection.h +++ b/MongoDB/include/Poco/MongoDB/Connection.h @@ -37,7 +37,7 @@ class MongoDB_API Connection /// for more information on the wire protocol. { public: - typedef Poco::SharedPtr<Connection> Ptr; + using Ptr = Poco::SharedPtr<Connection>; class MongoDB_API SocketFactory { diff --git a/MongoDB/include/Poco/MongoDB/Document.h b/MongoDB/include/Poco/MongoDB/Document.h index 674a1f789..5be1a33c8 100644 --- a/MongoDB/include/Poco/MongoDB/Document.h +++ b/MongoDB/include/Poco/MongoDB/Document.h @@ -33,7 +33,7 @@ namespace MongoDB { class ElementFindByName { public: - ElementFindByName(const std::string& name): + ElementFindByName(const std::string& name): _name(name) { } @@ -52,8 +52,8 @@ class MongoDB_API Document /// Represents a MongoDB (BSON) document. { public: - typedef SharedPtr<Document> Ptr; - typedef std::vector<Document::Ptr> Vector; + using Ptr = SharedPtr<Document>; + using Vector = std::vector<Document::Ptr>; Document(); /// Creates an empty Document. diff --git a/MongoDB/include/Poco/MongoDB/Element.h b/MongoDB/include/Poco/MongoDB/Element.h index e6a41c401..47a9fae7e 100644 --- a/MongoDB/include/Poco/MongoDB/Element.h +++ b/MongoDB/include/Poco/MongoDB/Element.h @@ -43,7 +43,7 @@ class MongoDB_API Element /// Represents an Element of a Document or an Array. { public: - typedef Poco::SharedPtr<Element> Ptr; + using Ptr = Poco::SharedPtr<Element>; explicit Element(const std::string& name); /// Creates the Element with the given name. @@ -78,10 +78,10 @@ inline const std::string& Element::name() const } -typedef std::list<Element::Ptr> ElementSet; +using ElementSet = std::list<Element::Ptr>; -template<typename T> +template<typename T> struct ElementTraits { }; @@ -259,7 +259,7 @@ inline void BSONWriter::write<Timestamp>(Timestamp& from) } -typedef Nullable<unsigned char> NullValue; +using NullValue = Nullable<unsigned char>; // BSON Null Value @@ -288,7 +288,7 @@ inline void BSONWriter::write<NullValue>(NullValue& from) } -struct BSONTimestamp +struct BSONTimestamp { Poco::Timestamp ts; Poco::Int32 inc; @@ -355,7 +355,7 @@ class ConcreteElement: public Element { public: ConcreteElement(const std::string& name, const T& init): - Element(name), + Element(name), _value(init) { } @@ -364,7 +364,7 @@ public: { } - + T value() const { return _value; @@ -376,7 +376,7 @@ public: return ElementTraits<T>::toString(_value, indent); } - + int type() const { return ElementTraits<T>::TypeId; diff --git a/MongoDB/include/Poco/MongoDB/JavaScriptCode.h b/MongoDB/include/Poco/MongoDB/JavaScriptCode.h index 6401743b8..3ec98354a 100644 --- a/MongoDB/include/Poco/MongoDB/JavaScriptCode.h +++ b/MongoDB/include/Poco/MongoDB/JavaScriptCode.h @@ -33,7 +33,7 @@ class MongoDB_API JavaScriptCode /// Represents JavaScript type in BSON. { public: - typedef SharedPtr<JavaScriptCode> Ptr; + using Ptr = SharedPtr<JavaScriptCode>; JavaScriptCode(); /// Creates an empty JavaScriptCode object. diff --git a/MongoDB/include/Poco/MongoDB/ObjectId.h b/MongoDB/include/Poco/MongoDB/ObjectId.h index 659047c95..d67581946 100644 --- a/MongoDB/include/Poco/MongoDB/ObjectId.h +++ b/MongoDB/include/Poco/MongoDB/ObjectId.h @@ -42,10 +42,10 @@ class MongoDB_API ObjectId /// as its value. { public: - typedef SharedPtr<ObjectId> Ptr; + using Ptr = SharedPtr<ObjectId>; explicit ObjectId(const std::string& id); - /// Creates an ObjectId from a string. + /// Creates an ObjectId from a string. /// /// The string must contain a hexadecimal representation /// of an object ID. This means a string of 24 characters. @@ -61,15 +61,15 @@ public: std::string toString(const std::string& fmt = "%02x") const; /// Returns the id in string format. The fmt parameter - /// specifies the formatting used for individual members + /// specifies the formatting used for individual members /// of the ID char array. private: ObjectId(); - static int fromHex(char c); + static int fromHex(char c); static char fromHex(const char* c); - + unsigned char _id[12]; friend class BSONWriter; diff --git a/MongoDB/include/Poco/MongoDB/RegularExpression.h b/MongoDB/include/Poco/MongoDB/RegularExpression.h index 49ef3b00b..a30d7bde7 100644 --- a/MongoDB/include/Poco/MongoDB/RegularExpression.h +++ b/MongoDB/include/Poco/MongoDB/RegularExpression.h @@ -31,7 +31,7 @@ class MongoDB_API RegularExpression /// Represents a regular expression in BSON format. { public: - typedef SharedPtr<RegularExpression> Ptr; + using Ptr = SharedPtr<RegularExpression>; RegularExpression(); /// Creates an empty RegularExpression.