OSDN Git Service

file/path.hpp Add.
authorMyun2 <myun2@nwhite.info>
Sun, 4 Sep 2011 17:30:46 +0000 (02:30 +0900)
committerMyun2 <myun2@nwhite.info>
Sun, 4 Sep 2011 17:30:46 +0000 (02:30 +0900)
roast/include/roast/file/path.hpp [new file with mode: 0644]

diff --git a/roast/include/roast/file/path.hpp b/roast/include/roast/file/path.hpp
new file mode 100644 (file)
index 0000000..9e0afd7
--- /dev/null
@@ -0,0 +1,44 @@
+//     Roast+ License
+/*
+*/
+#ifndef __SFJP_ROAST__file__path_HPP__
+#define __SFJP_ROAST__file__path_HPP__
+
+#include <string>
+
+namespace roast
+{
+       //      dirpath
+       class dirpath
+       {
+       private:
+               ::std::string m_path;
+       public:
+               dirpath(const char* str) : m_path(str){}
+               dirpath(const ::std::string& str) : m_path(str){}
+
+               //      Get/Set
+               const char* get() const { return m_path.c_str(); }
+               const ::std::string& get_str() const { return m_path; }
+               const char* get_cstr() const { return m_path.c_str(); }
+
+               void set(const char* str){ m_path = str; }
+               void set(const ::std::string ){ m_path = str; }
+
+               //      Cast Operator
+               operator (const char*) const { return m_path.c_str(); }
+               operator (const ::std::string&) const { return m_path; }
+       };
+
+       //      filepath
+       class filepath
+       {
+       private:
+               ::std::string m_path;
+       public:
+               filepath(const char* str) : m_path(str){}
+               filepath(const ::std::string& str) : m_path(str){}
+       };
+}
+
+#endif//__SFJP_ROAST__file__path_HPP__