mirror of
https://github.com/Icinga/icinga2.git
synced 2025-08-31 22:48:12 +02:00
34 lines
776 B
C++
34 lines
776 B
C++
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
|
|
|
#include "base/debuginfo.hpp"
|
|
|
|
using namespace icinga;
|
|
|
|
/**
|
|
* Outputs a DebugInfo struct to a stream.
|
|
*
|
|
* @param out The output stream.
|
|
* @param val The DebugInfo struct.
|
|
* @returns The output stream.
|
|
*/
|
|
std::ostream& icinga::operator<<(std::ostream& out, const DebugInfo& val)
|
|
{
|
|
out << "in " << val.Path << ": "
|
|
<< val.FirstLine << ":" << val.FirstColumn
|
|
<< "-"
|
|
<< val.LastLine << ":" << val.LastColumn;
|
|
|
|
return out;
|
|
}
|
|
|
|
DebugInfo icinga::DebugInfoRange(const DebugInfo& start, const DebugInfo& end)
|
|
{
|
|
DebugInfo result;
|
|
result.Path = start.Path;
|
|
result.FirstLine = start.FirstLine;
|
|
result.FirstColumn = start.FirstColumn;
|
|
result.LastLine = end.LastLine;
|
|
result.LastColumn = end.LastColumn;
|
|
return result;
|
|
}
|