diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2011-12-22 11:37:01 -0800 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2011-12-22 11:37:01 -0800 |
commit | 1bcab1377de6afe8c0f9c895cdba04baacf3e4a5 (patch) | |
tree | 4d478ccff5da0dee3c217c01f815ee1764965501 /bindings/cpp/upb/upb.hpp | |
parent | b5f5ee867e6c91b77490dc8894236f17a47bde00 (diff) |
Sync with internal Google development.
This breaks the open-source build, will
follow up with a change to fix it.
Diffstat (limited to 'bindings/cpp/upb/upb.hpp')
-rw-r--r-- | bindings/cpp/upb/upb.hpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/bindings/cpp/upb/upb.hpp b/bindings/cpp/upb/upb.hpp index 4fb337d..226859c 100644 --- a/bindings/cpp/upb/upb.hpp +++ b/bindings/cpp/upb/upb.hpp @@ -1,23 +1,34 @@ -/* - * upb - a minimalist implementation of protocol buffers. - * - * Copyright (c) 2011 Google Inc. See LICENSE for details. - * Author: Josh Haberman <jhaberman@gmail.com> - */ +// +// 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" +#include <iostream> namespace upb { +typedef upb_success_t Success; + class Status : public upb_status { public: Status() { upb_status_init(this); } ~Status() { upb_status_uninit(this); } + bool ok() const { return upb_ok(this); } + bool eof() const { return upb_eof(this); } + const char *GetString() const { return upb_status_getstr(this); } + void SetEof() { upb_status_seteof(this); } + void SetErrorLiteral(const char* msg) { + upb_status_seterrliteral(this, msg); + } + + void Clear() { upb_status_clear(this); } }; class Value : public upb_value { |