Doxygen
Mapper类 参考

Class representing a mapping from command names to command IDs. 更多...

#include <cmdmapper.h>

Public 成员函数

int map (const QCString &n)
 
QCString find (const int n)
 
 Mapper (const CommandMap *cm, bool caseSensitive)
 

Private 属性

std::map< std::string, int > m_map
 
bool m_cs
 

详细描述

Class representing a mapping from command names to command IDs.

在文件 cmdmapper.h219 行定义.

构造及析构函数说明

◆ Mapper()

Mapper::Mapper ( const CommandMap cm,
bool  caseSensitive 
)

在文件 cmdmapper.cpp256 行定义.

256  : m_cs(caseSensitive)
257 {
258  const CommandMap *p = cm;
259  while (p->cmdName)
260  {
261  m_map.insert(std::make_pair(p->cmdName,p->cmdId));
262  p++;
263  }
264 }

引用了 CommandMap::cmdId, CommandMap::cmdName , 以及 m_map.

成员函数说明

◆ find()

QCString Mapper::find ( const int  n)

在文件 cmdmapper.cpp246 行定义.

247 {
248  for (const auto &kv : m_map)
249  {
250  int curVal = kv.second;
251  if (curVal == n || (curVal == (n | SIMPLESECT_BIT))) return kv.first.c_str();
252  }
253  return QCString();
254 }

引用了 m_map , 以及 SIMPLESECT_BIT.

◆ map()

类成员变量说明

◆ m_cs

bool Mapper::m_cs
private

在文件 cmdmapper.h227 行定义.

被这些函数引用 map().

◆ m_map

std::map<std::string,int> Mapper::m_map
private

在文件 cmdmapper.h226 行定义.

被这些函数引用 find(), map() , 以及 Mapper().


该类的文档由以下文件生成:
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
QCString::str
std::string str() const
Definition: qcstring.h:442
CommandMap::cmdId
int cmdId
Definition: cmdmapper.cpp:35
CommandMap
Call representing a mapping from a command name to a command ID.
Definition: cmdmapper.cpp:19
Mapper::m_cs
bool m_cs
Definition: cmdmapper.h:227
SIMPLESECT_BIT
const int SIMPLESECT_BIT
Definition: cmdmapper.h:25
QCString::lower
QCString lower() const
Definition: qcstring.h:232
CommandMap::cmdName
const char * cmdName
Definition: cmdmapper.cpp:34
Mapper::m_map
std::map< std::string, int > m_map
Definition: cmdmapper.h:226
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108