diff options
author | Alexander Tkachev | 2016-06-10 14:06:06 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | c99b24c16d1111a701d915832f24ac457aef697d (patch) | |
tree | 9e812538728c8c7bd11ce06f2907cf1850e21df2 /backends/cloud/googledrive/googledrivelistdirectorybyidrequest.cpp | |
parent | e6242b0be8fc9f9abc4daf87f80675cca46df4d9 (diff) | |
download | scummvm-rg350-c99b24c16d1111a701d915832f24ac457aef697d.tar.gz scummvm-rg350-c99b24c16d1111a701d915832f24ac457aef697d.tar.bz2 scummvm-rg350-c99b24c16d1111a701d915832f24ac457aef697d.zip |
COMMON: Add String::asUint64()
Instead of all these atoull() I've added everywhere.
Diffstat (limited to 'backends/cloud/googledrive/googledrivelistdirectorybyidrequest.cpp')
-rw-r--r-- | backends/cloud/googledrive/googledrivelistdirectorybyidrequest.cpp | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/backends/cloud/googledrive/googledrivelistdirectorybyidrequest.cpp b/backends/cloud/googledrive/googledrivelistdirectorybyidrequest.cpp index f9af363254..86494e8c13 100644 --- a/backends/cloud/googledrive/googledrivelistdirectorybyidrequest.cpp +++ b/backends/cloud/googledrive/googledrivelistdirectorybyidrequest.cpp @@ -67,17 +67,6 @@ void GoogleDriveListDirectoryByIdRequest::makeRequest(Common::String pageToken) _workingRequest = ConnMan.addRequest(request); } -namespace { -uint64 atoull(Common::String s) { - uint64 result = 0; - for (uint32 i = 0; i < s.size(); ++i) { - if (s[i] < '0' || s[i] > '9') break; - result = result * 10L + (s[i] - '0'); - } - return result; -} -} - void GoogleDriveListDirectoryByIdRequest::responseCallback(Networking::JsonResponse response) { _workingRequest = nullptr; if (_ignoreCallback) return; @@ -113,7 +102,7 @@ void GoogleDriveListDirectoryByIdRequest::responseCallback(Networking::JsonRespo bool isDirectory = (item.getVal("mimeType")->asString() == "application/vnd.google-apps.folder"); uint32 size = 0, timestamp = 0; if (item.contains("size") && item.getVal("size")->isString()) - size = atoull(item.getVal("size")->asString()); + size = item.getVal("size")->asString().asUint64(); if (item.contains("modifiedTime") && item.getVal("modifiedTime")->isString()) timestamp = ISO8601::convertToTimestamp(item.getVal("modifiedTime")->asString()); |