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

Method getTotalBits

Libraries/QRCode/tests/QrSegment.cpp:132–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130
131
132int qrcodegen::QrSegment::getTotalBits(const std::vector<QrSegment> &segs, int version) {
133 if (version < 1 || version > 40)
134 throw "Version number out of range";
135 int result = 0;
136 for (size_t i = 0; i < segs.size(); i++) {
137 const QrSegment &seg(segs.at(i));
138 int ccbits = seg.mode.numCharCountBits(version);
139 // Fail if segment length value doesn't fit in the length field's bit-width
140 if (seg.numChars >= (1 << ccbits))
141 return -1;
142 result += 4 + ccbits + seg.bitLength;
143 }
144 return result;
145}
146
147
148bool qrcodegen::QrSegment::isAlphanumeric(const char *text) {

Callers

nothing calls this directly

Calls 1

numCharCountBitsMethod · 0.80

Tested by

no test coverage detected