本文整理汇总了C++中CFX_WideStringC::GetLength方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_WideStringC::GetLength方法的具体用法?C++ CFX_WideStringC::GetLength怎么用?C++ CFX_WideStringC::GetLength使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_WideStringC
的用法示例。
在下文中一共展示了CFX_WideStringC::GetLength方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
}
示例2: 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;
}
示例3:
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));
}
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: DecodeFileName
CFX_WideString CPDF_FileSpec::DecodeFileName(const CFX_WideStringC& filepath) {
if (filepath.GetLength() <= 1)
return CFX_WideString();
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
if (filepath.Left(sizeof("/Mac") - 1) == CFX_WideStringC(L"/Mac"))
return ChangeSlashToPlatform(filepath.c_str() + 1);
return ChangeSlashToPlatform(filepath.c_str());
#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
if (filepath.GetAt(0) != '/')
return ChangeSlashToPlatform(filepath.c_str());
if (filepath.GetAt(1) == '/')
return ChangeSlashToPlatform(filepath.c_str() + 1);
if (filepath.GetAt(2) == '/') {
CFX_WideString result;
result += filepath.GetAt(1);
result += ':';
result += ChangeSlashToPlatform(filepath.c_str() + 2);
return result;
}
CFX_WideString result;
result += '\\';
result += ChangeSlashToPlatform(filepath.c_str());
return result;
#else
return CFX_WideString(filepath);
#endif
}
示例9: FILESPEC_DecodeFileName
static CFX_WideString FILESPEC_DecodeFileName(const CFX_WideStringC& filepath) {
if (filepath.GetLength() <= 1) {
return CFX_WideString();
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
if (filepath.Left(sizeof("/Mac") - 1) == CFX_WideStringC(L"/Mac")) {
return ChangeSlashToPlatform(filepath.GetPtr() + 1);
}
return ChangeSlashToPlatform(filepath.GetPtr());
#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
if (filepath.GetAt(0) != '/') {
return ChangeSlashToPlatform(filepath.GetPtr());
}
if (filepath.GetAt(1) == '/') {
return ChangeSlashToPlatform(filepath.GetPtr() + 1);
}
if (filepath.GetAt(2) == '/') {
CFX_WideString result;
result += filepath.GetAt(1);
result += ':';
result += ChangeSlashToPlatform(filepath.GetPtr() + 2);
return result;
}
CFX_WideString result;
result += '\\';
result += ChangeSlashToPlatform(filepath.GetPtr());
return result;
#else
return filepath;
#endif
}
示例10: 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;
}
示例11: 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;
}
示例12:
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;
}
示例13: 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;
}
示例14: FilterContents
CFX_WideString CBC_OnedUPCAWriter::FilterContents(
const CFX_WideStringC& contents) {
CFX_WideString filtercontents;
FX_WCHAR ch;
for (int32_t i = 0; i < contents.GetLength(); i++) {
ch = contents.GetAt(i);
if (ch > 175) {
i++;
continue;
}
if (ch >= '0' && ch <= '9') {
filtercontents += ch;
}
}
return filtercontents;
}
示例15: XFA_GetBarcodeTypeByName
static XFA_LPCBARCODETYPEENUMINFO XFA_GetBarcodeTypeByName(
const CFX_WideStringC& wsName) {
int32_t iLength = wsName.GetLength();
if (iLength == 0) {
return NULL;
}
uint32_t uHash = FX_HashCode_String_GetW(wsName.GetPtr(), iLength, TRUE);
int32_t iStart = 0, iEnd = g_iXFABarcodeTypeCount - 1;
do {
int32_t iMid = (iStart + iEnd) / 2;
XFA_LPCBARCODETYPEENUMINFO pInfo = g_XFABarCodeTypeEnumData + iMid;
if (uHash == pInfo->uHash) {
return pInfo;
} else if (uHash < pInfo->uHash) {
iEnd = iMid - 1;
} else {
iStart = iMid + 1;
}
} while (iStart <= iEnd);
return NULL;
}