#include <folly/testing/TestUtil.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <glog/logging.h>
#include <folly/Exception.h>
#include <folly/File.h>
#include <folly/FileUtil.h>
#include <folly/Memory.h>
#include <folly/String.h>
#include <folly/ext/test_ext.h>
#include <folly/portability/Fcntl.h>
#ifdef _WIN32
#include <crtdbg.h>
#endif
#include <boost/regex.hpp>
namespace folly {
namespace test {
namespace {
fs::path generateUniquePath(fs::path path, StringPiece namePrefix) { … }
}
TemporaryFile::TemporaryFile(
StringPiece namePrefix, fs::path dir, Scope scope, bool closeOnDestruction)
: … { … }
void TemporaryFile::close() { … }
const fs::path& TemporaryFile::path() const { … }
void TemporaryFile::reset() { … }
TemporaryFile::~TemporaryFile() { … }
TemporaryDirectory::TemporaryDirectory(
StringPiece namePrefix, fs::path dir, Scope scope)
: … { … }
TemporaryDirectory::~TemporaryDirectory() { … }
ChangeToTempDir::ChangeToTempDir() { … }
ChangeToTempDir::~ChangeToTempDir() { … }
namespace detail {
SavedState disableInvalidParameters() { … }
#ifdef _WIN32
void enableInvalidParameters(SavedState state) {
_set_thread_local_invalid_parameter_handler(
(_invalid_parameter_handler)state.previousThreadLocalHandler);
_CrtSetReportMode(_CRT_ASSERT, state.previousCrtReportMode);
}
#else
void enableInvalidParameters(SavedState) { … }
#endif
bool hasPCREPatternMatch(StringPiece pattern, StringPiece target) { … }
bool hasNoPCREPatternMatch(StringPiece pattern, StringPiece target) { … }
}
CaptureFD::CaptureFD(int fd, ChunkCob chunk_cob)
: … { … }
void CaptureFD::release() { … }
CaptureFD::~CaptureFD() { … }
std::string CaptureFD::read() const { … }
std::string CaptureFD::readIncremental() { … }
fs::path find_resource(const std::string& resource) { … }
}
}