HART
0.2.0
High level Audio Regression and Testing
Loading...
Searching...
No Matches
hart_str.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
#
include
<
sstream
>
4
#
include
<
string
>
5
6
namespace
hart
{
7
8
/// @brief Helper class for building strings with string stream syntax
9
/// @private
10
class
Str
11
{
12
public
:
13
/// @brief Appends value to a string stream
14
/// @param value Any printable value
15
template
<
typename
ValueType>
16
Str& operator<< (
const
ValueType& value)
17
{
18
m_stringStream << value;
19
return
*
this
;
20
}
21
22
/// @brief Returns a std::string constructed from a stream
23
std::string toStdString()
const
24
{
25
return
m_stringStream.str();
26
}
27
28
private
:
29
std::ostringstream m_stringStream;
30
};
31
32
/// @brief A helper to construct strings using the "<<" syntax
33
/// @details Usage: `HART_STR ("Some text: " << someValue << "...")`
34
/// @ingroup Utilities
35
#
define
HART_STR
(
...
)
(
hart
::
Str
(
)
<<
__VA_ARGS__
)
.
toStdString
(
)
36
37
}
// namespace hart
hart
Definition
hart_dsp.hpp:15
include
hart_str.hpp
Generated on Wed Mar 25 2026 03:33:18 for HART by
1.9.8
© 2025 HART by
Daniel Leonov