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=5d820e4b168370f06805bc08f8dbb735d44470b1;p=Evergreen.git added a is-true wrapper for bool objects git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@6871 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/OpenSRF/src/objson/object.c b/OpenSRF/src/objson/object.c index c781c30308..782379b46e 100644 --- a/OpenSRF/src/objson/object.c +++ b/OpenSRF/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/OpenSRF/src/objson/object.h b/OpenSRF/src/objson/object.h index 0b3887d0fc..baa63e92c0 100644 --- a/OpenSRF/src/objson/object.h +++ b/OpenSRF/src/objson/object.h @@ -254,6 +254,8 @@ jsonObject* jsonObjectClone( const jsonObject* o ); */ char* jsonObjectToSimpleString( const jsonObject* o ); +int jsonBoolIsTrue( const jsonObject* o ); + /* ------------------------------------------------------------------------ */ /* XPATH */