Change krbCred member to reauthCred to better clarify purpose
[moonshot.git] / mech_eap / util_json.h
index 322d03e..e2c5e29 100644 (file)
@@ -49,6 +49,24 @@ using namespace shibsp;
 namespace gss_eap_util {
     class JSONObject;
 
+    class JSONException : public std::exception {
+    public:
+        JSONException(json_t *obj = NULL, json_type type = JSON_NULL);
+
+        ~JSONException(void) throw() {
+            json_decref(m_obj);
+        }
+
+        virtual const char *what(void) const throw() {
+            return m_reason.c_str();
+        }
+
+    private:
+        json_t *m_obj;
+        json_type m_type;
+        std::string m_reason;
+    };
+
     class JSONIterator {
     public:
         JSONIterator(const JSONObject &obj);
@@ -105,9 +123,16 @@ namespace gss_eap_util {
         json_int_t integer(void) const;
         double real(void) const;
         double number(void) const;
-        bool isnull(void) const;
         DDF ddf(void) const;
 
+        bool isObject(void) const;
+        bool isArray(void) const;
+        bool isString(void) const;
+        bool isInteger(void) const;
+        bool isNumber(void) const;
+        bool isBoolean(void) const;
+        bool isNull(void) const;
+
         ~JSONObject(void)
         {
             if (m_obj != NULL)