本文整理汇总了C++中CFX_ByteString::GetAt方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_ByteString::GetAt方法的具体用法?C++ CFX_ByteString::GetAt怎么用?C++ CFX_ByteString::GetAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_ByteString
的用法示例。
在下文中一共展示了CFX_ByteString::GetAt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
int32_t CBC_OnedCode128Writer::Encode128C(const CFX_ByteString& contents,
CFX_PtrArray& patterns) {
int32_t checkSum = 0;
int32_t checkWeight = 1;
int32_t position = 0;
patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[CODE_START_C]);
checkSum += CODE_START_C * checkWeight;
while (position < contents.GetLength()) {
int32_t patternIndex = 0;
FX_CHAR ch = contents.GetAt(position);
if (ch < '0' || ch > '9') {
patternIndex = (int32_t)ch;
position++;
} else {
patternIndex = FXSYS_atoi(contents.Mid(position, 2));
if (contents.GetAt(position + 1) < '0' ||
contents.GetAt(position + 1) > '9') {
position += 1;
} else {
position += 2;
}
}
patterns.Add((int32_t*)CBC_OnedCode128Reader::CODE_PATTERNS[patternIndex]);
checkSum += patternIndex * checkWeight;
if (position != 0) {
checkWeight++;
}
}
return checkSum;
}
示例2:
CFX_ByteArray& CBC_HighLevelEncoder::getBytesForMessage(CFX_WideString msg) {
CFX_ByteString bytestr;
CBC_UtilCodingConvert::UnicodeToUTF8(msg, bytestr);
for (int32_t i = 0; i < bytestr.GetLength(); i++) {
m_bytearray.Add(bytestr.GetAt(i));
}
return m_bytearray;
}
示例3:
CBC_EncoderContext::CBC_EncoderContext(const CFX_WideString msg,
CFX_WideString ecLevel,
int32_t& e) {
CFX_ByteString dststr;
CBC_UtilCodingConvert::UnicodeToUTF8(msg, dststr);
CFX_WideString sb;
int32_t c = dststr.GetLength();
for (int32_t i = 0; i < c; i++) {
FX_WCHAR ch = (FX_WCHAR)(dststr.GetAt(i) & 0xff);
if (ch == '?' && dststr.GetAt(i) != '?') {
e = BCExceptionCharactersOutsideISO88591Encoding;
}
sb += ch;
}
m_msg = sb;
m_shape = FORCE_NONE;
m_newEncoding = -1;
m_pos = 0;
m_symbolInfo = NULL;
m_skipAtEnd = 0;
m_maxSize = NULL;
m_minSize = NULL;
}
示例4: CFX_WideString
CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(
CFX_WideString wideMsg,
Compaction compaction,
int32_t& e) {
CFX_ByteString bytes;
CBC_UtilCodingConvert::UnicodeToUTF8(wideMsg, bytes);
CFX_WideString msg;
int32_t len = bytes.GetLength();
for (int32_t i = 0; i < len; i++) {
FX_WCHAR ch = (FX_WCHAR)(bytes.GetAt(i) & 0xff);
if (ch == '?' && bytes.GetAt(i) != '?') {
e = BCExceptionCharactersOutsideISO88591Encoding;
return CFX_WideString();
}
msg += ch;
}
CFX_ByteArray byteArr;
for (int32_t k = 0; k < bytes.GetLength(); k++) {
byteArr.Add(bytes.GetAt(k));
}
CFX_WideString sb;
len = msg.GetLength();
int32_t p = 0;
int32_t textSubMode = SUBMODE_ALPHA;
if (compaction == TEXT) {
encodeText(msg, p, len, sb, textSubMode);
} else if (compaction == BYTES) {
encodeBinary(&byteArr, p, byteArr.GetSize(), BYTE_COMPACTION, sb);
} else if (compaction == NUMERIC) {
sb += (FX_WCHAR)LATCH_TO_NUMERIC;
encodeNumeric(msg, p, len, sb);
} else {
int32_t encodingMode = LATCH_TO_TEXT;
while (p < len) {
int32_t n = determineConsecutiveDigitCount(msg, p);
if (n >= 13) {
sb += (FX_WCHAR)LATCH_TO_NUMERIC;
encodingMode = NUMERIC_COMPACTION;
textSubMode = SUBMODE_ALPHA;
encodeNumeric(msg, p, n, sb);
p += n;
} else {
int32_t t = determineConsecutiveTextCount(msg, p);
if (t >= 5 || n == len) {
if (encodingMode != TEXT_COMPACTION) {
sb += (FX_WCHAR)LATCH_TO_TEXT;
encodingMode = TEXT_COMPACTION;
textSubMode = SUBMODE_ALPHA;
}
textSubMode = encodeText(msg, p, t, sb, textSubMode);
p += t;
} else {
int32_t b = determineConsecutiveBinaryCount(msg, &byteArr, p, e);
BC_EXCEPTION_CHECK_ReturnValue(e, (FX_WCHAR)' ');
if (b == 0) {
b = 1;
}
if (b == 1 && encodingMode == TEXT_COMPACTION) {
encodeBinary(&byteArr, p, 1, TEXT_COMPACTION, sb);
} else {
encodeBinary(&byteArr, p, b, encodingMode, sb);
encodingMode = BYTE_COMPACTION;
textSubMode = SUBMODE_ALPHA;
}
p += b;
}
}
}
}
return sb;
}