WarpX
Functions
StringUtils.cpp File Reference
#include "StringUtils.H"
#include <sstream>

Functions

std::vector< std::string > automatic_text_wrap (const std::string &text, const int max_line_length)
 This function performs automatic text wrapping on a string, returning an array of strings each not exceeding the maximum line length (unless the text contains a word exceeding the maximum line length). More...
 

Function Documentation

◆ automatic_text_wrap()

std::vector<std::string> automatic_text_wrap ( const std::string &  text,
const int  max_line_length 
)

This function performs automatic text wrapping on a string, returning an array of strings each not exceeding the maximum line length (unless the text contains a word exceeding the maximum line length).

Parameters
[in]textthe string containing the text to be wrapped
[in]max_line_lengththe maximum line length
Returns
an std::vector containing the lines of the wrapped text