Class used to construct the print function.
More...
#include <print.hpp>
|
| struct | select_cout |
| | Struct used to define a way to template the choice of the "std::cout" object in order to be "std::cout" for "char" type or "std::wcout" for "wchar_t" type. More...
|
| |
|
| | Print () |
| | Default constructor of the Print class. It initializes the basic class members and enable (if required) performance improvements.. More...
|
| |
| template<class T > |
| void | setEnd (const T &end_val) |
| | Setter used to set the value of the "end" variable. Templated type is required in order to allow also char variables. More...
|
| |
| template<class T > |
| void | setSep (const T &sep_val) |
| | Setter used to set the value of the "sep" variable. Templated type is required in order to allow also char variables. More...
|
| |
| void | setFlush (const bool &flush_val) |
| | Setter used to set the value of the "flush" variable. Templated type is required in order to allow also char variables. More...
|
| |
| template<class T > |
| void | setPattern (const T &pattern_val) |
| | Setter used to set the value of the "pattern" variable. Templated type is required in order to allow also char variables. More...
|
| |
| template<class T , class... Args> |
| void | operator() (T &&first, Args &&... args) const |
| | Frontend implementation of the () operator overload to print to the output stream. The backend implementation is called in the required variation. More...
|
| |
| template<class... Args> |
| const std::basic_string< T_str > | operator() (mode &&first, Args &&... args) const |
| | Frontend implementation of the () operator overload to initialize its content with an std::string object. The backend implementation is called in the required variation. This overload is required in order to hide the output of the "print_backend" function during the initialization. More...
|
| |
| void | operator() (std::basic_ostream< T_str > &os=select_cout< T_str >::cout) const |
| | Template operator redefinition used to print an empty line on the screen. This is the no argument case overload. Can be used with "ptc::print()" or "ptc::print( ostream_name )". More...
|
| |
template<class T_str>
struct ptc::Print< T_str >
Class used to construct the print function.
- Template Parameters
-
| T_str | The type of the string objects defined inside the struct. This template is used in case you are dealing with std::string or std::wstring objects. |
◆ Print()
Default constructor of the Print class. It initializes the basic class members and enable (if required) performance improvements..
◆ operator()() [1/3]
template<class T_str >
template<class... Args>
| const std::basic_string<T_str> ptc::Print< T_str >::operator() |
( |
mode && |
first, |
|
|
Args &&... |
args |
|
) |
| const |
|
inline |
Frontend implementation of the () operator overload to initialize its content with an std::string object. The backend implementation is called in the required variation. This overload is required in order to hide the output of the "print_backend" function during the initialization.
- Template Parameters
-
| Args | Generic type of all the other objects to be passed to the backend implementation. |
- Parameters
-
| first | First object to be passed to the backend implementation. |
| args | The list of all the other objects to be passed to the backend implementation. |
- Returns
- const std::basic_string<T_str> The whole print content in string format.
◆ operator()() [2/3]
template<class T_str >
| void ptc::Print< T_str >::operator() |
( |
std::basic_ostream< T_str > & |
os = select_cout<T_str>::cout | ) |
const |
|
inline |
Template operator redefinition used to print an empty line on the screen. This is the no argument case overload. Can be used with "ptc::print()" or "ptc::print( ostream_name )".
- Parameters
-
| os | The stream in which you want to print the output. |
◆ operator()() [3/3]
template<class T_str >
template<class T , class... Args>
| void ptc::Print< T_str >::operator() |
( |
T && |
first, |
|
|
Args &&... |
args |
|
) |
| const |
|
inline |
Frontend implementation of the () operator overload to print to the output stream. The backend implementation is called in the required variation.
- Template Parameters
-
| T | Generic type of first object to be passed as argument to the backend implementation. |
| Args | Generic type of all the other objects to be passed to the backend implementation. |
- Parameters
-
| first | First object to be passed to the backend implementation. |
| args | The list of all the other objects to be passed to the backend implementation. |
◆ setEnd()
template<class T_str >
template<class T >
| void ptc::Print< T_str >::setEnd |
( |
const T & |
end_val | ) |
|
|
inline |
Setter used to set the value of the "end" variable. Templated type is required in order to allow also char variables.
- Template Parameters
-
| T | The type of the expression inserted to set the value of "end" variable. |
- Parameters
-
| end_val | The inserted expression used to set the value of "end" variable. |
◆ setFlush()
template<class T_str >
| void ptc::Print< T_str >::setFlush |
( |
const bool & |
flush_val | ) |
|
|
inline |
Setter used to set the value of the "flush" variable. Templated type is required in order to allow also char variables.
- Parameters
-
| flush_val | The inserted expression used to set the value of the "flush" variable. |
◆ setPattern()
template<class T_str >
template<class T >
| void ptc::Print< T_str >::setPattern |
( |
const T & |
pattern_val | ) |
|
|
inline |
Setter used to set the value of the "pattern" variable. Templated type is required in order to allow also char variables.
- Template Parameters
-
| T | The type of the expression inserted to set the value of "pattern" variable. |
- Parameters
-
| pattern_val | The inserted expression used to set the value of "pattern" variable. |
◆ setSep()
template<class T_str >
template<class T >
| void ptc::Print< T_str >::setSep |
( |
const T & |
sep_val | ) |
|
|
inline |
Setter used to set the value of the "sep" variable. Templated type is required in order to allow also char variables.
- Template Parameters
-
| T | The type of the expression inserted to set the value of "sep" variable. |
- Parameters
-
| end_val | The inserted expression used to set the value of "sep" variable. |
The documentation for this struct was generated from the following file: