]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/OS/FileSystem.h
yet another refactoring
[cpPlugins.git] / lib / cpPlugins / OS / FileSystem.h
diff --git a/lib/cpPlugins/OS/FileSystem.h b/lib/cpPlugins/OS/FileSystem.h
new file mode 100644 (file)
index 0000000..26d5ad4
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef __cpPlugins__OS__FileSystem__h__
+#define __cpPlugins__OS__FileSystem__h__
+
+#include <cpPlugins/Config.h>
+#include <set>
+
+namespace cpPlugins
+{
+  namespace OS
+  {
+    /**
+     */
+    class cpPlugins_EXPORT FileSystem
+    {
+    public:
+      typedef FileSystem Self;
+
+    public:
+      /**
+       */
+      static std::string CanonicalPath( const std::string& path );
+
+      /**
+       */
+      static std::pair< std::string, std::string > SplitPath(
+        const std::string& path
+        );
+
+      /**
+       */
+      static std::set< std::string > LoadDirContents(
+        const std::string& path, bool recursive = false,
+        const std::string& pattern = ""
+        );
+
+      /**
+       */
+      static int GlobMatch( const char* target, const char* pattern );
+
+      /**
+       */
+      static bool Glob( const std::string& line, const std::string& pattern );
+
+      /**
+       */
+      static bool Read( std::string& buffer, const std::string& fname );
+
+      /**
+       */
+      static bool Write( const std::string& buffer, const std::string& fname );
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#endif // __cpPlugins__OS__FileSystem__h__
+
+// eof - $RCSfile$