Diff
checker
文本
文本
图像
文档
Excel
文件夹
Legal
Enterprise
桌面版
定价
登录
下载 Diffchecker 桌面版
比较文本
查找两个文本文件之间的差异
工具
历史
实时编辑器
折叠未更改行
关闭换行
视图
拆分
统一
比对精度
智能
单词
字符
语法高亮
选择语法
忽略
文本转换
转到第一个差异
编辑输入
Diffchecker Desktop
运行Diffchecker最安全的方式。获取Diffchecker桌面应用:您的差异永远不会离开您的电脑!
获取桌面版
Untitled diff
创建于
10年前
差异永不过期
清除
导出
分享
解释
20 删除
行
总计
删除
字符
总计
删除
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
31 行
全部复制
12 添加
行
总计
添加
字符
总计
添加
要继续使用此功能,请升级到
Diff
checker
Pro
查看价格
25 行
全部复制
复制
已复制
复制
已复制
Interface per object
:
As opposed to
:
复制
已复制
复制
已复制
interface
Service
{
interface
GattRemoteServer
{
GetCharacteristic(CharacteristicId id
);
GetServices() => (array<ServiceInfo> services
);
GetCharacteristics
(
) =>
GetCharacteristics
ForService(ServiceId id
) =>
(array<CharacteristicInfo> characteristics);
(array<CharacteristicInfo> characteristics);
}
}
How Web Bluetooth would use it:
How Web Bluetooth would use it:
// BluetoothRemoteGATTService.cpp
// BluetoothRemoteGATTService.cpp
GetCharacteristic(String uuid) {
GetCharacteristic(String uuid) {
复制
已复制
复制
已复制
service
_->GetCharacteristics
(base::Bind(&OnGetCharacteristics, this,
uuid,
gatt
_->GetCharacteristics
ForService
(base::Bind(&OnGetCharacteristics, this,
...));
uuid,
...));
}
);
}
OnGetCharacteristics(uuid, characteristics, promise) {
OnGetCharacteristics(uuid, characteristics, promise) {
for (characteristic : characteristics) {
for (characteristic : characteristics) {
if (characteristic->uuid == uuid) {
if (characteristic->uuid == uuid) {
复制
已复制
复制
已复制
service_->GetCharacteristic(base::Bind(&OnGetCharacteristic, this, uuid,
promise.resolve(new BluetoothRemoteGATTCharacteristic(
characteristic
));
characteristic
->id, promise
));
return;
}
}
}
}
复制
已复制
复制
已复制
}
promise.
reject("Not Found Error"
);
OnGetCharacteristic(uuid, id, characteristic, promise) {
promise.
resolve(new BluetoothRemoteGATTCharacteristic(id, uuid)
);
}
}
复制
已复制
复制
已复制
已保存差异
原始文本
打开文件
Interface per object: interface Service { GetCharacteristic(CharacteristicId id); GetCharacteristics() => (array<CharacteristicInfo> characteristics); } How Web Bluetooth would use it: // BluetoothRemoteGATTService.cpp GetCharacteristic(String uuid) { service_->GetCharacteristics(base::Bind(&OnGetCharacteristics, this, uuid, ...)); }); OnGetCharacteristics(uuid, characteristics, promise) { for (characteristic : characteristics) { if (characteristic->uuid == uuid) { service_->GetCharacteristic(base::Bind(&OnGetCharacteristic, this, uuid, characteristic->id, promise)); return; } } } OnGetCharacteristic(uuid, id, characteristic, promise) { promise.resolve(new BluetoothRemoteGATTCharacteristic(id, uuid)); }
更改后文本
打开文件
As opposed to: interface GattRemoteServer { GetServices() => (array<ServiceInfo> services); GetCharacteristicsForService(ServiceId id) => (array<CharacteristicInfo> characteristics); } How Web Bluetooth would use it: // BluetoothRemoteGATTService.cpp GetCharacteristic(String uuid) { gatt_->GetCharacteristicsForService(base::Bind(&OnGetCharacteristics, this, uuid, ...)); } OnGetCharacteristics(uuid, characteristics, promise) { for (characteristic : characteristics) { if (characteristic->uuid == uuid) { promise.resolve(new BluetoothRemoteGATTCharacteristic(characteristic)); } } promise.reject("Not Found Error"); }
查找差异