本文整理汇总了C++中RETURN_NCTOR函数的典型用法代码示例。如果您正苦于以下问题:C++ RETURN_NCTOR函数的具体用法?C++ RETURN_NCTOR怎么用?C++ RETURN_NCTOR使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RETURN_NCTOR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Check if HTTP method match any of the passed methods
*
* @param string|array $methods
* @return boolean
*/
PHP_METHOD(Phalcon_Http_Request, isMethod) {
zval *methods, *http_method, *is_equals = NULL, *method = NULL;
HashTable *ah0;
HashPosition hp0;
zval **hd;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &methods) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_INIT_VAR(http_method);
PHALCON_CALL_METHOD(http_method, this_ptr, "getmethod", PH_NO_CHECK);
if (Z_TYPE_P(methods) == IS_STRING) {
PHALCON_INIT_VAR(is_equals);
is_equal_function(is_equals, methods, http_method TSRMLS_CC);
RETURN_NCTOR(is_equals);
} else {
if (!phalcon_valid_foreach(methods TSRMLS_CC)) {
return;
}
ah0 = Z_ARRVAL_P(methods);
zend_hash_internal_pointer_reset_ex(ah0, &hp0);
ph_cycle_start_0:
if (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) != SUCCESS) {
goto ph_cycle_end_0;
}
PHALCON_GET_FOREACH_VALUE(method);
PHALCON_INIT_NVAR(is_equals);
is_equal_function(is_equals, method, http_method TSRMLS_CC);
if (PHALCON_IS_TRUE(is_equals)) {
PHALCON_MM_RESTORE();
RETURN_TRUE;
}
zend_hash_move_forward_ex(ah0, &hp0);
goto ph_cycle_start_0;
ph_cycle_end_0:
if(0) {}
}
PHALCON_MM_RESTORE();
RETURN_FALSE;
}
示例2: PHP_METHOD
/**
* Returns the number of elements in the form
*
* @return int
*/
PHP_METHOD(Phalcon_Forms_Form, count){
zval *elements, *number;
PHALCON_MM_GROW();
PHALCON_OBS_VAR(elements);
phalcon_read_property(&elements, this_ptr, SL("_elements"), PH_NOISY_CC);
PHALCON_INIT_VAR(number);
phalcon_fast_count(number, elements TSRMLS_CC);
RETURN_NCTOR(number);
}
示例3: PHP_METHOD
/**
* Returns the number of arguments that the annotation has
*
* @return int
*/
PHP_METHOD(Phalcon_Annotations_Annotation, numberArguments){
zval *arguments, *number;
PHALCON_MM_GROW();
PHALCON_OBS_VAR(arguments);
phalcon_read_property(&arguments, this_ptr, SL("_arguments"), PH_NOISY_CC);
PHALCON_INIT_VAR(number);
phalcon_fast_count(number, arguments TSRMLS_CC);
RETURN_NCTOR(number);
}
示例4: PHP_METHOD
/**
* Returns the number of messages in the list
*
* @return int
*/
PHP_METHOD(Phalcon_Validation_Message_Group, count){
zval *messages, *number;
PHALCON_MM_GROW();
PHALCON_OBS_VAR(messages);
phalcon_read_property(&messages, this_ptr, SL("_messages"), PH_NOISY_CC);
PHALCON_INIT_VAR(number);
phalcon_fast_count(number, messages TSRMLS_CC);
RETURN_NCTOR(number);
}
示例5: PHP_METHOD
/**
* Checks whether transaction is managed by a transaction manager
*
* @return boolean
*/
PHP_METHOD(Phalcon_Mvc_Model_Transaction, isManaged){
zval *manager = NULL;
zval *r0 = NULL;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(manager);
phalcon_read_property(&manager, this_ptr, SL("_manager"), PH_NOISY_CC);
PHALCON_ALLOC_ZVAL_MM(r0);
boolean_not_function(r0, manager TSRMLS_CC);
RETURN_NCTOR(r0);
}
示例6: PHP_METHOD
/**
* Checks whether offset exists in the resultset
*
* @param int $index
* @return boolean
*/
PHP_METHOD(Phalcon_Mvc_Model_Resultset, offsetExists){
zval *index, *count, *exists;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 0, &index);
PHALCON_INIT_VAR(count);
phalcon_call_method(count, this_ptr, "count");
PHALCON_INIT_VAR(exists);
is_smaller_function(exists, index, count TSRMLS_CC);
RETURN_NCTOR(exists);
}
示例7: PHP_METHOD
/**
* Check if a default descriptor has already defined
*
* @return boolean
*/
PHP_METHOD(Phalcon_Db_Pool, hasDefaultDescriptor){
zval *t0 = NULL, *t1 = NULL;
zval *r0 = NULL;
PHALCON_MM_GROW();
PHALCON_OBSERVE_VAR(t0);
phalcon_read_static_property(&t0, SL("Phalcon_Db_Pool"), SL("_defaultDescriptor") TSRMLS_CC);
PHALCON_INIT_VAR(t1);
ZVAL_NULL(t1);
PHALCON_INIT_VAR(r0);
is_not_identical_function(r0, t1, t0 TSRMLS_CC);
RETURN_NCTOR(r0);
}
示例8: PHP_METHOD
/**
* Checks whether HTTP method is PUT. if $_SERVER['REQUEST_METHOD']=='PUT'
*
* @return boolean
*/
PHP_METHOD(Phalcon_Http_Request, isPut){
zval *put, *method, *is_put;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(put);
ZVAL_STRING(put, "PUT", 1);
PHALCON_INIT_VAR(method);
PHALCON_CALL_METHOD(method, this_ptr, "getmethod");
PHALCON_INIT_VAR(is_put);
is_equal_function(is_put, method, put TSRMLS_CC);
RETURN_NCTOR(is_put);
}
示例9: PHP_METHOD
/**
*
* Checks whether HTTP method is GET. if $_SERVER['REQUEST_METHOD']=='GET'
*
* @return boolean
*/
PHP_METHOD(Phalcon_Http_Request, isGet){
zval *get, *method, *is_get;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(get);
ZVAL_STRING(get, "GET", 1);
PHALCON_INIT_VAR(method);
phalcon_call_method(method, this_ptr, "getmethod");
PHALCON_INIT_VAR(is_get);
is_equal_function(is_get, method, get TSRMLS_CC);
RETURN_NCTOR(is_get);
}
示例10: PHP_METHOD
/**
* Check if the component is currently caching the output content
*
* @return boolean
*/
PHP_METHOD(Phalcon_Mvc_View, isCaching){
zval *zero, *cache_level, *is_caching;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(zero);
ZVAL_LONG(zero, 0);
PHALCON_OBS_VAR(cache_level);
phalcon_read_property_this(&cache_level, this_ptr, SL("_cacheLevel"), PH_NOISY_CC);
PHALCON_INIT_VAR(is_caching);
is_smaller_function(is_caching, zero, cache_level TSRMLS_CC);
RETURN_NCTOR(is_caching);
}
示例11: PHP_METHOD
/**
* Check whether the DI contains a service by a name
*
* @param string $name
* @return boolean
*/
PHP_METHOD(Phalcon_DI, has){
zval *name, *services, *is_set_service = NULL;
zval *r0 = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 0, &name);
PHALCON_OBS_VAR(services);
phalcon_read_property_this(&services, this_ptr, SL("_services"), PH_NOISY_CC);
PHALCON_INIT_VAR(r0);
ZVAL_BOOL(r0, phalcon_array_isset(services, name));
PHALCON_CPY_WRT(is_set_service, r0);
RETURN_NCTOR(is_set_service);
}
示例12: PHP_METHOD
/**
* Checks if the internal meta-data container is empty
*
* @return boolean
*/
PHP_METHOD(Phalcon_Model_MetaData, isEmpty){
zval *t0 = NULL, *t1 = NULL;
zval *r0 = NULL, *r1 = NULL;
PHALCON_MM_GROW();
PHALCON_ALLOC_ZVAL_MM(t0);
phalcon_read_property(&t0, this_ptr, SL("_metaData"), PHALCON_NOISY TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(r0);
phalcon_fast_count(r0, t0 TSRMLS_CC);
PHALCON_INIT_VAR(t1);
ZVAL_LONG(t1, 0);
PHALCON_ALLOC_ZVAL_MM(r1);
is_equal_function(r1, r0, t1 TSRMLS_CC);
RETURN_NCTOR(r1);
}
示例13: PHP_METHOD
/**
* Tell if the resultset if fresh or an old cached
*
* @return boolean
*/
PHP_METHOD(Phalcon_Mvc_Model_Resultset, isFresh){
zval *type = NULL, *is_fresh = NULL;
zval *t0 = NULL;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(type);
phalcon_read_property(&type, this_ptr, SL("_type"), PH_NOISY_CC);
PHALCON_INIT_VAR(t0);
ZVAL_LONG(t0, 1);
PHALCON_INIT_VAR(is_fresh);
is_equal_function(is_fresh, type, t0 TSRMLS_CC);
RETURN_NCTOR(is_fresh);
}
示例14: PHP_METHOD
/**
* Check whether a option has been defined in the validator options
*
* @param string $option
* @return boolean
*/
PHP_METHOD(Phalcon_Mvc_Model_Validator, isSetOption){
zval *option, *options, *is_set = NULL;
zval *r0 = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 0, &option);
PHALCON_OBS_VAR(options);
phalcon_read_property_this(&options, this_ptr, SL("_options"), PH_NOISY_CC);
PHALCON_INIT_VAR(r0);
ZVAL_BOOL(r0, phalcon_array_isset(options, option));
PHALCON_CPY_WRT(is_set, r0);
RETURN_NCTOR(is_set);
}
示例15: PHP_METHOD
/**
* Check whether is defined a translation key in the internal array
*
* @param string $index
* @return bool
*/
PHP_METHOD(Phalcon_Translate_Adapter_NativeArray, exists){
zval *index, *translate, *exists = NULL;
zval *r0 = NULL;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 0, &index);
PHALCON_OBS_VAR(translate);
phalcon_read_property_this(&translate, this_ptr, SL("_translate"), PH_NOISY_CC);
PHALCON_INIT_VAR(r0);
ZVAL_BOOL(r0, phalcon_array_isset(translate, index));
PHALCON_CPY_WRT(exists, r0);
RETURN_NCTOR(exists);
}