llvm.org GIT mirror llvm / 4181a4f
New file git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7482 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
2 changed file(s) with 58 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 //===- Support/FileUtilities.h - File System Utilities ----------*- C++ -*-===//
1 //
2 // This file defines a family of utility functions which are useful for doing
3 // various things with files.
4 //
5 //===----------------------------------------------------------------------===//
6
7 #ifndef SUPPORT_FILEUTILITIES_H
8 #define SUPPORT_FILEUTILITIES_H
9
10 #include
11
12 /// DiffFiles - Compare the two files specified, returning true if they are
13 /// different or if there is a file error. If you specify a string to fill in
14 /// for the error option, it will set the string to an error message if an error
15 /// occurs, allowing the caller to distinguish between a failed diff and a file
16 /// system error.
17 ///
18 bool DiffFiles(const std::string &FileA, const std::string &FileB,
19 std::string *Error = 0);
20
21
22 /// MoveFileOverIfUpdated - If the file specified by New is different than Old,
23 /// or if Old does not exist, move the New file over the Old file. Otherwise,
24 /// remove the New file.
25 ///
26 void MoveFileOverIfUpdated(const std::string &New, const std::string &Old);
27
28 #endif
0 //===- Support/FileUtilities.h - File System Utilities ----------*- C++ -*-===//
1 //
2 // This file defines a family of utility functions which are useful for doing
3 // various things with files.
4 //
5 //===----------------------------------------------------------------------===//
6
7 #ifndef SUPPORT_FILEUTILITIES_H
8 #define SUPPORT_FILEUTILITIES_H
9
10 #include
11
12 /// DiffFiles - Compare the two files specified, returning true if they are
13 /// different or if there is a file error. If you specify a string to fill in
14 /// for the error option, it will set the string to an error message if an error
15 /// occurs, allowing the caller to distinguish between a failed diff and a file
16 /// system error.
17 ///
18 bool DiffFiles(const std::string &FileA, const std::string &FileB,
19 std::string *Error = 0);
20
21
22 /// MoveFileOverIfUpdated - If the file specified by New is different than Old,
23 /// or if Old does not exist, move the New file over the Old file. Otherwise,
24 /// remove the New file.
25 ///
26 void MoveFileOverIfUpdated(const std::string &New, const std::string &Old);
27
28 #endif