本文整理汇总了C++中ArchiveTreeNode::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ ArchiveTreeNode::getName方法的具体用法?C++ ArchiveTreeNode::getName怎么用?C++ ArchiveTreeNode::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArchiveTreeNode
的用法示例。
在下文中一共展示了ArchiveTreeNode::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: importEditorImages
void importEditorImages(MapTexHashMap& map, ArchiveTreeNode* dir, string path)
{
SImage image;
// Go through entries
for (unsigned a = 0; a < dir->numEntries(); a++)
{
ArchiveEntry* entry = dir->getEntry(a);
// Load entry to image
if (image.open(entry->getMCData()))
{
// Create texture in hashmap
string name = path + entry->getName(true);
//wxLogMessage("Loading editor texture %s", CHR(name));
map_tex_t& mtex = map[name];
mtex.texture = new GLTexture(false);
mtex.texture->setFilter(GLTexture::MIPMAP);
mtex.texture->loadImage(&image);
}
}
// Go through subdirs
for (unsigned a = 0; a < dir->nChildren(); a++)
{
ArchiveTreeNode* subdir = (ArchiveTreeNode*)dir->getChild(a);
importEditorImages(map, subdir, path + subdir->getName() + "/");
}
}
示例2: swapNames
void swapNames()
{
ArchiveTreeNode* dir = archive->getDir(path);
archive->renameDir(dir, old_name);
old_name = new_name;
new_name = dir->getName();
path = dir->getPath();
}
示例3: detectNamespace
/* ADatArchive::detectNamespace
* Returns the namespace that [entry] is within
*******************************************************************/
string ADatArchive::detectNamespace(ArchiveEntry* entry) {
// Check entry
if (!checkEntry(entry))
return "global";
// If the entry is in the root dir, it's in the global namespace
if (entry->getParentDir() == getRoot())
return "global";
// Get the entry's *first* parent directory after root (ie <root>/namespace/)
ArchiveTreeNode* dir = entry->getParentDir();
while (dir && dir->getParent() != getRoot())
dir = (ArchiveTreeNode*)dir->getParent();
// Namespace is the directory's name (in lowercase)
if (dir)
return dir->getName().Lower();
else
return "global"; // Error, just return global
}