MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / GetCol

Method GetCol

CodeFormatServer/src/Lib/LineIndex/LineTypes.cpp:28–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28std::size_t LineOffset::GetCol(std::size_t colOffset) {
29 std::size_t col = 0;
30 std::size_t offset = colOffset;
31 for (auto &uc: CharsOffsets) {
32 if (offset > uc.TotalLen) {
33 offset -= uc.TotalLen;
34 col += uc.CharsNum;
35 } else {
36 col += offset / uc.Unit;
37 break;
38 }
39 }
40 return col;
41}
42
43std::size_t LineOffset::GetOffset(std::size_t colNum) {
44 std::size_t colOffset = 0;

Callers 1

GetLineColMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected