Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: chrome/browser/google_apis/drive_api_util.h

Issue 14341002: Implement query translation from GData WAPI to Drive API v2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refine query parsing. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_UTIL_H_ 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_UTIL_H_
6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_UTIL_H_ 6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 namespace google_apis { 10 namespace google_apis {
11 namespace util { 11 namespace util {
12 12
13 // Returns true if Drive v2 API is enabled via commandline switch. 13 // Returns true if Drive v2 API is enabled via commandline switch.
14 bool IsDriveV2ApiEnabled(); 14 bool IsDriveV2ApiEnabled();
15 15
16 } // namespace util 16 } // namespace util
17 17
18 namespace drive { 18 namespace drive {
19 namespace util { 19 namespace util {
20 20
21 // Escapes ' to \' in the |str|. This is designed to use for string value of 21 // Escapes ' to \' in the |str|. This is designed to use for string value of
22 // search parameter on Drive API v2. 22 // search parameter on Drive API v2.
23 // See also: https://developers.google.com/drive/search-parameters 23 // See also: https://developers.google.com/drive/search-parameters
24 std::string EscapeQueryStringValue(const std::string& str); 24 std::string EscapeQueryStringValue(const std::string& str);
25 25
26 // Parses the query, and builds a search query for Drive API v2.
27 // This only supports:
28 // Regular query (e.g. dog => fullText contains 'dog')
29 // Conjunctions
30 // (e.g. dog cat => fullText contains 'dog' and fullText contains 'cat')
31 // Exclusion query (e.g. -cat => not fullText contains 'cat').
32 // Quoted query (e.g. "dog cat" => fullText contains 'dog cat').
33 // See also: https://developers.google.com/drive/search-parameters
34 std::string TranslateQuery(const std::string& original_query);
35
26 } // namespace util 36 } // namespace util
27 } // namespace drive 37 } // namespace drive
28 } // namespace google_apis 38 } // namespace google_apis
29 39
30 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_UTIL_H_ 40 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/browser/google_apis/drive_api_service.cc ('k') | chrome/browser/google_apis/drive_api_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698