2 // Automated Testing Framework (atf)
4 // Copyright (c) 2007 The NetBSD Foundation, Inc.
5 // All rights reserved.
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions
10 // 1. Redistributions of source code must retain the above copyright
11 // notice, this list of conditions and the following disclaimer.
12 // 2. Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
16 // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
17 // CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 // IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #if !defined(_ATF_CXX_UI_HPP_)
31 #define _ATF_CXX_UI_HPP_
39 //! \brief Formats an error message to fit on screen.
41 //! Given the program's name and an error message, properly formats it to
44 //! The program's name is not stored globally to prevent the usage of this
45 //! function from inside the library. Making it a explicit parameter
46 //! restricts its usage to the frontend.
48 std::string
format_error(const std::string
&, const std::string
&);
51 //! \brief Formats an informational message to fit on screen.
53 //! Given the program's name and an informational message, properly formats
54 //! it to fit on screen.
56 //! The program's name is not stored globally to prevent the usage of this
57 //! function from inside the library. Making it a explicit parameter
58 //! restricts its usage to the frontend.
60 std::string
format_info(const std::string
&, const std::string
&);
63 //! \brief Formats a block of text to fit nicely on screen.
65 //! Given a text, which is composed of multiple paragraphs separated by
66 //! a single '\n' character, reformats it to fill on the current screen's
67 //! width with proper line wrapping.
69 //! This is just a special case of format_text_with_tag, provided for
72 std::string
format_text(const std::string
&);
75 //! \brief Formats a block of text to fit nicely on screen, prepending a
78 //! Given a text, which is composed of multiple paragraphs separated by
79 //! a single '\n' character, reformats it to fill on the current screen's
80 //! width with proper line wrapping. The text is prepended with a tag;
81 //! i.e. a word that is printed at the beginning of the first paragraph and
82 //! optionally repeated at the beginning of each word. The last parameter
83 //! specifies the column on which the text should start, and that position
84 //! must be greater than the tag's length or 0, in which case it
85 //! automatically takes the correct value.
87 std::string
format_text_with_tag(const std::string
&, const std::string
&,
91 //! \brief Formats a warning message to fit on screen.
93 //! Given the program's name and a warning message, properly formats it to
96 //! The program's name is not stored globally to prevent the usage of this
97 //! function from inside the library. Making it a explicit parameter
98 //! restricts its usage to the frontend.
100 std::string
format_warning(const std::string
&, const std::string
&);
105 #endif // !defined(_ATF_CXX_UI_HPP_)