From 1bcab1377de6afe8c0f9c895cdba04baacf3e4a5 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 22 Dec 2011 11:37:01 -0800 Subject: Sync with internal Google development. This breaks the open-source build, will follow up with a change to fix it. --- bindings/cpp/upb/upb.hpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'bindings/cpp/upb/upb.hpp') 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 - */ +// +// upb - a minimalist implementation of protocol buffers. +// +// Copyright (c) 2011 Google Inc. See LICENSE for details. +// Author: Josh Haberman #ifndef UPB_HPP #define UPB_HPP #include "upb/upb.h" +#include 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 { -- cgit v1.2.3