void OpenSaveFileDialog::notifyListSelectAccept(MyGUI::List* _sender, size_t _index) { if (_index == MyGUI::ITEM_NONE) return; FileInfo info = *_sender->getItemDataAt<FileInfo>(_index); if (info.folder) { if (info.name == L"..") { size_t index = mCurrentFolder.find_last_of(L"\\/"); if (index != std::string::npos) { mCurrentFolder = mCurrentFolder.substr(0, index); } } else { mCurrentFolder = concatenatePath (mCurrentFolder.asWStr(), info.name); } update(); } else { accept(); } }
// ACCESSORS int baltzo::DataFileLoader::loadTimeZoneFilePath(bsl::string *result, const char *timeZoneId) const { BSLS_ASSERT(result); BSLS_ASSERT(timeZoneId); BSLS_ASSERT(INVALID_PATH != d_rootPath); const int rc = validateTimeZoneId(timeZoneId); if (0 != rc) { return rc; // RETURN } concatenatePath(result, d_rootPath.c_str(), timeZoneId); return 0; }
// CLASS METHODS bool baltzo::DataFileLoader::isPlausibleZoneinfoRootPath(const char *path) { BSLS_ASSERT(path); if (!bdls::FilesystemUtil::isDirectory(path, true)) { return false; // RETURN } bsl::string gmtPath; concatenatePath(&gmtPath, path, "GMT"); // If 'path' is a valid directory, appending "GMT" to it must result in a // valid path. return bdls::FilesystemUtil::isRegularFile(gmtPath.c_str(), true); }
NativePath NativePath::operator / (NativePath const &nativePath) const { return concatenatePath(nativePath); }
NativePath NativePath::concatenatePath(String const &nativePath) const { return concatenatePath(NativePath(nativePath)); }