本文整理汇总了C++中Lang::getLangID方法的典型用法代码示例。如果您正苦于以下问题:C++ Lang::getLangID方法的具体用法?C++ Lang::getLangID怎么用?C++ Lang::getLangID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lang
的用法示例。
在下文中一共展示了Lang::getLangID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getLangFromExt
LangType Buffer::getLangFromExt(const char *ext)
{
NppParameters *pNppParam = NppParameters::getInstance();
int i = pNppParam->getNbLang();
i--;
while (i >= 0)
{
Lang *l = pNppParam->getLangFromIndex(i--);
const char *defList = l->getDefaultExtList();
const char *userList = NULL;
LexerStylerArray &lsa = pNppParam->getLStylerArray();
const char *lName = l->getLangName();
LexerStyler *pLS = lsa.getLexerStylerByName(lName);
if (pLS)
userList = pLS->getLexerUserExt();
std::string list("");
if (defList)
list += defList;
if (userList)
{
list += " ";
list += userList;
}
if (isInList(ext, list.c_str()))
return l->getLangID();
}
return L_TXT;
}
示例2: setFileOpenSaveDlgFilters
int Notepad_plus::setFileOpenSaveDlgFilters(FileDialog & fDlg, int langType)
{
NppParameters *pNppParam = NppParameters::getInstance();
NppGUI & nppGUI = (NppGUI & )pNppParam->getNppGUI();
int i = 0;
Lang *l = NppParameters::getInstance()->getLangFromIndex(i++);
int ltIndex = 0;
bool ltFound = false;
while (l)
{
LangType lid = l->getLangID();
bool inExcludedList = false;
for (size_t j = 0 ; j < nppGUI._excludedLangList.size() ; j++)
{
if (lid == nppGUI._excludedLangList[j]._langType)
{
inExcludedList = true;
break;
}
}
if (!inExcludedList)
{
const TCHAR *defList = l->getDefaultExtList();
const TCHAR *userList = NULL;
LexerStylerArray &lsa = (NppParameters::getInstance())->getLStylerArray();
const TCHAR *lName = l->getLangName();
LexerStyler *pLS = lsa.getLexerStylerByName(lName);
if (pLS)
userList = pLS->getLexerUserExt();
generic_string list(TEXT(""));
if (defList)
list += defList;
if (userList)
{
list += TEXT(" ");
list += userList;
}
generic_string stringFilters = exts2Filters(list);
const TCHAR *filters = stringFilters.c_str();
if (filters[0])
{
fDlg.setExtsFilter(getLangDesc(lid, true).c_str(), filters);
//
// Get index of lang type to find
//
if (langType != -1 && !ltFound)
{
ltFound = langType == lid;
}
if (langType != -1 && !ltFound)
{
ltIndex++;
}
}
}
l = (NppParameters::getInstance())->getLangFromIndex(i++);
}
if (!ltFound)
return -1;
return ltIndex;
}