duplicate_tree_detector.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
1// Copyright (c) 2011 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. 4// 5// This file declares a helper function that will check to see if a given folder 6// is "identical" to another (for some value of identical, see below). 7// 8 9#ifndef CHROME_INSTALLER_UTIL_DUPLICATE_TREE_DETECTOR_H_ 10#define CHROME_INSTALLER_UTIL_DUPLICATE_TREE_DETECTOR_H_ 11 12class FilePath; 13 14namespace installer { 15 16// Returns true if |dest_path| contains all the files from |src_path| in the 17// same directory structure and each of those files is of the same length. 18// src_path_ and |dest_path| must either both be files or both be directories. 19// Note that THIS IS A WEAK DEFINITION OF IDENTICAL and is intended only to 20// catch cases of missing files or obvious modifications. 21// It notably DOES NOT CHECKSUM the files. 22bool IsIdenticalFileHierarchy(const FilePath& src_path, 23 const FilePath& dest_path); 24 25} // namespace installer 26 27#endif // CHROME_INSTALLER_UTIL_DUPLICATE_TREE_DETECTOR_H_ 28