From 8c262c00ddbcf7735c7b868df9a39cd0016a271f Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Sat, 6 Oct 2018 03:46:20 +0000 Subject: [PATCH] Added and synchronized documentation comments for QrCode's scalar field accessor methods in C++ and Python with existing comments in Rust. --- cpp/QrCode.hpp | 12 ++++++++++++ python/qrcodegen.py | 11 ++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/cpp/QrCode.hpp b/cpp/QrCode.hpp index 9bcb2a6..1904844 100644 --- a/cpp/QrCode.hpp +++ b/cpp/QrCode.hpp @@ -151,15 +151,27 @@ class QrCode final { /*---- Public instance methods ----*/ + /* + * Returns this QR Code's version, in the range [1, 40]. + */ public: int getVersion() const; + /* + * Returns this QR Code's size, in the range [21, 177]. + */ public: int getSize() const; + /* + * Returns this QR Code's error correction level. + */ public: Ecc getErrorCorrectionLevel() const; + /* + * Returns this QR Code's mask, in the range [0, 7]. + */ public: int getMask() const; diff --git a/python/qrcodegen.py b/python/qrcodegen.py index e202fcb..51a93d0 100644 --- a/python/qrcodegen.py +++ b/python/qrcodegen.py @@ -223,22 +223,19 @@ class QrCode(object): # ---- Accessor methods ---- def get_version(self): - """Returns this QR Code's version number, which is always between 1 and 40 (inclusive).""" + """Returns this QR Code's version number, in the range [1, 40].""" return self._version def get_size(self): - """Returns the width and height of this QR Code, measured in modules. - Always equal to version * 4 + 17, in the range 21 to 177.""" + """Returns this QR Code's size, in the range [21, 177].""" return self._size def get_error_correction_level(self): - """Returns the error correction level used in this QR Code.""" + """Returns this QR Code's error correction level.""" return self._errcorlvl def get_mask(self): - """Returns the mask pattern used in this QR Code, in the range 0 to 7 (i.e. unsigned 3-bit integer). - Note that even if a constructor was called with automatic masking requested - (mask = -1), the resulting object will still have a mask value between 0 and 7.""" + """Returns this QR Code's mask, in the range [0, 7].""" return self._mask def get_module(self, x, y):