• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PHP_MAPSCRIPT_ERROR_HANDLING函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PHP_MAPSCRIPT_ERROR_HANDLING函数的典型用法代码示例。如果您正苦于以下问题:C++ PHP_MAPSCRIPT_ERROR_HANDLING函数的具体用法?C++ PHP_MAPSCRIPT_ERROR_HANDLING怎么用?C++ PHP_MAPSCRIPT_ERROR_HANDLING使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PHP_MAPSCRIPT_ERROR_HANDLING函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: PHP_METHOD

/* {{{ proto int label.removebinding(const bindingid)
   Remove attribute binding for a specfiled label property. Returns MS_SUCCESS on success. */
PHP_METHOD(labelObj, removeBinding)
{
  zval *zobj = getThis();
  long bindingId;
  php_label_object *php_label;

  PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
                            &bindingId) == FAILURE) {
    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
    return;
  }
  PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);

  php_label = MAPSCRIPT_OBJ_P(php_label_object, zobj);

  if (bindingId < 0 || bindingId > MS_LABEL_BINDING_LENGTH) {
    mapscript_throw_exception("Invalid binding id." TSRMLS_CC);
    return;
  }


  if(php_label->label->bindings[bindingId].item) {
    msFree(php_label->label->bindings[bindingId].item);
    php_label->label->bindings[bindingId].item =  NULL;
    php_label->label->bindings[bindingId].index = -1;
    php_label->label->numbindings--;
  }

  RETURN_LONG(MS_SUCCESS);

}
开发者ID:dmorissette,项目名称:mapserver,代码行数:34,代码来源:label.c


示例2: PHP_METHOD

/* {{{ proto shapefile __construct(string filename, int type)
   Create a new shapeFileObj instance. */
PHP_METHOD(shapeFileObj, __construct)
{
  zval *zobj = getThis();
  php_shapefile_object *php_shapefile;
  char *filename;
  long filename_len = 0;
  long type;

  PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl",
                            &filename, &filename_len, &type) == FAILURE) {
    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
    return;
  }
  PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);

  php_shapefile = (php_shapefile_object *)zend_object_store_get_object(zobj TSRMLS_CC);

  php_shapefile->shapefile = shapefileObj_new(filename, type);

  if (php_shapefile->shapefile == NULL) {
    mapscript_throw_mapserver_exception("Failed to open shapefile %s" TSRMLS_CC, filename);
    return;
  }
}
开发者ID:BentleySystems,项目名称:mapserver,代码行数:27,代码来源:shapefile.c


示例3: PHP_METHOD

PHP_METHOD(referenceMapObj, __get)
{
    char *property;
    long property_len = 0;
    zval *zobj = getThis();
    php_referencemap_object *php_referencemap;

    PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
                              &property, &property_len) == FAILURE) {
        PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
        return;
    }
    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);

    php_referencemap = (php_referencemap_object *) zend_object_store_get_object(zobj TSRMLS_CC);

    IF_GET_STRING("image", php_referencemap->referencemap->image)
    else IF_GET_LONG("width", php_referencemap->referencemap->width)
        else IF_GET_LONG("height", php_referencemap->referencemap->height)
            else IF_GET_LONG("status", php_referencemap->referencemap->status)
                else IF_GET_LONG("marker", php_referencemap->referencemap->marker)
                    else IF_GET_STRING("markername", php_referencemap->referencemap->markername)
                        else IF_GET_LONG("markersize", php_referencemap->referencemap->markersize)
                            else IF_GET_LONG("maxboxsize", php_referencemap->referencemap->maxboxsize)
                                else IF_GET_LONG("minboxsize", php_referencemap->referencemap->minboxsize)
                                    else IF_GET_OBJECT("extent", mapscript_ce_rect, php_referencemap->extent, &php_referencemap->referencemap->extent)
                                        else IF_GET_OBJECT("color", mapscript_ce_color, php_referencemap->color, &php_referencemap->referencemap->color)
                                            else IF_GET_OBJECT("outlinecolor", mapscript_ce_color, php_referencemap->outlinecolor, &php_referencemap->referencemap->outlinecolor)
                                                else {
                                                    mapscript_throw_exception("Property '%s' does not exist in this object." TSRMLS_CC, property);
                                                }
}
开发者ID:RodrigoVazquez,项目名称:mapserver,代码行数:33,代码来源:referencemap.c


示例4: PHP_METHOD

/* {{{ proto int shape.contains(shapeobj shape)
   Return true or false if the given shape in argument 1 is contained
   in the shape. Use3d underlying msGEOSContains GEOS library*/
PHP_METHOD(shapeObj, containsShape)
{
    zval *zobj =  getThis();
    zval *zshape;
    php_shape_object *php_shape, *php_shape2;

    PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O",
                              &zshape, mapscript_ce_shape) == FAILURE) {
        PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
        return;
    }
    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);

    php_shape = (php_shape_object *) zend_object_store_get_object(zobj TSRMLS_CC);
    php_shape2 = (php_shape_object *) zend_object_store_get_object(zshape TSRMLS_CC);

    if (shapeObj_contains_geos(php_shape->shape, php_shape2->shape))
    {
      RETURN_TRUE;
    }
    else
      RETURN_FALSE; 

}
开发者ID:bradh,项目名称:mapserver,代码行数:28,代码来源:shape.c


示例5: PHP_METHOD

/* {{{ proto int hashtable.remove(string key)
   Remove one item from hash table. Returns MS_FAILURE on error. */
PHP_METHOD(hashtableObj, remove)
{
  char *key;
  long key_len = 0;
  zval *zobj = getThis();
  int status = MS_FAILURE;
  php_hashtable_object *php_hashtable;

  PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
                            &key, &key_len) == FAILURE) {
    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
    return;
  }
  PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);

  php_hashtable = MAPSCRIPT_OBJ_P(php_hashtable_object, zobj);

  if ((status = hashTableObj_remove(php_hashtable->hashtable, key)) != MS_SUCCESS) {
    mapscript_throw_mapserver_exception("" TSRMLS_CC);
    return;
  }

  RETURN_LONG(status);
}
开发者ID:dmorissette,项目名称:mapserver,代码行数:27,代码来源:hashtable.c


示例6: PHP_METHOD

/* {{{ proto int hashtable.get(string key)
   Get a value from item by its key. Returns empty string if not found. */
PHP_METHOD(hashtableObj, get)
{
  char *key;
  long key_len = 0;
  zval *zobj = getThis();
  const char *value = NULL;
  php_hashtable_object *php_hashtable;

  PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
                            &key, &key_len) == FAILURE) {
    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
    return;
  }
  PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);

  php_hashtable = (php_hashtable_object *) zend_object_store_get_object(zobj TSRMLS_CC);

  value = hashTableObj_get(php_hashtable->hashtable, key);
  if (value == NULL) {
    RETURN_STRING("",1);
  }

  RETURN_STRING((char *)value, 1);
}
开发者ID:AdRiley,项目名称:mapserver,代码行数:27,代码来源:hashtable.c


示例7: line

/* {{{ proto int shape.line(int i)
   Returns line (part) number i.  First line is number 0. */
PHP_METHOD(shapeObj, line)
{
    zval *zobj =  getThis();
    long index;
    php_shape_object *php_shape;
    parent_object parent;

    PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l",
                              &index) == FAILURE) {
        PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
        return;
    }
    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);

    php_shape = (php_shape_object *) zend_object_store_get_object(zobj TSRMLS_CC);

    
    if (index < 0 || index >= php_shape->shape->numlines)
    {
        mapscript_throw_exception("Line '%d' does not exist in this object." TSRMLS_CC, index);
        return;
    }
    
    MAPSCRIPT_MAKE_PARENT(zobj, NULL);
    mapscript_create_line(&(php_shape->shape->line[index]), parent, return_value TSRMLS_CC);
}
开发者ID:bradh,项目名称:mapserver,代码行数:29,代码来源:shape.c


示例8: PHP_METHOD

/* {{{ proto int line.addXYZ(double x, double y, double z, double m)
   4th argument m is used for Measured shape files. It is not mandatory.
   Adds a point to the end of a line */
PHP_METHOD(lineObj, addXYZ)
{
  zval *zobj = getThis();
  pointObj point;
  double x, y, z, m = 0;
  int status = MS_FAILURE;
  php_line_object *php_line;

  PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd|d",
                            &x, &y, &z, &m) == FAILURE) {
    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
    return;
  }
  PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);

  php_line = (php_line_object *) zend_object_store_get_object(zobj TSRMLS_CC);

  point.x = x;
  point.y = y;

#ifdef USE_LINE_Z_M
  point.z = z;
  point.m = m;
#endif

  status = lineObj_add(php_line->line, &point);

  RETURN_LONG(status);
}
开发者ID:AdRiley,项目名称:mapserver,代码行数:33,代码来源:line.c


示例9: PHP_METHOD

/* {{{ proto int scalebar.setImageColor(int red, int green, int blue)
   Set the imagecolor property of the scalebar. Returns -1 on error. */
PHP_METHOD(scalebarObj, setImageColor)
{
  zval *zobj = getThis();
  long red, green, blue;
  php_scalebar_object *php_scalebar;

  PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
  if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll",
                            &red, &green, &blue) == FAILURE) {
    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
    return;
  }
  PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);

  php_scalebar = (php_scalebar_object *) zend_object_store_get_object(zobj TSRMLS_CC);

  if (red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255)
    RETURN_LONG(MS_FAILURE);

  php_scalebar->scalebar->imagecolor.red = red;
  php_scalebar->scalebar->imagecolor.green = green;
  php_scalebar->scalebar->imagecolor.blue = blue;

  RETURN_LONG(MS_SUCCESS);
}
开发者ID:AsgerPetersen,项目名称:mapserver,代码行数:27,代码来源:scalebar.c



注:本文中的PHP_MAPSCRIPT_ERROR_HANDLING函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PHP_ME函数代码示例发布时间:2022-05-30
下一篇:
C++ PHP_GINIT函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap