PLCnext API Documentation  21.0.0.35466
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Arp::System::Commons::Services::Io::IDirectoryService Class Referenceabstract

Provides common file directory operations. More...

#include <IDirectoryService.hpp>

Inheritance diagram for Arp::System::Commons::Services::Io::IDirectoryService:
Inheritance graph

Public Types

typedef std::shared_ptr< IDirectoryServicePtr
 
typedef delegate< void(IRscReadEnumerator< FileSystemEntry > &)> EnumerateFileSystemEntriesResultDelegate
 
typedef delegate< void(IRscReadEnumerator< FileSystemTraitsEntry > &)> EnumerateFileSystemTraitsEntriesResultDelegate
 
- Public Types inherited from Arp::System::Rsc::Services::IRscService
typedef std::shared_ptr< IRscServicePtr
 

Public Member Functions

 IDirectoryService (void)
 Constructs an IDirectoryService instance. More...
 
virtual ~IDirectoryService (void)
 Destructs this instance and frees all resouces. More...
 
virtual boolean Exists (const RscString< 512 > &path)=0
 Checks if the specified directory exists. More...
 
virtual FileSystemError Create (const RscString< 512 > &path)=0
 Creates the specified directory. More...
 
virtual FileSystemError Delete (const RscString< 512 > &path)=0
 Deletes the specified directory and its content. More...
 
virtual FileSystemError Clear (const RscString< 512 > &path)=0
 Removes the content of the specified directory, but does not delete the specified directory itself. More...
 
virtual FileSystemError Move (const RscString< 512 > &sourcePath, const RscString< 512 > &destinationPath, boolean clear=false)=0
 Moves the specified directory and its content to the given new location. More...
 
virtual FileSystemError Copy (const RscString< 512 > &sourcePath, const RscString< 512 > &destinationPath, boolean clear=false)=0
 Copies the specified directory and its content to the given new location. More...
 
virtual void EnumerateFileSystemEntries (const RscString< 512 > &path, const RscString< 512 > &searchPattern, boolean recursive, EnumerateFileSystemEntriesResultDelegate resultDelegate)=0
 Enumerates all files and subdirectories of the specified directory. More...
 
virtual void EnumerateFileSystemTraitsEntries (const RscString< 512 > &path, const RscString< 512 > &searchPattern, Traits traits, boolean recursive, EnumerateFileSystemTraitsEntriesResultDelegate resultDelegate)=0
 Enumerates all files and subdirectories of the specified directory. More...
 
- Public Member Functions inherited from Arp::System::Rsc::Services::IRscService
 IRscService (void)=default
 Constructs an IRscService instance. More...
 
virtual ~IRscService (void)=default
 Destructs this instance and frees all resouces. More...
 

Static Public Member Functions

static IRscServiceProxyFactory & GetProxyFactory (void)
 
- Static Public Member Functions inherited from Arp::System::Rsc::Services::IRscService
static IRscServiceProxyFactory & GetProxyFactory (void)
 Returns a reference to service proxy factory to create a proxy instance of the service More...
 

Detailed Description

Provides common file directory operations.

The path separator is always '/'.

Constructor & Destructor Documentation

◆ IDirectoryService()

IDirectoryService::IDirectoryService ( void  )
inline

Constructs an IDirectoryService instance.

◆ ~IDirectoryService()

IDirectoryService::~IDirectoryService ( void  )
inlinevirtual

Destructs this instance and frees all resouces.

Member Function Documentation

◆ Clear()

virtual FileSystemError Arp::System::Commons::Services::Io::IDirectoryService::Clear ( const RscString< 512 > &  path)
pure virtual

Removes the content of the specified directory, but does not delete the specified directory itself.

Parameters
pathThe path of the directory to clear.
Returns
Result of the action.

◆ Copy()

virtual FileSystemError Arp::System::Commons::Services::Io::IDirectoryService::Copy ( const RscString< 512 > &  sourcePath,
const RscString< 512 > &  destinationPath,
boolean  clear = false 
)
pure virtual

Copies the specified directory and its content to the given new location.

Parameters
sourcePathThe source path of the directory to copy.
destinationPathThe destination path of the directory to copy all content to.
clearIf set to true the destination location is cleared first if it yet exists and the operation succeeds anyway while returning true. Otherwise, if the destination yet exists, the operations fails and returns false.
Returns
Result of the action.

◆ Create()

virtual FileSystemError Arp::System::Commons::Services::Io::IDirectoryService::Create ( const RscString< 512 > &  path)
pure virtual

Creates the specified directory.

Parameters
pathThe path of the directory to create.
Returns
Result of the action.

◆ Delete()

virtual FileSystemError Arp::System::Commons::Services::Io::IDirectoryService::Delete ( const RscString< 512 > &  path)
pure virtual

Deletes the specified directory and its content.

Parameters
pathThe path of the directory to delete.
Returns
Result of the action.

◆ EnumerateFileSystemEntries()

virtual void Arp::System::Commons::Services::Io::IDirectoryService::EnumerateFileSystemEntries ( const RscString< 512 > &  path,
const RscString< 512 > &  searchPattern,
boolean  recursive,
EnumerateFileSystemEntriesResultDelegate  resultDelegate 
)
pure virtual

Enumerates all files and subdirectories of the specified directory.

Parameters
pathThe path of the directory to search in.
searchPatternThe pattern of the files to enumerate.
recursiveif set to true the files of all subdirectories are liested as well.
Returns
A file system entry for each found file.

◆ EnumerateFileSystemTraitsEntries()

virtual void Arp::System::Commons::Services::Io::IDirectoryService::EnumerateFileSystemTraitsEntries ( const RscString< 512 > &  path,
const RscString< 512 > &  searchPattern,
Traits  traits,
boolean  recursive,
EnumerateFileSystemTraitsEntriesResultDelegate  resultDelegate 
)
pure virtual

Enumerates all files and subdirectories of the specified directory.

Parameters
pathThe path of the directory to search in.
searchPatternThe pattern of the files to enumerate.
traitsThe selection of traits to get.
recursiveif set to true the files of all subdirectories are liested as well.
Returns
A file system trait entry for each found file.

◆ Exists()

virtual boolean Arp::System::Commons::Services::Io::IDirectoryService::Exists ( const RscString< 512 > &  path)
pure virtual

Checks if the specified directory exists.

Parameters
pathThe path of the directory to check.
Returns
true if the directory exists, otherwise false.

◆ Move()

virtual FileSystemError Arp::System::Commons::Services::Io::IDirectoryService::Move ( const RscString< 512 > &  sourcePath,
const RscString< 512 > &  destinationPath,
boolean  clear = false 
)
pure virtual

Moves the specified directory and its content to the given new location.

Parameters
sourcePathThe source path of the directory to move.
destinationPathThe destination path of the directory to move all content to.
clearIf set to true the destination location is cleared first if it yet exists and the operation succeeds anyway while returning true. Otherwise, if the destination yet exists, the operations fails and returns false.
Returns
Result of the action.

The documentation for this class was generated from the following file: