mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-29 21:22:11 +01:00
C++1x-ification
This commit is contained in:
parent
850f22b098
commit
09028eea15
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user