PLCnext API Documentation  22.3.0.20
IFileService.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 "FileServiceProxyFactory.hpp"
10 #include "Arp/System/Rsc/Services/RscStreamAdapter.hpp"
11 #include "Arp/System/Rsc/Services/RscString.hxx"
12 #include "FileSystemError.hpp"
13 #include "TraitItem.hpp"
14 #include "Traits.hpp"
15 #include <vector>
16 
17 // DO NOT MODIFY THIS FILE, THIS FILE IS AUTOGENERATED BY IFileService.cs
18 
19 namespace Arp { namespace System { namespace Commons { namespace Services { namespace Io
20 {
21 
22 using namespace Arp;
23 using namespace Arp::System::Rsc::Services;
24 
30 class IFileService : public IRscService
31 {
32 public: // typedefs
33  using Ptr = std::shared_ptr<IFileService>;
34 
35 public: // construction/destruction
37  IFileService(void) = default;
38 
39 public: // static policy operation
40  static IRscServiceProxyFactory& GetProxyFactory(void);
41 
42 public: // abstract operations
50  virtual boolean Exists(const RscString<512>& path) = 0;
51 
62  virtual FileSystemError Write(const RscString<512>& filePath, boolean overwrite, const std::vector<TraitItem>& traitItems, RscStreamAdapter data) = 0;
63 
74  virtual FileSystemError Read(Traits fileTraits, const RscString<512>& filePath, RscStreamAdapter data, std::vector<TraitItem>& traitItems) = 0;
75 
83  virtual FileSystemError Delete(const RscString<512>& filePath) = 0;
84 
95  virtual FileSystemError Move(boolean createDirectory, boolean overwrite, const RscString<512>& sourceFilePath, const RscString<512>& destinationFilePath) = 0;
96 
107  virtual FileSystemError Copy(boolean createDirectory, boolean overwrite, const RscString<512>& sourceFilePath, const RscString<512>& destinationFilePath) = 0;
108 };
109 
111 // inline methods of class IFileService
112 inline IRscServiceProxyFactory& IFileService::GetProxyFactory()
113 {
114  return FileServiceProxyFactory::GetInstance();
115 }
116 
117 }}}}} // 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
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.
Provides common file operations for reading and writing files as well as deleting/moving/copying file...
Definition: IFileService.hpp:30