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

C++ XMLWriter类代码示例

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

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



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

示例1: writeXMLValue

void XMLValueMap::writeXMLValue(XMLWriter &writer, const string &name,
                                const string &value) const {
  XMLAttributes attrs;
  attrs["v"] = value;
  writer.startElement(name, attrs);
  writer.endElement(name);
}
开发者ID:equinoxefr,项目名称:cbang,代码行数:7,代码来源:XMLValueMap.cpp


示例2: WriteXMLAttributes

void ViewInfo::WriteXMLAttributes(XMLWriter &xmlFile)
{
    selectedRegion.WriteXMLAttributes(xmlFile, wxT("sel0"), wxT("sel1"));
    xmlFile.WriteAttr(wxT("vpos"), vpos);
    xmlFile.WriteAttr(wxT("h"), h, 10);
    xmlFile.WriteAttr(wxT("zoom"), zoom, 10);
}
开发者ID:d-unknown-processor,项目名称:audacity,代码行数:7,代码来源:ViewInfo.cpp


示例3: SaveXML

void SilentBlockFile::SaveXML(XMLWriter &xmlFile)
// may throw
{
   xmlFile.StartTag(wxT("silentblockfile"));

   xmlFile.WriteAttr(wxT("len"), mLen);

   xmlFile.EndTag(wxT("silentblockfile"));
}
开发者ID:MindFy,项目名称:audacity,代码行数:9,代码来源:SilentBlockFile.cpp


示例4:

bool SceneSerializer::AddVector3Attribute(XMLWriter& writer, const float x, const float y, const float z)
{
	if(writer.AddAttribute(X, x))
		if(writer.AddAttribute(Y, y))
			if(writer.AddAttribute(Z, z))
				return true;

	return false;
}
开发者ID:VagabondOfHell,项目名称:ProBending,代码行数:9,代码来源:SceneSerializer.cpp


示例5: ToXML

	void Customer::ToXML(XMLWriter& writer) const
	{
		writer.BeginElement(CUSTOMER_TAG);
		{
			writer.WriteElement(NAME_TAG, mName);
			writer.WriteElement(ADDRESS_TAG, mAddress);
			writer.WriteElement(DATA_TAG, mData);
		}
		writer.EndElement(CUSTOMER_TAG);
	}
开发者ID:bendova,项目名称:MyCode,代码行数:10,代码来源:Customer.cpp


示例6: SerializeGameObject

void SceneSerializer::SerializeGameObject(XMLWriter& writer, const SharedGameObject gameObject)
{
	Ogre::Vector3 position = gameObject->GetWorldPosition();
	Ogre::Vector3 scale = gameObject->GetWorldScale();
	Ogre::Quaternion rotation = gameObject->GetWorldOrientation();
	
	writer.CreateNode(GameObjectNode, std::string(""), true); writer.AddAttribute(ObjectName, gameObject->GetName());
	writer.AddAttribute(ObjectTag, gameObject->tag, false, false);

		//game object Transform
		writer.CreateNode(Position);
			AddVector3Attribute(writer, position);
		writer.PopNode();

		writer.CreateNode(Rotation, gameObject->GetInheritOrientation());
			AddVector4Attribute(writer, rotation.x, rotation.y, rotation.z, rotation.w);
		writer.PopNode();

		writer.CreateNode(Scale, gameObject->GetInheritScale());
			AddVector3Attribute(writer, scale);
		writer.PopNode();

	for (auto compIter = gameObject->components.begin(); compIter != gameObject->components.end(); ++compIter)
	{
		switch (compIter->second->GetComponentType())
		{
		case Component::AUDIO_COMPONENT:
			break;

		case Component::MESH_RENDER_COMPONENT:
			SerializeMeshRenderComponent(writer, (MeshRenderComponent*)compIter->second);
			break;

		case Component::PARTICLE_COMPONENT:
			SerializeParticleComponent(writer, (ParticleComponent*)compIter->second);
			break;

		case Component::RIGID_BODY_COMPONENT:
			SerializeRigidBodyComponent(writer, (RigidBodyComponent*)compIter->second);
			break;

		default:
			break;
		}
	}

	//Serialize Child Game Objects
	for (auto childStart = gameObject->children.begin();
		childStart != gameObject->children.end(); ++childStart)
	{
		SerializeGameObject(writer, *childStart);
	}

	writer.PopNode();
}
开发者ID:VagabondOfHell,项目名称:ProBending,代码行数:55,代码来源:SceneSerializer.cpp


示例7: XMLWriter

void ProfileDB::dumpProfilesXML(vector<Profile*> profiles,
        map<string, Profile*> profileMappings, string profileName) {
	ostringstream output;
	XMLWriter writer = XMLWriter(&output);
	writer.start();
	writer.startTag("db");
	writer.setAttr("version", "1.0");
	writer.setAttr("id", "main");

	string line;

	if (profiles.size() > 0) {
		for (size_t i = 0; i < profiles.size(); i++) {
			Profile* profile = profiles.at(i);
			if (profile) {
				profile->toXML(writer, fIncludeCapabilities);
			}
		}
		if (fOutputMappings) {
			dumpProfileMappings(&writer, profileMappings);
		}
	} else {
		writer.startTag("error");
		writer.text(string("Could find no matching profile for ") + profileName);
		writer.endTag();
	}

	writer.endTag();

	printf("%s", output.str().c_str());
}
开发者ID:Ginox,项目名称:MoSync,代码行数:31,代码来源:profiledb.cpp


示例8:

bool vfs::PropertyContainer::writeToXMLFile(vfs::Path const& sFileName, vfs::PropertyContainer::TagMap& tagmap)
{
	XMLWriter xmlw;

	xmlw.openNode(tagmap.container());

	tSections::iterator sit = m_mapProps.begin();
	for(; sit != m_mapProps.end(); ++sit)
	{
		xmlw.addAttributeToNextValue(tagmap.sectionID(),sit->first.utf8());
		xmlw.openNode(tagmap.section());

		vfs::PropertyContainer::Section& section = sit->second;
		vfs::PropertyContainer::Section::tProps::iterator kit = section.mapProps.begin();
		for(; kit != section.mapProps.end(); ++kit)
		{
			xmlw.addAttributeToNextValue(tagmap.keyID(), kit->first.utf8());
			xmlw.addValue(tagmap.key(), kit->second.utf8());
		}

		xmlw.closeNode();

	}

	xmlw.closeNode();

	return xmlw.writeToFile(sFileName);
}
开发者ID:RadekSimkanic,项目名称:JA2-1.13,代码行数:28,代码来源:XMLProperties.cpp


示例9: SerializeScene

bool SceneSerializer::SerializeScene(const IScene* scene, std::string rootNodeName, const std::string& fileName,
			const std::string& refCollection/* = std::string("")*/)
{
	//PxDataManSerializeOptions serialOptions = PxDataManSerializeOptions(PxDataManSerializeOptions::ALL,
		//PxDataCollection, true, fileName);
	StartID = PhysXSerializerWrapper::GetHighestIDInCollection(ActorCollection);

	pxDataRefCollection = refCollection;

	if(StartID < 1)
		StartID = 1;

	long long otherCollectionID = PhysXSerializerWrapper::GetHighestIDInCollection(refCollection);

	if(otherCollectionID < 1)
		otherCollectionID = 1;

	if(otherCollectionID > StartID)
		StartID = otherCollectionID + 1;

	if(PhysXSerializerWrapper::CreateSerializer() )//&& 
		//PhysXDataManager::GetSingletonPtr()->SerializeData(serialOptions))
	{
		XMLWriter writer;
	
		rootNodeName.erase(std::remove_if(rootNodeName.begin(), rootNodeName.end(), isspace), rootNodeName.end());

		if(	PhysXSerializerWrapper::CreateCollection(ActorCollection, true))
		{
			writer.CreateNode(rootNodeName, std::string(""), false);//Root node which is scene name

			for (GameObjectList::iterator start = scene->gameObjectList.begin();
				start != scene->gameObjectList.end(); ++start)
			{
				if(start->get()->IsSerializable())//if serializable, serialize
					SerializeGameObject(writer, *start);
			}

			//PhysXSerializerWrapper::CompleteCollection(ActorCollection, refCollection);

			bool serialize = PhysXSerializerWrapper::SerializeToBinary(fileName + "Actors.pbd",
				ActorCollection, refCollection);

			bool xml = writer.WriteFile(fileName + "Actors.xml");

			PhysXSerializerWrapper::ReleaseCollection(ActorCollection);
			PhysXSerializerWrapper::DestroySerializer();

			return serialize && xml;
		}		
	}

	return false;
}
开发者ID:VagabondOfHell,项目名称:ProBending,代码行数:54,代码来源:SceneSerializer.cpp


示例10: toXML

void TestResult::toXML(XMLWriter &receiver) const
{
    QXmlAttributes atts;
    atts.append(QLatin1String("name"), QString(), QLatin1String("name"), m_testName);
    atts.append(QLatin1String("result"), QString(), QLatin1String("result"), displayName(m_status));

    if(!m_comment.isEmpty())
        atts.append(QLatin1String("comment"), QString(), QLatin1String("comment"), m_comment);

    receiver.startElement(QLatin1String("test-case"), atts);
    receiver.endElement(QLatin1String("test-case"));
}
开发者ID:husninazer,项目名称:qt,代码行数:12,代码来源:TestResult.cpp


示例11: WriteXML

void TimeTrack::WriteXML(XMLWriter &xmlFile)
{
   xmlFile.StartTag(wxT("timetrack"));

   xmlFile.WriteAttr(wxT("name"), mName);
   xmlFile.WriteAttr(wxT("channel"), mChannel);
   xmlFile.WriteAttr(wxT("offset"), mOffset, 8);

   mEnvelope->WriteXML(xmlFile);

   xmlFile.EndTag(wxT("timetrack"));
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:12,代码来源:TimeTrack.cpp


示例12: WriteXML

void WaveClip::WriteXML(XMLWriter &xmlFile)
{
   xmlFile.StartTag(wxT("waveclip"));
   xmlFile.WriteAttr(wxT("offset"), mOffset, 8);

   mSequence->WriteXML(xmlFile);
   mEnvelope->WriteXML(xmlFile);

   for (WaveClipList::compatibility_iterator it=mCutLines.GetFirst(); it; it=it->GetNext())
      it->GetData()->WriteXML(xmlFile);

   xmlFile.EndTag(wxT("waveclip"));
}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:13,代码来源:WaveClip.cpp


示例13: SaveXML

/// Writes the xml as a SimpleBlockFile if we can (if we have a summary file)
/// Otherwise writes XML as a subset of attributes with 'odpcmaliasblockfile as the start tag.
/// Most notably, the summaryfile attribute refers to a file that does not yet, so when the project file is read back in
/// and this object reconstructed, it needs to avoid trying to open it as well as schedule itself for OD loading
void ODDecodeBlockFile::SaveXML(XMLWriter &xmlFile)
// may throw
{
   auto locker = LockForRead();
   if(IsSummaryAvailable())
   {
      SimpleBlockFile::SaveXML(xmlFile);
   }
   else
   {
      xmlFile.StartTag(wxT("oddecodeblockfile"));
      {
         //unlock to prevent deadlock and resume lock after.
         auto suspension = locker.Suspend();
         ODLocker locker2{ &mFileNameMutex };
         xmlFile.WriteAttr(wxT("summaryfile"), mFileName.GetFullName());
      }
      xmlFile.WriteAttr(wxT("audiofile"), mAudioFileName.GetFullPath());
      xmlFile.WriteAttr(wxT("aliasstart"),
                        mAliasStart.as_long_long());
      xmlFile.WriteAttr(wxT("aliaslen"), mLen);
      xmlFile.WriteAttr(wxT("aliaschannel"), mAliasChannel);
      xmlFile.WriteAttr(wxT("decodetype"), (size_t)mType);

      xmlFile.EndTag(wxT("oddecodeblockfile"));
   }
}
开发者ID:MindFy,项目名称:audacity,代码行数:31,代码来源:ODDecodeBlockFile.cpp


示例14: SaveXML

/// Writes the xml as a SimpleBlockFile if we can (if we have a summary file)
/// Otherwise writes XML as a subset of attributes with 'odpcmaliasblockfile as the start tag.
/// Most notably, the summaryfile attribute refers to a file that does not yet, so when the project file is read back in
/// and this object reconstructed, it needs to avoid trying to open it as well as schedule itself for OD loading
void ODDecodeBlockFile::SaveXML(XMLWriter &xmlFile)
{
   LockRead();
   if(IsSummaryAvailable())
   {
      SimpleBlockFile::SaveXML(xmlFile);
   }
   else
   {
      xmlFile.StartTag(wxT("oddecodeblockfile"));
       //unlock to prevent deadlock and resume lock after.
      UnlockRead();
      mFileNameMutex.Lock();
      xmlFile.WriteAttr(wxT("summaryfile"), mFileName.GetFullName());
      mFileNameMutex.Unlock();
      LockRead();
      xmlFile.WriteAttr(wxT("audiofile"), mAudioFileName.GetFullPath());
      xmlFile.WriteAttr(wxT("aliasstart"), mAliasStart);
      xmlFile.WriteAttr(wxT("aliaslen"), mLen);
      xmlFile.WriteAttr(wxT("aliaschannel"), mAliasChannel);
      xmlFile.WriteAttr(wxT("decodetype"), (size_t)mType);

      xmlFile.EndTag(wxT("oddecodeblockfile"));
   }
   UnlockRead();
}
开发者ID:Cactuslegs,项目名称:audacity-of-nope,代码行数:30,代码来源:ODDecodeBlockFile.cpp


示例15: SaveXML

void LegacyAliasBlockFile::SaveXML(XMLWriter &xmlFile)
{
   xmlFile.StartTag(wxT("legacyblockfile"));
   
   xmlFile.WriteAttr(wxT("alias"), 1);
   xmlFile.WriteAttr(wxT("name"), mFileName.GetFullName());
   xmlFile.WriteAttr(wxT("aliaspath"), mAliasedFileName.GetFullPath());
   xmlFile.WriteAttr(wxT("aliasstart"), mAliasStart);
   xmlFile.WriteAttr(wxT("aliaslen"), mLen);
   xmlFile.WriteAttr(wxT("aliaschannel"), mAliasChannel);
   xmlFile.WriteAttr(wxT("summarylen"), mSummaryInfo.totalSummaryBytes);
   if (mSummaryInfo.fields < 3)
      xmlFile.WriteAttr(wxT("norms"), 1);

   xmlFile.EndTag(wxT("legacyblockfile"));
}
开发者ID:Cactuslegs,项目名称:audacity-of-nope,代码行数:16,代码来源:LegacyAliasBlockFile.cpp


示例16: SaveXML

/// Writes the xml as a PCMAliasBlockFile if we can (if we have a summary file)
/// Otherwise writes XML as a subset of attributes with 'odpcmaliasblockfile as the start tag.
/// Most notably, the summaryfile attribute refers to a file that does not yet, so when the project file is read back in
/// and this object reconstructed, it needs to avoid trying to open it as well as schedule itself for OD loading
void ODPCMAliasBlockFile::SaveXML(XMLWriter &xmlFile)
{
   //we lock this so that mAliasedFileName doesn't change.
   mReadDataMutex.Lock();
   if(IsSummaryAvailable())
   {
      PCMAliasBlockFile::SaveXML(xmlFile);
      mHasBeenSaved = true;
   }
   else
   {
      xmlFile.StartTag(wxT("odpcmaliasblockfile"));

      //unlock to prevent deadlock and resume lock after.
      mReadDataMutex.Unlock();
      mFileNameMutex.Lock();
      xmlFile.WriteAttr(wxT("summaryfile"), mFileName.GetFullName());
      mFileNameMutex.Unlock();
      mReadDataMutex.Lock();
      
      xmlFile.WriteAttr(wxT("aliasfile"), mAliasedFileName.GetFullPath());
      xmlFile.WriteAttr(wxT("aliasstart"), mAliasStart);
      xmlFile.WriteAttr(wxT("aliaslen"), mLen);
      xmlFile.WriteAttr(wxT("aliaschannel"), mAliasChannel);
      //these have not been computed yet.
      //xmlFile.WriteAttr(wxT("min"), mMin);
      //xmlFile.WriteAttr(wxT("max"), mMax);
     // xmlFile.WriteAttr(wxT("rms"), mRMS);

      xmlFile.EndTag(wxT("odpcmaliasblockfile"));
   }
   
   mReadDataMutex.Unlock();
}
开发者ID:tuanmasterit,项目名称:audacity,代码行数:38,代码来源:ODPCMAliasBlockFile.cpp


示例17: SaveXML

/// Writes the xml as a PCMAliasBlockFile if we can (if we have a summary file)
/// Otherwise writes XML as a subset of attributes with 'odpcmaliasblockfile as the start tag.
/// Most notably, the summaryfile attribute refers to a file that does not yet, so when the project file is read back in
/// and this object reconstructed, it needs to avoid trying to open it as well as schedule itself for OD loading
void ODPCMAliasBlockFile::SaveXML(XMLWriter &xmlFile)
{
   //we lock this so that mAliasedFileName doesn't change.
   LockRead();
   if(IsSummaryAvailable())
   {
      PCMAliasBlockFile::SaveXML(xmlFile);
      mHasBeenSaved = true;
   }
   else
   {
      xmlFile.StartTag(wxT("odpcmaliasblockfile"));

      //unlock to prevent deadlock and resume lock after.
      UnlockRead();
      mFileNameMutex.Lock();
      xmlFile.WriteAttr(wxT("summaryfile"), mFileName.GetFullName());
      mFileNameMutex.Unlock();
      LockRead();

      xmlFile.WriteAttr(wxT("aliasfile"), mAliasedFileName.GetFullPath());
      xmlFile.WriteAttr(wxT("aliasstart"), mAliasStart);
      xmlFile.WriteAttr(wxT("aliaslen"), mLen);
      xmlFile.WriteAttr(wxT("aliaschannel"), mAliasChannel);

      xmlFile.EndTag(wxT("odpcmaliasblockfile"));
   }

   UnlockRead();
}
开发者ID:aeve,项目名称:audacity,代码行数:34,代码来源:ODPCMAliasBlockFile.cpp


示例18: SaveXML

/// Writes the xml as a PCMAliasBlockFile if we can (if we have a summary file)
/// Otherwise writes XML as a subset of attributes with 'odpcmaliasblockfile as the start tag.
/// Most notably, the summaryfile attribute refers to a file that does not yet exist, so when the project file is read back in
/// and this object reconstructed, it needs to avoid trying to open it as well as schedule itself for OD loading
void ODPCMAliasBlockFile::SaveXML(XMLWriter &xmlFile)
// may throw
{
   //we lock this so that mAliasedFileName doesn't change.
   auto locker = LockForRead();
   if(IsSummaryAvailable())
   {
      PCMAliasBlockFile::SaveXML(xmlFile);
      mHasBeenSaved = true;
   }
   else
   {
      xmlFile.StartTag(wxT("odpcmaliasblockfile"));

      //unlock to prevent deadlock and resume lock after.
      {
         auto suspension = locker.Suspend();
         ODLocker locker2 { &mFileNameMutex };
         xmlFile.WriteAttr(wxT("summaryfile"), mFileName.GetFullName());
      }

      xmlFile.WriteAttr(wxT("aliasfile"), mAliasedFileName.GetFullPath());
      xmlFile.WriteAttr(wxT("aliasstart"),
                        mAliasStart.as_long_long());
      xmlFile.WriteAttr(wxT("aliaslen"), mLen);
      xmlFile.WriteAttr(wxT("aliaschannel"), mAliasChannel);

      xmlFile.EndTag(wxT("odpcmaliasblockfile"));
   }
}
开发者ID:MindFy,项目名称:audacity,代码行数:34,代码来源:ODPCMAliasBlockFile.cpp


示例19: WriteXMLHeader

void FFmpegPresets::WriteXMLHeader(XMLWriter &xmlFile)
{
   xmlFile.Write(wxT("<?xml "));
   xmlFile.Write(wxT("version=\"1.0\" "));
   xmlFile.Write(wxT("standalone=\"no\" "));
   xmlFile.Write(wxT("?>\n"));

   wxString dtdName = wxT("-//audacityffmpegpreset-1.0.0//DTD//EN");
   wxString dtdURI =
      wxT("http://audacity.sourceforge.net/xml/audacityffmpegpreset-1.0.0.dtd");

   xmlFile.Write(wxT("<!DOCTYPE "));
   xmlFile.Write(wxT("project "));
   xmlFile.Write(wxT("PUBLIC "));
   xmlFile.Write(wxT("\"-//audacityffmpegpreset-1.0.0//DTD//EN\" "));
   xmlFile.Write(wxT("\"http://audacity.sourceforge.net/xml/audacityffmpegpreset-1.0.0.dtd\" "));
   xmlFile.Write(wxT(">\n"));
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:18,代码来源:ExportFFmpegDialogs.cpp


示例20: SaveXML

void PCMAliasBlockFile::SaveXML(XMLWriter &xmlFile)
{
   xmlFile.StartTag(wxT("pcmaliasblockfile"));

   xmlFile.WriteAttr(wxT("summaryfile"), mFileName.GetFullName());
   xmlFile.WriteAttr(wxT("aliasfile"), mAliasedFileName.GetFullPath());
   xmlFile.WriteAttr(wxT("aliasstart"), mAliasStart);
   xmlFile.WriteAttr(wxT("aliaslen"), mLen);
   xmlFile.WriteAttr(wxT("aliaschannel"), mAliasChannel);
   xmlFile.WriteAttr(wxT("min"), mMin);
   xmlFile.WriteAttr(wxT("max"), mMax);
   xmlFile.WriteAttr(wxT("rms"), mRMS);

   xmlFile.EndTag(wxT("pcmaliasblockfile"));
}
开发者ID:ruthmagnus,项目名称:audacity,代码行数:15,代码来源:PCMAliasBlockFile.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ XML_ElementParser类代码示例发布时间:2022-05-31
下一篇:
C++ XMLURL类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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