Teach symstore more duplicated DLLs
[LibreOffice.git] / sw / inc / ToxWhitespaceStripper.hxx
blob9185fa5a4ee95b1ea7d36366fbe8a4ecd92f33ba
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
11 #ifndef TOXWHITESPACESTRIPPER_HXX_
12 #define TOXWHITESPACESTRIPPER_HXX_
14 #include <rtl/ustring.hxx>
15 #include <vector>
17 namespace sw {
19 /** This class helps to remove unwanted whitespaces from a string to use in a Tox.
21 * The new string will have
22 * - Newlines changed to spaces
23 * - Consecutive spaces merged
24 * - Trailing spaces removed
26 * It also allows to find the corresponding new positions of the input string in the stripped string.
27 * This is important for attributes which might have to be imported, e.g., it helps to answer the question:
28 * The 3rd character of the input string is subscript, which character in the output string is that?
30 * @note One leading whitespace is preserved.
32 class ToxWhitespaceStripper
34 public:
35 ToxWhitespaceStripper(const OUString&);
37 sal_Int32
38 GetPositionInStrippedString(sal_Int32 pos) const;
40 const OUString&
41 GetStrippedString() const { return mStripped;}
43 private:
44 OUString mStripped;
45 std::vector<sal_Int32> mNewPositions;
48 } // end namespace sw
51 #endif /* TOXWHITESPACESTRIPPER_HXX_ */