leveldb/util
Victor Costan a0191e5563 Add Env::Remove{File,Dir} which obsolete Env::Delete{File,Dir}.
The "DeleteFile" method name causes pain for Windows developers, because
<windows.h> #defines a DeleteFile macro to DeleteFileW or DeleteFileA.
Current code uses workarounds, like #undefining DeleteFile everywhere an
Env is declared, implemented, or used.

This CL removes the need for workarounds by renaming Env::DeleteFile to
Env::RemoveFile. For consistency, Env::DeleteDir is also renamed to
Env::RemoveDir. A few internal methods are also renamed for consistency.
Software that supports Windows is expected to migrate any Env
implementations and usage to Remove{File,Dir}, and never use the name
Env::Delete{File,Dir} in its code.

The renaming is done in a backwards-compatible way, at the risk of
making it slightly more difficult to build a new correct Env
implementation. The backwards compatibility is achieved using the
following hacks:

1) Env::Remove{File,Dir} methods are added, with a default
    implementation that calls into Env::Delete{File,Dir}. This makes old
    Env implementations compatible with code that calls into the updated
    API.
2) The Env::Delete{File,Dir} methods are no longer pure virtuals.
    Instead, they gain a default implementation that calls into
    Env::Remove{File,Dir}. This makes updated Env implementations
    compatible with code that calls into the old API.

The cost of this approach is that it's possible to write an Env without
overriding either Rename{File,Dir} or Delete{File,Dir}, without getting
a compiler warning. However, attempting to run the test suite will
immediately fail with an infinite call stack ending in
{Remove,Delete}{File,Dir}, making developers aware of the problem.

PiperOrigin-RevId: 288710907
2020-01-09 09:18:14 -08:00
..
arena_test.cc Internal change. 2019-12-02 11:44:39 -08:00
arena.cc Correct class/structure declaration order. 2019-05-03 09:48:57 -07:00
arena.h Correct class/structure declaration order. 2019-05-03 09:48:57 -07:00
bloom_test.cc Internal change. 2019-12-02 11:44:39 -08:00
bloom.cc Switch to using C++ 11 override specifier. 2019-05-09 14:11:06 -07:00
cache_test.cc Internal change. 2019-12-02 11:44:39 -08:00
cache.cc Switch to using C++ 11 override specifier. 2019-05-09 14:11:06 -07:00
coding_test.cc Internal change. 2019-12-02 11:44:39 -08:00
coding.cc unsigned char -> uint8_t 2019-05-28 15:44:32 -07:00
coding.h unsigned char -> uint8_t 2019-05-28 15:44:32 -07:00
comparator.cc Style cleanup. 2019-05-04 17:42:20 -07:00
crc32c_test.cc Internal change. 2019-12-02 11:44:39 -08:00
crc32c.cc Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
crc32c.h Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
env_posix_test_helper.h Limit the number of read-only files the POSIX Env will have open. 2017-01-04 09:13:20 -08:00
env_posix_test.cc Add Env::Remove{File,Dir} which obsolete Env::Delete{File,Dir}. 2020-01-09 09:18:14 -08:00
env_posix.cc Add Env::Remove{File,Dir} which obsolete Env::Delete{File,Dir}. 2020-01-09 09:18:14 -08:00
env_test.cc Add Env::Remove{File,Dir} which obsolete Env::Delete{File,Dir}. 2020-01-09 09:18:14 -08:00
env_windows_test_helper.h Switch corruption_test to use InMemEnv. 2019-03-20 13:57:03 -07:00
env_windows_test.cc Add Env::Remove{File,Dir} which obsolete Env::Delete{File,Dir}. 2020-01-09 09:18:14 -08:00
env_windows.cc Add Env::Remove{File,Dir} which obsolete Env::Delete{File,Dir}. 2020-01-09 09:18:14 -08:00
env.cc Add Env::Remove{File,Dir} which obsolete Env::Delete{File,Dir}. 2020-01-09 09:18:14 -08:00
filter_policy.cc Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
hash_test.cc Internal change. 2019-12-02 11:44:39 -08:00
hash.cc unsigned char -> uint8_t 2019-05-28 15:44:32 -07:00
hash.h Remove extern from function declarations. 2018-03-12 09:24:48 -07:00
histogram.cc Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
histogram.h Correct class/structure declaration order. 2019-05-03 09:48:57 -07:00
logging_test.cc Internal change. 2019-12-02 11:44:39 -08:00
logging.cc unsigned char -> uint8_t 2019-05-28 15:44:32 -07:00
logging.h Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
mutexlock.h Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
no_destructor_test.cc Internal change. 2019-12-02 11:44:39 -08:00
no_destructor.h Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
options.cc Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
posix_logger.h Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
random.h Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00
status_test.cc Internal change. 2019-12-02 11:44:39 -08:00
status.cc Add explicit typecasts to avoid compiler warning. 2019-05-24 14:49:37 -07:00
testutil.cc Switch testing harness to googletest. 2019-11-21 13:11:40 -08:00
testutil.h Internal change. 2019-12-02 11:44:39 -08:00
windows_logger.h Format all files IAW the Google C++ Style Guide. 2019-05-02 19:04:50 -07:00