Fixes the bug where the XML output path is affected by test changing the current directory. By Stefan Weigand.

This commit is contained in:
zhanyong.wan
2009-01-26 19:21:32 +00:00
parent b593ccbbbe
commit 650d5bf3ba
6 changed files with 288 additions and 41 deletions

View File

@@ -93,6 +93,12 @@ class FilePath {
int number,
const char* extension);
// Given directory = "dir", relative_path = "test.xml",
// returns "dir/test.xml".
// On Windows, uses \ as the separator rather than /.
static FilePath ConcatPaths(const FilePath& directory,
const FilePath& relative_path);
// Returns a pathname for a file that does not currently exist. The pathname
// will be directory/base_name.extension or
// directory/base_name_<number>.extension if directory/base_name.extension
@@ -164,6 +170,9 @@ class FilePath {
// root directory per disk drive.)
bool IsRootDirectory() const;
// Returns true if pathname describes an absolute path.
bool IsAbsolutePath() const;
private:
// Replaces multiple consecutive separators with a single separator.
// For example, "bar///foo" becomes "bar/foo". Does not eliminate other