From: erickson Date: Mon, 5 Feb 2007 15:47:11 +0000 (+0000) Subject: added a is-true wrapper for bool objects X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=626141e3eea51d1e6daa9761372ac4b4fc78642c;p=OpenSRF.git added a is-true wrapper for bool objects git-svn-id: svn://svn.open-ils.org/OpenSRF/branches/rel_1_0@816 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/objson/object.c b/src/objson/object.c index c781c30..782379b 100644 --- a/src/objson/object.c +++ b/src/objson/object.c @@ -805,3 +805,8 @@ char* jsonObjectToSimpleString( const jsonObject* o ) { } +int jsonBoolIsTrue( const jsonObject* o ) { + return (o && o->type == JSON_BOOL && o->value.b); +} + + diff --git a/src/objson/object.h b/src/objson/object.h index 0b3887d..baa63e9 100644 --- a/src/objson/object.h +++ b/src/objson/object.h @@ -254,6 +254,8 @@ jsonObject* jsonObjectClone( const jsonObject* o ); */ char* jsonObjectToSimpleString( const jsonObject* o ); +int jsonBoolIsTrue( const jsonObject* o ); + /* ------------------------------------------------------------------------ */ /* XPATH */