Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/sw/inc/   (Office von Apache Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 1 kB image not shown  

Quelle  ToxWhitespaceStripper.hxx   Sprache: C

 
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */


#pragma once

#include <rtl/ustring.hxx>
#include <vector>

namespace sw
{
/** This class helps to remove unwanted whitespaces from a string to use in a Tox.
 *
 * The new string will have
 * - Newlines changed to spaces
 * - Consecutive spaces merged
 * - Trailing spaces removed
 *
 * 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?
 *
 * @note One leading whitespace is preserved.
 */

class ToxWhitespaceStripper
{
public:
    ToxWhitespaceStripper(std::u16string_view);

    sal_Int32 GetPositionInStrippedString(sal_Int32 pos) const;

    const OUString& GetStrippedString() const { return mStripped; }

private:
    OUString mStripped;
    std::vector<sal_Int32> mNewPositions;
};

// end namespace sw

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5
C=94 H=99 G=96

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.