MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlXPathCastToBoolean

Function xmlXPathCastToBoolean

ThirdParty/libxml2/vtklibxml2/xpath.c:5023–5057  ·  view source on GitHub ↗

* xmlXPathCastToBoolean: * @val: an XPath object * * Converts an XPath object to its boolean value * * Returns the boolean value */

Source from the content-addressed store, hash-verified

5021 * Returns the boolean value
5022 */
5023int
5024xmlXPathCastToBoolean (xmlXPathObjectPtr val) {
5025 int ret = 0;
5026
5027 if (val == NULL)
5028 return(0);
5029 switch (val->type) {
5030 case XPATH_UNDEFINED:
5031 ret = 0;
5032 break;
5033 case XPATH_NODESET:
5034 case XPATH_XSLT_TREE:
5035 ret = xmlXPathCastNodeSetToBoolean(val->nodesetval);
5036 break;
5037 case XPATH_STRING:
5038 ret = xmlXPathCastStringToBoolean(val->stringval);
5039 break;
5040 case XPATH_NUMBER:
5041 ret = xmlXPathCastNumberToBoolean(val->floatval);
5042 break;
5043 case XPATH_BOOLEAN:
5044 ret = val->boolval;
5045 break;
5046 case XPATH_USERS:
5047#ifdef LIBXML_XPTR_LOCS_ENABLED
5048 case XPATH_POINT:
5049 case XPATH_RANGE:
5050 case XPATH_LOCATIONSET:
5051#endif /* LIBXML_XPTR_LOCS_ENABLED */
5052 /* TODO */
5053 ret = 0;
5054 break;
5055 }
5056 return(ret);
5057}
5058
5059
5060/**

Callers 4

xmlXPathPopBooleanFunction · 0.85
xmlXPathConvertBooleanFunction · 0.85
xmlXPathBooleanFunctionFunction · 0.85

Calls 3

Tested by

no test coverage detected