No behavior change.
strm << " " << device.GetUDID() << ": " << device.GetName() << "\n";
}
- if (m_device.hasValue() && m_device->operator bool()) {
+ if (m_device.has_value() && m_device->operator bool()) {
strm << "Current device: " << m_device->GetUDID() << ": "
<< m_device->GetName();
if (m_device->GetState() == CoreSimulatorSupport::Device::State::Booted) {
FileSpec PlatformAppleSimulator::GetCoreSimulatorPath() {
#if defined(__APPLE__)
std::lock_guard<std::mutex> guard(m_core_sim_path_mutex);
- if (!m_core_simulator_framework_path.hasValue()) {
+ if (!m_core_simulator_framework_path.has_value()) {
m_core_simulator_framework_path =
FileSpec("/Library/Developer/PrivateFrameworks/CoreSimulator.framework/"
"CoreSimulator");
FileSystem::Instance().Resolve(*m_core_simulator_framework_path);
}
- return m_core_simulator_framework_path.getValue();
+ return m_core_simulator_framework_path.value();
#else
return FileSpec();
#endif
#if defined(__APPLE__)
CoreSimulatorSupport::Device PlatformAppleSimulator::GetSimulatorDevice() {
- if (!m_device.hasValue()) {
+ if (!m_device.has_value()) {
const CoreSimulatorSupport::DeviceType::ProductFamilyID dev_id = m_kind;
- std::string developer_dir = HostInfo::GetXcodeDeveloperDirectory().GetPath();
+ std::string developer_dir =
+ HostInfo::GetXcodeDeveloperDirectory().GetPath();
m_device = CoreSimulatorSupport::DeviceSet::GetAvailableDevices(
developer_dir.c_str())
.GetFanciest(dev_id);
}
- if (m_device.hasValue())
- return m_device.getValue();
+ if (m_device.has_value())
+ return m_device.value();
else
return CoreSimulatorSupport::Device();
}
CoreSimulatorSupport::ModelIdentifier
CoreSimulatorSupport::DeviceType::GetModelIdentifier() {
- if (!m_model_identifier.hasValue()) {
+ if (!m_model_identifier.has_value()) {
auto utf8_model_id = [[m_dev modelIdentifier] UTF8String];
if (utf8_model_id && *utf8_model_id)
m_model_identifier = ModelIdentifier(utf8_model_id);
}
- if (m_model_identifier.hasValue())
- return m_model_identifier.getValue();
+ if (m_model_identifier.has_value())
+ return m_model_identifier.value();
else
return ModelIdentifier();
}
CoreSimulatorSupport::OSVersion
CoreSimulatorSupport::DeviceRuntime::GetVersion() {
- if (!m_os_version.hasValue()) {
+ if (!m_os_version.has_value()) {
auto utf8_ver_string = [[m_dev versionString] UTF8String];
auto utf8_build_ver = [[m_dev buildVersionString] UTF8String];
if (utf8_ver_string && *utf8_ver_string && utf8_build_ver &&
}
}
- if (m_os_version.hasValue())
- return m_os_version.getValue();
+ if (m_os_version.has_value())
+ return m_os_version.value();
return OSVersion();
}
}
CoreSimulatorSupport::DeviceType CoreSimulatorSupport::Device::GetDeviceType() {
- if (!m_dev_type.hasValue())
+ if (!m_dev_type.has_value())
m_dev_type = DeviceType([m_dev deviceType]);
- return m_dev_type.getValue();
+ return m_dev_type.value();
}
CoreSimulatorSupport::DeviceRuntime
CoreSimulatorSupport::Device::GetDeviceRuntime() {
- if (!m_dev_runtime.hasValue())
+ if (!m_dev_runtime.has_value())
m_dev_runtime = DeviceRuntime([m_dev runtime]);
- return m_dev_runtime.getValue();
+ return m_dev_runtime.value();
}
bool CoreSimulatorSupport::
llvm::SmallVector<fd_set, 1> write_fdset;
llvm::SmallVector<fd_set, 1> error_fdset;
- if (max_read_fd.hasValue()) {
+ if (max_read_fd.has_value()) {
read_fdset.resize((nfds / FD_SETSIZE) + 1);
read_fdset_ptr = read_fdset.data();
}
- if (max_write_fd.hasValue()) {
+ if (max_write_fd.has_value()) {
write_fdset.resize((nfds / FD_SETSIZE) + 1);
write_fdset_ptr = write_fdset.data();
}
- if (max_error_fd.hasValue()) {
+ if (max_error_fd.has_value()) {
error_fdset.resize((nfds / FD_SETSIZE) + 1);
error_fdset_ptr = error_fdset.data();
}