WarpX
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 
14 {
23  std::string
24  Err (const std::string &msg, bool do_text_wrapping = true);
25 
34  std::string
35  Info (const std::string &msg, bool do_text_wrapping = true);
36 
47  std::string
48  Warn (const std::string &msg, bool do_text_wrapping = true);
49 
59  void
60  Assert (const char *ex, const char *file, int line, const std::string &msg);
61 
70  void
71  Abort (const char *file, int line, const std::string &msg);
72 
73 } // namespace ablastr::utils::TextMsg
74 
75 #define ABLASTR_ALWAYS_ASSERT_WITH_MESSAGE(EX,MSG) (EX)?((void)0) : ablastr::utils::TextMsg::Assert( # EX , __FILE__, __LINE__ , MSG)
76 
77 #define ABLASTR_ABORT_WITH_MESSAGE(MSG) ablastr::utils::TextMsg::Abort( __FILE__, __LINE__ , MSG)
78 
79 #endif // ABLASTR_TEXT_MSG_H_
Definition: TextMsg.H:14
std::string Err(const std::string &msg, 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
void Abort(const char *file, 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
std::string Warn(const std::string &msg, 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
void Assert(const char *ex, const char *file, 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 Info(const std::string &msg, 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