Added/updated/synchronized documentation comments for QrSegment's accessor methods, in all languages except C.

pull/39/merge
Project Nayuki 6 years ago
parent 139e67eee2
commit aa39108f0d

@ -172,12 +172,21 @@ class QrSegment final {
/*---- Methods ----*/
/*
* Returns the mode field of this segment.
*/
public: Mode getMode() const;
/*
* Returns the character count field of this segment.
*/
public: int getNumChars() const;
/*
* Returns the data bits of this segment.
*/
public: const std::vector<bool> &getData() const;

@ -193,7 +193,7 @@ public final class QrSegment {
/*---- Methods ----*/
/**
* Returns a copy of the data bits of this segment.
* Returns the data bits of this segment.
* @return the data bits of this segment (not {@code null})
*/
public BitBuffer getBits() {

@ -718,7 +718,7 @@ var qrcodegen = new function() {
// Always zero or positive. Not the same as the data's bit length.
Object.defineProperty(this, "numChars", {value:numChars});
// Returns a copy of all bits, which is an array of 0s and 1s.
// Returns a new copy of the data bits of this segment.
this.getBits = function() {
return bitData.slice(); // Make defensive copy
};

@ -704,12 +704,15 @@ class QrSegment(object):
# ---- Accessor methods ----
def get_mode(self):
"""Returns the mode field of this segment."""
return self._mode
def get_num_chars(self):
"""Returns the character count field of this segment."""
return self._numchars
def get_bits(self):
"""Returns a new copy of the data bits of this segment."""
return list(self._bitdata) # Make defensive copy

@ -962,19 +962,19 @@ impl QrSegment {
/*---- Instance field getters ----*/
// Returns the mode indicator for this segment.
// Returns the mode indicator of this segment.
pub fn mode(&self) -> QrSegmentMode {
self.mode
}
// Returns the length of this segment's unencoded data, measured in characters.
// Returns the character count field of this segment.
pub fn num_chars(&self) -> usize {
self.numchars
}
// Returns a view of the bits of this segment.
// Returns the data bits of this segment.
pub fn data(&self) -> &Vec<bool> {
&self.data
}

@ -761,7 +761,7 @@ namespace qrcodegen {
/*-- Methods --*/
// Returns a copy of all bits, which is an array of 0s and 1s.
// Returns a new copy of the data bits of this segment.
public getBits(): Array<bit> {
return this.bitData.slice(); // Make defensive copy
}

Loading…
Cancel
Save