MCPcopy Create free account
hub / github.com/MaskRay/ccls / fromString

Method fromString

src/position.cc:17–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16namespace ccls {
17Pos Pos::fromString(const std::string &encoded) {
18 char *p = const_cast<char *>(encoded.c_str());
19 uint16_t line = uint16_t(strtoul(p, &p, 10) - 1);
20 assert(*p == ':');
21 p++;
22 int16_t column = int16_t(strtol(p, &p, 10)) - 1;
23 return {line, column};
24}
25
26std::string Pos::toString() {
27 char buf[99];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected