aboutsummaryrefslogtreecommitdiffstats
path: root/util/string/reverse.h
blob: 80f8b0088741d27fc9b2fcc367ad2df8f33d564a (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);