本文整理汇总了C++中WideString::EqualsASCII方法的典型用法代码示例。如果您正苦于以下问题:C++ WideString::EqualsASCII方法的具体用法?C++ WideString::EqualsASCII怎么用?C++ WideString::EqualsASCII使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WideString
的用法示例。
在下文中一共展示了WideString::EqualsASCII方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execEvent
CJS_Result CJX_Field::execEvent(
CFX_V8* runtime,
const std::vector<v8::Local<v8::Value>>& params) {
if (params.size() != 1)
return CJS_Result::Failure(JSMessage::kParamError);
WideString eventString = runtime->ToWideString(params[0]);
int32_t iRet =
execSingleEventByName(eventString.AsStringView(), XFA_Element::Field);
if (!eventString.EqualsASCII("validate"))
return CJS_Result::Success();
return CJS_Result::Success(runtime->NewBoolean(iRet != XFA_EVENTERROR_Error));
}
示例2: GetTextNode
CXFA_Node* CXFA_TextProvider::GetTextNode(bool& bRichText) {
bRichText = false;
if (m_eType == XFA_TEXTPROVIDERTYPE_Text) {
CXFA_Value* pValueNode =
m_pNode->GetChild<CXFA_Value>(0, XFA_Element::Value, false);
if (!pValueNode)
return nullptr;
CXFA_Node* pChildNode = pValueNode->GetFirstChild();
if (pChildNode && pChildNode->GetElementType() == XFA_Element::ExData) {
Optional<WideString> contentType = pChildNode->JSObject()->TryAttribute(
XFA_Attribute::ContentType, false);
if (contentType.has_value() &&
contentType.value().EqualsASCII("text/html")) {
bRichText = true;
}
}
return pChildNode;
}
if (m_eType == XFA_TEXTPROVIDERTYPE_Datasets) {
CXFA_Node* pBind = m_pNode->GetBindData();
CFX_XMLNode* pXMLNode = pBind->GetXMLMappingNode();
for (CFX_XMLNode* pXMLChild = pXMLNode->GetFirstChild(); pXMLChild;
pXMLChild = pXMLChild->GetNextSibling()) {
CFX_XMLElement* pElement = ToXMLElement(pXMLChild);
if (pElement && XFA_RecognizeRichText(pElement)) {
bRichText = true;
break;
}
}
return pBind;
}
if (m_eType == XFA_TEXTPROVIDERTYPE_Caption) {
CXFA_Caption* pCaptionNode =
m_pNode->GetChild<CXFA_Caption>(0, XFA_Element::Caption, false);
if (!pCaptionNode)
return nullptr;
CXFA_Value* pValueNode =
pCaptionNode->GetChild<CXFA_Value>(0, XFA_Element::Value, false);
if (!pValueNode)
return nullptr;
CXFA_Node* pChildNode = pValueNode->GetFirstChild();
if (pChildNode && pChildNode->GetElementType() == XFA_Element::ExData) {
Optional<WideString> contentType = pChildNode->JSObject()->TryAttribute(
XFA_Attribute::ContentType, false);
if (contentType.has_value() &&
contentType.value().EqualsASCII("text/html")) {
bRichText = true;
}
}
return pChildNode;
}
CXFA_Items* pItemNode =
m_pNode->GetChild<CXFA_Items>(0, XFA_Element::Items, false);
if (!pItemNode)
return nullptr;
CXFA_Node* pNode = pItemNode->GetFirstChild();
while (pNode) {
WideString wsName = pNode->JSObject()->GetCData(XFA_Attribute::Name);
if (m_eType == XFA_TEXTPROVIDERTYPE_Rollover &&
wsName.EqualsASCII("rollover")) {
return pNode;
}
if (m_eType == XFA_TEXTPROVIDERTYPE_Down && wsName.EqualsASCII("down"))
return pNode;
pNode = pNode->GetNextSibling();
}
return nullptr;
}