Line data Source code
1 : #include "parse_info.h"
2 : #include <sstream>
3 :
4 : namespace Odb::Lib::FileModel
5 : {
6 20 : std::string parse_info::toString(const std::string& message /*= ""*/) const
7 : {
8 20 : std::stringstream ss;
9 :
10 20 : if (!message.empty())
11 : {
12 16 : ss << message << std::endl;
13 : }
14 :
15 20 : if (!dataFile.empty() || !dataLine.empty() || !dataToken.empty())
16 : {
17 32 : ss << "current file: [" << dataFile.relative_path().string() << ":" << dataLineNumber << "]" << std::endl
18 16 : << "current line: [" << dataLine << "]" << std::endl
19 16 : << "current token: [" << dataToken << "]";
20 : }
21 :
22 40 : return ss.str();
23 20 : }
24 : }
|