24 const char *tail =
"src/base/Here.cc";
25 const char *full = __FILE__;
28 if (strstr(full, tail) ==
nullptr)
31 return strlen(full) - strlen(tail);
48 const char *name = strrchr(path,
'/');
55 uint32_t iterations = 0;
58 hash ^= 271 *
static_cast<uint32_t
>(*name);
61 return hash ^ (iterations * 271);
72 const auto fnameHash = fnameHashFull % 0x3FFFF;
73 return (fnameHash << 14) | (
lineNo & 0x3FFF);
84 os <<
'(' <<
lineNo <<
')';
static const char * SkipBuildPrefix(const char *path)
static size_t BuildPrefixLength()
static SourceLocationId FileNameHash(const char *path)
quickly computes a (weak) hash of a file name
uint32_t SourceLocationId
semi-uniquely identifies a source code location; stable across Squid runs
const char * fileName
source file name, often relative to build path
SourceLocationId id() const
int lineNo
line number inside the source file name (if positive)
std::ostream & print(std::ostream &os) const
describes location using a compact but human-friendly format
const char * context
line-independent location description
FileNameHashCacher * fileNameHashCacher