MCPcopy Create free account
hub / github.com/Illumina/hap.py / getLocationLineAndColumn

Method getLocationLineAndColumn

external/jsoncpp/jsoncpp.cpp:942–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

940}
941
942void Reader::getLocationLineAndColumn(Location location,
943 int &line,
944 int &column) const {
945 Location current = begin_;
946 Location lastLineStart = current;
947 line = 0;
948 while (current < location && current != end_) {
949 Char c = *current++;
950 if (c == '\r') {
951 if (*current == '\n')
952 ++current;
953 lastLineStart = current;
954 ++line;
955 } else if (c == '\n') {
956 lastLineStart = current;
957 ++line;
958 }
959 }
960 // column & line start at 1
961 column = int(location - lastLineStart) + 1;
962 ++line;
963}
964
965std::string Reader::getLocationLineAndColumn(Location location) const {
966 int line, column;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected