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


C++ XMLHelper::CloseTag方法代码示例

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


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

示例1:

// _StorePlaylistItem
status_t
XMLExporter::_StorePlaylistItem(XMLHelper& xml, ClipPlaylistItem* item)
{
	status_t ret = xml.CreateTag("ITEM");

	if (ret == B_OK && item->StartFrame() != 0)
		ret = xml.SetAttribute("startframe", item->StartFrame());

	if (ret == B_OK)
		ret = xml.SetAttribute("duration", item->Duration());

	if (ret == B_OK && item->Track() != 0)
		ret = xml.SetAttribute("track", item->Track());

	if (ret == B_OK)
		ret = xml.SetAttribute("clip_offset", item->ClipOffset());

	if (ret == B_OK && item->IsVideoMuted())
		ret = xml.SetAttribute("video_muted", true);

	if (ret == B_OK && item->IsAudioMuted())
		ret = xml.SetAttribute("audio_muted", true);

	if (ret == B_OK) {
		BString clipID;
		if (item->Clip()) {
			clipID = item->Clip()->ID();
		} else {
			item->GetValue(PROPERTY_CLIP_ID, clipID);
		}
		if (fClipIdIndexMap.ContainsKey(clipID.String())) {
			// the map should always contain the id!
			ret = xml.SetAttribute("clip_index",
				fClipIdIndexMap.Get(clipID.String()));
		} else {
			// this is a fallback, but we should not be here!
			ret = xml.SetAttribute("clip_id", clipID.String());
		}
	}

	if (ret == B_OK)
		ret = store_properties(xml, item);

	// store the NavigationInfo if it exists
	if (const NavigationInfo* info = item->NavigationInfo()) {
		ret = xml.CreateTag("NAV_INFO");
		if (ret == B_OK)
			ret = info->XMLStore(xml);
		if (ret == B_OK)
			ret = xml.CloseTag();
	}

	if (ret == B_OK)
		ret = xml.CloseTag();

	return ret;
}
开发者ID:stippi,项目名称:Clockwerk,代码行数:58,代码来源:XMLExporter.cpp

示例2:

// XMLRestore
status_t
RenderPreset::XMLRestore(XMLHelper& xmlHelper)
{
	xmlHelper.GetAttribute("name", fName);
	fRenderPreview = xmlHelper.GetAttribute("preview", fRenderPreview);

	// "use alpha" depends on "preview" setting
	if (!fRenderPreview)
		fUseAlpha = xmlHelper.GetAttribute("use_alpha", fUseAlpha);
	else
		fUseAlpha = false;

	if (xmlHelper.OpenTag("FILE_FORMAT") == B_OK) {
		xmlHelper.GetAttribute("name", fFamilyName);
		xmlHelper.CloseTag();	// FILE_FORMAT
	}
	if (xmlHelper.OpenTag("VIDEO") == B_OK) {
		fHasVideoTrack = xmlHelper.GetAttribute("on", fHasVideoTrack);
		if (xmlHelper.OpenTag("VIDEO_FORMAT") == B_OK) {
			fLineWidth = xmlHelper.GetAttribute("line_width", fLineWidth);
			fLineCount = xmlHelper.GetAttribute("line_count", fLineCount);
			fColorSpace = (color_space)xmlHelper.GetAttribute("color_space",
														 (int32)fColorSpace);
			xmlHelper.CloseTag();	// VIDEO_FORMAT
		}
		if (xmlHelper.OpenTag("VIDEO_CODEC") == B_OK) {
			xmlHelper.GetAttribute("name", fVideoCodecName);
			xmlHelper.CloseTag();	// VIDEO_CODEC
		}
		if (xmlHelper.OpenTag("QUALITY") == B_OK) {
			fVideoQuality = xmlHelper.GetAttribute("value", fVideoQuality);
			xmlHelper.CloseTag();	// QUALITY;
		}
		xmlHelper.CloseTag();	// VIDEO;
	}
	if (xmlHelper.OpenTag("AUDIO") == B_OK) {
		fHasAudioTrack = xmlHelper.GetAttribute("on", fHasAudioTrack);
		if (xmlHelper.OpenTag("AUDIO_CODEC") == B_OK) {
			xmlHelper.GetAttribute("name", fAudioCodecName);
			fAudioFrameRate = xmlHelper.GetAttribute("frame_rate", fAudioFrameRate);
			fAudioChannelCount = xmlHelper.GetAttribute("channels", fAudioChannelCount);
			xmlHelper.CloseTag();	// AUDIO_CODEC
		}
		xmlHelper.CloseTag();	// AUDIO
	}
	if (xmlHelper.OpenTag("COPYRIGHT") == B_OK) {
		xmlHelper.GetAttribute("string", fCopyright);
		xmlHelper.CloseTag();	// COPYRIGHT
	}
	if (xmlHelper.OpenTag("TIMECODE") == B_OK) {
		fTimeCodeOverlay = xmlHelper.GetAttribute("visible", fTimeCodeOverlay);
		fTimeCodeTransparency = xmlHelper.GetAttribute("transparency", fTimeCodeTransparency);
		fTimeCodeScale = xmlHelper.GetAttribute("scale", fTimeCodeScale);
		xmlHelper.CloseTag();	// TIMECODE
	}
	return B_OK;
}
开发者ID:stippi,项目名称:Clockwerk,代码行数:58,代码来源:RenderPreset.cpp

示例3: Name

// XMLStore
status_t
RenderPreset::XMLStore(XMLHelper& xmlHelper) const
{
	status_t error = B_OK;
	xmlHelper.SetAttribute("name", Name());
	xmlHelper.SetAttribute("preview", fRenderPreview);
	xmlHelper.SetAttribute("use_alpha", fUseAlpha);
	if ((error = xmlHelper.CreateTag("FILE_FORMAT")) == B_OK) {
		xmlHelper.SetAttribute("name", FormatFamily());
		xmlHelper.CloseTag();	// FILE_FORMAT
	}
	if ((error = xmlHelper.CreateTag("VIDEO")) == B_OK) {
		xmlHelper.SetAttribute("on", fHasVideoTrack);
		if ((error = xmlHelper.CreateTag("VIDEO_FORMAT")) == B_OK) {
			xmlHelper.SetAttribute("line_width", fLineWidth);
			xmlHelper.SetAttribute("line_count", fLineCount);
			xmlHelper.SetAttribute("color_space", (int32)fColorSpace);
			xmlHelper.CloseTag();	// VIDEO_FORMAT
		}
		if ((error = xmlHelper.CreateTag("VIDEO_CODEC")) == B_OK) {
			xmlHelper.SetAttribute("name", fVideoCodecName);
			xmlHelper.CloseTag();	// VIDEO_CODEC
		}
		if ((error = xmlHelper.CreateTag("QUALITY")) == B_OK) {
			xmlHelper.SetAttribute("value", fVideoQuality);
			xmlHelper.CloseTag();	// QUALITY
		}
		xmlHelper.CloseTag();	// VIDEO
	}
	if ((error = xmlHelper.CreateTag("AUDIO")) == B_OK) {
		xmlHelper.SetAttribute("on", fHasAudioTrack);
		if ((error = xmlHelper.CreateTag("AUDIO_CODEC")) == B_OK) {
			xmlHelper.SetAttribute("name", fAudioCodecName);
			xmlHelper.SetAttribute("frame_rate", fAudioFrameRate);
			xmlHelper.SetAttribute("channels", fAudioChannelCount);
			xmlHelper.CloseTag();	// AUDIO_CODEC
		}
		xmlHelper.CloseTag();	// AUDIO
	}
	if ((error = xmlHelper.CreateTag("COPYRIGHT")) == B_OK) {
		xmlHelper.SetAttribute("string", fCopyright);
		xmlHelper.CloseTag();	// COPYRIGHT
	}
	if ((error = xmlHelper.CreateTag("TIMECODE")) == B_OK) {
		xmlHelper.SetAttribute("visible", fTimeCodeOverlay);
		xmlHelper.SetAttribute("transparency", fTimeCodeTransparency);
		xmlHelper.SetAttribute("scale", fTimeCodeScale);
		xmlHelper.CloseTag();	// TIMECODE
	}
	// Who cares about errors?
	return B_OK;
}
开发者ID:stippi,项目名称:Clockwerk,代码行数:53,代码来源:RenderPreset.cpp

示例4:

// XMLRestore
status_t
PlaybackReport::XMLRestore(XMLHelper& xml)
{
	status_t ret = B_OK;

	while (xml.OpenTag("CLIP")) {
		BString clipID = xml.GetAttribute("clip_id", "");
		int32 playbackCount = xml.GetAttribute("playback_count", (int32)-1);

		if (clipID.Length() > 0 && playbackCount >= 0) {
			ret = fIDPlaybackCountMap.Put(clipID.String(), playbackCount);
		}

		if (ret == B_OK)
			ret = xml.CloseTag(); // CLIP

		if (ret < B_OK)
			break;
	}

	return ret;
}
开发者ID:stippi,项目名称:Clockwerk,代码行数:23,代码来源:PlaybackReport.cpp


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