From 10098e1371ea161370bff9ae8c35cbccbe5a43b4 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Thu, 1 Dec 2016 11:11:48 +0100 Subject: [PATCH] Add support for "long long" in JSON Driver. * Bug: In Hurricane::JsonWriter, add support for "long long". Needed on 32 bits architectures to write DbU that are now int64_t which resolves to "long long". --- hurricane/src/hurricane/JsonWriter.cpp | 2 ++ hurricane/src/hurricane/hurricane/JsonWriter.h | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hurricane/src/hurricane/JsonWriter.cpp b/hurricane/src/hurricane/JsonWriter.cpp index 15b7724e..f9ec660a 100644 --- a/hurricane/src/hurricane/JsonWriter.cpp +++ b/hurricane/src/hurricane/JsonWriter.cpp @@ -90,6 +90,8 @@ void JsonWriter::write ( int v ) { _WRITER->Int ( v); } void JsonWriter::write ( const long* v ) { _WRITER->Int64 (*v); } void JsonWriter::write ( long v ) { _WRITER->Int64 ( v); } + void JsonWriter::write ( const long long* v ) { _WRITER->Int64 (*v); } + void JsonWriter::write ( long long v ) { _WRITER->Int64 ( v); } void JsonWriter::write ( const unsigned int* v ) { _WRITER->Uint (*v); } void JsonWriter::write ( unsigned int v ) { _WRITER->Uint ( v); } void JsonWriter::write ( const unsigned long* v ) { _WRITER->Uint64(*v); } diff --git a/hurricane/src/hurricane/hurricane/JsonWriter.h b/hurricane/src/hurricane/hurricane/JsonWriter.h index 7ea4097a..b6804300 100644 --- a/hurricane/src/hurricane/hurricane/JsonWriter.h +++ b/hurricane/src/hurricane/hurricane/JsonWriter.h @@ -86,6 +86,8 @@ namespace Hurricane { void write ( int ); void write ( const int* ); void write ( long ); + void write ( const long long* ); + void write ( long long ); void write ( const long* ); void write ( unsigned int ); void write ( const unsigned int* ); @@ -130,6 +132,8 @@ inline void jsonWrite ( JsonWriter* w, const int* v ) { w->write(v); inline void jsonWrite ( JsonWriter* w, int v ) { w->write(v); } inline void jsonWrite ( JsonWriter* w, const long* v ) { w->write(v); } inline void jsonWrite ( JsonWriter* w, long v ) { w->write(v); } +inline void jsonWrite ( JsonWriter* w, const long long* v ) { w->write(v); } +inline void jsonWrite ( JsonWriter* w, long long v ) { w->write(v); } inline void jsonWrite ( JsonWriter* w, const unsigned int* v ) { w->write(v); } inline void jsonWrite ( JsonWriter* w, unsigned int v ) { w->write(v); } inline void jsonWrite ( JsonWriter* w, const unsigned long* v ) { w->write(v); } @@ -213,7 +217,7 @@ template inline void jsonWrite ( JsonWriter* w, const std::string& key, const C& ) { w->key( key ); - std::string message = "JSON unsupported type " + Hurricane::demangle(typeid(C).name()); + std::string message = "[DRIVER ERROR] JSON unsupported type " + Hurricane::demangle(typeid(C).name()); w->write( message.c_str() ); }