Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
clara::TextFlow::Column Class Reference

#include <clara.hpp>

Inheritance diagram for clara::TextFlow::Column:

Classes

class  iterator
 

Public Types

using const_iterator = iterator
 

Public Member Functions

 Column (std::string const &text)
 
auto width (size_t newWidth) -> Column &
 
auto indent (size_t newIndent) -> Column &
 
auto initialIndent (size_t newIndent) -> Column &
 
auto width () const -> size_t
 
auto begin () const -> iterator
 
auto end () const -> iterator
 
auto operator+ (Column const &other) -> Columns
 
auto toString () const -> std::string
 

Friends

std::ostream & operator<< (std::ostream &os, Column const &col)
 

Detailed Description

Definition at line 72 of file clara.hpp.

Member Typedef Documentation

◆ const_iterator

Definition at line 200 of file clara.hpp.

Constructor & Destructor Documentation

◆ Column()

clara::TextFlow::Column::Column ( std::string const & text)
inlineexplicit

Definition at line 202 of file clara.hpp.

202{ m_strings.push_back( text ); }

Member Function Documentation

◆ begin()

auto clara::TextFlow::Column::begin ( ) const -> iterator
inline

Definition at line 219 of file clara.hpp.

219{ return iterator( *this ); }

◆ end()

auto clara::TextFlow::Column::end ( ) const -> iterator
inline

Definition at line 220 of file clara.hpp.

220{ return { *this, m_strings.size() }; }

◆ indent()

auto clara::TextFlow::Column::indent ( size_t newIndent) -> Column&
inline

Definition at line 209 of file clara.hpp.

209 {
210 m_indent = newIndent;
211 return *this;
212 }

◆ initialIndent()

auto clara::TextFlow::Column::initialIndent ( size_t newIndent) -> Column&
inline

Definition at line 213 of file clara.hpp.

213 {
214 m_initialIndent = newIndent;
215 return *this;
216 }

◆ operator+()

auto clara::TextFlow::Column::operator+ ( Column const & other) -> Columns
inline

Definition at line 364 of file clara.hpp.

364 {
365 Columns cols;
366 cols += *this;
367 cols += other;
368 return cols;
369 }

◆ toString()

auto clara::TextFlow::Column::toString ( ) const -> std::string
inline

Definition at line 236 of file clara.hpp.

236 {
237 std::ostringstream oss;
238 oss << *this;
239 return oss.str();
240 }

◆ width() [1/2]

auto clara::TextFlow::Column::width ( ) const -> size_t
inline

Definition at line 218 of file clara.hpp.

218{ return m_width; }
Here is the caller graph for this function:

◆ width() [2/2]

auto clara::TextFlow::Column::width ( size_t newWidth) -> Column&
inline

Definition at line 204 of file clara.hpp.

204 {
205 assert( newWidth > 0 );
206 m_width = newWidth;
207 return *this;
208 }
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
Column const & col )
friend

Definition at line 222 of file clara.hpp.

222 {
223 bool first = true;
224 for( auto line : col ) {
225 if( first )
226 first = false;
227 else
228 os << "\n";
229 os << line;
230 }
231 return os;
232 }
os_t os

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