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 #include <vector>
13 
14 
15 namespace ablastr::utils
16 {
25  std::vector< std::string >
27  const std::string& text,
28  const int max_line_length);
29 
30 namespace TextMsg
31 {
40  std::string
41  Err (const std::string &msg, const bool do_text_wrapping = true);
42 
51  std::string
52  Info (const std::string &msg, const bool do_text_wrapping = true);
53 
64  std::string
65  Warn (const std::string &msg, const bool do_text_wrapping = true);
66 
67  void
68  Assert (const char *ex, const char *file, const int line, const std::string &msg);
69 
70 } // namespace TextMsg
71 } // namespace ablastr::utils
72 
73 #define ABLASTR_ALWAYS_ASSERT_WITH_MESSAGE(EX,MSG) (EX)?((void)0) : ablastr::utils::TextMsg::Assert( # EX , __FILE__, __LINE__ , MSG)
74 
75 
76 #endif // ABLASTR_TEXT_MSG_H_
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 &#39;### WARN: &#39; prefix and (by def...
Definition: TextMsg.cpp:68
std::vector< std::string > automatic_text_wrap(const std::string &text, const int max_line_length)
This function performs automatic text wrapping on a string, returning an array of strings each not ex...
Definition: TextMsg.cpp:82
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 &#39;### INFO: &#39; prefix and (by defau...
Definition: TextMsg.cpp:61
void Assert(const char *ex, const char *file, const int line, const std::string &msg)
Definition: TextMsg.cpp:75
int ex
Definition: Stencil.py:479
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 &#39;### ERROR: &#39; prefix and (by def...
Definition: TextMsg.cpp:54