mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 21:13:35 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
31
base/src_point.cpp
Normal file
31
base/src_point.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "base/src_point.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
|
||||
namespace base
|
||||
{
|
||||
void SrcPoint::TruncateFileName()
|
||||
{
|
||||
size_t const maxLen = 10000;
|
||||
char const * p[] = {m_fileName, m_fileName};
|
||||
for (size_t i = 0; i < maxLen && m_fileName[i]; ++i)
|
||||
{
|
||||
if (m_fileName[i] == '\\' || m_fileName[i] == '/')
|
||||
{
|
||||
std::swap(p[0], p[1]);
|
||||
p[0] = m_fileName + i + 1;
|
||||
}
|
||||
}
|
||||
m_fileName = p[1];
|
||||
}
|
||||
|
||||
std::string DebugPrint(SrcPoint const & srcPoint)
|
||||
{
|
||||
std::ostringstream out;
|
||||
if (srcPoint.Line() > 0)
|
||||
out << srcPoint.FileName() << ":" << srcPoint.Line() << " " << srcPoint.Function()
|
||||
<< srcPoint.Postfix() << ": ";
|
||||
return out.str();
|
||||
}
|
||||
} // namespace base
|
||||
Reference in New Issue
Block a user