本文整理汇总了C++中CFX_WideStringC::IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_WideStringC::IsEmpty方法的具体用法?C++ CFX_WideStringC::IsEmpty怎么用?C++ CFX_WideStringC::IsEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_WideStringC
的用法示例。
在下文中一共展示了CFX_WideStringC::IsEmpty方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Equal
bool CFX_WideString::Equal(const CFX_WideStringC& str) const {
if (m_pData == NULL) {
return str.IsEmpty();
}
return str.GetLength() == m_pData->m_nDataLength &&
wmemcmp(str.GetPtr(), m_pData->m_String, m_pData->m_nDataLength) == 0;
}
示例2: Equal
bool CFX_WideString::Equal(const CFX_WideStringC& str) const
{
if (m_pData == NULL) {
return str.IsEmpty();
}
return str.GetLength() == m_pData->m_nDataLength &&
FXSYS_memcmp32(str.GetPtr(), m_pData->m_String, m_pData->m_nDataLength * sizeof(FX_WCHAR)) == 0;
}
示例3: InsertContentSegment
void CXML_Parser::InsertContentSegment(bool bCDATA,
const CFX_WideStringC& content,
CXML_Element* pElement) {
if (content.IsEmpty()) {
return;
}
CXML_Content* pContent = new CXML_Content;
pContent->Set(bCDATA, content);
pElement->m_Children.push_back({CXML_Element::Content, pContent});
}
示例4: InsertContentSegment
void CXML_Parser::InsertContentSegment(FX_BOOL bCDATA, const CFX_WideStringC& content, CXML_Element* pElement)
{
if (content.IsEmpty()) {
return;
}
CXML_Content* pContent = new CXML_Content;
pContent->Set(bCDATA, content);
pElement->m_Children.Add((void*)CXML_Element::Content);
pElement->m_Children.Add(pContent);
}
示例5:
CFX_WideString::CFX_WideString(const CFX_WideStringC& str)
{
if (str.IsEmpty()) {
m_pData = NULL;
return;
}
m_pData = StringData::Create(str.GetLength());
if (m_pData) {
FXSYS_memcpy(m_pData->m_String, str.GetPtr(), str.GetLength()*sizeof(FX_WCHAR));
}
}
示例6: Preprocess
bool CBC_EAN8::Encode(const CFX_WideStringC& contents,
bool isDevice,
int32_t& e) {
if (contents.IsEmpty()) {
e = BCExceptionNoContents;
return false;
}
BCFORMAT format = BCFORMAT_EAN_8;
int32_t outWidth = 0;
int32_t outHeight = 0;
CFX_WideString encodeContents = Preprocess(contents);
CFX_ByteString byteString = encodeContents.UTF8Encode();
m_renderContents = encodeContents;
uint8_t* data = static_cast<CBC_OnedEAN8Writer*>(m_pBCWriter.get())
->Encode(byteString, format, outWidth, outHeight, e);
BC_EXCEPTION_CHECK_ReturnValue(e, false);
static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())
->RenderResult(encodeContents.AsStringC(), data, outWidth, isDevice, e);
FX_Free(data);
BC_EXCEPTION_CHECK_ReturnValue(e, false);
return true;
}
示例7:
int32_t XFA_FM2JS_Translate(const CFX_WideStringC& wsFormcalc,
CFX_WideTextBuf& wsJavascript,
CFX_WideString& wsError) {
if (wsFormcalc.IsEmpty()) {
wsJavascript.Clear();
wsError.Empty();
return 0;
}
int32_t status = 0;
CXFA_FMProgram program;
status = program.Init(wsFormcalc);
if (status) {
wsError = program.GetError().message;
return status;
}
status = program.ParseProgram();
if (status) {
wsError = program.GetError().message;
return status;
}
program.TranslateProgram(wsJavascript);
return 0;
}
示例8: filespec
std::unique_ptr<CFDF_Document> CPDF_InterForm::ExportToFDF(
const CFX_WideStringC& pdf_path,
const std::vector<CPDF_FormField*>& fields,
bool bIncludeOrExclude,
bool bSimpleFileSpec) const {
std::unique_ptr<CFDF_Document> pDoc = CFDF_Document::CreateNewDoc();
if (!pDoc)
return nullptr;
CPDF_Dictionary* pMainDict = pDoc->GetRoot()->GetDictFor("FDF");
if (!pdf_path.IsEmpty()) {
if (bSimpleFileSpec) {
CFX_WideString wsFilePath = CPDF_FileSpec::EncodeFileName(pdf_path);
pMainDict->SetNewFor<CPDF_String>(
"F", CFX_ByteString::FromUnicode(wsFilePath), false);
pMainDict->SetNewFor<CPDF_String>("UF", PDF_EncodeText(wsFilePath),
false);
} else {
CPDF_FileSpec filespec(pDoc->GetByteStringPool());
filespec.SetFileName(pdf_path);
pMainDict->SetFor("F", pdfium::WrapUnique(filespec.GetObj()));
}
}
CPDF_Array* pFields = pMainDict->SetNewFor<CPDF_Array>("Fields");
size_t nCount = m_pFieldTree->m_Root.CountFields();
for (size_t i = 0; i < nCount; ++i) {
CPDF_FormField* pField = m_pFieldTree->m_Root.GetFieldAtIndex(i);
if (!pField || pField->GetType() == CPDF_FormField::PushButton)
continue;
uint32_t dwFlags = pField->GetFieldFlags();
if (dwFlags & 0x04)
continue;
if (bIncludeOrExclude == pdfium::ContainsValue(fields, pField)) {
if ((dwFlags & 0x02) != 0 && pField->m_pDict->GetStringFor("V").IsEmpty())
continue;
CFX_WideString fullname = FPDF_GetFullName(pField->GetFieldDict());
auto pFieldDict =
pdfium::MakeUnique<CPDF_Dictionary>(pDoc->GetByteStringPool());
pFieldDict->SetNewFor<CPDF_String>("T", fullname);
if (pField->GetType() == CPDF_FormField::CheckBox ||
pField->GetType() == CPDF_FormField::RadioButton) {
CFX_WideString csExport = pField->GetCheckValue(false);
CFX_ByteString csBExport = PDF_EncodeText(csExport);
CPDF_Object* pOpt = FPDF_GetFieldAttr(pField->m_pDict, "Opt");
if (pOpt)
pFieldDict->SetNewFor<CPDF_String>("V", csBExport, false);
else
pFieldDict->SetNewFor<CPDF_Name>("V", csBExport);
} else {
CPDF_Object* pV = FPDF_GetFieldAttr(pField->m_pDict, "V");
if (pV)
pFieldDict->SetFor("V", pV->CloneDirectObject());
}
pFields->Add(std::move(pFieldDict));
}
}
return pDoc;
}
示例9: ResolveObjects
int32_t CXFA_ScriptContext::ResolveObjects(CXFA_Object* refNode,
const CFX_WideStringC& wsExpression,
XFA_RESOLVENODE_RS& resolveNodeRS,
uint32_t dwStyles,
CXFA_Node* bindNode) {
if (wsExpression.IsEmpty()) {
return 0;
}
if (m_eScriptType != XFA_SCRIPTLANGTYPE_Formcalc ||
(dwStyles & (XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings))) {
m_upObjectArray.RemoveAll();
}
if (refNode && refNode->IsNode() &&
(dwStyles & (XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_Siblings))) {
m_upObjectArray.Add(refNode->AsNode());
}
FX_BOOL bNextCreate = FALSE;
if (dwStyles & XFA_RESOLVENODE_CreateNode) {
m_ResolveProcessor->GetNodeHelper()->SetCreateNodeType(bindNode);
}
m_ResolveProcessor->GetNodeHelper()->m_pCreateParent = nullptr;
m_ResolveProcessor->GetNodeHelper()->m_iCurAllStart = -1;
CXFA_ResolveNodesData rndFind;
int32_t nStart = 0;
int32_t nLevel = 0;
int32_t nRet = -1;
rndFind.m_pSC = this;
CXFA_ObjArray findNodes;
findNodes.Add(refNode ? refNode : m_pDocument->GetRoot());
int32_t nNodes = 0;
while (TRUE) {
nNodes = findNodes.GetSize();
int32_t i = 0;
rndFind.m_dwStyles = dwStyles;
m_ResolveProcessor->SetCurStart(nStart);
nStart = m_ResolveProcessor->GetFilter(wsExpression, nStart, rndFind);
if (nStart < 1) {
if ((dwStyles & XFA_RESOLVENODE_CreateNode) && !bNextCreate) {
CXFA_Node* pDataNode = nullptr;
nStart = m_ResolveProcessor->GetNodeHelper()->m_iCurAllStart;
if (nStart != -1) {
pDataNode = m_pDocument->GetNotBindNode(findNodes);
if (pDataNode) {
findNodes.RemoveAll();
findNodes.Add(pDataNode);
break;
}
} else {
pDataNode = findNodes[0]->AsNode();
findNodes.RemoveAll();
findNodes.Add(pDataNode);
break;
}
dwStyles |= XFA_RESOLVENODE_Bind;
findNodes.RemoveAll();
findNodes.Add(m_ResolveProcessor->GetNodeHelper()->m_pAllStartParent);
continue;
} else {
break;
}
}
if (bNextCreate) {
FX_BOOL bCreate =
m_ResolveProcessor->GetNodeHelper()->ResolveNodes_CreateNode(
rndFind.m_wsName, rndFind.m_wsCondition,
nStart == wsExpression.GetLength(), this);
if (bCreate) {
continue;
} else {
break;
}
}
CXFA_ObjArray retNodes;
while (i < nNodes) {
FX_BOOL bDataBind = FALSE;
if (((dwStyles & XFA_RESOLVENODE_Bind) ||
(dwStyles & XFA_RESOLVENODE_CreateNode)) &&
nNodes > 1) {
CXFA_ResolveNodesData rndBind;
m_ResolveProcessor->GetFilter(wsExpression, nStart, rndBind);
m_ResolveProcessor->SetIndexDataBind(rndBind.m_wsCondition, i, nNodes);
bDataBind = TRUE;
}
rndFind.m_CurNode = findNodes[i++];
rndFind.m_nLevel = nLevel;
rndFind.m_dwFlag = XFA_RESOVENODE_RSTYPE_Nodes;
nRet = m_ResolveProcessor->Resolve(rndFind);
if (nRet < 1) {
continue;
}
if (rndFind.m_dwFlag == XFA_RESOVENODE_RSTYPE_Attribute &&
rndFind.m_pScriptAttribute && nStart < wsExpression.GetLength()) {
std::unique_ptr<CFXJSE_Value> pValue(new CFXJSE_Value(m_pIsolate));
(rndFind.m_Nodes[0]->*(rndFind.m_pScriptAttribute->lpfnCallback))(
pValue.get(), FALSE,
(XFA_ATTRIBUTE)rndFind.m_pScriptAttribute->eAttribute);
rndFind.m_Nodes.SetAt(0, ToObject(pValue.get(), nullptr));
}
int32_t iSize = m_upObjectArray.GetSize();
if (iSize) {
//.........这里部分代码省略.........