MCPcopy Create free account
hub / github.com/Rezonality/zep / GetLineOffsets

Method GetLineOffsets

src/buffer.cpp:528–542  ·  view source on GitHub ↗

Method for querying the beginning and end of a line

Source from the content-addressed store, hash-verified

526
527// Method for querying the beginning and end of a line
528bool ZepBuffer::GetLineOffsets(const long line, ByteRange& range) const
529{
530 // Not valid
531 if ((long)m_lineEnds.size() <= line)
532 {
533 range.first = 0;
534 range.second = 0;
535 return false;
536 }
537
538 // Find the line bounds - we know the end, find the start from the previous
539 range.second = m_lineEnds[line];
540 range.first = line == 0 ? 0 : m_lineEnds[line - 1];
541 return true;
542}
543
544std::string ZepBuffer::GetFileExtension() const
545{

Callers 4

UpdateLineSpansMethod · 0.80
GetCommandMethod · 0.80
PreDisplayMethod · 0.80
ReadFromBufferMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected