summaryrefslogtreecommitdiffstats
path: root/library/cpp/containers/cow_string/reverse.h
blob: d27b0b4fed6d708ff2abb52fd7487ad4f895b7b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once

#include <library/cpp/containers/cow_string/cow_string.h>

void ReverseInPlace(TCowString& 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(TUtf16CowString& string);

void ReverseInPlace(TUtf32CowString& string);