Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
593 B
31 lines
593 B
13 years ago
|
/*
|
||
|
* upb - a minimalist implementation of protocol buffers.
|
||
|
*
|
||
|
* Copyright (c) 2011 Google Inc. See LICENSE for details.
|
||
|
* Author: Josh Haberman <jhaberman@gmail.com>
|
||
|
*/
|
||
|
|
||
|
#ifndef UPB_HPP
|
||
|
#define UPB_HPP
|
||
|
|
||
|
#include "upb/upb.h"
|
||
|
|
||
|
namespace upb {
|
||
|
|
||
|
class Status : public upb_status {
|
||
|
public:
|
||
|
Status() { upb_status_init(this); }
|
||
|
~Status() { upb_status_uninit(this); }
|
||
|
|
||
|
const char *GetString() const { return upb_status_getstr(this); }
|
||
|
};
|
||
|
|
||
|
INLINE std::ostream& operator<<(std::ostream& out, const Status& status) {
|
||
|
out << status.GetString();
|
||
|
return out;
|
||
|
}
|
||
|
|
||
|
} // namespace upb
|
||
|
|
||
|
#endif
|