mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-28 23:15:52 +00:00
beast cleaning and tidying:
* Consolidate small modules into one * Remove Android-specific platform support * Remove Chrono.h from beast_core.h * Removed files: - TypeTraits.h - Utility.h - Net.h - Asio.h * Remove zlib support: - Remove inline zlib library sources - Remove GZIPCompressorOutputStream - Remove GZIPDecompressorInputStream * Remove obsolete or unused classes: - AbstractObject - BigInteger - BufferedInputStream - CacheLine - CPUMeter - DatagramSocket - DynamicObject - FileLogger - FPUFlags - Identifier - JSON - LocalisedStrings - MACAddress - MemoryAlignment - MemoryInputStream - MemoryMappedFile - NamedValueSet - OptionalScopedPointer - PerformanceCounter - PropertySet - ScopedTimeInterval - SparseSet - SpinDelay - StreamingSocket - StringPool - SubregionStream - Uuid - Variant
This commit is contained in:
@@ -902,19 +902,6 @@ File File::createTempFile (const String& fileNameEnding)
|
||||
return tempFile;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
MemoryMappedFile::MemoryMappedFile (const File& file, MemoryMappedFile::AccessMode mode)
|
||||
: address (nullptr), range (0, file.getSize()), fileHandle (0)
|
||||
{
|
||||
openInternal (file, mode);
|
||||
}
|
||||
|
||||
MemoryMappedFile::MemoryMappedFile (const File& file, const Range<int64>& fileRange, AccessMode mode)
|
||||
: address (nullptr), range (fileRange.getIntersectionWith (Range<int64> (0, file.getSize()))), fileHandle (0)
|
||||
{
|
||||
openInternal (file, mode);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
||||
class FileTests : public UnitTest
|
||||
@@ -1049,37 +1036,6 @@ public:
|
||||
expect (tempFile.getSize() == 10);
|
||||
}
|
||||
|
||||
beginTestCase ("Memory-mapped files");
|
||||
|
||||
{
|
||||
MemoryMappedFile mmf (tempFile, MemoryMappedFile::readOnly);
|
||||
expect (mmf.getSize() == 10);
|
||||
expect (mmf.getData() != nullptr);
|
||||
expect (memcmp (mmf.getData(), "0123456789", 10) == 0);
|
||||
}
|
||||
|
||||
{
|
||||
const File tempFile2 (tempFile.getNonexistentSibling (false));
|
||||
expect (tempFile2.create());
|
||||
expect (tempFile2.appendData ("xxxxxxxxxx", 10));
|
||||
|
||||
{
|
||||
MemoryMappedFile mmf (tempFile2, MemoryMappedFile::readWrite);
|
||||
expect (mmf.getSize() == 10);
|
||||
expect (mmf.getData() != nullptr);
|
||||
memcpy (mmf.getData(), "abcdefghij", 10);
|
||||
}
|
||||
|
||||
{
|
||||
MemoryMappedFile mmf (tempFile2, MemoryMappedFile::readWrite);
|
||||
expect (mmf.getSize() == 10);
|
||||
expect (mmf.getData() != nullptr);
|
||||
expect (memcmp (mmf.getData(), "abcdefghij", 10) == 0);
|
||||
}
|
||||
|
||||
expect (tempFile2.deleteFile());
|
||||
}
|
||||
|
||||
beginTestCase ("More writing");
|
||||
|
||||
expect (tempFile.appendData ("abcdefghij", 10));
|
||||
|
||||
Reference in New Issue
Block a user