本文整理汇总了C++中CFX_WideString::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_WideString::IsEmpty方法的具体用法?C++ CFX_WideString::IsEmpty怎么用?C++ CFX_WideString::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_WideString
的用法示例。
在下文中一共展示了CFX_WideString::IsEmpty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFileName
FX_BOOL CPDF_FileSpec::GetFileName(CFX_WideString &csFileName) const
{
if (m_pObj == NULL) {
return FALSE;
}
if (m_pObj->GetType() == PDFOBJ_DICTIONARY) {
CPDF_Dictionary* pDict = (CPDF_Dictionary*)m_pObj;
csFileName = pDict->GetUnicodeText(FX_BSTRC("UF"));
if (csFileName.IsEmpty()) {
csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("F")));
}
if (pDict->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL")) {
return TRUE;
}
if (csFileName.IsEmpty()) {
if (pDict->KeyExist(FX_BSTRC("DOS"))) {
csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("DOS")));
} else if (pDict->KeyExist(FX_BSTRC("Mac"))) {
csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("Mac")));
} else if (pDict->KeyExist(FX_BSTRC("Unix"))) {
csFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("Unix")));
} else {
return FALSE;
}
}
} else {
csFileName = CFX_WideString::FromLocal(m_pObj->GetString());
}
csFileName = FILESPEC_DecodeFileName(csFileName);
return TRUE;
}
示例2: ChangeSlash
CFX_WideString FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec)
{
CFX_WideString wsFileName;
if (pFileSpec->GetType() == PDFOBJ_DICTIONARY) {
CPDF_Dictionary* pDict = (CPDF_Dictionary*)pFileSpec;
wsFileName = pDict->GetUnicodeText(FX_BSTRC("UF"));
if (wsFileName.IsEmpty()) {
wsFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("F")));
}
if (pDict->GetString(FX_BSTRC("FS")) == FX_BSTRC("URL")) {
return wsFileName;
}
if (wsFileName.IsEmpty() && pDict->KeyExist(FX_BSTRC("DOS"))) {
wsFileName = CFX_WideString::FromLocal(pDict->GetString(FX_BSTRC("DOS")));
}
} else {
wsFileName = CFX_WideString::FromLocal(pFileSpec->GetString());
}
if (wsFileName[0] != '/') {
return ChangeSlash(wsFileName);
}
if (wsFileName[2] == '/') {
CFX_WideString result;
result += wsFileName[1];
result += ':';
result += ChangeSlash(((FX_LPCWSTR)wsFileName) + 2);
return result;
} else {
CFX_WideString result;
result += '\\';
result += ChangeSlash(wsFileName);
return result;
}
}
示例3: GetFileName
FX_BOOL CPDF_FileSpec::GetFileName(CFX_WideString& csFileName) const {
if (!m_pObj) {
return FALSE;
}
if (CPDF_Dictionary* pDict = m_pObj->AsDictionary()) {
csFileName = pDict->GetUnicodeTextBy("UF");
if (csFileName.IsEmpty()) {
csFileName = CFX_WideString::FromLocal(pDict->GetStringBy("F"));
}
if (pDict->GetStringBy("FS") == "URL") {
return TRUE;
}
if (csFileName.IsEmpty()) {
if (pDict->KeyExist("DOS")) {
csFileName = CFX_WideString::FromLocal(pDict->GetStringBy("DOS"));
} else if (pDict->KeyExist("Mac")) {
csFileName = CFX_WideString::FromLocal(pDict->GetStringBy("Mac"));
} else if (pDict->KeyExist("Unix")) {
csFileName = CFX_WideString::FromLocal(pDict->GetStringBy("Unix"));
} else {
return FALSE;
}
}
} else {
csFileName = CFX_WideString::FromLocal(m_pObj->GetString());
}
csFileName = FILESPEC_DecodeFileName(csFileName);
return TRUE;
}
示例4: ValidateFieldName
bool CPDF_InterForm::ValidateFieldName(
CFX_WideString& csNewFieldName,
int iType,
const CPDF_FormField* pExcludedField,
const CPDF_FormControl* pExcludedControl) const {
if (csNewFieldName.IsEmpty())
return false;
int iPos = 0;
int iLength = csNewFieldName.GetLength();
CFX_WideString csSub;
while (true) {
while (iPos < iLength &&
(csNewFieldName[iPos] == L'.' || csNewFieldName[iPos] == L' ')) {
iPos++;
}
if (iPos < iLength && !csSub.IsEmpty())
csSub += L'.';
while (iPos < iLength && csNewFieldName[iPos] != L'.')
csSub += csNewFieldName[iPos++];
for (int i = csSub.GetLength() - 1; i > -1; i--) {
if (csSub[i] != L' ' && csSub[i] != L'.')
break;
csSub.SetAt(i, L'\0');
}
size_t dwCount = m_pFieldTree->m_Root.CountFields();
for (size_t m = 0; m < dwCount; ++m) {
CPDF_FormField* pField = m_pFieldTree->m_Root.GetFieldAtIndex(m);
if (!pField)
continue;
if (pField == pExcludedField) {
if (!pExcludedControl || pField->CountControls() < 2)
continue;
}
CFX_WideString csFullName = pField->GetFullName();
int iRet = CompareFieldName(csSub, csFullName);
if (iRet == 1) {
if (pField->GetFieldType() != iType)
return false;
} else if (iRet == 2 && csSub == csNewFieldName) {
if (csFullName[iPos] == L'.')
return false;
} else if (iRet == 3 && csSub == csNewFieldName) {
if (csNewFieldName[csFullName.GetLength()] == L'.')
return false;
}
}
if (iPos >= iLength)
break;
}
if (csSub.IsEmpty())
return false;
csNewFieldName = csSub;
return true;
}
示例5: Equal
bool CFX_WideString::Equal(const CFX_WideString& other) const {
if (IsEmpty()) {
return other.IsEmpty();
}
if (other.IsEmpty()) {
return false;
}
return other.m_pData->m_nDataLength == m_pData->m_nDataLength &&
wmemcmp(other.m_pData->m_String, m_pData->m_String,
m_pData->m_nDataLength) == 0;
}
示例6: UnicodeFromCharCode
CFX_WideString CPDF_CIDFont::UnicodeFromCharCode(uint32_t charcode) const {
CFX_WideString str = CPDF_Font::UnicodeFromCharCode(charcode);
if (!str.IsEmpty())
return str;
FX_WCHAR ret = GetUnicodeFromCharCode(charcode);
return ret ? ret : CFX_WideString();
}
示例7: GetPageText
CFX_WideString CRF_TextPage::GetPageText(int start, int nCount ) const
{
if(nCount == -1) {
nCount = CountChars();
start = 0;
} else if(nCount < 1) {
return L"";
} else if(start >= CountChars()) {
return L"";
}
int i, index = start + nCount;
FPDF_CHAR_INFO info;
CFX_WideString str;
CFX_FloatRect recttmp;
FX_BOOL bstart = TRUE;
for(i = start; i < index; i++) {
GetCharInfo(i, info);
if(bstart) {
recttmp = info.m_CharBox;
str += info.m_Unicode;
bstart = FALSE;
} else if (_IsInsameline(recttmp, info.m_CharBox)) {
str += info.m_Unicode;
} else {
str += L"\r\n";
recttmp = info.m_CharBox;
str += info.m_Unicode;
}
}
if(str.IsEmpty()) {
return L"";
}
return str;
}
示例8: SetText
void CFDE_TxtEdtBuf::SetText(const CFX_WideString& wsText) {
ASSERT(!wsText.IsEmpty());
Clear(FALSE);
int32_t nTextLength = wsText.GetLength();
int32_t nNeedCount =
((nTextLength - 1) / m_nChunkSize + 1) - m_Chunks.GetSize();
int32_t i = 0;
for (i = 0; i < nNeedCount; i++) {
FDE_CHUNKHEADER* lpChunk =
static_cast<FDE_CHUNKHEADER*>(m_pAllocator->Alloc(
sizeof(FDE_CHUNKHEADER) + (m_nChunkSize - 1) * sizeof(FX_WCHAR)));
lpChunk->nUsed = 0;
m_Chunks.Add(lpChunk);
}
int32_t nTotalCount = m_Chunks.GetSize();
const FX_WCHAR* lpSrcBuf = wsText.c_str();
int32_t nLeave = nTextLength;
int32_t nCopyedLength = m_nChunkSize;
for (i = 0; i < nTotalCount && nLeave > 0; i++) {
if (nLeave < nCopyedLength) {
nCopyedLength = nLeave;
}
FDE_CHUNKHEADER* lpChunk = m_Chunks[i];
FXSYS_memcpy(lpChunk->wChars, lpSrcBuf, nCopyedLength * sizeof(FX_WCHAR));
nLeave -= nCopyedLength;
lpSrcBuf += nCopyedLength;
lpChunk->nUsed = nCopyedLength;
}
m_nTotal = nTextLength;
m_bChanged = TRUE;
}
示例9: SetContents
void CPDFSDK_BAAnnot::SetContents(const CFX_WideString& sContents) {
if (sContents.IsEmpty())
m_pAnnot->GetAnnotDict()->RemoveAt("Contents");
else
m_pAnnot->GetAnnotDict()->SetAtString("Contents",
PDF_EncodeText(sContents));
}
示例10: ExecuteDocumentPageAction
bool CPDFSDK_ActionHandler::ExecuteDocumentPageAction(
const CPDF_Action& action,
CPDF_AAction::AActionType type,
CPDFSDK_FormFillEnvironment* pFormFillEnv,
std::set<CPDF_Dictionary*>* visited) {
CPDF_Dictionary* pDict = action.GetDict();
if (pdfium::ContainsKey(*visited, pDict))
return false;
visited->insert(pDict);
ASSERT(pFormFillEnv);
if (action.GetType() == CPDF_Action::JavaScript) {
if (pFormFillEnv->IsJSInitiated()) {
CFX_WideString swJS = action.GetJavaScript();
if (!swJS.IsEmpty()) {
RunDocumentPageJavaScript(pFormFillEnv, type, swJS);
}
}
} else {
DoAction_NoJs(action, pFormFillEnv);
}
if (!IsValidDocView(pFormFillEnv))
return false;
for (int32_t i = 0, sz = action.GetSubActionsCount(); i < sz; i++) {
CPDF_Action subaction = action.GetSubAction(i);
if (!ExecuteDocumentPageAction(subaction, type, pFormFillEnv, visited))
return false;
}
return true;
}
示例11: CountFields
size_t CPDF_InterForm::CountFields(const CFX_WideString& csFieldName) const {
if (csFieldName.IsEmpty())
return m_pFieldTree->m_Root.CountFields();
CFieldTree::Node* pNode = m_pFieldTree->FindNode(csFieldName);
return pNode ? pNode->CountFields() : 0;
}
示例12: ExecuteDocumentOpenAction
FX_BOOL CPDFSDK_ActionHandler::ExecuteDocumentOpenAction(
const CPDF_Action& action,
CPDFSDK_Document* pDocument,
CFX_PtrList& list) {
CPDF_Dictionary* pDict = action.GetDict();
if (list.Find(pDict))
return FALSE;
list.AddTail(pDict);
CPDFDoc_Environment* pEnv = pDocument->GetEnv();
ASSERT(pEnv);
if (action.GetType() == CPDF_Action::JavaScript) {
if (pEnv->IsJSInitiated()) {
CFX_WideString swJS = action.GetJavaScript();
if (!swJS.IsEmpty()) {
RunDocumentOpenJavaScript(pDocument, L"", swJS);
}
}
} else {
DoAction_NoJs(action, pDocument);
}
for (int32_t i = 0, sz = action.GetSubActionsCount(); i < sz; i++) {
CPDF_Action subaction = action.GetSubAction(i);
if (!ExecuteDocumentOpenAction(subaction, pDocument, list))
return FALSE;
}
return TRUE;
}
示例13: ShowNullTestMsg
void CXFA_FFDocView::ShowNullTestMsg() {
int32_t iCount = m_arrNullTestMsg.GetSize();
CXFA_FFApp* pApp = m_pDoc->GetApp();
IXFA_AppProvider* pAppProvider = pApp->GetAppProvider();
if (pAppProvider && iCount) {
int32_t iRemain = iCount > 7 ? iCount - 7 : 0;
iCount -= iRemain;
CFX_WideString wsMsg;
for (int32_t i = 0; i < iCount; i++) {
wsMsg += m_arrNullTestMsg[i] + FX_WSTRC(L"\n");
}
if (iRemain > 0) {
CFX_WideString wsLimit;
pAppProvider->LoadString(XFA_IDS_ValidateLimit, wsLimit);
if (!wsLimit.IsEmpty()) {
CFX_WideString wsTemp;
wsTemp.Format((const FX_WCHAR*)wsLimit, iRemain);
wsMsg += FX_WSTRC(L"\n") + wsTemp;
}
}
CFX_WideString wsTitle;
pAppProvider->LoadString(XFA_IDS_AppName, wsTitle);
pAppProvider->MsgBox(wsMsg, wsTitle, XFA_MBICON_Status, XFA_MB_OK);
}
m_arrNullTestMsg.RemoveAll();
}
示例14: InsertOption
int CPDF_FormField::InsertOption(CFX_WideString csOptLabel,
int index,
FX_BOOL bNotify) {
if (csOptLabel.IsEmpty())
return -1;
if (bNotify && !NotifyListOrComboBoxBeforeChange(csOptLabel))
return -1;
CFX_ByteString csStr =
PDF_EncodeText(csOptLabel.c_str(), csOptLabel.GetLength());
CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "Opt");
CPDF_Array* pOpt = ToArray(pValue);
if (!pOpt) {
pOpt = new CPDF_Array;
m_pDict->SetAt("Opt", pOpt);
}
int iCount = (int)pOpt->GetCount();
if (index < 0 || index >= iCount) {
pOpt->AddString(csStr);
index = iCount;
} else {
CPDF_String* pString = new CPDF_String(csStr, FALSE);
pOpt->InsertAt(index, pString);
}
if (bNotify)
NotifyListOrComboBoxAfterChange();
return index;
}
示例15: SubmitForm
FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination,
FX_BOOL bUrlEncoded) {
if (sDestination.IsEmpty())
return FALSE;
if (!m_pDocument || !m_pInterForm)
return FALSE;
CPDFSDK_Environment* pEnv = m_pDocument->GetEnv();
CFX_WideString wsPDFFilePath = m_pDocument->GetPath();
CFDF_Document* pFDFDoc =
m_pInterForm->ExportToFDF(wsPDFFilePath.AsStringC(), false);
if (!pFDFDoc)
return FALSE;
CFX_ByteTextBuf FdfBuffer;
FX_BOOL bRet = pFDFDoc->WriteBuf(FdfBuffer);
delete pFDFDoc;
if (!bRet)
return FALSE;
uint8_t* pBuffer = FdfBuffer.GetBuffer();
FX_STRSIZE nBufSize = FdfBuffer.GetLength();
if (bUrlEncoded && !FDFToURLEncodedData(pBuffer, nBufSize))
return FALSE;
pEnv->JS_docSubmitForm(pBuffer, nBufSize, sDestination.c_str());
if (bUrlEncoded)
FX_Free(pBuffer);
return TRUE;
}