本文整理汇总了C++中Tag::getLanguage方法的典型用法代码示例。如果您正苦于以下问题:C++ Tag::getLanguage方法的具体用法?C++ Tag::getLanguage怎么用?C++ Tag::getLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tag
的用法示例。
在下文中一共展示了Tag::getLanguage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowTagsProperties
static void ShowTagsProperties()
{
TVITEM tvi;
ZeroMemory(&tvi, sizeof(TVITEM));
tvi.hItem = (HTREEITEM) TreeView_GetSelection(g_hTree);
tvi.mask = TVIF_PARAM;
int err = TreeView_GetItem(g_hTree, &tvi);
if (tvi.lParam != NULL)
{
TreeBuilder* builder = (TreeBuilder*) tvi.lParam;
Tag* tag = builder->GetTag();
if (tag != NULL)
{
std::string str = "Tag Name: " + tag->getFullTag();
str += "\r\nLanguage: " + tag->getLanguage();
str += "\r\nType: " + tag->getType();
str += "\r\nFile: " + tag->getFile();
if (tag->getMemberOf().length() != 0)
str += "\r\nMember of: " + tag->getMemberOf();
if (tag->getDetails().length() != 0)
str += "\r\nDetails: " + tag->getDetails();
MsgBox(str.c_str());
}
}
}
示例2: ImportTags
bool TagsDatabase::ImportTags()
{
// Open the file
tagFileInfo info;
tagFile *const file = tagsOpen(_tagsFile.c_str(), &info);
if (file == NULL)
{
MsgBox("Something went wrong opening generated tags file");
return false;
}
try
{
// First delete the old database (if any)
Delete();
// Create the new database
Open();
// Prepare the statement
SqliteStatement stmt(this);
stmt.Prepare("INSERT INTO Tags(Tag, File, Line, Pattern, Type, Language, MemberOf, MemberOfType, Inherits, Signature, Access, Implementation, ThisFileOnly, Unrecognized) VALUES (@tag, @file, @line, @pattern, @type, @language, @memberof, @memberoftype, @inherits, @signature, @access, @implementation, @thisfileonly, @unrecognized)");
// Go through the records and save them in the database
Tag tag;
tagEntry entry;
BeginTransaction();
while (tagsNext(file, &entry) == TagSuccess)
{
// Put it in the array
tag = entry;
// Is there anything to search for?
if (tag.getPattern().length() == 0 && tag.getLine() == 0)
continue;
// Very long search pattern in JavaScript, minimized?
if (tag.getLanguage() == "JavaScript")
if (tag.getPattern().length() >= MAX_PATH)
continue;
tag.SaveToDB(&stmt, _curDir);
}
stmt.Finalize();
CommitTransaction();
Close();
}
catch (SqliteException e)
{
tagsClose(file);
MsgBoxf("Something went wrong convert tags file to database!\n%s", e.what());
return false;
}
// Close the tags file
tagsClose(file);
return true;
}