Translated using Weblate (Chinese (Simplified))
[cygwin-setup.git] / CliParseFeedback.cc
blob6dc48ba3119ec96ed42b3065dd32d7f824888e0e
1 /*
2 * Copyright (c) 2020 Jon Turney
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
14 #include "CliParseFeedback.h"
15 #include "LogSingleton.h"
16 #include <sstream>
17 #include <iostream>
19 void CliParseFeedback::progress (unsigned long const pos, unsigned long const max)
21 std::cout << pos << "/" << max << std::endl;
24 void CliParseFeedback::iniName (const std::string& name)
28 void CliParseFeedback::babble (const std::string& message) const
30 Log (LOG_BABBLE) << message << endLog;
33 void CliParseFeedback::warning (const std::string& message) const
35 std::cout << "Warning: " << message << std::endl;
38 void CliParseFeedback::show_errors () const
42 void CliParseFeedback::note_error(int lineno, const std::string &s)
44 std::ostringstream buf;
45 buf << "line " << lineno << ": ";
46 buf << s << std::endl;
47 std::cout << buf.str();
48 error_count++;
51 bool CliParseFeedback::has_errors () const
53 return (error_count > 0);