8 #include "Arp/System/Core/IEnumerator.hxx" 9 #include <boost/regex.hpp> 11 namespace Arp {
namespace System {
namespace Commons {
namespace Io
72 static void Copy(
const String& sourcePath,
const String& destinationPath,
bool clear =
false);
82 static void Move(
const String& sourcePath,
const String& destinationPath,
bool overwrite =
false);
92 ARP_DEPRECATED(
"Please use Directory::Move() instead of Directory::Rename().")
93 static void Rename(
const String& sourcePath,
const String& destinationPath);
207 static IEnumerator<String>::Ptr TryGetSearchEnumerator(
const String& path,
const char* searchPattern,
bool recursive,
bool files,
bool directories);
210 template<
class Iterator>
219 bool MoveNext(
void)
override;
223 Iterator boostIterator;
230 template<
class Iterator>
231 class SearchEnumerator :
public IEnumerator<String>
236 SearchEnumerator(
const String& path,
const String& searchPattern,
bool files,
bool directories,
bool& error);
239 bool MoveNext(
void)
override;
243 static String NormalizeSearchPattern(
const String& searchPattern);
246 boost::regex searchRegex;
247 Iterator boostIterator;
259 EmptyEnumerator() =
default;
262 bool MoveNext(
void)
override 283 return Directory::GetSearchEnumerator(path, searchPattern, recursive,
true,
true);
293 return Directory::GetSearchEnumerator(path, searchPattern, recursive,
true,
false);
303 return Directory::GetSearchEnumerator(path, searchPattern, recursive,
false,
true);
313 return Directory::TryGetSearchEnumerator(path, searchPattern, recursive,
true,
true);
323 return Directory::TryGetSearchEnumerator(path, searchPattern, recursive,
true,
false);
333 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:296
Directory & operator=(const Directory &arg)=delete
Assignment operator.
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:286
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:316
~Directory(void)=delete
Destructs this instance and frees all resources.
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:326
static void Move(const String &sourcePath, const String &destinationPath, bool overwrite=false)
Moves a directory and its content to a new location.
static void Delete(const String &path)
Deletes a directory.
static IEnumerator< String >::Ptr GetEnumerator(const String &path, bool recursive=false)
Returns an enumerator listing the content of a directory.
Definition: Directory.hpp:276
static const SelfType Empty
An emtpy static string instance.
Definition: BasicString.hxx:222
Directory(void)=delete
Constructs an Directory instance.
Enumerator type, handled by Rsc with IRscReadEnumerator and IRscWriteEnumerator
Root namespace for the PLCnext API
static void Create(const String &path)
Creates a new directory.
static void Clear(const String &path)
Deletes the complete content of a directory.
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:306
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.
ARP_DEPRECATED("Please use Directory::Move() instead of Directory::Rename().") static void Rename(const String &sourcePath