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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CHANGE_H_
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CHANGE_H_
10 #include "base/files/file_path.h"
17 typedef std::set
<FileChange
> FileChangeSet
;
19 // Represents change in the filesystem. Rename is represented as two entries:
20 // of type DELETED and ADDED. CHANGED type is for changed contents of
21 // directories or for changed metadata and/or contents of files.
30 // Created an object representing a change of file or directory pointed by
31 // |change_path|. The change is of |change_type| type.
32 FileChange(const base::FilePath
& path
, Type type
);
35 // Factory method to create a FileChangeSet object with only one element.
36 static FileChangeSet
CreateSingleSet(const base::FilePath
& path
, Type type
);
38 bool operator==(const FileChange
&file_change
) const {
39 return path_
== file_change
.path() && type_
== file_change
.type();
42 bool operator<(const FileChange
&file_change
) const {
43 return (path_
< file_change
.path()) ||
44 (path_
== file_change
.path() && type_
< file_change
.type());
47 const base::FilePath
& path() const { return path_
; }
49 Type
type() const { return type_
; }
52 const base::FilePath path_
;
58 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_FILE_CHANGE_H_