LibreOffice Module sw (master) 1
Public Member Functions | Private Attributes | List of all members
sw::ToxWhitespaceStripper Class Reference

This class helps to remove unwanted whitespaces from a string to use in a Tox. More...

#include <ToxWhitespaceStripper.hxx>

Public Member Functions

 ToxWhitespaceStripper (std::u16string_view)
sal_Int32 GetPositionInStrippedString (sal_Int32 pos) const
const OUString & GetStrippedString () const

Private Attributes

OUString mStripped
std::vector< sal_Int32 > mNewPositions

Detailed Description

This class helps to remove unwanted whitespaces from a string to use in a Tox.

The new string will have

It also allows to find the corresponding new positions of the input string in the stripped string. This is important for attributes which might have to be imported, e.g., it helps to answer the question: The 3rd character of the input string is subscript, which character in the output string is that?

One leading whitespace is preserved.

Definition at line 31 of file ToxWhitespaceStripper.hxx.

Constructor & Destructor Documentation

◆ ToxWhitespaceStripper()

sw::ToxWhitespaceStripper::ToxWhitespaceStripper ( std::u16string_view  inputString)

Definition at line 19 of file ToxWhitespaceStripper.cxx.

References mNewPositions, mStripped, and pos.

Member Function Documentation

◆ GetPositionInStrippedString()

sal_Int32 sw::ToxWhitespaceStripper::GetPositionInStrippedString ( sal_Int32  pos) const

◆ GetStrippedString()

const OUString & sw::ToxWhitespaceStripper::GetStrippedString ( ) const

Definition at line 38 of file ToxWhitespaceStripper.hxx.

References mStripped.

Referenced by sw::ToxTextGenerator::HandleTextToken().

Member Data Documentation

◆ mNewPositions

std::vector<sal_Int32> sw::ToxWhitespaceStripper::mNewPositions

Definition at line 42 of file ToxWhitespaceStripper.hxx.

Referenced by GetPositionInStrippedString(), and ToxWhitespaceStripper().

◆ mStripped

OUString sw::ToxWhitespaceStripper::mStripped

Definition at line 41 of file ToxWhitespaceStripper.hxx.

Referenced by GetStrippedString(), and ToxWhitespaceStripper().

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