My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
Mapper Class Reference

#include <cmdmapper.h>

Public Member Functions

int map (const char *n)
 
QString find (const int n)
 
 Mapper (const CommandMap *cm, bool caseSensitive)
 

Private Attributes

QDict< int > m_map
 
bool m_cs
 

Detailed Description

Class representing a mapping from command names to command IDs.

Definition at line 206 of file cmdmapper.h.

Constructor & Destructor Documentation

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

Definition at line 245 of file cmdmapper.cpp.

References CommandMap::cmdId, CommandMap::cmdName, and m_map.

: m_map(89), m_cs(caseSensitive)
{
m_map.setAutoDelete(TRUE);
const CommandMap *p = cm;
while (p->cmdName)
{
m_map.insert(p->cmdName,new int(p->cmdId));
p++;
}
}

Member Function Documentation

QString Mapper::find ( const int  n)

Definition at line 235 of file cmdmapper.cpp.

References m_map, and SIMPLESECT_BIT.

Referenced by defaultHandleTitleAndSize().

{
QDictIterator<int> mapIterator(m_map);
for (int *curVal = mapIterator.toFirst();(curVal = mapIterator.current());++mapIterator)
{
if (*curVal == n || (*curVal == (n | SIMPLESECT_BIT))) return mapIterator.currentKey();
}
return NULL;
}
int Mapper::map ( const char *  n)

Member Data Documentation

bool Mapper::m_cs
private

Definition at line 214 of file cmdmapper.h.

Referenced by map().

QDict<int> Mapper::m_map
private

Definition at line 213 of file cmdmapper.h.

Referenced by find(), map(), and Mapper().


The documentation for this class was generated from the following files: