MySQL 8.4.2
Source Code Documentation
anonymous_namespace{relational_expression.cc}::StringJoiner Class Referencefinal

A class for formatting a list into a string where elements are separated by a separator. More...

Public Member Functions

 StringJoiner (const char *separator)
 
std::ostream & StartElement ()
 Start a new list element. More...
 
std::string GetResult () const
 

Private Attributes

const char * m_separator
 The separator between elements. More...
 
std::ostringstream m_stream
 The string represenation of the list. More...
 
bool m_first {true}
 True if we have not added any elements yet. More...
 

Detailed Description

A class for formatting a list into a string where elements are separated by a separator.

Constructor & Destructor Documentation

◆ StringJoiner()

anonymous_namespace{relational_expression.cc}::StringJoiner::StringJoiner ( const char *  separator)
inlineexplicit

Member Function Documentation

◆ GetResult()

std::string anonymous_namespace{relational_expression.cc}::StringJoiner::GetResult ( ) const
inline

◆ StartElement()

std::ostream & anonymous_namespace{relational_expression.cc}::StringJoiner::StartElement ( )
inline

Start a new list element.

Add a separator if needed.

Returns
The ostream to which we add the representation of the element.

Member Data Documentation

◆ m_first

bool anonymous_namespace{relational_expression.cc}::StringJoiner::m_first {true}
private

True if we have not added any elements yet.

◆ m_separator

const char* anonymous_namespace{relational_expression.cc}::StringJoiner::m_separator
private

The separator between elements.

◆ m_stream

std::ostringstream anonymous_namespace{relational_expression.cc}::StringJoiner::m_stream
private

The string represenation of the list.


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