mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 18:20:26 +01:00
Renamed SpecialTimestamp to BSONTimestamp
This commit is contained in:
parent
584a776d77
commit
b042b892db
@ -291,7 +291,7 @@ inline void BSONWriter::write<NullValue>(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<SpecialTimestamp>
|
||||
struct ElementTraits<BSONTimestamp>
|
||||
{
|
||||
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<SpecialTimestamp>
|
||||
|
||||
|
||||
template<>
|
||||
inline void BSONReader::read<SpecialTimestamp>(SpecialTimestamp& to)
|
||||
inline void BSONReader::read<BSONTimestamp>(BSONTimestamp& to)
|
||||
{
|
||||
Poco::Int64 value;
|
||||
_reader >> value;
|
||||
@ -328,7 +328,7 @@ inline void BSONReader::read<SpecialTimestamp>(SpecialTimestamp& to)
|
||||
|
||||
|
||||
template<>
|
||||
inline void BSONWriter::write<SpecialTimestamp>(SpecialTimestamp& from)
|
||||
inline void BSONWriter::write<BSONTimestamp>(BSONTimestamp& from)
|
||||
{
|
||||
Poco::Int64 value = from.ts.epochMicroseconds() / 1000;
|
||||
value <<= 32;
|
||||
|
@ -96,8 +96,8 @@ void Document::read(BinaryReader& reader)
|
||||
case ElementTraits<Poco::Timestamp>::TypeId:
|
||||
element = new ConcreteElement<Poco::Timestamp>(name, Poco::Timestamp());
|
||||
break;
|
||||
case ElementTraits<SpecialTimestamp>::TypeId:
|
||||
element = new ConcreteElement<SpecialTimestamp>(name, SpecialTimestamp());
|
||||
case ElementTraits<BSONTimestamp>::TypeId:
|
||||
element = new ConcreteElement<BSONTimestamp>(name, BSONTimestamp());
|
||||
break;
|
||||
case ElementTraits<NullValue>::TypeId:
|
||||
element = new ConcreteElement<NullValue>(name, NullValue(0));
|
||||
|
Loading…
Reference in New Issue
Block a user