C++ Utilities: misc/parseerror.cpp Source File

C++ Utilities 5.34.2 Useful C++ classes and routines such as argument parser, IO and conversion utilities

Loading...
Searching...
No Matches
parseerror.cpp
Go to the documentation of this file.
1#include "./parseerror.h"
2
3#include "../io/ansiescapecodes.h"
4
5#include <iostream>
6
7namespace CppUtilities {
8
15
19ParseError::~ParseError() noexcept
20{
21}
22
26std::ostream &operator<<(std::ostream &o, const ParseError &failure)
27{
28 using namespace std;
29 using namespace EscapeCodes;
30 return o << Phrases::Error << "Unable to parse arguments: " << TextAttribute::Reset << failure.what() << "\nSee --help for available commands."
31 << endl;
32}
33
34} // namespace CppUtilities
ansiescapecodes.h
CppUtilities::ParseError
The ParseError class is thrown by an ArgumentParser when a parsing error occurs.
Definition parseerror.h:11
CppUtilities::ParseError::~ParseError
~ParseError() noexcept override
Destroys the ParseError.
Definition parseerror.cpp:19
CppUtilities::EscapeCodes
Encapsulates functions for formatted terminal output using ANSI escape codes.
Definition ansiescapecodes.h:12
CppUtilities
Contains all utilities provided by the c++utilities library.
Definition argumentparser.h:18
CppUtilities::operator<<
CPP_UTILITIES_EXPORT std::ostream & operator<<(std::ostream &out, Indentation indentation)
Definition commandlineutils.h:88
std
STL namespace.
parseerror.h