ReactOS  0.4.14-dev-115-g4576127
TCharmap Class Reference

#include <tcharmap.h>

Collaboration diagram for TCharmap:

Public Member Functions

 TCharmap ()
 
 ~TCharmap ()
 
void init ()
 
char translate (char c, char mapchar)
 
char translate (char c)
 
void setmap (char mapchar)
 
void translate_buffer (char *start, char *end)
 
void modmap (char pos, char mapchar, char c)
 

Public Attributes

int enabled
 

Private Attributes

charmap [256]
 
charcurrent_map
 

Detailed Description

Definition at line 6 of file tcharmap.h.

Constructor & Destructor Documentation

◆ TCharmap()

TCharmap::TCharmap ( )

Definition at line 180 of file tcharmap.cpp.

180  {
181  memset(map, 0, sizeof(map));
182 
183  map[0] = mapB; // default map
184  map[(unsigned char)'B'] = mapB;
185  map[(unsigned char)'A'] = mapA;
186  if(ini.get_fast_write()) {
187  map[(unsigned char)'0'] = map0_safe;
188  map[(unsigned char)'2'] = map0_safe;
189  } else {
190  map[(unsigned char)'0'] = map0;
191  map[(unsigned char)'2'] = map0;
192  }
193  current_map = map[0];
194 }
static char mapA[256]
Definition: tcharmap.cpp:71
static char mapB[256]
Definition: tcharmap.cpp:35
static char map0[256]
Definition: tcharmap.cpp:108
unsigned char
Definition: typeof.h:29
TConfig ini
Definition: tnconfig.cpp:45
Definition: _map.h:44
char * current_map
Definition: tcharmap.h:9
bool get_fast_write() const
Definition: tnconfig.h:53
#define memset(x, y, z)
Definition: compat.h:39
static char map0_safe[256]
Definition: tcharmap.cpp:145

◆ ~TCharmap()

TCharmap::~TCharmap ( )

Definition at line 196 of file tcharmap.cpp.

196  {
197  for(int j = 0; j < 256; j++) {
198  if(map[j]) {
199  // Don't delete static maps!
200  switch(j) {
201  case 'B':
202  case 'A':
203  case '0':
204  case '2':
205  case 0: break;
206  default: delete map[j];
207  }
208  }
209  }
210 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
Definition: _map.h:44

Member Function Documentation

◆ init()

void TCharmap::init ( )
inline

Definition at line 14 of file tcharmap.h.

14 {}

Referenced by TMapLoader::Load().

◆ modmap()

void TCharmap::modmap ( char  pos,
char  mapchar,
char  c 
)

Definition at line 212 of file tcharmap.cpp.

212  {
213  if(!map[(unsigned char)mapchar]) {
214  map[(unsigned char)mapchar] = new char[256];
215  for(int j = 0; j < 256; j++) map[(unsigned char)mapchar][(unsigned char)pos] = j;
216  }
217  map[(unsigned char)mapchar][(unsigned char)pos] = c;
218 }
unsigned char
Definition: typeof.h:29
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
Definition: _map.h:44
#define c
Definition: ke_i.h:80

Referenced by TMapLoader::LoadCharMap().

◆ setmap()

void TCharmap::setmap ( char  mapchar)
inline

Definition at line 24 of file tcharmap.h.

24  {
25  if(map[(unsigned char)mapchar]) current_map = map[(unsigned char)mapchar];
26  }
unsigned char
Definition: typeof.h:29
Definition: _map.h:44
char * current_map
Definition: tcharmap.h:9

Referenced by TANSIParser::ConSetAttribute(), TANSIParser::Init(), TANSIParser::ParseANSIBuffer(), and TANSIParser::ParseEscape().

◆ translate() [1/2]

char TCharmap::translate ( char  c,
char  mapchar 
)
inline

Definition at line 16 of file tcharmap.h.

16  {
17  if(map[(unsigned char)mapchar]) return map[(unsigned char)mapchar][(unsigned char)c];
18  return c;
19  }
unsigned char
Definition: typeof.h:29
Definition: _map.h:44
#define c
Definition: ke_i.h:80

Referenced by translate_buffer().

◆ translate() [2/2]

char TCharmap::translate ( char  c)
inline

Definition at line 20 of file tcharmap.h.

20  {
21  return current_map[(unsigned char)c];
22  }
unsigned char
Definition: typeof.h:29
const GLubyte * c
Definition: glext.h:8905
char * current_map
Definition: tcharmap.h:9

◆ translate_buffer()

void TCharmap::translate_buffer ( char start,
char end 
)
inline

Definition at line 28 of file tcharmap.h.

28  {
29  while(start < end) {
30  *start = translate(*start);
31  start++;
32  }
33  }
GLuint GLuint end
Definition: gl.h:1545
char translate(char c, char mapchar)
Definition: tcharmap.h:16
GLuint start
Definition: gl.h:1545

Referenced by TANSIParser::ParseANSIBuffer().

Member Data Documentation

◆ current_map

char* TCharmap::current_map
private

Definition at line 9 of file tcharmap.h.

Referenced by setmap(), TCharmap(), and translate().

◆ enabled

int TCharmap::enabled

Definition at line 37 of file tcharmap.h.

Referenced by TMapLoader::LoadCharMap(), and TANSIParser::ParseANSIBuffer().

◆ map

char* TCharmap::map[256]
private

Definition at line 8 of file tcharmap.h.


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