mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-15 20:25:18 +02:00
better way to check if a JSONValue has a member
This commit is contained in:
parent
2acd00209f
commit
9da9b7240d
11
src/sync.d
11
src/sync.d
|
@ -9,22 +9,17 @@ private long thresholdFileSize = 10 * 2^^20; // 10 Mib
|
|||
|
||||
private bool isItemFolder(const ref JSONValue item)
|
||||
{
|
||||
scope (failure) return false;
|
||||
JSONValue folder = item["folder"];
|
||||
return true;
|
||||
return (("folder" in item.object) !is null);
|
||||
}
|
||||
|
||||
private bool isItemFile(const ref JSONValue item)
|
||||
{
|
||||
scope (failure) return false;
|
||||
JSONValue folder = item["file"];
|
||||
return true;
|
||||
return (("file" in item.object) !is null);
|
||||
}
|
||||
|
||||
private bool isItemDeleted(const ref JSONValue item)
|
||||
{
|
||||
scope (failure) return false;
|
||||
return !item["deleted"].isNull();
|
||||
return (("deleted" in item.object) !is null);
|
||||
}
|
||||
|
||||
private bool testCrc32(string path, const(char)[] crc32)
|
||||
|
|
Loading…
Reference in a new issue