MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / makeSegments

Method makeSegments

Libraries/QRCode/tests/QrSegment.cpp:104–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102
103
104std::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
122qrcodegen::QrSegment::QrSegment(const Mode &md, int numCh, const std::vector<uint8_t> &b, int bitLen) :

Callers

nothing calls this directly

Calls 2

isNumericFunction · 0.85
isAlphanumericFunction · 0.85

Tested by

no test coverage detected