Doxygen
EmojiEntityMapper类 参考

Singleton helper class to map emoji entities to other formats 更多...

#include <emoji.h>

+ EmojiEntityMapper 的协作图:

Public 成员函数

const char * name (int index) const
 Access routine to the name of the Emoji entity 更多...
 
const char * unicode (int index) const
 Access routine to the unicode sequence for the Emoji entity 更多...
 
void writeEmojiFile (TextStream &t)
 Writes the list of supported emojis to the given file. 更多...
 
int symbol2index (const std::string &symName) const
 Returns a code for the requested Emoji entity name 更多...
 

静态 Public 成员函数

static EmojiEntityMapperinstance ()
 Returns the one and only instance of the Emoji entity mapper 更多...
 
static void deleteInstance ()
 Deletes the one and only instance of the Emoji entity mapper 更多...
 

Private 成员函数

 EmojiEntityMapper ()
 
 ~EmojiEntityMapper ()
 

Private 属性

std::map< std::string, int > m_name2symGh
 

静态 Private 属性

static EmojiEntityMappers_instance = 0
 

详细描述

Singleton helper class to map emoji entities to other formats

在文件 emoji.h24 行定义.

构造及析构函数说明

◆ EmojiEntityMapper()

EmojiEntityMapper::EmojiEntityMapper ( )
private

在文件 emoji.cpp1522 行定义.

1523 {
1524  // 2 loops to be able to give precedence to the unicodeName (CLDR)
1525  for (int i = 0; i < g_numEmojiEntities; i++)
1526  {
1527  m_name2symGh.insert(std::make_pair(g_emojiEntities[i].name, i));
1528  }
1529 }

引用了 g_emojiEntities, g_numEmojiEntities, m_name2symGh , 以及 name().

被这些函数引用 instance().

◆ ~EmojiEntityMapper()

EmojiEntityMapper::~EmojiEntityMapper ( )
private

在文件 emoji.cpp1531 行定义.

1532 {
1533 }

成员函数说明

◆ deleteInstance()

void EmojiEntityMapper::deleteInstance ( )
static

Deletes the one and only instance of the Emoji entity mapper

在文件 emoji.cpp1546 行定义.

1547 {
1548  delete s_instance;
1549  s_instance=0;
1550 }

引用了 s_instance.

◆ instance()

EmojiEntityMapper * EmojiEntityMapper::instance ( )
static

Returns the one and only instance of the Emoji entity mapper

在文件 emoji.cpp1536 行定义.

1537 {
1538  if (s_instance==0)
1539  {
1541  }
1542  return s_instance;
1543 }

引用了 EmojiEntityMapper() , 以及 s_instance.

被这些函数引用 DocEmoji::DocEmoji(), readConfiguration(), HtmlDocVisitor::visit(), DocbookDocVisitor::visit(), LatexDocVisitor::visit(), RTFDocVisitor::visit(), ManDocVisitor::visit(), XmlDocVisitor::visit(), TextDocVisitor::visit() , 以及 PerlModDocVisitor::visit().

◆ name()

const char * EmojiEntityMapper::name ( int  index) const

Access routine to the name of the Emoji entity

参数
indexcode of the requested Emoji entity returned by symbol2index()
返回
the name of the Emoji entity in GitHub format (i.e. :smile:)

在文件 emoji.cpp1590 行定义.

1591 {
1592  return index>=0 && index<g_numEmojiEntities ? g_emojiEntities[index].name : 0;
1593 }

引用了 g_emojiEntities, g_numEmojiEntities , 以及 emojiEntityInfo::name.

被这些函数引用 EmojiEntityMapper(), LatexDocVisitor::visit(), ManDocVisitor::visit(), XmlDocVisitor::visit(), TextDocVisitor::visit() , 以及 PerlModDocVisitor::visit().

◆ symbol2index()

int EmojiEntityMapper::symbol2index ( const std::string &  symName) const

Returns a code for the requested Emoji entity name

参数
symNameEmoji entity name
返回
the code for the requested Emoji entity name, in case the requested Emoji item does not exist -1 is returned.

在文件 emoji.cpp1558 行定义.

1559 {
1560  auto it = m_name2symGh.find(symName);
1561  return it!=m_name2symGh.end() ? it->second : -1;
1562 }

引用了 m_name2symGh.

被这些函数引用 DocEmoji::DocEmoji().

◆ unicode()

const char * EmojiEntityMapper::unicode ( int  index) const

Access routine to the unicode sequence for the Emoji entity

参数
indexcode of the requested Emoji entity returned by symbol2index()
返回
the unicode sequence of the Emoji entity,

在文件 emoji.cpp1580 行定义.

1581 {
1582  return index>=0 && index<g_numEmojiEntities ? g_emojiEntities[index].unicode : 0;
1583 }

引用了 g_emojiEntities, g_numEmojiEntities , 以及 emojiEntityInfo::unicode.

被这些函数引用 HtmlDocVisitor::visit(), DocbookDocVisitor::visit() , 以及 RTFDocVisitor::visit().

◆ writeEmojiFile()

void EmojiEntityMapper::writeEmojiFile ( TextStream t)

Writes the list of supported emojis to the given file.

在文件 emoji.cpp1567 行定义.

1568 {
1569  for (int i = 0; i < g_numEmojiEntities; i++)
1570  {
1571  t << g_emojiEntities[i].name << "\n";
1572  }
1573 }

引用了 g_emojiEntities, g_numEmojiEntities , 以及 emojiEntityInfo::name.

被这些函数引用 readConfiguration().

类成员变量说明

◆ m_name2symGh

std::map<std::string,int> EmojiEntityMapper::m_name2symGh
private

在文件 emoji.h38 行定义.

被这些函数引用 EmojiEntityMapper() , 以及 symbol2index().

◆ s_instance

EmojiEntityMapper * EmojiEntityMapper::s_instance = 0
staticprivate

在文件 emoji.h37 行定义.

被这些函数引用 deleteInstance() , 以及 instance().


该类的文档由以下文件生成:
g_emojiEntities
static struct emojiEntityInfo g_emojiEntities[]
emojiEntityInfo::unicode
const char * unicode
Definition: emoji.cpp:37
EmojiEntityMapper::m_name2symGh
std::map< std::string, int > m_name2symGh
Definition: emoji.h:38
EmojiEntityMapper::EmojiEntityMapper
EmojiEntityMapper()
Definition: emoji.cpp:1522
EmojiEntityMapper::name
const char * name(int index) const
Access routine to the name of the Emoji entity
Definition: emoji.cpp:1590
g_numEmojiEntities
static const int g_numEmojiEntities
Definition: emoji.cpp:1518
EmojiEntityMapper::s_instance
static EmojiEntityMapper * s_instance
Definition: emoji.h:37
emojiEntityInfo::name
const char * name
Definition: emoji.cpp:36