本文整理汇总了C#中com.ximpleware.VTDNav.compareRawTokenString方法的典型用法代码示例。如果您正苦于以下问题:C# VTDNav.compareRawTokenString方法的具体用法?C# VTDNav.compareRawTokenString怎么用?C# VTDNav.compareRawTokenString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ximpleware.VTDNav
的用法示例。
在下文中一共展示了VTDNav.compareRawTokenString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: matchLocalName
private bool matchLocalName(VTDNav vn)
{
if (argCount1 == 1)
{
try
{
int index = vn.getCurrentIndex();
int type = vn.getTokenType(index);
String s1 = argumentList.e.evalString(vn);
if (vn.ns && (type == VTDNav.TOKEN_STARTING_TAG
|| type == VTDNav.TOKEN_ATTR_NAME))
{
int offset = vn.getTokenOffset(index);
int length = vn.getTokenLength(index);
if (length < 0x10000 || (length >> 16) == 0)
{
return (vn.compareRawTokenString(index, s1) == 0);//vn.toRawString(index);
}
else
{
int preLen = length >> 16;
int QLen = length & 0xffff;
if (preLen != 0)
{
return (vn.compareRawTokenString(offset + preLen + 1, QLen
- preLen - 1, s1) == 0);
}
}
}
else if (type == VTDNav.TOKEN_PI_NAME)
{
return vn.compareRawTokenString(index, s1) == 0;
}
else
return "".Equals(s1);
}
catch (NavException e)
{
return false; // this will never occur
}
}
else if (argCount1 == 2)
{
int a = evalFirstArgumentListNodeSet2(vn);
String s1 = argumentList.next.e.evalString(vn);
if (a == -1 || vn.ns == false)
return "".Equals(s1);
int type = vn.getTokenType(a);
if (type == VTDNav.TOKEN_STARTING_TAG || type == VTDNav.TOKEN_ATTR_NAME)
{
//return "".equals(s1);
try
{
int offset = vn.getTokenOffset(a);
int length = vn.getTokenLength(a);
if (length < 0x10000 || (length >> 16) == 0)
return vn.compareRawTokenString(a, s1) == 0;
else
{
int preLen = length >> 16;
int QLen = length & 0xffff;
if (preLen != 0)
return vn.compareRawTokenString(offset + preLen + 1,
QLen - preLen - 1, s1) == 0;
/*else {
return vn.toRawString(offset, QLen);
}*/
}
}
catch (NavException e)
{
return "".Equals(s1); // this will almost never occur
}
}
else if (type == VTDNav.TOKEN_PI_NAME)
{
try
{
return vn.compareRawTokenString(a, s1) == 0;
}
catch (NavException e)
{
return "".Equals(s1);
}
}
return "".Equals(s1);
}
else
throw new ArgumentException
("match-local-name()'s argument count is invalid");
return false;
}