亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? xmlconfiguration.cpp

?? This software aims to create an applet and panel tools to manage a wireless interface card, such as
?? CPP
字號:
//
// XMLConfiguration.cpp
//
// $Id: //poco/Main/Util/src/XMLConfiguration.cpp#1 $
//
// Copyright (c) 2004-2005, Guenter Obiltschnig/Applied Informatics.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
//
// 3. Redistributions in any form must be accompanied by information on
//    how to obtain complete source code for this software and any
//    accompanying software that uses this software.  The source code
//    must either be included in the distribution or be available for no
//    more than the cost of distribution plus a nominal fee, and must be
//    freely redistributable under reasonable conditions.  For an
//    executable file, complete source code means the source code for all
//    modules it contains.  It does not include source code for modules or
//    files that typically accompany the major components of the operating
//    system on which the executable file runs.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//


#include "Util/XMLConfiguration.h"
#include "SAX/InputSource.h"
#include "DOM/DOMParser.h"
#include "DOM/Element.h"
#include "DOM/Attr.h"
#include "Foundation/Exception.h"
#include "Foundation/NumberParser.h"
#include "Foundation/NumberFormatter.h"
#include <set>


Util_BEGIN


XMLConfiguration::XMLConfiguration()
{
}


XMLConfiguration::XMLConfiguration(XML::InputSource* pInputSource)
{
	load(pInputSource);
}


XMLConfiguration::XMLConfiguration(std::istream& istr)
{
	load(istr);
}


XMLConfiguration::XMLConfiguration(const std::string& path)
{
	load(path);
}


XMLConfiguration::XMLConfiguration(const XML::Document* pDocument)
{
	load(pDocument);
}

	
XMLConfiguration::XMLConfiguration(const XML::Node* pNode)
{
	load(pNode);
}


XMLConfiguration::~XMLConfiguration()
{
}


void XMLConfiguration::load(XML::InputSource* pInputSource)
{
	poco_check_ptr (pInputSource);
	
	XML::DOMParser parser;
	parser.setFeature(XML::XMLReader::FEATURE_NAMESPACES, false);
	parser.setFeature(XML::DOMParser::FEATURE_WHITESPACE, true);
	XML::AutoPtr<XML::Document> pDoc = parser.parse(pInputSource);
	load(pDoc);
}


void XMLConfiguration::load(std::istream& istr)
{
	XML::InputSource src(istr);
	load(&src);	
}


void XMLConfiguration::load(const std::string& path)
{
	XML::InputSource src(path);
	load(&src);	
}

	
void XMLConfiguration::load(const XML::Document* pDocument)
{
	poco_check_ptr (pDocument);
	
	_pDocument = XML::AutoPtr<XML::Document>(const_cast<XML::Document*>(pDocument), true);
	_pRoot     = XML::AutoPtr<XML::Node>(pDocument->documentElement(), true);
}


void XMLConfiguration::load(const XML::Node* pNode)
{
	poco_check_ptr (pNode);

	if (pNode->nodeType() == XML::Node::DOCUMENT_NODE)
	{
		load(static_cast<const XML::Document*>(pNode));
	}
	else
	{
		_pDocument = XML::AutoPtr<XML::Document>(pNode->ownerDocument(), true);
		_pRoot     = XML::AutoPtr<XML::Node>(const_cast<XML::Node*>(pNode), true);
	}
}


bool XMLConfiguration::getRaw(const std::string& key, std::string& value) const
{
	const XML::Node* pNode = findNode(key);
	if (pNode)
	{
		value = pNode->innerText();
		return true;
	}
	else return false;
}


void XMLConfiguration::setRaw(const std::string& key, const std::string& value)
{
	throw Foundation::NotImplementedException("Setting a property in an XMLConfiguration");
}


void XMLConfiguration::enumerate(const std::string& key, Keys& range) const
{
	using Foundation::NumberFormatter;
	
	std::multiset<std::string> keys;
	const XML::Node* pNode = findNode(key);
	if (pNode)
	{
		const XML::Node* pChild = pNode->firstChild();
		while (pChild)
		{
			if (pChild->nodeType() == XML::Node::ELEMENT_NODE)
			{
				const std::string& nodeName = pChild->nodeName();
				int n = (int) keys.count(nodeName);
				if (n)
					range.push_back(nodeName + "[" + NumberFormatter::format(n) + "]");
				else
					range.push_back(nodeName);
				keys.insert(nodeName);
			}
			pChild = pChild->nextSibling();
		}
	}
}


const XML::Node* XMLConfiguration::findNode(const std::string& key) const
{
	std::string::const_iterator it = key.begin();
	return findNode(it, key.end(), _pRoot);
}


const XML::Node* XMLConfiguration::findNode(std::string::const_iterator& it, const std::string::const_iterator& end, const XML::Node* pNode)
{
	if (pNode && it != end)
	{
		if (*it == '[')
		{
			++it;
			if (it != end && *it == '@')
			{
				++it;
				std::string attr;
				while (it != end && *it != ']') attr += *it++;
				if (it != end) ++it;
				return findAttribute(attr, pNode);
			}
			else
			{
				std::string index;
				while (it != end && *it != ']') index += *it++;
				if (it != end) ++it;
				return findNode(it, end, findElement(Foundation::NumberParser::parse(index), pNode));
			}
		}
		else
		{
			while (it != end && *it == '.') ++it;
			std::string key;
			while (it != end && *it != '.' && *it != '[') key += *it++;
			return findNode(it, end, findElement(key, pNode));
		}
	}
	else return pNode;
}


const XML::Node* XMLConfiguration::findElement(const std::string& name, const XML::Node* pNode)
{
	const XML::Node* pChild = pNode->firstChild();
	while (pChild)
	{
		if (pChild->nodeType() == XML::Node::ELEMENT_NODE && pChild->nodeName() == name)
			return pChild;
		pChild = pChild->nextSibling();
	}
	return 0;
}


const XML::Node* XMLConfiguration::findElement(int index, const XML::Node* pNode)
{
	const XML::Node* pRefNode = pNode;
	if (index > 0)
	{
		pNode = pNode->nextSibling();
		while (pNode)
		{
			if (pNode->nodeName() == pRefNode->nodeName())
			{
				if (--index == 0) break;
			}
			pNode = pNode->nextSibling();
		}
	}
	return pNode;
}


const XML::Node* XMLConfiguration::findAttribute(const std::string& name, const XML::Node* pNode)
{
	const XML::Element* pElem = dynamic_cast<const XML::Element*>(pNode);
	if (pElem)
		return pElem->getAttributeNode(name);
	else
		return 0;
}


Util_END

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美巨大另类极品videosbest| 欧美亚洲愉拍一区二区| 国产酒店精品激情| 91在线视频官网| 欧美三级三级三级爽爽爽| 日韩一区二区视频| 国产精品色一区二区三区| 国产精品超碰97尤物18| 亚洲国产一区二区视频| 日本午夜精品视频在线观看 | 欧美精品自拍偷拍| 精品国产制服丝袜高跟| 在线观看成人小视频| 国产亚洲精品aa午夜观看| 久久精品国产一区二区三区免费看| 亚洲免费观看高清完整| 国产久卡久卡久卡久卡视频精品| 久久亚洲一区二区三区明星换脸| 成人av免费网站| 国产一区二区三区在线观看精品| 亚洲综合免费观看高清在线观看| 久久福利视频一区二区| 欧美精品乱码久久久久久按摩| 亚洲欧美日韩一区二区 | 正在播放一区二区| 亚洲欧美日韩国产一区二区三区| 国产精品综合二区| 久久蜜桃av一区二区天堂| 久久99久久精品| 日韩欧美国产综合一区| 日韩综合一区二区| 欧美精品高清视频| 日韩中文字幕麻豆| 4438成人网| 视频在线观看一区| 日韩一级二级三级| 狠狠色丁香婷婷综合久久片| 欧美一级片免费看| 久久9热精品视频| 精品久久一区二区| 国产福利一区在线| 国产精品毛片久久久久久久| 成人黄色国产精品网站大全在线免费观看| 久久久精品天堂| hitomi一区二区三区精品| 国产精品福利一区| 欧美综合一区二区| 奇米四色…亚洲| 精品国产免费久久| 国产福利91精品一区| 国产精品美女一区二区| 色999日韩国产欧美一区二区| 一区二区高清在线| 日韩美女视频在线| 高清成人免费视频| 一区二区三国产精华液| 日韩一级片在线观看| 国产一区二区福利| 一区二区高清在线| 欧美成人一区二区| 91在线看国产| 天堂久久久久va久久久久| 精品国产99国产精品| 99精品偷自拍| 蜜臀精品久久久久久蜜臀| 国产精品私人影院| 4438亚洲最大| 99久久久久久| 午夜电影一区二区三区| 国产欧美精品一区二区色综合朱莉| 99久久国产免费看| 蜜桃一区二区三区在线观看| 国产精品久久久久久福利一牛影视 | 欧美日韩一区在线观看| 国产一区二区三区精品欧美日韩一区二区三区| 中文字幕精品一区| 欧美裸体bbwbbwbbw| 国产91丝袜在线播放0| 午夜久久久久久久久久一区二区| 国产日韩欧美精品电影三级在线| 欧美日韩一区视频| 99精品桃花视频在线观看| 视频一区欧美日韩| 国产精品久久福利| 欧美电影免费观看高清完整版在线| 91亚洲国产成人精品一区二区三 | 精品精品国产高清一毛片一天堂| www.亚洲色图.com| 久久av中文字幕片| 丝袜脚交一区二区| 一区二区在线电影| 国产三级精品三级在线专区| 91精品办公室少妇高潮对白| 久久不见久久见免费视频7| 亚洲一区自拍偷拍| 亚洲色图视频网| 中文字幕免费不卡在线| 精品久久久久久久人人人人传媒| 国内精品伊人久久久久av一坑 | 欧美片网站yy| 成人一二三区视频| 久久精品av麻豆的观看方式| 五月婷婷久久综合| 亚洲一区二区三区美女| 亚洲精选免费视频| 国产精品久久久久影视| 欧美国产日韩在线观看| 久久丝袜美腿综合| 亚洲精品一区二区三区蜜桃下载 | 久久精品日韩一区二区三区| 7777精品伊人久久久大香线蕉 | 日韩电影在线免费看| 一区二区三区日韩欧美精品 | 国产亚洲成年网址在线观看| 精品久久国产字幕高潮| 欧美va亚洲va| 成人永久aaa| 麻豆国产精品视频| 日本在线不卡视频| 亚洲国产裸拍裸体视频在线观看乱了| 91久久精品一区二区三区| 久久国产生活片100| 亚洲电影中文字幕在线观看| 国产精品第四页| 亚洲国产精品v| 国产日韩欧美a| 日韩欧美一区二区久久婷婷| 欧美在线小视频| 中文字幕av一区二区三区高 | 精品少妇一区二区三区| 8v天堂国产在线一区二区| 国产一区二区三区久久悠悠色av| 国产麻豆日韩欧美久久| 91福利视频在线| 亚洲精品在线免费播放| 亚洲情趣在线观看| 黄色小说综合网站| 制服丝袜一区二区三区| 欧美韩国日本综合| 免费不卡在线视频| 一本色道a无线码一区v| 国产日韩欧美麻豆| 美女被吸乳得到大胸91| 欧美色图12p| 亚洲国产成人av| 欧美在线视频日韩| 中文字幕亚洲成人| 经典三级视频一区| 欧美一区二区免费观在线| 337p粉嫩大胆噜噜噜噜噜91av| 亚洲精品久久久蜜桃| 国产成a人无v码亚洲福利| 欧美大黄免费观看| 麻豆国产一区二区| 欧美大片一区二区三区| 日本欧美加勒比视频| 91精品国产综合久久香蕉麻豆| 一区二区在线观看免费| 欧美图区在线视频| 午夜伦欧美伦电影理论片| 欧美性猛片aaaaaaa做受| 一区二区三区在线视频观看 | 欧美在线999| 婷婷综合另类小说色区| 久久综合九色欧美综合狠狠 | 久久综合一区二区| 日韩精品亚洲一区二区三区免费| 一本久道久久综合中文字幕| 国产精品女同一区二区三区| 国产成人免费视频网站高清观看视频 | 久久免费午夜影院| 波多野结衣一区二区三区 | 成人晚上爱看视频| 中文字幕综合网| 欧美性猛交xxxx乱大交退制版| 一区二区三区视频在线观看| 欧美一区二区三区日韩视频| 国精产品一区一区三区mba桃花 | 国产一区啦啦啦在线观看| 久久伊99综合婷婷久久伊| 国产传媒久久文化传媒| 午夜欧美大尺度福利影院在线看| 日韩精品一区二区三区swag| 99热99精品| 国产成人在线视频免费播放| 午夜一区二区三区视频| 欧美经典三级视频一区二区三区| 欧美视频一区二区三区在线观看| 国产成人精品免费在线| 亚洲欧美另类久久久精品2019| 精品乱人伦一区二区三区| 在线看一区二区| 久久av中文字幕片| 成人欧美一区二区三区小说| 日韩一区二区免费电影| 欧美日韩国产美女| 欧美日韩国产首页在线观看| 91亚洲精品久久久蜜桃网站| eeuss鲁片一区二区三区| 成人精品亚洲人成在线|