int64_t bson_iterator_long( const bson_iterator * i ){ switch (bson_iterator_type(i)){ case bson_int: return bson_iterator_int_raw(i); case bson_long: return bson_iterator_long_raw(i); case bson_double: return bson_iterator_double_raw(i); default: return 0; } }
bson_bool_t bson_iterator_bool( const bson_iterator * i ){ switch (bson_iterator_type(i)){ case bson_bool: return bson_iterator_bool_raw(i); case bson_int: return bson_iterator_int_raw(i) != 0; case bson_long: return bson_iterator_long_raw(i) != 0; case bson_double: return bson_iterator_double_raw(i) != 0; case bson_eoo: case bson_null: return 0; default: return 1; } }
int64_t bson_iterator_long( const bson_iterator *i ) { switch ( bson_iterator_type( i ) ) { case BSON_INT: return bson_iterator_int_raw( i ); case BSON_LONG: return bson_iterator_long_raw( i ); case BSON_DOUBLE: return bson_iterator_double_raw( i ); default: return 0; } }
MONGO_EXPORT int64_t bson_iterator_long( const bson_iterator *i ) { check_mongo_object( (void*)i ); switch ( bson_iterator_type( i ) ) { case BSON_INT: return bson_iterator_int_raw( i ); case BSON_LONG: return bson_iterator_long_raw( i ); case BSON_DOUBLE: return (int64_t) bson_iterator_double_raw( i ); default: return 0; } }
bson_bool_t bson_iterator_bool( const bson_iterator *i ) { switch ( bson_iterator_type( i ) ) { case BSON_BOOL: return bson_iterator_bool_raw( i ); case BSON_INT: return bson_iterator_int_raw( i ) != 0; case BSON_LONG: return bson_iterator_long_raw( i ) != 0; case BSON_DOUBLE: return bson_iterator_double_raw( i ) != 0; case BSON_EOO: case BSON_NULL: return 0; default: return 1; } }
MONGO_EXPORT bson_bool_t bson_iterator_bool( const bson_iterator *i ) { check_mongo_object( (void*)i ); switch ( bson_iterator_type( i ) ) { case BSON_BOOL: return bson_iterator_bool_raw( i ); case BSON_INT: return bson_iterator_int_raw( i ) != 0; case BSON_LONG: return bson_iterator_long_raw( i ) != 0; case BSON_DOUBLE: return bson_iterator_double_raw( i ) != 0; case BSON_EOO: case BSON_NULL: return 0; default: return 1; } }