tdlight/tdutils/td/utils/emoji.h

33 lines
1.1 KiB
C
Raw Normal View History

2021-09-20 21:30:23 +02:00
//
2024-01-01 01:07:21 +01:00
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
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);
// removes all emoji modifiers from the string
string remove_emoji_modifiers(Slice emoji, bool remove_selectors = true);
// removes all emoji modifiers from the string in-place
void remove_emoji_modifiers_in_place(string &emoji, bool remove_selectors = true);
// 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