diff --git a/MongoDB/include/Poco/MongoDB/Element.h b/MongoDB/include/Poco/MongoDB/Element.h index 8ad530e9f..ad6f57575 100644 --- a/MongoDB/include/Poco/MongoDB/Element.h +++ b/MongoDB/include/Poco/MongoDB/Element.h @@ -291,7 +291,7 @@ inline void BSONWriter::write(NullValue& from) { } -struct SpecialTimestamp { +struct BSONTimestamp { Poco::Timestamp ts; Poco::Int32 inc; }; @@ -299,11 +299,11 @@ struct SpecialTimestamp { // BSON Timestamp // spec: int64 template<> -struct ElementTraits +struct ElementTraits { enum { TypeId = 0x11 }; - static std::string toString(const SpecialTimestamp& value, int indent = 0) + static std::string toString(const BSONTimestamp& value, int indent = 0) { std::string result; result.append(1, '"'); @@ -317,7 +317,7 @@ struct ElementTraits template<> -inline void BSONReader::read(SpecialTimestamp& to) +inline void BSONReader::read(BSONTimestamp& to) { Poco::Int64 value; _reader >> value; @@ -328,7 +328,7 @@ inline void BSONReader::read(SpecialTimestamp& to) template<> -inline void BSONWriter::write(SpecialTimestamp& from) +inline void BSONWriter::write(BSONTimestamp& from) { Poco::Int64 value = from.ts.epochMicroseconds() / 1000; value <<= 32; diff --git a/MongoDB/src/Document.cpp b/MongoDB/src/Document.cpp index 080095112..91dc8da5d 100644 --- a/MongoDB/src/Document.cpp +++ b/MongoDB/src/Document.cpp @@ -96,8 +96,8 @@ void Document::read(BinaryReader& reader) case ElementTraits::TypeId: element = new ConcreteElement(name, Poco::Timestamp()); break; - case ElementTraits::TypeId: - element = new ConcreteElement(name, SpecialTimestamp()); + case ElementTraits::TypeId: + element = new ConcreteElement(name, BSONTimestamp()); break; case ElementTraits::TypeId: element = new ConcreteElement(name, NullValue(0));