mlpack
Namespaces | Functions
hyphenate_string.hpp File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 mlpack
 Linear algebra utility functions, generally performed on matrices or vectors.
 

Functions

std::string mlpack::util::HyphenateString (const std::string &str, const std::string &prefix, const bool force=false)
 Hyphenate a string or split it onto multiple 80-character lines, with some amount of padding on each line. More...
 
std::string mlpack::util::HyphenateString (const std::string &str, int padding)
 Hyphenate a string or split it onto multiple 80-character lines, with some amount of padding on each line. More...
 

Detailed Description

Author
Ryan Curtin

Hyphenate a string.

mlpack is free software; you may redistribute it and/or modify it under the terms of the 3-clause BSD license. You should have received a copy of the 3-clause BSD license along with mlpack. If not, see http://www.opensource.org/licenses/BSD-3-Clause for more information.

Function Documentation

◆ HyphenateString() [1/2]

std::string mlpack::util::HyphenateString ( const std::string &  str,
const std::string &  prefix,
const bool  force = false 
)
inline

Hyphenate a string or split it onto multiple 80-character lines, with some amount of padding on each line.

This is used for option output.

Parameters
strString to hyphenate (splits are on ' ').
prefixPrefix to hyphenate a string with.
forceHyphenate the string even if the length is less then 80.
Exceptions
std::invalid_argumentif prefix.size() >= 80.

◆ HyphenateString() [2/2]

std::string mlpack::util::HyphenateString ( const std::string &  str,
int  padding 
)
inline

Hyphenate a string or split it onto multiple 80-character lines, with some amount of padding on each line.

This is used for option output.

Parameters
strString to hyphenate (splits are on ' ').
paddingAmount of padding on the left for each new line.