mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Remove ScopedPointer, ContainerDeletePolicy
This commit is contained in:
@@ -21,8 +21,9 @@
|
||||
*/
|
||||
//==============================================================================
|
||||
|
||||
namespace beast
|
||||
{
|
||||
#include <beast/cxx14/memory.h> // <memory>
|
||||
|
||||
namespace beast {
|
||||
|
||||
static StringArray parseWildcards (const String& pattern)
|
||||
{
|
||||
@@ -97,8 +98,9 @@ bool DirectoryIterator::next (bool* const isDirResult, bool* const isHiddenResul
|
||||
if (isDirectory)
|
||||
{
|
||||
if (isRecursive && ((whatToLookFor & File::ignoreHiddenFiles) == 0 || ! isHidden))
|
||||
subIterator = new DirectoryIterator (File::createFileWithoutCheckingPath (path + filename),
|
||||
true, wildCard, whatToLookFor);
|
||||
subIterator = std::make_unique <DirectoryIterator> (
|
||||
File::createFileWithoutCheckingPath (path + filename),
|
||||
true, wildCard, whatToLookFor);
|
||||
|
||||
matches = (whatToLookFor & File::findDirectories) != 0;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,9 @@
|
||||
#ifndef BEAST_DIRECTORYITERATOR_H_INCLUDED
|
||||
#define BEAST_DIRECTORYITERATOR_H_INCLUDED
|
||||
|
||||
namespace beast
|
||||
{
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
|
||||
//==============================================================================
|
||||
/**
|
||||
@@ -129,11 +130,9 @@ private:
|
||||
|
||||
private:
|
||||
friend class DirectoryIterator;
|
||||
friend class ScopedPointer<Pimpl>;
|
||||
ScopedPointer<Pimpl> pimpl;
|
||||
std::unique_ptr<Pimpl> pimpl;
|
||||
};
|
||||
|
||||
friend class ScopedPointer<NativeIterator::Pimpl>;
|
||||
StringArray wildCards;
|
||||
NativeIterator fileFinder;
|
||||
String wildCard, path;
|
||||
@@ -142,7 +141,7 @@ private:
|
||||
const int whatToLookFor;
|
||||
const bool isRecursive;
|
||||
bool hasBeenAdvanced;
|
||||
ScopedPointer <DirectoryIterator> subIterator;
|
||||
std::unique_ptr <DirectoryIterator> subIterator;
|
||||
File currentFile;
|
||||
};
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <beast/unit_test/suite.h>
|
||||
#include <memory>
|
||||
|
||||
namespace beast {
|
||||
|
||||
@@ -674,7 +675,7 @@ bool File::startAsProcess (const String& parameters) const
|
||||
//==============================================================================
|
||||
FileInputStream* File::createInputStream() const
|
||||
{
|
||||
ScopedPointer<FileInputStream> fin (new FileInputStream (*this));
|
||||
std::unique_ptr <FileInputStream> fin (new FileInputStream (*this));
|
||||
|
||||
if (fin->openedOk())
|
||||
return fin.release();
|
||||
@@ -684,7 +685,7 @@ FileInputStream* File::createInputStream() const
|
||||
|
||||
FileOutputStream* File::createOutputStream (const size_t bufferSize) const
|
||||
{
|
||||
ScopedPointer<FileOutputStream> out (new FileOutputStream (*this, bufferSize));
|
||||
std::unique_ptr <FileOutputStream> out (new FileOutputStream (*this, bufferSize));
|
||||
|
||||
return out->failedToOpen() ? nullptr
|
||||
: out.release();
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace beast
|
||||
TemporaryFile temp (myTargetFile);
|
||||
|
||||
// create a stream to the temporary file, and write some data to it...
|
||||
ScopedPointer <FileOutputStream> out (temp.getFile().createOutputStream());
|
||||
std::unique_ptr <FileOutputStream> out (temp.getFile().createOutputStream());
|
||||
|
||||
if (out != nullptr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user