| 1002 | } |
| 1003 | |
| 1004 | void Reader::getLocationLineAndColumn(Location location, |
| 1005 | int& line, |
| 1006 | int& column) const { |
| 1007 | Location current = begin_; |
| 1008 | Location lastLineStart = current; |
| 1009 | line = 0; |
| 1010 | while (current < location && current != end_) { |
| 1011 | Char c = *current++; |
| 1012 | if (c == '\r') { |
| 1013 | if (*current == '\n') |
| 1014 | ++current; |
| 1015 | lastLineStart = current; |
| 1016 | ++line; |
| 1017 | } else if (c == '\n') { |
| 1018 | lastLineStart = current; |
| 1019 | ++line; |
| 1020 | } |
| 1021 | } |
| 1022 | // column & line start at 1 |
| 1023 | column = int(location - lastLineStart) + 1; |
| 1024 | ++line; |
| 1025 | } |
| 1026 | |
| 1027 | JSONCPP_STRING Reader::getLocationLineAndColumn(Location location) const { |
| 1028 | int line, column; |
nothing calls this directly
no outgoing calls
no test coverage detected