OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |