MCPcopy Create free account
hub / github.com/WinMerge/winmerge / GetLine

Method GetLine

Src/DiffTextBuffer.cpp:95–105  ·  view source on GitHub ↗

* @brief Get a line from the buffer. * @param [in] nLineIndex Index of the line to get. * @param [out] strLine Returns line text in the index. */

Source from the content-addressed store, hash-verified

93 * @param [out] strLine Returns line text in the index.
94 */
95bool CDiffTextBuffer::GetLine(int nLineIndex, String &strLine) const
96{
97 int nLineLength = CCrystalTextBuffer::GetLineLength(nLineIndex);
98 if (nLineLength < 0)
99 return false;
100 else if (nLineLength == 0)
101 strLine.clear();
102 else
103 strLine.assign(CCrystalTextBuffer::GetLineChars(nLineIndex), nLineLength);
104 return true;
105}
106
107/**
108 * @brief Set the buffer modified status.

Calls 3

GetLineLengthFunction · 0.85
clearMethod · 0.45
assignMethod · 0.45

Tested by

no test coverage detected