Updated 2 API documentation comments in {Java, JavaScript, Python, C++} language versions, though not identically.

pull/16/head
Project Nayuki 7 years ago
parent e9010fc7ef
commit d8b66fcbf1

@ -61,10 +61,11 @@ class QrCode final {
/*---- Public static factory functions ----*/
/*
* Returns a QR Code symbol representing the given Unicode text string at the given error correction level.
* As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer Unicode
* code points (not UTF-16 code units). The smallest possible QR Code version is automatically chosen for the output.
* The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
* Returns a QR Code symbol representing the specified Unicode text string at the specified error correction level.
* As a conservative upper bound, this function is guaranteed to succeed for strings that have 2953 or fewer
* UTF-8 code units (not Unicode code points) if the low error correction level is used. The smallest possible
* QR Code version is automatically chosen for the output. The ECC level of the result may be higher than
* the ecl argument if it can be done without increasing the version.
*/
public: static QrCode encodeText(const char *text, const Ecc &ecl);
@ -256,7 +257,7 @@ class QrCode final {
/*
* Computes the Reed-Solomon error correction codewords for a sequence of data codewords
* at a given degree. Objects are immutable, and the state only depends on the degree.
* This class exists because the divisor polynomial does not need to be recalculated for every input.
* This class exists because each data block in a QR Code shares the same the divisor polynomial.
*/
private: class ReedSolomonGenerator final {

@ -41,9 +41,10 @@ public final class QrCode {
/**
* Returns a QR Code symbol representing the specified Unicode text string at the specified error correction level.
* As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer Unicode
* code points (not UTF-16 code units). The smallest possible QR Code version is automatically chosen for the output.
* The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
* As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer
* Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
* QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
* ecl argument if it can be done without increasing the version.
* @param text the text to be encoded, which can be any Unicode string
* @param ecl the error correction level to use (will be boosted)
* @return a QR Code representing the text
@ -773,7 +774,7 @@ public final class QrCode {
/**
* Computes the Reed-Solomon error correction codewords for a sequence of data codewords
* at a given degree. Objects are immutable, and the state only depends on the degree.
* This class exists because the divisor polynomial does not need to be recalculated for every input.
* This class exists because each data block in a QR Code shares the same the divisor polynomial.
*/
private static final class ReedSolomonGenerator {

@ -533,10 +533,11 @@ var qrcodegen = new function() {
/*---- Public static factory functions for QrCode ----*/
/*
* Returns a QR Code symbol representing the given Unicode text string at the given error correction level.
* As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer Unicode
* code points (not UTF-16 code units). The smallest possible QR Code version is automatically chosen for the output.
* The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
* Returns a QR Code symbol representing the specified Unicode text string at the specified error correction level.
* As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer
* Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
* QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
* ecl argument if it can be done without increasing the version.
*/
this.QrCode.encodeText = function(text, ecl) {
var segs = qrcodegen.QrSegment.makeSegments(text);
@ -921,7 +922,7 @@ var qrcodegen = new function() {
/*
* A private helper class that computes the Reed-Solomon error correction codewords for a sequence of
* data codewords at a given degree. Objects are immutable, and the state only depends on the degree.
* This class exists because the divisor polynomial does not need to be recalculated for every input.
* This class exists because each data block in a QR Code shares the same the divisor polynomial.
* This constructor creates a Reed-Solomon ECC generator for the given degree. This could be implemented
* as a lookup table over all possible parameter values, instead of as an algorithm.
*/

@ -68,10 +68,11 @@ class QrCode(object):
@staticmethod
def encode_text(text, ecl):
"""Returns a QR Code symbol representing the given Unicode text string at the given error correction level.
As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer Unicode
code points (not UTF-16 code units). The smallest possible QR Code version is automatically chosen for the output.
The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version."""
"""Returns a QR Code symbol representing the specified Unicode text string at the specified error correction level.
As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer
Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
ecl argument if it can be done without increasing the version."""
segs = QrSegment.make_segments(text)
return QrCode.encode_segments(segs, ecl)
@ -775,7 +776,7 @@ class QrSegment(object):
class _ReedSolomonGenerator(object):
"""Computes the Reed-Solomon error correction codewords for a sequence of data codewords
at a given degree. Objects are immutable, and the state only depends on the degree.
This class exists because the divisor polynomial does not need to be recalculated for every input."""
This class exists because each data block in a QR Code shares the same the divisor polynomial."""
def __init__(self, degree):
"""Creates a Reed-Solomon ECC generator for the given degree. This could be implemented

Loading…
Cancel
Save