wxMaxima
Loading...
Searching...
No Matches
Functions
TextBreaks.cpp File Reference

Splits plain text output into the pieces it may be broken into lines between. More...

#include "TextBreaks.h"
#include "UrlDetection.h"
Include dependency graph for TextBreaks.cpp:

Functions

bool wxm::IsTextBreakChar (wxUniChar ch)
 Is a line break allowed after this character?
 
std::vector< wxString > wxm::SplitAtTextBreaks (const wxString &line)
 Split one line of text (no newlines) after the characters a line may be broken after.
 

Detailed Description

Splits plain text output into the pieces it may be broken into lines between.

See TextBreaks.h.

Function Documentation

◆ IsTextBreakChar()

bool wxm::IsTextBreakChar ( wxUniChar  ch)

Is a line break allowed after this character?

True for a space, a tab, "+", "-", ",", ";", ".", "*" and "/".

◆ SplitAtTextBreaks()

std::vector< wxString > wxm::SplitAtTextBreaks ( const wxString &  line)

Split one line of text (no newlines) after the characters a line may be broken after.

Concatenating the pieces always gives back line unchanged. The character that allows the break stays at the end of the piece before the break. A run of such characters stays together (", " breaks after the space, "--" after the second "-"), and the line isn't broken

  • before its first character that isn't a break character, so indentation stays with the word it indents, or
  • after a "." or a "," that is followed by a digit, so a number like 3.14 or 1,000 is never torn apart, or
  • inside a link (see wxm::FindUrls()): a link is only shown as one if all of it is in the same cell.