本文整理汇总了C++中VString::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ VString::isEmpty方法的具体用法?C++ VString::isEmpty怎么用?C++ VString::isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VString
的用法示例。
在下文中一共展示了VString::isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mPath
VFSNode::VFSNode(const VString& path)
: mPath(path)
{
if (path.isEmpty()) {
mPath = ".";
}
}
示例2: _platform_getKnownDirectoryNode
// static
VFSNode VFSNode::_platform_getKnownDirectoryNode(KnownDirectoryIdentifier id, const VString& companyName, const VString& appName) {
if (id == CURRENT_WORKING_DIRECTORY) {
return VFSNode(VPlatformAPI::getcwd());
}
if (id == EXECUTABLE_DIRECTORY) {
/*
This depends on the structure of the application or tool.
If it's an iOS application, it's a bundle where we have:
/...../wanted-dir/AppName.app/executable
(2 levels up, wanted-dir is a randomized serial number at some path)
If it's built as a Mac OS X application bundle we have:
/...../wanted-dir/AppName.app/Contents/MacOS/executable
(4 levels up, typically wanted-dir is /Applications if installed, but doesn't have to be)
If it's built as a simple Unix-y tool we have:
/...../wanted-dir/executable
(1 level up, wanted-dir is wherever the tool has been placed)
*/
#ifdef VPLATFORM_MAC_IOS
const int NUM_LEVELS_UP = 2;
#else
#ifdef VAULT_MACOSX_APP_IS_BUNDLE
const int NUM_LEVELS_UP = 4;
#else
const int NUM_LEVELS_UP = 1;
#endif
#endif
VFSNode node = VFSNode::getExecutable();
for (int i = 0; i < NUM_LEVELS_UP; ++i) {
VFSNode parentNode;
node.getParentNode(parentNode);
node = parentNode;
}
return node;
}
VFSNode currentUserFolder(_V_NSHomeDirectory());
if (id == USER_HOME_DIRECTORY) {
return currentUserFolder;
}
VFSNode libraryFolder;
currentUserFolder.getChildNode("Library", libraryFolder);
libraryFolder.mkdir();
VFSNode subFolder;
switch (id) {
case USER_HOME_DIRECTORY:
// handled earlier; we returned above
break;
case LOG_FILES_DIRECTORY:
libraryFolder.getChildNode("Logs", subFolder);
break;
case USER_PREFERENCES_DIRECTORY:
libraryFolder.getChildNode("Preferences", subFolder);
break;
case CACHED_DATA_DIRECTORY:
libraryFolder.getChildNode("Caches", subFolder);
break;
case APPLICATION_DATA_DIRECTORY:
subFolder = libraryFolder;
break;
case CURRENT_WORKING_DIRECTORY:
// handled earlier; we returned above
break;
case EXECUTABLE_DIRECTORY:
// handled earlier; we returned above
break;
default:
throw VStackTraceException(VSTRING_FORMAT("VFSNode::_platform_getKnownDirectoryNode: Requested invalid directory ID %d.", (int) id));
break;
}
subFolder.mkdir();
VFSNode companyFolder;
if (companyName.isEmpty()) {
companyFolder = subFolder;
} else {
subFolder.getChildNode(companyName, companyFolder);
companyFolder.mkdir();
}
VFSNode resultNode;
if (appName.isEmpty()) {
resultNode = companyFolder;
} else {
companyFolder.getChildNode(appName, resultNode);
resultNode.mkdir();
//.........这里部分代码省略.........
示例3: setPath
void VFSNode::setPath(const VString& path) {
if (path.isEmpty())
mPath = ".";
else
mPath = path;
}