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


C++ DOMString::transcode方法代码示例

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


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

示例1: fromXML

EppCommandCreateSecDns* EppCommandCreateSecDns::fromXML( const DOMNode &root )
{
	EppCommandCreateSecDns * cmd  = new EppCommandCreateSecDns();
	if( cmd == null )
	{
		return null;
	}

	DOMNodeList* list  = root.getChildNodes();
	for( unsigned int i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node = list->item(i);
		DOMString name = node->getLocalName();

		if( name.isNull() )
		{
			name = node->getNodeName();
		}
		if( name.isNull() )
		{
			continue;
		}
		if( name.substringData(0, 7).equals("secDNS:") )
		{
			name = name.substringData(7, name.length() - 7);
		}
		if( name.equals("dsData") )
		{
			EppSecDnsDsData * ds = EppSecDnsDsData::fromXML(*node);
			if( ds != null )
			{
				cmd->add(*ds);
				delete ds;
			}
		}
		else if( name.equals("maxSigLife") )
		{
			DOMString value = EppUtil::getText(*node);
			char *p = value.transcode();
			if( p != null )
			{
				cmd->maxSigLife = ::atoi(p);
				XercesString::Delete(p);
			}
		}
		else if( name.equals("keyData") )
		{
			// FIXME(zhang) not supported
			cmd->keyDataPresent = true;
			EppSecDnsKeyData *kd = EppSecDnsKeyData::fromXML(*node);
			if( kd != null )
			{
				cmd->add(*kd);
				delete kd;
			}
		}
	}
	return cmd;
}
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:59,代码来源:EppCommandCreateSecDns.cpp

示例2: strrchr

short
EppUtil::getDnsSecMajorMinor(const DOMString &root,
	unsigned short &_major, unsigned short &_minor)
{
	char major[4] = "\0";
	char minor[4] = "\0";
	int8_t iter = 0;

	if( 0 >= root.length() || root.isNull() )
		return -1;

	char *str_val = root.transcode();
	if( null == str_val )
		return -1;

	char *needle = strrchr(str_val, '-');
	if( NULL == needle )
	{
		delete []str_val;
	}
	needle++;/*we already have '-' in it */
	char *part = major;
	while( *needle != '\0' )
	{
		if( *needle == '.' )
		{
			needle++;
			part = minor;
			iter = 0;
			continue;
		}
		if( iter > 2 )
		{
			iter = -1;
			break;
		}
		part[iter] = *needle;
		iter++;
		needle++;
	}
	XercesString::Delete(str_val);
	if( iter != -1 )
	{
		_major = (unsigned short)atoi(major);
		_minor = (unsigned short)atoi(minor);
		return 0;
	}
	return -1;
}
开发者ID:kobewang,项目名称:registrar_toolkit,代码行数:49,代码来源:EppUtil.cpp

示例3: substring

DOMString EppUtil::substring(char sep , const DOMString & src)
{
	DOMString name;
	if ( src.isNull() ) return name;
	name = src;
	char * nameStr = name.transcode();
	if ( nameStr == null ) return name;
	int totalLen = name.length();
	char * indexPtr = strchr(nameStr, sep);
	if ( indexPtr != null )
	{
		int len = indexPtr - nameStr;
		name = name.substringData(len+1, totalLen);
	}
	XercesString::Delete(nameStr);
	return name;
}
开发者ID:kobewang,项目名称:registrar_toolkit,代码行数:17,代码来源:EppUtil.cpp

示例4: getDate

time_t EppUtil::getDate( const DOMNode& root, bool dateOnly )
{
	time_t cal = 0;

	DOMString s = EppUtil::getText(root);
	if( s.isNotNull() && s.length() > 0 )
	{
		char * buf = s.transcode();
		if( buf != null )
		{
			cal = EppUtil::getDate(buf, dateOnly);
			XercesString::Delete(buf);
		}
	}

	return cal;
}
开发者ID:kobewang,项目名称:registrar_toolkit,代码行数:17,代码来源:EppUtil.cpp

示例5: if

EppResponse * EppResponse::fromXML( const DOMNode& root )
{
	unsigned int i;
	EppResponse * rsp = null;
	DOMNode* response;
	bool found = false;

	DOMNodeList* list = root.getChildNodes();
	for( i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node = list->item(i);
		DOMString name = node->getLocalName();

		if( name.isNull() )
		{
			name = node->getNodeName();
		}
		if( name.isNull() )
		{
			continue;
		}
		if( name.equals("response") )
		{
			response = node;
			found = true;
			break;
		}
	}

	if( found == false )
	{
		return null;
	}

	rsp = new EppResponse();
	list = response->getChildNodes();
	for( i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node = list->item(i);
		DOMString name = node->getLocalName();
		if( name.isNull() )
		{
			name = node->getNodeName();
		}
		if( name.isNull() )
		{
			continue;
		}
		if( name.equals("result") )
		{
			EppResult * r = EppResult::fromXML(*node);
			if( r != null )
			{
				rsp->result->addElement(r);
			}
		}
		else if( name.equals("msgQ") )
		{
			DOMElement * elm = (DOMElement *) node;
			DOMString id = elm->getAttribute(XS("id"));
			if( id.isNotNull() && id.length() > 0 )
			{
				rsp->msgId = id;
			}
			DOMString str = elm->getAttribute(XS("count"));
			if( str.isNotNull() && str.length() > 0 )
			{
				char * p = str.transcode();
				if( p != null )
				{
					rsp->msgQCount = atoi(p);
					XercesString::Delete(p);
				}
			}

			DOMNodeList* qlist = node->getChildNodes();
			for( unsigned int j = 0; j < qlist->getLength(); j++ )
			{
				node = qlist->item(j);
				name = node->getLocalName();

				if( name.isNull() )
				{
					name = node->getNodeName();
				}
				if( name.isNull() )
				{
					continue;
				}
				if( name.equals("qDate") )
				{
					rsp->msgQDate = EppUtil::getDate(*node);
				}
				else if( name.equals("msg") )
				{
					rsp->msgQText = EppUtil::getText(*node);
				}
			}
		}
		else if( name.equals("resData") )
//.........这里部分代码省略.........
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:101,代码来源:EppResponse.cpp

示例6: if

EppSecDnsKeyData * EppSecDnsKeyData::fromXML( const DOMNode &root )
{
	EppSecDnsKeyData	* data = new EppSecDnsKeyData();
	if( data == null )
	{
		return data;
	}

	char *p = null;
	DOMString	value;
	DOMNodeList* list = root.getChildNodes();

	for( unsigned int i = 0; i < list->getLength(); i++ )
	{
		DOMNode* node = list->item(i);
		DOMString name = node->getLocalName();
		if( name.isNull() )
		{
			name = node->getNodeName();
		}
		if( name.isNull() )
		{
			continue;
		}
		if( name.substringData(0, 7).equals("secDNS:") )
		{
			name = name.substringData(7, name.length() - 7);
		}
		if( name.equals("flags") )
		{
			value = EppUtil::getText(*node);
			p = value.transcode();
			if( p != null )
			{
				uint16_t f = (uint16_t) ::atoi(p);
				XercesString::Delete(p);
				data->setFlags( f );
			}
		}
		else if( name.equals("protocol") )
		{
			value = EppUtil::getText(*node);
			p = value.transcode();
			if( p != null )
			{
				uint8_t proto = (uint8_t) ::atoi(p);
				XercesString::Delete(p);
				data->setProtocol( proto );
			}
		}
		else if( name.equals("alg") )
		{
			value = EppUtil::getText(*node);
			p = value.transcode();
			if( p != null )
			{
				uint8_t a = (uint8_t) ::atoi(p);
				XercesString::Delete(p);
				data->setAlgorithm(a);
			}
		}
		else if( name.equals("pubKey") )
		{
			value = EppUtil::getText(*node);
			if( value.length() > 0 )
			{
				data->setPublicKey(value);
			}
		}
	}

	return data;
}
开发者ID:neustar,项目名称:registrar_toolkit,代码行数:73,代码来源:EppSecDnsKeyData.cpp


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