PLCnext API Documentation  22.3.0.20
IFileService2.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 #include "Arp/System/Rsc/Services/IRscService.hpp"
9 #include "FileService2ProxyFactory.hpp"
10 #include "Arp/System/Core/delegate.hxx"
11 #include "Arp/System/Rsc/Services/IRscReadEnumerator.hxx"
12 #include "Arp/System/Rsc/Services/IRscWriteEnumerator.hxx"
13 #include "Arp/System/Rsc/Services/RscStreamAdapter.hpp"
14 #include "Arp/System/Rsc/Services/RscString.hxx"
15 #include "FileSystemError.hpp"
16 #include "ReadFileData.hpp"
17 #include "ReadFileInfo.hpp"
18 #include "TraitItem.hpp"
19 #include "Traits.hpp"
20 #include "WriteFileData.hpp"
21 #include <vector>
22 
23 // DO NOT MODIFY THIS FILE, THIS FILE IS AUTOGENERATED BY IFileService2.cs
24 
25 namespace Arp { namespace System { namespace Commons { namespace Services { namespace Io
26 {
27 
28 using namespace Arp;
29 using namespace Arp::System::Rsc::Services;
30 
35 class IFileService2 : public IRscService
36 {
37 public: // typedefs
38  using Ptr = std::shared_ptr<IFileService2>;
39  using ExistsManyPathsDelegate = delegate<void(IRscWriteEnumerator<RscString<512>>&)>;
40  using ExistsManyResultDelegate = delegate<void(IRscReadEnumerator<boolean>&)>;
41  using WriteManyWriteFileDataDelegate = delegate<void(IRscWriteEnumerator<WriteFileData>&)>;
42  using WriteManyResultDelegate = delegate<void(IRscReadEnumerator<FileSystemError>&)>;
43  using ReadManyReadFileInfoDelegate = delegate<void(IRscWriteEnumerator<ReadFileInfo>&)>;
44  using ReadManyReadFileDataDelegate = delegate<void(IRscReadEnumerator<ReadFileData>&)>;
45  using DeleteManyFilePathsDelegate = delegate<void(IRscWriteEnumerator<RscString<512>>&)>;
46  using DeleteManyResultDelegate = delegate<void(IRscReadEnumerator<FileSystemError>&)>;
47 
48 public: // construction/destruction
50  IFileService2(void) = default;
51 
52 public: // static policy operation
53  static IRscServiceProxyFactory& GetProxyFactory(void);
54 
55 public: // abstract operations
56  virtual boolean Exists(const RscString<512>& path) = 0;
57  virtual FileSystemError Write(const RscString<512>& filePath, boolean overwrite, const std::vector<TraitItem>& traitItems, RscStreamAdapter data) = 0;
58  virtual FileSystemError Read(Traits fileTraits, const RscString<512>& filePath, RscStreamAdapter data, std::vector<TraitItem>& traitItems) = 0;
59  virtual FileSystemError Delete(const RscString<512>& filePath) = 0;
60  virtual FileSystemError Move(boolean createDirectory, boolean overwrite, const RscString<512>& sourceFilePath, const RscString<512>& destinationFilePath) = 0;
61  virtual FileSystemError Copy(boolean createDirectory, boolean overwrite, const RscString<512>& sourceFilePath, const RscString<512>& destinationFilePath) = 0;
62 
70  virtual void ExistsMany(ExistsManyPathsDelegate pathsDelegate, ExistsManyResultDelegate resultDelegate) = 0;
71 
79  virtual void WriteMany(WriteManyWriteFileDataDelegate writeFileDataDelegate, WriteManyResultDelegate resultDelegate) = 0;
80 
86  virtual void ReadMany(ReadManyReadFileInfoDelegate readFileInfoDelegate, ReadManyReadFileDataDelegate readFileDataDelegate) = 0;
87 
95  virtual void DeleteMany(DeleteManyFilePathsDelegate filePathsDelegate, DeleteManyResultDelegate resultDelegate) = 0;
96 };
97 
99 // inline methods of class IFileService2
100 inline IRscServiceProxyFactory& IFileService2::GetProxyFactory()
101 {
102  return FileService2ProxyFactory::GetInstance();
103 }
104 
105 }}}}} // end of namespace Arp::System::Commons::Services::Io
Specifies write access to the file. Data can be written to the file and the file pointer can be moved...
Namespace for classes and interfaces for the Remote Service Call implementation
Definition: IRscReadEnumerator.hxx:9
Provides common file operations for several files in a single call.
Definition: IFileService2.hpp:35
Traits
This enum is used by several file services to specify the file traits to get or set, respectively.
Definition: Traits.hpp:20
FileSystemError
This enum is used by several file operations.
Definition: FileSystemError.hpp:20
This class serves as adapter between Rsc streams and streams from Arp::System::Commons::Io, e.g. file streams.
Definition: RscStreamAdapter.hpp:19
Specifies read access to the file. Data can be read from the file and the file pointer can be moved...
Root namespace for the PLCnext API
Base interface for all Rsc service interface.
Definition: IRscService.hpp:18
System components used by the System, Device, Plc or Io domains.