📄 mesgtext.cc
字号:
#include <string.h>#include <strstream.h>#include "basetype.h"#include "mesgtext.h"struct EMSGDC_Table_Entry { const char *index; const char *description;};#include "mesgttbl.h"static voiddummy(void){ (void)&EMSGDC_Instance; // shuts up unused warning}static const char *findDescription(const char *index){ Assert(index); // Efficiency is not an issue here, so linear search is fine EMSGDC_Table_Entry *ptr; for (ptr=EMSGDC_Table; ptr && ptr->index && strcmp(ptr->index,index) != 0; ++ptr); //Assert(ptr && ptr->index && ptr->description); if (!ptr || !ptr->index || !ptr->description) { return index; } else return ptr->description;}char *EMSGDC_Class::error(const char *index){ ostrstream stream; stream << findDescription("Error") << " - "; if (index && strlen(index)) stream << findDescription(index) << ends; return stream.str();}char *EMSGDC_Class::warning(const char *index){ ostrstream stream; stream << findDescription("Warning") << " - "; if (index && strlen(index)) stream << findDescription(index) << ends; return stream.str();}char *EMSGDC_Class::abort(const char *index){ ostrstream stream; stream << findDescription("Abort") << " - "; if (index && strlen(index)) stream << findDescription(index) << ends; return stream.str();}const char *EMSGDC_Class::message(const char *index){ return index && strlen(index) ? findDescription(index) : "";}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -