/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
py-modules-0.2.6
base/src_point.cpp
31 строка
692 B
Maxim Pimenov
[base] Replaced the namespace my with base.
18 сен 2018, 14:46
18 сен 2018, 14:46
412387c
Код
Авторство
О чём код?
#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