2021-09-20 21:30:23 +02:00
|
|
|
//
|
2022-01-01 01:35:39 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
|
2021-09-20 21:30:23 +02:00
|
|
|
//
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
//
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "td/utils/common.h"
|
|
|
|
#include "td/utils/Slice.h"
|
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
|
|
|
// checks whether the string is an emoji; variation selectors are ignored
|
|
|
|
bool is_emoji(Slice str);
|
|
|
|
|
2021-10-05 15:12:04 +02:00
|
|
|
// checks whether emoji ends on a Fitzpatrick modifier and returns it's number or 0
|
|
|
|
int get_fitzpatrick_modifier(Slice emoji);
|
|
|
|
|
2021-10-05 22:20:49 +02:00
|
|
|
// removes all Fitzpatrick modifier from the end of the string
|
|
|
|
Slice remove_fitzpatrick_modifier(Slice emoji);
|
|
|
|
|
2021-09-21 05:32:34 +02:00
|
|
|
// removes all emoji modifiers from the end of the string
|
|
|
|
Slice remove_emoji_modifiers(Slice emoji);
|
|
|
|
|
|
|
|
// removes all emoji modifiers from the end of the string in place
|
|
|
|
void remove_emoji_modifiers_in_place(string &emoji);
|
|
|
|
|
2021-12-22 11:40:20 +01:00
|
|
|
// removes all emoji selectors from the string if it is an emoji
|
|
|
|
string remove_emoji_selectors(Slice emoji);
|
|
|
|
|
2021-09-20 21:30:23 +02:00
|
|
|
} // namespace td
|