这篇教程C++ writeAttribute函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中writeAttribute函数的典型用法代码示例。如果您正苦于以下问题:C++ writeAttribute函数的具体用法?C++ writeAttribute怎么用?C++ writeAttribute使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了writeAttribute函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: writeAttributevoid GwfStreamWriter::writeObjectAttributes(SCgObject *obj){ writeAttribute("type", mTypeAlias2GWFType[obj->typeAlias()]); writeAttribute("idtf", obj->idtfValue()); writeAttribute("shapeColor", QString::number(obj->color().value())); writeAttribute("id", QString::number( obj->id() )); writeAttribute("parent", QString::number( obj->parentId() )); writeText(obj);}
开发者ID:SadTigger,项目名称:kbe,代码行数:9,
示例2: writeStartElementvoid GwfStreamWriter::writePoints(const QVector<QPointF>& points){ writeStartElement("points"); foreach(const QPointF& point,points) { writeStartElement("point"); writeAttribute("x", QString::number(point.x())); writeAttribute("y", QString::number(point.y())); writeEndElement(); }
开发者ID:SadTigger,项目名称:kbe,代码行数:11,
示例3: attributebool wb_session::castAttribute(pwr_sAttrRef* arp, pwr_tCid cid){ wb_attribute a = attribute(arp); if (!a) return a.sts(); if (!(a.flags() & PWR_MASK_CASTATTR)) { m_sts = 0; return false; } wb_cdef c = cdef(cid); // if ( c.size( pwr_eBix_rt) != a.size()) { // m_sts = 0; // return false; //} // pwr_tTid tid = a.tid(); pwr_tCastId castid; if (cid == a.originalTid()) castid = pwr_cNClassId; else castid = cid; pwr_sAttrRef cast_aref = cdh_ArefToCastAref(arp); wb_attribute cast_a = attribute(&cast_aref); if (!cast_a) return cast_a.sts(); try { writeAttribute(cast_a, &castid); } catch (wb_error& e) { m_sts = e.sts(); return false; } void* body = calloc(1, c.size(pwr_eBix_rt)); c.attrTemplateBody(&m_sts, pwr_eBix_rt, body, a); try { writeAttribute(a, body); } catch (wb_error& e) { m_sts = e.sts(); return false; } return true;}
开发者ID:siamect,项目名称:proview,代码行数:49,
示例4: time_GetTimebool wb_session::commit(){ if (!m_vrep->erep()->check_lock((char*)m_vrep->name(), m_vrep->dbtype())) { m_sts = LDH__LOCKSTOLEN; return false; } // Store time in volume object pwr_tOid oid = pwr_cNOid; pwr_tTime time; time_GetTime(&time); oid.vid = m_vrep->vid(); wb_orep* orep = m_vrep->object(&m_sts, oid); if (oddSts()) { orep->ref(); wb_attribute modtime(m_sts, orep, "SysBody", "Modified"); if (modtime.oddSts()) writeAttribute(modtime, &time); orep->unref(); } return m_srep->commit(&m_sts);}
开发者ID:siamect,项目名称:proview,代码行数:25,
示例5: IRR_ASSERT //! Writes an xml element with any number of attributes void CXMLWriter::writeElement(const c8* name, bool empty, core::array<core::stringc> &names, core::array<core::stringc> &values) { IRR_ASSERT(sizeof(name) > 0); if (Tabs > 0) { for (int i = 0; i < Tabs; ++i) File->write("/t", sizeof(c8)); } // write name File->write("<", sizeof(c8)); File->write(name, strlen(name) * sizeof(c8)); // write attributes u32 i = 0; for (; i < names.size() && i < values.size(); ++i) writeAttribute(names[i].cStr(), values[i].cStr()); // write closing tag if (empty) File->write(" />", 3 * sizeof(c8)); else { File->write(">", sizeof(c8)); ++Tabs; } TextWrittenLast = false; }
开发者ID:CowPlay,项目名称:engineSDK,代码行数:33,
示例6: foreachvoid BookmarkFactory::serialize(Payload *extension, QXmlStreamWriter *writer){ Bookmark *bookmark = se_cast<Bookmark*>(extension); writer->writeStartElement(QLatin1String("storage")); writer->writeDefaultNamespace(NS_BOOKMARKS); foreach (const Bookmark::Conference &conf, bookmark->conferences()) { writer->writeStartElement(QLatin1String("conference")); writeAttribute(writer,QLatin1String("jid"), conf.jid().full()); writeAttribute(writer,QLatin1String("name"), conf.name()); writeAttribute(writer,QLatin1String("autojoin"), enumToStr(conf.autojoin(), autojoin_types)); writeTextElement(writer,QLatin1String("nick"), conf.nick()); writeTextElement(writer,QLatin1String("password"), conf.password()); writer->writeEndElement(); } writer->writeEndElement();}
开发者ID:NeutronStein,项目名称:jreen,代码行数:16,
示例7: writeDomQDomElement MusicAbstractXml::writeDomElement(QDomElement &element, const QString &node, const QString &key, const QVariant &value){ QDomElement domElement = writeDom(element, node); writeAttribute(domElement, key, value); return domElement;}
开发者ID:DchunWang,项目名称:TTKMusicplayer,代码行数:7,
示例8: addDevToGrpDialog/* * Run the Add Device to Group dialog */void addDevToGrpDialog(CDKSCREEN *main_cdk_screen) { char device_name[MAX_SYSFS_ATTR_SIZE] = {0}, dev_handler[MAX_SYSFS_ATTR_SIZE] = {0}, dev_grp_name[MAX_SYSFS_ATTR_SIZE] = {0}, attr_path[MAX_SYSFS_PATH_SIZE] = {0}, attr_value[MAX_SYSFS_ATTR_SIZE] = {0}; char *error_msg = NULL; int temp_int = 0; /* Have the user choose a SCST device */ getSCSTDevChoice(main_cdk_screen, device_name, dev_handler); if (device_name[0] == '/0') return; /* Have the user choose a SCST device group (to add the device to) */ getSCSTDevGrpChoice(main_cdk_screen, dev_grp_name); if (dev_grp_name[0] == '/0') return; /* Add the SCST device to the device group (ALUA) */ snprintf(attr_path, MAX_SYSFS_PATH_SIZE, "%s/device_groups/%s/devices/mgmt", SYSFS_SCST_TGT, dev_grp_name); snprintf(attr_value, MAX_SYSFS_ATTR_SIZE, "add %s", device_name); if ((temp_int = writeAttribute(attr_path, attr_value)) != 0) { SAFE_ASPRINTF(&error_msg, "Couldn't add SCST (ALUA) device to device group: %s", strerror(temp_int)); errorDialog(main_cdk_screen, error_msg, NULL); FREE_NULL(error_msg); } /* Done */ return;}
开发者ID:byteworks-ch,项目名称:esos,代码行数:38,
示例9: remDevGrpDialog/* * Run the Remove Device Group dialog */void remDevGrpDialog(CDKSCREEN *main_cdk_screen) { char dev_grp_name[MAX_SYSFS_ATTR_SIZE] = {0}, attr_path[MAX_SYSFS_PATH_SIZE] = {0}, attr_value[MAX_SYSFS_ATTR_SIZE] = {0}; char *error_msg = NULL, *confirm_msg = NULL; boolean confirm = FALSE; int temp_int = 0; /* Have the user choose a SCST device group */ getSCSTDevGrpChoice(main_cdk_screen, dev_grp_name); if (dev_grp_name[0] == '/0') return; /* Get a final confirmation from user before we delete */ SAFE_ASPRINTF(&confirm_msg, "Are you sure you want to delete SCST device group '%s?'", dev_grp_name); confirm = confirmDialog(main_cdk_screen, confirm_msg, NULL); FREE_NULL(confirm_msg); if (confirm) { /* Delete the specified SCST device group */ snprintf(attr_path, MAX_SYSFS_PATH_SIZE, "%s/device_groups/mgmt", SYSFS_SCST_TGT); snprintf(attr_value, MAX_SYSFS_ATTR_SIZE, "del %s", dev_grp_name); if ((temp_int = writeAttribute(attr_path, attr_value)) != 0) { SAFE_ASPRINTF(&error_msg, "Couldn't delete SCST (ALUA) device group: %s", strerror(temp_int)); errorDialog(main_cdk_screen, error_msg, NULL); FREE_NULL(error_msg); } } /* Done */ return;}
开发者ID:byteworks-ch,项目名称:esos,代码行数:38,
示例10: sizeof//! Writes an xml element with any number of attributesvoid CXMLWriter::writeElement(const wchar_t* name, bool empty, core::array<core::stringw> &names, core::array<core::stringw> &values){ if (!File || !name) return; if (Tabs > 0) { for (int i=0; i<Tabs; ++i) File->write(L"/t", sizeof(wchar_t)); } // write name File->write(L"<", sizeof(wchar_t)); File->write(name, wcslen(name)*sizeof(wchar_t)); // write attributes u32 i=0; for (; i < names.size() && i < values.size(); ++i) writeAttribute(names[i].c_str(), values[i].c_str()); // write closing tag if (empty) File->write(L" />", 3*sizeof(wchar_t)); else { File->write(L">", sizeof(wchar_t)); ++Tabs; } TextWrittenLast = false;}
开发者ID:John-He-928,项目名称:krkrz,代码行数:35,
示例11: H5Pset_obj_track_times HDF5::Group MatlabSerializationContext::createMatlabGroup () const { // Disable time tracking for objects to make HDF5 files more deterministic GroupCreatePropList gcpl = GroupCreatePropList::create (); HDF5::Exception::check ("H5Pset_obj_track_times", H5Pset_obj_track_times (gcpl.handle (), false)); HDF5::Group group = HDF5::Group::create (file (), gcpl); writeAttribute (group, "MATLAB_class", "struct"); return group; }
开发者ID:voxie-viewer,项目名称:voxie,代码行数:9,
示例12: setDevicebool OptionsTreeWriter::write(QIODevice* device){ setDevice(device); // turn it off for even more speed setAutoFormatting(true); setAutoFormattingIndent(1); writeStartDocument(); writeDTD(QString("<!DOCTYPE %1>").arg(configName_)); writeStartElement(configName_); writeAttribute("version", configVersion_); writeAttribute("xmlns", configNS_); writeTree(&options_->tree_); writeEndDocument(); return true;}
开发者ID:ChowZenki,项目名称:psi,代码行数:19,
示例13: setCodecvoid GwfStreamWriter::startWriting(const char* encoding){ QTextCodec *codec = QTextCodec::codecForName(encoding); setCodec(codec); setAutoFormatting(true); writeStartDocument(); writeStartElement("GWF"); writeAttribute("version", "1.6"); writeStartElement("staticSector"); isWritingStarted = true;}
开发者ID:SadTigger,项目名称:kbe,代码行数:11,
示例14: writeAttribute void MatlabSerializer<bool>::h5MatlabSave (const MatlabSerializationContextHandle& handle, const bool& b) { //HDF5::DataSpace dataSpace = HDF5::DataSpace::create (H5S_SCALAR); // Matlab (7.5) cannot read this HDF5::DataSpace dataSpace = HDF5::DataSpace::createSimple (1); uint8_t data = b ? 1 : 0; HDF5::DataType dt = getH5Type<uint8_t> (); HDF5::DataSet dataSet = handle.createDataSet (dt, dataSpace); writeAttribute (dataSet, "MATLAB_class", "logical"); writeScalarAttribute<int32_t> (dataSet, "MATLAB_int_decode", 1); dataSet.write (&data, dt, dataSpace); }
开发者ID:voxie-viewer,项目名称:voxie,代码行数:11,
示例15: writeAttributesstatic inline void writeAttributes( std::ostream &out, const GraphAttributes &GA, const edge &e){ const long flags = GA.attributes(); out << "["; bool comma = false; // Whether to put comma before attribute. if(flags & GraphAttributes::edgeLabel) { writeAttribute(out, comma, "label", GA.label(e)); } if(flags & GraphAttributes::edgeDoubleWeight) { writeAttribute(out, comma, "weight", GA.doubleWeight(e)); } else if(flags & GraphAttributes::edgeIntWeight) { writeAttribute(out, comma, "weight", GA.intWeight(e)); } if(flags & GraphAttributes::edgeGraphics) { // This should be legal cubic B-Spline in the future. std::stringstream sstream; for(const DPoint &p : GA.bends(e)) { sstream << p.m_x << "," << p.m_y << " "; } writeAttribute(out, comma, "pos", sstream.str()); } if(flags & GraphAttributes::edgeArrow) { writeAttribute(out, comma, "dir", dot::toString(GA.arrowType(e))); } if(flags & GraphAttributes::edgeStyle) { writeAttribute(out, comma, "color", GA.strokeColor(e)); } if(flags & GraphAttributes::edgeType) { writeAttribute(out, comma, "arrowhead", GA.arrowType(e)); // Additionaly, according to IBM UML doc dependency is a dashed edge. if(GA.type(e) == Graph::dependency) { writeAttribute(out, comma, "style", "dashed"); } } // NOTE: Edge subgraphs are not supported. out << "]";}
开发者ID:marvin2k,项目名称:ogdf,代码行数:51,
示例16: writeStartElement//! [2]void XbelWriter::writeItem(QTreeWidgetItem *item){ QString tagName = item->data(0, Qt::UserRole).toString(); if (tagName == "folder") { bool folded = !treeWidget->isItemExpanded(item); writeStartElement(tagName); writeAttribute("folded", folded ? "yes" : "no"); writeTextElement("title", item->text(0)); for (int i = 0; i < item->childCount(); ++i) writeItem(item->child(i)); writeEndElement(); } else if (tagName == "bookmark") { writeStartElement(tagName); if (!item->text(1).isEmpty()) writeAttribute("href", item->text(1)); writeTextElement("title", item->text(0)); writeEndElement(); } else if (tagName == "separator") { writeEmptyElement(tagName); }}
开发者ID:Fale,项目名称:qtmoko,代码行数:22,
示例17: writeAttributesstatic voidwriteAttributes(template_t *t, tfile_t *tf){ evl_list_t *head = t->tm_attributes; evl_listnode_t *p, *end; int nAttrs = _evlGetListSize(head); writeScalar(nAttrs, tf); for (p=head, end=NULL; p!=end; end=head, p=p->li_next) { writeAttribute((tmpl_attribute_t*) p->li_data, t, tf); }}
开发者ID:cmjonze,项目名称:evlog_cvs,代码行数:12,
示例18: foreachvoid QhpWriter::writeCustomFilters(){ if (!m_customFilters.count()) return; foreach (const CustomFilter &f, m_customFilters) { writeStartElement(QLatin1String("customFilter")); writeAttribute(QLatin1String("name"), f.name); foreach (const QString &a, f.filterAttributes) writeTextElement(QLatin1String("filterAttribute"), a); writeEndElement(); }
开发者ID:FlavioFalcao,项目名称:qt5,代码行数:12,
示例19: sKeyQString QxXmlWriter::writeBinaryData(const QString & qualifiedName, QxXmlWriter::type_byte_arr_ptr pData){ QString sKey(getNextKeyBinaryData()); m_mapBinaryData.insert(sKey, pData); writeStartElement(qualifiedName); writeAttribute(QX_XML_ATTRIBUTE_IS_BINARY_DATA, "1"); writeCharacters(sKey); writeEndElement(); return sKey;}
开发者ID:arBmind,项目名称:QxORM-1.32,代码行数:12,
示例20: remTgtFromGrpDialog/* * Run the Remove Target from Group dialog */void remTgtFromGrpDialog(CDKSCREEN *main_cdk_screen) { char dev_grp_name[MAX_SYSFS_ATTR_SIZE] = {0}, tgt_grp_name[MAX_SYSFS_ATTR_SIZE] = {0}, target_name[MAX_SYSFS_ATTR_SIZE] = {0}, attr_path[MAX_SYSFS_PATH_SIZE] = {0}, attr_value[MAX_SYSFS_ATTR_SIZE] = {0}; char *error_msg = NULL, *confirm_msg = NULL; boolean confirm = FALSE; int temp_int = 0; /* Have the user choose a SCST device group */ getSCSTDevGrpChoice(main_cdk_screen, dev_grp_name); if (dev_grp_name[0] == '/0') return; /* Get target group choice from user (based on previously * selected device group) */ getSCSTTgtGrpChoice(main_cdk_screen, dev_grp_name, tgt_grp_name); if (tgt_grp_name[0] == '/0') return; /* Get target group choice from user (based on previously * selected device group) */ getSCSTTgtGrpTgtChoice(main_cdk_screen, dev_grp_name, tgt_grp_name, target_name); if (target_name[0] == '/0') return; /* Get a final confirmation from user before we delete */ SAFE_ASPRINTF(&confirm_msg, "target '%s' from group '%s?'", target_name, tgt_grp_name); confirm = confirmDialog(main_cdk_screen, "Are you sure you want to remove SCST", confirm_msg); FREE_NULL(confirm_msg); if (confirm) { /* Remove the SCST target from the target group (ALUA) */ snprintf(attr_path, MAX_SYSFS_PATH_SIZE, "%s/device_groups/%s/target_groups/%s/mgmt", SYSFS_SCST_TGT, dev_grp_name, tgt_grp_name); snprintf(attr_value, MAX_SYSFS_ATTR_SIZE, "del %s", target_name); if ((temp_int = writeAttribute(attr_path, attr_value)) != 0) { SAFE_ASPRINTF(&error_msg, "Couldn't delete SCST (ALUA) target from target group: %s", strerror(temp_int)); errorDialog(main_cdk_screen, error_msg, NULL); FREE_NULL(error_msg); } } /* Done */ return;}
开发者ID:byteworks-ch,项目名称:esos,代码行数:55,
示例21: addDevGrpDialog/* * Run the Add Device Group dialog */void addDevGrpDialog(CDKSCREEN *main_cdk_screen) { CDKENTRY *dev_grp_name_entry = 0; char attr_path[MAX_SYSFS_PATH_SIZE] = {0}, attr_value[MAX_SYSFS_ATTR_SIZE] = {0}; char *dev_grp_name = NULL, *error_msg = NULL; int temp_int = 0; while (1) { /* Get new device group name (entry widget) */ dev_grp_name_entry = newCDKEntry(main_cdk_screen, CENTER, CENTER, "<C></31/B>Add New Device Group/n", "</B>New Group Name (no spaces): ", COLOR_DIALOG_SELECT, '_' | COLOR_DIALOG_INPUT, vMIXED, SCST_DEV_GRP_NAME_LEN, 0, SCST_DEV_GRP_NAME_LEN, TRUE, FALSE); if (!dev_grp_name_entry) { errorDialog(main_cdk_screen, ENTRY_ERR_MSG, NULL); break; } setCDKEntryBoxAttribute(dev_grp_name_entry, COLOR_DIALOG_BOX); setCDKEntryBackgroundAttrib(dev_grp_name_entry, COLOR_DIALOG_TEXT); /* Draw the entry widget */ curs_set(1); dev_grp_name = activateCDKEntry(dev_grp_name_entry, 0); /* Check exit from widget */ if (dev_grp_name_entry->exitType == vNORMAL) { /* Check group name for bad characters */ if (!checkInputStr(main_cdk_screen, NAME_CHARS, dev_grp_name)) break; /* Add the new device group */ snprintf(attr_path, MAX_SYSFS_PATH_SIZE, "%s/device_groups/mgmt", SYSFS_SCST_TGT); snprintf(attr_value, MAX_SYSFS_ATTR_SIZE, "create %s", dev_grp_name); if ((temp_int = writeAttribute(attr_path, attr_value)) != 0) { SAFE_ASPRINTF(&error_msg, "Couldn't add SCST (ALUA) device group: %s", strerror(temp_int)); errorDialog(main_cdk_screen, error_msg, NULL); FREE_NULL(error_msg); } } break; } /* Done */ destroyCDKEntry(dev_grp_name_entry); return;}
开发者ID:byteworks-ch,项目名称:esos,代码行数:54,
示例22: setDevice//! [1]bool XbelWriter::writeFile(QIODevice *device){ setDevice(device); writeStartDocument(); writeDTD("<!DOCTYPE xbel>"); writeStartElement("xbel"); writeAttribute("version", "1.0"); for (int i = 0; i < treeWidget->topLevelItemCount(); ++i) writeItem(treeWidget->topLevelItem(i)); writeEndDocument(); return true;}
开发者ID:Fale,项目名称:qtmoko,代码行数:15,
示例23: Q_ASSERTQDomElement MusicAbstractXml::writeDomElementMutil(QDomElement &element, const QString &node, const QStringList &keys, const QList<QVariant> &values){ Q_ASSERT(!keys.isEmpty()); Q_ASSERT(!values.isEmpty()); QDomElement domElement = writeDomElement(element, node, keys.front(), values.front()); for(int i=1; i<keys.count(); ++i) { writeAttribute(domElement, keys[i], values[i]); } return domElement;}
开发者ID:DchunWang,项目名称:TTKMusicplayer,代码行数:14,
示例24: writeAttributevoid CSharpWriter::writeAttributes(UMLAttributeList &atList, QTextStream &cs) { for (UMLAttribute *at = atList.first(); at ; at = atList.next()) { bool asProperty = true; if (at->getVisibility() == Uml::Visibility::Private) { asProperty = false; } writeAttribute(at->getDoc(), at->getVisibility(), at->getStatic(), makeLocalTypeName(at), at->getName(), at->getInitialValue(), asProperty, cs); cs << m_endl; } // end for return;}
开发者ID:serghei,项目名称:kde-kdesdk,代码行数:15,
示例25: setDevicevoid XbelWriter::writeToFile(QIODevice *device){ TRACE_OBJ setDevice(device); writeStartDocument(); writeDTD(QLatin1String("<!DOCTYPE xbel>")); writeStartElement(QLatin1String("xbel")); writeAttribute(QLatin1String("version"), QLatin1String("1.0")); const QModelIndex &root = bookmarkModel->index(0,0, QModelIndex()); for (int i = 0; i < bookmarkModel->rowCount(root); ++i) writeData(bookmarkModel->index(i, 0, root)); writeEndDocument();}
开发者ID:mohdpatah,项目名称:qt,代码行数:15,
注:本文中的writeAttribute函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ writeBlock函数代码示例 C++ write8_delegate函数代码示例 |