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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/drive_backend_util.h

Issue 374843002: [SyncFS] [Refactoring] Change RemovePrefix() to return bool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_ 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_ 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 bool HasFileAsParent(const FileDetails& details, const std::string& file_id); 44 bool HasFileAsParent(const FileDetails& details, const std::string& file_id);
45 45
46 bool IsAppRoot(const FileTracker& tracker); 46 bool IsAppRoot(const FileTracker& tracker);
47 47
48 std::string GetTrackerTitle(const FileTracker& tracker); 48 std::string GetTrackerTitle(const FileTracker& tracker);
49 49
50 SyncStatusCode GDataErrorCodeToSyncStatusCode( 50 SyncStatusCode GDataErrorCodeToSyncStatusCode(
51 google_apis::GDataErrorCode error); 51 google_apis::GDataErrorCode error);
52 52
53 std::string RemovePrefix(const std::string& str, const std::string& prefix); 53 // Returns true if |str| starts with |prefix|, and removes |prefix| from |str|.
54 // If |out| is not NULL, the result is stored in it.
55 bool RemovePrefix(const std::string& str, const std::string& prefix,
56 std::string* out);
54 57
55 template <typename Src, typename Dest> 58 template <typename Src, typename Dest>
56 void AppendContents(const Src& src, Dest* dest) { 59 void AppendContents(const Src& src, Dest* dest) {
57 dest->insert(dest->end(), src.begin(), src.end()); 60 dest->insert(dest->end(), src.begin(), src.end());
58 } 61 }
59 62
60 template <typename Container> 63 template <typename Container>
61 const typename Container::mapped_type& LookUpMap( 64 const typename Container::mapped_type& LookUpMap(
62 const Container& container, 65 const Container& container,
63 const typename Container::key_type& key, 66 const typename Container::key_type& key,
(...skipping 14 matching lines...) Expand all
78 base::Callback<R()> CreateComposedFunction( 81 base::Callback<R()> CreateComposedFunction(
79 const base::Callback<T()>& g, 82 const base::Callback<T()>& g,
80 const base::Callback<R(S)>& f) { 83 const base::Callback<R(S)>& f) {
81 return base::Bind(&ComposeFunction<R, S, T>, g, f); 84 return base::Bind(&ComposeFunction<R, S, T>, g, f);
82 } 85 }
83 86
84 } // namespace drive_backend 87 } // namespace drive_backend
85 } // namespace sync_file_system 88 } // namespace sync_file_system
86 89
87 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_ 90 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_DRIVE_BACKEND_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/drive_backend_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698