summaryrefslogtreecommitdiff
path: root/bindings/cpp/upb/upb.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/cpp/upb/upb.hpp')
-rw-r--r--bindings/cpp/upb/upb.hpp23
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 {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback