util: Add function FormatParagraph to format paragraph to fixed-width

This is to be used for the `-version` and `-help` messages.
This commit is contained in:
Wladimir J. van der Laan
2014-06-10 16:02:29 +02:00
parent 96b733e996
commit 97789d374c
3 changed files with 51 additions and 0 deletions

View File

@@ -286,6 +286,11 @@ inline std::string HexStr(const T& vch, bool fSpaces=false)
return HexStr(vch.begin(), vch.end(), fSpaces);
}
/** Format a paragraph of text to a fixed width, adding spaces for
* indentation to any added line.
*/
std::string FormatParagraph(const std::string in, size_t width=79, size_t indent=0);
inline int64_t GetPerformanceCounter()
{
int64_t nCounter = 0;