ARTEMIS
TextMsg.H
Go to the documentation of this file.
1 /* Copyright 2022 Luca Fedeli
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 
8 #ifndef ABLASTR_TEXT_MSG_H_
9 #define ABLASTR_TEXT_MSG_H_
10 
11 #include <string>
12 #include <vector>
13 
14 
16 {
25  std::string
26  Err (const std::string &msg, const bool do_text_wrapping = true);
27 
36  std::string
37  Info (const std::string &msg, const bool do_text_wrapping = true);
38 
49  std::string
50  Warn (const std::string &msg, const bool do_text_wrapping = true);
51 
61  void
62  Assert (const char *ex, const char *file, const int line, const std::string &msg);
63 
72  void
73  Abort (const char *file, const int line, const std::string &msg);
74 
75 } // namespace ablastr::utils::TextMsg
76 
77 #define ABLASTR_ALWAYS_ASSERT_WITH_MESSAGE(EX,MSG) (EX)?((void)0) : ablastr::utils::TextMsg::Assert( # EX , __FILE__, __LINE__ , MSG)
78 
79 #define ABLASTR_ABORT_WITH_MESSAGE(MSG) ablastr::utils::TextMsg::Abort( __FILE__, __LINE__ , MSG)
80 
81 #endif // ABLASTR_TEXT_MSG_H_
Definition: TextMsg.H:16
void Assert(const char *ex, const char *file, const int line, const std::string &msg)
This function is a wrapper around amrex::Assert, designed to ensure the uniform formatting of the err...
Definition: TextMsg.cpp:77
std::string Warn(const std::string &msg, const bool do_text_wrapping=true)
This function formats a text message as a warning message, adding the '### WARN: ' prefix and (by def...
Definition: TextMsg.cpp:70
std::string Err(const std::string &msg, const bool do_text_wrapping=true)
This function formats a text message as an error message, adding the '### ERROR: ' prefix and (by def...
Definition: TextMsg.cpp:56
std::string Info(const std::string &msg, const bool do_text_wrapping=true)
This function formats a text message as an info message, adding the '### INFO: ' prefix and (by defau...
Definition: TextMsg.cpp:63
void Abort(const char *file, const int line, const std::string &msg)
This function is a wrapper around amrex::Abort, designed to ensure the uniform formatting of the erro...
Definition: TextMsg.cpp:84