本文整理汇总了C++中CFX_WideString::Right方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_WideString::Right方法的具体用法?C++ CFX_WideString::Right怎么用?C++ CFX_WideString::Right使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_WideString
的用法示例。
在下文中一共展示了CFX_WideString::Right方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: XFA_ResolveNode_DoPredicateFilter
void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter(
int32_t iCurIndex,
CFX_WideString wsCondition,
int32_t iFoundCount,
CXFA_ResolveNodesData& rnd) {
CXFA_NodeArray& findNodes = (CXFA_NodeArray&)rnd.m_Nodes;
FXSYS_assert(iFoundCount == findNodes.GetSize());
CFX_WideString wsExpression;
IXFA_ScriptContext* pContext = NULL;
XFA_SCRIPTLANGTYPE eLangType = XFA_SCRIPTLANGTYPE_Unkown;
if (wsCondition.Left(2) == FX_WSTRC(L".[") &&
wsCondition.Right(1) == FX_WSTRC(L"]")) {
eLangType = XFA_SCRIPTLANGTYPE_Formcalc;
} else if (wsCondition.Left(2) == FX_WSTRC(L".(") &&
wsCondition.Right(1) == FX_WSTRC(L")")) {
eLangType = XFA_SCRIPTLANGTYPE_Javascript;
} else {
return;
}
pContext = rnd.m_pSC;
wsExpression = wsCondition.Mid(2, wsCondition.GetLength() - 3);
for (int32_t i = iFoundCount - 1; i >= 0; i--) {
CXFA_Object* node = findNodes[i];
FX_BOOL bRet = FALSE;
FXJSE_HVALUE pRetValue = FXJSE_Value_Create(rnd.m_pSC->GetRuntime());
bRet = pContext->RunScript(eLangType, wsExpression, pRetValue, node);
if (!bRet || !FXJSE_Value_ToBoolean(pRetValue)) {
findNodes.RemoveAt(i);
}
FXJSE_Value_Release(pRetValue);
}
}
示例2: ResolveNodes_CreateNode
FX_BOOL CXFA_NodeHelper::ResolveNodes_CreateNode(
CFX_WideString wsName,
CFX_WideString wsCondition,
FX_BOOL bLastNode,
CXFA_ScriptContext* pScriptContext) {
if (!m_pCreateParent) {
return FALSE;
}
FX_BOOL bIsClassName = FALSE;
FX_BOOL bResult = FALSE;
if (wsName.GetAt(0) == '!') {
wsName = wsName.Right(wsName.GetLength() - 1);
m_pCreateParent = ToNode(
pScriptContext->GetDocument()->GetXFAObject(XFA_HASHCODE_Datasets));
}
if (wsName.GetAt(0) == '#') {
bIsClassName = TRUE;
wsName = wsName.Right(wsName.GetLength() - 1);
}
if (m_iCreateCount == 0) {
CreateNode_ForCondition(wsCondition);
}
if (bIsClassName) {
XFA_Element eType = XFA_GetElementTypeForName(wsName.AsStringC());
if (eType == XFA_Element::Unknown)
return FALSE;
for (int32_t iIndex = 0; iIndex < m_iCreateCount; iIndex++) {
CXFA_Node* pNewNode = m_pCreateParent->CreateSamePacketNode(eType);
if (pNewNode) {
m_pCreateParent->InsertChild(pNewNode);
if (iIndex == m_iCreateCount - 1) {
m_pCreateParent = pNewNode;
}
bResult = TRUE;
}
}
} else {
XFA_Element eClassType = XFA_Element::DataGroup;
if (bLastNode) {
eClassType = m_eLastCreateType;
}
for (int32_t iIndex = 0; iIndex < m_iCreateCount; iIndex++) {
CXFA_Node* pNewNode = m_pCreateParent->CreateSamePacketNode(eClassType);
if (pNewNode) {
pNewNode->SetAttribute(XFA_ATTRIBUTE_Name, wsName.AsStringC());
pNewNode->CreateXMLMappingNode();
m_pCreateParent->InsertChild(pNewNode);
if (iIndex == m_iCreateCount - 1) {
m_pCreateParent = pNewNode;
}
bResult = TRUE;
}
}
}
if (!bResult) {
m_pCreateParent = nullptr;
}
return bResult;
}
示例3: XFA_ResolveNodes_AnyChild
int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_AnyChild(
CXFA_ResolveNodesData& rnd) {
CFX_WideString wsName = rnd.m_wsName.Right(rnd.m_wsName.GetLength() - 1);
CFX_WideString wsCondition = rnd.m_wsCondition;
CXFA_Node* findNode = NULL;
CXFA_NodeArray siblings;
FX_BOOL bClassName = FALSE;
if (wsName.GetAt(0) == '#') {
bClassName = TRUE;
wsName = wsName.Right(wsName.GetLength() - 1);
}
findNode = m_pNodeHelper->XFA_ResolveNodes_GetOneChild(ToNode(rnd.m_CurNode),
wsName, bClassName);
if (findNode == NULL) {
return 0;
}
if (wsCondition.IsEmpty()) {
rnd.m_Nodes.Add(findNode);
return rnd.m_Nodes.GetSize();
}
m_pNodeHelper->XFA_CountSiblings(findNode, XFA_LOGIC_Transparent,
(CXFA_NodeArray*)&rnd.m_Nodes, bClassName);
XFA_ResolveNode_FilterCondition(rnd, wsCondition);
return rnd.m_Nodes.GetSize();
}
示例4: NormalPropertySetter
void CXFA_ScriptContext::NormalPropertySetter(CFXJSE_Value* pOriginalValue,
const CFX_ByteStringC& szPropName,
CFXJSE_Value* pReturnValue) {
CXFA_Object* pOriginalObject = ToObject(pOriginalValue, nullptr);
if (!pOriginalObject)
return;
CXFA_ScriptContext* lpScriptContext =
pOriginalObject->GetDocument()->GetScriptContext();
CXFA_Object* pObject = lpScriptContext->GetVariablesThis(pOriginalObject);
CFX_WideString wsPropName = CFX_WideString::FromUTF8(szPropName);
const XFA_SCRIPTATTRIBUTEINFO* lpAttributeInfo = XFA_GetScriptAttributeByName(
pObject->GetElementType(), wsPropName.AsStringC());
if (lpAttributeInfo) {
(pObject->*(lpAttributeInfo->lpfnCallback))(
pReturnValue, TRUE, (XFA_ATTRIBUTE)lpAttributeInfo->eAttribute);
} else {
if (pObject->IsNode()) {
if (wsPropName.GetAt(0) == '#') {
wsPropName = wsPropName.Right(wsPropName.GetLength() - 1);
}
CXFA_Node* pNode = ToNode(pObject);
CXFA_Node* pPropOrChild = nullptr;
XFA_Element eType = XFA_GetElementTypeForName(wsPropName.AsStringC());
if (eType != XFA_Element::Unknown)
pPropOrChild = pNode->GetProperty(0, eType);
else
pPropOrChild = pNode->GetFirstChildByName(wsPropName.AsStringC());
if (pPropOrChild) {
CFX_WideString wsDefaultName(L"{default}");
const XFA_SCRIPTATTRIBUTEINFO* lpAttrInfo =
XFA_GetScriptAttributeByName(pPropOrChild->GetElementType(),
wsDefaultName.AsStringC());
if (lpAttrInfo) {
(pPropOrChild->*(lpAttrInfo->lpfnCallback))(
pReturnValue, TRUE, (XFA_ATTRIBUTE)lpAttrInfo->eAttribute);
return;
}
}
}
CXFA_Object* pScriptObject =
lpScriptContext->GetVariablesThis(pOriginalObject, TRUE);
if (pScriptObject) {
lpScriptContext->QueryVariableValue(ToNode(pScriptObject), szPropName,
pReturnValue, FALSE);
}
}
}
示例5: FX_LocaleMgr_Create
IFX_LocaleMgr* FX_LocaleMgr_Create(const FX_WCHAR* pszLocalPath,
FX_WORD wDefaultLCID) {
void* pPathHandle = FX_OpenFolder(pszLocalPath);
if (!pPathHandle) {
return NULL;
}
CFX_LocaleMgr* pLocaleMgr = new CFX_LocaleMgr(wDefaultLCID);
CFX_WideString wsFileName;
FX_BOOL bFolder = FALSE;
while (FX_GetNextFile(pPathHandle, wsFileName, bFolder)) {
if (!bFolder) {
if (wsFileName.GetLength() < 4) {
continue;
}
CFX_WideString wsExt = wsFileName.Right(4);
wsExt.MakeLower();
if (wsExt != L".xml") {
continue;
}
CFX_WideString wsFullPath(pszLocalPath);
wsFullPath += L"\\" + wsFileName;
IFX_FileRead* pRead = FX_CreateFileRead(wsFullPath);
if (!pRead) {
continue;
}
CXML_Element* pXmlLocale = CXML_Element::Parse(pRead);
pRead->Release();
CFX_ByteString bssp = pXmlLocale->GetNamespace();
if (bssp == "http://www.foxitsoftware.com/localization") {
CFX_WideString wsLCID = pXmlLocale->GetAttrValue("", "lcid");
wchar_t* pEnd = NULL;
FX_DWORD dwLCID = wcstol(wsLCID, &pEnd, 16);
if (pLocaleMgr->m_lcid2xml.GetValueAt((void*)(uintptr_t)dwLCID)) {
delete pXmlLocale;
} else {
pLocaleMgr->m_lcid2xml.SetAt((void*)(uintptr_t)dwLCID, pXmlLocale);
}
} else {
delete pXmlLocale;
}
}
}
FX_CloseFolder(pPathHandle);
return pLocaleMgr;
}
示例6: ExtractFindWhat
void CPDF_TextPageFind::ExtractFindWhat(const CFX_WideString& findwhat) {
if (findwhat.IsEmpty())
return;
int index = 0;
while (1) {
CFX_WideString csWord = TEXT_EMPTY;
int ret =
ExtractSubString(csWord, findwhat.c_str(), index, TEXT_SPACE_CHAR);
if (csWord.IsEmpty()) {
if (ret) {
m_csFindWhatArray.push_back(L"");
index++;
continue;
} else {
break;
}
}
int pos = 0;
while (pos < csWord.GetLength()) {
CFX_WideString curStr = csWord.Mid(pos, 1);
FX_WCHAR curChar = csWord.GetAt(pos);
if (IsIgnoreSpaceCharacter(curChar)) {
if (pos > 0 && curChar == 0x2019) {
pos++;
continue;
}
if (pos > 0)
m_csFindWhatArray.push_back(csWord.Mid(0, pos));
m_csFindWhatArray.push_back(curStr);
if (pos == csWord.GetLength() - 1) {
csWord.clear();
break;
}
csWord = csWord.Right(csWord.GetLength() - pos - 1);
pos = 0;
continue;
}
pos++;
}
if (!csWord.IsEmpty())
m_csFindWhatArray.push_back(csWord);
index++;
}
}
示例7: ValidateCanonicalDateTime
FX_BOOL CXFA_LocaleValue::ValidateCanonicalDateTime(
const CFX_WideString& wsDateTime) {
CFX_WideString wsDate, wsTime;
if (wsDateTime.IsEmpty()) {
return FALSE;
}
int nSplitIndex = -1;
nSplitIndex = wsDateTime.Find('T');
if (nSplitIndex < 0) {
nSplitIndex = wsDateTime.Find(' ');
}
if (nSplitIndex < 0) {
return FALSE;
}
wsDate = wsDateTime.Left(nSplitIndex);
wsTime = wsDateTime.Right(wsDateTime.GetLength() - nSplitIndex - 1);
CFX_Unitime dt;
return ValidateCanonicalDate(wsDate, dt) && ValidateCanonicalTime(wsTime);
}
示例8: XFA_ValueSplitDateTime
static FX_BOOL XFA_ValueSplitDateTime(const CFX_WideString& wsDateTime,
CFX_WideString& wsDate,
CFX_WideString& wsTime) {
wsDate = L"";
wsTime = L"";
if (wsDateTime.IsEmpty()) {
return FALSE;
}
int nSplitIndex = -1;
nSplitIndex = wsDateTime.Find('T');
if (nSplitIndex < 0) {
nSplitIndex = wsDateTime.Find(' ');
}
if (nSplitIndex < 0) {
return FALSE;
}
wsDate = wsDateTime.Left(nSplitIndex);
wsTime = wsDateTime.Right(wsDateTime.GetLength() - nSplitIndex - 1);
return TRUE;
}
示例9: MailToInfo
bool CPDFXFA_DocEnvironment::MailToInfo(CFX_WideString& csURL,
CFX_WideString& csToAddress,
CFX_WideString& csCCAddress,
CFX_WideString& csBCCAddress,
CFX_WideString& csSubject,
CFX_WideString& csMsg) {
CFX_WideString srcURL = csURL;
srcURL.TrimLeft();
if (srcURL.Left(7).CompareNoCase(L"mailto:") != 0)
return false;
int pos = srcURL.Find(L'?', 0);
CFX_WideString tmp;
if (pos == -1) {
pos = srcURL.Find(L'@', 0);
if (pos == -1)
return false;
tmp = srcURL.Right(csURL.GetLength() - 7);
} else {
tmp = srcURL.Left(pos);
tmp = tmp.Right(tmp.GetLength() - 7);
}
tmp.TrimLeft();
tmp.TrimRight();
csToAddress = tmp;
srcURL = srcURL.Right(srcURL.GetLength() - (pos + 1));
while (!srcURL.IsEmpty()) {
srcURL.TrimLeft();
srcURL.TrimRight();
pos = srcURL.Find(L'&', 0);
tmp = (pos == -1) ? srcURL : srcURL.Left(pos);
tmp.TrimLeft();
tmp.TrimRight();
if (tmp.GetLength() >= 3 && tmp.Left(3).CompareNoCase(L"cc=") == 0) {
tmp = tmp.Right(tmp.GetLength() - 3);
if (!csCCAddress.IsEmpty())
csCCAddress += L';';
csCCAddress += tmp;
} else if (tmp.GetLength() >= 4 &&
tmp.Left(4).CompareNoCase(L"bcc=") == 0) {
tmp = tmp.Right(tmp.GetLength() - 4);
if (!csBCCAddress.IsEmpty())
csBCCAddress += L';';
csBCCAddress += tmp;
} else if (tmp.GetLength() >= 8 &&
tmp.Left(8).CompareNoCase(L"subject=") == 0) {
tmp = tmp.Right(tmp.GetLength() - 8);
csSubject += tmp;
} else if (tmp.GetLength() >= 5 &&
tmp.Left(5).CompareNoCase(L"body=") == 0) {
tmp = tmp.Right(tmp.GetLength() - 5);
csMsg += tmp;
}
srcURL = (pos == -1) ? L"" : srcURL.Right(csURL.GetLength() - (pos + 1));
}
csToAddress.Replace(L",", L";");
csCCAddress.Replace(L",", L";");
csBCCAddress.Replace(L",", L";");
return true;
}