Loading...
Searching...
No Matches
meshkit::plan::Text Class Reference

Owned byte string with the QString-style helpers used for tags and diagnostics. More...

#include <meshkit/detail/planmodel.hpp>

Inheritance diagram for meshkit::plan::Text:
Collaboration diagram for meshkit::plan::Text:

Public Member Functions

 Text ()=default
 
 Text (const std::string &v)
 Copy a std::string; also serves as an implicit conversion.
 
bool isEmpty () const
 Return true when the string holds no characters.
 
template<class T>
Text arg (const T &value) const
 Replace the lowest-numbered %1..%9 placeholder with a formatted value.
 
template<class T, class U>
Text arg (const T &a, const U &b) const
 Substitute two values in turn; exactly arg(a).arg(b).
 

Detailed Description

Owned byte string with the QString-style helpers used for tags and diagnostics.

A std::string (no encoding is imposed) that adds isEmpty() and %1..%9 placeholder substitution through arg(). Functions such as validate() return an empty Text for success.

Constructor & Destructor Documentation

◆ Text() [1/2]

meshkit::plan::Text::Text ( )
default
Here is the caller graph for this function:

◆ Text() [2/2]

meshkit::plan::Text::Text ( const std::string & v)
inline

Copy a std::string; also serves as an implicit conversion.

Parameters
[in]vString to copy.

Member Function Documentation

◆ arg() [1/2]

template<class T, class U>
Text meshkit::plan::Text::arg ( const T & a,
const U & b ) const
inline

Substitute two values in turn; exactly arg(a).arg(b).

Parameters
[in]aValue for the lowest-numbered placeholder.
[in]bValue for the lowest-numbered placeholder left after substituting a.
Returns
The substituted copy.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ arg() [2/2]

template<class T>
Text meshkit::plan::Text::arg ( const T & value) const
inline

Replace the lowest-numbered %1..%9 placeholder with a formatted value.

Parameters
[in]valueValue written with operator<< to a default-formatted std::ostringstream (a double therefore prints with six significant digits).
Returns
A copy in which every occurrence of the lowest-numbered placeholder present is replaced, or an unchanged copy when there is none. Only one digit is read, so %10 is %1 followed by 0. Inserted text is not rescanned by this call, but a later arg() call sees any placeholder it contains.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEmpty()

bool meshkit::plan::Text::isEmpty ( ) const
inline

Return true when the string holds no characters.

Here is the caller graph for this function:

The documentation for this class was generated from the following file: