这篇教程C++ writeNode函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中writeNode函数的典型用法代码示例。如果您正苦于以下问题:C++ writeNode函数的具体用法?C++ writeNode怎么用?C++ writeNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了writeNode函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: recDeleteint recDelete(rect *r, node *n, int pos){ int i,j; node *n1, *n2; if(n->leaf){ for(i = 0; i < n->size; ++i) if(n->values[i]->child == pos){ deleteValue(n, i); writeNode(n); return TRUE; } return FALSE; } for(i = 0; i < n->size; ++i) if(intersect(r, n->values[i]->r)){ n1 = readNode(n->values[i]->child); if(recDelete(r, n1, pos)){ n->values[i]->r = dupRect(n1->MBR); if(n1->size < b ) underflow(n, n1, i); else{ refreshMBR(n); writeNode(n); freeNode(n1); } return TRUE; } else freeNode(n1); } return FALSE;}
开发者ID:javierab,项目名称:T1Alg,代码行数:35,
示例2: writeConfigvoid JsonTextWriter::writeToStream( const Text & text, std::ostream & os ) { os << "{/n/tconfig: "; writeConfig( text.getConfig(), os ); os << ",/n/tcontent: '" << text.getContent() << "',/n/tnodes: [/n/t/t"; uint nodesCount = text.getNodes().size(); if ( nodesCount > 0 ) { writeNode( *text.getNodes().at( 0 ), os ); for ( uint i = 1; i < nodesCount; ++ i ) { os << ",/n/t/t"; writeNode( *text.getNodes().at( i ), os ); } } os << "/n/t],/n/tannotations: [/n/t/t"; for ( uint i = 0; i < nodesCount; ++ i ) { const Node & node = *text.getNodes().at( i ); for ( uint j = 0; j < node.getTransitionCount(); ++ j ) { if ( i != 0 || j != 0 ) os << ",/n/t/t"; writeAnnotation( *node.getTransition( j ), os ); } } os << "/n/t]/n}";}
开发者ID:alesapin,项目名称:lspl,代码行数:28,
示例3: writeNodevoid BSPFile::writeNode( ChunkOutputStream* out, const BSPNode* nodeIn ) { Debug::println( "bsp: Writing node of {0} polygons", nodeIn->polygons() ); out->beginChunk( "node" ); out->writeFloat( nodeIn->plane().x ); out->writeFloat( nodeIn->plane().y ); out->writeFloat( nodeIn->plane().z ); out->writeFloat( nodeIn->plane().w ); int childFlags = 0; if ( nodeIn->positive() ) childFlags |= 1; if ( nodeIn->negative() ) childFlags |= 2; out->writeInt( childFlags ); if ( nodeIn->positive() ) writeNode( out, nodeIn->positive() ); if ( nodeIn->negative() ) writeNode( out, nodeIn->negative() ); out->writeInt( nodeIn->polygons() ); for ( int i = 0; i < nodeIn->polygons(); ++i ) out->writeInt( m_tree->getPolygonIndex(&nodeIn->getPolygon(i)) ); out->endChunk();}
开发者ID:TheRyaz,项目名称:c_reading,代码行数:29,
示例4: readNodevoid Btree<T>::cutNode(T& x, unsigned xRST, unsigned ptr, unsigned pos, T& y, unsigned &yRST)//// Purpose: divides the node accessed by index ptr that contains// item x and index xRST at index pos. The new nodes are accessed// by pointers ptr and yRST. The median element is y.//// Parameters://// input: x - the inserted data// xRST - the inserted index associated with item x// ptr - the index to the manipulated node// pos - the index of the dividing line//// output:// y - the new median// yRST - the index to the other node.//{ unsigned median, i; Bstruct<T> *buf1, *buf2; buf1 = new Bstruct<T>; buf2 = new Bstruct<T>; readNode(buf1, ptr); // calculate the median element which also determines if // the new inserted item x is placed in the new left or the // new right nodes median = (pos <= BTREE_MIN) ? BTREE_MIN : BTREE_MIN + 1; // create a new tree node and put it on the right yRST = getNodeIndex(); for (i = 0; i <= BTREE_MAX; i++) buf2->nodeLink[i] = BTREE_NIL; numNodes++; // loop to move half of the keys for (i = median + 1; i <= BTREE_MAX; i++) { buf2->data[i - median] = buf1->data[i]; buf2->nodeLink[i - median] = buf1->nodeLink[i]; } buf2->count = BTREE_MAX - median; buf1->count = median; // push in the new data if (pos <= BTREE_MIN) pushIn(x, xRST, buf1, pos); else pushIn(x, xRST, buf2, pos - median); y = buf1->data[buf1->count]; buf2->nodeLink[0] = buf1->nodeLink[buf1->count--]; writeNode(buf1, ptr); writeNode(buf2, yRST); delete buf1; delete buf2;}
开发者ID:heavilessrose,项目名称:my-sync,代码行数:58,
示例5: writeElementstatic void writeElement(Serialization *serialization, DFNode *element, int depth){ const TagDecl *tagDecl = DFNameMapNameForTag(serialization->doc->map,element->tag); assert(tagDecl != NULL); const NamespaceDecl *nsDecl = DFNameMapNamespaceForID(serialization->doc->map,tagDecl->namespaceID); assert(nsDecl != NULL); const xmlChar *prefix = (const xmlChar *)nsDecl->prefix; const xmlChar *localName = (const xmlChar *)tagDecl->localName; if (serialization->indent && (element->parent != element->doc->docNode)) xmlTextWriterWriteRawLen(serialization->writer,INDENT,1+depth); if (serialization->html || (tagDecl->namespaceID == serialization->defaultNS)) xmlTextWriterStartElement(serialization->writer,localName); else xmlTextWriterStartElementNS(serialization->writer,prefix,localName,NULL); if ((element->parent == serialization->doc->docNode) && !serialization->html) writeNamespaceDeclarations(serialization,element); writeAttributes(serialization,element); // Check if all children are text nodes. If this is true; we should treat them as if they are a single text // node, and not do any indentation. int allChildrenText = 1; for (DFNode *child = element->first; child != NULL; child = child->next) { if (child->tag != DOM_TEXT) allChildrenText = 0; } if (allChildrenText) { int oldIndent = serialization->indent; serialization->indent = 0; for (DFNode *child = element->first; child != NULL; child = child->next) writeNode(serialization,child,depth+2); serialization->indent = oldIndent; } else { for (DFNode *child = element->first; child != NULL; child = child->next) writeNode(serialization,child,depth+2); } if (serialization->indent && (element->first != NULL) && !allChildrenText) { if ((element->first != element->last) || (element->first->tag != DOM_TEXT)) xmlTextWriterWriteRawLen(serialization->writer,INDENT,1+depth); } if (serialization->html && (element->first == NULL) && HTML_requiresCloseTag(element->tag)) { xmlTextWriterWriteString(serialization->writer,(xmlChar *)""); } xmlTextWriterEndElement(serialization->writer);}
开发者ID:apache,项目名称:incubator-corinthia,代码行数:55,
示例6: getNumChildrenvoid TOutline::writeNode(TNode *node, opstream &op) { uchar more = (node->next != 0) ? 1 : 0; uchar expand = (node->expanded) ? 1 : 0; op << more; op << expand; op << getNumChildren(node); op.writeString(node->text); if (node->childList != 0) writeNode(node->childList, op); if (node->next != 0) writeNode(node->next, op);}
开发者ID:OS2World,项目名称:SYSTEM-LOADER-QSINIT,代码行数:15,
示例7: writeNode void writeNode(Node& node, std::ostream& stream, const WriteParameters& params) { writeNode(*(node.get()), stream, params); }
开发者ID:dgault,项目名称:bioformats,代码行数:7,
示例8: writeNodeint writeNode(FILE *fpio, OctNode* node) { int istat; int istat_cum; int ix, iy, iz; float value; value = (float) node->value; istat = fwrite(&value, sizeof (float), 1, fpio); /* node value */ istat += fwrite(&(node->isLeaf), sizeof (char), 1, fpio); /* leaf flag, 1=leaf */ if (istat < 2) return (-1); if (node->isLeaf) return (1); istat_cum = 1; for (ix = 0; ix < 2; ix++) { for (iy = 0; iy < 2; iy++) { for (iz = 0; iz < 2; iz++) { if (node->child[ix][iy][iz] != NULL) { istat = writeNode(fpio, node->child[ix][iy][iz]); if (istat < 0) return (-1); istat_cum += istat; } } } } return (istat_cum);}
开发者ID:koukou73gr,项目名称:seiscomp3,代码行数:35,
示例9: writeTree3Dint writeTree3D(FILE *fpio, Tree3D* tree) { int istat; int istat_cum; int ix, iy, iz; istat = fwrite(&(tree->data_code), sizeof (int), 1, fpio); istat += fwrite(&(tree->numx), sizeof (int), 1, fpio); istat += fwrite(&(tree->numy), sizeof (int), 1, fpio); istat += fwrite(&(tree->numz), sizeof (int), 1, fpio); istat += fwrite(&(tree->orig), sizeof (Vect3D), 1, fpio); istat += fwrite(&(tree->ds), sizeof (Vect3D), 1, fpio); istat += fwrite(&(tree->integral), sizeof (double), 1, fpio); if (istat < 6) return (-1); istat_cum = 0; for (ix = 0; ix < tree->numx; ix++) { for (iy = 0; iy < tree->numy; iy++) { for (iz = 0; iz < tree->numz; iz++) { istat = writeNode(fpio, tree->nodeArray[ix][iy][iz]); if (istat < 0) return (-1); istat_cum += istat; } } } return (istat_cum);}
开发者ID:koukou73gr,项目名称:seiscomp3,代码行数:32,
示例10: writeDocument void writeDocument(Document& document, std::ostream& stream, const WriteParameters& params) { writeNode(*(document.get()), stream, params); }
开发者ID:dgault,项目名称:bioformats,代码行数:7,
示例11: DFSerializeXMLBuffervoid DFSerializeXMLBuffer(DFDocument *doc, NamespaceID defaultNS, int indent, DFBuffer *buf){ xmlOutputBufferPtr output = xmlOutputBufferCreateIO(StringBufferWrite, StringBufferClose, buf, NULL); xmlTextWriterPtr writer = xmlNewTextWriter(output); int html = 0; for (DFNode *child = doc->docNode->first; child != NULL; child = child->next) { if (child->tag == HTML_HTML) html = 1; } Serialization serialization; bzero(&serialization,sizeof(serialization)); serialization.ic = iconv_open("UTF-8","UTF-16LE"); if (serialization.ic == ((iconv_t)-1)) { fprintf(stderr,"FATAL: Can't open iconv descriptor/n"); abort(); } serialization.writer = writer; serialization.doc = doc; serialization.defaultNS = defaultNS; serialization.html = html; serialization.indent = indent; writeNode(&serialization,doc->docNode,0); iconv_close(serialization.ic); xmlFreeTextWriter(writer);}
开发者ID:flyonok,项目名称:DocFormats,代码行数:30,
示例12: writeNodevoid JsonWriter::writeEntry(JsonVector::const_iterator entry){ if (!entry->meta.empty()) out << prefix << " // " << entry->meta << "/n"; out << prefix; writeNode(*entry);}
开发者ID:argarak,项目名称:vcmi,代码行数:7,
示例13: _setAttributeNode// Attr setAttributeNode(in Attr newAttr) raises(DOMException);// Attr setAttributeNodeNS(in Attr newAttr) raises(DOMException);static void _setAttributeNode(Request& r, MethodParams& params) { VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlNode& element=get_self_element(vnode); xmlDoc& xmldoc=vxdoc.get_xmldoc(); xmlAttr& newAttr=as_attr(params, 0, "newAttr must be ATTRIBUTE node"); if(newAttr.doc!=&xmldoc) throw Exception("xml.dom", 0, "WRONG_DOCUMENT_ERR"); if(newAttr.parent) throw Exception("xml.dom", 0, "INUSE_ATTRIBUTE_ERR"); if(xmlNode* retNode=pa_getAttributeNodeNS(element, newAttr.name, pa_xmlGetNsURI((xmlNode*)&newAttr))) { // write out result writeNode(r, vxdoc, retNode); xmlUnlinkNode(retNode); } pa_addAttributeNode(element, newAttr);}
开发者ID:viatsko,项目名称:parser3,代码行数:28,
示例14: switchbool Writer::writeNode(Lattice *lattice, const Node *node, StringBuffer *os) const { switch (node->stat) { case MECAB_BOS_NODE: return writeNode(lattice, bos_format_.get(), node, os); case MECAB_EOS_NODE: return writeNode(lattice, eos_format_.get(), node, os); case MECAB_UNK_NODE: return writeNode(lattice, unk_format_.get(), node, os); case MECAB_NOR_NODE: return writeNode(lattice, node_format_.get(), node, os); case MECAB_EON_NODE: return writeNode(lattice, eon_format_.get(), node, os); } return true;}
开发者ID:SavantCat,项目名称:openjtalk-training,代码行数:16,
示例15: _replaceChild// Node replaceChild(in Node newChild,in Node oldChild) raises(DOMException);static void _replaceChild(Request& r, MethodParams& params) { xmlNode& newChild=as_node(params, 0, "newChild must be node"); xmlNode& oldChild=as_node(params, 1, "oldChild must be node"); VXnode& vnode=GET_SELF(r, VXnode); VXdoc& vxdoc=vnode.get_vxdoc(); xmlDoc& xmldoc=vxdoc.get_xmldoc(); xmlNode& selfNode=vnode.get_xmlnode(); if(newChild.doc!=&xmldoc) throw Exception("xml.dom", 0, "WRONG_DOCUMENT_ERR"); if(oldChild.doc!=&xmldoc) throw Exception("xml.dom", 0, "WRONG_DOCUMENT_ERR"); if(oldChild.parent!=&selfNode) throw Exception("xml.dom", 0, "NOT_FOUND_ERR"); xmlNode* refChild=oldChild.next; xmlUnlinkNode(&oldChild); xmlNode* retNode; if(refChild) retNode=xmlAddPrevSibling(refChild, &newChild); else retNode=xmlAddChild(&selfNode, &newChild); // write out result writeNode(r, vxdoc, retNode);}
开发者ID:viatsko,项目名称:parser3,代码行数:35,
示例16: _createDocumentFragment// DocumentFragment createDocumentFragment()static void _createDocumentFragment(Request& r, MethodParams&) { VXdoc& vdoc=GET_SELF(r, VXdoc); xmlDoc& xmldoc=vdoc.get_xmldoc(); xmlNode *node=xmlNewDocFragment(&xmldoc); writeNode(r, vdoc, node);}
开发者ID:viatsko,项目名称:parser3,代码行数:8,
示例17: writeGraphstatic void writeGraph( std::ostream &out, const Graph &G, const GraphAttributes *GA){ const std::string dir = (GA && !GA->directed()) ? "undirected" : "directed"; GraphIO::indent(out, 1) << "<graph " << "mode=/"static/" " << "defaultedgetype=/"" << dir << "/"" << ">/n"; if(GA) { defineAttributes(out, 2, *GA); } GraphIO::indent(out, 2) << "<nodes>/n"; for(node v : G.nodes) { writeNode(out, 3, GA, v); } GraphIO::indent(out, 2) << "</nodes>/n"; gexf::writeEdges(out, G, GA); GraphIO::indent(out, 1) << "</graph>/n";}
开发者ID:lncosie,项目名称:ogdf,代码行数:26,
示例18: writeObject virtual WriteResult writeObject(const osg::Object& obj,std::ostream& fout,const Options* options=NULL) const { const osg::Node* node = dynamic_cast<const osg::Node*>(&obj); if (node) return writeNode(*node, fout, options); else return WriteResult(WriteResult::FILE_NOT_HANDLED); }
开发者ID:joevandyk,项目名称:osg,代码行数:8,
示例19: _createComment// Comment createComment(in DOMString data)static void _createComment(Request& r, MethodParams& params) { xmlChar* data=as_xmlchar(r, params, 0, XML_DATA_MUST_BE_STRING); VXdoc& vdoc=GET_SELF(r, VXdoc); xmlNode *node=xmlNewComment(data); writeNode(r, vdoc, node);}
开发者ID:viatsko,项目名称:parser3,代码行数:9,
示例20: writeNode //------------------------------ bool SceneGraphWriter::writeNodes( const COLLADAFW::NodePointerArray& nodesToWriter ) { for ( size_t i = 0, count = nodesToWriter.getCount(); i < count; ++i) { writeNode(nodesToWriter[i]); } return true; }
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:9,
示例21: writeNode/* Write the LLS on the screen */void writeNode(typeList lis) { if (emptyList(lis)) printf("/n"); else { writeDataType(lis->data); writeNode(lis->next); }}
开发者ID:b3h3moth,项目名称:L-LP,代码行数:9,
示例22: underflowvoid underflow(node *n, node *n1, int i){ int j, sibling; node *n2; if(n->size == i + 1){ n2 = readNode(n->values[i-1]->child); sibling = i-1; } else{ n2 = readNode(n->values[i+1]->child); sibling = i+1; } if(n2->size > b){ n1->values[n1->size++] = n2->values[--(n2->size)]; refreshMBR(n1); refreshMBR(n2); freeRect(n->values[i]->r); n->values[i]->r = dupRect(n1->MBR); freeRect(n->values[sibling]->r); n->values[sibling]->r = dupRect(n2->MBR); refreshMBR(n); writeNode(n); writeNode(n1); freeNode(n1); writeNode(n2); freeNode(n2); } else{ n2 = merge(n1,n2); freeNodeVal(n->values[i]); n->values[i] = new(nodeVal); n->values[i]->child = n2->address; n->values[i]->r=dupRect(n2->MBR); deleteValue(n, sibling); writeNode(n); freeNode(n2); }}
开发者ID:javierab,项目名称:T1Alg,代码行数:46,
示例23: writeUserbool Writer::writeUser(Lattice *lattice, StringBuffer *os) const { if (!writeNode(lattice, bos_format_.get(), lattice->bos_node(), os)) { return false; } const Node *node = 0; for (node = lattice->bos_node()->next; node->next; node = node->next) { const char *fmt = (node->stat == MECAB_UNK_NODE ? unk_format_.get() : node_format_.get()); if (!writeNode(lattice, fmt, node, os)) { return false; } } if (!writeNode(lattice, eos_format_.get(), node, os)) { return false; } return true;}
开发者ID:SavantCat,项目名称:openjtalk-training,代码行数:17,
示例24: writeNode virtual WriteResult writeNode( const osg::Node& node, const std::string& file, const Options* options ) const { std::string ext = osgDB::getLowerCaseFileExtension(file); if ( ext=="assimp" ) return writeNode(node, osgDB::getNameLessExtension(file), options); // TODO return WriteResult::FILE_NOT_HANDLED; }
开发者ID:512400330,项目名称:osgRecipes,代码行数:8,
示例25: ostrvoid DOMWriter::writeNode(const std::string& systemId, const Node* pNode){ Poco::FileOutputStream ostr(systemId); if (ostr.good()) writeNode(ostr, pNode); else throw Poco::CreateFileException(systemId);}
开发者ID:Victorcasas,项目名称:georest,代码行数:8,
注:本文中的writeNode函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ writePacket函数代码示例 C++ writeMessage函数代码示例 |