OLD | NEW |
---|---|
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_CHROMEOS_GDATA_GDATA_FILES_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 // the same name "Foo" will be renames to "Foo (1)" and "Foo (2)". | 245 // the same name "Foo" will be renames to "Foo (1)" and "Foo (2)". |
246 // TODO(satorux): Remove this. crbug.com/139649 | 246 // TODO(satorux): Remove this. crbug.com/139649 |
247 void AddEntry(GDataEntry* entry); | 247 void AddEntry(GDataEntry* entry); |
248 | 248 |
249 // Removes the entry from its children list and destroys the entry instance. | 249 // Removes the entry from its children list and destroys the entry instance. |
250 // TODO(satorux): Remove this. crbug.com/139649 | 250 // TODO(satorux): Remove this. crbug.com/139649 |
251 void RemoveEntry(GDataEntry* entry); | 251 void RemoveEntry(GDataEntry* entry); |
252 | 252 |
253 // Takes over all entries from |dir|. | 253 // Takes over all entries from |dir|. |
254 // TODO(satorux): Remove this. crbug.com/139649 | 254 // TODO(satorux): Remove this. crbug.com/139649 |
255 bool TakeOverEntries(GDataDirectory* dir); | 255 void TakeOverEntries(GDataDirectory* dir); |
256 | 256 |
257 // Find a child by its name. | 257 // Find a child's resource_id by its name. |
satorux1
2012/08/20 16:40:08
Please document what's returned if the child is no
achuithb
2012/08/20 21:14:57
Done.
| |
258 // TODO(satorux): Remove this. crbug.com/139649 | 258 // TODO(satorux): Remove this. crbug.com/139649 |
259 GDataEntry* FindChild(const FilePath::StringType& file_name) const; | 259 const std::string& FindChild(const FilePath::StringType& file_name) const; |
260 | |
261 // Add |entry| to children. | |
262 void AddChild(GDataEntry* entry); | |
263 | 260 |
264 // Removes the entry from its children without destroying the | 261 // Removes the entry from its children without destroying the |
265 // entry instance. | 262 // entry instance. |
266 void RemoveChild(GDataEntry* entry); | 263 void RemoveChild(GDataEntry* entry); |
267 | 264 |
268 // Removes child elements. | 265 // Removes child elements. |
269 void RemoveChildren(); | 266 void RemoveChildren(); |
270 void RemoveChildFiles(); | 267 void RemoveChildFiles(); |
271 void RemoveChildDirectories(); | 268 void RemoveChildDirectories(); |
272 | 269 |
273 // Recursively extracts the paths set of all sub-directories. | 270 // Recursively extracts the paths set of all sub-directories. |
274 void GetChildDirectoryPaths(std::set<FilePath>* child_dirs); | 271 void GetChildDirectoryPaths(std::set<FilePath>* child_dirs); |
275 | 272 |
276 // Maps between base_name and resource_id of files and directories. | 273 // Map between base_name and resource_id of files and directories. |
277 typedef std::map<FilePath::StringType, GDataFile*> GDataFileCollection; | 274 typedef std::map<FilePath::StringType, std::string> GDataChildMap; |
278 typedef std::map<FilePath::StringType, GDataDirectory*> | |
279 GDataDirectoryCollection; | |
280 // Collection of children. | 275 // Collection of children. |
281 GDataFileCollection child_files_; | 276 GDataChildMap child_files_; |
282 GDataDirectoryCollection child_directories_; | 277 GDataChildMap child_directories_; |
283 | 278 |
284 DISALLOW_COPY_AND_ASSIGN(GDataDirectory); | 279 DISALLOW_COPY_AND_ASSIGN(GDataDirectory); |
285 }; | 280 }; |
286 | 281 |
287 } // namespace gdata | 282 } // namespace gdata |
288 | 283 |
289 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ | 284 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
OLD | NEW |