|
|
@@ -0,0 +1,33 @@ |
|
|
|
#pragma once |
|
|
|
|
|
|
|
#include <sstream> |
|
|
|
|
|
|
|
namespace cppcore |
|
|
|
{ |
|
|
|
|
|
|
|
struct string_builder |
|
|
|
{ |
|
|
|
private: |
|
|
|
std::ostringstream os; |
|
|
|
|
|
|
|
public: |
|
|
|
/** |
|
|
|
* @brief Write something to the string builder |
|
|
|
*/ |
|
|
|
template<typename TArg> |
|
|
|
string_builder& operator<<(TArg&& arg); |
|
|
|
|
|
|
|
/** |
|
|
|
* @brief Get the constructed string. |
|
|
|
*/ |
|
|
|
inline std::string str() const; |
|
|
|
|
|
|
|
/** |
|
|
|
* @brief Get the constructed string. |
|
|
|
*/ |
|
|
|
inline operator std::string() const; |
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#include "string_builder.inl" |