summaryrefslogtreecommitdiffstats
path: root/base/file_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/file_util.h')
-rw-r--r--base/file_util.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/base/file_util.h b/base/file_util.h
index 579e81c..f74ff97 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -30,14 +30,15 @@
// This file contains utility functions for dealing with the local
// filesystem.
-#ifndef BASE_FILE_UTIL_H__
-#define BASE_FILE_UTIL_H__
+#ifndef BASE_FILE_UTIL_H_
+#define BASE_FILE_UTIL_H_
#include "build/build_config.h"
-#ifdef OS_WIN
+#if defined(OS_WIN)
#include <windows.h>
#endif
+
#include <stack>
#include <string>
@@ -120,13 +121,13 @@ void ReplaceExtension(std::wstring* file_name, const std::wstring& extension);
//-----------------------------------------------------------------------------
// Functions that involve filesystem access or modification:
-#ifdef OS_WIN
+#if defined(OS_WIN)
// Returns the number of files matching the current path that were
// created on or after the given FILETIME. Doesn't count ".." or ".".
// Filetime is UTC filetime, not LocalFiletime.
int CountFilesCreatedAfter(const std::wstring& path,
const FILETIME& file_time);
-#endif
+#endif // defined(OS_WIN)
// Deletes the given path, whether it's a file or a directory.
// If it's a directory, it's perfectly happy to delete all of the
@@ -162,7 +163,7 @@ bool PathExists(const std::wstring& path);
// Returns true if the given path is writable by the user, false otherwise.
bool PathIsWritable(const std::wstring& path);
-#ifdef OS_WIN
+#if defined(OS_WIN)
// Gets the creation time of the given file (expressed in the local timezone),
// and returns it via the creation_time parameter. Returns true if successful,
// false otherwise.
@@ -172,7 +173,7 @@ bool GetFileCreationLocalTime(const std::wstring& filename,
// Same as above, but takes a previously-opened file handle instead of a name.
bool GetFileCreationLocalTimeFromHandle(HANDLE file_handle,
LPSYSTEMTIME creation_time);
-#endif
+#endif // defined(OS_WIN)
// Returns true if the contents of the two files given are equal, false
// otherwise. If either file can't be read, returns false.
@@ -299,10 +300,10 @@ class FileEnumerator {
// enumerate in the breadth-first search.
std::stack<std::wstring> pending_paths_;
-#ifdef OS_WIN
+#if defined(OS_WIN)
WIN32_FIND_DATA find_data_;
HANDLE find_handle_;
-#endif
+#endif // defined(OS_WIN)
DISALLOW_EVIL_CONSTRUCTORS(FileEnumerator);
};
@@ -315,4 +316,4 @@ bool RenameFileAndResetSecurityDescriptor(
} // namespace file_util
-#endif // BASE_FILE_UTIL_H__
+#endif // BASE_FILE_UTIL_H_