当前位置: 首页>>代码示例>>C++>>正文


C++ xmlStrEqual函数代码示例

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


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

示例1: endElement

void endElement ( void *data, const xmlChar *fullname ) {

// CHECK FOR TAGS

	if ( xmlStrEqual(fullname,forTag) == 1) {
		depth--;
		
		if ( DETAILS ) {
			std::cout << "----------------------------\n\nLoop " << loopCount << "\n\n";
			fLoop->printArrayRefs();
		}

		if ( depth == 0 ) {
			if ( fLoop->GCDTest() ) {
				if ( DETAILS ) {
					std::cout << "CANNOT be in parallel.\n\n";
				}
				exit(1);
			}
			else {
				if ( DETAILS ) {
					std::cout << "CAN be in parallel.\n\n";
				}
			}
		}

		delete fLoop;
		fLoop = new ForLoop;

	}

	else if ( xmlStrEqual(fullname,initTag) == 1 )		withinInit = false;
	else if ( xmlStrEqual(fullname,typeTag) == 1 )		withinType = false;
	else if ( xmlStrEqual(fullname,nameTag) == 1 )		withinName = false; // HAVE TO HAVE MORE BOOLEANS FOR THIS
	else if ( xmlStrEqual(fullname,exprTag) == 1 )		withinExpr = false;
	else if ( xmlStrEqual(fullname,exprStmtTag) == 1 )	withinExprStmt = false;
	else if ( xmlStrEqual(fullname,condTag) == 1 )		withinCond = false;
	else if ( xmlStrEqual(fullname,incrTag) == 1 )		{ withinIncr = false; withinBlock = true; }
	else if ( xmlStrEqual(fullname,indexTag) == 1 )		withinIndex = false;

}
开发者ID:davidsteinberg,项目名称:forallel,代码行数:41,代码来源:forallel.cpp

示例2: pa_xmlNamedPreorderTraversal

template<typename I> static void
pa_xmlNamedPreorderTraversal (
							  xmlNode *root, 
							  xmlChar *tagURI, 
							  xmlChar *tagName, 
							  void callback(xmlNode& node, I info),
							  I info) 
{
	for(xmlNode *iter=root->children; iter; iter = iter->next) {
		if(iter->type == XML_ELEMENT_NODE &&
			(xmlStrEqual(iter->name, tagName) ||
			xmlStrEqual(tagName, (const xmlChar*)"*"))) {
				if(tagURI != NULL &&
					(xmlStrEqual(pa_xmlGetNsURI(iter), tagURI) ||
					xmlStrEqual(tagURI, (const xmlChar*)"*")))
					callback(*iter, info);
				else if(tagURI == NULL)
					callback(*iter, info);
			}
			pa_xmlNamedPreorderTraversal(iter, tagURI, tagName, callback, info);
	}

	return;
}
开发者ID:viatsko,项目名称:parser3,代码行数:24,代码来源:xnode.C

示例3: gNode

gate* winFlowJoWorkspace::getGate(wsPopNode & node){


	xmlXPathObjectPtr resGate=node.xpathInNode("Gate/*");
	wsNode gNode(resGate->nodesetval->nodeTab[0]);
	xmlXPathFreeObject(resGate);
	const xmlChar * gateType=gNode.getNodePtr()->name;
	if(xmlStrEqual(gateType,(const xmlChar *)"PolygonGate"))
	{
		wsPolyGateNode pGNode(gNode.getNodePtr());
		if(g_loglevel>=GATE_LEVEL)
			COUT<<"parsing PolygonGate.."<<endl;
		return(getGate(pGNode));

	}
	else if(xmlStrEqual(gateType,(const xmlChar *)"RectangleGate"))
	{
		wsRectGateNode rGNode(gNode.getNodePtr());
		if(g_loglevel>=GATE_LEVEL)
			COUT<<"parsing RectangleGate.."<<endl;
		return(getGate(rGNode));
	}
	else if(xmlStrEqual(gateType,(const xmlChar *)"EllipsoidGate"))
	{
		wsEllipseGateNode eGNode(gNode.getNodePtr());
		if(g_loglevel>=GATE_LEVEL)
			COUT<<"parsing EllipsoidGate.."<<endl;
		return(getGate(eGNode));
	}
	else
	{
//		COUT<<"gate type: "<<gateType<<" is not supported!"<<endl;
		throw(domain_error("invalid  gate type!"));
	}

}
开发者ID:pontikos,项目名称:flowWorkspace,代码行数:36,代码来源:winFlowJoWorkspace.cpp

示例4: xsltTestCompMatchCount

static int
xsltTestCompMatchCount(xsltTransformContextPtr context,
                       xmlNodePtr node,
                       xsltCompMatchPtr countPat,
                       xmlNodePtr cur)
{
    if (countPat != NULL) {
        return xsltTestCompMatchList(context, node, countPat);
    }
    else {
        /*
         * 7.7 Numbering
         *
         * If count attribute is not specified, then it defaults to the
         * pattern that matches any node with the same node type as the
         * current node and, if the current node has an expanded-name, with
         * the same expanded-name as the current node.
         */
        if (node->type != cur->type)
            return 0;
        if (node->type == XML_NAMESPACE_DECL)
            /*
             * Namespace nodes have no preceding siblings and no parents
             * that are namespace nodes. This means that node == cur.
             */
            return 1;
        /* TODO: Skip node types without expanded names like text nodes. */
        if (!xmlStrEqual(node->name, cur->name))
            return 0;
        if (node->ns == cur->ns)
            return 1;
        if ((node->ns == NULL) || (cur->ns == NULL))
            return 0;
        return (xmlStrEqual(node->ns->href, cur->ns->href));
    }
}
开发者ID:amaneureka,项目名称:reactos,代码行数:36,代码来源:numbers.c

示例5: xmlStrQEqual

int
xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) {
    if (pref == NULL) return(xmlStrEqual(name, str));
    if (name == NULL) return(0);
    if (str == NULL) return(0);

    do {
        if (*pref++ != *str) return(0);
    } while ((*str++) && (*pref));
    if (*str++ != ':') return(0);
    do {
        if (*name++ != *str) return(0);
    } while (*str++);
    return(1);
}
开发者ID:Cyril2004,项目名称:proto-quic,代码行数:15,代码来源:xmlstring.c

示例6: getLogger

bool
Importer::parseLibraryCameras( const Asset& asset_parent,
                               xmlNodePtr lib_cameras_node )
{
    Logger log = getLogger( "Scene.XML.parseLibraryCameras" );
    if( !assertNode( lib_cameras_node, "library_cameras" ) ) {
        return false;
    }
    xmlNodePtr n = lib_cameras_node->children;
    if( n!=NULL && xmlStrEqual( n->name, BAD_CAST "asset" ) ) {
        Asset asset;
        if( parseAsset( asset, n ) ) {
            m_database.library<Camera>().setAsset( asset );
        }
        else {
            SCENELOG_ERROR( log, "Failed to parse <asset>" );
            return false;
        }
        n = n->next;
    }
    else {
        m_database.library<Camera>().setAsset( asset_parent );
    }

    while( n!= NULL && xmlStrEqual( n->name, BAD_CAST "camera" ) ) {
        if( !parseCamera( m_database.library<Camera>().asset(), n ) ) {
            SCENELOG_ERROR( log, "Failed to parse <camera>" );
            return false;
        }
        n = n->next;
    }
    ignoreExtraNodes( log, n );
    nagAboutRemainingNodes( log, n );
    return true;

}
开发者ID:sintefmath,项目名称:scene,代码行数:36,代码来源:LibraryCameras.cpp

示例7: xsltFindElemSpaceHandling

int
xsltFindElemSpaceHandling(xsltTransformContextPtr ctxt, xmlNodePtr node) {
    xsltStylesheetPtr style;
    const xmlChar *val;

    if ((ctxt == NULL) || (node == NULL))
	return(0);
    style = ctxt->style;
    while (style != NULL) {
	if (node->ns != NULL) {
	    val = (const xmlChar *)
	      xmlHashLookup2(style->stripSpaces, node->name, node->ns->href);
            if (val == NULL) {
                val = (const xmlChar *)
                    xmlHashLookup2(style->stripSpaces, BAD_CAST "*",
                                   node->ns->href);
            }
	} else {
	    val = (const xmlChar *)
		  xmlHashLookup2(style->stripSpaces, node->name, NULL);
	}
	if (val != NULL) {
	    if (xmlStrEqual(val, (xmlChar *) "strip"))
		return(1);
	    if (xmlStrEqual(val, (xmlChar *) "preserve"))
		return(0);
	}
	if (style->stripAll == 1)
	    return(1);
	if (style->stripAll == -1)
	    return(0);

	style = xsltNextImport(style);
    }
    return(0);
}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:36,代码来源:imports.c

示例8: XDR_A_maxOccurs

static xmlAttrPtr XDR_A_maxOccurs(xmlAttrPtr xdr_attr, xmlNodePtr node)
{
    xmlChar* str = get_attr_val(xdr_attr);
    xmlAttrPtr attr;

    TRACE("(%p, %p)\n", xdr_attr, node);

    if (xmlStrEqual(str, BAD_CAST "*"))
        attr = xmlSetProp(node, xs_maxOccurs, xs_unbounded);
    else
        attr = copy_prop_ignore_ns(xdr_attr, node);

    xmlFree(str);
    return attr;
}
开发者ID:AlexSteel,项目名称:wine,代码行数:15,代码来源:xdr.c

示例9: gtodo_client_category_edit

/* returns TRUE is successfull */
gboolean gtodo_client_category_edit(GTodoClient *cl, gchar *old, gchar *newn)
{
	if(cl == NULL || old == NULL || newn == NULL) return FALSE;
	if(gtodo_client_category_exists(cl, newn) && !gtodo_client_category_exists(cl, old)) return FALSE;
	else 
	{
		xmlNodePtr cur = cl->root->xmlChildrenNode;
		while(cur != NULL){
			if(xmlStrEqual(cur->name, (xmlChar *)"category")){
				xmlChar *temp = xmlGetProp(cur, (const xmlChar *)"title");
				if(xmlStrEqual(temp, (const xmlChar *)old))
				{
					xmlSetProp(cur, (xmlChar *)"title", (xmlChar *)newn);
					cur = NULL;
				}
				else cur = cur->next;
				xmlFree(temp);	
			}
			else cur = cur->next;
		}
	}
	gtodo_client_save_xml(cl,NULL);
	return TRUE;
}
开发者ID:abderrahim,项目名称:anjuta,代码行数:25,代码来源:libgtodo.c

示例10: get_dt_ns

static inline xmlNsPtr get_dt_ns(xmlNodePtr node)
{
    xmlNsPtr ns;

    node = get_schema(node);
    assert(node != NULL);

    FOREACH_NS(node, ns)
    {
        if (xmlStrEqual(ns->href, DT_href))
            break;
    }

    return ns;
}
开发者ID:AlexSteel,项目名称:wine,代码行数:15,代码来源:xdr.c

示例11: plugin_read_config

static void
plugin_read_config (Control *ctrl, xmlNodePtr node)
{
    xmlChar *value;
    gui *plugin = ctrl->data;

    for (node = node->children; node; node = node->next) {
        if (xmlStrEqual(node->name, (const xmlChar *)"Windowlist")) {
            if ((value = xmlGetProp(node, (const xmlChar *)"includeAll"))) {
                plugin->includeAll = atoi(value);
                g_free(value);
	    }
	    break;
	}
    }
}
开发者ID:BackupTheBerlios,项目名称:xfce-goodies-svn,代码行数:16,代码来源:windowlist.c

示例12: presence_core

/*
 * Public API
 */
Local::Heap::Heap (boost::shared_ptr<Ekiga::PresenceCore> _presence_core,
		   boost::shared_ptr<Local::Cluster> _local_cluster):
  presence_core(_presence_core), local_cluster(_local_cluster), doc ()
{
  xmlNodePtr root;
  contacts_settings = boost::shared_ptr<Ekiga::Settings> (new Ekiga::Settings (CONTACTS_SCHEMA));
  std::string raw = contacts_settings->get_string (ROSTER_KEY);

  // Build the XML document representing the contacts list from the configuration
  if (!raw.empty ()) {

    doc = boost::shared_ptr<xmlDoc> (xmlRecoverMemory (raw.c_str (), raw.length ()), xmlFreeDoc);
    if ( !doc)
      doc = boost::shared_ptr<xmlDoc> (xmlNewDoc (BAD_CAST "1.0"), xmlFreeDoc);

    root = xmlDocGetRootElement (doc.get ());
    if (root == NULL) {

      root = xmlNewDocNode (doc.get (), NULL, BAD_CAST "list", NULL);
      xmlDocSetRootElement (doc.get (), root);
    }

    for (xmlNodePtr child = root->children; child != NULL; child = child->next)
      if (child->type == XML_ELEMENT_NODE
	  && child->name != NULL
	  && xmlStrEqual (BAD_CAST ("entry"), child->name))
	add (child);

    // Or create a new XML document
  }
  else {

    doc = boost::shared_ptr<xmlDoc> (xmlNewDoc (BAD_CAST "1.0"), xmlFreeDoc);
    root = xmlNewDocNode (doc.get (), NULL, BAD_CAST "list", NULL);
    xmlDocSetRootElement (doc.get (), root);

    {
      // add 500, 501 and 520 at ekiga.net in this case!
      std::set<std::string> groups;

      groups.insert (_("Services"));
      add (_("Echo test"), "sip:[email protected]", groups);
      add (_("Conference room"), "sip:[email protected]", groups);
      add (_("Call back test"), "sip:[email protected]", groups);
    }
  }
}
开发者ID:UIKit0,项目名称:ekiga,代码行数:50,代码来源:local-heap.cpp

示例13: xmlHashAddEntry3

/**
 * xmlHashAddEntry3:
 * @table: the hash table
 * @name: the name of the userdata
 * @name2: a second name of the userdata
 * @name3: a third name of the userdata
 * @userdata: a pointer to the userdata
 *
 * Add the @userdata to the hash @table. This can later be retrieved
 * by using the tuple (@name, @name2, @name3). Duplicate entries generate
 * errors.
 *
 * Returns 0 the addition succeeded and -1 in case of error.
 */
int
xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name,
	         const xmlChar *name2, const xmlChar *name3,
		 void *userdata) {
    unsigned long key, len = 0;
    xmlHashEntryPtr entry;
    xmlHashEntryPtr insert;

    if ((table == NULL) || name == NULL)
	return(-1);

    /*
     * Check for duplicate and insertion location.
     */
    key = xmlHashComputeKey(table, name, name2, name3);
    if (table->table[key] == NULL) {
	insert = NULL;
    } else {
	for (insert = table->table[key]; insert->next != NULL;
	     insert = insert->next) {
	    if ((xmlStrEqual(insert->name, name)) &&
		(xmlStrEqual(insert->name2, name2)) &&
		(xmlStrEqual(insert->name3, name3)))
		return(-1);
	    len++;
	}
	if ((xmlStrEqual(insert->name, name)) &&
	    (xmlStrEqual(insert->name2, name2)) &&
	    (xmlStrEqual(insert->name3, name3)))
	    return(-1);
    }

    entry = xmlMalloc(sizeof(xmlHashEntry));
    if (entry == NULL)
	return(-1);
    entry->name = xmlStrdup(name);
    entry->name2 = xmlStrdup(name2);
    entry->name3 = xmlStrdup(name3);
    entry->payload = userdata;
    entry->next = NULL;


    if (insert == NULL) {
	table->table[key] = entry;
    } else {
	insert->next = entry;
    }
    table->nbElems++;

    if (len > MAX_HASH_LEN)
	xmlHashGrow(table, MAX_HASH_LEN * table->size);

    return(0);
}
开发者ID:gitpan,项目名称:AxKit-Needs,代码行数:68,代码来源:hash.c

示例14: get_element_text

/* Find an element among siblings, and get the (one) text element within it */
static xmlNodePtr get_element_text(xmlNodePtr node, const xmlChar *element)
{
	xmlNodePtr sib;

	for (sib = node; sib; sib = sib->next) {
		if (xmlStrEqual(sib->name, element)) {
			xmlNodePtr text;
			text = get_element(sib->children, TEXT_ELT);
			if (text == NULL) {
				fprintf(stderr, "unable to find text element for %s\n", (char *)element);
			} else {
				return text;
			}
		}
	}
	return NULL;
}
开发者ID:yeroca,项目名称:AudioTriggersPlus,代码行数:18,代码来源:main.c

示例15: core

/*
 * Public API
 */
Local::Heap::Heap (Ekiga::ServiceCore &_core): core (_core), doc ()
{
  xmlNodePtr root;
  gchar *c_raw = gm_conf_get_string (KEY);

  // Build the XML document representing the contacts list from the configuration
  if (c_raw != NULL) {

    const std::string raw = c_raw;
    doc = std::tr1::shared_ptr<xmlDoc> (xmlRecoverMemory (raw.c_str (), raw.length ()), xmlFreeDoc);
    if ( !doc)
      doc = std::tr1::shared_ptr<xmlDoc> (xmlNewDoc (BAD_CAST "1.0"), xmlFreeDoc);

    root = xmlDocGetRootElement (doc.get ());
    if (root == NULL) {

      root = xmlNewDocNode (doc.get (), NULL, BAD_CAST "list", NULL);
      xmlDocSetRootElement (doc.get (), root);
    }

    for (xmlNodePtr child = root->children; child != NULL; child = child->next)
      if (child->type == XML_ELEMENT_NODE
	  && child->name != NULL
	  && xmlStrEqual (BAD_CAST ("entry"), child->name))
	add (child);

    g_free (c_raw);

    // Or create a new XML document
  }
  else {

    doc = std::tr1::shared_ptr<xmlDoc> (xmlNewDoc (BAD_CAST "1.0"), xmlFreeDoc);
    root = xmlNewDocNode (doc.get (), NULL, BAD_CAST "list", NULL);
    xmlDocSetRootElement (doc.get (), root);

    {
      // add 500 and 501 at ekiga.net in this case!
      std::set<std::string> groups;

      groups.insert (_("Services"));
      add (_("Echo test"), "sip:[email protected]", groups);
      add (_("Conference room"), "sip:[email protected]", groups);
    }
  }
}
开发者ID:NeoWing,项目名称:ekiga-3.2.7,代码行数:49,代码来源:local-heap.cpp


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