Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: xfa/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp

Issue 1972053003: Add CFX_ByteStringC::CharAt() to avoid c_str() and casts (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fee/fde_txtedtengine.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 // Original code is licensed as follows: 6 // Original code is licensed as follows:
7 /* 7 /*
8 * Copyright 2008 ZXing authors 8 * Copyright 2008 ZXing authors
9 * 9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * Licensed under the Apache License, Version 2.0 (the "License");
(...skipping 18 matching lines...) Expand all
29 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 29 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
30 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}; 30 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
31 const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::C40_SHIFT2_SET_CHARS[] = { 31 const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::C40_SHIFT2_SET_CHARS[] = {
32 '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', 32 '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.',
33 '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_'}; 33 '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_'};
34 const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::TEXT_BASIC_SET_CHARS[] = { 34 const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::TEXT_BASIC_SET_CHARS[] = {
35 '*', '*', '*', ' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 35 '*', '*', '*', ' ', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
36 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 36 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
37 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; 37 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
38 const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::TEXT_SHIFT3_SET_CHARS[] = { 38 const FX_CHAR CBC_DataMatrixDecodedBitStreamParser::TEXT_SHIFT3_SET_CHARS[] = {
39 '\'', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 39 '\'', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
40 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 40 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
41 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', (FX_CHAR)127}; 41 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', 127};
42 const int32_t CBC_DataMatrixDecodedBitStreamParser::PAD_ENCODE = 0; 42 const int32_t CBC_DataMatrixDecodedBitStreamParser::PAD_ENCODE = 0;
43 const int32_t CBC_DataMatrixDecodedBitStreamParser::ASCII_ENCODE = 1; 43 const int32_t CBC_DataMatrixDecodedBitStreamParser::ASCII_ENCODE = 1;
44 const int32_t CBC_DataMatrixDecodedBitStreamParser::C40_ENCODE = 2; 44 const int32_t CBC_DataMatrixDecodedBitStreamParser::C40_ENCODE = 2;
45 const int32_t CBC_DataMatrixDecodedBitStreamParser::TEXT_ENCODE = 3; 45 const int32_t CBC_DataMatrixDecodedBitStreamParser::TEXT_ENCODE = 3;
46 const int32_t CBC_DataMatrixDecodedBitStreamParser::ANSIX12_ENCODE = 4; 46 const int32_t CBC_DataMatrixDecodedBitStreamParser::ANSIX12_ENCODE = 4;
47 const int32_t CBC_DataMatrixDecodedBitStreamParser::EDIFACT_ENCODE = 5; 47 const int32_t CBC_DataMatrixDecodedBitStreamParser::EDIFACT_ENCODE = 5;
48 const int32_t CBC_DataMatrixDecodedBitStreamParser::BASE256_ENCODE = 6; 48 const int32_t CBC_DataMatrixDecodedBitStreamParser::BASE256_ENCODE = 6;
49 CBC_DataMatrixDecodedBitStreamParser::CBC_DataMatrixDecodedBitStreamParser() {} 49 CBC_DataMatrixDecodedBitStreamParser::CBC_DataMatrixDecodedBitStreamParser() {}
50 CBC_DataMatrixDecodedBitStreamParser::~CBC_DataMatrixDecodedBitStreamParser() {} 50 CBC_DataMatrixDecodedBitStreamParser::~CBC_DataMatrixDecodedBitStreamParser() {}
51 51
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 BC_FX_ByteString_Append(result, *bytes); 464 BC_FX_ByteString_Append(result, *bytes);
465 delete bytes; 465 delete bytes;
466 } 466 }
467 uint8_t CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State( 467 uint8_t CBC_DataMatrixDecodedBitStreamParser::Unrandomize255State(
468 int32_t randomizedBase256Codeword, 468 int32_t randomizedBase256Codeword,
469 int32_t base256CodewordPosition) { 469 int32_t base256CodewordPosition) {
470 int32_t pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1; 470 int32_t pseudoRandomNumber = ((149 * base256CodewordPosition) % 255) + 1;
471 int32_t tempVariable = randomizedBase256Codeword - pseudoRandomNumber; 471 int32_t tempVariable = randomizedBase256Codeword - pseudoRandomNumber;
472 return (uint8_t)(tempVariable >= 0 ? tempVariable : tempVariable + 256); 472 return (uint8_t)(tempVariable >= 0 ? tempVariable : tempVariable + 256);
473 } 473 }
OLDNEW
« no previous file with comments | « xfa/fee/fde_txtedtengine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698