From c99b24c16d1111a701d915832f24ac457aef697d Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Fri, 10 Jun 2016 14:06:06 +0600 Subject: COMMON: Add String::asUint64() Instead of all these atoull() I've added everywhere. --- .../googledrive/googledrivelistdirectorybyidrequest.cpp | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'backends/cloud/googledrive/googledrivelistdirectorybyidrequest.cpp') 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()); -- cgit v1.2.3