mirror of
https://github.com/XRPLF/clio.git
synced 2026-04-29 15:37:53 +00:00
19 lines
327 B
C++
19 lines
327 B
C++
#pragma once
|
|
|
|
#include <sstream>
|
|
#include <string>
|
|
|
|
/**
|
|
* @brief A simple string buffer that can be used to mock std::cout for console logging.
|
|
*/
|
|
class StringBuffer final : public std::stringbuf {
|
|
public:
|
|
std::string
|
|
getStrAndReset()
|
|
{
|
|
auto value = str();
|
|
str("");
|
|
return value;
|
|
}
|
|
};
|