本文整理汇总了C++中StyleContext::GetCurrentLowered方法的典型用法代码示例。如果您正苦于以下问题:C++ StyleContext::GetCurrentLowered方法的具体用法?C++ StyleContext::GetCurrentLowered怎么用?C++ StyleContext::GetCurrentLowered使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StyleContext
的用法示例。
在下文中一共展示了StyleContext::GetCurrentLowered方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckForKeyword
/**
* Check if the current content context represent a keyword and set the context state if so.
*/
static void CheckForKeyword(StyleContext& sc, WordList* keywordlists[], int activeState)
{
int length = sc.LengthCurrent() + 1; // +1 for the next char
char* s = new char[length];
sc.GetCurrentLowered(s, length);
if (keywordlists[0]->InList(s))
sc.ChangeState(SCE_MYSQL_MAJORKEYWORD | activeState);
else
if (keywordlists[1]->InList(s))
sc.ChangeState(SCE_MYSQL_KEYWORD | activeState);
else
if (keywordlists[2]->InList(s))
sc.ChangeState(SCE_MYSQL_DATABASEOBJECT | activeState);
else
if (keywordlists[3]->InList(s))
sc.ChangeState(SCE_MYSQL_FUNCTION | activeState);
else
if (keywordlists[5]->InList(s))
sc.ChangeState(SCE_MYSQL_PROCEDUREKEYWORD | activeState);
else
if (keywordlists[6]->InList(s))
sc.ChangeState(SCE_MYSQL_USER1 | activeState);
else
if (keywordlists[7]->InList(s))
sc.ChangeState(SCE_MYSQL_USER2 | activeState);
else
if (keywordlists[8]->InList(s))
sc.ChangeState(SCE_MYSQL_USER3 | activeState);
delete [] s;
}
示例2: ClassifyPascalWord
static void ClassifyPascalWord(WordList *keywordlists[], StyleContext &sc, int &curLineState, bool bSmartHighlighting) {
WordList& keywords = *keywordlists[0];
char s[100];
sc.GetCurrentLowered(s, sizeof(s));
if (keywords.InList(s)) {
if (curLineState & stateInAsm) {
if (strcmp(s, "end") == 0 && sc.GetRelative(-4) != '@') {
curLineState &= ~stateInAsm;
sc.ChangeState(SCE_PAS_WORD);
} else {
sc.ChangeState(SCE_PAS_ASM);
}
} else {
bool ignoreKeyword = false;
if (strcmp(s, "asm") == 0) {
curLineState |= stateInAsm;
} else if (bSmartHighlighting) {
if (strcmp(s, "property") == 0) {
curLineState |= stateInProperty;
} else if (strcmp(s, "exports") == 0) {
curLineState |= stateInExport;
} else if (!(curLineState & (stateInProperty | stateInExport)) && strcmp(s, "index") == 0) {
ignoreKeyword = true;
} else if (!(curLineState & stateInExport) && strcmp(s, "name") == 0) {
ignoreKeyword = true;
} else if (!(curLineState & stateInProperty) &&
(strcmp(s, "read") == 0 || strcmp(s, "write") == 0 ||
strcmp(s, "default") == 0 || strcmp(s, "nodefault") == 0 ||
strcmp(s, "stored") == 0 || strcmp(s, "implements") == 0 ||
strcmp(s, "readonly") == 0 || strcmp(s, "writeonly") == 0 ||
strcmp(s, "add") == 0 || strcmp(s, "remove") == 0)) {
ignoreKeyword = true;
}
}
if (!ignoreKeyword) {
sc.ChangeState(SCE_PAS_WORD);
}
}
} else if (curLineState & stateInAsm) {
sc.ChangeState(SCE_PAS_ASM);
}
sc.SetState(SCE_PAS_DEFAULT);
}