本文整理汇总了C++中CFX_WideStringC类的典型用法代码示例。如果您正苦于以下问题:C++ CFX_WideStringC类的具体用法?C++ CFX_WideStringC怎么用?C++ CFX_WideStringC使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CFX_WideStringC类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RunVariablesScript
FX_BOOL CXFA_ScriptContext::RunVariablesScript(CXFA_Node* pScriptNode) {
if (!pScriptNode)
return FALSE;
if (pScriptNode->GetElementType() != XFA_Element::Script)
return TRUE;
CXFA_Node* pParent = pScriptNode->GetNodeItem(XFA_NODEITEM_Parent);
if (!pParent || pParent->GetElementType() != XFA_Element::Variables)
return FALSE;
if (m_mapVariableToContext.GetValueAt(pScriptNode))
return TRUE;
CXFA_Node* pTextNode = pScriptNode->GetNodeItem(XFA_NODEITEM_FirstChild);
if (!pTextNode)
return FALSE;
CFX_WideStringC wsScript;
if (!pTextNode->TryCData(XFA_ATTRIBUTE_Value, wsScript))
return FALSE;
CFX_ByteString btScript =
FX_UTF8Encode(wsScript.c_str(), wsScript.GetLength());
std::unique_ptr<CFXJSE_Value> hRetValue(new CFXJSE_Value(m_pIsolate));
CXFA_Node* pThisObject = pParent->GetNodeItem(XFA_NODEITEM_Parent);
CFXJSE_Context* pVariablesContext =
CreateVariablesContext(pScriptNode, pThisObject);
CXFA_Object* pOriginalObject = m_pThisObject;
m_pThisObject = pThisObject;
FX_BOOL bRet =
pVariablesContext->ExecuteScript(btScript.c_str(), hRetValue.get());
m_pThisObject = pOriginalObject;
return bRet;
}
示例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 &&
wmemcmp(str.GetPtr(), m_pData->m_String, m_pData->m_nDataLength) == 0;
}
示例3: RenderDeviceResult
void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device,
const CFX_Matrix* matrix,
const CFX_WideStringC& contents,
int32_t& e) {
if (!m_output)
BC_EXCEPTION_CHECK_ReturnVoid(e);
CFX_GraphStateData stateData;
CFX_PathData path;
path.AppendRect(0, 0, (FX_FLOAT)m_Width, (FX_FLOAT)m_Height);
device->DrawPath(&path, matrix, &stateData, m_backgroundColor,
m_backgroundColor, FXFILL_ALTERNATE);
CFX_Matrix matri(m_outputHScale, 0.0, 0.0, (FX_FLOAT)m_Height, 0.0, 0.0);
matri.Concat(*matrix);
for (int32_t x = 0; x < m_output->GetWidth(); x++) {
for (int32_t y = 0; y < m_output->GetHeight(); y++) {
CFX_PathData rect;
rect.AppendRect((FX_FLOAT)x, (FX_FLOAT)y, (FX_FLOAT)(x + 1),
(FX_FLOAT)(y + 1));
if (m_output->Get(x, y)) {
CFX_GraphStateData data;
device->DrawPath(&rect, &matri, &data, m_barColor, 0, FXFILL_WINDING);
}
}
}
int32_t i = 0;
for (; i < contents.GetLength(); i++)
if (contents.GetAt(i) != ' ') {
break;
}
if (m_locTextLoc != BC_TEXT_LOC_NONE && i < contents.GetLength()) {
ShowChars(contents, nullptr, device, matrix, m_barWidth, m_multiple, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
}
示例4: RunScript
FX_BOOL CXFA_ScriptContext::RunScript(XFA_SCRIPTLANGTYPE eScriptType,
const CFX_WideStringC& wsScript,
CFXJSE_Value* hRetValue,
CXFA_Object* pThisObject) {
CFX_ByteString btScript;
XFA_SCRIPTLANGTYPE eSaveType = m_eScriptType;
m_eScriptType = eScriptType;
if (eScriptType == XFA_SCRIPTLANGTYPE_Formcalc) {
if (!m_FM2JSContext) {
m_FM2JSContext.reset(
new CXFA_FM2JSContext(m_pIsolate, m_JsContext.get(), m_pDocument));
}
CFX_WideTextBuf wsJavaScript;
CFX_WideString wsErrorInfo;
int32_t iFlags =
CXFA_FM2JSContext::Translate(wsScript, wsJavaScript, wsErrorInfo);
if (iFlags) {
hRetValue->SetUndefined();
return FALSE;
}
btScript =
FX_UTF8Encode(wsJavaScript.GetBuffer(), wsJavaScript.GetLength());
} else {
btScript = FX_UTF8Encode(wsScript.c_str(), wsScript.GetLength());
}
CXFA_Object* pOriginalObject = m_pThisObject;
m_pThisObject = pThisObject;
CFXJSE_Value* pValue = pThisObject ? GetJSValueFromMap(pThisObject) : nullptr;
FX_BOOL bRet =
m_JsContext->ExecuteScript(btScript.c_str(), hRetValue, pValue);
m_pThisObject = pOriginalObject;
m_eScriptType = eSaveType;
return bRet;
}
示例5: RenderBitmapResult
void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap*& pOutBitmap,
const CFX_WideStringC& contents,
int32_t& e) {
if (!m_output)
BC_EXCEPTION_CHECK_ReturnVoid(e);
pOutBitmap = CreateDIBitmap(m_output->GetWidth(), m_output->GetHeight());
pOutBitmap->Clear(m_backgroundColor);
if (!pOutBitmap) {
e = BCExceptionFailToCreateBitmap;
return;
}
for (int32_t x = 0; x < m_output->GetWidth(); x++) {
for (int32_t y = 0; y < m_output->GetHeight(); y++) {
if (m_output->Get(x, y)) {
pOutBitmap->SetPixel(x, y, m_barColor);
}
}
}
int32_t i = 0;
for (; i < contents.GetLength(); i++)
if (contents.GetAt(i) != ' ') {
break;
}
if (m_locTextLoc != BC_TEXT_LOC_NONE && i < contents.GetLength()) {
ShowChars(contents, pOutBitmap, nullptr, nullptr, m_barWidth, m_multiple,
e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
CFX_DIBitmap* pStretchBitmap = pOutBitmap->StretchTo(m_Width, m_Height);
delete pOutBitmap;
pOutBitmap = pStretchBitmap;
}
示例6: CheckContentValidity
FX_BOOL CBC_OnedUPCAWriter::CheckContentValidity(
const CFX_WideStringC& contents) {
for (FX_STRSIZE i = 0; i < contents.GetLength(); ++i) {
if (contents.GetAt(i) < '0' || contents.GetAt(i) > '9')
return FALSE;
}
return TRUE;
}
示例7: 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;
}
示例8: PutRequestURL
FX_BOOL CPDFXFA_App::PutRequestURL(const CFX_WideStringC& wsURL,
const CFX_WideStringC& wsData,
const CFX_WideStringC& wsEncode) {
CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
if (pEnv) {
return pEnv->FFI_PutRequestURL(wsURL.GetPtr(), wsData.GetPtr(),
wsEncode.GetPtr());
}
return FALSE;
}
示例9:
FX_BOOL CBC_OnedEAN8Writer::CheckContentValidity(
const CFX_WideStringC& contents) {
for (int32_t i = 0; i < contents.GetLength(); i++) {
if (contents.GetAt(i) >= '0' && contents.GetAt(i) <= '9') {
continue;
} else {
return FALSE;
}
}
return TRUE;
}
示例10:
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));
}
}
示例11: MsgBox
int32_t CPDFXFA_App::MsgBox(const CFX_WideStringC& wsMessage,
const CFX_WideStringC& wsTitle,
FX_DWORD dwIconType,
FX_DWORD dwButtonType) {
CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
if (!pEnv)
return -1;
FX_DWORD iconType = 0;
int iButtonType = 0;
switch (dwIconType) {
case XFA_MBICON_Error:
iconType |= 0;
break;
case XFA_MBICON_Warning:
iconType |= 1;
break;
case XFA_MBICON_Question:
iconType |= 2;
break;
case XFA_MBICON_Status:
iconType |= 3;
break;
}
switch (dwButtonType) {
case XFA_MB_OK:
iButtonType |= 0;
break;
case XFA_MB_OKCancel:
iButtonType |= 1;
break;
case XFA_MB_YesNo:
iButtonType |= 2;
break;
case XFA_MB_YesNoCancel:
iButtonType |= 3;
break;
}
int32_t iRet = pEnv->JS_appAlert(wsMessage.GetPtr(), wsTitle.GetPtr(),
iButtonType, iconType);
switch (iRet) {
case 1:
return XFA_IDOK;
case 2:
return XFA_IDCancel;
case 3:
return XFA_IDNo;
case 4:
return XFA_IDYes;
}
return XFA_IDYes;
}
示例12: FX_WideString_GetNormalization
FX_STRSIZE FX_WideString_GetNormalization(const CFX_WideStringC& wsSrc,
FX_WCHAR* pDst) {
FX_STRSIZE nCount = 0;
for (FX_STRSIZE len = 0; len < wsSrc.GetLength(); len++) {
FX_WCHAR wch = wsSrc.GetAt(len);
if (pDst) {
nCount += FX_Unicode_GetNormalization(wch, pDst + nCount);
} else {
nCount += FX_Unicode_GetNormalization(wch, pDst);
}
}
return nCount;
}
示例13: ToColor
// Static.
FX_ARGB CXFA_Data::ToColor(const CFX_WideStringC& wsValue) {
uint8_t r = 0, g = 0, b = 0;
if (wsValue.GetLength() == 0)
return 0xff000000;
int cc = 0;
const FX_WCHAR* str = wsValue.c_str();
int len = wsValue.GetLength();
while (FXSYS_iswspace(str[cc]) && cc < len)
cc++;
if (cc >= len)
return 0xff000000;
while (cc < len) {
if (str[cc] == ',' || !FXSYS_isDecimalDigit(str[cc]))
break;
r = r * 10 + str[cc] - '0';
cc++;
}
if (cc < len && str[cc] == ',') {
cc++;
while (FXSYS_iswspace(str[cc]) && cc < len)
cc++;
while (cc < len) {
if (str[cc] == ',' || !FXSYS_isDecimalDigit(str[cc]))
break;
g = g * 10 + str[cc] - '0';
cc++;
}
if (cc < len && str[cc] == ',') {
cc++;
while (FXSYS_iswspace(str[cc]) && cc < len)
cc++;
while (cc < len) {
if (str[cc] == ',' || !FXSYS_isDecimalDigit(str[cc]))
break;
b = b * 10 + str[cc] - '0';
cc++;
}
}
}
return (0xff << 24) | (r << 16) | (g << 8) | b;
}
示例14: PostRequestURL
FX_BOOL CPDFXFA_App::PostRequestURL(const CFX_WideStringC& wsURL,
const CFX_WideStringC& wsData,
const CFX_WideStringC& wsContentType,
const CFX_WideStringC& wsEncode,
const CFX_WideStringC& wsHeader,
CFX_WideString& wsResponse) {
CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
if (pEnv) {
wsResponse = pEnv->FFI_PostRequestURL(wsURL.GetPtr(), wsData.GetPtr(),
wsContentType.GetPtr(),
wsEncode.GetPtr(), wsHeader.GetPtr());
return TRUE;
}
return FALSE;
}
示例15: FX_File_Exist
FX_BOOL FX_File_Exist(const CFX_WideStringC& fileName) {
FX_DWORD dwAttri = ::GetFileAttributesW((LPCWSTR)fileName.GetPtr());
if (dwAttri == -1) {
return FALSE;
}
return (dwAttri & FILE_ATTRIBUTE_DIRECTORY) == 0;
}