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

Provides common file operations for several files in a single call. More...

#include <IFileService2.hpp>

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

Public Types

using Ptr = std::shared_ptr< IFileService2 >
 
using DeleteManyFilePathsDelegate = delegate< void(IRscWriteEnumerator< RscString< 512 > > &)>
 
using DeleteManyResultDelegate = delegate< void(IRscReadEnumerator< FileSystemError > &)>
 
using ExistsManyPathsDelegate = delegate< void(IRscWriteEnumerator< RscString< 512 > > &)>
 
using ExistsManyResultDelegate = delegate< void(IRscReadEnumerator< boolean > &)>
 
using ReadManyReadFileDataDelegate = delegate< void(IRscReadEnumerator< ReadFileData > &)>
 
using ReadManyReadFileInfoDelegate = delegate< void(IRscWriteEnumerator< ReadFileInfo > &)>
 
using WriteManyResultDelegate = delegate< void(IRscReadEnumerator< FileSystemError > &)>
 
using WriteManyWriteFileDataDelegate = delegate< void(IRscWriteEnumerator< WriteFileData > &)>
 
- Public Types inherited from Arp::System::Rsc::Services::IRscService
typedef std::shared_ptr< IRscServicePtr
 

Public Member Functions

 IFileService2 (void)=default
 Constructs an IFileService2 instance.
 
virtual boolean Exists (const RscString< 512 > &path)=0
 Checks if the specified file exists. More...
 
virtual FileSystemError Write (const RscString< 512 > &filePath, boolean overwrite, const std::vector< TraitItem > &traitItems, RscStreamAdapter data)=0
 Writes the given data to the specified file. More...
 
virtual FileSystemError Read (Traits fileTraits, const RscString< 512 > &filePath, RscStreamAdapter data, std::vector< TraitItem > &traitItems)=0
 Reads the specified file from device. More...
 
virtual FileSystemError Delete (const RscString< 512 > &filePath)=0
 Deletes the specified file. More...
 
virtual FileSystemError Move (boolean createDirectory, boolean overwrite, const RscString< 512 > &sourceFilePath, const RscString< 512 > &destinationFilePath)=0
 Moves the specified file. More...
 
virtual FileSystemError Copy (boolean createDirectory, boolean overwrite, const RscString< 512 > &sourceFilePath, const RscString< 512 > &destinationFilePath)=0
 Copies the specified files. More...
 
virtual void ExistsMany (ExistsManyPathsDelegate pathsDelegate, ExistsManyResultDelegate resultDelegate)=0
 Checks if the specified files exist. More...
 
virtual void WriteMany (WriteManyWriteFileDataDelegate writeFileDataDelegate, WriteManyResultDelegate resultDelegate)=0
 Writes the given data to the specified files. More...
 
virtual void ReadMany (ReadManyReadFileInfoDelegate readFileInfoDelegate, ReadManyReadFileDataDelegate readFileDataDelegate)=0
 Reads the specified files. More...
 
virtual void DeleteMany (DeleteManyFilePathsDelegate filePathsDelegate, DeleteManyResultDelegate resultDelegate)=0
 Deletes the specified files. More...
 
- Public Member Functions inherited from Arp::System::Rsc::Services::IRscService
 IRscService (void)=default
 Constructs an IRscService instance.
 
virtual ~IRscService (void)=default
 Destructs this instance and frees all resouces.
 

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 operations for several files in a single call.

The path separator is always '/'.

This service is defined in library Arp.System.Commons.Services.

Member Function Documentation

◆ Copy()

virtual FileSystemError Arp::System::Commons::Services::Io::IFileService2::Copy ( boolean  createDirectory,
boolean  overwrite,
const RscString< 512 > &  sourceFilePath,
const RscString< 512 > &  destinationFilePath 
)
pure virtual

Copies the specified files.

Parameters
createDirectoryif set to true the directory of the file is created (recursively), if it does not exists yet.
overwriteif set to true the destination file is overwritten, if it yet exists, otherwise an error is returned.
sourceFilePathThe source path of the file to copy.
destinationFilePathThe destination path of the file to copy.
Returns
Result of the action.

◆ Delete()

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

Deletes the specified file.

Parameters
filePathThe pathe of the file to delete.
Returns
Result of the action.

◆ DeleteMany()

virtual void Arp::System::Commons::Services::Io::IFileService2::DeleteMany ( DeleteManyFilePathsDelegate  filePathsDelegate,
DeleteManyResultDelegate  resultDelegate 
)
pure virtual

Deletes the specified files.

Parameters
filePathsPaths of files to delete.
Returns
A Arp.System.Commons.Services.Io.FileSystemError array where each element corresponds the related element in filePaths . The element value isArp.System.Commons.Services.Io.FileSystemError.None, if the file could be deleted, otherwise the appropiate error info.

◆ Exists()

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

Checks if the specified file exists.

Parameters
pathPath of the file to check.
Returns
true if the file exists, otherwise false.

◆ ExistsMany()

virtual void Arp::System::Commons::Services::Io::IFileService2::ExistsMany ( ExistsManyPathsDelegate  pathsDelegate,
ExistsManyResultDelegate  resultDelegate 
)
pure virtual

Checks if the specified files exist.

Parameters
pathsPaths of files to check.
Returns
A bool array where each element corresponds the related element in paths . The element value is true, if the file exists, otherwise false.

◆ Move()

virtual FileSystemError Arp::System::Commons::Services::Io::IFileService2::Move ( boolean  createDirectory,
boolean  overwrite,
const RscString< 512 > &  sourceFilePath,
const RscString< 512 > &  destinationFilePath 
)
pure virtual

Moves the specified file.

Parameters
createDirectoryif set to true the directory of the file is created (recursively), if it does not exists yet.
overwriteif set to true the destination file is overwritten, if it yet exists, otherwise an error is returned.
sourceFilePathThe source path of the file to move.
destinationFilePathThe destination path of the file to move.
Returns
Result of the action.

◆ Read()

virtual FileSystemError Arp::System::Commons::Services::Io::IFileService2::Read ( Traits  fileTraits,
const RscString< 512 > &  filePath,
RscStreamAdapter  data,
std::vector< TraitItem > &  traitItems 
)
pure virtual

Reads the specified file from device.

Parameters
fileTraitsSpecifies the file traits to read, if this value is not Arp.System.Commons.Services.Io.Traits.None.
filePathThe path of the file to read.
dataData read from the specified file.
traitItemsSpecified trait items read from the specified file.
Returns
Result of the action.

◆ ReadMany()

virtual void Arp::System::Commons::Services::Io::IFileService2::ReadMany ( ReadManyReadFileInfoDelegate  readFileInfoDelegate,
ReadManyReadFileDataDelegate  readFileDataDelegate 
)
pure virtual

Reads the specified files.

Parameters
readFileInfoContains information of all files to read.
readFileDataContains the file data and traits of all read files, as well as an eror info if the file could not be read

◆ Write()

virtual FileSystemError Arp::System::Commons::Services::Io::IFileService2::Write ( const RscString< 512 > &  filePath,
boolean  overwrite,
const std::vector< TraitItem > &  traitItems,
RscStreamAdapter  data 
)
pure virtual

Writes the given data to the specified file.

Parameters
filePathPath of the file on the target.
overwriteIf set to true the destination file is overwritten, if it yet exists, otherwise an error is returned.
traitItemsTrait items to set up after writing the file.
dataData to writing into the specified file.
Returns
Result of the action.

◆ WriteMany()

virtual void Arp::System::Commons::Services::Io::IFileService2::WriteMany ( WriteManyWriteFileDataDelegate  writeFileDataDelegate,
WriteManyResultDelegate  resultDelegate 
)
pure virtual

Writes the given data to the specified files.

Parameters
writeFileDataAn array of Arp.System.Commons.Services.Io.WriteFileData where ech element contains the file info and data of the file to write.
Returns
A Arp.System.Commons.Services.Io.FileSystemError array where each element corresponds the related element in writeFileData . The element value isArp.System.Commons.Services.Io.FileSystemError.None, if the file could be written, otherwise the appropiate error info.

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