15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2011 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// This file declares a helper function that will check to see if a given folder
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// is "identical" to another (for some value of identical, see below).
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CHROME_INSTALLER_UTIL_DUPLICATE_TREE_DETECTOR_H_
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CHROME_INSTALLER_UTIL_DUPLICATE_TREE_DETECTOR_H_
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace base {
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class FilePath;
142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace installer {
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Returns true if |dest_path| contains all the files from |src_path| in the
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// same directory structure and each of those files is of the same length.
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// src_path_ and |dest_path| must either both be files or both be directories.
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Note that THIS IS A WEAK DEFINITION OF IDENTICAL and is intended only to
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// catch cases of missing files or obvious modifications.
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// It notably DOES NOT CHECKSUM the files.
242a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)bool IsIdenticalFileHierarchy(const base::FilePath& src_path,
252a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                              const base::FilePath& dest_path);
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace installer
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // CHROME_INSTALLER_UTIL_DUPLICATE_TREE_DETECTOR_H_
30