29 lines
687 B
Plaintext
29 lines
687 B
Plaintext
namespace QrCode
|
|
|
|
class QRData_Byte
|
|
|
|
function new()
|
|
m.mode = QrCode.QRMode.Byte
|
|
end function
|
|
|
|
public function setData(data as string)
|
|
m.bytes = m.stringToBytes(data)
|
|
m.length = m.bytes.count()
|
|
end function
|
|
|
|
public function writeToBuffer(buffer as QRBitBuffer)
|
|
for each byte in m.bytes
|
|
buffer.put(byte, 8)
|
|
end for
|
|
end function
|
|
|
|
private function stringToBytes(text as string) as object
|
|
result = CreateObject("roByteArray")
|
|
result.fromAsciiString(text)
|
|
return result
|
|
end function
|
|
|
|
end class
|
|
|
|
end namespace
|