diff options
Diffstat (limited to 'src/google/protobuf/stubs/common.cc')
-rw-r--r-- | src/google/protobuf/stubs/common.cc | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/google/protobuf/stubs/common.cc b/src/google/protobuf/stubs/common.cc index 54e00ccb..d470fc72 100644 --- a/src/google/protobuf/stubs/common.cc +++ b/src/google/protobuf/stubs/common.cc @@ -32,12 +32,13 @@ #include <google/protobuf/stubs/common.h> #include <google/protobuf/stubs/once.h> +#include <google/protobuf/stubs/status.h> +#include <google/protobuf/stubs/stringpiece.h> +#include <google/protobuf/stubs/strutil.h> #include <stdio.h> #include <errno.h> #include <vector> -#include "config.h" - #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN // We only need minimal includes #include <windows.h> @@ -148,6 +149,27 @@ LogMessage& LogMessage::operator<<(const char* value) { return *this; } +LogMessage& LogMessage::operator<<(const StringPiece& value) { + message_ += value.ToString(); + return *this; +} + +LogMessage& LogMessage::operator<<(long long value) { + message_ += SimpleItoa(value); + return *this; +} + +LogMessage& LogMessage::operator<<(unsigned long long value) { + message_ += SimpleItoa(value); + return *this; +} + +LogMessage& LogMessage::operator<<( + const ::google::protobuf::util::Status& status) { + message_ += status.ToString(); + return *this; +} + // Since this is just for logging, we don't care if the current locale changes // the results -- in fact, we probably prefer that. So we use snprintf() // instead of Simple*toa(). @@ -167,7 +189,7 @@ LogMessage& LogMessage::operator<<(const char* value) { DECLARE_STREAM_OPERATOR(char , "%c" ) DECLARE_STREAM_OPERATOR(int , "%d" ) -DECLARE_STREAM_OPERATOR(uint , "%u" ) +DECLARE_STREAM_OPERATOR(unsigned int , "%u" ) DECLARE_STREAM_OPERATOR(long , "%ld") DECLARE_STREAM_OPERATOR(unsigned long, "%lu") DECLARE_STREAM_OPERATOR(double , "%g" ) |