| 102 | |
| 103 | |
| 104 | std::vector<qrcodegen::QrSegment> qrcodegen::QrSegment::makeSegments(const char *text) { |
| 105 | // Select the most efficient segment encoding automatically |
| 106 | std::vector<QrSegment> result; |
| 107 | if (*text == '\0'); // Leave the vector empty |
| 108 | else if (QrSegment::isNumeric(text)) |
| 109 | result.push_back(QrSegment::makeNumeric(text)); |
| 110 | else if (QrSegment::isAlphanumeric(text)) |
| 111 | result.push_back(QrSegment::makeAlphanumeric(text)); |
| 112 | else { |
| 113 | std::vector<uint8_t> bytes; |
| 114 | for (; *text != '\0'; text++) |
| 115 | bytes.push_back(static_cast<uint8_t>(*text)); |
| 116 | result.push_back(QrSegment::makeBytes(bytes)); |
| 117 | } |
| 118 | return result; |
| 119 | } |
| 120 | |
| 121 | |
| 122 | qrcodegen::QrSegment::QrSegment(const Mode &md, int numCh, const std::vector<uint8_t> &b, int bitLen) : |
nothing calls this directly
no test coverage detected