77 static std::string
breakString(
const std::string& input,
const Size indentation,
const Size max_lines,
const Size first_line_prefill = 0);
82 return console_width_;
85 friend struct ConsoleWidthTest;
89 int console_width_ = std::numeric_limits<int>::max();
Singleton helper for terminal-width-aware string wrapping in TOPP-tool console output.
Definition ConsoleUtils.h:38
void operator=(ConsoleUtils const &)=delete
Assignment operator deleted (singleton)
static std::string breakString(const std::string &input, const Size indentation, const Size max_lines, const Size first_line_prefill=0)
Convenience wrapper around breakStringList that joins the result with "\\n".
static StringList breakStringList(const std::string &input, const Size indentation, const Size max_lines, const Size first_line_prefill=0)
Wrap input to the current console width and return one element per output line.
static const ConsoleUtils & getInstance()
Return the singleton instance (constructed on first call; thread-safe per Meyers-singleton rules)
StringList breakString_(const std::string &input, const Size indentation, const Size max_lines, Size first_line_prefill) const
Non-static implementation used by the public static wrappers; receives the cached console_width_.
int getConsoleWidth() const
Cached console width (or std::numeric_limits<int>::max() when detection failed and wrapping is effect...
Definition ConsoleUtils.h:80
ConsoleUtils()
Private ctor — caches the console width once; use getInstance to access.
ConsoleUtils(const ConsoleUtils &)=delete
Copy constructor deleted (singleton)
int readConsoleSize_()
Probe the host environment / terminal to determine the console width (also honours the COLUMNS env va...
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
std::vector< std::string > StringList
Vector of String.
Definition ListUtils.h:44
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19