aboutsummaryrefslogtreecommitdiffstats
path: root/util/string/reverse.h
blob: 3a70eef061d22c68e506284dbc4fc16061921845 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once

#include <util/generic/fwd.h>

void ReverseInPlace(TString& string);

/** NB. UTF-16 is variable-length encoding because of the surrogate pairs.
 * This function takes this into account and treats a surrogate pair as a single symbol.
 * Ex. if [C D] is a surrogate pair,
 * A B [C D] E
 * will become
 * E [C D] B A
 */
void ReverseInPlace(TUtf16String& string);

void ReverseInPlace(TUtf32String& string);