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 clear =
false);
205 static IEnumerator<String>::Ptr TryGetSearchEnumerator(
const String& path,
const char* searchPattern,
bool recursive,
bool files,
bool directories);
208 template<
class Iterator>
217 bool MoveNext(
void)
override;
221 Iterator boostIterator;
228 template<
class Iterator>
229 class SearchEnumerator :
public IEnumerator<String>
234 SearchEnumerator(
const String& path,
const String& searchPattern,
bool files,
bool directories,
bool& error);
237 bool MoveNext(
void)
override;
241 static String NormalizeSearchPattern(
const String& searchPattern);
244 boost::regex searchRegex;
245 Iterator boostIterator;
257 EmptyEnumerator() =
default;
260 bool MoveNext(
void)
override 266 return String::Empty;
281 return Directory::GetSearchEnumerator(path, searchPattern, recursive,
true,
true);
291 return Directory::GetSearchEnumerator(path, searchPattern, recursive,
true,
false);
301 return Directory::GetSearchEnumerator(path, searchPattern, recursive,
false,
true);
311 return Directory::TryGetSearchEnumerator(path, searchPattern, recursive,
true,
true);
321 return Directory::TryGetSearchEnumerator(path, searchPattern, recursive,
true,
false);
331 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:294
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:284
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:314
~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:324
static void Move(const String &sourcePath, const String &destinationPath, bool clear=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:274
Directory(void)=delete
Constructs an Directory instance.
Enumerator type, handled by Rsc with IRscReadEnumerator and IRscWriteEnumerator
Root namespace for the PLCnext API
static void Rename(const String &sourcePath, const String &destinationPath)
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:304
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.