8 #include "Arp/System/Core/IEnumerator.hxx" 9 #include <boost/regex.hpp> 11 namespace Arp {
namespace System {
namespace Commons {
namespace Io
88 static void Copy(
const String& sourcePath,
const String& destinationPath,
bool clear =
false);
99 static void Copy(
const String& sourcePath,
const String& destinationPath,
bool clear,
bool sync);
109 static void Move(
const String& sourcePath,
const String& destinationPath,
bool overwrite =
false);
120 static void Move(
const String& sourcePath,
const String& destinationPath,
bool overwrite,
bool sync);
130 ARP_DEPRECATED(
"Please use Directory::Move() instead of Directory::Rename().")
131 static void Rename(
const String& sourcePath,
const String& destinationPath);
254 static IEnumerator<String>::Ptr TryGetSearchEnumerator(
const String& path,
const char* searchPattern,
bool recursive,
bool files,
bool directories);
257 template<
class Iterator>
266 bool MoveNext(
void)
override;
270 Iterator boostIterator;
277 template<
class Iterator>
278 class SearchEnumerator :
public IEnumerator<String>
283 SearchEnumerator(
const String& path,
const String& searchPattern,
bool files,
bool directories,
bool& error);
286 bool MoveNext(
void)
override;
290 static String NormalizeSearchPattern(
const String& searchPattern);
293 boost::regex searchRegex;
294 Iterator boostIterator;
306 EmptyEnumerator() =
default;
309 bool MoveNext(
void)
override 330 return Directory::GetSearchEnumerator(path, searchPattern, recursive,
true,
true);
340 return Directory::GetSearchEnumerator(path, searchPattern, recursive,
true,
false);
350 return Directory::GetSearchEnumerator(path, searchPattern, recursive,
false,
true);
360 return Directory::TryGetSearchEnumerator(path, searchPattern, recursive,
true,
true);
370 return Directory::TryGetSearchEnumerator(path, searchPattern, recursive,
true,
false);
380 return Directory::TryGetSearchEnumerator(path, searchPattern, recursive,
false,
true);
static IEnumerator< String >::Ptr GetDirectoryEnumerator(const String &path, bool recursive=false)
Like Arp::System::Commons::Io::Directory::GetEnumerator but only directories are listed by the return...
Definition: Directory.hpp:343
static IEnumerator< String >::Ptr GetFileEnumerator(const String &path, bool recursive=false)
Like Arp::System::Commons::Io::Directory::GetEnumerator but only files are listed by the returned enu...
Definition: Directory.hpp:333
Declares the interface of the enumerator pattern, which is leaned on .NET enumerator idiom...
Definition: IEnumerator.hxx:47
static IEnumerator< String >::Ptr TryGetFileEnumerator(const String &path, bool recursive=false)
Like Arp::System::Commons::Io::Directory::GetFileEnumerator but will not throw any exception...
Definition: Directory.hpp:363
static IEnumerator< String >::Ptr TryGetDirectoryEnumerator(const String &path, bool recursive=false)
Like Arp::System::Commons::Io::Directory::GetDirectoryEnumerator but will not throw any exception...
Definition: Directory.hpp:373
static void Move(const String &sourcePath, const String &destinationPath, bool overwrite=false)
Moves a directory and its content to a new location. After successful operation, the synchronization ...
static void Delete(const String &path)
Deletes a directory. After successful operation, the synchronization of the file system will be force...
static IEnumerator< String >::Ptr GetEnumerator(const String &path, bool recursive=false)
Returns an enumerator listing the content of a directory.
Definition: Directory.hpp:323
static const SelfType Empty
An emtpy static string instance.
Definition: BasicString.hxx:212
Enumerator type, handled by Rsc with IRscReadEnumerator and IRscWriteEnumerator
static void SyncAll(void)
Force global file system synchronization.
Root namespace for the PLCnext API
static void Create(const String &path)
Creates a new directory. After successful operation, the synchronization of the file system will be f...
static void Clear(const String &path)
Deletes the complete content of a directory. After successful operation, the synchronization of the f...
static bool Exists(const String &path)
Checks if a specific directory exists.
static String GetCurrent(void)
Returns the fully qualified path of the current directory.
System components used by the System, Device, Plc or Io domains.
static IEnumerator< String >::Ptr TryGetEnumerator(const String &path, bool recursive=false)
Like Arp::System::Commons::Io::Directory::GetEnumerator but will not throw any exception.
Definition: Directory.hpp:353
static void Sync(const String &path)
Force file system synchronization for the given file.
API for manipulation and examiniation of directories of a file system.
Definition: Directory.hpp:15
static void Copy(const String &sourcePath, const String &destinationPath, bool clear=false)
Copies a directory and its content to a new location. After successful operation, the synchronization...
ARP_DEPRECATED("Please use Directory::Move() instead of Directory::Rename().") static void Rename(const String &sourcePath